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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  7 Apr 2020 00:33:44 -0600
From:   "Jason A. Donenfeld" <Jason@...c4.com>
To:     linux-kernel@...r.kernel.org, linux-edac@...r.kernel.org,
        x86@...nel.org, arnd@...db.de, srinivas.pandruvada@...ux.intel.com,
        bberg@...hat.com, bp@...e.de
Cc:     "Jason A. Donenfeld" <Jason@...c4.com>
Subject: [PATCH 2/3] x86/mce/therm_throt: allow disabling verbose logging

There is an enormous amount of fiddly book keeping and an auxiliary
workqueue just for the purpose of ratelimiting and reliably printing
messages regarding thermal events and throttling, which uses CPU in a
rather common interrupt. Add an option to disable this verbose
reporting.

Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>
---
 arch/x86/Kconfig                      | 9 +++++++++
 arch/x86/kernel/cpu/mce/therm_throt.c | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..39e7444353af 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1159,6 +1159,15 @@ config X86_THERMAL_VECTOR
 	def_bool y
 	depends on X86_MCE_INTEL
 
+config X86_MCE_THERMAL_VERBOSE
+	bool "Verbose logging for thermal events"
+	depends on X86_THERMAL_VECTOR
+	---help---
+	  Display messages in the kernel log when thermal events are triggered,
+	  such as overheating and throttling. This mostly only uses extra CPU
+	  for ratelimiting and book keeping, so unless you need these logs, it
+	  is safe to say N.
+
 source "arch/x86/events/Kconfig"
 
 config X86_LEGACY_VM86
diff --git a/arch/x86/kernel/cpu/mce/therm_throt.c b/arch/x86/kernel/cpu/mce/therm_throt.c
index f904e85eb68f..6d726190a40a 100644
--- a/arch/x86/kernel/cpu/mce/therm_throt.c
+++ b/arch/x86/kernel/cpu/mce/therm_throt.c
@@ -313,6 +313,9 @@ static void therm_throt_process(bool new_event, int event, int level)
 	u64 now;
 	struct thermal_state *pstate = &per_cpu(thermal_state, this_cpu);
 
+	if (!IS_ENABLED(CONFIG_X86_MCE_THERMAL_VERBOSE))
+		return;
+
 	now = get_jiffies_64();
 	if (level == CORE_LEVEL) {
 		if (event == THERMAL_THROTTLING_EVENT)
-- 
2.26.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ