Re: [PATCH v3 3/11] KVM: MMU: fix direct sp's access corruptted

2010-07-01 Thread Marcelo Tosatti
On Thu, Jul 01, 2010 at 08:50:58AM +0800, Xiao Guangrong wrote: > > > Marcelo Tosatti wrote: > > >> - if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) > >> - continue; > >> + if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) { > >> +

Re: [PATCH v3 3/11] KVM: MMU: fix direct sp's access corruptted

2010-06-30 Thread Xiao Guangrong
Marcelo Tosatti wrote: >> -if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) >> -continue; >> +if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) { >> +struct kvm_mmu_page *child; >> +unsigned

Re: [PATCH v3 3/11] KVM: MMU: fix direct sp's access corruptted

2010-06-30 Thread Marcelo Tosatti
On Wed, Jun 30, 2010 at 04:03:28PM +0800, Xiao Guangrong wrote: > If the mapping is writable but the dirty flag is not set, we will find > the read-only direct sp and setup the mapping, then if the write #PF > occur, we will mark this mapping writable in the read-only direct sp, > now, other real r

[PATCH v3 3/11] KVM: MMU: fix direct sp's access corruptted

2010-06-30 Thread Xiao Guangrong
If the mapping is writable but the dirty flag is not set, we will find the read-only direct sp and setup the mapping, then if the write #PF occur, we will mark this mapping writable in the read-only direct sp, now, other real read-only mapping will happily write it without #PF. It may hurt guest's