Re: [patch] kvm: make cr3 loading more robust

Avi Kivity
2007-01-03T12:29:08Z

Ingo Molnar wrote:
>
>> The context switch paths need to do the same.
>>
>
> yeah. Although, as this example has shown it, such implicit assumptions
> carried into code tends to be volatile. Couldnt the kvm_mmu_zap_page()
> be done implicitly within kvm_mmu_alloc_page()? As long as the list is
> LRU, and the number of allocations done within a logical operation
> doesnt exceed the size of the LRU list (which it doesnt), this should be
> doable.
>

Right not the list is not LRU, so a zap can kill your parent page
table. I'm also worried about preserving invariants, as the page tables
are linked through a variety of data structures. Calling zap_page()
while another operation is in progress could cause corruption if
zap_page() kills one of your parents or children.