SMP Paging

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

SMP Paging

Post 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
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: SMP Paging

Post 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?
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: SMP Paging

Post 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..
Post Reply