[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1677b9af-fe23-242c-3160-9d9e6c1412c6@redhat.com>
Date: Tue, 23 Jun 2020 13:34:49 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Igor Mammedov <imammedo@...hat.com>
Cc: linux-kernel@...r.kernel.org, sean.j.christopherson@...el.com,
vkuznets@...hat.com, kvm@...r.kernel.org, wanpengli@...cent.com
Subject: Re: [PATCH] kvm: lapic: fix broken vcpu hotplug
On 23/06/20 13:13, Igor Mammedov wrote:
>>> + apic->vcpu->kvm->arch.apic_map_dirty = true;
>>> kvm_lapic_set_base(vcpu, vcpu->arch.apic_base);
>>> /* set SPIV separately to get count of SW disabled APICs right */
>>> apic_set_spiv(apic, *((u32 *)(s->regs + APIC_SPIV)));
>>>
>> Queued, but it's better to set apic_map_dirty just before the call to
>> kvm_recalculate_apic_map, or you can have a variant of the race that you
>> pointed out.
> Here I was worried about failure path as well that is just before normal
> kvm_recalculate_apic_map(), and has its own kvm_recalculate_apic_map().
>
> but I'm not sure if we should force map update in that case.
>
In that case kvm_lapic_set_base and apic_set_spiv will take care of it
(and if it kvm_apic_state_fixup writes LDR, it succeeds and you go down
the other path).
Paolo
Powered by blists - more mailing lists