On 8/12/25 03:06, Philippe Mathieu-Daudé wrote:
Introduce arm_hw_accel_cpu_feature_supported() helper,
an accelerator implementation to return whether a ARM
feature is supported by host hardware. Allow optional
fallback on emulation.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  target/arm/cpu.h     | 12 ++++++++++++
  target/arm/hvf/hvf.c | 20 ++++++++++++++++++++
  target/arm/kvm.c     | 22 ++++++++++++++++++++++
  3 files changed, 54 insertions(+)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index dc9b6dce4c9..5136c4caabf 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2507,6 +2507,18 @@ static inline ARMSecuritySpace arm_secure_to_space(bool 
secure)
  }
#if !defined(CONFIG_USER_ONLY)
+
+/**
+ * arm_hw_accel_cpu_feature_supported:
+ * @feat: Feature to test for support
+ * @can_emulate: Whether Allow to fall back to emulation if @feat is not
+ *               supported by hardware accelerator
+ *
+ * Hardware accelerator implementation of cpu_feature_supported().
+ */
+bool arm_hw_accel_cpu_feature_supported(enum arm_features feat,
+                                        bool can_emulate);

internals.h.

I guess this is ok. If we ignore xen, which is a thing of its own, we don't currently have more than one accelerator per OS. That hasn't always been true for x86, where we had 2 or 3 at once for Windows.


r~

Reply via email to