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]
Date:   Mon, 28 Nov 2022 21:28:03 +0800
From:   Yuan ZhaoXiong <yuanzhx326@...il.com>
To:     tglx@...utronix.de, steven.price@....com, Jason@...c4.com,
        juri.lelli@...hat.com, tony.luck@...el.com, frederic@...nel.org,
        yuanzhx326@...il.com, sathyanarayanan.kuppuswamy@...ux.intel.com
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] cpu: printk error information when call cpu_up() failed.

It is better to printk error information out when calling cpu_up() failed.
Users will observe cpu up error conveniently via the kernel log.

Signed-off-by: Yuan ZhaoXiong <yuanzhx326@...il.com>
---
 kernel/cpu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index bbad5e375d3b..28b0202e7744 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1481,12 +1481,16 @@ int bringup_hibernate_cpu(unsigned int sleep_cpu)
 void bringup_nonboot_cpus(unsigned int setup_max_cpus)
 {
 	unsigned int cpu;
+	int error;
 
 	for_each_present_cpu(cpu) {
 		if (num_online_cpus() >= setup_max_cpus)
 			break;
-		if (!cpu_online(cpu))
-			cpu_up(cpu, CPUHP_ONLINE);
+		if (!cpu_online(cpu)) {
+			error = cpu_up(cpu, CPUHP_ONLINE);
+			if (error)
+				pr_err("Error taking CPU%d up: %d\n", cpu, error);
+		}
 	}
 }
 
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ