From nobody Mon Nov 23 04:26:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1794981839; cv=none; d=zohomail.com; s=zohoarc; b=go9G4hpWUSRsYTKRCN1WaMFBbKd6p1X84tEC5CWvDnGoZKHPS61FbBb1SeN/TXBl6DDkHZCfLGSzpIFCSzGurSdgcHeYDuJrSJl+huTmCsrh1JHHmbyvpZpZ/AkLSyvEdmJnpXdXKzqyZNecd2WB5TYV8zU0en70iXlcX8eM7aE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794981839; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tf6wJHVIyABPZMoaRTm7XpuEasULHVflGlQUyCPmJjc=; b=TfCg3bIg0nRlbqJOhvAtetJTRTizKgEZbrBH29QvjMuVtho5YhIYDRenpSh717MusWbkrr3cQkuglM7ONJNHG+FCw1TC/mIkYkI8PTFSYgvsmuwQS7k4ldqkvw0zStAuOEvBJe4l1xK/7LyPZm+bMCK9H9bPNeaRA/qJBp6J8UI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794981839752296.07356707646704; Tue, 17 Nov 2026 22:03:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xTYlR-0005C1-KS; Wed, 18 Nov 2026 01:03:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTYlH-0005BM-5P for qemu-devel@nongnu.org; Wed, 18 Nov 2026 01:03:15 -0500 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xTYlF-0003ir-EJ for qemu-devel@nongnu.org; Wed, 18 Nov 2026 01:03:14 -0500 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-483a66818edso377831fac.0 for ; Tue, 17 Nov 2026 22:03:13 -0800 (PST) Received: from [127.0.1.1] ([2605:ad80:33:509c:ff29:6c8b:a81b:ce71]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4b74372cb6bsm1358721fac.4.2026.11.17.22.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 22:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794981792; x=1795586592; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tf6wJHVIyABPZMoaRTm7XpuEasULHVflGlQUyCPmJjc=; b=u8e07hv2sEarV1CwgtoYLt2MVFSxhFvhNWTbYGhaeCysNg2TRXTXI6y6f0nUdk1Gl1 lItevWEksLMqoLbH0a1zSenjUKqi24PtjGw5ew7wLn2h5r0yHeMx+LkzzFRQNXa1mypI p5jLvzBjMFaa5pL4PY7hKq8KVsU5GOKTxyl8t19gbavLzfIcCy5Ki5kC7wsBOAVqX+Gr hXoBL5KMuaZnDLnVCkWL66HTwz4HrjFVJlPSmoEOZfJvSqTFeKRcEVpHpn0voWUFJjzz paOEti6nmOOj3+V42vru3dVpDY+CSzMUyDbNoQ8rwGDaCKXfhRCyaiGUNdcjGvrZwJ3W M5tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794981792; x=1795586592; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tf6wJHVIyABPZMoaRTm7XpuEasULHVflGlQUyCPmJjc=; b=f4xUHV40XGQKEhBU/Wi1iPDZvC0a23vV8HjQ61Hjw+Q+A4e1yH2J8obp/MJvJfyGQF HLMeuAvfzm7h5Zlq6fyZNk5/i4E8ZvrOCe4GxND3gvVAITSAS5jl25bs10kQHk0GntIT DZlmYuCOK1KSwv2E6Jw49jxGoYLvBI2xc+NTy4YgoQU5x5z5CV95bvQdxGV9ZLSa/eX5 fh9n6iSF3pykPMWEqa1T65+2Hmj0w3AFTE+98r+7Xt2ISNwOE5g4lm4PUP+fQVD2ucFh GPf3irkyAuO3cnu7ueCh6I3o7isVTsMyOIuwIVsfTatpM27G25JxzfLP4f0ynKmnCOeS BP5g== X-Gm-Message-State: APuU4Z/88S2EvHEmrhaVBKw+tHX9t2EQ5tZu6Ci+QWzPlNH0uzQiibMV 7yfQlHgYeqABLbJl3ZKZlmgV3kSca7AONbH0uYsS4LiJ4ZsNMCffGKIF X-Gm-Gg: AYBFou3JjVwwuMRFvGAoKGZftZNlm9htOSiyfVpDOaYdLKSWwUJ6AsFFANXD5At9QF7 B1rHwT1VewvieMTWV4TjOKvfS/akYFRP1Gfcri0LBOi9Ld0cw9Q0ZE+xT29w2BpMHwWFNdbKL2l 43z/QlRencRfFlwc7SQUoqzlyi9bcBtbMLOmn4hFYxyXPaVCqyt4yf8HEldPxia7EMcJLk7vfqK bM911aLqi1t2OXGBLsevlNOlIG3qcmzEDVIpU4D9l3Y3CuHAjy9Pr5XyDmPaHqO6utAIzZGlNqd wWYnJ8Vj1tv7A6ROBXEWhyaRtUg5PyyNzaxwTZJ3Mh7E2m+Hq0SMDqScwfh7Aecmm548hJ1XDzd AHawrfC7zN+FnY7bnAubbEtcH7qUH9KxE7JXEgTAQEty+swB3d+Ro4Ltnmy5AS0fK393BaWTwhG 41W6+MRL3XHtFzODblxGfiFBwWNEity6Y5r0km3EQi3Dg3relOxLBTL/asBF7awmKyyTXOYwPiW vHylMTnJuL08PxQ+XsWbsS4UKqWwcfFjeXClNvVmvES9L+TpHbIXtNgKU5zeRdO3MtzuF1ReAMK tg3AFn0NdtehqHxRrrAShRKk04Pf6/4CBeCgxkL7rMJQMdk= X-Received: by 2002:a05:6870:d188:b0:4ad:827b:dcf5 with SMTP id 586e51a60fabf-4b75da54b25mr1373378fac.10.1794981792076; Tue, 17 Nov 2026 22:03:12 -0800 (PST) From: Andrew Nguyen Date: Wed, 18 Nov 2026 00:02:52 -0600 Subject: [PATCH v2 1/2] target/i386: make error message for -cpu host more informative MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261118-4836-cpu-host-error-v2-1-ba02bb640d9d@gmail.com> References: <20261118-4836-cpu-host-error-v2-0-ba02bb640d9d@gmail.com> In-Reply-To: <20261118-4836-cpu-host-error-v2-0-ba02bb640d9d@gmail.com> To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Zhao Liu , Peter Maydell , Andrew Nguyen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794981788; l=898; i=xmphyr@gmail.com; s=20261115; h=from:subject:message-id; bh=retLpvaxak7EvfhoaIt+z23+rFg2vACv2e+tGvhXBFI=; b=i1cel7YrNFJIp03UZB+LDfZA0hXDnYl7OkYcB2/4vKKJW32cLQ4abXDoT7oyuUOEx4JkDL572 SWCJNAXzgZ+BK4Rw5/pHUWetD4lsmA9ZrJGMHDbJ1tEivcICrVT+PlR X-Developer-Key: i=xmphyr@gmail.com; a=ed25519; pk=NNmtCKBlfBcUb+tQiMXr0u4Z3W1r0gSDovSDVTzPWXE= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=xmphyr@gmail.com; helo=mail-oa1-x2e.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, FREEMAIL_FROM=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1794981841705158500 Included the mention of WHPX when the option -cpu host doesn't have an accelerator option. Signed-off-by: Andrew Nguyen Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4836 --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index eab0d5a4d4..7dd5535f80 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10229,7 +10229,8 @@ static void x86_cpu_realizefn(DeviceState *dev, Err= or **errp) =20 if (xcc->host_cpuid_required && !accel_uses_host_cpuid()) { g_autofree char *name =3D x86_cpu_class_get_model_name(xcc); - error_setg(&local_err, "CPU model '%s' requires KVM or HVF", name); + error_setg(&local_err, "The '%s' CPU type can only be used with KV= M, + HVF or WHPX", name); goto out; } =20 --=20 2.43.0 From nobody Mon Nov 23 04:26:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1794981839; cv=none; d=zohomail.com; s=zohoarc; b=Qeb4imzaHeFJssyxfqi2CxEaTic6tAB/E/15Juu8/W3i1Wme2Q9scvRsbbod9KgqlaoyDOqhZGIDrx9GaVWbVQjiudxCZ7YkHuoPk24hMpC2RF2u2GNVoB838oloBpORjkL4e/CSSIVWvi1zvy8nOfyt63IbtOWNWUJkuSJV1wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794981839; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Xl2/uj5l9DlpnL9JicC2LIldYUr6zKoBKpkVXIT8Bo8=; b=m6084d62IRfLWXop32fygmpvazEHp8QylenfQ+8xnctMBM/Ea294+O1+GnVtQTh5TBiU93hbUsDJDnB5JMD3t6plXDPjL/RuBLkCkmDlEEsxPPeQJx2R8CmP73xUvWixBAge7kNa9cg/AI24/1eO4MaINm8RDej6d01PakKqGgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794981839880305.9898352912518; Tue, 17 Nov 2026 22:03:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xTYlV-0005Cg-B4; Wed, 18 Nov 2026 01:03:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xTYlK-0005Bi-9u for qemu-devel@nongnu.org; Wed, 18 Nov 2026 01:03:19 -0500 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xTYlI-0003zL-J3 for qemu-devel@nongnu.org; Wed, 18 Nov 2026 01:03:17 -0500 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-71aea92f666so387302eaf.2 for ; Tue, 17 Nov 2026 22:03:16 -0800 (PST) Received: from [127.0.1.1] ([2605:ad80:33:509c:ff29:6c8b:a81b:ce71]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4b74372cb6bsm1358721fac.4.2026.11.17.22.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 22:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794981795; x=1795586595; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Xl2/uj5l9DlpnL9JicC2LIldYUr6zKoBKpkVXIT8Bo8=; b=lHSlRZGUHPxXWu7rDQfGOZmvehHbZQCq7aLmzk+7LqdtXr/3j2inbo79XmG+R2GV2I DHL5gEC0UZcKFUEGxPyQxfqOn4iod0qQnGyjDNrQ/k3WYpIJRdsJyzJwaeB9SE7iWGlh tVM2K0HZ2sphluHNTOHXK8FN8b2MJenZnwLD8Znivqyls031MldnB0oVctnRvJaIk//5 XrdE1CCIGPXDtckDI3Zzls/XK2YdZGREJpMPzD4MyY//2ZTtQUaoUNXWCHl1HCkrtpyk i65TMQRmM7Cw0UHYuJAlrG0Vt5/UID3EoINtPz+t+uagc9ipKtjgi8sxYsYnIKyU+xTo ThjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794981795; x=1795586595; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Xl2/uj5l9DlpnL9JicC2LIldYUr6zKoBKpkVXIT8Bo8=; b=W5TU2/nHpEoXDJDgq4sga0sTPk60wHNFnzuMcY0uSBxz7O4sB7fIG7jGoLQtFGLZwB BLq4RjY9vdBnwW5cNXLstVQcyiTss4Up2NM38fNlDVEXq7QdoNFJC2cO3sMtIfv3xpn3 Li9jBBirWPKTecDLm4ElMcAi+2TkeB2KaGneONVUG5bkfyGreEQcbBvD6t0+W54SukXe /q9BpGa51ZIt+0Lq/FyYC7HJAop/8b+PEvTVHmJ/1qOqwqr76GM3H3nnV7xbmZWMKxxJ BtvUrpT5g73xVoGv1lNCigjUmZGx8qCuoiIDA+q6I/coiAPQOjWDi3fRVMS/ttbF+Lxz XYig== X-Gm-Message-State: APuU4Z/Iqa3qCKm8OoCL93ViCO9+56+fNjb405KiHEnng1pZ/qmCh/5P afPODJImL8wZGogBxwM8M026v8RF3VCdBVfcmvZY9XH1eX5F1p0x0YID X-Gm-Gg: AYBFou0G3YmX35X4BbDw+eWG+9IrDqMzXqlS6duCY8REMOIfV7Qeqkjwm1/kN2WcBR8 xFbwns3hJYFRi4ptLnkEiLsYJ5CZp/UAP6dWw224SNzW+hutcQfhzceECjjtgyvR5rFG0tPhscV TC/NiVfHC+7RcsOjbSgfV27jJIAxM7j7KEItuG0elTLa2rgEOebpRCIgPAARq7Xgjv+Aq/+MBDb YIqDkKbk9IOc1bfr8kU4W6TLIlBrNtnK8QuA/elGrJPICmq8V1SyWaTh3YPxCAXUfK1XmiiLosZ pYKRZMuL4y0hlFy4qjZLjG/TlknYQ5y4j1bPTcNR60pGWfSg5S98R5oG5nGzNYoCVdUOxKYSKwP /LtydnPckt+7wCHpNvBq1i3OO/sqRcQCPx+IsrnWjb/GN70cUlNxv/TTOFIRp/46GJrVj/WtOyR H8m5GVvuuPSxsfbr3SFplA/M+8bixP0UkXPr+gEMQ9ekpHwsH/VMb9JB9HIwSI5aqhuoOWo7hgJ 7z6f68mcVQIeNQwOMkHT+c2oLJwhRDC4iDST7SDl9I9nznY/anHrCdJMzZ+4uICN/SV0BHBqP10 bdlTlTb0U36nEalOank3T0XBzFQ= X-Received: by 2002:a05:6820:16a0:b0:71b:187f:1d05 with SMTP id 006d021491bc7-71b187f2097mr1273431eaf.68.1794981795174; Tue, 17 Nov 2026 22:03:15 -0800 (PST) From: Andrew Nguyen Date: Wed, 18 Nov 2026 00:02:53 -0600 Subject: [PATCH v2 2/2] target/i386: check hardware acceleration with -cpu host and scalable error MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261118-4836-cpu-host-error-v2-2-ba02bb640d9d@gmail.com> References: <20261118-4836-cpu-host-error-v2-0-ba02bb640d9d@gmail.com> In-Reply-To: <20261118-4836-cpu-host-error-v2-0-ba02bb640d9d@gmail.com> To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Zhao Liu , Peter Maydell , Andrew Nguyen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794981788; l=2033; i=xmphyr@gmail.com; s=20261115; h=from:subject:message-id; bh=IZ8lIXL26iA16ORR+IngSnn/rMP1mNzjWyTWSalCn8g=; b=ccqZBxRmI9IKEe09TTiGb50yzzMv6W0O/dW3Vh+8zjGESB9FpawhfruFHZkxCJj2oiQ7Ray0H b6i/ACP5xA9BfW4JnAL6O6qfrX1hFsmgBylJatylE5Q5gBjMvdl9g21 X-Developer-Key: i=xmphyr@gmail.com; a=ed25519; pk=NNmtCKBlfBcUb+tQiMXr0u4Z3W1r0gSDovSDVTzPWXE= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c36; envelope-from=xmphyr@gmail.com; helo=mail-oo1-xc36.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, FREEMAIL_FROM=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1794981841652158501 Added an additional check with -cpu host: that a hardware accelerator is enabled. The error message for when a hardware accelerator isn't used gives a list of supported hardware accelerators. This list is made more scalable in the form of a separate function that is substantially easier to find and append later down the line. Signed-off-by: Andrew Nguyen --- include/system/hw_accel.h | 10 ++++++++++ target/i386/cpu.c | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/system/hw_accel.h b/include/system/hw_accel.h index f0c10b6d80..04608073f7 100644 --- a/include/system/hw_accel.h +++ b/include/system/hw_accel.h @@ -54,4 +54,14 @@ static inline bool hwaccel_enabled(void) || whpx_enabled(); } =20 +/** + * hwaccel_names: + * + * Returns: String of supported hardware accelerators. + */ +static inline const char *hwaccel_names(void) +{ + return "kvm, hvf, whpx, or nvmm"; +} + #endif /* QEMU_HW_ACCEL_H */ diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 7dd5535f80..375a4453e4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -25,6 +25,7 @@ #include "cpu.h" #include "tcg/helper-tcg.h" #include "exec/translation-block.h" +#include "system/hw_accel.h" #include "system/hvf.h" #include "system/mshv.h" #include "system/whpx.h" @@ -10227,10 +10228,11 @@ static void x86_cpu_realizefn(DeviceState *dev, E= rror **errp) return; } =20 - if (xcc->host_cpuid_required && !accel_uses_host_cpuid()) { + if (xcc->host_cpuid_required && (!accel_uses_host_cpuid() || + !hwaccel_enabled())) { g_autofree char *name =3D x86_cpu_class_get_model_name(xcc); - error_setg(&local_err, "The '%s' CPU type can only be used with KV= M, - HVF or WHPX", name); + error_setg(&local_err, "The '%s' CPU type can only be used with " + "hardware accelerators %s.", name, hwaccel_names()); goto out; } =20 --=20 2.43.0