git: DragonFly_RELEASE_2_8 kernel - Fix pmap deactivate/reactiva

看板DFBSD_commit作者時間15年前 (2010/11/20 09:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 5fe0f3a651685a127bb7332a351368a578a5fbdf Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Sat Oct 23 09:43:18 2010 -0700 kernel - Fix pmap deactivate/reactivation race. * The LWKT thread switch code clears the cpu mask bit in proc->p_vmspace->vm_pmap.pm_active, and the switch-in code sets the mask bit. This code has a bug because the switch code ALSO optimizes the loading of %cr3 to avoid reloading it if it hasn't changed, for example when switching between two user threads associated with the process, because the other cpu(s) running similar threads may lose track of the fact that our cpu also needs an IPI for page invalidations in the pmap for a short period of time. Because we don't reload %cr3 in this case, our tlb can become invalid. This can also occur with vfork() sequences. * Fix by testing that we are switching to the same vmspace and do not clear the pm_active bit in that case. Retain the %cr3 optimization. Summary of changes: sys/platform/pc32/i386/swtch.s | 36 +++++++++-- sys/platform/pc64/x86_64/ipl.s | 2 +- sys/platform/pc64/x86_64/npx.c | 119 ----------------------------------- sys/platform/pc64/x86_64/swtch.s | 51 +++++++++------ sys/platform/pc64/x86_64/trap.c | 1 - sys/platform/vkernel64/x86_64/npx.c | 119 ----------------------------------- 6 files changed, 64 insertions(+), 264 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5fe0f3a651685a127bb7332a351368a578a5fbdf -- DragonFly BSD source repository
文章代碼(AID): #1CvoKkUM (DFBSD_commit)