From patchwork Fri Jan 3 15:05:58 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: 854866 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp8290789wrq; Fri, 3 Jan 2025 07:07:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVMLgZ/wHoDSrUQWTEbpTL7PNjWC7dQPD1tfFu8wj+iP0ZTrG/08l8NcwbenhOC4gSu3/OhmQ==@linaro.org X-Google-Smtp-Source: AGHT+IFiks/TGGE2r5JRtqDlZRUEP4kS2k70Hq2t6fUPNHZN8B/WpOGUPefxFQEwcAaeOsRCFMuU X-Received: by 2002:a05:6000:4a14:b0:385:f1f2:13f1 with SMTP id ffacd0b85a97d-38a221f16camr43711699f8f.22.1735916827813; Fri, 03 Jan 2025 07:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735916827; cv=none; d=google.com; s=arc-20240605; b=Uyqde5Y5Q2Ixxr5C49sJhQcsMA+MF78SliFEa4VXqiDg6xzTpbR4ZqcTRfY1gjzG8z XCuoUUGNb9xK4DOVKT/oqPJrQE+k35JvO2LxOcGCVKaNEAjtw09NXC6QfePleRN1xKBp 4Du/JX8NkasiGuC+TVOQJh60BYCDYcS+uNjRCL2jJhielVSzpYyLVEHab7EZWkgjUJkw Kbsi1v9E87OE2lKOFuLfAr8zo4sNPqaQ3UA9qlVLaspnTYlOV1X1jrQwcHIBfXHyKY9f /pfe+TVzXUBEW3rsAc8/3XcI1w7HNxL7J7/1QsZcS56I6xdAhGvUHcDQTk3yJHooPvdp gMgw== 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=vWyUslIfzchH/Qqlm6hFSoY1eYQiE88dMF3dsmhROmc=; fh=ghZB4CPdfqwrlWOaybnyDuG8Qk1car7GwOSM7RPujFE=; b=f7dkHXiCuGbQgqiF+S9+scSx7m1qYTHtu6gfY7/k92xld9dw/dvePX12BIFi0S15bc X+qBVV96KOaVHycoqqGjbxUoYH2w4y058LeLZLp9dsHADzEKaDXsfCiMzX6E2693Ylxw 4Ntxcw5RGlRt7y+WUJ1V6nvcuuZKOGiO/1+WXWMN+LVr/68WdtOMkbGbSwKH7eMbHnOP OVEJrJrbSBO9gBKy097AA7QKGi0CqSE0a3VCLmeA+YpjuEPbW8SSVdv5YwuMB0JdHv1b E9RGuFTqq8OumftjK/KUgd31C6TOVF2kgROwIFALY2ZvIG/POW2+4rTuRnf4XRNYrPfb euDQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sRmiIV0o; 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 ffacd0b85a97d-38a1c8330fesi2806064f8f.202.2025.01.03.07.07.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jan 2025 07:07:07 -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=sRmiIV0o; 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 1tTjFZ-0008Ib-PL; Fri, 03 Jan 2025 10:06:09 -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 1tTjFW-0008IJ-Vp for qemu-devel@nongnu.org; Fri, 03 Jan 2025 10:06:07 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTjFU-0005xQ-UE for qemu-devel@nongnu.org; Fri, 03 Jan 2025 10:06:06 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso84396395e9.3 for ; Fri, 03 Jan 2025 07:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735916762; x=1736521562; 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=vWyUslIfzchH/Qqlm6hFSoY1eYQiE88dMF3dsmhROmc=; b=sRmiIV0onMVlrMOoi1WugPFa811o65wuPC0UMS+QZ1ypWkT51NZoPHGi3nc9bfk9MM 8wmIvQRdJi+2Ydtr0W24D7M8A7Ul0QSpA6C4GhBSYNcLRyiWRkrWbaLICn82o6bbAnEj EA4+ttnpr0JybGhAYNw2u/9PJ7f0aBfmb9LfrbBtJ0491gr/gSoJX/ylrwSf6a0IToJ3 1VVlNIIlZM+3Ih3s+6MzbK6H7JJE0tc6NpdTsQi1fAC7kcAaoWd6l91Q5ZxSfMC6BjE2 S0Di//coIwNGseGcO47JXP9EKlN0hXg5Z41o0pR43hKSKeQkansnxniUwY30szzaKnpo 6gbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735916762; x=1736521562; 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=vWyUslIfzchH/Qqlm6hFSoY1eYQiE88dMF3dsmhROmc=; b=WwGP98baYeIFioDvibcOZCCtRouYn00KPQiPFh1cq0+r+RbWqoPiT5PspxPMpPJ1tN Sk5PlyDtSJS0kBD1ziYncYi4TR4d4kb/2e/zGkec+TqxBdeOtzqEdx9Ru/HzhRQ4Hzod D1ZnxE1S2d+WCNmfhwVueTJ7wn5FbUU8vVzgrNbcYUspyvbOmZNJILCV3HGRgQCT9B3G Luvav+x1N3Nx2U7oQXkastuaFujc+/XZcOANRaqNHKxLokyATq1s8l+Ov5C/4KlGjPAZ mlme2zkcu594vmzwtyOJU26xcX1O43EuAxosAfJNmxOe/CPp0OSwhBM6t3Ipxk/VtVj3 Hp4A== X-Gm-Message-State: AOJu0Yz6u3eQ3dfkloNohHCi/KeToBJw0AP+2QhbCl9eL946RDUgzVen LQHtuYHwNHzWNeCS3sZXvBuTpPNrUgRYYh12ZpqttLg3vziQbwFQKASrl/vPT9J7VlDDcC7vEux cccc= X-Gm-Gg: ASbGnctCFGpCkWDVVgEg0w2pI05v2vB2vZA3ZSQB12JuXRqIDaVjA4rd2za/AVGnNT5 He5afbnGHeKbzjPXXYvwyKOleSgmjidHri6W84NRPwU+yWtEqdFCfIgFVV3LG8a00etXAUirdtV BwO6tmZikL34H35733W3fggb4vtza42qF8w2a3my/D+s1gibPlz3k67nkYQKDsTMEzhUvcZ1UXm hbqpQqSqwb/jex4mH56GB7wvdOWkrtHQotFC0Qy5ymy9wQexlmHxQlw5tMMq6NTg0uPbNujrFR/ BedR9iUW4K880vNamC0IrH1Hz2QRfb8= X-Received: by 2002:a05:600c:4f86:b0:434:a802:e99a with SMTP id 5b1f17b1804b1-436685484bamr422640835e9.4.1735916760732; Fri, 03 Jan 2025 07:06:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436612899f0sm485988345e9.38.2025.01.03.07.05.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Jan 2025 07:06:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Daniel Henrique Barboza , Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= Subject: [PATCH] system: Try hardware accelerators (KVM, HVF) before software one (TCG) Date: Fri, 3 Jan 2025 16:05:58 +0100 Message-ID: <20250103150558.1473-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 As Daniel suggested [*]: > We should consider to rank HVF above TCG, on the basis > that HW acceleration is faster and should provide a > host<->guest security boundary that we don't claim for TCG [*] https://lore.kernel.org/qemu-devel/Z07YASl2Pd3CPtjE@redhat.com/ Suggested-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Richard Henderson --- system/vl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/vl.c b/system/vl.c index 0843b7ab49b..e20391281f8 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2379,7 +2379,6 @@ 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")) { @@ -2390,10 +2389,10 @@ static void configure_accelerators(const char *progname) } } else if (have_kvm) { accelerators = "kvm"; + } else if (accel_find("hvf")) { + accelerators = "hvf"; } else if (have_tcg) { accelerators = "tcg"; - } else if (have_hvf) { - accelerators = "hvf"; } else { error_report("No accelerator selected and" " no default accelerator available");