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

Avi Kivity
2008-08-28T15:15:59Z

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.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.