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

Avi Kivity
2008-08-27T15:50:29Z

Joerg Roedel wrote:
> On Wed, Aug 27, 2008 at 06:22:14PM +0300, Avi Kivity wrote:
>
>> Joerg Rodel wrote:
>>
>>> I will test it. Is the fix in your latest kernel.org tree?
>>>
>> It is now. It doesn't fix the problem.
>>
>>
>>> Reproduce it
>>> with a KVM guest and start tbench in it with around 100 clients
>>> configured. The tbench-process will crash when the bug is hit.
>>>
>>>
>> Does it reproduce with uniprocessor guests?
>>
>
> Don't know yet. We will try that.
>
>

It didn't reproduce here on uniprocessor, but I hadn't tried for long.

Some observations:

- tbench triggers many cases where we have concurrent faults on the same
address. these are serialized by mmu_lock. I tried to have
direct_map_entry() return is it detects a race. didn't help.
- I instrumented set_shadow_pte() to warn if changing the pfn or
writeable bit. Didn't trip.

Are there any rules for touching npt ptes concurrently?

Meanwhile, I applied the patch, but I'm very worried about this.

--
error compiling committee.c: too many arguments to function