提交 ae832c5e 编写于 作者: X Xiangyou Xie 提交者: Yang Yingliang

ARM: cpuidle: Add support for cpuidle-haltpoll driver for ARM

hulk inclusion
category: feature
bugzilla: NA
CVE: NA

Add support for cpuidle-haltpoll driver for ARM.
Allow arm to use the couidle-haltpoll driver.
Signed-off-by: NXiangyou Xie <xiexiangyou@huawei.com>
Signed-off-by: NYubo Miao <miaoyubo@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: Nzhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 37d7ee07
......@@ -288,6 +288,9 @@ config ARCH_SUPPORTS_UPROBES
config ARCH_PROC_KCORE_TEXT
def_bool y
config ARCH_HAS_CPU_RELAX
def_bool y
source "arch/arm64/Kconfig.platforms"
source "kernel/livepatch/Kconfig"
......
......@@ -133,6 +133,10 @@ void arch_cpu_idle(void)
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
}
#if defined(CONFIG_HALTPOLL_CPUIDLE_MODULE)
EXPORT_SYMBOL(arch_cpu_idle);
#endif
#ifdef CONFIG_HOTPLUG_CPU
void arch_cpu_idle_dead(void)
{
......
......@@ -34,7 +34,7 @@ config CPU_IDLE_GOV_TEO
config CPU_IDLE_GOV_HALTPOLL
bool "Haltpoll governor (for virtualized systems)"
depends on KVM_GUEST
depends on KVM_GUEST || ARM64
help
This governor implements haltpoll idle state selection, to be
used in conjunction with the haltpoll cpuidle driver, allowing
......@@ -63,7 +63,7 @@ endmenu
config HALTPOLL_CPUIDLE
tristate "Halt poll cpuidle driver"
depends on X86 && KVM_GUEST
depends on (X86 && KVM_GUEST) || ARM64
default y
help
This option enables halt poll cpuidle driver, which allows to poll
......
......@@ -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_has_hint(KVM_HINTS_REALTIME);
}
static int __init haltpoll_init(void)
......@@ -106,7 +106,7 @@ static int __init haltpoll_init(void)
cpuidle_poll_state_init(drv);
if (!kvm_para_available() || !haltpoll_want())
if (!force && (!kvm_para_available() || !haltpoll_want()))
return -ENODEV;
ret = cpuidle_register_driver(drv);
......
......@@ -39,6 +39,10 @@ module_param(guest_halt_poll_grow_start, uint, 0644);
static bool guest_halt_poll_allow_shrink __read_mostly = true;
module_param(guest_halt_poll_allow_shrink, bool, 0644);
static bool enable __read_mostly;
module_param(enable, bool, 0444);
MODULE_PARM_DESC(enable, "Load unconditionally");
/**
* haltpoll_select - selects the next idle state to enter
* @drv: cpuidle driver containing state data
......@@ -141,7 +145,7 @@ static struct cpuidle_governor haltpoll_governor = {
static int __init init_haltpoll(void)
{
if (kvm_para_available())
if (kvm_para_available() || enable)
return cpuidle_register_governor(&haltpoll_governor);
return 0;
......
......@@ -8,6 +8,9 @@
#include <linux/sched.h>
#include <linux/sched/clock.h>
#include <linux/sched/idle.h>
#ifdef CONFIG_ARM64
#include <linux/cpu.h>
#endif
#define POLL_IDLE_RELAX_COUNT 200
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册