From owner-freebsd-arm@freebsd.org Wed Jul 15 09:26:59 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 491D89A1066 for ; Wed, 15 Jul 2015 09:26:59 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA101D3E for ; Wed, 15 Jul 2015 09:26:59 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by phabric-backend.isc.freebsd.org (Postfix, from userid 1346) id 2B61CE2FD; Wed, 15 Jul 2015 09:26:59 +0000 (UTC) Date: Wed, 15 Jul 2015 09:26:59 +0000 To: freebsd-arm@freebsd.org From: "wma_semihalf.com (Wojciech Macek)" Reply-to: D3094+327+b6ce39a707c1ba10@FreeBSD.org Subject: [Differential] [Commented On] D3094: Fix ARMv8 KSTACK_PAGES issue Message-ID: X-Priority: 3 Thread-Topic: D3094: Fix ARMv8 KSTACK_PAGES issue X-Herald-Rules: <28>, <31>, <32>, <34> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: MTE0MDI0ZWQ5YjVlYzUxYzUyMWU4OWFkZjdhIFWmJ2M= 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: Wed, 15 Jul 2015 09:26:59 -0000 wma_semihalf.com added inline comments. INLINE COMMENTS sys/arm64/include/param.h:98 Hm... isn't the argument about error vulnerability good enough? I'm pretty sure that sooner or later, when someone creates new file which uses KSTACK_PAGES he looks where is defined and includes forgetting about prior including of "opt_kstack_pages.h" (*). In that case the default value will be used regardless of the one set up in KERNCONF. The compiler won't show even slightest indication of an error and the bug will appear in the most unpredictable place. I remember how much time took to find this bug, because errors it caused were at the first look completely unrelated to anything. If we really want to have armv8 the tier1 architecture, I'd like to remove this piece of code because is dangerous. (*) All armv8 machdep files are the perfect example of that situation. The code was copied from armv7 (where I think that KSTACK_PAGES doesn't work either, but no one ever tried to change the default) and the bug propagated. REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D3094 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: wma_semihalf.com, emaste, zbb, andrew Cc: imp, andrew, freebsd-arm-list, emaste