]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 29 May 2025 16:45:10 +0000 (17:45 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 29 May 2025 16:45:10 +0000 (17:45 +0100)
In order to allow non-target specific code to include
"hvf_arm.h", define the stubs in hvf-stub.c.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250513173928.77376-3-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
MAINTAINERS
target/arm/hvf-stub.c [new file with mode: 0644]
target/arm/hvf_arm.h
target/arm/meson.build

index 8e68333623e6570b8b0f560a63f78bc515b20dca..973254fae79d22f0dd482ceadaafcee1d9b1888a 100644 (file)
@@ -510,6 +510,7 @@ Apple Silicon HVF CPUs
 M: Alexander Graf <agraf@csgraf.de>
 S: Maintained
 F: target/arm/hvf/
+F: target/arm/hvf-stub.c
 
 X86 HVF CPUs
 M: Cameron Esfahani <dirty@apple.com>
diff --git a/target/arm/hvf-stub.c b/target/arm/hvf-stub.c
new file mode 100644 (file)
index 0000000..ff13726
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * QEMU Hypervisor.framework (HVF) stubs for ARM
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "hvf_arm.h"
+
+uint32_t hvf_arm_get_default_ipa_bit_size(void)
+{
+    g_assert_not_reached();
+}
+
+uint32_t hvf_arm_get_max_ipa_bit_size(void)
+{
+    g_assert_not_reached();
+}
index 26c717b38269e65700ecd56616d6a2f5b8a82aaa..7a44e0926209d52db23e6afedd34523701ca9046 100644 (file)
@@ -22,23 +22,7 @@ void hvf_arm_init_debug(void);
 
 void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu);
 
-#ifdef CONFIG_HVF
-
 uint32_t hvf_arm_get_default_ipa_bit_size(void);
 uint32_t hvf_arm_get_max_ipa_bit_size(void);
 
-#else
-
-static inline uint32_t hvf_arm_get_default_ipa_bit_size(void)
-{
-    return 0;
-}
-
-static inline uint32_t hvf_arm_get_max_ipa_bit_size(void)
-{
-    return 0;
-}
-
-#endif
-
 #endif
index e568dfb706a326c753c50b6495db4caf8c39ee25..2747f4b404cf1e55f5d26c16794ed6335cd0b7c4 100644 (file)
@@ -32,6 +32,7 @@ arm_common_system_ss.add(files('cpu.c'), capstone)
 arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files(
   'cpu32-stubs.c'))
 arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
+arm_common_system_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c'))
 arm_common_system_ss.add(files(
   'arch_dump.c',
   'arm-powerctl.c',