@@ -4,5 +4,6 @@
void arch_haltpoll_enable(unsigned int cpu);
void arch_haltpoll_disable(unsigned int cpu);
+bool arch_haltpoll_want(void);
#endif
@@ -1151,4 +1151,10 @@ void arch_haltpoll_disable(unsigned int cpu)
smp_call_function_single(cpu, kvm_enable_host_haltpoll, NULL, 1);
}
EXPORT_SYMBOL_GPL(arch_haltpoll_disable);
+
+bool arch_haltpoll_want(void)
+{
+ return kvm_para_has_hint(KVM_HINTS_REALTIME);
+}
+EXPORT_SYMBOL_GPL(arch_haltpoll_want);
#endif
@@ -96,7 +96,7 @@ static void haltpoll_uninit(void)
static bool haltpoll_want(void)
{
- return kvm_para_has_hint(KVM_HINTS_REALTIME) || force;
+ return (kvm_para_available() && arch_haltpoll_want()) || force;
}
static int __init haltpoll_init(void)
@@ -110,7 +110,7 @@ static int __init haltpoll_init(void)
return -ENODEV;
#endif
- if (!kvm_para_available() || !haltpoll_want())
+ if (!haltpoll_want())
return -ENODEV;
cpuidle_poll_state_init(drv);
@@ -12,5 +12,10 @@ static inline void arch_haltpoll_enable(unsigned int cpu)
static inline void arch_haltpoll_disable(unsigned int cpu)
{
}
+
+static inline bool arch_haltpoll_want(void)
+{
+ return false;
+}
#endif
#endif