All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Nguyen <xmphyr@gmail.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Zhao Liu <zhao1.liu@intel.com>,
	 Peter Maydell <peter.maydell@linaro.org>,
	Andrew Nguyen <xmphyr@gmail.com>
Subject: [PATCH v2 0/2] target/i386: make error message for -cpu host more informative
Date: Wed, 18 Nov 2026 00:02:51 -0600	[thread overview]
Message-ID: <20261118-4836-cpu-host-error-v2-0-ba02bb640d9d@gmail.com> (raw)

This is a resolution for issue #4836: https://gitlab.com/qemu-project/qemu/-/work_items/4836.
"-cpu host" by itself is not permitted; an accelerator must be specified as well. For Linux,
it is KVM. macOS is HVF and Windows is WHPX.

Previously, QEMU would only tell the user to use either KVM or HVF, essentially excluding
Windows users.

Signed-off-by: Andrew Nguyen <xmphyr@gmail.com>
---
I originally was going to make hwaccel_names() a macro, but that felt wrong. 

I am considering putting the hwaccel_enabled() call in accel_uses_host_cpuid(), but I'm not 
totally sure what that function is for at the higher level. My assumption is whether or not 
QEMU is able to get the CPU's capabilities.

Just now realizing that the cover letter should largely be left unchanged between revisions.
However, I don't know where to put additional comments otherwise...

---
Changes in v1:
- cpu.c:10229: added WHPX to the error message when "-cpu host" doesn't include an accelerator

Changes in v2:
- cpu.c: added a check for hardware acceleration
- cpu.c: replaced the explicit list of hardware accelerators
- hw_accel.h: created function hwaccel_names() to return the list of hw accerlator names
- Link to v1: https://lore.kernel.org/qemu-devel/20261115-4836-cpu-host-error-v1-1-fdf0eb56ba8a@gmail.com

---
Andrew Nguyen (2):
      target/i386: make error message for -cpu host more informative
      target/i386: check hardware acceleration with -cpu host and scalable error

 include/system/hw_accel.h | 10 ++++++++++
 target/i386/cpu.c         |  7 +++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
---
base-commit: e9fa1f66f0d47c74b6766e1b8b87ad7c2a9394d5
change-id: 20261115-4836-cpu-host-error-1e85b17e0f1d

Best regards,
-- 
Andrew Nguyen <xmphyr@gmail.com>



             reply	other threads:[~2026-11-18  6:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  6:02 Andrew Nguyen [this message]
2026-11-18  6:02 ` [PATCH v2 1/2] target/i386: make error message for -cpu host more informative Andrew Nguyen
2026-11-18  6:02 ` [PATCH v2 2/2] target/i386: check hardware acceleration with -cpu host and scalable error Andrew Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118-4836-cpu-host-error-v2-0-ba02bb640d9d@gmail.com \
    --to=xmphyr@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.