What does the User/Supervisor bit in the page table entry mean?
Asked Answered
C

1

6

I am trying to understand whether:

  1. the User/Supervisor bit is used to distinguish pages of kernel memory, from those of the user process
  2. the User/Supervisor bit changes when execution moves to the kernel while executing a system call
  3. Or perhaps none of them.

Can someone clarify?

Component answered 6/5, 2015 at 23:18 Comment(0)
F
4

On an Intel virtual memory system, the user/supervisor bit set to 1 for a certain page means "this page is accessible by a process executed in user mode (in contrast to supervisor mode)", see here.
In which mode a process is executed is determined by the supervisor bit in the CPUs status register. A 1 in the supervisor bit means execution in supervisor mode, see here. The supervisor bit in the status register changes, when execution moves to the kernel.
So both of your assumptions are true, but they relate to 2 different bits.

Fer answered 11/5, 2015 at 5:29 Comment(6)
if the page is set in supervised mode, does it mean that is in kernel memory?Component
Yes, kernel memory is the set of pages that can only be accessed by processes executed in supervisor mode, not in user mode. The supervisor bit in the page table is used by the memory management unit to protect it from user accesses. If a process is executed in supervisor or user mode is determined by the supervisor bit in the CPUs status word.Expertise
but can I set the supervised bit on on a user process page? or ALL the pages with supervised bit ARE in kernel memory?Component
If you set the SV bit on a user page, the user process can no longer access the page, which will result in a crash due to memory violation as soon as it tries. And, yes, ALL the pages with SV bit ARE THE kernel memory (if you say IN the kernel memory, this sounds as if this were a different memory, but it is only a set of pages distinguished by this bit).Expertise
can pages with SV bit on be paged out?Redhot
Yes, they can be paged out. But if the operating system does it, depend on the actual implementation.Expertise

© 2022 - 2024 — McMap. All rights reserved.