[PATCH] x86/xen: move declaration/definition of xen_processor_present()

From: Roger Pau Monne
Date: Tue Mar 21 2023 - 07:26:44 EST


So that it doesn't break the build when CONFIG_XEN or CONFIG_XEN_DOM0
are not enabled.

The current header is only included when CONFIG_XEN_DOM0 is selected,
so instead place it in the top level xen.h header, and also use the
dummy helper when CONFIG_X86 is not selected, as the current
implementation is x86 only.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Link: https://lore.kernel.org/oe-kbuild-all/202303210729.DvRvIUla-lkp@xxxxxxxxx/
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
arch/x86/include/asm/xen/hypervisor.h | 10 ----------
include/xen/xen.h | 10 ++++++++++
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
index 990a1609677e..5fc35f889cd1 100644
--- a/arch/x86/include/asm/xen/hypervisor.h
+++ b/arch/x86/include/asm/xen/hypervisor.h
@@ -63,14 +63,4 @@ void __init xen_pvh_init(struct boot_params *boot_params);
void __init mem_map_via_hcall(struct boot_params *boot_params_p);
#endif

-#if defined(CONFIG_XEN_DOM0) && defined(CONFIG_ACPI)
-bool __init xen_processor_present(uint32_t acpi_id);
-#else
-static inline bool xen_processor_present(uint32_t acpi_id)
-{
- BUG();
- return false;
-}
-#endif
-
#endif /* _ASM_X86_XEN_HYPERVISOR_H */
diff --git a/include/xen/xen.h b/include/xen/xen.h
index 7adf59837c25..4410e74f3eb5 100644
--- a/include/xen/xen.h
+++ b/include/xen/xen.h
@@ -71,4 +71,14 @@ static inline void xen_free_unpopulated_pages(unsigned int nr_pages,
}
#endif

+#if defined(CONFIG_XEN_DOM0) && defined(CONFIG_ACPI) && defined(CONFIG_X86)
+bool __init xen_processor_present(uint32_t acpi_id);
+#else
+static inline bool xen_processor_present(uint32_t acpi_id)
+{
+ BUG();
+ return false;
+}
+#endif
+
#endif /* _XEN_XEN_H */
--
2.40.0