From nobody Wed Nov 20 05:01:33 2024 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 4XtTjk0rqjz5dFBk for ; Wed, 20 Nov 2024 05:01:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XtTjj5p08z4Fbx for ; Wed, 20 Nov 2024 05:01:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2ea4e9e6ef2so2606470a91.1 for ; Tue, 19 Nov 2024 21:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1732078904; x=1732683704; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cx7c7hiOxtRP6eRGW0hauLp4yNhqP39z5c3kL6tOTC4=; b=16YmMF0fzAV4duqfzE5kPZZLdJ2/pULa4TekGOURUeMGQsaJBvQWHe/5GbYwDMu139 nQ7b1BtApHRvk5uQW8j+pVOj9cRM44Rau5+gyWWGNZ59lpP3gliNB6izRP+kSew2TwkO IyYbJDYIqU2etWisxDqsgxO9rAy6uQRyhjXFXnLozBqiZ7qpZ1gJLjZRoSUbOyPKLJ/P 7Oq7bGwr3MpdSEyHwupUoRgyPMKkzdBAXskhFqHWpqARoJPyI1/eP5vFyGZB2j+uLQEf pe7ML5KHDKsg0e+RFyAyIVmi40hxCXRwBFUdjsHAnvHYijrXWYlSYlI/pZgj4qTbZhoa 6/ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732078904; x=1732683704; 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=cx7c7hiOxtRP6eRGW0hauLp4yNhqP39z5c3kL6tOTC4=; b=tSWC3eo9rehFrOFSod5EDPfKtQC/jZQ97KLMV4VTM/rVm1mNKFMHaR8ioVSb3yS9VT glo643/EXAXU19nPQKQ6AqJh61kGIWyEnCDSLRqNuO3zp/zjZHb9PuGZCcjLVRr35lFA 2eiQMYuiXBhws1sppmmp8X9OClq57VPyIxQcTwl64OKUxqr9YkeUsHskRhOCq7xb+sqx sQkCuJUbw6bFUA38HGwWg+c2BStBJyTK3kUEcFbJPCtZWUQtcWEhSdwNoKeoAIjD3MWC kXOXh3ylv/xzbwyGtkKXhcJxRs+A1XhjoWtuTrmeXuROj0Suklf97IqKc3W0vDiej6Kf usIw== X-Forwarded-Encrypted: i=1; AJvYcCUrXP/3f9EJ9oCveCkRyESarqRo75h0ljlyp5eld67TY7rp0HFOOzOKEjHHelgcJ1fSUqa6KMQ5UIuZ7KaRtmZ9RM9o@freebsd.org X-Gm-Message-State: AOJu0YxTyzXIGAXV5+QNM+RZWNUtuy9qc6rChvKbkBO+yAcbBdo1uGBd DhARk74qpMQ31ZUVawJ2kGrTbN98G/Y1lbs0rS2FuUTx2+YKH1tCZE1o0v1O6EENDOyYXPllnio TvTEUvHQ8dNaAivFV4Ywxld6B5KHjdSt1dcucHQ== X-Google-Smtp-Source: AGHT+IFaL/2MuBpPROVWehefqUSLlY+VEzi2x4GITfZ7l1/IdMz+oV8FF74M1RUvMu7zJyUAf1q3PJQfGuJ40ynrPls= X-Received: by 2002:a17:90b:4c41:b0:2ea:94a1:f63f with SMTP id 98e67ed59e1d1-2eaca7de059mr1815102a91.33.1732078904129; Tue, 19 Nov 2024 21:01:44 -0800 (PST) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202411200335.4AK3ZnVU099504@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 19 Nov 2024 22:01:33 -0700 Message-ID: Subject: Re: git: c29cba408d19 - main - stand: Narrow the 'signal emulation' we provide To: Jessica Clarke Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000cddbee0627510b8a" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XtTjj5p08z4Fbx X-Spamd-Bar: ---- --000000000000cddbee0627510b8a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Nov 19, 2024, 8:56=E2=80=AFPM Jessica Clarke w= rote: > On 20 Nov 2024, at 03:35, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dc29cba408d197ed2c267d0605e4225b= b54153e01 > > > > commit c29cba408d197ed2c267d0605e4225bb54153e01 > > Author: Warner Losh > > AuthorDate: 2024-11-20 03:05:11 +0000 > > Commit: Warner Losh > > CommitDate: 2024-11-20 03:24:41 +0000 > > > > stand: Narrow the 'signal emulation' we provide > > > > We only need to provide sig_atomic_t in emulation. However, includin= g > > machine/signal.h brings in too much namespace pollution related to > > signals. Instead, define sig_atomic_t as long. Setting long is async > > atomic on all platforms (though powerpc64 defines it to an int), > though > > that doesn't matter since the boot loader doesn't use signals. > > > > Sponsored by: Netflix > > --- > > stand/libsa/stand.h | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h > > index 260defa3a33d..e1188fb73a26 100644 > > --- a/stand/libsa/stand.h > > +++ b/stand/libsa/stand.h > > @@ -82,8 +82,13 @@ > > #define EOFFSET (ELAST+8) /* relative seek not supported */ > > #define ESALAST (ELAST+8) /* */ > > > > -/* Partial signal emulation for sig_atomic_t */ > > -#include > > +/* > > + * LUA needs sig_atomic_t. This is defined to be long or int on all ou= r > > + * platforms. On all but powerpc, these are all the same thing as long= . > 64-bit > > + * powerpc defines this as int, but long can also be accessed > atomically. It's > > + * also OK because we don't have signal handlers in the boot loader. > > + */ > > Presumably an oversight when adding the powerpc64* ports :( Probably we > should fix this by taking advantage of being able to break ABI for tier > 2 architectures between major versions. Shame it wasn=E2=80=99t done the = same > time as ELFv1 -> ELFv2. We fixed riscv and arm64=E2=80=99s SIG_ATOMIC_MIN= /MAX > recently, but the underlying types were still long in that case, > thankfully. > Likely. But i already have too much on my plate. Just a weird thing i noticed. Warner Jess > > > +typedef long sig_atomic_t; > > > > __BEGIN_DECLS > > > > --000000000000cddbee0627510b8a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Nov 19, 2024, 8:56=E2=80=AFPM Jessica Clarke &= lt;jrtc27@freebsd.org> wrote:<= br>
On 20 Nov 2024, at 03:35, Warner Lo= sh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc29cba408d197ed2c267d0605e4225= bb54153e01
>
> commit c29cba408d197ed2c267d0605e4225bb54153e01
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-11-20 03:05:11 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-11-20 03:24:41 +0000
>
>=C2=A0 =C2=A0 stand: Narrow the 'signal emulation' we provide >
>=C2=A0 =C2=A0 We only need to provide sig_atomic_t in emulation. Howeve= r, including
>=C2=A0 =C2=A0 machine/signal.h brings in too much namespace pollution r= elated to
>=C2=A0 =C2=A0 signals. Instead, define sig_atomic_t as long. Setting lo= ng is async
>=C2=A0 =C2=A0 atomic on all platforms (though powerpc64 defines it to a= n int), though
>=C2=A0 =C2=A0 that doesn't matter since the boot loader doesn't= use signals.
>
>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Net= flix
> ---
> stand/libsa/stand.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h
> index 260defa3a33d..e1188fb73a26 100644
> --- a/stand/libsa/stand.h
> +++ b/stand/libsa/stand.h
> @@ -82,8 +82,13 @@
> #define EOFFSET (ELAST+8) /* relative seek not supported */
> #define ESALAST (ELAST+8) /* */
>
> -/* Partial signal emulation for sig_atomic_t */
> -#include <machine/signal.h>
> +/*
> + * LUA needs sig_atomic_t. This is defined to be long or int on all o= ur
> + * platforms. On all but powerpc, these are all the same thing as lon= g. 64-bit
> + * powerpc defines this as int, but long can also be accessed atomica= lly. It's
> + * also OK because we don't have signal handlers in the boot load= er.
> + */

Presumably an oversight when adding the powerpc64* ports :( Probably we
should fix this by taking advantage of being able to break ABI for tier
2 architectures between major versions. Shame it wasn=E2=80=99t done the sa= me
time as ELFv1 -> ELFv2. We fixed riscv and arm64=E2=80=99s SIG_ATOMIC_MI= N/MAX
recently, but the underlying types were still long in that case,
thankfully.

Likely. But i already have too much on my plate. Just a weird th= ing i noticed.

Warner

Jess

> +typedef long sig_atomic_t;
>
> __BEGIN_DECLS
>

--000000000000cddbee0627510b8a--