• Linus Torvalds's avatar
    x86: don't call '->send_IPI_mask()' with an empty mask · b04e6373
    Linus Torvalds authored
    As noted in 83d349f3 ("x86: don't send
    an IPI to the empty set of CPU's"), some APIC's will be very unhappy
    with an empty destination mask.  That commit added a WARN_ON() for that
    case, and avoided the resulting problem, but didn't fix the underlying
    reason for why those empty mask cases happened.
    
    This fixes that, by checking the result of 'cpumask_andnot()' of the
    current CPU actually has any other CPU's left in the set of CPU's to be
    sent a TLB flush, and not calling down to the IPI code if the mask is
    empty.
    
    The reason this started happening at all is that we started passing just
    the CPU mask pointers around in commit 4595f962 ("x86: change
    flush_tlb_others to take a const struct cpumask"), and when we did that,
    the cpumask was no longer thread-local.
    
    Before that commit, flush_tlb_mm() used to create it's own copy of
    'mm->cpu_vm_mask' and pass that copy down to the low-level flush
    routines after having tested that it was not empty.  But after changing
    it to just pass down the CPU mask pointer, the lower level TLB flush
    routines would now get a pointer to that 'mm->cpu_vm_mask', and that
    could still change - and become empty - after the test due to other
    CPU's having flushed their own TLB's.
    
    See
    
    	http://bugzilla.kernel.org/show_bug.cgi?id=13933
    
    for details.
    Tested-by: default avatarThomas Björnell <thomas.bjornell@gmail.com>
    Cc: stable@kernel.org
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    b04e6373
tlb.c 7.62 KB