Received: by 10.192.165.148 with SMTP id m20csp2720997imm; Sun, 29 Apr 2018 05:36:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqmU9ejU0c9Dxgi+MEcFuJdxyliqAb4Ur6f2mtJ/OIJXXx5uNY9ILI1WaX/bXUNaSR9+nEb X-Received: by 2002:a63:6c04:: with SMTP id h4-v6mr7608984pgc.220.1525005394449; Sun, 29 Apr 2018 05:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525005394; cv=none; d=google.com; s=arc-20160816; b=gjW1VTqgagKHbjCmN4c4O1lbMcfFmlpZCMD/FkpkwT3AIYfiti8+EFHsb8ehOwQh2u iOsxXD3Mv6F7NLOoKQu/R0agDWbGPfVlXbukAtEzWL0CvD8rb7hrXDR2+m7eVrJ0kBhc C3D4AHIc0lKRX6I8+r9dccxZ9blgtquvPIX/E9Vf+OxkGjs94tNToTYpo1bSP3WeGHF6 Qx1hrtWUL64PP9ngI12IKCd36hmUMtbT9hOv4mrM8/SMKtMkqz5b6Xl5iKKq2rV0rzlb mqRLK/51GENVjjXQK7O3IQbqdC4vdcKlJbFaY/wx0zEGdhtwarkdx+hLjf2lhyE55XBu F/cA== 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=7pN3AwTXHj326mT83ygavUCd4IjIt02hZ2s05R0+WpA=; b=OqmB7gvlAdgA39r2MAyEhzZ7gnA6utpYY8Y0+3zFEBRiYz/CCGG5HT+NIKRtOEkglG 2OXg7tm2hkddAEavZRHLo+EeOmKsozfng4Ov2gQAozPcw0lfTtN5v3z4kd7F5eFxfU87 RRPVYRfqaBX16ftR9EdBWEvyut2uR2j4oLDnh1nl5uZn1v4g0/yqme/awHuKQoWeFKGz pD94dXALR5fjW88LjFCDYA9u6AmkWLZO1+x8HPCRU/Oa8yVEtt4xipFsq/v3hO3ADAFd DRqJ5+WibSHI1o6tg+ORN2KyJ8bYPiltCWWBSL10ayBtgdjTay/cmi2gwDozooxuPTRL 5FOQ== 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 202si5605716pfx.61.2018.04.29.05.36.18; Sun, 29 Apr 2018 05:36:34 -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 S1753558AbeD2Mfi (ORCPT + 99 others); Sun, 29 Apr 2018 08:35:38 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52460 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753469AbeD2Mfg (ORCPT ); Sun, 29 Apr 2018 08:35:36 -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 B6F641529; Sun, 29 Apr 2018 05:35:35 -0700 (PDT) Received: from localhost (unknown [10.37.8.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 269F83F25D; Sun, 29 Apr 2018 05:35:34 -0700 (PDT) Date: Sun, 29 Apr 2018 14:35:33 +0200 From: Christoffer Dall To: Eric Auger Cc: eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, peter.maydell@linaro.org, andre.przywara@arm.com Subject: Re: [PATCH v4 09/12] KVM: arm/arm64: Check all vcpu redistributors are set on map_resources Message-ID: <20180429123533.GE7512@C02W217FHV2R.local> References: <1524838505-3823-1-git-send-email-eric.auger@redhat.com> <1524838505-3823-10-git-send-email-eric.auger@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524838505-3823-10-git-send-email-eric.auger@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 Fri, Apr 27, 2018 at 04:15:02PM +0200, Eric Auger wrote: > On vcpu first run, we eventually know the actual number of vcpus. > This is a synchronization point to check all redistributors > were assigned. On kvm_vgic_map_resources() we check both dist and > redist were set, eventually check potential base address inconsistencies. > > Signed-off-by: Eric Auger Reviewed-by: Christoffer Dall > > --- > > v3 -> v4: > - use kvm_debug > --- > virt/kvm/arm/vgic/vgic-v3.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c > index c4a2a46..5563671 100644 > --- a/virt/kvm/arm/vgic/vgic-v3.c > +++ b/virt/kvm/arm/vgic/vgic-v3.c > @@ -484,16 +484,25 @@ struct vgic_redist_region *vgic_v3_rdist_free_slot(struct list_head *rd_regions) > > int vgic_v3_map_resources(struct kvm *kvm) > { > - int ret = 0; > struct vgic_dist *dist = &kvm->arch.vgic; > - struct vgic_redist_region *rdreg = > - list_first_entry(&dist->rd_regions, > - struct vgic_redist_region, list); > + struct kvm_vcpu *vcpu; > + int ret = 0; > + int c; > > if (vgic_ready(kvm)) > goto out; > > - if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) || !rdreg) { > + kvm_for_each_vcpu(c, vcpu, kvm) { > + struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; > + > + if (IS_VGIC_ADDR_UNDEF(vgic_cpu->rd_iodev.base_addr)) { > + kvm_debug("vcpu %d redistributor base not set\n", c); > + ret = -ENXIO; > + goto out; > + } > + } > + > + if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base)) { > kvm_err("Need to set vgic distributor addresses first\n"); > ret = -ENXIO; > goto out; > -- > 2.5.5 > > _______________________________________________ > kvmarm mailing list > kvmarm@lists.cs.columbia.edu > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm