aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/tlb.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-09-05 18:21:22 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-09-05 18:21:22 -0400
commit2c910cb75e1fe6de52d95c8e32caedd1629a33a5 (patch)
tree94a0eea6f8cde689d11e7583ddd0a930b8785ab4 /arch/x86/mm/tlb.c
parent627212c9d49ba2759b699450f5d8f45f73e062fa (diff)
parentb53b1c08a23eb1091982daacb2122f90a7094a77 (diff)
Merge branch 'uverbs_dev_cleanups' into rdma.git for-next
For dependencies, branch based on rdma.git 'for-rc' of https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/ Pull 'uverbs_dev_cleanups' from Leon Romanovsky: ==================== Reuse the char device code interfaces to simplify ib_uverbs_device creation and destruction. As part of this series, we are sending fix to cleanup path, which was discovered during internal review, The fix definitely can go to -rc, but it means that this series will be dependent on rdma-rc. ==================== * branch 'uverbs_dev_cleanups': RDMA/uverbs: Use device.groups to initialize device attributes RDMA/uverbs: Use cdev_device_add() instead of cdev_add() RDMA/core: Depend on device_add() to add device attributes RDMA/uverbs: Fix error cleanup path of ib_uverbs_add_one() Resolved conflict in ib_device_unregister_sysfs() Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'arch/x86/mm/tlb.c')
-rw-r--r--arch/x86/mm/tlb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 9517d1b2a281..e96b99eb800c 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -305,6 +305,10 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
305 305
306 choose_new_asid(next, next_tlb_gen, &new_asid, &need_flush); 306 choose_new_asid(next, next_tlb_gen, &new_asid, &need_flush);
307 307
308 /* Let nmi_uaccess_okay() know that we're changing CR3. */
309 this_cpu_write(cpu_tlbstate.loaded_mm, LOADED_MM_SWITCHING);
310 barrier();
311
308 if (need_flush) { 312 if (need_flush) {
309 this_cpu_write(cpu_tlbstate.ctxs[new_asid].ctx_id, next->context.ctx_id); 313 this_cpu_write(cpu_tlbstate.ctxs[new_asid].ctx_id, next->context.ctx_id);
310 this_cpu_write(cpu_tlbstate.ctxs[new_asid].tlb_gen, next_tlb_gen); 314 this_cpu_write(cpu_tlbstate.ctxs[new_asid].tlb_gen, next_tlb_gen);
@@ -335,6 +339,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
335 if (next != &init_mm) 339 if (next != &init_mm)
336 this_cpu_write(cpu_tlbstate.last_ctx_id, next->context.ctx_id); 340 this_cpu_write(cpu_tlbstate.last_ctx_id, next->context.ctx_id);
337 341
342 /* Make sure we write CR3 before loaded_mm. */
343 barrier();
344
338 this_cpu_write(cpu_tlbstate.loaded_mm, next); 345 this_cpu_write(cpu_tlbstate.loaded_mm, next);
339 this_cpu_write(cpu_tlbstate.loaded_mm_asid, new_asid); 346 this_cpu_write(cpu_tlbstate.loaded_mm_asid, new_asid);
340 } 347 }