Re: [patch 3/3] KVM: MMU: prepopulate the shadow on invlpg

Avi Kivity
2008-11-02T08:39:14Z

Marcelo Tosatti wrote:
> Err, I'm on crack. The assumption is that the common case is pte
> invalidation + invlpg: kunmap_atomic, page aging clearing the
> accessed bit, page reclaim.
>
> Linux COW will invalidate + invlpg (do_wp_page) first:
>
> entry = mk_pte(new_page, vma->vm_page_prot);
> entry = maybe_mkwrite(pte_mkdirty(entry), vma);
> /*
> * Clear the pte entry and flush it first, before
> * updating the
> * pte with the new entry. This will avoid a race
> * condition
> * seen in the presence of one thread doing SMC and
> * another
> * thread doing COW.
> */
> ptep_clear_flush_notify(vma, address, page_table);
>
> Not sure about Windows.
>
>

Okay, so Linux won't win on this. But is there any downside, apart from
fetching the pte and reestablishing the spte?

--
error compiling committee.c: too many arguments to function