Re: [Xen-devel] xen_exit_mmap() questions
From: Jan Beulich
Date: Thu Apr 27 2017 - 03:40:34 EST
>>> On 27.04.17 at 02:55, <boris.ostrovsky@xxxxxxxxxx> wrote:
> The point of CR3 loading here, I believe, is to make sure the hypervisor
> knows that the (v)CPU is no longer using the the mm's cr3 (we are
> loading swapper_pgdir here).
Correct, or else there would still be a non-zero refcount for the
page tables hanging off of that CR3, disallowing those pages to
become writable, and in turn disallowing the use of direct writes
instead of hypercalls to clear the individual entries (or to be
precise, direct writes would still be allowed, but their use would
be even slower than using hypercalls because they would trap
into the hypervisor for emulation).
Jan