0

So can someone explain to me that what will happen if they did this and how much overhead will this cause, to have a seperate process for the kernel part of the virtual memory, and make a context switch when a process needs to access it? is it even possible?

and how often do normal user processes even need to jump in the kernel? do all the base functions like printf and scanf all end up in the kernel part of memory to execute their low level stuff?

I'm asking this because of the meltdown vulnerability, considering if it was implemented this way, then we would be safe from that attack

Mery Ted
  • 113
  • 1
  • 5
  • If you don't map the kernel code into process's memory space, every time you make a syscall you need to switch page table or flush TLB. A process running in user mode(ring 3 on x86) use syscall(sysenter or syscall instruction) to enter kernel mode(ring 0). printf needs to write to file, scanf needs to read from file, so they all end up with some syscall. Then you get your own answer about how often. – 炸鱼薯条德里克 Aug 23 '19 at 13:30
  • @StephenKitt so does the linux processes still have the kernel mapping in virtual memory? because after the meltdown attack some papers (KAISER paper) suggested a method to move the kernel mapping out of the virtual memory of user mode processes, so i assume this was never implemented correct? – Mery Ted Aug 23 '19 at 14:16
  • 1
    It was implemented, see the KPTI description in point 3 of my answer. – Stephen Kitt Aug 23 '19 at 14:27

0 Answers0