From patchwork Tue Dec 3 09:42:32 2024 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: 846946 Delivered-To: patch@linaro.org Received: by 2002:a5d:44cd:0:b0:385:e875:8a9e with SMTP id z13csp381977wrr; Tue, 3 Dec 2024 01:43:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUh2OJ0wbgbHfQVMSLUAY2AmJ/dOMHEZwSzogwr2FrDj76GwiwLizWB8pV0P/JlPa8H6MIj3w==@linaro.org X-Google-Smtp-Source: AGHT+IEW+Uxof8b8kGpSKocO2mL3NzWhEUlISGi4MlaF1e0UR4DozmdgD3UNHaap6VqHJO9yWbR5 X-Received: by 2002:a05:620a:4888:b0:7b1:7508:9f38 with SMTP id af79cd13be357-7b6839f9681mr3878757885a.16.1733218990157; Tue, 03 Dec 2024 01:43:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733218990; cv=none; d=google.com; s=arc-20240605; b=QsvV8WnF9g39Hxpr4Lndmu41DqgzsFgvR0W3HEegPGg4uw2Z4s8asqKi22FGw9TxRd WtUPnQzfiXdnv6kAPJKuXYxV2p/dw2JUENSMnbmF195rCh2JP9QEMM6+1Yjo7RE9toWU sEr5RyvQWNS1+yIrNrBoPc/oqu0A6R0uuoxaTpTtmTy3Fi4qM4amdxY0LprWcQ+zlUEe sJi9XowiBv1v7cHZeJ2a16gKUJ2teh3MKy1PK7N8Fo2BNcVYifINk8RFnRLRfo3zYI9q CtipY1HkOR2tqE+l6WRQ+L9d13mIMUq+ACEt3LLPUiUNJ7fQs97lI4UHDNzWRqPwZITS cwWw== 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=5s5PWLTfQVptCG3HIJElGI4YVuaTaoJWIlnXWhqF62c=; fh=7lLVRn/eYlJiXt6XYhWCFiBQhYr6fROeGWDdb3B6t6E=; b=O2v0AV7vKob2aNmRgaaQTnsD6y71C2S92G/RJmpbwqwIdMM74WOvsDMW6EqUpLJwBJ XD4SRWvoOhsHiqzMLg2yA/blHAAT7TUbSuulcFDOFBKHZLswH7pAVwBqj6RUx+KN/oyc L1SohigPuu+3+3/Y1j1aXM2FIiq4416SQLm2Twv1gkxkLZ1dMmpPQX1n8bOXqd8kwF1h LN7HwVmqNBx1QmGcKKqWxaM+uUH+KYLzX/1Yu3KzGrMwGWk7YvxEILe6yiAb2yv7SfwV BOsb0fpokK2YgKfPfR9AyCVCi+omyb97WYZONePSAIWIH4BUi2HOXihacURLtAnvChUU X7Fw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b7pK5sVY; 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 af79cd13be357-7b6849b3b35si1434766085a.324.2024.12.03.01.43.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Dec 2024 01:43:10 -0800 (PST) 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=b7pK5sVY; 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 1tIPQY-0001kI-0i; Tue, 03 Dec 2024 04:42:42 -0500 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 1tIPQV-0001jm-NI for qemu-devel@nongnu.org; Tue, 03 Dec 2024 04:42:39 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIPQT-00052c-QV for qemu-devel@nongnu.org; Tue, 03 Dec 2024 04:42:39 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-434b3e32e9dso45190855e9.2 for ; Tue, 03 Dec 2024 01:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733218955; x=1733823755; 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=5s5PWLTfQVptCG3HIJElGI4YVuaTaoJWIlnXWhqF62c=; b=b7pK5sVY6iUkJTPO/sLN5ddDJnI4h+xXEQVd2fp0GKDkpGsPsj24oF61JJAeKcv+H2 Fdi3VSgRgH2dfbucvknsnOgZVE9GMRBI0uDZIpgIGNmg34HHsbz+tXIwRwuV/pamCUz8 uLeJbT5CvxQsE4ufAwSJp+8m5v3f0ByApkL0ILMXFwoK82GwBPr8pH43WOnlyT05yllH TGqVLCq+UIVeB4ddg21Og+34RPyp+X6G3rwafBjymzTOzRzIMI+Y+NKcg4KPZAJazzu2 yCBrp5DAhwafuKfVLZAuYEi/yr3ucyDytRiOPadHPtBvg3uu2V236npNsNMnCYc2O4G0 o/qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733218955; x=1733823755; 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=5s5PWLTfQVptCG3HIJElGI4YVuaTaoJWIlnXWhqF62c=; b=YSMWowdw00Hi31xcjZvM227eEo5MlScB2vHewY8mXcqYuAlpKeckGaLsE775gsQ0cB ngMruuY1Z2YYkf9tBaVjpjDmO6Gc1L2zyad5dA8xYHL5QkQ4Uzv5i5vZTH8GeM8tyU+p DPLLMyo6lQo8jjbHpCEBtO6K6C+rQMVhRiKgHyHKnswVToKnUqg5Jc/RCA4AfXnEyhmU xXwGj4OW5w4G1H4rdGV6s3kG2MtSmdB9bpwGLRxDrJD9KcRY30poH/l0MH8B8ojK6dSn uqggtG8LMYGwqgDEUEeOBX/WJAGHuadBEcUyKy+0Pktljk26OadgN7ICzOGinq2lOnkv 1+Aw== X-Gm-Message-State: AOJu0Yyb/0PEs2TFrqhXusyDBqSuRyEyxundYq9uSABVp3lfnRh4Z59p DqFEE9XhAJWAFG7HXIcRMiYvdp6ezoieIpFUTZ6u00BRQTabED/kOCFKi0SsVVkKU/PY3aAapXZ SQos= X-Gm-Gg: ASbGncs1bGv/OPx8pVmFLCob3TaU6rvZ5WgwScTVx7Qq8p26/0cBUt6bRKVMyUCjnd3 23gkMYxo0ogm+ZTDnTCRJNViHJ+WMh5N4MoQDbAIfozE6zvfqvvd8vKuEPfx5IkuJ0XrU7lN4B6 QASmCiGXi+7ZieGJUiXEkmh49z8fR+zFJGcaFQQlkStCFaSjHJenGswO4wdbGAp7rTbagsDq9Go FUxcroStyV3FOup4KCNYjYCsnQaNhG540ae+dAuVyWP8G/Ag5R4/N6AjRjk7EZZ9AdpXlJ+ X-Received: by 2002:a05:600c:3ba0:b0:434:a160:3682 with SMTP id 5b1f17b1804b1-434d09c36d4mr17543485e9.17.1733218955385; Tue, 03 Dec 2024 01:42:35 -0800 (PST) Received: from localhost.localdomain ([176.187.209.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434b0f70cbfsm187271615e9.36.2024.12.03.01.42.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Dec 2024 01:42:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Thomas Huth , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3] system: Select HVF by default when no other accelerator is available Date: Tue, 3 Dec 2024 10:42:32 +0100 Message-ID: <20241203094232.62232-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 When testing with a HVF-only binary, we get: 3/12 qemu:func-quick+func-aarch64 / func-aarch64-version ERROR 0.29s exit status 1 stderr: Traceback (most recent call last): File "tests/functional/test_version.py", line 22, in test_qmp_human_info_version self.vm.launch() File "machine/machine.py", line 461, in launch raise VMLaunchFailure( qemu.machine.machine.VMLaunchFailure: ConnectError: Failed to establish session: EOFError Exit code: 1 Command: build/qemu-system-aarch64 -display none -vga none -chardev socket,id=mon,fd=5 -mon chardev=mon,mode=control -machine none -nodefaults Output: qemu-system-aarch64: No accelerator selected and no default accelerator available Fix by checking for HVF in configure_accelerators() and using it by default when no other accelerator is available. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- v2 was https://lore.kernel.org/qemu-devel/20241203091036.59898-1-philmd@linaro.org/ --- system/vl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/vl.c b/system/vl.c index 54998fdbc7e..2f855d83fbb 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2362,6 +2362,7 @@ static void configure_accelerators(const char *progname) /* Select the default accelerator */ bool have_tcg = accel_find("tcg"); bool have_kvm = accel_find("kvm"); + bool have_hvf = accel_find("hvf"); if (have_tcg && have_kvm) { if (g_str_has_suffix(progname, "kvm")) { @@ -2374,6 +2375,8 @@ static void configure_accelerators(const char *progname) accelerators = "kvm"; } else if (have_tcg) { accelerators = "tcg"; + } else if (have_hvf) { + accelerators = "hvf"; } else { error_report("No accelerator selected and" " no default accelerator available");