Marcelo Tosatti wrote: >> >> Here CR3_TARGET_VALUEx is written. >> My question is: >> 1 why is vmcs_writel(CR3_TARGET_VALUE0 + idx*2, cr3); called by >> vmx_set_cr3(), but not called by mmu_free_roots()? >> > > By clearing guest_cr3 entry of the shared area we avoid the guest from > using it. > > So its unecessary to also clear the corresponding CR3_TARGET_VALUE0 > register. > > >> 2 since "cache" is also mapped to guest OS. Is calling >> vmcs_writel(CR3_TARGET_VALUE0 + idx*2, cr3); necessary? >> > > As said above, no, because the guest will check > cache->entry[idx].guest_cr3 before attempting to use a cached host_cr3 > value. >
Only if you trust the guest. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel