Page 1 of 1

duplicating kernel memory mapping across page directories

Posted: Fri Sep 29, 2017 7:36 am
by stdcall
Hi.
I'm wondering how to map kernel memory that will be represented in all available page_directories.
The only way I can think of is to keep a linked list of all page_directories and update them on every mapping / unmapping.
Is there a better way ?

Thanks,
Ramon.

Re: duplicating kernel memory mapping across page directorie

Posted: Fri Sep 29, 2017 9:07 am
by Korona
Share the top-level paging struct entries, as I explained here.

Re: duplicating kernel memory mapping across page directorie

Posted: Fri Sep 29, 2017 10:09 am
by JAAman
of course if you are using PAE (or LMode) you can take an entire directory entry (or 2) for the global kernel, then updates to the kernel address space are automatically propagated to all address spaces without doing anything at all (of course with SMP you will need to notify any other CPUs so they can invalidate any necessary TLBs) and no modification of any address spaces other than the current one are ever necessary