On Tue, May 05, 2020 at 08:16:03AM +0200, Jan Beulich wrote: > While the mere updating of ->pv_cr3 and ->root_pgt_changed aren't overly > expensive (but still needed only for the toggle_guest_mode() path), the > effect of the latter on the exit-to-guest path is not insignificant. > Move the logic into toggle_guest_mode(), on the basis that > toggle_guest_pt() will always be invoked in pairs, yet we can't safely > undo the setting of root_pgt_changed during the second of these > invocations.
I'm not sure if it would be worth to add a comment to note the intended usage of toggle_guest_pt is to fetch data from the kernel page tables when running in user mode. The one about using it in pairs is certainly fine. > While at it, add a comment ahead of toggle_guest_pt() to clarify its > intended usage. > > Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Roger Pau Monné <[email protected]> Thanks, Roger.
