From nobody Thu Nov 07 15:43:49 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkmZc349Xz5c1cG; Thu, 07 Nov 2024 15:43:52 +0000 (UTC) (envelope-from kp@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkmZc2ZLfz45F1; Thu, 7 Nov 2024 15:43:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730994232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AL8TUioIRP6V8bClOiAG+bdrwp4lu/9pJGqlEYfRsnw=; b=iUTc9TJflxPnNVgzphnxpsaltodr2pW2G+xzjaNz3jPKjvd80mtJH+PrsQtb99Ioc2rKa/ oix84WZzXr9xCYhy3je0ZPEWcMz/9v0m6076aI4iKwH535TV4SKyC1A8a5vihLHVqdF7vO FX2p8YIH8KbO7zqK9dsx8SgyOSaR5+dM1AzvYjEVUCOlsqTxjzMHrGOBe2le/wm/rkaw9B rxwqpVNsp/h5sI4m3Iz5z8Vj4ATB7s6GmPHdywmnBFyUzVtKXGfV6A0Cl8ehU3DwWvxvyD eXv5Yl8HJUfCTCh2HZvzGkQrdABk2M1muo29yg1o3pUT4R9kdwF0/KlqinNFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730994232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AL8TUioIRP6V8bClOiAG+bdrwp4lu/9pJGqlEYfRsnw=; b=qfrY227t55EJ7MuNahlUZHgLor9y01Cb6uhn+3hF6b2qk6q+v3nN3WdCRKXm5nu6V44TVV TQACBeIPPmqQl8RlAyFhYdWauLxyCDxn7IML0JZp3yrhSQ6rRnXwSQaoR0aP1xP9/q05VT bIfgzZf8kcFb3BqAEhCy8Gf0+GO1J3u362yVBcJWf2Va3moIqhclW/mLKgrwoNW9GpV5r7 4ciJ6krljeZ70uP+f7c9BXg5ZomUpzCdiyjO9au41kH32bKMHCPegUWx1+HKHZJfdQdMIc gZFJznbkpaLJCyxzxPQxIp+7nPUEtbTR1VqUxYAwcAl7QZnfUkNtxG6ll1KTWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730994232; a=rsa-sha256; cv=none; b=d77uMAo7jkkI6lsreIDtbVg9GjWm/FHJLK1uzd4q6Hd3XQsYR+pbq17jEadpeQUykv3Zva 3NvhToaLFygF+qKLbFl1rBwaz8X4l+OMYIw9ujf1XJx4+n8HrOMrKUDzU4Iz4xe9A/cPB+ diImCR55lsCFqIN7T0ULBpQ8fYH/nnxxcq4SLi/jyKiZyrUBwmyjcyKWVXYilobqJFefBr 78be4K/zSAK5KUOCs3XDU+SFzqF8KVuNKA4xOW0o0AVChRXsIGuuxqQ9h9n5VOQN/5M0Jl c4g+iBqS8kgnFRjrL3WC+Akoh+WVLz+tmA5M+dbsmsUv0IisTY5KlTGvN199ug== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R11" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XkmZc0jGnz1QlM; Thu, 7 Nov 2024 15:43:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id D148B42E78; Thu, 07 Nov 2024 16:43:49 +0100 (CET) From: Kristof Provost To: Alan Somers Cc: =?utf-8?q?Olivier_Cochard-Labb=C3=A9?= , Igor Ostapenko , freebsd-testing@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: RFC: Add required_klds metadata to Kyua Date: Thu, 07 Nov 2024 16:43:49 +0100 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: References: <9fc6fc72-4c2c-4b09-bdb5-122a49b45295@FreeBSD.org> <9975A26D-6AB4-433F-B4B2-515F956BF366@FreeBSD.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_E1688D6D-F804-4D3F-B9BC-1BE59FE56D88_=" Content-Transfer-Encoding: 8bit --=_MailMate_E1688D6D-F804-4D3F-B9BC-1BE59FE56D88_= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7 Nov 2024, at 16:16, Alan Somers wrote: > I too like the idea of Project A with required_klds or required_kmods. > But how would you handle situations where a user customizes their > kernel config to build some feature that's usually a module directly > into the kernel? I would think that would break any test using > required_klds. > That’s actually fine if we use `kldstat -m` or modfind(). It’ll still find a “module” even when it’s built into the kernel. For example, pfsense builds pf into the kernel: [24.11-BETA][root@pfSense.jupiter.sigsegv.be]/root: kldstat Id Refs Address Size Name 1 19 0xffff000000000000 28e4d90 kernel 2 1 0xffff0000028e5000 46e278 zfs.ko 3 1 0xffff000002d54000 3e258 opensolaris.ko 4 1 0xffff0000b1c00000 27000 safexcel.ko 5 1 0xffff0000b1c27000 26000 cryptodev.ko [24.11-BETA][root@pfSense.jupiter.sigsegv.be]/root: kldstat -m pf Id Refs Name 440 1 pf Or when it actually is a module: freebsd_current_zfs# kldstat Id Refs Address Size Name 1 48 0xffffffff80200000 1f75b10 kernel 2 1 0xffffffff82176000 6320 filemon.ko 3 1 0xffffffff8217d000 78fdf8 zfs.ko 4 1 0xffffffff83010000 2a68 mac_ntpd.ko 5 3 0xffffffff83013000 5adc0 pf.ko 6 1 0xffffffff8306e000 9688 pfsync.ko 7 1 0xffffffff83078000 2260 pflog.ko 8 1 0xffffffff8307b000 128a0 dummynet.ko 9 1 0xffffffff8308e000 9890 carp.ko 10 1 0xffffffff83098000 18148 ipsec.ko 11 1 0xffffffff830b1000 7bf98 sctp.ko 12 1 0xffffffff8312d000 2568 ipdivert.ko 13 1 0xffffffff83130000 88d8 if_bridge.ko 14 1 0xffffffff83139000 5120 bridgestp.ko 15 1 0xffffffff8313f000 52a4 if_epair.ko freebsd_current_zfs# kldstat -m pf Id Refs Name 506 1 pf freebsd_current_zfs# kldunload pfsync freebsd_current_zfs# kldunload pflog freebsd_current_zfs# kldunload pf freebsd_current_zfs# kldstat -m pf kldstat: can't find module pf: No such file or directory — Kristof --=_MailMate_E1688D6D-F804-4D3F-B9BC-1BE59FE56D88_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 7 Nov 2024, at 16:16, Alan Somers wrote:

I too like the idea of Project A wi= th required_klds or required_kmods.
But how would you handle situations where a user customizes their
kernel config to build some feature that's usually a module directly
into the kernel? I would think that would break any test using
required_klds.


That=E2=80=99s actually fine if we use kldstat -m or modfind(= ). It=E2=80=99ll still find a =E2=80=9Cmodule=E2=80=9D even when it=E2=80= =99s built into the kernel.

For example, pfsense builds pf into the kernel:

[2=
4.11-BETA][root@pfSense.jupiter.sigsegv.be]/root: kldstat
Id Refs Address                Size Name
 1   19 0xffff000000000000  28e4d90 kernel
 2    1 0xffff0000028e5000   46e278 zfs.ko
 3    1 0xffff000002d54000    3e258 opensolaris.ko
 4    1 0xffff0000b1c00000    27000 safexcel.ko
 5    1 0xffff0000b1c27000    26000 cryptodev.ko
[24.11-BETA][root@pfSense.jupiter.sigsegv.be]/root: kldstat -m pf
Id  Refs Name
440    1 pf

Or when it actually is a module:

fr=
eebsd_current_zfs# kldstat
Id Refs Address                Size Name
 1   48 0xffffffff80200000  1f75b10 kernel
 2    1 0xffffffff82176000     6320 filemon.ko
 3    1 0xffffffff8217d000   78fdf8 zfs.ko
 4    1 0xffffffff83010000     2a68 mac_ntpd.ko
 5    3 0xffffffff83013000    5adc0 pf.ko
 6    1 0xffffffff8306e000     9688 pfsync.ko
 7    1 0xffffffff83078000     2260 pflog.ko
 8    1 0xffffffff8307b000    128a0 dummynet.ko
 9    1 0xffffffff8308e000     9890 carp.ko
10    1 0xffffffff83098000    18148 ipsec.ko
11    1 0xffffffff830b1000    7bf98 sctp.ko
12    1 0xffffffff8312d000     2568 ipdivert.ko
13    1 0xffffffff83130000     88d8 if_bridge.ko
14    1 0xffffffff83139000     5120 bridgestp.ko
15    1 0xffffffff8313f000     52a4 if_epair.ko
freebsd_current_zfs# kldstat -m pf
Id  Refs Name
506    1 pf
freebsd_current_zfs# kldunload pfsync                                    =
                                                                         =
                                                                      	fr=
eebsd_current_zfs# kldunload pflog
freebsd_current_zfs# kldunload pf
freebsd_current_zfs# kldstat -m pf
kldstat: can't find module pf: No such file or directory

=E2=80=94
Kristof

--=_MailMate_E1688D6D-F804-4D3F-B9BC-1BE59FE56D88_=--