Re: [PATCH] svm: Add mutex_lock to protect apic_access_page_done on AMD systems

From: Paolo Bonzini
Date: Sun Nov 25 2018 - 12:34:53 EST


On 12/11/18 14:37, joro@xxxxxxxxxx wrote:
> On Mon, Nov 12, 2018 at 12:23:14PM +0000, Suthikulpanit, Suravee wrote:
>> From: Wei Wang <wawei@xxxxxxxxx>
>>
>> There is a race condition when accessing kvm->arch.apic_access_page_done.
>> Due to it, x86_set_memory_region will fail when creating the second vcpu
>> for a svm guest.
>>
>> Add a mutex_lock to serialize the accesses to apic_access_page_done.
>> This lock is also used by vmx for the same purpose.
>>
>> Signed-off-by: Wei Wang <wawei@xxxxxxxxx>
>> Signed-off-by: Amadeusz Juskowiak <ajusk@xxxxxxxxx>
>> Signed-off-by: Julian Stecklina <jsteckli@xxxxxxxxx>
>> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> Reviewed-by: Joerg Roedel <jroedel@xxxxxxx>

Queued, thanks.

Paolo