@@ -8,7 +8,7 @@ obj-y += common.o
obj-y += hygon.o
obj-y += intel.o
obj-y += intel_cacheinfo.o
-obj-y += mwait-idle.o
+obj-$(CONFIG_INTEL) += mwait-idle.o
obj-y += shanghai.o
obj-y += vpmu.o
obj-$(CONFIG_AMD) += vpmu_amd.o
@@ -15,7 +15,14 @@ extern void (*lapic_timer_on)(void);
extern uint64_t (*cpuidle_get_tick)(void);
+#ifdef CONFIG_INTEL
int mwait_idle_init(struct notifier_block *nfb);
+#else
+static inline int mwait_idle_init(struct notifier_block *nfb)
+{
+ return -ENODEV;
+}
+#endif
int cpuidle_init_cpu(unsigned int cpu);
void cf_check default_dead_idle(void);
void cf_check acpi_dead_idle(void);
@@ -14,6 +14,13 @@
#define MWAIT_ECX_INTERRUPT_BREAK 0x1
void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
+#ifdef CONFIG_INTEL
bool mwait_pc10_supported(void);
+#else
+static inline bool mwait_pc10_supported(void)
+{
+ return false;
+}
+#endif
#endif /* __ASM_X86_MWAIT_H__ */
Currently mwait_idle driver in Xen only implements support for Intel CPUs. Thus in order to reduce dead code in non-Intel build configurations it can be made explicitly dependant on CONFIG_INTEL option. Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com> CC: Jan Beulich <jbeulich@suse.com> --- v1 patch here: https://lore.kernel.org/xen-devel/20240905160058.493057-1-Sergiy_Kibrik@epam.com/ changes in v2: - stub returns -ENODEV --- xen/arch/x86/cpu/Makefile | 2 +- xen/arch/x86/include/asm/cpuidle.h | 7 +++++++ xen/arch/x86/include/asm/mwait.h | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-)