Understanding the Role and Implementation of VMID in RISC-V Hypervisor hgatp during Guest OS Switching

36 Views Asked by At

I'm currently working on implementing a RISC-V hypervisor and have a question regarding hgatp during guest OS switches.

When HSXLEN=64, VMID is located in bits 44 to 57 of hgatp. Although I've consulted "The RISC-V Instruction Set Manual Volume II: Privileged Architecture Ver. 20211203," there is no information about the role of VMID. If VMID is indeed used for distinguishing guest OS instances, it's unclear how it is utilized afterward. The Privileged Architecture only explains its use during SFENCE instructions from within the guest OS. Are there any other applications for VMID?

Furthermore, when the hypervisor switches the guest OS, does hgatp need to be manually switched by software each time? Is there no mechanism in RISC-V hardware where changing the value of VMID in hgatp automatically switches the value of PPN inside hgatp?

0

There are 0 best solutions below