From nobody Sat Oct 29 00:09:28 2022 X-Original-To: dev-commits-src-all@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 4MzftG1C44z4gJvv for ; Sat, 29 Oct 2022 00:09:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 4MzftF1tzsz3YSx for ; Sat, 29 Oct 2022 00:09:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ej1-x636.google.com with SMTP id kt23so16518070ejc.7 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=FAgiw9iLWvd9alGNIoA4UKkDc4AtRmcQ2CQ0DmV42aa5is6o7n2V9/UTVPw0ft7Dwq hFbKZeY+bQodRQ1YmHuHODgYNH6f+aN0Bo/avE0IMapV3V8pxCFGfbEy0tcbPOTjjUaV EtIqqsdjLljWaUL7G4TwQysIhSZkcZoxapplLjBBwZ0rt2gO12JTV84hlCwcBYrTZmmO 5DNVvpM6A43wENYrunC72JFYT2GsQa2pARhl4apqtkDXAVqmoWEplmv8sGGA6kosuMfY L2PQBMi/61nPJ1VDpK9s6URQWWQn8TZxwoYShE2gfazKlsNYbMqadECCY5hJOdnvPYM+ Wamg== X-Gm-Message-State: ACrzQf1M+X9Z1YadaGH2YxUYznJd3t5/YRl47s8970ML6GO43QskFej7 FSZth9Vrd6gGjXO/HS0pVP9XFr8TVAJdpYLC8nuy7w== 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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 4MzftF1tzsz3YSx 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::636) 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::636:from]; MLMMJ_DEST(0.00)[dev-commits-src-all@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-all@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--