Page 1 of 1
SMP Paging
Posted: Fri Apr 08, 2022 10:06 am
by Kamal123
Hi, I have SMP support in my kernel, AP's boots up to 64 bit mode, then finally GDT,IDT and APIC initialised inside AP's startup routine, the problem is that, if I map a virtual page before starting AP's, it gets mapped and I can write to that virtual page but after starting the AP's I cannot access that particular virtual page from inside AP's routine, it page fault even if I use BSP's pml4 for all AP's. But if I map a virtual page from inside AP's and after startup of all AP's i can use that virtual page from BSP, it works. I use BSP's pml4 for all other application processors.
Thanks
Re: SMP Paging
Posted: Fri Apr 08, 2022 11:43 am
by Octocontrabass
It sounds like you might have a memory corruption bug.
- The BSP maps the page
- The BSP accesses the page, loading the translation into its TLB
- The page is unmapped due to a bug
- The BSP can still access the page using its TLB, but the APs page fault
If you flush the BSP's TLB, can it still access the page? What is the page fault error code?
Re: SMP Paging
Posted: Fri Apr 08, 2022 1:03 pm
by Kamal123
Hi,
After experimenting, I came to know, only the heap memory area get unmapped after APs initialisation, and also it is not accessible from AP's routine..I checked all memory mappings using qemu, and only missing area is - kernel heap memory area. The page fault exception bit is-- present bit..