From nobody Sat Oct 29 00:09:28 2022 X-Original-To: dev-commits-src-main@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 4MzftG1Dpvz4gJsT for ; Sat, 29 Oct 2022 00:09:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MzftF21w3z3YSy for ; Sat, 29 Oct 2022 00:09:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ej1-x634.google.com with SMTP id q9so16674079ejd.0 for ; Fri, 28 Oct 2022 17:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pwua8nv2t6oqhlVWqdSX5TPBthNZvcpSlCXE11NqSUs=; b=YdOUEG7JTeqnzJxIAW5K0ihcnGZDQNQqBAd6ET8aEUJS7A1/KUvTG9L5aZGnUeWhvK zAHrJxE1t0I/w1+QBY6UffnNx9KKescRF9YVVMRVCv7Pi2KpEwqkSMXCxrVM6W/8Fm6E kW2sYWGN557VAja5ppYVYK53wl58xT5Wdw1/GK0h1N+KzfYr3dLBlEXOSJVdUUacvi0D UbMtaGHuV4knFHybWyGIlmOLROZ4zBIhRtnCGNsQMnkMqxxdc0S4e8VEoME8gvyAq5Xd SD7fe+ADkqee6LGelM2cTm4uvVDlF1GaSLGG4JKaJEkt0MDta9Sl/EteSsfLWSEy0KWA 6K5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pwua8nv2t6oqhlVWqdSX5TPBthNZvcpSlCXE11NqSUs=; b=5BO3P6ezwo88o32iIUpBFfNX5Dx4q/7aKEjnwS+PE7JMweKVAKhdF8ClMFEk9O0fAM tJL2/rjHIaIAM9Z/mfB1gsfFPRnVHNE07eTto83oZ5PiiPLdGDbedWpRWiUdGh8zHbZN dK9YGDVCtvN5lBGg76slACR5uh94cuVChxrlKOklutDIDOLgTtb9ijSKiKJ8knAwJWjP hsPNAmDjsO5E6+c+iIEms+Oq3GWj6h9Zg7rQjMuHPd5YRjBAi/JFL2QXIhxYFQDnXai2 mXY6pBFjkCZ0IG7lykwxk2Jpa2zu/zv0PDCfofCprNGsqgYbi0OWHSNdu70aBxSXahhg uBQA== X-Gm-Message-State: ACrzQf0b/Y0QEZk9qeWM0nBcbH0QZGjBlJ4Xq5Y4SqJbNgNSPNv4dC3H drnLFkmYJiYUyYVL4UUvSPLQZNn7L49LCegKsyV42w== X-Google-Smtp-Source: AMsMyM5rhcK791PKXRvVV6TGw0LEmPYI7PmdfDc+DvseW+aVcIwAxQEXhseILHL8EuXcqq+zJKiJpTENbjGHLrWjrUA= X-Received: by 2002:a17:906:730f:b0:791:9b75:2ca1 with SMTP id di15-20020a170906730f00b007919b752ca1mr1597686ejc.140.1667002179773; Fri, 28 Oct 2022 17:09:39 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202210271759.29RHxoXe019330@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 28 Oct 2022 18:09:28 -0600 Message-ID: Subject: Re: git: 701ab6dba4a2 - main - Stop building FDT-only modules in an ACPI only kernel To: Mitchell Horne Cc: John Baldwin , Andrew Turner , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000c3f93a05ec213036" X-Rspamd-Queue-Id: 4MzftF21w3z3YSy X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=YdOUEG7J; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::634) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::634:from]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_SPF_NA(0.00)[no SPF record]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; DMARC_NA(0.00)[bsdimp.com]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-ThisMailContainsUnwantedMimeParts: N --000000000000c3f93a05ec213036 Content-Type: text/plain; charset="UTF-8" On Fri, Oct 28, 2022 at 2:23 PM Mitchell Horne wrote: > > > On 10/28/22 12:59, John Baldwin wrote: > > On 10/27/22 10:59 AM, Andrew Turner wrote: > >> The branch main has been updated by andrew: > >> > >> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=701ab6dba4a2232751cd91f79bfc1d8e96bf5316 > >> > >> commit 701ab6dba4a2232751cd91f79bfc1d8e96bf5316 > >> Author: Andrew Turner > >> AuthorDate: 2022-10-27 17:01:44 +0000 > >> Commit: Andrew Turner > >> CommitDate: 2022-10-27 17:59:33 +0000 > >> > >> Stop building FDT-only modules in an ACPI only kernel > >> When building a kernel without FDT these modules don't build. As > >> they > >> depend on FDT and don't work with ACPI disable them. > >> Reviewed by: imp, kevans > >> Sponsored by: The FreeBSD Foundation > >> Differential Revision: https://reviews.freebsd.org/D37178 > > > > Hmm, the OPT_FDT handling seems a bit atypical. Other optional > > components are > > tested for by ${KERN_OPTS:M} rather than empty(OPT_) under > > sys/modules. > > > > Some time ago I experimented with trying to build a NOFDT kernel like > this. I found that this type of construct worked well: > > SUBDIR.${MK_FDT}= ${_allwinner} \ > ${_if_cgem} \ > ${_sdhci_fdt} \ > ... > > That is, use the existing SUBDIR.yes logic to conditionally exclude > these already conditional subdirectories. It avoids multiple identical > checks, whether you use ${KERN_OPTS:MFDT} or empty(OPT_FDT) forms. > Something to consider. > I have a more extensive set of changes I'm working on that I might as well trot out here... First, I'd 100% kill every last _foo variable. They aren't needed. Next, I'd have a Makefile.$MACHINE. This makefile would be responsible for defining a MODULES_FEATURES variable that would be a list like MODULE_FEATUERS=32bit x86 64bit-atomics for i386. Each of these features would have subdirs associated with them SUBDIR.64bit-atomics+=mpr SUBDIR.64bit-atomics+=mps and then we'd join them all together at the end. The Makefile.$MACHINE might also add modules to SUBDIRS that are always compiled for that machine, and might add features like 'fdt' or 'acpi' conditionally to MODULE_FEATURES so it would need to be more than just a bunch of MODULE_FEATURES.= lines at the top of this Makefile. I was hoping to share a preview early next week. I think this will be a good balance between simplicity and the mess we have today... Warner --000000000000c3f93a05ec213036 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Oct 28, 2022 at 2:23 PM Mitch= ell Horne <mhorne@freebsd.org&= gt; wrote:


On 10/28/22 12:59, John Baldwin wrote:
> On 10/27/22 10:59 AM, Andrew Turner wrote:
>> The branch main has been updated by andrew:
>>
>> URL:
>> https://c= git.FreeBSD.org/src/commit/?id=3D701ab6dba4a2232751cd91f79bfc1d8e96bf5316
>>
>> commit 701ab6dba4a2232751cd91f79bfc1d8e96bf5316
>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Andrew Turner <andrew@FreeBSD.o= rg>
>> AuthorDate: 2022-10-27 17:01:44 +0000
>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Andrew Turner <andrew@FreeBSD.o= rg>
>> CommitDate: 2022-10-27 17:59:33 +0000
>>
>> =C2=A0=C2=A0=C2=A0=C2=A0 Stop building FDT-only modules in an ACPI= only kernel
>> =C2=A0=C2=A0=C2=A0=C2=A0 When building a kernel without FDT these = modules don't build. As
>> they
>> =C2=A0=C2=A0=C2=A0=C2=A0 depend on FDT and don't work with ACP= I disable them.
>> =C2=A0=C2=A0=C2=A0=C2=A0 Reviewed by:=C2=A0=C2=A0=C2=A0 imp, kevan= s
>> =C2=A0=C2=A0=C2=A0=C2=A0 Sponsored by:=C2=A0=C2=A0 The FreeBSD Fou= ndation
>> =C2=A0=C2=A0=C2=A0=C2=A0 Differential Revision:
https://r= eviews.freebsd.org/D37178
>
> Hmm, the OPT_FDT handling seems a bit atypical.=C2=A0 Other optional <= br> > components are
> tested for by ${KERN_OPTS:M<foo>} rather than empty(OPT_<foo&= gt;) under
> sys/modules.
>

Some time ago I experimented with trying to build a NOFDT kernel like
this. I found that this type of construct worked well:

SUBDIR.${MK_FDT}=3D ${_allwinner} \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${_if_= cgem} \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${_sdh= ci_fdt} \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0...
That is, use the existing SUBDIR.yes logic to conditionally exclude
these already conditional subdirectories. It avoids multiple identical
checks, whether you use ${KERN_OPTS:MFDT} or empty(OPT_FDT) forms.
Something to consider.

I have a more ex= tensive set of changes I'm working on that I might as well
tr= ot out here...

First, I'd 100% kill every last= _foo variable. They aren't needed.
Next, I'd have a Make= file.$MACHINE. This makefile would be responsible
for defining a = MODULES_FEATURES variable that would be a list like
MODULE_FEATUE= RS=3D32bit x86 64bit-atomics
for i386. Each of these features= would have subdirs associated with them
SUBDIR.64bit-atomics+=3D= mpr
SUBDIR.64bit-atomics+=3Dmps
and then we'd = join them all together at the end. The Makefile.$MACHINE
might al= so add modules to SUBDIRS that are always compiled for that machine,
<= div>and might add features like 'fdt' or 'acpi' conditional= ly to MODULE_FEATURES
so it would need to be more than just a bun= ch of MODULE_FEATURES.<arch>=3D
lines at the top of this Ma= kefile.

I was hoping to share a preview early next= week. I think this will be a good
balance between simplicity and= the mess we have today...

Warner

--000000000000c3f93a05ec213036--