From owner-freebsd-arm@FreeBSD.ORG Mon May 11 18:52:51 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45C3944B for ; Mon, 11 May 2015 18:52:51 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCFF1B00 for ; Mon, 11 May 2015 18:52:51 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t4BIqoIK007154 for ; Mon, 11 May 2015 18:52:50 GMT (envelope-from daemon-user@phabric-backend.isc.freebsd.org) Received: (from daemon-user@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t4BIqou8007153; Mon, 11 May 2015 18:52:50 GMT (envelope-from daemon-user) Date: Mon, 11 May 2015 18:52:50 +0000 To: freebsd-arm@freebsd.org From: "zbb (Zbigniew Bodek)" Subject: [Differential] [Commented On] D2377: Introduce ARM GICv3 support Message-ID: X-Priority: 3 Thread-Topic: D2377: Introduce ARM GICv3 support X-Herald-Rules: <28>, <31>, <32>, <34>, <8> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: MjA1ZGZkZWI5MTE4ZDk2Nzk0YzAyZGRiMWRiIFVQ+oI= Precedence: bulk X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 18:52:51 -0000 zbb added inline comments. INLINE COMMENTS sys/arm64/arm64/gic_v3.c:163 Hmm? I don't think you can call `init_func(sc);` here. It would be an error. Extra indirection seemed more convenient here since: 1. we will have at least one more function here 2. we have secondary cores initialization sequence (that andrew requested to be removed from this commit) and it is more convenient to see what are the differences between those thwo 3. the overhead of writing this loop is the same as writing 3-4 times: ``` err = func1(); if (err != 0) goto error; err = func2(); if (err != 0) goto error; .... ``` sys/arm64/arm64/gic_v3.c:191 OK. I will remove `i` from this loop. Regarding `gic_refists.nregions + 1` then AFAIK we have proper comment when allocating resource: ``` /* * Allocate array of struct resource. * One entry for Distributor and all remaining for Re-Distributor. */ ``` So now we have to comment on allocation and deallocation? sys/arm64/arm64/locore.S:192 This is the explanation from the documentation ("GIC bits"). If you look at the following line you see more detailed description what field setting means what ``` /* 0001 - SR CPU IF supported */ ``` I will make that line even more detailed in the next iteration.... REVISION DETAIL https://reviews.freebsd.org/D2377 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: zbb, emaste, ian, imp, andrew, brueffer, joel, wblock Cc: kostikbel, emaste, andrew, imp, freebsd-arm