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: <53C4AD96.3030303@jp.fujitsu.com>
Date:	Tue, 15 Jul 2014 13:27:02 +0900
From:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
To:	Borislav Petkov <bp@...en8.de>
CC:	Igor Mammedov <imammedo@...hat.com>, <tglx@...utronix.de>,
	<mingo@...hat.com>, <hpa@...or.com>, <x86@...nel.org>,
	<toshi.kani@...com>, <huawei.libin@...wei.com>,
	<paul.gortmaker@...driver.com>, <linux-kernel@...r.kernel.org>,
	<srivatsa.bhat@...ux.vnet.ibm.com>, <umgwanakikbuti@...il.com>,
	<peterz@...radead.org>
Subject: Re: [PATCH] x86,cpu-hotplug: assign same CPU number to readded CPU

Hi Borislav,

(2014/07/11 19:59), Borislav Petkov wrote:
> On Fri, Jul 11, 2014 at 09:48:27AM +0900, Yasuaki Ishimatsu wrote:
>>>> +static int get_cpuid(int apicid)
>
> Btw this "cpuid" is misleading. Call it "cpu_num" or so.

O.K.
I'll update it.

>
>>>> +{
>>>> +	int cpuid;
>>>> +
>>>> +	cpuid = apicid_to_cpuid[apicid];
>>>> +	if (cpuid < 0)
>>>> +		cpuid = cpumask_next_zero(-1, cpu_used_mask);
>>> Why do you need additional cpu bitmask?
>>
>> To assing new CPU number, I prepared new cpu bitmask.
>>
>> The following two steps are necessary to assign CPU number to APIC ID.
>>   1. Check whether APIC ID has been assigned CPU number
>>   2. Assign new CPU number if ACPI ID has not been assigned CPU number (it
>>      means apicid_to_cpuid[] returns -1)
>>
>> Step 1. is checked by apicid_to_cpuid[]. And step 2. assigns new CPU
>> number by using cpu_used_mask.
>>
>> To keep cpu number, cpumask must not be cleared by hot removing CPU.
>> If cpumask is cleared by hot removing CPU, the cpumask cannot be used
>> to keep CPU number.
>>
>> Currently, cpu_present_map is used to assign CPU number. But the cpumask
>> is cleared by hot removing CPU since the mask is prepared to remember
>> existed CPUs in the system. So the cpu_present_map must be cleared
>> at CPU hot remove.
>>
>> I confirmed whether present cpumasks (cpu_possible_map, cpu_online_map
>> et al) is usable or not for this purpose. But there is no cpumask that
>> can be used to keep CPU number. So I prepared new cpu bitmask.
>>
>>> How about just finding the first apicid_to_cpuid[apicid] < 0
>>> and dropping not needed anymore bitmask.
>>
>> When apicid_to_cpuid[] return -1, kernel assigns new CPU number. For
>> this, the cpu_used_mask is necessary.
>
> And we can't have that - we cannot have cores which had number X get
> number Y after hotplug.
>

> Can you send a full dmesg after you've done a physical node hotplug on a
> machine? Privately is fine too.

O.K.
I'll send dmesg.

Thanks,
Yasuaki Ishimatsu

>
> Boot with
>
> 	"ignore_loglevel log_buf_len=10M debug apic=debug show_lapic=all"
>
> please.
>
> Thanks.
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ