Hello,
I am working on a modern port of Plan 9 (9front) to newer power systems and I seem to be a bit confused about how the hypervisor privilege state works. My current progress is getting code booted from skiboot under qemu using our compiler and linker and am currently working on setting up virtual memory. As part of getting this code booting I poked at some of the skiboot code and noticed that it was using instructions that would seem to indicate to me that skiboot is running in hypervisor mode. Specifically I see the assembly files in skiboot make use of the rfid and hrfid instructions at the "kernel"/OPAL API interface.
With all this I have some questions that it would be useful to have answered, I have tried to search the ISA and internet at large so far but have come up empty. If I am being run from skiboot is my kernel starting in hypervisor mode? How does one drop down from hypervisor state? As far as I understand a modified version of the traditional system call instruction is used for entering hypervisor state from privileged state, but it is unclear how to initiate that first drop in to privileged mode. It would also be a bit surprising to me that all page faults in userspace (within problem state) would require the privilege state to make a hypervisor systemcall in order to modify the page table. For the time being I don't plan to use more then 2 privilege states, more classical just userspace and kernel space would I do this with privilege state/problem state or with hypervisor state/problem state?
I also am a bit confused about exactly how the virtual memory works, how segments relate to the page table entry but I likely just need to reread that section of the manual and can save this until after I understand what I need to be doing with the privilege state and exceptions.
I am sorry if any of this is obvious, let me know if there are available resources that would answer my questions. I am not quite a POWER veteran nor a kernel programming veteran. I am learning a bit of each as I go here.
Thank you,
------------------------------
Jacob Moody
------------------------------