diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2011-11-28 10:59:10 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2012-04-17 10:29:37 -0400 |
commit | e323969ccda2d69f02e047c08b03faa09215c72a (patch) | |
tree | 27ed693ec5bb114773f267722bdd0db371a4f5a2 /arch/arm/mm | |
parent | 7fec1b57b8a925d83c194f995f83d9f8442fd48e (diff) |
ARM: Remove current_mm per-cpu variable
The current_mm variable was used to store the new mm between the
switch_mm() and switch_to() calls where an IPI to reset the context
could have set the wrong mm. Since the interrupts are disabled during
context switch, there is no need for this variable, current->active_mm
already points to the current mm when interrupts are re-enabled.
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Tested-by: Marc Zyngier <Marc.Zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/context.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 06a2e7ce23c..806cc4f6351 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -18,9 +18,6 @@ | |||
18 | 18 | ||
19 | static DEFINE_RAW_SPINLOCK(cpu_asid_lock); | 19 | static DEFINE_RAW_SPINLOCK(cpu_asid_lock); |
20 | unsigned int cpu_last_asid = ASID_FIRST_VERSION; | 20 | unsigned int cpu_last_asid = ASID_FIRST_VERSION; |
21 | #ifdef CONFIG_SMP | ||
22 | DEFINE_PER_CPU(struct mm_struct *, current_mm); | ||
23 | #endif | ||
24 | 21 | ||
25 | #ifdef CONFIG_ARM_LPAE | 22 | #ifdef CONFIG_ARM_LPAE |
26 | void cpu_set_reserved_ttbr0(void) | 23 | void cpu_set_reserved_ttbr0(void) |
@@ -108,14 +105,7 @@ static void reset_context(void *info) | |||
108 | { | 105 | { |
109 | unsigned int asid; | 106 | unsigned int asid; |
110 | unsigned int cpu = smp_processor_id(); | 107 | unsigned int cpu = smp_processor_id(); |
111 | struct mm_struct *mm = per_cpu(current_mm, cpu); | 108 | struct mm_struct *mm = current->active_mm; |
112 | |||
113 | /* | ||
114 | * Check if a current_mm was set on this CPU as it might still | ||
115 | * be in the early booting stages and using the reserved ASID. | ||
116 | */ | ||
117 | if (!mm) | ||
118 | return; | ||
119 | 109 | ||
120 | smp_rmb(); | 110 | smp_rmb(); |
121 | asid = cpu_last_asid + cpu + 1; | 111 | asid = cpu_last_asid + cpu + 1; |