From: Peng Liang liangpeng10@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I912VN CVE: NA
------------------------------
boot_option_idle_override is defined only in x86/ia64. Since haltpoll supports x86 and arm64, let's check boot_option_idle_override only in x86.
Signed-off-by: Peng Liang liangpeng10@huawei.com Signed-off-by: liangtian liangtian13@huawei.com --- drivers/cpuidle/cpuidle-haltpoll.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index 3afdd19fee25..af3983dfe3eb 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -143,12 +143,14 @@ static int register_haltpoll_driver(void) int ret; struct cpuidle_driver *drv = &haltpoll_driver;
+#ifdef CONFIG_X86 /* Do not load haltpoll if idle= is passed */ if (boot_option_idle_override != IDLE_NO_OVERRIDE) return -ENODEV;
if (!force && (!kvm_para_available() || !haltpoll_want())) return -ENODEV; +#endif
cpuidle_poll_state_init(drv);