From owner-freebsd-current@freebsd.org Sat Feb 15 20:01:05 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A071C246F3A for ; Sat, 15 Feb 2020 20:01:05 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Kh2T3pJgz3JJP; Sat, 15 Feb 2020 20:01:05 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300CD5F0C35002176EF40A6C93250.dip0.t-ipconnect.de [IPv6:2003:cd:5f0c:3500:2176:ef40:a6c9:3250]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id EED241A4EE; Sat, 15 Feb 2020 20:01:04 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: option KDTRACE_HOOKS non-optional after r357912? To: Konstantin Belousov Cc: Mateusz Guzik , freebsd-current@freebsd.org References: <57662d12-5c9f-c947-70ca-d1032b82fb3b@freebsd.org> <20200215174543.GU4808@kib.kiev.ua> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: <185a5721-e891-2c4d-7fc3-b3fbb75f49d7@freebsd.org> Date: Sat, 15 Feb 2020 21:01:01 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200215174543.GU4808@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 15 Feb 2020 20:01:05 -0000 Am 15.02.20 um 18:45 schrieb Konstantin Belousov: > On Sat, Feb 15, 2020 at 03:58:06PM +0100, Stefan Eßer wrote: >> Am 15.02.20 um 15:40 schrieb Stefan Eßer: >>> Am 15.02.20 um 14:47 schrieb Mateusz Guzik: >>>> On 2/15/20, Stefan Eßer wrote: >>>>> Hi Mateusz, >>>>> >>>>> your optimization of systrace checks has made KDTRACE_HOOKS mandatory, >>>>> since there are unprotected assignments to systrace_enabled (which is >>>>> defined as constant 0 in kernels without KDTRACE_HOOKS due to your >>>>> change): >>>>> >>>>> /sys/cddl/dev/systrace/systrace.c:322:20: error: expression is not >>>>> assignable >>>>> systrace_enabled = true; >>>>> ~~~~~~~~~~~~~~~~ ^ >>>>> /sys/cddl/dev/systrace/systrace.c:334:20: error: expression is not >>>>> assignable >>>>> systrace_enabled = false; >>>>> ~~~~~~~~~~~~~~~~ ^ >>>>> 2 errors generated. >>>>> *** [systrace.o] Error code 1 >>>>> >>>>> The easy work-around is of course to add KDTRACE_HOOKS to the stripped >>>>> down kernel configuration. But I think there should be stab functions >>>>> in systrace.c to cover the case that this option is not active. >>>>> >>>>> Or is the overhead and other impact of KDTRACE_HOOKS considered to be >>>>> so insignificant that it should be included in every kernel? >>>> >>>> Well tinderbox built for me. >>> >>> Yes, no surprise, KDTRACE_HOOKS is defined in all the GENERIC kernels. >>> >>>> Note that the module strongly depends on KDTRACE_HOOKS to work in the >>>> first place -- even prior to my patch support in the syscall path was gated by >>>> this define. In other words, the module should not be being built if the option >>>> is not enabled. Thus if anything the change adds an unintended improvement >>>> of catching the lack of dependency checking here. I may take a closer look >>>> later but preferably someone familiar with the build system would take >>>> care of it. >>> >>> If KDTRACE_HOOKS is meant to be kept optional, the hooks should not be >>> compiled in and the functions to enable that feature should return >>> failure, IMHO. >> >> A clarification: The above was of course meant for the case that the >> option has not been specified. It has been activated, I do not expect >> the enable function to return failure ... >> > Try https://reviews.freebsd.org/D23699 That version fixed the issues for me - kernel and world could be built and installed using the previously broken configuration. Thank you for the quick fix. Regards, STefan