From owner-freebsd-current@freebsd.org Sat Feb 15 13:47:14 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 E4EE023BA84 for ; Sat, 15 Feb 2020 13:47:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48KWl52yn3z4GcL for ; Sat, 15 Feb 2020 13:47:13 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x433.google.com with SMTP id k11so14295489wrd.9 for ; Sat, 15 Feb 2020 05:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dDt86fqKtZ1VtM9iGrUTY0jzhY0+QKGndvB7eKMI7nw=; b=VEz+zdjahd6mrXVMy6boHb7znGMX93I9xYtJvibBxf6eCohftn0S37eUUgsMtdigz2 8lHya5B6GJ0wIhgof3PE54dF6wpH3MQNVn/3E9R3GRA5bhPUTETkPtnySRS69rTMr25Y jqfWAJYEmHmPhPSN1T7wYvh/peSac/Gl8Bu5izojIVdPsNk2rFq5Xs0mnNZZKGDwEeDh isP2LuuiHJVG7moGxKBnrnj7YvxPINBFkoKcrFp4aDjFa/Hsu6fvImt4oAB/QeQzqoXr wXa7NGUfn6KMt0lP04idxdyw2/mehQhlzZdMJ7hGClZ4/6WFq57C3doz9a04WvWXAeS4 3qgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dDt86fqKtZ1VtM9iGrUTY0jzhY0+QKGndvB7eKMI7nw=; b=pfOknxsSA5wnvEqE8jDG6odWRgR6KFi/IUbqCLFrkw23kY457LBkMuVLtMAOgvP0Jj 66g4eArI2v5g0cArNTj6otQrNsNMA4TJulgE9Z2psDWYSC15hBI1egDaJcCmpTqhlSb7 I8YtDCQNUYnchtino+hYQV9wYEgtUxPBBXogobo6BGwk9tgLBuQfMDILRblwwEEwotIA 5AGYlKgO3h/290zjuNTV7cbBEwhjKVNm0y0EcW0/qEpYXU/OnASeaDvP5AKP/FPmg6AV Vp9R07KHLTa0jBvUvZWSKcQY3haxEb75boeLJqzPxJRqdNTkGBCna9BlpctfZEp4iipW Gc+w== X-Gm-Message-State: APjAAAUSdXgeLXEMgRyBluLZ8VwC6VoeNTiumVYtrWAv/Yx0Y7JOL65m YWLV4FAbfmaKOArL3vEBqSDVDA33W3Ujf0IgjdQ= X-Google-Smtp-Source: APXvYqzjEoRu23uV+gGGVBhplSF+Ju1M9uPSmbNCbTjb9RNAWhNjrCtgt+L4NjmeRdtbCmADIf7+tHfPZSp8o5e+HLo= X-Received: by 2002:adf:a1d9:: with SMTP id v25mr10130516wrv.160.1581774431369; Sat, 15 Feb 2020 05:47:11 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:6b02:0:0:0:0:0 with HTTP; Sat, 15 Feb 2020 05:47:10 -0800 (PST) In-Reply-To: References: From: Mateusz Guzik Date: Sat, 15 Feb 2020 14:47:10 +0100 Message-ID: Subject: Re: option KDTRACE_HOOKS non-optional after r357912? To: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= Cc: freebsd-current@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 48KWl52yn3z4GcL X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VEz+zdja; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[yahoo.de]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.06), ipnet: 2a00:1450::/32(-2.42), asn: 15169(-1.68), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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 13:47:15 -0000 On 2/15/20, Stefan E=C3=9Fer 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 =3D true; > ~~~~~~~~~~~~~~~~ ^ > /sys/cddl/dev/systrace/systrace.c:334:20: error: expression is not > assignable > systrace_enabled =3D 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. 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 op= tion 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. It comes with some overhead of course since there is no hot patching, but it is unlikely you will be able to measure it because of other factors. --=20 Mateusz Guzik