kernel/x86: Always call arch_cpu_global_tlb_invalidate with interrupts disabled.
Fixes a race. Discovered by SED4906. Change-Id: I2b267312e9f3ff32bafa2ac2784f5d4a9905e24e Reviewed-on: https://review.haiku-os.org/c/haiku/+/10416 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
5d19bcda45
commit
de74304510
@@ -1994,16 +1994,13 @@ void
|
||||
arch_cpu_global_tlb_invalidate()
|
||||
{
|
||||
uint32 flags = x86_read_cr4();
|
||||
|
||||
if (flags & IA32_CR4_GLOBAL_PAGES) {
|
||||
if ((flags & IA32_CR4_GLOBAL_PAGES) != 0) {
|
||||
// disable and reenable the global pages to flush all TLBs regardless
|
||||
// of the global page bit
|
||||
x86_write_cr4(flags & ~IA32_CR4_GLOBAL_PAGES);
|
||||
x86_write_cr4(flags | IA32_CR4_GLOBAL_PAGES);
|
||||
} else {
|
||||
cpu_status state = disable_interrupts();
|
||||
arch_cpu_user_tlb_invalidate(0);
|
||||
restore_interrupts(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ X86VMTranslationMap::Flush()
|
||||
fInvalidPagesCount);
|
||||
|
||||
if (fIsKernelMap) {
|
||||
cpu_status state = disable_interrupts();
|
||||
arch_cpu_global_tlb_invalidate();
|
||||
restore_interrupts(state);
|
||||
smp_send_broadcast_ici(SMP_MSG_GLOBAL_INVALIDATE_PAGES, 0, 0, 0,
|
||||
NULL, SMP_MSG_FLAG_SYNC);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user