Received: by 10.192.165.148 with SMTP id m20csp1850000imm; Thu, 26 Apr 2018 03:14:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx48fnh60G1/OoL77ofggDRqAY0hbhSUZ4X+UiPKE9mq9ZxTNf2xlr74XNnvhssS+hNXw+Du1 X-Received: by 10.99.100.69 with SMTP id y66mr26719380pgb.206.1524737693196; Thu, 26 Apr 2018 03:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524737693; cv=none; d=google.com; s=arc-20160816; b=IrcsbWxooDT+padrKqIqlKFVufY0jWlQZaOuiW8Bc0dhGRPhuwzxzosGe4TlyNQdpA j5hap6HyRj4G1F3ynVOoMKXu63gSVG9DCtgsECtkpXyRQ4W13vizIyySnj8kIqAPEijC 6JZn4l4ghZOm7IaXVLKlvV1ptBcDZwbGWp2WH39IGGVdqPibU3/bt6GNkKvdZFI+uMwr BXyAh5aYVTwz+dAjsx0Ipt7oMzwe0TiRvQCu2hqkN1nenV1M0Rm9yuYOnjS3xWU+g7wX Q28CgrQjFxs5NzcmTp7kAO6RixtkDem5vfuuPR+zBoxjEg6fK9UtOS50/1Brun1peozF HhBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=mgwd/QW2Tu+zUGSiNAz20bZnDzMK3u0mr8zhtJsbhCY=; b=fw4vj2JYLBKGJ2PddJoYmmjUgl8aOat9ejU3O5qN9BfrHYgvWUzIMxHEbRk1KVUftp Nj/e54Nykm65/YTqSTZOwLmyz+0UC98dNJ7450OUtpWw1LgDPMHDt0p3mURopvzofs4S KRjnn3hgVFWFGvXjbU7WEB0lGDNIP52/3Aw1nzTRNqYc0bHUXBxjnBHImZxmI66eNB5G +ILI7DwF/VbTEcoHjXFv7eZ197bJow0DfrERVu1XmtNWyfH/+kr70XEthLqKYAaLiaWX WI+63+2/UszZRHQS1n/jwdPe3UX2yFdIVszGgrPZq+pSPF5plFe9Bf07VmfyV7qU/xO3 iGsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si15537083pgr.472.2018.04.26.03.14.39; Thu, 26 Apr 2018 03:14:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755071AbeDZKNJ (ORCPT + 99 others); Thu, 26 Apr 2018 06:13:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50618 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754081AbeDZKM7 (ORCPT ); Thu, 26 Apr 2018 06:12:59 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AF5115AD; Thu, 26 Apr 2018 03:12:59 -0700 (PDT) Received: from localhost (unknown [10.37.12.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8174D3F487; Thu, 26 Apr 2018 03:12:58 -0700 (PDT) Date: Thu, 26 Apr 2018 12:12:56 +0200 From: Christoffer Dall To: Auger Eric Cc: eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, cdall@kernel.org, peter.maydell@linaro.org, andre.przywara@arm.com, drjones@redhat.com, wei@redhat.com Subject: Re: [PATCH v3 08/12] KVM: arm/arm64: Check vcpu redist base before registering an iodev Message-ID: <20180426101256.GC19872@C02W217FHV2R.local> References: <1523607658-9166-1-git-send-email-eric.auger@redhat.com> <1523607658-9166-9-git-send-email-eric.auger@redhat.com> <20180424210759.GI4533@C02W217FHV2R.local> <73b8e64b-3c14-b937-487a-78f3cc73fde5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73b8e64b-3c14-b937-487a-78f3cc73fde5@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 11:25:06AM +0200, Auger Eric wrote: > Hi Christoffer, > > On 04/24/2018 11:07 PM, Christoffer Dall wrote: > > On Fri, Apr 13, 2018 at 10:20:54AM +0200, Eric Auger wrote: > >> As we are going to register several redist regions, > >> vgic_register_all_redist_iodevs() may be called several times. We need > >> to register a redist_iodev for a given vcpu only once. > > > > Wouldn't it be more natural to change that caller to only register the > > iodevs for that region? > > vgic_register_redist_iodev() is the place where we decide where we map a > given vcpu redist into a given redist region. > > Calling vgic_register_redist_iodev for only the vcpus mapping to the > redist region would force to inverse the logic. I think it would bring > more upheavals in the code than bringing benefit? > > This new check somehow corresponds to what we had before: > " > if (IS_VGIC_ADDR_UNDEF(vgic->vgic_redist_base)) > return 0; > " Ah, this is because we don't enforce any ordering between creating the redistributors and initializing the vcpus, this always confuses me. Fine, let's leave it as you suggest here. Thanks, -Christoffer