[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241107190818.522639-14-ankur.a.arora@oracle.com>
Date: Thu, 7 Nov 2024 11:08:16 -0800
From: Ankur Arora <ankur.a.arora@...cle.com>
To: linux-pm@...r.kernel.org, kvm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org
Cc: catalin.marinas@....com, will@...nel.org, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
x86@...nel.org, hpa@...or.com, pbonzini@...hat.com,
vkuznets@...hat.com, rafael@...nel.org, daniel.lezcano@...aro.org,
peterz@...radead.org, arnd@...db.de, lenb@...nel.org,
mark.rutland@....com, harisokn@...zon.com, mtosatti@...hat.com,
sudeep.holla@....com, cl@...two.org, maz@...nel.org,
misono.tomohiro@...itsu.com, maobibo@...ngson.cn,
zhenglifeng1@...wei.com, joao.m.martins@...cle.com,
boris.ostrovsky@...cle.com, konrad.wilk@...cle.com
Subject: [PATCH v9 13/15] arm64: support cpuidle-haltpoll
Add architectural support for the cpuidle-haltpoll driver by defining
arch_haltpoll_*(). Also define ARCH_CPUIDLE_HALTPOLL to allow
cpuidle-haltpoll to be selected.
Tested-by: Haris Okanovic <harisokn@...zon.com>
Tested-by: Misono Tomohiro <misono.tomohiro@...itsu.com>
Signed-off-by: Ankur Arora <ankur.a.arora@...cle.com>
---
arch/arm64/Kconfig | 6 ++++++
arch/arm64/include/asm/cpuidle_haltpoll.h | 20 ++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 arch/arm64/include/asm/cpuidle_haltpoll.h
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 43762c68e357..bd00647f6013 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2428,6 +2428,12 @@ config ARCH_HIBERNATION_HEADER
config ARCH_SUSPEND_POSSIBLE
def_bool y
+config ARCH_CPUIDLE_HALTPOLL
+ bool "Enable selection of the cpuidle-haltpoll driver"
+ help
+ cpuidle-haltpoll allows for adaptive polling based on
+ current load before entering the idle state.
+
endmenu # "Power management options"
menu "CPU Power Management"
diff --git a/arch/arm64/include/asm/cpuidle_haltpoll.h b/arch/arm64/include/asm/cpuidle_haltpoll.h
new file mode 100644
index 000000000000..aa01ae9ad5dd
--- /dev/null
+++ b/arch/arm64/include/asm/cpuidle_haltpoll.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _ARCH_HALTPOLL_H
+#define _ARCH_HALTPOLL_H
+
+static inline void arch_haltpoll_enable(unsigned int cpu) { }
+static inline void arch_haltpoll_disable(unsigned int cpu) { }
+
+static inline bool arch_haltpoll_want(bool force)
+{
+ /*
+ * Enabling haltpoll requires KVM support for arch_haltpoll_enable(),
+ * arch_haltpoll_disable().
+ *
+ * Given that that's missing right now, only allow force loading for
+ * haltpoll.
+ */
+ return force;
+}
+#endif
--
2.43.5
Powered by blists - more mailing lists