svn commit: r352548 - head/stand/libsa

2019-09-19 Thread Toomas Soome
Author: tsoome
Date: Fri Sep 20 05:22:34 2019
New Revision: 352548
URL: https://svnweb.freebsd.org/changeset/base/352548

Log:
  loader: fix typo in zalloc.

Modified:
  head/stand/libsa/zalloc.c

Modified: head/stand/libsa/zalloc.c
==
--- head/stand/libsa/zalloc.c   Fri Sep 20 00:07:48 2019(r352547)
+++ head/stand/libsa/zalloc.c   Fri Sep 20 05:22:34 2019(r352548)
@@ -125,7 +125,8 @@ znalloc(MemPool *mp, uintptr_t bytes, size_t align)
continue;
 
/*
-* Cut extra from head and create new memory node from reminder.
+* Cut extra from head and create new memory node from
+* remainder.
 */
 
if (extra != 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: r352547 - in stable/12/sys: conf sys

2019-09-19 Thread Glen Barber
Author: gjb
Date: Fri Sep 20 00:07:48 2019
New Revision: 352547
URL: https://svnweb.freebsd.org/changeset/base/352547

Log:
  - Set stable/12 back to 'STABLE', now that all work on the 12.1 release
cycle will take place in the releng/12.1 branch.
  - Bump __FreeBSD_version.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/12/sys/conf/newvers.sh
  stable/12/sys/sys/param.h

Modified: stable/12/sys/conf/newvers.sh
==
--- stable/12/sys/conf/newvers.sh   Fri Sep 20 00:05:14 2019
(r352546)
+++ stable/12/sys/conf/newvers.sh   Fri Sep 20 00:07:48 2019
(r352547)
@@ -46,7 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.1"
-BRANCH="PRERELEASE"
+BRANCH="STABLE"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: stable/12/sys/sys/param.h
==
--- stable/12/sys/sys/param.h   Fri Sep 20 00:05:14 2019(r352546)
+++ stable/12/sys/sys/param.h   Fri Sep 20 00:07:48 2019(r352547)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200519  /* Master, propagated to newvers */
+#define __FreeBSD_version 1201500  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of 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"


svn commit: r352546 - in releng/12.1: release/pkg_repos sys/conf sys/sys usr.sbin/pkg

2019-09-19 Thread Glen Barber
Author: gjb
Date: Fri Sep 20 00:05:14 2019
New Revision: 352546
URL: https://svnweb.freebsd.org/changeset/base/352546

Log:
  - Copy stable/12@r352480 to releng/12.1 as part of the 12.1 release
cycle.
  - Update from PRERELEASE to BETA1.
  - Set the default pkg(7) repository to 'quarterly'.
  - Bump __FreeBSD_version.
  - Prune svn:mergeinfo from the new branch.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (Netgate)

Added:
 - copied from r352480, stable/12/
Directory Properties:
  releng/12.1/   (props changed)
Modified:
  releng/12.1/release/pkg_repos/release-dvd.conf
  releng/12.1/sys/conf/newvers.sh
  releng/12.1/sys/sys/param.h
  releng/12.1/usr.sbin/pkg/Makefile

Modified: releng/12.1/release/pkg_repos/release-dvd.conf
==
--- stable/12/release/pkg_repos/release-dvd.confWed Sep 18 07:31:31 
2019(r352480)
+++ releng/12.1/release/pkg_repos/release-dvd.conf  Fri Sep 20 00:05:14 
2019(r352546)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 release: {
-  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest;,
+  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly;,
   mirror_type: "srv",
   signature_type: "fingerprints",
   fingerprints: "/usr/share/keys/pkg",

Modified: releng/12.1/sys/conf/newvers.sh
==
--- stable/12/sys/conf/newvers.sh   Wed Sep 18 07:31:31 2019
(r352480)
+++ releng/12.1/sys/conf/newvers.sh Fri Sep 20 00:05:14 2019
(r352546)
@@ -46,7 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.1"
-BRANCH="PRERELEASE"
+BRANCH="BETA1"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/12.1/sys/sys/param.h
==
--- stable/12/sys/sys/param.h   Wed Sep 18 07:31:31 2019(r352480)
+++ releng/12.1/sys/sys/param.h Fri Sep 20 00:05:14 2019(r352546)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200519  /* Master, propagated to newvers */
+#define __FreeBSD_version 1201000  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Modified: releng/12.1/usr.sbin/pkg/Makefile
==
--- stable/12/usr.sbin/pkg/Makefile Wed Sep 18 07:31:31 2019
(r352480)
+++ releng/12.1/usr.sbin/pkg/Makefile   Fri Sep 20 00:05:14 2019
(r352546)
@@ -2,8 +2,15 @@
 
 .if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
 PKGCONFBRANCH?=quarterly
-.endif
+.else
+_BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
+BRANCH?=   ${_BRANCH}
+. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
+PKGCONFBRANCH?=quarterly
+. else
 PKGCONFBRANCH?=latest
+. endif
+.endif
 CONFS= FreeBSD.conf.${PKGCONFBRANCH}
 CONFSNAME= FreeBSD.conf
 CONFSDIR=  /etc/pkg
___
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: r352545 - in stable/12: share/man/man4 sys/dev/rtwn/usb sys/dev/usb

2019-09-19 Thread Jung-uk Kim
Author: jkim
Date: Thu Sep 19 22:39:13 2019
New Revision: 352545
URL: https://svnweb.freebsd.org/changeset/base/352545

Log:
  MFC:  r351653
  
  Add support for TP-Link Archer T2U Nano.

Modified:
  stable/12/share/man/man4/rtwn_usb.4
  stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h
  stable/12/sys/dev/usb/usbdevs
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/rtwn_usb.4
==
--- stable/12/share/man/man4/rtwn_usb.4 Thu Sep 19 22:15:57 2019
(r352544)
+++ stable/12/share/man/man4/rtwn_usb.4 Thu Sep 19 22:39:13 2019
(r352545)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd February 2, 2019
+.Dd September 1, 2019
 .Dt RTWN_USB 4
 .Os
 .Sh NAME
@@ -94,6 +94,7 @@ based USB wireless network adapters, including:
 .It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0
 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0
 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0
+.It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0
 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0

Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h
==
--- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.hThu Sep 19 22:15:57 
2019(r352544)
+++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.hThu Sep 19 22:39:13 
2019(r352545)
@@ -158,7 +158,8 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8821AU_DEV(MELCO,   WIU2433DM),
RTWN_RTL8821AU_DEV(NETGEAR, A6100),
RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_1),
-   RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2)
+   RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2),
+   RTWN_RTL8821AU_DEV(TPLINK,  T2UNANO)
 #undef RTWN_RTL8821AU_DEV
 };
 

Modified: stable/12/sys/dev/usb/usbdevs
==
--- stable/12/sys/dev/usb/usbdevs   Thu Sep 19 22:15:57 2019
(r352544)
+++ stable/12/sys/dev/usb/usbdevs   Thu Sep 19 22:39:13 2019
(r352545)
@@ -4661,6 +4661,7 @@ product TPLINK WN722NV2   0x010c  TL-WN722N v2
 product TPLINK T4UV2   0x010d  Archer T4U ver 2
 product TPLINK T4UHV1  0x0103  Archer T4UH ver 1
 product TPLINK T4UHV2  0x010e  Archer T4UH ver 2
+product TPLINK T2UNANO 0x011e  Archer T2U Nano
 product TPLINK RTL8153 0x0601  RTL8153 USB 10/100/1000 LAN
 
 /* Trek Technology products */
___
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: r352544 - head/sys/dev/ioat

2019-09-19 Thread Alexander Motin
Author: mav
Date: Thu Sep 19 22:15:57 2019
New Revision: 352544
URL: https://svnweb.freebsd.org/changeset/base/352544

Log:
  Improve ioat(4) NUMA-awareness.
  
  Allocate ioat->ring memory from the device domain.
  Schedule ioat->poll_timer to the first CPU of the device domain.
  
  According to pcm-numa tool from intel-pcm port, this reduces number of
  remote DRAM accesses while copying data by 75%.  And unless it is a noise,
  I've noticed some speed improvement when copying data to other domain.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cThu Sep 19 21:23:14 2019(r352543)
+++ head/sys/dev/ioat/ioat.cThu Sep 19 22:15:57 2019(r352544)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -266,6 +268,11 @@ ioat_attach(device_t device)
 
ioat = DEVICE2SOFTC(device);
ioat->device = device;
+   if (bus_get_domain(device, >domain) != 0)
+   ioat->domain = 0;
+   ioat->cpu = CPU_FFS(_domain[ioat->domain]) - 1;
+   if (ioat->cpu < 0)
+   ioat->cpu = CPU_FIRST();
 
error = ioat_map_pci_bar(ioat);
if (error != 0)
@@ -600,8 +607,8 @@ ioat3_attach(device_t device)
__func__, error);
return (error);
}
-   ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT,
-   M_ZERO | M_WAITOK);
+   ioat->ring = malloc_domainset(num_descriptors * sizeof(*ring), M_IOAT,
+   DOMAINSET_PREF(ioat->domain), M_ZERO | M_WAITOK);
 
ring = ioat->ring;
for (i = 0; i < num_descriptors; i++) {
@@ -1107,8 +1114,8 @@ ioat_release(bus_dmaengine_t dmaengine)
(uint16_t)ioat->head);
 
if (!callout_pending(>poll_timer)) {
-   callout_reset(>poll_timer, 1,
-   ioat_poll_timer_callback, ioat);
+   callout_reset_on(>poll_timer, 1,
+   ioat_poll_timer_callback, ioat, ioat->cpu);
}
}
mtx_unlock(>submit_lock);
@@ -1644,7 +1651,7 @@ ioat_free_ring(struct ioat_softc *ioat, uint32_t size,
 struct ioat_descriptor *ring)
 {
 
-   free(ring, M_IOAT);
+   free_domain(ring, M_IOAT);
 }
 
 static struct ioat_descriptor *

Modified: head/sys/dev/ioat/ioat_internal.h
==
--- head/sys/dev/ioat/ioat_internal.h   Thu Sep 19 21:23:14 2019
(r352543)
+++ head/sys/dev/ioat/ioat_internal.h   Thu Sep 19 22:15:57 2019
(r352544)
@@ -442,6 +442,8 @@ struct ioat_softc {
 })
 
device_tdevice;
+   int domain;
+   int cpu;
int version;
unsignedchan_idx;
 
___
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: r352543 - in head/sys: kern sys

2019-09-19 Thread Mateusz Guzik
Author: mjg
Date: Thu Sep 19 21:23:14 2019
New Revision: 352543
URL: https://svnweb.freebsd.org/changeset/base/352543

Log:
  vfs: group fields used for per-cpu ops in one cacheline
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_mount.c
  head/sys/sys/mount.h

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Thu Sep 19 21:13:51 2019(r352542)
+++ head/sys/kern/vfs_mount.c   Thu Sep 19 21:23:14 2019(r352543)
@@ -157,7 +157,7 @@ vfs_mount_init(void *dummy __unused)
 {
 
mount_zone = uma_zcreate("Mountpoints", sizeof(struct mount), NULL,
-   NULL, mount_init, mount_fini, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+   NULL, mount_init, mount_fini, UMA_ALIGN_CACHE, UMA_ZONE_NOFREE);
 }
 SYSINIT(vfs_mount, SI_SUB_VFS, SI_ORDER_ANY, vfs_mount_init, NULL);
 

Modified: head/sys/sys/mount.h
==
--- head/sys/sys/mount.hThu Sep 19 21:13:51 2019(r352542)
+++ head/sys/sys/mount.hThu Sep 19 21:23:14 2019(r352543)
@@ -226,7 +226,7 @@ struct mount {
struct lock mnt_explock;/* vfs_export walkers lock */
TAILQ_ENTRY(mount) mnt_upper_link;  /* (m) we in the all uppers */
TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/
-   int mnt_vfs_ops;/* (i) pending vfs ops */
+   int __aligned(CACHE_LINE_SIZE)  mnt_vfs_ops;/* (i) pending vfs ops */
int *mnt_thread_in_ops_pcpu;
int *mnt_ref_pcpu;
int *mnt_lockref_pcpu;
___
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: r352542 - head/usr.sbin/freebsd-update

2019-09-19 Thread Michael Gmelin
Author: grembo (ports committer)
Date: Thu Sep 19 21:13:51 2019
New Revision: 352542
URL: https://svnweb.freebsd.org/changeset/base/352542

Log:
  Fix src component detection
  
  Reviewed by:  emaste
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D21579

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Thu Sep 19 20:45:23 
2019(r352541)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Thu Sep 19 21:13:51 
2019(r352542)
@@ -221,6 +221,14 @@ config_KeepModifiedMetadata () {
 # Add to the list of components which should be kept updated.
 config_Components () {
for C in $@; do
+   COMPONENTS="${COMPONENTS} ${C}"
+   done
+}
+
+# Remove src component from list if it isn't installed
+finalize_components_config () {
+   COMPONENTS=""
+   for C in $@; do
if [ "$C" = "src" ]; then
if [ -e "${BASEDIR}/usr/src/COPYRIGHT" ]; then
COMPONENTS="${COMPONENTS} ${C}"
@@ -3284,6 +3292,7 @@ get_params () {
parse_cmdline $@
parse_conffile
default_params
+   finalize_components_config ${COMPONENTS}
 }
 
 # Fetch command.  Make sure that we're being called
___
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: r352541 - stable/12/sys/amd64/amd64

2019-09-19 Thread Alan Cox
Author: alc
Date: Thu Sep 19 20:45:23 2019
New Revision: 352541
URL: https://svnweb.freebsd.org/changeset/base/352541

Log:
  MF r349585
Tidy up pmap_copy().  Notably, deindent the innermost loop by making a
simple change to the control flow.  Replace an unnecessary test by a
KASSERT.  Add a comment explaining an obscure test.

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

Modified: stable/12/sys/amd64/amd64/pmap.c
==
--- stable/12/sys/amd64/amd64/pmap.cThu Sep 19 20:16:51 2019
(r352540)
+++ stable/12/sys/amd64/amd64/pmap.cThu Sep 19 20:45:23 2019
(r352541)
@@ -6355,18 +6355,18 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t 
  *
  * This routine is only advisory and need not do anything.
  */
-
 void
 pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t 
len,
 vm_offset_t src_addr)
 {
struct rwlock *lock;
struct spglist free;
-   vm_offset_t addr;
-   vm_offset_t end_addr = src_addr + len;
-   vm_offset_t va_next;
+   pml4_entry_t *pml4e;
+   pdp_entry_t *pdpe;
+   pd_entry_t *pde, srcptepaddr;
+   pt_entry_t *dst_pte, PG_A, PG_M, PG_V, ptetemp, *src_pte;
+   vm_offset_t addr, end_addr, va_next;
vm_page_t dst_pdpg, dstmpte, srcmpte;
-   pt_entry_t PG_A, PG_M, PG_V;
 
if (dst_addr != src_addr)
return;
@@ -6385,6 +6385,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_
if (pmap_emulate_ad_bits(dst_pmap))
return;
 
+   end_addr = src_addr + len;
lock = NULL;
if (dst_pmap < src_pmap) {
PMAP_LOCK(dst_pmap);
@@ -6399,11 +6400,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_
PG_V = pmap_valid_bit(dst_pmap);
 
for (addr = src_addr; addr < end_addr; addr = va_next) {
-   pt_entry_t *src_pte, *dst_pte;
-   pml4_entry_t *pml4e;
-   pdp_entry_t *pdpe;
-   pd_entry_t srcptepaddr, *pde;
-
KASSERT(addr < UPT_MIN_ADDRESS,
("pmap_copy: invalid to pmap_copy page tables"));
 
@@ -6445,7 +6441,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_
pmap_pv_insert_pde(dst_pmap, addr, srcptepaddr,
PMAP_ENTER_NORECLAIM, ))) {
*pde = srcptepaddr & ~PG_W;
-   pmap_resident_count_inc(dst_pmap, NBPDR / 
PAGE_SIZE);
+   pmap_resident_count_inc(dst_pmap, NBPDR /
+   PAGE_SIZE);
atomic_add_long(_pde_mappings, 1);
} else
dst_pdpg->wire_count--;
@@ -6463,58 +6460,54 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_
src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr);
src_pte = _pte[pmap_pte_index(addr)];
dstmpte = NULL;
-   while (addr < va_next) {
-   pt_entry_t ptetemp;
+   for (; addr < va_next; addr += PAGE_SIZE, src_pte++) {
ptetemp = *src_pte;
+
/*
-* we only virtual copy managed pages
+* We only virtual copy managed pages.
 */
-   if ((ptetemp & PG_MANAGED) != 0) {
-   if (dstmpte != NULL &&
-   dstmpte->pindex == pmap_pde_pindex(addr))
-   dstmpte->wire_count++;
-   else if ((dstmpte = pmap_allocpte(dst_pmap,
-   addr, NULL)) == NULL)
-   goto out;
-   dst_pte = (pt_entry_t *)
-   PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte));
-   dst_pte = _pte[pmap_pte_index(addr)];
-   if (*dst_pte == 0 &&
-   pmap_try_insert_pv_entry(dst_pmap, addr,
-   PHYS_TO_VM_PAGE(ptetemp & PG_FRAME),
-   )) {
+   if ((ptetemp & PG_MANAGED) == 0)
+   continue;
+
+   if (dstmpte != NULL) {
+   KASSERT(dstmpte->pindex ==
+   pmap_pde_pindex(addr),
+   ("dstmpte pindex/addr mismatch"));
+   dstmpte->wire_count++;
+   } else if ((dstmpte = pmap_allocpte(dst_pmap, addr,
+   NULL)) == NULL)
+   goto out;
+   dst_pte = (pt_entry_t *)
+ 

svn commit: r352540 - head/contrib/ntp/ntpd

2019-09-19 Thread Cy Schubert
Author: cy
Date: Thu Sep 19 20:16:51 2019
New Revision: 352540
URL: https://svnweb.freebsd.org/changeset/base/352540

Log:
  Follow up on r352304 which disabled default mlockall() at startup.
  Unfortunately though the original tarball supports this in ./configure
  (for Linux), to fully support disabling of mlockall() by default requires
  a little extra help otherwise the following is logged in syslog:
  
Cannot set RLIMIT_MEMLOCK: Operation not permitted
  
  MFC after:2 weeks
  X-MFC with:   r352304

Modified:
  head/contrib/ntp/ntpd/ntpd.c

Modified: head/contrib/ntp/ntpd/ntpd.c
==
--- head/contrib/ntp/ntpd/ntpd.cThu Sep 19 19:42:59 2019
(r352539)
+++ head/contrib/ntp/ntpd/ntpd.cThu Sep 19 20:16:51 2019
(r352540)
@@ -999,7 +999,7 @@ ntpdmain(
 # if defined(HAVE_MLOCKALL)
 #  ifdef HAVE_SETRLIMIT
ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
-#   ifdef RLIMIT_MEMLOCK
+#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && 
DFLT_RLIMIT_MEMLOCK != -1
/*
 * The default RLIMIT_MEMLOCK is very low on Linux systems.
 * Unless we increase this limit malloc calls are likely to
___
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: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd

2019-09-19 Thread Cy Schubert
In message , Dimitry 
Andric w
rites:
>
> On 19 Sep 2019, at 14:46, Cy Schubert  wrote:
> >=20
> > In message <4ccdcc18-6412-e606-4a74-314033a5f...@freebsd.org>, Dimitry =
> Andric writes:
> >> On 2019-09-13 22:20, Cy Schubert wrote:
> >>> Author: cy
> >>> Date: Fri Sep 13 20:20:05 2019
> >>> New Revision: 352304
> >>> URL: https://svnweb.freebsd.org/changeset/base/352304
> >>>=20
> >>> Log:
> >>>   No longer mlock() ntpd pages by default in memory thus allowing =
> its
> >>>   pages to page as necessary.
> >>>=20
> >>>   To restore historic BSD behaviour add the following to ntp.conf:
> >>>   rlimit memlock 32
> >>=20
> >> Apparently this does not completely work, as I still see:
> >>=20
> >> ntpd[824]: ntpd 4.2.8p12-a (1): Starting
> >> ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted
> >>=20
> >> even while my ntp.conf is almost entirely vanilla (it only has a
> >> different "server" line).
> >>=20
> >> Even explicitly adding:
> >>=20
> >> rlimit memlock -1
> >>=20
> >> does not work, it results in the same error.
> >>=20
> >> -Dimitry
> >=20
> > Can you try this please?
> >=20
> > diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
> > index 2b14431dc7b..bcfca27a535 100644
> > --- a/contrib/ntp/ntpd/ntpd.c
> > +++ b/contrib/ntp/ntpd/ntpd.c
> > @@ -999,7 +999,7 @@ ntpdmain(
> > # if defined(HAVE_MLOCKALL)
> > #  ifdef HAVE_SETRLIMIT
> > ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
> > -#   ifdef RLIMIT_MEMLOCK
> > +#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) &&
> > DFLT_RLIMIT_MEMLOCK !=3D -1
> > /*
> >  * The default RLIMIT_MEMLOCK is very low on Linux systems.
> >  * Unless we increase this limit malloc calls are likely to
>
> Yes, I already had something similar edited in (though I tested
> DLT_RLIMIT_MEMLOCK > 0), and that works for me.

That would work too, as it sets defaults before it reads the config file, 
which overrides the defaults.

I'll commit the fix and put a corresponding fix into both ports as well and 
let our upstrem know.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r352535 - stable/12/usr.sbin/pkg

2019-09-19 Thread Glen Barber
Author: gjb
Date: Thu Sep 19 18:50:42 2019
New Revision: 352535
URL: https://svnweb.freebsd.org/changeset/base/352535

Log:
  MFC r352520 (partial):
   The original commit was a direct commit to stable/12, as at the time it
   was presumed it would not be necessary for head.  However, when it is
   time to create a releng branch or switch from PRERELEASE/STABLE to
   BETA/RC, the pkg(7) Makefile needs further adjusting.  This commit
   includes those further adjustments, evaluating the BRANCH variable from
   release/Makefile to determine the pkg(7) repository to use.
  
  Approved by:  re (kib, insta-MFC)
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/12/usr.sbin/pkg/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/pkg/Makefile
==
--- stable/12/usr.sbin/pkg/Makefile Thu Sep 19 17:42:17 2019
(r352534)
+++ stable/12/usr.sbin/pkg/Makefile Thu Sep 19 18:50:42 2019
(r352535)
@@ -2,8 +2,15 @@
 
 .if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
 PKGCONFBRANCH?=quarterly
-.endif
+.else
+_BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
+BRANCH?=   ${_BRANCH}
+. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
+PKGCONFBRANCH?=quarterly
+. else
 PKGCONFBRANCH?=latest
+. endif
+.endif
 CONFS= FreeBSD.conf.${PKGCONFBRANCH}
 CONFSNAME= FreeBSD.conf
 CONFSDIR=  /etc/pkg
___
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: r352534 - stable/12/sys/fs/fuse

2019-09-19 Thread Alan Somers
Author: asomers
Date: Thu Sep 19 17:42:17 2019
New Revision: 352534
URL: https://svnweb.freebsd.org/changeset/base/352534

Log:
  MFC r352417:
  
  Fix an off-by-one error from r351961
  
  That revision addressed a Coverity CID that could lead to a buffer overflow,
  but it had an off-by-one error in the buffer size check.
  
  Reported by:  Coverity
  Coverity CID: 1405530
  MFC-With: 351961
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/fs/fuse/fuse_internal.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/fuse/fuse_internal.c
==
--- stable/12/sys/fs/fuse/fuse_internal.c   Thu Sep 19 17:42:02 2019
(r352533)
+++ stable/12/sys/fs/fuse/fuse_internal.c   Thu Sep 19 17:42:17 2019
(r352534)
@@ -390,7 +390,7 @@ fuse_internal_invalidate_entry(struct mount *mp, struc
if ((err = uiomove(, sizeof(fnieo), uio)) != 0)
return (err);
 
-   if (fnieo.namelen > sizeof(name))
+   if (fnieo.namelen >= sizeof(name))
return (EINVAL);
 
if ((err = uiomove(name, fnieo.namelen, uio)) != 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: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd

2019-09-19 Thread Dimitry Andric
On 19 Sep 2019, at 14:46, Cy Schubert  wrote:
> 
> In message <4ccdcc18-6412-e606-4a74-314033a5f...@freebsd.org>, Dimitry Andric 
> writes:
>> On 2019-09-13 22:20, Cy Schubert wrote:
>>> Author: cy
>>> Date: Fri Sep 13 20:20:05 2019
>>> New Revision: 352304
>>> URL: https://svnweb.freebsd.org/changeset/base/352304
>>> 
>>> Log:
>>>   No longer mlock() ntpd pages by default in memory thus allowing its
>>>   pages to page as necessary.
>>> 
>>>   To restore historic BSD behaviour add the following to ntp.conf:
>>> rlimit memlock 32
>> 
>> Apparently this does not completely work, as I still see:
>> 
>> ntpd[824]: ntpd 4.2.8p12-a (1): Starting
>> ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted
>> 
>> even while my ntp.conf is almost entirely vanilla (it only has a
>> different "server" line).
>> 
>> Even explicitly adding:
>> 
>> rlimit memlock -1
>> 
>> does not work, it results in the same error.
>> 
>> -Dimitry
> 
> Can you try this please?
> 
> diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
> index 2b14431dc7b..bcfca27a535 100644
> --- a/contrib/ntp/ntpd/ntpd.c
> +++ b/contrib/ntp/ntpd/ntpd.c
> @@ -999,7 +999,7 @@ ntpdmain(
> # if defined(HAVE_MLOCKALL)
> #  ifdef HAVE_SETRLIMIT
>   ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
> -#   ifdef RLIMIT_MEMLOCK
> +#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) &&
> DFLT_RLIMIT_MEMLOCK != -1
>   /*
>* The default RLIMIT_MEMLOCK is very low on Linux systems.
>* Unless we increase this limit malloc calls are likely to

Yes, I already had something similar edited in (though I tested
DLT_RLIMIT_MEMLOCK > 0), and that works for me.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r352525 - vendor/clang/clang-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:39 2019
New Revision: 352525
URL: https://svnweb.freebsd.org/changeset/base/352525

Log:
  Tag clang 9.0.0 release r372316.

Added:
  vendor/clang/clang-release_900-r372316/
 - copied from r352524, vendor/clang/dist-release_90/
___
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: r352523 - vendor/llvm/llvm-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:33 2019
New Revision: 352523
URL: https://svnweb.freebsd.org/changeset/base/352523

Log:
  Tag llvm 9.0.0 release r372316.

Added:
  vendor/llvm/llvm-release_900-r372316/
 - copied from r352522, vendor/llvm/dist-release_90/
___
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: r352528 - vendor/llvm-libunwind/libunwind-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:48 2019
New Revision: 352528
URL: https://svnweb.freebsd.org/changeset/base/352528

Log:
  Tag LLVM libunwind 9.0.0 release r372316.

Added:
  vendor/llvm-libunwind/libunwind-release_900-r372316/
 - copied from r352527, vendor/llvm-libunwind/dist-release_90/
___
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: r352530 - in vendor/lldb/dist-release_90/utils: . TableGen

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:53 2019
New Revision: 352530
URL: https://svnweb.freebsd.org/changeset/base/352530

Log:
  Vendor import of lldb 9.0.0 release r372316:
  https://llvm.org/svn/llvm-project/lldb/tags/RELEASE_900/final@372316

Added:
  vendor/lldb/dist-release_90/utils/
  vendor/lldb/dist-release_90/utils/TableGen/
  vendor/lldb/dist-release_90/utils/TableGen/LLDBOptionDefEmitter.cpp
  vendor/lldb/dist-release_90/utils/TableGen/LLDBTableGen.cpp
  vendor/lldb/dist-release_90/utils/TableGen/LLDBTableGenBackends.h

Added: vendor/lldb/dist-release_90/utils/TableGen/LLDBOptionDefEmitter.cpp
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/lldb/dist-release_90/utils/TableGen/LLDBOptionDefEmitter.cpp Thu Sep 
19 17:17:53 2019(r352530)
@@ -0,0 +1,151 @@
+//===- TableGen.cpp - Top-Level TableGen implementation for Clang 
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+//
+// These tablegen backends emits LLDB's OptionDefinition values for different
+// LLDB commands.
+//
+//===--===//
+
+#include "LLDBTableGenBackends.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/TableGen/Record.h"
+#include "llvm/TableGen/StringMatcher.h"
+#include "llvm/TableGen/TableGenBackend.h"
+#include 
+#include 
+
+using namespace llvm;
+
+/// Map of command names to their associated records. Also makes sure our
+/// commands are sorted in a deterministic way.
+typedef std::map> RecordsByCommand;
+
+/// Groups all records by their command.
+static RecordsByCommand getCommandList(std::vector Options) {
+  RecordsByCommand result;
+  for (Record *Option : Options)
+result[Option->getValueAsString("Command").str()].push_back(Option);
+  return result;
+}
+
+static void emitOption(Record *Option, raw_ostream ) {
+  OS << "  {";
+
+  // List of option groups this option is in.
+  std::vector GroupsArg;
+
+  if (Option->getValue("Groups")) {
+// The user specified a list of groups.
+auto Groups = Option->getValueAsListOfInts("Groups");
+for (int Group : Groups)
+  GroupsArg.push_back("LLDB_OPT_SET_" + std::to_string(Group));
+  } else if (Option->getValue("GroupStart")) {
+// The user specified a range of groups (with potentially only one 
element).
+int GroupStart = Option->getValueAsInt("GroupStart");
+int GroupEnd = Option->getValueAsInt("GroupEnd");
+for (int i = GroupStart; i <= GroupEnd; ++i)
+  GroupsArg.push_back("LLDB_OPT_SET_" + std::to_string(i));
+  }
+
+  // If we have any groups, we merge them. Otherwise we move this option into
+  // the all group.
+  if (GroupsArg.empty())
+OS << "LLDB_OPT_SET_ALL";
+  else
+OS << llvm::join(GroupsArg.begin(), GroupsArg.end(), " | ");
+
+  OS << ", ";
+
+  // Check if this option is required.
+  OS << (Option->getValue("Required") ? "true" : "false");
+
+  // Add the full and short name for this option.
+  OS << ", \"" << Option->getValueAsString("FullName") << "\", ";
+  OS << '\'' << Option->getValueAsString("ShortName") << "'";
+
+  auto ArgType = Option->getValue("ArgType");
+  bool IsOptionalArg = Option->getValue("OptionalArg") != nullptr;
+
+  // Decide if we have either an option, required or no argument for this
+  // option.
+  OS << ", OptionParser::";
+  if (ArgType) {
+if (IsOptionalArg)
+  OS << "eOptionalArgument";
+else
+  OS << "eRequiredArgument";
+  } else
+OS << "eNoArgument";
+  OS << ", nullptr, ";
+
+  if (Option->getValue("ArgEnum"))
+OS << Option->getValueAsString("ArgEnum");
+  else
+OS << "{}";
+  OS << ", ";
+
+  // Read the tab completions we offer for this option (if there are any)
+  if (Option->getValue("Completions")) {
+auto Completions = Option->getValueAsListOfStrings("Completions");
+std::vector CompletionArgs;
+for (llvm::StringRef Completion : Completions)
+  CompletionArgs.push_back("CommandCompletions::e" + Completion.str() +
+   "Completion");
+
+OS << llvm::join(CompletionArgs.begin(), CompletionArgs.end(), " | ");
+  } else {
+OS << "CommandCompletions::eNoCompletion";
+  }
+
+  // Add the argument type.
+  OS << ", eArgType";
+  if (ArgType) {
+OS << ArgType->getValue()->getAsUnquotedString();
+  } else
+OS << "None";
+  OS << ", ";
+
+  // Add the description if there is any.
+  if (auto D = Option->getValue("Description"))
+OS << D->getValue()->getAsString();
+  else
+OS << "\"\"";
+  OS << "},\n";
+}
+
+/// Emits all option initializers to the raw_ostream.
+static void emitOptions(std::string Command, std::vector Option,
+ 

svn commit: r352524 - in vendor/clang/dist-release_90: include/clang/Basic lib/AST lib/Basic lib/CodeGen

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:36 2019
New Revision: 352524
URL: https://svnweb.freebsd.org/changeset/base/352524

Log:
  Vendor import of clang 9.0.0 release r372316:
  https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_900/final@372316

Modified:
  vendor/clang/dist-release_90/include/clang/Basic/Builtins.def
  vendor/clang/dist-release_90/lib/AST/Decl.cpp
  vendor/clang/dist-release_90/lib/Basic/Version.cpp
  vendor/clang/dist-release_90/lib/CodeGen/CodeGenModule.cpp

Modified: vendor/clang/dist-release_90/include/clang/Basic/Builtins.def
==
--- vendor/clang/dist-release_90/include/clang/Basic/Builtins.def   Thu Sep 
19 17:17:33 2019(r352523)
+++ vendor/clang/dist-release_90/include/clang/Basic/Builtins.def   Thu Sep 
19 17:17:36 2019(r352524)
@@ -440,7 +440,7 @@ BUILTIN(__builtin_rotateleft64, "UWiUWiUWi", "nc")
 BUILTIN(__builtin_rotateright8, "UcUcUc", "nc")
 BUILTIN(__builtin_rotateright16, "UsUsUs", "nc")
 BUILTIN(__builtin_rotateright32, "UZiUZiUZi", "nc")
-BUILTIN(__builtin_rotateright64, "UWiUWiWi", "nc")
+BUILTIN(__builtin_rotateright64, "UWiUWiUWi", "nc")
 
 // Random GCC builtins
 BUILTIN(__builtin_constant_p, "i.", "nctu")

Modified: vendor/clang/dist-release_90/lib/AST/Decl.cpp
==
--- vendor/clang/dist-release_90/lib/AST/Decl.cpp   Thu Sep 19 17:17:33 
2019(r352523)
+++ vendor/clang/dist-release_90/lib/AST/Decl.cpp   Thu Sep 19 17:17:36 
2019(r352524)
@@ -3332,7 +3332,8 @@ SourceRange FunctionDecl::getExceptionSpecSourceRange(
 /// an externally visible symbol, but "extern inline" will not create an
 /// externally visible symbol.
 bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
-  assert((doesThisDeclarationHaveABody() || willHaveBody()) &&
+  assert((doesThisDeclarationHaveABody() || willHaveBody() ||
+  hasAttr()) &&
  "Must be a function definition");
   assert(isInlined() && "Function must be inline");
   ASTContext  = getASTContext();

Modified: vendor/clang/dist-release_90/lib/Basic/Version.cpp
==
--- vendor/clang/dist-release_90/lib/Basic/Version.cpp  Thu Sep 19 17:17:33 
2019(r352523)
+++ vendor/clang/dist-release_90/lib/Basic/Version.cpp  Thu Sep 19 17:17:36 
2019(r352524)
@@ -35,7 +35,7 @@ std::string getClangRepositoryPath() {
 
   // If the CLANG_REPOSITORY is empty, try to use the SVN keyword. This helps 
us
   // pick up a tag in an SVN export, for example.
-  StringRef SVNRepository("$URL: 
https://llvm.org/svn/llvm-project/cfe/branches/release_90/lib/Basic/Version.cpp 
$");
+  StringRef SVNRepository("$URL: 
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_900/final/lib/Basic/Version.cpp
 $");
   if (URL.empty()) {
 URL = SVNRepository.slice(SVNRepository.find(':'),
   SVNRepository.find("/lib/Basic"));

Modified: vendor/clang/dist-release_90/lib/CodeGen/CodeGenModule.cpp
==
--- vendor/clang/dist-release_90/lib/CodeGen/CodeGenModule.cpp  Thu Sep 19 
17:17:33 2019(r352523)
+++ vendor/clang/dist-release_90/lib/CodeGen/CodeGenModule.cpp  Thu Sep 19 
17:17:36 2019(r352524)
@@ -4355,17 +4355,22 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD)
   // Create a reference to the named value.  This ensures that it is emitted
   // if a deferred decl.
   llvm::Constant *Aliasee;
-  if (isa(DeclTy))
+  llvm::GlobalValue::LinkageTypes LT;
+  if (isa(DeclTy)) {
 Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD,
   /*ForVTable=*/false);
-  else
+LT = getFunctionLinkage(GD);
+  } else {
 Aliasee = GetOrCreateLLVMGlobal(AA->getAliasee(),
 llvm::PointerType::getUnqual(DeclTy),
 /*D=*/nullptr);
+LT = getLLVMLinkageVarDefinition(cast(GD.getDecl()),
+ D->getType().isConstQualified());
+  }
 
   // Create the new alias itself, but don't set a name yet.
-  auto *GA = llvm::GlobalAlias::create(
-  DeclTy, 0, llvm::Function::ExternalLinkage, "", Aliasee, ());
+  auto *GA =
+  llvm::GlobalAlias::create(DeclTy, 0, LT, "", Aliasee, ());
 
   if (Entry) {
 if (GA->getAliasee() == Entry) {
___
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: r352532 - vendor/llvm-openmp/openmp-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:59 2019
New Revision: 352532
URL: https://svnweb.freebsd.org/changeset/base/352532

Log:
  Tag LLVM openmp 9.0.0 release r372316.

Added:
  vendor/llvm-openmp/openmp-release_900-r372316/
 - copied from r352531, vendor/llvm-openmp/dist-release_90/
___
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: r352531 - vendor/lldb/lldb-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:56 2019
New Revision: 352531
URL: https://svnweb.freebsd.org/changeset/base/352531

Log:
  Tag lldb 9.0.0 release r372316.

Added:
  vendor/lldb/lldb-release_900-r372316/
 - copied from r352530, vendor/lldb/dist-release_90/
___
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: r352529 - vendor/lld/lld-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:51 2019
New Revision: 352529
URL: https://svnweb.freebsd.org/changeset/base/352529

Log:
  Tag lld 9.0.0 release r372316.

Added:
  vendor/lld/lld-release_900-r372316/
 - copied from r352528, vendor/lld/dist-release_90/
___
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: r352526 - vendor/compiler-rt/compiler-rt-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:42 2019
New Revision: 352526
URL: https://svnweb.freebsd.org/changeset/base/352526

Log:
  Tag compiler-rt 9.0.0 release r372316.

Added:
  vendor/compiler-rt/compiler-rt-release_900-r372316/
 - copied from r352525, vendor/compiler-rt/dist-release_90/
___
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: r352527 - vendor/libc++/libc++-release_900-r372316

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:45 2019
New Revision: 352527
URL: https://svnweb.freebsd.org/changeset/base/352527

Log:
  Tag libc++ 9.0.0 release r372316.

Added:
  vendor/libc++/libc++-release_900-r372316/
 - copied from r352526, vendor/libc++/dist-release_90/
___
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: r352522 - in vendor/llvm/dist-release_90: include/llvm/IR lib/CodeGen lib/IR lib/Target/X86 lib/Transforms/Utils

2019-09-19 Thread Dimitry Andric
Author: dim
Date: Thu Sep 19 17:17:29 2019
New Revision: 352522
URL: https://svnweb.freebsd.org/changeset/base/352522

Log:
  Vendor import of llvm 9.0.0 release r372316:
  https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_900/final@372316

Modified:
  vendor/llvm/dist-release_90/include/llvm/IR/Instructions.h
  vendor/llvm/dist-release_90/lib/CodeGen/IfConversion.cpp
  vendor/llvm/dist-release_90/lib/IR/Instructions.cpp
  vendor/llvm/dist-release_90/lib/Target/X86/X86ISelLowering.cpp
  vendor/llvm/dist-release_90/lib/Transforms/Utils/SimplifyLibCalls.cpp

Modified: vendor/llvm/dist-release_90/include/llvm/IR/Instructions.h
==
--- vendor/llvm/dist-release_90/include/llvm/IR/Instructions.h  Thu Sep 19 
16:54:34 2019(r352521)
+++ vendor/llvm/dist-release_90/include/llvm/IR/Instructions.h  Thu Sep 19 
17:17:29 2019(r352522)
@@ -3938,6 +3938,9 @@ class CallBrInst : public CallBase {
 ArrayRef IndirectDests, ArrayRef Args,
 ArrayRef Bundles, const Twine );
 
+  /// Should the Indirect Destinations change, scan + update the Arg list.
+  void updateArgBlockAddresses(unsigned i, BasicBlock *B);
+
   /// Compute the number of operands to allocate.
   static int ComputeNumOperands(int NumArgs, int NumIndirectDests,
 int NumBundleInputs = 0) {
@@ -4075,7 +4078,7 @@ class CallBrInst : public CallBase {
 return cast(*(<-1>() - getNumIndirectDests() - 1));
   }
   BasicBlock *getIndirectDest(unsigned i) const {
-return cast(*(<-1>() - getNumIndirectDests() + i));
+return cast_or_null(*(<-1>() - getNumIndirectDests() + i));
   }
   SmallVector getIndirectDests() const {
 SmallVector IndirectDests;
@@ -4087,6 +4090,7 @@ class CallBrInst : public CallBase {
 *(<-1>() - getNumIndirectDests() - 1) = reinterpret_cast(B);
   }
   void setIndirectDest(unsigned i, BasicBlock *B) {
+updateArgBlockAddresses(i, B);
 *(<-1>() - getNumIndirectDests() + i) = reinterpret_cast(B);
   }
 
@@ -4096,11 +4100,10 @@ class CallBrInst : public CallBase {
 return i == 0 ? getDefaultDest() : getIndirectDest(i - 1);
   }
 
-  void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
-assert(idx < getNumIndirectDests() + 1 &&
+  void setSuccessor(unsigned i, BasicBlock *NewSucc) {
+assert(i < getNumIndirectDests() + 1 &&
"Successor # out of range for callbr!");
-*(<-1>() - getNumIndirectDests() -1 + idx) =
-reinterpret_cast(NewSucc);
+return i == 0 ? setDefaultDest(NewSucc) : setIndirectDest(i - 1, NewSucc);
   }
 
   unsigned getNumSuccessors() const { return getNumIndirectDests() + 1; }

Modified: vendor/llvm/dist-release_90/lib/CodeGen/IfConversion.cpp
==
--- vendor/llvm/dist-release_90/lib/CodeGen/IfConversion.cppThu Sep 19 
16:54:34 2019(r352521)
+++ vendor/llvm/dist-release_90/lib/CodeGen/IfConversion.cppThu Sep 19 
17:17:29 2019(r352522)
@@ -912,6 +912,12 @@ void IfConverter::AnalyzeBranches(BBInfo ) {
   BBI.BrCond.clear();
   BBI.IsBrAnalyzable =
   !TII->analyzeBranch(*BBI.BB, BBI.TrueBB, BBI.FalseBB, BBI.BrCond);
+  if (!BBI.IsBrAnalyzable) {
+BBI.TrueBB = nullptr;
+BBI.FalseBB = nullptr;
+BBI.BrCond.clear();
+  }
+
   SmallVector RevCond(BBI.BrCond.begin(), BBI.BrCond.end());
   BBI.IsBrReversible = (RevCond.size() == 0) ||
   !TII->reverseBranchCondition(RevCond);
@@ -1758,9 +1764,15 @@ bool IfConverter::IfConvertDiamondCommon(
   if (!BBI1->IsBrAnalyzable)
 verifySameBranchInstructions(, );
 #endif
-  BBI1->NonPredSize -= TII->removeBranch(*BBI1->BB);
-  // Remove duplicated instructions.
+  // Remove duplicated instructions from the tail of MBB1: any branch
+  // instructions, and the common instructions counted by NumDups2.
   DI1 = MBB1.end();
+  while (DI1 != MBB1.begin()) {
+MachineBasicBlock::iterator Prev = std::prev(DI1);
+if (!Prev->isBranch() && !Prev->isDebugInstr())
+  break;
+DI1 = Prev;
+  }
   for (unsigned i = 0; i != NumDups2; ) {
 // NumDups2 only counted non-dbg_value instructions, so this won't
 // run off the head of the list.

Modified: vendor/llvm/dist-release_90/lib/IR/Instructions.cpp
==
--- vendor/llvm/dist-release_90/lib/IR/Instructions.cpp Thu Sep 19 16:54:34 
2019(r352521)
+++ vendor/llvm/dist-release_90/lib/IR/Instructions.cpp Thu Sep 19 17:17:29 
2019(r352522)
@@ -822,6 +822,17 @@ void CallBrInst::init(FunctionType *FTy, Value *Fn, Ba
   setName(NameStr);
 }
 
+void CallBrInst::updateArgBlockAddresses(unsigned i, BasicBlock *B) {
+  assert(getNumIndirectDests() > i && "IndirectDest # out of range for 
callbr");
+  if (BasicBlock *OldBB = getIndirectDest(i)) {
+BlockAddress *Old = BlockAddress::get(OldBB);
+BlockAddress *New = BlockAddress::get(B);

svn commit: r352521 - svnadmin/conf

2019-09-19 Thread Glen Barber
Author: gjb
Date: Thu Sep 19 16:54:34 2019
New Revision: 352521
URL: https://svnweb.freebsd.org/changeset/base/352521

Log:
  Add releng/12.1 to svnadmin/conf/approvers.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Thu Sep 19 16:43:12 2019(r352520)
+++ svnadmin/conf/approvers Thu Sep 19 16:54:34 2019(r352521)
@@ -20,6 +20,7 @@
 #^stable/12/   re
 #^stable/11/   re
 ^release/  re
+^releng/12.1/  re
 ^releng/12.0/  (security-officer|so)
 ^releng/11.[0-3]/  (security-officer|so)
 ^releng/10.[0-4]/  (security-officer|so)
___
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: r352520 - head/usr.sbin/pkg

2019-09-19 Thread Glen Barber
Author: gjb
Date: Thu Sep 19 16:43:12 2019
New Revision: 352520
URL: https://svnweb.freebsd.org/changeset/base/352520

Log:
  Apply r346792 (cperciva) from stable/12 to head.  The original commit
  message:
  
   On non-x86 systems, use "quarterly" packages.
  
   x86 architectures have "latest" package builds on stable/*, so keep using
   those (they'll get switched over to "quarterly" during releases).
  
  The original commit was a direct commit to stable/12, as at the time it
  was presumed it would not be necessary for head.  However, when it is time
  to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, the
  pkg(7) Makefile needs further adjusting.  This commit includes those
  further adjustments, evaluating the BRANCH variable from release/Makefile
  to determine the pkg(7) repository to use.
  
  MFC after:immediate (if possible)
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/usr.sbin/pkg/Makefile

Modified: head/usr.sbin/pkg/Makefile
==
--- head/usr.sbin/pkg/Makefile  Thu Sep 19 15:12:32 2019(r352519)
+++ head/usr.sbin/pkg/Makefile  Thu Sep 19 16:43:12 2019(r352520)
@@ -1,6 +1,16 @@
 # $FreeBSD$
 
+.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
+PKGCONFBRANCH?=quarterly
+.else
+_BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
+BRANCH?=   ${_BRANCH}
+. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
+PKGCONFBRANCH?=quarterly
+. else
 PKGCONFBRANCH?=latest
+. endif
+.endif
 CONFS= FreeBSD.conf.${PKGCONFBRANCH}
 CONFSNAME= FreeBSD.conf
 CONFSDIR=  /etc/pkg
___
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: r352513 - head/usr.sbin/freebsd-update

2019-09-19 Thread Ian Lepore
On Thu, 2019-09-19 at 11:34 +, Ed Maste wrote:
> Author: emaste
> Date: Thu Sep 19 11:34:35 2019
> New Revision: 352513
> URL: https://svnweb.freebsd.org/changeset/base/352513
> 
> Log:
>   freebsd-update.8: appease igor
>   
>   igor follows American style guides in the belief that abbreviations i.e.
>   and e.g. are always followed by a comma.  Make that change now so that
>   future updates to freebsd-update.8 do not complain about this.
>   
> 

Grammatically, English requires a comma after 'i.e.' because it is an
adverbial phrase functioning as a conjunctive adverb.

If you translate 'e.g.' idiomatically as "for example", then it is also
a conjunctive adverbial phrase requiring a comma.

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


svn commit: r352519 - in stable/12/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv

2019-09-19 Thread Alan Cox
Author: alc
Date: Thu Sep 19 15:12:32 2019
New Revision: 352519
URL: https://svnweb.freebsd.org/changeset/base/352519

Log:
  MFC r350335:
  Simplify the handling of superpages in pmap_clear_modify().  Specifically,
  if a demotion succeeds, then all of the 4KB page mappings within the
  superpage-sized region must be valid, so there is no point in testing the
  validity of the 4KB page mapping that is going to be write protected.
  
  Deindent the nearby code.

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

Modified: stable/12/sys/amd64/amd64/pmap.c
==
--- stable/12/sys/amd64/amd64/pmap.cThu Sep 19 14:45:04 2019
(r352518)
+++ stable/12/sys/amd64/amd64/pmap.cThu Sep 19 15:12:32 2019
(r352519)
@@ -7599,7 +7599,7 @@ pmap_clear_modify(vm_page_t m)
pmap_t pmap;
pv_entry_t next_pv, pv;
pd_entry_t oldpde, *pde;
-   pt_entry_t oldpte, *pte, PG_M, PG_RW, PG_V;
+   pt_entry_t *pte, PG_M, PG_RW;
struct rwlock *lock;
vm_offset_t va;
int md_gen, pvh_gen;
@@ -7635,33 +7635,23 @@ restart:
}
}
PG_M = pmap_modified_bit(pmap);
-   PG_V = pmap_valid_bit(pmap);
PG_RW = pmap_rw_bit(pmap);
va = pv->pv_va;
pde = pmap_pde(pmap, va);
oldpde = *pde;
-   if ((oldpde & PG_RW) != 0) {
-   if (pmap_demote_pde_locked(pmap, pde, va, )) {
-   if ((oldpde & PG_W) == 0) {
-   /*
-* Write protect the mapping to a
-* single page so that a subsequent
-* write access may repromote.
-*/
-   va += VM_PAGE_TO_PHYS(m) - (oldpde &
-   PG_PS_FRAME);
-   pte = pmap_pde_to_pte(pde, va);
-   oldpte = *pte;
-   if ((oldpte & PG_V) != 0) {
-   while (!atomic_cmpset_long(pte,
-   oldpte,
-   oldpte & ~(PG_M | PG_RW)))
-   oldpte = *pte;
-   vm_page_dirty(m);
-   pmap_invalidate_page(pmap, va);
-   }
-   }
-   }
+   /* If oldpde has PG_RW set, then it also has PG_M set. */
+   if ((oldpde & PG_RW) != 0 &&
+   pmap_demote_pde_locked(pmap, pde, va, ) &&
+   (oldpde & PG_W) == 0) {
+   /*
+* Write protect the mapping to a single page so that
+* a subsequent write access may repromote.
+*/
+   va += VM_PAGE_TO_PHYS(m) - (oldpde & PG_PS_FRAME);
+   pte = pmap_pde_to_pte(pde, va);
+   atomic_clear_long(pte, PG_M | PG_RW);
+   vm_page_dirty(m);
+   pmap_invalidate_page(pmap, va);
}
PMAP_UNLOCK(pmap);
}

Modified: stable/12/sys/arm64/arm64/pmap.c
==
--- stable/12/sys/arm64/arm64/pmap.cThu Sep 19 14:45:04 2019
(r352518)
+++ stable/12/sys/arm64/arm64/pmap.cThu Sep 19 15:12:32 2019
(r352519)
@@ -5008,28 +5008,22 @@ restart:
va = pv->pv_va;
l2 = pmap_l2(pmap, va);
oldl2 = pmap_load(l2);
-   if ((oldl2 & ATTR_SW_DBM) != 0) {
-   if (pmap_demote_l2_locked(pmap, l2, va, )) {
-   if ((oldl2 & ATTR_SW_WIRED) == 0) {
-   /*
-* Write protect the mapping to a
-* single page so that a subsequent
-* write access may repromote.
-*/
-   va += VM_PAGE_TO_PHYS(m) -
-   (oldl2 & ~ATTR_MASK);
-   l3 = pmap_l2_to_l3(l2, va);
-   oldl3 = pmap_load(l3);
-   if (pmap_l3_valid(oldl3)) {
-   

svn commit: r352518 - head/usr.sbin/ntp/libntp

2019-09-19 Thread Cy Schubert
Author: cy
Date: Thu Sep 19 14:45:04 2019
New Revision: 352518
URL: https://svnweb.freebsd.org/changeset/base/352518

Log:
  Reduce calls to close(2) at startup through the use of closefrom(2).
  
  Submitted by: pawel.bierna...@gmail.com
  Reviewed by:  mjg, cy
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D21715

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

Modified: head/usr.sbin/ntp/libntp/Makefile
==
--- head/usr.sbin/ntp/libntp/Makefile   Thu Sep 19 14:36:30 2019
(r352517)
+++ head/usr.sbin/ntp/libntp/Makefile   Thu Sep 19 14:45:04 2019
(r352518)
@@ -83,7 +83,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
-I${.CURDIR:H} \
-I${.CURDIR}/
 
-CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H
+CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H -DHAVE_CLOSEFROM
 
 CLEANFILES+= .version version.c
 
___
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: r352517 - in stable/12/sys: amd64/amd64 i386/i386

2019-09-19 Thread Alan Cox
Author: alc
Date: Thu Sep 19 14:36:30 2019
New Revision: 352517
URL: https://svnweb.freebsd.org/changeset/base/352517

Log:
  MFC r349526:
  
  When we protect PTEs (as opposed to PDEs), we only call vm_page_dirty()
  when, in fact, we are write protecting the page and the PTE has PG_M set.
  However, pmap_protect_pde() was always calling vm_page_dirty() when the PDE
  has PG_M set.  So, adding PG_NX to a writeable PDE could result in
  unnecessary (but harmless) calls to vm_page_dirty().
  
  Simplify the loop calling vm_page_dirty() in pmap_protect_pde().

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

Modified: stable/12/sys/amd64/amd64/pmap.c
==
--- stable/12/sys/amd64/amd64/pmap.cThu Sep 19 13:25:19 2019
(r352516)
+++ stable/12/sys/amd64/amd64/pmap.cThu Sep 19 14:36:30 2019
(r352517)
@@ -5214,8 +5214,7 @@ static boolean_t
 pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot)
 {
pd_entry_t newpde, oldpde;
-   vm_offset_t eva, va;
-   vm_page_t m;
+   vm_page_t m, mt;
boolean_t anychanged;
pt_entry_t PG_G, PG_M, PG_RW;
 
@@ -5229,15 +5228,15 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offs
anychanged = FALSE;
 retry:
oldpde = newpde = *pde;
-   if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) ==
-   (PG_MANAGED | PG_M | PG_RW)) {
-   eva = sva + NBPDR;
-   for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME);
-   va < eva; va += PAGE_SIZE, m++)
-   vm_page_dirty(m);
-   }
-   if ((prot & VM_PROT_WRITE) == 0)
+   if ((prot & VM_PROT_WRITE) == 0) {
+   if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) ==
+   (PG_MANAGED | PG_M | PG_RW)) {
+   m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME);
+   for (mt = m; mt < [NBPDR / PAGE_SIZE]; mt++)
+   vm_page_dirty(mt);
+   }
newpde &= ~(PG_RW | PG_M);
+   }
if ((prot & VM_PROT_EXECUTE) == 0)
newpde |= pg_nx;
if (newpde != oldpde) {

Modified: stable/12/sys/i386/i386/pmap.c
==
--- stable/12/sys/i386/i386/pmap.c  Thu Sep 19 13:25:19 2019
(r352516)
+++ stable/12/sys/i386/i386/pmap.c  Thu Sep 19 14:36:30 2019
(r352517)
@@ -3332,8 +3332,7 @@ static boolean_t
 pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot)
 {
pd_entry_t newpde, oldpde;
-   vm_offset_t eva, va;
-   vm_page_t m;
+   vm_page_t m, mt;
boolean_t anychanged;
 
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
@@ -3342,15 +3341,15 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offs
anychanged = FALSE;
 retry:
oldpde = newpde = *pde;
-   if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) ==
-   (PG_MANAGED | PG_M | PG_RW)) {
-   eva = sva + NBPDR;
-   for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME);
-   va < eva; va += PAGE_SIZE, m++)
-   vm_page_dirty(m);
-   }
-   if ((prot & VM_PROT_WRITE) == 0)
+   if ((prot & VM_PROT_WRITE) == 0) {
+   if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) ==
+   (PG_MANAGED | PG_M | PG_RW)) {
+   m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME);
+   for (mt = m; mt < [NBPDR / PAGE_SIZE]; mt++)
+   vm_page_dirty(mt);
+   }
newpde &= ~(PG_RW | PG_M);
+   }
 #if defined(PAE) || defined(PAE_TABLES)
if ((prot & VM_PROT_EXECUTE) == 0)
newpde |= pg_nx;
___
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: r352516 - head/lib/libarchive/tests

2019-09-19 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Sep 19 13:25:19 2019
New Revision: 352516
URL: https://svnweb.freebsd.org/changeset/base/352516

Log:
  Whitespace cleanup, no functional change
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libarchive/tests/Makefile

Modified: head/lib/libarchive/tests/Makefile
==
--- head/lib/libarchive/tests/Makefile  Thu Sep 19 13:23:25 2019
(r352515)
+++ head/lib/libarchive/tests/Makefile  Thu Sep 19 13:25:19 2019
(r352516)
@@ -520,12 +520,12 @@ ${PACKAGE}FILES+= test_read_format_rar5_blake2.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_compressed.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_different_window_size.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_distance_overflow.rar.uu
-${PACKAGE}FILES+=  test_read_format_rar5_extra_field_version.rar.uu
+${PACKAGE}FILES+=  test_read_format_rar5_extra_field_version.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_fileattr.rar.uu
-${PACKAGE}FILES+=  test_read_format_rar5_hardlink.rar.uu   
-${PACKAGE}FILES+=  test_read_format_rar5_invalid_dict_reference.rar.uu 
-${PACKAGE}FILES+=  test_read_format_rar5_leftshift1.rar.uu 
-${PACKAGE}FILES+=  test_read_format_rar5_leftshift2.rar.uu 
+${PACKAGE}FILES+=  test_read_format_rar5_hardlink.rar.uu
+${PACKAGE}FILES+=  test_read_format_rar5_invalid_dict_reference.rar.uu
+${PACKAGE}FILES+=  test_read_format_rar5_leftshift1.rar.uu
+${PACKAGE}FILES+=  test_read_format_rar5_leftshift2.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_multiarchive.part01.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_multiarchive.part02.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_multiarchive.part03.rar.uu
@@ -541,13 +541,13 @@ ${PACKAGE}FILES+= test_read_format_rar5_multiarchive_s
 ${PACKAGE}FILES+=  test_read_format_rar5_multiple_files.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_multiple_files_solid.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_nonempty_dir_stream.rar.uu
-${PACKAGE}FILES+=  test_read_format_rar5_owner.rar.uu  
-${PACKAGE}FILES+=  test_read_format_rar5_readtables_overflow.rar.uu
+${PACKAGE}FILES+=  test_read_format_rar5_owner.rar.uu
+${PACKAGE}FILES+=  test_read_format_rar5_readtables_overflow.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_solid.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_stored.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_stored_manyfiles.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_symlink.rar.uu
-${PACKAGE}FILES+=  test_read_format_rar5_truncated_huff.rar.uu 
+${PACKAGE}FILES+=  test_read_format_rar5_truncated_huff.rar.uu
 ${PACKAGE}FILES+=  test_read_format_rar5_win32.rar.uu
 ${PACKAGE}FILES+=  test_read_format_raw.bufr.uu
 ${PACKAGE}FILES+=  test_read_format_raw.data.Z.uu
___
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: r352515 - head/lib/libarchive/tests

2019-09-19 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Sep 19 13:23:25 2019
New Revision: 352515
URL: https://svnweb.freebsd.org/changeset/base/352515

Log:
  Temporarily add test_write_filter_zstd BROKEN_TESTS as it always fails in CI
  
  There is no trivial way to mark single libarchive test skip currently so just
  add it to BROKEN_TESTS for now.
  
  PR:   240683
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libarchive/tests/Makefile

Modified: head/lib/libarchive/tests/Makefile
==
--- head/lib/libarchive/tests/Makefile  Thu Sep 19 11:46:43 2019
(r352514)
+++ head/lib/libarchive/tests/Makefile  Thu Sep 19 13:23:25 2019
(r352515)
@@ -305,6 +305,9 @@ BROKEN_TESTS+=  
test_read_disk_directory_traversals
 # (Times out?) [and] crashes
 BROKEN_TESTS+= test_fuzz_rar
 
+# https://bugs.freebsd.org/240683
+BROKEN_TESTS+= test_write_filter_zstd
+
 # Build the test program.
 SRCS.libarchive_test=  \
${TESTS_SRCS}   \
___
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: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd

2019-09-19 Thread Cy Schubert
In message <4ccdcc18-6412-e606-4a74-314033a5f...@freebsd.org>, Dimitry 
Andric w
rites:
> On 2019-09-13 22:20, Cy Schubert wrote:
> > Author: cy
> > Date: Fri Sep 13 20:20:05 2019
> > New Revision: 352304
> > URL: https://svnweb.freebsd.org/changeset/base/352304
> > 
> > Log:
> >No longer mlock() ntpd pages by default in memory thus allowing its
> >pages to page as necessary.
> >
> >To restore historic BSD behaviour add the following to ntp.conf:
> > rlimit memlock 32
>
> Apparently this does not completely work, as I still see:
>
> ntpd[824]: ntpd 4.2.8p12-a (1): Starting
> ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted
>
> even while my ntp.conf is almost entirely vanilla (it only has a 
> different "server" line).
>
> Even explicitly adding:
>
> rlimit memlock -1
>
> does not work, it results in the same error.
>
> -Dimitry

Can you try this please?

diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
index 2b14431dc7b..bcfca27a535 100644
--- a/contrib/ntp/ntpd/ntpd.c
+++ b/contrib/ntp/ntpd/ntpd.c
@@ -999,7 +999,7 @@ ntpdmain(
 # if defined(HAVE_MLOCKALL)
 #  ifdef HAVE_SETRLIMIT
ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
-#   ifdef RLIMIT_MEMLOCK
+#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && 
DFLT_RLIMIT_MEMLOCK != -1
/*
 * The default RLIMIT_MEMLOCK is very low on Linux systems.
 * Unless we increase this limit malloc calls are likely to



-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r352514 - head/usr.sbin/freebsd-update

2019-09-19 Thread Ed Maste
Author: emaste
Date: Thu Sep 19 11:46:43 2019
New Revision: 352514
URL: https://svnweb.freebsd.org/changeset/base/352514

Log:
  freebsd-update: make usage output consistent
  
  Drop trailing . which appeared only on description of IDS.
  
  Submitted by: grembo
  Event:EuroBSDCon Norway FreeBSD DevSummit

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Thu Sep 19 11:34:35 
2019(r352513)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Thu Sep 19 11:46:43 
2019(r352514)
@@ -64,7 +64,7 @@ Commands:
   upgrade  -- Fetch upgrades to FreeBSD version specified via -r option
   install  -- Install downloaded updates or upgrades
   rollback -- Uninstall most recently installed updates
-  IDS  -- Compare the system against an index of "known good" files.
+  IDS  -- Compare the system against an index of "known good" files
 EOF
exit 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: r352513 - head/usr.sbin/freebsd-update

2019-09-19 Thread Ed Maste
Author: emaste
Date: Thu Sep 19 11:34:35 2019
New Revision: 352513
URL: https://svnweb.freebsd.org/changeset/base/352513

Log:
  freebsd-update.8: appease igor
  
  igor follows American style guides in the belief that abbreviations i.e.
  and e.g. are always followed by a comma.  Make that change now so that
  future updates to freebsd-update.8 do not complain about this.
  
  Submitted by: grembo
  Event:EuroBSDCon Norway FreeBSD DevSummit

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.8

Modified: head/usr.sbin/freebsd-update/freebsd-update.8
==
--- head/usr.sbin/freebsd-update/freebsd-update.8   Thu Sep 19 10:27:47 
2019(r352512)
+++ head/usr.sbin/freebsd-update/freebsd-update.8   Thu Sep 19 11:34:35 
2019(r352513)
@@ -95,7 +95,7 @@ Trust an RSA key with SHA256 of
 .Ar KEY .
 (default: read value from configuration file.)
 .It Fl r Ar newrelease
-Specify the new release (e.g. 11.2-RELEASE) to which
+Specify the new release (e.g., 11.2-RELEASE) to which
 .Nm
 should upgrade (upgrade command only).
 .It Fl s Ar server
___
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: r352512 - head/sys/netinet/tcp_stacks

2019-09-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Sep 19 10:27:47 2019
New Revision: 352512
URL: https://svnweb.freebsd.org/changeset/base/352512

Log:
  When the RACK stack computes the space for user data in a TCP segment,
  it wasn't taking the IP level options into account. This patch fixes this.
  In addition, it also corrects a KASSERT and adds protection code to assure
  that the IP header chain and the TCP head fit in the first fragment as
  required by RFC 7112.
  
  Reviewed by:  rrs@
  MFC after:3 days
  Sponsored by: Nertflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D21666

Modified:
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Thu Sep 19 10:22:29 2019
(r352511)
+++ head/sys/netinet/tcp_stacks/rack.c  Thu Sep 19 10:27:47 2019
(r352512)
@@ -7840,7 +7840,16 @@ send:
hdrlen += sizeof(struct udphdr);
}
 #endif
-   ipoptlen = 0;
+#ifdef INET6
+   if (isipv6)
+   ipoptlen = ip6_optlen(tp->t_inpcb);
+   else
+#endif
+   if (tp->t_inpcb->inp_options)
+   ipoptlen = tp->t_inpcb->inp_options->m_len -
+   offsetof(struct ipoption, ipopt_list);
+   else
+   ipoptlen = 0;
 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
ipoptlen += ipsec_optlen;
 #endif
@@ -7913,6 +7922,18 @@ send:
sendalot = 1;
 
} else {
+   if (optlen + ipoptlen > tp->t_maxseg) {
+   /*
+* Since we don't have enough space to put
+* the IP header chain and the TCP header in
+* one packet as required by RFC 7112, don't
+* send it.
+*/
+   SOCKBUF_UNLOCK(>so_snd);
+   error = EMSGSIZE;
+   sack_rxmit = 0;
+   goto out;
+   }
len = tp->t_maxseg - optlen - ipoptlen;
sendalot = 1;
}
@@ -8414,15 +8435,9 @@ send:
m->m_pkthdr.csum_flags |= CSUM_TSO;
m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen;
}
-#if defined(IPSEC) || defined(IPSEC_SUPPORT)
-   KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL),
-   ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u",
-   __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL)));
-#else
-   KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL),
-   ("%s: mbuf chain shorter than expected: %d + %u + %u != %u",
-   __func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
-#endif
+   KASSERT(len + hdrlen == m_length(m, NULL),
+   ("%s: mbuf chain different than expected: %d + %u != %u",
+   __func__, len, hdrlen, m_length(m, NULL)));
 
 #ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */
___
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: r352511 - head/sys/netinet6

2019-09-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Sep 19 10:22:29 2019
New Revision: 352511
URL: https://svnweb.freebsd.org/changeset/base/352511

Log:
  When processing an incoming IPv6 packet over the loopback interface which
  contains Hop-by-Hop options, the mbuf chain is potentially changed in
  ip6_hopopts_input(), called by ip6_input_hbh().
  This can happen, because of the the use of IP6_EXTHDR_CHECK, which might
  call m_pullup().
  So provide the updated pointer back to the called of ip6_input_hbh() to
  avoid using a freed mbuf chain in`ip6_input()`.
  
  Reviewed by:  markj@
  MFC after:3 days
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D21664

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==
--- head/sys/netinet6/ip6_input.c   Thu Sep 19 10:06:18 2019
(r352510)
+++ head/sys/netinet6/ip6_input.c   Thu Sep 19 10:22:29 2019
(r352511)
@@ -403,20 +403,22 @@ VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_TH
 #endif
 
 static int
-ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off,
+ip6_input_hbh(struct mbuf **mp, uint32_t *plen, uint32_t *rtalert, int *off,
 int *nxt, int *ours)
 {
+   struct mbuf *m;
struct ip6_hdr *ip6;
struct ip6_hbh *hbh;
 
-   if (ip6_hopopts_input(plen, rtalert, , off)) {
+   if (ip6_hopopts_input(plen, rtalert, mp, off)) {
 #if 0  /*touches NULL pointer*/
-   in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard);
+   in6_ifstat_inc((*mp)->m_pkthdr.rcvif, ifs6_in_discard);
 #endif
goto out;   /* m have already been freed */
}
 
/* adjust pointer */
+   m = *mp;
ip6 = mtod(m, struct ip6_hdr *);
 
/*
@@ -854,7 +856,7 @@ passin:
 */
plen = (u_int32_t)ntohs(ip6->ip6_plen);
if (ip6->ip6_nxt == IPPROTO_HOPOPTS) {
-   if (ip6_input_hbh(m, , , , , ) != 0)
+   if (ip6_input_hbh(, , , , , ) != 0)
return;
} else
nxt = ip6->ip6_nxt;
___
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: r352510 - stable/11/sys/netinet

2019-09-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Sep 19 10:06:18 2019
New Revision: 352510
URL: https://svnweb.freebsd.org/changeset/base/352510

Log:
  MFC r352438:
  
  Only allow a SCTP-AUTH shared key to be updated by the application
  if it is not deactivated and not used.
  This avoids a use-after-free problem.
  
  Reported by:  da_cheng_s...@yeah.net

Modified:
  stable/11/sys/netinet/sctp_auth.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_auth.c
==
--- stable/11/sys/netinet/sctp_auth.c   Thu Sep 19 10:01:19 2019
(r352509)
+++ stable/11/sys/netinet/sctp_auth.c   Thu Sep 19 10:06:18 2019
(r352510)
@@ -521,7 +521,7 @@ sctp_insert_sharedkey(struct sctp_keyhead *shared_keys
} else if (new_skey->keyid == skey->keyid) {
/* replace the existing key */
/* verify this key *can* be replaced */
-   if ((skey->deactivated) && (skey->refcount > 1)) {
+   if ((skey->deactivated) || (skey->refcount > 1)) {
SCTPDBG(SCTP_DEBUG_AUTH1,
"can't replace shared key id %u\n",
new_skey->keyid);
___
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: r352509 - stable/12/sys/netinet

2019-09-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Sep 19 10:01:19 2019
New Revision: 352509
URL: https://svnweb.freebsd.org/changeset/base/352509

Log:
  MFC r352438:
  
  Only allow a SCTP-AUTH shared key to be updated by the application
  if it is not deactivated and not used.
  This avoids a use-after-free problem.
  
  Reported by:  da_cheng_s...@yeah.net

Modified:
  stable/12/sys/netinet/sctp_auth.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_auth.c
==
--- stable/12/sys/netinet/sctp_auth.c   Thu Sep 19 09:59:37 2019
(r352508)
+++ stable/12/sys/netinet/sctp_auth.c   Thu Sep 19 10:01:19 2019
(r352509)
@@ -523,7 +523,7 @@ sctp_insert_sharedkey(struct sctp_keyhead *shared_keys
} else if (new_skey->keyid == skey->keyid) {
/* replace the existing key */
/* verify this key *can* be replaced */
-   if ((skey->deactivated) && (skey->refcount > 1)) {
+   if ((skey->deactivated) || (skey->refcount > 1)) {
SCTPDBG(SCTP_DEBUG_AUTH1,
"can't replace shared key id %u\n",
new_skey->keyid);
___
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: r352508 - stable/12/sys/netinet

2019-09-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Sep 19 09:59:37 2019
New Revision: 352508
URL: https://svnweb.freebsd.org/changeset/base/352508

Log:
  MFC r352386:
  Don't write to memory outside of the allocated array for SACK blocks.
  
  Obtained from:rrs@
  Sponsored by: Netflix, Inc.

Modified:
  stable/12/sys/netinet/tcp_sack.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_sack.c
==
--- stable/12/sys/netinet/tcp_sack.cThu Sep 19 09:48:01 2019
(r352507)
+++ stable/12/sys/netinet/tcp_sack.cThu Sep 19 09:59:37 2019
(r352508)
@@ -235,7 +235,7 @@ tcp_update_dsack_list(struct tcpcb *tp, tcp_seq rcv_st
saved_blks[n].start = mid_blk.start;
saved_blks[n++].end = mid_blk.end;
}
-   for (j = 0; (j < tp->rcv_numsacks) && (j < MAX_SACK_BLKS-1); j++) {
+   for (j = 0; (j < tp->rcv_numsacks) && (n < MAX_SACK_BLKS); j++) {
if (((SEQ_LT(tp->sackblks[j].end, mid_blk.start) ||
  SEQ_GT(tp->sackblks[j].start, mid_blk.end)) &&
(SEQ_GT(tp->sackblks[j].start, tp->rcv_nxt
___
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: r352507 - head/cddl/contrib/opensolaris/cmd/zfs

2019-09-19 Thread Andriy Gapon
Author: avg
Date: Thu Sep 19 09:48:01 2019
New Revision: 352507
URL: https://svnweb.freebsd.org/changeset/base/352507

Log:
  update zfs send usage help with r352447
  
  MFC after:3 days

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cThu Sep 19 09:43:56 
2019(r352506)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cThu Sep 19 09:48:01 
2019(r352507)
@@ -290,7 +290,7 @@ get_usage(zfs_help_t idx)
case HELP_SEND:
return (gettext("\tsend [-DnPpRvLec] [-[iI] snapshot] "
"\n"
-   "\tsend [-Le] [-i snapshot|bookmark] "
+   "\tsend [-LPcenv] [-i snapshot|bookmark] "
"\n"
"\tsend [-nvPe] -t \n"));
case HELP_SET:
___
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: r352506 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-09-19 Thread Andriy Gapon
Author: avg
Date: Thu Sep 19 09:43:56 2019
New Revision: 352506
URL: https://svnweb.freebsd.org/changeset/base/352506

Log:
  fix dsl_scan_ds_clone_swapped logic
  
  It was incorrect with respect to swapping dataset IDs both in the
  on-disk ZAP object and the in-memory queue.
  
  In both cases, if only ds1 was already present, then it would be first
  replaced with ds2 and then ds2 would be replaced back with ds1.  Also,
  both cases did not properly handle a situation where both ds1 and ds2
  are already queued.  A duplicate insertion would be attempted and its
  failure would result in a panic.
  
  This change has also been submitted to ZoL as zfsonlinux/zfs@dd262c9
  
  PR:   239566
  Reported by:  pascal.guitier...@gmail.com
  MFC after:4 days
  Sponsored by: CyberSecure

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Thu Sep 
19 09:22:45 2019(r352505)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Thu Sep 
19 09:43:56 2019(r352506)
@@ -2014,16 +2014,17 @@ ds_clone_swapped_bookmark(dsl_dataset_t *ds1, dsl_data
 }
 
 /*
- * Called when a parent dataset and its clone are swapped. If we were
+ * Called when an origin dataset and its clone are swapped.  If we were
  * currently traversing the dataset, we need to switch to traversing the
- * newly promoted parent.
+ * newly promoted clone.
  */
 void
 dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_dataset_t *ds2, dmu_tx_t *tx)
 {
dsl_pool_t *dp = ds1->ds_dir->dd_pool;
dsl_scan_t *scn = dp->dp_scan;
-   uint64_t mintxg;
+   uint64_t mintxg1, mintxg2;
+   boolean_t ds1_queued, ds2_queued;
 
if (!dsl_scan_is_running(scn))
return;
@@ -2031,44 +2032,81 @@ dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_data
ds_clone_swapped_bookmark(ds1, ds2, >scn_phys.scn_bookmark);
ds_clone_swapped_bookmark(ds1, ds2, >scn_phys_cached.scn_bookmark);
 
-   if (scan_ds_queue_contains(scn, ds1->ds_object, )) {
-   scan_ds_queue_remove(scn, ds1->ds_object);
-   scan_ds_queue_insert(scn, ds2->ds_object, mintxg);
+   /*
+* Handle the in-memory scan queue.
+*/
+   ds1_queued = scan_ds_queue_contains(scn, ds1->ds_object, );
+   ds2_queued = scan_ds_queue_contains(scn, ds2->ds_object, );
+
+   /* Sanity checking. */
+   if (ds1_queued) {
+   ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg);
+   ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg);
}
-   if (scan_ds_queue_contains(scn, ds2->ds_object, )) {
+   if (ds2_queued) {
+   ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg);
+   ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg);
+   }
+
+   if (ds1_queued && ds2_queued) {
+   /*
+* If both are queued, we don't need to do anything.
+* The swapping code below would not handle this case correctly,
+* since we can't insert ds2 if it is already there. That's
+* because scan_ds_queue_insert() prohibits a duplicate insert
+* and panics.
+*/
+   } else if (ds1_queued) {
+   scan_ds_queue_remove(scn, ds1->ds_object);
+   scan_ds_queue_insert(scn, ds2->ds_object, mintxg1);
+   } else if (ds2_queued) {
scan_ds_queue_remove(scn, ds2->ds_object);
-   scan_ds_queue_insert(scn, ds1->ds_object, mintxg);
+   scan_ds_queue_insert(scn, ds1->ds_object, mintxg2);
}
 
-   if (zap_lookup_int_key(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj,
-   ds1->ds_object, ) == 0) {
-   int err;
-   ASSERT3U(mintxg, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg);
-   ASSERT3U(mintxg, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg);
-   VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
+   /*
+* Handle the on-disk scan queue.
+* The on-disk state is an out-of-date version of the in-memory state,
+* so the in-memory and on-disk values for ds1_queued and ds2_queued may
+* be different. Therefore we need to apply the swap logic to the
+* on-disk state independently of the in-memory state.
+*/
+   ds1_queued = zap_lookup_int_key(dp->dp_meta_objset,
+   scn->scn_phys.scn_queue_obj, ds1->ds_object, ) == 0;
+   ds2_queued = zap_lookup_int_key(dp->dp_meta_objset,
+   scn->scn_phys.scn_queue_obj, ds2->ds_object, ) == 0;
+
+   /* Sanity checking. */
+   if (ds1_queued) {
+   ASSERT3U(mintxg1, ==, 

Re: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd

2019-09-19 Thread Dimitry Andric

On 2019-09-13 22:20, Cy Schubert wrote:

Author: cy
Date: Fri Sep 13 20:20:05 2019
New Revision: 352304
URL: https://svnweb.freebsd.org/changeset/base/352304

Log:
   No longer mlock() ntpd pages by default in memory thus allowing its
   pages to page as necessary.
   
   To restore historic BSD behaviour add the following to ntp.conf:

rlimit memlock 32


Apparently this does not completely work, as I still see:

ntpd[824]: ntpd 4.2.8p12-a (1): Starting
ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted

even while my ntp.conf is almost entirely vanilla (it only has a 
different "server" line).


Even explicitly adding:

rlimit memlock -1

does not work, it results in the same error.

-Dimitry
___
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: r352505 - head/sys/dev/vt

2019-09-19 Thread Andriy Gapon
Author: avg
Date: Thu Sep 19 09:22:45 2019
New Revision: 352505
URL: https://svnweb.freebsd.org/changeset/base/352505

Log:
  vt: fix problems with trying to switch to a closed VT
  
  If there is an attempt to switch from a process-owned VT to a closed VT,
  then vt(4) first requests the process to release its VT and only then
  realizes that the target VT is closed and, so, the switch is not
  possible.  So, the driver does not actually do any switch, but at the
  same time the owning process is not notified about that and it does not
  re-acquire the VT.
  
  This change adds an early check for the target VT state, so that the
  switch can be refused before the process coordination dance.
  On top of that, the code now checks for a failure of vt_window_switch()
  and calls vt_window_postswitch() for the current VT if it is in the
  process mode.
  
  Test Plan:
  - configure VT1 - VT8 (ttyv0 - ttyv7) to be text consoles (run getty)
  - configure VT9 (ttyv8) to rn X server
  - make sure that the X server configuration allows VT switching
  - leave VT10 - VT12 unconfigured
  - while in the X server press Ctrl+Alt+F10
  - without the patch, observe strange screen content and problems with
keyboard input
  - with the patch, observe that nothing happens
  
  The problem has been observed and the fix has been tested with an nVidia
  graphics card and the proprietary nvidia driver.
  Not sure if that matters.
  
  Reviewed by:  ray
  MFC after:2 weeks
  Differential Revision: https://reviews.freebsd.org/D21704

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Thu Sep 19 07:28:24 2019(r352504)
+++ head/sys/dev/vt/vt_core.c   Thu Sep 19 09:22:45 2019(r352505)
@@ -335,7 +335,7 @@ static void
 vt_switch_timer(void *arg)
 {
 
-   vt_late_window_switch((struct vt_window *)arg);
+   (void)vt_late_window_switch((struct vt_window *)arg);
 }
 
 static int
@@ -457,13 +457,22 @@ vt_window_postswitch(struct vt_window *vw)
 static int
 vt_late_window_switch(struct vt_window *vw)
 {
+   struct vt_window *curvw;
int ret;
 
callout_stop(>vw_proc_dead_timer);
 
ret = vt_window_switch(vw);
-   if (ret)
+   if (ret != 0) {
+   /*
+* If the switch hasn't happened, then return the VT
+* to the current owner, if any.
+*/
+   curvw = vw->vw_device->vd_curwindow;
+   if (curvw->vw_smode.mode == VT_PROCESS)
+   (void)vt_window_postswitch(curvw);
return (ret);
+   }
 
/* Notify owner process about terminal availability. */
if (vw->vw_smode.mode == VT_PROCESS) {
@@ -509,6 +518,19 @@ vt_proc_window_switch(struct vt_window *vw)
return (0); /* success */
}
 
+   /*
+* Early check for an attempt to switch to a non-functional VT.
+* The same check is done in vt_window_switch(), but it's better
+* to fail as early as possible to avoid needless pre-switch
+* actions.
+*/
+   VT_LOCK(vd);
+   if ((vw->vw_flags & (VWF_OPENED|VWF_CONSOLE)) == 0) {
+   VT_UNLOCK(vd);
+   return (EINVAL);
+   }
+   VT_UNLOCK(vd);
+
/* Ask current process permission to switch away. */
if (curvw->vw_smode.mode == VT_PROCESS) {
DPRINTF(30, "%s: VT_PROCESS ", __func__);
@@ -1792,7 +1814,7 @@ finish_vt_rel(struct vt_window *vw, int release, int *
vw->vw_flags &= ~VWF_SWWAIT_REL;
if (release) {
callout_drain(>vw_proc_dead_timer);
-   vt_late_window_switch(vw->vw_switch_to);
+   (void)vt_late_window_switch(vw->vw_switch_to);
}
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: r352504 - head/sys/vm

2019-09-19 Thread Allan Jude
Author: allanjude
Date: Thu Sep 19 07:28:24 2019
New Revision: 352504
URL: https://svnweb.freebsd.org/changeset/base/352504

Log:
  sys/vm/vm_glue.c: Incorrect function name in panic string
  
  Use __func__ to avoid this issue in the future.
  
  Submitted by: Wuyang Chung 
  Reviewed by:  markj, emaste
  Obtained from:https://github.com/freebsd/freebsd/pull/410

Modified:
  head/sys/vm/vm_glue.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Wed Sep 18 23:33:38 2019(r352503)
+++ head/sys/vm/vm_glue.c   Thu Sep 19 07:28:24 2019(r352504)
@@ -320,7 +320,7 @@ vm_thread_stack_create(struct domainset *ds, vm_object
ks = kva_alloc((pages + KSTACK_GUARD_PAGES) * PAGE_SIZE);
 #endif
if (ks == 0) {
-   printf("vm_thread_new: kstack allocation failed\n");
+   printf("%s: kstack allocation failed\n", __func__);
vm_object_deallocate(ksobj);
return (0);
}
@@ -362,7 +362,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t
for (i = 0; i < pages; i++) {
m = vm_page_lookup(ksobj, i);
if (m == NULL)
-   panic("vm_thread_dispose: kstack already missing?");
+   panic("%s: kstack already missing?", __func__);
vm_page_unwire_noq(m);
vm_page_free(m);
}
___
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"