Skip to content

RFC target/arm: Introduce host_cpu_feature_supported() API

Philippe Mathieu-Daudé kvm qemu-arm qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest10 patches 9 repliesIn review
  2. v1 RFC11 patches 17 repliesSuperseded

Changes in v2 from the cover letter

- Addressed Richard's review comments removing 'can_emulate' arg

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10accel/system: Introduce hwaccel_enabled() helperinclude/system/hw_accel.h+13 -00 replies
2/10target/arm: Use generic hwaccel_enabled() to check 'host' cpu typetarget/arm/arm-qmp-cmds.c target/arm/cpu.c target/arm/cpu64.c+12 -90 replies
3/10target/arm: Restrict PMU to system modetarget/arm/cpu.c+3 -20 replies
4/10target/arm: Factor hvf_psci_get_target_el() outtarget/arm/hvf/hvf.c+5 -20 replies
5/10target/arm: Introduce host_cpu_feature_supported()target/arm/hvf/hvf.c target/arm/internals.h target/arm/kvm.c+50 -01 reply
6/10target/arm: Replace kvm_arm_pmu_supported by host_cpu_feature_supportedtarget/arm/cpu.c target/arm/kvm-stub.c target/arm/kvm.c +1 more+6 -271 reply
7/10target/arm: Replace kvm_arm_el2_supported by host_cpu_feature_supportedhw/arm/virt.c target/arm/kvm-stub.c target/arm/kvm.c +1 more+4 -261 reply
8/10target/arm/hvf: Sync registers used at EL2target/arm/hvf/hvf.c+32 -03 replies
9/10target/arm/hvf: Consider EL2 acceleration for Silicon M3+ chipsetstarget/arm/hvf/hvf.c+6 -01 reply
10/10target/arm/hvf: Allow EL2/EL3 emulation on Silicon M1 / M2target/arm/hvf/hvf.c+5 -12 replies

Reviews trailers per patch

9 of 10 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonPierrick Bouvier
1/10R-b
2/10R-b R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [RFC PATCH v2 00/10] target/arm: Introduce host_cpu_feature_supported() API

Since v1:
- Addressed Richard's review comments removing 'can_emulate' arg

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/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/

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

Philippe Mathieu-Daudé (8):
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 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/internals.h    |  8 +++++
 target/arm/kvm_arm.h      | 24 --------------
 hw/arm/virt.c             |  8 +----
 target/arm/arm-qmp-cmds.c |  5 +--
 target/arm/cpu.c          | 16 +++++----
 target/arm/cpu64.c        | 11 ++++---
 target/arm/hvf/hvf.c      | 69 +++++++++++++++++++++++++++++++++++++--
 target/arm/kvm-stub.c     | 10 ------
 target/arm/kvm.c          | 33 ++++++++++++++-----
 10 files changed, 133 insertions(+), 64 deletions(-)
Signature · 1 line
2.49.0