svn commit: r347646 - head/sys/ddb

2019-05-15 Thread Ryan Libby
Author: rlibby
Date: Thu May 16 05:29:54 2019
New Revision: 347646
URL: https://svnweb.freebsd.org/changeset/base/347646

Log:
  db show thread: avoid overflow in tick conversion
  
  The previous calculations for displaying the time since last switch
  easily overflowed, after less than 36 min for hz=1000.  Now overflow
  takes 2000 times longer (as long as ticks takes to wrap).
  
  Reviewed by:  cem, markj
  Sponsored by: Dell EMC Isilon
  Differential revision:https://reviews.freebsd.org/D20273

Modified:
  head/sys/ddb/db_ps.c

Modified: head/sys/ddb/db_ps.c
==
--- head/sys/ddb/db_ps.cThu May 16 04:24:08 2019(r347645)
+++ head/sys/ddb/db_ps.cThu May 16 05:29:54 2019(r347646)
@@ -338,8 +338,8 @@ DB_SHOW_COMMAND(thread, db_show_thread)
 {
struct thread *td;
struct lock_object *lock;
+   u_int delta;
bool comma;
-   int delta;
 
/* Determine which thread to examine. */
if (have_addr)
@@ -421,14 +421,14 @@ DB_SHOW_COMMAND(thread, db_show_thread)
db_printf(" priority: %d\n", td->td_priority);
db_printf(" container lock: %s (%p)\n", lock->lo_name, lock);
if (td->td_swvoltick != 0) {
-   delta = (u_int)ticks - (u_int)td->td_swvoltick;
-   db_printf(" last voluntary switch: %d ms ago\n",
-   1000 * delta / hz);
+   delta = ticks - td->td_swvoltick;
+   db_printf(" last voluntary switch: %u.%03u s ago\n",
+   delta / hz, (delta % hz) * 1000 / hz);
}
if (td->td_swinvoltick != 0) {
-   delta = (u_int)ticks - (u_int)td->td_swinvoltick;
-   db_printf(" last involuntary switch: %d ms ago\n",
-   1000 * delta / hz);
+   delta = ticks - td->td_swinvoltick;
+   db_printf(" last involuntary switch: %u.%03u s ago\n",
+   delta / hz, (delta % hz) * 1000 / hz);
}
 }
 
___
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: r347645 - head/sys/x86/iommu

2019-05-15 Thread Ryan Libby
Author: rlibby
Date: Thu May 16 04:24:08 2019
New Revision: 347645
URL: https://svnweb.freebsd.org/changeset/base/347645

Log:
  iommu static analysis cleanup
  
  A static analyzer complained about a couple instances of checking a
  variable against NULL after already having dereferenced it.
   - dmar_gas_alloc_region: remove the tautological NULL checks
   - dmar_release_resources / dmar_fini_fault_log: don't deref unit->regs
 unless initialized.
  
  And while here, fix an inverted initialization check in dmar_fini_qi.
  
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential revision:https://reviews.freebsd.org/D20263

Modified:
  head/sys/x86/iommu/intel_fault.c
  head/sys/x86/iommu/intel_gas.c
  head/sys/x86/iommu/intel_qi.c

Modified: head/sys/x86/iommu/intel_fault.c
==
--- head/sys/x86/iommu/intel_fault.cThu May 16 03:30:36 2019
(r347644)
+++ head/sys/x86/iommu/intel_fault.cThu May 16 04:24:08 2019
(r347645)
@@ -291,12 +291,12 @@ void
 dmar_fini_fault_log(struct dmar_unit *unit)
 {
 
+   if (unit->fault_taskqueue == NULL)
+   return;
+
DMAR_LOCK(unit);
dmar_disable_fault_intr(unit);
DMAR_UNLOCK(unit);
-
-   if (unit->fault_taskqueue == NULL)
-   return;
 
taskqueue_drain(unit->fault_taskqueue, >fault_task);
taskqueue_free(unit->fault_taskqueue);

Modified: head/sys/x86/iommu/intel_gas.c
==
--- head/sys/x86/iommu/intel_gas.c  Thu May 16 03:30:36 2019
(r347644)
+++ head/sys/x86/iommu/intel_gas.c  Thu May 16 04:24:08 2019
(r347645)
@@ -546,7 +546,7 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru
return (EBUSY);
entry->start = prev->end;
}
-   if (next != NULL && next->start < entry->end &&
+   if (next->start < entry->end &&
(next->flags & DMAR_MAP_ENTRY_PLACE) == 0) {
if ((next->flags & DMAR_MAP_ENTRY_RMRR) == 0)
return (EBUSY);
@@ -560,7 +560,7 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru
dmar_gas_rb_remove(domain, prev);
prev = NULL;
}
-   if (next != NULL && next->start < entry->end) {
+   if (next->start < entry->end) {
dmar_gas_rb_remove(domain, next);
next = NULL;
}

Modified: head/sys/x86/iommu/intel_qi.c
==
--- head/sys/x86/iommu/intel_qi.c   Thu May 16 03:30:36 2019
(r347644)
+++ head/sys/x86/iommu/intel_qi.c   Thu May 16 04:24:08 2019
(r347645)
@@ -425,7 +425,7 @@ dmar_fini_qi(struct dmar_unit *unit)
 {
struct dmar_qi_genseq gseq;
 
-   if (unit->qi_enabled)
+   if (!unit->qi_enabled)
return;
taskqueue_drain(unit->qi_taskqueue, >qi_task);
taskqueue_free(unit->qi_taskqueue);
___
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: r347644 - stable/11/lib/libc/gen

2019-05-15 Thread Alan Somers
Author: asomers
Date: Thu May 16 03:30:36 2019
New Revision: 347644
URL: https://svnweb.freebsd.org/changeset/base/347644

Log:
  MFC r347032 (except for the part about d_off):
  
  directory.3: add a STANDARDS section
  
  Reviewed by:  jilles, ngie
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20111

Modified:
  stable/11/lib/libc/gen/directory.3
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/gen/directory.3
==
--- stable/11/lib/libc/gen/directory.3  Thu May 16 03:24:08 2019
(r347643)
+++ stable/11/lib/libc/gen/directory.3  Thu May 16 03:30:36 2019
(r347644)
@@ -28,7 +28,7 @@
 .\" @(#)directory.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd August 31, 2016
+.Dd April 30, 2019
 .Dt DIRECTORY 3
 .Os
 .Sh NAME
@@ -264,6 +264,29 @@ return (NOT_FOUND);
 .Xr open 2 ,
 .Xr read 2 ,
 .Xr dir 5
+.Sh STANDARDS
+The
+.Fn closedir ,
+.Fn dirfd ,
+.Fn fdopendir ,
+.Fn opendir ,
+.Fn readdir ,
+.Fn readdir_r ,
+.Fn rewinddir ,
+.Fn seekdir
+and
+.Fn telldir
+functions are expected to conform to
+.St -p1003.1-2008 .
+The
+.Fn fdclosedir
+function and the
+.Fa d_reclen
+and
+.Fa d_type
+fields of
+.Vt struct dirent
+are non-standard, and should not be used in portable programs.
 .Sh HISTORY
 The
 .Fn opendir ,
___
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: r347643 - stable/11/tools/regression/fsx

2019-05-15 Thread Alan Somers
Author: asomers
Date: Thu May 16 03:24:08 2019
New Revision: 347643
URL: https://svnweb.freebsd.org/changeset/base/347643

Log:
  MFC r346847:
  
  fsx: seed more randomly with the -S0 option
  
  When using -S0, seed the PRNG with the current time in nanoseconds, not
  seconds, so consecutive runs don't accidentally use the same seed.
  
  Also, rename some variables for clarity.
  
  Reviewed by:  ngie
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20078

Modified:
  stable/11/tools/regression/fsx/fsx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/regression/fsx/fsx.c
==
--- stable/11/tools/regression/fsx/fsx.cThu May 16 02:41:25 2019
(r347642)
+++ stable/11/tools/regression/fsx/fsx.cThu May 16 03:24:08 2019
(r347643)
@@ -48,6 +48,7 @@
 # include 
 # include 
 #endif
+#include 
 #include 
 #include 
 #ifndef MAP_FILE
@@ -274,16 +275,22 @@ logdump(void)
prt("\t******");
break;
case OP_WRITE:
-   prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)",
-   lp->args[0], lp->args[0] + lp->args[1] - 1,
-   lp->args[1]);
-   if (lp->args[0] > lp->args[2])
-   prt(" HOLE");
-   else if (lp->args[0] + lp->args[1] > lp->args[2])
-   prt(" EXTEND");
-   if ((badoff >= lp->args[0] || badoff >=lp->args[2]) &&
-   badoff < lp->args[0] + lp->args[1])
-   prt("\t***");
+   {
+   int offset = lp->args[0];
+   int len = lp->args[1];
+   int oldlen = lp->args[2];
+
+   prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)",
+   offset, offset + len - 1,
+   len);
+   if (offset > oldlen)
+   prt(" HOLE");
+   else if (offset + len > oldlen)
+   prt(" EXTEND");
+   if ((badoff >= offset || badoff >=oldlen) &&
+   badoff < offset + len)
+   prt("\t***");
+   }
break;
case OP_TRUNCATE:
down = lp->args[0] < lp->args[1];
@@ -993,6 +1000,7 @@ main(int argc, char **argv)
char*endp;
char goodfile[1024];
char logfile[1024];
+   struct timespec now;
 
goodfile[0] = 0;
logfile[0] = 0;
@@ -1115,8 +1123,11 @@ main(int argc, char **argv)
break;
case 'S':
seed = getnum(optarg, );
-   if (seed == 0)
-   seed = time(0) % 1;
+   if (seed == 0) {
+   if (clock_gettime(CLOCK_REALTIME, ) != 0)
+   err(1, "clock_gettime");
+   seed = now.tv_nsec % 1;
+   }
if (!quiet)
fprintf(stdout, "Seed set to %d\n", seed);
if (seed < 0)
@@ -1206,7 +1217,7 @@ main(int argc, char **argv)
prterr(fname);
warn("main: error on write");
} else
-   warn("main: short write, 0x%x bytes instead of 
0x%x\n",
+   warn("main: short write, 0x%x bytes instead of 
0x%lx\n",
 (unsigned)written, maxfilelen);
exit(98);
}
___
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: r347642 - head/contrib/wpa/wpa_supplicant

2019-05-15 Thread Cy Schubert
Author: cy
Date: Thu May 16 02:41:25 2019
New Revision: 347642
URL: https://svnweb.freebsd.org/changeset/base/347642

Log:
  The driver list prints "(null)" for the NDIS driver when -h (help) or
  an unknown switch is passed outputting the command usage. This is
  because the NDIS driver is uninitialized when usage help is printed.
  To resolve this we initialize the driver prior to the possibility of
  printing the usage help message.
  
  Obtained from:The wpa_supplicant port
  MFC after:1 week

Modified:
  head/contrib/wpa/wpa_supplicant/main.c
  head/contrib/wpa/wpa_supplicant/wpa_supplicant.c

Modified: head/contrib/wpa/wpa_supplicant/main.c
==
--- head/contrib/wpa/wpa_supplicant/main.c  Thu May 16 02:18:57 2019
(r347641)
+++ head/contrib/wpa/wpa_supplicant/main.c  Thu May 16 02:41:25 2019
(r347642)
@@ -199,6 +199,11 @@ int main(int argc, char *argv[])
 
wpa_supplicant_fd_workaround(1);
 
+#ifdef CONFIG_DRIVER_NDIS
+   void driver_ndis_init_ops(void);
+   driver_ndis_init_ops();
+#endif /* CONFIG_DRIVER_NDIS */
+
for (;;) {
c = getopt(argc, argv,
   "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");

Modified: head/contrib/wpa/wpa_supplicant/wpa_supplicant.c
==
--- head/contrib/wpa/wpa_supplicant/wpa_supplicant.cThu May 16 02:18:57 
2019(r347641)
+++ head/contrib/wpa/wpa_supplicant/wpa_supplicant.cThu May 16 02:41:25 
2019(r347642)
@@ -6357,13 +6357,6 @@ struct wpa_global * wpa_supplicant_init(struct wpa_par
if (params == NULL)
return NULL;
 
-#ifdef CONFIG_DRIVER_NDIS
-   {
-   void driver_ndis_init_ops(void);
-   driver_ndis_init_ops();
-   }
-#endif /* CONFIG_DRIVER_NDIS */
-
 #ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
 #endif /* CONFIG_NO_WPA_MSG */
___
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: r347641 - head/tests/sys/netipsec/tunnel

2019-05-15 Thread Kristof Provost
Author: kp
Date: Thu May 16 02:18:57 2019
New Revision: 347641
URL: https://svnweb.freebsd.org/changeset/base/347641

Log:
  ipsec tests: Skip if ipsec.ko is not loaded
  
  As of r347410 IPSec is no longer built into GENERIC. The ipsec.ko module must
  be loaded before we can execute the IPSec tests.
  
  Check this, and skip the tests if IPSec is not available.

Modified:
  head/tests/sys/netipsec/tunnel/utils.subr

Modified: head/tests/sys/netipsec/tunnel/utils.subr
==
--- head/tests/sys/netipsec/tunnel/utils.subr   Thu May 16 02:11:33 2019
(r347640)
+++ head/tests/sys/netipsec/tunnel/utils.subr   Thu May 16 02:18:57 2019
(r347641)
@@ -8,6 +8,10 @@
 
 ist_init()
 {
+   if ! sysctl -q kern.features.ipsec >/dev/null ; then
+   atf_skip "This test requires ipsec"
+   fi
+
vnet_init
 }
 
___
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: r347640 - head/lib/libbe

2019-05-15 Thread Kyle Evans
Author: kevans
Date: Thu May 16 02:11:33 2019
New Revision: 347640
URL: https://svnweb.freebsd.org/changeset/base/347640

Log:
  libbe(3): Descend into children of datasets w/ mountpoint=none
  
  These datasets will generally be canmount=noauto,mountpoint=none (e.g.
  zroot/var) but have children that may need to be mounted. Instead of
  skipping that segment for no good reason, descend.
  
  Submitted by: Wes Maag
  Reported by:  Wes Maag
  MFC after:3 days

Modified:
  head/lib/libbe/be_access.c

Modified: head/lib/libbe/be_access.c
==
--- head/lib/libbe/be_access.c  Thu May 16 01:32:54 2019(r347639)
+++ head/lib/libbe/be_access.c  Thu May 16 02:11:33 2019(r347640)
@@ -99,13 +99,12 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data)
if (strcmp("none", zfs_mnt) == 0) {
/*
 * mountpoint=none; we'll mount it at info->mountpoint assuming
-* we're at the root.  If we're not at the root... that's less
-* than stellar and not entirely sure what to do with that.
-* For now, we won't treat it as an error condition -- we just
-* won't mount it, and we'll continue on.
+* we're at the root.  If we're not at the root, we're likely
+* at some intermediate dataset (e.g. zroot/var) that will have
+* children that may need to be mounted.
 */
if (info->depth > 0)
-   return (0);
+   goto skipmount;
 
snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint);
} else {
@@ -136,6 +135,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data)
if (!info->deepmount)
return (0);
 
+skipmount:
++info->depth;
err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info);
--info->depth;
___
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: r347639 - head/sys/x86/x86

2019-05-15 Thread Conrad Meyer
Author: cem
Date: Thu May 16 01:32:54 2019
New Revision: 347639
URL: https://svnweb.freebsd.org/changeset/base/347639

Log:
  x86: Correctly identify bhyve hypervisor
  
  Spotted after a similar report by Olivier Cochard-Labbé.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Thu May 16 01:09:13 2019(r347638)
+++ head/sys/x86/x86/identcpu.c Thu May 16 01:32:54 2019(r347639)
@@ -1365,7 +1365,7 @@ identify_hypervisor(void)
vm_guest = VM_GUEST_HV;
else if (strcmp(hv_vendor, "KVMKVMKVM") == 0)
vm_guest = VM_GUEST_KVM;
-   else if (strcmp(hv_vendor, "bhyve bhyve") == 0)
+   else if (strcmp(hv_vendor, "bhyve bhyve ") == 0)
vm_guest = VM_GUEST_BHYVE;
}
return;
___
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: r347638 - in head: . etc lib/libc/gen

2019-05-15 Thread Brad Davis
Author: brd
Date: Thu May 16 01:09:13 2019
New Revision: 347638
URL: https://svnweb.freebsd.org/changeset/base/347638

Log:
  Move master.passwd and group to lib/libc/gen/
  
  libc was picked as the destination location for these because of the syscalls
  that use these files as the lowest level place they are referenced.
  
  Approved by:  will (mentor), rgrimes, manu
  Differential Revision:https://reviews.freebsd.org/D16728

Added:
  head/lib/libc/gen/group
 - copied unchanged from r347637, head/etc/group
  head/lib/libc/gen/master.passwd
 - copied unchanged from r347637, head/etc/master.passwd
Deleted:
  head/etc/group
  head/etc/master.passwd
Modified:
  head/Makefile.inc1
  head/etc/Makefile
  head/lib/libc/gen/Makefile.inc

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu May 16 00:53:54 2019(r347637)
+++ head/Makefile.inc1  Thu May 16 01:09:13 2019(r347638)
@@ -871,8 +871,8 @@ DB_FROM_SRC=yes
 .endif
 
 .if defined(DB_FROM_SRC)
-INSTALLFLAGS+= -N ${.CURDIR}/etc
-MTREEFLAGS+=   -N ${.CURDIR}/etc
+INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen
+MTREEFLAGS+=   -N ${.CURDIR}/lib/libc/gen
 .endif
 _INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
 INSTALL_DDIR=  ${_INSTALL_DDIR:S://:/:g:C:/$::}

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 16 00:53:54 2019(r347637)
+++ head/etc/Makefile   Thu May 16 01:09:13 2019(r347638)
@@ -15,7 +15,6 @@ SUBDIR+=sendmail
 .endif
 
 BIN1=  \
-   group \
login.access \
rc.bsdextended \
rc.firewall \
@@ -65,21 +64,7 @@ distribution:
 .endif
cd ${.CURDIR}; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
-   ${BIN1} ${DESTDIR}/etc; \
-   ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
-   master.passwd ${DESTDIR}/etc;
-
-.if ${MK_TCSH} == "no"
-   sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
-.endif
-   pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
-.if defined(NO_ROOT)
-   ( \
-   echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; 
\
-   echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; 
\
-   echo "./etc/spwd.db type=file mode=0600 uname=root 
gname=wheel"; \
-   ) | ${METALOG.add}
-.endif
+   ${BIN1} ${DESTDIR}/etc
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu May 16 00:53:54 2019
(r347637)
+++ head/lib/libc/gen/Makefile.inc  Thu May 16 01:09:13 2019
(r347638)
@@ -4,7 +4,8 @@
 # machine-independent gen sources
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
 
-CONFS= shells
+CONFS+=group master.passwd shells
+CONFSMODE_master.passwd=   600
 
 SRCS+= __getosreldate.c \
__pthread_mutex_init_calloc_cb_stub.c \
@@ -543,3 +544,16 @@ MLINKS+=vis.3 nvis.3 \
vis.3 svis.3
 
 MLINKS+=wordexp.3 wordfree.3
+
+afterinstallconfig:
+.if ${MK_TCSH} == "no"
+   sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
+.endif
+   pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
+.if defined(NO_ROOT) && defined(METALOG)
+   ( \
+   echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; 
\
+   echo "./etc/spwd.db type=file mode=0600 uname=root 
gname=wheel"; \
+   echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; 
\
+   ) | cat -l >> ${METALOG}
+.endif

Copied: head/lib/libc/gen/group (from r347637, head/etc/group)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/gen/group Thu May 16 01:09:13 2019(r347638, copy 
of r347637, head/etc/group)
@@ -0,0 +1,36 @@
+# $FreeBSD$
+#
+wheel:*:0:root
+daemon:*:1:
+kmem:*:2:
+sys:*:3:
+tty:*:4:
+operator:*:5:root
+mail:*:6:
+bin:*:7:
+news:*:8:
+man:*:9:
+games:*:13:
+ftp:*:14:
+staff:*:20:
+sshd:*:22:
+smmsp:*:25:
+mailnull:*:26:
+guest:*:31:
+video:*:44:
+bind:*:53:
+unbound:*:59:
+proxy:*:62:
+authpf:*:63:
+_pflogd:*:64:
+_dhcp:*:65:
+uucp:*:66:
+dialer:*:68:
+network:*:69:
+audit:*:77:
+www:*:80:
+ntpd:*:123:
+_ypldap:*:160:
+hast:*:845:
+nogroup:*:65533:
+nobody:*:65534:

Copied: head/lib/libc/gen/master.passwd (from r347637, head/etc/master.passwd)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/gen/master.passwd Thu May 16 01:09:13 2019
(r347638, 

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

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu May 16 00:53:54 2019
New Revision: 347637
URL: https://svnweb.freebsd.org/changeset/base/347637

Log:
  MFC r345550:
  
  Change default value of kern.bootfile to reflect reality
  
  In most cases kernel.bootfile is populated from the information
  provided by loader(8). There are certain scenarios when loader
  is not available, for instance when kernel is loaded by u-boot
  or some other BootROM directly. In this case the default value
  "/kernel" points to invalid location and breaks some functinality,
  like using installkernel on self-hosted system or dtrace's CTF
  lookup. This can be fixed by setting the value manually but the
  default that reflects correct location is better than default that
  points to invalid one.
  
  Current default was set around FreeBSD 1, when "/kernel" was the
  actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.
  
  PR:   221550
  Reviewed by:  ian, imp
  Differential Revision:https://reviews.freebsd.org/D18902

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

Modified: stable/11/sys/kern/kern_mib.c
==
--- stable/11/sys/kern/kern_mib.c   Thu May 16 00:51:30 2019
(r347636)
+++ stable/11/sys/kern/kern_mib.c   Thu May 16 00:53:54 2019
(r347637)
@@ -135,7 +135,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
 SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
+char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";   /* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
___
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: r347636 - stable/11/sys/dev/acpi_support

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu May 16 00:51:30 2019
New Revision: 347636
URL: https://svnweb.freebsd.org/changeset/base/347636

Log:
  MFC r346647:
  
  [acpi_ibm] Add support for newer Thinkpad models
  
  Add support for newer Thinkpad models with id LEN0268. Was tested on
  Thinkpad T480 and ThinkPad X1 Yoga 2nd gen.
  
  PR:   229120
  Submitted by: Ali Abdallah 

Modified:
  stable/11/sys/dev/acpi_support/acpi_ibm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/acpi_support/acpi_ibm.c
==
--- stable/11/sys/dev/acpi_support/acpi_ibm.c   Wed May 15 22:51:25 2019
(r347635)
+++ stable/11/sys/dev/acpi_support/acpi_ibm.c   Thu May 16 00:51:30 2019
(r347636)
@@ -340,7 +340,7 @@ static devclass_t acpi_ibm_devclass;
 DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass,
  0, 0);
 MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1);
-static char*ibm_ids[] = {"IBM0068", "LEN0068", NULL};
+static char*ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL};
 
 static void
 ibm_led(void *softc, int onoff)
@@ -387,9 +387,14 @@ static int
 acpi_ibm_attach(device_t dev)
 {
int i;
+   int hkey;
struct acpi_ibm_softc   *sc;
char *maker, *product;
-   devclass_t  ec_devclass;
+   ACPI_OBJECT_LIST input;
+   ACPI_OBJECT params[1];
+   ACPI_OBJECT out_obj;
+   ACPI_BUFFER result;
+   devclass_t ec_devclass;
 
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
 
@@ -424,15 +429,42 @@ acpi_ibm_attach(device_t dev)
"initialmask", CTLFLAG_RD,
>events_initialmask, 0, "Initial eventmask");
 
-   /* The availmask is the bitmask of supported events */
-   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
-   IBM_NAME_EVENTS_AVAILMASK, >events_availmask)))
+   if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", ))) {
+   device_printf(dev, "Firmware version is 0x%X\n", hkey);
+   switch(hkey >> 8)
+   {
+   case 1:
+   /* The availmask is the bitmask of supported 
events */
+   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, 
>events_availmask)))
+   sc->events_availmask = 0x;
+   break;
+
+   case 2:
+   result.Length = sizeof(out_obj);
+   result.Pointer = _obj;
+   params[0].Type = ACPI_TYPE_INTEGER;
+   params[0].Integer.Value = 1;
+   input.Pointer = params;
+   input.Count = 1;
+
+   sc->events_availmask = 0x;
+
+   if (ACPI_SUCCESS(AcpiEvaluateObject (sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, , 
)))
+   sc->events_availmask = 
out_obj.Integer.Value;
+   break;
+   default:
+   device_printf(dev, "Unknown firmware version 
0x%x\n", hkey);
+   break;
+   }
+   } else
sc->events_availmask = 0x;
 
SYSCTL_ADD_UINT(sc->sysctl_ctx,
-   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-   "availmask", CTLFLAG_RD,
-   >events_availmask, 0, "Mask of supported events");
+   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+   "availmask", CTLFLAG_RD,
+   >events_availmask, 0, "Mask of supported 
events");
}
 
/* Hook up proc nodes */
___
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: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Rick Macklem
Konstantin Belousov wrote:
[lots of stuff snipped]
>On Wed, May 15, 2019 at 08:31:23PM +0300, Dmitry Chagin wrote:
>>
>> yes, you are right. thank you! but in the best tradition of the project,
>> the system does not built,
>> I got ar error when building static llvm library:
>> ar: fatal: Symbol table offset overflow
>> *** Error code 70
errno 70 is ESTALE, which is an NFS error indicating that the file was deleted
on the NFS server.
If you are using an NFS mount, I'd suggest trying it on a local disk.
(NFS isn't a POSIX compliant file system and never will be, given the protocol
 specification. You can usually get away with builds on NFS, but...)

If you aren't using a NFS mount, then I have no idea why an ESTALE would happen?

>>
>> Stop.
>> make[6]: stopped in /home/dchagin/head/lib/clang/libllvm
>> *** Error code 1
>Perhaps try to manually compile usr.bin/ar from the new source and install
>it before doing buildworld.

Good luck with it, rick
___
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: r347634 - stable/12/sys/dev/acpi_support

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed May 15 21:52:43 2019
New Revision: 347634
URL: https://svnweb.freebsd.org/changeset/base/347634

Log:
  MFC r346647:
  
  [acpi_ibm] Add support for newer Thinkpad models
  
  Add support for newer Thinkpad models with id LEN0268. Was tested on
  Thinkpad T480 and ThinkPad X1 Yoga 2nd gen.
  
  PR:   229120
  Submitted by: Ali Abdallah 

Modified:
  stable/12/sys/dev/acpi_support/acpi_ibm.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpi_support/acpi_ibm.c
==
--- stable/12/sys/dev/acpi_support/acpi_ibm.c   Wed May 15 21:25:44 2019
(r347633)
+++ stable/12/sys/dev/acpi_support/acpi_ibm.c   Wed May 15 21:52:43 2019
(r347634)
@@ -349,7 +349,7 @@ static devclass_t acpi_ibm_devclass;
 DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass,
  0, 0);
 MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1);
-static char*ibm_ids[] = {"IBM0068", "LEN0068", NULL};
+static char*ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL};
 
 static void
 ibm_led(void *softc, int onoff)
@@ -425,9 +425,14 @@ static int
 acpi_ibm_attach(device_t dev)
 {
int i;
+   int hkey;
struct acpi_ibm_softc   *sc;
char *maker, *product;
-   devclass_t  ec_devclass;
+   ACPI_OBJECT_LIST input;
+   ACPI_OBJECT params[1];
+   ACPI_OBJECT out_obj;
+   ACPI_BUFFER result;
+   devclass_t ec_devclass;
 
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
 
@@ -462,15 +467,42 @@ acpi_ibm_attach(device_t dev)
"initialmask", CTLFLAG_RD,
>events_initialmask, 0, "Initial eventmask");
 
-   /* The availmask is the bitmask of supported events */
-   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
-   IBM_NAME_EVENTS_AVAILMASK, >events_availmask)))
+   if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", ))) {
+   device_printf(dev, "Firmware version is 0x%X\n", hkey);
+   switch(hkey >> 8)
+   {
+   case 1:
+   /* The availmask is the bitmask of supported 
events */
+   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, 
>events_availmask)))
+   sc->events_availmask = 0x;
+   break;
+
+   case 2:
+   result.Length = sizeof(out_obj);
+   result.Pointer = _obj;
+   params[0].Type = ACPI_TYPE_INTEGER;
+   params[0].Integer.Value = 1;
+   input.Pointer = params;
+   input.Count = 1;
+
+   sc->events_availmask = 0x;
+
+   if (ACPI_SUCCESS(AcpiEvaluateObject (sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, , 
)))
+   sc->events_availmask = 
out_obj.Integer.Value;
+   break;
+   default:
+   device_printf(dev, "Unknown firmware version 
0x%x\n", hkey);
+   break;
+   }
+   } else
sc->events_availmask = 0x;
 
SYSCTL_ADD_UINT(sc->sysctl_ctx,
-   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-   "availmask", CTLFLAG_RD,
-   >events_availmask, 0, "Mask of supported events");
+   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+   "availmask", CTLFLAG_RD,
+   >events_availmask, 0, "Mask of supported 
events");
}
 
/* Hook up proc nodes */
___
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: r347633 - in releng/12.0: . sys/conf

2019-05-15 Thread Gordon Tetlow
Author: gordon
Date: Wed May 15 21:25:44 2019
New Revision: 347633
URL: https://svnweb.freebsd.org/changeset/base/347633

Log:
  Bump patch revision for updated mds patches.
  
  Approved by:  so

Modified:
  releng/12.0/UPDATING
  releng/12.0/sys/conf/newvers.sh

Modified: releng/12.0/UPDATING
==
--- releng/12.0/UPDATINGWed May 15 20:44:27 2019(r347632)
+++ releng/12.0/UPDATINGWed May 15 21:25:44 2019(r347633)
@@ -16,6 +16,11 @@ 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.
 
+20190515   p5  FreeBSD-EN-19:07.mds [revised]
+
+   Fixed error in patch causing panic on i386 architecture. [SA-19:07.mds]
+
+
 20190514   p4  FreeBSD-EN-19:08.tzdata
FreeBSD-EN-19:09.xinstall
FreeBSD-EN-19:10.scp

Modified: releng/12.0/sys/conf/newvers.sh
==
--- releng/12.0/sys/conf/newvers.sh Wed May 15 20:44:27 2019
(r347632)
+++ releng/12.0/sys/conf/newvers.sh Wed May 15 21:25:44 2019
(r347633)
@@ -46,7 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.0"
-BRANCH="RELEASE-p4"
+BRANCH="RELEASE-p5"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 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: r347632 - releng/12.0/sys/i386/i386

2019-05-15 Thread Konstantin Belousov
Author: kib
Date: Wed May 15 20:44:27 2019
New Revision: 347632
URL: https://svnweb.freebsd.org/changeset/base/347632

Log:
  Fix mismerge.
  
  Pointy hat to:kib
  Tested by: so (emaste, gtetlow)
  Approved by: so (emaste, gtetlow)

Modified:
  releng/12.0/sys/i386/i386/initcpu.c

Modified: releng/12.0/sys/i386/i386/initcpu.c
==
--- releng/12.0/sys/i386/i386/initcpu.c Wed May 15 20:01:41 2019
(r347631)
+++ releng/12.0/sys/i386/i386/initcpu.c Wed May 15 20:44:27 2019
(r347632)
@@ -745,7 +745,6 @@ initializecpu(void)
cpu_fxsr = hw_instruction_sse = 1;
}
 #if defined(PAE) || defined(PAE_TABLES)
-   hw_mds_recalculate();
if ((amd_feature & AMDID_NX) != 0) {
uint64_t msr;
 
@@ -755,6 +754,7 @@ initializecpu(void)
elf32_nxstack = 1;
}
 #endif
+   hw_mds_recalculate();
 }
 
 void
___
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: r347629 - stable/12/sys/kern

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed May 15 18:56:42 2019
New Revision: 347629
URL: https://svnweb.freebsd.org/changeset/base/347629

Log:
  MFC r345550:
  
  Change default value of kern.bootfile to reflect reality
  
  In most cases kernel.bootfile is populated from the information
  provided by loader(8). There are certain scenarios when loader
  is not available, for instance when kernel is loaded by u-boot
  or some other BootROM directly. In this case the default value
  "/kernel" points to invalid location and breaks some functinality,
  like using installkernel on self-hosted system or dtrace's CTF
  lookup. This can be fixed by setting the value manually but the
  default that reflects correct location is better than default that
  points to invalid one.
  
  Current default was set around FreeBSD 1, when "/kernel" was the
  actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.
  
  PR:   221550
  Reviewed by:  ian, imp
  Differential Revision:https://reviews.freebsd.org/D18902

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

Modified: stable/12/sys/kern/kern_mib.c
==
--- stable/12/sys/kern/kern_mib.c   Wed May 15 18:13:43 2019
(r347628)
+++ stable/12/sys/kern/kern_mib.c   Wed May 15 18:56:42 2019
(r347629)
@@ -136,7 +136,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
 SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
+char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";   /* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
___
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: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Konstantin Belousov
On Wed, May 15, 2019 at 08:31:23PM +0300, Dmitry Chagin wrote:
> ср, 15 мая 2019 г. в 11:10, Konstantin Belousov :
> 
> > On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote:
> > > вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :
> > >
> > > > Author: kib
> > > > Date: Tue May 14 17:02:20 2019
> > > > New Revision: 347566
> > > > URL: https://svnweb.freebsd.org/changeset/base/347566
> > > >
> > > > Log:
> > > >   Mitigations for Microarchitectural Data Sampling.
> > > >
> > > >   Microarchitectural buffers on some Intel processors utilizing
> > > >   speculative execution may allow a local process to obtain a memory
> > > >   disclosure.  An attacker may be able to read secret data from the
> > > >   kernel or from a process when executing untrusted code (for example,
> > > >   in a web browser).
> > > >
> > > >   Reference:
> > > >
> > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
> > > >   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> > > > CVE-2019-11091
> > > >   Security: FreeBSD-SA-19:07.mds
> > > >   Reviewed by:  jhb
> > > >   Tested by:emaste, lwhsu
> > > >   Approved by:  so (gtetlow)
> > > >
> > > > Modified:
> > > >   head/sys/amd64/amd64/exception.S
> > > >   head/sys/amd64/amd64/genassym.c
> > > >   head/sys/amd64/amd64/initcpu.c
> > > >   head/sys/amd64/amd64/machdep.c
> > > >   head/sys/amd64/amd64/support.S
> > > >
> > >
> > >
> > >
> > > Hi, Kostik!
> > >
> > > cc -target x86_64-unknown-freebsd13.0
> > > --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
> > > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
> > > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
> > > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
> > > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
> > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
> > > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
> > > -MF.depend.support.o -MTsupport.o
> > > -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
> > > -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include
> > -mcmodel=kernel
> > > -mno-red-zone -mno-mmx -mno-sse -msoft-float
> > > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> > > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> > > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
> > -Wno-pointer-sign
> > > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
> > > -fdiagnostics-show-option -Wno-unknown-pragmas
> > > -Wno-error-tautological-compare -Wno-error-empty-body
> > > -Wno-error-parentheses-equality -Wno-error-unused-function
> > > -Wno-error-pointer-sign -Wno-error-shift-negative-value
> > > -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
> > > -Werror /home/dchagin/head/sys/amd64/amd64/support.S
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
> > > requires: AVX-512 ISA
> > >  vmovdqa64 %zmm0, %gs:0x340
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
> > > requires: AVX-512 ISA
> > >  vpxor %zmm0, %zmm0, %zmm0
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
> > > requires: AVX-512 DQ ISA
> > >  vorpd (%rdx), %zmm0, %zmm0
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
> > > requires: AVX-512 DQ ISA
> > >  vorpd (%rdx), %zmm0, %zmm0
> > >  ^
> > > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
> > > requires: AVX-512 ISA
> > >  vmovdqa64 %gs:0x340, %zmm0
> > >  ^
> > > *** Error code 1
> > >
> > >
> > > I/m missied something?
> > Yes, you are using older compiler than current.  Perhaps you are using
> > clang 6.0 still.  Update your world.
> >
> > FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0
> > patches. I do not want to put such abomination into live code base,
> > remembering aesni.ko.
> >
> 
> yes, you are right. thank you! but in the best tradition of the project,
> the system does not built,
> I got ar error when building static llvm library:
> ar: fatal: Symbol table offset overflow
> *** Error code 70
> 
> Stop.
> make[6]: stopped in /home/dchagin/head/lib/clang/libllvm
> *** Error code 1
Perhaps try to manually compile usr.bin/ar from the new source and install
it before doing buildworld.
___
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: r347628 - in head/sys: amd64/amd64 i386/i386

2019-05-15 Thread Ryan Libby
Author: rlibby
Date: Wed May 15 18:13:43 2019
New Revision: 347628
URL: https://svnweb.freebsd.org/changeset/base/347628

Log:
  x86: spell vpxor %zmm0 as vpxord
  
  Fix gcc/gas amd64 & i386 build after r347566.
  
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20264

Modified:
  head/sys/amd64/amd64/support.S
  head/sys/i386/i386/support.s

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Wed May 15 17:58:08 2019
(r347627)
+++ head/sys/amd64/amd64/support.S  Wed May 15 18:13:43 2019
(r347628)
@@ -1807,7 +1807,7 @@ ENTRY(mds_handler_skl_avx512)
 1: movqPCPU(MDS_BUF), %rdi
movqPCPU(MDS_BUF64), %rdx
vmovdqa64   %zmm0, PCPU(MDS_TMP)
-   vpxor   %zmm0, %zmm0, %zmm0
+   vpxord  %zmm0, %zmm0, %zmm0
 
lfence
vorpd   (%rdx), %zmm0, %zmm0

Modified: head/sys/i386/i386/support.s
==
--- head/sys/i386/i386/support.sWed May 15 17:58:08 2019
(r347627)
+++ head/sys/i386/i386/support.sWed May 15 18:13:43 2019
(r347628)
@@ -611,7 +611,7 @@ ENTRY(mds_handler_skl_avx512)
 1: movlPCPU(MDS_BUF), %edi
movlPCPU(MDS_BUF64), %edx
vmovdqa64   %zmm0, PCPU(MDS_TMP)
-   vpxor   %zmm0, %zmm0, %zmm0
+   vpxord  %zmm0, %zmm0, %zmm0
 
lfence
vorpd   (%edx), %zmm0, %zmm0
___
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: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Dmitry Chagin
ср, 15 мая 2019 г. в 11:10, Konstantin Belousov :

> On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote:
> > вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :
> >
> > > Author: kib
> > > Date: Tue May 14 17:02:20 2019
> > > New Revision: 347566
> > > URL: https://svnweb.freebsd.org/changeset/base/347566
> > >
> > > Log:
> > >   Mitigations for Microarchitectural Data Sampling.
> > >
> > >   Microarchitectural buffers on some Intel processors utilizing
> > >   speculative execution may allow a local process to obtain a memory
> > >   disclosure.  An attacker may be able to read secret data from the
> > >   kernel or from a process when executing untrusted code (for example,
> > >   in a web browser).
> > >
> > >   Reference:
> > >
> https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
> > >   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> > > CVE-2019-11091
> > >   Security: FreeBSD-SA-19:07.mds
> > >   Reviewed by:  jhb
> > >   Tested by:emaste, lwhsu
> > >   Approved by:  so (gtetlow)
> > >
> > > Modified:
> > >   head/sys/amd64/amd64/exception.S
> > >   head/sys/amd64/amd64/genassym.c
> > >   head/sys/amd64/amd64/initcpu.c
> > >   head/sys/amd64/amd64/machdep.c
> > >   head/sys/amd64/amd64/support.S
> > >
> >
> >
> >
> > Hi, Kostik!
> >
> > cc -target x86_64-unknown-freebsd13.0
> > --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
> > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
> > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
> > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
> > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
> > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
> > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
> > -MF.depend.support.o -MTsupport.o
> > -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
> > -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include
> -mcmodel=kernel
> > -mno-red-zone -mno-mmx -mno-sse -msoft-float
> > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
> -Wno-pointer-sign
> > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
> > -fdiagnostics-show-option -Wno-unknown-pragmas
> > -Wno-error-tautological-compare -Wno-error-empty-body
> > -Wno-error-parentheses-equality -Wno-error-unused-function
> > -Wno-error-pointer-sign -Wno-error-shift-negative-value
> > -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
> > -Werror /home/dchagin/head/sys/amd64/amd64/support.S
> > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
> > requires: AVX-512 ISA
> >  vmovdqa64 %zmm0, %gs:0x340
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
> > requires: AVX-512 ISA
> >  vpxor %zmm0, %zmm0, %zmm0
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
> > requires: AVX-512 DQ ISA
> >  vorpd (%rdx), %zmm0, %zmm0
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
> > requires: AVX-512 DQ ISA
> >  vorpd (%rdx), %zmm0, %zmm0
> >  ^
> > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
> > requires: AVX-512 ISA
> >  vmovdqa64 %gs:0x340, %zmm0
> >  ^
> > *** Error code 1
> >
> >
> > I/m missied something?
> Yes, you are using older compiler than current.  Perhaps you are using
> clang 6.0 still.  Update your world.
>
> FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0
> patches. I do not want to put such abomination into live code base,
> remembering aesni.ko.
>

yes, you are right. thank you! but in the best tradition of the project,
the system does not built,
I got ar error when building static llvm library:
ar: fatal: Symbol table offset overflow
*** Error code 70

Stop.
make[6]: stopped in /home/dchagin/head/lib/clang/libllvm
*** Error code 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: r347627 - stable/11/sys/dev/dcons

2019-05-15 Thread Ian Lepore
Author: ian
Date: Wed May 15 17:58:08 2019
New Revision: 347627
URL: https://svnweb.freebsd.org/changeset/base/347627

Log:
  MFC r347422:
  
  Allow dcons(4) to be unloaded when loaded as a module.
  
  When the module is unloaded, the tty devices are destroyed.  That requires
  implementing the tsw_free callback to avoid a panic.  This driver requires
  no particular cleanup to be done from the callback, but the module itself
  must remain in memory until the deferred tsw_free callbacks are invoked.
  These changes implement that by incrementing a reference count variable in
  the detach routine, and decrementing it in the tsw_free callback.  The
  MOD_UNLOAD event handler doesn't return until the count drops to zero.
  
  PR: 237758

Modified:
  stable/11/sys/dev/dcons/dcons_os.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/dcons/dcons_os.c
==
--- stable/11/sys/dev/dcons/dcons_os.c  Wed May 15 17:57:06 2019
(r347626)
+++ stable/11/sys/dev/dcons/dcons_os.c  Wed May 15 17:58:08 2019
(r347627)
@@ -50,6 +50,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -133,12 +134,16 @@ extern struct gdb_dbgport *gdb_cur;
 #endif
 
 static tsw_outwakeup_t dcons_outwakeup;
+static tsw_free_t  dcons_free;
 
 static struct ttydevsw dcons_ttydevsw = {
.tsw_flags  = TF_NOPREFIX,
.tsw_outwakeup  = dcons_outwakeup,
+   .tsw_free   = dcons_free,
 };
 
+static int dcons_close_refs;
+
 #if (defined(GDB) || defined(DDB))
 static int
 dcons_check_break(struct dcons_softc *dc, int c)
@@ -196,6 +201,14 @@ dcons_os_putc(struct dcons_softc *dc, int c)
 }
 
 static void
+dcons_free(void *xsc __unused)
+{
+
+   /* Our deferred free has arrived, now we're waiting for one fewer. */
+   atomic_subtract_rel_int(_close_refs, 1);
+}
+
+static void
 dcons_outwakeup(struct tty *tp)
 {
struct dcons_softc *dc;
@@ -389,6 +402,8 @@ dcons_detach(int port)
dc = [port];
tp = dc->tty;
 
+   /* tty_rel_gone() schedules a deferred free callback, count it. */
+   atomic_add_int(_close_refs, 1);
tty_lock(tp);
tty_rel_gone(tp);
 
@@ -423,6 +438,9 @@ dcons_modevent(module_t mode, int type, void *data)
contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF);
}
 
+   /* Wait for tty deferred free callbacks to complete. */
+   while (atomic_load_acq_int(_close_refs) > 0)
+pause_sbt("dcunld", mstosbt(50), mstosbt(10), 0);
break;
case MOD_SHUTDOWN:
 #if 0  /* Keep connection after halt */
___
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: r347625 - head/sys/x86/x86

2019-05-15 Thread Konstantin Belousov
Author: kib
Date: Wed May 15 17:55:41 2019
New Revision: 347625
URL: https://svnweb.freebsd.org/changeset/base/347625

Log:
  Properly announce MD_CLEAR.
  
  Submitted by: Petr Lampa 
  MFC after:3 days

Modified:
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Wed May 15 17:50:17 2019(r347624)
+++ head/sys/x86/x86/identcpu.c Wed May 15 17:55:41 2019(r347625)
@@ -995,6 +995,7 @@ printcpuinfo(void)
printf("\n  Structured Extended Features3=0x%b",
cpu_stdext_feature3,
   "\020"
+  "\013MD_CLEAR"
   "\016TSXFA"
   "\033IBPB"
   "\034STIBP"
___
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: r347626 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:57:06 2019
New Revision: 347626
URL: https://svnweb.freebsd.org/changeset/base/347626

Log:
  LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/kernel.h

Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h
==
--- head/sys/compat/linuxkpi/common/include/linux/kernel.h  Wed May 15 
17:55:41 2019(r347625)
+++ head/sys/compat/linuxkpi/common/include/linux/kernel.h  Wed May 15 
17:57:06 2019(r347626)
@@ -130,9 +130,14 @@
 #defineALIGN(x, y) roundup2((x), (y))
 #undef PTR_ALIGN
 #definePTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), 
(a)))
+#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5
+/* Moved from linuxkpi_gplv2 */
+#defineIS_ALIGNED(x, a)(((x) & ((__typeof(x))(a) - 1)) == 0)
+#endif
 #defineDIV_ROUND_UP(x, n)  howmany(x, n)
 #define__KERNEL_DIV_ROUND_UP(x, n) howmany(x, n)
 #defineDIV_ROUND_UP_ULL(x, n)  DIV_ROUND_UP((unsigned long long)(x), 
(n))
+#defineDIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n))
 #defineFIELD_SIZEOF(t, f)  sizeof(((t *)0)->f)
 
 #defineprintk(...) printf(__VA_ARGS__)
___
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: r347624 - stable/12/sys/dev/dcons

2019-05-15 Thread Ian Lepore
Author: ian
Date: Wed May 15 17:50:17 2019
New Revision: 347624
URL: https://svnweb.freebsd.org/changeset/base/347624

Log:
  MFC r347422:
  
  Allow dcons(4) to be unloaded when loaded as a module.
  
  When the module is unloaded, the tty devices are destroyed.  That requires
  implementing the tsw_free callback to avoid a panic.  This driver requires
  no particular cleanup to be done from the callback, but the module itself
  must remain in memory until the deferred tsw_free callbacks are invoked.
  These changes implement that by incrementing a reference count variable in
  the detach routine, and decrementing it in the tsw_free callback.  The
  MOD_UNLOAD event handler doesn't return until the count drops to zero.
  
  PR: 237758

Modified:
  stable/12/sys/dev/dcons/dcons_os.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/dcons/dcons_os.c
==
--- stable/12/sys/dev/dcons/dcons_os.c  Wed May 15 17:48:11 2019
(r347623)
+++ stable/12/sys/dev/dcons/dcons_os.c  Wed May 15 17:50:17 2019
(r347624)
@@ -52,6 +52,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -135,12 +136,16 @@ extern struct gdb_dbgport *gdb_cur;
 #endif
 
 static tsw_outwakeup_t dcons_outwakeup;
+static tsw_free_t  dcons_free;
 
 static struct ttydevsw dcons_ttydevsw = {
.tsw_flags  = TF_NOPREFIX,
.tsw_outwakeup  = dcons_outwakeup,
+   .tsw_free   = dcons_free,
 };
 
+static int dcons_close_refs;
+
 #if (defined(GDB) || defined(DDB))
 static int
 dcons_check_break(struct dcons_softc *dc, int c)
@@ -198,6 +203,14 @@ dcons_os_putc(struct dcons_softc *dc, int c)
 }
 
 static void
+dcons_free(void *xsc __unused)
+{
+
+   /* Our deferred free has arrived, now we're waiting for one fewer. */
+   atomic_subtract_rel_int(_close_refs, 1);
+}
+
+static void
 dcons_outwakeup(struct tty *tp)
 {
struct dcons_softc *dc;
@@ -396,6 +409,8 @@ dcons_detach(int port)
dc = [port];
tp = dc->tty;
 
+   /* tty_rel_gone() schedules a deferred free callback, count it. */
+   atomic_add_int(_close_refs, 1);
tty_lock(tp);
tty_rel_gone(tp);
 
@@ -430,6 +445,9 @@ dcons_modevent(module_t mode, int type, void *data)
contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF);
}
 
+   /* Wait for tty deferred free callbacks to complete. */
+   while (atomic_load_acq_int(_close_refs) > 0)
+pause_sbt("dcunld", mstosbt(50), mstosbt(10), 0);
break;
case MOD_SHUTDOWN:
 #if 0  /* Keep connection after halt */
___
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: r347623 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:48:11 2019
New Revision: 347623
URL: https://svnweb.freebsd.org/changeset/base/347623

Log:
  LinuxKPI: Move {lower|upper}_32_bits macros from port to base.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/compiler.h

Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h
==
--- head/sys/compat/linuxkpi/common/include/linux/compiler.hWed May 15 
17:44:25 2019(r347622)
+++ head/sys/compat/linuxkpi/common/include/linux/compiler.hWed May 15 
17:48:11 2019(r347623)
@@ -81,6 +81,12 @@
 
 #definebarrier()   __asm__ __volatile__("": : 
:"memory")
 
+#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5
+/* Moved from drm_os_freebsd.h */
+#definelower_32_bits(n)((u32)(n))
+#defineupper_32_bits(n)((u32)(((n) >> 16) >> 16))
+#endif
+
 #define___PASTE(a,b) a##b
 #define__PASTE(a,b) ___PASTE(a,b)
 
___
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: r347622 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:44:25 2019
New Revision: 347622
URL: https://svnweb.freebsd.org/changeset/base/347622

Log:
  LinuxKPI: Include asm/atomic-long.h from atomic.h.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/atomic.h

Modified: head/sys/compat/linuxkpi/common/include/linux/atomic.h
==
--- head/sys/compat/linuxkpi/common/include/linux/atomic.h  Wed May 15 
17:32:00 2019(r347621)
+++ head/sys/compat/linuxkpi/common/include/linux/atomic.h  Wed May 15 
17:44:25 2019(r347622)
@@ -31,5 +31,6 @@
 
 #include 
 #include 
+#include 
 
 #endif /* _LINUX_ATOMIC_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: r347621 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:32:00 2019
New Revision: 347621
URL: https://svnweb.freebsd.org/changeset/base/347621

Log:
  LinuxKPI: Add get_random_u32 function.
  
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/random.h

Modified: head/sys/compat/linuxkpi/common/include/linux/random.h
==
--- head/sys/compat/linuxkpi/common/include/linux/random.h  Wed May 15 
17:04:12 2019(r347620)
+++ head/sys/compat/linuxkpi/common/include/linux/random.h  Wed May 15 
17:32:00 2019(r347621)
@@ -35,6 +35,8 @@
 #include 
 #include 
 
+#defineget_random_u32() get_random_int()
+
 static inline void
 get_random_bytes(void *buf, int nbytes)
 {
___
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: r347620 - head/sys/compat/linuxkpi/common/include/asm

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 17:04:12 2019
New Revision: 347620
URL: https://svnweb.freebsd.org/changeset/base/347620

Log:
  LinuxKPI: Update user_access_begin for Linux v5.0.
  
  Check the new LINUXKPI_VERSION macro for backwards compatibility.
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/asm/uaccess.h

Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h
==
--- head/sys/compat/linuxkpi/common/include/asm/uaccess.h   Wed May 15 
16:59:04 2019(r347619)
+++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h   Wed May 15 
17:04:12 2019(r347620)
@@ -52,7 +52,11 @@ copy_from_user(void *to, const void *from, unsigned lo
 #define__copy_from_user(...)   copy_from_user(__VA_ARGS__)
 #define__copy_in_user(...) copy_from_user(__VA_ARGS__)
 
+#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5
+#defineuser_access_begin(ptr, len) access_ok(ptr, len)
+#else
 #defineuser_access_begin() do { } while (0)
+#endif
 #defineuser_access_end() do { } while (0)
 
 #defineunsafe_get_user(x, ptr, err) do { \
___
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: r347619 - head/sys/compat/linuxkpi/common/include/linux

2019-05-15 Thread Johannes Lundberg
Author: johalun
Date: Wed May 15 16:59:04 2019
New Revision: 347619
URL: https://svnweb.freebsd.org/changeset/base/347619

Log:
  LinuxKPI: Expand ktime functionality.
  
  Also, make ktime_get_raw call getnanouptime instead of getnanotime
  to match (the correct) ktime_get_raw_ns.
  This patch is part of D19565
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/ktime.h

Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h
==
--- head/sys/compat/linuxkpi/common/include/linux/ktime.h   Wed May 15 
16:51:08 2019(r347618)
+++ head/sys/compat/linuxkpi/common/include/linux/ktime.h   Wed May 15 
16:59:04 2019(r347619)
@@ -35,8 +35,6 @@
 #include 
 #include 
 
-#definektime_get_ts(x) getnanouptime(x)
-
 /* time values in nanoseconds */
 typedef s64 ktime_t;
 
@@ -93,6 +91,13 @@ ktime_add_ms(ktime_t kt, int64_t ms)
 }
 
 static inline ktime_t
+ktime_add_us(ktime_t kt, int64_t us)
+{
+
+   return (ktime_add_ns(kt, us * NSEC_PER_USEC));
+}
+
+static inline ktime_t
 ktime_sub_ns(ktime_t kt, int64_t ns)
 {
return (kt - ns);
@@ -172,11 +177,20 @@ timeval_to_ktime(struct timeval tv)
return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC));
 }
 
+static inline int64_t
+timespec64_to_ns(struct timespec64 *ts)
+{
+   return (timespec_to_ns(ts));
+}
+
 #definektime_to_timespec(kt)   ns_to_timespec(kt)
 #definektime_to_timespec64(kt) ns_to_timespec(kt)
 #definektime_to_timeval(kt)ns_to_timeval(kt)
 #definektime_to_ns(kt) (kt)
-#definektime_get_ts64(ts)  ktime_get_ts(ts)
+#definektime_get_ts(ts)getnanouptime(ts)
+#definektime_get_ts64(ts)  getnanouptime(ts)
+#definektime_get_raw_ts64(ts)  getnanouptime(ts)
+#definegetrawmonotonic64(ts)   getnanouptime(ts)
 
 static inline int64_t
 ktime_get_ns(void)
@@ -229,7 +243,7 @@ ktime_get_raw(void)
 {
struct timespec ts;
 
-   nanotime();
+   nanouptime();
return (timespec_to_ktime(ts));
 }
 
___
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: r347618 - head/sys/mips/atheros

2019-05-15 Thread Adrian Chadd
Author: adrian
Date: Wed May 15 16:51:08 2019
New Revision: 347618
URL: https://svnweb.freebsd.org/changeset/base/347618

Log:
  [ar71xx_gpio] Add AR9341/AR9342 to the list of chips for programming 
function/output enable.
  
  This is reqired to use the gpiofunc behaviour for configuring GPIO
  pins at boot time.
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D20170

Modified:
  head/sys/mips/atheros/ar71xx_gpio.c

Modified: head/sys/mips/atheros/ar71xx_gpio.c
==
--- head/sys/mips/atheros/ar71xx_gpio.c Wed May 15 15:54:27 2019
(r347617)
+++ head/sys/mips/atheros/ar71xx_gpio.c Wed May 15 16:51:08 2019
(r347618)
@@ -151,6 +151,8 @@ static int
 ar71xx_gpio_oe_is_high(void)
 {
switch (ar71xx_soc) {
+   case AR71XX_SOC_AR9341:
+   case AR71XX_SOC_AR9342:
case AR71XX_SOC_AR9344:
case AR71XX_SOC_QCA9533:
case AR71XX_SOC_QCA9533_V2:
@@ -559,7 +561,7 @@ ar71xx_gpio_attach(device_t dev)
) != 0)
continue;
 
-   /* We only handle mode=1 for now */
+   /* We only handle mode=1 (output) for now */
if (gpiomode != 1)
continue;
 
___
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: r347617 - head/lib/libc/stdlib

2019-05-15 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Wed May 15 15:54:27 2019
New Revision: 347617
URL: https://svnweb.freebsd.org/changeset/base/347617

Log:
  Add small EXAMPLE section to bsearch.3.
  
  Submitted by: fernape (via Phabricator)
  Reviewed by:  bcr, jilles, dab
  Approved by:  bcr (man pages), jilles (src)
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D19902

Modified:
  head/lib/libc/stdlib/bsearch.3

Modified: head/lib/libc/stdlib/bsearch.3
==
--- head/lib/libc/stdlib/bsearch.3  Wed May 15 15:49:29 2019
(r347616)
+++ head/lib/libc/stdlib/bsearch.3  Wed May 15 15:54:27 2019
(r347617)
@@ -32,7 +32,7 @@
 .\" @(#)bsearch.3  8.3 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd February 22, 2013
+.Dd May 15, 2019
 .Dt BSEARCH 3
 .Os
 .Sh NAME
@@ -83,6 +83,61 @@ The
 function returns a pointer to a matching member of the array, or a null
 pointer if no match is found.
 If two members compare as equal, which member is matched is unspecified.
+.Sh EXAMPLES
+A sample program that searches people by age in a sorted array:
+.Bd -literal
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct person {
+   char name[5];
+   int age;
+};
+
+int
+compare(const void *key, const void *array_member)
+{
+   int age = (intptr_t) key;
+   struct person person = *(struct person *) array_member;
+
+   return (age - person.age);
+}
+
+int
+main()
+{
+   struct person *friend;
+
+   /* Sorted array */
+   struct person friends[6] = {
+   { "paul", 22 },
+   { "anne", 25 },
+   { "fred", 25 },
+   { "mary", 27 },
+   { "mark", 35 },
+   { "bill", 50 }
+   };
+
+   size_t array_size = sizeof(friends) / sizeof(struct person);
+
+   friend = bsearch((void *)22, , array_size, sizeof(struct 
person), compare);
+   assert(strcmp(friend->name, "paul") == 0);
+   printf("name: %s\enage: %d\en", friend->name, friend->age);
+
+   friend = bsearch((void *)25, , array_size, sizeof(struct 
person), compare);
+   assert(strcmp(friend->name, "fred") == 0 || strcmp(friend->name, 
"anne") == 0);
+   printf("name: %s\enage: %d\en", friend->name, friend->age);
+
+   friend = bsearch((void *)30, , array_size, sizeof(struct 
person), compare);
+   assert(friend == NULL);
+   printf("friend aged 30 not found\en");
+
+   return (EXIT_SUCCESS);
+}
+.Ed
 .Sh SEE ALSO
 .Xr db 3 ,
 .Xr lsearch 3 ,
___
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: r347616 - in stable/11/sys: amd64/amd64 i386/i386

2019-05-15 Thread Mark Johnston
Author: markj
Date: Wed May 15 15:49:29 2019
New Revision: 347616
URL: https://svnweb.freebsd.org/changeset/base/347616

Log:
  MFC r339046, r339073:
  Count bootstrap data as resident in the kernel pmap.

Modified:
  stable/11/sys/amd64/amd64/pmap.c
  stable/11/sys/i386/i386/pmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/pmap.c
==
--- stable/11/sys/amd64/amd64/pmap.cWed May 15 15:11:49 2019
(r347615)
+++ stable/11/sys/amd64/amd64/pmap.cWed May 15 15:49:29 2019
(r347616)
@@ -1016,9 +1016,11 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 {
vm_offset_t va;
pt_entry_t *pte;
+   u_long res;
int i;
 
KERNend = *firstaddr;
+   res = atop(KERNend - (vm_paddr_t)kernphys);
 
if (!pti)
pg_g = X86_PG_G;
@@ -1038,10 +1040,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt));
 
virtual_avail = (vm_offset_t) KERNBASE + *firstaddr;
-
virtual_end = VM_MAX_KERNEL_ADDRESS;
 
-
/* XXX do %cr0 as well */
load_cr4(rcr4() | CR4_PGE);
load_cr3(KPML4phys);
@@ -1050,6 +1050,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 
/*
 * Initialize the kernel pmap (which is statically allocated).
+* Count bootstrap data as being resident in case any of this data is
+* later unmapped (using pmap_remove()) and freed.
 */
PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys);
@@ -1057,6 +1059,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
kernel_pmap->pm_ucr3 = PMAP_NO_CR3;
CPU_FILL(_pmap->pm_active);  /* don't allow deactivation */
TAILQ_INIT(_pmap->pm_pvchunk);
+   kernel_pmap->pm_stats.resident_count = res;
kernel_pmap->pm_flags = pmap_flags;
 
/*

Modified: stable/11/sys/i386/i386/pmap.c
==
--- stable/11/sys/i386/i386/pmap.c  Wed May 15 15:11:49 2019
(r347615)
+++ stable/11/sys/i386/i386/pmap.c  Wed May 15 15:49:29 2019
(r347616)
@@ -377,8 +377,11 @@ pmap_bootstrap(vm_paddr_t firstaddr)
vm_offset_t va;
pt_entry_t *pte, *unused;
struct pcpu *pc;
+   u_long res;
int i;
 
+   res = atop(firstaddr - (vm_paddr_t)KERNLOAD);
+
/*
 * Add a physical memory segment (vm_phys_seg) corresponding to the
 * preallocated kernel page table pages so that vm_page structures
@@ -396,11 +399,12 @@ pmap_bootstrap(vm_paddr_t firstaddr)
 * unused virtual address in addition to "firstaddr".
 */
virtual_avail = (vm_offset_t) KERNBASE + firstaddr;
-
virtual_end = VM_MAX_KERNEL_ADDRESS;
 
/*
 * Initialize the kernel pmap (which is statically allocated).
+* Count bootstrap data as being resident in case any of this data is
+* later unmapped (using pmap_remove()) and freed.
 */
PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_pdir = (pd_entry_t *) (KERNBASE + (u_int)IdlePTD);
@@ -408,6 +412,7 @@ pmap_bootstrap(vm_paddr_t firstaddr)
kernel_pmap->pm_pdpt = (pdpt_entry_t *) (KERNBASE + (u_int)IdlePDPT);
 #endif
CPU_FILL(_pmap->pm_active);  /* don't allow deactivation */
+   kernel_pmap->pm_stats.resident_count = res;
TAILQ_INIT(_pmap->pm_pvchunk);
 
/*
___
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: r347615 - head

2019-05-15 Thread Antoine Brodin
Author: antoine
Date: Wed May 15 15:11:49 2019
New Revision: 347615
URL: https://svnweb.freebsd.org/changeset/base/347615

Log:
  Add more obsolete files.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed May 15 15:03:55 2019(r347614)
+++ head/ObsoleteFiles.inc  Wed May 15 15:11:49 2019(r347615)
@@ -43,6 +43,8 @@ OLD_FILES+=lib/casper/libcap_sysctl.1
 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package.
 OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py
 OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc
+# 20190326: tzdata 2019a import
+OLD_FILES+=usr/share/zoneinfo/Etc/UCT
 # 20190304: new libc++ import which bumps version from 7.0.1 to 8.0.0.
 OLD_FILES+=usr/include/c++/v1/experimental/dynarray
 # 20190304: new clang import which bumps version from 7.0.1 to 8.0.0.
@@ -201,16 +203,21 @@ OLD_FILES+=usr/include/sys/seq.h
 OLD_FILES+=usr/lib/libprivateifconfig.a
 OLD_FILES+=usr/lib/libprivateifconfig_p.a
 # 20190131: pfil(9) changed
-OLD_FILES+=usr/share/man/man9/pfil_hook_get.9
-OLD_FILES+=usr/share/man/man9/pfil_rlock.9
-OLD_FILES+=usr/share/man/man9/pfil_runlock.9
-OLD_FILES+=usr/share/man/man9/pfil_wlock.9
-OLD_FILES+=usr/share/man/man9/pfil_wunlock.9
+OLD_FILES+=usr/share/man/man9/pfil_hook_get.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_rlock.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_runlock.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_wlock.9.gz
+OLD_FILES+=usr/share/man/man9/pfil_wunlock.9.gz
 # 20190126: adv(4) / adw(4) removal
 OLD_FILES+=usr/share/man/man4/adv.4.gz
 OLD_FILES+=usr/share/man/man4/adw.4.gz
+# 20190123: nonexistant cred_update_thread(9) removed
+OLD_FILES+=usr/share/man/man9/cred_update_thread.9.gz
 # 20190114: old pbuf allocator removed
+OLD_FILES+=usr/share/man/man9/getpbuf.9.gz
 OLD_FILES+=usr/share/man/man9/pbuf.9.gz
+OLD_FILES+=usr/share/man/man9/relpbuf.9.gz
+OLD_FILES+=usr/share/man/man9/trypbuf.9.gz
 # 20181219: ibcs removal
 OLD_FILES+=usr/share/examples/ibcs2/hello.uu
 OLD_FILES+=usr/share/examples/ibcs2/README
___
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: r347614 - stable/11/release/doc/share/xml

2019-05-15 Thread Glen Barber
Author: gjb
Date: Wed May 15 15:03:55 2019
New Revision: 347614
URL: https://svnweb.freebsd.org/changeset/base/347614

Log:
  Document EN-19:08 through EN-19:10, SA-19:03 through SA-19:07.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: stable/11/release/doc/share/xml/errata.xml
==
--- stable/11/release/doc/share/xml/errata.xml  Wed May 15 08:39:16 2019
(r347613)
+++ stable/11/release/doc/share/xml/errata.xml  Wed May 15 15:03:55 2019
(r347614)
@@ -126,6 +126,22 @@
kqueue race condition and kernel
panic
   
+
+  
+   FreeBSD-EN-19:08.tzdata
+   14May2019
+   Timezone database information
+   update
+  
+
+  
+   FreeBSD-EN-19:09.xinstall
+   14May2019
+broken with partially matching
+   relative paths
+  
 
   
 

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlWed May 15 08:39:16 
2019(r347613)
+++ stable/11/release/doc/share/xml/security.xmlWed May 15 15:03:55 
2019(r347614)
@@ -92,6 +92,44 @@
File description reference count
leak
   
+
+  
+   FreeBSD-SA-19:03.wpa
+   14May2019
+   Multiple vulnerabilities
+  
+
+  
+   FreeBSD-SA-19:04.ntp
+   14May2019
+   Authenticated denial of service in
+   
+  
+
+  
+   FreeBSD-SA-19:05.pf
+   14May2019
+   IPv6 fragment reassembly panic in
+   
+  
+
+  
+   FreeBSD-SA-19:06.pf
+   14May2019
+   ICMP/ICMP6 packet filter bypass in
+   
+  
+
+  
+   FreeBSD-SA-19:07.mds
+   14May2019
+   Microarchitectural Data Sampling
+  
 
   
 
___
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"


Guest post request

2019-05-15 Thread ali luffman
Good day,

I hope that this mail finds you well. 

The reason for this mail is to inquire if you are interested in hosting a 
sponsored or guest blog post on your unique website? 

Currently, we are searching for clients that are willing be get paid to host 
these relevant blog posts. Our content is guaranteed to be of the 
highest-quality and will be embedded with a Do-follow link that is completely 
relevant to your specific website.

We are an agency that is seeking to find and nurture a long-term and 
sustainable working relationship, which will be beneficial to all parties 
involved. 

Please would you let me know how much you will be charging per post, and if 
payment via either PayPal or Payoneer would suit you once the article has been 
published. 

I thank you for your time and look forward to our future correspondence.

Best Regards

Thanks,

---
This email has been checked for viruses by AVG.
https://www.avg.com

___
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: r347613 - stable/11/sys/netinet6

2019-05-15 Thread Michael Tuexen
Author: tuexen
Date: Wed May 15 08:39:16 2019
New Revision: 347613
URL: https://svnweb.freebsd.org/changeset/base/347613

Log:
  MFC r337738:
  Use a macro to set the assoc state.

Modified:
  stable/11/sys/netinet6/sctp6_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/sctp6_usrreq.c
==
--- stable/11/sys/netinet6/sctp6_usrreq.c   Wed May 15 08:15:44 2019
(r347612)
+++ stable/11/sys/netinet6/sctp6_usrreq.c   Wed May 15 08:39:16 2019
(r347613)
@@ -924,7 +924,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr
/* Set the connected flag so we can queue data */
soisconnecting(so);
}
-   stcb->asoc.state = SCTP_STATE_COOKIE_WAIT;
+   SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT);
(void)SCTP_GETTIME_TIMEVAL(>asoc.time_entered);
 
/* initialize authentication parameters for the assoc */
___
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: r347612 - stable/12/sys/dev/cpuctl

2019-05-15 Thread Konstantin Belousov
Author: kib
Date: Wed May 15 08:15:44 2019
New Revision: 347612
URL: https://svnweb.freebsd.org/changeset/base/347612

Log:
  MFC r347368:
  x86: Put other CPUs into tight loop when updating Intel microcode from
  loaded OS.

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

Modified: stable/12/sys/dev/cpuctl/cpuctl.c
==
--- stable/12/sys/dev/cpuctl/cpuctl.c   Wed May 15 07:51:35 2019
(r347611)
+++ stable/12/sys/dev/cpuctl/cpuctl.c   Wed May 15 08:15:44 2019
(r347612)
@@ -330,9 +330,26 @@ cpuctl_do_update(int cpu, cpuctl_update_args_t *data, 
return (ret);
 }
 
+struct ucode_update_data {
+   void *ptr;
+   int cpu;
+   int ret;
+};
+
+static void
+ucode_intel_load_rv(void *arg)
+{
+   struct ucode_update_data *d;
+
+   d = arg;
+   if (PCPU_GET(cpuid) == d->cpu)
+   d->ret = ucode_intel_load(d->ptr, true, NULL, NULL);
+}
+
 static int
 update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
+   struct ucode_update_data d;
void *ptr;
int is_bound, oldcpu, ret;
 
@@ -360,12 +377,11 @@ update_intel(int cpu, cpuctl_update_args_t *args, stru
oldcpu = td->td_oncpu;
is_bound = cpu_sched_is_bound(td);
set_cpu(cpu, td);
-   critical_enter();
-
-   ret = ucode_intel_load(ptr, true, NULL, NULL);
-
-   critical_exit();
+   d.ptr = ptr;
+   d.cpu = cpu;
+   smp_rendezvous(NULL, ucode_intel_load_rv, NULL, );
restore_cpu(oldcpu, is_bound, td);
+   ret = d.ret;
 
/*
 * Replace any existing update.  This ensures that the new update
___
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: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Konstantin Belousov
On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote:
> вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :
> 
> > Author: kib
> > Date: Tue May 14 17:02:20 2019
> > New Revision: 347566
> > URL: https://svnweb.freebsd.org/changeset/base/347566
> >
> > Log:
> >   Mitigations for Microarchitectural Data Sampling.
> >
> >   Microarchitectural buffers on some Intel processors utilizing
> >   speculative execution may allow a local process to obtain a memory
> >   disclosure.  An attacker may be able to read secret data from the
> >   kernel or from a process when executing untrusted code (for example,
> >   in a web browser).
> >
> >   Reference:
> > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
> >   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> > CVE-2019-11091
> >   Security: FreeBSD-SA-19:07.mds
> >   Reviewed by:  jhb
> >   Tested by:emaste, lwhsu
> >   Approved by:  so (gtetlow)
> >
> > Modified:
> >   head/sys/amd64/amd64/exception.S
> >   head/sys/amd64/amd64/genassym.c
> >   head/sys/amd64/amd64/initcpu.c
> >   head/sys/amd64/amd64/machdep.c
> >   head/sys/amd64/amd64/support.S
> >
> 
> 
> 
> Hi, Kostik!
> 
> cc -target x86_64-unknown-freebsd13.0
> --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
> -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
> assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
> -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
> -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
> -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
> -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
> -MF.depend.support.o -MTsupport.o
> -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
> -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include -mcmodel=kernel
> -mno-red-zone -mno-mmx -mno-sse -msoft-float
> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign
> -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
> -fdiagnostics-show-option -Wno-unknown-pragmas
> -Wno-error-tautological-compare -Wno-error-empty-body
> -Wno-error-parentheses-equality -Wno-error-unused-function
> -Wno-error-pointer-sign -Wno-error-shift-negative-value
> -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
> -Werror /home/dchagin/head/sys/amd64/amd64/support.S
> /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
> requires: AVX-512 ISA
>  vmovdqa64 %zmm0, %gs:0x340
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
> requires: AVX-512 ISA
>  vpxor %zmm0, %zmm0, %zmm0
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
> requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
> requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
> requires: AVX-512 ISA
>  vmovdqa64 %gs:0x340, %zmm0
>  ^
> *** Error code 1
> 
> 
> I/m missied something?
Yes, you are using older compiler than current.  Perhaps you are using
clang 6.0 still.  Update your world.

FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0
patches. I do not want to put such abomination into live code base,
remembering aesni.ko.
___
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: r347610 - in stable/11/usr.sbin/lpr: common_source lpc

2019-05-15 Thread Enji Cooper
Author: ngie
Date: Wed May 15 07:51:30 2019
New Revision: 347610
URL: https://svnweb.freebsd.org/changeset/base/347610

Log:
  MFC r320009,r347075:
  
  r320009 (by sbruno):
  
  Quiesce clang warning while building lpc.
  
  usr.sbin/lpr/lpc/lpc.c
Warning
  passing 'char *[20]' to parameter of type 'const char **' discards
  qualifiers in nested pointer types
  [-Wincompatible-pointer-types-discards-qualifiers]
Fix:
   Explicitly cast the variable "margv" to const char ** only for it's
   use as a parameter to suppress the error
  
  r347075:
  
  Fix `clang -Wcast-qual` issues
  
  Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and
  deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb`
  variable.
  
  This unblocks ^/projects/runtime-coverage-v2 from building cleanly on
  universe13a.freebsd.org. I suspect the issue was introduced through some
  changes to `bsd.*.mk` inclusion on the branch, which I will continue to
  investigate/isolate.
  
  Tested with:  clang 8 (arm64)

Modified:
  stable/11/usr.sbin/lpr/common_source/printcap.c
  stable/11/usr.sbin/lpr/lpc/lpc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/lpr/common_source/printcap.c
==
--- stable/11/usr.sbin/lpr/common_source/printcap.c Wed May 15 07:46:17 
2019(r347609)
+++ stable/11/usr.sbin/lpr/common_source/printcap.c Wed May 15 07:51:30 
2019(r347610)
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
 /*
  * Routines and data used in processing the printcap file.
  */
-static char *printcapdb[2] = { _PATH_PRINTCAP, 0 };  /* list for cget* */
+static char*printcapdb[] = { __DECONST(char *, _PATH_PRINTCAP), NULL };
 
 static char*capdb_canonical_name(const char *_bp);
 static int  capdb_getaltlog(char *_bp, const char *_shrt,
@@ -97,15 +97,9 @@ int
 getprintcap(const char *printer, struct printer *pp)
 {
int status;
-   char *XXX;
char *bp;
 
-   /*
-* A bug in the declaration of cgetent(3) means that we have
-* to hide the constness of its third argument.
-*/
-   XXX = (char *)printer;
-   if ((status = cgetent(, printcapdb, XXX)) < 0)
+   if ((status = cgetent(, printcapdb, printer)) < 0)
return status;
status = getprintcap_int(bp, pp);
free(bp);
@@ -378,10 +372,10 @@ capdb_getaltstr(char *bp, const char *shrt, const char
 {
int status;
 
-   status = cgetstr(bp, (char *)/*XXX*/lng, result);
+   status = cgetstr(bp, lng, result);
if (status >= 0 || status == PCAPERR_OSERR)
return status;
-   status = cgetstr(bp, (char *)/*XXX*/shrt, result);
+   status = cgetstr(bp, shrt, result);
if (status >= 0 || status == PCAPERR_OSERR)
return status;
if (dflt) {
@@ -402,10 +396,10 @@ capdb_getaltnum(char *bp, const char *shrt, const char
 {
int status;
 
-   status = cgetnum(bp, (char *)/*XXX*/lng, result);
+   status = cgetnum(bp, lng, result);
if (status >= 0)
return status;
-   status = cgetnum(bp, (char *)/*XXX*/shrt, result);
+   status = cgetnum(bp, shrt, result);
if (status >= 0)
return status;
*result = dflt;
@@ -419,9 +413,9 @@ capdb_getaltnum(char *bp, const char *shrt, const char
 static int
 capdb_getaltlog(char *bp, const char *shrt, const char *lng)
 {
-   if (cgetcap(bp, (char *)/*XXX*/lng, ':'))
+   if (cgetcap(bp, lng, ':'))
return 1;
-   if (cgetcap(bp, (char *)/*XXX*/shrt, ':'))
+   if (cgetcap(bp, shrt, ':'))
return 1;
return 0;
 }

Modified: stable/11/usr.sbin/lpr/lpc/lpc.c
==
--- stable/11/usr.sbin/lpr/lpc/lpc.cWed May 15 07:46:17 2019
(r347609)
+++ stable/11/usr.sbin/lpr/lpc/lpc.cWed May 15 07:51:30 2019
(r347610)
@@ -197,7 +197,7 @@ cmdscanner(void)
makeargv();
if (margc == 0)
continue;
-   if (el != NULL && el_parse(el, margc, margv) != -1)
+   if (el != NULL && el_parse(el, margc, (const char **)margv) != 
-1)
continue;
 
c = getcmd(margv[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: r347611 - stable/12/usr.sbin/lpr/common_source

2019-05-15 Thread Enji Cooper
Author: ngie
Date: Wed May 15 07:51:35 2019
New Revision: 347611
URL: https://svnweb.freebsd.org/changeset/base/347611

Log:
  MFC r347075:
  
  Fix `clang -Wcast-qual` issues
  
  Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and
  deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb`
  variable.
  
  This unblocks ^/projects/runtime-coverage-v2 from building cleanly on
  universe13a.freebsd.org. I suspect the issue was introduced through some
  changes to `bsd.*.mk` inclusion on the branch, which I will continue to
  investigate/isolate.
  
  Tested with:  clang 8 (arm64)

Modified:
  stable/12/usr.sbin/lpr/common_source/printcap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/lpr/common_source/printcap.c
==
--- stable/12/usr.sbin/lpr/common_source/printcap.c Wed May 15 07:51:30 
2019(r347610)
+++ stable/12/usr.sbin/lpr/common_source/printcap.c Wed May 15 07:51:35 
2019(r347611)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 /*
  * Routines and data used in processing the printcap file.
  */
-static char *printcapdb[2] = { _PATH_PRINTCAP, 0 };  /* list for cget* */
+static char*printcapdb[] = { __DECONST(char *, _PATH_PRINTCAP), NULL };
 
 static char*capdb_canonical_name(const char *_bp);
 static int  capdb_getaltlog(char *_bp, const char *_shrt,
@@ -99,15 +99,9 @@ int
 getprintcap(const char *printer, struct printer *pp)
 {
int status;
-   char *XXX;
char *bp;
 
-   /*
-* A bug in the declaration of cgetent(3) means that we have
-* to hide the constness of its third argument.
-*/
-   XXX = (char *)printer;
-   if ((status = cgetent(, printcapdb, XXX)) < 0)
+   if ((status = cgetent(, printcapdb, printer)) < 0)
return status;
status = getprintcap_int(bp, pp);
free(bp);
@@ -380,10 +374,10 @@ capdb_getaltstr(char *bp, const char *shrt, const char
 {
int status;
 
-   status = cgetstr(bp, (char *)/*XXX*/lng, result);
+   status = cgetstr(bp, lng, result);
if (status >= 0 || status == PCAPERR_OSERR)
return status;
-   status = cgetstr(bp, (char *)/*XXX*/shrt, result);
+   status = cgetstr(bp, shrt, result);
if (status >= 0 || status == PCAPERR_OSERR)
return status;
if (dflt) {
@@ -404,10 +398,10 @@ capdb_getaltnum(char *bp, const char *shrt, const char
 {
int status;
 
-   status = cgetnum(bp, (char *)/*XXX*/lng, result);
+   status = cgetnum(bp, lng, result);
if (status >= 0)
return status;
-   status = cgetnum(bp, (char *)/*XXX*/shrt, result);
+   status = cgetnum(bp, shrt, result);
if (status >= 0)
return status;
*result = dflt;
@@ -421,9 +415,9 @@ capdb_getaltnum(char *bp, const char *shrt, const char
 static int
 capdb_getaltlog(char *bp, const char *shrt, const char *lng)
 {
-   if (cgetcap(bp, (char *)/*XXX*/lng, ':'))
+   if (cgetcap(bp, lng, ':'))
return 1;
-   if (cgetcap(bp, (char *)/*XXX*/shrt, ':'))
+   if (cgetcap(bp, shrt, ':'))
return 1;
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"


Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86

2019-05-15 Thread Dmitry Chagin
вт, 14 мая 2019 г. в 20:02, Konstantin Belousov :

> Author: kib
> Date: Tue May 14 17:02:20 2019
> New Revision: 347566
> URL: https://svnweb.freebsd.org/changeset/base/347566
>
> Log:
>   Mitigations for Microarchitectural Data Sampling.
>
>   Microarchitectural buffers on some Intel processors utilizing
>   speculative execution may allow a local process to obtain a memory
>   disclosure.  An attacker may be able to read secret data from the
>   kernel or from a process when executing untrusted code (for example,
>   in a web browser).
>
>   Reference:
> https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
>   Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
> CVE-2019-11091
>   Security: FreeBSD-SA-19:07.mds
>   Reviewed by:  jhb
>   Tested by:emaste, lwhsu
>   Approved by:  so (gtetlow)
>
> Modified:
>   head/sys/amd64/amd64/exception.S
>   head/sys/amd64/amd64/genassym.c
>   head/sys/amd64/amd64/initcpu.c
>   head/sys/amd64/amd64/machdep.c
>   head/sys/amd64/amd64/support.S
>



Hi, Kostik!

cc -target x86_64-unknown-freebsd13.0
--sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp
-B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x
assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc
-I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include
-I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL
-DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
-MF.depend.support.o -MTsupport.o
-fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include
-fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include -mcmodel=kernel
-mno-red-zone -mno-mmx -mno-sse -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
-gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign
-D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
-fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equality -Wno-error-unused-function
-Wno-error-pointer-sign -Wno-error-shift-negative-value
-Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999
-Werror /home/dchagin/head/sys/amd64/amd64/support.S
/home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction
requires: AVX-512 ISA
 vmovdqa64 %zmm0, %gs:0x340
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction
requires: AVX-512 ISA
 vpxor %zmm0, %zmm0, %zmm0
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction
requires: AVX-512 DQ ISA
 vorpd (%rdx), %zmm0, %zmm0
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction
requires: AVX-512 DQ ISA
 vorpd (%rdx), %zmm0, %zmm0
 ^
/home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction
requires: AVX-512 ISA
 vmovdqa64 %gs:0x340, %zmm0
 ^
*** Error code 1


I/m missied something?
___
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"