From nobody Wed Nov 20 05:01:33 2024 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 4XtTjk46WZz5dDqH for ; Wed, 20 Nov 2024 05:01:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 4XtTjj5p0mz4FhW 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-x102e.google.com with SMTP id 98e67ed59e1d1-2ea4d429e43so2620812a91.3 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=U6AFCJS3+PrKOhDXWKR+b2JK1ixx0pxRsI43ukkaND3nZVozeMMVZVxr0rshDOgf7d 9IwIWqopkxr4kyeduWM2CIhcCuuOPfF4bvoIFHvS8fWMhnATM+1Tzl7UW7K+3FUExK6+ e7XMyErlBNaC88J7TNzgPmWn8iurpptQUN2Wi1UPl10uPO5stfZTZ1kPYgr6XORSiP1s eR5PQ2pnZLkOYb6gdAhX/etYYLn/hL3udPihnQtaRMQ7ZlzZ737vwM17vc56RAMuCDWN Sas1JxP5NgyG2q9yApC8paU4JOnSeSjQtaWxPiLQZ+s9h172csnSbK6AmgayvYmciUwV s15w== X-Forwarded-Encrypted: i=1; AJvYcCVyT+P/zyg9NLvrHxZeju4BxwQNChMwdey7NKTXzKikG0MbPfAuiom0eqknxuEEqmw/EX9gbVVbZelT8zveRnxLcwKetA==@freebsd.org X-Gm-Message-State: AOJu0YxiWGHV76vFNOmV87BfmTA0XYeStdu8IkbUQ7tlRUzJbjRXG8kh 3QtAsgus8YLIG3Aw8mMG5qUevAhmeVZr2QTb1ybglXWO90hqB6nz+JN35Nm6AgStZbN9mOUx9+G kPCoTVsH/g6C2waQpA2ckbTAHLPMAZypb8IOehQ== 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 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4XtTjj5p0mz4FhW 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--