git: 230efeda080f - main - libusbhid: add missing include guards

2024-06-06 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=230efeda080f09bc282f50a7a4cfc337fd7c6d0d

commit 230efeda080f09bc282f50a7a4cfc337fd7c6d0d
Author: Andreas Kempe 
AuthorDate: 2022-07-10 20:51:48 +
Commit: Ed Maste 
CommitDate: 2024-06-06 14:09:05 +

libusbhid: add missing include guards

PR: 265136
---
 lib/libusbhid/usbhid.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/lib/libusbhid/usbhid.h b/lib/libusbhid/usbhid.h
index 15d4f1613746..637fb3d846f7 100644
--- a/lib/libusbhid/usbhid.h
+++ b/lib/libusbhid/usbhid.h
@@ -29,6 +29,9 @@
  *
  */
 
+#ifndef _USBHID_H_
+#define _USBHID_H_
+
 #include 
 
 typedef struct report_desc *report_desc_t;
@@ -111,3 +114,5 @@ int hid_set_report(int fd, enum hid_kind k,
 unsigned char *data, unsigned int size);
 
 __END_DECLS
+
+#endif /* !_USBHID_H_ */



git: 888796ade284 - main - libm: fma: correct zero sign with small inputs

2024-06-08 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=888796ade2842486d3167067e8034254c38aadd3

commit 888796ade2842486d3167067e8034254c38aadd3
Author: Ed Maste 
AuthorDate: 2024-03-19 14:31:39 +
Commit: Ed Maste 
CommitDate: 2024-06-08 15:55:36 +

libm: fma: correct zero sign with small inputs

PR: 277783
Reported by:Victor Stinner
Submitted by:   kargl
MFC after:  1 week
Differential Revision: https://reviews.freebsd.org/D44433
---
 lib/msun/src/s_fma.c  | 4 +++-
 lib/msun/src/s_fmal.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c
index b8a342646d85..4d08b40cc71a 100644
--- a/lib/msun/src/s_fma.c
+++ b/lib/msun/src/s_fma.c
@@ -267,7 +267,9 @@ fma(double x, double y, double z)
 */
fesetround(oround);
volatile double vzs = zs; /* XXX gcc CSE bug workaround */
-   return (xy.hi + vzs + ldexp(xy.lo, spread));
+   xs = ldexp(xy.lo, spread);
+   xy.hi += vzs;
+   return (xy.hi == 0 ? xs : xy.hi + xs);
}
 
if (oround != FE_TONEAREST) {
diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c
index 3d333632127c..12f9c364670b 100644
--- a/lib/msun/src/s_fmal.c
+++ b/lib/msun/src/s_fmal.c
@@ -248,7 +248,9 @@ fmal(long double x, long double y, long double z)
 */
fesetround(oround);
volatile long double vzs = zs; /* XXX gcc CSE bug workaround */
-   return (xy.hi + vzs + ldexpl(xy.lo, spread));
+   xs = ldexpl(xy.lo, spread);
+   xy.hi += vzs;
+   return (xy.hi == 0 ? xs : xy.hi + xs);
}
 
if (oround != FE_TONEAREST) {



git: a87651e2ff18 - main - ktrace(1): add xref to namei(9)

2024-06-10 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a87651e2ff189cec4c26cb220354f1bc93794f31

commit a87651e2ff189cec4c26cb220354f1bc93794f31
Author: Ed Maste 
AuthorDate: 2024-06-10 12:51:01 +
Commit: Ed Maste 
CommitDate: 2024-06-10 14:41:45 +

ktrace(1): add xref to namei(9)

namei was mistaken for a typo (see GitHub pull request #1284).  Add an
xref to make it clear.

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45546
---
 usr.bin/ktrace/ktrace.1 | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1
index da39aac7800f..162706c65e6e 100644
--- a/usr.bin/ktrace/ktrace.1
+++ b/usr.bin/ktrace/ktrace.1
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 20, 2024
+.Dd June 10, 2024
 .Dt KTRACE 1
 .Os
 .Sh NAME
@@ -48,7 +48,8 @@ The
 utility enables kernel trace logging for the specified processes.
 Kernel trace data is logged to the file
 .Pa ktrace.out .
-The kernel operations that are traced include system calls, namei
+The kernel operations that are traced include system calls,
+.Xr namei 9
 translations, signal processing, and
 .Tn I/O .
 .Pp
@@ -199,7 +200,8 @@ Disable tracing of all user-owned processes:
 .Xr truss 1 ,
 .Xr ktrace 2 ,
 .Xr utrace 2 ,
-.Xr capsicum 4
+.Xr capsicum 4 ,
+.Xr namei 9
 .Sh HISTORY
 The
 .Nm



git: 87e5b17c149e - main - prepare-commit-msg: add 50 column marker

2024-06-10 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=87e5b17c149ef7e68c23c7dfd18734b3e0abe48d

commit 87e5b17c149ef7e68c23c7dfd18734b3e0abe48d
Author: Ed Maste 
AuthorDate: 2024-06-09 17:24:13 +
Commit: Ed Maste 
CommitDate: 2024-06-10 14:48:32 +

prepare-commit-msg: add 50 column marker

A common convention suggests a 50 column commit subject line (the first
line of the commit message).  Add a 50 column marker to the commit
message template

Reviewed by:lwhsu
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45538
---
 tools/tools/git/hooks/prepare-commit-msg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/git/hooks/prepare-commit-msg 
b/tools/tools/git/hooks/prepare-commit-msg
index ac3844accec2..e8e0e2887c3f 100755
--- a/tools/tools/git/hooks/prepare-commit-msg
+++ b/tools/tools/git/hooks/prepare-commit-msg
@@ -38,7 +38,7 @@ outfile=$(mktemp /tmp/freebsd-git-commit.)
 
 cat >$outfile <

git: 0e34d0993096 - main - Add WITHOUT_LLVM_BINUTILS src.conf description

2024-06-10 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0e34d099309687f19420c615c5c56c032f30119d

commit 0e34d099309687f19420c615c5c56c032f30119d
Author: Ed Maste 
AuthorDate: 2024-06-10 15:45:41 +
Commit: Ed Maste 
CommitDate: 2024-06-10 15:50:32 +

Add WITHOUT_LLVM_BINUTILS src.conf description

Before FreeBSD 15 I plan to switch to LLVM_BINUTILS by default.  Add the
src.conf description now, for the benefit of downstream branches and
testing/CI.

PR: 258872 [exp-run]
Sponsored by:   The FreeBSD Foundation
---
 tools/build/options/WITHOUT_LLVM_BINUTILS | 17 +
 1 file changed, 17 insertions(+)

diff --git a/tools/build/options/WITHOUT_LLVM_BINUTILS 
b/tools/build/options/WITHOUT_LLVM_BINUTILS
new file mode 100644
index ..35cc0c0e034f
--- /dev/null
+++ b/tools/build/options/WITHOUT_LLVM_BINUTILS
@@ -0,0 +1,17 @@
+Install ELF Tool Chain's binary utilities instead of LLVM's.
+This includes
+.Xr addr2line 1 ,
+.Xr ar 1 ,
+.Xr nm 1 ,
+.Xr objcopy 1 ,
+.Xr ranlib 1 ,
+.Xr readelf 1 ,
+.Xr size 1 ,
+and
+.Xr strip 1 .
+Regardless of this setting, LLVM tools are used for
+.Xr c++filt 1
+and
+.Xr objdump 1 .
+.Xr strings 1
+is always provided by ELF Tool Chain.



git: 0277c0c6f72a - main - ktrace(1): add more xrefs

2024-06-11 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0277c0c6f72a964bf0439db1f4558551052e4f3b

commit 0277c0c6f72a964bf0439db1f4558551052e4f3b
Author: Ed Maste 
AuthorDate: 2024-06-11 00:31:08 +
Commit: Ed Maste 
CommitDate: 2024-06-11 15:02:00 +

ktrace(1): add more xrefs

Following commit a87651e2ff18 add xrefs to intro(2) and sigaction(2),
and use a consistent form.

Suggested by:   kib, arrowd
Reviewed by:kib (earlier)
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4
---
 usr.bin/ktrace/ktrace.1 | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1
index 162706c65e6e..5cc6df52d69a 100644
--- a/usr.bin/ktrace/ktrace.1
+++ b/usr.bin/ktrace/ktrace.1
@@ -48,9 +48,13 @@ The
 utility enables kernel trace logging for the specified processes.
 Kernel trace data is logged to the file
 .Pa ktrace.out .
-The kernel operations that are traced include system calls,
-.Xr namei 9
-translations, signal processing, and
+The kernel operations that are traced include system calls
+.Pq see Xr intro 2 ,
+file system path lookups
+.Pq Xr namei 9 ,
+signal processing
+.Pq Xr sigaction 2 ,
+and
 .Tn I/O .
 .Pp
 Once tracing is enabled on a process, trace data will be logged until
@@ -120,7 +124,9 @@ trace page faults
 trace
 .Tn I/O
 .It Cm n
-trace namei translations
+trace
+.Xr namei 9
+translations
 .It Cm p
 trace capability check failures
 .It Cm s
@@ -198,7 +204,9 @@ Disable tracing of all user-owned processes:
 .Xr dtrace 1 ,
 .Xr kdump 1 ,
 .Xr truss 1 ,
+.Xr intro 2 ,
 .Xr ktrace 2 ,
+.Xr sigaction 2 ,
 .Xr utrace 2 ,
 .Xr capsicum 4 ,
 .Xr namei 9



git: 92927b8bcf51 - main - msun: update Clang bug reference in fma test

2024-06-11 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=92927b8bcf51dcbcf99d633c1b3cab3cab2373ac

commit 92927b8bcf51dcbcf99d633c1b3cab3cab2373ac
Author: Ed Maste 
AuthorDate: 2024-06-12 00:23:44 +
Commit: Ed Maste 
CommitDate: 2024-06-12 00:29:27 +

msun: update Clang bug reference in fma test

LLVM bugzilla bug 8100 became issue #8472 with the migration to GitHub.

https://github.com/llvm/llvm-project/issues/8472
---
 lib/msun/src/s_fma.c  | 4 ++--
 lib/msun/src/s_fmal.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c
index 4d08b40cc71a..686e80e66f5d 100644
--- a/lib/msun/src/s_fma.c
+++ b/lib/msun/src/s_fma.c
@@ -244,7 +244,7 @@ fma(double x, double y, double z)
zs = copysign(DBL_MIN, zs);
 
fesetround(FE_TONEAREST);
-   /* work around clang bug 8100 */
+   /* work around clang issue #8472 */
volatile double vxs = xs;
 
/*
@@ -278,7 +278,7 @@ fma(double x, double y, double z)
 * rounding modes.
 */
fesetround(oround);
-   /* work around clang bug 8100 */
+   /* work around clang issue #8472 */
volatile double vrlo = r.lo;
adj = vrlo + xy.lo;
return (ldexp(r.hi + adj, spread));
diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c
index 12f9c364670b..a53d85f5ca57 100644
--- a/lib/msun/src/s_fmal.c
+++ b/lib/msun/src/s_fmal.c
@@ -225,7 +225,7 @@ fmal(long double x, long double y, long double z)
zs = copysignl(LDBL_MIN, zs);
 
fesetround(FE_TONEAREST);
-   /* work around clang bug 8100 */
+   /* work around clang issue #8472 */
volatile long double vxs = xs;
 
/*
@@ -259,7 +259,7 @@ fmal(long double x, long double y, long double z)
 * rounding modes.
 */
fesetround(oround);
-   /* work around clang bug 8100 */
+   /* work around clang issue #8472 */
volatile long double vrlo = r.lo;
adj = vrlo + xy.lo;
return (ldexpl(r.hi + adj, spread));



git: e77ad954bb82 - main - Revert "libm: fma: correct zero sign with small inputs"

2024-06-11 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e77ad954bb825983b4346b9cc646c9c910b1be24

commit e77ad954bb825983b4346b9cc646c9c910b1be24
Author: Ed Maste 
AuthorDate: 2024-06-12 01:34:02 +
Commit: Ed Maste 
CommitDate: 2024-06-12 01:36:12 +

Revert "libm: fma: correct zero sign with small inputs"

This change introduced a test failure, so revert until that can be
addressed.

This reverts commit 888796ade2842486d3167067e8034254c38aadd3.

PR: 277783
Reported by:rlibby
Sponsored by:   The FreeBSD Foundation
---
 lib/msun/src/s_fma.c  | 4 +---
 lib/msun/src/s_fmal.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c
index 686e80e66f5d..16902d321290 100644
--- a/lib/msun/src/s_fma.c
+++ b/lib/msun/src/s_fma.c
@@ -267,9 +267,7 @@ fma(double x, double y, double z)
 */
fesetround(oround);
volatile double vzs = zs; /* XXX gcc CSE bug workaround */
-   xs = ldexp(xy.lo, spread);
-   xy.hi += vzs;
-   return (xy.hi == 0 ? xs : xy.hi + xs);
+   return (xy.hi + vzs + ldexp(xy.lo, spread));
}
 
if (oround != FE_TONEAREST) {
diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c
index a53d85f5ca57..9d08bc72e12e 100644
--- a/lib/msun/src/s_fmal.c
+++ b/lib/msun/src/s_fmal.c
@@ -248,9 +248,7 @@ fmal(long double x, long double y, long double z)
 */
fesetround(oround);
volatile long double vzs = zs; /* XXX gcc CSE bug workaround */
-   xs = ldexpl(xy.lo, spread);
-   xy.hi += vzs;
-   return (xy.hi == 0 ? xs : xy.hi + xs);
+   return (xy.hi + vzs + ldexpl(xy.lo, spread));
}
 
if (oround != FE_TONEAREST) {



Re: git: 888796ade284 - main - libm: fma: correct zero sign with small inputs

2024-06-11 Thread Ed Maste
On Mon, 10 Jun 2024 at 19:31, Ryan Libby  wrote:
>
> On Sat, Jun 8, 2024 at 8:56 AM Ed Maste  wrote:
> >
> > The branch main has been updated by emaste:
> >
> > URL: 
> > https://cgit.FreeBSD.org/src/commit/?id=888796ade2842486d3167067e8034254c38aadd3
> >
> > commit 888796ade2842486d3167067e8034254c38aadd3
> > Author: Ed Maste 
> > AuthorDate: 2024-03-19 14:31:39 +
> > Commit: Ed Maste 
> > CommitDate: 2024-06-08 15:55:36 +
> >
> > ...
> This seems to have caused the lib/msun/fma_tests:zeroes test to fail in
> the FE_ROUNDDOWN mode on amd64, now finding 0 while expecting -0.  I
> don't know if the test is wrong or too strict, or if the new result is
> wrong.

Thanks - I have reverted the change for now to avoid leaving a failing
test (even if it's actually the test at fault). I'll recommit it after
the test situation is resolved.



git: a16cb8709de7 - main - tzsetup: Correct UTC description

2024-06-12 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a16cb8709de7ddc6dd6ab71918af9fc5fd96f377

commit a16cb8709de7ddc6dd6ab71918af9fc5fd96f377
Author: Ed Maste 
AuthorDate: 2024-06-13 00:08:04 +
Commit: Ed Maste 
CommitDate: 2024-06-13 00:24:49 +

tzsetup: Correct UTC description

UTC is Coordinated Universal Time, not Greenwich Mean Time.

Reviewed by:imp, allanjude
MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45573
---
 usr.sbin/tzsetup/tzsetup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index fee5762b6fa6..617de4efb765 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -957,7 +957,7 @@ main(int argc, char **argv)
"If it is set to local time,\n"
"or you don't know, please choose NO here!");
 
-   conf.title = "Select local or UTC (Greenwich Mean Time) clock";
+   conf.title = "Select local or UTC (Coordinated Universal Time) 
clock";
if (bsddialog_yesno(&conf, prompt, 7, 73) == BSDDIALOG_YES) {
if (reallydoit)
unlink(path_wall_cmos_clock);



git: 70e3e1bde9bf - main - tzsetup: add detail for -s option

2024-06-14 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=70e3e1bde9bf0ddf7fc18b97487fe2d23d4fc5ed

commit 70e3e1bde9bf0ddf7fc18b97487fe2d23d4fc5ed
Author: Ed Maste 
AuthorDate: 2024-06-13 15:23:26 +
Commit: Ed Maste 
CommitDate: 2024-06-14 14:02:31 +

tzsetup: add detail for -s option

Skipping the UTC question via -s will not create or delete
/etc/wall_cmos_clock.

Reported by:Tomoaki AOKI
Reviewed by:imp, allanjude, jrm
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45576
---
 usr.sbin/tzsetup/tzsetup.8 | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8
index 60461363da9a..499d25765541 100644
--- a/usr.sbin/tzsetup/tzsetup.8
+++ b/usr.sbin/tzsetup/tzsetup.8
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 18, 2023
+.Dd June 14, 2024
 .Dt TZSETUP 8
 .Os
 .Sh NAME
@@ -59,6 +59,10 @@ The name is obtained from
 .Pa /var/db/zoneinfo .
 .It Fl s
 Skip the initial question about adjusting the clock if not set to UTC.
+.Nm
+will neither create nor delete
+.Pa /etc/wall_cmos_clock .
+On a newly installed system the hardware clock will keep UTC.
 .El
 .Pp
 It is possible to short-circuit the menu system by specifying the



git: aa6fb1d277be - main - tzsetup: ask local/UTC question only on x86

2024-06-14 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=aa6fb1d277be47c51abc309ac9305def0fce7f9d

commit aa6fb1d277be47c51abc309ac9305def0fce7f9d
Author: Ed Maste 
AuthorDate: 2024-06-12 23:48:24 +
Commit: Ed Maste 
CommitDate: 2024-06-14 16:15:48 +

tzsetup: ask local/UTC question only on x86

Storing local time in the RTC is a legacy of 1990s PCs; it's not
relevant on other platforms of interest to FreeBSD.

While here switch to C99 bool.

Sponsored by:   The FreeBSD Foundation
Reviewed by:allanjude (earlier), imp (earlier)
Differential Revision: https://reviews.freebsd.org/D45575
---
 usr.sbin/tzsetup/tzsetup.8 |  3 ++-
 usr.sbin/tzsetup/tzsetup.c | 25 +++--
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8
index 499d25765541..4e70875ec74b 100644
--- a/usr.sbin/tzsetup/tzsetup.8
+++ b/usr.sbin/tzsetup/tzsetup.8
@@ -62,7 +62,8 @@ Skip the initial question about adjusting the clock if not 
set to UTC.
 .Nm
 will neither create nor delete
 .Pa /etc/wall_cmos_clock .
-On a newly installed system the hardware clock will keep UTC.
+On a newly installed system, the hardware clock will keep UTC.
+This option is enabled automatically on non-x86 hardware.
 .El
 .Pp
 It is possible to short-circuit the menu system by specifying the
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 617de4efb765..6629dd81f250 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -826,23 +826,28 @@ main(int argc, char **argv)
charprompt[128];
int fd;
 #endif
-   int c, rv, skiputc;
+   int c, rv;
+   boolskiputc;
+   char*dztpath;
+#if defined(__i386__) || defined(__amd64__)
charvm_guest[16] = "";
size_t  len = sizeof(vm_guest);
-   char*dztpath;
 
+   skiputc = false;
+
+   /* Default skiputc to true for VM guests */
+   if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 &&
+   strcmp(vm_guest, "none") != 0)
+   skiputc = true;
+#else
+   skiputc = true;
+#endif
dztpath = NULL;
-   skiputc = 0;
 
 #ifdef HAVE_BSDDIALOG
setlocale(LC_ALL, "");
 #endif
 
-   /* Default skiputc to 1 for VM guests */
-   if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 &&
-   strcmp(vm_guest, "none") != 0)
-   skiputc = 1;
-
while ((c = getopt(argc, argv, "C:d:nrs")) != -1) {
switch (c) {
case 'C':
@@ -861,7 +866,7 @@ main(int argc, char **argv)
 #endif
break;
case 's':
-   skiputc = 1;
+   skiputc = true;
break;
default:
usage();
@@ -951,7 +956,7 @@ main(int argc, char **argv)
if (bsddialog_init() == BSDDIALOG_ERROR)
errx(1, "Error bsddialog: %s\n", bsddialog_geterror());
 
-   if (skiputc == 0) {
+   if (!skiputc) {
snprintf(prompt, sizeof(prompt),
"Is this machine's CMOS clock set to UTC?  "
"If it is set to local time,\n"



git: fb1028dcd4ae - main - hda: add support for Tiger Lake-H

2024-06-14 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fb1028dcd4aedc4d48dbd97314f008c663b2e711

commit fb1028dcd4aedc4d48dbd97314f008c663b2e711
Author: Adam Retter 
AuthorDate: 2024-06-14 15:57:15 +
Commit: Ed Maste 
CommitDate: 2024-06-14 16:24:59 +

hda: add support for Tiger Lake-H

PR: 272682
Reported by:Miguel Salcedo
Reviewed by:emaste
---
 sys/dev/sound/pci/hda/hdac.c  | 1 +
 sys/dev/sound/pci/hda/hdac.h  | 2 ++
 sys/dev/sound/pci/hda/hdacc.c | 1 +
 3 files changed, 4 insertions(+)

diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index e45c121eb10b..336602b6bbf4 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -109,6 +109,7 @@ static const struct {
{ HDA_INTEL_CMLKLP,  "Intel Comet Lake-LP", 0, 0 },
{ HDA_INTEL_CMLKH,   "Intel Comet Lake-H",  0, 0 },
{ HDA_INTEL_TGLK,"Intel Tiger Lake",0, 0 },
+   { HDA_INTEL_TGLKH,   "Intel Tiger Lake-H",  0, 0 },
{ HDA_INTEL_GMLK,"Intel Gemini Lake",   0, 0 },
{ HDA_INTEL_ALLK,"Intel Alder Lake",0, 0 },
{ HDA_INTEL_ALLKM,   "Intel Alder Lake-M",  0, 0 },
diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h
index b40bfc7f6da3..4b4bd70f800f 100644
--- a/sys/dev/sound/pci/hda/hdac.h
+++ b/sys/dev/sound/pci/hda/hdac.h
@@ -98,6 +98,7 @@
 #define HDA_INTEL_CMLKLP   HDA_MODEL_CONSTRUCT(INTEL, 0x02c8)
 #define HDA_INTEL_CMLKHHDA_MODEL_CONSTRUCT(INTEL, 0x06c8)
 #define HDA_INTEL_TGLK HDA_MODEL_CONSTRUCT(INTEL, 0xa0c8)
+#define HDA_INTEL_TGLKHHDA_MODEL_CONSTRUCT(INTEL, 0x43c8)
 #define HDA_INTEL_MTL  HDA_MODEL_CONSTRUCT(INTEL, 0x7e28)
 #define HDA_INTEL_ARLS HDA_MODEL_CONSTRUCT(INTEL, 0x7f50)
 #define HDA_INTEL_ARL  HDA_MODEL_CONSTRUCT(INTEL, 0x7728)
@@ -911,6 +912,7 @@
 #define HDA_CODEC_INTELGMLK1   HDA_CODEC_CONSTRUCT(INTEL, 0x280d)
 #define HDA_CODEC_INTELICLKHDA_CODEC_CONSTRUCT(INTEL, 0x280f)
 #define HDA_CODEC_INTELTGLKHDA_CODEC_CONSTRUCT(INTEL, 0x2812)
+#define HDA_CODEC_INTELTGLKH   HDA_CODEC_CONSTRUCT(INTEL, 0x2814)
 #define HDA_CODEC_INTELALLKHDA_CODEC_CONSTRUCT(INTEL, 0x2815)
 #define HDA_CODEC_INTELJLK HDA_CODEC_CONSTRUCT(INTEL, 0x281a)
 #define HDA_CODEC_INTELELLKHDA_CODEC_CONSTRUCT(INTEL, 0x281b)
diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c
index 009c9098ac3b..81395a1a9ae7 100644
--- a/sys/dev/sound/pci/hda/hdacc.c
+++ b/sys/dev/sound/pci/hda/hdacc.c
@@ -393,6 +393,7 @@ static const struct {
{ HDA_CODEC_INTELGMLK1, 0,  "Intel Gemini Lake" },
{ HDA_CODEC_INTELICLK, 0,   "Intel Ice Lake" },
{ HDA_CODEC_INTELTGLK, 0,   "Intel Tiger Lake" },
+   { HDA_CODEC_INTELTGLKH, 0,  "Intel Tiger Lake-H" },
{ HDA_CODEC_INTELALLK, 0,   "Intel Alder Lake" },
{ HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" },
{ HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" },



git: f354ca7383f7 - main - development.7: markup nits, tag spdx

2024-06-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f354ca7383f709f8380e11b2192eb62312d4139f

commit f354ca7383f709f8380e11b2192eb62312d4139f
Author: Alexander Ziaee 
AuthorDate: 2024-06-02 13:47:44 +
Commit: Ed Maste 
CommitDate: 2024-06-17 16:52:25 +

development.7: markup nits, tag spdx

Using quoted literals is a mistake in roff(7).
Please escape with `\&`, the zero-width-space.

Reviewed by:emaste
MFC after:  3 days
---
 share/man/man7/development.7 | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/share/man/man7/development.7 b/share/man/man7/development.7
index 0eb5377bd07b..9af9bfb66fa8 100644
--- a/share/man/man7/development.7
+++ b/share/man/man7/development.7
@@ -1,3 +1,6 @@
+.\"-
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
 .\" Copyright (c) 2018 Edward Tomasz Napierala 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -89,7 +92,7 @@ and
 .Xr release 7 .
 Kernel programming interfaces (KPIs) are documented in section 9
 manual pages; use
-.Ql "apropos -s 9 ."
+.Ql apropos -s 9 \&.
 for a list.
 Regression test suite is described in
 .Xr tests 7 .
@@ -116,7 +119,6 @@ build and test status of CURRENT and STABLE branches,
 the continuous integration system is at:
 .Pp
 .Lk https://ci.FreeBSD.org
-.Pp
 .Sh EXAMPLES
 Check out the CURRENT branch, build it, and install, overwriting the current
 system:
@@ -187,8 +189,7 @@ The
 .Nm
 manual page was originally written by
 .An Matthew Dillon Aq Mt dil...@freebsd.org
-and first appeared
-in
+and first appeared in
 .Fx 5.0 ,
 December 2002.
 It was since extensively modified by



git: c6030b380469 - main - Revert "tzsetup: ask local/UTC question only on x86"

2024-06-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c6030b380469f928c8cae87ed53bcb234cb3486f

commit c6030b380469f928c8cae87ed53bcb234cb3486f
Author: Ed Maste 
AuthorDate: 2024-06-17 17:03:44 +
Commit: Ed Maste 
CommitDate: 2024-06-17 17:04:40 +

Revert "tzsetup: ask local/UTC question only on x86"

I am unsure if AArch64 Windows systems keep UTC or local time in the RTC
by default, so keep tzsetup consistent across architectures for now.

This reverts commit aa6fb1d277be47c51abc309ac9305def0fce7f9d.

Reported by: Mark Millard
---
 usr.sbin/tzsetup/tzsetup.8 |  1 -
 usr.sbin/tzsetup/tzsetup.c | 25 ++---
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8
index 4e70875ec74b..3fd463c31ee5 100644
--- a/usr.sbin/tzsetup/tzsetup.8
+++ b/usr.sbin/tzsetup/tzsetup.8
@@ -63,7 +63,6 @@ Skip the initial question about adjusting the clock if not 
set to UTC.
 will neither create nor delete
 .Pa /etc/wall_cmos_clock .
 On a newly installed system, the hardware clock will keep UTC.
-This option is enabled automatically on non-x86 hardware.
 .El
 .Pp
 It is possible to short-circuit the menu system by specifying the
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 6629dd81f250..617de4efb765 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -826,28 +826,23 @@ main(int argc, char **argv)
charprompt[128];
int fd;
 #endif
-   int c, rv;
-   boolskiputc;
-   char*dztpath;
-#if defined(__i386__) || defined(__amd64__)
+   int c, rv, skiputc;
charvm_guest[16] = "";
size_t  len = sizeof(vm_guest);
+   char*dztpath;
 
-   skiputc = false;
-
-   /* Default skiputc to true for VM guests */
-   if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 &&
-   strcmp(vm_guest, "none") != 0)
-   skiputc = true;
-#else
-   skiputc = true;
-#endif
dztpath = NULL;
+   skiputc = 0;
 
 #ifdef HAVE_BSDDIALOG
setlocale(LC_ALL, "");
 #endif
 
+   /* Default skiputc to 1 for VM guests */
+   if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 &&
+   strcmp(vm_guest, "none") != 0)
+   skiputc = 1;
+
while ((c = getopt(argc, argv, "C:d:nrs")) != -1) {
switch (c) {
case 'C':
@@ -866,7 +861,7 @@ main(int argc, char **argv)
 #endif
break;
case 's':
-   skiputc = true;
+   skiputc = 1;
break;
default:
usage();
@@ -956,7 +951,7 @@ main(int argc, char **argv)
if (bsddialog_init() == BSDDIALOG_ERROR)
errx(1, "Error bsddialog: %s\n", bsddialog_geterror());
 
-   if (!skiputc) {
+   if (skiputc == 0) {
snprintf(prompt, sizeof(prompt),
"Is this machine's CMOS clock set to UTC?  "
"If it is set to local time,\n"



Re: git: aa6fb1d277be - main - tzsetup: ask local/UTC question only on x86

2024-06-17 Thread Ed Maste
On Fri, 14 Jun 2024 at 15:56, Mark Millard  wrote:
>
> So, you are saying that the modern aarch64 Windows 11 on a system
> that has an RTC would be based on storing UTC in the RTC, even for
> booting Windows 11?

Oh, very good point. I am not sure, so have reverted the change via
commit c6030b380469 and may recommit it once we have a conclusive
answer.



git: 2d6094615a13 - main - release: Remove mergemaster mm-mtree.sh script

2024-06-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2d6094615a137d9d4fc0ea0b29132d4a7e358eb5

commit 2d6094615a137d9d4fc0ea0b29132d4a7e358eb5
Author: Ed Maste 
AuthorDate: 2023-09-09 16:14:58 +
Commit: Ed Maste 
CommitDate: 2024-06-17 18:37:46 +

release: Remove mergemaster mm-mtree.sh script

It is unused after 8ee478dfd46d ("release: stop generating mergemaster
databases").

Sponsored by:   The FreeBSD Foundation
---
 release/scripts/mm-mtree.sh | 152 
 1 file changed, 152 deletions(-)

diff --git a/release/scripts/mm-mtree.sh b/release/scripts/mm-mtree.sh
deleted file mode 100755
index 7ba7d0c9694a..
--- a/release/scripts/mm-mtree.sh
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/sh
-
-# mergemaster mtree database generator
-
-# This script is intended to be used as part of the release building
-# process to generate the /var/db/mergemaster.mtree file relevant to
-# the source tree used to create the release so that users can make
-# use of mergemaster's -U option to update their files after updating
-# to -stable.
-
-# Copyright 2009 Douglas Barton
-# do...@freebsd.org
-
-PATH=/bin:/usr/bin:/usr/sbin
-
-display_usage () {
-  VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
-  echo "${0##*/} version ${VERSION_NUMBER}"
-  echo "Usage: ${0##*/} [-m /path] [-t /path] [-A arch] [-F ] [-D 
/path]"
-  echo "Options:"
-  echo "  -m /path/directory  Specify location of source to do the make in"
-  echo "  -t /path/directory  Specify temp root directory"
-  echo "  -A architecture  Alternative architecture name to pass to make"
-  echo "  -F  Specify what to put on the make command line"
-  echo '  -D /path/directory  Specify the destination directory to install 
files to'
-  echo ''
-}
-
-# Set the default path for the temporary root environment
-#
-TEMPROOT=`TMPDIR=/var/tmp mktemp -d -t temproot`
-
-# Assign the location of the mtree database
-#
-MTREEDB=${MTREEDB:-/var/db}
-MTREEFILE="${MTREEDB}/mergemaster.mtree"
-
-# Check the command line options
-#
-while getopts "m:t:A:F:D:h" COMMAND_LINE_ARGUMENT ; do
-  case "${COMMAND_LINE_ARGUMENT}" in
-  m)
-SOURCEDIR=${OPTARG}
-;;
-  t)
-TEMPROOT=${OPTARG}
-;;
-  A)
-ARCHSTRING='TARGET_ARCH='${OPTARG}
-;;
-  F)
-MM_MAKE_ARGS="${OPTARG}"
-;;
-  D)
-DESTDIR=${OPTARG}
-;;
-  h)
-display_usage
-exit 0
-;;
-  *)
-echo ''
-display_usage
-exit 1
-;;
-  esac
-done
-
-# Assign the source directory
-#
-SOURCEDIR=${SOURCEDIR:-/usr/src}
-if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \
-   -f ${SOURCEDIR}/../Makefile.inc1 ]; then
-  echo " *** The source directory you specified (${SOURCEDIR})"
-  echo " will be reset to ${SOURCEDIR}/.."
-  echo ''
-  sleep 3
-  SOURCEDIR=${SOURCEDIR}/..
-fi
-
-# Setup make to use system files from SOURCEDIR
-MM_MAKE="make ${ARCHSTRING} ${MM_MAKE_ARGS} -m ${SOURCEDIR}/share/mk 
-DDB_FROM_SRC"
-
-delete_temproot () {
-  rm -rf "${TEMPROOT}" 2>/dev/null
-  chflags -R 0 "${TEMPROOT}" 2>/dev/null
-  rm -rf "${TEMPROOT}" || exit 1
-}
-
-[ -d "${TEMPROOT}" ] && delete_temproot
-
-echo "*** Creating the temporary root environment in ${TEMPROOT}"
-
-if mkdir -p "${TEMPROOT}"; then
-  echo " *** ${TEMPROOT} ready for use"
-fi
-
-if [ ! -d "${TEMPROOT}" ]; then
-  echo ''
-  echo "  *** FATAL ERROR: Cannot create ${TEMPROOT}"
-  echo ''
-  exit 1
-fi
-
-echo " *** Creating and populating directory structure in ${TEMPROOT}"
-echo ''
-
-{ cd ${SOURCEDIR} || { echo "*** Cannot cd to ${SOURCEDIR}" ; exit 1;}
-  case "${DESTDIR}" in
-  '') ;;
-  *)
-${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs
-;;
-  esac
-  ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs &&
-  ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc &&
-  ${MM_MAKE} everything SUBDIR_OVERRIDE=etc &&
-  ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} ||
-  { echo '';
-echo "  *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to";
-echo "  the temproot environment";
-echo '';
-exit 1;}
-
-# We really don't want to have to deal with files like login.conf.db, pwd.db,
-# or spwd.db.  Instead, we want to compare the text versions, and run *_mkdb.
-# Prompt the user to do so below, as needed.
-#
-rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd
-
-# We only need to compare things like freebsd.cf once
-find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null
-
-# Delete stuff we do not need to keep the mtree datab

git: e2ad879d4c60 - main - ifconfig: make interface address without mask an error

2024-06-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e2ad879d4c60fb22e768da5caec92920bc5f626b

commit e2ad879d4c60fb22e768da5caec92920bc5f626b
Author: Ed Maste 
AuthorDate: 2024-06-13 17:37:32 +
Commit: Ed Maste 
CommitDate: 2024-06-18 00:21:06 +

ifconfig: make interface address without mask an error

In commit d8237b955528, as part of the deprecation of IPv4 address
classes, Mike Karels introduced a warning in ifconfig for setting an
address without a width or mask.  The commit message says "This will
hopefully be an error in the future."

As the warning has been included in releases from FreeBSD 13.1 on, and
sufficient time has passed, turn this into an error.

Reviewed by:allanjude, olce, grembo, philip, gordon
Relnotes:   Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45585
---
 UPDATING|  5 +
 sbin/ifconfig/af_inet.c | 32 
 2 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/UPDATING b/UPDATING
index 98d8b58dcd20..2b6f9cb0d956 100644
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20240617:
+   ifconfig now treats IPv4 addresses without a width or mask as an error.
+   Specify the desired mask or width along with the IP address on the
+   ifconfig command line and in rc.conf.
+
 20240428:
OpenBSM auditing runtime (auditd, etc.) has been moved into the new
package FreeBSD-audit.  If you use OpenBSM auditing and pkgbase, you
diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c
index e21956cfc4fd..4fd74d481b3a 100644
--- a/sbin/ifconfig/af_inet.c
+++ b/sbin/ifconfig/af_inet.c
@@ -436,36 +436,13 @@ in_exec_nl(if_ctx *ctx, unsigned long action, void *data)
 
return (e.error);
 }
-
-static void
-in_setdefaultmask_nl(void)
-{
-   struct in_px *px = sintab_nl[ADDR];
-
-   in_addr_t i = ntohl(px->addr.s_addr);
-
-   /*
-* If netmask isn't supplied, use historical default.
-* This is deprecated for interfaces other than loopback
-* or point-to-point; warn in other cases.  In the future
-* we should return an error rather than warning.
-*/
-   if (IN_CLASSA(i))
-   px->plen = 32 - IN_CLASSA_NSHIFT;
-   else if (IN_CLASSB(i))
-   px->plen = 32 - IN_CLASSB_NSHIFT;
-   else
-   px->plen = 32 - IN_CLASSC_NSHIFT;
-   px->maskset = true;
-}
 #endif
 
 static void
-warn_nomask(int ifflags)
+err_nomask(int ifflags)
 {
 if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) {
-   warnx("WARNING: setting interface address without mask "
-   "is deprecated,\ndefault mask may not be correct.");
+   errx(1, "ERROR: setting interface address without mask is no longer 
supported.");
 }
 }
 
@@ -474,12 +451,11 @@ in_postproc(if_ctx *ctx __unused, int newaddr, int 
ifflags)
 {
 #ifdef WITHOUT_NETLINK
if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && 
newaddr) {
-   warn_nomask(ifflags);
+   err_nomask(ifflags);
}
 #else
if (sintab_nl[ADDR]->addrset && !sintab_nl[ADDR]->maskset && newaddr) {
-   warn_nomask(ifflags);
-   in_setdefaultmask_nl();
+   err_nomask(ifflags);
}
 #endif
 }



git: 42fbb55d4549 - main - arch.7: armv6 will be removed prior to FreeBSD 15.0

2024-06-19 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=42fbb55d4549d26dba6b67cd1b501b6dc038dd07

commit 42fbb55d4549d26dba6b67cd1b501b6dc038dd07
Author: Ed Maste 
AuthorDate: 2024-06-19 17:16:48 +
Commit: Ed Maste 
CommitDate: 2024-06-19 17:40:08 +

arch.7: armv6 will be removed prior to FreeBSD 15.0

Reviewed by:andrew, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45633
---
 share/man/man7/arch.7 | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7
index 35a7b0246389..f3d2e1036706 100644
--- a/share/man/man7/arch.7
+++ b/share/man/man7/arch.7
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd September 2, 2023
+.Dd June 19, 2024
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -87,7 +87,6 @@ release to support each architecture.
 .It Sy Architecture Ta Sy Initial Release
 .It aarch64 Ta 11.0
 .It amd64   Ta 5.1
-.It armv6   Ta 10.0
 .It armv7   Ta 12.0
 .It i386Ta 1.0
 .It powerpc Ta 6.0
@@ -103,6 +102,7 @@ Discontinued architectures are shown in the following table.
 .It alpha   Ta 3.2   Ta 6.4
 .It arm Ta 6.0   Ta 12.4
 .It armeb   Ta 8.0   Ta 11.4
+.It armv6   Ta 10.0  Ta 14.x
 .It ia64Ta 5.0   Ta 10.4
 .It mipsTa 8.0   Ta 13.x
 .It mipsel  Ta 9.0   Ta 13.x
@@ -156,7 +156,7 @@ Examples are:
 .It Sy LP64Ta Sy ILP32 counterpart
 .It Dv amd64   Ta Dv i386
 .It Dv powerpc64   Ta Dv powerpc
-.It Dv aarch64 Ta Dv armv6/armv7
+.It Dv aarch64 Ta Dv armv7
 .El
 .Pp
 .Dv aarch64
@@ -166,11 +166,7 @@ or
 .Dv armv7
 binaries if the CPU implements
 .Dv AArch32
-execution state, however older
-.Dv armv4
-and
-.Dv armv5
-binaries aren't supported.
+execution state, however older arm binaries aren't supported.
 .Pp
 On all supported architectures:
 .Bl -column -offset -indent "long long" "Size"
@@ -195,7 +191,6 @@ Machine-dependent type sizes:
 .It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t
 .It aarch64 Ta 8 Ta 16 Ta 8
 .It amd64   Ta 8 Ta 16 Ta 8
-.It armv6   Ta 4 Ta  8 Ta 8
 .It armv7   Ta 4 Ta  8 Ta 8
 .It i386Ta 4 Ta 12 Ta 4
 .It powerpc Ta 4 Ta  8 Ta 8
@@ -212,7 +207,6 @@ is 8 bytes on all supported architectures except i386.
 .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
 .It aarch64 Ta little Ta unsigned
 .It amd64   Ta little Ta   signed
-.It armv6   Ta little Ta unsigned
 .It armv7   Ta little Ta unsigned
 .It i386Ta little Ta   signed
 .It powerpc Ta bigTa unsigned
@@ -226,7 +220,6 @@ is 8 bytes on all supported architectures except i386.
 .It Sy Architecture Ta Sy Page Sizes
 .It aarch64 Ta 4K, 2M, 1G
 .It amd64   Ta 4K, 2M, 1G
-.It armv6   Ta 4K, 1M
 .It armv7   Ta 4K, 1M
 .It i386Ta 4K, 2M (PAE), 4M
 .It powerpc Ta 4K
@@ -240,7 +233,6 @@ is 8 bytes on all supported architectures except i386.
 .It Sy Architecture Ta Sy float, double Ta Sy long double
 .It aarch64 Ta hard Ta soft, quad precision
 .It amd64   Ta hard Ta hard, 80 bit
-.It armv6   Ta hard Ta hard, double precision
 .It armv7   Ta hard Ta hard, double precision
 .It i386Ta hard Ta hard, 80 bit
 .It powerpc Ta hard Ta hard, double precision
@@ -276,7 +268,7 @@ or similar things like boot sequences.
 .It Dv MACHINE Ta Dv MACHINE_CPUARCH Ta Dv MACHINE_ARCH
 .It arm64 Ta aarch64 Ta aarch64
 .It amd64 Ta amd64 Ta amd64
-.It arm Ta arm Ta armv6, armv7
+.It arm Ta arm Ta armv7
 .It i386 Ta i386 Ta i386
 .It powerpc Ta powerpc Ta powerpc, powerpcspe, powerpc64, powerpc64le
 .It riscv Ta riscv Ta riscv64
@@ -308,7 +300,6 @@ Architecture-specific macros:
 .It Sy Architecture Ta Sy Predefined macros
 .It aarch64 Ta Dv __aarch64__
 .It amd64   Ta Dv __amd64__ , Dv __x86_64__
-.It armv6   Ta Dv __arm__ , Dv __ARM_ARCH >= 6
 .It armv7   Ta Dv __arm__ , Dv __ARM_ARCH >= 7
 .It i386Ta Dv __i386__
 .It powerpc Ta Dv __powerpc__



git: 1efd69f933b6 - main - p9fs: move NULL check immediately after allocation

2024-06-24 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1efd69f933b6ad4177ecda78cf4891aa9a1e8f6b

commit 1efd69f933b6ad4177ecda78cf4891aa9a1e8f6b
Author: Ed Maste 
AuthorDate: 2024-06-24 16:21:19 +
Commit: Ed Maste 
CommitDate: 2024-06-24 19:36:11 +

p9fs: move NULL check immediately after allocation

Reported by:Shawn Webb (HardenedBSD)
Reviewed by:dfr
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45719
---
 sys/dev/virtio/p9fs/virtio_p9fs.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c 
b/sys/dev/virtio/p9fs/virtio_p9fs.c
index 48430b4f6b67..811faff6cd93 100644
--- a/sys/dev/virtio/p9fs/virtio_p9fs.c
+++ b/sys/dev/virtio/p9fs/virtio_p9fs.c
@@ -332,6 +332,11 @@ vt9p_attach(device_t dev)
cv_init(&chan->submit_cv, "Conditional variable for submit queue" );
chan->max_nsegs = MAX_SUPPORTED_SGS;
chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_NOWAIT);
+   if (chan->vt9p_sglist == NULL) {
+   error = ENOMEM;
+   P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__);
+   goto out;
+   }
 
/* Negotiate the features from the host */
virtio_set_feature_desc(dev, virtio_9p_feature_desc);
@@ -367,12 +372,6 @@ vt9p_attach(device_t dev)
SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, 
"p9fs_mount_tag",
CTLFLAG_RD, chan->mount_tag, 0, "Mount tag");
 
-   if (chan->vt9p_sglist == NULL) {
-   error = ENOMEM;
-   P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__);
-   goto out;
-   }
-
/* We expect one virtqueue, for requests. */
error = vt9p_alloc_virtqueue(chan);
 



git: e6b88237c6c3 - main - p9fs: use M_WAITOK where appropriate

2024-06-24 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e6b88237c6c33fe2f66cad9836858b877900871a

commit e6b88237c6c33fe2f66cad9836858b877900871a
Author: Ed Maste 
AuthorDate: 2024-06-24 20:10:00 +
Commit: Ed Maste 
CommitDate: 2024-06-25 02:02:13 +

p9fs: use M_WAITOK where appropriate

device_attach routines are allowed to sleep, and this routine already
has other M_WAITOK allocations.

Reported by:markj
Reviewed by:markj
Fixes: 1efd69f933b6 ("p9fs: move NULL check immediately after alloc...")
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45721
---
 sys/dev/virtio/p9fs/virtio_p9fs.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c 
b/sys/dev/virtio/p9fs/virtio_p9fs.c
index 811faff6cd93..aa174d3bd5ba 100644
--- a/sys/dev/virtio/p9fs/virtio_p9fs.c
+++ b/sys/dev/virtio/p9fs/virtio_p9fs.c
@@ -331,12 +331,7 @@ vt9p_attach(device_t dev)
/* Initialize the condition variable */
cv_init(&chan->submit_cv, "Conditional variable for submit queue" );
chan->max_nsegs = MAX_SUPPORTED_SGS;
-   chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_NOWAIT);
-   if (chan->vt9p_sglist == NULL) {
-   error = ENOMEM;
-   P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__);
-   goto out;
-   }
+   chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_WAITOK);
 
/* Negotiate the features from the host */
virtio_set_feature_desc(dev, virtio_9p_feature_desc);



git: 5654b42142e1 - main - libusb: claim to be version 1.0.16

2024-06-28 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5654b42142e1f689b26d405c90379b85f22349a0

commit 5654b42142e1f689b26d405c90379b85f22349a0
Author: Ed Maste 
AuthorDate: 2024-06-06 13:33:44 +
Commit: Ed Maste 
CommitDate: 2024-06-28 16:18:34 +

libusb: claim to be version 1.0.16

We are not 100% compatible with 1.0.16, but implement some
functionality from that version that is required by certain ports.

PR: 277799
PR: 279555 (exp-run)
Event:  Kitchener-Waterloo Hackathon 202406
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45514
---
 lib/libusb/libusb-1.0.pc.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libusb/libusb-1.0.pc.in b/lib/libusb/libusb-1.0.pc.in
index 7dbf746e773e..3a2f27cc52b8 100644
--- a/lib/libusb/libusb-1.0.pc.in
+++ b/lib/libusb/libusb-1.0.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
 
 Name: libusb-1.0
 Description: Library that abstracts ways to access USB devices (v1.0)
-Version: 1.0.13
+Version: 1.0.16
 Libs: -L${libdir} -lusb
 Cflags: -I${includedir}



git: 94416c6939f4 - main - openssh: use '' instead of `' in config.h

2024-07-03 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=94416c6939f431b29286a71bb2797e749df9645c

commit 94416c6939f431b29286a71bb2797e749df9645c
Author: Ed Maste 
AuthorDate: 2024-07-01 14:45:43 +
Commit: Ed Maste 
CommitDate: 2024-07-03 18:22:50 +

openssh: use '' instead of `' in config.h

Autoconf 2.72 uses '' rather tha `' in comments in config.h, from
autoconf commit 64df9b4523fe ("Autoconf now quotes 'like this' instead
of `like this'").

Switch quoting style now to minimize diffs on the next OpenSSH update
and config.h regen.

Reviewed by:gordon, philip
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45840
---
 crypto/openssh/config.h | 614 
 1 file changed, 307 insertions(+), 307 deletions(-)

diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h
index 5e7e93992829..6462ff16d8d9 100644
--- a/crypto/openssh/config.h
+++ b/crypto/openssh/config.h
@@ -196,19 +196,19 @@
 /* Define if you have ut_addr_v6 in utmpx.h */
 /* #undef HAVE_ADDR_V6_IN_UTMPX */
 
-/* Define to 1 if you have the `arc4random' function. */
+/* Define to 1 if you have the 'arc4random' function. */
 #define HAVE_ARC4RANDOM 1
 
-/* Define to 1 if you have the `arc4random_buf' function. */
+/* Define to 1 if you have the 'arc4random_buf' function. */
 #define HAVE_ARC4RANDOM_BUF 1
 
-/* Define to 1 if you have the `arc4random_stir' function. */
+/* Define to 1 if you have the 'arc4random_stir' function. */
 /* #undef HAVE_ARC4RANDOM_STIR */
 
-/* Define to 1 if you have the `arc4random_uniform' function. */
+/* Define to 1 if you have the 'arc4random_uniform' function. */
 #define HAVE_ARC4RANDOM_UNIFORM 1
 
-/* Define to 1 if you have the `asprintf' function. */
+/* Define to 1 if you have the 'asprintf' function. */
 #define HAVE_ASPRINTF 1
 
 /* OpenBSD's gcc has bounded */
@@ -220,52 +220,52 @@
 /* OpenBSD's gcc has sentinel */
 /* #undef HAVE_ATTRIBUTE__SENTINEL__ */
 
-/* Define to 1 if you have the `aug_get_machine' function. */
+/* Define to 1 if you have the 'aug_get_machine' function. */
 /* #undef HAVE_AUG_GET_MACHINE */
 
-/* Define to 1 if you have the `auth_hostok' function. */
+/* Define to 1 if you have the 'auth_hostok' function. */
 #define HAVE_AUTH_HOSTOK 1
 
-/* Define to 1 if you have the `auth_timeok' function. */
+/* Define to 1 if you have the 'auth_timeok' function. */
 #define HAVE_AUTH_TIMEOK 1
 
-/* Define to 1 if you have the `b64_ntop' function. */
+/* Define to 1 if you have the 'b64_ntop' function. */
 /* #undef HAVE_B64_NTOP */
 
-/* Define to 1 if you have the `b64_pton' function. */
+/* Define to 1 if you have the 'b64_pton' function. */
 /* #undef HAVE_B64_PTON */
 
 /* Define if you have the basename function. */
 #define HAVE_BASENAME 1
 
-/* Define to 1 if you have the `bcopy' function. */
+/* Define to 1 if you have the 'bcopy' function. */
 #define HAVE_BCOPY 1
 
-/* Define to 1 if you have the `bcrypt_pbkdf' function. */
+/* Define to 1 if you have the 'bcrypt_pbkdf' function. */
 /* #undef HAVE_BCRYPT_PBKDF */
 
-/* Define to 1 if you have the `bindresvport_sa' function. */
+/* Define to 1 if you have the 'bindresvport_sa' function. */
 #define HAVE_BINDRESVPORT_SA 1
 
-/* Define to 1 if you have the `blf_enc' function. */
+/* Define to 1 if you have the 'blf_enc' function. */
 /* #undef HAVE_BLF_ENC */
 
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_BLF_H */
 
-/* Define to 1 if you have the `Blowfish_expand0state' function. */
+/* Define to 1 if you have the 'Blowfish_expand0state' function. */
 /* #undef HAVE_BLOWFISH_EXPAND0STATE */
 
-/* Define to 1 if you have the `Blowfish_expandstate' function. */
+/* Define to 1 if you have the 'Blowfish_expandstate' function. */
 /* #undef HAVE_BLOWFISH_EXPANDSTATE */
 
-/* Define to 1 if you have the `Blowfish_initstate' function. */
+/* Define to 1 if you have the 'Blowfish_initstate' function. */
 /* #undef HAVE_BLOWFISH_INITSTATE */
 
-/* Define to 1 if you have the `Blowfish_stream2word' function. */
+/* Define to 1 if you have the 'Blowfish_stream2word' function. */
 /* #undef HAVE_BLOWFISH_STREAM2WORD */
 
-/* Define to 1 if you have the `BN_is_prime_ex' function. */
+/* Define to 1 if you have the 'BN_is_prime_ex' function. */
 #define HAVE_BN_IS_PRIME_EX 1
 
 /* Define to 1 if you have the  header file. */
@@ -277,7 +277,7 @@
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_BSTRING_H */
 
-/* Define to 1 if you have the `bzero' function. */

git: b81424adf718 - main - OpenSSH: correct logic error in ObscureKeystrokeTiming

2024-07-05 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b81424adf7181d816c10b1345aaa3305ab0ec304

commit b81424adf7181d816c10b1345aaa3305ab0ec304
Author: Ed Maste 
AuthorDate: 2024-07-01 13:14:15 +
Commit: Ed Maste 
CommitDate: 2024-07-05 13:16:40 +

OpenSSH: correct logic error in ObscureKeystrokeTiming

Cherry-pick fix:
upstream: when sending ObscureKeystrokeTiming chaff packets, we
can't rely on channel_did_enqueue to tell that there is data to send. This
flag indicates that the channels code enqueued a packet on _this_ ppoll()
iteration, not that data was enqueued in _any_ ppoll() iteration in the
timeslice. ok markus@

OpenBSD-Commit-ID: 009b74fd2769b36b5284a0188ade182f00564136

Obtained from:  openssh-portable 146c420d29d0
Reviewed by:gordon
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45823
---
 crypto/openssh/clientloop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c
index 8ec36af94b3f..6dcd6c8535aa 100644
--- a/crypto/openssh/clientloop.c
+++ b/crypto/openssh/clientloop.c
@@ -608,8 +608,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec 
*timeout,
if (timespeccmp(&now, &chaff_until, >=)) {
/* Stop if there have been no keystrokes for a while */
stop_reason = "chaff time expired";
-   } else if (timespeccmp(&now, &next_interval, >=)) {
-   /* Otherwise if we were due to send, then send chaff */
+   } else if (timespeccmp(&now, &next_interval, >=) &&
+   !ssh_packet_have_data_to_write(ssh)) {
+   /* If due to send but have no data, then send chaff */
if (send_chaff(ssh))
nchaff++;
}



git: 004d5af853bf - main - splash(4): fix markup around cross-references

2024-07-15 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=004d5af853bfef1eb66394a15ac9e94e6dcebc0a

commit 004d5af853bfef1eb66394a15ac9e94e6dcebc0a
Author: Ed Maste 
AuthorDate: 2024-07-15 12:53:52 +
Commit: Ed Maste 
CommitDate: 2024-07-15 12:53:52 +

splash(4): fix markup around cross-references

Fixes: 7504e0e3e517 ("splash(4): Document how to use splash screen ...")
Sponsored by: The FreeBSD Foundation
---
 share/man/man4/splash.4 | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/share/man/man4/splash.4 b/share/man/man4/splash.4
index 736703317a7f..af2ae2e4369a 100644
--- a/share/man/man4/splash.4
+++ b/share/man/man4/splash.4
@@ -204,8 +204,8 @@ have the following line in the kernel configuration file.
 .Dl device splash
 .Pp
 Next for
-.Xr syscons 4
-, edit
+.Xr syscons 4 ,
+edit
 .Pa /boot/loader.conf
 (see
 .Xr loader.conf 5 )
@@ -244,8 +244,8 @@ bitmap_name="/boot/splash.bin"
 .Ed
 .Pp
 For
-.Xr vt 4
-, edit
+.Xr vt 4 ,
+edit
 .Pa /boot/loader.conf
 (see
 .Xr loader.conf 5 )



Re: git: 60f098f84119 - main - arch: Update to remove armv6

2024-07-15 Thread Ed Maste
On Sun, 14 Jul 2024 at 02:00, Warner Losh  wrote:
>
>  .Dv aarch64
>  will support execution of
> -.Dv armv6
> -or
>  .Dv armv7
>  binaries if the CPU implements
>  .Dv AArch32
> -execution state, however older arm binaries aren't supported.
> +execution state, however older arm binaries are not supported by
> +.Fx .

Do older 32-bit Arm userland binaries actually not work? Would
"support execution of 32-bit Arm binaries if the CPU implements the
AArch32 execution state" be accurate?



git: 001606523a48 - main - libm: add parens to clarify expressions in fma, fmal

2024-07-15 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=001606523a48ca2aa440c985db47327a00671358

commit 001606523a48ca2aa440c985db47327a00671358
Author: Ed Maste 
AuthorDate: 2024-06-18 01:30:44 +
Commit: Ed Maste 
CommitDate: 2024-07-15 13:30:02 +

libm: add parens to clarify expressions in fma, fmal

Obtained from:  NetBSD
---
 lib/msun/src/s_fma.c  | 6 +++---
 lib/msun/src/s_fmal.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c
index 16902d321290..6c889a6a46ca 100644
--- a/lib/msun/src/s_fma.c
+++ b/lib/msun/src/s_fma.c
@@ -222,17 +222,17 @@ fma(double x, double y, double z)
case FE_TONEAREST:
return (z);
case FE_TOWARDZERO:
-   if (x > 0.0 ^ y < 0.0 ^ z < 0.0)
+   if ((x > 0.0) ^ (y < 0.0) ^ (z < 0.0))
return (z);
else
return (nextafter(z, 0));
case FE_DOWNWARD:
-   if (x > 0.0 ^ y < 0.0)
+   if ((x > 0.0) ^ (y < 0.0))
return (z);
else
return (nextafter(z, -INFINITY));
default:/* FE_UPWARD */
-   if (x > 0.0 ^ y < 0.0)
+   if ((x > 0.0) ^ (y < 0.0))
return (nextafter(z, INFINITY));
else
return (z);
diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c
index 9d08bc72e12e..80c835d09c2b 100644
--- a/lib/msun/src/s_fmal.c
+++ b/lib/msun/src/s_fmal.c
@@ -203,17 +203,17 @@ fmal(long double x, long double y, long double z)
case FE_TONEAREST:
return (z);
case FE_TOWARDZERO:
-   if (x > 0.0 ^ y < 0.0 ^ z < 0.0)
+   if ((x > 0.0) ^ (y < 0.0) ^ (z < 0.0))
return (z);
else
return (nextafterl(z, 0));
case FE_DOWNWARD:
-   if (x > 0.0 ^ y < 0.0)
+   if ((x > 0.0) ^ (y < 0.0))
return (z);
else
return (nextafterl(z, -INFINITY));
default:/* FE_UPWARD */
-   if (x > 0.0 ^ y < 0.0)
+   if ((x > 0.0) ^ (y < 0.0))
return (nextafterl(z, INFINITY));
else
return (z);



git: 867873b3980c - main - Revert "Makefile.inc1: show time for `make installworld'"

2024-07-15 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=867873b3980c42c379f1f0e6ac88d92337ddf5dd

commit 867873b3980c42c379f1f0e6ac88d92337ddf5dd
Author: Ed Maste 
AuthorDate: 2024-07-15 13:49:26 +
Commit: Ed Maste 
CommitDate: 2024-07-15 13:50:04 +

Revert "Makefile.inc1: show time for  `make installworld'"

It broke `make packages`, so revert until that can be fixed.

This reverts commit e5a0202f96948a95bf1b879727e155a4f1d1da93.

Reported by:bapt, theraven
---
 Makefile.inc1 | 22 +++---
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 7ff961e22e7a..19ed923702b1 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1241,19 +1241,11 @@ WMAKE_TGTS+=build${libcompat}
 .endif
 WMAKE_TGTS+=   everything
 
-# record buildworld / install time in seconds
+# record buildworld time in seconds
 .if make(buildworld)
 _BUILDWORLD_START!= date '+%s'
 .export _BUILDWORLD_START
 .endif
-.if make(installworld)
-_INSTALLWORLD_START!= date '+%s'
-.export _INSTALLWORLD_START
-.endif
-.if make(installkernel)
-_INSTALLKERNEL_START!= date '+%s'
-.export _INSTALLKERNEL_START
-.endif
 
 buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY
 .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
@@ -1321,11 +1313,11 @@ kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY
 installcheck: _installcheck_world _installcheck_kernel .PHONY
 _installcheck_world: .PHONY
@echo "--"
-   @echo ">>> Install check world started on `LC_ALL=C date`"
+   @echo ">>> Install check world"
@echo "--"
 _installcheck_kernel: .PHONY
@echo "--"
-   @echo ">>> Install check kernel started on `LC_ALL=C date`"
+   @echo ">>> Install check kernel"
@echo "--"
 
 #
@@ -1649,8 +1641,6 @@ restage reinstall: .MAKE .PHONY
 .endfor
@echo "--"
@echo ">>> Installing everything completed on `LC_ALL=C date`"
-   @seconds=$$(($$(date '+%s') - ${_INSTALLWORLD_START})); \
- echo ">>> Install world completed in $$seconds seconds, ncpu: 
$$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
@echo "--"
 
 redistribute: .MAKE .PHONY
@@ -1883,9 +1873,6 @@ reinstallkernel reinstallkernel.debug: 
_installcheck_kernel .PHONY
@echo "--"
@echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C 
date)"
@echo "--"
-   @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
- echo ">>> Install kernel(s) ${INSTALLKERNEL} completed in $$seconds 
seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
-   @echo "--"
 .endif
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
 .for _kernel in ${BUILDKERNELS:[2..-1]}
@@ -1900,9 +1887,6 @@ reinstallkernel reinstallkernel.debug: 
_installcheck_kernel .PHONY
@echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)"
@echo "--"
 .endfor
-   @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
- echo ">>> Install kernel(s) ${BUILDKERNELS} completed in $$seconds 
seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
-   @echo "--"
 .endif
 
 distributekernel distributekernel.debug: .PHONY



git: a39decd73f82 - main - etcupdate: remove mergemaster cross-reference

2024-07-15 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a39decd73f82c74cbe2cecb8f71ca5d3417e5978

commit a39decd73f82c74cbe2cecb8f71ca5d3417e5978
Author: Ed Maste 
AuthorDate: 2024-07-16 01:36:34 +
Commit: Ed Maste 
CommitDate: 2024-07-16 01:37:14 +

etcupdate: remove mergemaster cross-reference

It will be retired soon.

Sponsored by:   The FreeBSD Foundation
---
 usr.sbin/etcupdate/etcupdate.8 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8
index 82c36fc9cb68..22d3d91bb6eb 100644
--- a/usr.sbin/etcupdate/etcupdate.8
+++ b/usr.sbin/etcupdate/etcupdate.8
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 9, 2022
+.Dd July 15, 2024
 .Dt ETCUPDATE 8
 .Os
 .Sh NAME
@@ -894,7 +894,6 @@ but it has been removed in the destination directory.
 .Xr make 1 ,
 .Xr newaliases 1 ,
 .Xr sh 1 ,
-.Xr mergemaster 8 ,
 .Xr pwd_mkdb 8 ,
 .Xr services_mkdb 8 ,
 .Xr tzsetup 8



git: f2055611fe56 - main - mergemaster: remove from the tree

2024-07-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f2055611fe5624017bd7769c8dc6419c348806ff

commit f2055611fe5624017bd7769c8dc6419c348806ff
Author: Ed Maste 
AuthorDate: 2023-09-09 13:17:16 +
Commit: Ed Maste 
CommitDate: 2024-07-16 12:25:54 +

mergemaster: remove from the tree

Mergemaster has been deprecated for many years, replaced by
etcupdate(8).  Remove it now, in advance of FreeBSD 15.0.

PR: 252417
Reviewed by:imp
Relnotes:   Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45622
---
 ObsoleteFiles.inc   |4 +
 targets/pseudo/userland/Makefile.depend |1 -
 usr.sbin/Makefile   |1 -
 usr.sbin/mergemaster/Makefile   |5 -
 usr.sbin/mergemaster/Makefile.depend|   10 -
 usr.sbin/mergemaster/mergemaster.8  |  485 --
 usr.sbin/mergemaster/mergemaster.sh | 1568 ---
 7 files changed, 4 insertions(+), 2070 deletions(-)

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 19eefda42fe9..f8f0309d6ccf 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -51,6 +51,10 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20240716: retire mergemaster
+OLD_FILES+=usr/sbin/mergemaster
+OLD_FILES+=usr/share/man/man8/mergemaster.8.gz
+
 # 20240527: csh: Remove hardlink /.cshrc
 OLD_FILES+=.cshrc
 
diff --git a/targets/pseudo/userland/Makefile.depend 
b/targets/pseudo/userland/Makefile.depend
index 378531b68cc1..6a844630c999 100644
--- a/targets/pseudo/userland/Makefile.depend
+++ b/targets/pseudo/userland/Makefile.depend
@@ -589,7 +589,6 @@ DIRDEPS+= \
usr.sbin/makemap \
usr.sbin/manctl \
usr.sbin/memcontrol \
-   usr.sbin/mergemaster \
usr.sbin/mfiutil \
usr.sbin/mixer \
usr.sbin/mld6query \
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 9d6c90d09461..e039cea6ee16 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -38,7 +38,6 @@ SUBDIR=   adduser \
mailwrapper \
makefs \
memcontrol \
-   mergemaster \
mfiutil \
mixer \
mlxcontrol \
diff --git a/usr.sbin/mergemaster/Makefile b/usr.sbin/mergemaster/Makefile
deleted file mode 100644
index 2edda1b9bc05..
--- a/usr.sbin/mergemaster/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-SCRIPTS=mergemaster.sh
-MAN=   mergemaster.8
-
-.include 
-
diff --git a/usr.sbin/mergemaster/Makefile.depend 
b/usr.sbin/mergemaster/Makefile.depend
deleted file mode 100644
index 11aba52f82cf..
--- a/usr.sbin/mergemaster/Makefile.depend
+++ /dev/null
@@ -1,10 +0,0 @@
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
-
-
-.include 
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/usr.sbin/mergemaster/mergemaster.8 
b/usr.sbin/mergemaster/mergemaster.8
deleted file mode 100644
index 20d746de347c..
--- a/usr.sbin/mergemaster/mergemaster.8
+++ /dev/null
@@ -1,485 +0,0 @@
-.\" Copyright (c) 1998-2011 Douglas Barton
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"notice, this list of conditions and the following disclaimer in the
-.\"documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.Dd April 16, 2024
-.Dt MERGEMASTER 8
-.Os
-.Sh NAME
-.Nm mergemaster
-.Nd merge configuration files, et al during an upgrade
-.Sh SYNOPSIS
-.Nm
-.Op Fl scrvhpCP
-.Op Fl a|iFU
-.Op Fl -run-updates=[always|never]
-.Op Fl m Ar /path/to/sources
-.Op Fl t Ar /path/to/temp/root
-.Op Fl d
-.Op Fl u Ar N
-.Op Fl w Ar N
-.Op Fl A Ar Target architecture

git: afd67a167799 - main - etcupdate(8): improve phrasing

2024-07-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=afd67a1677999b0f9d82d29bfd7c767f665e76e8

commit afd67a1677999b0f9d82d29bfd7c767f665e76e8
Author: Ed Maste 
AuthorDate: 2024-07-16 01:44:11 +
Commit: Ed Maste 
CommitDate: 2024-07-16 19:17:31 +

etcupdate(8): improve phrasing

Reported by:igor(1)
---
 usr.sbin/etcupdate/etcupdate.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8
index 22d3d91bb6eb..bf7ddb792907 100644
--- a/usr.sbin/etcupdate/etcupdate.8
+++ b/usr.sbin/etcupdate/etcupdate.8
@@ -485,7 +485,7 @@ as additional parameters to
 when building a
 .Dq current
 tree.
-This can be used for to set the
+This can be used to set the
 .Dv TARGET
 or
 .Dv TARGET_ARCH



git: 0ac6cc3fd747 - main - iichid: Soften "Interrupt setup failed" message

2024-07-23 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0ac6cc3fd7473a7a8596fa73322a67fc1d78df53

commit 0ac6cc3fd7473a7a8596fa73322a67fc1d78df53
Author: Ed Maste 
AuthorDate: 2024-07-23 17:37:15 +
Commit: Ed Maste 
CommitDate: 2024-07-23 20:38:16 +

iichid: Soften "Interrupt setup failed" message

Users may interpret the message as a possible hardware error, but the
issue is in fact unimplemented functionality.  Reword the message to
avoid implying it is an error.

Reviewed by:wulf
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46092
---
 sys/dev/iicbus/iichid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c
index 222f20842a04..1e0dac2ee5dd 100644
--- a/sys/dev/iicbus/iichid.c
+++ b/sys/dev/iicbus/iichid.c
@@ -1154,7 +1154,7 @@ iichid_attach(device_t dev)
if (sc->irq_res == NULL || error != 0) {
 #ifdef IICHID_SAMPLING
device_printf(sc->dev,
-   "Interrupt setup failed. Fallback to sampling\n");
+   "Using sampling mode\n");
sc->sampling_rate_slow = IICHID_SAMPLING_RATE_SLOW;
 #else
device_printf(sc->dev, "Interrupt setup failed\n");



git: d55de30efd09 - main - tools/build/make.py: Minor typo fix

2024-07-27 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d55de30efd09ee011bf4604be1c15ce4155775c1

commit d55de30efd09ee011bf4604be1c15ce4155775c1
Author: Jose Luis Duran 
AuthorDate: 2024-07-25 04:32:33 +
Commit: Ed Maste 
CommitDate: 2024-07-28 03:04:24 +

tools/build/make.py: Minor typo fix

If the object directory prefix does not exist, make.py previously exited
with a message indicating that the chosen prefix does not exit.

Reviewed by:emaste
Pull request:   https://github.com/freebsd/freebsd-src/pull/1348
---
 tools/build/make.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/make.py b/tools/build/make.py
index 73788a8896c7..ec42cb70dd21 100755
--- a/tools/build/make.py
+++ b/tools/build/make.py
@@ -243,7 +243,7 @@ if __name__ == "__main__":
 sys.exit("MAKEOBJDIRPREFIX is not set, cannot continue!")
 if not Path(MAKEOBJDIRPREFIX).is_dir():
 sys.exit(
-"Chosen MAKEOBJDIRPREFIX=" + MAKEOBJDIRPREFIX + " doesn't exit!")
+"Chosen MAKEOBJDIRPREFIX=" + MAKEOBJDIRPREFIX + " doesn't exist!")
 objdir_prefix = Path(MAKEOBJDIRPREFIX).absolute()
 source_root = Path(__file__).absolute().parent.parent.parent
 



git: 34f746cc7f8a - main - libm: fma: correct zero sign with small inputs

2024-07-28 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=34f746cc7f8a8dd261027a8b392b76e70adc8438

commit 34f746cc7f8a8dd261027a8b392b76e70adc8438
Author: Steve Kargl 
AuthorDate: 2024-06-16 23:41:38 +
Commit: Ed Maste 
CommitDate: 2024-07-28 21:37:45 +

libm: fma: correct zero sign with small inputs

This is a fixed version of 888796ade284.

PR: 277783
Reported by:Victor Stinner
Reviewed by:emaste
MFC after:  1 week
---
 lib/msun/src/s_fma.c  | 4 ++--
 lib/msun/src/s_fmal.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c
index 6c889a6a46ca..23a84491dd2a 100644
--- a/lib/msun/src/s_fma.c
+++ b/lib/msun/src/s_fma.c
@@ -260,14 +260,14 @@ fma(double x, double y, double z)
 
spread = ex + ey;
 
-   if (r.hi == 0.0) {
+   if (r.hi == 0.0 && xy.lo == 0) {
/*
 * When the addends cancel to 0, ensure that the result has
 * the correct sign.
 */
fesetround(oround);
volatile double vzs = zs; /* XXX gcc CSE bug workaround */
-   return (xy.hi + vzs + ldexp(xy.lo, spread));
+   return (xy.hi + vzs);
}
 
if (oround != FE_TONEAREST) {
diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c
index 80c835d09c2b..2fca20610157 100644
--- a/lib/msun/src/s_fmal.c
+++ b/lib/msun/src/s_fmal.c
@@ -241,14 +241,14 @@ fmal(long double x, long double y, long double z)
 
spread = ex + ey;
 
-   if (r.hi == 0.0) {
+   if (r.hi == 0.0 && xy.lo == 0) {
/*
 * When the addends cancel to 0, ensure that the result has
 * the correct sign.
 */
fesetround(oround);
volatile long double vzs = zs; /* XXX gcc CSE bug workaround */
-   return (xy.hi + vzs + ldexpl(xy.lo, spread));
+   return (xy.hi + vzs);
}
 
if (oround != FE_TONEAREST) {



git: ba373fca78a1 - main - Do not clean (in buildworld/buildkernel) by default

2024-07-29 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ba373fca78a114768244d6a8c27983da870c1169

commit ba373fca78a114768244d6a8c27983da870c1169
Author: Ed Maste 
AuthorDate: 2024-07-29 00:00:00 +
Commit: Ed Maste 
CommitDate: 2024-07-29 17:16:52 +

Do not clean (in buildworld/buildkernel) by default

As discussed on the freebsd-arch mailing list[1].  For historical
reasons FreeBSD's buildworld and buildkernel targets started by cleaning
the object tree, for traditional (non-metamode) builds.

Cleaning is not necessary when dependencies are properly tracked, and we
have a somewhat kludgey script[2] to handle some known cases where deps
were mishandled by traditional builds.  Be consistent with the vast
majority of open source build systems by default, and do not clean at
the beginning of buildworld or buildkernel.

Users may set WITH_CLEAN in src.conf(5) to restore the previous
behaviour, or run `make cleanworld` and/or `make cleankernel` before
starting a build.

[1] https://lists.freebsd.org/archives/freebsd-arch/2024-July/000727.html
[2] tools/build/depend-cleanup.sh

Reviewed by:jhb, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46172
---
 UPDATING   | 10 ++
 share/man/man5/src.conf.5  |  6 +++---
 share/mk/src.opts.mk   |  2 +-
 tools/build/options/WITH_CLEAN |  1 +
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/UPDATING b/UPDATING
index fc3abb285039..cffafdb5d247 100644
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20240729:
+   The build now defaults to WITHOUT_CLEAN - i.e., no automatic clean
+   is performed at the beginning of buildworld or buildkernel.  The
+   WITH_CLEAN src.conf(5) knob can be used to restore the previous
+   behaviour.
+
+   If you encounter incremental build issues, please report them to the
+   freebsd-current mailing list so that a special-case dependency can be
+   added, if necessary.
+
 20240712:
Support for armv6 has been disconnected and is being removed.
 
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 1d35823fc9c4..a12a2a8cb9f4 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,5 +1,5 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
-.Dd May 22, 2024
+.Dd July 29, 2024
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -383,8 +383,8 @@ Build clang-format.
 .It Va WITHOUT_CLANG_FULL
 Avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
 the Clang C/C++ compiler.
-.It Va WITHOUT_CLEAN
-Do not clean before building world and/or kernel.
+.It Va WITH_CLEAN
+Clean before building world and/or kernel.
 .It Va WITHOUT_CPP
 Do not build
 .Xr cpp 1 .
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 501df88cd776..d7e246d10396 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -80,7 +80,6 @@ __DEFAULT_YES_OPTIONS = \
 CDDL \
 CLANG \
 CLANG_BOOTSTRAP \
-CLEAN \
 CPP \
 CROSS_COMPILER \
 CRYPT \
@@ -195,6 +194,7 @@ __DEFAULT_NO_OPTIONS = \
 BHYVE_SNAPSHOT \
 CLANG_EXTRAS \
 CLANG_FORMAT \
+CLEAN \
 DIALOG \
 DETECT_TZ_CHANGES \
 DISK_IMAGE_TOOLS_BOOTSTRAP \
diff --git a/tools/build/options/WITH_CLEAN b/tools/build/options/WITH_CLEAN
new file mode 100644
index ..d5962258bcc0
--- /dev/null
+++ b/tools/build/options/WITH_CLEAN
@@ -0,0 +1 @@
+Clean before building world and/or kernel.



git: 4a06d149371c - main - depend-cleanup: remove entries from 2020 and 2021

2024-07-29 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4a06d149371c16287e1dd5a8fa51e92346a0c3f4

commit 4a06d149371c16287e1dd5a8fa51e92346a0c3f4
Author: Ed Maste 
AuthorDate: 2024-07-29 17:06:48 +
Commit: Ed Maste 
CommitDate: 2024-07-29 18:57:32 +

depend-cleanup: remove entries from 2020 and 2021

> These tests increase the build time (albeit by a small amount), so
> they should be removed once enough time has passed and it is extremely
> unlikely anyone would try a NO_CLEAN build against an object tree from
> before the related change.

The comment suggests a year is a reasonable period but we'll be somewhat
more conservative for now, in part so that we retain different examples
of special cases.

Reviewed by:brooks, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46178
---
 tools/build/depend-cleanup.sh | 51 ---
 1 file changed, 51 deletions(-)

diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
index 45f04c0ace73..b93d50a57ff4 100755
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -103,57 +103,6 @@ clean_dep()
 }
 
 # Date  Rev  Description
-# 20200310  r358851  rename of openmp's ittnotify_static.c to .cpp
-clean_dep lib/libomp ittnotify_static c
-# 20200414  r359930  closefrom
-clean_dep lib/libc   closefrom S
-
-# 20200826  r364746  OpenZFS merge, apply a big hammer (remove whole tree)
-if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \
-egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" 
\
-"$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then
-   echo "Removing old ZFS tree"
-   for libcompat in "" $ALL_libcompats; do
-   dirprfx=${libcompat:+obj-lib${libcompat}/}
-   run rm -rf "$OBJTOP"/${dirprfx}cddl
-   done
-fi
-
-# 20200916  WARNS bumped, need bootstrapped crunchgen stubs
-if [ -e "$OBJTOP"/rescue/rescue/rescue.c ] && \
-! grep -q 'crunched_stub_t' "$OBJTOP"/rescue/rescue/rescue.c; then
-   echo "Removing old rescue(8) tree"
-   run rm -rf "$OBJTOP"/rescue/rescue
-fi
-
-# 20210105  fda7daf06301   pfctl gained its own version of pf_ruleset.c
-if [ -e "$OBJTOP"/sbin/pfctl/.depend.pf_ruleset.o ] && \
-egrep -qw "sys/netpfil/pf/pf_ruleset.c" \
-"$OBJTOP"/sbin/pfctl/.depend.pf_ruleset.o; then
-   echo "Removing old pf_ruleset dependecy file"
-   run rm -rf "$OBJTOP"/sbin/pfctl/.depend.pf_ruleset.o
-fi
-
-# 20210108  821aa63a0940   non-widechar version of ncurses removed
-if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then
-   echo "Removing stale ncurses objects"
-   for libcompat in "" $ALL_libcompats; do
-   dirprfx=${libcompat:+obj-lib${libcompat}/}
-   run rm -rf "$OBJTOP"/${dirprfx}lib/ncurses
-   done
-fi
-
-# 20210608  f20893853e8emove from atomic.S to atomic.c
-clean_dep   cddl/lib/libspl atomic S
-# 20211207  cbdec8db18b5switch to libthr-friendly pdfork
-clean_dep   lib/libcpdfork S
-
-# 20211230  5e6a2d6eb220libc++.so.1 path changed in ldscript
-if [ -e "$OBJTOP"/lib/libc++/libc++.ld ] && \
-fgrep -q "/usr/lib/libc++.so" "$OBJTOP"/lib/libc++/libc++.ld; then
-   echo "Removing old libc++ linker script"
-   run rm -f "$OBJTOP"/lib/libc++/libc++.ld
-fi
 
 # 20220326  fbc002cb72d2move from bcmp.c to bcmp.S
 if [ "$MACHINE_ARCH" = "amd64" ]; then



git: 5c2bc3db201a - main - Remove "All Rights Reserved" from FreeBSD Foundation copyrights

2024-07-30 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5c2bc3db201a4fe8d7911cf816bea104d5dc2138

commit 5c2bc3db201a4fe8d7911cf816bea104d5dc2138
Author: Ed Maste 
AuthorDate: 2024-07-30 16:02:17 +
Commit: Ed Maste 
CommitDate: 2024-07-30 16:16:36 +

Remove "All Rights Reserved" from FreeBSD Foundation copyrights

These ones were unambiguous cases where the Foundation was the only
listed copyright holder.

Sponsored by:   The FreeBSD Foundation
---
 include/xlocale.h | 1 -
 lib/libcasper/services/cap_dns/cap_dns.c  | 1 -
 lib/libcasper/services/cap_dns/cap_dns.h  | 1 -
 lib/libcasper/services/cap_dns/tests/dns_test.c   | 1 -
 lib/libcasper/services/cap_grp/cap_grp.c  | 1 -
 lib/libcasper/services/cap_grp/cap_grp.h  | 1 -
 lib/libcasper/services/cap_grp/tests/grp_test.c   | 1 -
 lib/libcasper/services/cap_pwd/cap_pwd.c  | 1 -
 lib/libcasper/services/cap_pwd/cap_pwd.h  | 1 -
 lib/libcasper/services/cap_pwd/tests/pwd_test.c   | 1 -
 lib/libcasper/services/cap_sysctl/cap_sysctl.c| 1 -
 lib/libcasper/services/cap_sysctl/cap_sysctl.h| 1 -
 lib/libcasper/services/cap_sysctl/tests/sysctl_test.c | 1 -
 lib/libnv/common_impl.h   | 1 -
 lib/libnv/tests/nvlist_add_test.c | 1 -
 lib/libnv/tests/nvlist_exists_test.c  | 1 -
 lib/libnv/tests/nvlist_free_test.c| 1 -
 lib/libnv/tests/nvlist_get_test.c | 1 -
 lib/libnv/tests/nvlist_move_test.c| 1 -
 lib/libnv/tests/nvlist_send_recv_test.c   | 1 -
 lib/libproc/proc_bkpt.c   | 1 -
 lib/libproc/proc_regs.c   | 1 -
 lib/libproc/proc_rtld.c   | 1 -
 lib/librtld_db/librtld_db.3   | 1 -
 lib/librtld_db/rtld_db.c  | 1 -
 lib/librtld_db/rtld_db.h  | 1 -
 lib/libthr/plockstat.d| 1 -
 lib/libthr/thread/thr_malloc.c| 1 -
 lib/libthread_db/arch/aarch64/libpthread_md.c | 1 -
 libexec/ftpd/blacklist.c  | 1 -
 libexec/ftpd/blacklist_client.h   | 1 -
 libexec/rc/rc.d/blacklistd| 1 -
 libexec/rtld-elf/aarch64/reloc.c  | 1 -
 libexec/rtld-elf/aarch64/rtld_start.S | 1 -
 libexec/rtld-elf/rtld_malloc.h| 1 -
 sbin/hastctl/hastctl.8| 1 -
 sbin/hastctl/hastctl.c| 1 -
 sbin/hastd/activemap.c| 1 -
 sbin/hastd/activemap.h| 1 -
 sbin/hastd/control.c  | 1 -
 sbin/hastd/control.h  | 1 -
 sbin/hastd/ebuf.c | 1 -
 sbin/hastd/ebuf.h | 1 -
 sbin/hastd/hast_proto.h   | 1 -
 sbin/hastd/hastd.8| 1 -
 sbin/hastd/hastd.h| 1 -
 sbin/hastd/metadata.c | 1 -
 sbin/hastd/metadata.h | 1 -
 sbin/hastd/nv.c   | 1 -
 sbin/hastd/nv.h   | 1 -
 sbin/hastd/proto.c| 1 -
 sbin/hastd/proto.h| 1 -
 sbin/hastd/proto_impl.h   | 1 -
 sbin/hastd/proto_socketpair.c | 1 -
 sbin/hastd/proto_uds.c| 1 -
 sbin/hastd/rangelock.c| 1 -
 sbin/hastd/rangelock.h| 1 -
 sbin/hastd/synch.h| 1 -
 share/examples/hast/ucarp.sh  | 1 -
 share/examples/hast/ucarp_down.sh | 1 -
 share/examples/hast/ucarp_up.sh   | 1 -
 share/examples/kld/khelp/h_example.c  | 1 -
 tests/sys/fs/fusefs/unlink.cc | 1 -
 tests/sys/kern/kern_copyin.c  | 1 -
 tools/regression/capsicum/syscalls/cap_fcntls_limit.c | 1 -
 tools/regression/capsicum/syscalls/cap_getmode.c  | 1 -
 tools/regression/capsicum/syscalls/cap_ioctls_limit.c | 1 -
 tools/regression/capsicum/syscalls/misc.c | 1 -
 tools/regression/capsicum/syscalls/misc.h | 1 -
 tools/test/popss/popss.c  | 1 -
 tools/test/vm86/vm86_test.c   | 1 -
 tools/test/vm86/vm86_test_asm.s   | 1 -
 tools/tools/vt/mkkfont/mkkfont.c  | 1 

git: 2739a6845031 - main - sshd: remove blacklist call from grace_alarm_timer

2024-08-06 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2739a6845031e69be7c03461a9335d8bbb9f59bd

commit 2739a6845031e69be7c03461a9335d8bbb9f59bd
Author: Ed Maste 
AuthorDate: 2024-08-01 00:04:46 +
Commit: Ed Maste 
CommitDate: 2024-08-06 19:14:00 +

sshd: remove blacklist call from grace_alarm_timer

Under certain circumstances it may call log(3), which is not async-
signal-safe.

For now just remove the blacklist integration from this path, which
means that blacklistd will not detect and firewall hosts that establish
a connection but do nothing further.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46203
---
 crypto/openssh/sshd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c
index 0c83e0ea468e..889f2056bc75 100644
--- a/crypto/openssh/sshd.c
+++ b/crypto/openssh/sshd.c
@@ -377,8 +377,6 @@ grace_alarm_handler(int sig)
kill(0, SIGTERM);
}
 
-   BLACKLIST_NOTIFY(the_active_state, BLACKLIST_AUTH_FAIL, "ssh");
-
/* Log error and exit. */
sigdie("Timeout before authentication for %s port %d",
ssh_remote_ipaddr(the_active_state),



git: 3d3bae9b9538 - main - sshd: bump VersionAddendum for 2739a6845031

2024-08-06 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3d3bae9b95388169d396adc8007585699c5a23e0

commit 3d3bae9b95388169d396adc8007585699c5a23e0
Author: Ed Maste 
AuthorDate: 2024-08-06 19:22:53 +
Commit: Ed Maste 
CommitDate: 2024-08-06 19:23:33 +

sshd: bump VersionAddendum for 2739a6845031

Reported by: markj
Fixes: 2739a6845031 ("sshd: remove blacklist call from grace_alarm_...")
Sponsored by: The FreeBSD Foundation
---
 crypto/openssh/sshd_config   | 2 +-
 crypto/openssh/sshd_config.5 | 2 +-
 crypto/openssh/version.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/crypto/openssh/sshd_config b/crypto/openssh/sshd_config
index a06f8fcc13d1..7f559775e3b3 100644
--- a/crypto/openssh/sshd_config
+++ b/crypto/openssh/sshd_config
@@ -105,7 +105,7 @@ AuthorizedKeysFile  .ssh/authorized_keys
 #PermitTunnel no
 #ChrootDirectory none
 #UseBlacklist no
-#VersionAddendum FreeBSD-20240318
+#VersionAddendum FreeBSD-20240806
 
 # no default banner path
 #Banner none
diff --git a/crypto/openssh/sshd_config.5 b/crypto/openssh/sshd_config.5
index 0715b1f9d581..4de510ac8795 100644
--- a/crypto/openssh/sshd_config.5
+++ b/crypto/openssh/sshd_config.5
@@ -1944,7 +1944,7 @@ The default is
 Optionally specifies additional text to append to the SSH protocol banner
 sent by the server upon connection.
 The default is
-.Qq FreeBSD-20240318 .
+.Qq FreeBSD-20240806 .
 The value
 .Cm none
 may be used to disable this.
diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h
index 836b5650b247..82be0be8498f 100644
--- a/crypto/openssh/version.h
+++ b/crypto/openssh/version.h
@@ -5,4 +5,4 @@
 #define SSH_PORTABLE   "p1"
 #define SSH_RELEASESSH_VERSION SSH_PORTABLE
 
-#define SSH_VERSION_FREEBSD"FreeBSD-20240701"
+#define SSH_VERSION_FREEBSD"FreeBSD-20240806"



git: a1295b24842d - main - linuxkpi: use canonical tests for is_{zero,broadcast}_ether_addr

2024-08-08 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a1295b24842d209e6bf93a4823193d56ad2db064

commit a1295b24842d209e6bf93a4823193d56ad2db064
Author: Ed Maste 
AuthorDate: 2024-08-08 00:00:00 +
Commit: Ed Maste 
CommitDate: 2024-08-08 16:39:14 +

linuxkpi: use canonical tests for is_{zero,broadcast}_ether_addr

They are functionally equivalent, but the updated form mirrors the tests
in sys/net/ethernet.h and avoids confusion.

Reviewed by:kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D21037
---
 sys/compat/linuxkpi/common/include/linux/etherdevice.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h 
b/sys/compat/linuxkpi/common/include/linux/etherdevice.h
index 89cd4c8e0ba0..5d3df744ae0e 100644
--- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h
+++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h
@@ -53,7 +53,8 @@ struct ethtool_modinfo {
 static inline bool
 is_zero_ether_addr(const u8 * addr)
 {
-   return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == 
0x00);
+   return ((addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]) ==
+   0x00);
 }
 
 static inline bool
@@ -65,7 +66,8 @@ is_multicast_ether_addr(const u8 * addr)
 static inline bool
 is_broadcast_ether_addr(const u8 * addr)
 {
-   return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == 
(6 * 0xff));
+   return ((addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) ==
+   0xff);
 }
 
 static inline bool



git: d8ff42e81684 - main - pipe: keep uio_iovcnt consistent

2024-08-08 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d8ff42e816848a0d4a427755b46b8560cb86ebc8

commit d8ff42e816848a0d4a427755b46b8560cb86ebc8
Author: Ed Maste 
AuthorDate: 2024-07-17 14:33:53 +
Commit: Ed Maste 
CommitDate: 2024-08-08 18:16:26 +

pipe: keep uio_iovcnt consistent

In pipe_build_write_buffer we increment uio_iov but did not update
uio_iovcnt.  This would not cause an OOB read (thanks to to uio_resid)
but is inconsistent and could be an issue if other code changes are made
in the future.

Reported by:Synacktiv
Reviewed by:jhb, markj, brooks
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45999
---
 sys/kern/sys_pipe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 70b2a03e0140..73b6facec6c7 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -941,8 +941,10 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio 
*uio)
 
uio->uio_iov->iov_len -= size;
uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + size;
-   if (uio->uio_iov->iov_len == 0)
+   if (uio->uio_iov->iov_len == 0) {
uio->uio_iov++;
+   uio->uio_iovcnt--;
+   }
uio->uio_resid -= size;
uio->uio_offset += size;
return (0);



git: 6ee6c7b14664 - main - acl_copyin: avoid returning uninitialized memory

2024-08-09 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6ee6c7b146643170602091e8c330314e4ef47b42

commit 6ee6c7b146643170602091e8c330314e4ef47b42
Author: Pierre Pronchery 
AuthorDate: 2024-07-25 12:44:17 +
Commit: Ed Maste 
CommitDate: 2024-08-09 14:40:59 +

acl_copyin: avoid returning uninitialized memory

acl_copyin did not validate the return value of acl_copy_oldacl_into_acl
which could lead to uninitialized acl structure memory reads.

Reported by:Synacktiv
Reviewed by:markj, emaste
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46125
---
 sys/kern/vfs_acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c
index 20a58be02948..fde05478d41c 100644
--- a/sys/kern/vfs_acl.c
+++ b/sys/kern/vfs_acl.c
@@ -145,7 +145,7 @@ acl_copyin(const void *user_acl, struct acl *kernel_acl, 
acl_type_t type)
error = copyin(user_acl, &old, sizeof(old));
if (error != 0)
break;
-   acl_copy_oldacl_into_acl(&old, kernel_acl);
+   error = acl_copy_oldacl_into_acl(&old, kernel_acl);
break;
 
default:



git: 2777a32588e1 - main - iommu: disable dma by default

2024-08-13 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2777a32588e11514a9c7a24cd2915f6d5537cd22

commit 2777a32588e11514a9c7a24cd2915f6d5537cd22
Author: Ed Maste 
AuthorDate: 2024-08-13 19:51:34 +
Commit: Ed Maste 
CommitDate: 2024-08-13 20:00:47 +

iommu: disable dma by default

APIC ID 255 and above require x2APIC and DMAR interrupt remapping.
FreeBSD is starting to be tested on high core count Intel systems that
meet this criteria.  We're going to enable DMAR by default to support
this, so default hw.iommu.dma to 0 to avoid a significant performance
regression.

Reviewed by:kib, jhb
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42435
---
 sys/dev/iommu/busdma_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
index d870e2af3984..3d554249ba3f 100644
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/sys/dev/iommu/busdma_iommu.c
@@ -963,7 +963,7 @@ iommu_init_busdma(struct iommu_unit *unit)
 {
int error;
 
-   unit->dma_enabled = 1;
+   unit->dma_enabled = 0;
error = TUNABLE_INT_FETCH("hw.iommu.dma", &unit->dma_enabled);
if (error == 0) /* compatibility */
TUNABLE_INT_FETCH("hw.dmar.dma", &unit->dma_enabled);



git: 3192fc30230a - main - x86: Enable Intel DMAR by default

2024-08-13 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3192fc30230ae432b80cca783abc2dbea9d3f383

commit 3192fc30230ae432b80cca783abc2dbea9d3f383
Author: Ed Maste 
AuthorDate: 2022-09-30 18:33:41 +
Commit: Ed Maste 
CommitDate: 2024-08-13 20:02:45 +

x86: Enable Intel DMAR by default

APIC ID 255 and above require x2APIC and DMAR interrupt remapping.
FreeBSD is starting to be tested on high core count Intel systems that
meet this criteria.

Reviewed by:kib, jhb
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42435
---
 sys/x86/iommu/intel_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c
index 0b25620114cd..9401892aa9d6 100644
--- a/sys/x86/iommu/intel_drv.c
+++ b/sys/x86/iommu/intel_drv.c
@@ -159,7 +159,8 @@ dmar_count_iter(ACPI_DMAR_HEADER *dmarh, void *arg)
 
 int dmar_rmrr_enable = 1;
 
-static int dmar_enable = 0;
+static int dmar_enable = 1;
+
 static void
 dmar_identify(driver_t *driver, device_t parent)
 {



Re: git: 2777a32588e1 - main - iommu: disable dma by default

2024-08-13 Thread Ed Maste
On Tue, 13 Aug 2024 at 16:03, Ed Maste  wrote:
>
> The branch main has been updated by emaste:
>
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=2777a32588e11514a9c7a24cd2915f6d5537cd22
>
> commit 2777a32588e11514a9c7a24cd2915f6d5537cd22
> Author: Ed Maste 
> AuthorDate: 2024-08-13 19:51:34 +
> Commit: Ed Maste 
> CommitDate: 2024-08-13 20:00:47 +
>
> iommu: disable dma by default

Note that this change is MI, while the change that followed to enable
DMAR by default is x86-specific.



git: ef9fc9609a1f - main - sys: Mark ACL conversion routines as __result_use_check

2024-08-15 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ef9fc9609a1ff53047577aa7cf51246fc04c954b

commit ef9fc9609a1ff53047577aa7cf51246fc04c954b
Author: Pierre Pronchery 
AuthorDate: 2024-08-09 17:37:38 +
Commit: Ed Maste 
CommitDate: 2024-08-15 19:04:29 +

sys: Mark ACL conversion routines as __result_use_check

Both acl_copy_oldacl_into_acl() and acl_copy_acl_into_oldacl() may fail
in some circumstances (e.g., acl.acl_cnt exceeding the capacity of
OLDACL_MAX_ENTRIES).  This change marks both routines with
__result_use_check, enforcing check for errors by the caller.

Suggested by:   markj
Reviewed by:markj, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46254
---
 sys/sys/acl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/sys/acl.h b/sys/sys/acl.h
index c119cfabef32..d4770667fcf5 100644
--- a/sys/sys/acl.h
+++ b/sys/sys/acl.h
@@ -309,9 +309,9 @@ voidacl_nfs4_compute_inherited_acl(
const struct acl *parent_aclp,
struct acl *child_aclp, mode_t mode,
int file_owner_id, int is_directory);
-intacl_copy_oldacl_into_acl(const struct oldacl *source,
+int __result_use_check acl_copy_oldacl_into_acl(const struct oldacl *source,
struct acl *dest);
-intacl_copy_acl_into_oldacl(const struct acl *source,
+int __result_use_check acl_copy_acl_into_oldacl(const struct acl *source,
struct oldacl *dest);
 
 /*



git: f66e71fa78e1 - main - linux.4: clarify path translation

2024-08-19 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f66e71fa78e16164339f7fd4791306fb30165581

commit f66e71fa78e16164339f7fd4791306fb30165581
Author: Ed Maste 
AuthorDate: 2024-08-19 13:43:37 +
Commit: Ed Maste 
CommitDate: 2024-08-19 14:14:28 +

linux.4: clarify path translation

Try to be a little more explicit about the path translation mechanism
accessing /compat/linux/ then falling back to /.

PR: 277804
Reviewed by:fernape
Sponsored by:   The FreeBSD Foundation
---
 share/man/man4/linux.4 | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4
index 212dd2526f3f..b404c9e1c04d 100644
--- a/share/man/man4/linux.4
+++ b/share/man/man4/linux.4
@@ -63,9 +63,11 @@ before
 .Pa / .
 For example, when Linux process attempts to open
 .Pa /etc/passwd ,
-it will really access
+it will first access
 .Pa /compat/linux/etc/passwd ,
-unless the latter does not exist.
+falling back to
+.Pa /etc/passwd
+if the former does not exist.
 This is used to make sure Linux processes load Linux shared libraries
 instead of their similarly-named FreeBSD counterparts, and also
 to provide alternative versions of certain other files and virtual



git: d1daec3d358e - main - linux.4: improve the path translation clarificiation

2024-08-19 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1

commit d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1
Author: Ed Maste 
AuthorDate: 2024-08-19 14:26:26 +
Commit: Ed Maste 
CommitDate: 2024-08-19 14:29:19 +

linux.4: improve the path translation clarificiation

As suggested by mar...@lispworks.com, refer to the compat path
explicitly, and correct an existing grammaro.

PR: 277804
Fixes: f66e71fa78e1 ("linux.4: clarify path translation")
Sponsored by:   The FreeBSD Foundation
---
 share/man/man4/linux.4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4
index b404c9e1c04d..711ac11e8fce 100644
--- a/share/man/man4/linux.4
+++ b/share/man/man4/linux.4
@@ -61,13 +61,13 @@ under
 .Pa /compat/linux )
 before
 .Pa / .
-For example, when Linux process attempts to open
+For example, when a Linux process attempts to open
 .Pa /etc/passwd ,
 it will first access
 .Pa /compat/linux/etc/passwd ,
 falling back to
 .Pa /etc/passwd
-if the former does not exist.
+if the compat path does not exist.
 This is used to make sure Linux processes load Linux shared libraries
 instead of their similarly-named FreeBSD counterparts, and also
 to provide alternative versions of certain other files and virtual



git: 0875f3cd74b2 - main - Revert "x86: Enable Intel DMAR by default"

2024-08-20 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0875f3cd74b2f305e82bff4e640c89f891ca84f8

commit 0875f3cd74b2f305e82bff4e640c89f891ca84f8
Author: Ed Maste 
AuthorDate: 2024-08-20 15:43:11 +
Commit: Ed Maste 
CommitDate: 2024-08-20 15:49:25 +

Revert "x86: Enable Intel DMAR by default"

A number of people have reported panics with it enabled by default,
possibly due to broken ACPI tables, which we do not handle well. D46382
is a potential fix for this issue.

Additionally DMAR is currently not compatible with bhyve passthrough
(see comment #10 in PR280817), with a draft patch to address that in
D25672.

Revert to disabling DMAR by default pending the resolution of those two
issues.

This reverts commit 3192fc30230ae432b80cca783abc2dbea9d3f383.

PR: 280817
Sponsored by:   The FreeBSD Foundation
---
 sys/x86/iommu/intel_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c
index 9401892aa9d6..0b25620114cd 100644
--- a/sys/x86/iommu/intel_drv.c
+++ b/sys/x86/iommu/intel_drv.c
@@ -159,8 +159,7 @@ dmar_count_iter(ACPI_DMAR_HEADER *dmarh, void *arg)
 
 int dmar_rmrr_enable = 1;
 
-static int dmar_enable = 1;
-
+static int dmar_enable = 0;
 static void
 dmar_identify(driver_t *driver, device_t parent)
 {



git: aa0bc761d245 - main - bsd.symver.mk: pass $CFLAGS to $CPP invocation

2024-08-20 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=aa0bc761d245d2ea1e4b7a0343715cc76859d5da

commit aa0bc761d245d2ea1e4b7a0343715cc76859d5da
Author: Ed Maste 
AuthorDate: 2024-05-24 16:15:17 +
Commit: Ed Maste 
CommitDate: 2024-08-21 01:17:52 +

bsd.symver.mk: pass $CFLAGS to $CPP invocation

This allows us to support symbols optionally available based on
configuration, not just on compiler built-in #defines.

Reviewed by:brooks, jrtc27
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45346
---
 share/mk/bsd.symver.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/mk/bsd.symver.mk b/share/mk/bsd.symver.mk
index a1c6e62fba76..d0b63206d8fe 100644
--- a/share/mk/bsd.symver.mk
+++ b/share/mk/bsd.symver.mk
@@ -44,7 +44,7 @@ _vgen=  ${path}/${VERSION_GEN}
 # Run the symbol maps through the C preprocessor before passing
 # them to the symbol version generator.
 ${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS}
-   cat ${SYMBOL_MAPS} | ${CPP} - - \
+   cat ${SYMBOL_MAPS} | ${CPP} ${CFLAGS} - - \
| awk -v vfile=${VERSION_DEF} -f ${_vgen} > ${.TARGET}
 .endif # !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
 .endif  # !target()



git: db87c98168b1 - main - ctl: avoid heap info leak in ctl_request_sense

2024-08-21 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=db87c98168b1605f067d283fa36a710369c3849d

commit db87c98168b1605f067d283fa36a710369c3849d
Author: Ed Maste 
AuthorDate: 2024-08-20 18:12:47 +
Commit: Ed Maste 
CommitDate: 2024-08-21 13:32:41 +

ctl: avoid heap info leak in ctl_request_sense

Previously 3 bytes of data from the heap could be leaked to ctl
consumers.

Reported by:Synacktiv
Reviewed by:asomers, mav
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46091
---
 sys/cam/ctl/ctl.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index fac65e155890..845cffe77a5d 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -9304,14 +9304,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio)
sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
-
-   /*
-* struct scsi_sense_data, which is currently set to 256 bytes, is
-* larger than the largest allowed value for the length field in the
-* REQUEST SENSE CDB, which is 252 bytes as of SPC-4.
-*/
-   ctsio->kern_data_len = cdb->length;
-   ctsio->kern_total_len = cdb->length;
+   ctsio->kern_data_len = ctsio->kern_total_len =
+   MIN(cdb->length, sizeof(*sense_ptr));
 
/*
 * If we don't have a LUN, we don't have any pending sense.



git: 85707cfdaddc - main - bhyve: avoid updating fbaddr when vm_mmap_memseg fails

2024-08-26 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=85707cfdaddc179af8bd2623091eb1b8c58fed4a

commit 85707cfdaddc179af8bd2623091eb1b8c58fed4a
Author: Pierre Pronchery 
AuthorDate: 2024-07-24 20:51:20 +
Commit: Ed Maste 
CommitDate: 2024-08-26 20:23:52 +

bhyve: avoid updating fbaddr when vm_mmap_memseg fails

In the function pci_fbuf_baraddr the field sc->fbaddr was set with a
user-controlled value, even though the call to vm_mmap_memseg failed.

No security risk as currently sc->fbaddr is not really used in the
source code.

Reported by:Synacktiv
Reviewed by:emaste
Sponsored by:   Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D46109
---
 usr.sbin/bhyve/pci_fbuf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c
index 798e9b41f0b0..125428e0b772 100644
--- a/usr.sbin/bhyve/pci_fbuf.c
+++ b/usr.sbin/bhyve/pci_fbuf.c
@@ -231,7 +231,8 @@ pci_fbuf_baraddr(struct pci_devinst *pi, int baridx, int 
enabled,
if (vm_mmap_memseg(pi->pi_vmctx, address, VM_FRAMEBUFFER, 0,
FB_SIZE, prot) != 0)
EPRINTLN("pci_fbuf: mmap_memseg failed");
-   sc->fbaddr = address;
+   else
+   sc->fbaddr = address;
}
 }
 



git: 1a19741860d7 - main - UPDATING: remove 20240813 DMAR entry

2024-09-02 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1a19741860d777bea1b7fe000f87136538020c3b

commit 1a19741860d777bea1b7fe000f87136538020c3b
Author: Ed Maste 
AuthorDate: 2024-08-29 12:43:16 +
Commit: Ed Maste 
CommitDate: 2024-09-02 20:44:55 +

UPDATING: remove 20240813 DMAR entry

The associated commit has been reverted and DMAR is not enabled by
default any longer.

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46474
---
 UPDATING | 5 -
 1 file changed, 5 deletions(-)

diff --git a/UPDATING b/UPDATING
index bbcbdad9bfd7..cffafdb5d247 100644
--- a/UPDATING
+++ b/UPDATING
@@ -27,11 +27,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
-20240813:
-   DMAR is now enabled by default on Intel. If your system crashes in the
-   dmar code on boot, please set 'hw.dmar.enable=0' in /boot/loader.conf
-   and file a bug.
-
 20240729:
The build now defaults to WITHOUT_CLEAN - i.e., no automatic clean
is performed at the beginning of buildworld or buildkernel.  The



git: 83325e7b738c - main - beep: show error upon failure to open sound device

2024-09-03 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=83325e7b738ce87d88553585b135b0e7d15997a6

commit 83325e7b738ce87d88553585b135b0e7d15997a6
Author: Ed Maste 
AuthorDate: 2024-09-03 14:21:46 +
Commit: Ed Maste 
CommitDate: 2024-09-03 14:27:43 +

beep: show error upon failure to open sound device

If beep cannot open /dev/dsp provide more information to aid the user
in diagnosing a problem.

Reviewed by:christos
Sponsored by:   The FreeBSD Foundation
---
 usr.bin/beep/beep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c
index 151236b4825b..2696bacfacf4 100644
--- a/usr.bin/beep/beep.c
+++ b/usr.bin/beep/beep.c
@@ -202,7 +202,7 @@ main(int argc, char **argv)
 
f = open(oss_dev, O_WRONLY);
if (f < 0)
-   errx(1, "Failed to open '%s'", oss_dev);
+   err(1, "Failed to open '%s'", oss_dev);
 
c = 1;  /* mono */
if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0)



git: 1b9cfd6a625d - main - stand: bump arbitrary build date to 2024-01-01

2024-09-03 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1b9cfd6a625dc82611846cb9a53c1886f7af3758

commit 1b9cfd6a625dc82611846cb9a53c1886f7af3758
Author: Ed Maste 
AuthorDate: 2024-08-12 13:11:09 +
Commit: Ed Maste 
CommitDate: 2024-09-03 19:09:28 +

stand: bump arbitrary build date to 2024-01-01

For build reproducibility we set PE headers to an arbitrary timestamp.
Nothing in FreeBSD uses this timestamp, but bump it from 2016 to 2024 so
that the timestamp does not seem "too old" in case some third party tool
is used to inspect EFI boot components.

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46527
---
 stand/efi/Makefile.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc
index 3a13ca24f369..18751f0e4ecc 100644
--- a/stand/efi/Makefile.inc
+++ b/stand/efi/Makefile.inc
@@ -23,8 +23,8 @@ EFI_TARGET=   efi-app-x86_64
 EFI_TARGET=binary
 .endif
 
-# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00
+# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2024 00:00:00
 # for build reproducibility.
-SOURCE_DATE_EPOCH?=1451606400
+SOURCE_DATE_EPOCH?=1704067200
 
 .include "../Makefile.inc"



git: a06fc21e770a - main - bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a06fc21e770a482c8915411ebc98c870e42dd29b

commit a06fc21e770a482c8915411ebc98c870e42dd29b
Author: Pierre Pronchery 
AuthorDate: 2024-09-04 14:38:11 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:11 +

bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler

The function tpm_ppi_mem_handler is vulnerable to buffer over-read and
over-write, the MMIO handler serves the heap allocated structure
tpm_ppi_qemu.
The issue is that the structure size is smaller than 0x1000 and the
handler does not validate the offset and size (sizeof is 0x15A while the
handler allows up to 0x1000 bytes)

Reported by:Synacktiv
Reviewed by:corvink
Security:   FreeBSD-SA-24:10.bhyve
Security:   CVE-2024-41928
Security:   HYP-01
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45980
---
 usr.sbin/bhyve/tpm_ppi_qemu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c
index 239d39184589..01b8493e7273 100644
--- a/usr.sbin/bhyve/tpm_ppi_qemu.c
+++ b/usr.sbin/bhyve/tpm_ppi_qemu.c
@@ -25,7 +25,7 @@
 #include "tpm_ppi.h"
 
 #define TPM_PPI_ADDRESS 0xFED45000
-#define TPM_PPI_SIZE 0x1000
+#define TPM_PPI_SIZE 0x400
 
 #define TPM_PPI_FWCFG_FILE "etc/tpm/config"
 
@@ -100,7 +100,7 @@ tpm_ppi_init(void **sc)
struct tpm_ppi_fwcfg *fwcfg = NULL;
int error;
 
-   ppi = calloc(1, sizeof(*ppi));
+   ppi = calloc(1, TPM_PPI_SIZE);
if (ppi == NULL) {
warnx("%s: failed to allocate acpi region for ppi", __func__);
error = ENOMEM;



git: 5c9308a41308 - main - bhyve: fix off by one error in pci_xhci

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5c9308a4130858598c76f3ae6e3e3dfb41ccfe68

commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68
Author: Pierre Pronchery 
AuthorDate: 2024-09-04 14:38:11 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:11 +

bhyve: fix off by one error in pci_xhci

The function pci_xhci_find_stream validates that the streamid is valid
but the bound check accepts up to ep_MaxPStreams included.

The bug results in an out-of-bounds write on the heap with controlled
data.

Reported by:Synacktiv
Reviewed by:jhb
Security:   FreeBSD-SA-24:12.bhyve
Security:   CVE-2024-32668
Security:   HYP-04
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45994
---
 usr.sbin/bhyve/pci_xhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c
index 8654dd9e7a14..b72c839c807b 100644
--- a/usr.sbin/bhyve/pci_xhci.c
+++ b/usr.sbin/bhyve/pci_xhci.c
@@ -660,7 +660,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid)
devep = &dev->eps[epid];
pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0);
if (pstreams > 0) {
-   DPRINTF(("init_ep %d with pstreams %d", epid, pstreams));
+   DPRINTF(("init_ep %d with pstreams %u", epid, pstreams));
assert(devep->ep_sctx_trbs == NULL);
 
devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 &
@@ -1202,7 +1202,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct 
xhci_endp_ctx *ep,
}
 
/* only support primary stream */
-   if (streamid > devep->ep_MaxPStreams)
+   if (streamid >= devep->ep_MaxPStreams)
return (XHCI_TRB_ERROR_STREAM_TYPE);
 
sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) +



git: 670b582db6cb - main - ctl: fix Use-After-Free in ctl_write_buffer

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=670b582db6cb827a8760df942ed8af0020a0b4d0

commit 670b582db6cb827a8760df942ed8af0020a0b4d0
Author: Alan Somers 
AuthorDate: 2024-09-04 14:38:11 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:11 +

ctl: fix Use-After-Free in ctl_write_buffer

The virtio_scsi device allows a guest VM to directly send SCSI commands
to the kernel driver exposed on /dev/cam/ctl. This setup makes the
vulnerability directly accessible from VMs through the pci_virtio_scsi
bhyve device.

The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing
the kern_data_ptr to be freed when the command finishes processing.
However, the buffer is still stored in lun->write_buffer, leading to a
Use-After-Free vulnerability.

Since the buffer needs to persist indefinitely, so it can be accessed by
READ BUFFER, do not set CTL_FLAG_ALLOCATED.

Reported by:Synacktiv
Reviewed by:Pierre Pronchery 
Reviewed by:jhb
Security:   FreeBSD-SA-24:11.ctl
Security:   CVE-2024-45063
Security:   HYP-03
Sponsored by:   Axcient
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46424
---
 sys/cam/ctl/ctl.c | 19 +++
 sys/cam/ctl/ctl_private.h |  8 
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 82420396aca1..2124903f4ac1 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -5625,21 +5625,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio)
return (CTL_RETVAL_COMPLETE);
}
 
+   if (lun->write_buffer == NULL) {
+   lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE,
+   M_CTL, M_WAITOK);
+   }
+
/*
-* If we've got a kernel request that hasn't been malloced yet,
-* malloc it and tell the caller the data buffer is here.
+* If this kernel request hasn't started yet, initialize the data
+* buffer to the correct region of the LUN's write buffer.  Note that
+* this doesn't set CTL_FLAG_ALLOCATED since this points into a
+* persistent buffer belonging to the LUN rather than a buffer
+* dedicated to this request.
 */
-   if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
-   if (lun->write_buffer == NULL) {
-   lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE,
-   M_CTL, M_WAITOK);
-   }
+   if (ctsio->kern_data_ptr == NULL) {
ctsio->kern_data_ptr = lun->write_buffer + buffer_offset;
ctsio->kern_data_len = len;
ctsio->kern_total_len = len;
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
-   ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
ctl_datamove((union ctl_io *)ctsio);
 
diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h
index cd7e499c60a6..821aa0aa681b 100644
--- a/sys/cam/ctl/ctl_private.h
+++ b/sys/cam/ctl/ctl_private.h
@@ -355,6 +355,14 @@ struct ctl_lun {
uint8_t pr_res_type;
int prevent_count;
uint32_t*prevent;
+
+   /*
+* The READ_BUFFER and WRITE_BUFFER commands permit access to a logical
+* data buffer associated with a LUN.  Accesses to the data buffer do
+* not affect data stored on the storage medium.  To support this,
+* allocate a buffer on first use that persists until the LUN is
+* destroyed.
+*/
uint8_t *write_buffer;
struct ctl_devid*lun_devid;
TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists;



git: ea44766b78d6 - main - ctl: fix memory disclosure in read/write buffer commands

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ea44766b78d639d3a89afd5302ec6feffaade813

commit ea44766b78d639d3a89afd5302ec6feffaade813
Author: Pierre Pronchery 
AuthorDate: 2024-09-04 14:38:11 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:11 +

ctl: fix memory disclosure in read/write buffer commands

The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to
a kernel memory disclosure caused by an uninitialized kernel allocation.
If one of these functions is called for the first time for a given LUN, a
kernel allocation is performed without the M_ZERO flag. Then a call to
ctl_read_buffer() returns the content of this allocation, which may
contain kernel data.

Reported by:Synacktiv
Reviewed by:asomers
Reviewed by:jhb
Security:   FreeBSD-SA-24:11.ctl
Security:   CVE-2024-8178
Security:   HYP-05
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45952
---
 sys/cam/ctl/ctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 2124903f4ac1..e58299951540 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -5586,7 +5586,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio)
} else {
if (lun->write_buffer == NULL) {
lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE,
-   M_CTL, M_WAITOK);
+   M_CTL, M_WAITOK | M_ZERO);
}
ctsio->kern_data_ptr = lun->write_buffer + buffer_offset;
}
@@ -5627,7 +5627,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio)
 
if (lun->write_buffer == NULL) {
lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE,
-   M_CTL, M_WAITOK);
+   M_CTL, M_WAITOK | M_ZERO);
}
 
/*



git: af438acbfde3 - main - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=af438acbfde3d25dbdc82b2b3d72380f0191e9d9

commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9
Author: Pierre Pronchery 
AuthorDate: 2024-09-04 14:38:12 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:12 +

ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes

This vulnerability is directly accessible to a guest VM through the
pci_virtio_scsi bhyve device.

In the function ctl_report_supported_opcodes() accessible from the VM,
the option RSO_OPTIONS_OC_ASA does not check the requested
service_action value before accessing &ctl_cmd_table[].

Reported by:Synacktiv
Reviewed by:asomers
Security:   FreeBSD-SA-24:11.ctl
Security:   CVE-2024-42416
Security:   HYP-06
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46027
---
 sys/cam/ctl/ctl.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index e58299951540..53858edc2a1d 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -7470,20 +7470,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio)
case RSO_OPTIONS_OC_SA:
if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 ||
service_action >= 32) {
-   ctl_set_invalid_field(/*ctsio*/ ctsio,
- /*sks_valid*/ 1,
- /*command*/ 1,
- /*field*/ 2,
- /*bit_valid*/ 1,
- /*bit*/ 2);
-   ctl_done((union ctl_io *)ctsio);
-   return (CTL_RETVAL_COMPLETE);
+   goto invalid;
}
-   /* FALLTHROUGH */
+   total_len = sizeof(struct scsi_report_supported_opcodes_one) + 
32;
+   break;
case RSO_OPTIONS_OC_ASA:
+   if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 &&
+   service_action >= 32) {
+   goto invalid;
+   }
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 
32;
break;
default:
+invalid:
ctl_set_invalid_field(/*ctsio*/ ctsio,
  /*sks_valid*/ 1,
  /*command*/ 1,



git: 60d717baf214 - main - ctl: add some ATF tests for READ BUFFER

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=60d717baf2144cf344ec9b47d715ce837b5d46d4

commit 60d717baf2144cf344ec9b47d715ce837b5d46d4
Author: Alan Somers 
AuthorDate: 2024-09-04 14:38:12 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:12 +

ctl: add some ATF tests for READ BUFFER

Reviewed by:Pierre Pronchery 
Reviewed by:jhb
MFC after:  2 weeks
Sponsored by:   Axcient
---
 etc/mtree/BSD.tests.dist |   4 +
 tests/sys/Makefile   |   1 +
 tests/sys/cam/Makefile   |   7 ++
 tests/sys/cam/ctl/Makefile   |  10 ++
 tests/sys/cam/ctl/read_buffer.sh | 226 +++
 5 files changed, 248 insertions(+)

diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index ba03881bcc27..ac53de071c11 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -791,6 +791,10 @@
 ..
 compat32
 ..
+cam
+ctl
+..
+..
 devrandom
 ..
 dtrace
diff --git a/tests/sys/Makefile b/tests/sys/Makefile
index e64268e5a397..535e627d22cb 100644
--- a/tests/sys/Makefile
+++ b/tests/sys/Makefile
@@ -6,6 +6,7 @@ TESTS_SUBDIRS+= acl
 TESTS_SUBDIRS+=aio
 TESTS_SUBDIRS+=${_audit}
 TESTS_SUBDIRS+=auditpipe
+TESTS_SUBDIRS+=cam
 TESTS_SUBDIRS+=capsicum
 TESTS_SUBDIRS+=${_cddl}
 # XXX: Currently broken in CI
diff --git a/tests/sys/cam/Makefile b/tests/sys/cam/Makefile
new file mode 100644
index ..4cc36604280a
--- /dev/null
+++ b/tests/sys/cam/Makefile
@@ -0,0 +1,7 @@
+.include 
+
+TESTSDIR=  ${TESTSBASE}/sys/cam
+
+TESTS_SUBDIRS+=ctl
+
+.include 
diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile
new file mode 100644
index ..0e6f39a1a56f
--- /dev/null
+++ b/tests/sys/cam/ctl/Makefile
@@ -0,0 +1,10 @@
+PACKAGE=   tests
+
+TESTSDIR=  ${TESTSBASE}/sys/cam/ctl
+
+ATF_TESTS_SH+= read_buffer
+
+# Must be exclusive because it disables/enables camsim
+TEST_METADATA.read_buffer+=is_exclusive="true"
+
+.include 
diff --git a/tests/sys/cam/ctl/read_buffer.sh b/tests/sys/cam/ctl/read_buffer.sh
new file mode 100644
index ..4a84eb6b9725
--- /dev/null
+++ b/tests/sys/cam/ctl/read_buffer.sh
@@ -0,0 +1,226 @@
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2024 Axcient
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Not tested
+# * modes other than "Data" and "Desc".  We don't support those.
+# * Buffer ID other than 0.  We don't support those.
+# * The Mode Specific field.  We don't support it.
+
+load_modules() {
+   if ! kldstat -q -m ctl; then
+   kldload ctl || atf_skip "could not load ctl kernel mod"
+   fi
+   if ! ctladm port -o on -p 0; then
+   atf_skip "could not enable the camsim frontend"
+   fi
+}
+
+find_da_device() {
+   SERIAL=$1
+
+   # Rescan camsim
+   # XXX  camsim doesn't update when creating a new device.  Worse, a
+   # rescan won't look for new devices.  So we must disable/re-enable it.
+   # Worse still, enabling it isn't synchronous, so we need a retry loop
+   # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000
+   retries=5
+   ctladm port -o off -p 0 >/dev/null
+   ctladm port -o on -p 0 >/dev/null
+   while true; do
+
+   # Find the corresponding da device
+   da=`geom disk list | awk -v serial=$SERIAL ' /Geom name:/ { 
de

git: dd83da532c36 - main - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=dd83da532c36830a0c0aac624903849262ec6f68

commit dd83da532c36830a0c0aac624903849262ec6f68
Author: Olivier Certner 
AuthorDate: 2024-09-04 14:38:12 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:12 +

umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags

...into the only USHMF_LINKED, as they are always set or unset together.

This is both to stop giving the impression that they can be set/unset
independently, which they can't with the current code, and to make it
clearer that an upcoming reference counting fix is correct.

Reviewed by:kib
Approved by:emaste (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46126
---
 sys/kern/kern_umtx.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index e6d5e2de5e88..8d70438ea195 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -4293,8 +4293,7 @@ __umtx_op_sem2_wake(struct thread *td, struct 
_umtx_op_args *uap,
 #defineUSHM_OBJ_UMTX(o)
\
 ((struct umtx_shm_obj_list *)(&(o)->umtx_data))
 
-#defineUSHMF_REG_LINKED0x0001
-#defineUSHMF_OBJ_LINKED0x0002
+#defineUSHMF_LINKED0x0001
 struct umtx_shm_reg {
TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link;
LIST_ENTRY(umtx_shm_reg) ushm_obj_link;
@@ -4354,7 +4353,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key)
KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM"));
KASSERT(reg->ushm_refcnt > 0,
("reg %p refcnt 0 onlist", reg));
-   KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0,
+   KASSERT((reg->ushm_flags & USHMF_LINKED) != 0,
("reg %p not linked", reg));
reg->ushm_refcnt++;
return (reg);
@@ -4394,14 +4393,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, 
bool force)
reg->ushm_refcnt--;
res = reg->ushm_refcnt == 0;
if (res || force) {
-   if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) {
+   if ((reg->ushm_flags & USHMF_LINKED) != 0) {
TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash],
reg, ushm_reg_link);
-   reg->ushm_flags &= ~USHMF_REG_LINKED;
-   }
-   if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) {
LIST_REMOVE(reg, ushm_obj_link);
-   reg->ushm_flags &= ~USHMF_OBJ_LINKED;
+   reg->ushm_flags &= ~USHMF_LINKED;
}
}
return (res);
@@ -4494,7 +4490,7 @@ umtx_shm_create_reg(struct thread *td, const struct 
umtx_key *key,
TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link);
LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg,
ushm_obj_link);
-   reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED;
+   reg->ushm_flags = USHMF_LINKED;
mtx_unlock(&umtx_shm_lock);
*res = reg;
return (0);



git: 62f40433ab47 - main - umtx: shm: Fix use-after-free due to multiple drops of the registry reference

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=62f40433ab47ad4a9694a22a0313d57661502ca1

commit 62f40433ab47ad4a9694a22a0313d57661502ca1
Author: Olivier Certner 
AuthorDate: 2024-09-04 14:38:12 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:12 +

umtx: shm: Fix use-after-free due to multiple drops of the registry 
reference

umtx_shm_unref_reg_locked() would unconditionally drop the "registry"
reference, tied to USHMF_LINKED.

This is not a problem for caller umtx_shm_object_terminated(), which
operates under the 'umtx_shm_lock' lock end-to-end, but it is for
indirect caller umtx_shm(), which drops the lock between
umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that
deregisters the umtx shared region (from 'umtx_shm_registry';
umtx_shm_find_reg() only finds registered shared mutexes).

Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM
and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg()
but before umtx_shm_unref_reg(true), would then decrease twice the
reference count for the single reference standing for the shared mutex's
registration.

Reported by:Synacktiv
Reviewed by:kib
Approved by:emaste (mentor)
Security:   FreeBSD-SA-24:14.umtx
Security:   CVE-2024-43102
Security:   CAP-01
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46126
---
 sys/kern/kern_umtx.c | 51 +--
 1 file changed, 33 insertions(+), 18 deletions(-)

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 8d70438ea195..37c44f969a27 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -4384,39 +4384,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg)
 }
 
 static bool
-umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force)
+umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref)
 {
-   bool res;
-
mtx_assert(&umtx_shm_lock, MA_OWNED);
KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg));
-   reg->ushm_refcnt--;
-   res = reg->ushm_refcnt == 0;
-   if (res || force) {
-   if ((reg->ushm_flags & USHMF_LINKED) != 0) {
-   TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash],
-   reg, ushm_reg_link);
-   LIST_REMOVE(reg, ushm_obj_link);
-   reg->ushm_flags &= ~USHMF_LINKED;
-   }
+
+   if (linked_ref) {
+   if ((reg->ushm_flags & USHMF_LINKED) == 0)
+   /*
+* The reference tied to USHMF_LINKED has already been
+* released concurrently.
+*/
+   return (false);
+
+   TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg,
+   ushm_reg_link);
+   LIST_REMOVE(reg, ushm_obj_link);
+   reg->ushm_flags &= ~USHMF_LINKED;
}
-   return (res);
+
+   reg->ushm_refcnt--;
+   return (reg->ushm_refcnt == 0);
 }
 
 static void
-umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force)
+umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref)
 {
vm_object_t object;
bool dofree;
 
-   if (force) {
+   if (linked_ref) {
+   /*
+* Note: This may be executed multiple times on the same
+* shared-memory VM object in presence of concurrent callers
+* because 'umtx_shm_lock' is not held all along in umtx_shm()
+* and here.
+*/
object = reg->ushm_obj->shm_object;
VM_OBJECT_WLOCK(object);
vm_object_set_flag(object, OBJ_UMTXDEAD);
VM_OBJECT_WUNLOCK(object);
}
mtx_lock(&umtx_shm_lock);
-   dofree = umtx_shm_unref_reg_locked(reg, force);
+   dofree = umtx_shm_unref_reg_locked(reg, linked_ref);
mtx_unlock(&umtx_shm_lock);
if (dofree)
umtx_shm_free_reg(reg);
@@ -4469,7 +4479,6 @@ umtx_shm_create_reg(struct thread *td, const struct 
umtx_key *key,
if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP)))
return (ENOMEM);
reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO);
-   reg->ushm_refcnt = 1;
bcopy(key, ®->ushm_key, sizeof(*key));
reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false);
reg->ushm_cred = crhold(cred);
@@ -4486,11 +4495,17 @@ umtx_shm_create_reg(struct thread *td, const struct 
umtx_key *key,
*res = reg1;
r

git: c3e6dfe55c0e - main - umtx: shm: Prevent reference counting overflow

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c3e6dfe55c0e81d0717b0458bc95128384c3ebe8

commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8
Author: Olivier Certner 
AuthorDate: 2024-09-04 14:38:12 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:12 +

umtx: shm: Prevent reference counting overflow

This hardens against provoked use-after-free occurences should there be
reference counting leaks in the future (which is currently not the
case).

At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW
when it cannot grant an additional reference to the registry object, and
so will umtx_shm_find_reg().  umtx_shm_create_reg() will fail if calling
umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the
passed key already exists, but we can't acquire another reference on
it), avoiding the creation of a duplicate registry entry for a given key
(this wouldn't pose problem for the rest of the code in its current
form, but is expressly avoided for intelligibility and hardening
purposes).

Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system
call, can only return EOVERFLOW on such a bug manifesting, we don't
document that return value.

Reviewed by:kib, emaste
Approved by:emaste (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46126
---
 sys/kern/kern_umtx.c | 76 +---
 1 file changed, 54 insertions(+), 22 deletions(-)

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 37c44f969a27..a6c160ab6283 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -4334,8 +4334,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int 
pending __unused)
 static struct task umtx_shm_reg_delfree_task =
 TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL);
 
-static struct umtx_shm_reg *
-umtx_shm_find_reg_locked(const struct umtx_key *key)
+/*
+ * Returns 0 if a SHM with the passed key is found in the registry, in which
+ * case it is returned through 'oreg'.  Otherwise, returns an error among ESRCH
+ * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have
+ * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference
+ * count would overflow, so can't return it), in which case '*oreg' is left
+ * unchanged.
+ */
+static int
+umtx_shm_find_reg_locked(const struct umtx_key *key,
+struct umtx_shm_reg **const oreg)
 {
struct umtx_shm_reg *reg;
struct umtx_shm_reg_head *reg_head;
@@ -4355,22 +4364,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key)
("reg %p refcnt 0 onlist", reg));
KASSERT((reg->ushm_flags & USHMF_LINKED) != 0,
("reg %p not linked", reg));
+   /*
+* Don't let overflow happen, just deny a new reference
+* (this is additional protection against some reference
+* count leak, which is known not to be the case at the
+* time of this writing).
+*/
+   if (__predict_false(reg->ushm_refcnt == UINT_MAX))
+   return (EOVERFLOW);
reg->ushm_refcnt++;
-   return (reg);
+   *oreg = reg;
+   return (0);
}
}
-   return (NULL);
+   return (ESRCH);
 }
 
-static struct umtx_shm_reg *
-umtx_shm_find_reg(const struct umtx_key *key)
+/*
+ * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'.
+ */
+static int
+umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg)
 {
-   struct umtx_shm_reg *reg;
+   int error;
 
mtx_lock(&umtx_shm_lock);
-   reg = umtx_shm_find_reg_locked(key);
+   error = umtx_shm_find_reg_locked(key, oreg);
mtx_unlock(&umtx_shm_lock);
-   return (reg);
+   return (error);
 }
 
 static void
@@ -4470,11 +4491,18 @@ umtx_shm_create_reg(struct thread *td, const struct 
umtx_key *key,
struct ucred *cred;
int error;
 
-   reg = umtx_shm_find_reg(key);
-   if (reg != NULL) {
-   *res = reg;
-   return (0);
+   error = umtx_shm_find_reg(key, res);
+   if (error != ESRCH) {
+   /*
+* Either no error occured, and '*res' was filled, or EOVERFLOW
+* was returned, indicating a reference count limit, and we
+* won't create a duplicate registration.  In both cases, we are
+* done.
+*/
+   return (error);
}
+   /* No ent

git: c75a18905e30 - main - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0'

2024-09-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c75a18905e308f69b01f19c3d7d613883a008e79

commit c75a18905e308f69b01f19c3d7d613883a008e79
Author: Olivier Certner 
AuthorDate: 2024-09-04 14:38:12 +
Commit: Ed Maste 
CommitDate: 2024-09-04 14:38:12 +

umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0'

'ushm_refcnt' is unsigned.  Don't leave the impression it isn't.

No functional change (intended).

Reviewed by:kib
Approved by:emaste (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46126
---
 sys/kern/kern_umtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index a6c160ab6283..705571930d7b 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -4360,7 +4360,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key,
reg->ushm_key.info.shared.offset ==
key->info.shared.offset) {
KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM"));
-   KASSERT(reg->ushm_refcnt > 0,
+   KASSERT(reg->ushm_refcnt != 0,
("reg %p refcnt 0 onlist", reg));
KASSERT((reg->ushm_flags & USHMF_LINKED) != 0,
("reg %p not linked", reg));
@@ -4408,7 +4408,7 @@ static bool
 umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref)
 {
mtx_assert(&umtx_shm_lock, MA_OWNED);
-   KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg));
+   KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg));
 
if (linked_ref) {
if ((reg->ushm_flags & USHMF_LINKED) == 0)



git: e8b7c78c1b38 - main - Cirrus-CI: switch to llvm18 by default

2024-04-07 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e8b7c78c1b38d0486ff12993c0529a201030bd07

commit e8b7c78c1b38d0486ff12993c0529a201030bd07
Author: Ed Maste 
AuthorDate: 2024-04-06 21:53:17 +
Commit: Ed Maste 
CommitDate: 2024-04-07 21:23:25 +

Cirrus-CI: switch to llvm18 by default

As of commit 439352ac8257 Clang/LLVM 18 is the default in-tree compiler.
Follow suit in with the external toolchain package used by Cirrus-CI.

Sponsored by:   The FreeBSD Foundation
---
 .cirrus.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 90d031a919f2..13719a3e2058 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,15 +23,15 @@ task:
   TOOLCHAIN: llvm16
   TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
   - name: amd64-llvm17 World and kernel build and boot smoke test
-only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' || $CIRRUS_BRANCH 
=~ 'pull/.*'
+only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
+trigger_type: manual
 env:
   TARGET: amd64
   TARGET_ARCH: amd64
   TOOLCHAIN: llvm17
   TOOLCHAIN_PKG: ${TOOLCHAIN}-lite
   - name: amd64-llvm18 World and kernel build and boot smoke test
-only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src'
-trigger_type: manual
+only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' || $CIRRUS_BRANCH 
=~ 'pull/.*'
 env:
   TARGET: amd64
   TARGET_ARCH: amd64



Re: git: 22ca6db50f4e - main - config.mk: Add MK_VIMAGE knob

2024-04-13 Thread Ed Maste
On Tue, 9 Apr 2024 at 13:08, Stephen J. Kiernan  wrote:
>
> The branch main has been updated by stevek:
>
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=22ca6db50f4e6bd75a141f57cf953d8de6531a06
>
> commit 22ca6db50f4e6bd75a141f57cf953d8de6531a06
> Author: Stephen J. Kiernan 
> AuthorDate: 2024-04-09 17:04:24 +
> Commit: Stephen J. Kiernan 
> CommitDate: 2024-04-09 17:05:56 +
>
> config.mk: Add MK_VIMAGE knob

This breaks the makeman CI test, erroring with
no description found for WITHOUT_VIMAGE, skipping
no description found for WITHOUT_VIMAGE_SUPPORT, skipping



git: 40b57cb616ca - main - tzsetup: be explicit about *timezone* abbreviation

2024-04-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=40b57cb616ca19aee3de104acd058da289c936bb

commit 40b57cb616ca19aee3de104acd058da289c936bb
Author: Ed Maste 
AuthorDate: 2024-03-25 20:25:23 +
Commit: Ed Maste 
CommitDate: 2024-04-16 13:55:46 +

tzsetup: be explicit about *timezone* abbreviation

During the install process tzsetup asks a question like

Does the abbreviation `EDT' look reasonable?

The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not.  A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.

Reviewed by:bapt, brooks, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500
---
 usr.sbin/tzsetup/tzsetup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 9610023ec3ea..fee5762b6fa6 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -709,7 +709,7 @@ confirm_zone(const char *filename)
tm = localtime(&t);
 
snprintf(prompt, sizeof(prompt),
-   "Does the abbreviation `%s' look reasonable?", tm->tm_zone);
+   "Does the timezone abbreviation `%s' look reasonable?", 
tm->tm_zone);
conf.title = "Confirmation";
rv = (bsddialog_yesno(&conf, prompt, 5, 72) == BSDDIALOG_YES);
return (rv);



git: 73cce7d8886b - main - mergemaster: postpone removal to FreeBSD 15

2024-04-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=73cce7d8886bc59284c757decb49deba046e73fc

commit 73cce7d8886bc59284c757decb49deba046e73fc
Author: Ed Maste 
AuthorDate: 2024-04-16 14:19:14 +
Commit: Ed Maste 
CommitDate: 2024-04-16 14:19:14 +

mergemaster: postpone removal to FreeBSD 15

Mergemaster has been deprecated for quite some time, but was not
removed prior to FreeBSD 14.0.  Update the deprecation notice in the man
page to reflect this.

PR: 274967
Reported by:naddy
Sponsored by:   The FreeBSD Foundation
---
 usr.sbin/mergemaster/mergemaster.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/mergemaster/mergemaster.8 
b/usr.sbin/mergemaster/mergemaster.8
index 695f1bba3474..20d746de347c 100644
--- a/usr.sbin/mergemaster/mergemaster.8
+++ b/usr.sbin/mergemaster/mergemaster.8
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 2, 2023
+.Dd April 16, 2024
 .Dt MERGEMASTER 8
 .Os
 .Sh NAME
@@ -45,7 +45,7 @@
 The
 .Nm
 utility is deprecated and may not be available in
-.Fx 14.0
+.Fx 15.0
 or later.
 Users are advised to use
 .Xr etcupdate 8



git: d51c59002367 - main - mfc-candidates: fix output order with incorrect commit dates

2024-04-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d51c590023675ca20a7da74d75a3b5a5dcfdfddc

commit d51c590023675ca20a7da74d75a3b5a5dcfdfddc
Author: Ed Maste 
AuthorDate: 2024-04-16 15:41:05 +
Commit: Ed Maste 
CommitDate: 2024-04-16 18:20:40 +

mfc-candidates: fix output order with incorrect commit dates

Previously we obtained the list of MFC candidate hashes (i.e., those
commits only in the mfc-from branch), removed the already-merged
commits based on "cherry picked from" commit message entries, and then
printed the list sorted by commit time.  This is usually the correct
order, but it is not when commits have non-monotonically-increasing
commit times.  This is unfortunately the case for a number of commits in
our tree.  This made it difficult to merge some groups of dependent
commits in the correct order.

Instead, leave the from-list in git rev-parse order, and move the
matching logic to a new lua script.

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44808
---
 tools/tools/git/candidatematch.lua | 66 ++
 tools/tools/git/mfc-candidates.sh  | 19 ---
 2 files changed, 72 insertions(+), 13 deletions(-)

diff --git a/tools/tools/git/candidatematch.lua 
b/tools/tools/git/candidatematch.lua
new file mode 100755
index ..98c247fca339
--- /dev/null
+++ b/tools/tools/git/candidatematch.lua
@@ -0,0 +1,66 @@
+#!/usr/libexec/flua
+
+-- MFC candidate script utility - $0 from-file to-file
+--
+-- from-file specifies hashes that exist only in the "MFC from" branch and
+-- to-file specifies the original hashes of commits already merged to the
+-- "MFC to" branch.
+
+-- SPDX-License-Identifier: BSD-2-Clause
+-- Copyright 2024 The FreeBSD Foundation
+
+-- Read a file and return its content as a table
+local function read_file(filename)
+   local file = assert(io.open(filename, "r"))
+   local content = {}
+   for line in file:lines() do
+   table.insert(content, line)
+   end
+   file:close()
+   return content
+end
+
+-- Remove hashes from 'set1' list that are present in 'set2' list
+local function set_difference(set1, set2)
+   local set2_values = {}
+   for _, value in ipairs(set2) do
+   set2_values[value] = true
+   end
+
+   local result = {}
+   for _, value in ipairs(set1) do
+   if not set2_values[value] then
+   table.insert(result, value)
+   end
+   end
+   return result
+end
+
+-- Main function
+local function main()
+   local from_file = arg[1]
+   local to_file = arg[2]
+   local exclude_file = arg[3]
+
+   if not from_file or not to_file then
+   print("Usage: flua $0 from-file to-file")
+   return
+   end
+
+   local from_hashes = read_file(from_file)
+   local to_hashes = read_file(to_file)
+
+   local result_hashes = set_difference(from_hashes, to_hashes)
+
+   if exclude_file then
+   exclude_hashes = read_file(exclude_file)
+   result_hashes = set_difference(result_hashes, exclude_hashes)
+   end
+
+   -- Print the result
+   for _, hash in ipairs(result_hashes) do
+   print(hash)
+   end
+end
+
+main()
diff --git a/tools/tools/git/mfc-candidates.sh 
b/tools/tools/git/mfc-candidates.sh
index d7fd4b5ded13..0787e1278991 100644
--- a/tools/tools/git/mfc-candidates.sh
+++ b/tools/tools/git/mfc-candidates.sh
@@ -124,16 +124,14 @@ fi
 # Commits in from_branch after branch point
 commits_from()
 {
-   git rev-list --first-parent $authorarg $to_branch..$from_branch "$@" |\
-   sort
+   git rev-list --first-parent --reverse $authorarg 
$to_branch..$from_branch "$@"
 }
 
 # "cherry picked from" hashes from commits in to_branch after branch point
 commits_to()
 {
git log $from_branch..$to_branch --grep 'cherry picked from' "$@" |\
-   sed -E -n 's/^[[:space:]]*\(cherry picked from commit 
([0-9a-f]+)\)[[:space:]]*$/\1/p' |\
-   sort
+   sed -E -n 's/^[[:space:]]*\(cherry picked from commit 
([0-9a-f]+)\)[[:space:]]*$/\1/p'
 }
 
 # Turn a list of short hashes (and optional descriptions) into a list of full
@@ -164,16 +162,11 @@ fi
 commits_from "$@" > $from_list
 commits_to "$@" > $to_list
 
-comm -23 $from_list $to_list > $candidate_list
+/usr/libexec/flua $(dirname $0)/candidatematch.lua \
+$from_list $to_list $exclude_list > $candidate_list
 
-if [ -n "$exclude_file" ]; then
-   mv $candidate_list $candidate_list.bak
-   comm -23 $candidate_list.bak $exclude_list > $candidate_list
-fi
-
-# Sort by 

git: 2e850b832f5d - main - acpi_battery: avoid divide-by-zero when no devices have capacity info

2024-04-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2e850b832f5d2adb9b230d191277d67c00caaab9

commit 2e850b832f5d2adb9b230d191277d67c00caaab9
Author: Josef 'Jeff' Sipek 
AuthorDate: 2024-04-16 23:01:28 +
Commit:     Ed Maste 
CommitDate: 2024-04-16 23:39:45 +

acpi_battery: avoid divide-by-zero when no devices have capacity info

On laptops with builtin batteries, disconnecting the battery may show up
as a battery without any capacity information. (The theory is that one
is disconnecting the cells but the electronics identifying the battery
are still connected.) As a result, the loop over all batteries in
acpi_battery_get_battinfo results in total_lfcap == 0.

So, just check that total_lfcap is non-zero to avoid a division by zero
(triggerable by sysctl hw.acpi.battery).

Reported by:Stefano Marinelli
Tested by:  Stefano Marinelli
Reviewed by:emaste
Differential Revision: https://reviews.freebsd.org/D44818
---
 sys/dev/acpica/acpi_battery.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c
index 7455c6afc6a6..cfd8261d5eab 100644
--- a/sys/dev/acpica/acpi_battery.c
+++ b/sys/dev/acpica/acpi_battery.c
@@ -266,7 +266,14 @@ acpi_battery_get_battinfo(device_t dev, struct 
acpi_battinfo *battinfo)
  */
 if (valid_units > 0) {
if (dev == NULL) {
-   battinfo->cap = (total_cap * 100) / total_lfcap;
+   /*
+* Avoid division by zero if none of the batteries had valid
+* capacity info.
+*/
+   if (total_lfcap > 0)
+   battinfo->cap = (total_cap * 100) / total_lfcap;
+   else
+   battinfo->cap = 0;
battinfo->min = total_min;
battinfo->state = batt_stat;
battinfo->rate = valid_rate;



git: ede456359e55 - main - CONTRIBUTING: mention sys/crypto as another "contrib" directory

2024-04-18 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ede456359e55958ab17ac665e5867674a0c0e81b

commit ede456359e55958ab17ac665e5867674a0c0e81b
Author: Ed Maste 
AuthorDate: 2024-04-18 18:44:30 +
Commit: Ed Maste 
CommitDate: 2024-04-18 18:57:19 +

CONTRIBUTING: mention sys/crypto as another "contrib" directory

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44857
---
 CONTRIBUTING.md | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c3028b7a764f..7dcdc1b49685 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -145,11 +145,11 @@ class work. It also helps us keep track.
 
 ## FreeBSD's Upstreams
 
-Anything that's in the directory `contrib`, `crypto`, `sys/contrib` or
-`sys/cddl` likely has an upstream we pull from. Please do a git log --merges in
-any subdirectory of these you are submitting patches for to find out the last
-time we merged from upstream. If it is in the last 5 years, upstream is 
"active"
-and you should submit your patches there and let the last few people to commit
-to this file (especially merge commits) know. If it's been more than 5 years,
-upstream is likely inactive so please submit the patch. We can sort out if it
-should go into FreeBSD or upstream.
+Anything that's in the directory `contrib`, `crypto`, `sys/contrib`,
+`sys/crypto/` or `sys/cddl` likely has an upstream we pull from. Please do a
+`git log --merges` in any subdirectory of these you are submitting patches for
+to find out the last time we merged from upstream. If it is in the last 5 
years,
+upstream is "active" and you should submit your patches there and let the last
+few people to commit to this file (especially merge commits) know. If it's been
+more than 5 years, upstream is likely inactive so please submit the patch. We
+can sort out if it should go into FreeBSD or upstream.



git: 67783db661f8 - main - CONTRIBUTING: request only one submission type per change

2024-04-18 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=67783db661f88cf5259c19bb59ddee9e076007ac

commit 67783db661f88cf5259c19bb59ddee9e076007ac
Author: Ed Maste 
AuthorDate: 2024-04-18 18:38:54 +
Commit: Ed Maste 
CommitDate: 2024-04-18 19:13:15 +

CONTRIBUTING: request only one submission type per change

We have some instances of contributors opening a GitHub pull request and
a Phabricator review for the same change, which divides or duplicates
review effort.

Reviewed by:markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44856
---
 CONTRIBUTING.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7dcdc1b49685..c26b1d335c5f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -18,6 +18,10 @@ The preferred method depends on a few factors including the 
size or scope of
 the change.  GitHub pull requests are preferred for relatively straightforward
 changes where the contributor already has a GitHub account.
 
+A change should be submitted by only one method.  For example, please do not
+open a GitHub pull request and create a Phabricator review for the same change
+(unless explicitly requested to do so by a FreeBSD committer).
+
 ## GitHub Pull Requests
 
 Presently, GitHub 'freebsd-src' repository is one of the publish-only services



git: 793745fad866 - main - mfc-candidates: move pretty printing into lua

2024-04-21 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=793745fad866f65863ab3b16a17bdf18dc779efd

commit 793745fad866f65863ab3b16a17bdf18dc779efd
Author: Ed Maste 
AuthorDate: 2024-04-16 16:49:05 +
Commit: Ed Maste 
CommitDate: 2024-04-21 14:10:57 +

mfc-candidates: move pretty printing into lua

d51c59002367 moved the MFC hash matching logic into a lua utility
script but left the output formatting in the shell script. Simplify this
slightly by just printing the formatted output from lua.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44836
---
 tools/tools/git/candidatematch.lua | 10 +-
 tools/tools/git/mfc-candidates.sh  |  7 +--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/tools/git/candidatematch.lua 
b/tools/tools/git/candidatematch.lua
index 98c247fca339..481c1f38fea1 100755
--- a/tools/tools/git/candidatematch.lua
+++ b/tools/tools/git/candidatematch.lua
@@ -36,6 +36,14 @@ local function set_difference(set1, set2)
return result
 end
 
+-- Execute a command and print to stdout
+local function exec_command(command)
+   local handle = io.popen(command)
+   local output = handle:read("a")
+   handle:close()
+   io.write(output)
+end
+
 -- Main function
 local function main()
local from_file = arg[1]
@@ -59,7 +67,7 @@ local function main()
 
-- Print the result
for _, hash in ipairs(result_hashes) do
-   print(hash)
+   exec_command("git show --pretty='%h %s' --no-patch " .. hash)
end
 end
 
diff --git a/tools/tools/git/mfc-candidates.sh 
b/tools/tools/git/mfc-candidates.sh
index 0787e1278991..cf71c314cb95 100644
--- a/tools/tools/git/mfc-candidates.sh
+++ b/tools/tools/git/mfc-candidates.sh
@@ -152,7 +152,6 @@ canonicalize_hashes()
 workdir=$(mktemp -d /tmp/find-mfc.XX)
 from_list=$workdir/commits-from
 to_list=$workdir/commits-to
-candidate_list=$workdir/candidates
 
 if [ -n "$exclude_file" ]; then
exclude_list=$workdir/commits-exclude
@@ -163,10 +162,6 @@ commits_from "$@" > $from_list
 commits_to "$@" > $to_list
 
 /usr/libexec/flua $(dirname $0)/candidatematch.lua \
-$from_list $to_list $exclude_list > $candidate_list
-
-while read hash; do
-   git show --pretty='%h %s' --no-patch $hash
-done < $candidate_list
+$from_list $to_list $exclude_list
 
 rm -rf "$workdir"



git: 10e0c34bf842 - main - Enable L1SS handling on RPI4 pcib

2024-04-21 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=10e0c34bf842885b4bd78adbbdbd7fb00f133cb5

commit 10e0c34bf842885b4bd78adbbdbd7fb00f133cb5
Author: HP van Braam 
AuthorDate: 2024-04-16 23:01:20 +
Commit: Ed Maste 
CommitDate: 2024-04-21 22:34:05 +

Enable L1SS handling on RPI4 pcib

Thanks to @kevans91 for pointing me in the right direction. FreeBSD had
the same bug as Linux (see
https://bugzilla.kernel.org/show_bug.cgi?id=217276) where the ultimate
solution was to honor the brcm,enable-l1ss FDT property.

In current versions of the dtb files this property has been added by
default.

Without this on many, many pcie addin cards the pcib will Serror when
trying to assert the clreq# pin on the pcie bus. Many cards do not have
these hooked up.

PR: 260131, 277638, 277605
Reviewed-by:emaste
Signed-off-by: HP van Braam 
Pull-request: https://github.com/freebsd/freebsd-src/pull/1179
---
 sys/arm/broadcom/bcm2835/bcm2838_pci.c | 22 ++
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/sys/arm/broadcom/bcm2835/bcm2838_pci.c 
b/sys/arm/broadcom/bcm2835/bcm2838_pci.c
index 921d675aae4d..f5304525a6fb 100644
--- a/sys/arm/broadcom/bcm2835/bcm2838_pci.c
+++ b/sys/arm/broadcom/bcm2835/bcm2838_pci.c
@@ -60,7 +60,7 @@
 #define REG_BRIDGE_CTRL0x9210
 #define BRIDGE_DISABLE_FLAG0x1
 #define BRIDGE_RESET_FLAG  0x2
-#define REG_BRIDGE_SERDES_MODE 0x4204
+#define REG_PCIE_HARD_DEBUG0x4204
 #define REG_DMA_CONFIG 0x4008
 #define REG_DMA_WINDOW_LOW 0x4034
 #define REG_DMA_WINDOW_HIGH0x4038
@@ -86,6 +86,9 @@
 #define REG_EP_CONFIG_CHOICE   0x9000
 #define REG_EP_CONFIG_DATA 0x8000
 
+#define L1SS_ENABLE 0x0020
+#define CLKREQ_ENABLE   0x2
+
 /*
  * The system memory controller can address up to 16 GiB of physical memory
  * (although at time of writing the largest memory size available for purchase
@@ -190,7 +193,7 @@ bcm_pcib_reset_controller(struct bcm_pcib_softc *sc)
 
DELAY(100);
 
-   bcm_pcib_set_reg(sc, REG_BRIDGE_SERDES_MODE, 0);
+   bcm_pcib_set_reg(sc, REG_PCIE_HARD_DEBUG, 0);
 
DELAY(100);
 }
@@ -613,7 +616,7 @@ bcm_pcib_attach(device_t dev)
struct bcm_pcib_softc *sc;
pci_addr_t phys_base, pci_base;
bus_size_t size;
-   uint32_t hardware_rev, bridge_state, link_state;
+   uint32_t hardware_rev, bridge_state, link_state, tmp;
int error, tries;
 
sc = device_get_softc(dev);
@@ -719,7 +722,18 @@ bcm_pcib_attach(device_t dev)
bcm_pcib_set_reg(sc, PCI_ID_VAL3,
PCIC_BRIDGE << CLASS_SHIFT | PCIS_BRIDGE_PCI << SUBCLASS_SHIFT);
 
-   bcm_pcib_set_reg(sc, REG_BRIDGE_SERDES_MODE, 0x2);
+   tmp = bcm_pcib_read_reg(sc, REG_PCIE_HARD_DEBUG);
+   tmp |= CLKREQ_ENABLE;
+
+   if (ofw_bus_has_prop(dev, "brcm,enable-l1ss")) {
+   if (bootverbose)
+   device_printf(dev, "note: enabling L1SS due to OF "
+   "property brcm,enable-l1ss\n");
+
+   tmp |= L1SS_ENABLE;
+   }
+
+   bcm_pcib_set_reg(sc, REG_PCIE_HARD_DEBUG, tmp);
DELAY(100);
 
bcm_pcib_relocate_bridge_window(dev);



git: 76a8625bc71d - main - mfc-candidates: use stable/14 as default MFC-to branch

2024-04-22 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=76a8625bc71da3fa63eef5abb4782553d2588f5c

commit 76a8625bc71da3fa63eef5abb4782553d2588f5c
Author: Ed Maste 
AuthorDate: 2024-04-22 17:54:52 +
Commit: Ed Maste 
CommitDate: 2024-04-22 17:57:17 +

mfc-candidates: use stable/14 as default MFC-to branch

This tool is typically invoked from within a working tree containing the
desired MFC target branch, which is detected automatically.  It also has
a default for when it is invoked from elsewhere.  Switch the default to
the most recent branch, stable/14.

Sponsored by:   The FreeBSD Foundation
---
 tools/tools/git/mfc-candidates.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/git/mfc-candidates.sh 
b/tools/tools/git/mfc-candidates.sh
index cf71c314cb95..c232a1ad3345 100644
--- a/tools/tools/git/mfc-candidates.sh
+++ b/tools/tools/git/mfc-candidates.sh
@@ -41,7 +41,7 @@ if [ "${repo}" = "ports.git" ]; then
qtr=$(((month-1) / 3 + 1))
to_branch="freebsd/${year}Q${qtr}"
 elif [ "${repo}" = "src.git" ]; then
-   to_branch=freebsd/stable/13
+   to_branch=freebsd/stable/14
# If pwd is a stable or release branch tree, default to it.
cur_branch=$(git symbolic-ref --short HEAD 2>/dev/null)
case $cur_branch in



git: 91d35fb663e0 - main - Remove WITHOUT_CAPSICUM build support

2024-04-23 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=91d35fb663e0276abc4963ae559e4759ea929842

commit 91d35fb663e0276abc4963ae559e4759ea929842
Author: Ed Maste 
AuthorDate: 2024-04-23 11:20:59 +
Commit: Ed Maste 
CommitDate: 2024-04-23 12:26:28 +

Remove WITHOUT_CAPSICUM build support

Capsicum is non-optional as of c24c117b9644 ("Remove
WITHOUT_{CAPSICUM,CASPER} options").

`#ifndef WITHOUT_CAPSICUM` is left in the source for the benefit of
downstream consumers, but is never defined in FreeBSD.

Reviewed by:oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42077
---
 share/mk/src.opts.mk | 5 -
 tools/build/options/WITHOUT_CAPSICUM | 1 -
 usr.bin/xz/Makefile  | 4 
 3 files changed, 10 deletions(-)

diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 2ea0cbf24268..3d3a1299fac9 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -218,7 +218,6 @@ __DEFAULT_NO_OPTIONS = \
 ZONEINFO_LEAPSECONDS_SUPPORT \
 
 __REQUIRED_OPTIONS = \
-CAPSICUM \
 CASPER
 
 # LEFT/RIGHT. Left options which default to "yes" unless their corresponding
@@ -383,10 +382,6 @@ BROKEN_OPTIONS+= TESTS
 # Force some options off if their dependencies are off.
 # Order is somewhat important.
 #
-.if ${MK_CAPSICUM} == "no"
-MK_CASPER:=no
-.endif
-
 .if ${MK_SOURCELESS} == "no"
 MK_SOURCELESS_HOST:=   no
 MK_SOURCELESS_UCODE:= no
diff --git a/tools/build/options/WITHOUT_CAPSICUM 
b/tools/build/options/WITHOUT_CAPSICUM
deleted file mode 100644
index 19d821f6c981..
--- a/tools/build/options/WITHOUT_CAPSICUM
+++ /dev/null
@@ -1 +0,0 @@
-This option has no effect.
diff --git a/usr.bin/xz/Makefile b/usr.bin/xz/Makefile
index e3cbafb0ebc3..5b61202a981e 100644
--- a/usr.bin/xz/Makefile
+++ b/usr.bin/xz/Makefile
@@ -43,10 +43,6 @@ CFLAGS+= -DHAVE_CONFIG_H \
-I${LZMALIBDIR} \
-I${XZDIR}/common
 
-.if ${MK_CAPSICUM} == "no"
-CFLAGS+=   -DWITHOUT_CAPSICUM
-.endif
-
 LIBADD=lzma
 
 .include 



git: 4329887454b0 - main - src.conf: regen after 91d35fb663e0, WITHOUT_CAPSICUM removal

2024-04-23 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4329887454b008e42e809dcd275a69f596b9dc83

commit 4329887454b008e42e809dcd275a69f596b9dc83
Author: Ed Maste 
AuthorDate: 2024-04-23 12:48:18 +
Commit: Ed Maste 
CommitDate: 2024-04-23 12:48:18 +

src.conf: regen after 91d35fb663e0, WITHOUT_CAPSICUM removal

Sponsored by:   The FreeBSD Foundation
---
 share/man/man5/src.conf.5 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 3f35e4146b52..7effd3f08ccc 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,5 +1,5 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
-.Dd April 18, 2024
+.Dd April 23, 2024
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -264,8 +264,6 @@ Build some programs without optional bzip2 support.
 .It Va WITHOUT_CALENDAR
 Do not build
 .Xr calendar 1 .
-.It Va WITHOUT_CAPSICUM
-This option has no effect.
 .It Va WITHOUT_CAROOT
 Do not add the trusted certificates from the Mozilla NSS bundle to
 base.



git: fcdf9a19893b - main - Support ARP for 802 networks

2024-04-23 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fcdf9a19893b9b5beb7a21407de507f0ae4c500b

commit fcdf9a19893b9b5beb7a21407de507f0ae4c500b
Author: Denny Page 
AuthorDate: 2024-04-13 17:16:08 +
Commit: Ed Maste 
CommitDate: 2024-04-23 16:30:53 +

Support ARP for 802 networks

This is used by 802.3 Ethernet.  (Also be used by 802.4 Token Bus and
802.5 Token Ring, but we don't support those.)

This was accidentally removed along with FDDI support in commit
0437c8e3b198, presumably because comments implied it was used only by
FDDI or Token Ring.

Fixes: 0437c8e3b198 ("Remove support for FDDI networks.")
Reviewed-by: emaste
Signed-off-by: Denny Page 
Pull-request: https://github.com/freebsd/freebsd-src/pull/1166
---
 sys/net/if_arp.h   | 2 +-
 sys/netinet/if_ether.c | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h
index 0c3ee5d7acc6..6a944276674c 100644
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -45,7 +45,7 @@
 struct arphdr {
u_short ar_hrd; /* format of hardware address */
 #define ARPHRD_ETHER   1   /* ethernet hardware format */
-#define ARPHRD_IEEE802 6   /* token-ring hardware format */
+#define ARPHRD_IEEE802 6   /* 802.2 networks (ethernet/tb/tr) */
 #define ARPHRD_FRELAY  15  /* frame relay hardware format */
 #define ARPHRD_IEEE139424  /* firewire hardware format */
 #define ARPHRD_INFINIBAND 32   /* infiniband hardware format */
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 4b3d2a91d996..543e6a3922fb 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -682,6 +682,10 @@ arpintr(struct mbuf *m)
hlen = ETHER_ADDR_LEN; /* RFC 826 */
layer = "ethernet";
break;
+   case ARPHRD_IEEE802:
+   hlen = ETHER_ADDR_LEN;
+   layer = "ieee802";
+   break;
case ARPHRD_INFINIBAND:
hlen = 20;  /* RFC 4391, INFINIBAND_ALEN */
layer = "infiniband";



git: b07689d1f2a2 - main - beinstall: retire mergemaster support

2024-05-01 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b07689d1f2a268317bead0d785407b2f7dd7de78

commit b07689d1f2a268317bead0d785407b2f7dd7de78
Author: Ed Maste 
AuthorDate: 2023-09-09 16:17:11 +
Commit: Ed Maste 
CommitDate: 2024-05-01 23:02:00 +

beinstall: retire mergemaster support

Mergemaster has been deprecated for some time, and will be retired.

Reviewed by:kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41799
---
 share/man/man8/beinstall.8 | 15 +++
 tools/build/beinstall.sh   | 15 +--
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/share/man/man8/beinstall.8 b/share/man/man8/beinstall.8
index e403f25d2f35..114483ba752a 100644
--- a/share/man/man8/beinstall.8
+++ b/share/man/man8/beinstall.8
@@ -41,10 +41,8 @@ source tree.
 also automatically performs
 .Pa /etc
 updates
-(using either
-.Xr etcupdate 8
-or
-.Xr mergemaster 8 )
+(using
+.Xr etcupdate 8 )
 and
 package updates using
 .Xr pkg-upgrade 8
@@ -88,18 +86,12 @@ from ports (sysutils/beadm).
 .It Ev CONFIG_UPDATER Pq default: Dq Li "etcupdate"
 Config updater:
 .Xr etcupdate 8
-and
-.Xr mergemaster 8
-are supported.
+is supported.
 Set to an empty string to skip.
 .It Ev ETCUPDATE_FLAGS Pq default: Dq Li "-F"
 Flags for
 .Xr etcupdate 8
 if used.
-.It Ev MERGEMASTER_FLAGS Pq default: Dq Li "-iFU"
-Flags for
-.Xr mergemaster 8
-if used.
 .It Ev NO_PKG_UPGRADE Pq default: Dq Li ""
 If not empty,
 .Dq Li pkg upgrade
@@ -117,7 +109,6 @@ lives in the src tree.
 .Xr development 7 ,
 .Xr bectl 8 ,
 .Xr etcupdate 8 ,
-.Xr mergemaster 8 ,
 .Xr pkg 8
 .Sh HISTORY
 .Nm
diff --git a/tools/build/beinstall.sh b/tools/build/beinstall.sh
index 766a3a03739f..7f7481b671f5 100755
--- a/tools/build/beinstall.sh
+++ b/tools/build/beinstall.sh
@@ -45,13 +45,10 @@
 BE_UTILITY="${BE_UTILITY:-"bectl"}"
 # If not empty, 'pkg upgrade' will be skipped.
 NO_PKG_UPGRADE="${NO_PKG_UPGRADE:-""}"
-# Config updater - 'etcupdate' and 'mergemaster' are supported.  Set to an
-# empty string to skip.
+# Config updater - 'etcupdate' is supported.  Set to an empty string to skip.
 CONFIG_UPDATER="${CONFIG_UPDATER:-"etcupdate"}"
 # Flags for etcupdate if used.
 ETCUPDATE_FLAGS="${ETCUPDATE_FLAGS:-"-F"}"
-# Flags for mergemaster if used.
-MERGEMASTER_FLAGS="${MERGEMASTER_FLAGS:-"-iFU"}"
 
 
 
@@ -122,14 +119,6 @@ create_be_dirs() {
return 0
 }
 
-update_mergemaster_pre() {
-   ${MERGEMASTER_CMD} -p -m ${srcdir} -D ${BE_MNTPT} -t ${BE_MM_ROOT} 
${MERGEMASTER_FLAGS}
-}
-
-update_mergemaster() {
-   ${MERGEMASTER_CMD} -m ${srcdir} -D ${BE_MNTPT} -t ${BE_MM_ROOT} 
${MERGEMASTER_FLAGS}
-}
-
 update_etcupdate_pre() {
${ETCUPDATE_CMD} -p -s ${srcdir} -D ${BE_MNTPT} ${ETCUPDATE_FLAGS} || 
return $?
${ETCUPDATE_CMD} resolve -D ${BE_MNTPT} || return $?
@@ -176,7 +165,6 @@ objdir=$(make -V .OBJDIR 2>/dev/null)
 
 ## Constants
 ETCUPDATE_CMD="${srcdir}/usr.sbin/etcupdate/etcupdate.sh"
-MERGEMASTER_CMD="${srcdir}/usr.sbin/mergemaster/mergemaster.sh"
 
 # May be a worktree, in which case .git is a file, not a directory.
 if [ -e .git ] ; then
@@ -206,7 +194,6 @@ BE_TMP=$(mktemp -d /tmp/beinstall.XX)
 [ $? -ne 0 -o ! -d ${BE_TMP} ] && errx "Unable to create mountpoint"
 [ -z "$NO_CLEANUP_BE" ] && cleanup_commands="rmdir_be ${cleanup_commands}"
 BE_MNTPT=${BE_TMP}/mnt
-BE_MM_ROOT=${BE_TMP}/mergemaster # mergemaster will create
 mkdir -p ${BE_MNTPT}
 
 ${BE_UTILITY} create ${BENAME} >/dev/null || errx "Unable to create BE 
${BENAME}"



git: abd872540f24 - main - libcbor: vendor update to 0.11.0

2024-05-03 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=abd872540f24cfc7dbd1ea29b6918c7082a22108

commit abd872540f24cfc7dbd1ea29b6918c7082a22108
Merge: b27eb9ce96b8 5f50d6b344f0
Author: Ed Maste 
AuthorDate: 2024-05-03 23:33:50 +
Commit: Ed Maste 
CommitDate: 2024-05-03 23:33:50 +

libcbor: vendor update to 0.11.0

Sponsored by:   The FreeBSD Foundation

 contrib/libcbor/.circleci/config.yml   |  30 ++--
 contrib/libcbor/.cirrus.yml|  26 +++
 contrib/libcbor/.readthedocs.yaml  |  21 +++
 contrib/libcbor/CHANGELOG.md   |  15 +-
 contrib/libcbor/CMakeLists.txt |  18 +-
 contrib/libcbor/CONTRIBUTING.md|   2 +-
 contrib/libcbor/Doxyfile   |   2 +-
 contrib/libcbor/README.md  |   7 +-
 contrib/libcbor/appveyor.yml   |  14 --
 contrib/libcbor/doc/source/api/item_types.rst  |   2 +-
 contrib/libcbor/doc/source/conf.py |  18 +-
 contrib/libcbor/doc/source/development.rst |   6 +-
 contrib/libcbor/doc/source/index.rst   |   8 +-
 contrib/libcbor/doc/source/internal.rst|   4 +-
 contrib/libcbor/doc/source/requirements.txt|  52 +++---
 ...fc_conformance.rst => standard_conformance.rst} |   6 +-
 contrib/libcbor/examples/CMakeLists.txt|   4 +
 .../bazel/third_party/libcbor/cbor/configuration.h |   4 +-
 contrib/libcbor/examples/cbor2cjson.c  | 123 +
 contrib/libcbor/examples/cjson2cbor.c  |   4 +-
 contrib/libcbor/examples/data/all_types.cbor   | Bin 0 -> 354 bytes
 contrib/libcbor/examples/readfile.c|   2 +-
 contrib/libcbor/oss-fuzz/build.sh  |   2 +-
 contrib/libcbor/src/CMakeLists.txt |  21 ++-
 contrib/libcbor/src/cbor.c |  82 +
 contrib/libcbor/src/cbor/common.h  |   2 +-
 .../libcbor/src/cbor/internal/builder_callbacks.c  |  27 +--
 contrib/libcbor/src/cbor/internal/loaders.c|   2 +-
 contrib/libcbor/src/cbor/internal/memory_utils.h   |   2 +-
 contrib/libcbor/src/cbor/internal/unicode.c|   6 +-
 contrib/libcbor/src/cbor/internal/unicode.h|   6 +-
 contrib/libcbor/src/cbor/maps.c|   1 +
 contrib/libcbor/src/cbor/streaming.c   |  43 ++---
 contrib/libcbor/src/cbor/strings.c |  10 ++
 contrib/libcbor/src/cbor/strings.h |  19 +-
 contrib/libcbor/src/libcborConfig.cmake.in |   8 +
 contrib/libcbor/test/callbacks_test.c  |  25 +++
 contrib/libcbor/test/cbor_serialize_test.c |  32 
 contrib/libcbor/test/cbor_stream_decode_test.c |   8 +-
 contrib/libcbor/test/float_ctrl_test.c |   6 +-
 contrib/libcbor/test/pretty_printer_test.c | 197 +++--
 contrib/libcbor/test/string_test.c |  67 +++
 contrib/libcbor/test/tag_test.c|  23 +++
 contrib/libcbor/test/test_allocator.c  |   2 +-
 44 files changed, 746 insertions(+), 213 deletions(-)

diff --cc contrib/libcbor/.cirrus.yml
index ,..948ae23b4a98
new file mode 100644
--- /dev/null
+++ b/contrib/libcbor/.cirrus.yml
@@@ -1,0 -1,0 +1,26 @@@
++freebsd_task:
++install_script:
++- ASSUME_ALWAYS_YES=yes pkg bootstrap -f && pkg install -y cmocka cmake 
ninja
++build_script:
++- mkdir build
++- cd build
++- cmake -GNinja -DWITH_TESTS=ON
++  -DCBOR_CUSTOM_ALLOC=ON
++  -DCMAKE_BUILD_TYPE=Debug
++  -DSANITIZE=OFF
++  ..
++- ninja -j $(sysctl -n hw.ncpu)
++test_script:
++- cd build
++- ctest -VV
++matrix:
++# From gcloud compute images list --project freebsd-org-cloud-dev 
--no-standard-images
++- name: freebsd-13-2
++  freebsd_instance:
++image_family: freebsd-13-2
++- name: freebsd-14-0
++  freebsd_instance:
++image_family: freebsd-14-0
++- name: freebsd-15-0-snap
++  freebsd_instance:
++image_family: freebsd-15-0-snap
diff --cc contrib/libcbor/.readthedocs.yaml
index ,f2514ffae113..f2514ffae113
mode 00,100644..100644
--- a/contrib/libcbor/.readthedocs.yaml
+++ b/contrib/libcbor/.readthedocs.yaml
diff --cc contrib/libcbor/CONTRIBUTING.md
index cc834d21a46b,..9bd42a06b6dc
mode 100644,00..100644
--- a/contrib/libcbor/CONTRIBUTING.md
+++ b/contrib/libcbor/CONTRIBUTING.md
@@@ -1,35 -1,0 +1,35 @@@
 +# Contributing to libcbor
 +
 +libcbor is maintained by [@PJK](https://github.com/PJK) in his spare time on 
a best-effort basis.
 +
- Community contributions are welcome as long as they align with the [project 
priorities](https://github.com/PJK/libcbor#main-features) and 
[goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and 
follow 

git: 60a517b66a69 - main - libfido2: update to 1.14.0

2024-05-04 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=60a517b66a69b8c011b04063ef63a938738719bd

commit 60a517b66a69b8c011b04063ef63a938738719bd
Merge: cb808de400c7 e85dbcdab023
Author: Ed Maste 
AuthorDate: 2024-05-04 16:51:08 +
Commit: Ed Maste 
CommitDate: 2024-05-04 16:51:08 +

libfido2: update to 1.14.0

Sponsored by:   The FreeBSD Foundation

 contrib/libfido2/.actions/build-bsd|  97 +++
 contrib/libfido2/.actions/build-linux-clang|  21 +++
 contrib/libfido2/.actions/build-linux-gcc  |  23 +++
 .../.actions/build-linux-i686-w64-mingw32-gcc  |  58 +++
 .../libfido2/.actions/build-linux-openssl3-clang   |  33 
 contrib/libfido2/.actions/build-linux-openssl3-gcc |  28 
 .../build-linux-openssl3-i686-w64-mingw32-gcc  |  59 +++
 contrib/libfido2/.actions/build-osx-clang  |  19 +++
 contrib/libfido2/.actions/fuzz-linux   |  93 +++
 contrib/libfido2/.actions/llvm.gpg |  52 ++
 contrib/libfido2/.actions/setup_clang  |  17 ++
 contrib/libfido2/.gitattributes|   1 +
 .../libfido2/.github/ISSUE_TEMPLATE/bug_report.md  |  80 ++
 contrib/libfido2/.github/ISSUE_TEMPLATE/config.yml |   8 +
 .../libfido2/.github/workflows/alpine_builds.yml   |  39 +
 contrib/libfido2/.github/workflows/bsd_builds.yml  |  32 
 contrib/libfido2/.github/workflows/cifuzz_oss.yml  |  46 ++
 .../libfido2/.github/workflows/codeql-analysis.yml |  42 +
 .../libfido2/.github/workflows/cygwin_builds.yml   |  30 
 .../libfido2/.github/workflows/linux_builds.yml|  57 +++
 contrib/libfido2/.github/workflows/linux_fuzz.yml  |  41 +
 .../libfido2/.github/workflows/macos_builds.yml|  32 
 contrib/libfido2/.github/workflows/openssl3.yml|  51 ++
 .../libfido2/.github/workflows/windows_builds.yml  |  32 
 contrib/libfido2/.gitignore|   9 ++
 contrib/libfido2/CMakeLists.txt|   4 +-
 contrib/libfido2/NEWS  |  10 ++
 contrib/libfido2/README.adoc   |   2 +-
 contrib/libfido2/examples/README.adoc  |   5 +-
 contrib/libfido2/examples/cred.c   |  30 +++-
 contrib/libfido2/fuzz/Dockerfile   |   2 +-
 contrib/libfido2/fuzz/Makefile |   2 +-
 contrib/libfido2/fuzz/export.gnu   |   2 +
 contrib/libfido2/fuzz/functions.txt|  63 
 contrib/libfido2/fuzz/fuzz_assert.c|   4 +-
 contrib/libfido2/fuzz/report.tgz   | Bin 357005 -> 361946 bytes
 contrib/libfido2/fuzz/summary.txt  |  18 +--
 contrib/libfido2/man/CMakeLists.txt|   3 +
 contrib/libfido2/man/fido2-assert.1|  13 +-
 contrib/libfido2/man/fido2-cred.1  |  13 +-
 contrib/libfido2/man/fido_assert_new.3 |  14 +-
 contrib/libfido2/man/fido_assert_set_authdata.3|  59 ++-
 contrib/libfido2/regress/assert.c  |  50 +-
 contrib/libfido2/regress/cred.c|  18 ++-
 contrib/libfido2/regress/eddsa.c   |   2 +-
 contrib/libfido2/src/assert.c  |  68 +++-
 contrib/libfido2/src/export.gnu|   3 +
 contrib/libfido2/src/export.llvm   |   3 +
 contrib/libfido2/src/export.msvc   |   3 +
 contrib/libfido2/src/fido.h|   4 +
 contrib/libfido2/src/fido/types.h  |   2 +
 contrib/libfido2/src/webauthn.h| 177 +++--
 contrib/libfido2/src/winhello.c|  63 +++-
 contrib/libfido2/tools/assert_get.c|  19 ++-
 contrib/libfido2/tools/cred_make.c |  20 ++-
 contrib/libfido2/tools/extern.h|  19 +--
 contrib/libfido2/tools/fido2-assert.c  |   4 +-
 contrib/libfido2/tools/fido2-cred.c|   4 +-
 contrib/libfido2/udev/70-u2f.rules |  32 +++-
 contrib/libfido2/udev/fidodevs |  16 +-
 contrib/libfido2/windows/build.ps1 |   1 +
 contrib/libfido2/windows/const.ps1 |  16 +-
 lib/libfido2/Makefile  |   2 +-
 63 files changed, 1646 insertions(+), 124 deletions(-)

diff --cc contrib/libfido2/.actions/build-bsd
index ,66fc4e3ba281..66fc4e3ba281
mode 00,100755..100755
--- a/contrib/libfido2/.actions/build-bsd
+++ b/contrib/libfido2/.actions/build-bsd
diff --cc contrib/libfido2/.actions/build-linux-clang
index ,ba20f1279ec9..ba20f1279ec9
mode 00,100755..100755
--- a/contrib/libfido2/.actions/build-linux-clang
+++ b/contrib/libfido2/.actions/build-linux-clang
diff --cc contrib/libfido2/.actions/build-linux-gcc
index ,cd42b5eb7bed..cd42b5eb7bed
m

git: 2d29d2ecebf8 - main - clock_gettime.2: fix markup

2024-05-06 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2d29d2ecebf8ea19221995b3ea2e3a7ac700bf81

commit 2d29d2ecebf8ea19221995b3ea2e3a7ac700bf81
Author: Ed Maste 
AuthorDate: 2024-05-06 19:59:42 +
Commit: Ed Maste 
CommitDate: 2024-05-06 21:52:22 +

clock_gettime.2: fix markup

The CLOCK_* constants are "defined variable or preprocessor constants"
and so use .Dv.

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45106
---
 lib/libsys/clock_gettime.2 | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2
index a0f1274f0eff..82f6615e8b93 100644
--- a/lib/libsys/clock_gettime.2
+++ b/lib/libsys/clock_gettime.2
@@ -94,35 +94,35 @@ Returns the execution time of the calling thread.
 .El
 .Pp
 The clock IDs
-.Fa CLOCK_REALTIME ,
-.Fa CLOCK_MONOTONIC ,
+.Dv CLOCK_REALTIME ,
+.Dv CLOCK_MONOTONIC ,
 and
-.Fa CLOCK_UPTIME
+.Dv CLOCK_UPTIME
 perform a full time counter query.
 The clock IDs with the _FAST suffix, i.e.,
-.Fa CLOCK_REALTIME_FAST ,
-.Fa CLOCK_MONOTONIC_FAST ,
+.Dv CLOCK_REALTIME_FAST ,
+.Dv CLOCK_MONOTONIC_FAST ,
 and
-.Fa CLOCK_UPTIME_FAST ,
+.Dv CLOCK_UPTIME_FAST ,
 do not perform
 a full time counter query, so their accuracy is one timer tick.
 Similarly,
-.Fa CLOCK_REALTIME_PRECISE ,
-.Fa CLOCK_MONOTONIC_PRECISE ,
+.Dv CLOCK_REALTIME_PRECISE ,
+.Dv CLOCK_MONOTONIC_PRECISE ,
 and
-.Fa CLOCK_UPTIME_PRECISE
+.Dv CLOCK_UPTIME_PRECISE
 are used to get the most exact value as possible, at the expense of
 execution time.
 The clock IDs
-.Fa CLOCK_REALTIME_COARSE
+.Dv CLOCK_REALTIME_COARSE
 and
-.Fa CLOCK_MONOTONIC_COARSE
+.Dv CLOCK_MONOTONIC_COARSE
 are aliases of corresponding IDs with _FAST suffix for compatibility with other
 systems.
 Finally,
-.Fa CLOCK_BOOTTIME
+.Dv CLOCK_BOOTTIME
 is an alias for
-.Fa CLOCK_UPTIME
+.Dv CLOCK_UPTIME
 for compatibility with other systems and is unrelated to the
 .Fa kern.boottime
 .Xr sysctl 8 .
@@ -140,7 +140,7 @@ struct timespec {
 .Ed
 .Pp
 Only the super-user may set the time of day, using only
-.Fa CLOCK_REALTIME .
+.Dv CLOCK_REALTIME .
 If the system
 .Xr securelevel 7
 is greater than 1 (see
@@ -188,14 +188,14 @@ and
 system calls conform to
 .St -p1003.1b-93 .
 The clock IDs
-.Fa CLOCK_REALTIME_FAST ,
-.Fa CLOCK_REALTIME_PRECISE ,
-.Fa CLOCK_MONOTONIC_FAST ,
-.Fa CLOCK_MONOTONIC_PRECISE ,
-.Fa CLOCK_UPTIME ,
-.Fa CLOCK_UPTIME_FAST ,
-.Fa CLOCK_UPTIME_PRECISE ,
-.Fa CLOCK_SECOND
+.Dv CLOCK_REALTIME_FAST ,
+.Dv CLOCK_REALTIME_PRECISE ,
+.Dv CLOCK_MONOTONIC_FAST ,
+.Dv CLOCK_MONOTONIC_PRECISE ,
+.Dv CLOCK_UPTIME ,
+.Dv CLOCK_UPTIME_FAST ,
+.Dv CLOCK_UPTIME_PRECISE ,
+.Dv CLOCK_SECOND
 are
 .Fx
 extensions to the POSIX interface.



git: d84fd89ecd40 - main - dlopen(3): mention fdlopen for capsicum(4)

2024-05-07 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d84fd89ecd404ffbf629381d2dde14fd79b39402

commit d84fd89ecd404ffbf629381d2dde14fd79b39402
Author: Ed Maste 
AuthorDate: 2024-05-07 01:45:50 +
Commit: Ed Maste 
CommitDate: 2024-05-07 13:09:59 +

dlopen(3): mention fdlopen for capsicum(4)

Capsicum-sandboxed applications generally cannot use dlopen, as absolute
and cwd-relative paths cannot be accessed.  Mention that fdlopen is
useful for sandboxed applications.

PR: 277169
Reviewed by:markj, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45108
---
 lib/libc/gen/dlopen.3 | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3
index 9871029a84b5..340545114114 100644
--- a/lib/libc/gen/dlopen.3
+++ b/lib/libc/gen/dlopen.3
@@ -29,7 +29,7 @@
 .\"
 .\" Copyright (c) 1991 Sun Microsystems, Inc.
 .\"
-.Dd May 14, 2020
+.Dd May 7, 2024
 .Dt DLOPEN 3
 .Os
 .Sh NAME
@@ -199,6 +199,10 @@ The
 function can be used by the code that needs to perform
 additional checks on the loaded objects, to prevent races with
 symlinking or renames.
+Applications sandboxed using
+.Xr capsicum 4
+can also make beneficial use of
+.Fn fdlopen .
 .Pp
 The
 .Fn dlsym



git: 7ef6ce51742d - main - smsc(4): update to mention Microchip

2024-05-08 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7ef6ce51742d44a7375ccbaeda4cc64e034c4816

commit 7ef6ce51742d44a7375ccbaeda4cc64e034c4816
Author: Ed Maste 
AuthorDate: 2024-05-07 15:33:45 +
Commit: Ed Maste 
CommitDate: 2024-05-08 18:18:46 +

smsc(4): update to mention Microchip

Microchip Technology acquired SMSC in 2012, and all current products
and datasheets refer to the devices supported by this driver as
Microchip parts.  Mention SMSC in a parenthetical comment to explain
the driver's name.

Reviewed by:imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45115
---
 share/man/man4/smsc.4 | 12 ++--
 sys/dev/usb/net/if_smsc.c |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/share/man/man4/smsc.4 b/share/man/man4/smsc.4
index 56c1556e5f83..61b12c7d230c 100644
--- a/share/man/man4/smsc.4
+++ b/share/man/man4/smsc.4
@@ -25,12 +25,12 @@
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 24, 2015
+.Dd May 7, 2024
 .Dt SMSC 4
 .Os
 .Sh NAME
 .Nm smsc
-.Nd "USB SMSC LAN9xxx Fast Ethernet driver"
+.Nd "USB Microchip LAN9xxx Fast Ethernet driver"
 .Sh SYNOPSIS
 To load the driver as a module at boot time, place the
 following line in
@@ -53,7 +53,7 @@ following lines in your kernel configuration file:
 The
 .Nm
 device driver provides support for USB Fast Ethernet adapters based
-on the SMSC LAN9xxx chipsets.
+on the Microchip (formerly SMSC) LAN9xxx chipsets.
 .Pp
 For more information on configuring this device, see
 .Xr ifconfig 8 .
@@ -64,11 +64,11 @@ driver:
 .Pp
 .Bl -bullet -compact
 .It
-SMSC LAN9500, LAN9500A, LAN9505 and LAN9505A based Ethernet adapters
+LAN9500, LAN9500A, LAN9505 and LAN9505A based Ethernet adapters
 .It
-SMSC LAN89530, LAN9530 and LAN9730 based Ethernet adapters
+LAN89530, LAN9530 and LAN9730 based Ethernet adapters
 .It
-SMSC LAN951x Ethernet adapters with integrated USB hub
+LAN951x Ethernet adapters with integrated USB hub
 .El
 .Sh SEE ALSO
 .Xr arp 4 ,
diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c
index a59501b6bbff..58809de4ad3a 100644
--- a/sys/dev/usb/net/if_smsc.c
+++ b/sys/dev/usb/net/if_smsc.c
@@ -28,7 +28,7 @@
 
 #include 
 /*
- * SMSC LAN9xxx devices (http://www.smsc.com/)
+ * Microchip LAN9xxx devices (https://www.microchip.com/en-us/product/lan9500a)
  * 
  * The LAN9500 & LAN9500A devices are stand-alone USB to Ethernet chips that
  * support USB 2.0 and 10/100 Mbps Ethernet.
@@ -38,7 +38,7 @@
  * supports the hub part.
  *
  * This driver is closely modelled on the Linux driver written and copyrighted
- * by SMSC.
+ * by SMSC (later acquired by Microchip).
  *
  *
  *



git: 82f43db382cc - main - ip17x: fix non-debug build

2024-05-09 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=82f43db382cc4aea2a3f34f08da9a97ab023d5fb

commit 82f43db382cc4aea2a3f34f08da9a97ab023d5fb
Author: Ed Maste 
AuthorDate: 2024-05-08 13:20:44 +
Commit: Ed Maste 
CommitDate: 2024-05-09 18:22:11 +

ip17x: fix non-debug build

PR: 278847
Reviewed by:jhibbits
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45133
---
 sys/dev/etherswitch/ip17x/ip17x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/etherswitch/ip17x/ip17x.c 
b/sys/dev/etherswitch/ip17x/ip17x.c
index 218c0c293662..65e548ba293b 100644
--- a/sys/dev/etherswitch/ip17x/ip17x.c
+++ b/sys/dev/etherswitch/ip17x/ip17x.c
@@ -556,7 +556,7 @@ ip17x_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
 static int
 ip17x_readreg(device_t dev, int addr)
 {
-   struct ip17x_softc *sc;
+   struct ip17x_softc *sc __diagused;
 
sc = device_get_softc(dev);
IP17X_LOCK_ASSERT(sc, MA_OWNED);
@@ -568,7 +568,7 @@ ip17x_readreg(device_t dev, int addr)
 static int
 ip17x_writereg(device_t dev, int addr, int value)
 {
-   struct ip17x_softc *sc;
+   struct ip17x_softc *sc __diagused;
 
sc = device_get_softc(dev);
IP17X_LOCK_ASSERT(sc, MA_OWNED);



git: 2e0c027e69de - main - ukswitch: fix non-debug build

2024-05-10 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2e0c027e69de66afc1157c76bd42ecd3737d54e1

commit 2e0c027e69de66afc1157c76bd42ecd3737d54e1
Author: Ed Maste 
AuthorDate: 2024-05-10 12:52:06 +
Commit: Ed Maste 
CommitDate: 2024-05-10 12:53:15 +

ukswitch: fix non-debug build

PR: 278847
Sponsored by:   The FreeBSD Foundation
---
 sys/dev/etherswitch/ukswitch/ukswitch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c 
b/sys/dev/etherswitch/ukswitch/ukswitch.c
index 6eff37bb118e..88726422bd01 100644
--- a/sys/dev/etherswitch/ukswitch/ukswitch.c
+++ b/sys/dev/etherswitch/ukswitch/ukswitch.c
@@ -514,7 +514,7 @@ ukswitch_writephy(device_t dev, int phy, int reg, int data)
 static int
 ukswitch_readreg(device_t dev, int addr)
 {
-   struct ukswitch_softc *sc;
+   struct ukswitch_softc *sc __diagused;
 
sc = device_get_softc(dev);
UKSWITCH_LOCK_ASSERT(sc, MA_OWNED);
@@ -526,7 +526,7 @@ ukswitch_readreg(device_t dev, int addr)
 static int
 ukswitch_writereg(device_t dev, int addr, int value)
 {
-   struct ukswitch_softc *sc;
+   struct ukswitch_softc *sc __diagused;
 
sc = device_get_softc(dev);
UKSWITCH_LOCK_ASSERT(sc, MA_OWNED);



git: 0b272e0926b3 - main - madt: print CPU APIC ID as signed int

2024-05-10 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0b272e0926b3c4b1961131119e22ed5791be7230

commit 0b272e0926b3c4b1961131119e22ed5791be7230
Author: Ed Maste 
AuthorDate: 2024-05-10 18:57:22 +
Commit: Ed Maste 
CommitDate: 2024-05-10 19:20:40 +

madt: print CPU APIC ID as signed int

Instead of printing something like "MADT: Found CPU APIC ID 4294967295
ACPI ID 512: disabled" print the APIC ID as a singed int for a more
user-friendly -1.

Reviewed by:jhb
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45158
---
 sys/x86/acpica/madt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index c6358ad7e847..a593028ffb5a 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -368,8 +368,8 @@ madt_add_cpu(u_int acpi_id, u_int apic_id, u_int flags)
 * MP code figure out which CPU is the BSP on its own.
 */
if (bootverbose)
-   printf("MADT: Found CPU APIC ID %u ACPI ID %u: %s\n",
-   apic_id, acpi_id, flags & ACPI_MADT_ENABLED ?
+   printf("MADT: Found CPU APIC ID %d ACPI ID %u: %s\n",
+   (int)apic_id, acpi_id, flags & ACPI_MADT_ENABLED ?
"enabled" : "disabled");
if (!(flags & ACPI_MADT_ENABLED))
return;



git: 4e3286818327 - main - Increase IOAPIC_MAX_ID to 255 (from 254)

2024-05-10 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4e3286818327453efd8e4c133928ba26a169567a

commit 4e3286818327453efd8e4c133928ba26a169567a
Author: Ed Maste 
AuthorDate: 2024-05-10 17:40:59 +
Commit: Ed Maste 
CommitDate: 2024-05-10 19:40:18 +

Increase IOAPIC_MAX_ID to 255 (from 254)

A test system provided by AMD panicked with "madt_parse_apics:
I/O APIC ID 255 too high".  I/O APIC ID 255 is acceptable, so increase
the limit.

Reviewed by:jhb, kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45157
---
 sys/x86/include/apicvar.h | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
index 10016e291b9b..ac6a82659e34 100644
--- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -78,7 +78,12 @@
 #defineMAX_APIC_ID 0x800
 #defineAPIC_ID_ALL 0x
 
-#defineIOAPIC_MAX_ID   xAPIC_MAX_APIC_ID
+/*
+ * The 0xff ID is used for broadcast IPIs for local APICs when not using
+ * x2APIC.  IPIs are not sent to I/O APICs so it's acceptable for an I/O APIC
+ * to use that ID.
+ */
+#defineIOAPIC_MAX_ID   0xff
 
 /* I/O Interrupts are used for external devices such as ISA, PCI, etc. */
 #defineAPIC_IO_INTS(IDT_IO_INTS + 16)



git: b667c40f9ff6 - main - src.conf.5: regen after addition of _FORTIFY_SOURCE build knob

2024-05-13 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b667c40f9ff6db3ad5978368b3771e675759b474

commit b667c40f9ff6db3ad5978368b3771e675759b474
Author: Ed Maste 
AuthorDate: 2024-05-13 15:27:05 +
Commit: Ed Maste 
CommitDate: 2024-05-13 15:28:52 +

src.conf.5: regen after addition of _FORTIFY_SOURCE build knob

Regen to pick up WITHOUT_SSP addition from commit 9bfd3b4076a7.

Sponsored by:   The FreeBSD Foundation
---
 share/man/man5/src.conf.5 | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 5301fc488021..f3e45ca8a661 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,5 +1,5 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
-.Dd April 23, 2024
+.Dd May 13, 2024
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1552,6 +1552,9 @@ When set, it enforces these options:
 .El
 .It Va WITHOUT_SSP
 Do not build world with stack smashing protection.
+See
+.Xr security 7
+for more information.
 .It Va WITH_STAGING
 Enable staging of files to a stage tree.
 This can be best thought of as auto-install to



git: 65fd76b5f566 - main - makeman: extend duplicate option warning to OPT_ options

2024-05-16 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=65fd76b5f566a21d4e017711e8d0678aab6fe59e

commit 65fd76b5f566a21d4e017711e8d0678aab6fe59e
Author: Ed Maste 
AuthorDate: 2024-05-13 19:05:39 +
Commit: Ed Maste 
CommitDate: 2024-05-16 17:30:37 +

makeman: extend duplicate option warning to OPT_ options

In a local tree I accidentally had OPT_INIT_ALL defaulting to zero in
userland and none in kernel.  This resulted in the INIT_ALL text
appearing twice in src.conf.5.

Reviewed by:brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45184
---
 tools/build/options/makeman | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tools/build/options/makeman b/tools/build/options/makeman
index 30416b03b983..e0980d3be607 100755
--- a/tools/build/options/makeman
+++ b/tools/build/options/makeman
@@ -379,12 +379,18 @@ EOF
 The following options accept a single value from a list of valid values.
 .Bl -tag -width indent
 EOF
+   prev_opt=
show_group_options |
while read opt ; do
if [ ! -f ${opt} ] ; then
echo "no description found for ${opt}, skipping" >&2
continue
fi
+   if [ $opt = "$prev_opt" ]; then
+   echo "ignoring duplicate option $opt" >&2
+   continue
+   fi
+   prev_opt=$opt
 
echo ".It Va ${opt}"
cat ${opt}



git: e9806d21282d - main - bhyve: avoid resource leak in error path

2024-05-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e9806d21282d3d5486b99b5c7062b490b00d8323

commit e9806d21282d3d5486b99b5c7062b490b00d8323
Author: Pierre Pronchery 
AuthorDate: 2024-05-16 16:55:54 +
Commit: Ed Maste 
CommitDate: 2024-05-17 16:26:27 +

bhyve: avoid resource leak in error path

In e820_finalize(), the e820_fwcfg_item variable, containing the
etc/e820 file (for the e820 table from the BIOS) is not free()'d when it
could not be added to the QEMU firmware configuration device (fw_cfg).

Reported by:Coverity Scan
CID:1522761
Reviewed by:corvink, jhb
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45223
---
 usr.sbin/bhyve/amd64/e820.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.sbin/bhyve/amd64/e820.c b/usr.sbin/bhyve/amd64/e820.c
index 456ce0330b50..9d95ec8ce688 100644
--- a/usr.sbin/bhyve/amd64/e820.c
+++ b/usr.sbin/bhyve/amd64/e820.c
@@ -483,6 +483,8 @@ e820_finalize(void)
e820_fwcfg_item->size, e820_fwcfg_item->data);
if (error != 0) {
warnx("could not add qemu fwcfg etc/e820");
+   free(e820_fwcfg_item->data);
+   free(e820_fwcfg_item);
return (error);
}
free(e820_fwcfg_item);



git: f7d45c5443ed - main - bhyve: avoid side effect in assertion

2024-05-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f7d45c5443edc99857fdda19c68301b5ec4a8971

commit f7d45c5443edc99857fdda19c68301b5ec4a8971
Author: Pierre Pronchery 
AuthorDate: 2024-05-17 07:31:32 +
Commit: Ed Maste 
CommitDate: 2024-05-17 19:45:18 +

bhyve: avoid side effect in assertion

An assert() was setting the error variable instead of checking it.

Reported by:Coverity Scan
CID:1521431
Reviewed by:jhb
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1244
---
 usr.sbin/bhyve/tpm_ppi_qemu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c
index ad66ecb09683..239d39184589 100644
--- a/usr.sbin/bhyve/tpm_ppi_qemu.c
+++ b/usr.sbin/bhyve/tpm_ppi_qemu.c
@@ -161,7 +161,7 @@ tpm_ppi_deinit(void *sc)
ppi = sc;
 
error = unregister_mem(&ppi_mmio);
-   assert(error = 0);
+   assert(error == 0);
 
free(ppi);
 }



git: fb623aab3927 - main - diff: honour -B flag with -q

2024-05-17 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fb623aab3927a6825ff7731198ec2e33426f7607

commit fb623aab3927a6825ff7731198ec2e33426f7607
Author: Ed Maste 
AuthorDate: 2024-05-16 14:53:23 +
Commit: Ed Maste 
CommitDate: 2024-05-18 00:03:56 +

diff: honour -B flag with -q

PR: 278988
Reviewed by:bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45220
---
 usr.bin/diff/diffreg.c  |  3 ++-
 usr.bin/diff/tests/diff_test.sh | 11 +++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
index 06d914215b11..6073feebf5fb 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -408,7 +408,8 @@ diffreg_stone(char *file1, char *file2, int flags, int 
capsicum)
}
 
if (diff_format == D_BRIEF && ignore_pats == NULL &&
-   (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) == 0)
+   (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|
+   D_SKIPBLANKLINES|D_STRIPCR)) == 0)
{
rval = D_DIFFER;
status |= 1;
diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh
index 146c23fa303d..9a17d180da02 100755
--- a/usr.bin/diff/tests/diff_test.sh
+++ b/usr.bin/diff/tests/diff_test.sh
@@ -11,6 +11,7 @@ atf_test_case brief_format
 atf_test_case b230049
 atf_test_case stripcr_o
 atf_test_case b252515
+atf_test_case b278988
 atf_test_case Bflag
 atf_test_case Nflag
 atf_test_case tabsize
@@ -89,6 +90,15 @@ b252515_body()
diff -qw b252515_a.in b252515_b.in
 }
 
+b278988_body()
+{
+   printf 'a\nb\nn' > b278988.a.in
+   printf 'a\n\nb\nn' > b278988.b.in
+   atf_check -o empty -s eq:0 \
+   diff -Bw b278988.a.in b278988.b.in
+
+}
+
 header_body()
 {
export TZ=UTC
@@ -369,6 +379,7 @@ atf_init_test_cases()
atf_add_test_case b230049
atf_add_test_case stripcr_o
atf_add_test_case b252515
+   atf_add_test_case b278988
atf_add_test_case Bflag
atf_add_test_case Nflag
atf_add_test_case tabsize



git: 7975f57b7e14 - main - uipc_shm: Fix double check for shmfd->shm_path

2024-05-21 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7975f57b7e14b146ca730421ef9e2094c242e9c0

commit 7975f57b7e14b146ca730421ef9e2094c242e9c0
Author: Ricardo Branco 
AuthorDate: 2024-05-20 13:09:08 +
Commit: Ed Maste 
CommitDate: 2024-05-21 13:39:53 +

uipc_shm: Fix double check for shmfd->shm_path

Reviewed by:emaste, zlei
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1250
---
 sys/kern/uipc_shm.c | 26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index 1136f34a6f85..c83455d1e70b 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -1910,21 +1910,19 @@ shm_fill_kinfo_locked(struct shmfd *shmfd, struct 
kinfo_file *kif, bool list)
kif->kf_un.kf_file.kf_file_mode = S_IFREG | shmfd->shm_mode;
kif->kf_un.kf_file.kf_file_size = shmfd->shm_size;
if (shmfd->shm_path != NULL) {
-   if (shmfd->shm_path != NULL) {
-   path = shmfd->shm_path;
-   pr_path = curthread->td_ucred->cr_prison->pr_path;
-   if (strcmp(pr_path, "/") != 0) {
-   /* Return the jail-rooted pathname. */
-   pr_pathlen = strlen(pr_path);
-   visible = strncmp(path, pr_path, pr_pathlen)
-   == 0 && path[pr_pathlen] == '/';
-   if (list && !visible)
-   return (EPERM);
-   if (visible)
-   path += pr_pathlen;
-   }
-   strlcpy(kif->kf_path, path, sizeof(kif->kf_path));
+   path = shmfd->shm_path;
+   pr_path = curthread->td_ucred->cr_prison->pr_path;
+   if (strcmp(pr_path, "/") != 0) {
+   /* Return the jail-rooted pathname. */
+   pr_pathlen = strlen(pr_path);
+   visible = strncmp(path, pr_path, pr_pathlen) == 0 &&
+   path[pr_pathlen] == '/';
+   if (list && !visible)
+   return (EPERM);
+   if (visible)
+   path += pr_pathlen;
}
+   strlcpy(kif->kf_path, path, sizeof(kif->kf_path));
}
return (0);
 }



git: 61639bb3fc5a - main - libc: move NIS xdr_* symbols from rpc's to yp's Symbol.map

2024-05-24 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=61639bb3fc5abe0bb7b096e643b51c30703ac432

commit 61639bb3fc5abe0bb7b096e643b51c30703ac432
Author: Ed Maste 
AuthorDate: 2024-05-24 17:27:29 +
Commit: Ed Maste 
CommitDate: 2024-05-24 20:47:37 +

libc: move NIS xdr_* symbols from rpc's to yp's Symbol.map

To fix WITHOUT_NIS build.  Building yp_xdr.c is gated by MK_NIS.

PR: 279270
Reported by:peterj
Reported by:matteo
Reported by:Michael Dexter's Build Option Survey run
Reviewed by:brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45347
---
 lib/libc/rpc/Symbol.map | 31 ---
 lib/libc/yp/Symbol.map  | 32 
 2 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/lib/libc/rpc/Symbol.map b/lib/libc/rpc/Symbol.map
index 5bf364f28d81..e4fecb83ec66 100644
--- a/lib/libc/rpc/Symbol.map
+++ b/lib/libc/rpc/Symbol.map
@@ -8,37 +8,6 @@ FBSD_1.0 {
xdr_desargs;
xdr_desresp;
 
-   /* From yp_xdr.c (generated by rpcgen - include/rpcsvc/yp.x) */
-   xdr_domainname;
-   xdr_keydat;
-   xdr_mapname;
-   xdr_peername;
-   xdr_valdat;
-   xdr_ypbind_binding;
-   xdr_ypbind_resp;
-   xdr_ypbind_resptype;
-   xdr_ypbind_setdom;
-   xdr_ypmap_parms;
-   xdr_ypmaplist;
-   xdr_yppush_status;
-   xdr_yppushresp_xfr;
-   xdr_ypreq_key;
-   xdr_ypreq_nokey;
-   xdr_ypreq_xfr;
-   xdr_ypreqtype;
-   xdr_yprequest;
-   xdr_ypresp_all;
-   xdr_ypresp_key_val;
-   xdr_ypresp_maplist;
-   xdr_ypresp_master;
-   xdr_ypresp_order;
-   xdr_ypresp_val;
-   xdr_ypresp_xfr;
-   xdr_ypresponse;
-   xdr_ypresptype;
-   xdr_ypstat;
-   xdr_ypxfrstat;
-
authdes_seccreate;
authdes_pk_seccreate;
authnone_create;
diff --git a/lib/libc/yp/Symbol.map b/lib/libc/yp/Symbol.map
index fff2b2e60e39..f50beed7be31 100644
--- a/lib/libc/yp/Symbol.map
+++ b/lib/libc/yp/Symbol.map
@@ -18,4 +18,36 @@ FBSD_1.0 {
yperr_string;
ypprot_err;
_yp_check;
+
+   /* From yp_xdr.c (generated by rpcgen - include/rpcsvc/yp.x) */
+   xdr_domainname;
+   xdr_keydat;
+   xdr_mapname;
+   xdr_peername;
+   xdr_valdat;
+   xdr_ypbind_binding;
+   xdr_ypbind_resp;
+   xdr_ypbind_resptype;
+   xdr_ypbind_setdom;
+   xdr_ypmap_parms;
+   xdr_ypmaplist;
+   xdr_yppush_status;
+   xdr_yppushresp_xfr;
+   xdr_ypreq_key;
+   xdr_ypreq_nokey;
+   xdr_ypreq_xfr;
+   xdr_ypreqtype;
+   xdr_yprequest;
+   xdr_ypresp_all;
+   xdr_ypresp_key_val;
+   xdr_ypresp_maplist;
+   xdr_ypresp_master;
+   xdr_ypresp_order;
+   xdr_ypresp_val;
+   xdr_ypresp_xfr;
+   xdr_ypresponse;
+   xdr_ypresptype;
+   xdr_ypstat;
+   xdr_ypxfrstat;
+
 };



git: f52481f3b8a3 - main - vt(4): add note about sc/UEFI incompatibility

2024-05-24 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f52481f3b8a377e336ecba1b5150023a344ec189

commit f52481f3b8a377e336ecba1b5150023a344ec189
Author: Ed Maste 
AuthorDate: 2024-05-24 21:45:14 +
Commit: Ed Maste 
CommitDate: 2024-05-24 23:55:10 +

vt(4): add note about sc/UEFI incompatibility

syscons is not compatible with UEFI boot.  This is noted in syscons(4),
but not mentioned in vt(4) where the kern.vty tunable (used to select vt
or sc) is documented.  Add a note so that if someone reads vt(4) but not
sc(4) they are not surprised by having no usable console.

PR: 276206
Reviewed by:brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45357
---
 share/man/man4/vt.4 | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4
index ed4da98df673..45e6c0ceb979 100644
--- a/share/man/man4/vt.4
+++ b/share/man/man4/vt.4
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 8, 2023
+.Dd May 24, 2024
 .Dt "VT" 4
 .Os
 .Sh NAME
@@ -220,6 +220,11 @@ The
 kernel uses
 .Nm
 when this value is not set.
+Note that
+.Ql sc
+is not compatible with
+.Xr UEFI 8
+boot.
 .It Va kern.vt.color. Ns Ar colornum Ns Va .rgb
 Set this value to override default palette entry for color
 .Pa colornum



git: 9b1de7e4844d - main - vt/sc: retire logic to select vt(4) by default for UEFI boot

2024-05-25 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9b1de7e4844d951a7d7335cbde75a86a2380e220

commit 9b1de7e4844d951a7d7335cbde75a86a2380e220
Author: Ed Maste 
AuthorDate: 2024-05-24 21:36:09 +
Commit: Ed Maste 
CommitDate: 2024-05-25 15:00:35 +

vt/sc: retire logic to select vt(4) by default for UEFI boot

We previously defaulted to using sc(4) with a special case to prefer
vt(4) when booted via UEFI.  As vt(4) is now always the default we can
simplify this.

Reviewed by:imp, kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45356
---
 sys/amd64/amd64/machdep.c |  9 -
 sys/kern/kern_cons.c  | 18 --
 sys/sys/cons.h|  1 -
 3 files changed, 28 deletions(-)

diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index c8539b7b189d..c509dcc2f7dd 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1464,15 +1464,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
r_idt.rd_base = (long) idt;
lidt(&r_idt);
 
-   /*
-* Use vt(4) by default for UEFI boot (during the sc(4)/vt(4)
-* transition).
-* Once bootblocks have updated, we can test directly for
-* efi_systbl != NULL here...
-*/
-   if (efi_boot)
-   vty_set_preferred(VTY_VT);
-
TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable);
TUNABLE_INT_FETCH("machdep.mitigations.ibrs.disable", &hw_ibrs_disable);
 
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
index 040aa3932a1a..2ab86d5905a9 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -737,7 +737,6 @@ sysbeep(int pitch __unused, sbintime_t duration __unused)
 /*
  * Temporary support for sc(4) to vt(4) transition.
  */
-static unsigned vty_prefer;
 static char vty_name[16];
 SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name,
 0, "Console vty driver");
@@ -762,10 +761,6 @@ vty_enabled(unsigned vty)
break;
}
 #endif
-   if (vty_prefer != 0) {
-   vty_selected = vty_prefer;
-   break;
-   }
 #if defined(DEV_VT)
vty_selected = VTY_VT;
 #elif defined(DEV_SC)
@@ -780,16 +775,3 @@ vty_enabled(unsigned vty)
}
return ((vty_selected & vty) != 0);
 }
-
-void
-vty_set_preferred(unsigned vty)
-{
-
-   vty_prefer = vty;
-#if !defined(DEV_SC)
-   vty_prefer &= ~VTY_SC;
-#endif
-#if !defined(DEV_VT)
-   vty_prefer &= ~VTY_VT;
-#endif
-}
diff --git a/sys/sys/cons.h b/sys/sys/cons.h
index 78df26858376..c7110a7c8c17 100644
--- a/sys/sys/cons.h
+++ b/sys/sys/cons.h
@@ -145,7 +145,6 @@ int constty_clear(struct tty *tp);
 #defineVTY_SC 0x01
 #defineVTY_VT 0x02
 intvty_enabled(unsigned int);
-void   vty_set_preferred(unsigned int);
 
 #endif /* _KERNEL */
 



git: b128bedfb95c - main - mptutil: correct man page date

2024-05-25 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b128bedfb95c1fefe10e3375b07e200eff8c3664

commit b128bedfb95c1fefe10e3375b07e200eff8c3664
Author: Ed Maste 
AuthorDate: 2024-05-25 18:00:54 +
Commit: Ed Maste 
CommitDate: 2024-05-25 18:02:36 +

mptutil: correct man page date

PR: 279201
Fixes:  9a49a3792940 ("mptutil: document that disabled/enab...")
Sponsored by:   The FreeBSD Foundation
---
 usr.sbin/mptutil/mptutil.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/mptutil/mptutil.8 b/usr.sbin/mptutil/mptutil.8
index 47eb9e43d2b9..1aeaafbfa12e 100644
--- a/usr.sbin/mptutil/mptutil.8
+++ b/usr.sbin/mptutil/mptutil.8
@@ -27,7 +27,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 24, 2024
+.Dd May 24, 2023
 .Dt MPTUTIL 8
 .Os
 .Sh NAME



git: a8f86ecd6104 - main - newsyslog: Fix case of the 'P' flag in newsyslog.conf(5)

2024-05-26 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a8f86ecd6104b1f127b426be278a9031789b4413

commit a8f86ecd6104b1f127b426be278a9031789b4413
Author: Joshua Kinard 
AuthorDate: 2024-05-25 20:52:11 +
Commit: Ed Maste 
CommitDate: 2024-05-27 01:34:14 +

newsyslog: Fix case of the 'P' flag in newsyslog.conf(5)

PR: 279303
Reviewed-by: emaste
Signed-off-by: Joshua Kinard 
---
 usr.sbin/newsyslog/newsyslog.conf.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 
b/usr.sbin/newsyslog/newsyslog.conf.5
index 120c5a0cb7cc..9f229bc04402 100644
--- a/usr.sbin/newsyslog/newsyslog.conf.5
+++ b/usr.sbin/newsyslog/newsyslog.conf.5
@@ -330,7 +330,7 @@ to use
 .It Cm N
 indicates that there is no process which needs to be signaled
 when this log file is rotated.
-.It Cm p
+.It Cm P
 indicates that the zero-th rotated file should not be compressed.
 .It Cm R
 if this flag is set the



  1   2   3   4   5   6   7   8   9   10   >