Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features

2021-11-24 Thread Emmanuel Vadot
On Tue, 23 Nov 2021 20:36:40 +0100 (CET)
free...@oldach.net (Helge Oldach) wrote:

> Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET):
> > On 11/23/2021 5:00 AM, Helge Oldach wrote:
> > > Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET):
> > > Hmmm. On a RPi4/8G:
> > > 
> > > Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6):
> > > | type 16 bytes 64 bytes256 bytes   1024 bytes   8192 
> > > bytes  16384 bytes
> > > | aes-256-gcm  35791.98k38533.57k39986.77k41397.59k
> > > 39840.43k39638.36k
> > > 
> > > After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621)
> > > 
> > > | type 16 bytes 64 bytes256 bytes   1024 bytes   8192 
> > > bytes  16384 bytes
> > > | aes-256-gcm  21277.62k23226.64k23613.90k23687.51k
> > > 23892.93k23947.95k
> > > 
> > > It seems that AES throughput is actually cut by almost half?
> > 
> > Do you know which of the CPU optimizations your RPi4 supports?
> 
> Is this what you need?
> 
>  Instruction Set Attributes 0 = 

 So there is no AES+PMULL instruction set on RPI4, I guess that openssl
uses them for aes-gcm.

 I wonder what it uses before that make it have this boost.

 On my rockpro64 I do see the improvement btw :
root@generic:~ # cpuset -l 4,5 openssl speed -evp aes-256-gcm
...
aes-256-gcm 122861.59k   337938.39k   565408.44k   661223.09k   709175.19k  
 712327.25k
root@generic:~ # cpuset -l 4,5 env OPENSSL_armcap=0 openssl speed -evp 
aes-256-gcm
...
aes-256-gcm  34068.11k38068.62k39435.24k39818.75k39905.34k  
  39922.35k

 Running on the big cores at max freq.

>  Instruction Set Attributes 1 = <>
>  Processor Features 0 = 
>  Processor Features 1 = <>
>   Memory Model Features 0 =  PA>
>   Memory Model Features 1 = <8bit VMID>
>   Memory Model Features 2 = <32bit CCIDX,48bit VA>
>  Debug Features 0 =  Breakpoints,PMUv3,Debugv8>
>  Debug Features 1 = <>
>  Auxiliary Features 0 = <>
>  Auxiliary Features 1 = <>
> AArch32 Instruction Set Attributes 5 = 
> AArch32 Media and VFP Features 0 =  VFPv3+v4,AdvSIMD>
> AArch32 Media and VFP Features 1 =  Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
> 
> > You can set the environment variable OPENSSL_armcap to override 
> > OpenSSL's detection.
> > 
> > Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm
> 
> On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again 
> (i.e. after this commit):
> 
> hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm
> Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s
> Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s
> Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s
> Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s
> Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s
> Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s
> OpenSSL 1.1.1l-freebsd  24 Aug 2021
> built on: reproducible build, date unspecified
> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr)
> compiler: clang
> The 'numbers' are in 1000s of bytes per second processed.
> type 16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes 
>  16384 bytes
> aes-256-gcm  33504.57k39704.51k40825.01k41394.83k
> 41454.25k41601.52k
> hmo@p48 ~ $ openssl speed -evp aes-256-gcm
> Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s
> Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s
> Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s
> Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s
> Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s
> Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s
> OpenSSL 1.1.1l-freebsd  24 Aug 2021
> built on: reproducible build, date unspecified
> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr)
> compiler: clang
> The 'numbers' are in 1000s of bytes per second processed.
> type 16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes 
>  16384 bytes
> aes-256-gcm  21686.41k23197.59k23656.30k23725.04k
> 23926.10k23916.23k
> hmo@p48 ~ $
> 
> Kind regards,
> Helge


-- 
Emmanuel Vadot  



Re: git: ee2c52fd3fd9 - main - sys/devctl.h: Only declare kernel functions in kernel.

2021-11-24 Thread Ruslan Makhmatkhanov

Warner Losh wrote on 11/24/21 07:22:

The branch main has been updated by imp:

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

commit ee2c52fd3fd9dd19c1f7117cdda968ec4e08c898
Author: Warner Losh 
AuthorDate: 2021-11-24 03:28:45 +
Commit: Warner Losh 
CommitDate: 2021-11-24 04:21:18 +

 sys/devctl.h: Only declare kernel functions in kernel.
 
 Also, while I'm here, switch to newer, shorter format and fix my

 copyright to match the others in the tree.
 
 Sponsored by:   Netflix

---
  sys/sys/devctl.h | 27 ---
  1 file changed, 4 insertions(+), 23 deletions(-)


[...]


+ * SPDX-License-Idnetifier: BSD-2-Clause


    typo =)

[...]

--
Regards,
Ruslan

T.O.S. Of Reality



git: 857c66bb5f3c - vendor/bsddialog - vendor branch created

2021-11-24 Thread Baptiste Daroussin
The branch vendor/bsddialog has been created by bapt:

URL: https://cgit.FreeBSD.org/src/log/?id=857c66bb5f3c

857c66bb5f3c bsddialog: import snapshot as of 2021-11-24



git: 4143293277c3 - Create tag vendor/bsddialog/2021-11-24

2021-11-24 Thread Baptiste Daroussin
The annotated tag vendor/bsddialog/2021-11-24 has been created by bapt:

URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bsddialog/2021-11-24

tag vendor/bsddialog/2021-11-24
Tagger: Baptiste Daroussin 
TaggerDate: 2021-11-24 08:47:07 +

tag import of bsddialog 2021-11-24

commit 857c66bb5f3c5651b012beb1b5ea6ba39354ea94
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 08:42:13 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 08:46:56 +

bsddialog: import snapshot as of 2021-11-24



git: 1bc9ca3b35d2 - main - cam: Unbreak CAM_IO_STATS build

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit 1bc9ca3b35d280cdb0dbefa69bebf687970d1ef6
Author: Warner Losh 
AuthorDate: 2021-11-24 09:10:53 +
Commit: Warner Losh 
CommitDate: 2021-11-24 09:36:48 +

cam: Unbreak CAM_IO_STATS build

Fixes:  6637b7460066
Sponsored by:   Netflix
---
 sys/cam/nvme/nvme_da.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index f1c9a9ec9fea..7a489afdb993 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -1267,6 +1267,13 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb)
 static int
 ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
 {
+#ifdef CAM_IO_STATS
+   struct nda_softc *softc;
+   struct cam_periph *periph;
+
+   periph = xpt_path_periph(ccb->ccb_h.path);
+   softc = (struct nda_softc *)periph->softc;
+#endif
 
switch (ccb->ccb_h.status & CAM_STATUS_MASK) {
case CAM_CMD_TIMEOUT:



git: b3fab418301e - main - devctl.h: Spelling typo

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit b3fab418301eaadb3b9ac24f9ff295a84521dc54
Author: Warner Losh 
AuthorDate: 2021-11-24 09:12:35 +
Commit: Warner Losh 
CommitDate: 2021-11-24 09:37:51 +

devctl.h: Spelling typo

Spell identifier correctly. While I'm here, further simplify.

Fixes:  ee2c52fd3fd9
Sponsored by:   Netflix
---
 sys/sys/devctl.h | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sys/sys/devctl.h b/sys/sys/devctl.h
index 2cf84e420874..b72cd28dfce8 100644
--- a/sys/sys/devctl.h
+++ b/sys/sys/devctl.h
@@ -1,10 +1,7 @@
 /*-
  * Copyright 2020 M. Warner Losh 
  *
- * SPDX-License-Idnetifier: BSD-2-Clause
- *
- * $FreeBSD$
- *
+ * SPDX-License-Identifier: BSD-2-Clause
  */
 
 #ifndef _SYS_DEVCTL_H_



git: a2b53e53a3f3 - main - sys/file.h: Allow inclusion when compiling for a strict namespace

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit a2b53e53a3f38dd89b64500a2d2a1727baffe4f9
Author: Warner Losh 
AuthorDate: 2021-11-24 09:25:47 +
Commit: Warner Losh 
CommitDate: 2021-11-24 09:38:09 +

sys/file.h: Allow inclusion when compiling for a strict namespace

Although not part of the standard, this file is sometimes included with
-D_POSIX_C_SOURCE= or -D_XOPEN_SOURCE=. Limit those
sturctures that use types hidden by __BSD_VISIBLE to when they are
visible.

PR: 259975, 234205
Sponsored by:   Netflix
---
 sys/sys/file.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/sys/sys/file.h b/sys/sys/file.h
index 5a6f0b1d2071..8c4a2394770d 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -174,6 +174,7 @@ struct fileops {
  * nonenot locked
  */
 
+#if __BSD_VISIBLE
 struct fadvise_info {
int fa_advice;  /* (f) FADV_* type. */
off_t   fa_start;   /* (f) Region start. */
@@ -213,12 +214,14 @@ struct file {
 
 #defineFOFFSET_LOCKED   0x1
 #defineFOFFSET_LOCK_WAITING 0x2
+#endif /* __BSD_VISIBLE */
 
 #endif /* _KERNEL || _WANT_FILE */
 
 /*
  * Userland version of struct file, for sysctl
  */
+#if __BSD_VISIBLE
 struct xfile {
ksize_t xf_size;/* size of struct xfile */
pid_t   xf_pid; /* owning process */
@@ -238,6 +241,7 @@ struct xfile {
int _xf_int_pad3;
int64_t _xf_int64_pad[6];
 };
+#endif /* __BSD_VISIBLE */
 
 #ifdef _KERNEL
 



git: fde3fc69cda8 - main - ncurses: to not create a libncursesw.a in the OBJDIR

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit fde3fc69cda865dc65b547411157b3ca7674c5dd
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:10:26 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:02:22 +

ncurses: to not create a libncursesw.a in the OBJDIR

It breaks intree partial builds for every library depending on ncurses
because ncursesw.a (built without PIC) will be the first the library
path for the linker to resolve -lncursesw
---
 lib/ncurses/ncurses/Makefile | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index af733d3ac613..45c8fcd11301 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -170,9 +170,11 @@ SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcurses_p.a
 LIBADD+=   tinfow
 SHLIB_LDSCRIPT=libncursesw.ldscript
 STATIC_LDSCRIPT= libncursesw.aldscript
+CLEANFILES+= libncursesw.ald
+# Keep this for a while to ensure the file is removed during make clean
 CLEANFILES+= libncursesw.a
 
-libncursesw.a: ${.CURDIR}/${STATIC_LDSCRIPT}
+libncursesw.ald: ${.CURDIR}/${STATIC_LDSCRIPT}
sed -e 's,@@LIB@@,${LIB},g' \
-e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \
${.ALLSRC} > ${.TARGET}
@@ -184,11 +186,11 @@ lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h 
ncurses_dll.h
 expanded.c: MKexpanded.sh
sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" 
${CFLAGS} >expanded.c
 
-all: ${STATIC_LDSCRIPT} libncursesw.a
+all: ${STATIC_LDSCRIPT} libncursesw.ald
 
-install-libncursesw.a: libncursesw.a
+install-libncursesw.a: libncursesw.ald
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} 
-m ${LIBMODE} \
-   ${_INSTALLFLAGS} libncursesw.a ${DESTDIR}${_LIBDIR}/lib${LIB}.a
+   ${_INSTALLFLAGS} libncursesw.ald ${DESTDIR}${_LIBDIR}/lib${LIB}.a
 
 realinstall: install-libncursesw.a
 



git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit a46722b580567799b484b5a81728eaf380777e04
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:20:10 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:02:22 +

ncurses: register formw as usable lib for LIBADD
---
 share/mk/src.libnames.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 7873d05d18da..6fee77357480 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -129,6 +129,7 @@ _LIBRARIES= \
execinfo \
fetch \
figpar \
+   formw \
geom \
gpio \
gssapi \
@@ -381,6 +382,7 @@ _DP_stats=  sbuf pthread
 _DP_stdthreads=pthread
 _DP_tacplus=   md
 _DP_ncursesw=  tinfow
+_DP_formw= ncursesw
 _DP_nvpair=spl
 _DP_panelw=ncursesw
 _DP_rpcsec_gss=gssapi



git: 37d0601f4273 - main - bsddialog: import new TUI widget and utility

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 37d0601f4273810f69440469e6b5625130bbc899
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:26:46 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:03:31 +

bsddialog: import new TUI widget and utility

bsddialog is an attempt to write in permissive license a replacement for
libdialog.

While it is still in early stage it is good enough to already be used in
many areas, it is imported as private lib until it matures enough to be
considered as having a stable ABI
---
 etc/mtree/BSD.usr.dist   | 2 ++
 lib/Makefile | 1 +
 share/mk/src.libnames.mk | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 5eaaed4e1265..891372c8148f 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -9,6 +9,8 @@
 ..
 include
 private
+bsddialog
+..
 bsdstat
 ..
 event1
diff --git a/lib/Makefile b/lib/Makefile
index 93761cc06b21..3af6b938ee74 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -36,6 +36,7 @@ SUBDIR=   ${SUBDIR_BOOTSTRAP} \
libauditd \
libbegemot \
libblocksruntime \
+   libbsddialog \
libbsdstat \
libbsm \
libbz2 \
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 6fee77357480..bc3ad9c4bf40 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -16,6 +16,7 @@ _PRIVATELIBS= \
atf_c \
atf_cxx \
auditd \
+   bsddialog \
bsdstat \
cbor \
devdctl \
@@ -262,6 +263,7 @@ _DP_80211=  sbuf bsdxml
 _DP_9p=sbuf
 _DP_archive=   z bz2 lzma bsdxml zstd
 _DP_avl=   spl
+_DP_bsddialog= formw ncursesw tinfow
 _DP_zstd=  pthread
 .if ${MK_BLACKLIST} != "no"
 _DP_blacklist+=pthread



git: c76f07938c44 - main - Add 'contrib/bsddialog/' from commit '857c66bb5f3c5651b012beb1b5ea6ba39354ea94'

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit c76f07938c44264c7ebd400c23f218e561960d23
Merge: a46722b58056 857c66bb5f3c
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 10:03:17 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:03:17 +

Add 'contrib/bsddialog/' from commit 
'857c66bb5f3c5651b012beb1b5ea6ba39354ea94'

git-subtree-dir: contrib/bsddialog
git-subtree-mainline: a46722b580567799b484b5a81728eaf380777e04
git-subtree-split: 857c66bb5f3c5651b012beb1b5ea6ba39354ea94

 contrib/bsddialog/GNUMakefile  |   28 +
 contrib/bsddialog/LICENSE  |   24 +
 contrib/bsddialog/Makefile |   49 +
 contrib/bsddialog/README.md|  160 +++
 contrib/bsddialog/bsddialog.c  | 1263 
 contrib/bsddialog/lib/GNUMakefile  |   31 +
 contrib/bsddialog/lib/Makefile |   73 ++
 contrib/bsddialog/lib/barbox.c |  369 ++
 contrib/bsddialog/lib/bsddialog.h  |  257 
 contrib/bsddialog/lib/bsddialog_theme.h|   96 ++
 contrib/bsddialog/lib/commandbox.c |  211 
 contrib/bsddialog/lib/editorbox.c  |   45 +
 contrib/bsddialog/lib/filebox.c|   52 +
 contrib/bsddialog/lib/formbox.c|  396 ++
 contrib/bsddialog/lib/infobox.c|  114 ++
 contrib/bsddialog/lib/lib_util.c   |  996 +++
 contrib/bsddialog/lib/lib_util.h   |  146 +++
 contrib/bsddialog/lib/libbsddialog.c   |  142 +++
 contrib/bsddialog/lib/menubox.c| 1015 
 contrib/bsddialog/lib/messagebox.c |  278 +
 contrib/bsddialog/lib/textbox.c|  280 +
 contrib/bsddialog/lib/theme.c  |  286 +
 contrib/bsddialog/lib/timebox.c|  241 
 contrib/bsddialog/library_examples/buildlist.c |   44 +
 contrib/bsddialog/library_examples/checklist.c |   44 +
 contrib/bsddialog/library_examples/compile |   10 +
 contrib/bsddialog/library_examples/infobox.c   |   32 +
 contrib/bsddialog/library_examples/menu.c  |   44 +
 contrib/bsddialog/library_examples/mixedlist.c |   71 ++
 contrib/bsddialog/library_examples/msgbox.c|   42 +
 contrib/bsddialog/library_examples/ports.c |   97 ++
 contrib/bsddialog/library_examples/radiolist.c |   44 +
 contrib/bsddialog/library_examples/theme.c |   67 ++
 contrib/bsddialog/library_examples/treeview.c  |   44 +
 contrib/bsddialog/library_examples/yesno.c |   32 +
 contrib/bsddialog/screenshot.png   |  Bin 0 -> 11050 bytes
 .../bsddialog/utility_examples/gauge_example.sh|   20 +
 contrib/bsddialog/utility_examples/info_example.sh |3 +
 contrib/bsddialog/utility_examples/menu_example.sh |   41 +
 .../bsddialog/utility_examples/message_example.sh  |5 +
 .../utility_examples/mixedform_example.sh  |   25 +
 .../utility_examples/mixedgauge_example.sh |   24 +
 42 files changed, 7241 insertions(+)

diff --cc contrib/bsddialog/GNUMakefile
index ,7480ae33ec21..7480ae33ec21
mode 00,100644..100644
--- a/contrib/bsddialog/GNUMakefile
+++ b/contrib/bsddialog/GNUMakefile
diff --cc contrib/bsddialog/LICENSE
index ,434f1782e537..434f1782e537
mode 00,100644..100644
--- a/contrib/bsddialog/LICENSE
+++ b/contrib/bsddialog/LICENSE
diff --cc contrib/bsddialog/Makefile
index ,..295aa927e4c5
new file mode 100644
--- /dev/null
+++ b/contrib/bsddialog/Makefile
@@@ -1,0 -1,0 +1,49 @@@
++# Any copyright is dedicated to the Public Domain, see:
++# 
++#
++# Written by Alfonso Sabato Siciliano
++
++OUTPUT=  bsddialog
++SOURCES= bsddialog.c
++OBJECTS= ${SOURCES:.c=.o}
++LIBPATH= ${.CURDIR}/lib
++LIBBSDDIALOG= ${LIBPATH}/libbsddialog.so
++
++CFLAGS= -Wall -I${LIBPATH}
++LDFLAGS= -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lbsddialog
++
++BINDIR= /usr/local/bin
++MAN= ${OUTPUT}.1
++GZIP= gzip -cn
++MANDIR= /usr/local/share/man/man1
++
++INSTALL= install
++RM= rm -f
++
++all : ${OUTPUT}
++
++${OUTPUT}: ${LIBBSDDIALOG} ${OBJECTS}
++  ${CC} ${LDFLAGS} ${OBJECTS} -o ${.PREFIX}
++
++${LIBBSDDIALOG}:
++.if defined(PORTNCURSES)
++  make -C ${LIBPATH} -DPORTNCURSES
++.else
++  make -C ${LIBPATH}
++.endif
++
++.c.o:
++  ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
++
++install:
++  ${INSTALL} -s -m 555 ${OUTPUT} ${BINDIR}
++  ${GZIP} ${MAN} > ${MAN}.gz
++  ${INSTALL} -m 444 ${MAN}.gz ${MANDIR}
++
++unistall:
++  ${RM} ${BINDIR}/${OUTPUT}
++  ${RM} ${MANDIR}/${MAN}.gz
++
++clean:
++  make -C ${LIBPATH} clean
++  ${RM} ${OUTPUT} *.o *~ *

git: f872dde34c6a - main - tzsetup: replace libdialog with libbsddialog

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit f872dde34c6af8c27e16905ebfdb62cddb4c35ba
Author: Baptiste Daroussin 
AuthorDate: 2021-11-15 15:38:34 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:03:33 +

tzsetup: replace libdialog with libbsddialog

Reviewed by: alfix86_gmail.com (bsddialog author)
Differential Revision: https://reviews.freebsd.org/D33077
---
 usr.sbin/tzsetup/Makefile  |   6 +-
 usr.sbin/tzsetup/tzsetup.c | 189 +++--
 2 files changed, 99 insertions(+), 96 deletions(-)

diff --git a/usr.sbin/tzsetup/Makefile b/usr.sbin/tzsetup/Makefile
index 7274b7680ca9..adef619b6596 100644
--- a/usr.sbin/tzsetup/Makefile
+++ b/usr.sbin/tzsetup/Makefile
@@ -7,10 +7,10 @@ MAN=  tzsetup.8
 
 CFLAGS+= -I.
 
-.if ${MK_DIALOG} != no && !defined(BOOTSTRAPPING)
+.if !defined(BOOTSTRAPPING)
 WARNS?=3
-CFLAGS+=   -I${SRCTOP}/contrib/dialog -DHAVE_DIALOG
-LIBADD=dialog tinfow
+CFLAGS+=   -I${SRCTOP}/contrib/bsddialog/lib -DHAVE_BSDDIALOG
+LIBADD=bsddialog
 .endif
 
 .include 
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 6446800ce519..93871e27fb7b 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef HAVE_DIALOG
-#include 
+#ifdef HAVE_BSDDIALOG
+#include 
 #endif
 
 #define_PATH_ZONETAB   "/usr/share/zoneinfo/zone1970.tab"
@@ -86,7 +86,9 @@ static void   usage(void);
 static int install_zoneinfo(const char *zoneinfo);
 static int install_zoneinfo_file(const char *zoneinfo_file);
 
-#ifdef HAVE_DIALOG
+#ifdef HAVE_BSDDIALOG
+static struct bsddialog_conf conf;
+
 /* for use in describing more exotic behaviors */
 typedef struct dialogMenuItem {
char *prompt;
@@ -128,28 +130,30 @@ xdialog_count_columns(const char *p)
 }
 
 static int
-xdialog_menu(const char *title, const char *cprompt, int height, int width,
+xdialog_menu(char *title, char *cprompt, int height, int width,
 int menu_height, int item_no, dialogMenuItem *ditems)
 {
int i, result, choice = 0;
-   DIALOG_LISTITEM *listitems;
-   DIALOG_VARS save_vars;
-
-   dlg_save_vars(&save_vars);
+   struct bsddialog_menuitem *listitems;
 
/* initialize list items */
-   listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1);
-   assert_ptr(listitems, "xdialog_menu");
+   listitems = calloc(item_no + 1, sizeof(struct bsddialog_menuitem));
+   if (listitems == NULL)
+   errx(1, "Failed to allocate memory in xdialog_menu");
for (i = 0; i < item_no; i++) {
+   listitems[i].prefix = "";
+   listitems[i].depth = 0;
+   listitems[i].bottomdesc = "";
+   listitems[i].on = false;
listitems[i].name = ditems[i].prompt;
-   listitems[i].text = ditems[i].title;
+   listitems[i].desc = ditems[i].title;
}
 
/* calculate height */
if (height < 0)
height = xdialog_count_rows(cprompt) + menu_height + 4 + 2;
-   if (height > LINES)
-   height = LINES;
+   if (height > bsddialog_terminalheight())
+   height = bsddialog_terminalheight() - 2;
 
/* calculate width */
if (width < 0) {
@@ -160,7 +164,7 @@ xdialog_menu(const char *title, const char *cprompt, int 
height, int width,
 
l = strlen(listitems[i].name);
for (j = 0; j < item_no; j++) {
-   int k = strlen(listitems[j].text);
+   int k = strlen(listitems[j].desc);
tag_x = MAX(tag_x, l + k + 2);
}
}
@@ -169,37 +173,39 @@ xdialog_menu(const char *title, const char *cprompt, int 
height, int width,
width = MAX(width, tag_x + 4) + 4;
}
width = MAX(width, 24);
-   if (width > COLS)
-   width = COLS;
+   if (width > bsddialog_terminalwidth())
+   width = bsddialog_terminalwidth() - 3;
 
 again:
-   dialog_vars.default_item = listitems[choice].name;
-   result = dlg_menu(title, cprompt, height, width,
-   menu_height, item_no, listitems, &choice, NULL);
+   conf.menu.default_item = listitems[choice].name;
+   conf.title = title;
+   result = bsddialog_menu(conf, cprompt, height, width,
+   menu_height, item_no, listitems, NULL);
+   for (int i = 0; i < item_no; i++)
+   if (listitems[i].on)
+   choice = i;
switch (result) {
-   case DLG_EXIT_ESC:
+   case BSDDIALOG_ESC:
result = -1;
break;
-   case DLG_EXIT_OK:
+   case BSDDIALOG_YESOK:
if (ditems[choice].f

git: 6ea39dd6c73b - main - tzsetup: remove dedundant declaration

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 6ea39dd6c73b9667bfa7540d3b26295213105871
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 10:12:05 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:12:05 +

tzsetup: remove dedundant declaration
---
 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 93871e27fb7b..4fc0fa88d438 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -181,7 +181,7 @@ again:
conf.title = title;
result = bsddialog_menu(conf, cprompt, height, width,
menu_height, item_no, listitems, NULL);
-   for (int i = 0; i < item_no; i++)
+   for (i = 0; i < item_no; i++)
if (listitems[i].on)
choice = i;
switch (result) {



git: 24b05d7a6190 - main - kbdmap: use libbsddialog instead of calling dialog(1) via system(3)

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 24b05d7a6190292f62488aa4d7de86246a09467c
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 10:55:26 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:55:26 +

kbdmap: use libbsddialog instead of calling dialog(1) via system(3)
---
 usr.sbin/kbdmap/Makefile |   2 +
 usr.sbin/kbdmap/kbdmap.c | 108 +++
 2 files changed, 46 insertions(+), 64 deletions(-)

diff --git a/usr.sbin/kbdmap/Makefile b/usr.sbin/kbdmap/Makefile
index ec493416a573..22747e70720c 100644
--- a/usr.sbin/kbdmap/Makefile
+++ b/usr.sbin/kbdmap/Makefile
@@ -1,6 +1,8 @@
 # $FreeBSD$
 
 PROG=  kbdmap
+CFLAGS+=   -I${SRCTOP}/contrib/bsddialog/lib
+LIBADD=bsddialog
 LINKS= ${BINDIR}/kbdmap ${BINDIR}/vidfont
 MLINKS=kbdmap.1 vidfont.1
 
diff --git a/usr.sbin/kbdmap/kbdmap.c b/usr.sbin/kbdmap/kbdmap.c
index 4f99ba03c2c8..2783d2368e0e 100644
--- a/usr.sbin/kbdmap/kbdmap.c
+++ b/usr.sbin/kbdmap/kbdmap.c
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -350,19 +351,23 @@ do_vidfont(struct keymap *km)
 static void
 show_dialog(struct keymap **km_sorted, int num_keymaps)
 {
-   FILE *fp;
-   char *cmd, *dialog;
-   char tmp_name[] = "/tmp/_kbd_lang.";
-   int fd, i, size;
-
-   fd = mkstemp(tmp_name);
-   if (fd == -1) {
-   fprintf(stderr, "Could not open temporary file \"%s\"\n",
-   tmp_name);
+   struct bsddialog_conf conf;
+   struct bsddialog_menuitem *listitems;
+   int i, result;
+
+   bsddialog_initconf(&conf);
+   conf.clear = true;
+   if (bsddialog_init() < 0) {
+   fprintf(stderr, "Failed to initialize bsddialog");
+   exit(1);
+   }
+   conf.title = __DECONST(char *, title);
+
+   listitems = calloc(num_keymaps + 1, sizeof(struct bsddialog_menuitem));
+   if (listitems == NULL) {
+   fprintf(stderr, "Failed to allocate memory in show_dialog");
exit(1);
}
-   asprintf(&dialog, "/usr/bin/dialog --clear --title \"%s\" "
- "--menu \"%s\" 0 0 0", title, menu);
 
/* start right font, assume that current font is equal
 * to default font in /etc/rc.conf
@@ -374,63 +379,38 @@ show_dialog(struct keymap **km_sorted, int num_keymaps)
if (font && strcmp(font, font_current))
vidcontrol(font);
 
-   /* Build up the command */
-   size = 0;
-   for (i=0; idesc) + 6;
-   }
-
-   /* Allow the space for '2> tmpfilename' redirection */
-   size += strlen(tmp_name) + 3;
-
-   cmd = (char *) malloc(strlen(dialog) + size + 1);
-   strcpy(cmd, dialog);
-
+   /* Build up the menu */
for (i=0; idesc);
-   strcat(cmd, "\"");
-   strcat(cmd, " \"\"");
+   listitems[i].prefix = __DECONST(char *, "");
+   listitems[i].depth = 0;
+   listitems[i].bottomdesc = __DECONST(char *, "");
+   listitems[i].on = false;
+   listitems[i].name = km_sorted[i]->desc;
+   listitems[i].desc = __DECONST(char *, "");
}
-
-   strcat(cmd, " 2>");
-   strcat(cmd, tmp_name);
-
-   /* Show the dialog.. */
-   system(cmd);
-
-   fp = fopen(tmp_name, "r");
-   if (fp) {
-   char choice[64];
-   if (fgets(choice, sizeof(choice), fp) != NULL) {
-   /* Find key for desc */
-   for (i=0; idesc)) {
-   if (!strcmp(program, "kbdmap"))
-   do_kbdcontrol(km_sorted[i]);
-   else
-   do_vidfont(km_sorted[i]);
-   break;
-   }
+   result = bsddialog_menu(conf, __DECONST(char *, menu), 0, 0, 0,
+   num_keymaps, listitems, NULL);
+   bsddialog_end();
+   switch (result) {
+   case BSDDIALOG_YESOK:
+   for (i = 0; i < num_keymaps; i++) {
+   if (listitems[i].on) {
+   printf("ici\n");
+   if (!strcmp(program, "kdbmap"))
+   do_kbdcontrol(km_sorted[i]);
+   else
+   do_vidfont(km_sorted[i]);
+   break;
}
-   } else {
-   if (font != NULL && strcmp(font, font_current))
-   /* Cancelled, restore old font */
-   vidcontrol(font_current);
}
-   fclose(fp);
-   } else
- 

git: 7d51283f700c - main - partedit: cleanup headers

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 7d51283f700cb6f43f3293c40a8fcab3854c5fc1
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 11:06:34 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 11:06:34 +

partedit: cleanup headers

Removed dialog.h where not needed and include headers actually used
---
 usr.sbin/bsdinstall/partedit/scripted.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/usr.sbin/bsdinstall/partedit/scripted.c 
b/usr.sbin/bsdinstall/partedit/scripted.c
index 37ac6de131b5..956855eb6e54 100644
--- a/usr.sbin/bsdinstall/partedit/scripted.c
+++ b/usr.sbin/bsdinstall/partedit/scripted.c
@@ -29,13 +29,12 @@
  */
 
 #include 
-#include 
-#include 
-#include 
 
+#include 
 #include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include "partedit.h"
 



git: 848ee2a3a8b4 - main - bsddialog: actually add directories

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 848ee2a3a8b47c9905fc51fefcf60eb371edbb98
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 11:13:45 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 11:13:45 +

bsddialog: actually add directories
---
 lib/libbsddialog/Makefile  | 30 ++
 usr.bin/bsddialog/Makefile | 12 
 2 files changed, 42 insertions(+)

diff --git a/lib/libbsddialog/Makefile b/lib/libbsddialog/Makefile
new file mode 100644
index ..14e06fde0c7e
--- /dev/null
+++ b/lib/libbsddialog/Makefile
@@ -0,0 +1,30 @@
+BSDDIALOG= ${SRCTOP}/contrib/bsddialog
+
+.PATH: ${BSDDIALOG}/lib
+
+LIB=   bsddialog
+PRIVATELIB=yes
+SHLIB_MAJOR=   0
+SRCS=  barbox.c \
+   commandbox.c \
+   editorbox.c \
+   filebox.c \
+   formbox.c \
+   infobox.c \
+   lib_util.c \
+   lib_util.h \
+   libbsddialog.c \
+   menubox.c \
+   messagebox.c \
+   textbox.c \
+   theme.c \
+   timebox.c
+INCS=  bsddialog.h \
+   bsddialog_theme.h
+MAN=
+
+LIBADD=ncursesw tinfow formw
+
+WARNS= 2
+
+.include 
diff --git a/usr.bin/bsddialog/Makefile b/usr.bin/bsddialog/Makefile
new file mode 100644
index ..3ff5c378418e
--- /dev/null
+++ b/usr.bin/bsddialog/Makefile
@@ -0,0 +1,12 @@
+BSDDIALOG= ${SRCTOP}/contrib/bsddialog
+.PATH: ${BSDDIALOG}
+
+PROG=  bsddialog
+SRCS=  bsddialog.c
+MAN=
+CFLAGS+=   -I${BSDDIALOG}/lib
+LIBADD=bsddialog
+
+WARNS= 2
+
+.include 



Re: git: 8ef0c11e7ce7 - main - nfsclient: upgrade vnode lock in VOP_OPEN()/VOP_CLOSE() if we need to flush buffers

2021-11-24 Thread Konstantin Belousov
On Wed, Nov 24, 2021 at 07:01:56PM +1100, Peter Jeremy wrote:
> On 2021-Nov-24 05:12:19 +0200, Konstantin Belousov  
> wrote:
> >Try this (combined two patches).
> 
> That's helped.  I can now swapon and swapoff but not actually use swap:
> KDB: stack backtrace:
> db_trace_self() at db_trace_self
> db_trace_self_wrapper() at db_trace_self_wrapper+0x30
> assert_vop_locked() at assert_vop_locked+0x58
> VOP_STRATEGY_APV() at VOP_STRATEGY_APV+0x54
> bufstrategy() at bufstrategy+0x4c
> swap_pager_putpages() at swap_pager_putpages+0x108
> vm_pageout_flush() at vm_pageout_flush+0x108
> vm_pageout_cluster() at vm_pageout_cluster+0x464
> vm_pageout_laundry_worker() at vm_pageout_laundry_worker+0x910
> fork_exit() at fork_exit+0x74
> fork_trampoline() at fork_trampoline+0x14
> vnode 0xa8840700: type VREG
> usecount 1, writecount 0, refcount 2 seqc users 0
> hold count flags ()
> flags (VV_VMSIZEVNLOCK)
> v_object 0xa8df3738 ref 0 pages 0 cleanbuf 0 dirtybuf 0
> lock type nfs: UNLOCKED
> fileid 30984 fsid 0x3a3a00ff01
> VOP_STRATEGY: 0xa8840700 is not locked but should be
> KDB: enter: lock violation

Please try this, but it may require more work.  In particular, watch out
for deadlock: the swapped out pages are busied before swap vnode is locked.
By itself it is fine, but if some other io happens to the swap vnode, it
might become problematic.

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 9bc506c9b6b8..6daedd02649d 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2366,8 +2366,8 @@ sys_swapon(struct thread *td, struct swapon_args *uap)
goto done;
}
 
-   NDINIT(&nd, LOOKUP, ISOPEN | FOLLOW | AUDITVNODE1, UIO_USERSPACE,
-   uap->name, td);
+   NDINIT(&nd, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1,
+   UIO_USERSPACE, uap->name, td);
error = namei(&nd);
if (error)
goto done;
@@ -2387,8 +2387,10 @@ sys_swapon(struct thread *td, struct swapon_args *uap)
error = swaponvp(td, vp, attr.va_size / DEV_BSIZE);
}
 
-   if (error)
-   vrele(vp);
+   if (error != 0)
+   vput(vp);
+   else
+   VOP_UNLOCK(vp);
 done:
sx_xunlock(&swdev_syscall_lock);
return (error);
@@ -3012,7 +3014,7 @@ swapongeom(struct vnode *vp)
 {
int error;
 
-   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   ASSERT_VOP_ELOCKED(vp, "swapongeom");
if (vp->v_type != VCHR || VN_IS_DOOMED(vp)) {
error = ENOENT;
} else {
@@ -3020,7 +3022,6 @@ swapongeom(struct vnode *vp)
error = swapongeom_locked(vp->v_rdev, vp);
g_topology_unlock();
}
-   VOP_UNLOCK(vp);
return (error);
 }
 
@@ -3042,24 +3043,30 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp)
vp2 = sp->sw_id;
vhold(vp2);
if (bp->b_iocmd == BIO_WRITE) {
+   vn_lock(vp2, LK_EXCLUSIVE | LK_RETRY);
if (bp->b_bufobj)
bufobj_wdrop(bp->b_bufobj);
bufobj_wref(&vp2->v_bufobj);
+   } else {
+   vn_lock(vp2, LK_SHARED | LK_RETRY);
}
if (bp->b_bufobj != &vp2->v_bufobj)
bp->b_bufobj = &vp2->v_bufobj;
bp->b_vp = vp2;
bp->b_iooffset = dbtob(bp->b_blkno);
bstrategy(bp);
-   return;
+   VOP_UNLOCK(vp2);
 }
 
 static void
 swapdev_close(struct thread *td, struct swdevt *sp)
 {
+   struct vnode *vp;
 
-   VOP_CLOSE(sp->sw_vp, FREAD | FWRITE, td->td_ucred, td);
-   vrele(sp->sw_vp);
+   vp = sp->sw_vp;
+   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td);
+   vput(vp);
 }
 
 static int
@@ -3068,6 +3075,7 @@ swaponvp(struct thread *td, struct vnode *vp, u_long 
nblks)
struct swdevt *sp;
int error;
 
+   ASSERT_VOP_ELOCKED(vp, "swaponvp");
if (nblks == 0)
return (ENXIO);
mtx_lock(&sw_dev_mtx);
@@ -3079,14 +3087,12 @@ swaponvp(struct thread *td, struct vnode *vp, u_long 
nblks)
}
mtx_unlock(&sw_dev_mtx);
 
-   (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 #ifdef MAC
error = mac_system_check_swapon(td->td_ucred, vp);
if (error == 0)
 #endif
error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td, NULL);
-   (void) VOP_UNLOCK(vp);
-   if (error)
+   if (error != 0)
return (error);
 
swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close,



RE: git: 2eb2079554f4 - main - bhyve: keep physical and virtual COMMAND reg in sync

2021-11-24 Thread Corvin Köhne
Hi John,

> Would you be able to test if that change works in your environment?  I was
> never able to confirm that it fixed the bug I was trying to address, but I
> do think it is more correct.  The busmastering thing is to work around Linux
> clearing that flag on shutdown of a guest, and I wanted to preserve other
> bits in the command register that weren't related to BARs, etc.

The change works in my environment. As you have mentioned, my Linux guest
clears the busmastering bit on shutdown. However, in my opinion we should
initialize the command register bits in the same way as a real system does.

I took a short look into a public available PCI specification
(https://www.ics.uci.edu/~harris/ics216/pci/PCI_22.pdf).
For busmastering (and also for IO/Mem decoding) it states that it's default 
value
is 0. Therefore, I'd prefer to unconditionally clear those bits on startup.


Best regards
Corvin



Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Beckhoff
Registered office: Verl, Germany | Register court: Guetersloh HRA 7075




Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Bjoern A. Zeeb

On Wed, 24 Nov 2021, Baptiste Daroussin wrote:


The branch main has been updated by bapt:

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

commit a46722b580567799b484b5a81728eaf380777e04
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:20:10 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:02:22 +

   ncurses: register formw as usable lib for LIBADD


is LIBFORM to be LIBFORMW or do we need another new entry?

   1393 make[7]: "share/mk/bsd.libnames.mk" line 190: lib/ncurses/form: Missing 
value for LIBFORMW in bsd.libnames.mk.  Likely should be: LIBFORMW?= 
${LIBDESTDIR}${LIBDIR_BASE}/libformw.a




---
share/mk/src.libnames.mk | 2 ++
1 file changed, 2 insertions(+)

diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 7873d05d18da..6fee77357480 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -129,6 +129,7 @@ _LIBRARIES= \
execinfo \
fetch \
figpar \
+   formw \
geom \
gpio \
gssapi \
@@ -381,6 +382,7 @@ _DP_stats=  sbuf pthread
_DP_stdthreads= pthread
_DP_tacplus=md
_DP_ncursesw=   tinfow
+_DP_formw= ncursesw
_DP_nvpair= spl
_DP_panelw= ncursesw
_DP_rpcsec_gss= gssapi



--
Bjoern A. Zeeb r15:7



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread FreeBSD User
On Wed, 24 Nov 2021 10:03:51 GMT
Baptiste Daroussin  wrote:

> The branch main has been updated by bapt:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=a46722b580567799b484b5a81728eaf380777e04
> 
> commit a46722b580567799b484b5a81728eaf380777e04
> Author: Baptiste Daroussin 
> AuthorDate: 2021-11-24 09:20:10 +
> Commit: Baptiste Daroussin 
> CommitDate: 2021-11-24 10:02:22 +
> 
> ncurses: register formw as usable lib for LIBADD
> ---
>  share/mk/src.libnames.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
> index 7873d05d18da..6fee77357480 100644
> --- a/share/mk/src.libnames.mk
> +++ b/share/mk/src.libnames.mk
> @@ -129,6 +129,7 @@ _LIBRARIES=   \
>   execinfo \
>   fetch \
>   figpar \
> + formw \
>   geom \
>   gpio \
>   gssapi \
> @@ -381,6 +382,7 @@ _DP_stats=sbuf pthread
>  _DP_stdthreads=  pthread
>  _DP_tacplus= md
>  _DP_ncursesw=tinfow
> +_DP_formw=   ncursesw
>  _DP_nvpair=  spl
>  _DP_panelw=  ncursesw
>  _DP_rpcsec_gss=  gssapi
> 

buildworld is failing at:

===> lib/clang/libclang (includes)
--- includes_subdir_lib/ncurses ---
make[5]: "/usr/src/share/mk/bsd.libnames.mk" line 190: 
/usr/src/lib/ncurses/form: Missing
value for LIBFORMW in bsd.libnames.mk.  Likely should be: LIBFORMW?=
${LIBDESTDIR}${LIBDIR_BASE}/libformw.a

Kind regards 
O. Hartmann



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Bjoern A. Zeeb

On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:


On Wed, 24 Nov 2021, Baptiste Daroussin wrote:


The branch main has been updated by bapt:

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


commit a46722b580567799b484b5a81728eaf380777e04
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:20:10 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:02:22 +

   ncurses: register formw as usable lib for LIBADD


is LIBFORM to be LIBFORMW or do we need another new entry?

  1393 make[7]: "share/mk/bsd.libnames.mk" line 190: lib/ncurses/form: 
Missing value for LIBFORMW in bsd.libnames.mk.  Likely should be: LIBFORMW?= 
${LIBDESTDIR}${LIBDIR_BASE}/libformw.a



and later still:

   6315 ld: error: unable to find library -lformw
   6316 cc: error: linker command failed with exit code 1 (use -v to see 
invocation)
   6317 --- libprivatebsddialog.so.0.full ---
   6318 *** [libprivatebsddialog.so.0.full] Error code 1


@ 848ee2a3a8b47c9905fc51fefcf60eb371edbb98






---
share/mk/src.libnames.mk | 2 ++
1 file changed, 2 insertions(+)

diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 7873d05d18da..6fee77357480 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -129,6 +129,7 @@ _LIBRARIES= \
execinfo \
fetch \
figpar \
+   formw \
geom \
gpio \
gssapi \
@@ -381,6 +382,7 @@ _DP_stats=  sbuf pthread
_DP_stdthreads= pthread
_DP_tacplus=md
_DP_ncursesw=   tinfow
+_DP_formw= ncursesw
_DP_nvpair= spl
_DP_panelw= ncursesw
_DP_rpcsec_gss= gssapi






--
Bjoern A. Zeeb r15:7



git: 1cd0117ff6a1 - main - ncurses: libform is installed as libformw

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 1cd0117ff6a147d5979ebf736afe00c6d4287f2d
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 12:58:17 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 12:58:17 +

ncurses: libform is installed as libformw

Reported by:many
---
 share/mk/bsd.libnames.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk
index bc59c4babfd4..f71664bf5858 100644
--- a/share/mk/bsd.libnames.mk
+++ b/share/mk/bsd.libnames.mk
@@ -64,7 +64,7 @@ LIBEXECINFO?= ${LIBDESTDIR}${LIBDIR_BASE}/libexecinfo.a
 LIBFETCH?= ${LIBDESTDIR}${LIBDIR_BASE}/libfetch.a
 LIBFIGPAR?=${LIBDESTDIR}${LIBDIR_BASE}/libfigpar.a
 LIBFL?="don't use LIBFL, use LIBL"
-LIBFORM?=  ${LIBDESTDIR}${LIBDIR_BASE}/libform.a
+LIBFORMW?= ${LIBDESTDIR}${LIBDIR_BASE}/libformw.a
 LIBG2C?=   ${LIBDESTDIR}${LIBDIR_BASE}/libg2c.a
 LIBGEOM?=  ${LIBDESTDIR}${LIBDIR_BASE}/libgeom.a
 LIBGPIO?=  ${LIBDESTDIR}${LIBDIR_BASE}/libgpio.a



git: f1d2f22b34ab - stable/13 - pca954x: driver for PCA954x / TCA954x I2C switches

2021-11-24 Thread Andriy Gapon
The branch stable/13 has been updated by avg:

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

commit f1d2f22b34ab6c7216fcc980c57b60d5ef8f21d2
Author: Andriy Gapon 
AuthorDate: 2020-08-18 09:16:28 +
Commit: Andriy Gapon 
CommitDate: 2021-11-24 14:19:09 +

pca954x: driver for PCA954x / TCA954x I2C switches

At the moment only PCA9548A is supported and has been tested.

(cherry picked from commit c0525ab1d1ce69ab3d589e95733caedb04e0dcbd)
---
 share/man/man4/Makefile  |   1 +
 share/man/man4/pca954x.4 | 119 +++
 sys/conf/files   |   1 +
 sys/dev/iicbus/mux/pca954x.c | 214 +++
 sys/modules/i2c/mux/Makefile |   1 +
 sys/modules/i2c/mux/pca954x/Makefile |  20 
 6 files changed, 356 insertions(+)

diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index e8c0a5651ff8..be66bf02e9f7 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -422,6 +422,7 @@ MAN=aac.4 \
owc.4 \
${_padlock.4} \
pass.4 \
+   pca954x.4 \
pccard.4 \
pccbb.4 \
pcf.4 \
diff --git a/share/man/man4/pca954x.4 b/share/man/man4/pca954x.4
new file mode 100644
index ..d845740f9b6c
--- /dev/null
+++ b/share/man/man4/pca954x.4
@@ -0,0 +1,119 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2020 Andriy Gapon 
+.\"
+.\" 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd November 13, 2021
+.Dt PCA954X 4
+.Os
+.Sh NAME
+.Nm pca954x
+.Nd driver for PCA9548A I2C switch
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device pca954x"
+.Cd "device iicmux"
+.Cd "device iicbus"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+pca954x_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver supports the PCA9548A I2C bus switch and compatible chips such as
+TCA9548A.
+It automatically connects an upstream I2C bus to one of several downstream
+buses as needed when slave devices on the downstream buses initiate I/O.
+More information on the automatic switching behavior is available in
+.Xr iicmux 4 .
+.Sh FDT CONFIGURATION
+On an
+.Xr FDT 4
+based system, an
+.Nm
+device node is defined as a child node of its upstream I2C bus.
+The children of the
+.Nm
+node are additional I2C buses, which will have their own I2C slave
+devices described in their child nodes.
+.Pp
+The
+.Nm
+driver attaches to nodes where the
+.Va compatible
+property is set to one of
+.Bl -bullet
+.It
+.Qq nxp,pca9548
+.El
+.Pp
+The
+.Nm
+driver supports the following optional properties in addition to the standard
+I2C mux properties:
+.Bl -tag -width i2c-mux-idle-disconnect
+.It Va i2c-mux-idle-disconnect
+if defined, forces the switch to disconnect all children in idle state.
+.El
+.Sh HINTS CONFIGURATION
+On a
+.Xr device.hints 5
+based system, these values are configurable for
+.Nm :
+.Bl -tag -width hint.pca954x..chip_type
+.It Va hint.pca954x..at
+The upstream
+.Xr iicbus 4
+the
+.Nm
+instance is attached to.
+.It Va hint.pca954x..chip_type
+The type of the chip.
+At present, only
+.Qq pca9548
+is supported.
+.El
+.Pp
+When configured via hints, the driver automatically adds an
+.Xr iicbus 4
+instance for every downstream bus supported by the chip.
+There is currently no way to indicate used versus unused channels.
+.Sh SEE ALSO
+.Xr iicbus 4 ,
+.Xr iicmux 4
+.Sh HISTORY
+The
+.Nm
+driver and this manual page 

Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables

2021-11-24 Thread Slawa Olhovchenkov
On Tue, Nov 16, 2021 at 10:26:42PM +, Marcin Wojtas wrote:

> 
> Enable ASLR by default for 64-bit executables
> 

Now any core dumps will be useless?



git: 169e06fa7852 - main - os-release: Quote variables as documented in the manual

2021-11-24 Thread Mateusz Piotrowski
The branch main has been updated by 0mp (doc, ports committer):

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

commit 169e06fa7852810f4ced2cce7a3c14ca9443bf39
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-23 10:26:47 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 15:17:01 +

os-release: Quote variables as documented in the manual

Variables must be quoted if they contain non-alphanumeric characters.

Warner noted in the review that the lack of quoting causing problems
here is rather an edge case. I believe that it's worth adding the quotes
here anyway because this is what the specification says and there is no
good reason not to follow it.

Reviewed by:imp
Approved by:imp (src)
MFC after:  7 days
---
 libexec/rc/rc.d/os-release | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libexec/rc/rc.d/os-release b/libexec/rc/rc.d/os-release
index c328e161a70e..16f8cb178db8 100755
--- a/libexec/rc/rc.d/os-release
+++ b/libexec/rc/rc.d/os-release
@@ -27,14 +27,14 @@ osrelease_start()
t=$(mktemp -t os-release)
cat > "$t" <<-__EOF__
NAME=FreeBSD
-   VERSION=$_version
-   VERSION_ID=$_version_id
+   VERSION="$_version"
+   VERSION_ID="$_version_id"
ID=freebsd
ANSI_COLOR="0;31"
PRETTY_NAME="FreeBSD $_version"
-   CPE_NAME=cpe:/o:freebsd:freebsd:$_version_id
-   HOME_URL=https://FreeBSD.org/
-   BUG_REPORT_URL=https://bugs.FreeBSD.org/
+   CPE_NAME="cpe:/o:freebsd:freebsd:$_version_id"
+   HOME_URL="https://FreeBSD.org/";
+   BUG_REPORT_URL="https://bugs.FreeBSD.org/";
 __EOF__
install -C -o root -g wheel -m ${osrelease_perms} "$t" 
"${osrelease_file}"
rm -f "$t"



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Bjoern A. Zeeb

On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:


On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:


On Wed, 24 Nov 2021, Baptiste Daroussin wrote:


The branch main has been updated by bapt:

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


commit a46722b580567799b484b5a81728eaf380777e04
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:20:10 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:02:22 +

   ncurses: register formw as usable lib for LIBADD


is LIBFORM to be LIBFORMW or do we need another new entry?

  1393 make[7]: "share/mk/bsd.libnames.mk" line 190: lib/ncurses/form: 
Missing value for LIBFORMW in bsd.libnames.mk.  Likely should be: 
LIBFORMW?= ${LIBDESTDIR}${LIBDIR_BASE}/libformw.a



and later still:

  6315 ld: error: unable to find library -lformw
  6316 cc: error: linker command failed with exit code 1 (use -v to see 
invocation)

  6317 --- libprivatebsddialog.so.0.full ---
  6318 *** [libprivatebsddialog.so.0.full] Error code 1


@ 848ee2a3a8b47c9905fc51fefcf60eb371edbb98


I've locally fixed this (it seems) like this for now:

diff --git a/Makefile.inc1 b/Makefile.inc1
index d8f50cf77d4b..620d9f239b6e 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2943,6 +2943,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
${_lib_casper} \
lib/ncurses/tinfo \
lib/ncurses/ncurses \
+   lib/ncurses/form \
lib/libopie lib/libpam/libpam lib/libthr \
${_lib_libradius} lib/libsbuf lib/libtacplus \
lib/libgeom \
@@ -2982,6 +2983,7 @@ _lib_libradius=   lib/libradius
 .endif

 lib/ncurses/ncurses__L:lib/ncurses/tinfo__L
+lib/ncurses/form__L:   lib/ncurses/ncurses__L

 .if ${MK_OFED} != "no"
 _prebuild_libs+= \


--
Bjoern A. Zeeb r15:7



git: dd978721a223 - main - Remove redundant declarations

2021-11-24 Thread Andrew Turner
The branch main has been updated by andrew:

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

commit dd978721a223e3f9d35a7be5407c52a281fcec8f
Author: Andrew Turner 
AuthorDate: 2021-11-23 17:26:35 +
Commit: Andrew Turner 
CommitDate: 2021-11-24 15:31:50 +

Remove redundant declarations

These are already defined in the same file.

Sponsored by:   The FreeBSD Foundation
---
 sys/arm64/rockchip/clk/rk_clk_fract.c | 3 ---
 sys/arm64/rockchip/rk_pcie_phy.c  | 1 -
 2 files changed, 4 deletions(-)

diff --git a/sys/arm64/rockchip/clk/rk_clk_fract.c 
b/sys/arm64/rockchip/clk/rk_clk_fract.c
index afdf56cfade7..2b347db91790 100644
--- a/sys/arm64/rockchip/clk/rk_clk_fract.c
+++ b/sys/arm64/rockchip/clk/rk_clk_fract.c
@@ -179,9 +179,6 @@ rk_clk_fract_set_gate(struct clknode *clk, bool enable)
return (0);
 }
 
-static int
-rk_clk_fract_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout,
-int flags, int *stop);
 static int
 rk_clk_fract_recalc(struct clknode *clk, uint64_t *freq)
 {
diff --git a/sys/arm64/rockchip/rk_pcie_phy.c b/sys/arm64/rockchip/rk_pcie_phy.c
index eaa7619e15c3..d01aa930906b 100644
--- a/sys/arm64/rockchip/rk_pcie_phy.c
+++ b/sys/arm64/rockchip/rk_pcie_phy.c
@@ -252,7 +252,6 @@ rk_pcie_phy_enable(struct phynode *phynode, bool enable)
 }
 
 /* Phy class and methods. */
-static int rk_pcie_phy_enable(struct phynode *phynode, bool enable);
 static phynode_method_t rk_pcie_phy_phynode_methods[] = {
PHYNODEMETHOD(phynode_enable,rk_pcie_phy_enable),
 



git: 3ff041945054 - main - Fix bracketing in the arm64 minidump code

2021-11-24 Thread Andrew Turner
The branch main has been updated by andrew:

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

commit 3ff041945054e692672f506a2448d1200133032d
Author: Andrew Turner 
AuthorDate: 2021-11-23 18:28:28 +
Commit: Andrew Turner 
CommitDate: 2021-11-24 15:31:56 +

Fix bracketing in the arm64 minidump code

When building with gcc10 it suggests the parentheses are wrong. Set them
to be the calculated physical address or'd with page table attributes.

Reviewed by:mhorne, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33099
---
 sys/arm64/arm64/minidump_machdep.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/arm64/arm64/minidump_machdep.c 
b/sys/arm64/arm64/minidump_machdep.c
index 8383d69fc5f8..ac5a7b271b85 100644
--- a/sys/arm64/arm64/minidump_machdep.c
+++ b/sys/arm64/arm64/minidump_machdep.c
@@ -303,8 +303,8 @@ cpu_minidumpsys(struct dumperinfo *di, const struct 
minidumpstate *state)
 
for (i = 0; i < Ln_ENTRIES; i++) {
for (j = 0; j < Ln_ENTRIES; j++) {
-   tmpbuffer[j] = pa + i * L2_SIZE +
-   j * PAGE_SIZE | ATTR_DEFAULT |
+   tmpbuffer[j] = (pa + i * L2_SIZE +
+   j * PAGE_SIZE) | ATTR_DEFAULT |
L3_PAGE;
}
error = blk_write(di, (char *)&tmpbuffer, 0,
@@ -323,7 +323,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct 
minidumpstate *state)
 
/* Generate fake l3 entries based upon the l1 entry */
for (i = 0; i < Ln_ENTRIES; i++) {
-   tmpbuffer[i] = pa + (i * PAGE_SIZE) |
+   tmpbuffer[i] = (pa + i * PAGE_SIZE) |
ATTR_DEFAULT | L3_PAGE;
}
error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE);



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Kyle Evans
On Wed, Nov 24, 2021 at 9:34 AM Bjoern A. Zeeb
 wrote:
>
> On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:
>
> > On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:
> >
> >> On Wed, 24 Nov 2021, Baptiste Daroussin wrote:
> >>
> >>> The branch main has been updated by bapt:
> >>>
> >>> URL:
> >>> https://cgit.FreeBSD.org/src/commit/?id=a46722b580567799b484b5a81728eaf380777e04
> >>>
> >>> commit a46722b580567799b484b5a81728eaf380777e04
> >>> Author: Baptiste Daroussin 
> >>> AuthorDate: 2021-11-24 09:20:10 +
> >>> Commit: Baptiste Daroussin 
> >>> CommitDate: 2021-11-24 10:02:22 +
> >>>
> >>>ncurses: register formw as usable lib for LIBADD
> >>
> >> is LIBFORM to be LIBFORMW or do we need another new entry?
> >>
> >>   1393 make[7]: "share/mk/bsd.libnames.mk" line 190: lib/ncurses/form:
> >> Missing value for LIBFORMW in bsd.libnames.mk.  Likely should be:
> >> LIBFORMW?= ${LIBDESTDIR}${LIBDIR_BASE}/libformw.a
> >
> >
> > and later still:
> >
> >   6315 ld: error: unable to find library -lformw
> >   6316 cc: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> >   6317 --- libprivatebsddialog.so.0.full ---
> >   6318 *** [libprivatebsddialog.so.0.full] Error code 1
> >
> >
> > @ 848ee2a3a8b47c9905fc51fefcf60eb371edbb98
>
> I've locally fixed this (it seems) like this for now:
>
> diff --git a/Makefile.inc1 b/Makefile.inc1
> index d8f50cf77d4b..620d9f239b6e 100644
> --- a/Makefile.inc1
> +++ b/Makefile.inc1
> @@ -2943,6 +2943,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
>  ${_lib_casper} \
>  lib/ncurses/tinfo \
>  lib/ncurses/ncurses \
> +   lib/ncurses/form \
>  lib/libopie lib/libpam/libpam lib/libthr \
>  ${_lib_libradius} lib/libsbuf lib/libtacplus \
>  lib/libgeom \
> @@ -2982,6 +2983,7 @@ _lib_libradius=   lib/libradius
>   .endif
>
>   lib/ncurses/ncurses__L:lib/ncurses/tinfo__L
> +lib/ncurses/form__L:   lib/ncurses/ncurses__L
>
>   .if ${MK_OFED} != "no"
>   _prebuild_libs+= \
>

I would also add a SUBDIR_DEPEND_form in lib/ncurses/Makefile to
reflect this dependency for local builds of lib/ncurses, but
otherwise:

Reviewed by: Kyle Evans 



git: 5abafe4aa0b8 - main - bsddialog, mark the lib as dependent on ncurses

2021-11-24 Thread Baptiste Daroussin
The branch main has been updated by bapt:

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

commit 5abafe4aa0b82a3ce96425b016641324c290a8b4
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 15:47:39 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 15:48:44 +

bsddialog, mark the lib as dependent on ncurses
---
 lib/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/Makefile b/lib/Makefile
index 3af6b938ee74..2cba5feaee19 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -117,6 +117,7 @@ SUBDIR_DEPEND_geom= libufs
 SUBDIR_DEPEND_googletest= libregex
 SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
 SUBDIR_DEPEND_libauditdm= libbsm
+SUBDIR_DEPEND_libbsddialog= ncurses
 SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
 SUBDIR_DEPEND_libc++:= libcxxrt
 # libssp_nonshared doesn't need to be linked into libc on every arch, but it is



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Baptiste Daroussin
On Wed, Nov 24, 2021 at 03:34:02PM +, Bjoern A. Zeeb wrote:
> On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:
> 
> > On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:
> > 
> > > On Wed, 24 Nov 2021, Baptiste Daroussin wrote:
> > > 
> > > > The branch main has been updated by bapt:
> > > > 
> > > > URL: 
> > > > https://cgit.FreeBSD.org/src/commit/?id=a46722b580567799b484b5a81728eaf380777e04
> > > > 
> > > > commit a46722b580567799b484b5a81728eaf380777e04
> > > > Author: Baptiste Daroussin 
> > > > AuthorDate: 2021-11-24 09:20:10 +
> > > > Commit: Baptiste Daroussin 
> > > > CommitDate: 2021-11-24 10:02:22 +
> > > > 
> > > >ncurses: register formw as usable lib for LIBADD
> > > 
> > > is LIBFORM to be LIBFORMW or do we need another new entry?
> > > 
> > >   1393 make[7]: "share/mk/bsd.libnames.mk" line 190:
> > > lib/ncurses/form: Missing value for LIBFORMW in bsd.libnames.mk.
> > > Likely should be: LIBFORMW?= ${LIBDESTDIR}${LIBDIR_BASE}/libformw.a
> > 
> > 
> > and later still:
> > 
> >   6315 ld: error: unable to find library -lformw
> >   6316 cc: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> >   6317 --- libprivatebsddialog.so.0.full ---
> >   6318 *** [libprivatebsddialog.so.0.full] Error code 1
> > 
> > 
> > @ 848ee2a3a8b47c9905fc51fefcf60eb371edbb98
> 
> I've locally fixed this (it seems) like this for now:
> 
> diff --git a/Makefile.inc1 b/Makefile.inc1
> index d8f50cf77d4b..620d9f239b6e 100644
> --- a/Makefile.inc1
> +++ b/Makefile.inc1
> @@ -2943,6 +2943,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
> ${_lib_casper} \
> lib/ncurses/tinfo \
> lib/ncurses/ncurses \
> +   lib/ncurses/form \
> lib/libopie lib/libpam/libpam lib/libthr \
> ${_lib_libradius} lib/libsbuf lib/libtacplus \
> lib/libgeom \
> @@ -2982,6 +2983,7 @@ _lib_libradius=   lib/libradius
>  .endif
> 
>  lib/ncurses/ncurses__L:lib/ncurses/tinfo__L
> +lib/ncurses/form__L:   lib/ncurses/ncurses__L
> 
>  .if ${MK_OFED} != "no"
>  _prebuild_libs+= \
> 

I think it should be fixed, I don't think it is necessary to add it to the
prebuild_libs

Best regards,
Bapt



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Baptiste Daroussin
On Wed, Nov 24, 2021 at 09:43:22AM -0600, Kyle Evans wrote:
> On Wed, Nov 24, 2021 at 9:34 AM Bjoern A. Zeeb
>  wrote:
> >
> > On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:
> >
> > > On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:
> > >
> > >> On Wed, 24 Nov 2021, Baptiste Daroussin wrote:
> > >>
> > >>> The branch main has been updated by bapt:
> > >>>
> > >>> URL:
> > >>> https://cgit.FreeBSD.org/src/commit/?id=a46722b580567799b484b5a81728eaf380777e04
> > >>>
> > >>> commit a46722b580567799b484b5a81728eaf380777e04
> > >>> Author: Baptiste Daroussin 
> > >>> AuthorDate: 2021-11-24 09:20:10 +
> > >>> Commit: Baptiste Daroussin 
> > >>> CommitDate: 2021-11-24 10:02:22 +
> > >>>
> > >>>ncurses: register formw as usable lib for LIBADD
> > >>
> > >> is LIBFORM to be LIBFORMW or do we need another new entry?
> > >>
> > >>   1393 make[7]: "share/mk/bsd.libnames.mk" line 190: lib/ncurses/form:
> > >> Missing value for LIBFORMW in bsd.libnames.mk.  Likely should be:
> > >> LIBFORMW?= ${LIBDESTDIR}${LIBDIR_BASE}/libformw.a
> > >
> > >
> > > and later still:
> > >
> > >   6315 ld: error: unable to find library -lformw
> > >   6316 cc: error: linker command failed with exit code 1 (use -v to see
> > > invocation)
> > >   6317 --- libprivatebsddialog.so.0.full ---
> > >   6318 *** [libprivatebsddialog.so.0.full] Error code 1
> > >
> > >
> > > @ 848ee2a3a8b47c9905fc51fefcf60eb371edbb98
> >
> > I've locally fixed this (it seems) like this for now:
> >
> > diff --git a/Makefile.inc1 b/Makefile.inc1
> > index d8f50cf77d4b..620d9f239b6e 100644
> > --- a/Makefile.inc1
> > +++ b/Makefile.inc1
> > @@ -2943,6 +2943,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
> >  ${_lib_casper} \
> >  lib/ncurses/tinfo \
> >  lib/ncurses/ncurses \
> > +   lib/ncurses/form \
> >  lib/libopie lib/libpam/libpam lib/libthr \
> >  ${_lib_libradius} lib/libsbuf lib/libtacplus \
> >  lib/libgeom \
> > @@ -2982,6 +2983,7 @@ _lib_libradius=   lib/libradius
> >   .endif
> >
> >   lib/ncurses/ncurses__L:lib/ncurses/tinfo__L
> > +lib/ncurses/form__L:   lib/ncurses/ncurses__L
> >
> >   .if ${MK_OFED} != "no"
> >   _prebuild_libs+= \
> >
> 
> I would also add a SUBDIR_DEPEND_form in lib/ncurses/Makefile to
> reflect this dependency for local builds of lib/ncurses, but
> otherwise:
> 
it is already there the SUBDIR_DEPEND

Bapt



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Bjoern A. Zeeb

On Wed, 24 Nov 2021, Baptiste Daroussin wrote:


On Wed, Nov 24, 2021 at 03:34:02PM +, Bjoern A. Zeeb wrote:

On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:


On Wed, 24 Nov 2021, Bjoern A. Zeeb wrote:


On Wed, 24 Nov 2021, Baptiste Daroussin wrote:


The branch main has been updated by bapt:

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

commit a46722b580567799b484b5a81728eaf380777e04
Author: Baptiste Daroussin 
AuthorDate: 2021-11-24 09:20:10 +
Commit: Baptiste Daroussin 
CommitDate: 2021-11-24 10:02:22 +

   ncurses: register formw as usable lib for LIBADD


is LIBFORM to be LIBFORMW or do we need another new entry?

  1393 make[7]: "share/mk/bsd.libnames.mk" line 190:
lib/ncurses/form: Missing value for LIBFORMW in bsd.libnames.mk.
Likely should be: LIBFORMW?= ${LIBDESTDIR}${LIBDIR_BASE}/libformw.a



and later still:

  6315 ld: error: unable to find library -lformw
  6316 cc: error: linker command failed with exit code 1 (use -v to see
invocation)
  6317 --- libprivatebsddialog.so.0.full ---
  6318 *** [libprivatebsddialog.so.0.full] Error code 1


@ 848ee2a3a8b47c9905fc51fefcf60eb371edbb98


I've locally fixed this (it seems) like this for now:

diff --git a/Makefile.inc1 b/Makefile.inc1
index d8f50cf77d4b..620d9f239b6e 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2943,6 +2943,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
${_lib_casper} \
lib/ncurses/tinfo \
lib/ncurses/ncurses \
+   lib/ncurses/form \
lib/libopie lib/libpam/libpam lib/libthr \
${_lib_libradius} lib/libsbuf lib/libtacplus \
lib/libgeom \
@@ -2982,6 +2983,7 @@ _lib_libradius=   lib/libradius
 .endif

 lib/ncurses/ncurses__L:lib/ncurses/tinfo__L
+lib/ncurses/form__L:   lib/ncurses/ncurses__L

 .if ${MK_OFED} != "no"
 _prebuild_libs+= \



I think it should be fixed, I don't think it is necessary to add it to the
prebuild_libs



I just saw it flying in;  thanks a lot!   I had just used a hammer.

--
Bjoern A. Zeeb r15:7



git: f69572733023 - stable/13 - Export symbols from opensolaris.ko and dtrace.ko

2021-11-24 Thread Mark Johnston
The branch stable/13 has been updated by markj:

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

commit f69572733023aa8017bddc5bed24358d3bc14847
Author: Mark Johnston 
AuthorDate: 2021-11-17 16:01:59 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 15:55:37 +

Export symbols from opensolaris.ko and dtrace.ko

Both modules provide many symbols used by various DTrace provider
modules, so just export everything.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 8a693ccf86f90469910c5b2425ddb8a75e298487)
---
 sys/modules/dtrace/dtrace/Makefile | 4 +---
 sys/modules/opensolaris/Makefile   | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sys/modules/dtrace/dtrace/Makefile 
b/sys/modules/dtrace/dtrace/Makefile
index 55f9f4f66f36..712e10331a38 100644
--- a/sys/modules/dtrace/dtrace/Makefile
+++ b/sys/modules/dtrace/dtrace/Makefile
@@ -49,9 +49,7 @@ CFLAGS+=  -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/common/util \
-I${SYSDIR} -DDIS_MEM
 
-EXPORT_SYMS=   dtrace_register \
-   dtrace_unregister \
-   dtrace_probe_lookup
+EXPORT_SYMS=   YES
 
 dtrace_asm.o:  assym.inc
 
diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile
index 536b9637cd3c..7010485b0ee7 100644
--- a/sys/modules/opensolaris/Makefile
+++ b/sys/modules/opensolaris/Makefile
@@ -27,7 +27,7 @@ SRCS+=opensolaris_atomic.c
 
 CFLAGS+=   ${OPENZFS_CFLAGS}
 
-EXPORT_SYMS=   cpu_core
+EXPORT_SYMS=   YES
 
 IGNORE_PRAGMA= 1
 



git: 615b3385c990 - stable/13 - top: Sort flags in usage message

2021-11-24 Thread Mateusz Piotrowski
The branch stable/13 has been updated by 0mp (doc, ports committer):

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

commit 615b3385c9906a2f476ff3962639c41b1c61b321
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 13:21:34 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:03:37 +

top: Sort flags in usage message

While here, fix the indentation of the second line in the message.

MFC after:  3 days

(cherry picked from commit 82d0f865ee9a93213876c14342b147e31b7ade0d)
---
 usr.bin/top/top.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 08248911e99a..68b7bdf1dfb5 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -465,8 +465,8 @@ main(int argc, const char *argv[])
 
  default:
errx(1, 
-"[-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-p pid]\n"
-"   [-s time] [-J jail] [-U username] [number]");
+"[-abCHIijnPqStuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n"
+" [-p pid] [-s time] [-U username] [number]");
}
}
 



git: 6d20d6e5d887 - stable/12 - top: Sort flags in usage message

2021-11-24 Thread Mateusz Piotrowski
The branch stable/12 has been updated by 0mp (doc, ports committer):

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

commit 6d20d6e5d887221d8b5cfd6322995560add6b999
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 13:21:34 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:04:15 +

top: Sort flags in usage message

While here, fix the indentation of the second line in the message.

MFC after:  3 days

(cherry picked from commit 82d0f865ee9a93213876c14342b147e31b7ade0d)
---
 usr.bin/top/top.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 4b624aacb6b0..50e199ba71d0 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -459,8 +459,8 @@ main(int argc, const char *argv[])
 
  default:
errx(1, 
-"[-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-p pid]\n"
-"   [-s time] [-J jail] [-U username] [number]");
+"[-abCHIijnPqStuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n"
+" [-p pid] [-s time] [-U username] [number]");
}
}
 



Re: git: 2eb2079554f4 - main - bhyve: keep physical and virtual COMMAND reg in sync

2021-11-24 Thread John Baldwin

On 11/24/21 4:00 AM, Corvin Köhne wrote:

Hi John,


Would you be able to test if that change works in your environment?  I was
never able to confirm that it fixed the bug I was trying to address, but I
do think it is more correct.  The busmastering thing is to work around Linux
clearing that flag on shutdown of a guest, and I wanted to preserve other
bits in the command register that weren't related to BARs, etc.


The change works in my environment. As you have mentioned, my Linux guest
clears the busmastering bit on shutdown. However, in my opinion we should
initialize the command register bits in the same way as a real system does.

I took a short look into a public available PCI specification
(https://www.ics.uci.edu/~harris/ics216/pci/PCI_22.pdf).
For busmastering (and also for IO/Mem decoding) it states that it's default 
value
is 0. Therefore, I'd prefer to unconditionally clear those bits on startup.


While it's true that real systems do that on reset, most firmware set those bits
while populating BARs.  Bhyve doesn't always run boot firmware to do those tasks
and needs to provide working devices out of the box.  This is similar to how
bhyve pre-populates BARs with resources rather than relying on firmware to
assign resources to BARs.

--
John Baldwin



git: cd66a1b1c8c5 - stable/13 - top.1: Sort options alphabetically

2021-11-24 Thread Mateusz Piotrowski
The branch stable/13 has been updated by 0mp (doc, ports committer):

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

commit cd66a1b1c8c5afb995e13534e4c818a5df78013e
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 13:11:23 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:07:02 +

top.1: Sort options alphabetically

While here, add a short sentence introducing the options.

MFC after:  3 days

(cherry picked from commit 112539041590259a9d1e34999a80dc607c69f4db)
---
 usr.bin/top/top.1 | 155 +++---
 1 file changed, 77 insertions(+), 78 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index 42282bebdafe..f435cfe5e206 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -7,14 +7,14 @@
 .Nd display and update information about the top cpu processes
 .Sh SYNOPSIS
 .Nm
-.Op Fl CHIPSTabijnpqtuvxz
-.Op Fl J Ar jail
-.Op Fl U Ar uid
+.Op Fl abCHIijnPpqSTtuvxz
 .Op Fl d Ar count
+.Op Fl J Ar jail
 .Op Fl m Ar cpu|io
-.Op Fl s Ar time
 .Op Fl o Ar field
 .Op Fl p Ar pid
+.Op Fl s Ar time
+.Op Fl U Ar uid
 .Op Ar number
 .Sh DESCRIPTION
 .Nm
@@ -43,22 +43,9 @@ If the output of
 .Nm
 is redirected to a file, it acts as if it were being run on a dumb
 terminal.
-.Bl -tag -width indent -compact
-.It Fl C
-Toggle CPU display mode.
-By default top displays the weighted CPU percentage in the WCPU column
-(this is the same value that
-.Xr ps 1
-displays as CPU).
-Each time
-.Fl C
-flag is passed it toggles between \*(lqraw cpu\*(rq mode
-and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
-the \*(lqWCPU\*(rq column respectively.
-.It Fl S
-Show system processes in the display.
-Normally, system processes such as the pager and the swapper are not shown.
-This option makes them visible.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
 .It Fl a
 Display command names derived from the argv[] vector, rather than real
 executable name.
@@ -75,9 +62,34 @@ In this mode, all input from the terminal is
 ignored.
 Interrupt characters (such as ^C and ^\e) still have an effect.
 This is the default on a dumb terminal, or when the output is not a terminal.
+.It Fl C
+Toggle CPU display mode.
+By default top displays the weighted CPU percentage in the WCPU column
+(this is the same value that
+.Xr ps 1
+displays as CPU).
+Each time
+.Fl C
+flag is passed it toggles between \*(lqraw cpu\*(rq mode
+and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
+the \*(lqWCPU\*(rq column respectively.
+.It Fl d Ar count
+Show only
+.Ar count
+displays, then exit.
+A display is considered to be one update of the
+screen.
+The default is 1 for dumb terminals.
+Note that for
+.Ar count
+= 1
+no information is available about the percentage of time spent by the CPU in 
every state.
 .It Fl H
 Display each thread for a multithreaded process individually.
 By default a single summary line is displayed for each process.
+.It Fl I
+Do not display idle processes.
+By default, top displays both active and idle processes.
 .It Fl i
 Use \*(lqinteractive\*(rq mode.
 In this mode, any input is immediately
@@ -90,19 +102,23 @@ screen will immediately be updated, even if the command 
was not
 understood.
 This mode is the default when standard output is an
 intelligent terminal.
-.It Fl I
-Do not display idle processes.
-By default, top displays both active and idle processes.
+.It Fl J Ar jail
+Show only those processes owned by
+.Ar jail .
+This may be either the
+.Ar jid
+or
+.Ar name
+of the jail.
+Use
+0
+to limit to host processes.
+Using this option implies
+.Fl j .
 .It Fl j
 Display the
 .Xr jail 8
 ID.
-.It Fl T
-Toggle displaying thread ID (tid) instead of process id (pid).
-.It Fl t
-Do not display the
-.Nm
-process itself.
 .It Fl m Ar display
 Display either 'cpu' or 'io' statistics.
 Default is 'cpu'.
@@ -110,8 +126,19 @@ Default is 'cpu'.
 Use \*(lqnon-interactive\*(rq mode.
 This is identical to \*(lqbatch\*(rq
 mode.
+.It Fl o Ar field
+Sort the process display area on the specified field.
+The field name
+is the name of the column as seen in the output, but in lower case:
+\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq,
+\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq,
+\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq,
+\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq.
 .It Fl P
 Display per-cpu CPU usage statistics.
+.It Fl p Ar pid
+Show only the process
+.Ar pid .
 .It Fl q
 Renice
 .Nm
@@ -119,6 +146,26 @@ to -20 so that it will run faster.
 This can be used when the system is
 being very sluggish to improve the possibility of discovering the problem.
 This option can only be used by root.
+.It Fl S
+Show system processes in the display.
+Normally, system processes such as the pager and the swapper are not shown.
+This option makes them visible.
+.It Fl s Ar time
+Set the

git: 5f3b6ce64f99 - stable/13 - top.1: Fix a typo in description of H interactive command

2021-11-24 Thread Mateusz Piotrowski
The branch stable/13 has been updated by 0mp (doc, ports committer):

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

commit 5f3b6ce64f99b110f2ba7595c7d680b843efc3e8
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 12:50:56 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:09:31 +

top.1: Fix a typo in description of H interactive command

B is listed as an interactive command to toggle the display of threads.
This is a typo introduced during the conversion of the manual page to
mdoc.

Fixes:  9d6cce02a78c967e69b603d503545c4b43d7765f
MFC after:  3 days

(cherry picked from commit b8135ed67ce86e40fa7b46653ff54c769f2e7c98)
---
 usr.bin/top/top.1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index f435cfe5e206..5989831fe8a9 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.Dd September 21, 2019
+.Dd November 18, 2021
 .Dt TOP 1
 .Os
 .Sh NAME
@@ -286,7 +286,7 @@ If the pid specified is simply \*(lq+\*(rq, then show all 
processes.
 .It e
 Display a list of system errors (if any) generated by the last
 command.
-.It B H
+.It H
 Toggle the display of threads.
 .It i or I
 Toggle the display of idle processes.



git: 745ffe0ee867 - stable/13 - top.1: Improve description of -m

2021-11-24 Thread Mateusz Piotrowski
The branch stable/13 has been updated by 0mp (doc, ports committer):

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

commit 745ffe0ee86751541867e90af262ac355d061827
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 14:31:48 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:10:04 +

top.1: Improve description of -m

Describe -m argument as "mode" instead of "display".

MFC after:  3 days

(cherry picked from commit c947fc5fae31c5935a57abcaa76f40fc8950ce59)
---
 usr.bin/top/top.1 | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index 5989831fe8a9..892ee8307e27 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -10,7 +10,7 @@
 .Op Fl abCHIijnPpqSTtuvxz
 .Op Fl d Ar count
 .Op Fl J Ar jail
-.Op Fl m Ar cpu|io
+.Op Fl m Ar mode
 .Op Fl o Ar field
 .Op Fl p Ar pid
 .Op Fl s Ar time
@@ -119,9 +119,15 @@ Using this option implies
 Display the
 .Xr jail 8
 ID.
-.It Fl m Ar display
-Display either 'cpu' or 'io' statistics.
-Default is 'cpu'.
+.It Fl m Ar mode
+Display statistics in the specified
+.Ar mode .
+Available modes are
+.Cm cpu
+and
+.Cm io .
+Default is
+.Cm cpu .
 .It Fl n
 Use \*(lqnon-interactive\*(rq mode.
 This is identical to \*(lqbatch\*(rq



git: 14454e662a6b - stable/12 - top.1: Fix a typo in description of H interactive command

2021-11-24 Thread Mateusz Piotrowski
The branch stable/12 has been updated by 0mp (doc, ports committer):

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

commit 14454e662a6b3fd6e4b4cf2261132efd6dd231d3
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 12:50:56 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:09:02 +

top.1: Fix a typo in description of H interactive command

B is listed as an interactive command to toggle the display of threads.
This is a typo introduced during the conversion of the manual page to
mdoc.

Fixes:  9d6cce02a78c967e69b603d503545c4b43d7765f
MFC after:  3 days

(cherry picked from commit b8135ed67ce86e40fa7b46653ff54c769f2e7c98)
---
 usr.bin/top/top.1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index e70c3c022d43..1f0be330ddc8 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.Dd October 2, 2018
+.Dd November 18, 2021
 .Dt TOP 1
 .Os
 .Sh NAME
@@ -283,7 +283,7 @@ If the pid specified is simply \*(lq+\*(rq, then show all 
processes.
 .It e
 Display a list of system errors (if any) generated by the last
 command.
-.It B H
+.It H
 Toggle the display of threads.
 .It i or I
 Toggle the display of idle processes.



git: a9bfcefbdb6b - stable/12 - top.1: Sort options alphabetically

2021-11-24 Thread Mateusz Piotrowski
The branch stable/12 has been updated by 0mp (doc, ports committer):

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

commit a9bfcefbdb6bc58949292c505aad98b35d57c897
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 13:11:23 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:07:12 +

top.1: Sort options alphabetically

While here, add a short sentence introducing the options.

MFC after:  3 days

(cherry picked from commit 112539041590259a9d1e34999a80dc607c69f4db)
---
 usr.bin/top/top.1 | 155 +++---
 1 file changed, 77 insertions(+), 78 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index 104b979abd00..e70c3c022d43 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -7,14 +7,14 @@
 .Nd display and update information about the top cpu processes
 .Sh SYNOPSIS
 .Nm
-.Op Fl CHIPSTabijnpqtuvxz
-.Op Fl J Ar jail
-.Op Fl U Ar uid
+.Op Fl abCHIijnPpqSTtuvxz
 .Op Fl d Ar count
+.Op Fl J Ar jail
 .Op Fl m Ar cpu|io
-.Op Fl s Ar time
 .Op Fl o Ar field
 .Op Fl p Ar pid
+.Op Fl s Ar time
+.Op Fl U Ar uid
 .Op Ar number
 .Sh DESCRIPTION
 .Nm
@@ -43,22 +43,9 @@ If the output of
 .Nm
 is redirected to a file, it acts as if it were being run on a dumb
 terminal.
-.Bl -tag -width indent -compact
-.It Fl C
-Toggle CPU display mode.
-By default top displays the weighted CPU percentage in the WCPU column
-(this is the same value that
-.Xr ps 1
-displays as CPU).
-Each time
-.Fl C
-flag is passed it toggles between \*(lqraw cpu\*(rq mode
-and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
-the \*(lqWCPU\*(rq column respectively.
-.It Fl S
-Show system processes in the display.
-Normally, system processes such as the pager and the swapper are not shown.
-This option makes them visible.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
 .It Fl a
 Display command names derived from the argv[] vector, rather than real
 executable name.
@@ -72,9 +59,34 @@ In this mode, all input from the terminal is
 ignored.
 Interrupt characters (such as ^C and ^\e) still have an effect.
 This is the default on a dumb terminal, or when the output is not a terminal.
+.It Fl C
+Toggle CPU display mode.
+By default top displays the weighted CPU percentage in the WCPU column
+(this is the same value that
+.Xr ps 1
+displays as CPU).
+Each time
+.Fl C
+flag is passed it toggles between \*(lqraw cpu\*(rq mode
+and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
+the \*(lqWCPU\*(rq column respectively.
+.It Fl d Ar count
+Show only
+.Ar count
+displays, then exit.
+A display is considered to be one update of the
+screen.
+The default is 1 for dumb terminals.
+Note that for
+.Ar count
+= 1
+no information is available about the percentage of time spent by the CPU in 
every state.
 .It Fl H
 Display each thread for a multithreaded process individually.
 By default a single summary line is displayed for each process.
+.It Fl I
+Do not display idle processes.
+By default, top displays both active and idle processes.
 .It Fl i
 Use \*(lqinteractive\*(rq mode.
 In this mode, any input is immediately
@@ -87,19 +99,23 @@ screen will immediately be updated, even if the command was 
not
 understood.
 This mode is the default when standard output is an
 intelligent terminal.
-.It Fl I
-Do not display idle processes.
-By default, top displays both active and idle processes.
+.It Fl J Ar jail
+Show only those processes owned by
+.Ar jail .
+This may be either the
+.Ar jid
+or
+.Ar name
+of the jail.
+Use
+0
+to limit to host processes.
+Using this option implies
+.Fl j .
 .It Fl j
 Display the
 .Xr jail 8
 ID.
-.It Fl T
-Toggle displaying thread ID (tid) instead of process id (pid).
-.It Fl t
-Do not display the
-.Nm
-process itself.
 .It Fl m Ar display
 Display either 'cpu' or 'io' statistics.
 Default is 'cpu'.
@@ -107,8 +123,19 @@ Default is 'cpu'.
 Use \*(lqnon-interactive\*(rq mode.
 This is identical to \*(lqbatch\*(rq
 mode.
+.It Fl o Ar field
+Sort the process display area on the specified field.
+The field name
+is the name of the column as seen in the output, but in lower case:
+\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq,
+\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq,
+\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq,
+\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq.
 .It Fl P
 Display per-cpu CPU usage statistics.
+.It Fl p Ar pid
+Show only the process
+.Ar pid .
 .It Fl q
 Renice
 .Nm
@@ -116,6 +143,26 @@ to -20 so that it will run faster.
 This can be used when the system is
 being very sluggish to improve the possibility of discovering the problem.
 This option can only be used by root.
+.It Fl S
+Show system processes in the display.
+Normally, system processes such as the pager and the swapper are not shown.
+This option makes them visible.
+.It Fl s Ar time
+Set the 

git: 4614bc803462 - stable/12 - top.1: Improve description of -m

2021-11-24 Thread Mateusz Piotrowski
The branch stable/12 has been updated by 0mp (doc, ports committer):

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

commit 4614bc803462366cb64b4a0609989fa2e3205b28
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 14:31:48 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:10:10 +

top.1: Improve description of -m

Describe -m argument as "mode" instead of "display".

MFC after:  3 days

(cherry picked from commit c947fc5fae31c5935a57abcaa76f40fc8950ce59)
---
 usr.bin/top/top.1 | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index 1f0be330ddc8..deda87a973f0 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -10,7 +10,7 @@
 .Op Fl abCHIijnPpqSTtuvxz
 .Op Fl d Ar count
 .Op Fl J Ar jail
-.Op Fl m Ar cpu|io
+.Op Fl m Ar mode
 .Op Fl o Ar field
 .Op Fl p Ar pid
 .Op Fl s Ar time
@@ -116,9 +116,15 @@ Using this option implies
 Display the
 .Xr jail 8
 ID.
-.It Fl m Ar display
-Display either 'cpu' or 'io' statistics.
-Default is 'cpu'.
+.It Fl m Ar mode
+Display statistics in the specified
+.Ar mode .
+Available modes are
+.Cm cpu
+and
+.Cm io .
+Default is
+.Cm cpu .
 .It Fl n
 Use \*(lqnon-interactive\*(rq mode.
 This is identical to \*(lqbatch\*(rq



git: 51f4d6a6bcf9 - stable/13 - top.1: Use the Dq macros instead of \*lq and \*rq

2021-11-24 Thread Mateusz Piotrowski
The branch stable/13 has been updated by 0mp (doc, ports committer):

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

commit 51f4d6a6bcf905c20f661302461e87c798f668ab
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 14:55:27 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:10:31 +

top.1: Use the Dq macros instead of \*lq and \*rq

MFC after:  3 days

(cherry picked from commit 01e3140571bab1a7283e33669de171865cdb8028)
---
 usr.bin/top/top.1 | 144 --
 1 file changed, 107 insertions(+), 37 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index 892ee8307e27..3aff7012f3d8 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -35,9 +35,13 @@ processes will be displayed instead of the default.
 makes a distinction between terminals that support advanced capabilities
 and those that do not.
 This distinction affects the choice of defaults for certain options.
-In the remainder of this document, an \*(lqintelligent\*(rq terminal is one 
that
+In the remainder of this document, an
+.Dq intelligent
+terminal is one that
 supports cursor addressing, clear screen, and clear to end of line.
-Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
+Conversely, a
+.Dq dumb
+terminal is one that does not support such
 features.
 If the output of
 .Nm
@@ -57,7 +61,9 @@ Non-printable characters in the command line are
 encoded in C-style backslash sequences or
 a three digit octal sequences.
 .It Fl b
-Use \*(lqbatch\*(rq mode.
+Use
+.Dq batch
+mode.
 In this mode, all input from the terminal is
 ignored.
 Interrupt characters (such as ^C and ^\e) still have an effect.
@@ -70,9 +76,15 @@ By default top displays the weighted CPU percentage in the 
WCPU column
 displays as CPU).
 Each time
 .Fl C
-flag is passed it toggles between \*(lqraw cpu\*(rq mode
-and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
-the \*(lqWCPU\*(rq column respectively.
+flag is passed it toggles between
+.Dq raw cpu
+mode and
+.Dq weighted cpu
+mode, showing the
+.Dq CPU
+or the
+.Dq WCPU
+column respectively.
 .It Fl d Ar count
 Show only
 .Ar count
@@ -91,10 +103,13 @@ By default a single summary line is displayed for each 
process.
 Do not display idle processes.
 By default, top displays both active and idle processes.
 .It Fl i
-Use \*(lqinteractive\*(rq mode.
+Use
+.Dq interactive
+mode.
 In this mode, any input is immediately
 read for processing.
-See the section on \*(lqInteractive Mode\*(rq
+See the section on
+.Dq Interactive Mode
 for an explanation of
 which keys perform what functions.
 After the command is processed, the
@@ -129,17 +144,32 @@ and
 Default is
 .Cm cpu .
 .It Fl n
-Use \*(lqnon-interactive\*(rq mode.
-This is identical to \*(lqbatch\*(rq
+Use
+.Dq non-interactive
+mode.
+This is identical to
+.Dq batch
 mode.
 .It Fl o Ar field
 Sort the process display area on the specified field.
 The field name
 is the name of the column as seen in the output, but in lower case:
-\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq,
-\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq,
-\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq,
-\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq.
+.Dq cpu ,
+.Dq size ,
+.Dq res ,
+.Dq time ,
+.Dq pri ,
+.Dq threads ,
+.Dq total ,
+.Dq read ,
+.Dq write ,
+.Dq fault ,
+.Dq vcsw ,
+.Dq ivcsw ,
+.Dq jid ,
+.Dq swap ,
+or
+.Dq pid .
 .It Fl P
 Display per-cpu CPU usage statistics.
 .It Fl p Ar pid
@@ -176,7 +206,9 @@ uid numbers.
 Do not map uid numbers to usernames.
 Normally,
 .Nm
-will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map
+will read as much of the file
+.Pa /etc/passwd
+as is necessary to map
 all the user id numbers it encounters into login names.
 This option disables all that, while possibly decreasing execution time.
 The uid numbers are displayed instead of the names.
@@ -192,23 +224,29 @@ Both
 .Ar count
 and
 .Ar number
-fields can be specified as \*(lqinfinite\*(rq, indicating that they can
+fields can be specified as
+.Dq infinite ,
+indicating that they can
 stretch as far as possible.
 This is accomplished by using any proper
 prefix of the keywords
-\*(lqinfinity\*(rq,
-\*(lqmaximum\*(rq,
+.Dq infinity ,
+.Dq maximum ,
 or
-\*(lqall\*(rq.
+.Dq all .
 Boolean flags are toggles.
 A second specification of any of these options will negate the first.
 .Sh "INTERACTIVE MODE"
 When
 .Nm
-is running in \*(lqinteractive mode\*(rq, it reads commands from the
+is running in
+.Dq interactive mode ,
+it reads commands from the
 terminal and acts upon them accordingly.
 In this mode, the terminal is
-put in \*(lqCBREAK\*(rq, so that a character will be
+put in
+.Dq CBREAK ,
+so that a character will be
 processed as soon as it is typed.
 Almost always, a key will be
 pressed when
@@ -265,30 +303,45 @@ Toggle 

git: cf1f1f91e914 - stable/12 - top.1: Use the Dq macros instead of \*lq and \*rq

2021-11-24 Thread Mateusz Piotrowski
The branch stable/12 has been updated by 0mp (doc, ports committer):

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

commit cf1f1f91e91425c8796b1af4263e98d280ee7e0a
Author: Mateusz Piotrowski <0...@freebsd.org>
AuthorDate: 2021-11-18 14:55:27 +
Commit: Mateusz Piotrowski <0...@freebsd.org>
CommitDate: 2021-11-24 16:10:24 +

top.1: Use the Dq macros instead of \*lq and \*rq

MFC after:  3 days

(cherry picked from commit 01e3140571bab1a7283e33669de171865cdb8028)
---
 usr.bin/top/top.1 | 144 --
 1 file changed, 107 insertions(+), 37 deletions(-)

diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index deda87a973f0..4a587877dba6 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -35,9 +35,13 @@ processes will be displayed instead of the default.
 makes a distinction between terminals that support advanced capabilities
 and those that do not.
 This distinction affects the choice of defaults for certain options.
-In the remainder of this document, an \*(lqintelligent\*(rq terminal is one 
that
+In the remainder of this document, an
+.Dq intelligent
+terminal is one that
 supports cursor addressing, clear screen, and clear to end of line.
-Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
+Conversely, a
+.Dq dumb
+terminal is one that does not support such
 features.
 If the output of
 .Nm
@@ -54,7 +58,9 @@ puts their status information there.
 If the real name differs from argv[0],
 it will be displayed in parenthesis.
 .It Fl b
-Use \*(lqbatch\*(rq mode.
+Use
+.Dq batch
+mode.
 In this mode, all input from the terminal is
 ignored.
 Interrupt characters (such as ^C and ^\e) still have an effect.
@@ -67,9 +73,15 @@ By default top displays the weighted CPU percentage in the 
WCPU column
 displays as CPU).
 Each time
 .Fl C
-flag is passed it toggles between \*(lqraw cpu\*(rq mode
-and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
-the \*(lqWCPU\*(rq column respectively.
+flag is passed it toggles between
+.Dq raw cpu
+mode and
+.Dq weighted cpu
+mode, showing the
+.Dq CPU
+or the
+.Dq WCPU
+column respectively.
 .It Fl d Ar count
 Show only
 .Ar count
@@ -88,10 +100,13 @@ By default a single summary line is displayed for each 
process.
 Do not display idle processes.
 By default, top displays both active and idle processes.
 .It Fl i
-Use \*(lqinteractive\*(rq mode.
+Use
+.Dq interactive
+mode.
 In this mode, any input is immediately
 read for processing.
-See the section on \*(lqInteractive Mode\*(rq
+See the section on
+.Dq Interactive Mode
 for an explanation of
 which keys perform what functions.
 After the command is processed, the
@@ -126,17 +141,32 @@ and
 Default is
 .Cm cpu .
 .It Fl n
-Use \*(lqnon-interactive\*(rq mode.
-This is identical to \*(lqbatch\*(rq
+Use
+.Dq non-interactive
+mode.
+This is identical to
+.Dq batch
 mode.
 .It Fl o Ar field
 Sort the process display area on the specified field.
 The field name
 is the name of the column as seen in the output, but in lower case:
-\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq,
-\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq,
-\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq,
-\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq.
+.Dq cpu ,
+.Dq size ,
+.Dq res ,
+.Dq time ,
+.Dq pri ,
+.Dq threads ,
+.Dq total ,
+.Dq read ,
+.Dq write ,
+.Dq fault ,
+.Dq vcsw ,
+.Dq ivcsw ,
+.Dq jid ,
+.Dq swap ,
+or
+.Dq pid .
 .It Fl P
 Display per-cpu CPU usage statistics.
 .It Fl p Ar pid
@@ -173,7 +203,9 @@ uid numbers.
 Do not map uid numbers to usernames.
 Normally,
 .Nm
-will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map
+will read as much of the file
+.Pa /etc/passwd
+as is necessary to map
 all the user id numbers it encounters into login names.
 This option disables all that, while possibly decreasing execution time.
 The uid numbers are displayed instead of the names.
@@ -189,23 +221,29 @@ Both
 .Ar count
 and
 .Ar number
-fields can be specified as \*(lqinfinite\*(rq, indicating that they can
+fields can be specified as
+.Dq infinite ,
+indicating that they can
 stretch as far as possible.
 This is accomplished by using any proper
 prefix of the keywords
-\*(lqinfinity\*(rq,
-\*(lqmaximum\*(rq,
+.Dq infinity ,
+.Dq maximum ,
 or
-\*(lqall\*(rq.
+.Dq all .
 Boolean flags are toggles.
 A second specification of any of these options will negate the first.
 .Sh "INTERACTIVE MODE"
 When
 .Nm
-is running in \*(lqinteractive mode\*(rq, it reads commands from the
+is running in
+.Dq interactive mode ,
+it reads commands from the
 terminal and acts upon them accordingly.
 In this mode, the terminal is
-put in \*(lqCBREAK\*(rq, so that a character will be
+put in
+.Dq CBREAK ,
+so that a character will be
 processed as soon as it is typed.
 Almost always, a key will be
 pressed when
@@ -262,30 +300,45 @@ Toggle the displ

Re: git: 3a60869237b8 - main - Add assembly optimized code for OpenSSL on powerpc, powerpc64 and powerpc64le

2021-11-24 Thread John Baldwin

On 11/23/21 2:27 PM, Piotr Kubaj wrote:

The branch main has been updated by pkubaj (ports committer):

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

commit 3a60869237b8b315fe66497cf5299ec08b688533
Author: Piotr Kubaj 
AuthorDate: 2021-11-22 02:28:46 +
Commit: Piotr Kubaj 
CommitDate: 2021-11-23 22:26:53 +

 Add assembly optimized code for OpenSSL on powerpc, powerpc64 and 
powerpc64le
 
 Summary:

 1. 
https://github.com/openssl/openssl/commit/34ab13b7d8e3e723adb60be8142e38b7c9cd382a
 needs to be merged for ELFv2 support on big-endian.
 2. crypto/openssl/crypto/ppccap.c needs to be patched.
 Same reason as in https://github.com/openssl/openssl/pull/17082.


Have you looked at adding powerpc support to ossl(4)?  It should be fairly 
simple
(just adding the right asm files in Makefiles and the powerpc equivalent of
OSSL_cpuid).

--
John Baldwin



Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables

2021-11-24 Thread John Baldwin

On 11/24/21 6:41 AM, Slawa Olhovchenkov wrote:

On Tue, Nov 16, 2021 at 10:26:42PM +, Marcin Wojtas wrote:



 Enable ASLR by default for 64-bit executables
 


Now any core dumps will be useless?


I believe core dumps should be fine.  We include the ELF auxv values in core
dumps as a NT_PROCSTAT_AUXV note that GDB (and I presume LLDB) both look at
to determine the location of the main executable (AT_BASE).  Once the dynamic
section of the main executable is found, DT_DEBUG is used to find the linked
list of shared libraries (including rtld itself) just as with PDEs.

--
John Baldwin



git: 1caaf5558544 - main - 32-bit compat: plug a set-but-not-unused var in freebsd32_copy_msg_out

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 1caaf5558544ad672dc7b0e70a2492cdcc5e362e
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 16:15:10 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 16:25:50 +

32-bit compat: plug a set-but-not-unused var in freebsd32_copy_msg_out

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/compat/freebsd32/freebsd32_misc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/compat/freebsd32/freebsd32_misc.c 
b/sys/compat/freebsd32/freebsd32_misc.c
index e81148d3577c..a51daec85fcd 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1357,12 +1357,11 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf 
*control)
socklen_t clen, datalen, datalen_out, oldclen;
int error;
caddr_t ctlbuf;
-   int len, maxlen, copylen;
+   int len, copylen;
struct mbuf *m;
error = 0;
 
len= msg->msg_controllen;
-   maxlen = msg->msg_controllen;
msg->msg_controllen = 0;
 
ctlbuf = msg->msg_control;



git: 3279341dc541 - main - aesni: plug a set-but-not-unused var in aesni_newsession

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 3279341dc541cfc730c80b8dd29ae9a6cd106325
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 16:17:09 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 16:25:50 +

aesni: plug a set-but-not-unused var in aesni_newsession

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/crypto/aesni/aesni.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c
index de797abd1af5..cd31287b08f0 100644
--- a/sys/crypto/aesni/aesni.c
+++ b/sys/crypto/aesni/aesni.c
@@ -342,12 +342,9 @@ static int
 aesni_newsession(device_t dev, crypto_session_t cses,
 const struct crypto_session_params *csp)
 {
-   struct aesni_softc *sc;
struct aesni_session *ses;
int error;
 
-   sc = device_get_softc(dev);
-
ses = crypto_get_driver_session(cses);
 
switch (csp->csp_mode) {



git: ab9d2f02a098 - main - amd_ecc_inject: return an error instead of ignoring it in tsc_modevent

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit ab9d2f02a098aad38bb2e04edb22a33294c18ac0
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 16:22:56 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 16:25:50 +

amd_ecc_inject: return an error instead of ignoring it in tsc_modevent

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/dev/amd_ecc_inject/ecc_inject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/amd_ecc_inject/ecc_inject.c 
b/sys/dev/amd_ecc_inject/ecc_inject.c
index c0f3c142a3c8..657e10407dbc 100644
--- a/sys/dev/amd_ecc_inject/ecc_inject.c
+++ b/sys/dev/amd_ecc_inject/ecc_inject.c
@@ -237,9 +237,9 @@ tsc_modevent(module_t mod __unused, int type, void *data 
__unused)
case MOD_SHUTDOWN:
break;
default:
-   return (EOPNOTSUPP);
+   error = EOPNOTSUPP;
}
-   return (0);
+   return (error);
 }
 
 DEV_MODULE(tsc, tsc_modevent, NULL);



git: cfe94aa8c117 - main - agp: plug a set-but-not-unused var in agp_intel_gtt_map_memory

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit cfe94aa8c117f3b8fa6cc69ed5a5093ea3cb959f
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 16:20:39 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 16:25:50 +

agp: plug a set-but-not-unused var in agp_intel_gtt_map_memory

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/dev/agp/agp_i810.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c
index 9bca2f556a60..50749863a5f5 100644
--- a/sys/dev/agp/agp_i810.c
+++ b/sys/dev/agp/agp_i810.c
@@ -2202,7 +2202,9 @@ int
 agp_intel_gtt_map_memory(device_t dev, vm_page_t *pages, u_int num_entries,
 struct sglist **sg_list)
 {
+#if 0
struct agp_i810_softc *sc;
+#endif
struct sglist *sg;
int i;
 #if 0
@@ -2212,7 +2214,9 @@ agp_intel_gtt_map_memory(device_t dev, vm_page_t *pages, 
u_int num_entries,
 
if (*sg_list != NULL)
return (0);
+#if 0
sc = device_get_softc(dev);
+#endif
sg = sglist_alloc(num_entries, M_WAITOK /* XXXKIB */);
for (i = 0; i < num_entries; i++) {
sg->sg_segs[i].ss_paddr = VM_PAGE_TO_PHYS(pages[i]);



git: e052f7269108 - main - alc: plug a set-but-not-unused var in alc_init_locked

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit e052f72691088229c34e8f908593319c413b2a10
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 16:26:57 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 16:26:57 +

alc: plug a set-but-not-unused var in alc_init_locked

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/dev/alc/if_alc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c
index eb906d60bcbe..bedbd20c1f04 100644
--- a/sys/dev/alc/if_alc.c
+++ b/sys/dev/alc/if_alc.c
@@ -3932,7 +3932,6 @@ static void
 alc_init_locked(struct alc_softc *sc)
 {
struct ifnet *ifp;
-   struct mii_data *mii;
uint8_t eaddr[ETHER_ADDR_LEN];
bus_addr_t paddr;
uint32_t reg, rxf_hi, rxf_lo;
@@ -3940,7 +3939,6 @@ alc_init_locked(struct alc_softc *sc)
ALC_LOCK_ASSERT(sc);
 
ifp = sc->alc_ifp;
-   mii = device_get_softc(sc->alc_miibus);
 
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
return;



Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables

2021-11-24 Thread Dawid Górecki
On Wed, Nov 24, 2021 at 3:41 PM Slawa Olhovchenkov  wrote:
>
> On Tue, Nov 16, 2021 at 10:26:42PM +, Marcin Wojtas wrote:
>
> >
> > Enable ASLR by default for 64-bit executables
> >
>
> Now any core dumps will be useless?
>

Core dumps work fine. I just created a test application to confirm.
LLDB resolves everything without issues.

First run:

root@aslr-dgr:~/coretest # lldb ./coretest --core ./coretest.core
(lldb) target create "./coretest" --core "./coretest.core"
Core file '/root/coretest/coretest.core' (x86_64) was loaded.
(lldb) bt
This version of LLDB has no plugin for the language "assembler".
Inspection of frame variables will be limited.
* thread #1, name = 'coretest', stop reason = signal SIGABRT
  * frame #0: 0x21d0be68c53a libc.so.7`__sys_thr_kill at thr_kill.S:4
frame #1: 0x21d0be604bf4 libc.so.7`__raise(s=6) at raise.c:52:10
frame #2: 0x21d0be6b62c9 libc.so.7`abort at abort.c:67:8
frame #3: 0x21c8bd67d9f5 coretest`main at coretest.c:10:2
frame #4: 0x21c8bd67d7cd coretest`_start(ap=,
cleanup=) at crt1_c.c:73:7
(lldb) frame select 3
frame #3: 0x21c8bd67d9f5 coretest`main at coretest.c:10:2
   7int a = 1;
   8printf("Core dump test.\n");
   9
-> 10   abort();
   11
   12   return 0;
   13   }
(lldb) frame v
(int) a = 1
(lldb) quit

Second run:

root@aslr-dgr:~/coretest # ./coretest
Core dump test.
Abort trap (core dumped)
root@aslr-dgr:~/coretest # lldb ./coretest --core ./coretest.core
(lldb) target create "./coretest" --core "./coretest.core"
Core file '/root/coretest/coretest.core' (x86_64) was loaded.
(lldb) bt
This version of LLDB has no plugin for the language "assembler".
Inspection of frame variables will be limited.
* thread #1, name = 'coretest', stop reason = signal SIGABRT
  * frame #0: 0x063d5022353a libc.so.7`__sys_thr_kill at thr_kill.S:4
frame #1: 0x063d5019bbf4 libc.so.7`__raise(s=6) at raise.c:52:10
frame #2: 0x063d5024d2c9 libc.so.7`abort at abort.c:67:8
frame #3: 0x06354fc1d9f5 coretest`main at coretest.c:10:2
frame #4: 0x06354fc1d7cd coretest`_start(ap=,
cleanup=) at crt1_c.c:73:7
(lldb)

You can see that addresses change but core dump still works.



Re: git: 169e06fa7852 - main - os-release: Quote variables as documented in the manual

2021-11-24 Thread Warner Losh
On Wed, Nov 24, 2021 at 8:28 AM Mateusz Piotrowski <0...@freebsd.org> wrote:

> The branch main has been updated by 0mp (doc, ports committer):
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=169e06fa7852810f4ced2cce7a3c14ca9443bf39
>
> commit 169e06fa7852810f4ced2cce7a3c14ca9443bf39
> Author: Mateusz Piotrowski <0...@freebsd.org>
> AuthorDate: 2021-11-23 10:26:47 +
> Commit: Mateusz Piotrowski <0...@freebsd.org>
> CommitDate: 2021-11-24 15:17:01 +
>
> os-release: Quote variables as documented in the manual
>
> Variables must be quoted if they contain non-alphanumeric characters.
>
> Warner noted in the review that the lack of quoting causing problems
> here is rather an edge case. I believe that it's worth adding the
> quotes
> here anyway because this is what the specification says and there is no
> good reason not to follow it.
>

The only place it might be needed is for _version. Everything else can't
have troublesome characters. The manual does not say you have to
quote non-alphanumeric characters in variable assignment being my
main point. Certainly not the paths and URLs. That's just gratuitous
and not generally done in shell scripts (which I thought was a good
enough reason to not do it). I'd have preferred if that nuance had
been better reflected in the commit message since the change
itself won't break anything.

Warner


> Reviewed by:imp
> Approved by:imp (src)
> MFC after:  7 days
> ---
>  libexec/rc/rc.d/os-release | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/libexec/rc/rc.d/os-release b/libexec/rc/rc.d/os-release
> index c328e161a70e..16f8cb178db8 100755
> --- a/libexec/rc/rc.d/os-release
> +++ b/libexec/rc/rc.d/os-release
> @@ -27,14 +27,14 @@ osrelease_start()
> t=$(mktemp -t os-release)
> cat > "$t" <<-__EOF__
> NAME=FreeBSD
> -   VERSION=$_version
> -   VERSION_ID=$_version_id
> +   VERSION="$_version"
> +   VERSION_ID="$_version_id"
> ID=freebsd
> ANSI_COLOR="0;31"
> PRETTY_NAME="FreeBSD $_version"
> -   CPE_NAME=cpe:/o:freebsd:freebsd:$_version_id
> -   HOME_URL=https://FreeBSD.org/
> -   BUG_REPORT_URL=https://bugs.FreeBSD.org/
> +   CPE_NAME="cpe:/o:freebsd:freebsd:$_version_id"
> +   HOME_URL="https://FreeBSD.org/";
> +   BUG_REPORT_URL="https://bugs.FreeBSD.org/";
>  __EOF__
> install -C -o root -g wheel -m ${osrelease_perms} "$t"
> "${osrelease_file}"
> rm -f "$t"
>


Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables

2021-11-24 Thread Jessica Clarke
On 24 Nov 2021, at 16:23, John Baldwin  wrote:
> On 11/24/21 6:41 AM, Slawa Olhovchenkov wrote:
>> On Tue, Nov 16, 2021 at 10:26:42PM +, Marcin Wojtas wrote:
>>> 
>>> Enable ASLR by default for 64-bit executables
>>> 
>> Now any core dumps will be useless?
> 
> I believe core dumps should be fine.  We include the ELF auxv values in core
> dumps as a NT_PROCSTAT_AUXV note that GDB (and I presume LLDB) both look at
> to determine the location of the main executable (AT_BASE).  Once the dynamic
> section of the main executable is found, DT_DEBUG is used to find the linked
> list of shared libraries (including rtld itself) just as with PDEs.

And if it were broken, it would’ve been broken by switching to building
PIEs, not enabling ASLR. PIEs are linked with a base address of 0, so
even if the kernel has a deterministic address at which it maps such
executables (i.e. ASLR were disabled), it still needs to communicate
that to the debugger somehow. Well, unless you hard-code the address for
every architecture in the debugger, which is clearly a bad idea and not
done.

Jess




git: eaab06d53dfa - stable/13 - devfs.rules: Correctly unhide pf in vnet jails

2021-11-24 Thread Kristof Provost
The branch stable/13 has been updated by kp:

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

commit eaab06d53dfa7fbf926a2c19aa00a6804b5e6349
Author: Zhenlei Huang 
AuthorDate: 2021-11-03 11:46:48 +
Commit: Kristof Provost 
CommitDate: 2021-11-24 16:45:51 +

devfs.rules: Correctly unhide pf in vnet jails

Revision 9e9be081d8 introduced a new devfs rule devfsrules_jail_vnet. It
includes rule devfsrules_jail which include other rules. Unfortunately
devfs could not recursively parse the action include and thus
devfsrules_jail_vnet will expose all nodes.

PR: 255660
Reviewed by:kp
Obtained from:  Gijs Peskens 
MFC after:  3 weeks
Differential Revision:  https://reviews.freebsd.org/D32814

(cherry picked from commit 7acd322ebe2072b1d73b1d19c14ab12a300ba8e8)
---
 sbin/devfs/devfs.rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sbin/devfs/devfs.rules b/sbin/devfs/devfs.rules
index 01d8e5194c17..9543e20947d9 100644
--- a/sbin/devfs/devfs.rules
+++ b/sbin/devfs/devfs.rules
@@ -88,5 +88,8 @@ add path fuse unhide
 add path zfs unhide
 
 [devfsrules_jail_vnet=5]
+add include $devfsrules_hide_all
+add include $devfsrules_unhide_basic
+add include $devfsrules_unhide_login
 add include $devfsrules_jail
 add path pf unhide



git: c31b7fd8b294 - stable/12 - riscv: add COMPAT_FREEBSD12 option

2021-11-24 Thread Kristof Provost
The branch stable/12 has been updated by kp:

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

commit c31b7fd8b294e64b285898ffbfb613b178948126
Author: Kristof Provost 
AuthorDate: 2021-11-16 19:46:26 +
Commit: Kristof Provost 
CommitDate: 2021-11-24 16:57:23 +

riscv: add COMPAT_FREEBSD12 option

Turn on compat option for older FreeBSD versions (i.e. 12). We do not
enable the compat options for 11 or older because riscv was never
supported in those versions.

Reviewed by:jrtc27 (previous version)
MFC after:  1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D33015

(cherry picked from commit 23e1961e78b0ac4d1cf03426d1a642962069f2b9)
---
 sys/riscv/conf/GENERIC | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC
index 4982c48ece39..5cba4cc2f94f 100644
--- a/sys/riscv/conf/GENERIC
+++ b/sys/riscv/conf/GENERIC
@@ -51,6 +51,7 @@ options   PSEUDOFS# Pseudo-filesystem 
framework
 optionsGEOM_PART_GPT   # GUID Partition Tables.
 optionsGEOM_RAID   # Soft RAID functionality.
 optionsGEOM_LABEL  # Provides labelization
+optionsCOMPAT_FREEBSD12# Compatible with FreeBSD12
 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI
 optionsKTRACE  # ktrace(1) support
 optionsSTACK   # stack(9) support



git: 576d71e383f1 - stable/13 - riscv: add COMPAT_FREEBSD12 option

2021-11-24 Thread Kristof Provost
The branch stable/13 has been updated by kp:

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

commit 576d71e383f10cde0de14da16baf98835d51ecec
Author: Kristof Provost 
AuthorDate: 2021-11-16 19:46:26 +
Commit: Kristof Provost 
CommitDate: 2021-11-24 16:45:51 +

riscv: add COMPAT_FREEBSD12 option

Turn on compat option for older FreeBSD versions (i.e. 12). We do not
enable the compat options for 11 or older because riscv was never
supported in those versions.

Reviewed by:jrtc27 (previous version)
MFC after:  1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D33015

(cherry picked from commit 23e1961e78b0ac4d1cf03426d1a642962069f2b9)
---
 sys/riscv/conf/GENERIC | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC
index 8c3162d6ae1e..4ce3ffe059ba 100644
--- a/sys/riscv/conf/GENERIC
+++ b/sys/riscv/conf/GENERIC
@@ -52,6 +52,7 @@ options   TMPFS   # Efficient memory 
filesystem
 optionsGEOM_PART_GPT   # GUID Partition Tables.
 optionsGEOM_RAID   # Soft RAID functionality.
 optionsGEOM_LABEL  # Provides labelization
+optionsCOMPAT_FREEBSD12# Compatible with FreeBSD12
 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI
 optionsKTRACE  # ktrace(1) support
 optionsSTACK   # stack(9) support



git: 094b79ea7342 - stable/13 - pf tests: route_to:icmp_nat_head requires scapy

2021-11-24 Thread Kristof Provost
The branch stable/13 has been updated by kp:

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

commit 094b79ea7342c3c6e5b698816d9486bb80e9518b
Author: Kristof Provost 
AuthorDate: 2021-11-03 09:34:20 +
Commit: Kristof Provost 
CommitDate: 2021-11-24 16:45:51 +

pf tests: route_to:icmp_nat_head requires scapy

Document the requirement so the test is skipped if scapy is not
installed.

MFC after:  3 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 11703705c2f77498246b9523aae44040bd346c00)
---
 tests/sys/netpfil/pf/route_to.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh
index e7646a5fb7f7..570d1feb36ff 100644
--- a/tests/sys/netpfil/pf/route_to.sh
+++ b/tests/sys/netpfil/pf/route_to.sh
@@ -257,6 +257,7 @@ icmp_nat_head()
 {
atf_set descr 'Test that ICMP packets are correct for route-to + NAT'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 icmp_nat_body()



git: b991674ba5af - stable/12 - pf tests: route_to:icmp_nat_head requires scapy

2021-11-24 Thread Kristof Provost
The branch stable/12 has been updated by kp:

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

commit b991674ba5afeb11b7c4eb70028cce4a4e0ad41f
Author: Kristof Provost 
AuthorDate: 2021-11-03 09:34:20 +
Commit: Kristof Provost 
CommitDate: 2021-11-24 16:57:23 +

pf tests: route_to:icmp_nat_head requires scapy

Document the requirement so the test is skipped if scapy is not
installed.

MFC after:  3 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 11703705c2f77498246b9523aae44040bd346c00)
---
 tests/sys/netpfil/pf/route_to.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh
index e7646a5fb7f7..570d1feb36ff 100755
--- a/tests/sys/netpfil/pf/route_to.sh
+++ b/tests/sys/netpfil/pf/route_to.sh
@@ -257,6 +257,7 @@ icmp_nat_head()
 {
atf_set descr 'Test that ICMP packets are correct for route-to + NAT'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 icmp_nat_body()



git: 05ea7a3e5e74 - main - net80211: fix -Wunused-but-set-variable warnings

2021-11-24 Thread Bjoern A. Zeeb
The branch main has been updated by bz:

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

commit 05ea7a3e5e748547a0229efa80be0e71eaf84f52
Author: Bjoern A. Zeeb 
AuthorDate: 2021-11-24 17:36:48 +
Commit: Bjoern A. Zeeb 
CommitDate: 2021-11-24 17:39:19 +

net80211: fix -Wunused-but-set-variable warnings

Put the offending variables under the appropriate #ifdefs
(mostly IEEE80211_DEBUG, in one case IEEE80211_SUPPORT_SUPERG, and
in two cases under __notyet__ to revisit why these had been left
there but not used).

Sponsored by:   The FreeBSD Foundation
MFC after:  10 days
---
 sys/net80211/ieee80211_adhoc.c  |  5 -
 sys/net80211/ieee80211_crypto_wep.c |  8 +---
 sys/net80211/ieee80211_hostap.c | 16 +++-
 sys/net80211/ieee80211_ht.c | 21 -
 sys/net80211/ieee80211_output.c |  6 ++
 sys/net80211/ieee80211_sta.c|  7 ++-
 6 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c
index 15051568..57e46dd5ad0b 100644
--- a/sys/net80211/ieee80211_adhoc.c
+++ b/sys/net80211/ieee80211_adhoc.c
@@ -1009,7 +1009,6 @@ ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf 
*m0,
 {
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
-   struct ieee80211_frame *wh;
 
/*
 * Process management frames when scanning; useful for doing
@@ -1018,7 +1017,11 @@ ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf 
*m0,
if (ic->ic_flags & IEEE80211_F_SCAN)
adhoc_recv_mgmt(ni, m0, subtype, rxs, rssi, nf);
else {
+#ifdef IEEE80211_DEBUG
+   struct ieee80211_frame *wh;
+
wh = mtod(m0, struct ieee80211_frame *);
+#endif
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_ASSOC_REQ:
case IEEE80211_FC0_SUBTYPE_ASSOC_RESP:
diff --git a/sys/net80211/ieee80211_crypto_wep.c 
b/sys/net80211/ieee80211_crypto_wep.c
index 797de006cdf2..164157559cb2 100644
--- a/sys/net80211/ieee80211_crypto_wep.c
+++ b/sys/net80211/ieee80211_crypto_wep.c
@@ -241,11 +241,8 @@ wep_decap(struct ieee80211_key *k, struct mbuf *m, int 
hdrlen)
 {
struct wep_ctx *ctx = k->wk_private;
struct ieee80211vap *vap = ctx->wc_vap;
-   struct ieee80211_frame *wh;
const struct ieee80211_rx_stats *rxs;
 
-   wh = mtod(m, struct ieee80211_frame *);
-
rxs = ieee80211_get_rx_params_ptr(m);
 
if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))
@@ -258,6 +255,11 @@ wep_decap(struct ieee80211_key *k, struct mbuf *m, int 
hdrlen)
 */
if ((k->wk_flags & IEEE80211_KEY_SWDECRYPT) &&
!wep_decrypt(k, m, hdrlen)) {
+#ifdef IEEE80211_DEBUG
+   struct ieee80211_frame *wh;
+
+   wh = mtod(m, struct ieee80211_frame *);
+#endif
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,
"%s", "WEP ICV mismatch on decrypt");
vap->iv_stats.is_rx_wepfail++;
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
index 4fa9c6a72145..f3a85848fc84 100644
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -997,7 +997,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct 
ieee80211_frame *wh,
 {
struct ieee80211vap *vap = ni->ni_vap;
uint8_t *challenge;
-   int allocbs, estatus;
+   int estatus;
 
KASSERT(vap->iv_state == IEEE80211_S_RUN, ("state %d", vap->iv_state));
 
@@ -1070,17 +1070,26 @@ hostap_auth_shared(struct ieee80211_node *ni, struct 
ieee80211_frame *wh,
}
switch (seq) {
case IEEE80211_AUTH_SHARED_REQUEST:
+   {
+#ifdef IEEE80211_DEBUG
+   bool allocbs;
+#endif
+
if (ni == vap->iv_bss) {
ni = ieee80211_dup_bss(vap, wh->i_addr2);
if (ni == NULL) {
/* NB: no way to return an error */
return;
}
+#ifdef IEEE80211_DEBUG
allocbs = 1;
+#endif
} else {
if ((ni->ni_flags & IEEE80211_NODE_AREF) == 0)
(void) ieee80211_ref_node(ni);
+#ifdef IEEE80211_DEBUG
allocbs = 0;
+#endif
}
/*
 * Mark the node as referenced to reflect that it's
@@ -1120,6 +1129,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct 
ieee80211_frame *wh,
return;
}
break;
+   }
case IEEE80211_AUTH_SHARED_RESPONSE:
if (ni == vap->iv_bss) {
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_AUTH,
@@ -2299,7 +2309,9 @@ hostap_recv_mgmt(st

Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features

2021-11-24 Thread Allan Jude

On 11/24/2021 3:30 AM, Emmanuel Vadot wrote:

On Tue, 23 Nov 2021 20:36:40 +0100 (CET)
free...@oldach.net (Helge Oldach) wrote:


Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET):

On 11/23/2021 5:00 AM, Helge Oldach wrote:

Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET):
Hmmm. On a RPi4/8G:

Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6):
| type 16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes 
 16384 bytes
| aes-256-gcm  35791.98k38533.57k39986.77k41397.59k
39840.43k39638.36k

After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621)

| type 16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes 
 16384 bytes
| aes-256-gcm  21277.62k23226.64k23613.90k23687.51k
23892.93k23947.95k

It seems that AES throughput is actually cut by almost half?


Do you know which of the CPU optimizations your RPi4 supports?


Is this what you need?

  Instruction Set Attributes 0 = 


  So there is no AES+PMULL instruction set on RPI4, I guess that openssl
uses them for aes-gcm.

  I wonder what it uses before that make it have this boost.

  On my rockpro64 I do see the improvement btw :
root@generic:~ # cpuset -l 4,5 openssl speed -evp aes-256-gcm
...
aes-256-gcm 122861.59k   337938.39k   565408.44k   661223.09k   709175.19k  
 712327.25k
root@generic:~ # cpuset -l 4,5 env OPENSSL_armcap=0 openssl speed -evp 
aes-256-gcm
...
aes-256-gcm  34068.11k38068.62k39435.24k39818.75k39905.34k  
  39922.35k

  Running on the big cores at max freq.


  Instruction Set Attributes 1 = <>
  Processor Features 0 = 
  Processor Features 1 = <>
   Memory Model Features 0 = 
   Memory Model Features 1 = <8bit VMID>
   Memory Model Features 2 = <32bit CCIDX,48bit VA>
  Debug Features 0 = 
  Debug Features 1 = <>
  Auxiliary Features 0 = <>
  Auxiliary Features 1 = <>
AArch32 Instruction Set Attributes 5 = 
AArch32 Media and VFP Features 0 = 
AArch32 Media and VFP Features 1 = 


You can set the environment variable OPENSSL_armcap to override
OpenSSL's detection.

Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm


On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again (i.e. 
after this commit):

hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm
Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s
Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s
Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s
Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s
Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s
Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s
OpenSSL 1.1.1l-freebsd  24 Aug 2021
built on: reproducible build, date unspecified
options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr)
compiler: clang
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes  
16384 bytes
aes-256-gcm  33504.57k39704.51k40825.01k41394.83k41454.25k  
  41601.52k
hmo@p48 ~ $ openssl speed -evp aes-256-gcm
Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s
Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s
Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s
Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s
Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s
Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s
OpenSSL 1.1.1l-freebsd  24 Aug 2021
built on: reproducible build, date unspecified
options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr)
compiler: clang
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes256 bytes   1024 bytes   8192 bytes  
16384 bytes
aes-256-gcm  21686.41k23197.59k23656.30k23725.04k23926.10k  
  23916.23k
hmo@p48 ~ $

Kind regards,
Helge





So based on results from Manu, and Mark Millard, it seems almost every 
ARM platform is faster when it takes advantage of the CPU features, 
except the RPi4(B).


As Manu pointed out, it doesn't appear to have the AES+PMULL feature, 
which means it must be something else that is slowing it down.


What might help, is to try each feature in turn, and figure out which 
one is causing slower results.


#define HWCAP_FP0x0001
#define HWCAP_ASIMD 0x0002
#define HWCAP_EVTSTRM   0x0004
#define HWCAP_AES   0x0008
#define HWCAP_PMULL 0x0010
#define HWCAP_SHA1  0x0020
#define HWCAP_SHA2  0x0040
#define HWCAP_CRC32 0x0080

So try:
e

git: f29f6b2e1fc9 - main - ichsmb: Add PCI IDs for Intel Alder Lake SMBus controller

2021-11-24 Thread Alexander Motin
The branch main has been updated by mav:

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

commit f29f6b2e1fc93ea68171f6c974ffe654232d09ca
Author: Alexander Motin 
AuthorDate: 2021-11-24 18:06:52 +
Commit: Alexander Motin 
CommitDate: 2021-11-24 18:07:58 +

ichsmb: Add PCI IDs for Intel Alder Lake SMBus controller

Submitted by:   Dmitry Luhtionov 
MFC after:  2 weeks
---
 sys/dev/ichsmb/ichsmb_pci.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c
index 51049643ae15..32c6c1fbbcf2 100644
--- a/sys/dev/ichsmb/ichsmb_pci.c
+++ b/sys/dev/ichsmb/ichsmb_pci.c
@@ -110,6 +110,9 @@ __FBSDID("$FreeBSD$");
 #defineID_TIGERLAKE0xa0a3
 #defineID_TIGERLAKE2   0x43a3
 #defineID_GEMINILAKE   0x31d4
+#defineID_ALDERLAKE0x7aa3
+#defineID_ALDERLAKE2   0x51a3
+#defineID_ALDERLAKE3   0x54a3
 
 static const struct pci_device_table ichsmb_devices[] = {
{ PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA),
@@ -202,6 +205,12 @@ static const struct pci_device_table ichsmb_devices[] = {
  PCI_DESCR("Intel Tiger Lake SMBus controller") },
{ PCI_DEV(PCI_VENDOR_INTEL, ID_GEMINILAKE),
  PCI_DESCR("Intel Gemini Lake SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_ALDERLAKE),
+ PCI_DESCR("Intel Alder Lake SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_ALDERLAKE2),
+ PCI_DESCR("Intel Alder Lake SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_ALDERLAKE3),
+ PCI_DESCR("Intel Alder Lake SMBus controller") },
 };
 
 /* Internal functions */



git: 1c55b0ce1c94 - main - std.nodebug: turn off net80211 debugging as well

2021-11-24 Thread Bjoern A. Zeeb
The branch main has been updated by bz:

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

commit 1c55b0ce1c944c0b1b7657b7efa151cd25a74f5b
Author: Bjoern A. Zeeb 
AuthorDate: 2021-11-24 18:03:48 +
Commit: Bjoern A. Zeeb 
CommitDate: 2021-11-24 18:06:20 +

std.nodebug: turn off net80211 debugging as well

Add IEEE80211_DEBUG to turn off some net80211 debbugging for
no-debug builds.

Sponsored by:   The FreeBSD Foundation
MFC after:  10 days
---
 sys/conf/std.nodebug | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/conf/std.nodebug b/sys/conf/std.nodebug
index 53a7fc6b2f81..b0bf9d4d47f6 100644
--- a/sys/conf/std.nodebug
+++ b/sys/conf/std.nodebug
@@ -14,6 +14,9 @@ nooptions KCOV
 nooptions  MALLOC_DEBUG_MAXZONES
 nooptions  QUEUE_MACRO_DEBUG_TRASH
 
+# Net80211 debugging
+nooptions  IEEE80211_DEBUG
+
 # USB debugging
 nooptions  USB_DEBUG
 nooptions  HID_DEBUG



git: b194db935565 - main - sys/acct.h: Add sys/types.h include

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit b194db935565d58392c21906419cbd99a5ecc0c3
Author: Warner Losh 
AuthorDate: 2021-11-24 17:37:48 +
Commit: Warner Losh 
CommitDate: 2021-11-24 18:26:44 +

sys/acct.h: Add sys/types.h include

There's no harm in including sys/types.h here and acct.h needs it. This
file isn't defined by any standard, so what we do here wrt namespaces
likely doesn't matter. If it does, it will be easy enough to add the
necessary __BSD_VISIBLE guards in the future.

Sponsored by:   Netflix
---
 sys/sys/acct.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/sys/acct.h b/sys/sys/acct.h
index 36c6a5e23d06..7f61f3f4fc10 100644
--- a/sys/sys/acct.h
+++ b/sys/sys/acct.h
@@ -42,6 +42,8 @@
 
 #ifdef _KERNEL
 #define float uint32_t
+#else
+#include 
 #endif
 
 #define AC_COMM_LEN 16



git: 242d6201a6c8 - main - sys/alq.h: Kernel only file, mark as such

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit 242d6201a6c840a68dc19b0df1157568751e1391
Author: Warner Losh 
AuthorDate: 2021-11-24 17:39:10 +
Commit: Warner Losh 
CommitDate: 2021-11-24 18:26:45 +

sys/alq.h: Kernel only file, mark as such

The alq interfaces are 100% in-kernel, so make this whole file #ifdef
_KERNEL. There's no users of this in the tree outside of the kernel, nor
does it define anything that could be useful at peeking into the state
of alq.

Sponsored by:   Netflix
---
 sys/sys/alq.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/sys/alq.h b/sys/sys/alq.h
index 536fa2077357..fc8962c13cdb 100644
--- a/sys/sys/alq.h
+++ b/sys/sys/alq.h
@@ -37,6 +37,7 @@
 #ifndef _SYS_ALQ_H_
 #define_SYS_ALQ_H_
 
+#ifdef _KERNEL
 /*
  * Opaque type for the Async. Logging Queue
  */
@@ -143,4 +144,5 @@ alq_post(struct alq *alq, struct ale *ale)
alq_post_flags(alq, ale, 0);
 }
 
+#endif /* _KERNEL */
 #endif /* _SYS_ALQ_H_ */



git: fde1edaae7f0 - main - sys/disk/*.h: Include sys/types.h

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit fde1edaae7f05f753f3d0787744bcb466b634e7b
Author: Warner Losh 
AuthorDate: 2021-11-24 17:41:57 +
Commit: Warner Losh 
CommitDate: 2021-11-24 18:26:45 +

sys/disk/*.h: Include sys/types.h

All these files use types defined by sys/types.h. Add an include of it
at the top to make them standalone.

Sponsored by:   Netflix
---
 sys/sys/disk/apm.h  | 2 ++
 sys/sys/disk/bsd.h  | 2 ++
 sys/sys/disk/gpt.h  | 2 ++
 sys/sys/disk/mbr.h  | 2 ++
 sys/sys/disk/vtoc.h | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/sys/sys/disk/apm.h b/sys/sys/disk/apm.h
index a9183b5e3aa7..1cf64a53b81a 100644
--- a/sys/sys/disk/apm.h
+++ b/sys/sys/disk/apm.h
@@ -29,6 +29,8 @@
 #ifndef _SYS_DISK_APM_H_
 #define_SYS_DISK_APM_H_
 
+#include 
+
 /* Driver Descriptor Record. */
 struct apm_ddr {
uint16_tddr_sig;
diff --git a/sys/sys/disk/bsd.h b/sys/sys/disk/bsd.h
index 6b1e55ce6545..3e627db09099 100644
--- a/sys/sys/disk/bsd.h
+++ b/sys/sys/disk/bsd.h
@@ -33,6 +33,8 @@
 #ifndef _SYS_DISK_BSD_H_
 #define_SYS_DISK_BSD_H_
 
+#include 
+
 /* The disk magic number */
 #define BSD_MAGIC  0x82564557U
 
diff --git a/sys/sys/disk/gpt.h b/sys/sys/disk/gpt.h
index c68524b9051e..3cb8d8e071e8 100644
--- a/sys/sys/disk/gpt.h
+++ b/sys/sys/disk/gpt.h
@@ -29,6 +29,8 @@
 #ifndef _SYS_DISK_GPT_H_
 #define_SYS_DISK_GPT_H_
 
+#include 
+
 /*
  * Applications can define GPT_UUID_TYPE if they want the GPT structures
  * to use a particular type definition for UUIDs/GUIDs.  This header uses
diff --git a/sys/sys/disk/mbr.h b/sys/sys/disk/mbr.h
index 39b47c4a7386..1241059b02ea 100644
--- a/sys/sys/disk/mbr.h
+++ b/sys/sys/disk/mbr.h
@@ -33,6 +33,8 @@
 #ifndef _SYS_DISK_MBR_H_
 #define_SYS_DISK_MBR_H_
 
+#include 
+
 #defineDOSBBSECTOR 0   /* DOS boot block relative sector 
number */
 #defineDOSDSNOFF   440 /* WinNT/2K/XP Drive Serial Number 
offset */
 #defineDOSPARTOFF  446
diff --git a/sys/sys/disk/vtoc.h b/sys/sys/disk/vtoc.h
index c784d92717cf..c8e6e86268e4 100644
--- a/sys/sys/disk/vtoc.h
+++ b/sys/sys/disk/vtoc.h
@@ -29,6 +29,8 @@
 #ifndef _SYS_DISK_VTOC_H_
 #define_SYS_DISK_VTOC_H_
 
+#include 
+
 #defineVTOC_TAG_UNASSIGNED 0x00
 #defineVTOC_TAG_BOOT   0x01
 #defineVTOC_TAG_ROOT   0x02



git: d69b6fa5b449 - main - sys/ata.h: Include sys/types.h

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit d69b6fa5b449422b217aad22a81f3e3ec8dd6894
Author: Warner Losh 
AuthorDate: 2021-11-24 17:48:10 +
Commit: Warner Losh 
CommitDate: 2021-11-24 18:26:45 +

sys/ata.h: Include sys/types.h

This file needs types defined by sys/types.h, and there's no reason not
to include sys/types.h here.

Sponsored by:   Netflix
---
 sys/sys/ata.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/sys/ata.h b/sys/sys/ata.h
index 83eb089dbecf..7f89d96790fe 100644
--- a/sys/sys/ata.h
+++ b/sys/sys/ata.h
@@ -31,6 +31,7 @@
 #ifndef _SYS_ATA_H_
 #define _SYS_ATA_H_
 
+#include 
 #include 
 
 /* ATA/ATAPI device parameters */



git: 9be3985f6501 - main - sys/backlight.h: include sys/types.h

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit 9be3985f6501034f15b220fd1ce16a8cdc011f6a
Author: Warner Losh 
AuthorDate: 2021-11-24 17:49:34 +
Commit: Warner Losh 
CommitDate: 2021-11-24 18:26:45 +

sys/backlight.h: include sys/types.h

Sponsored by:   Netflix
---
 sys/sys/backlight.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/sys/backlight.h b/sys/sys/backlight.h
index 4742d40e746c..697e0b6b6349 100644
--- a/sys/sys/backlight.h
+++ b/sys/sys/backlight.h
@@ -30,6 +30,8 @@
 #ifndef __BACKLIGHT_H__
 #define__BACKLIGHT_H__
 
+#include 
+
 #defineBACKLIGHTMAXLEVELS 100
 
 struct backlight_props {



git: 00dbcdbe0a5a - main - sys/uuid.h: Include sys/types.h

2021-11-24 Thread Warner Losh
The branch main has been updated by imp:

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

commit 00dbcdbe0a5af49d76711a48a84a720ab4243a57
Author: Warner Losh 
AuthorDate: 2021-11-24 17:49:53 +
Commit: Warner Losh 
CommitDate: 2021-11-24 18:26:45 +

sys/uuid.h: Include sys/types.h

Change the include of sys/cdefs.h to sys/types.h to pick up all the
types. sys/types.h includes cdefs.h.

Sponsored by:   Netflix
---
 sys/sys/uuid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/sys/uuid.h b/sys/sys/uuid.h
index 95050d0f8d20..bbb85732dd50 100644
--- a/sys/sys/uuid.h
+++ b/sys/sys/uuid.h
@@ -31,7 +31,7 @@
 #ifndef _SYS_UUID_H_
 #define_SYS_UUID_H_
 
-#include 
+#include 
 
 /* Length of a node address (an IEEE 802 address). */
 #define_UUID_NODE_LEN  6



Re: git: 3a60869237b8 - main - Add assembly optimized code for OpenSSL on powerpc, powerpc64 and powerpc64le

2021-11-24 Thread John Baldwin

On 11/24/21 10:24 AM, Piotr Kubaj wrote:

OK, it looks like ossl uses fpu_kern functions and those are available only an 
aarch64, amd64 and i386:
cc  -O2 -pipe -fno-common  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE 
-nostdinc   -include 
/usr/obj/usr/src/powerpc.powerpc64/sys/modules/ossl/opt_global.h -I. 
-I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fPIC -mlongcall 
-fno-omit-frame-pointer 
-fdebug-prefix-map=./machine=/usr/src/sys/powerpc/include -MD  
-MF.depend.ossl.o -MTossl.o -mno-altivec -msoft-float -mabi=elfv2 
-ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ 
-Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas 
-Wno-error-tautological-compare -Wno-error-empty-body 
-Wno-error-parentheses-equality -Wno-error-unused-function 
-Wno-error-pointer-sign -Wno-error-shift-negative-value 
-Wno-address-of-packed-member -Wno-format-zero-length -std=iso9899:1999 -c 
/usr/src/sys/crypto/openssl/ossl.c -o ossl.o
/usr/src/sys/crypto/openssl/ossl.c:190:4: error: implicit declaration of 
function 'fpu_kern_enter' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
 fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
 ^
/usr/src/sys/crypto/openssl/ossl.c:190:36: error: use of undeclared identifier 
'FPU_KERN_NOCTX'
 fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
 ^
/usr/src/sys/crypto/openssl/ossl.c:193:4: error: implicit declaration of 
function 'fpu_kern_leave' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
 fpu_kern_leave(curthread, NULL);
 ^
/usr/src/sys/crypto/openssl/ossl.c:193:4: note: did you mean 'fpu_kern_enter'?
/usr/src/sys/crypto/openssl/ossl.c:190:4: note: 'fpu_kern_enter' declared here
 fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
 ^
/usr/src/sys/crypto/openssl/ossl.c:214:6: error: implicit declaration of 
function 'is_fpu_kern_thread' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
 if (is_fpu_kern_thread(0)) {
 ^
/usr/src/sys/crypto/openssl/ossl.c:217:3: error: implicit declaration of 
function 'fpu_kern_enter' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
 fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
 ^
/usr/src/sys/crypto/openssl/ossl.c:217:35: error: use of undeclared identifier 
'FPU_KERN_NOCTX'
 fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
 ^
/usr/src/sys/crypto/openssl/ossl.c:263:3: error: implicit declaration of 
function 'fpu_kern_leave' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
 fpu_kern_leave(curthread, NULL);
 ^
7 errors generated.

AFAIK porting those is not easy and it's certainly above my pay grade.


Do the powerpc instructions use additional registers that are not part of the 
normal
GPRs saved/restored on a context switch?  If so, then, yes, you will need to 
implement
something here (though the FPU_KERN_NOCTX variant is a bit simpler as it 
disables
context switches and it's sufficient just to init the registers and permit 
accesses
without raising a trap until fpu_kern_leave).  If not, then you can make the 
use of
those functions conditional on architecture.


On 21-11-24 08:15:26, John Baldwin wrote:

On 11/23/21 2:27 PM, Piotr Kubaj wrote:

The branch main has been updated by pkubaj (ports committer):

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

commit 3a60869237b8b315fe66497cf5299ec08b688533
Author: Piotr Kubaj 
AuthorDate: 2021-11-22 02:28:46 +
Commit: Piotr Kubaj 
CommitDate: 2021-11-23 22:26:53 +

  Add assembly optimized code for OpenSSL on powerpc, powerpc64 and 
powerpc64le
  
  Summary:

  1. 
https://github.com/openssl/openssl/commit/34ab13b7d8e3e723adb60be8142e38b7c9cd382a
  needs to be merged for ELFv2 support on big-endian.
  2. crypto/openssl/crypto/ppccap.c needs to be patched.
  Same reason as in https://github.com/openssl/openssl/pull/17082.


Have you looked at adding powerpc support to ossl(4)?  It should be fairly 
simple
(just adding the right asm files in Makefiles and the powerpc equivalent of
OSSL_cpuid).

--
John Baldwin



--
John Baldwin



git: 09100f936be0 - main - netinet: Remove in_cksum_update()

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 09100f936be0684aa8caef441b96345960fd9c72
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:15:40 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:15 +

netinet: Remove in_cksum_update()

It was never implemented on powerpc or riscv and appears to have been
unused since it was added in 1998.  No functional change intended.

Reviewed by:kp, glebius, cy
MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33093
---
 sys/amd64/include/in_cksum.h   | 29 -
 sys/i386/include/in_cksum.h| 19 ---
 sys/mips/include/in_cksum.h| 29 -
 sys/powerpc/include/in_cksum.h | 29 -
 4 files changed, 106 deletions(-)

diff --git a/sys/amd64/include/in_cksum.h b/sys/amd64/include/in_cksum.h
index 79d30cafbc90..89ff1097f369 100644
--- a/sys/amd64/include/in_cksum.h
+++ b/sys/amd64/include/in_cksum.h
@@ -45,35 +45,6 @@
 
 #define in_cksum(m, len)   in_cksum_skip(m, len, 0)
 
-#if defined(IPVERSION) && (IPVERSION == 4)
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five 32-bit words.
- */
-#ifdef __CC_SUPPORTS___INLINE
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
-   int __tmpsum;
-   __tmpsum = (int)ntohs(ip->ip_sum) + 256;
-   ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
-
-#else
-
-#definein_cksum_update(ip) \
-   do { \
-   int __tmpsum; \
-   __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
-   ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
-   } while(0)
-
-#endif
-#endif
-
 #ifdef _KERNEL
 #if defined(IPVERSION) && (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *ip);
diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h
index 87c18ec4066d..a8214e97cd9a 100644
--- a/sys/i386/include/in_cksum.h
+++ b/sys/i386/include/in_cksum.h
@@ -83,14 +83,6 @@ in_cksum_hdr(const struct ip *ip)
 
return ~sum & 0x;
 }
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
-   int __tmpsum;
-   __tmpsum = (int)ntohs(ip->ip_sum) + 256;
-   ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
 #endif
 
 static __inline u_short
@@ -123,17 +115,6 @@ in_pseudo(u_int sum, u_int b, u_int c)
sum -= 0x;
return (sum);
 }
-
-#else
-#if defined(IPVERSION) && (IPVERSION == 4)
-#definein_cksum_update(ip) \
-   do { \
-   int __tmpsum; \
-   __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
-   ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
-   } while(0)
-
-#endif
 #endif
 
 #ifdef _KERNEL
diff --git a/sys/mips/include/in_cksum.h b/sys/mips/include/in_cksum.h
index d55b838b42ed..580fb9c024f8 100644
--- a/sys/mips/include/in_cksum.h
+++ b/sys/mips/include/in_cksum.h
@@ -42,35 +42,6 @@
 
 #definein_cksum(m, len)in_cksum_skip(m, len, 0)
 
-#if defined(IPVERSION) && (IPVERSION == 4)
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five 32-bit words.
- */
-#ifdef __CC_SUPPORTS___INLINE
-
-static __inline void
-in_cksum_update(struct ip *ip)
-{
-   int __tmpsum;
-   __tmpsum = (int)ntohs(ip->ip_sum) + 256;
-   ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
-}
-
-#else
-
-#definein_cksum_update(ip) 
\
-   do {\
-   int __tmpsum;   \
-   __tmpsum = (int)ntohs(ip->ip_sum) + 256;\
-   ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));\
-   } while(0)
-
-#endif
-#endif
-
 #ifdef _KERNEL
 #if defined(IPVERSION) && (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *ip);
diff --git a/sys/powerpc/include/in_cksum.h b/sys/powerpc/include/in_cksum.h
index fd34e13d3822..7407b4ad7104 100644
--- a/sys/powerpc/include/in_cksum.h
+++ b/sys/powerpc/include/in_cksum.h
@@ -41,35 +41,6 @@
 
 #define in_cksum(m, len)   in_cksum_skip(m, len, 0)
 
-#if defined(IPVERSION) && (IPVERSION == 4)
-/*
- * It it useful to have an Internet checksum routine which is inlineable
- * and optimized specifically for the task of computing IP header checksums
- * in the normal case (where there are no options and the header length is
- * therefore always exactly five

git: 5195bcc2126b - main - netinet: Remove in_cksum.c

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 5195bcc2126b302802643f5204d1030e5893fb62
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:19:34 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:16 +

netinet: Remove in_cksum.c

It does not get compiled into the kernel.  No functional change
inteneded.

Reviewed by:kp, glebius, cy
MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33094
---
 sys/netinet/in_cksum.c | 148 -
 1 file changed, 148 deletions(-)

diff --git a/sys/netinet/in_cksum.c b/sys/netinet/in_cksum.c
deleted file mode 100644
index 64a69760dab7..
--- a/sys/netinet/in_cksum.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * Copyright (c) 1988, 1992, 1993
- * The Regents of the University of California.  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.
- * 3. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
- *
- * @(#)in_cksum.c  8.1 (Berkeley) 6/10/93
- */
-
-#include 
-__FBSDID("$FreeBSD$");
-
-#include 
-#include 
-
-/*
- * Checksum routine for Internet Protocol family headers (Portable Version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x)  (x > 65535 ? x -= 65535 : x)
-#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; 
ADDCARRY(sum);}
-
-int
-in_cksum(struct mbuf *m, int len)
-{
-   u_short *w;
-   int sum = 0;
-   int mlen = 0;
-   int byte_swapped = 0;
-
-   union {
-   charc[2];
-   u_short s;
-   } s_util;
-   union {
-   u_short s[2];
-   longl;
-   } l_util;
-
-   for (;m && len; m = m->m_next) {
-   if (m->m_len == 0)
-   continue;
-   w = mtod(m, u_short *);
-   if (mlen == -1) {
-   /*
-* The first byte of this mbuf is the continuation
-* of a word spanning between this mbuf and the
-* last mbuf.
-*
-* s_util.c[0] is already saved when scanning previous
-* mbuf.
-*/
-   s_util.c[1] = *(char *)w;
-   sum += s_util.s;
-   w = (u_short *)((char *)w + 1);
-   mlen = m->m_len - 1;
-   len--;
-   } else
-   mlen = m->m_len;
-   if (len < mlen)
-   mlen = len;
-   len -= mlen;
-   /*
-* Force to even boundary.
-*/
-   if ((1 & (uintptr_t) w) && (mlen > 0)) {
-   REDUCE;
-   sum <<= 8;
-   s_util.c[0] = *(u_char *)w;
-   w = (u_short *)((char *)w + 1);
-   mlen--;
-   byte_swapped = 1;
-   }
-   /*
-* Unroll the loop to make overhead from
-* branches &c small.
-*/
-   while ((mlen -= 32) >= 0) {
-   sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
-   

git: 0d9c3423f59b - main - netinet: Implement in_cksum_skip() using m_apply()

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 0d9c3423f59bb305301f5a5bc7c8f5daf7b7aa52
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:19:54 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:16 +

netinet: Implement in_cksum_skip() using m_apply()

This allows it to work with unmapped mbufs.  In particular,
in_cksum_skip() calls no longer need to be preceded by calls to
mb_unmapped_to_ext() to avoid a page fault.

PR: 259645
Reviewed by:gallatin, glebius, jhb
MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33096
---
 sys/netinet/in_cksum.c | 63 +-
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/sys/netinet/in_cksum.c b/sys/netinet/in_cksum.c
index 581950c8afa4..98317d4dac4a 100644
--- a/sys/netinet/in_cksum.c
+++ b/sys/netinet/in_cksum.c
@@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * These implementations may be overridden on a per-platform basis.
+ * These implementations may be overridden on a per-platform basis.  On
+ * platforms with a direct map, the implementation of in_cksum() must handle
+ * unmapped mbufs.
  */
 #ifndef HAVE_MD_IN_CKSUM
 
@@ -203,44 +205,43 @@ in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
return (sum);
 }
 
+struct cksum_skip_partial_args {
+   uint64_t csum;
+   int clen;
+};
+
+static int
+in_cksum_skip_partial(void *arg, void *data, u_int len)
+{
+   struct cksum_skip_partial_args *a;
+
+   a = arg;
+if (((uintptr_t)data ^ a->clen) & 1)
+a->csum += in_cksumdata(data, len) << 8;
+else
+a->csum += in_cksumdata(data, len);
+   a->clen += len;
+   return (0);
+}
+
 u_short
 in_cksum_skip(struct mbuf *m, int len, int skip)
 {
-   u_int64_t sum = 0;
-   int mlen = 0;
-   int clen = 0;
-   caddr_t addr;
+   struct cksum_skip_partial_args a;
union q_util q_util;
union l_util l_util;
+   uint64_t sum;
 
len -= skip;
-   for (; skip && m; m = m->m_next) {
-   if (m->m_len > skip) {
-   mlen = m->m_len - skip;
-   addr = mtod(m, caddr_t) + skip;
-   goto skip_start;
-   } else {
-   skip -= m->m_len;
-   }
-   }
-
-   for (; m && len; m = m->m_next) {
-   if (m->m_len == 0)
-   continue;
-   mlen = m->m_len;
-   addr = mtod(m, caddr_t);
-skip_start:
-   if (len < mlen)
-   mlen = len;
-
-   if ((clen ^ (uintptr_t) addr) & 1)
-   sum += in_cksumdata(addr, mlen) << 8;
-   else
-   sum += in_cksumdata(addr, mlen);
 
-   clen += mlen;
-   len -= mlen;
-   }
+   /*
+* The use of m_apply() allows this routine to operate on unmapped
+* mbufs.
+*/
+   a.csum = 0;
+   a.clen = 0;
+   (void)m_apply(m, skip, len, in_cksum_skip_partial, &a);
+   sum = a.csum;
REDUCE16;
return (~sum & 0x);
 }



git: 44775b163bfa - main - netinet: Remove unneeded mb_unmapped_to_ext() calls

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 44775b163bfa902ea96658343e852062e2e67a8e
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:20:09 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:16 +

netinet: Remove unneeded mb_unmapped_to_ext() calls

in_cksum_skip() now handles unmapped mbufs on platforms where they're
permitted.

Reviewed by:glebius, jhb
MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33097
---
 sys/netinet/ip_divert.c  |  6 
 sys/netinet/ip_output.c  | 21 ---
 sys/netinet6/ip6_output.c| 62 ++--
 sys/netipsec/ipsec_output.c  | 12 ---
 sys/netpfil/ipfw/nat64/nat64_translate.c | 10 --
 sys/netpfil/pf/pf.c  |  6 
 6 files changed, 32 insertions(+), 85 deletions(-)

diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index fb4eba220703..265fc1918d82 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -212,9 +212,6 @@ divert_packet(struct mbuf *m, bool incoming)
 
/* Delayed checksums are currently not compatible with divert. */
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
-   m = mb_unmapped_to_ext(m);
-   if (m == NULL)
-   return;
in_delayed_cksum(m);
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
@@ -226,9 +223,6 @@ divert_packet(struct mbuf *m, bool incoming)
 #endif
 #ifdef INET6
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) {
-   m = mb_unmapped_to_ext(m);
-   if (m == NULL)
-   return;
in6_delayed_cksum(m, m->m_pkthdr.len -
sizeof(struct ip6_hdr), sizeof(struct ip6_hdr));
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6;
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index cfa6b1919a06..e30339f8c4aa 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -733,23 +733,20 @@ sendit:
}
}
 
-   m->m_pkthdr.csum_flags |= CSUM_IP;
-   if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) {
+   /* Ensure the packet data is mapped if the interface requires it. */
+   if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) {
m = mb_unmapped_to_ext(m);
if (m == NULL) {
IPSTAT_INC(ips_odropped);
error = ENOBUFS;
goto bad;
}
+   }
+
+   m->m_pkthdr.csum_flags |= CSUM_IP;
+   if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) {
in_delayed_cksum(m);
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
-   } else if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) {
-   m = mb_unmapped_to_ext(m);
-   if (m == NULL) {
-   IPSTAT_INC(ips_odropped);
-   error = ENOBUFS;
-   goto bad;
-   }
}
 #if defined(SCTP) || defined(SCTP_SUPPORT)
if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) {
@@ -894,12 +891,6 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu,
 * fragmented packets, then do it here.
 */
if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
-   m0 = mb_unmapped_to_ext(m0);
-   if (m0 == NULL) {
-   error = ENOBUFS;
-   IPSTAT_INC(ips_odropped);
-   goto done;
-   }
in_delayed_cksum(m0);
m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index fedb6c6b6c78..6091951e2ba2 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -212,42 +212,26 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short 
offset)
*(u_short *)mtodo(m, offset) = csum;
 }
 
-static int
+static void
 ip6_output_delayed_csum(struct mbuf *m, struct ifnet *ifp, int csum_flags,
-int plen, int optlen, bool frag)
+int plen, int optlen)
 {
 
KASSERT((plen >= optlen), ("%s:%d: plen %d < optlen %d, m %p, ifp %p "
-   "csum_flags %#x frag %d\n",
-   __func__, __LINE__, plen, optlen, m, ifp, csum_flags, frag));
+   "csum_flags %#x",
+   __func__, __LINE__, plen, optlen, m, ifp, csum_flags));
 
-   if ((csum_flags & CSUM_DELAY_DATA_IPV6) ||
-#if defined(SCTP) || defined(SCTP_SUPPORT)
-   (csum_flags & CSUM_SCTP_IPV6) ||
-#endif
-   (!frag && (ifp->if_capenable & IFCAP_MEXTPG) == 0)) {
-   m = mb_unmapped_to_ext(m);
-   if (m == NULL) {
-

git: ecbbe831445a - main - netinet: Deduplicate most in_cksum() implementations

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit ecbbe831445a4b94279e5932828d60076e4ca444
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:19:44 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:16 +

netinet: Deduplicate most in_cksum() implementations

in_cksum() and related routines are implemented separately for each
platform, but only i386 and arm have optimized versions.  Other
platforms' copies of in_cksum.c are identical except for style
differences and support for big-endian CPUs.

Deduplicate the implementations for the rest of the platforms.  This
will make it easier to implement in_cksum() for unmapped mbufs.  On arm
and i386, define HAVE_MD_IN_CKSUM to mean that the MI implementation is
not to be compiled.

No functional change intended.

Reviewed by:kp, glebius
MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33095
---
 sys/amd64/amd64/in_cksum.c   | 243 --
 sys/arm/arm/{in_cksum.c => in_cksum_machdep.c}   |   0
 sys/arm/include/in_cksum.h   |   3 +
 sys/arm64/arm64/in_cksum.c   | 241 -
 sys/conf/files   |   1 +
 sys/conf/files.amd64 |   1 -
 sys/conf/files.arm   |   2 +-
 sys/conf/files.arm64 |   1 -
 sys/conf/files.i386  |   2 +-
 sys/conf/files.mips  |   1 -
 sys/conf/files.powerpc   |   1 -
 sys/conf/files.riscv |   1 -
 sys/i386/i386/{in_cksum.c => in_cksum_machdep.c} |   0
 sys/i386/include/in_cksum.h  |   3 +
 sys/{mips/mips => netinet}/in_cksum.c|   7 +
 sys/powerpc/powerpc/in_cksum.c   | 253 ---
 sys/riscv/riscv/in_cksum.c   | 243 --
 17 files changed, 16 insertions(+), 987 deletions(-)

diff --git a/sys/amd64/amd64/in_cksum.c b/sys/amd64/amd64/in_cksum.c
deleted file mode 100644
index 30e90f043cc3..
--- a/sys/amd64/amd64/in_cksum.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */
-
-/*-
- * SPDX-License-Identifier: BSD-4-Clause
- *
- * Copyright (c) 1988, 1992, 1993
- * The Regents of the University of California.  All rights reserved.
- * Copyright (c) 1996
- * Matt Thomas 
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
- *
- * @(#)in_cksum.c  8.1 (Berkeley) 6/10/93
- */
-
-#include  /* RCS ID & Copyright macro defns */
-__FBSDID("$FreeBSD$");
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Checksum routine for Internet Protocol family headers
- *(Portable Alpha version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x)  (x > 65535 ? x -= 65535 : x)
-#define REDUCE32 

git: 517373f72302 - main - natd: Remove uneeded in_cksum.h includes

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 517373f7230207e60e4561bc44c8b3c44acea963
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:30:28 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:16 +

natd: Remove uneeded in_cksum.h includes

MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
---
 sbin/natd/icmp.c | 1 -
 sbin/natd/natd.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/sbin/natd/icmp.c b/sbin/natd/icmp.c
index 1509b965f4b8..f85457ac4773 100644
--- a/sbin/natd/icmp.c
+++ b/sbin/natd/icmp.c
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c
index 268850c0a95a..402c430dfdfd 100644
--- a/sbin/natd/natd.c
+++ b/sbin/natd/natd.c
@@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



git: 60c95f316374 - main - safexcel: Fix -Wunused-but-set-variable warnings

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 60c95f316374fdd383f70b50e98ad097460accf3
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:30:39 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 18:31:16 +

safexcel: Fix -Wunused-but-set-variable warnings

MFC after:  1 week
Sponsored by:   The FreeBSD Foundation
---
 sys/dev/safexcel/safexcel.c | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c
index 36bd65642403..dc43b7dfc026 100644
--- a/sys/dev/safexcel/safexcel.c
+++ b/sys/dev/safexcel/safexcel.c
@@ -168,7 +168,7 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx)
struct safexcel_res_descr *rdesc;
struct safexcel_request *req;
struct safexcel_ring *ring;
-   uint32_t blocked, error, i, ncdescs, nrdescs, nreqs;
+   uint32_t blocked, error, i, nrdescs, nreqs;
 
blocked = 0;
ring = &sc->sc_ring[ringidx];
@@ -194,7 +194,7 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx)
bus_dmamap_sync(ring->dma_atok.tag, ring->dma_atok.map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
-   ncdescs = nrdescs = 0;
+   nrdescs = 0;
for (i = 0; i < nreqs; i++) {
req = safexcel_next_request(ring);
 
@@ -203,7 +203,6 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx)
bus_dmamap_sync(ring->data_dtag, req->dmap,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
-   ncdescs += req->cdescs;
while (req->cdescs-- > 0) {
cdesc = safexcel_cmd_descr_next(&ring->cdr);
KASSERT(cdesc != NULL,
@@ -306,7 +305,6 @@ static int
 safexcel_configure(struct safexcel_softc *sc)
 {
uint32_t i, mask, pemask, reg;
-   device_t dev;
 
if (sc->sc_type == 197) {
sc->sc_offsets = eip197_regs_offset;
@@ -316,8 +314,6 @@ safexcel_configure(struct safexcel_softc *sc)
pemask = EIP97_N_PES_MASK;
}
 
-   dev = sc->sc_dev;
-
/* Scan for valid ring interrupt controllers. */
for (i = 0; i < SAFEXCEL_MAX_RING_AIC; i++) {
reg = SAFEXCEL_READ(sc, SAFEXCEL_HIA_AIC_R(sc) +
@@ -1625,12 +1621,10 @@ static void
 safexcel_instr_eta(struct safexcel_request *req, struct safexcel_instr *instr,
 struct safexcel_cmd_descr *cdesc)
 {
-   const struct crypto_session_params *csp;
struct cryptop *crp;
struct safexcel_instr *start;
 
crp = req->crp;
-   csp = crypto_get_params(crp->crp_session);
start = instr;
 
/* Insert the AAD. */
@@ -2452,9 +2446,7 @@ safexcel_newsession(device_t dev, crypto_session_t cses,
 const struct crypto_session_params *csp)
 {
struct safexcel_session *sess;
-   struct safexcel_softc *sc;
 
-   sc = device_get_softc(dev);
sess = crypto_get_driver_session(cses);
sess->cses = cses;
 
@@ -2533,7 +2525,6 @@ safexcel_newsession(device_t dev, crypto_session_t cses,
 static int
 safexcel_process(device_t dev, struct cryptop *crp, int hint)
 {
-   const struct crypto_session_params *csp;
struct safexcel_request *req;
struct safexcel_ring *ring;
struct safexcel_session *sess;
@@ -2542,7 +2533,6 @@ safexcel_process(device_t dev, struct cryptop *crp, int 
hint)
 
sc = device_get_softc(dev);
sess = crypto_get_driver_session(crp->crp_session);
-   csp = crypto_get_params(crp->crp_session);
 
if (__predict_false(crypto_buffer_len(&crp->crp_buf) >
SAFEXCEL_MAX_REQUEST_SIZE)) {



git: d9ed1dcc5c68 - main - acpi: Fix error code returned in acpi_bus_get_prop

2021-11-24 Thread Marcin Wojtas
The branch main has been updated by mw:

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

commit d9ed1dcc5c6894e376e6e4ef6f2554dd056baf4e
Author: Bartlomiej Grzesik 
AuthorDate: 2021-11-22 14:05:57 +
Commit: Marcin Wojtas 
CommitDate: 2021-11-24 18:42:43 +

acpi: Fix error code returned in acpi_bus_get_prop

ACPI implementation of device_get_property would return "-1" when
property was found, but it's type wasn't supported.
This causes device_has_property to return false in that scenario, which
arguably could be considered as incorrect.

Fix that by returning "0" in that case.

Reviewed by: bz, mw
Tested by: mw
MFC after: 2 weeks
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D33103
---
 sys/dev/acpica/acpi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 5d2b895bbe88..9b728b84bd12 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1849,9 +1849,10 @@ acpi_bus_get_prop(device_t bus, device_t child, const 
char *propname,
memcpy(propvalue, obj->Buffer.Pointer,
MIN(size, obj->Buffer.Length));
return (obj->Buffer.Length);
-   }
 
-   return (-1);
+   default:
+   return (0);
+   }
 }
 
 int



Re: git: a46722b58056 - main - ncurses: register formw as usable lib for LIBADD

2021-11-24 Thread Ed Maste
On Wed, 24 Nov 2021 at 10:49, Baptiste Daroussin  wrote:
>
> I think it should be fixed, I don't think it is necessary to add it to the
> prebuild_libs

https://ci.freebsd.org/tinderbox/ (at e052f7269108) and
https://cirrus-ci.com/github/freebsd/freebsd-src/main (at 05ea7a3
right now) are still red.



git: 45c09a74d681 - main - vm_fault: Move nera into faultstate

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit 45c09a74d681cfcad0a556b753cd56f6084ace46
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:42:32 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 19:02:55 +

vm_fault: Move nera into faultstate

This makes it easier to factor out pieces of vm_fault().  No functional
change intended.

Obtained from:  jeff (object_concurrency patches)
Reviewed by:kib
MFC after:  2 weeks
Differential Revision:  https://reviews.freebsd.org/D33016
---
 sys/vm/vm_fault.c | 62 ++-
 1 file changed, 34 insertions(+), 28 deletions(-)

diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index d459bad78dd8..75868c17d32d 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -125,9 +125,12 @@ struct faultstate {
vm_prot_t   fault_type;
vm_prot_t   prot;
int fault_flags;
+   boolean_t   wired;
+
+   /* Control state. */
struct timeval  oom_start_time;
booloom_started;
-   boolean_t   wired;
+   int nera;
 
/* Page reference for cow. */
vm_page_t m_cow;
@@ -1184,7 +1187,7 @@ vm_fault_allocate(struct faultstate *fs)
  * pages at the same time.
  */
 static int
-vm_fault_getpages(struct faultstate *fs, int nera, int *behindp, int *aheadp)
+vm_fault_getpages(struct faultstate *fs, int *behindp, int *aheadp)
 {
vm_offset_t e_end, e_start;
int ahead, behind, cluster_offset, rv;
@@ -1202,6 +1205,20 @@ vm_fault_getpages(struct faultstate *fs, int nera, int 
*behindp, int *aheadp)
e_end = fs->entry->end;
behavior = vm_map_entry_behavior(fs->entry);
 
+   /*
+* If the pager for the current object might have
+* the page, then determine the number of additional
+* pages to read and potentially reprioritize
+* previously read pages for earlier reclamation.
+* These operations should only be performed once per
+* page fault.  Even if the current pager doesn't
+* have the page, the number of additional pages to
+* read will apply to subsequent objects in the
+* shadow chain.
+*/
+   if (fs->nera == -1 && !P_KILLED(curproc))
+   fs->nera = vm_fault_readahead(fs);
+
/*
 * Release the map lock before locking the vnode or
 * sleeping in the pager.  (If the current object has
@@ -1221,15 +1238,15 @@ vm_fault_getpages(struct faultstate *fs, int nera, int 
*behindp, int *aheadp)
 * Page in the requested page and hint the pager,
 * that it may bring up surrounding pages.
 */
-   if (nera == -1 || behavior == MAP_ENTRY_BEHAV_RANDOM ||
+   if (fs->nera == -1 || behavior == MAP_ENTRY_BEHAV_RANDOM ||
P_KILLED(curproc)) {
behind = 0;
ahead = 0;
} else {
/* Is this a sequential fault? */
-   if (nera > 0) {
+   if (fs->nera > 0) {
behind = 0;
-   ahead = nera;
+   ahead = fs->nera;
} else {
/*
 * Request a cluster of pages that is
@@ -1261,8 +1278,14 @@ vm_fault_getpages(struct faultstate *fs, int nera, int 
*behindp, int *aheadp)
 * outside the range of the pager, clean up and return
 * an error.
 */
-   if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD)
+   if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) {
+   VM_OBJECT_WLOCK(fs->object);
+   fault_page_free(&fs->m);
+   unlock_and_deallocate(fs);
return (KERN_OUT_OF_BOUNDS);
+   }
+   KASSERT(rv == VM_PAGER_FAIL,
+   ("%s: unepxected pager error %d", __func__, rv));
return (KERN_NOT_RECEIVER);
 }
 
@@ -1307,7 +1330,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t 
fault_type,
 {
struct faultstate fs;
int ahead, behind, faultcount;
-   int nera, result, rv;
+   int result, rv;
bool dead, hardfault;
 
VM_CNT_INC(v_vm_faults);
@@ -1322,8 +1345,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t 
fault_type,
fs.map = map;
fs.lookup_still_valid = false;
fs.oom_started = false;
+   fs.nera = -1;
faultcount = 0;
-   nera = -1;
hardfault = false;
 
 RetryFault:
@@ -1490,21 +1513,7 @@ RetryFault:
 */
VM_OBJECT_WUNLOCK(fs.object);
 
-   /*
-* If the pager for the current object might have
-* the page, then determine the number of additional
-* pages to read and potentially reprioritize
-* pr

git: f1b642c255a2 - main - vm_fault: Introduce a fault_status enum for internal return types

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit f1b642c255a2931fd793219d11562310a2ce49c8
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:43:26 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 19:02:55 +

vm_fault: Introduce a fault_status enum for internal return types

Rather than overloading the meanings of the Mach statuses, introduce a
new set for use internally in the fault code.  This makes the control
flow easier to follow and provides some extra error checking when a
fault status variable is used in a switch statement.

vm_fault_lookup() and vm_fault_relookup() continue to use Mach statuses
for now, as there isn't much benefit to converting them and they
effectively pass through a status from vm_map_lookup().

Obtained from:  jeff (object_concurrency patches)
Reviewed by:kib
MFC after:  2 weeks
Differential Revision:  https://reviews.freebsd.org/D33017
---
 sys/vm/vm_fault.c | 202 ++
 1 file changed, 111 insertions(+), 91 deletions(-)

diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 75868c17d32d..0e4d9fd33c6f 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -155,6 +155,19 @@ struct faultstate {
struct vnode*vp;
 };
 
+/*
+ * Return codes for internal fault routines.
+ */
+enum fault_status {
+   FAULT_SUCCESS = 1,  /* Return success to user. */
+   FAULT_FAILURE,  /* Return failure to user. */
+   FAULT_CONTINUE, /* Continue faulting. */
+   FAULT_RESTART,  /* Restart fault. */
+   FAULT_OUT_OF_BOUNDS,/* Invalid address for pager. */
+   FAULT_HARD, /* Performed I/O. */
+   FAULT_SOFT, /* Found valid page. */
+};
+
 static void vm_fault_dontneed(const struct faultstate *fs, vm_offset_t vaddr,
int ahead);
 static void vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra,
@@ -298,7 +311,7 @@ vm_fault_dirty(struct faultstate *fs, vm_page_t m)
 /*
  * Unlocks fs.first_object and fs.map on success.
  */
-static int
+static enum fault_status
 vm_fault_soft_fast(struct faultstate *fs)
 {
vm_page_t m, m_map;
@@ -306,17 +319,20 @@ vm_fault_soft_fast(struct faultstate *fs)
vm_page_t m_super;
int flags;
 #endif
-   int psind, rv;
+   int psind;
vm_offset_t vaddr;
+   enum fault_status res;
 
MPASS(fs->vp == NULL);
+
+   res = FAULT_SUCCESS;
vaddr = fs->vaddr;
vm_object_busy(fs->first_object);
m = vm_page_lookup(fs->first_object, fs->first_pindex);
/* A busy page can be mapped for read|execute access. */
if (m == NULL || ((fs->prot & VM_PROT_WRITE) != 0 &&
vm_page_busied(m)) || !vm_page_all_valid(m)) {
-   rv = KERN_FAILURE;
+   res = FAULT_FAILURE;
goto out;
}
m_map = m;
@@ -351,10 +367,12 @@ vm_fault_soft_fast(struct faultstate *fs)
}
}
 #endif
-   rv = pmap_enter(fs->map->pmap, vaddr, m_map, fs->prot, fs->fault_type |
-   PMAP_ENTER_NOSLEEP | (fs->wired ? PMAP_ENTER_WIRED : 0), psind);
-   if (rv != KERN_SUCCESS)
+   if (pmap_enter(fs->map->pmap, vaddr, m_map, fs->prot, fs->fault_type |
+   PMAP_ENTER_NOSLEEP | (fs->wired ? PMAP_ENTER_WIRED : 0), psind) !=
+   KERN_SUCCESS) {
+   res = FAULT_FAILURE;
goto out;
+   }
if (fs->m_hold != NULL) {
(*fs->m_hold) = m;
vm_page_wire(m);
@@ -368,7 +386,7 @@ vm_fault_soft_fast(struct faultstate *fs)
 
 out:
vm_object_unbusy(fs->first_object);
-   return (rv);
+   return (res);
 }
 
 static void
@@ -417,13 +435,14 @@ vm_fault_populate_cleanup(vm_object_t object, vm_pindex_t 
first,
}
 }
 
-static int
+static enum fault_status
 vm_fault_populate(struct faultstate *fs)
 {
vm_offset_t vaddr;
vm_page_t m;
vm_pindex_t map_first, map_last, pager_first, pager_last, pidx;
int bdry_idx, i, npages, psind, rv;
+   enum fault_status res;
 
MPASS(fs->object == fs->first_object);
VM_OBJECT_ASSERT_WLOCKED(fs->first_object);
@@ -436,6 +455,8 @@ vm_fault_populate(struct faultstate *fs)
unlock_map(fs);
unlock_vp(fs);
 
+   res = FAULT_SUCCESS;
+
/*
 * Call the pager (driver) populate() method.
 *
@@ -456,11 +477,11 @@ vm_fault_populate(struct faultstate *fs)
 */
vm_fault_restore_map_lock(fs);
if (fs->map->timestamp != fs->map_generation)
-   return (KERN_RESTART);
-   return (KERN_NOT_RECEIVER);
+   return (FAULT_RESTART);
+   return (FAULT_CONTINUE);
}
if (rv != VM_PAGER_OK)
-   retu

git: d47d3a94bb2d - main - vm_fault: Factor out per-object operations into vm_fault_object()

2021-11-24 Thread Mark Johnston
The branch main has been updated by markj:

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

commit d47d3a94bb2d873b1c3a5cdfe9cc00e4619f649b
Author: Mark Johnston 
AuthorDate: 2021-11-24 18:43:38 +
Commit: Mark Johnston 
CommitDate: 2021-11-24 19:02:56 +

vm_fault: Factor out per-object operations into vm_fault_object()

No functional change intended.

Obtained from:  jeff (object_concurrency patches)
Reviewed by:kib
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D33018
---
 sys/vm/vm_fault.c | 213 ++
 1 file changed, 118 insertions(+), 95 deletions(-)

diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 0e4d9fd33c6f..a929351257ce 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -166,6 +166,7 @@ enum fault_status {
FAULT_OUT_OF_BOUNDS,/* Invalid address for pager. */
FAULT_HARD, /* Performed I/O. */
FAULT_SOFT, /* Found valid page. */
+   FAULT_PROTECTION_FAILURE, /* Invalid access. */
 };
 
 static void vm_fault_dontneed(const struct faultstate *fs, vm_offset_t vaddr,
@@ -1350,6 +1351,96 @@ vm_fault_busy_sleep(struct faultstate *fs)
vm_object_deallocate(fs->first_object);
 }
 
+/*
+ * Handle page lookup, populate, allocate, page-in for the current
+ * object.
+ *
+ * The object is locked on entry and will remain locked with a return
+ * code of FAULT_CONTINUE so that fault may follow the shadow chain.
+ * Otherwise, the object will be unlocked upon return.
+ */
+static enum fault_status
+vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp)
+{
+   enum fault_status res;
+   bool dead;
+
+   /*
+* If the object is marked for imminent termination, we retry
+* here, since the collapse pass has raced with us.  Otherwise,
+* if we see terminally dead object, return fail.
+*/
+   if ((fs->object->flags & OBJ_DEAD) != 0) {
+   dead = fs->object->type == OBJT_DEAD;
+   unlock_and_deallocate(fs);
+   if (dead)
+   return (FAULT_PROTECTION_FAILURE);
+   pause("vmf_de", 1);
+   return (FAULT_RESTART);
+   }
+
+   /*
+* See if the page is resident.
+*/
+   fs->m = vm_page_lookup(fs->object, fs->pindex);
+   if (fs->m != NULL) {
+   if (!vm_page_tryxbusy(fs->m)) {
+   vm_fault_busy_sleep(fs);
+   return (FAULT_RESTART);
+   }
+
+   /*
+* The page is marked busy for other processes and the
+* pagedaemon.  If it is still completely valid we are
+* done.
+*/
+   if (vm_page_all_valid(fs->m)) {
+   VM_OBJECT_WUNLOCK(fs->object);
+   return (FAULT_SOFT);
+   }
+   }
+   VM_OBJECT_ASSERT_WLOCKED(fs->object);
+
+   /*
+* Page is not resident.  If the pager might contain the page
+* or this is the beginning of the search, allocate a new
+* page.  (Default objects are zero-fill, so there is no real
+* pager for them.)
+*/
+   if (fs->m == NULL && (fs->object->type != OBJT_DEFAULT ||
+   fs->object == fs->first_object)) {
+   res = vm_fault_allocate(fs);
+   if (res != FAULT_CONTINUE)
+   return (res);
+   }
+
+   /*
+* Default objects have no pager so no exclusive busy exists
+* to protect this page in the chain.  Skip to the next
+* object without dropping the lock to preserve atomicity of
+* shadow faults.
+*/
+   if (fs->object->type != OBJT_DEFAULT) {
+   /*
+* At this point, we have either allocated a new page
+* or found an existing page that is only partially
+* valid.
+*
+* We hold a reference on the current object and the
+* page is exclusive busied.  The exclusive busy
+* prevents simultaneous faults and collapses while
+* the object lock is dropped.
+*/
+   VM_OBJECT_WUNLOCK(fs->object);
+   res = vm_fault_getpages(fs, behindp, aheadp);
+   if (res == FAULT_CONTINUE)
+   VM_OBJECT_WLOCK(fs->object);
+   } else {
+   res = FAULT_CONTINUE;
+   }
+   return (res);
+}
+
 int
 vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
 int fault_flags, vm_page_t *m_hold)
@@ -1357,7 +1448,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t 
fault_type,
struct faultstate fs;
int ahead, behind, faultcount, rv;
enum fault_status res;
-   bool dead, hardfault;
+   bool hardfault;

git: 483a226238ed - main - Add ncurses/form to _prebuild_libs to fix build

2021-11-24 Thread Ed Maste
The branch main has been updated by emaste:

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

commit 483a226238ed8949c6d280ae0757a0683962a74b
Author: Ed Maste 
AuthorDate: 2021-11-24 18:56:38 +
Commit: Ed Maste 
CommitDate: 2021-11-24 19:39:37 +

Add ncurses/form to _prebuild_libs to fix build

Reported by:bz
---
 Makefile.inc1 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile.inc1 b/Makefile.inc1
index d8f50cf77d4b..1ba3716a02db 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2943,6 +2943,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
${_lib_casper} \
lib/ncurses/tinfo \
lib/ncurses/ncurses \
+   lib/ncurses/form \
lib/libopie lib/libpam/libpam lib/libthr \
${_lib_libradius} lib/libsbuf lib/libtacplus \
lib/libgeom \
@@ -2982,6 +2983,7 @@ _lib_libradius=   lib/libradius
 .endif
 
 lib/ncurses/ncurses__L:lib/ncurses/tinfo__L
+lib/ncurses/form__L: lib/ncurses/ncurses__L
 
 .if ${MK_OFED} != "no"
 _prebuild_libs+= \



git: ca853dee3b8f - main - iavf(4): Split source and update to 3.0.26-k

2021-11-24 Thread Eric Joyner
The branch main has been updated by erj:

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

commit ca853dee3b8f26f53d48d685f32ec0b8396369e8
Author: Eric Joyner 
AuthorDate: 2021-02-12 21:28:18 +
Commit: Eric Joyner 
CommitDate: 2021-11-24 19:54:08 +

iavf(4): Split source and update to 3.0.26-k

The iavf(4) driver now uses a different source base from ixl(4), since
it will be the standard VF driver for new Intel Ethernet products going
forward, including ice(4). It continues to use the iflib framework
for network drivers.

Since it now uses a different source code base, this commit adds a new
sys/dev/iavf entry, but it re-uses the existing module name so no
configuration changes are necessary.

Signed-off-by: Eric Joyner 

Reviewed by:kbowling@
Tested by:  lukasz.szczepan...@intel.com
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D28636
---
 sys/conf/files.amd64   |   34 +-
 sys/dev/iavf/iavf_adminq.c |  990 +
 sys/dev/iavf/iavf_adminq.h |  122 ++
 sys/dev/iavf/iavf_adminq_cmd.h |  678 
 sys/dev/iavf/iavf_alloc.h  |   64 ++
 sys/dev/iavf/iavf_common.c | 1053 ++
 sys/dev/iavf/iavf_debug.h  |  131 +++
 sys/dev/iavf/iavf_devids.h |   45 +
 sys/dev/iavf/iavf_drv_info.h   |   78 ++
 sys/dev/iavf/iavf_iflib.h  |  407 +++
 sys/dev/iavf/iavf_lib.c| 1531 ++
 sys/dev/iavf/iavf_lib.h|  512 +
 sys/dev/iavf/iavf_opts.h   |   48 +
 sys/dev/iavf/iavf_osdep.c  |  405 +++
 sys/dev/iavf/iavf_osdep.h  |  250 +
 sys/dev/iavf/iavf_prototype.h  |  122 ++
 sys/dev/iavf/iavf_register.h   |  121 ++
 sys/dev/iavf/iavf_status.h |  107 ++
 sys/dev/iavf/iavf_sysctls_common.h |  158 +++
 sys/dev/iavf/iavf_sysctls_iflib.h  |   46 +
 sys/dev/iavf/iavf_txrx_common.h|   93 ++
 sys/dev/iavf/iavf_txrx_iflib.c |  789 +
 sys/dev/iavf/iavf_type.h   | 1037 +
 sys/dev/iavf/iavf_vc_common.c  | 1330 ++
 sys/dev/iavf/iavf_vc_common.h  |   83 ++
 sys/dev/iavf/iavf_vc_iflib.c   |  178 +++
 sys/dev/iavf/if_iavf_iflib.c   | 2138 
 sys/dev/iavf/virtchnl.h|  991 +
 sys/modules/iavf/Makefile  |   11 +-
 29 files changed, 13536 insertions(+), 16 deletions(-)

diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 9a741906c868..125a8cff6705 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -110,6 +110,22 @@ dev/axgbe/xgbe-i2c.c   optionalaxp
 dev/axgbe/xgbe-phy-v2.coptionalaxp
 dev/hyperv/vmbus/amd64/hyperv_machdep.coptional
hyperv
 dev/hyperv/vmbus/amd64/vmbus_vector.S  optionalhyperv
+dev/iavf/if_iavf_iflib.c   optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_lib.coptionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_osdep.c  optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_txrx_iflib.c optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_common.c optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_adminq.c optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_vc_common.c  optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
+dev/iavf/iavf_vc_iflib.c   optionaliavf pci \
+   compile-with "${NORMAL_C} -I$S/dev/iavf"
 dev/ice/if_ice_iflib.c optionalice pci \
compile-with "${NORMAL_C} -I$S/dev/ice"
 dev/ice/ice_lib.c  optionalice pci \
@@ -172,23 +188,19 @@ dev/ixl/ixl_pf_iov.c  optionalixl pci 
 pci_iov \
compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/ixl_pf_i2c.c   optionalixl pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
-dev/ixl/if_iavf.c  optionaliavf pci \
+dev/ixl/ixl_txrx.c optionalixl pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
-dev/ixl/iavf_vc.c  optionaliavf pci \
+dev/ixl/i40e_osdep.c   optionalixl pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
-dev/ixl/ixl_txrx.c optionalixl pci | iavf pci \
+dev/ixl/i40e_lan_hmc.c optionalixl pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
-dev/ixl/i40e_osdep.c   optionalixl pci | iavf pci \
+dev/ixl/i40e_hmc.c optionalixl pci \
compi

git: 409b36ad911d - main - ixl(4): Remove iavf(4) source files

2021-11-24 Thread Eric Joyner
The branch main has been updated by erj:

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

commit 409b36ad911d0a12a45c1488369b458965691379
Author: Eric Joyner 
AuthorDate: 2021-02-13 00:04:54 +
Commit: Eric Joyner 
CommitDate: 2021-11-24 19:54:08 +

ixl(4): Remove iavf(4) source files

Since iavf(4) no longer shares code with ixl(4) as of commit
f2fbd56a8d07665bc0a5e8b7e40026b50a591e2a and now has its own directory,
remove these now-unused iavf(4)-only files.

Signed-off-by: Eric Joyner 

Sponsored by: Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D28638
---
 sys/dev/ixl/iavf.h|  225 -
 sys/dev/ixl/iavf_vc.c | 1010 
 sys/dev/ixl/if_iavf.c | 2448 -
 3 files changed, 3683 deletions(-)

diff --git a/sys/dev/ixl/iavf.h b/sys/dev/ixl/iavf.h
deleted file mode 100644
index 9a7716c5e5a2..
--- a/sys/dev/ixl/iavf.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
-
-  Copyright (c) 2013-2018, Intel Corporation
-  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.
-  
-   3. Neither the name of the Intel Corporation nor the names of its 
-  contributors may be used to endorse or promote products derived from 
-  this software without specific prior written permission.
-  
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
-
-**/
-/*$FreeBSD$*/
-
-
-#ifndef _IAVF_H_
-#define _IAVF_H_
-
-#include "ixl.h"
-
-#define IAVF_AQ_MAX_ERR200
-#define IAVF_MAX_FILTERS   128
-#define IAVF_MAX_QUEUES16
-#define IAVF_AQ_TIMEOUT(1 * hz)
-
-/* MacVlan Flags */
-#define IAVF_FILTER_USED   (u16)(1 << 0)
-#define IAVF_FILTER_VLAN   (u16)(1 << 1)
-#define IAVF_FILTER_ADD(u16)(1 << 2)
-#define IAVF_FILTER_DEL(u16)(1 << 3)
-#define IAVF_FILTER_MC (u16)(1 << 4)
-
-#define IAVF_FLAG_AQ_ENABLE_QUEUES(u32)(1 << 0)
-#define IAVF_FLAG_AQ_DISABLE_QUEUES   (u32)(1 << 1)
-#define IAVF_FLAG_AQ_ADD_MAC_FILTER   (u32)(1 << 2)
-#define IAVF_FLAG_AQ_ADD_VLAN_FILTER  (u32)(1 << 3)
-#define IAVF_FLAG_AQ_DEL_MAC_FILTER   (u32)(1 << 4)
-#define IAVF_FLAG_AQ_DEL_VLAN_FILTER  (u32)(1 << 5)
-#define IAVF_FLAG_AQ_CONFIGURE_QUEUES (u32)(1 << 6)
-#define IAVF_FLAG_AQ_MAP_VECTORS  (u32)(1 << 7)
-#define IAVF_FLAG_AQ_HANDLE_RESET (u32)(1 << 8)
-#define IAVF_FLAG_AQ_CONFIGURE_PROMISC(u32)(1 << 9)
-#define IAVF_FLAG_AQ_GET_STATS(u32)(1 << 10)
-#define IAVF_FLAG_AQ_CONFIG_RSS_KEY   (u32)(1 << 11)
-#define IAVF_FLAG_AQ_SET_RSS_HENA (u32)(1 << 12)
-#define IAVF_FLAG_AQ_GET_RSS_HENA_CAPS(u32)(1 << 13)
-#define IAVF_FLAG_AQ_CONFIG_RSS_LUT   (u32)(1 << 14)
-
-/* printf %b flag args */
-#define IAVF_FLAGS \
-"\20\1ENABLE_QUEUES\2DISABLE_QUEUES\3ADD_MAC_FILTER" \
-"\4ADD_VLAN_FILTER\5DEL_MAC_FILTER\6DEL_VLAN_FILTER" \
-"\7CONFIGURE_QUEUES\10MAP_VECTORS\11HANDLE_RESET" \
-"\12CONFIGURE_PROMISC\13GET_STATS\14CONFIG_RSS_KEY" \
-"\15SET_RSS_HENA\16GET_RSS_HENA_CAPS\17CONFIG_RSS_LUT"
-#define IAVF_PRINTF_VF_OFFLOAD_FLAGS \
-"\20\1L2" \
-"\2IWARP" \
-"\3RSVD" \
-"\4RSS_AQ" \
-"\5RSS_REG" \
-"\6WB_ON_ITR" \
-"\7REQ_QUEUES" \
-"\21VLAN" \
-"\22RX_POLLING" \
-"\23RSS_PCTYPE_V2" \
-"\24RSS_PF" \
-"\25ENCAP" \
-"\26ENCAP_CSUM" \
-"\27RX_ENCAP_CSUM"
-
-MALLOC_DECLARE(M_IAVF);
-
-/* Driver state */
-enum i

git: b0c7681ed739 - stable/12 - iser: Remove redundant linuxkpi MODULE_DEPEND

2021-11-24 Thread Ka Ho Ng
The branch stable/12 has been updated by khng:

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

commit b0c7681ed7398182de7b9026714c24ec20982796
Author: Ka Ho Ng 
AuthorDate: 2021-11-15 06:04:08 +
Commit: Ka Ho Ng 
CommitDate: 2021-11-24 20:18:12 +

iser: Remove redundant linuxkpi MODULE_DEPEND

Since ibcore depends on linuxkpi, there is no need to pull in the
linuxkpi dependency in iser.

Sponsored by:   The FreeBSD Foundation
Reviewed by:trasz
Differential Revision:  https://reviews.freebsd.org/D32977

(cherry picked from commit f7523c8a19d008412ccc969b12eeb756613f3678)
---
 sys/dev/iser/icl_iser.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sys/dev/iser/icl_iser.c b/sys/dev/iser/icl_iser.c
index 622178ab4dd3..dba3eaeb8587 100644
--- a/sys/dev/iser/icl_iser.c
+++ b/sys/dev/iser/icl_iser.c
@@ -565,5 +565,4 @@ moduledata_t icl_iser_data = {
 DECLARE_MODULE(icl_iser, icl_iser_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
 MODULE_DEPEND(icl_iser, icl, 1, 1, 1);
 MODULE_DEPEND(icl_iser, ibcore, 1, 1, 1);
-MODULE_DEPEND(icl_iser, linuxkpi, 1, 1, 1);
 MODULE_VERSION(icl_iser, 1);



git: 35f26bdf5948 - stable/13 - iser: Remove redundant linuxkpi MODULE_DEPEND

2021-11-24 Thread Ka Ho Ng
The branch stable/13 has been updated by khng:

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

commit 35f26bdf5948bc8439a210292018738ea42ad3b0
Author: Ka Ho Ng 
AuthorDate: 2021-11-15 06:04:08 +
Commit: Ka Ho Ng 
CommitDate: 2021-11-24 20:17:26 +

iser: Remove redundant linuxkpi MODULE_DEPEND

Since ibcore depends on linuxkpi, there is no need to pull in the
linuxkpi dependency in iser.

Sponsored by:   The FreeBSD Foundation
Reviewed by:trasz
Differential Revision:  https://reviews.freebsd.org/D32977

(cherry picked from commit f7523c8a19d008412ccc969b12eeb756613f3678)
---
 sys/dev/iser/icl_iser.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sys/dev/iser/icl_iser.c b/sys/dev/iser/icl_iser.c
index be09a3649dd9..f3780a441e01 100644
--- a/sys/dev/iser/icl_iser.c
+++ b/sys/dev/iser/icl_iser.c
@@ -566,5 +566,4 @@ moduledata_t icl_iser_data = {
 DECLARE_MODULE(icl_iser, icl_iser_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
 MODULE_DEPEND(icl_iser, icl, 1, 1, 1);
 MODULE_DEPEND(icl_iser, ibcore, 1, 1, 1);
-MODULE_DEPEND(icl_iser, linuxkpi, 1, 1, 1);
 MODULE_VERSION(icl_iser, 1);



git: 74a0e24f0797 - main - linux: plug set-but-not-unused vars

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 74a0e24f07974b4d51c57afa7525b5f88574ad31
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 21:16:03 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 21:16:03 +

linux: plug set-but-not-unused vars

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/compat/linux/linux_emul.c  | 9 +
 sys/compat/linux/linux_event.c | 2 --
 sys/compat/linux/linux_misc.c  | 2 --
 sys/compat/linux/linux_mmap.c  | 2 --
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c
index 86688d50c8a8..83c82fc84fee 100644
--- a/sys/compat/linux/linux_emul.c
+++ b/sys/compat/linux/linux_emul.c
@@ -363,12 +363,13 @@ void
 linux_schedtail(struct thread *td)
 {
struct linux_emuldata *em;
-   struct proc *p;
-   int error = 0;
+#ifdef KTR
+   int error;
+#else
+   int error __unused;
+#endif
int *child_set_tid;
 
-   p = td->td_proc;
-
em = em_find(td);
KASSERT(em != NULL, ("linux_schedtail: thread emuldata not found.\n"));
child_set_tid = em->child_set_tid;
diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c
index 2539b406618f..fa6ebc366ae9 100644
--- a/sys/compat/linux/linux_event.c
+++ b/sys/compat/linux/linux_event.c
@@ -615,7 +615,6 @@ linux_eventfd2(struct thread *td, struct 
linux_eventfd2_args *args)
 int
 linux_timerfd_create(struct thread *td, struct linux_timerfd_create_args *args)
 {
-   struct filedesc *fdp;
struct timerfd *tfd;
struct file *fp;
clockid_t clockid;
@@ -634,7 +633,6 @@ linux_timerfd_create(struct thread *td, struct 
linux_timerfd_create_args *args)
if ((args->flags & LINUX_TFD_CLOEXEC) != 0)
fflags |= O_CLOEXEC;
 
-   fdp = td->td_proc->p_fd;
error = falloc(td, &fp, &fd, fflags);
if (error != 0)
return (error);
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 5ae4051aaf38..589ad911266f 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1087,7 +1087,6 @@ linux_waitid(struct thread *td, struct linux_waitid_args 
*args)
siginfo_t siginfo;
l_siginfo_t lsi;
idtype_t idtype;
-   struct proc *p;
int error;
 
options = 0;
@@ -1127,7 +1126,6 @@ linux_waitid(struct thread *td, struct linux_waitid_args 
*args)
return (error);
}
if (args->info != NULL) {
-   p = td->td_proc;
bzero(&lsi, sizeof(lsi));
if (td->td_retval[0] != 0) {
sig = bsd_to_linux_signal(siginfo.si_signo);
diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c
index d7f12b782e96..af2ccc74ba12 100644
--- a/sys/compat/linux/linux_mmap.c
+++ b/sys/compat/linux/linux_mmap.c
@@ -83,14 +83,12 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t 
len, int prot,
struct proc *p = td->td_proc;
struct vmspace *vms = td->td_proc->p_vmspace;
int bsd_flags, error;
-   struct file *fp;
 
LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx",
addr, len, prot, flags, fd, pos);
 
error = 0;
bsd_flags = 0;
-   fp = NULL;
 
/*
 * Linux mmap(2):



git: ae3d955404da - main - linprocfs: plug set-but-not-unused vars

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit ae3d955404dac5c22fdbbc9bd1a3583b4c7d8637
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 21:18:36 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 21:18:36 +

linprocfs: plug set-but-not-unused vars

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/compat/linprocfs/linprocfs.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 66c6d1cf76ac..16755402bb7b 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -1277,7 +1277,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
char *name = "", *freename = NULL;
const char *l_map_str;
ino_t ino;
-   int ref_count, shadow_count, flags;
int error;
struct vnode *vp;
struct vattr vat;
@@ -1331,9 +1330,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
vref(vp);
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
-   flags = obj->flags;
-   ref_count = obj->ref_count;
-   shadow_count = obj->shadow_count;
VM_OBJECT_RUNLOCK(obj);
if (vp != NULL) {
vn_fullpath(vp, &name, &freename);
@@ -1353,10 +1349,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
if (e_end == p->p_sysent->sv_usrstack)
name = stack_str;
}
-   } else {
-   flags = 0;
-   ref_count = 0;
-   shadow_count = 0;
}
 
/*



git: cb2bfd3ecb70 - main - geom_journal: plug set-but-not-unused vars

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit cb2bfd3ecb7029fb2ba1d0a8d4091b8b3e68167a
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 21:21:59 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 21:21:59 +

geom_journal: plug set-but-not-unused vars

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/geom/journal/g_journal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
index e57d58d6f7ca..954d0dbf2c6b 100644
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -421,15 +421,13 @@ static int
 g_journal_access(struct g_provider *pp, int acr, int acw, int ace)
 {
struct g_journal_softc *sc;
-   int dcr, dcw, dce;
+   int dcw;
 
g_topology_assert();
GJ_DEBUG(2, "Access request for %s: r%dw%de%d.", pp->name,
acr, acw, ace);
 
-   dcr = pp->acr + acr;
dcw = pp->acw + acw;
-   dce = pp->ace + ace;
 
sc = pp->geom->softc;
if (sc == NULL || (sc->sc_flags & GJF_DEVICE_DESTROY)) {



git: 35b12b8711d0 - main - fdescfs: plug a set-but-not-unused var

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 35b12b8711d0d20f9aba77d7f62cffa59e625b7a
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 21:25:24 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 21:25:24 +

fdescfs: plug a set-but-not-unused var

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/fs/fdescfs/fdesc_vnops.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index 209e3b3df4f3..d8dab3d7598c 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -159,10 +159,8 @@ fdesc_allocvp(fdntype ftype, unsigned fd_fd, int ix, 
struct mount *mp,
struct fdhashhead *fc;
struct fdescnode *fd, *fd2;
struct vnode *vp, *vp2;
-   struct thread *td;
int error;
 
-   td = curthread;
fc = FD_NHASH(ix);
 loop:
mtx_lock(&fdesc_hashmtx);



git: 2cedfc3f7eb5 - main - if_epair: ifdef vars only used with ALTQ

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 2cedfc3f7eb58c8a3d35de226c63066946d9beb0
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 21:28:54 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 21:28:54 +

if_epair: ifdef vars only used with ALTQ

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/net/if_epair.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c
index 89483db46337..699d74ee4fb4 100644
--- a/sys/net/if_epair.c
+++ b/sys/net/if_epair.c
@@ -271,8 +271,11 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m)
 {
struct epair_softc *sc;
struct ifnet *oifp;
-   int error, len;
+   int error;
+#ifdef ALTQ
+   int len;
short mflags;
+#endif
 
if (m == NULL)
return (0);
@@ -309,10 +312,11 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m)
m_freem(m);
return (0);
}
+
+#ifdef ALTQ
len = m->m_pkthdr.len;
mflags = m->m_flags;
 
-#ifdef ALTQ
/* Support ALTQ via the classic if_start() path. */
IF_LOCK(&ifp->if_snd);
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {



git: 873606999f88 - main - unionfs: plug a set-but-not-unused var

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 873606999f880afbc9b9eae85ee7737aead57b83
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 21:31:35 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 21:31:35 +

unionfs: plug a set-but-not-unused var

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/fs/unionfs/union_vnops.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 81741dc19349..93249b21ccb3 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -631,7 +631,6 @@ static int
 unionfs_check_corrected_access(accmode_t accmode, struct vattr *va,
 struct ucred *cred)
 {
-   int count;
uid_t   uid;/* upper side vnode's uid */
gid_t   gid;/* upper side vnode's gid */
u_short vmode;  /* upper side vnode's mode */
@@ -654,7 +653,6 @@ unionfs_check_corrected_access(accmode_t accmode, struct 
vattr *va,
}
 
/* check group */
-   count = 0;
if (groupmember(gid, cred)) {
if (accmode & VEXEC)
mask |= S_IXGRP;



git: 943df073a348 - main - LinuxKPI: USB return possible error from suspend/resume

2021-11-24 Thread Bjoern A. Zeeb
The branch main has been updated by bz:

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

commit 943df073a348bcb1e701c3677536f913761d4123
Author: Bjoern A. Zeeb 
AuthorDate: 2021-11-24 21:28:46 +
Commit: Bjoern A. Zeeb 
CommitDate: 2021-11-24 21:32:38 +

LinuxKPI: USB return possible error from suspend/resume

USB suspend/resume cannot fail so we never returned the error which
resulted in a -Wunused-but-set-variable warning.
Initialize the return variable and return a possible error possibly
triggering a printf upstream to at least have a trace of the problem.
This also fixes the warning.

Suggested by:   hselasky
Sponsored by:   The FreeBSD Foundation
MFC after:  10 days
Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D33107
---
 sys/compat/linuxkpi/common/src/linux_usb.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_usb.c 
b/sys/compat/linuxkpi/common/src/linux_usb.c
index 11f400bc2c52..72aa561fcfbb 100644
--- a/sys/compat/linuxkpi/common/src/linux_usb.c
+++ b/sys/compat/linuxkpi/common/src/linux_usb.c
@@ -343,10 +343,10 @@ usb_linux_suspend(device_t dev)
struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
int err;
 
-   if (udrv && udrv->suspend) {
+   err = 0;
+   if (udrv && udrv->suspend)
err = (udrv->suspend) (sc->sc_ui, 0);
-   }
-   return (0);
+   return (-err);
 }
 
 /**
@@ -361,10 +361,10 @@ usb_linux_resume(device_t dev)
struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
int err;
 
-   if (udrv && udrv->resume) {
+   err = 0;
+   if (udrv && udrv->resume)
err = (udrv->resume) (sc->sc_ui);
-   }
-   return (0);
+   return (-err);
 }
 
 /**



git: 7043359ce3c1 - main - LinuxKPI: fix -Wunused-but-set-variable warnings

2021-11-24 Thread Bjoern A. Zeeb
The branch main has been updated by bz:

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

commit 7043359ce3c1e56ed55c8b41867a14a418511a05
Author: Bjoern A. Zeeb 
AuthorDate: 2021-11-24 21:20:52 +
Commit: Bjoern A. Zeeb 
CommitDate: 2021-11-24 21:32:38 +

LinuxKPI: fix -Wunused-but-set-variable warnings

Handle write-only variables by removing the unused return value from void
functions or removing the unused variables entirely.

Sponsored by:   The FreeBSD Foundation
MFC after:  10 days
Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D33107
---
 sys/compat/linuxkpi/common/src/linux_firmware.c | 3 +--
 sys/compat/linuxkpi/common/src/linux_pci.c  | 4 
 sys/compat/linuxkpi/common/src/linux_usb.c  | 8 +++-
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_firmware.c 
b/sys/compat/linuxkpi/common/src/linux_firmware.c
index d779b509105e..47cccd42da20 100644
--- a/sys/compat/linuxkpi/common/src/linux_firmware.c
+++ b/sys/compat/linuxkpi/common/src/linux_firmware.c
@@ -150,7 +150,6 @@ lkpi_fw_task(void *ctx, int pending)
 {
struct lkpi_fw_task *lfwt;
const struct linuxkpi_firmware *fw;
-   int error;
 
KASSERT(ctx != NULL && pending == 1, ("%s: lfwt %p, pending %d\n",
__func__, ctx, pending));
@@ -159,7 +158,7 @@ lkpi_fw_task(void *ctx, int pending)
if (lfwt->cont == NULL)
goto out;
 
-   error = _linuxkpi_request_firmware(lfwt->fw_name, &fw, lfwt->dev,
+   _linuxkpi_request_firmware(lfwt->fw_name, &fw, lfwt->dev,
lfwt->gfp, true, true);
 
/*
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c 
b/sys/compat/linuxkpi/common/src/linux_pci.c
index 8ec6a5af2140..bf28c10fbf96 100644
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -1063,11 +1063,9 @@ dma_pool_obj_import(void *arg, void **store, int count, 
int domain __unused,
 int flags)
 {
struct dma_pool *pool = arg;
-   struct linux_dma_priv *priv;
struct linux_dma_obj *obj;
int error, i;
 
-   priv = pool->pool_device->dma_priv;
for (i = 0; i < count; i++) {
obj = uma_zalloc(linux_dma_obj_zone, flags);
if (obj == NULL)
@@ -1090,11 +1088,9 @@ static void
 dma_pool_obj_release(void *arg, void **store, int count)
 {
struct dma_pool *pool = arg;
-   struct linux_dma_priv *priv;
struct linux_dma_obj *obj;
int i;
 
-   priv = pool->pool_device->dma_priv;
for (i = 0; i < count; i++) {
obj = store[i];
bus_dmamem_free(pool->pool_dmat, obj->vaddr, obj->dmamap);
diff --git a/sys/compat/linuxkpi/common/src/linux_usb.c 
b/sys/compat/linuxkpi/common/src/linux_usb.c
index e93559f95264..11f400bc2c52 100644
--- a/sys/compat/linuxkpi/common/src/linux_usb.c
+++ b/sys/compat/linuxkpi/common/src/linux_usb.c
@@ -1185,15 +1185,14 @@ usb_linux_free_device(struct usb_device *dev)
 {
struct usb_host_endpoint *uhe;
struct usb_host_endpoint *uhe_end;
-   int err;
 
uhe = dev->linux_endpoint_start;
uhe_end = dev->linux_endpoint_end;
while (uhe != uhe_end) {
-   err = usb_setup_endpoint(dev, uhe, 0);
+   usb_setup_endpoint(dev, uhe, 0);
uhe++;
}
-   err = usb_setup_endpoint(dev, &dev->ep0, 0);
+   usb_setup_endpoint(dev, &dev->ep0, 0);
free(dev->linux_endpoint_start, M_USBDEV);
 }
 
@@ -1276,7 +1275,6 @@ usb_linux_cleanup_interface(struct usb_device *dev, 
struct usb_interface *iface)
struct usb_host_interface *uhi_end;
struct usb_host_endpoint *uhe;
struct usb_host_endpoint *uhe_end;
-   int err;
 
uhi = iface->altsetting;
uhi_end = iface->altsetting + iface->num_altsetting;
@@ -1284,7 +1282,7 @@ usb_linux_cleanup_interface(struct usb_device *dev, 
struct usb_interface *iface)
uhe = uhi->endpoint;
uhe_end = uhi->endpoint + uhi->desc.bNumEndpoints;
while (uhe != uhe_end) {
-   err = usb_setup_endpoint(dev, uhe, 0);
+   usb_setup_endpoint(dev, uhe, 0);
uhe++;
}
uhi++;



git: 3f539826e12e - stable/13 - nfsd: Fix f_bavail and f_ffree for NFSv4 when negative

2021-11-24 Thread Rick Macklem
The branch stable/13 has been updated by rmacklem:

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

commit 3f539826e12e3177655add03f6297f49019ac08b
Author: Rick Macklem 
AuthorDate: 2021-11-08 20:59:31 +
Commit: Rick Macklem 
CommitDate: 2021-11-24 22:31:55 +

nfsd: Fix f_bavail and f_ffree for NFSv4 when negative

Since the NFS Space_available and Files_available are unsigned,
the NFSv3 server sets them to 0 when negative, so that they
do not appear to be large positive values for non-FreeBSD clients.
This patch fixes the NFSv4 server to do the same.

Found during a recent IEFT NFSv4 working group testing event.

(cherry picked from commit d70ca5b00eede3367ce659a03b2f9cc9729cd0dd)
---
 sys/fs/nfs/nfs_commonsubs.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index c8534982ee0e..144b2e215496 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -2511,6 +2511,17 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount 
*mp, vnode_t vp,
}
NFSCLRSTATFS_ATTRBIT(retbitp);
}
+   /*
+* Since NFS handles these values as unsigned on the
+* wire, there is no way to represent negative values,
+* so set them to 0. Without this, they will appear
+* to be very large positive values for clients like
+* Solaris10.
+*/
+   if (fs->f_bavail < 0)
+   fs->f_bavail = 0;
+   if (fs->f_ffree < 0)
+   fs->f_ffree = 0;
}
 #endif
 



git: 354988ca3f9d - stable/13 - nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError

2021-11-24 Thread Rick Macklem
The branch stable/13 has been updated by rmacklem:

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

commit 354988ca3f9db745ce0734ef1bda2daba584f723
Author: Rick Macklem 
AuthorDate: 2021-11-08 23:58:00 +
Commit: Rick Macklem 
CommitDate: 2021-11-24 22:35:03 +

nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError

If a pNFS server's DS runs out of disk space, it replies
NFSERR_NOSPC to the client doing writing.  For the Linux
client, it then sends a LayoutError RPC to the MDS server to
tell it about the error and keeps retrying, doing repeated
LayoutGets to the MDS and Write RPCs to the DS.  The Linux client is
"stuck" until disk space on the DS is free'd up unless
a subsequent LayoutGet request is sent a NFSERR_NOSPC
reply.
The looping problem still occurs for NFSv4.1 mounts, but no
fix for this is known at this time.

This patch changes the pNFS MDS server to reply to LayoutGet
operations with NFSERR_NOSPC once a LayoutError reports the
problem, until the DS has available space.  This keeps the Linux
NFSv4.2 from looping.

Found during recent testing because of issues w.r.t. a DS
being out of space found during a recent IEFT NFSv4 working
group testing event.

(cherry picked from commit f8dc06303bac39be53872de7429aa54694b3f86a)
---
 sys/fs/nfs/nfs_var.h  |  2 ++
 sys/fs/nfs/nfsrvstate.h   |  3 +++
 sys/fs/nfsserver/nfs_nfsdport.c   | 53 +++
 sys/fs/nfsserver/nfs_nfsdserv.c   |  4 +++
 sys/fs/nfsserver/nfs_nfsdsocket.c |  3 +++
 sys/fs/nfsserver/nfs_nfsdstate.c  | 53 +--
 6 files changed, 116 insertions(+), 2 deletions(-)

diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index b45143067c46..1f20c1cb76a8 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -170,6 +170,7 @@ int nfsrv_copymr(vnode_t, vnode_t, vnode_t, struct 
nfsdevice *,
 int nfsrv_mdscopymr(char *, char *, char *, char *, int *, char *, NFSPROC_T *,
 struct vnode **, struct vnode **, struct pnfsdsfile **, struct nfsdevice 
**,
 struct nfsdevice **);
+void nfsrv_marknospc(char *, bool);
 
 /* nfs_nfsdserv.c */
 int nfsrvd_access(struct nfsrv_descript *, int,
@@ -762,6 +763,7 @@ int nfsvno_listxattr(struct vnode *, uint64_t, struct ucred 
*, struct thread *,
 void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *, char *, int,
 int);
 bool nfsrv_checkwrongsec(struct nfsrv_descript *, int, enum vtype);
+void nfsrv_checknospc(void);
 
 /* nfs_commonkrpc.c */
 int newnfs_nmcancelreqs(struct nfsmount *);
diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h
index 427d5b132281..9eebeece9727 100644
--- a/sys/fs/nfs/nfsrvstate.h
+++ b/sys/fs/nfs/nfsrvstate.h
@@ -132,6 +132,7 @@ struct nfslayout {
nfsv4stateid_t  lay_stateid;
nfsquad_t   lay_clientid;
fhandle_t   lay_fh;
+   charlay_deviceid[NFSX_V4DEVICEID];
fsid_t  lay_fsid;
uint32_tlay_layoutlen;
uint16_tlay_mirrorcnt;
@@ -147,6 +148,7 @@ struct nfslayout {
 #defineNFSLAY_RECALL   0x0004
 #defineNFSLAY_RETURNED 0x0008
 #defineNFSLAY_CALLB0x0010
+#defineNFSLAY_NOSPC0x0020
 
 /*
  * Structure for an NFSv4.1 session.
@@ -353,6 +355,7 @@ struct nfsdevice {
char*nfsdev_host;
fsid_t  nfsdev_mdsfsid;
uint32_tnfsdev_nextdir;
+   boolnfsdev_nospc;
vnode_t nfsdev_dsdir[0];
 };
 
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index f48e57e449c9..bd833f1c375a 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -6733,6 +6733,59 @@ nfsrv_checkwrongsec(struct nfsrv_descript *nd, int 
nextop, enum vtype vtyp)
return (true);
 }
 
+/*
+ * Check DSs marked no space.
+ */
+void
+nfsrv_checknospc(void)
+{
+   struct statfs *tsf;
+   struct nfsdevice *ds;
+   struct vnode **dvpp, **tdvpp, *dvp;
+   char *devid, *tdevid;
+   int cnt, error = 0, i;
+
+   if (nfsrv_devidcnt <= 0)
+   return;
+   dvpp = mallocarray(nfsrv_devidcnt, sizeof(*dvpp), M_TEMP, M_WAITOK);
+   devid = malloc(nfsrv_devidcnt * NFSX_V4DEVICEID, M_TEMP, M_WAITOK);
+   tsf = malloc(sizeof(*tsf), M_TEMP, M_WAITOK);
+
+   /* Get an array of the dvps for the DSs. */
+   tdvpp = dvpp;
+   tdevid = devid;
+   i = 0;
+   NFSDDSLOCK();
+   /* First, search for matches for same file system. */
+   TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) {
+   if (ds->nfsdev_nmp != NULL && ds->nfsdev_nospc) {
+   if (++i > nfsrv_devidcnt)
+   break;
+

git: 40dd1c9c06eb - main - ext2: plug set-but-not-used vars

2021-11-24 Thread Mateusz Guzik
The branch main has been updated by mjg:

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

commit 40dd1c9c06ebe8dc7ea082c4bdc79343137a3997
Author: Mateusz Guzik 
AuthorDate: 2021-11-24 22:59:51 +
Commit: Mateusz Guzik 
CommitDate: 2021-11-24 23:02:26 +

ext2: plug set-but-not-used vars

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/fs/ext2fs/ext2_extents.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c
index 408f1a27ae76..3d393c4b7bbe 100644
--- a/sys/fs/ext2fs/ext2_extents.c
+++ b/sys/fs/ext2fs/ext2_extents.c
@@ -280,11 +280,8 @@ ext4_ext_in_cache(struct inode *ip, daddr_t lbn, struct 
ext4_extent *ep)
 static int
 ext4_ext_check_header(struct inode *ip, struct ext4_extent_header *eh)
 {
-   struct m_ext2fs *fs;
char *error_msg;
 
-   fs = ip->i_e2fs;
-
if (le16toh(eh->eh_magic) != EXT4_EXT_MAGIC) {
error_msg = "header: invalid magic";
goto corrupted;
@@ -418,14 +415,12 @@ int
 ext4_ext_find_extent(struct inode *ip, daddr_t block,
 struct ext4_extent_path **ppath)
 {
-   struct m_ext2fs *fs;
struct ext4_extent_header *eh;
struct ext4_extent_path *path;
struct buf *bp;
uint64_t blk;
int error, depth, i, ppos, alloc;
 
-   fs = ip->i_e2fs;
eh = ext4_ext_inode_header(ip);
depth = ext4_ext_inode_depth(ip);
ppos = 0;
@@ -690,12 +685,9 @@ static int
 ext4_ext_insert_index(struct inode *ip, struct ext4_extent_path *path,
 uint32_t lblk, e4fs_daddr_t blk)
 {
-   struct m_ext2fs *fs;
struct ext4_extent_index *idx;
int len;
 
-   fs = ip->i_e2fs;
-
if (lblk == le32toh(path->ep_index->ei_blk)) {
SDT_PROBE2(ext2fs, , trace, extents, 1,
"lblk == index blk => extent corrupted");



git: 83511ce5c473 - main - ldconfig: remove a comment which is another remnant of a.out support

2021-11-24 Thread Konstantin Belousov
The branch main has been updated by kib:

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

commit 83511ce5c473406e0661247e40971be28e218684
Author: Konstantin Belousov 
AuthorDate: 2021-11-24 20:44:20 +
Commit: Konstantin Belousov 
CommitDate: 2021-11-24 23:55:03 +

ldconfig: remove a comment which is another remnant of a.out support

Noted and reviewed by:  emaste
Sponsored by:   The FreeBSD Foundation
MFC after:  1 week
Differential revision:  https://reviews.freebsd.org/D33058
---
 sbin/ldconfig/ldconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c
index d0c6c9802a52..389cbb6101b5 100644
--- a/sbin/ldconfig/ldconfig.c
+++ b/sbin/ldconfig/ldconfig.c
@@ -102,7 +102,7 @@ main(int argc, char **argv)
}
 
if (is_soft)
-   hints_file = _PATH_ELFSOFT_HINTS;   /* Never will have 
a.out softfloat */
+   hints_file = _PATH_ELFSOFT_HINTS;
else if (is_32)
hints_file = _PATH_ELF32_HINTS;
else



  1   2   >