On 04/09/2012 04:55 PM, Xiao Guangrong wrote: > > Okay, let's simplify it as possible: > > - let it only fix the page fault with PFEC.P == 1 && PFEC.W = 0, that means > unlock set_spte path can be dropped > > - let it just fixes the page fault caused by dirty-log that means we always > skip the spte which write-protected by shadow page protection. > > Then, things should be fair simper: > > In set_spte path, if the spte can be writable, we set ALLOW_WRITE bit > In rmap_write_protect: > if (spte.PT_WRITABLE_MASK) { > WARN_ON(!(spte & ALLOW_WRITE)); > spte &= ~PT_WRITABLE_MASK; > spte |= WRITE_PROTECT; > } > > in fast page fault: > > if (spte & PT_WRITABLE_MASK) > return_go_guest; > > if ((spte & ALLOW_WRITE) && !(spte & WRITE_PROTECT)) > cmpxchg spte + PT_WRITABLE_MASK > > The information all we needed comes from spte it is independence from other path, > and no barriers. > > > Hmm, how about this one? > I like it. WRITE_PROTECT is better than my ALLOW_WRITES, the meaning is clearer. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html