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:   Thu, 8 Dec 2016 12:03:31 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        Borislav Petkov <bp@...en8.de>,
        "Charles (Chas) Williams" <ciwillia@...cade.com>,
        "M. Vefa Bicakci" <m.v.b@...box.com>,
        Alok Kataria <akataria@...are.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: Re: [PATCH] x86/smpboot: Make logical package management more robust

On Thu, Dec 08, 2016 at 10:04:25AM +0100, Thomas Gleixner wrote:
> @@ -289,16 +293,17 @@ int topology_update_package_map(unsigned
>  	if (test_and_set_bit(pkg, physical_package_map))
>  		goto found;
>  
> -	if (logical_packages_frozen) {
> -		physical_to_logical_pkg[pkg] = -1;
> -		pr_warn("APIC(%x) Package %u exceeds logical package max\n",
> -			apicid, pkg);
> +	if (logical_packages >= __max_logical_packages) {
> +		pr_warn("Package %u of CPU %u exceeds BIOS package data %u.\n",
> +			logical_packages, cpu, __max_logical_packages);
>  		return -ENOSPC;
>  	}
>  
>  	new = logical_packages++;
> -	pr_info("APIC(%x) Converting physical %u to logical package %u\n",
> -		apicid, pkg, new);
> +	if (new != pkg) {
> +		pr_info("CPU %u Converting physical %u to logical package %u\n",
> +			cpu, pkg, new);
> +	}

This makes the print conditional on the phy<->logical mapping not
matching; I thought it was a concious decision to print everything in
the initial version.

This way, if we have a 4 node system and nodes 1,2 are crossed we'll
only see:

 "Converting physical 2 to logical package 1"
 "Converting physical 1 to logical package 2"

And nothing on the other two nodes, which could be slightly confusing.

>  	physical_to_logical_pkg[pkg] = new;
>  
>  found:



> @@ -366,27 +371,9 @@ static void __init smp_init_package_map(
>  	size = BITS_TO_LONGS(max_physical_pkg_id) * sizeof(unsigned long);
>  	physical_package_map = kzalloc(size, GFP_KERNEL);
>  
> -	for_each_present_cpu(cpu) {
> -		unsigned int apicid = apic->cpu_present_to_apicid(cpu);
> -
> -		if (apicid == BAD_APICID || !apic->apic_id_valid(apicid))
> -			continue;
> -		if (!topology_update_package_map(apicid, cpu))
> -			continue;
> -		pr_warn("CPU %u APICId %x disabled\n", cpu, apicid);
> -		per_cpu(x86_bios_cpu_apicid, cpu) = BAD_APICID;
> -		set_cpu_possible(cpu, false);
> -		set_cpu_present(cpu, false);
> -	}
> -
> -	if (logical_packages > __max_logical_packages) {
> -		pr_warn("Detected more packages (%u), then computed by BIOS data (%u).\n",
> -			logical_packages, __max_logical_packages);
> -		logical_packages_frozen = true;
> -		__max_logical_packages  = logical_packages;

So we'll never 'shrink' the initially computed max; which could result
in using more memory than strictly needed, otoh it makes physical
hotplug happier.

> -	}
> -
>  	pr_info("Max logical packages: %u\n", __max_logical_packages);
> +
> +	topology_update_package_map(pkg, cpu);
>  }


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ