Different privilege levels are defined in ARMv7. They are PL0, PL1, PL2. And each privilege level depends on Processor modes
Nine different processor modes are defined in ARMv7
User: This is the so-called user mode. It is at the lowest level and cannot access all resources of the system. The privilege level belongs to PL0
FIQ: Fast IRQ, fast interrupt mode, privilege level belongs to PL1
IRQ: Interrupt mode, the privilege level belongs to PL1
Supervisor: SVC mode or enter reset mode, the privilege level belongs to PL1
Monitor: Secture Monitor mode, only exists in Secure world, the privilege level belongs to PL1
Abort: Data Abort or command Abort mode, belongs to an abnormal mode, and the privilege level belongs to PL1
Hyp: Virtualization mode, only exists in normal world. Privilege level belongs to PL2
Undefined: Undefined instruction exception mode, privilege level belongs to PL1
System: System level mode, can access all resources of the system, the privilege level belongs to PL1
Confirm the relationship between privilege level and processor mode through the following diagram.
- User mode has the lowest privilege level and belongs to PL0
- The SVC mode is to enter the Reset mode or call the SVC instruction, and the SVC instruction is the so-called system call instruction in ARMv7. For example, when the open function is called, the system call will be triggered, and eventually the SVC instruction will fall into the kernel
- Monitor mode, only available in Secure world, monitor is used to switch between normal world and secure world
- System mode, generally the operating mode of the operating system
- Hyp mode, running on PL2, and only normal world exists
Look at a clearer diagram that shows the relationship between processor mode and privilege level
From this picture, you can clearly see the various privilege levels and the position of the processor mode at the privilege level.