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, 19 Jul 2012 19:05:51 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Borislav Petkov <bp@...en8.de>, msb@...omium.org, mingo@...nel.org,
	linux-kernel@...r.kernel.org, shaohua.li@...el.com,
	yinghai@...nel.org, tglx@...utronix.de, hpa@...or.com,
	x86@...nel.org, tj@...nel.org, akpm@...ux-foundation.org,
	sfr@...b.auug.org.au, cl@...two.org, olofj@...omium.org,
	paulmck@...ux.vnet.ibm.com, Alex Shi <alex.shi@...el.com>,
	Conny Seidel <conny.seidel@....com>
Subject: Re: [PATCH] x86, mm: Send tlb flush IPIs to online cpus only

On 07/19/2012 07:02 PM, Borislav Petkov wrote:
> On Thu, Jul 19, 2012 at 06:27:33PM +0530, Srivatsa S. Bhat wrote:
> 
> [ … ]
> 
>> So we are sending an IPI to a cpu which is now offline. Once a cpu is offline,
>> it will no longer respond to IPIs. This explains the softlockup.
>>
>> A cpu in the mm_cpumask could go offline before we send the invalidate
>> IPI causing us to wait forever. Avoid this by sending the IPI to only the
>> online cpus.
>>
>> [Since flush_tlb_others_ipi() is always called with preempt disabled, it is
>> not possible for a CPU to go offline once we enter this function, because
>> CPU offline goes through the stop_machine() stuff (which cannot proceed until
>> all preempt disabled sections are exited). So we don't have to worry about
>> any race between CPU offline and the target cpumask calculation in
>> flush_tlb_others_ipi().]
>>
>> Addresses http://crosbug.com/31737
>>
>> Reported-and-debugged-by: Mandeep Singh Baines <msb@...omium.org>
>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
>> Acked-by: Mandeep Singh Baines <msb@...omium.org>
>> Cc: Thomas Gleixner <tglx@...utronix.de>
>> Cc: Ingo Molnar <mingo@...hat.com>
>> Cc: "H. Peter Anvin" <hpa@...or.com>
>> Cc: x86@...nel.org
>> Cc: Tejun Heo <tj@...nel.org>
>> Cc: Andrew Morton <akpm@...ux-foundation.org>
>> Cc: Stephen Rothwell <sfr@...b.auug.org.au>
>> Cc: Christoph Lameter <cl@...two.org>
>> Cc: Olof Johansson <olofj@...omium.org>
>> ---
>>
>>  arch/x86/mm/tlb.c |    6 +++++-
>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
>> index 5e57e11..9d387a9 100644
>> --- a/arch/x86/mm/tlb.c
>> +++ b/arch/x86/mm/tlb.c
>> @@ -186,7 +186,11 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
>>  
>>  	f->flush_mm = mm;
>>  	f->flush_va = va;
>> -	if (cpumask_andnot(to_cpumask(f->flush_cpumask), cpumask, cpumask_of(smp_processor_id()))) {
>> +
>> +	cpumask_and(to_cpumask(f->flush_cpumask), cpumask, cpu_online_mask);
>> +	cpumask_clear_cpu(smp_processor_id(), to_cpumask(f->flush_cpumask));
>> +
>> +	if (!cpumask_empty(to_cpumask(f->flush_cpumask))) {
> 
> FWIW, there's code in tip/x86/mm which reworks all that and
> flush_tlb_others_ipi along with the 32 TLB flush vectors are being
> removed in favor of a smp_call_function_many thing. And it should be
> hotplug-safe since it must be called with preemption disabled anyway.
> 

Oh.. ok.. Then this patch is perhaps unnecessary..
Thanks for the info!

Regards,
Srivatsa S. Bhat

--
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