svn commit: r357757 - in head: 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-02-10 Thread Xin LI
Author: delphij
Date: Tue Feb 11 07:02:48 2020
New Revision: 357757
URL: https://svnweb.freebsd.org/changeset/base/357757

Log:
  MFV r357712: file 5.38.
  
  MFC after:2 weeks

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

Modified: head/contrib/file/ChangeLog
==
--- head/contrib/file/ChangeLog Tue Feb 11 06:12:02 2020(r357756)
+++ head/contrib/file/ChangeLog Tue Feb 11 07:02:48 2020(r357757)
@@ -1,3 +1,23 @@
+2019-12-16  21:11  Christos Zoulas 
+
+   * release 5.38
+
+2019-12-15  22:13  Christos Zoulas 
+

svn commit: r357756 - head/usr.sbin/periodic/etc/daily

2020-02-10 Thread Kyle Evans
Author: kevans
Date: Tue Feb 11 06:12:02 2020
New Revision: 357756
URL: https://svnweb.freebsd.org/changeset/base/357756

Log:
  backup-passwd: mask out all passwords in the diff
  
  The previous expression borked if a username had a plus or hyphen in it.
  This is needlessly restrictive- at leSt a hyphen in the middle is valid.
  Instead of playing this game, let's just assume the username can't contain a
  colon and mask out the second field.
  
  Submitted by: sigsys gmail com
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D23548

Modified:
  head/usr.sbin/periodic/etc/daily/200.backup-passwd

Modified: head/usr.sbin/periodic/etc/daily/200.backup-passwd
==
--- head/usr.sbin/periodic/etc/daily/200.backup-passwd  Tue Feb 11 05:15:35 
2020(r357755)
+++ head/usr.sbin/periodic/etc/daily/200.backup-passwd  Tue Feb 11 06:12:02 
2020(r357756)
@@ -42,7 +42,7 @@ case "$daily_backup_passwd_enable" in
[ $rc -lt 1 ] && rc=1
echo "$host passwd diffs:"
diff -uI '^#' $bak/master.passwd.bak /etc/master.passwd |\
-   sed 's/^\([-+ ][^-+:]*\):[^:]*:/\1:(password):/'
+   sed 's/^\([-+ ][^:]*\):[^:]*:/\1:(password):/'
mv $bak/master.passwd.bak $bak/master.passwd.bak2
cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3
fi
___
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: r357755 - stable/12/contrib/elftoolchain/elfcopy

2020-02-10 Thread Mark Johnston
Author: markj
Date: Tue Feb 11 05:15:35 2020
New Revision: 357755
URL: https://svnweb.freebsd.org/changeset/base/357755

Log:
  MFC r357537, r357538:
  elfcopy: Coverity fixups.

Modified:
  stable/12/contrib/elftoolchain/elfcopy/main.c
  stable/12/contrib/elftoolchain/elfcopy/sections.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/elfcopy/main.c
==
--- stable/12/contrib/elftoolchain/elfcopy/main.c   Tue Feb 11 05:14:36 
2020(r357754)
+++ stable/12/contrib/elftoolchain/elfcopy/main.c   Tue Feb 11 05:15:35 
2020(r357755)
@@ -587,15 +587,19 @@ copy_from_tempfile(const char *src, const char *dst, i
if ((tmpfd = open(dst, O_CREAT | O_TRUNC | O_WRONLY, 0755)) < 0)
return (-1);
 
-   if (elftc_copyfile(infd, tmpfd) < 0)
+   if (elftc_copyfile(infd, tmpfd) < 0) {
+   (void) close(tmpfd);
return (-1);
+   }
 
/*
 * Remove the temporary file from the file system
 * namespace, and close its file descriptor.
 */
-   if (unlink(src) < 0)
+   if (unlink(src) < 0) {
+   (void) close(tmpfd);
return (-1);
+   }
 
(void) close(infd);
 

Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c
==
--- stable/12/contrib/elftoolchain/elfcopy/sections.c   Tue Feb 11 05:14:36 
2020(r357754)
+++ stable/12/contrib/elftoolchain/elfcopy/sections.c   Tue Feb 11 05:15:35 
2020(r357755)
@@ -1092,7 +1092,7 @@ read_section(struct section *s, size_t *size)
if (b == NULL)
b = malloc(id->d_size);
else
-   b = malloc(sz + id->d_size);
+   b = realloc(b, sz + id->d_size);
if (b == NULL)
err(EXIT_FAILURE, "malloc or realloc failed");
 
___
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: r357754 - stable/12/contrib/elftoolchain/libdwarf

2020-02-10 Thread Mark Johnston
Author: markj
Date: Tue Feb 11 05:14:36 2020
New Revision: 357754
URL: https://svnweb.freebsd.org/changeset/base/357754

Log:
  MFC r357531, r357532, r357533, r357534:
  libdwarf: Coverity fixups.

Modified:
  stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c
  stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_expr.c
  stable/12/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c
  stable/12/contrib/elftoolchain/libdwarf/libdwarf_frame.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c
==
--- stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_attr.cTue Feb 11 
05:13:35 2020(r357753)
+++ stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_attr.cTue Feb 11 
05:14:36 2020(r357754)
@@ -46,8 +46,10 @@ dwarf_add_AT_location_expr(Dwarf_P_Debug dbg, Dwarf_P_
at->at_attrib = attr;
at->at_expr = loc_expr;
 
-   if (_dwarf_expr_into_block(loc_expr, error) != DW_DLE_NONE)
+   if (_dwarf_expr_into_block(loc_expr, error) != DW_DLE_NONE) {
+   free(at);
return (DW_DLV_BADADDR);
+   }
at->u[0].u64 = loc_expr->pe_length;
at->u[1].u8p = loc_expr->pe_block;
if (loc_expr->pe_length <= UCHAR_MAX)

Modified: stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_expr.c
==
--- stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_expr.cTue Feb 11 
05:13:35 2020(r357753)
+++ stable/12/contrib/elftoolchain/libdwarf/dwarf_pro_expr.cTue Feb 11 
05:14:36 2020(r357754)
@@ -36,10 +36,10 @@ _dwarf_add_expr(Dwarf_P_Expr expr, Dwarf_Small opcode,
Dwarf_Debug dbg;
int len;
 
-   dbg = expr != NULL ? expr->pe_dbg : NULL;
+   dbg = expr->pe_dbg;
 
-   if (_dwarf_loc_expr_add_atom(expr->pe_dbg, NULL, NULL, opcode, val1,
-   val2, , error) != DW_DLE_NONE)
+   if (_dwarf_loc_expr_add_atom(dbg, NULL, NULL, opcode, val1, val2, ,
+   error) != DW_DLE_NONE)
return (NULL);
assert(len > 0);
 
@@ -67,7 +67,7 @@ _dwarf_expr_into_block(Dwarf_P_Expr expr, Dwarf_Error 
Dwarf_Debug dbg;
int len, pos, ret;
 
-   dbg = expr != NULL ? expr->pe_dbg : NULL;
+   dbg = expr->pe_dbg;
 
if (expr->pe_block != NULL) {
free(expr->pe_block);
@@ -88,7 +88,7 @@ _dwarf_expr_into_block(Dwarf_P_Expr expr, Dwarf_Error 
pos = 0;
STAILQ_FOREACH(ee, >pe_eelist, ee_next) {
assert((Dwarf_Unsigned) pos < expr->pe_length);
-   ret = _dwarf_loc_expr_add_atom(expr->pe_dbg,
+   ret = _dwarf_loc_expr_add_atom(dbg,
>pe_block[pos], >pe_block[expr->pe_length],
ee->ee_loc.lr_atom, ee->ee_loc.lr_number,
ee->ee_loc.lr_number2, , error);

Modified: stable/12/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c
==
--- stable/12/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c   Tue Feb 11 
05:13:35 2020(r357753)
+++ stable/12/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c   Tue Feb 11 
05:14:36 2020(r357754)
@@ -59,9 +59,7 @@ _dwarf_abbrev_add(Dwarf_CU cu, uint64_t entry, uint64_
HASH_ADD(ab_hh, cu->cu_abbrev_hash, ab_entry,
sizeof(ab->ab_entry), ab);
 
-   if (abp != NULL)
-   *abp = ab;
-
+   *abp = ab;
return (DW_DLE_NONE);
 }
 

Modified: stable/12/contrib/elftoolchain/libdwarf/libdwarf_frame.c
==
--- stable/12/contrib/elftoolchain/libdwarf/libdwarf_frame.cTue Feb 11 
05:13:35 2020(r357753)
+++ stable/12/contrib/elftoolchain/libdwarf/libdwarf_frame.cTue Feb 11 
05:14:36 2020(r357754)
@@ -468,9 +468,9 @@ _dwarf_frame_section_init(Dwarf_Debug dbg, Dwarf_Frame
 
if (length > ds->ds_size - offset ||
(length == 0 && !eh_frame)) {
-   DWARF_SET_ERROR(dbg, error,
-   DW_DLE_DEBUG_FRAME_LENGTH_BAD);
-   return (DW_DLE_DEBUG_FRAME_LENGTH_BAD);
+   ret = DW_DLE_DEBUG_FRAME_LENGTH_BAD;
+   DWARF_SET_ERROR(dbg, error, ret);
+   goto fail_cleanup;
}
 
/* Check terminator for .eh_frame */
___
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: r357753 - stable/12/contrib/elftoolchain/readelf

2020-02-10 Thread Mark Johnston
Author: markj
Date: Tue Feb 11 05:13:35 2020
New Revision: 357753
URL: https://svnweb.freebsd.org/changeset/base/357753

Log:
  MFC r357542:
  readelf: Don't leak memory when dwarf_get_fde_info_for_all_regs() fails.

Modified:
  stable/12/contrib/elftoolchain/readelf/readelf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/readelf/readelf.c
==
--- stable/12/contrib/elftoolchain/readelf/readelf.cTue Feb 11 05:11:52 
2020(r357752)
+++ stable/12/contrib/elftoolchain/readelf/readelf.cTue Feb 11 05:13:35 
2020(r357753)
@@ -5871,6 +5871,7 @@ dump_dwarf_frame_regtable(struct readelf *re, Dwarf_Fd
for (; cur_pc < end_pc; cur_pc++) {
if (dwarf_get_fde_info_for_all_regs(fde, cur_pc, , _pc,
) != DW_DLV_OK) {
+   free(vec);
warnx("dwarf_get_fde_info_for_all_regs failed: %s\n",
dwarf_errmsg(de));
return (-1);
___
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: r357752 - stable/12/contrib/elftoolchain/size

2020-02-10 Thread Mark Johnston
Author: markj
Date: Tue Feb 11 05:11:52 2020
New Revision: 357752
URL: https://svnweb.freebsd.org/changeset/base/357752

Log:
  MFC r357539:
  size: Avoid returning a stack pointer from xlatetom().

Modified:
  stable/12/contrib/elftoolchain/size/size.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/size/size.c
==
--- stable/12/contrib/elftoolchain/size/size.c  Tue Feb 11 05:11:27 2020
(r357751)
+++ stable/12/contrib/elftoolchain/size/size.c  Tue Feb 11 05:11:52 2020
(r357752)
@@ -211,7 +211,7 @@ main(int argc, char **argv)
 return (rc);
 }
 
-static Elf_Data *
+static int
 xlatetom(Elf *elf, GElf_Ehdr *elfhdr, void *_src, void *_dst,
 Elf_Type type, size_t size)
 {
@@ -224,7 +224,8 @@ xlatetom(Elf *elf, GElf_Ehdr *elfhdr, void *_src, void
dst.d_buf = _dst;
dst.d_version = elfhdr->e_version;
dst.d_size = size;
-   return (gelf_xlatetom(elf, , , elfhdr->e_ident[EI_DATA]));
+   return (gelf_xlatetom(elf, , , elfhdr->e_ident[EI_DATA]) !=
+   NULL ? 0 : 1);
 }
 
 #define NOTE_OFFSET_32(nhdr, namesz, offset)   \
@@ -285,12 +286,12 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phd
while (data != NULL && offset + sizeof(Elf32_Nhdr) < segment_end) {
nhdr = (Elf32_Nhdr *)(uintptr_t)((char*)data + offset);
memset(_l, 0, sizeof(Elf32_Nhdr));
-   if (!xlatetom(elf, elfhdr, >n_type, _l.n_type,
-   ELF_T_WORD, sizeof(Elf32_Word)) ||
-   !xlatetom(elf, elfhdr, >n_descsz, _l.n_descsz,
-   ELF_T_WORD, sizeof(Elf32_Word)) ||
-   !xlatetom(elf, elfhdr, >n_namesz, _l.n_namesz,
-   ELF_T_WORD, sizeof(Elf32_Word)))
+   if (xlatetom(elf, elfhdr, >n_type, _l.n_type,
+   ELF_T_WORD, sizeof(Elf32_Word)) != 0 ||
+   xlatetom(elf, elfhdr, >n_descsz, _l.n_descsz,
+   ELF_T_WORD, sizeof(Elf32_Word)) != 0 ||
+   xlatetom(elf, elfhdr, >n_namesz, _l.n_namesz,
+   ELF_T_WORD, sizeof(Elf32_Word)) != 0)
break;
 
if (offset + sizeof(Elf32_Nhdr) +
@@ -327,10 +328,10 @@ handle_core_note(Elf *elf, GElf_Ehdr *elfhdr, GElf_Phd
pid = PID64(nhdr,
nhdr_l.n_namesz, 40);
}
-   xlatetom(elf, elfhdr, _size, _size,
-   ELF_T_WORD, sizeof(uint64_t));
-   xlatetom(elf, elfhdr, , , ELF_T_WORD,
-   sizeof(pid_t));
+   (void)xlatetom(elf, elfhdr, _size,
+   _size, ELF_T_WORD, sizeof(uint64_t));
+   (void)xlatetom(elf, elfhdr, , ,
+   ELF_T_WORD, sizeof(pid_t));
}
 
if (raw_size != 0 && style == STYLE_SYSV) {
___
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: r357751 - stable/12/contrib/elftoolchain/libelftc

2020-02-10 Thread Mark Johnston
Author: markj
Date: Tue Feb 11 05:11:27 2020
New Revision: 357751
URL: https://svnweb.freebsd.org/changeset/base/357751

Log:
  MFC r357535, r357536:
  libelftc: Fix memory leaks in the C++ demanglers.

Modified:
  stable/12/contrib/elftoolchain/libelftc/libelftc_dem_arm.c
  stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c
  stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/libelftc/libelftc_dem_arm.c
==
--- stable/12/contrib/elftoolchain/libelftc/libelftc_dem_arm.c  Tue Feb 11 
04:05:45 2020(r357750)
+++ stable/12/contrib/elftoolchain/libelftc/libelftc_dem_arm.c  Tue Feb 11 
05:11:27 2020(r357751)
@@ -203,11 +203,13 @@ cpp_demangle_ARM(const char *org)
break;
 
if ((arg = vector_str_substr(, arg_begin, d.vec.size - 1,
-   _len)) == NULL)
+   _len)) == NULL)
goto clean;
 
-   if (vector_str_push(, arg, arg_len) == false)
+   if (vector_str_push(, arg, arg_len) == false) {
+   free(arg);
goto clean;
+   }
 
free(arg);
 
@@ -301,12 +303,11 @@ init_demangle_data(struct demangle_data *d)
 
d->type = ENCODE_FUNC;
 
-   if (vector_str_init(>vec) == false)
+   if (!vector_str_init(>vec))
return (false);
 
-   if (vector_str_init(>arg) == false) {
+   if (!vector_str_init(>arg)) {
vector_str_dest(>vec);
-
return (false);
}
 
@@ -956,7 +957,7 @@ read_op_user(struct demangle_data *d)
goto clean;
 
if (VEC_PUSH_STR(>vec, "::operator ") == false)
-   return (false);
+   goto clean;
 
if (vector_str_push(>vec, to_str, to_len) == false)
goto clean;

Modified: stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c
==
--- stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Tue Feb 11 
04:05:45 2020(r357750)
+++ stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Tue Feb 11 
05:11:27 2020(r357751)
@@ -216,11 +216,13 @@ cpp_demangle_gnu2(const char *org)
break;
 
if ((arg = vector_str_substr(, arg_begin, d.vec.size - 1,
-   _len)) == NULL)
+   _len)) == NULL)
goto clean;
 
-   if (vector_str_push(, arg, arg_len) == false)
+   if (vector_str_push(, arg, arg_len) == false) {
+   free(arg);
goto clean;
+   }
 
free(arg);
 
@@ -387,12 +389,11 @@ init_demangle_data(struct demangle_data *d)
 
d->type = ENCODE_FUNC;
 
-   if (vector_str_init(>vec) == false)
+   if (!vector_str_init(>vec))
return (false);
 
-   if (vector_str_init(>arg) == false) {
+   if (!vector_str_init(>arg)) {
vector_str_dest(>vec);
-
return (false);
}
 

Modified: stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
==
--- stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Tue Feb 11 
04:05:45 2020(r357750)
+++ stable/12/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Tue Feb 11 
05:11:27 2020(r357751)
@@ -1659,7 +1659,8 @@ cpp_demangle_read_local_name(struct cpp_demangle_data 
if (*(++ddata->cur) == '\0')
return (0);
 
-   vector_str_init(_name);
+   if (!vector_str_init(_name))
+   return (0);
ddata->cur_output = _name;
 
if (!cpp_demangle_read_encoding(ddata)) {
@@ -3953,7 +3954,7 @@ vector_type_qualifier_init(struct vector_type_qualifie
 
assert(v->q_container != NULL);
 
-   if (vector_str_init(>ext_name) == false) {
+   if (!vector_str_init(>ext_name)) {
free(v->q_container);
return (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: r357750 - head/release/tools

2020-02-10 Thread Colin Percival
Author: cperciva
Date: Tue Feb 11 04:05:45 2020
New Revision: 357750
URL: https://svnweb.freebsd.org/changeset/base/357750

Log:
  Mount /dev while deinstalling pkg inside EC2 AMIs.
  
  This gets rid of (harmless) warnings:
  "pkg: Cannot open /dev/null:No such file or directory".
  
  MFC after:2 weeks

Modified:
  head/release/tools/ec2.conf

Modified: head/release/tools/ec2.conf
==
--- head/release/tools/ec2.conf Tue Feb 11 04:03:22 2020(r357749)
+++ head/release/tools/ec2.conf Tue Feb 11 04:05:45 2020(r357750)
@@ -40,8 +40,10 @@ vm_extra_pre_umount() {
# catalogue and install or update pkg when the instance first
# launches, so these files would just be replaced anyway; removing
# them from the image allows it to boot faster.
+   mount -t devfs devfs ${DESTDIR}/dev
chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
/usr/sbin/pkg delete -f -y pkg
+   umount ${DESTDIR}/dev
rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
 
# The size of the EC2 root disk can be configured at instance launch
___
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: r357749 - head/release/tools

2020-02-10 Thread Colin Percival
Author: cperciva
Date: Tue Feb 11 04:03:22 2020
New Revision: 357749
URL: https://svnweb.freebsd.org/changeset/base/357749

Log:
  Remove /qemu from EC2 ARM AMIs
  
  I forgot to do this as part of r345858 -- I added it to the
  vm_extra_pre_umount in vmimage.subr but forgot that function
  was overridden in the EC2 build.
  
  MFC after:2 weeks

Modified:
  head/release/tools/ec2.conf

Modified: head/release/tools/ec2.conf
==
--- head/release/tools/ec2.conf Tue Feb 11 03:37:42 2020(r357748)
+++ head/release/tools/ec2.conf Tue Feb 11 04:03:22 2020(r357749)
@@ -116,6 +116,9 @@ vm_extra_pre_umount() {
# * firstboot_pkgs (install packages)
touch ${DESTDIR}/firstboot
 
+   if ! [ -z "${QEMUSTATIC}" ]; then
+   rm -f ${DESTDIR}/${EMULATOR}
+   fi
rm -f ${DESTDIR}/etc/resolv.conf
 
return 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: r357748 - stable/12/sys/kern

2020-02-10 Thread Mark Johnston
Author: markj
Date: Tue Feb 11 03:37:42 2020
New Revision: 357748
URL: https://svnweb.freebsd.org/changeset/base/357748

Log:
  MFC r357525:
  Correct the malloc tag used when freeing the temporary semop(2) buffer.

Modified:
  stable/12/sys/kern/sysv_sem.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/sysv_sem.c
==
--- stable/12/sys/kern/sysv_sem.c   Tue Feb 11 00:43:58 2020
(r357747)
+++ stable/12/sys/kern/sysv_sem.c   Tue Feb 11 03:37:42 2020
(r357748)
@@ -1142,7 +1142,7 @@ sys_semop(struct thread *td, struct semop_args *uap)
DPRINTF(("error = %d from copyin(%p, %p, %d)\n", error,
uap->sops, sops, nsops * sizeof(sops[0])));
if (sops != small_sops)
-   free(sops, M_SEM);
+   free(sops, M_TEMP);
return (error);
}
 
@@ -1393,7 +1393,7 @@ done:
 done2:
mtx_unlock(sema_mtxp);
if (sops != small_sops)
-   free(sops, M_SEM);
+   free(sops, M_TEMP);
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"


Re: svn commit: r357728 - head/sys/sys

2020-02-10 Thread Gleb Smirnoff
On Mon, Feb 10, 2020 at 01:52:26PM +, Mateusz Guzik wrote:
M> Author: mjg
M> Date: Mon Feb 10 13:52:25 2020
M> New Revision: 357728
M> URL: https://svnweb.freebsd.org/changeset/base/357728
M> 
M> Log:
M>   Tidy up zpcpu_replace*
M>   
M>   - only compute the target address once
M>   - remove spurious type casting, zpcpu_get already return the correct type
M>   
M>   While here add missing newlines to other routines.
M> 
M> Modified:
M>   head/sys/sys/pcpu.h
M> 
M> Modified: head/sys/sys/pcpu.h
M> 
==
M> --- head/sys/sys/pcpu.h  Mon Feb 10 13:24:14 2020(r357727)
M> +++ head/sys/sys/pcpu.h  Mon Feb 10 13:52:25 2020(r357728)
M> @@ -245,32 +245,41 @@ extern struct pcpu *cpuid_to_pcpu[];
M>   * If you need atomicity use xchg.
M>   * */
M>  #define zpcpu_replace(base, val) ({ \
M> -__typeof(val) _old = *(__typeof(base))zpcpu_get(base);  \
M> -*(__typeof(val) *)zpcpu_get(base) = val;\
M> +__typeof(val) *_ptr = zpcpu_get(base);  \
M> +__typeof(val) _old; \
M> +\
M> +_old = *_ptr;   \
M> +*_ptr = val;\
M>  _old;   \
M>  })

I think this function must have only protected variant that asserts
that curthread->td_critnest is on.

zpcpu_get() sometimes can be used without critical section, when we
are fine with getting a value from a different CPU.

However, can't imagine a situation where migrating during a replace
operation is acceptable.

-- 
Gleb Smirnoff
___
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: r357747 - svnadmin/conf

2020-02-10 Thread Alexander Motin
Author: mav
Date: Tue Feb 11 00:43:58 2020
New Revision: 357747
URL: https://svnweb.freebsd.org/changeset/base/357747

Log:
  Enable commit access for Ryan Moeller (freqlabs).
  
  Matt Macy will co-mentor.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessMon Feb 10 22:28:54 2020(r357746)
+++ svnadmin/conf/accessTue Feb 11 00:43:58 2020(r357747)
@@ -75,6 +75,7 @@ emax
 erj
 eugen
 fabient
+freqlabs
 fsu
 gabor  devnull
 gad

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Feb 10 22:28:54 2020(r357746)
+++ svnadmin/conf/mentors   Tue Feb 11 00:43:58 2020(r357747)
@@ -14,6 +14,7 @@ alfredo   jhibbits
 anish  jhb
 brdallanjude   Co-mentor: bapt
 chsimp
+freqlabs   mav Co-mentor: mmacy
 gordon delphij Co-mentor: emaste
 jceel  trasz
 jkhrwatson
___
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: r357746 - head/sys/kern

2020-02-10 Thread Mateusz Guzik
Author: mjg
Date: Mon Feb 10 22:28:54 2020
New Revision: 357746
URL: https://svnweb.freebsd.org/changeset/base/357746

Log:
  vfs: fix device count leak on vrele racing with vgone
  
  The race is:
  
  CPU1CPU2
  devfs_reclaim_vchr
  make v_usecount 0
VI_LOCK
sees v_usecount == 0, no updates
vp->v_rdev = NULL;
...
VI_UNLOCK
  VI_LOCK
  v_decr_devcount
sees v_rdev == NULL, no updates
  
  In this scenario si_devcount decrement is not performed.
  
  Note this can only happen if the vnode lock is not held.
  
  Reviewed by:  kib
  Tested by:pho
  Differential Revision:https://reviews.freebsd.org/D23529

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cMon Feb 10 20:53:59 2020(r357745)
+++ head/sys/kern/vfs_subr.cMon Feb 10 22:28:54 2020(r357746)
@@ -3192,12 +3192,22 @@ vputx(struct vnode *vp, enum vputx_op func)
 * count which provides liveness of the vnode, in which case we
 * have to vdrop.
 */
-   if (!refcount_release(>v_usecount)) {
-   if (func == VPUTX_VPUT)
-   VOP_UNLOCK(vp);
-   return;
+   if (__predict_false(vp->v_type == VCHR && func == VPUTX_VRELE)) {
+   if (refcount_release_if_not_last(>v_usecount))
+   return;
+   VI_LOCK(vp);
+   if (!refcount_release(>v_usecount)) {
+   VI_UNLOCK(vp);
+   return;
+   }
+   } else {
+   if (!refcount_release(>v_usecount)) {
+   if (func == VPUTX_VPUT)
+   VOP_UNLOCK(vp);
+   return;
+   }
+   VI_LOCK(vp);
}
-   VI_LOCK(vp);
v_decr_devcount(vp);
/*
 * By the time we got here someone else might have transitioned
___
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: r357745 - head/sys/kern

2020-02-10 Thread Li-Wen Hsu
Author: lwhsu
Date: Mon Feb 10 20:53:59 2020
New Revision: 357745
URL: https://svnweb.freebsd.org/changeset/base/357745

Log:
  Restore the behavior of allowing empty string in a string sysctl
  
  Added as a special case to avoid unnecessary memory operations.
  
  Reviewed by:  delphij
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Mon Feb 10 20:23:08 2020(r357744)
+++ head/sys/kern/kern_sysctl.c Mon Feb 10 20:53:59 2020(r357745)
@@ -1687,8 +1687,12 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS)
return (error);
 
if (req->newlen - req->newidx >= arg2 ||
-   req->newlen - req->newidx <= 0) {
+   req->newlen - req->newidx < 0) {
error = EINVAL;
+   } else if (req->newlen - req->newidx == 0) {
+   sx_xlock();
+   ((char *)arg1)[0] = '\0';
+   sx_xunlock();
} else {
arg2 = req->newlen - req->newidx;
tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK);
___
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: r357744 - head/sys/kern

2020-02-10 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 10 20:23:08 2020
New Revision: 357744
URL: https://svnweb.freebsd.org/changeset/base/357744

Log:
  Fix for unbalanced EPOCH(9) usage in the generic kernel interrupt
  handler.
  
  Interrupt handlers are removed via intr_event_execute_handlers() when
  IH_DEAD is set. The thread removing the interrupt is woken up, and
  calls intr_event_update(). When this happens, the ie_hflags are
  cleared and re-built from all the remaining handlers sharing the
  event. When the last IH_NET handler is removed, the IH_NET flag will
  be cleared from ih_hflags (or ie_hflags may still be being rebuilt in
  a different context), and the ithread_execute_handlers() may return
  with ie_hflags missing IH_NET. This can lead to a scenario where
  IH_NET was present before calling ithread_execute_handlers, and is not
  present at its return, meaning the need for epoch must be cached
  locally.
  
  This can happen when loading and unloading network drivers. Also make
  sure the ie_hflags is not cleared before being updated.
  
  This is a regression issue after r357004.
  
  Backtrace:
  panic()
  # trying to access epoch tracker on stack of dead thread
  _epoch_enter_preempt()
  ifunit_ref()
  ifioctl()
  fo_ioctl()
  kern_ioctl()
  sys_ioctl()
  syscallenter()
  amd64_syscall()
  
  Differential Revision:https://reviews.freebsd.org/D23483
  Reviewed by:  glebius@, gallatin@, mav@, jeff@ and kib@
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/kern/kern_intr.c

Modified: head/sys/kern/kern_intr.c
==
--- head/sys/kern/kern_intr.c   Mon Feb 10 18:28:02 2020(r357743)
+++ head/sys/kern/kern_intr.c   Mon Feb 10 20:23:08 2020(r357744)
@@ -189,12 +189,12 @@ intr_event_update(struct intr_event *ie)
 {
struct intr_handler *ih;
char *last;
-   int missed, space;
+   int missed, space, flags;
 
/* Start off with no entropy and just the name of the event. */
mtx_assert(>ie_lock, MA_OWNED);
strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname));
-   ie->ie_hflags = 0;
+   flags = 0;
missed = 0;
space = 1;
 
@@ -207,8 +207,9 @@ intr_event_update(struct intr_event *ie)
space = 0;
} else
missed++;
-   ie->ie_hflags |= ih->ih_flags;
+   flags |= ih->ih_flags;
}
+   ie->ie_hflags = flags;
 
/*
 * If there is only one handler and its name is too long, just copy in
@@ -1208,6 +1209,7 @@ ithread_loop(void *arg)
struct thread *td;
struct proc *p;
int wake, epoch_count;
+   bool needs_epoch;
 
td = curthread;
p = td->td_proc;
@@ -1242,20 +1244,22 @@ ithread_loop(void *arg)
 * that the load of ih_need in ithread_execute_handlers()
 * is ordered after the load of it_need here.
 */
-   if (ie->ie_hflags & IH_NET) {
+   needs_epoch =
+   (atomic_load_int(>ie_hflags) & IH_NET) != 0;
+   if (needs_epoch) {
epoch_count = 0;
NET_EPOCH_ENTER(et);
}
while (atomic_cmpset_acq_int(>it_need, 1, 0) != 0) {
ithread_execute_handlers(p, ie);
-   if ((ie->ie_hflags & IH_NET) &&
+   if (needs_epoch &&
++epoch_count >= intr_epoch_batch) {
NET_EPOCH_EXIT(et);
epoch_count = 0;
NET_EPOCH_ENTER(et);
}
}
-   if (ie->ie_hflags & IH_NET)
+   if (needs_epoch)
NET_EPOCH_EXIT(et);
WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread");
mtx_assert(, MA_NOTOWNED);
___
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"


Re: svn commit: r357361 - in head/sys: kern sys ufs/ufs vm

2020-02-10 Thread Mateusz Guzik
On 2/3/20, John Baldwin  wrote:
> On 1/31/20 10:46 PM, Mateusz Guzik wrote:
>> Author: mjg
>> Date: Sat Feb  1 06:46:55 2020
>> New Revision: 357361
>> URL: https://svnweb.freebsd.org/changeset/base/357361
>>
>> Log:
>>   vfs: replace VOP_MARKATIME with VOP_MMAPPED
>>
>>   The routine is only provided by ufs and is only used on mmap and exec.
>>
>>   Reviewed by:   kib
>>   Differential Revision: https://reviews.freebsd.org/D23422
>>
>> Modified:
>>   head/sys/kern/kern_exec.c
>>   head/sys/kern/vfs_subr.c
>>   head/sys/kern/vnode_if.src
>>   head/sys/sys/vnode.h
>>   head/sys/ufs/ufs/ufs_vnops.c
>>   head/sys/vm/vm_mmap.c
>>
>> Modified: head/sys/ufs/ufs/ufs_vnops.c
>> ==
>> --- head/sys/ufs/ufs/ufs_vnops.c Sat Feb  1 06:41:44 2020
>> (r357360)
>> +++ head/sys/ufs/ufs/ufs_vnops.c Sat Feb  1 06:46:55 2020
>> (r357361)
>> @@ -108,7 +108,7 @@ static vop_getattr_t ufs_getattr;
>>  static vop_ioctl_t  ufs_ioctl;
>>  static vop_link_t   ufs_link;
>>  static int ufs_makeinode(int mode, struct vnode *, struct vnode **,
>> struct componentname *, const char *);
>> -static vop_markatime_t  ufs_markatime;
>> +static vop_mmapped_tufs_mmapped;
>>  static vop_mkdir_t  ufs_mkdir;
>>  static vop_mknod_t  ufs_mknod;
>>  static vop_open_t   ufs_open;
>> @@ -676,19 +676,22 @@ out:
>>  }
>>  #endif /* UFS_ACL */
>>
>> -/*
>> - * Mark this file's access time for update for vfs_mark_atime().  This
>> - * is called from execve() and mmap().
>> - */
>
> Why remove this comment rather than update it?  It is largely still
> true and explains the purpose of the VOP (update the atime) which is
> now no longer obvious from the name.
>

I don't think a fs-specific implementation of a VOP is the right place to
state where it is called from. I would argue the name could be better as
the execve bit is definitely not obvious, but interested parties can
always grep.

Finally, the function literally just updates atime so I don't think
repeating this in the comment buys anything.

-- 
Mateusz Guzik 
___
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"


Re: svn commit: r357695 - in head: sys/kern sys/sys usr.bin/procstat

2020-02-10 Thread Konstantin Belousov
On Mon, Feb 10, 2020 at 10:11:43AM -0800, John Baldwin wrote:
> On 2/9/20 4:10 AM, Konstantin Belousov wrote:
> > Author: kib
> > Date: Sun Feb  9 12:10:37 2020
> > New Revision: 357695
> > URL: https://svnweb.freebsd.org/changeset/base/357695
> > 
> > Log:
> >   Add AT_BSDFLAGS auxv entry.
> >   
> >   The intent is to provide bsd-specific flags relevant to interpreter
> >   and C runtime.  I did not want to reuse AT_FLAGS which is common ELF
> >   auxv entry.
> >   
> >   Use bsdflags to report kernel support for sigfastblock(2).  This
> >   allows rtld and libthr to safely infer the syscall presence without
> >   SIGSYS.  The tunable kern.elf{32,64}.sigfastblock blocks reporting.
> >   
> >   Tested by:pho
> >   Disscussed with:  cem, emaste, jilles
> >   Sponsored by: The FreeBSD Foundation
> >   Differential revision:https://reviews.freebsd.org/D12773
> 
> I find adding a new auxv type curious.  The MIPS ABI doc says that
> "bits under the 0xff00 mask are reserved for system semantics".
> The powerpc and x86-64 docs don't define any bits at all.  In
> practice I think we are free to use AT_FLAGS however we wish as no
> use cases of "standard" bits have arisen since AT_FLAGS was first
> defined.

So you would prefer to have me used AT_FLAGS for sigfastblock indicator ?
I am feeling uncomfortable doing that.

My reasoning, to reformulate it from what I wrote in the commit message,
is to not pollute neither compilation nor ABI namespace for bsd-specific
flags.  AT_FLAGS was not touched by anybody and I do not want to open
it for use, since ABI group my finally find some use for it.
___
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: r357743 - head/usr.sbin/ntp

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 18:28:02 2020
New Revision: 357743
URL: https://svnweb.freebsd.org/changeset/base/357743

Log:
  Use __riscv instead of __riscv__
  
  I misread arch(7) when I added this...
  
  Noticed by: jhb@ and mhorne@

Modified:
  head/usr.sbin/ntp/config.h

Modified: head/usr.sbin/ntp/config.h
==
--- head/usr.sbin/ntp/config.h  Mon Feb 10 18:06:38 2020(r357742)
+++ head/usr.sbin/ntp/config.h  Mon Feb 10 18:28:02 2020(r357743)
@@ -1592,7 +1592,7 @@
 #define STR_SYSTEM "arm64-undermydesk-freebsd"
 #elif defined(__arm__)
 #define STR_SYSTEM "arm-undermydesk-freebsd"
-#elif defined(__riscv__)
+#elif defined(__riscv)
 #define STR_SYSTEM "riscv64-undermydesk-freebsd"
 #else
 #define STR_SYSTEM "i386-undermydesk-freebsd"
___
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"


Re: svn commit: r357740 - head/usr.sbin/ntp

2020-02-10 Thread Warner Losh
On Mon, Feb 10, 2020 at 11:15 AM John Baldwin  wrote:

> On 2/10/20 9:17 AM, Warner Losh wrote:
> > Author: imp
> > Date: Mon Feb 10 17:17:03 2020
> > New Revision: 357740
> > URL: https://svnweb.freebsd.org/changeset/base/357740
> >
> > Log:
> >   Refresh architecture list with latest:
> >
> >   Remove: sparc, sparc64 (twice), ia64, alpha
> >   Add: riscv64
> >
> >   Remove now-useless sparc64 ifdef
> >
> >   Reivewed by: cy@, bcr@
> >   Differential Revision: https://reviews.freebsd.org/D23593
> >
> > Modified:
> >   head/usr.sbin/ntp/config.h
> >
> > Modified: head/usr.sbin/ntp/config.h
> >
> ==
> > --- head/usr.sbin/ntp/config.hMon Feb 10 17:16:59 2020
> (r357739)
> > +++ head/usr.sbin/ntp/config.hMon Feb 10 17:17:03 2020
> (r357740)
> > @@ -1578,11 +1578,7 @@
> >  /* #undef STRERROR_R_CHAR_P */
> >
> >  /* canonical system (cpu-vendor-os) of where we should run */
> > -#if defined(__alpha__)
> > -#define STR_SYSTEM "alpha-undermydesk-freebsd"
> > -#elif defined(__sparc64__)
> > -#define STR_SYSTEM "sparc64-undermydesk-freebsd"
> > -#elif defined(__amd64__)
> > +#if defined(__amd64__)
> >  #define STR_SYSTEM "amd64-undermydesk-freebsd"
> >  #elif defined(__powerpc64__)
> >  #define STR_SYSTEM "powerpc64-undermydesk-freebsd"
> > @@ -1596,12 +1592,8 @@
> >  #define STR_SYSTEM "arm64-undermydesk-freebsd"
> >  #elif defined(__arm__)
> >  #define STR_SYSTEM "arm-undermydesk-freebsd"
> > -#elif defined(__sparc64__)
> > -#define STR_SYSTEM "sparc64-undermydesk-freebsd"
> > -#elif defined(__sparc__)
> > -#define STR_SYSTEM "sparc-undermydesk-freebsd"
> > -#elif defined(__ia64__)
> > -#define STR_SYSTEM "ia64-undermydesk-freebsd"
> > +#elif defined(__riscv__)
> > +#define STR_SYSTEM "riscv64-undermydesk-freebsd"
>
> This should be __riscv (see arch(7))
>

Doh! I could have sworn I double checked, but I'll fix. Thanks!

Warner
___
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"


Re: svn commit: r357703 - head/share/mk

2020-02-10 Thread Kyle Evans
On Mon, Feb 10, 2020 at 12:13 PM John Baldwin  wrote:
>
> On 2/9/20 10:53 AM, Kyle Evans wrote:
> > Author: kevans
> > Date: Sun Feb  9 18:53:53 2020
> > New Revision: 357703
> > URL: https://svnweb.freebsd.org/changeset/base/357703
> >
> > Log:
> >   mips: mark GOOGLETEST broken, due to no fault of its own
> >
> >   As explained in the comment; GOOGLETEST cannot currently be compiled on 
> > any
> >   mips variant at the moment due to the cross toolchain seemingly using the
> >   wrong spec and not pulling in libgcc. We'll be fine when llvm 10 lands, at
> >   which point this should be reverted most expeditiously.
>
> Hmm, I thought you were going to do this for any external GCC?  It's also
> broken on amd64, etc. as well when using external GCC.
>

My main concern at the moment is we haven't had any functional default
builds for mips since I had unbroken it over a month ago -- I was
hoping we'd be able to come up with a fix for the external GCC spec
issue in relatively short order so as not to worry about it, but I can
look at expanding this to all external GCC.
___
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"


Re: svn commit: r357740 - head/usr.sbin/ntp

2020-02-10 Thread John Baldwin
On 2/10/20 9:17 AM, Warner Losh wrote:
> Author: imp
> Date: Mon Feb 10 17:17:03 2020
> New Revision: 357740
> URL: https://svnweb.freebsd.org/changeset/base/357740
> 
> Log:
>   Refresh architecture list with latest:
>   
>   Remove: sparc, sparc64 (twice), ia64, alpha
>   Add: riscv64
>   
>   Remove now-useless sparc64 ifdef
>   
>   Reivewed by: cy@, bcr@
>   Differential Revision: https://reviews.freebsd.org/D23593
> 
> Modified:
>   head/usr.sbin/ntp/config.h
> 
> Modified: head/usr.sbin/ntp/config.h
> ==
> --- head/usr.sbin/ntp/config.hMon Feb 10 17:16:59 2020
> (r357739)
> +++ head/usr.sbin/ntp/config.hMon Feb 10 17:17:03 2020
> (r357740)
> @@ -1578,11 +1578,7 @@
>  /* #undef STRERROR_R_CHAR_P */
>  
>  /* canonical system (cpu-vendor-os) of where we should run */
> -#if defined(__alpha__)
> -#define STR_SYSTEM "alpha-undermydesk-freebsd"
> -#elif defined(__sparc64__)
> -#define STR_SYSTEM "sparc64-undermydesk-freebsd"
> -#elif defined(__amd64__)
> +#if defined(__amd64__)
>  #define STR_SYSTEM "amd64-undermydesk-freebsd"
>  #elif defined(__powerpc64__)
>  #define STR_SYSTEM "powerpc64-undermydesk-freebsd"
> @@ -1596,12 +1592,8 @@
>  #define STR_SYSTEM "arm64-undermydesk-freebsd"
>  #elif defined(__arm__)
>  #define STR_SYSTEM "arm-undermydesk-freebsd"
> -#elif defined(__sparc64__)
> -#define STR_SYSTEM "sparc64-undermydesk-freebsd"
> -#elif defined(__sparc__)
> -#define STR_SYSTEM "sparc-undermydesk-freebsd"
> -#elif defined(__ia64__)
> -#define STR_SYSTEM "ia64-undermydesk-freebsd"
> +#elif defined(__riscv__)
> +#define STR_SYSTEM "riscv64-undermydesk-freebsd"

This should be __riscv (see arch(7))

-- 
John Baldwin
___
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"


Re: svn commit: r357703 - head/share/mk

2020-02-10 Thread John Baldwin
On 2/9/20 10:53 AM, Kyle Evans wrote:
> Author: kevans
> Date: Sun Feb  9 18:53:53 2020
> New Revision: 357703
> URL: https://svnweb.freebsd.org/changeset/base/357703
> 
> Log:
>   mips: mark GOOGLETEST broken, due to no fault of its own
>   
>   As explained in the comment; GOOGLETEST cannot currently be compiled on any
>   mips variant at the moment due to the cross toolchain seemingly using the
>   wrong spec and not pulling in libgcc. We'll be fine when llvm 10 lands, at
>   which point this should be reverted most expeditiously.

Hmm, I thought you were going to do this for any external GCC?  It's also
broken on amd64, etc. as well when using external GCC.

-- 
John Baldwin
___
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"


Re: svn commit: r357695 - in head: sys/kern sys/sys usr.bin/procstat

2020-02-10 Thread John Baldwin
On 2/9/20 4:10 AM, Konstantin Belousov wrote:
> Author: kib
> Date: Sun Feb  9 12:10:37 2020
> New Revision: 357695
> URL: https://svnweb.freebsd.org/changeset/base/357695
> 
> Log:
>   Add AT_BSDFLAGS auxv entry.
>   
>   The intent is to provide bsd-specific flags relevant to interpreter
>   and C runtime.  I did not want to reuse AT_FLAGS which is common ELF
>   auxv entry.
>   
>   Use bsdflags to report kernel support for sigfastblock(2).  This
>   allows rtld and libthr to safely infer the syscall presence without
>   SIGSYS.  The tunable kern.elf{32,64}.sigfastblock blocks reporting.
>   
>   Tested by:  pho
>   Disscussed with:cem, emaste, jilles
>   Sponsored by:   The FreeBSD Foundation
>   Differential revision:  https://reviews.freebsd.org/D12773

I find adding a new auxv type curious.  The MIPS ABI doc says that
"bits under the 0xff00 mask are reserved for system semantics".
The powerpc and x86-64 docs don't define any bits at all.  In
practice I think we are free to use AT_FLAGS however we wish as no
use cases of "standard" bits have arisen since AT_FLAGS was first
defined.

-- 
John Baldwin
___
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: r357742 - head/sys/vm

2020-02-10 Thread Jonathan T. Looney
Author: jtl
Date: Mon Feb 10 18:06:38 2020
New Revision: 357742
URL: https://svnweb.freebsd.org/changeset/base/357742

Log:
  Modify the vm.panic_on_oom sysctl to take a count of events.
  
  Currently, the vm.panic_on_oom sysctl is a boolean which controls the
  behavior of the VM system when it encounters an out-of-memory situation.
  If set to 0, the VM system kills the largest process. If set to any other
  value, the VM system will initiate a panic.
  
  This change makes the sysctl a count of events. If set to 0, the VM system
  kills the largest process. If set to any other value, the VM system will
  kill the largest process until it has seen the specified number of
  out-of-memory events. Once it reaches the specified number of events, it
  will initiate a panic.
  
  This change is helpful in capturing cores when the system is in a perpetual
  cycle of out-of-memory events (as opposed to just hitting one or two
  sporadic out-of-memory events).
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D23601

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cMon Feb 10 17:17:08 2020(r357741)
+++ head/sys/vm/vm_pageout.cMon Feb 10 18:06:38 2020(r357742)
@@ -158,7 +158,7 @@ static int vm_panic_on_oom = 0;
 
 SYSCTL_INT(_vm, OID_AUTO, panic_on_oom,
CTLFLAG_RWTUN, _panic_on_oom, 0,
-   "panic on out of memory instead of killing the largest process");
+   "Panic on the given number of out-of-memory errors instead of killing 
the largest process");
 
 SYSCTL_INT(_vm, OID_AUTO, pageout_update_period,
CTLFLAG_RWTUN, _pageout_update_period, 0,
@@ -1933,7 +1933,7 @@ vm_pageout_oom(int shortage)
}
sx_sunlock(_lock);
if (bigproc != NULL) {
-   if (vm_panic_on_oom != 0)
+   if (vm_panic_on_oom != 0 && --vm_panic_on_oom == 0)
panic("out of swap space");
PROC_LOCK(bigproc);
killproc(bigproc, "out of swap space");
___
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"


Re: svn commit: r357683 - head/lib/libc/string

2020-02-10 Thread Ian Lepore
On Mon, 2020-02-10 at 10:46 -0300, Renato Botelho wrote:
> On 08/02/20 18:17, Eitan Adler wrote:
> > Author: eadler
> > Date: Sat Feb  8 21:17:48 2020
> > New Revision: 357683
> > URL: https://svnweb.freebsd.org/changeset/base/357683
> > 
> > Log:
> >memset.3: better fix previous typo
> >
> >Upon re-reading the whole sentence this is a better fix.
> >
> >MFC with: r357681
> > 
> > Modified:
> >head/lib/libc/string/memset.3
> > 
> > Modified: head/lib/libc/string/memset.3
> > ==
> > --- head/lib/libc/string/memset.3   Sat Feb  8 21:02:20 2020
> > (r357682)
> > +++ head/lib/libc/string/memset.3   Sat Feb  8 21:17:48 2020
> > (r357683)
> > @@ -63,8 +63,9 @@ Undefined behaviour from
> >   .Fn memset ,
> >   resulting from storage overflow, will occur if
> >   .Fa len
> > -is greater than the length of buffer
> > -.Fa dest .
> > +is greater than the length of the
> > +.Fa dest
> > +buffer.
> >   The behaviour is also undefined if
> >   .Fa dest
> >   is an invalid pointer.
> 
> .Dd should be bumped to current date
> 

It has always been my understanding for that we don't bump .Dd for
things like minor grammar and spelling fixes, only for actual content
changes.  A few seconds of quick googling finds mailing list messages
to that effect going back many many years.

-- Ian


___
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"


Re: svn commit: r357740 - head/usr.sbin/ntp

2020-02-10 Thread Mitchell Horne
On Mon, Feb 10, 2020 at 12:17 PM Warner Losh  wrote:
>
> Author: imp
> Date: Mon Feb 10 17:17:03 2020
> New Revision: 357740
> URL: https://svnweb.freebsd.org/changeset/base/357740
>
> Log:
>   Refresh architecture list with latest:
>
>   Remove: sparc, sparc64 (twice), ia64, alpha
>   Add: riscv64
>
>   Remove now-useless sparc64 ifdef
>
>   Reivewed by: cy@, bcr@
>   Differential Revision: https://reviews.freebsd.org/D23593
>
> Modified:
>   head/usr.sbin/ntp/config.h
>
> Modified: head/usr.sbin/ntp/config.h
> ==
> --- head/usr.sbin/ntp/config.h  Mon Feb 10 17:16:59 2020(r357739)
> +++ head/usr.sbin/ntp/config.h  Mon Feb 10 17:17:03 2020(r357740)
> @@ -1578,11 +1578,7 @@
>  /* #undef STRERROR_R_CHAR_P */
>
>  /* canonical system (cpu-vendor-os) of where we should run */
> -#if defined(__alpha__)
> -#define STR_SYSTEM "alpha-undermydesk-freebsd"
> -#elif defined(__sparc64__)
> -#define STR_SYSTEM "sparc64-undermydesk-freebsd"
> -#elif defined(__amd64__)
> +#if defined(__amd64__)
>  #define STR_SYSTEM "amd64-undermydesk-freebsd"
>  #elif defined(__powerpc64__)
>  #define STR_SYSTEM "powerpc64-undermydesk-freebsd"
> @@ -1596,12 +1592,8 @@
>  #define STR_SYSTEM "arm64-undermydesk-freebsd"
>  #elif defined(__arm__)
>  #define STR_SYSTEM "arm-undermydesk-freebsd"
> -#elif defined(__sparc64__)
> -#define STR_SYSTEM "sparc64-undermydesk-freebsd"
> -#elif defined(__sparc__)
> -#define STR_SYSTEM "sparc-undermydesk-freebsd"
> -#elif defined(__ia64__)
> -#define STR_SYSTEM "ia64-undermydesk-freebsd"
> +#elif defined(__riscv__)

Hi Warner,

Surprisingly, the canonical define for RISC-V is __riscv, not __riscv__.

Mitchell

> +#define STR_SYSTEM "riscv64-undermydesk-freebsd"
>  #else
>  #define STR_SYSTEM "i386-undermydesk-freebsd"
>  #endif
> @@ -1669,7 +1661,7 @@ typedef unsigned int  uintptr_t;
>  /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
> significant byte first (like Motorola and SPARC, unlike Intel). */
>  #if defined(__ARMEB__) || defined(__MIPSEB__) || defined(__powerpc__) || \
> -defined(__powerpc64__) || defined(__sparc64__)
> +defined(__powerpc64__)
>  #define WORDS_BIGENDIAN 1
>  #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: r357738 - head/usr.sbin/config

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:16:54 2020
New Revision: 357738
URL: https://svnweb.freebsd.org/changeset/base/357738

Log:
  For valid arch values (really $MACHINE), remove references to alpha
  and sparc64. Add references to arm64 and riscv
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Modified:
  head/usr.sbin/config/config.5

Modified: head/usr.sbin/config/config.5
==
--- head/usr.sbin/config/config.5   Mon Feb 10 17:16:50 2020
(r357737)
+++ head/usr.sbin/config/config.5   Mon Feb 10 17:16:54 2020
(r357738)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 11, 2018
+.Dd February 9, 2020
 .Dt CONFIG 5
 .Os
 .Sh NAME
@@ -251,10 +251,10 @@ Legal values for
 include:
 .Pp
 .Bl -tag -width ".Cm powerpc" -compact
-.It Cm alpha
-The DEC Alpha architecture.
+.It Cm arm64
+The 64-bit ARM application architecture.
 .It Cm arm
-The ARM architecture.
+The ARM architecture
 .It Cm amd64
 The AMD x86-64 architecture.
 .It Cm i386
@@ -263,8 +263,8 @@ The Intel x86 based PC architecture.
 The MIPS architecture.
 .It Cm powerpc
 The IBM PowerPC architecture.
-.It Cm sparc64
-The Sun Sparc64 architecture.
+.It Cm riscv
+The RISC-V architecture.
 .El
 .Pp
 If argument
___
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: r357741 - head/usr.sbin/ntp/libntpevent

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:17:08 2020
New Revision: 357741
URL: https://svnweb.freebsd.org/changeset/base/357741

Log:
  Remove ifdefs for ia64 and sparc64.
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Modified:
  head/usr.sbin/ntp/libntpevent/Makefile

Modified: head/usr.sbin/ntp/libntpevent/Makefile
==
--- head/usr.sbin/ntp/libntpevent/Makefile  Mon Feb 10 17:17:03 2020
(r357740)
+++ head/usr.sbin/ntp/libntpevent/Makefile  Mon Feb 10 17:17:08 2020
(r357741)
@@ -21,12 +21,8 @@ SRCS+=   bufferevent_openssl.c
 NTP_ATOMIC=x86_32
 .elif ${MACHINE_ARCH} == "amd64"
 NTP_ATOMIC=x86_64
-.elif ${MACHINE_ARCH} == "ia64"
-NTP_ATOMIC=ia64
 .elif ${MACHINE_ARCH} == "powerpc64"
 NTP_ATOMIC=powerpc
-.elif ${MACHINE_ARCH} == "sparc64"
-NTP_ATOMIC=sparc64
 .else
 NTP_ATOMIC=noatomic
 .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: r357740 - head/usr.sbin/ntp

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:17:03 2020
New Revision: 357740
URL: https://svnweb.freebsd.org/changeset/base/357740

Log:
  Refresh architecture list with latest:
  
  Remove: sparc, sparc64 (twice), ia64, alpha
  Add: riscv64
  
  Remove now-useless sparc64 ifdef
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Modified:
  head/usr.sbin/ntp/config.h

Modified: head/usr.sbin/ntp/config.h
==
--- head/usr.sbin/ntp/config.h  Mon Feb 10 17:16:59 2020(r357739)
+++ head/usr.sbin/ntp/config.h  Mon Feb 10 17:17:03 2020(r357740)
@@ -1578,11 +1578,7 @@
 /* #undef STRERROR_R_CHAR_P */
 
 /* canonical system (cpu-vendor-os) of where we should run */
-#if defined(__alpha__)
-#define STR_SYSTEM "alpha-undermydesk-freebsd"
-#elif defined(__sparc64__)
-#define STR_SYSTEM "sparc64-undermydesk-freebsd"
-#elif defined(__amd64__)
+#if defined(__amd64__)
 #define STR_SYSTEM "amd64-undermydesk-freebsd"
 #elif defined(__powerpc64__)
 #define STR_SYSTEM "powerpc64-undermydesk-freebsd"
@@ -1596,12 +1592,8 @@
 #define STR_SYSTEM "arm64-undermydesk-freebsd"
 #elif defined(__arm__)
 #define STR_SYSTEM "arm-undermydesk-freebsd"
-#elif defined(__sparc64__)
-#define STR_SYSTEM "sparc64-undermydesk-freebsd"
-#elif defined(__sparc__)
-#define STR_SYSTEM "sparc-undermydesk-freebsd"
-#elif defined(__ia64__)
-#define STR_SYSTEM "ia64-undermydesk-freebsd"
+#elif defined(__riscv__)
+#define STR_SYSTEM "riscv64-undermydesk-freebsd"
 #else
 #define STR_SYSTEM "i386-undermydesk-freebsd"
 #endif
@@ -1669,7 +1661,7 @@ typedef unsigned int  uintptr_t;
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined(__ARMEB__) || defined(__MIPSEB__) || defined(__powerpc__) || \
-defined(__powerpc64__) || defined(__sparc64__)
+defined(__powerpc64__)
 #define WORDS_BIGENDIAN 1
 #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: r357739 - in head/usr.sbin: . eeprom

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:16:59 2020
New Revision: 357739
URL: https://svnweb.freebsd.org/changeset/base/357739

Log:
  Remove sparc64 specific eeprom command
  
  This command was only ever for sparc64, so remove it. Remove
  usr.sbin/Makeiile.sparc64 as well since it only references ofwdump
  (cross platform) and eeprom.
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Deleted:
  head/usr.sbin/Makefile.sparc64
  head/usr.sbin/eeprom/Makefile
  head/usr.sbin/eeprom/Makefile.depend
  head/usr.sbin/eeprom/eeprom.8
  head/usr.sbin/eeprom/eeprom.c
  head/usr.sbin/eeprom/ofw_options.c
  head/usr.sbin/eeprom/ofw_options.h
___
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: r357735 - head/usr.sbin/tzsetup

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:16:41 2020
New Revision: 357735
URL: https://svnweb.freebsd.org/changeset/base/357735

Log:
  Remove sparc64 ifdef
  
  Now we default to setting the hardware clock to UTC
  everywhere. sparc64 was the old odd-man out before.
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Modified:
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.c
==
--- head/usr.sbin/tzsetup/tzsetup.c Mon Feb 10 17:16:26 2020
(r357734)
+++ head/usr.sbin/tzsetup/tzsetup.c Mon Feb 10 17:16:41 2020
(r357735)
@@ -1020,9 +1020,7 @@ main(int argc, char **argv)
"If it is set to local time,\n"
"or you don't know, please choose NO here!");
dlg_save_vars(_vars);
-#if !defined(__sparc64__)
dialog_vars.defaultno = TRUE;
-#endif
yesno = dialog_yesno(title, prompt, 7, 73);
dlg_restore_vars(_vars);
if (!yesno) {
___
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: r357737 - head/usr.sbin/bsnmpd/modules/snmp_hostres

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:16:50 2020
New Revision: 357737
URL: https://svnweb.freebsd.org/changeset/base/357737

Log:
  Fix a comment for the SUN geom class.
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c   Mon Feb 
10 17:16:45 2020(r357736)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c   Mon Feb 
10 17:16:50 2020(r357737)
@@ -484,7 +484,7 @@ partition_tbl_handle_disk(int32_t ds_index, const char
 
/*
 * Get the "SUN" GEOM class.
-* Here we'll find all the info needed about the BSD slices.
+* Here we'll find all the info needed about the SUN slices.
 */
if ((classp = find_class(, "SUN")) != NULL) {
get_bsd_sun(classp, ds_index, disk_dev_name);
___
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: r357736 - head/usr.sbin/bsnmpd/modules/snmp_bridge

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:16:45 2020
New Revision: 357736
URL: https://svnweb.freebsd.org/changeset/base/357736

Log:
  Fix comment. It mentioned sparc64 specifically, but alignment issues
  are present elsewhere.
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c   Mon Feb 10 
17:16:41 2020(r357735)
+++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c   Mon Feb 10 
17:16:45 2020(r357736)
@@ -586,8 +586,7 @@ bridge_get_basemac(const char *bif_name, u_char *mac, 
continue;
 
/*
-* Not just casting because of alignment constraints
-* on sparc64.
+* Not just casting because of alignment constraints.
 */
bcopy(ifa->ifa_addr, , sizeof(struct sockaddr_dl));
 
___
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: r357734 - head/usr.sbin/binmiscctl

2020-02-10 Thread Warner Losh
Author: imp
Date: Mon Feb 10 17:16:26 2020
New Revision: 357734
URL: https://svnweb.freebsd.org/changeset/base/357734

Log:
  Remove sparc64 example.
  
  Reivewed by: cy@, bcr@
  Differential Revision: https://reviews.freebsd.org/D23593

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

Modified: head/usr.sbin/binmiscctl/binmiscctl.8
==
--- head/usr.sbin/binmiscctl/binmiscctl.8   Mon Feb 10 17:02:37 2020
(r357733)
+++ head/usr.sbin/binmiscctl/binmiscctl.8   Mon Feb 10 17:16:26 2020
(r357734)
@@ -27,7 +27,7 @@
 .\"
 .\" Support for miscellaneous binary image activators
 .\"
-.Dd July 21, 2018
+.Dd February 10, 2020
 .Dt BINMISCCTL 8
 .Os
 .Sh NAME
@@ -267,17 +267,6 @@ Add QEMU bsd-user program as an image activator for Po
   --interpreter "/usr/local/bin/qemu-ppc64-static" \e
   --magic "\ex7f\ex45\ex4c\ex46\ex02\ex02\ex01\ex00\ex00\ex00\e
\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 SPARC64 binaries:
-.Bd -literal -offset indent
-# binmiscctl add sparc64 \e
-  --interpreter "/usr/local/bin/qemu-sparc64-static" \e
-  --magic "\ex7f\ex45\ex4c\ex46\ex02\ex02\ex01\ex00\ex00\ex00\e
-   \ex00\ex00\ex00\ex00\ex00\ex00\ex00\ex02\ex00\ex2b" \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
___
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: r357733 - stable/11/release/doc/share/xml

2020-02-10 Thread Glen Barber
Author: gjb
Date: Mon Feb 10 17:02:37 2020
New Revision: 357733
URL: https://svnweb.freebsd.org/changeset/base/357733

Log:
  Fix a typo.
  
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  stable/11/release/doc/share/xml/security.xml

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlMon Feb 10 16:15:34 
2020(r357732)
+++ stable/11/release/doc/share/xml/security.xmlMon Feb 10 17:02:37 
2020(r357733)
@@ -137,7 +137,7 @@
FreeBSD-SA-20:03.thrmisc
28January2020
-   Kennel stack data disclosure
+   Kernel stack data disclosure
   
 
   
___
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"


Re: svn commit: r357728 - head/sys/sys

2020-02-10 Thread Pedro Giffuni

Hi;

On 10/02/2020 08:52, Mateusz Guzik wrote:

Author: mjg
Date: Mon Feb 10 13:52:25 2020
New Revision: 357728
URL: https://svnweb.freebsd.org/changeset/base/357728

Log:
   Tidy up zpcpu_replace*
   
   - only compute the target address once

   - remove spurious type casting, zpcpu_get already return the correct type
   
   While here add missing newlines to other routines.


Modified:
   head/sys/sys/pcpu.h


For the record, this file (and many others), uses a space after #define, 
when we should be using a tab to conform with style(9). One of the many 
lessons from bde.


I have a huge patch to fix those, which I won't commit because it wouldl 
obliterate all VCS annotations.


Pedro.



Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Mon Feb 10 13:24:14 2020(r357727)
+++ head/sys/sys/pcpu.h Mon Feb 10 13:52:25 2020(r357728)
@@ -245,32 +245,41 @@ extern struct pcpu *cpuid_to_pcpu[];
   * If you need atomicity use xchg.
   * */
  #define zpcpu_replace(base, val) ({   \
-   __typeof(val) _old = *(__typeof(base))zpcpu_get(base);  \
-   *(__typeof(val) *)zpcpu_get(base) = val;\
+   __typeof(val) *_ptr = zpcpu_get(base);  \
+   __typeof(val) _old; \
+   \
+   _old = *_ptr;   \
+   *_ptr = val;\
_old;   \
  })
  
  #define zpcpu_replace_cpu(base, val, cpu) ({\

-   __typeof(val) _old = *(__typeof(base))zpcpu_get_cpu(base, cpu); \
-   *(__typeof(val) *)zpcpu_get_cpu(base, cpu) = val;   \
+   __typeof(val) *_ptr = zpcpu_get_cpu(base, cpu); \
+   __typeof(val) _old; \
+   \
+   _old = *_ptr;   \
+   *_ptr = val;\
_old;   \
  })
  
  #define zpcpu_set_protected(base, val) ({\

MPASS(curthread->td_critnest > 0);\
__typeof(val) *_ptr = zpcpu_get(base);  \
+   \
*_ptr = (val);  \
  })
  
  #define zpcpu_add_protected(base, val) ({\

MPASS(curthread->td_critnest > 0);\
__typeof(val) *_ptr = zpcpu_get(base);  \
+   \
*_ptr += (val); \
  })
  
  #define zpcpu_sub_protected(base, val) ({\

MPASS(curthread->td_critnest > 0);\
__typeof(val) *_ptr = zpcpu_get(base);  \
+   \
*_ptr -= (val); \
  })
  

___
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: r357730 - in head/sys: cam/ata cam/nvme cam/scsi ufs/ffs ufs/ufs

2020-02-10 Thread Scott Long
Author: scottl
Date: Mon Feb 10 14:27:28 2020
New Revision: 357730
URL: https://svnweb.freebsd.org/changeset/base/357730

Log:
  Revert r357710 and 357711 until they can be debugged

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/nvme/nvme_da.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/ufsmount.h

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Mon Feb 10 13:54:34 2020(r357729)
+++ head/sys/cam/ata/ata_da.c   Mon Feb 10 14:27:28 2020(r357730)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #endif /* _KERNEL */
 
@@ -1566,10 +1565,6 @@ adagetattr(struct bio *bp)
 {
int ret;
struct cam_periph *periph;
-
-   /* TODO: tunable knob */
-   if (g_handleattr_int(bp, "GEOM::canspeedup", 1))
-   return (0);
 
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
cam_periph_lock(periph);

Modified: head/sys/cam/nvme/nvme_da.c
==
--- head/sys/cam/nvme/nvme_da.c Mon Feb 10 13:54:34 2020(r357729)
+++ head/sys/cam/nvme/nvme_da.c Mon Feb 10 14:27:28 2020(r357730)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #endif /* _KERNEL */
 
@@ -700,10 +699,6 @@ ndagetattr(struct bio *bp)
 {
int ret;
struct cam_periph *periph;
-
-   /* TODO: tunable knob */
-   if (g_handleattr_int(bp, "GEOM::canspeedup", 1))
-   return (0);
 
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
cam_periph_lock(periph);

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Mon Feb 10 13:54:34 2020(r357729)
+++ head/sys/cam/scsi/scsi_da.c Mon Feb 10 14:27:28 2020(r357730)
@@ -1942,10 +1942,6 @@ dagetattr(struct bio *bp)
int ret;
struct cam_periph *periph;
 
-   /* TODO: tunable knob for this */
-   if (g_handleattr_int(bp, "GEOM::canspeedup", 1))
-   return (0);
-
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
cam_periph_lock(periph);
ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Mon Feb 10 13:54:34 2020
(r357729)
+++ head/sys/ufs/ffs/ffs_softdep.c  Mon Feb 10 14:27:28 2020
(r357730)
@@ -1464,9 +1464,6 @@ softdep_send_speedup(struct ufsmount *ump, size_t shor
 {
struct buf *bp;
 
-   if ((ump->um_flags & UM_CANSPEEDUP) == 0)
-   return;
-
bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO);
bp->b_iocmd = BIO_SPEEDUP;
bp->b_ioflags = flags;

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Mon Feb 10 13:54:34 2020
(r357729)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Mon Feb 10 14:27:28 2020
(r357730)
@@ -794,7 +794,7 @@ ffs_mountfs(devvp, mp, td)
struct ucred *cred;
struct g_consumer *cp;
struct mount *nmp;
-   int candelete, canspeedup;
+   int candelete;
off_t loc;
 
fs = NULL;
@@ -1009,13 +1009,6 @@ ffs_mountfs(devvp, mp, td)
ump->um_trimhash = hashinit(MAXTRIMIO, M_TRIM,
>um_trimlisthashsize);
}
-   }
-
-   /* TODO: sysctl tunables, runtime modification */
-   len = sizeof(int);
-   if (g_io_getattr("GEOM::canspeedup", cp, , ) == 0) {
-   if (canspeedup)
-   ump->um_flags |= UM_CANSPEEDUP;
}
 
ump->um_mountp = mp;

Modified: head/sys/ufs/ufs/ufsmount.h
==
--- head/sys/ufs/ufs/ufsmount.h Mon Feb 10 13:54:34 2020(r357729)
+++ head/sys/ufs/ufs/ufsmount.h Mon Feb 10 14:27:28 2020(r357730)
@@ -131,7 +131,6 @@ struct ufsmount {
  */
 #define UM_CANDELETE   0x0001  /* devvp supports TRIM */
 #define UM_WRITESUSPENDED  0x0002  /* suspension in progress */
-#define UM_CANSPEEDUP  0x0004  /* devvp supports SPEEDUP */
 
 /*
  * function prototypes
___
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: r357729 - head/sys/kern

2020-02-10 Thread Mateusz Guzik
Author: mjg
Date: Mon Feb 10 13:54:34 2020
New Revision: 357729
URL: https://svnweb.freebsd.org/changeset/base/357729

Log:
  vfs: fix lock recursion in vrele
  
  vrele is supposed to be called with an unlocked vnode, but this was never
  asserted for if v_usecount was > 0. For such counts the lock is never touched
  by the routine. As a result the kernel has several consumers which expect
  vunref semantics and get away with calling vrele since they happen to never do
  it when this is the last reference (and for some of them this may happen to be
  a guarantee).
  
  Work around the problem by changing vrele semantics to tolerate being called
  with a lock. This eliminates a possible bug where the lock is already held and
  vputx takes it anyway.
  
  Reviewed by:  kib
  Tested by:pho
  Differential Revision:https://reviews.freebsd.org/D23528

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cMon Feb 10 13:52:25 2020(r357728)
+++ head/sys/kern/vfs_subr.cMon Feb 10 13:54:34 2020(r357729)
@@ -3170,6 +3170,7 @@ static void
 vputx(struct vnode *vp, enum vputx_op func)
 {
int error;
+   bool want_unlock;
 
KASSERT(vp != NULL, ("vputx: null vp"));
if (func == VPUTX_VUNREF)
@@ -3221,13 +3222,31 @@ vputx(struct vnode *vp, enum vputx_op func)
 * as VI_DOINGINACT to avoid recursion.
 */
vp->v_iflag |= VI_OWEINACT;
+   want_unlock = false;
+   error = 0;
switch (func) {
case VPUTX_VRELE:
-   error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK);
-   VI_LOCK(vp);
+   switch (VOP_ISLOCKED(vp)) {
+   case LK_EXCLUSIVE:
+   break;
+   case LK_EXCLOTHER:
+   case 0:
+   want_unlock = true;
+   error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK);
+   VI_LOCK(vp);
+   break;
+   default:
+   /*
+* The lock has at least one sharer, but we have no way
+* to conclude whether this is us. Play it safe and
+* defer processing.
+*/
+   error = EAGAIN;
+   break;
+   }
break;
case VPUTX_VPUT:
-   error = 0;
+   want_unlock = true;
if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
error = VOP_LOCK(vp, LK_UPGRADE | LK_INTERLOCK |
LK_NOWAIT);
@@ -3235,7 +3254,6 @@ vputx(struct vnode *vp, enum vputx_op func)
}
break;
case VPUTX_VUNREF:
-   error = 0;
if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
error = VOP_LOCK(vp, LK_TRYUPGRADE | LK_INTERLOCK);
VI_LOCK(vp);
@@ -3244,7 +3262,7 @@ vputx(struct vnode *vp, enum vputx_op func)
}
if (error == 0) {
vinactive(vp);
-   if (func != VPUTX_VUNREF)
+   if (want_unlock)
VOP_UNLOCK(vp);
vdropl(vp);
} else {
___
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: r357728 - head/sys/sys

2020-02-10 Thread Mateusz Guzik
Author: mjg
Date: Mon Feb 10 13:52:25 2020
New Revision: 357728
URL: https://svnweb.freebsd.org/changeset/base/357728

Log:
  Tidy up zpcpu_replace*
  
  - only compute the target address once
  - remove spurious type casting, zpcpu_get already return the correct type
  
  While here add missing newlines to other routines.

Modified:
  head/sys/sys/pcpu.h

Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Mon Feb 10 13:24:14 2020(r357727)
+++ head/sys/sys/pcpu.h Mon Feb 10 13:52:25 2020(r357728)
@@ -245,32 +245,41 @@ extern struct pcpu *cpuid_to_pcpu[];
  * If you need atomicity use xchg.
  * */
 #define zpcpu_replace(base, val) ({\
-   __typeof(val) _old = *(__typeof(base))zpcpu_get(base);  \
-   *(__typeof(val) *)zpcpu_get(base) = val;\
+   __typeof(val) *_ptr = zpcpu_get(base);  \
+   __typeof(val) _old; \
+   \
+   _old = *_ptr;   \
+   *_ptr = val;\
_old;   \
 })
 
 #define zpcpu_replace_cpu(base, val, cpu) ({   \
-   __typeof(val) _old = *(__typeof(base))zpcpu_get_cpu(base, cpu); \
-   *(__typeof(val) *)zpcpu_get_cpu(base, cpu) = val;   \
+   __typeof(val) *_ptr = zpcpu_get_cpu(base, cpu); \
+   __typeof(val) _old; \
+   \
+   _old = *_ptr;   \
+   *_ptr = val;\
_old;   \
 })
 
 #define zpcpu_set_protected(base, val) ({  \
MPASS(curthread->td_critnest > 0);  \
__typeof(val) *_ptr = zpcpu_get(base);  \
+   \
*_ptr = (val);  \
 })
 
 #define zpcpu_add_protected(base, val) ({  \
MPASS(curthread->td_critnest > 0);  \
__typeof(val) *_ptr = zpcpu_get(base);  \
+   \
*_ptr += (val); \
 })
 
 #define zpcpu_sub_protected(base, val) ({  \
MPASS(curthread->td_critnest > 0);  \
__typeof(val) *_ptr = zpcpu_get(base);  \
+   \
*_ptr -= (val); \
 })
 
___
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"


Creative personalized video ad for your marketing campaigns

2020-02-10 Thread Paul Joseph


Hi %F_Name%,

I'm reaching out to you today as a cartoon ad producer. My specialty is 
eye-catching videos to connect an audience to a product. I have extensive 
experience in this field with about 350 commercials to my name.

Would you like to see what this looks like? Here's a completed sample of my 
work: https://www.youtube.com/watch?v=BxsAALpGnu4

There's so much more I can do to promote your product, too. I also create 
websites, fun mobile apps, logos and appealing flyers.

To find out more about my firm, search for "Social Lobster".

Hope to hear from you,

Paul Joseph

___
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"


Re: svn commit: r357683 - head/lib/libc/string

2020-02-10 Thread Renato Botelho

On 08/02/20 18:17, Eitan Adler wrote:

Author: eadler
Date: Sat Feb  8 21:17:48 2020
New Revision: 357683
URL: https://svnweb.freebsd.org/changeset/base/357683

Log:
   memset.3: better fix previous typo
   
   Upon re-reading the whole sentence this is a better fix.
   
   MFC with: r357681


Modified:
   head/lib/libc/string/memset.3

Modified: head/lib/libc/string/memset.3
==
--- head/lib/libc/string/memset.3   Sat Feb  8 21:02:20 2020
(r357682)
+++ head/lib/libc/string/memset.3   Sat Feb  8 21:17:48 2020
(r357683)
@@ -63,8 +63,9 @@ Undefined behaviour from
  .Fn memset ,
  resulting from storage overflow, will occur if
  .Fa len
-is greater than the length of buffer
-.Fa dest .
+is greater than the length of the
+.Fa dest
+buffer.
  The behaviour is also undefined if
  .Fa dest
  is an invalid pointer.


.Dd should be bumped to current date

--
Renato Botelho
___
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: r357727 - head/sys/compat/linux

2020-02-10 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Feb 10 13:24:14 2020
New Revision: 357727
URL: https://svnweb.freebsd.org/changeset/base/357727

Log:
  Make linux(4) use kern_socketpair(9) instead of going through
  sys_socketpair().  It's a cleanup; no functional changes.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D22814

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cMon Feb 10 11:09:56 2020
(r357726)
+++ head/sys/compat/linux/linux_socket.cMon Feb 10 13:24:14 2020
(r357727)
@@ -753,25 +753,19 @@ linux_getpeername(struct thread *td, struct linux_getp
 int
 linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
 {
-   struct socketpair_args /* {
-   int domain;
-   int type;
-   int protocol;
-   int *rsv;
-   } */ bsd_args;
-   int error;
+   int domain, error, sv[2], type;
 
-   bsd_args.domain = linux_to_bsd_domain(args->domain);
-   if (bsd_args.domain != PF_LOCAL)
+   domain = linux_to_bsd_domain(args->domain);
+   if (domain != PF_LOCAL)
return (EAFNOSUPPORT);
-   bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK;
-   if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX)
+   type = args->type & LINUX_SOCK_TYPE_MASK;
+   if (type < 0 || type > LINUX_SOCK_MAX)
return (EINVAL);
error = linux_set_socket_flags(args->type & ~LINUX_SOCK_TYPE_MASK,
-   _args.type);
+   );
if (error != 0)
return (error);
-   if (args->protocol != 0 && args->protocol != PF_UNIX)
+   if (args->protocol != 0 && args->protocol != PF_UNIX) {
 
/*
 * Use of PF_UNIX as protocol argument is not right,
@@ -780,10 +774,16 @@ linux_socketpair(struct thread *td, struct linux_socke
 * to FreeBSD one.
 */
return (EPROTONOSUPPORT);
-   else
-   bsd_args.protocol = 0;
-   bsd_args.rsv = (int *)PTRIN(args->rsv);
-   return (sys_socketpair(td, _args));
+   }
+   error = kern_socketpair(td, domain, type, 0, sv);
+   if (error != 0)
+return (error);
+error = copyout(sv, PTRIN(args->rsv), 2 * sizeof(int));
+if (error != 0) {
+(void)kern_close(td, sv[0]);
+(void)kern_close(td, sv[1]);
+}
+   return (error);
 }
 
 #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
___
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: r357726 - head/sys/dev/usb/controller

2020-02-10 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 10 11:09:56 2020
New Revision: 357726
URL: https://svnweb.freebsd.org/changeset/base/357726

Log:
  Add USB host controller PCI ID's for Hygon.
  
  Differential Revision:https://reviews.freebsd.org/D23564
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/controller/ehci_pci.c
  head/sys/dev/usb/controller/ohci_pci.c
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/ehci_pci.c
==
--- head/sys/dev/usb/controller/ehci_pci.c  Mon Feb 10 09:11:10 2020
(r357725)
+++ head/sys/dev/usb/controller/ehci_pci.c  Mon Feb 10 11:09:56 2020
(r357726)
@@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_EHCI_VENDORID_APPLE 0x106b
 #definePCI_EHCI_VENDORID_ATI   0x1002
 #definePCI_EHCI_VENDORID_CMDTECH   0x1095
+#definePCI_EHCI_VENDORID_HYGON 0x1d94
 #definePCI_EHCI_VENDORID_INTEL 0x8086
 #definePCI_EHCI_VENDORID_NEC   0x1033
 #definePCI_EHCI_VENDORID_OPTI  0x1045
@@ -374,6 +375,9 @@ ehci_pci_attach(device_t self)
break;
case PCI_EHCI_VENDORID_CMDTECH:
sprintf(sc->sc_vendor, "CMDTECH");
+   break;
+   case PCI_EHCI_VENDORID_HYGON:
+   sprintf(sc->sc_vendor, "Hygon");
break;
case PCI_EHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");

Modified: head/sys/dev/usb/controller/ohci_pci.c
==
--- head/sys/dev/usb/controller/ohci_pci.c  Mon Feb 10 09:11:10 2020
(r357725)
+++ head/sys/dev/usb/controller/ohci_pci.c  Mon Feb 10 11:09:56 2020
(r357726)
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_OHCI_VENDORID_APPLE 0x106b
 #definePCI_OHCI_VENDORID_ATI   0x1002
 #definePCI_OHCI_VENDORID_CMDTECH   0x1095
+#definePCI_OHCI_VENDORID_HYGON 0x1d94
 #definePCI_OHCI_VENDORID_NEC   0x1033
 #definePCI_OHCI_VENDORID_NVIDIA0x12D2
 #definePCI_OHCI_VENDORID_NVIDIA2   0x10DE
@@ -279,6 +280,9 @@ ohci_pci_attach(device_t self)
break;
case PCI_OHCI_VENDORID_CMDTECH:
sprintf(sc->sc_vendor, "CMDTECH");
+   break;
+   case PCI_OHCI_VENDORID_HYGON:
+   sprintf(sc->sc_vendor, "Hygon");
break;
case PCI_OHCI_VENDORID_NEC:
sprintf(sc->sc_vendor, "NEC");

Modified: head/sys/dev/usb/controller/xhci_pci.c
==
--- head/sys/dev/usb/controller/xhci_pci.c  Mon Feb 10 09:11:10 2020
(r357725)
+++ head/sys/dev/usb/controller/xhci_pci.c  Mon Feb 10 11:09:56 2020
(r357726)
@@ -107,6 +107,9 @@ xhci_pci_match(device_t self)
case 0x78141022:
return ("AMD FCH USB 3.0 controller");
 
+   case 0x145f1d94:
+   return ("Hygon USB 3.0 controller");
+
case 0x01941033:
return ("NEC uPD720200 USB 3.0 controller");
case 0x00151912:
___
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"