On 11/03/15 15:58, Janusz Mocek wrote:
> W dniu 03.11.2015 o 14:31, Laszlo Ersek pisze:
>> On 11/03/15 13:34, Paolo Bonzini wrote:
>>>
>>> On 03/11/2015 02:14, Laszlo Ersek wrote:
>>>> Anyway, with the following host kernel change, the AP startup problem
>>>> goes away (tested on top of v4.3):
>>>>
>>>>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>>>>> index 9a9a198..4f978ad 100644
>>>>>> --- a/arch/x86/kvm/x86.c
>>>>>> +++ b/arch/x86/kvm/x86.c
>>>>>> @@ -622,7 +622,8 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long 
>>>>>> cr0)
>>>>>>          if ((cr0 ^ old_cr0) & update_bits)
>>>>>>                  kvm_mmu_reset_context(vcpu);
>>>>>>
>>>>>> -        if ((cr0 ^ old_cr0) & X86_CR0_CD)
>>>>>> +        if (!kvm_check_has_quirk(vcpu->kvm, 
>>>>>> KVM_X86_QUIRK_CD_NW_CLEARED) &&
>>>>>> +            (cr0 ^ old_cr0) & X86_CR0_CD)
>>>>>>                  kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL);
>>>>>>
>>>>>>          return 0;
>>>> (Honestly I just imitated fb279950ba here; I'm not making any better
>>>> argument for this diff. But, independently, I wonder why this hunk
>>>> didn't have the noncoherent DMA check either, originally.)
>>> Great job.  I look forward to the testing results.
>>>
>>> It should also have the noncoherent DMA check, in fact, though that's
>>> just an optimization and it would have masked the bug on your system.
>> Thank you! I'll wait for Janusz's results, and if stuff works, I'll post
>> the patch with the update you're suggesting (zap only if the guest has
>> noncoherent DMA and lacks the quirk).
>>
>> Laszlo
>>
>>> Thanks,
>>>
>>> Paolo
>>>
>>>> Janusz, could you rebuild your host kernel with this patch, and share
>>>> the results? (I'm also attaching the same as a formatted patch, so you
>>>> can apply it with "git am" easily.)
> Looks like its working correctly now
> 

Awesome, thank you for testing it. I'll put together a patch.

Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to