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] [day] [month] [year] [list]
Message-ID: <tip-4596749339e06dc7a424fc08a15eded850ed78b7@git.kernel.org>
Date:   Fri, 23 Feb 2018 00:29:17 -0800
From:   tip-bot for Samuel Neves <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     douly.fnst@...fujitsu.com, sneves@....uc.pt, peterz@...radead.org,
        mingo@...nel.org, hpa@...or.com, torvalds@...ux-foundation.org,
        linux-kernel@...r.kernel.org, tglx@...utronix.de
Subject: [tip:x86/urgent] x86/topology: Update the 'cpu cores' field in
 /proc/cpuinfo correctly across CPU hotplug operations

Commit-ID:  4596749339e06dc7a424fc08a15eded850ed78b7
Gitweb:     https://git.kernel.org/tip/4596749339e06dc7a424fc08a15eded850ed78b7
Author:     Samuel Neves <sneves@....uc.pt>
AuthorDate: Wed, 21 Feb 2018 20:50:36 +0000
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 23 Feb 2018 08:47:47 +0100

x86/topology: Update the 'cpu cores' field in /proc/cpuinfo correctly across CPU hotplug operations

Without this fix, /proc/cpuinfo will display an incorrect amount
of CPU cores, after bringing them offline and online again, as
exemplified below:

  $ cat /proc/cpuinfo | grep cores
  cpu cores	: 4
  cpu cores	: 8
  cpu cores	: 8
  cpu cores	: 20
  cpu cores	: 4
  cpu cores	: 3
  cpu cores	: 2
  cpu cores	: 2

This patch fixes this by always zeroing the booted_cores variable
upon turning off a logical CPU.

Tested-by: Dou Liyang <douly.fnst@...fujitsu.com>
Signed-off-by: Samuel Neves <sneves@....uc.pt>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: jgross@...e.com
Cc: luto@...nel.org
Cc: prarit@...hat.com
Cc: vkuznets@...hat.com
Link: http://lkml.kernel.org/r/20180221205036.5244-1-sneves@dei.uc.pt
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/smpboot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9eee25d07586..ff99e2b6fc54 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1437,6 +1437,7 @@ static void remove_siblinginfo(int cpu)
 	cpumask_clear(topology_sibling_cpumask(cpu));
 	cpumask_clear(topology_core_cpumask(cpu));
 	c->cpu_core_id = 0;
+	c->booted_cores = 0;
 	cpumask_clear_cpu(cpu, cpu_sibling_setup_mask);
 	recompute_smt_state();
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ