lkml.org 
[lkml]   [2020]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kvm: lapic: fix broken vcpu hotplug
From
Date
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

\
 
 \ /
  Last update: 2020-06-23 13:37    [W:0.189 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site