Re: [PATCH] KVM: SVM: fix random segfaults with NPT enabled

Joerg Roedel
2008-08-28T15:19:53Z

On Thu, Aug 28, 2008 at 06:15:57PM +0300, Avi Kivity wrote:
> Joerg Rodel wrote:
> > I did a bit meditation about the softmmu code today. In the path of the
> > NPT fault the function kvm_mmu_free_some_pages() is called which itself
> > calls kvm_mmu_zap_page(). There the two functions
> > kvm_mmu_page_unlink_children() and kvm_mmu_unlink_parents() are called.
> > They both call mmu_page_remove_parent_pte() which modifies ptes. But
> > only the first function, kvm_mmu_page_unlink_children(), flushes remote
> > TLBs. The function kvm_mmu_unlink_parents() does not. Is this correct?
> >
> >
>
> It isn't correct. I'll move the flush below. Good catch.
>
> However, I can't believe this is responsible. There is very little page
> zapping going on with npt.

Ok, cool. But the bug happens only rarely so I think there is some
probability that this is the missing tlb flush, I think. But lets see.

Joerg