From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966484AbdADJKr (ORCPT ); Wed, 4 Jan 2017 04:10:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40504 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965280AbdADJKn (ORCPT ); Wed, 4 Jan 2017 04:10:43 -0500 Subject: Re: [PATCH v2 3/6] KVM: x86: make pic setup code look like ioapic setup To: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20161216151006.11776-1-rkrcmar@redhat.com> <20161216151006.11776-4-rkrcmar@redhat.com> <2cca2bc6-2702-0b2f-e744-f86cbdd80ef5@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <0d2c9e2d-f1f6-b107-2250-c323f9bc8edc@redhat.com> Date: Wed, 4 Jan 2017 10:10:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 04 Jan 2017 09:10:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> 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 >> >> 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 > > Paolo > -- David