kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Miguel Luis" <miguel.luis@oracle.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	kvm@vger.kernel.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Haibo Xu" <haibo.xu@linaro.org>,
	"Mohamed Mediouni" <mohamed@unpredictable.fr>,
	"Mark Burton" <mburton@qti.qualcomm.com>,
	"Alexander Graf" <agraf@csgraf.de>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Mads Ynddal" <mads@ynddal.dk>,
	"Eric Auger" <eric.auger@redhat.com>,
	qemu-arm@nongnu.org, "Cameron Esfahani" <dirty@apple.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [RFC PATCH 00/11] target/arm: Introduce host_cpu_feature_supported() API
Date: Mon, 11 Aug 2025 19:06:00 +0200	[thread overview]
Message-ID: <20250811170611.37482-1-philmd@linaro.org> (raw)

Hi,

Mohamed and myself are working on adding nested virtualization
support to HVF Aarch64. Mohamed approach leverages the latest
hardware features of the Apple M3+ Silicon chips [1], while mine
falls back to emulation [2] when features are not available, as
it happens with the M1 and M2 chipsets.

We want to support both methods long term, as they solve different
use cases. Therefore I'm looking for a common API for methods
added in both series.

In this series we propose the host_cpu_feature_supported() method
to check if a feature is supported by the host, allowing fall back
to TCG. KVM uses are converted, and an example -- while not really
usable without other patch applied -- is provided for HVF.

Does this look reasonable enough to pursue in that direction?

Thanks,

Phil.

[1] https://lore.kernel.org/qemu-devel/20250808070137.48716-1-mohamed@unpredictable.fr/
[2] https://lore.kernel.org/qemu-devel/20250620172751.94231-1-philmd@linaro.org/

Mohamed Mediouni (2):
  target/arm: Factor hvf_psci_get_target_el() out
  target/arm/hvf: Sync registers used at EL2

Philippe Mathieu-Daudé (9):
  accel/system: Introduce hwaccel_enabled() helper
  target/arm: Use generic hwaccel_enabled() to check 'host' cpu type
  target/arm: Restrict PMU to system mode
  target/arm: Introduce arm_hw_accel_cpu_feature_supported()
  target/arm: Introduce host_cpu_feature_supported()
  target/arm: Replace kvm_arm_pmu_supported by
    host_cpu_feature_supported
  target/arm: Replace kvm_arm_el2_supported by
    host_cpu_feature_supported
  target/arm/hvf: Consider EL2 acceleration for Silicon M3+ chipsets
  target/arm/hvf: Allow EL2/EL3 emulation on Silicon M1 / M2

 include/system/hw_accel.h | 13 +++++++
 target/arm/cpu.h          | 23 +++++++++++++
 target/arm/kvm_arm.h      | 24 -------------
 hw/arm/virt.c             |  8 +----
 target/arm/arm-qmp-cmds.c |  5 +--
 target/arm/arm_hw_accel.c | 27 +++++++++++++++
 target/arm/cpu.c          | 14 ++++----
 target/arm/cpu64.c        | 11 +++---
 target/arm/hvf/hvf.c      | 71 +++++++++++++++++++++++++++++++++++++--
 target/arm/kvm-stub.c     | 10 ------
 target/arm/kvm.c          | 33 +++++++++++++-----
 target/arm/meson.build    |  2 +-
 12 files changed, 176 insertions(+), 65 deletions(-)
 create mode 100644 target/arm/arm_hw_accel.c

-- 
2.49.0


             reply	other threads:[~2025-08-11 17:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 17:06 Philippe Mathieu-Daudé [this message]
2025-08-11 17:06 ` [RFC PATCH 01/11] accel/system: Introduce hwaccel_enabled() helper Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 02/11] target/arm: Use generic hwaccel_enabled() to check 'host' cpu type Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 03/11] target/arm: Restrict PMU to system mode Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 04/11] target/arm: Factor hvf_psci_get_target_el() out Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 05/11] target/arm: Introduce arm_hw_accel_cpu_feature_supported() Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 06/11] target/arm: Introduce host_cpu_feature_supported() Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 07/11] target/arm: Replace kvm_arm_pmu_supported by host_cpu_feature_supported Philippe Mathieu-Daudé
2025-08-12  0:48   ` Richard Henderson
2025-08-12  4:49     ` Philippe Mathieu-Daudé
2025-08-12  6:03       ` Philippe Mathieu-Daudé
2025-08-12  7:33         ` Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 08/11] target/arm: Replace kvm_arm_el2_supported " Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 09/11] target/arm/hvf: Sync registers used at EL2 Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 10/11] target/arm/hvf: Consider EL2 acceleration for Silicon M3+ chipsets Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 11/11] target/arm/hvf: Allow EL2/EL3 emulation on Silicon M1 / M2 Philippe Mathieu-Daudé

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=20250811170611.37482-1-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=alex.bennee@linaro.org \
    --cc=cfontana@suse.de \
    --cc=dirty@apple.com \
    --cc=eric.auger@redhat.com \
    --cc=haibo.xu@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=mads@ynddal.dk \
    --cc=mburton@qti.qualcomm.com \
    --cc=miguel.luis@oracle.com \
    --cc=mohamed@unpredictable.fr \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).