From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 11 12:25:03 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C399A106567B; Fri, 11 Jun 2010 12:25:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9130D8FC1A; Fri, 11 Jun 2010 12:25:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 429C946C13; Fri, 11 Jun 2010 08:25:03 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 798388A04F; Fri, 11 Jun 2010 08:25:02 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 11 Jun 2010 07:56:10 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <20100609121453.095d92b4@kibab.com> <20100610160109.19585782fyr3buw4@webmail.leidinger.net> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006110756.10287.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 08:25:02 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Kostik Belousov , Alexander Leidinger , Adrian Chadd , Garrett Cooper , Ilya Bakulin Subject: Re: GSoC: registration of optional kernel features via sysctl: a question to the community X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 12:25:03 -0000 On Friday 11 June 2010 12:28:58 am Adrian Chadd wrote: > How about exposing a simple userspace API for doing this, rather than > doing it via sysctl? > > That way you could "simply" tie alternative overrides in as needed for > builds (eg, environment variables setting overrides; and/or pointing > to a configuration file with such) but not affect any runtime > detection the rest of the system is doing. man 3 feature_present I don't see much practical use for spoofing. If there really was a desire for such a thing, then perhaps you could implement it in libc keyed off environment variables. It would perhaps be useful to have a feature_present(1) for ports that uses the API instead of using the sysctls directly, but I really don't think there are any useful cases for spoofing. At Y! we used kern.features.pae in kmod.mk to automatically enable PAE in standalone kernel module builds if the running kernel was using PAE since PAE alters the kernel ABI. -- John Baldwin