From owner-freebsd-current@FreeBSD.ORG Mon Nov 7 19:31:32 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0D76106566B; Mon, 7 Nov 2011 19:31:32 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id DD98A8FC15; Mon, 7 Nov 2011 19:31:31 +0000 (UTC) Received: by eyd10 with SMTP id 10so5064469eyd.13 for ; Mon, 07 Nov 2011 11:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=kLRUd1p4WICYXaV3QwZZDLuhCutxFbaO/X2YIliA0yw=; b=S6Il9ge4xpZq55tQ3Euujnesxbt0LXbzpecachfAS8yun+Uu+9auBdJNRP1UIhs2wM E2BjFRwMXzzuCszENegTeFI/GE2PvMKrYdCHqCSaoTxP+0QVQ7ctEoxEVawCoi/D6Seb fqmHZvILhVQuRKMMZlZMFFBcC79bGI/0RKEn8= MIME-Version: 1.0 Received: by 10.180.106.104 with SMTP id gt8mr9288131wib.6.1320694290900; Mon, 07 Nov 2011 11:31:30 -0800 (PST) Received: by 10.180.81.200 with HTTP; Mon, 7 Nov 2011 11:31:30 -0800 (PST) In-Reply-To: <4EB11C32.80106@FreeBSD.org> References: <4EB11C32.80106@FreeBSD.org> Date: Mon, 7 Nov 2011 14:31:30 -0500 Message-ID: From: Arnaud Lacombe To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Penta Upa , freebsd-current@freebsd.org, Benjamin Kaduk , "K. Macy" Subject: Re: panic at vm_page_wire with FreeBSD 9.0 Beta 3 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 19:31:32 -0000 Hi, On Wed, Nov 2, 2011 at 6:32 AM, Andriy Gapon wrote: > > [restored cc: to the original poster] > > on 02/11/2011 08:10 Benjamin Kaduk said the following: >> I am perhaps confused. =A0Last I checked, bsd.kmod.mk caused '-include >> opt_global.h' to be passed on the command line. =A0Is the issue just tha= t the >> opt_global.h used for the kmod could be different from the actual kernel= 's >> opt_global.h, because KERNCONF was not specified and the header is gener= ated at >> module-build time? =A0In this case, clearly the onus is on the user to p= ass >> KERNCONF at module build time. > > To be precise, this is what is actually passed to a compiler: > sys/conf/kmod.mk: > .if defined(KERNBUILDDIR) > CFLAGS+=3D =A0 =A0 -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/= opt_global.h > .endif > > where KERNBUILDDIR can be passed via environment from a kernel build: > sys/conf/kern.post.mk: > MKMODULESENV+=3D =A0KERNBUILDDIR=3D"${.CURDIR}" SYSDIR=3D"${SYSDIR}" > > KERNCONF does not have any meaning in a module build. > > To make sure that a module build sees exactly the same kernel options as = a > kernel with which the module should work, one has to either build the mod= ule > together with the kernel (within the kernel build; search for MODULES in > make.conf(5)) or to manually specify KERNBUILDDIR to point to a correct k= ernel > build directory. =A0(Which to a certain degree implies impossibility to b= uild a > "perfect" module for a pre-built binary kernel or to provide a "perfect" > universal pre-built module for any custom kernel) > > Of course, the real problem is that modules should not care about any (or= at > least some) kernel options, they should be isolated from the options via = a > proper KPI/KBI (perhaps DDI or "module-to-kernel interface" or whatever).= =A0A > module should be able to work correctly with kernels built with different= options. > You cannot be make a point in shade of gray, it either "must care" or "must not care" about kernel option, not "care about some, but not other". Moreover, you cannot advocate stable internal KBI/KPI when you are not even able to provide a stable userland ABI... > P.P.S. [and tangential] I see that many module makefiles fake up various = kernel > options in a fashion similar to the following: > .if !defined(KERNBUILDDIR) > opt_compat.h: > =A0 =A0 =A0 =A0echo "#define COMPAT_FREEBSD6 1" > ${.TARGET} > > opt_kbd.h: > =A0 =A0 =A0 =A0echo "#define KBD_INSTALL_CDEV 1" > ${.TARGET} > .endif > > And handful of modules fake up opt_global.h, e.g.: > opt_global.h: > =A0 =A0 =A0 =A0echo "#define ALTQ 1" =A0 =A0 > ${.TARGET} This mess is utterly broken. FWIW, I advocate to make KERNBUILDDIR (ie. kernel option's configuration) mandatory for building any modules. - Arnaud > -- > Andriy Gapon > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " >