ARM: mm: remove IPI broadcasting on ASID rollover

ASIDs are allocated to MMU contexts based on a rolling counter. This
means that after 255 allocations we must invalidate all existing ASIDs
via an expensive IPI mechanism to synchronise all of the online CPUs and
ensure that all tasks execute with an ASID from the new generation.

This patch changes the rollover behaviour so that we rely instead on the
hardware broadcasting of the TLB invalidation to avoid the IPI calls.
This works by keeping track of the active ASID on each core, which is
then reserved in the case of a rollover so that currently scheduled
tasks can continue to run. For cores without hardware TLB broadcasting,
we keep track of pending flushes in a cpumask, so cores can flush their
local TLB before scheduling a new mm.

CRs-Fixed: 623919

Change-Id: I2ed0f2ab6635bf900bcb81e29efbd01991da8e86
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: b5466f8728527a05a493cc4abe9e6f034a1bbaab
Git-repo: https://android.googlesource.com/kernel/common/
[spathi@codeaurora.org: removed unused function set_asid().
The function cpu_set_reserved_ttbr0() is not available since patch
"ARM: Use TTBR1 instead of reserved context ID" is not merged
so used old functionlity by calling cpu_set_asid(0)]
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock""
Merge "Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock"""
Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock""
Merge "Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock"""
Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock""
Merge "Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock"""
Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock""
Merge "Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock"""
Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock""
Merge "Merge "Merge "msm: kgsl: Release process mutex appropriately to avoid deadlock"""
Merge "ARM: mm: remove IPI broadcasting on ASID rollover"
Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover""
Merge "Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover"""
Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover""
Merge "Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover"""
Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover""
Merge "Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover"""
Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover""
Merge "Merge "Merge "ARM: mm: remove IPI broadcasting on ASID rollover"""