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]
Message-ID: <c716d43a-8b9f-f517-2c84-a3a61ab361b0@cn.fujitsu.com>
Date:   Thu, 25 Aug 2016 16:57:37 +0800
From:   Dou Liyang <douly.fnst@...fujitsu.com>
To:     <tglx@...utronix.de>
CC:     <tj@...nel.org>, <rjw@...ysocki.net>, <akpm@...ux-foundation.org>,
        <isimatu.yasuaki@...fujitsu.com>, <kamezawa.hiroyu@...fujitsu.com>,
        <izumi.taku@...fujitsu.com>, <rafael@...nel.org>, <x86@...nel.org>,
        <linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-mm@...ck.org>
Subject: Re: [PATCH v12 2/7] x86, acpi, cpu-hotplug: Enable acpi to register
 all possible cpus at boot time.

Hi tglx,

At 08/25/2016 04:35 PM, Dou Liyang wrote:
>  arch/x86/kernel/apic/apic.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index cea4fc1..e5612a9 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -2024,7 +2024,7 @@ void disconnect_bsp_APIC(int virt_wire_setup)
>  	apic_write(APIC_LVT1, value);
>  }
>
> -int generic_processor_info(int apicid, int version)
> +static int __generic_processor_info(int apicid, int version, bool enabled)
>  {
>  	int cpu, max = nr_cpu_ids;
>  	bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid,
> @@ -2090,7 +2090,6 @@ int generic_processor_info(int apicid, int version)
>  		return -EINVAL;
>  	}
>
> -	num_processors++;
>  	if (apicid == boot_cpu_physical_apicid) {

I move the "num_processors++" below.
Because I think that if "apicid == boot_cpu_physical_apicid" is true,
The "disabled_cpus" will plus one that may conflict with the
"num_processors++"

Is my thought right?

>  		/*
>  		 * x86_bios_cpu_apicid is required to have processors listed
> @@ -2113,6 +2112,7 @@ int generic_processor_info(int apicid, int version)
>
>  		pr_warning("APIC: Package limit reached. Processor %d/0x%x ignored.\n",
>  			   thiscpu, apicid);
> +
>  		disabled_cpus++;
>  		return -ENOSPC;
>  	}
> @@ -2132,7 +2132,6 @@ int generic_processor_info(int apicid, int version)
>  			apic_version[boot_cpu_physical_apicid], cpu, version);
>  	}
>
> -	physid_set(apicid, phys_cpu_present_map);
>  	if (apicid > max_physical_apicid)
>  		max_physical_apicid = apicid;
>
> @@ -2145,11 +2144,22 @@ int generic_processor_info(int apicid, int version)
>  		apic->x86_32_early_logical_apicid(cpu);
>  #endif
>  	set_cpu_possible(cpu, true);
> -	set_cpu_present(cpu, true);
> +
> +	if (enabled) {
> +		num_processors++;
> +		physid_set(apicid, phys_cpu_present_map);
> +		set_cpu_present(cpu, true);
> +	} else
> +		disabled_cpus++;
>

I remove all the "if (enabled)" code and do the unified
judgment here.

Thanks,
Dou


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ