svn commit: r360522 - stable/11/lib/libc/nls

2020-04-30 Thread Xin LI
Author: delphij
Date: Fri May  1 04:59:40 2020
New Revision: 360522
URL: https://svnweb.freebsd.org/changeset/base/360522

Log:
  MFC r359118: Fix race condition in catopen(3).

Modified:
  stable/11/lib/libc/nls/msgcat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/nls/msgcat.c
==
--- stable/11/lib/libc/nls/msgcat.c Fri May  1 04:48:20 2020
(r360521)
+++ stable/11/lib/libc/nls/msgcat.c Fri May  1 04:59:40 2020
(r360522)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include  /* for ntohl() */
+#include 
 
 #include 
 #include 
@@ -76,19 +77,25 @@ __FBSDID("$FreeBSD$");
 
 #defineNLERR   ((nl_catd) -1)
 #define NLRETERR(errc)  { errno = errc; return (NLERR); }
-#define SAVEFAIL(n, l, e)  { WLOCK(NLERR); 
\
- np = malloc(sizeof(struct catentry)); 
\
+#define SAVEFAIL(n, l, e)  { np = calloc(1, sizeof(struct catentry));  
\
  if (np != NULL) { 
\
np->name = strdup(n);   
\
-   np->path = NULL;
\
np->catd = NLERR;   
\
-   np->refcount = 0;   
\
np->lang = (l == NULL) ? NULL : 
\
strdup(l);  
\
np->caterrno = e;   
\
-   SLIST_INSERT_HEAD(, np, list);
\
+   if (np->name == NULL || 
\
+   (l != NULL && np->lang == NULL)) {  
\
+   free(np->name); 
\
+   free(np->lang); 
\
+   free(np);   
\
+   } else {
\
+   WLOCK(NLERR);   
\
+   SLIST_INSERT_HEAD(, np,   
\
+   list);  
\
+   UNLOCK; 
\
+   }   
\
  } 
\
- UNLOCK;   
\
  errno = e;
\
}
 
@@ -152,7 +159,7 @@ catopen(const char *name, int type)
NLRETERR(np->caterrno);
} else {
/* Found cached successful entry */
-   np->refcount++;
+   atomic_add_int(>refcount, 1);
UNLOCK;
return (np->catd);
}
@@ -355,8 +362,7 @@ catclose(nl_catd catd)
WLOCK(-1);
SLIST_FOREACH(np, , list) {
if (catd == np->catd) {
-   np->refcount--;
-   if (np->refcount == 0)
+   if (atomic_fetchadd_int(>refcount, -1) == 1)
catfree(np);
break;
}
@@ -376,6 +382,7 @@ load_msgcat(const char *path, const char *name, const 
nl_catd catd;
struct catentry *np;
void *data;
+   char *copy_path, *copy_name, *copy_lang;
int fd;
 
/* path/name will never be NULL here */
@@ -387,7 +394,7 @@ load_msgcat(const char *path, const char *name, const 
RLOCK(NLERR);
SLIST_FOREACH(np, , list) {
if ((np->path != NULL) && (strcmp(np->path, path) == 0)) {
-   np->refcount++;
+   atomic_add_int(>refcount, 1);
UNLOCK;
return (np->catd);
}
@@ -432,7 +439,20 @@ load_msgcat(const char *path, const char *name, const 
NLRETERR(EFTYPE);
}
 
-   if ((catd = malloc(sizeof (*catd))) == NULL) {
+   copy_name = strdup(name);
+   copy_path = strdup(path);
+   copy_lang = (lang == NULL) ? NULL : strdup(lang);
+   catd = malloc(sizeof (*catd));
+   np = calloc(1, sizeof(struct catentry));
+
+   if (copy_name == NULL || copy_path == NULL ||
+   (lang != NULL && copy_lang == 

svn commit: r360521 - in stable/11: contrib/file contrib/file/doc contrib/file/m4 contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic

2020-04-30 Thread Xin LI
Author: delphij
Date: Fri May  1 04:48:20 2020
New Revision: 360521
URL: https://svnweb.freebsd.org/changeset/base/360521

Log:
  MFC r357757: MFV r357712: file 5.38.

Added:
  stable/11/contrib/file/magic/Magdir/forth
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/forth
  stable/11/contrib/file/magic/Magdir/git
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/git
  stable/11/contrib/file/magic/Magdir/modulefile
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/modulefile
  stable/11/contrib/file/magic/Magdir/openfst
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/openfst
  stable/11/contrib/file/magic/Magdir/opentimestamps
 - copied unchanged from r357757, 
head/contrib/file/magic/Magdir/opentimestamps
  stable/11/contrib/file/magic/Magdir/pmem
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/pmem
  stable/11/contrib/file/magic/Magdir/rst
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/rst
  stable/11/contrib/file/magic/Magdir/sosi
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/sosi
  stable/11/contrib/file/src/is_csv.c
 - copied unchanged from r357757, head/contrib/file/src/is_csv.c
Modified:
  stable/11/contrib/file/ChangeLog
  stable/11/contrib/file/Makefile.in
  stable/11/contrib/file/README
  stable/11/contrib/file/aclocal.m4
  stable/11/contrib/file/compile
  stable/11/contrib/file/config.guess
  stable/11/contrib/file/config.h.in
  stable/11/contrib/file/config.sub
  stable/11/contrib/file/configure
  stable/11/contrib/file/configure.ac
  stable/11/contrib/file/depcomp
  stable/11/contrib/file/doc/Makefile.in
  stable/11/contrib/file/doc/file.man
  stable/11/contrib/file/doc/libmagic.man
  stable/11/contrib/file/doc/magic.man
  stable/11/contrib/file/ltmain.sh
  stable/11/contrib/file/m4/libtool.m4
  stable/11/contrib/file/m4/ltoptions.m4
  stable/11/contrib/file/m4/ltsugar.m4
  stable/11/contrib/file/m4/ltversion.m4
  stable/11/contrib/file/m4/lt~obsolete.m4
  stable/11/contrib/file/magic/Magdir/android
  stable/11/contrib/file/magic/Magdir/animation
  stable/11/contrib/file/magic/Magdir/apple
  stable/11/contrib/file/magic/Magdir/archive
  stable/11/contrib/file/magic/Magdir/audio
  stable/11/contrib/file/magic/Magdir/bsi
  stable/11/contrib/file/magic/Magdir/c-lang
  stable/11/contrib/file/magic/Magdir/cad
  stable/11/contrib/file/magic/Magdir/commands
  stable/11/contrib/file/magic/Magdir/compress
  stable/11/contrib/file/magic/Magdir/console
  stable/11/contrib/file/magic/Magdir/database
  stable/11/contrib/file/magic/Magdir/elf
  stable/11/contrib/file/magic/Magdir/espressif
  stable/11/contrib/file/magic/Magdir/filesystems
  stable/11/contrib/file/magic/Magdir/fonts
  stable/11/contrib/file/magic/Magdir/frame
  stable/11/contrib/file/magic/Magdir/games
  stable/11/contrib/file/magic/Magdir/gimp
  stable/11/contrib/file/magic/Magdir/icc
  stable/11/contrib/file/magic/Magdir/images
  stable/11/contrib/file/magic/Magdir/javascript
  stable/11/contrib/file/magic/Magdir/kml
  stable/11/contrib/file/magic/Magdir/linux
  stable/11/contrib/file/magic/Magdir/macintosh
  stable/11/contrib/file/magic/Magdir/mail.news
  stable/11/contrib/file/magic/Magdir/map
  stable/11/contrib/file/magic/Magdir/msdos
  stable/11/contrib/file/magic/Magdir/msooxml
  stable/11/contrib/file/magic/Magdir/ole2compounddocs
  stable/11/contrib/file/magic/Magdir/pdf
  stable/11/contrib/file/magic/Magdir/python
  stable/11/contrib/file/magic/Magdir/rpi
  stable/11/contrib/file/magic/Magdir/ruby
  stable/11/contrib/file/magic/Magdir/sgml
  stable/11/contrib/file/magic/Magdir/sniffer
  stable/11/contrib/file/magic/Magdir/ssh
  stable/11/contrib/file/magic/Magdir/uuencode
  stable/11/contrib/file/magic/Magdir/varied.script
  stable/11/contrib/file/magic/Magdir/vax
  stable/11/contrib/file/magic/Magdir/windows
  stable/11/contrib/file/magic/Magdir/wordprocessors
  stable/11/contrib/file/magic/Magdir/zip
  stable/11/contrib/file/magic/Makefile.am
  stable/11/contrib/file/magic/Makefile.in
  stable/11/contrib/file/missing
  stable/11/contrib/file/python/Makefile.in
  stable/11/contrib/file/src/Makefile.am
  stable/11/contrib/file/src/Makefile.in
  stable/11/contrib/file/src/apprentice.c
  stable/11/contrib/file/src/ascmagic.c
  stable/11/contrib/file/src/buffer.c
  stable/11/contrib/file/src/compress.c
  stable/11/contrib/file/src/encoding.c
  stable/11/contrib/file/src/file.c
  stable/11/contrib/file/src/file.h
  stable/11/contrib/file/src/file_opts.h
  stable/11/contrib/file/src/fsmagic.c
  stable/11/contrib/file/src/funcs.c
  stable/11/contrib/file/src/magic.h.in
  stable/11/contrib/file/src/readcdf.c
  stable/11/contrib/file/src/readelf.c
  stable/11/contrib/file/src/seccomp.c
  stable/11/contrib/file/src/vasprintf.c
  stable/11/contrib/file/tests/JW07022A.mp3.result
  stable/11/contrib/file/tests/Makefile.in
  stable/11/contrib/file/tests/test.c
  

svn commit: r360520 - stable/12/sbin/fsck_msdosfs

2020-04-30 Thread Xin LI
Author: delphij
Date: Fri May  1 04:16:57 2020
New Revision: 360520
URL: https://svnweb.freebsd.org/changeset/base/360520

Log:
  MFC r360428: Do not overflow when calculating file system size.

Modified:
  stable/12/sbin/fsck_msdosfs/check.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/fsck_msdosfs/check.c
==
--- stable/12/sbin/fsck_msdosfs/check.c Fri May  1 01:31:19 2020
(r360519)
+++ stable/12/sbin/fsck_msdosfs/check.c Fri May  1 04:16:57 2020
(r360520)
@@ -54,6 +54,8 @@ checkfilesys(const char *fname)
int finish_dosdirsection=0;
int mod = 0;
int ret = 8;
+   int64_t freebytes;
+   int64_t badbytes;
 
rdonly = alwaysno;
if (!preen)
@@ -129,37 +131,33 @@ checkfilesys(const char *fname)
mod |= FSERROR;
}
 
+   freebytes = (int64_t)boot.NumFree * boot.ClusterSize;
+   badbytes = (int64_t)boot.NumBad * boot.ClusterSize;
+
 #ifdef HAVE_LIBUTIL_H
char freestr[7], badstr[7];
 
-   int64_t freebytes = boot.NumFree * boot.ClusterSize;
humanize_number(freestr, sizeof(freestr), freebytes, "",
HN_AUTOSCALE, HN_DECIMAL | HN_IEC_PREFIXES);
if (boot.NumBad) {
-   int64_t badbytes = boot.NumBad * boot.ClusterSize;
-
humanize_number(badstr, sizeof(badstr), badbytes, "",
HN_AUTOSCALE, HN_B | HN_DECIMAL | HN_IEC_PREFIXES);
 
pwarn("%d files, %sB free (%d clusters), %sB bad (%d 
clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree,
+ boot.NumFiles, freestr, boot.NumFree,
  badstr, boot.NumBad);
} else {
pwarn("%d files, %sB free (%d clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree);
+ boot.NumFiles, freestr, boot.NumFree);
}
 #else
if (boot.NumBad)
-   pwarn("%d files, %d KiB free (%d clusters), %d KiB bad (%d 
clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree,
- boot.NumBad * boot.ClusterSize / 1024, boot.NumBad);
+   pwarn("%d files, %jd KiB free (%d clusters), %jd KiB bad (%d 
clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree,
+ (intmax_t)badbytes / 1024, boot.NumBad);
else
-   pwarn("%d files, %d KiB free (%d clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree);
+   pwarn("%d files, %jd KiB free (%d clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree);
 #endif
 
if (mod && (mod & FSERROR) == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360519 - head/usr.sbin/binmiscctl

2020-04-30 Thread Mitchell Horne
Author: mhorne
Date: Fri May  1 01:31:19 2020
New Revision: 360519
URL: https://svnweb.freebsd.org/changeset/base/360519

Log:
  Add RISC-V interpreter example
  
  Now that RISC-V support has landed in qemu-user-static, add to the list
  of examples in the binmiscctl(8) manpage.
  
  Reviewed by:  kevans
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D24646

Modified:
  head/usr.sbin/binmiscctl/binmiscctl.8

Modified: head/usr.sbin/binmiscctl/binmiscctl.8
==
--- head/usr.sbin/binmiscctl/binmiscctl.8   Fri May  1 01:30:11 2020
(r360518)
+++ head/usr.sbin/binmiscctl/binmiscctl.8   Fri May  1 01:31:19 2020
(r360519)
@@ -27,7 +27,7 @@
 .\"
 .\" Support for miscellaneous binary image activators
 .\"
-.Dd February 10, 2020
+.Dd April 30, 2020
 .Dt BINMISCCTL 8
 .Os
 .Sh NAME
@@ -269,6 +269,17 @@ Add QEMU bsd-user program as an image activator for Po
\ex00\ex00\ex00\ex00\ex00\ex00\ex00\ex02\ex00\ex15" \e
   --mask  "\exff\exff\exff\exff\exff\exff\exff\ex00\exff\exff\e
\exff\exff\exff\exff\exff\exff\exff\exfe\exff\exff" \e
+  --size 20 --set-enabled
+.Ed
+.Pp
+Add QEMU bsd-user program as an image activator for 64-bit RISC-V binaries:
+.Bd -literal -offset indent
+# binmiscctl add riscv64 \e
+  --interpreter "/usr/local/bin/qemu-riscv64-static" \e
+  --magic "\ex7f\ex45\ex4c\ex46\ex02\ex01\ex01\ex00\ex00\ex00\e
+   \ex00\ex00\ex00\ex00\ex00\ex00\ex02\ex00\exf3\ex00" \e
+  --mask  "\exff\exff\exff\exff\exff\exff\exff\ex00\exff\exff\e
+   \exff\exff\exff\exff\exff\exff\exfe\exff\exff\exff" \e
   --size 20 --set-enabled
 .Ed
 .Ss "Create and use an ARMv6 chroot on an AMD64 host"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360517 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/executer include

2020-04-30 Thread Jung-uk Kim
Author: jkim
Date: Fri May  1 01:26:36 2020
New Revision: 360517
URL: https://svnweb.freebsd.org/changeset/base/360517

Log:
  MFV:  r360512
  
  Merge ACPICA 20200430.

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/acgetline.c
  head/sys/contrib/dev/acpica/common/dmtbdump2.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.l
  head/sys/contrib/dev/acpica/compiler/aslload.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslpredef.c
  head/sys/contrib/dev/acpica/compiler/aslxref.c
  head/sys/contrib/dev/acpica/compiler/dtutils.c
  head/sys/contrib/dev/acpica/components/debugger/dbhistry.c
  head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
  head/sys/contrib/dev/acpica/components/executer/exfield.c
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/acpredef.h
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Fri May  1 00:41:41 2020
(r360516)
+++ head/sys/contrib/dev/acpica/changes.txt Fri May  1 01:26:36 2020
(r360517)
@@ -1,4 +1,61 @@
 
+
+
+30 April 2020. Summary of changes for version 20200430:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Cleaned up the coding style of a couple of global variables 
+(AcpiGbl_NextCmdNum and AcpiProtocolLengths) caught by static analyzers. 
+AcpiProtocolLengths was made static, and the definition of 
+AcpiGbl_NextCmdNum was moved to acglobal.h.
+
+
+2) iASL Compiler/Disassembler and ACPICA tools: 
+
+iASL DataTable Compiler:  Fixed a segfault on errors that aren't directly 
+associated with a field.
+
+Disassembler: has been made more resilient so that it will continue to 
+parse AML even if the AML generates ACPI namespace errors. This enables 
+iASL to disassemble some AML that may have been compiled using older 
+versions of iASL that no longer compile with newer versions of iASL.
+
+iASL: Fixed the required parameters for _NIH and _NIG. Previously, there 
+was a mixup where _NIG required one parameter and _NIH required zero 
+parameters. This change swaps these parameter requirements. Now it is 
+required that _NIH must be called with one parameter and _NIG requires 
+zero parameters.
+
+iASL: Allow use of undefined externals as long as they are protected by 
+an if (CondRefOf (...)) block when compiling multiple definition blocks.
+
+iASL: Fixed the type override behavior of named objects that are declared 
+as External. External declarations will no longer override the type of 
+the actual definition if it already exists.
+
+AcpiNames: Added setargv.obj to the MSVC 2017 link sequence to enable 
+command line wildcard support on Windows. Note: the AcpiNames utility is 
+essentially redundant with the AcpiExec utility (using the "namespace" 
+command) and is therefore deprecated. It will be removed in future 
+releases of ACPICA.
+
+Disassembler: ignore AE_ALREADY_EXISTS status when parsing create* 
+operators. The disassembler is intended to emit existing ASL code as-is. 
+Therefore, error messages emitted during disassembly should be ignored or 
+handled in a way such that the disassembler can continue to parse the 
+AML. This change ignores AE_ALREADY_EXISTS errors during the deferred Op 
+parsing for create operators in order to complete parsing ASL termlists.
+
+iASL DataTable Compiler: IVRS table: fix potentially uninitialized 
+variable warning. Some compilers catch potential uninitialized variables. 
+This is done by examining branches of if/else statements. This change 
+replaces an "else if" with an "else" to fix the uninitialized variable 
+warning.
+
+
+
 26 March 2020. Summary of changes for version 20200326:
 
 
@@ -674,7 +731,7 @@ temporary.
 
 iASL: Emit error for creation of a zero-length operation region. Such a 
 region is rather pointless. If encountered, a runtime error is also 
-implemented in the interpeter.
+implemented in the interpreter.
 
 Debugger: Fix a possible fault with the "test objects" command.
 

Modified: head/sys/contrib/dev/acpica/common/acgetline.c
==
--- head/sys/contrib/dev/acpica/common/acgetline.c  Fri May  1 00:41:41 
2020(r360516)
+++ head/sys/contrib/dev/acpica/common/acgetline.c  Fri May  1 01:26:36 
2020(r360517)
@@ -189,8 +189,6 @@ AcpiAcClearLine (
 #define _ASCII_LEFT_ARROW   'D'
 #define _ASCII_NEWLINE  '\n'
 
-extern UINT32   AcpiGbl_NextCmdNum;
-
 /* Erase

svn commit: r360516 - stable/12/lib/libpmc/pmu-events/arch/x86

2020-04-30 Thread Alexander Motin
Author: mav
Date: Fri May  1 00:41:41 2020
New Revision: 360516
URL: https://svnweb.freebsd.org/changeset/base/360516

Log:
  MFC r360269: Map family 0x5F (Denverton) to goldmont.
  
  According to the 325462-071US document, they should be the same.

Modified:
  stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv
==
--- stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csvFri May  1 
00:40:18 2020(r360515)
+++ stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csvFri May  1 
00:41:41 2020(r360516)
@@ -9,6 +9,7 @@ GenuineIntel-6-27,v4,bonnell,core
 GenuineIntel-6-36,v4,bonnell,core
 GenuineIntel-6-35,v4,bonnell,core
 GenuineIntel-6-5C,v8,goldmont,core
+GenuineIntel-6-5F,v8,goldmont,core
 GenuineIntel-6-7A,v1,goldmontplus,core
 GenuineIntel-6-3C,v24,haswell,core
 GenuineIntel-6-45,v24,haswell,core
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360515 - stable/12/sys/dev/hwpmc

2020-04-30 Thread Alexander Motin
Author: mav
Date: Fri May  1 00:40:18 2020
New Revision: 360515
URL: https://svnweb.freebsd.org/changeset/base/360515

Log:
  MFC r360266: Add family 0x5F (Denverton) to PMC_CPU_INTEL_ATOM_GOLDMONT.
  
  According to the 325462-071US document, they should be the same.

Modified:
  stable/12/sys/dev/hwpmc/hwpmc_intel.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/hwpmc/hwpmc_intel.c
==
--- stable/12/sys/dev/hwpmc/hwpmc_intel.c   Fri May  1 00:36:14 2020
(r360514)
+++ stable/12/sys/dev/hwpmc/hwpmc_intel.c   Fri May  1 00:40:18 2020
(r360515)
@@ -204,6 +204,7 @@ pmc_intel_initialize(void)
nclasses = 3;
break;
case 0x5C:  /* Per Intel document 325462-071US 10/2019. */
+   case 0x5F:
cputype = PMC_CPU_INTEL_ATOM_GOLDMONT;
nclasses = 3;
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360514 - head/sys/fs/nfs

2020-04-30 Thread Rick Macklem
Author: rmacklem
Date: Fri May  1 00:36:14 2020
New Revision: 360514
URL: https://svnweb.freebsd.org/changeset/base/360514

Log:
  Factor some code out of nfsm_dissct() into separate functions.
  
  Factoring some of the code in nfsm_dissct() out into separate functions
  allows these functions to be used elsewhere in the NFS mbuf handling code.
  Other uses of these functions will be done in future commits.
  It also makes it easier to add support for ext_pgs mbufs, which is needed
  for nfs-over-tls under development in base/projects/nfs-over-tls.
  
  Although the algorithm in nfsm_dissct() is somewhat re-written by this
  patch, the semantics of nfsm_dissct() should not have changed.

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfs_var.h

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cThu Apr 30 23:41:22 2020
(r360513)
+++ head/sys/fs/nfs/nfs_commonsubs.cFri May  1 00:36:14 2020
(r360514)
@@ -229,6 +229,8 @@ static void nfsrv_removeuser(struct nfsusrgrp *usrp, i
 static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **,
 int *, int *);
 static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *);
+static int nfsm_copyfrommbuf(struct nfsrv_descript *, char *, enum uio_seg,
+int);
 
 static struct {
int op;
@@ -701,52 +703,49 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho
caddr_t retp;
 
retp = NULL;
-   left = mtod(nd->nd_md, caddr_t) + nd->nd_md->m_len - nd->nd_dpos;
+   left = mtod(nd->nd_md, char *) + nd->nd_md->m_len -
+   nd->nd_dpos;
while (left == 0) {
-   nd->nd_md = nd->nd_md->m_next;
-   if (nd->nd_md == NULL)
-   return (retp);
-   left = nd->nd_md->m_len;
-   nd->nd_dpos = mtod(nd->nd_md, caddr_t);
+   if (!nfsm_shiftnext(nd, ))
+   return (NULL);
}
if (left >= siz) {
retp = nd->nd_dpos;
nd->nd_dpos += siz;
-   } else if (nd->nd_md->m_next == NULL) {
-   return (retp);
} else if (siz > ncl_mbuf_mhlen) {
panic("nfs S too big");
} else {
+   /* Allocate a new mbuf for the "siz" bytes of data. */
MGET(mp2, MT_DATA, how);
if (mp2 == NULL)
return (NULL);
+
+   /*
+* Link the new mp2 mbuf into the list then copy left
+* bytes from the mbuf before it and siz - left bytes
+* from the mbuf(s) after it.
+*/
mp2->m_next = nd->nd_md->m_next;
nd->nd_md->m_next = mp2;
nd->nd_md->m_len -= left;
-   nd->nd_md = mp2;
-   retp = p = mtod(mp2, caddr_t);
-   NFSBCOPY(nd->nd_dpos, p, left); /* Copy what was left */
+   retp = p = mtod(mp2, char *);
+   memcpy(p, nd->nd_dpos, left);   /* Copy what was left */
siz2 = siz - left;
p += left;
-   mp2 = mp2->m_next;
+   mp2->m_len = siz;
+   nd->nd_md = mp2->m_next;
/* Loop around copying up the siz2 bytes */
while (siz2 > 0) {
-   if (mp2 == NULL)
+   if (nd->nd_md == NULL)
return (NULL);
-   xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2;
-   if (xfer > 0) {
-   NFSBCOPY(mtod(mp2, caddr_t), p, xfer);
-   mp2->m_data += xfer;
-   mp2->m_len -= xfer;
-   p += xfer;
-   siz2 -= xfer;
-   }
+   nfsm_set(nd, 0, false);
+   xfer = nfsm_copyfrommbuf(nd, p,
+   UIO_SYSSPACE, siz2);
+   p += xfer;
+   siz2 -= xfer;
if (siz2 > 0)
-   mp2 = mp2->m_next;
+   nd->nd_md = nd->nd_md->m_next;
}
-   nd->nd_md->m_len = siz;
-   nd->nd_md = mp2;
-   nd->nd_dpos = mtod(mp2, caddr_t);
}
return (retp);
 }
@@ -4825,5 +4824,76 @@ nfsv4_findmirror(struct nfsmount *nmp)
}
}
return (ds);
+}
+
+/*
+ * Fill in the fields of "struct nfsrv_descript" for a new ext_pgs mbuf.
+ * The build argument is true for build and false for dissect.
+ */
+int
+nfsm_set(struct nfsrv_descript *nd, u_int offs, bool build)
+{
+   struct mbuf *m;
+   int rlen;
+
+   if (build)
+   m = nd->nd_mb;
+   else
+   m = nd->nd_md;
+   if (build) {
+

svn commit: r360513 - vendor-sys/acpica/20200430

2020-04-30 Thread Jung-uk Kim
Author: jkim
Date: Thu Apr 30 23:41:22 2020
New Revision: 360513
URL: https://svnweb.freebsd.org/changeset/base/360513

Log:
  Tag ACPICA 20200430.

Added:
  vendor-sys/acpica/20200430/
 - copied from r360512, vendor-sys/acpica/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360512 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/components/executer so...

2020-04-30 Thread Jung-uk Kim
Author: jkim
Date: Thu Apr 30 23:40:36 2020
New Revision: 360512
URL: https://svnweb.freebsd.org/changeset/base/360512

Log:
  Import ACPICA 20200430.

Modified:
  vendor-sys/acpica/dist/changes.txt
  vendor-sys/acpica/dist/source/common/acgetline.c
  vendor-sys/acpica/dist/source/common/dmtbdump2.c
  vendor-sys/acpica/dist/source/compiler/aslcompiler.l
  vendor-sys/acpica/dist/source/compiler/aslload.c
  vendor-sys/acpica/dist/source/compiler/aslmessages.c
  vendor-sys/acpica/dist/source/compiler/aslmessages.h
  vendor-sys/acpica/dist/source/compiler/aslpredef.c
  vendor-sys/acpica/dist/source/compiler/aslxref.c
  vendor-sys/acpica/dist/source/compiler/dtutils.c
  vendor-sys/acpica/dist/source/components/debugger/dbhistry.c
  vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c
  vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c
  vendor-sys/acpica/dist/source/components/executer/exfield.c
  vendor-sys/acpica/dist/source/include/acglobal.h
  vendor-sys/acpica/dist/source/include/acpixf.h
  vendor-sys/acpica/dist/source/include/acpredef.h
  vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c

Modified: vendor-sys/acpica/dist/changes.txt
==
--- vendor-sys/acpica/dist/changes.txt  Thu Apr 30 22:08:40 2020
(r360511)
+++ vendor-sys/acpica/dist/changes.txt  Thu Apr 30 23:40:36 2020
(r360512)
@@ -1,4 +1,61 @@
 
+
+
+30 April 2020. Summary of changes for version 20200430:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Cleaned up the coding style of a couple of global variables 
+(AcpiGbl_NextCmdNum and AcpiProtocolLengths) caught by static analyzers. 
+AcpiProtocolLengths was made static, and the definition of 
+AcpiGbl_NextCmdNum was moved to acglobal.h.
+
+
+2) iASL Compiler/Disassembler and ACPICA tools: 
+
+iASL DataTable Compiler:  Fixed a segfault on errors that aren't directly 
+associated with a field.
+
+Disassembler: has been made more resilient so that it will continue to 
+parse AML even if the AML generates ACPI namespace errors. This enables 
+iASL to disassemble some AML that may have been compiled using older 
+versions of iASL that no longer compile with newer versions of iASL.
+
+iASL: Fixed the required parameters for _NIH and _NIG. Previously, there 
+was a mixup where _NIG required one parameter and _NIH required zero 
+parameters. This change swaps these parameter requirements. Now it is 
+required that _NIH must be called with one parameter and _NIG requires 
+zero parameters.
+
+iASL: Allow use of undefined externals as long as they are protected by 
+an if (CondRefOf (...)) block when compiling multiple definition blocks.
+
+iASL: Fixed the type override behavior of named objects that are declared 
+as External. External declarations will no longer override the type of 
+the actual definition if it already exists.
+
+AcpiNames: Added setargv.obj to the MSVC 2017 link sequence to enable 
+command line wildcard support on Windows. Note: the AcpiNames utility is 
+essentially redundant with the AcpiExec utility (using the "namespace" 
+command) and is therefore deprecated. It will be removed in future 
+releases of ACPICA.
+
+Disassembler: ignore AE_ALREADY_EXISTS status when parsing create* 
+operators. The disassembler is intended to emit existing ASL code as-is. 
+Therefore, error messages emitted during disassembly should be ignored or 
+handled in a way such that the disassembler can continue to parse the 
+AML. This change ignores AE_ALREADY_EXISTS errors during the deferred Op 
+parsing for create operators in order to complete parsing ASL termlists.
+
+iASL DataTable Compiler: IVRS table: fix potentially uninitialized 
+variable warning. Some compilers catch potential uninitialized variables. 
+This is done by examining branches of if/else statements. This change 
+replaces an "else if" with an "else" to fix the uninitialized variable 
+warning.
+
+
+
 26 March 2020. Summary of changes for version 20200326:
 
 
@@ -674,7 +731,7 @@ temporary.
 
 iASL: Emit error for creation of a zero-length operation region. Such a 
 region is rather pointless. If encountered, a runtime error is also 
-implemented in the interpeter.
+implemented in the interpreter.
 
 Debugger: Fix a possible fault with the "test objects" command.
 

Modified: vendor-sys/acpica/dist/source/common/acgetline.c
==
--- vendor-sys/acpica/dist/source/common/acgetline.cThu Apr 30 22:08:40 
2020(r360511)
+++ vendor-sys/acpica/dist/source/common/acgetline.cThu Apr 30 23:40:36 
2020(r360512)
@@ -189,8 +189,6 @@ AcpiAcClearLine (
 #define _ASCII_LEFT_ARROW   'D'
 #define _ASCII_NEWLINE  '\n'
 
-extern UINT32   AcpiGbl_NextCmdNum;
-
 /* Erase a single character

svn commit: r360511 - in head: lib/libc/db/mpool lib/libc/gen lib/libc/iconv lib/libc/posix1e lib/libc/secure lib/libgcc_s lib/libprocstat share/man/man5 share/mk tools/build/options

2020-04-30 Thread John Baldwin
Author: jhb
Date: Thu Apr 30 22:08:40 2020
New Revision: 360511
URL: https://svnweb.freebsd.org/changeset/base/360511

Log:
  Remove the SYMVER build option.
  
  This option was added as a transition aide when symbol versioning was
  first added.  It was enabled by default in 2007 and is supported even
  by the old GPLv2 binutils.  Trying to disable it currently fails to
  build in libc and at this point it isn't worth fixing the build.
  
  Reported by:  Michael Dexter
  Reviewed by:  imp
  Differential Revision:https://reviews.freebsd.org/D24637

Deleted:
  head/tools/build/options/WITHOUT_SYMVER
Modified:
  head/lib/libc/db/mpool/Makefile.inc
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/iconv/Makefile.inc
  head/lib/libc/posix1e/Makefile.inc
  head/lib/libc/secure/Makefile.inc
  head/lib/libgcc_s/Makefile
  head/lib/libprocstat/Makefile
  head/share/man/man5/src.conf.5
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.opts.mk
  head/share/mk/bsd.symver.mk

Modified: head/lib/libc/db/mpool/Makefile.inc
==
--- head/lib/libc/db/mpool/Makefile.inc Thu Apr 30 21:16:08 2020
(r360510)
+++ head/lib/libc/db/mpool/Makefile.inc Thu Apr 30 22:08:40 2020
(r360511)
@@ -3,7 +3,5 @@
 
 .PATH: ${LIBC_SRCTOP}/db/mpool
 
-SRCS+= mpool.c
-.if ${MK_SYMVER} == yes
-SRCS+= mpool-compat.c
-.endif
+SRCS+= mpool.c \
+   mpool-compat.c

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu Apr 30 21:16:08 2020
(r360510)
+++ head/lib/libc/gen/Makefile.inc  Thu Apr 30 22:08:40 2020
(r360511)
@@ -34,6 +34,7 @@ SRCS+=__getosreldate.c \
ctermid.c \
daemon.c \
devname.c \
+   devname-compat11.c \
dirfd.c \
dirname.c \
dirname_compat.c \
@@ -58,7 +59,10 @@ SRCS+=   __getosreldate.c \
fstab.c \
ftok.c \
fts.c \
+   fts-compat.c \
+   fts-compat11.c \
ftw.c \
+   ftw-compat11.c \
getbootfile.c \
getbsize.c \
getcap.c \
@@ -71,6 +75,7 @@ SRCS+=__getosreldate.c \
getloadavg.c \
getlogin.c \
getmntinfo.c \
+   getmntinfo-compat11.c \
getnetgrent.c \
getosreldate.c \
getpagesize.c \
@@ -83,6 +88,7 @@ SRCS+=__getosreldate.c \
getutxent.c \
getvfsbyname.c \
glob.c \
+   glob-compat11.c \
initgroups.c \
isatty.c \
isinf.c \
@@ -94,6 +100,7 @@ SRCS+=   __getosreldate.c \
lrand48.c \
mrand48.c \
nftw.c \
+   nftw-compat11.c \
nice.c \
nlist.c \
nrand48.c \
@@ -107,10 +114,12 @@ SRCS+=__getosreldate.c \
pw_scan.c \
raise.c \
readdir.c \
+   readdir-compat11.c \
readpassphrase.c \
recvmmsg.c \
rewinddir.c \
scandir.c \
+   scandir-compat11.c \
seed48.c \
seekdir.c \
semctl.c \
@@ -147,6 +156,7 @@ SRCS+=  __getosreldate.c \
ualarm.c \
ulimit.c \
uname.c \
+   unvis-compat.c \
usleep.c \
utime.c \
utxdb.c \
@@ -156,18 +166,6 @@ SRCS+= __getosreldate.c \
waitpid.c \
waitid.c \
wordexp.c
-.if ${MK_SYMVER} == yes
-SRCS+= devname-compat11.c \
-   fts-compat.c \
-   fts-compat11.c \
-   ftw-compat11.c \
-   getmntinfo-compat11.c \
-   glob-compat11.c \
-   nftw-compat11.c \
-   readdir-compat11.c \
-   scandir-compat11.c \
-   unvis-compat.c
-.endif
 
 CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20
 

Modified: head/lib/libc/iconv/Makefile.inc
==
--- head/lib/libc/iconv/Makefile.incThu Apr 30 21:16:08 2020
(r360510)
+++ head/lib/libc/iconv/Makefile.incThu Apr 30 22:08:40 2020
(r360511)
@@ -14,10 +14,7 @@ SRCS+=   citrus_bcs.c citrus_bcs_strtol.c citrus_bcs_str
citrus_esdb.c citrus_hash.c citrus_iconv.c citrus_lookup.c \
citrus_lookup_factory.c citrus_mapper.c citrus_memstream.c \
citrus_mmap.c citrus_module.c citrus_none.c citrus_pivot_factory.c \
-   citrus_prop.c citrus_stdenc.c bsd_iconv.c
-.if ${MK_SYMVER} == yes
-SRCS+= iconv_compat.c
-.endif
+   citrus_prop.c citrus_stdenc.c bsd_iconv.c iconv_compat.c
 
 SYM_MAPS+= ${LIBC_SRCTOP}/iconv/Symbol.map
 

Modified: head/lib/libc/posix1e/Makefile.inc
==
--- head/lib/libc/posix1e/Makefile.inc  Thu Apr 30 21:16:08 2020
(r360510)
+++ head/lib/libc/posix1e/Makefile.inc  Thu Apr 30 22:08:40 2020
(r360511)
@@ -11,6 +11,7 @@ subr_acl_nfs4.c: ${SRCTOP}/sys/kern/subr_acl_nfs4.c
 CONFS+=posix1e/mac.conf
 SRCS+= 

svn commit: r360510 - in stable/12: share/man/man7 sys/netinet

2020-04-30 Thread Richard Scheffenegger
Author: rscheff
Date: Thu Apr 30 21:16:08 2020
New Revision: 360510
URL: https://svnweb.freebsd.org/changeset/base/360510

Log:
  MFC r360010: Reduce the delayed ACK timeout from 100ms to 40ms.
  
  Reviewed by:  kbowling, tuexen
  Approved by:  tuexen (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23281

Modified:
  stable/12/share/man/man7/tuning.7
  stable/12/sys/netinet/tcp_timer.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man7/tuning.7
==
--- stable/12/share/man/man7/tuning.7   Thu Apr 30 21:09:01 2020
(r360509)
+++ stable/12/share/man/man7/tuning.7   Thu Apr 30 21:16:08 2020
(r360510)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2017
+.Dd April 16, 2020
 .Dt TUNING 7
 .Os
 .Sh NAME
@@ -435,7 +435,7 @@ number of tiny packets flowing across the network in h
 The
 .Fx
 delayed ACK implementation also follows the TCP protocol rule that
-at least every other packet be acknowledged even if the standard 100ms
+at least every other packet be acknowledged even if the standard 40ms
 timeout has not yet passed.
 Normally the worst a delayed ACK can do is
 slightly delay the teardown of a connection, or slightly delay the ramp-up

Modified: stable/12/sys/netinet/tcp_timer.h
==
--- stable/12/sys/netinet/tcp_timer.h   Thu Apr 30 21:09:01 2020
(r360509)
+++ stable/12/sys/netinet/tcp_timer.h   Thu Apr 30 21:16:08 2020
(r360510)
@@ -119,7 +119,7 @@
 
 #defineTCP_MAXRXTSHIFT 12  /* maximum retransmits 
*/
 
-#defineTCPTV_DELACK( hz/10 )   /* 100ms timeout */
+#defineTCPTV_DELACK( hz/25 )   /* 40ms timeout */
 
 /*
  * If we exceed this number of retransmits for a single segment, we'll consider
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360509 - head/tests/sys/geom/class

2020-04-30 Thread Ed Maste
Author: emaste
Date: Thu Apr 30 21:09:01 2020
New Revision: 360509
URL: https://svnweb.freebsd.org/changeset/base/360509

Log:
  geli tests require OpenSSL - exclude them under WITHOUT_OPENSSL
  
  PR:   245931
  Submitted by: The FreeBSD Foundation

Modified:
  head/tests/sys/geom/class/Makefile

Modified: head/tests/sys/geom/class/Makefile
==
--- head/tests/sys/geom/class/Makefile  Thu Apr 30 21:08:59 2020
(r360508)
+++ head/tests/sys/geom/class/Makefile  Thu Apr 30 21:09:01 2020
(r360509)
@@ -1,11 +1,15 @@
 # $FreeBSD$
 
+.include 
+
 PACKAGE=   tests
 
 TESTSDIR=  ${TESTSBASE}/sys/geom/class
 
 TESTS_SUBDIRS+=concat
+.if ${MK_OPENSSL} != "no"
 TESTS_SUBDIRS+=eli
+.endif
 TESTS_SUBDIRS+=gate
 TESTS_SUBDIRS+=mirror
 TESTS_SUBDIRS+=multipath
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360507 - head/share/man/man5

2020-04-30 Thread Ed Maste
Author: emaste
Date: Thu Apr 30 21:08:22 2020
New Revision: 360507
URL: https://svnweb.freebsd.org/changeset/base/360507

Log:
  src.conf.5: regen after WITHOUT_OPENSSL dep changes

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Thu Apr 30 21:04:39 2020
(r360506)
+++ head/share/man/man5/src.conf.5  Thu Apr 30 21:08:22 2020
(r360507)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd April 29, 2020
+.Dd April 30, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -414,7 +414,15 @@ When set, it enforces these options:
 .It
 .Va WITHOUT_OPENSSL
 .It
+.Va WITHOUT_PKGBOOTSTRAP
+.It
+.Va WITHOUT_SVN
+.It
+.Va WITHOUT_SVNLITE
+.It
 .Va WITHOUT_UNBOUND
+.It
+.Va WITHOUT_WIRELESS
 .El
 .Pp
 When set, these options are also in effect:
@@ -1318,7 +1326,15 @@ When set, it enforces these options:
 .It
 .Va WITHOUT_OPENSSH
 .It
+.Va WITHOUT_PKGBOOTSTRAP
+.It
+.Va WITHOUT_SVN
+.It
+.Va WITHOUT_SVNLITE
+.It
 .Va WITHOUT_UNBOUND
+.It
+.Va WITHOUT_WIRELESS
 .El
 .Pp
 When set, these options are also in effect:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360508 - head/sys/cam/nvme

2020-04-30 Thread Warner Losh
Author: imp
Date: Thu Apr 30 21:08:59 2020
New Revision: 360508
URL: https://svnweb.freebsd.org/changeset/base/360508

Log:
  Fix three bugs highlighted by review:
  
  - maxio should be dp->d_maxsize. This is often MAXPHYS, but not always
(especially if MAXPHYS is > 1MB).
  - Unlock the periph before returning. We don't need to relock it to
release the ccb.
  - Make sure we release the ccb in error paths.
  
  Reviewed by: cperciva

Modified:
  head/sys/cam/nvme/nvme_da.c

Modified: head/sys/cam/nvme/nvme_da.c
==
--- head/sys/cam/nvme/nvme_da.c Thu Apr 30 21:08:22 2020(r360507)
+++ head/sys/cam/nvme/nvme_da.c Thu Apr 30 21:08:59 2020(r360508)
@@ -402,7 +402,7 @@ ndaioctl(struct disk *dp, u_long cmd, void *data, int 
struct nvme_pt_command *pt;
union ccb *ccb;
struct cam_periph_map_info mapinfo;
-   u_int maxmap = MAXPHYS; /* XXX is this right */
+   u_int maxmap = dp->d_maxsize;
int error;
 
/*
@@ -426,8 +426,10 @@ ndaioctl(struct disk *dp, u_long cmd, void *data, int 
 */
memset(, 0, sizeof(mapinfo));
error = cam_periph_mapmem(ccb, , maxmap);
-   if (error)
+   if (error) {
+   xpt_release_ccb(ccb);
return (error);
+   }
 
/*
 * Lock the periph and run the command. XXX do we need
@@ -442,7 +444,6 @@ ndaioctl(struct disk *dp, u_long cmd, void *data, int 
 * Tear down mapping and return status.
 */
cam_periph_unmapmem(ccb, );
-   cam_periph_lock(periph);
error = (ccb->ccb_h.status == CAM_REQ_CMP) ? 0 : EIO;
xpt_release_ccb(ccb);
return (error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360506 - head/stand/lua

2020-04-30 Thread Kyle Evans
Author: kevans
Date: Thu Apr 30 21:04:39 2020
New Revision: 360506
URL: https://svnweb.freebsd.org/changeset/base/360506

Log:
  lualoader: config: improve readConfFiles, rename to readConf
  
  The previous interface was pretty bad, and required the caller to get some
  implementation details correct that it really shouldn't need to (e.g.
  loader_conf_files handling) and pass in an empty table for it to use.
  
  The new and much improved interface, readConf, is much less of a hack;
  hiding these implementation details and just doing the right thing.
  config.lua will now use it to process /boot/defaults/loader.conf and the
  subsequent loader_conf_files from there, and read-conf will also use it.
  
  This improvement submitted by Olivier (cited below), loader_conf_files
  handling from the original patch was changed to just clobber it before
  processing and not bother restoring it after the fact following r360505
  where it's now guaranteed to evade the loader environment.
  
  PR:   244640
  Submitted by: Olivier Certner (olivier freebsd free fr>

Modified:
  head/stand/lua/cli.lua
  head/stand/lua/config.lua
  head/stand/lua/config.lua.8

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Thu Apr 30 20:58:58 2020(r360505)
+++ head/stand/lua/cli.lua  Thu Apr 30 21:04:39 2020(r360506)
@@ -127,10 +127,7 @@ end
 
 cli['read-conf'] = function(...)
local _, argv = cli.arguments(...)
-   -- Don't trigger a reload of previously loaded loader_conf_files, in
-   -- case this config file doesn't set it.
-   loader.setenv("loader_conf_files", "")
-   config.readConfFiles(assert(core.popFrontTable(argv)), {})
+   config.readConf(assert(core.popFrontTable(argv)))
 end
 
 cli['reload-conf'] = function(...)

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Thu Apr 30 20:58:58 2020(r360505)
+++ head/stand/lua/config.lua   Thu Apr 30 21:04:39 2020(r360506)
@@ -488,36 +488,36 @@ function config.parse(text)
return status
 end
 
-function config.readConfFiles(files, loaded_files)
-   if files ~= nil then
-   -- The caller may not have passed in loader_conf_files; we could
-   -- have instead gotten some other string of files.  We don't
-   -- want to trigger any redundant re-read/loads based on this.
-   local prefiles = getEnv("loader_conf_files")
-   for name in files:gmatch("([%w%p]+)%s*") do
-   if loaded_files[name] ~= nil then
-   goto continue
-   end
+function config.readConf(file, loaded_files)
+   if loaded_files == nil then
+   loaded_files = {}
+   end
 
-   print("Loading " .. name)
-   -- These may or may not exist, and that's ok. Do a
-   -- silent parse so that we complain on parse errors but
-   -- not for them simply not existing.
-   if not config.processFile(name, true) then
-   print(MSG_FAILPARSECFG:format(name))
-   end
+   if loaded_files[file] ~= nil then
+   return
+   end
 
-   loaded_files[name] = true
-   local newfiles = getEnv("loader_conf_files")
-   if prefiles ~= newfiles then
-   -- Recurse; process the new files immediately.
-   -- If we come back and it turns out we've
-   -- already loaded the rest of what was in the
-   -- original loader_conf_files, no big deal.
-   config.readConfFiles(newfiles, loaded_files)
-   prefiles = newfiles
-   end
-   ::continue::
+   print("Loading " .. file)
+
+   -- The final value of loader_conf_files is not important, so just
+   -- clobber it here.  We'll later check if it's no longer nil and process
+   -- the new value for files to read.
+   setEnv("loader_conf_files", nil)
+
+   -- These may or may not exist, and that's ok. Do a
+   -- silent parse so that we complain on parse errors but
+   -- not for them simply not existing.
+   if not config.processFile(file, true) then
+   print(MSG_FAILPARSECFG:format(file))
+   end
+
+   loaded_files[file] = true
+
+   -- Going to process "loader_conf_files" extra-files
+   local loader_conf_files = getEnv("loader_conf_files")
+   if loader_conf_files ~= nil then
+   for name in loader_conf_files:gmatch("[%w%p]+") do
+   config.readConf(name, loaded_files)
  

svn commit: r360504 - head/sys/dev/nvme

2020-04-30 Thread Warner Losh
Author: imp
Date: Thu Apr 30 20:58:38 2020
New Revision: 360504
URL: https://svnweb.freebsd.org/changeset/base/360504

Log:
  Style(9) nit: put function name at start of line.

Modified:
  head/sys/dev/nvme/nvme_ns.c

Modified: head/sys/dev/nvme/nvme_ns.c
==
--- head/sys/dev/nvme/nvme_ns.c Thu Apr 30 20:58:33 2020(r360503)
+++ head/sys/dev/nvme/nvme_ns.c Thu Apr 30 20:58:38 2020(r360504)
@@ -617,7 +617,8 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t 
return (0);
 }
 
-void nvme_ns_destruct(struct nvme_namespace *ns)
+void
+nvme_ns_destruct(struct nvme_namespace *ns)
 {
 
if (ns->cdev != NULL)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360505 - head/stand/lua

2020-04-30 Thread Kyle Evans
Author: kevans
Date: Thu Apr 30 20:58:58 2020
New Revision: 360505
URL: https://svnweb.freebsd.org/changeset/base/360505

Log:
  lualoader: config: add a table for restricted environment vars
  
  This new table should be used for transient values that don't need to end up
  in the loader environment. Generally, these will be things that are internal
  details that really aren't needed or interesting outside of the config
  module (e.g. if we changed how ${module}_* directives work, they might use
  this instead).
  
  To start, populate it with loader_conf_files. Any specific value of
  loader_conf_files isn't all that interesting; if we're going to export it,
  we should really instead export a loader_conf_files that indicates all of
  the configuration files we processed. This will be used to reduce
  bookkeeping overhead in a future commit that cleans up readConfFiles.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Thu Apr 30 20:58:38 2020(r360504)
+++ head/stand/lua/config.lua   Thu Apr 30 20:58:58 2020(r360505)
@@ -61,6 +61,17 @@ local QVALREPL = QVALEXPR:gsub('%%', '')
 local WORDEXPR = "([%w]+)"
 local WORDREPL = WORDEXPR:gsub('%%', '')
 
+-- Entries that should never make it into the environment; each one should have
+-- a documented reason for its existence, and these should all be 
implementation
+-- details of the config module.
+local loader_env_restricted_table = {
+   -- loader_conf_files should be considered write-only, and consumers
+   -- should not rely on any particular value; it's a loader implementation
+   -- detail.  Moreover, it's not a particularly useful variable to have in
+   -- the kenv.  Save the overhead, let it get fetched other ways.
+   loader_conf_files = true,
+}
+
 local function restoreEnv()
-- Examine changed environment variables
for k, v in pairs(env_changed) do
@@ -88,14 +99,31 @@ local function restoreEnv()
env_restore = {}
 end
 
+-- XXX This getEnv/setEnv should likely be exported at some point.  We can save
+-- the call back into loader.getenv for any variable that's been set or
+-- overridden by any loader.conf using this implementation with little overhead
+-- since we're already tracking the values.
+local function getEnv(key)
+   if loader_env_restricted_table[key] ~= nil or
+   env_changed[key] ~= nil then
+   return env_changed[key]
+   end
+
+   return loader.getenv(key)
+end
+
 local function setEnv(key, value)
+   env_changed[key] = value
+
+   if loader_env_restricted_table[key] ~= nil then
+   return 0
+   end
+
-- Track the original value for this if we haven't already
if env_restore[key] == nil then
env_restore[key] = {value = loader.getenv(key)}
end
 
-   env_changed[key] = value
-
return loader.setenv(key, value)
 end
 
@@ -465,7 +493,7 @@ function config.readConfFiles(files, loaded_files)
-- The caller may not have passed in loader_conf_files; we could
-- have instead gotten some other string of files.  We don't
-- want to trigger any redundant re-read/loads based on this.
-   local prefiles = loader.getenv("loader_conf_files")
+   local prefiles = getEnv("loader_conf_files")
for name in files:gmatch("([%w%p]+)%s*") do
if loaded_files[name] ~= nil then
goto continue
@@ -480,7 +508,7 @@ function config.readConfFiles(files, loaded_files)
end
 
loaded_files[name] = true
-   local newfiles = loader.getenv("loader_conf_files")
+   local newfiles = getEnv("loader_conf_files")
if prefiles ~= newfiles then
-- Recurse; process the new files immediately.
-- If we come back and it turns out we've
@@ -607,7 +635,7 @@ function config.load(file, reloading)
end
 
local loaded_files = {file = true}
-   config.readConfFiles(loader.getenv("loader_conf_files"), loaded_files)
+   config.readConfFiles(getEnv("loader_conf_files"), loaded_files)
 
checkNextboot()
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360503 - head/sys/dev/nvme

2020-04-30 Thread Warner Losh
Author: imp
Date: Thu Apr 30 20:58:33 2020
New Revision: 360503
URL: https://svnweb.freebsd.org/changeset/base/360503

Log:
  Move / reword a comment.
  
  Explain what we're doing with mapping CAM's notion of a LUN to NVMe's
  notion of a namespace.

Modified:
  head/sys/dev/nvme/nvme_sim.c

Modified: head/sys/dev/nvme/nvme_sim.c
==
--- head/sys/dev/nvme/nvme_sim.cThu Apr 30 19:48:55 2020
(r360502)
+++ head/sys/dev/nvme/nvme_sim.cThu Apr 30 20:58:33 2020
(r360503)
@@ -172,12 +172,6 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb)
struct ccb_pathinq  *cpi = >cpi;
device_tdev = ctrlr->dev;
 
-   /*
-* NVMe may have multiple LUNs on the same path. Current 
generation
-* of NVMe devives support only a single name space. Multiple 
name
-* space drives are coming, but it's unclear how we should 
report
-* them up the stack.
-*/
cpi->version_num = 1;
cpi->hba_inquiry = 0;
cpi->target_sprt = 0;
@@ -332,13 +326,17 @@ nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_ar
return (NULL);
}
 
+   /*
+* We map the NVMe namespace idea onto the CAM unit LUN. For
+* each new namespace, we create a new CAM path for it. We then
+* rescan the path to get it to enumerate.
+*/
if (xpt_create_path(>ccb_h.path, /*periph*/NULL,
cam_sim_path(sc->s_sim), 0, ns->id) != CAM_REQ_CMP) {
printf("unable to create path for rescan\n");
xpt_free_ccb(ccb);
return (NULL);
}
-
xpt_rescan(ccb);
 
return (ns);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360502 - head/sys/cam

2020-04-30 Thread Warner Losh
Author: imp
Date: Thu Apr 30 19:48:55 2020
New Revision: 360502
URL: https://svnweb.freebsd.org/changeset/base/360502

Log:
  Remove stray blank line.
  
  This was accidentally added in r360483.

Modified:
  head/sys/cam/cam_ccb.h

Modified: head/sys/cam/cam_ccb.h
==
--- head/sys/cam/cam_ccb.h  Thu Apr 30 18:11:56 2020(r360501)
+++ head/sys/cam/cam_ccb.h  Thu Apr 30 19:48:55 2020(r360502)
@@ -1034,7 +1034,6 @@ struct ccb_trans_settings_nvme 
uint8_t speed;  /* PCIe generation for each lane */
uint8_t max_lanes;  /* Number of PCIe lanes */
uint8_t max_speed;  /* PCIe generation for each lane */
-
 };
 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360501 - head/share/mk

2020-04-30 Thread Ed Maste
Author: emaste
Date: Thu Apr 30 18:11:56 2020
New Revision: 360501
URL: https://svnweb.freebsd.org/changeset/base/360501

Log:
  src.opts.mk: add WITHOUT_OPENSSL dependencies
  
  A number of components require OpenSSL and fail to build if it is not
  enabled.  As a first phase force these off under WITHOUT_OPENSSL.  A
  second phase should make these more fine-grained, allowing the component
  to build but without OpenSSL.
  
  PR:   245931
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Thu Apr 30 17:51:26 2020(r360500)
+++ head/share/mk/src.opts.mk   Thu Apr 30 18:11:56 2020(r360501)
@@ -435,6 +435,10 @@ MK_OPENSSH:=   no
 MK_KERBEROS:=  no
 MK_KERBEROS_SUPPORT:=  no
 MK_LDNS:=  no
+MK_PKGBOOTSTRAP:=  no
+MK_SVN:=   no
+MK_SVNLITE:=   no
+MK_WIRELESS:=  no
 .endif
 
 .if ${MK_LDNS} == "no"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360500 - stable/11/sys/kern

2020-04-30 Thread Alexander Motin
Author: mav
Date: Thu Apr 30 17:51:26 2020
New Revision: 360500
URL: https://svnweb.freebsd.org/changeset/base/360500

Log:
  MFC r333839 (by mmacy): getnextevent: put variable only used by KTR under 
ifdef KTR

Modified:
  stable/11/sys/kern/kern_clocksource.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_clocksource.c
==
--- stable/11/sys/kern/kern_clocksource.c   Thu Apr 30 15:45:01 2020
(r360499)
+++ stable/11/sys/kern/kern_clocksource.c   Thu Apr 30 17:51:26 2020
(r360500)
@@ -270,18 +270,22 @@ getnextevent(void)
 #ifdef SMP
int cpu;
 #endif
+#ifdef KTR
int c;
 
+   c = -1;
+#endif
state = DPCPU_PTR(timerstate);
event = state->nextevent;
-   c = -1;
 #ifdef SMP
if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) {
CPU_FOREACH(cpu) {
state = DPCPU_ID_PTR(cpu, timerstate);
if (event > state->nextevent) {
event = state->nextevent;
+#ifdef KTR
c = cpu;
+#endif
}
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360499 - head/sys/dev/ichiic

2020-04-30 Thread Andriy Gapon
Author: avg
Date: Thu Apr 30 15:45:01 2020
New Revision: 360499
URL: https://svnweb.freebsd.org/changeset/base/360499

Log:
  ig4iic_acpi_probe: remove set but unused variable
  
  MFC after:1 week

Modified:
  head/sys/dev/ichiic/ig4_acpi.c

Modified: head/sys/dev/ichiic/ig4_acpi.c
==
--- head/sys/dev/ichiic/ig4_acpi.c  Thu Apr 30 15:39:04 2020
(r360498)
+++ head/sys/dev/ichiic/ig4_acpi.c  Thu Apr 30 15:45:01 2020
(r360499)
@@ -68,10 +68,8 @@ static char *ig4iic_ids[] = {
 static int
 ig4iic_acpi_probe(device_t dev)
 {
-   ig4iic_softc_t *sc;
int rv;
 
-   sc = device_get_softc(dev);
if (acpi_disabled("ig4iic"))
return (ENXIO);
rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids, NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360498 - head/sys/net

2020-04-30 Thread Mark Johnston
Author: markj
Date: Thu Apr 30 15:39:04 2020
New Revision: 360498
URL: https://svnweb.freebsd.org/changeset/base/360498

Log:
  Increase the iflib txq callout mutex name length to 32 bytes.
  
  With a length of 16, the name (":TX():callout") typically
  gets truncated.
  
  PR:   245712
  Reported by:  ghuckri...@blackberry.com
  MFC after:1 week

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Apr 30 15:24:05 2020(r360497)
+++ head/sys/net/iflib.cThu Apr 30 15:39:04 2020(r360498)
@@ -358,7 +358,7 @@ struct iflib_txq {
bus_dma_tag_t   ift_buf_tag;
bus_dma_tag_t   ift_tso_buf_tag;
iflib_dma_info_tift_ifdi;
-#define MTX_NAME_LEN 16
+#defineMTX_NAME_LEN32
charift_mtx_name[MTX_NAME_LEN];
bus_dma_segment_t   ift_segs[IFLIB_MAX_TX_SEGS]  
__aligned(CACHE_LINE_SIZE);
 #ifdef IFLIB_DIAGNOSTICS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360497 - stable/12/share/mk

2020-04-30 Thread John Baldwin
Author: jhb
Date: Thu Apr 30 15:24:05 2020
New Revision: 360497
URL: https://svnweb.freebsd.org/changeset/base/360497

Log:
  MFC 354660: Enable the RISC-V LLVM backend by default.

Modified:
  stable/12/share/mk/src.opts.mk
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/mk/src.opts.mk
==
--- stable/12/share/mk/src.opts.mk  Thu Apr 30 14:51:31 2020
(r360496)
+++ stable/12/share/mk/src.opts.mk  Thu Apr 30 15:24:05 2020
(r360497)
@@ -267,6 +267,7 @@ __LLVM_TARGETS= \
arm \
mips \
powerpc \
+   riscv \
sparc \
x86
 __LLVM_TARGET_FILT=C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/
@@ -288,7 +289,6 @@ __DEFAULT_DEPENDENT_OPTIONS+=   LLVM_TARGET_${__llt:${__
 .endfor
 
 __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF
-__DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV
 
 .include 
 # If the compiler is not C++11 capable, disable Clang and use GCC instead.
@@ -300,7 +300,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV
 # Clang is enabled, and will be installed as the default /usr/bin/cc.
 __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD
 __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC
-.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mriscv*} == "" && ${__T} != 
"sparc64"
+.elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64"
 # If an external compiler that supports C++11 is used as ${CC} and Clang
 # supports the target, then Clang is enabled but GCC is installed as the
 # default /usr/bin/cc.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360496 - in stable/12/sys: conf modules/linux modules/linux64 modules/vmm

2020-04-30 Thread Kyle Evans
Author: kevans
Date: Thu Apr 30 14:51:31 2020
New Revision: 360496
URL: https://svnweb.freebsd.org/changeset/base/360496

Log:
  MFC r360071-r360072: force -fcommon in kernel/modules where needed
  
  This contains some extra bits over the original commits, as things are
  slightly different in earlier branches.
  
  r360071:
  Allow kernel modules to build with a compiler that defaults to -fno-common
  
  This uses the same approach as r359691.
  
  r360072:
  More fixes to build the kernel with a compiler that defaults to -fno-common
  
  Using the same approach as the last commit for the files used by genassym.sh.

Modified:
  stable/12/sys/conf/files.amd64
  stable/12/sys/conf/files.i386
  stable/12/sys/conf/kern.post.mk
  stable/12/sys/conf/kmod.mk
  stable/12/sys/modules/linux/Makefile
  stable/12/sys/modules/linux64/Makefile
  stable/12/sys/modules/vmm/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files.amd64
==
--- stable/12/sys/conf/files.amd64  Thu Apr 30 14:38:55 2020
(r360495)
+++ stable/12/sys/conf/files.amd64  Thu Apr 30 14:51:31 2020
(r360496)
@@ -34,7 +34,7 @@ cloudabi64_vdso_blob.ooptional
compat_cloudabi64   \
 #
 linux32_genassym.o optionalcompat_linux32  \
dependency  "$S/amd64/linux32/linux32_genassym.c offset.inc"
\
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "linux32_genassym.o"
 #
@@ -58,7 +58,7 @@ linux32_vdso.so   optionalcompat_linux32  
\
 #
 ia32_genassym.ostandard
\
dependency  "$S/compat/ia32/ia32_genassym.c offset.inc" 
\
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "ia32_genassym.o"
 #

Modified: stable/12/sys/conf/files.i386
==
--- stable/12/sys/conf/files.i386   Thu Apr 30 14:38:55 2020
(r360495)
+++ stable/12/sys/conf/files.i386   Thu Apr 30 14:51:31 2020
(r360496)
@@ -21,7 +21,7 @@ cloudabi32_vdso_blob.ooptional
compat_cloudabi32   \
 #
 linux_genassym.o   optionalcompat_linux\
dependency  "$S/i386/linux/linux_genassym.c offset.inc" 
\
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "linux_genassym.o"
 #

Modified: stable/12/sys/conf/kern.post.mk
==
--- stable/12/sys/conf/kern.post.mk Thu Apr 30 14:38:55 2020
(r360495)
+++ stable/12/sys/conf/kern.post.mk Thu Apr 30 14:51:31 2020
(r360496)
@@ -202,20 +202,20 @@ offset.inc: $S/kern/genoffset.sh genoffset.o
NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > 
${.TARGET}
 
 genoffset.o: $S/kern/genoffset.c
-   ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon $S/kern/genoffset.c
 
 # genoffset_test.o is not actually used for anything - the point of compiling 
it
 # is to exercise the CTASSERT that checks that the offsets in the offset.inc
 # _lite struct(s) match those in the original(s). 
 genoffset_test.o: $S/kern/genoffset.c offset.inc
-   ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon -DOFFSET_TEST \
$S/kern/genoffset.c -o ${.TARGET}
 
 assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o
NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > 
${.TARGET}
 
 genassym.o: $S/$M/$M/genassym.c  offset.inc
-   ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon $S/$M/$M/genassym.c
 
 OBJS_DEPEND_GUESS+= opt_global.h
 genoffset.o genassym.o vers.o: opt_global.h

Modified: stable/12/sys/conf/kmod.mk
==
--- stable/12/sys/conf/kmod.mk  Thu Apr 30 14:38:55 2020(r360495)
+++ stable/12/sys/conf/kmod.mk  Thu Apr 30 14:51:31 2020(r360496)
@@ -515,13 +515,13 @@ assym.inc: ${SYSDIR}/kern/genassym.sh
sh 

svn commit: r360495 - in stable: 11 12

2020-04-30 Thread Kyle Evans
Author: kevans
Date: Thu Apr 30 14:38:55 2020
New Revision: 360495
URL: https://svnweb.freebsd.org/changeset/base/360495

Log:
  MFC r355423: UPDATING: Add [less] long-belated note about certs in base
  
  While the interaction between this and the ETCSYMLINK option of
  security/ca_root_nss isn't necessarily fatal, one should be aware and
  attempt to understand the ramifications of mixing the two.
  
  ports-secteam will be contacted to discuss the default option for branches
  where certs are being included in base.

Modified:
  stable/12/UPDATING
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/UPDATING
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/UPDATING
==
--- stable/12/UPDATING  Thu Apr 30 13:48:58 2020(r360494)
+++ stable/12/UPDATING  Thu Apr 30 14:38:55 2020(r360495)
@@ -16,6 +16,16 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20200430:
+   The root certificates of the Mozilla CA Certificate Store have been
+   imported into the base system and can be managed with the certctl(8)
+   utility.  If you have installed the security/ca_root_nss port or package
+   with the ETCSYMLINK option (the default), be advised that there may be
+   differences between those included in the port and those included in
+   base due to differences in nss branch used as well as general update
+   frequency.  Note also that certctl(8) cannot manage certs in the
+   format used by the security/ca_root_nss port.
+
 20200107:
Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have
been upgraded to 9.0.1.  Please see the 20141231 entry below for
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360495 - in stable: 11 12

2020-04-30 Thread Kyle Evans
Author: kevans
Date: Thu Apr 30 14:38:55 2020
New Revision: 360495
URL: https://svnweb.freebsd.org/changeset/base/360495

Log:
  MFC r355423: UPDATING: Add [less] long-belated note about certs in base
  
  While the interaction between this and the ETCSYMLINK option of
  security/ca_root_nss isn't necessarily fatal, one should be aware and
  attempt to understand the ramifications of mixing the two.
  
  ports-secteam will be contacted to discuss the default option for branches
  where certs are being included in base.

Modified:
  stable/11/UPDATING
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/UPDATING
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/UPDATING
==
--- stable/11/UPDATING  Thu Apr 30 13:48:58 2020(r360494)
+++ stable/11/UPDATING  Thu Apr 30 14:38:55 2020(r360495)
@@ -16,6 +16,16 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20200430:
+   The root certificates of the Mozilla CA Certificate Store have been
+   imported into the base system and can be managed with the certctl(8)
+   utility.  If you have installed the security/ca_root_nss port or package
+   with the ETCSYMLINK option (the default), be advised that there may be
+   differences between those included in the port and those included in
+   base due to differences in nss branch used as well as general update
+   frequency.  Note also that certctl(8) cannot manage certs in the
+   format used by the security/ca_root_nss port.
+
 20190913:
ntpd no longer by default locks its pages in memory, allowing them
to be paged out by the kernel. Use rlimit memlock to restore
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360494 - in stable/11/sys: conf modules/linux modules/linux64 modules/vmm

2020-04-30 Thread Kyle Evans
Author: kevans
Date: Thu Apr 30 13:48:58 2020
New Revision: 360494
URL: https://svnweb.freebsd.org/changeset/base/360494

Log:
  MFC r360071-r360072: force -fcommon for parts of kernel/kmods that need
  
  Note that this isn't a 1:1 MFC, as a couple more instances needed to be
  patched to force -fcommon in the face of a compiler that defaulted to
  -fno-common.
  
  r360071:
  Allow kernel modules to build with a compiler that defaults to -fno-common
  
  This uses the same approach as r359691.
  
  r360072:
  More fixes to build the kernel with a compiler that defaults to -fno-common
  
  Using the same approach as the last commit for the files used by genassym.sh.

Modified:
  stable/11/sys/conf/files.amd64
  stable/11/sys/conf/files.i386
  stable/11/sys/conf/files.pc98
  stable/11/sys/conf/kern.post.mk
  stable/11/sys/conf/kmod.mk
  stable/11/sys/modules/linux/Makefile
  stable/11/sys/modules/linux64/Makefile
  stable/11/sys/modules/vmm/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files.amd64
==
--- stable/11/sys/conf/files.amd64  Thu Apr 30 12:02:13 2020
(r360493)
+++ stable/11/sys/conf/files.amd64  Thu Apr 30 13:48:58 2020
(r360494)
@@ -34,7 +34,7 @@ cloudabi64_vdso_blob.ooptional
compat_cloudabi64   \
 #
 linux32_genassym.o optionalcompat_linux32  \
dependency  "$S/amd64/linux32/linux32_genassym.c"   \
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "linux32_genassym.o"
 #
@@ -58,7 +58,7 @@ linux32_vdso.so   optionalcompat_linux32  
\
 #
 ia32_genassym.ostandard
\
dependency  "$S/compat/ia32/ia32_genassym.c"\
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "ia32_genassym.o"
 #

Modified: stable/11/sys/conf/files.i386
==
--- stable/11/sys/conf/files.i386   Thu Apr 30 12:02:13 2020
(r360493)
+++ stable/11/sys/conf/files.i386   Thu Apr 30 13:48:58 2020
(r360494)
@@ -21,7 +21,7 @@ cloudabi32_vdso_blob.ooptional
compat_cloudabi32   \
 #
 linux_genassym.o   optionalcompat_linux\
dependency  "$S/i386/linux/linux_genassym.c"\
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "linux_genassym.o"
 #
@@ -45,7 +45,7 @@ linux_vdso.so optionalcompat_linux
\
 #
 svr4_genassym.ooptionalcompat_svr4 
\
dependency  "$S/i386/svr4/svr4_genassym.c"  \
-   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "svr4_genassym.o"
 #

Modified: stable/11/sys/conf/files.pc98
==
--- stable/11/sys/conf/files.pc98   Thu Apr 30 12:02:13 2020
(r360493)
+++ stable/11/sys/conf/files.pc98   Thu Apr 30 13:48:58 2020
(r360494)
@@ -11,7 +11,7 @@
 #
 linux_genassym.o   optionalcompat_linux\
dependency  "$S/i386/linux/linux_genassym.c"\
-   compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
+   compile-with"${CC} ${CFLAGS:N-fno-common} -fcommon -c ${.IMPSRC}"   
\
no-obj no-implicit-rule \
clean   "linux_genassym.o"
 #
@@ -35,7 +35,7 @@ linux_vdso.so optionalcompat_linux
\
 #
 svr4_genassym.ooptionalcompat_svr4 
\
dependency  "$S/i386/svr4/svr4_genassym.c"  \
-   compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
+   compile-with"${CC} ${CFLAGS:N-fno-common} -fcommon -c ${.IMPSRC}"   
\
no-obj no-implicit-rule \
clean   

svn commit: r360493 - head/share/man/man5

2020-04-30 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Thu Apr 30 12:02:13 2020
New Revision: 360493
URL: https://svnweb.freebsd.org/changeset/base/360493

Log:
  Add a new manual page for unionfs(5), written by
  Gordon Bergling. Hook it up to the build by adding
  it to the Makefile.
  
  Submitted by: gbergling_gmail.com
  Approved by:  bcr
  Differential Revision:https://reviews.freebsd.org/D24589

Added:
  head/share/man/man5/unionfs.5   (contents, props changed)
Modified:
  head/share/man/man5/Makefile

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileThu Apr 30 11:17:29 2020
(r360492)
+++ head/share/man/man5/MakefileThu Apr 30 12:02:13 2020
(r360493)
@@ -69,7 +69,8 @@ MAN=  acct.5 \
style.Makefile.5 \
style.mdoc.5 \
sysctl.conf.5 \
-   tmpfs.5
+   tmpfs.5 \
+   unionfs.5
 
 MLINKS=dir.5 dirent.5
 MLINKS+=ext2fs.5 ext4fs.5

Added: head/share/man/man5/unionfs.5
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man5/unionfs.5   Thu Apr 30 12:02:13 2020
(r360493)
@@ -0,0 +1,87 @@
+.\" Copyright (c) 2020 Gordon Bergling
+.\"
+.\" 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 April 27, 2020
+.Dt UNIONFS 5
+.Os
+.Sh NAME
+.Nm unionfs
+.Nd "UNION FS"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "option UNIONFS"
+.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
+unionfs_load="YES"
+.Ed
+.Sh DESCRIPTION
+The UNIONFS driver is an implementation of a stackable unification filesystem.
+.Sh SEE ALSO
+.Xr mount_unionfs 8
+.Sh STANDARDS
+.Rs
+.%T Union mounts in 4.4BSD-Lite
+.%A J. S. Pendry
+.%A M. K. McKusick
+.%R Proceedings of the USENIX Technical Conference on UNIX and Advanced 
Computing Systems
+.%D December 1995
+.Re
+.Pp
+.Rs
+.%T Jails: Confining the omnipotent root
+.%A P. H. Kamp
+.%A R. N. M. Watson
+.%R Proceedings of the Second International System Administration and 
Networking Conference (SANE2000)
+.%D May 2000
+.Re
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 5.0 .
+.Sh AUTHORS
+The
+.Nm
+device driver was written by Jan-Simon Pendry for
+.Bx 4.4
+and
+.An Masanori OZAWA Aq Mt oz...@ongs.co.jp
+reimplemented the handling of the locking for
+.Fx 7.0 .
+The manual page was written by
+.An Gordon Bergling Aq Mt gbergl...@gmail.com .
+.Sh BUGS
+Please see the
+.Xr mount_unionfs 8
+manual page for a list of bugs regarding the
+.Nm
+filesystem.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360492 - head/share/man/man9

2020-04-30 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Thu Apr 30 11:17:29 2020
New Revision: 360492
URL: https://svnweb.freebsd.org/changeset/base/360492

Log:
  Add HISTORY sections to disk(9), driver(9), and
  epoch(9).
  
  In one instance, remove a trailing whitespace while here.
  
  Submitted by: gbergling_gmail.com
  Approved by:  bcr
  Differential Revision:https://reviews.freebsd.org/D24243

Modified:
  head/share/man/man9/disk.9
  head/share/man/man9/driver.9
  head/share/man/man9/epoch.9

Modified: head/share/man/man9/disk.9
==
--- head/share/man/man9/disk.9  Thu Apr 30 11:11:28 2020(r360491)
+++ head/share/man/man9/disk.9  Thu Apr 30 11:17:29 2020(r360492)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 3, 2017
+.Dd April 30, 2020
 .Dt DISK 9
 .Os
 .Sh NAME
@@ -241,6 +241,11 @@ Typically used to store a pointer to the drivers
 .Vt softc
 structure for this disk device.
 .El
+.Sh HISTORY
+The
+.Nm kernel disk storage API
+first appeard in
+.Fx 4.9 .
 .Sh SEE ALSO
 .Xr GEOM 4 ,
 .Xr devfs 5 ,

Modified: head/share/man/man9/driver.9
==
--- head/share/man/man9/driver.9Thu Apr 30 11:11:28 2020
(r360491)
+++ head/share/man/man9/driver.9Thu Apr 30 11:17:29 2020
(r360492)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 22, 2011
+.Dd April 30, 2020
 .Dt DRIVER 9
 .Os
 .Sh NAME
@@ -102,6 +102,11 @@ macro will also create the devclass with the name of t
 can optionally call extra initialisation code in the driver by
 specifying an extra module event handler and argument as the last two
 arguments.
+.Sh HISTORY
+The
+.Nm
+framework first appeared in
+.Fx 2.2.7 .
 .Sh SEE ALSO
 .Xr devclass 9 ,
 .Xr device 9 ,

Modified: head/share/man/man9/epoch.9
==
--- head/share/man/man9/epoch.9 Thu Apr 30 11:11:28 2020(r360491)
+++ head/share/man/man9/epoch.9 Thu Apr 30 11:17:29 2020(r360492)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 16, 2020
+.Dd April 30, 2020
 .Dt EPOCH 9
 .Os
 .Sh NAME
@@ -281,6 +281,11 @@ The
 .Nm
 kernel programming interface is under development and is subject to change.
 .El
+.Sh HISTORY
+The
+.Nm
+framework first appeard in
+.Fx 11.0 .
 .Sh SEE ALSO
 .Xr locking 9 ,
 .Xr mtx_pool 9 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360491 - head/sys/netinet/cc

2020-04-30 Thread Richard Scheffenegger
Author: rscheff
Date: Thu Apr 30 11:11:28 2020
New Revision: 360491
URL: https://svnweb.freebsd.org/changeset/base/360491

Log:
  Introduce a lower bound of 2 MSS to TCP Cubic.
  
  Running TCP Cubic together with ECN could end up reducing cwnd down to 1 
byte, if the
  receiver continously sets the ECE flag, resulting in very poor transmission 
speeds.
  
  In line with RFC6582 App. B, a lower bound of 2 MSS is introduced, as well as 
a typecast
  to prevent any potential integer overflows during intermediate calculation 
steps of the
  adjusted cwnd.
  
  Reported by:  Cheng Cui
  Reviewed by:  tuexen (mentor)
  Approved by:  tuexen (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23353

Modified:
  head/sys/netinet/cc/cc_cubic.c

Modified: head/sys/netinet/cc/cc_cubic.c
==
--- head/sys/netinet/cc/cc_cubic.c  Thu Apr 30 06:34:34 2020
(r360490)
+++ head/sys/netinet/cc/cc_cubic.c  Thu Apr 30 11:11:28 2020
(r360491)
@@ -366,8 +366,9 @@ cubic_post_recovery(struct cc_var *ccv)
CCV(ccv, t_maxseg);
else
/* Update cwnd based on beta and adjusted max_cwnd. */
-   CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA *
-   cubic_data->max_cwnd) >> CUBIC_SHIFT));
+   CCV(ccv, snd_cwnd) = 
max(((uint64_t)cubic_data->max_cwnd *
+   CUBIC_BETA) >> CUBIC_SHIFT,
+   2 * CCV(ccv, t_maxseg));
}
cubic_data->t_last_cong = ticks;
 
@@ -433,6 +434,7 @@ static void
 cubic_ssthresh_update(struct cc_var *ccv)
 {
struct cubic *cubic_data;
+   uint32_t ssthresh;
 
cubic_data = ccv->cc_data;
 
@@ -441,10 +443,11 @@ cubic_ssthresh_update(struct cc_var *ccv)
 * subsequent congestion events, set it to cwnd * beta.
 */
if (cubic_data->num_cong_events == 0)
-   CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd) >> 1;
+   ssthresh = CCV(ccv, snd_cwnd) >> 1;
else
-   CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) *
+   ssthresh = ((uint64_t)CCV(ccv, snd_cwnd) *
CUBIC_BETA) >> CUBIC_SHIFT;
+   CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * CCV(ccv, t_maxseg));
 }
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360490 - stable/11/sbin/fsck_msdosfs

2020-04-30 Thread Xin LI
Author: delphij
Date: Thu Apr 30 06:34:34 2020
New Revision: 360490
URL: https://svnweb.freebsd.org/changeset/base/360490

Log:
  MFC r345839, r345894, r345897, r345900-r345901, r345976, r346220, r348602, 
r348767, r348967,
  r349047-r349048, r351204-r351205, r351502, r351623, r352364, r356249-r356250, 
r356313,
  r356434, r356628-r356629, r356636, r356657, r357421, r357716, r360359, 
r360428:
  
  r345839: Assert that q can't be NULL.  'empty' is always non-NULL when 
DIREMPTY
  r345894: Restore the ability of checking and fixing next free
  r345897: Restore lfcl when LOSTDIR's chain was corrupted and overwritten
  r345900: Implement checking of `.' and `..' entries of subdirectory.
  r345901: Fix build.
  r345976: Write string constant differently to improve readability.
  r346220: Don't cast result from malloc().
  r348602: Don't increment cl after increment.
  r348767: preen should work independently with alwaysyes and alwaysno.
  r348967: Avoid out of boundary access when checking invalid long filenames.
  r349047: Blankspace.  No actual code change.
  r349048: In ask(): override default option if any of 
alwaysyes/alwaysno/rdonly is
  r351204: Remove redundant check and wrong fix: fat.c checks already take care
  r351205: Use calloc().
  r351502: Comment boot block checks and perform additional sanity checks:
  r351623: Remove unneeded blank line.  No functional change.
  r352364: Avoid mixing cluster numbers and sector numbers. Makes code more 
readable.
  r356249: Reduce memory footprint of fsck_msdosfs.
  r356250: Revert r356249 for now as it broke GCC builds.
  r356313: Reduce memory footprint of fsck_msdosfs.
  r356434: fsck_msdosfs.8: document -M.
  r356628: Require FAT to occupy at least one sector.
  r356629: Apply typo fix from NetBSD, we have already applied all NetBSD 
changes so
  r356636: Correct off-by-two issue when determining FAT type.
  r356657: Tighten FAT checks and fix off-by-one error in corner case.
  r357421: Diff reduction against NetBSD, no functional change.
  r357716: Use humanize_number to format available and bad space sizes.
  r360359: Fix a bug with dirty file system handling.
  r360428: Do not overflow when calculating file system size.

Modified:
  stable/11/sbin/fsck_msdosfs/Makefile
  stable/11/sbin/fsck_msdosfs/boot.c
  stable/11/sbin/fsck_msdosfs/check.c
  stable/11/sbin/fsck_msdosfs/dir.c
  stable/11/sbin/fsck_msdosfs/dosfs.h
  stable/11/sbin/fsck_msdosfs/ext.h
  stable/11/sbin/fsck_msdosfs/fat.c
  stable/11/sbin/fsck_msdosfs/fsck_msdosfs.8
  stable/11/sbin/fsck_msdosfs/main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/fsck_msdosfs/Makefile
==
--- stable/11/sbin/fsck_msdosfs/MakefileThu Apr 30 05:28:48 2020
(r360489)
+++ stable/11/sbin/fsck_msdosfs/MakefileThu Apr 30 06:34:34 2020
(r360490)
@@ -9,6 +9,7 @@ PROG=   fsck_msdosfs
 MAN=   fsck_msdosfs.8
 SRCS=  main.c check.c boot.c fat.c dir.c fsutil.c
 
-CFLAGS+= -I${FSCK}
+CFLAGS+= -I${FSCK} -DHAVE_LIBUTIL_H
+LIBADD=util
 
 .include 

Modified: stable/11/sbin/fsck_msdosfs/boot.c
==
--- stable/11/sbin/fsck_msdosfs/boot.c  Thu Apr 30 05:28:48 2020
(r360489)
+++ stable/11/sbin/fsck_msdosfs/boot.c  Thu Apr 30 06:34:34 2020
(r360490)
@@ -28,11 +28,14 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: boot.c,v 1.11 2006/06/05 16:51:18 christos Exp ");
+__RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $");
 static const char rcsid[] =
   "$FreeBSD$";
 #endif /* not lint */
 
+#include 
+
+#include 
 #include 
 #include 
 #include 
@@ -46,10 +49,8 @@ readboot(int dosfs, struct bootblock *boot)
 {
u_char block[DOSBOOTBLOCKSIZE];
u_char fsinfo[2 * DOSBOOTBLOCKSIZE];
-   u_char backup[DOSBOOTBLOCKSIZE];
int ret = FSOK;
-   int i;
-   
+
if ((size_t)read(dosfs, block, sizeof block) != sizeof block) {
perr("could not read boot block");
return FSFATAL;
@@ -64,61 +65,130 @@ readboot(int dosfs, struct bootblock *boot)
memset(boot, 0, sizeof *boot);
boot->ValidFat = -1;
 
-   /* decode bios parameter block */
+   /* Decode BIOS Parameter Block */
+
+   /* Bytes per sector: can only be  512, 1024, 2048 and 4096. */
boot->bpbBytesPerSec = block[11] + (block[12] << 8);
+   if (boot->bpbBytesPerSec < DOSBOOTBLOCKSIZE_REAL ||
+   boot->bpbBytesPerSec > DOSBOOTBLOCKSIZE ||
+   !powerof2(boot->bpbBytesPerSec)) {
+   pfatal("Invalid sector size: %u", boot->bpbBytesPerSec);
+   return FSFATAL;
+   }
+
+   /* Sectors per cluster: can only be: 1, 2, 4, 8, 16, 32, 64, 128. */
boot->bpbSecPerClust = block[13];
+   if (boot->bpbSecPerClust == 0 || !powerof2(boot->bpbSecPerClust)) {
+   pfatal("Invalid