[NTOS]
authorStefan Ginsberg <stefanginsberg@gmail.com>
Wed, 14 Oct 2015 19:33:35 +0000 (19:33 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Wed, 14 Oct 2015 19:33:35 +0000 (19:33 +0000)
commit5e026edfdc112f675536effe62347a73062a3cb4
tree0fa29759d3d37828654786e9e2ab60448fd1de7a
parentac979ac9f945cf03e9f92b41655848b23fb32227
[NTOS]
Add super-complicated handling of global pages to KeFlushCurrentTb (pretty much the same code which has been in HalpFlushTLB for the past ~6 years). This should be all that is required to make this feature work (everything else being in place already), and *seems* to work fine but is disabled under a switch until tested thoroughly.

Global pages, an important optimization that allows for not flushing the whole x86 TLB every time CR3 is changed (typically on context switch to a new process, or during process attach/detach), relies on us doing extra work whenever we do alter a global page. This is likely where any bugs will have to be flushed out!

Fixup Ki386EnableGlobalPage while we are at it -- disable/restore interrupts properly, and verify PGE-bit isn't set (nothing should have touched it before this routine, which is responsible for initializing it, so we shouldn't have to disable it). Fix, but disable, the CPU-sync spin as well as there should be no particular reason to do this for PGE-enabling during initialization (no other processor will be messing with PTEs at this stage, as compared to a call to KeFlushEntireTb).

Everyone, repeat after me: Global pages are awesome!

svn path=/trunk/; revision=69528
reactos/ntoskrnl/include/ntoskrnl.h
reactos/ntoskrnl/ke/i386/cpu.c
reactos/ntoskrnl/ke/i386/patpge.c
reactos/ntoskrnl/mm/ARM3/i386/init.c