How will a hypervisor reflect a change whenever there occurs a change in the guest page table of the guest OS. How is the correspondence maintained between guest page mapping and shadow page mapping?
One way is write protecting the memory addresses. Whenever there will be write into a guest p开发者_如何学Cage table, there will be a appropriate handler that will ensure the corresponding change into the shadow page table. Can I have some more inputs in this area?
If the hardware supports nested paging, the guest OS manages its page tables with no hypervisor involvement other than faulting physical pages into the guest's address space. Otherwise, some sort of shadow page tables are required, but the implementations vary wildly. Some hypervisors trap and rewrite guest OS page fault handling instructions into hypercalls to lower the overhead of maintaining shadow page tables. Paravirtualization puts the burden on the guest kernel to handle this. Hardware virtualization without nested paging traps to the hypervisor on guest page fault, which is slower, but less bug-prone than software-only methods.
精彩评论