On 05.09.2024 18:00, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/cpu/Makefile
> +++ b/xen/arch/x86/cpu/Makefile
> @@ -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

I'm okay this way, but I wonder whether Andrew - just like for PSR - would
like this not directly keyed to INTEL.

> --- a/xen/arch/x86/include/asm/cpuidle.h
> +++ b/xen/arch/x86/include/asm/cpuidle.h
> @@ -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 -ENOSYS;
> +}

As mentioned elsewhere before - please don't abuse ENOSYS. Seeing how the
function is used I even wonder why it has return type "int".

Jan

Reply via email to