AnsweredAssumed Answered

The mechanics of switching between user/supervisor/hypervisor mode

Question asked by Mike Lackey on Apr 12, 2018
Latest reply on Apr 16, 2018 by Mike Lackey

I am looking for a P4080/e500mc document that describes the mechanics of writing code to switch between user/supervisor/hypervisor mode.  I'm new to this, and not sure how it works.  I've looked in the e500mc ref manual, the P4080 programmer's manual, google, and this community.  I'm probably not asking the right question.


My SWAG is that privilege is controlled by the MMU configuration.  Example, say three small-ish blocks of virtual memory, one configured with user only privs, one with supervisor privs, and one with hypervisor privs.  At startup the code (by default running in hypervisor space) configures the MMU to provide three blocks of memory, such that each block has differing privs.  When initialization is complete, jumping to the address space of another block automagically updates the MSR.  Stated differently, the MSR is changed to what is configured for that block.  So there really is no code to switch back and forth, just transferring control from one block to another causes the MSR to be updated with the privs assigned to that block.


Is there a doc that describes the mechanics of this?