From nobody Thu Dec 02 16:46:48 2021 X-Original-To: freebsd-current@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 C6BC318BF040 for ; Thu, 2 Dec 2021 16:46:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4J4hgY4tJtz4fCL for ; Thu, 2 Dec 2021 16:46:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x72a.google.com with SMTP id a11so469088qkh.13 for ; Thu, 02 Dec 2021 08:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FKJPmLBSaEBFirqvfgcQI95qni9WRD2MxlMgO/rodZ0=; b=jcLJtrZLPxq08j0gVvY1aR0vPF8YGikJDsz7n8wyiyobQx4lmK2W6PnL2lIJiZXvXd ZTj2WK1mABKI9vd9xXYx2sewCI0h6ix5W6d9mhpCY1FEVwSJK/ugo3+1Xlsv9iyq4o/T EZ5XUvmpLCN7rysNW4a2PvL8x72M2+2SyBBQkA6oEoAr3TjYYt/Pp1blmzBulHUgNLMC KNc5no3NfrSddNfEI7jxK17zuvjVOZTqsIc/DGKVTcO09LStXUCJSUV2OgS3bjhDMZ/b u/KdV2U/L49BLo7I7kHNGVhgkiptEgvg0jgSZYjtM/g0oqT75C79XhqovM04cDuGGCY9 Vl/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FKJPmLBSaEBFirqvfgcQI95qni9WRD2MxlMgO/rodZ0=; b=4XnYBpWSOaOoU+ULYsIdhyfAZ4e4uKz8IzhTkAQ7+Le4IoJzGDOf/d8abaLqlOTFqg A6Pj6Gr7U9EDq/qxhzoq3bT7z4S8H5grX0+bY3QwH/p1LlDdBadT7XFJG6mZ9kHPba9j MobAWobgmCHWY4t/MyKFektpfIawBB4MpCjIRiEvTMKxt8VSdHVLf3NXhkVWY47sykV5 EsfUVEHyZgMnf6ls6kcshr+Ya15zT9UneqBpuSBdPS34L5bG3jFr2fGcqr2TNcnj7B+i BLNOYbhAsAdO/J6jkW3MO4BT3leVlyQKSZ1CofM0i55u+bFgP+fWxh9/kTAZACSXQo3Q BoKw== X-Gm-Message-State: AOAM530uKHZ27cKoIDbBMQEbNAZXV4fLrHWOiRWXlW5ss/tYQy4aHE+2 2Paf5E6K8X6BUmjNLchziLEdMKPcabcgUA8U X-Google-Smtp-Source: ABdhPJzUq7jcy/MWh2kK+xkCCn9F8UKZc6i960qpNC6ZVtrbNes+Tw4pPC41JZGqUEFhq6asSvZmaQ== X-Received: by 2002:a05:620a:15c8:: with SMTP id o8mr13782030qkm.385.1638463609178; Thu, 02 Dec 2021 08:46:49 -0800 (PST) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id o1sm153275qtw.1.2021.12.02.08.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 08:46:48 -0800 (PST) Date: Thu, 2 Dec 2021 11:46:48 -0500 From: Shawn Webb To: Stefan Esser Cc: FreeBSD CURRENT Subject: Re: [REVIEW] Hide BIT_* macros from userland code Message-ID: <20211202164648.276kuh3blin6b2wp@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <7d97e129-4aa7-aa98-dc91-e332a3da620f@freebsd.org> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o5zlasg5gkhqto6j" Content-Disposition: inline In-Reply-To: <7d97e129-4aa7-aa98-dc91-e332a3da620f@freebsd.org> X-Rspamd-Queue-Id: 4J4hgY4tJtz4fCL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --o5zlasg5gkhqto6j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Stefan, On Thu, Dec 02, 2021 at 05:26:55PM +0100, Stefan Esser wrote: > I have created >=20 > https://reviews.freebsd.org/D33235 >=20 > to remove the BIT_* macros used in the kernel from the userland API. >=20 > They conflict with differing definitions in some 3rd party code and > lead to compile issues in a number of ports (via CPU_* macros based > on the BIT_* macros). >=20 > See PR259787 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259787 > for an example of such a problem. I recently was in a position to evaluate BIT_* macros for userland use. It was around the time when the conversation regarding hiding BIT_* from userland, which conversation caused me to find another solution. I think such an API is incredibly useful, so I wonder if there's a way to satisfy both. For example, maybe prefix the userland side with a USERLAND_ or something similar? Kernel would use BIT_* and userland would use USERLAND_BIT_* (just spitballing, not actually advocating for "USERLAND_BIT_*" but rather just the idea of it.) Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --o5zlasg5gkhqto6j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmGo+HUACgkQ/y5nonf4 4fr6eA//ZcS4ZmNskfxlZ3rciKWU6mWAkmAZ8e4Gt/YHdpziSCIl/zNdEbma1Ohn vcApMcqlZ4/Hwe9IChbyi5V5Luh0RVg418cZ2MyPKuxNWAPh4SxlL+ODhaaZHWif ZOBfbC4QoejinEPgeMgYLxMtdaEBlTB5vnL/e5DkACznmGB5/2W8I00HFUhy15n/ CrnGauN6MYk7aXs5cnXdv96eHwL+dhqYpFvl1wwQReBE5I9hKFkNgs+qYWaUlcpO 5r9OlsGoqeoYuagtzu6vZeIqdbK9G32fE1PGbTBbBYOmVBle2S+4bBZV6nsgbUBX TtHVkVL740/Bh7O8VsmiXfmvu+Cazb+4SaBprCVb5IcS2AWapLrfa08i+oDweLda nggtNwPkioSUwYPGI4DfHTaqnVwc/KZVuxTmfTenrfb66rjtFGfmbyADKpcz5Fi9 22o0eAOt160FBj7Ld635432XjPVapwLvfC84r+nuTpw9HxSgwINicBqMNf5pSdCq CNaLHiVR9v+TnW59GCR538GVyD5TtLAyHZGuwIcsxQrV6YnMoPrKR6j7l06ZWKeH simpqlej4Py4y04ijYNepRQRxZU94yY2CpgEC5vdjuAR2kiZHsVKzf3ibwMR4A0s jkZmPkaNCAqxLq31LBrVNJIllvgVmJkxVa3OHQePzVEyvr+cJZs= =8mR8 -----END PGP SIGNATURE----- --o5zlasg5gkhqto6j--