lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1571272750-29798-1-git-send-email-zhenzhong.duan@oracle.com>
Date:   Thu, 17 Oct 2019 08:39:10 +0800
From:   Zhenzhong Duan <zhenzhong.duan@...cle.com>
To:     linux-kernel@...r.kernel.org
Cc:     rjw@...ysocki.net, daniel.lezcano@...aro.org,
        linux-pm@...r.kernel.org, mtosatti@...hat.com,
        Zhenzhong Duan <zhenzhong.duan@...cle.com>,
        Joao Martins <joao.m.martins@...cle.com>
Subject: [PATCH] cpuidle-haltpoll: make haltpoll aware of 'idle=' override

Currenly haltpoll isn't aware of the 'idle=' override, the priority is
'idle=poll' > haltpoll > 'idle=halt'. When 'idle=poll' is used, cpuidle
driver is bypassed but current_driver in sys still shows 'haltpoll'.

When 'idle=halt' is used, haltpoll take precedence and make 'idle=halt'
no effect.

Add a check to not load haltpoll driver if there is 'idle=' and haltpoll
is built in. If haltpoll is built as a module, still give a chance for
admin to use it despite 'idle='.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@...cle.com>
Signed-off-by: Joao Martins <joao.m.martins@...cle.com>
---
 drivers/cpuidle/cpuidle-haltpoll.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
index 932390b..00e9821 100644
--- a/drivers/cpuidle/cpuidle-haltpoll.c
+++ b/drivers/cpuidle/cpuidle-haltpoll.c
@@ -95,6 +95,12 @@ static int __init haltpoll_init(void)
 	int ret;
 	struct cpuidle_driver *drv = &haltpoll_driver;
 
+#if !defined(CONFIG_HALTPOLL_CPUIDLE_MODULE)
+	/* Do not load haltpoll if idle= is passed */
+	if (boot_option_idle_override != IDLE_NO_OVERRIDE)
+		return -ENODEV;
+#endif
+
 	cpuidle_poll_state_init(drv);
 
 	if (!kvm_para_available() ||
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ