lkml.org 
[lkml]   [2017]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/6] KVM: x86: make pic setup code look like ioapic setup
From
Date
Am 03.01.2017 um 17:12 schrieb Paolo Bonzini:
>
>
> On 03/01/2017 14:04, David Hildenbrand wrote:
>> Am 16.12.2016 um 16:10 schrieb Radim Krčmář:
>>> We don't treat kvm->arch.vpic specially anymore, so the setup can look
>>> like ioapic. This gets a bit more information out of return values.
>>
>> This originally saved us from a race condition as far as I can
>> reconstruct from the commit history. Think the problem was
>> vpic being set but routes not being set up yet.
>>
>> commit 71ba994c94a81c37185ef2fb5190844286ba9aca
>> Author: Paolo Bonzini <pbonzini@redhat.com>
>> Date: Wed Jul 29 12:31:15 2015 +0200
>>
>> KVM: x86: clean/fix memory barriers in irqchip_in_kernel
>>
>> The memory barriers are trying to protect against concurrent RCU-based
>> interrupt injection, but the IRQ routing table is not valid at the time
>> kvm->arch.vpic is written. Fix this by writing kvm->arch.vpic last.
>> kvm_destroy_pic then need not set kvm->arch.vpic to NULL; modify it
>> to take a struct kvm_pic* and reuse it if the IOAPIC creation fails.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>
>> I assume that this is now fixed via the irqchip_mode, as it is stored
>> last? If so, I really like this patch :)
>
> Yes, the previous patch referred to that when it said
> "irqchip_in_kernel() tried to save a bit by reusing pic_irqchip()", and
> what this commit message means by "not trteating kvm->arch.vpic
> specially anymore".

Thanks for confirming!

Reviewed-by: David Hildenbrand <david@redhat.com>

>
> Paolo
>


--

David

\
 
 \ /
  Last update: 2017-01-04 10:13    [W:0.153 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site