From patchwork Tue Apr 1 09:06:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 877478 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp2150336wrs; Tue, 1 Apr 2025 02:11:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdgIxAlZOJcqzassaJP5F9uxqd2HDdGN5urjahQf8BZoITwnUJf2klcrQG6JUhZ1XexDB0EQ==@linaro.org X-Google-Smtp-Source: AGHT+IFaP65wEH3vtGwsQl4mcl5wBwM26ZPV0FN4C+E1KlAGLzEhe/X1KNfHY/JOzfFC8pGngqf6 X-Received: by 2002:a05:6214:1d0a:b0:6e8:ec85:831c with SMTP id 6a1803df08f44-6eed6276269mr182408806d6.35.1743498677596; Tue, 01 Apr 2025 02:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743498677; cv=none; d=google.com; s=arc-20240605; b=EnSSUeBH2YHqsQrzLZ6R4q661HchhZ7Bj9npXlz1VuFLF9oBmDDWbsAevFKl83rWK8 OpH6R5ad1uRWjXZUNMy29lurDjrwvBFLkWw2sx6r+gKqslVZpXGwJil8n5xvLDxdgGmY x4VZiSSdYw5BeAc/AKI3jXxkYE5Bn+MN6LmPnCn8E5XW3Q+Ria1WKpfVSwFWs4rIQEcT 3BMIEVAF7EpbroX1okDArBCJfoTRCZuoF0s+LwN35YQ/6/cDYod9fo3CxH/xrjAJKKrz LU/fyyA8yJALLF45+KCvbG742DM40miV8zVo7qShJJkCWnNOOgAEbIVLruEE/zg8jGfL Cwuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=ModoBwl9WODpWJ7/22XSJxgnbrp5F28A+dseEzQypeA=; fh=CUpCZKNKe/PWOtYP6Vb8fhNvkjFJcwl3BPpoRMy6q/4=; b=aXicN/gQMyAG52UO+ThhUGAGiUcQVhyqzQ3QMrryaWaQ0v9lUFxXFb5FLwUxJBOZMS K1D7haY5KnEM2UtGoOmwtamAjf7mdiHRR1/KVaoyUULBBIt4SrX1FP2LuE1VtOEzV637 bC8YcwNc6N0cxfiBvr028UmlbksLevPyHj9K7p5+NbYE/YrO58PKeuSwYyhhnEK5HVpk xMaA90/cpdU8RzDk085WpDW8zZ55tzTsNh2jXJS/7p66W+SyK0Xxp9ma9ayNtvboCggd VpPH+3C2WFAWZnynixUJLEGWTheKWEV7OSec1ExUSyjsXZSXhYwT35Z+a6mewVveVrHm lexw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f+Fvc3EX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6eec962d440si87563726d6.79.2025.04.01.02.11.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Apr 2025 02:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f+Fvc3EX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzXb3-0005BH-1R; Tue, 01 Apr 2025 05:07:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tzXZW-0004bq-98 for qemu-devel@nongnu.org; Tue, 01 Apr 2025 05:06:15 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tzXZT-0005Xp-7Q for qemu-devel@nongnu.org; Tue, 01 Apr 2025 05:06:14 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43d04dc73b7so59105545e9.3 for ; Tue, 01 Apr 2025 02:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743498369; x=1744103169; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ModoBwl9WODpWJ7/22XSJxgnbrp5F28A+dseEzQypeA=; b=f+Fvc3EXrLImyHFBsAR3/Hy8HIoIqaDZfjGyyFGTBGkuoc2LLnjJw/ugNpRWyCJ5uM xRhSdZDFN2emqzbRJonoIJ/VnUV+Kkx10oyTfCiqqp2nzxyo9VMbOGWZgWoXy9qSxcVY 1XrXGZIgA7La17hpaRfqsiajYTavuYdUXwB5T/dyzGQagWSP/DdHBr7abBS/Iue8YJEv nBsJHcNG7pMj2zhnmZh5NSwJ/xkkDDj5u6/X4ZXCpnWC4E37zC2wlh72vXFWC8gKE0ta svE8M0tvDAXKpYPaqGG3wrWFkn0zlAymfBjhb6QHeSFJtiRBvWt1Al7Ye57MOkBqzjP9 mSsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743498369; x=1744103169; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ModoBwl9WODpWJ7/22XSJxgnbrp5F28A+dseEzQypeA=; b=lOQOEgirWWCe/avqPqIAPPwGSFF5U3Ll/2YoOQPn9JqqZTcNtrHB9CruQtLH1/EwGp yRnPda9t9xKBNehSvNTLnOYQZ7bXWZk0wtGTRiifGJWgtvb1VWx8rubmN7Zccbv3SOkV +JslRcllSCnV6E9tCeranoMRtO16dbLwIx9ZNJQGDUHZ0OYSdrWCcoCBDzlEZqp4ANMg SJqIx7klWAl1YVgApaoqZDXjqCMMjwoEPDgr/+HjfMBPc52XQL24zaANmp8asrVn4sOC eWe1sW/UOzITKyDTYRCvc0ZcF+2tzbAr2POeZ7taHRSZiO3Z2jBkgN7ua+WXHoPmi1V4 E9Ww== X-Gm-Message-State: AOJu0YyqiDgok36Y0dZigRfahbfxVMTNafLnRXtRkXDppnLMOkIxKvVA adYUW0Q+u/IK+nygwgiPttCFYzeSgHkqQqiz9k6LiUR0R43h4dqCVnohGGnTMVll2AnGbMgEl71 q X-Gm-Gg: ASbGnctZmuXvopzZ3h8j7+mme8HuKdbFgHPzflE7LrBEQuikHm66sw0ng5KxM+oUBnz T2n5Jl9zPhAQjrQzVQRoSb4SG+WjFDADFvD/a/QRcY9bP0A04kjhdNz44PpQQziFglhugnJqXjO tD5XFbXuU+Or2y3wnPo6LIlHRQMLhw7zwo9fxrHqcKxxNAh+avpqLkWZuB4gIyfm6nUnChATbBn g2SWqgC0tMfIoF0ZYns3FqnlpMt70z1hSefHVQJxEbNvY0wppcCKaYQnwu/U6JO9v6+TrhL8pVZ 6kqqyAgkI7yyxvCVdd3DWvAy65w4MIjPfA62RQ/HlOPHfAxBysSUItHyTIU+ukzjAr7r1Cyeuok AeZkqWR9yMRshmJwAUcI= X-Received: by 2002:a5d:6d84:0:b0:39b:fa24:9519 with SMTP id ffacd0b85a97d-39c12117ddemr8727460f8f.35.1743498369011; Tue, 01 Apr 2025 02:06:09 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d830f5b41sm198104025e9.27.2025.04.01.02.06.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 01 Apr 2025 02:06:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Fabiano Rosas , Laurent Vivier , Alexander Graf , Paolo Bonzini , Phil Dennis-Jordan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-10.0] hw/vmapple: Allow running QTest framework on macOS Date: Tue, 1 Apr 2025 11:06:07 +0200 Message-ID: <20250401090607.36375-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Acked-by: Fabiano Rosas --- 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;