On 12/8/25 02:35, Richard Henderson wrote:
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.
OK, but since hw/intc/arm_gicv3_hvf.c calls host_cpu_feature_supported,
the other one has to stay in "cpu.h" (see
https://lore.kernel.org/qemu-devel/20250808070137.48716-5-moha...@unpredictable.fr/).