Received: by 10.192.165.148 with SMTP id m20csp2235170imm; Thu, 26 Apr 2018 07:54:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+LKEODTGmglg2p5sImhSnKqN96N+CuPwHyeMRdh6dRt+i3QR9VlraF/9Yxng2lERkDdrrW X-Received: by 10.99.126.71 with SMTP id o7mr27478636pgn.366.1524754458013; Thu, 26 Apr 2018 07:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524754457; cv=none; d=google.com; s=arc-20160816; b=ohqm8bD+rfdZ0uePB5RWN5OiI7SnJffP5Ko3XkS9qRYAGFc/mKysVQCjWYhM5U4GB7 jn8tmr+bkmXuJcT4+Wy7xRC1DRDasrOIk6Gn/vDT+YbDjwPK+A7C5bANob+jrkBG5Rea lRZR2TEaWv1QjaBOYW2UdtMhfoPlG2uNR0nxGnEgLKe6gJQxJhq/wHgAfCFFN5hCQRRX 4M/ZtxLqME4qOJl7ebPdnsC26w9Fgi0e5MPnCmvRs6BlvZ4+yCN1S1elenau6O8bOjmJ /VPaO+UBsgoOv8Mi4X8OjpxpLjmlhPvKC3JwzOtC8Ydhe97CgayvYB2P0wEeGTgh/CKp e+ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=8bQbIrVuZb8o/mZz0pRC2pj47pDoDs09adTcVh4nhDU=; b=vk5dlEsRsv30gXnOqine5+vtdkSfz4a6BfSjd7bnfKuAJAm7ATPFHvBYappMfboBwr TozTN67cQztcqGB6OdyHB2HKuu6EdGsUZzKiXxCxXAfnGs3Wt+2AjjBFjH6uAfRavvLy ZWC44dDGNtdqp+mrF3t/gPNduviB/RMs+baDejRAq59aG7kPA2aJ8JBFD7++1T7mnyvL fIaJIN4VlDr3rHoU0lYAPmIxzRqQcIFswy1ioO/w2odytUVEjv10CtTnmSqZn4jJypV+ /juEUMu8T+WU9ybec2SGUDuTJndbdl6N4ZjqJIQWIpVqRaiXTz52Uel8VyJ/2NqwCkxR pLNA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l188si1324827pfc.266.2018.04.26.07.54.03; Thu, 26 Apr 2018 07:54:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756658AbeDZOw3 (ORCPT + 99 others); Thu, 26 Apr 2018 10:52:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48822 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755861AbeDZOw2 (ORCPT ); Thu, 26 Apr 2018 10:52:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76E40722F4; Thu, 26 Apr 2018 14:52:27 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-141.ams2.redhat.com [10.36.116.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70F7C202323B; Thu, 26 Apr 2018 14:52:25 +0000 (UTC) Subject: Re: [PATCH v3 07/12] KVM: arm/arm64: Adapt vgic_v3_check_base to multiple rdist regions To: Christoffer Dall References: <1523607658-9166-1-git-send-email-eric.auger@redhat.com> <1523607658-9166-8-git-send-email-eric.auger@redhat.com> <20180424210748.GH4533@C02W217FHV2R.local> <557b2aaf-3f6f-ea11-55e2-5667b651922b@redhat.com> <20180426100615.GB19872@C02W217FHV2R.local> 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 From: Auger Eric Message-ID: <920c2d0d-0f68-6336-1f8c-06a813eeac62@redhat.com> Date: Thu, 26 Apr 2018 16:52:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20180426100615.GB19872@C02W217FHV2R.local> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 26 Apr 2018 14:52:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 26 Apr 2018 14:52:27 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eric.auger@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoffer, On 04/26/2018 12:06 PM, Christoffer Dall wrote: > On Thu, Apr 26, 2018 at 10:29:35AM +0200, Auger Eric wrote: >> Hi Christoffer, >> On 04/24/2018 11:07 PM, Christoffer Dall wrote: >>> On Fri, Apr 13, 2018 at 10:20:53AM +0200, Eric Auger wrote: >>>> We introduce a new helper to check there is no overlap between >>>> dist region (if set) and registered rdist regions. This both >>>> handles the case of legacy single rdist region (implicitly sized >>>> with the number of online vcpus) and the new case of multiple >>>> explicitly sized rdist regions. >>> >>> I don't understand this change, really. Is this just a cleanup, or >>> changing some functionality (why?). >>> >>> I think this could have come with the introduction of >>> vgic_v3_rdist_overlap() before patch 6, and then patch 6 could have been >>> simplified (hopefully) to just call this "check that nothing in the >>> world ever collides withi itself" function. >> I have merged this patch and vgic_v3_rd_region_size + >> vgic_v3_rdist_overlap and put it before this patch. >> >> Also I reworked the commit message which was unclear I acknowledge. >> >> With respect to using the adapted vgic_v3_check_base() in >> vgic_v3_insert_redist_region(), it is less obvious to me. >> >> In vgic_v3_insert_redist_region we do the checks *before* inserting the >> new rdist region in the list of redist regions. While >> vgic_v3_check_base() does the checks on already registered rdist and >> dist regions. So I would be tempted to leave >> vgic_v3_insert_redist_region() implementation as it is. >> > > ok, but do see my suggestion there to factor out the check, which should > make that function slightly easier to read. > > Then perhaps you can use that function from vgic_v3_check_base to check > that each rdist doesn't overlap with the distributor? I introduced the suggested additional helper, vgic_dist_overlap, to check a region does not overlap with the distributor region and used it in vgic_v3_insert_redist_region. However in vgic_v3_check_base I do not need it as I already use vgic_v3_rdist_overlap() which does the job, ie. check the dist against all registered redists. Thanks Eric > > Thanks, > -Christoffer >