File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ static void set_reserved_asid_bits(void)
92
92
bitmap_clear (asid_map , 0 , NUM_USER_ASIDS );
93
93
}
94
94
95
+ #define asid_gen_match (asid ) \
96
+ (!(((asid) ^ atomic64_read(&asid_generation)) >> asid_bits))
97
+
95
98
static void flush_context (void )
96
99
{
97
100
int i ;
@@ -220,16 +223,15 @@ void check_and_switch_context(struct mm_struct *mm, unsigned int cpu)
220
223
* because atomic RmWs are totally ordered for a given location.
221
224
*/
222
225
old_active_asid = atomic64_read (& per_cpu (active_asids , cpu ));
223
- if (old_active_asid &&
224
- !((asid ^ atomic64_read (& asid_generation )) >> asid_bits ) &&
226
+ if (old_active_asid && asid_gen_match (asid ) &&
225
227
atomic64_cmpxchg_relaxed (& per_cpu (active_asids , cpu ),
226
228
old_active_asid , asid ))
227
229
goto switch_mm_fastpath ;
228
230
229
231
raw_spin_lock_irqsave (& cpu_asid_lock , flags );
230
232
/* Check that our ASID belongs to the current generation. */
231
233
asid = atomic64_read (& mm -> context .id );
232
- if ((asid ^ atomic64_read ( & asid_generation )) >> asid_bits ) {
234
+ if (! asid_gen_match (asid ) ) {
233
235
asid = new_context (mm );
234
236
atomic64_set (& mm -> context .id , asid );
235
237
}
You can’t perform that action at this time.
0 commit comments