diff --git a/src/system/kernel/arch/x86/arch_cpu.cpp b/src/system/kernel/arch/x86/arch_cpu.cpp index 6924dd53b7..d195c8988b 100644 --- a/src/system/kernel/arch/x86/arch_cpu.cpp +++ b/src/system/kernel/arch/x86/arch_cpu.cpp @@ -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); } } diff --git a/src/system/kernel/arch/x86/paging/X86VMTranslationMap.cpp b/src/system/kernel/arch/x86/paging/X86VMTranslationMap.cpp index ab695d15b5..5687599b5a 100644 --- a/src/system/kernel/arch/x86/paging/X86VMTranslationMap.cpp +++ b/src/system/kernel/arch/x86/paging/X86VMTranslationMap.cpp @@ -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 {