Re: svn commit: r338172 - in head: . sys/amd64/conf sys/dev/drm sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/drm2/radeon/reg_srcs sys/dev/drm2/ttm sys/i386/conf sys/modules sys/modules/d

2018-08-21 Thread John Baldwin
On 8/22/18 3:44 AM, Matthew Macy wrote:
> 
> 
> Could you please create a stable/11 deprecation change.
> 
> 
> What does that entail other than an update to UPDATING in stable/11?

There are helper functions such as gone_in(), etc. that you can use
during attach, though in this case you might want to alter the message
to point users to the port rather than just saying it has been removed.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338182 - in head: sbin/nvmecontrol sys/cam/nvme sys/dev/mpr sys/dev/nvme sys/sys usr.sbin/bhyve

2018-08-21 Thread Chuck Tuffli
Author: chuck
Date: Wed Aug 22 04:29:24 2018
New Revision: 338182
URL: https://svnweb.freebsd.org/changeset/base/338182

Log:
  Make NVMe compatible with the original API
  
  The original NVMe API used bit-fields to represent fields in data
  structures defined by the specification (e.g. the op-code in the command
  data structure). The implementation targeted x86_64 processors and
  defined the bit fields for little endian dwords (i.e. 32 bits).
  
  This approach does not work as-is for big endian architectures and was
  changed to use a combination of bit shifts and masks to support PowerPC.
  Unfortunately, this changed the NVMe API and forces #ifdef's based on
  the OS revision level in user space code.
  
  This change reverts to something that looks like the original API, but
  it uses bytes instead of bit-fields inside the packed command structure.
  As a bonus, this works as-is for both big and little endian CPU
  architectures.
  
  Bump __FreeBSD_version to 1200081 due to API change
  
  Reviewed by: imp, kbowling, smh, mav
  Approved by: imp (mentor)
  Differential Revision: https://reviews.freebsd.org/D16404

Modified:
  head/sbin/nvmecontrol/firmware.c
  head/sbin/nvmecontrol/format.c
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/ns.c
  head/sbin/nvmecontrol/nvmecontrol.c
  head/sbin/nvmecontrol/power.c
  head/sbin/nvmecontrol/wdc.c
  head/sys/cam/nvme/nvme_all.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/nvme/nvme.c
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ctrlr_cmd.c
  head/sys/dev/nvme/nvme_ns_cmd.c
  head/sys/dev/nvme/nvme_qpair.c
  head/sys/sys/param.h
  head/usr.sbin/bhyve/pci_nvme.c

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cWed Aug 22 04:27:33 2018
(r338181)
+++ head/sbin/nvmecontrol/firmware.cWed Aug 22 04:29:24 2018
(r338182)
@@ -125,7 +125,7 @@ update_firmware(int fd, uint8_t *payload, int32_t payl
memcpy(chunk, payload + off, size);
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc_fuse = 
NVME_CMD_SET_OPC(NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD);
+   pt.cmd.opc = NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD;
pt.cmd.cdw10 = htole32((size / sizeof(uint32_t)) - 1);
pt.cmd.cdw11 = htole32(off / sizeof(uint32_t));
pt.buf = chunk;
@@ -150,7 +150,7 @@ activate_firmware(int fd, int slot, int activate_actio
uint16_t sct, sc;
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_FIRMWARE_ACTIVATE);
+   pt.cmd.opc = NVME_OPC_FIRMWARE_ACTIVATE;
pt.cmd.cdw10 = htole32((activate_action << 3) | slot);
pt.is_read = 0;
 

Modified: head/sbin/nvmecontrol/format.c
==
--- head/sbin/nvmecontrol/format.c  Wed Aug 22 04:27:33 2018
(r338181)
+++ head/sbin/nvmecontrol/format.c  Wed Aug 22 04:29:24 2018
(r338182)
@@ -172,7 +172,7 @@ format(int argc, char *argv[])
}
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_FORMAT_NVM);
+   pt.cmd.opc = NVME_OPC_FORMAT_NVM;
pt.cmd.nsid = htole32(nsid);
pt.cmd.cdw10 = htole32((ses << 9) + (pil << 8) + (pi << 5) +
(mset << 4) + lbaf);

Modified: head/sbin/nvmecontrol/logpage.c
==
--- head/sbin/nvmecontrol/logpage.c Wed Aug 22 04:27:33 2018
(r338181)
+++ head/sbin/nvmecontrol/logpage.c Wed Aug 22 04:29:24 2018
(r338182)
@@ -107,7 +107,7 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, 
int i, err_pages;
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_GET_LOG_PAGE);
+   pt.cmd.opc = NVME_OPC_GET_LOG_PAGE;
pt.cmd.nsid = htole32(nsid);
pt.cmd.cdw10 = ((payload_size/sizeof(uint32_t)) - 1) << 16;
pt.cmd.cdw10 |= log_page;

Modified: head/sbin/nvmecontrol/ns.c
==
--- head/sbin/nvmecontrol/ns.c  Wed Aug 22 04:27:33 2018(r338181)
+++ head/sbin/nvmecontrol/ns.c  Wed Aug 22 04:29:24 2018(r338182)
@@ -216,7 +216,7 @@ nscreate(int argc, char *argv[])
nvme_namespace_data_swapbytes();
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_NAMESPACE_MANAGEMENT);
+   pt.cmd.opc = NVME_OPC_NAMESPACE_MANAGEMENT;
 
pt.cmd.cdw10 = 0; /* create */
pt.buf = 
@@ -267,7 +267,7 @@ nsdelete(int argc, char *argv[])
errx(1, "controller does not support namespace management");
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_NAMESPACE_MANAGEMENT);
+   pt.cmd.opc = NVME_OPC_NAMESPACE_MANAGEMENT;

svn commit: r338181 - stable/11/usr.bin/printf/tests

2018-08-21 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug 22 04:27:33 2018
New Revision: 338181
URL: https://svnweb.freebsd.org/changeset/base/338181

Log:
  MFC r337728: (committed by jilles)
  printf: Add test for width and precision in %b format
  
  PR:  229641

Added:
  stable/11/usr.bin/printf/tests/regress.bwidth.out
 - copied unchanged from r337728, 
head/usr.bin/printf/tests/regress.bwidth.out
Modified:
  stable/11/usr.bin/printf/tests/Makefile
  stable/11/usr.bin/printf/tests/regress.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/printf/tests/Makefile
==
--- stable/11/usr.bin/printf/tests/Makefile Wed Aug 22 04:21:25 2018
(r338180)
+++ stable/11/usr.bin/printf/tests/Makefile Wed Aug 22 04:27:33 2018
(r338181)
@@ -5,6 +5,7 @@ PACKAGE=tests
 TAP_TESTS_SH=  legacy_test
 
 ${PACKAGE}FILES+=  regress.b.out
+${PACKAGE}FILES+=  regress.bwidth.out
 ${PACKAGE}FILES+=  regress.d.out
 ${PACKAGE}FILES+=  regress.f.out
 ${PACKAGE}FILES+=  regress.l1.out

Copied: stable/11/usr.bin/printf/tests/regress.bwidth.out (from r337728, 
head/usr.bin/printf/tests/regress.bwidth.out)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/usr.bin/printf/tests/regress.bwidth.out   Wed Aug 22 04:27:33 
2018(r338181, copy of r337728, 
head/usr.bin/printf/tests/regress.bwidth.out)
@@ -0,0 +1 @@
+  a

Modified: stable/11/usr.bin/printf/tests/regress.sh
==
--- stable/11/usr.bin/printf/tests/regress.sh   Wed Aug 22 04:21:25 2018
(r338180)
+++ stable/11/usr.bin/printf/tests/regress.sh   Wed Aug 22 04:27:33 2018
(r338181)
@@ -2,7 +2,7 @@
 
 REGRESSION_START($1)
 
-echo '1..23'
+echo '1..24'
 
 REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"')
 REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 
123')
@@ -27,5 +27,6 @@ REGRESSION_TEST(`missingpos1', `printf "%*.*1\$s" 1 1 
 REGRESSION_TEST(`missingpos1', `printf "%1\$*2\$.*s" 1 1 1 2>&1')
 REGRESSION_TEST(`missingpos1', `printf "%*1\$.*2\$s" 1 1 1 2>&1')
 REGRESSION_TEST(`missingpos1', `printf "%1\$*.*2\$s" 1 1 1 2>&1')
+REGRESSION_TEST(`bwidth', `printf "%8.2b" "a\nb\n"')
 
 REGRESSION_END()
___
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: r338180 - stable/10/sys/fs/msdosfs

2018-08-21 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug 22 04:21:25 2018
New Revision: 338180
URL: https://svnweb.freebsd.org/changeset/base/338180

Log:
  MFC r337456:
  msdosfs: fixes for Undefined Behavior.
  
  These were found by the Undefined Behaviour GsoC project at NetBSD:
  
  Do not change signedness bit with left shift.
  While there avoid signed integer overflow.
  Address both issues with using unsigned type.
  
  msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be
  represented in type 'int [20]'
  msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be
  represented in type 'int [20]'
  
  Detected with micro-UBSan in the user mode.
  
  Hinted from:  NetBSD (CVS 1.33)

Modified:
  stable/10/sys/fs/msdosfs/msdosfs_fat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c
==
--- stable/10/sys/fs/msdosfs/msdosfs_fat.c  Wed Aug 22 04:20:20 2018
(r338179)
+++ stable/10/sys/fs/msdosfs/msdosfs_fat.c  Wed Aug 22 04:21:25 2018
(r338180)
@@ -408,7 +408,7 @@ usemap_alloc(pmp, cn)
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
== 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
-   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
+   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little"));
pmp->pm_freeclustercount--;
pmp->pm_flags |= MSDOSFS_FSIMOD;
@@ -431,7 +431,7 @@ usemap_free(pmp, cn)
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
!= 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
-   pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS));
+   pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS));
 }
 
 int
@@ -813,7 +813,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, 
for (cn = newst; cn <= pmp->pm_maxcluster;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
-   map |= (1 << (cn % N_INUSEBITS)) - 1;
+   map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != FULL_RUN) {
cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@@ -830,7 +830,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, 
for (cn = 0; cn < newst;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
-   map |= (1 << (cn % N_INUSEBITS)) - 1;
+   map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != FULL_RUN) {
cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@@ -981,7 +981,7 @@ fillinusemap(pmp)
 
for (cn = pmp->pm_maxcluster + 1; cn < (pmp->pm_maxcluster +
N_INUSEBITS) / N_INUSEBITS; cn++)
-   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
+   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
 
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: r338179 - stable/11/sys/fs/msdosfs

2018-08-21 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug 22 04:20:20 2018
New Revision: 338179
URL: https://svnweb.freebsd.org/changeset/base/338179

Log:
  MFC r337456:
  msdosfs: fixes for Undefined Behavior.
  
  These were found by the Undefined Behaviour GsoC project at NetBSD:
  
  Do not change signedness bit with left shift.
  While there avoid signed integer overflow.
  Address both issues with using unsigned type.
  
  msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be
  represented in type 'int [20]'
  msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be
  represented in type 'int [20]'
  
  Detected with micro-UBSan in the user mode.
  
  Hinted from:  NetBSD (CVS 1.33)

Modified:
  stable/11/sys/fs/msdosfs/msdosfs_fat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/msdosfs/msdosfs_fat.c
==
--- stable/11/sys/fs/msdosfs/msdosfs_fat.c  Wed Aug 22 04:09:55 2018
(r338178)
+++ stable/11/sys/fs/msdosfs/msdosfs_fat.c  Wed Aug 22 04:20:20 2018
(r338179)
@@ -389,7 +389,7 @@ usemap_alloc(struct msdosfsmount *pmp, u_long cn)
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
== 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
-   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
+   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little"));
pmp->pm_freeclustercount--;
pmp->pm_flags |= MSDOSFS_FSIMOD;
@@ -410,7 +410,7 @@ usemap_free(struct msdosfsmount *pmp, u_long cn)
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
!= 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
-   pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS));
+   pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS));
 }
 
 int
@@ -773,7 +773,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, 
for (cn = newst; cn <= pmp->pm_maxcluster;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
-   map |= (1 << (cn % N_INUSEBITS)) - 1;
+   map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != FULL_RUN) {
cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@@ -790,7 +790,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, 
for (cn = 0; cn < newst;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
-   map |= (1 << (cn % N_INUSEBITS)) - 1;
+   map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != FULL_RUN) {
cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@@ -948,7 +948,7 @@ fillinusemap(struct msdosfsmount *pmp)
 
for (cn = pmp->pm_maxcluster + 1; cn < (pmp->pm_maxcluster +
N_INUSEBITS) / N_INUSEBITS; cn++)
-   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
+   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
 
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: r338178 - in head/sys: netinet netinet6

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Wed Aug 22 04:09:55 2018
New Revision: 338178
URL: https://svnweb.freebsd.org/changeset/base/338178

Log:
  in_mcast: fix copy paste error when clearing flag

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Wed Aug 22 03:04:43 2018(r338177)
+++ head/sys/netinet/in_mcast.c Wed Aug 22 04:09:55 2018(r338178)
@@ -276,7 +276,7 @@ inm_disconnect(struct in_multi *inm)
if (--ll_ifma->ifma_refcount == 0) {
if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) {
CK_STAILQ_REMOVE(>if_multiaddrs, ll_ifma, 
ifmultiaddr, ifma_link);
-   ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
+   ll_ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
}
MCDPRINTF("removed ll_ifma: %p from %s\n", ll_ifma, 
ifp->if_xname);
if_freemulti(ll_ifma);

Modified: head/sys/netinet6/in6_mcast.c
==
--- head/sys/netinet6/in6_mcast.c   Wed Aug 22 03:04:43 2018
(r338177)
+++ head/sys/netinet6/in6_mcast.c   Wed Aug 22 04:09:55 2018
(r338178)
@@ -618,7 +618,7 @@ in6m_disconnect(struct in6_multi *inm)
ifma6_restart = true;
if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) {
CK_STAILQ_REMOVE(>if_multiaddrs, ll_ifma, 
ifmultiaddr, ifma_link);
-   ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
+   ll_ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
}
MCDPRINTF("removed ll_ifma: %p from %s\n", ll_ifma, 
ifp->if_xname);
if_freemulti(ll_ifma);
___
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: r338177 - in head/tools: kerneldoc/subsys tools

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Wed Aug 22 03:04:43 2018
New Revision: 338177
URL: https://svnweb.freebsd.org/changeset/base/338177

Log:
  r338172 followup - removal of stray drm references

Deleted:
  head/tools/kerneldoc/subsys/Doxyfile-dev_drm
Modified:
  head/tools/tools/README

Modified: head/tools/tools/README
==
--- head/tools/tools/README Wed Aug 22 02:53:35 2018(r338176)
+++ head/tools/tools/README Wed Aug 22 03:04:43 2018(r338177)
@@ -16,7 +16,6 @@ commitsdb A tool for reconstructing commit history usi
 crypto Test and exercise tools related to the crypto framework
 cxgbetool  A tool for the cxgbe(4) driver.
 cxgbtool   A tool for the cxgb(4) driver.
-drmTools specific to the DRM/KMS device drivers.
 editingEditor modes and the like to help editing FreeBSD code.
 epfe   Extract printing filter examples from printing.sgml.
 ether_reflect  An Ethernet packet reflector for low level testing.
___
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: r338176 - in head: sys/conf sys/contrib/dev/drm2 tools/tools/drm

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Wed Aug 22 02:53:35 2018
New Revision: 338176
URL: https://svnweb.freebsd.org/changeset/base/338176

Log:
  r338172 follow - remove firmwares

Deleted:
  head/sys/contrib/dev/drm2/
  head/tools/tools/drm/
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Aug 22 02:43:34 2018(r338175)
+++ head/sys/conf/files Wed Aug 22 02:53:35 2018(r338176)
@@ -1553,99 +1553,6 @@ dev/de/if_de.c   optional de pci
 dev/dme/if_dme.c   optional dme
 dev/dpt/dpt_pci.c  optional dpt pci
 dev/dpt/dpt_scsi.c optional dpt
-dev/drm/ati_pcigart.c  optional drm
-dev/drm/drm_agpsupport.c   optional drm
-dev/drm/drm_auth.c optional drm
-dev/drm/drm_bufs.c optional drm
-dev/drm/drm_context.c  optional drm
-dev/drm/drm_dma.c  optional drm
-dev/drm/drm_drawable.c optional drm
-dev/drm/drm_drv.c  optional drm
-dev/drm/drm_fops.c optional drm
-dev/drm/drm_hashtab.c  optional drm
-dev/drm/drm_ioctl.coptional drm
-dev/drm/drm_irq.c  optional drm
-dev/drm/drm_lock.c optional drm
-dev/drm/drm_memory.c   optional drm
-dev/drm/drm_mm.c   optional drm
-dev/drm/drm_pci.c  optional drm
-dev/drm/drm_scatter.c  optional drm
-dev/drm/drm_sman.c optional drm
-dev/drm/drm_sysctl.c   optional drm
-dev/drm/drm_vm.c   optional drm
-dev/drm/mach64_dma.c   optional mach64drm
-dev/drm/mach64_drv.c   optional mach64drm
-dev/drm/mach64_irq.c   optional mach64drm
-dev/drm/mach64_state.c optional mach64drm
-dev/drm/mga_dma.c  optional mgadrm
-dev/drm/mga_drv.c  optional mgadrm
-dev/drm/mga_irq.c  optional mgadrm
-dev/drm/mga_state.coptional mgadrm
-dev/drm/mga_warp.c optional mgadrm
-dev/drm/r128_cce.c optional r128drm \
-   compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}"
-dev/drm/r128_drv.c optional r128drm
-dev/drm/r128_irq.c optional r128drm
-dev/drm/r128_state.c   optional r128drm
-dev/drm/savage_bci.c   optional savagedrm
-dev/drm/savage_drv.c   optional savagedrm
-dev/drm/savage_state.c optional savagedrm
-dev/drm/sis_drv.c  optional sisdrm
-dev/drm/sis_ds.c   optional sisdrm
-dev/drm/sis_mm.c   optional sisdrm
-dev/drm/tdfx_drv.c optional tdfxdrm
-dev/drm/via_dma.c  optional viadrm
-dev/drm/via_dmablit.c  optional viadrm
-dev/drm/via_drv.c  optional viadrm
-dev/drm/via_irq.c  optional viadrm
-dev/drm/via_map.c  optional viadrm
-dev/drm/via_mm.c   optional viadrm
-dev/drm/via_verifier.c optional viadrm
-dev/drm/via_video.coptional viadrm
-dev/drm2/drm_agpsupport.c  optional drm2
-dev/drm2/drm_auth.coptional drm2
-dev/drm2/drm_bufs.coptional drm2
-dev/drm2/drm_buffer.c  optional drm2
-dev/drm2/drm_context.c optional drm2
-dev/drm2/drm_crtc.coptional drm2
-dev/drm2/drm_crtc_helper.c optional drm2
-dev/drm2/drm_dma.c optional drm2
-dev/drm2/drm_dp_helper.c   optional drm2
-dev/drm2/drm_dp_iic_helper.c   optional drm2
-dev/drm2/drm_drv.c optional drm2
-dev/drm2/drm_edid.coptional drm2
-dev/drm2/drm_fb_helper.c   optional drm2
-dev/drm2/drm_fops.coptional drm2
-dev/drm2/drm_gem.c optional drm2
-dev/drm2/drm_gem_names.c   optional drm2
-dev/drm2/drm_global.c  optional drm2
-dev/drm2/drm_hashtab.c optional drm2
-dev/drm2/drm_ioctl.c   optional drm2
-dev/drm2/drm_irq.c optional drm2
-dev/drm2/drm_linux_list_sort.c optional drm2
-dev/drm2/drm_lock.coptional drm2
-dev/drm2/drm_memory.c  optional drm2
-dev/drm2/drm_mm.c  optional drm2
-dev/drm2/drm_modes.c   optional drm2
-dev/drm2/drm_pci.c optional drm2
-dev/drm2/drm_platform.coptional drm2
-dev/drm2/drm_scatter.c optional drm2
-dev/drm2/drm_stub.coptional drm2
-dev/drm2/drm_sysctl.c  optional drm2
-dev/drm2/drm_vm.c  optional drm2
-dev/drm2/drm_os_freebsd.c  optional drm2
-dev/drm2/ttm/ttm_agp_backend.c optional drm2
-dev/drm2/ttm/ttm_lock.coptional drm2
-dev/drm2/ttm/ttm_object.c  optional drm2
-dev/drm2/ttm/ttm_tt.c  optional drm2
-dev/drm2/ttm/ttm_bo_util.c optional drm2
-dev/drm2/ttm/ttm_bo.c  optional drm2
-dev/drm2/ttm/ttm_bo_manager.c  optional drm2
-dev/drm2/ttm/ttm_execbuf_util.coptional drm2
-dev/drm2/ttm/ttm_memory.c  optional drm2
-dev/drm2/ttm/ttm_page_alloc.c  optional 

Re: svn commit: r338172 - in head: . sys/amd64/conf sys/dev/drm sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/drm2/radeon/reg_srcs sys/dev/drm2/ttm sys/i386/conf sys/modules sys/modules/d

2018-08-21 Thread Matthew Macy
>
> Could you please create a stable/11 deprecation change.
>

What does that entail other than an update to UPDATING in stable/11?
___
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: r338175 - in head/sys/dev: drm drm2

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Wed Aug 22 02:43:34 2018
New Revision: 338175
URL: https://svnweb.freebsd.org/changeset/base/338175

Log:
  cleanup after git svn detritus left by r338172

Deleted:
  head/sys/dev/drm/
  head/sys/dev/drm2/
___
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: r338174 - head/sys/arm/conf

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Wed Aug 22 02:18:45 2018
New Revision: 338174
URL: https://svnweb.freebsd.org/changeset/base/338174

Log:
  disconnect drm2 from tegra build until made self-contained

Modified:
  head/sys/arm/conf/TEGRA124

Modified: head/sys/arm/conf/TEGRA124
==
--- head/sys/arm/conf/TEGRA124  Wed Aug 22 01:52:55 2018(r338173)
+++ head/sys/arm/conf/TEGRA124  Wed Aug 22 02:18:45 2018(r338174)
@@ -124,7 +124,6 @@ device  re  # RealTek 
8139C+/8169/8169S/8110S
 device fbd
 device vt
 device kbdmux
-device drm2
 
 # Sound
 #devicesound
___
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: r338172 - in head: . sys/amd64/conf sys/dev/drm sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/drm2/radeon/reg_srcs sys/dev/drm2/ttm sys/i386/conf sys/modules sys/modules/d

2018-08-21 Thread Rodney W. Grimes
> Author: mmacy
> Date: Wed Aug 22 01:50:12 2018
> New Revision: 338172
> URL: https://svnweb.freebsd.org/changeset/base/338172
> 
> Log:
>   Remove legacy drm and drm2 from tree
>   
>   As discussed on the MLs drm2 conflicts with the ports' version and there
>   is no upstream for most if not all of drm. Both have been merged in to
>   a single port.
>   
>   Users on powerpc, 32-bit hardware, or with GPUs predating Radeon
>   and i915 will need to install the graphics/drm-legacy-kmod. All
>   other users should be able to use one of the LinuxKPI-based ports:
>   graphics/drm-stable-kmod, graphics/drm-next-kmod, graphics/drm-devel-kmod.
>   
>   MFC: never

Could you please create a stable/11 deprecation change.

>   Approved by: core@
> 
> Deleted:
>   head/sys/dev/drm/ati_pcigart.c
...

-- 
Rod Grimes rgri...@freebsd.org
___
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: r338173 - head/stand/lua

2018-08-21 Thread Kyle Evans
Author: kevans
Date: Wed Aug 22 01:52:55 2018
New Revision: 338173
URL: https://svnweb.freebsd.org/changeset/base/338173

Log:
  lualoader: Fix loader.conf(5) EOL validation for 'exec' lines
  
  This includes some light rework to simplify the line parsing, as well.  If
  we hit a line match, we'll always either use the line and move on to the
  next line, or we'll spew out malformed line errors.
  
  We had multiple spots to output the error and set the status based on
  whether we had a non-nil first capture group or failed EOL validation, but
  it was always the same error.  Light rework entails a small label jump to
  skip error handling and elimination of 'found' local.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Wed Aug 22 01:50:12 2018(r338172)
+++ head/stand/lua/config.lua   Wed Aug 22 01:52:55 2018(r338173)
@@ -128,10 +128,20 @@ end
 -- pattern should have no more than two captures patterns, which correspond to
 -- the two parameters (usually 'key' and 'value') that are passed to the
 -- process function.  All trailing characters will be validated.
+--
+-- We have two special entries in this table: the first is the first entry,
+-- a full-line comment.  The second is for 'exec' handling.  Both have a single
+-- capture group, but the difference is that the full-line comment pattern will
+-- match the entire line.  This does not run afoul of the later end of line
+-- validation that we'll do after a match.  However, the 'exec' pattern will.
+-- We document the exceptions with a special 'groups' index that indicates
+-- the number of capture groups, if not two.  We'll use this later to do
+-- validation on the proper entry.
 local pattern_table = {
{
str = "(#.*)",
process = function(_, _)  end,
+   groups = 1,
},
--  module_load="value"
{
@@ -193,6 +203,7 @@ local pattern_table = {
print(MSG_FAILEXEC:format(k))
end
end,
+   groups = 1,
},
--  env_var="value"
{
@@ -394,31 +405,30 @@ function config.parse(text)
 
for line in text:gmatch("([^\n]+)") do
if line:match("^%s*$") == nil then
-   local found = false
-
for _, val in ipairs(pattern_table) do
local pattern = '^%s*' .. val.str .. '%s*(.*)';
+   local cgroups = val.groups or 2
local k, v, c = line:match(pattern)
if k ~= nil then
-   found = true
+   -- Offset by one, drats
+   if cgroups == 1 then
+   c = v
+   v = nil
+   end
 
if isValidComment(c) then
val.process(k, v)
-   else
-   print(MSG_MALFORMED:format(n,
-   line))
-   status = false
+   goto nextline
end
 
break
end
end
 
-   if not found then
-   print(MSG_MALFORMED:format(n, line))
-   status = false
-   end
+   print(MSG_MALFORMED:format(n, line))
+   status = false
end
+   ::nextline::
n = n + 1
end
 
___
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: r338172 - in head: . sys/amd64/conf sys/dev/drm sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/drm2/radeon/reg_srcs sys/dev/drm2/ttm sys/i386/conf sys/modules sys/modules/dr...

2018-08-21 Thread Matt Macy
/modules/drm2/radeonkmsfw/CYPRESS_uvd/Makefile
  head/sys/modules/drm2/radeonkmsfw/HAINAN_ce/Makefile
  head/sys/modules/drm2/radeonkmsfw/HAINAN_mc/Makefile
  head/sys/modules/drm2/radeonkmsfw/HAINAN_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/HAINAN_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/HAINAN_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/JUNIPER_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/JUNIPER_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/JUNIPER_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/Makefile
  head/sys/modules/drm2/radeonkmsfw/Makefile.inc
  head/sys/modules/drm2/radeonkmsfw/OLAND_ce/Makefile
  head/sys/modules/drm2/radeonkmsfw/OLAND_mc/Makefile
  head/sys/modules/drm2/radeonkmsfw/OLAND_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/OLAND_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/OLAND_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/PALM_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/PALM_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/PITCAIRN_ce/Makefile
  head/sys/modules/drm2/radeonkmsfw/PITCAIRN_mc/Makefile
  head/sys/modules/drm2/radeonkmsfw/PITCAIRN_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/PITCAIRN_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/PITCAIRN_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/R100_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/R200_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/R300_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/R420_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/R520_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/R600_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/R600_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/R600_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/R700_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/REDWOOD_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/REDWOOD_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/REDWOOD_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/RS600_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RS690_cp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RS780_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RS780_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV610_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV610_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV620_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV620_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV630_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV630_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV635_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV635_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV670_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV670_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV710_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV710_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV710_uvd/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV730_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV730_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV770_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/RV770_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/SUMO2_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/SUMO2_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/SUMO_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/SUMO_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/SUMO_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/SUMO_uvd/Makefile
  head/sys/modules/drm2/radeonkmsfw/TAHITI_ce/Makefile
  head/sys/modules/drm2/radeonkmsfw/TAHITI_mc/Makefile
  head/sys/modules/drm2/radeonkmsfw/TAHITI_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/TAHITI_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/TAHITI_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/TAHITI_uvd/Makefile
  head/sys/modules/drm2/radeonkmsfw/TURKS_mc/Makefile
  head/sys/modules/drm2/radeonkmsfw/TURKS_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/TURKS_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/VERDE_ce/Makefile
  head/sys/modules/drm2/radeonkmsfw/VERDE_mc/Makefile
  head/sys/modules/drm2/radeonkmsfw/VERDE_me/Makefile
  head/sys/modules/drm2/radeonkmsfw/VERDE_pfp/Makefile
  head/sys/modules/drm2/radeonkmsfw/VERDE_rlc/Makefile
  head/sys/modules/drm2/radeonkmsfw/gen-makefiles
Modified:
  head/UPDATING
  head/sys/amd64/conf/NOTES
  head/sys/i386/conf/NOTES
  head/sys/modules/Makefile
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Wed Aug 22 01:43:11 2018(r338171)
+++ head/UPDATING   Wed Aug 22 01:50:12 2018(r338172)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20180821:
+   drm and drm2 have been removed. Users on powerpc, 32-bit hardware,
+   or with GPUs predating Radeon and i915 will need to install the
+   graphics/drm-legacy-kmod. All other users should be able to use
+

svn commit: r338171 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet

2018-08-21 Thread Cy Schubert
Author: cy
Date: Wed Aug 22 01:43:11 2018
New Revision: 338171
URL: https://svnweb.freebsd.org/changeset/base/338171

Log:
  MFC r338047:
  
  The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
  becomes -1, except these are unsigned integers, so they become very large
  numbers. Thus are always larger than the maximum bucket; the hash table
  insertion fails causing NAT to fail.
  
  This commit ensures that if the index is already zero it is not reduced
  prior to insertion into the hash table.
  
  PR:   208566

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:23:11 
2018(r338170)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:43:11 
2018(r338171)
@@ -2309,14 +2309,16 @@ ipf_nat_delete(softc, nat, logtype)
 
bkt = nat->nat_hv[0] % softn->ipf_nat_table_sz;
nss = >ipf_nat_stats.ns_side[0];
-   nss->ns_bucketlen[bkt]--;
+   if (nss->ns_bucketlen[bkt] > 0)
+   nss->ns_bucketlen[bkt]--;
if (nss->ns_bucketlen[bkt] == 0) {
nss->ns_inuse--;
}
 
bkt = nat->nat_hv[1] % softn->ipf_nat_table_sz;
nss = >ipf_nat_stats.ns_side[1];
-   nss->ns_bucketlen[bkt]--;
+   if (nss->ns_bucketlen[bkt] > 0)
+   nss->ns_bucketlen[bkt]--;
if (nss->ns_bucketlen[bkt] == 0) {
nss->ns_inuse--;
}
___
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: r338171 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet

2018-08-21 Thread Cy Schubert
Author: cy
Date: Wed Aug 22 01:43:11 2018
New Revision: 338171
URL: https://svnweb.freebsd.org/changeset/base/338171

Log:
  MFC r338047:
  
  The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
  becomes -1, except these are unsigned integers, so they become very large
  numbers. Thus are always larger than the maximum bucket; the hash table
  insertion fails causing NAT to fail.
  
  This commit ensures that if the index is already zero it is not reduced
  prior to insertion into the hash table.
  
  PR:   208566

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:23:11 
2018(r338170)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:43:11 
2018(r338171)
@@ -2304,14 +2304,16 @@ ipf_nat_delete(softc, nat, logtype)
 
bkt = nat->nat_hv[0] % softn->ipf_nat_table_sz;
nss = >ipf_nat_stats.ns_side[0];
-   nss->ns_bucketlen[bkt]--;
+   if (nss->ns_bucketlen[bkt] > 0)
+   nss->ns_bucketlen[bkt]--;
if (nss->ns_bucketlen[bkt] == 0) {
nss->ns_inuse--;
}
 
bkt = nat->nat_hv[1] % softn->ipf_nat_table_sz;
nss = >ipf_nat_stats.ns_side[1];
-   nss->ns_bucketlen[bkt]--;
+   if (nss->ns_bucketlen[bkt] > 0)
+   nss->ns_bucketlen[bkt]--;
if (nss->ns_bucketlen[bkt] == 0) {
nss->ns_inuse--;
}
___
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: r338170 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet

2018-08-21 Thread Cy Schubert
Author: cy
Date: Wed Aug 22 01:23:11 2018
New Revision: 338170
URL: https://svnweb.freebsd.org/changeset/base/338170

Log:
  MFC r338046:
  
  Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes
  are situated next to error counters and/or in one instance prior to the
  -1 return from various functions. This was useful in diagnosis of
  PR/208566 and will be handy in the future diagnosing NAT failures.
  
  PR:   208566

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:04:52 
2018(r338169)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:23:11 
2018(r338170)
@@ -2681,6 +2681,7 @@ ipf_nat_newmap(fin, nat, ni)
if ((np->in_nsrcmsk == 0x) && (np->in_spnext == 0)) {
if (l > 0) {
NBUMPSIDEX(1, ns_exhausted, ns_exhausted_1);
+   DT4(ns_exhausted_1, fr_info_t *, fin, nat_t *, 
nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
}
@@ -2698,6 +2699,7 @@ ipf_nat_newmap(fin, nat, ni)
if ((l >= np->in_ppip) || ((l > 0) &&
 !(flags & IPN_TCPUDP))) {
NBUMPSIDEX(1, ns_exhausted, ns_exhausted_2);
+   DT4(ns_exhausted_2, fr_info_t *, fin, nat_t *, 
nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
/*
@@ -2733,6 +2735,7 @@ ipf_nat_newmap(fin, nat, ni)
ipf_ifpaddr(softc, 4, FRI_NORMAL, fin->fin_ifp,
   , NULL) == -1) {
NBUMPSIDEX(1, ns_new_ifpaddr, ns_new_ifpaddr_1);
+   DT4(ns_new_ifpaddr_1, fr_info_t *, fin, nat_t 
*, nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
in.s_addr = ntohl(in6.in4.s_addr);
@@ -2743,6 +2746,7 @@ ipf_nat_newmap(fin, nat, ni)
 */
if (l > 0) {
NBUMPSIDEX(1, ns_exhausted, ns_exhausted_3);
+   DT4(ns_exhausted_3, fr_info_t *, fin, nat_t *, 
nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
in.s_addr = ntohl(fin->fin_saddr);
@@ -2838,6 +2842,7 @@ ipf_nat_newmap(fin, nat, ni)
(np->in_spnext != 0) && (st_port == np->in_spnext) &&
(np->in_snip != 0) && (st_ip == np->in_snip)) {
NBUMPSIDED(1, ns_wrap);
+   DT4(ns_wrap, fr_info_t *, fin, nat_t *, nat, natinfo_t 
*, ni, ipnat_t *, np);
return -1;
}
l++;
@@ -2973,6 +2978,7 @@ ipf_nat_newrdr(fin, nat, ni)
if (ipf_ifpaddr(softc, 4, FRI_NORMAL, fin->fin_ifp,
   , NULL) == -1) {
NBUMPSIDEX(0, ns_new_ifpaddr, ns_new_ifpaddr_2);
+   DT3(ns_new_ifpaddr_2, fr_info_t *, fin, nat_t *, nat, 
natinfo_t, ni);
return -1;
}
in.s_addr = ntohl(in6.in4.s_addr);
@@ -3119,6 +3125,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
 
if (nsp->ns_active >= softn->ipf_nat_table_max) {
NBUMPSIDED(fin->fin_out, ns_table_max);
+   DT2(ns_table_max, nat_stat_t *, nsp, ipf_nat_softc_t *, softn);
return NULL;
}
 
@@ -3133,6 +3140,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
/* Give me a new nat */
KMALLOC(nat, nat_t *);
if (nat == NULL) {
+   DT(ns_memfail);
NBUMPSIDED(fin->fin_out, ns_memfail);
/*
 * Try to automatically tune the max # of entries in the
@@ -3228,6 +3236,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
if ((np->in_apr != NULL) && ((nat->nat_flags & NAT_SLAVE) == 0)) {
if (ipf_proxy_new(fin, nat) == -1) {
NBUMPSIDED(fin->fin_out, ns_appr_fail);
+   DT3(ns_appr_fail, fr_info_t *, fin, nat_t *, nat, 
ipnat_t *, np);
goto badnat;
}
}
@@ -3385,6 +3394,7 @@ ipf_nat_finalise(fin, nat)
}
 
NBUMPSIDED(fin->fin_out, ns_unfinalised);
+   DT2(ns_unfinalised, fr_info_t *, fin, 

svn commit: r338170 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet

2018-08-21 Thread Cy Schubert
Author: cy
Date: Wed Aug 22 01:23:11 2018
New Revision: 338170
URL: https://svnweb.freebsd.org/changeset/base/338170

Log:
  MFC r338046:
  
  Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes
  are situated next to error counters and/or in one instance prior to the
  -1 return from various functions. This was useful in diagnosis of
  PR/208566 and will be handy in the future diagnosing NAT failures.
  
  PR:   208566

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:04:52 
2018(r338169)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:23:11 
2018(r338170)
@@ -2676,6 +2676,7 @@ ipf_nat_newmap(fin, nat, ni)
if ((np->in_nsrcmsk == 0x) && (np->in_spnext == 0)) {
if (l > 0) {
NBUMPSIDEX(1, ns_exhausted, ns_exhausted_1);
+   DT4(ns_exhausted_1, fr_info_t *, fin, nat_t *, 
nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
}
@@ -2693,6 +2694,7 @@ ipf_nat_newmap(fin, nat, ni)
if ((l >= np->in_ppip) || ((l > 0) &&
 !(flags & IPN_TCPUDP))) {
NBUMPSIDEX(1, ns_exhausted, ns_exhausted_2);
+   DT4(ns_exhausted_2, fr_info_t *, fin, nat_t *, 
nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
/*
@@ -2728,6 +2730,7 @@ ipf_nat_newmap(fin, nat, ni)
ipf_ifpaddr(softc, 4, FRI_NORMAL, fin->fin_ifp,
   , NULL) == -1) {
NBUMPSIDEX(1, ns_new_ifpaddr, ns_new_ifpaddr_1);
+   DT4(ns_new_ifpaddr_1, fr_info_t *, fin, nat_t 
*, nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
in.s_addr = ntohl(in6.in4.s_addr);
@@ -2738,6 +2741,7 @@ ipf_nat_newmap(fin, nat, ni)
 */
if (l > 0) {
NBUMPSIDEX(1, ns_exhausted, ns_exhausted_3);
+   DT4(ns_exhausted_3, fr_info_t *, fin, nat_t *, 
nat, natinfo_t *, ni, ipnat_t *, np);
return -1;
}
in.s_addr = ntohl(fin->fin_saddr);
@@ -2833,6 +2837,7 @@ ipf_nat_newmap(fin, nat, ni)
(np->in_spnext != 0) && (st_port == np->in_spnext) &&
(np->in_snip != 0) && (st_ip == np->in_snip)) {
NBUMPSIDED(1, ns_wrap);
+   DT4(ns_wrap, fr_info_t *, fin, nat_t *, nat, natinfo_t 
*, ni, ipnat_t *, np);
return -1;
}
l++;
@@ -2968,6 +2973,7 @@ ipf_nat_newrdr(fin, nat, ni)
if (ipf_ifpaddr(softc, 4, FRI_NORMAL, fin->fin_ifp,
   , NULL) == -1) {
NBUMPSIDEX(0, ns_new_ifpaddr, ns_new_ifpaddr_2);
+   DT3(ns_new_ifpaddr_2, fr_info_t *, fin, nat_t *, nat, 
natinfo_t, ni);
return -1;
}
in.s_addr = ntohl(in6.in4.s_addr);
@@ -3114,6 +3120,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
 
if (nsp->ns_active >= softn->ipf_nat_table_max) {
NBUMPSIDED(fin->fin_out, ns_table_max);
+   DT2(ns_table_max, nat_stat_t *, nsp, ipf_nat_softc_t *, softn);
return NULL;
}
 
@@ -3128,6 +3135,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
/* Give me a new nat */
KMALLOC(nat, nat_t *);
if (nat == NULL) {
+   DT(ns_memfail);
NBUMPSIDED(fin->fin_out, ns_memfail);
/*
 * Try to automatically tune the max # of entries in the
@@ -3223,6 +3231,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
if ((np->in_apr != NULL) && ((nat->nat_flags & NAT_SLAVE) == 0)) {
if (ipf_proxy_new(fin, nat) == -1) {
NBUMPSIDED(fin->fin_out, ns_appr_fail);
+   DT3(ns_appr_fail, fr_info_t *, fin, nat_t *, nat, 
ipnat_t *, np);
goto badnat;
}
}
@@ -3380,6 +3389,7 @@ ipf_nat_finalise(fin, nat)
}
 
NBUMPSIDED(fin->fin_out, ns_unfinalised);
+   DT2(ns_unfinalised, fr_info_t *, fin, 

svn commit: r338169 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet

2018-08-21 Thread Cy Schubert
Author: cy
Date: Wed Aug 22 01:04:52 2018
New Revision: 338169
URL: https://svnweb.freebsd.org/changeset/base/338169

Log:
  MFC r338045:
  
  Expose np (nat_t - an entry in the nat table structure) in the DTrace
  probe when nat fails (label badnat). This is useful in diagnosing
  failed NAT issues and was used in PR/208566.
  
  PR:   208566

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Tue Aug 21 23:42:20 
2018(r338168)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:04:52 
2018(r338169)
@@ -3264,7 +3264,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
 
goto done;
 badnat:
-   DT2(ns_badnatnew, fr_info_t *, fin, nat_t *, nat);
+   DT3(ns_badnatnew, fr_info_t *, fin, nat_t *, nat, ipnat_t *, np);
NBUMPSIDE(fin->fin_out, ns_badnatnew);
if ((hm = nat->nat_hm) != NULL)
ipf_nat_hostmapdel(softc, );
___
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: r338169 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet

2018-08-21 Thread Cy Schubert
Author: cy
Date: Wed Aug 22 01:04:52 2018
New Revision: 338169
URL: https://svnweb.freebsd.org/changeset/base/338169

Log:
  MFC r338045:
  
  Expose np (nat_t - an entry in the nat table structure) in the DTrace
  probe when nat fails (label badnat). This is useful in diagnosing
  failed NAT issues and was used in PR/208566.
  
  PR:   208566

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Tue Aug 21 23:42:20 
2018(r338168)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 22 01:04:52 
2018(r338169)
@@ -3259,7 +3259,7 @@ ipf_nat_add(fin, np, natsave, flags, direction)
 
goto done;
 badnat:
-   DT2(ns_badnatnew, fr_info_t *, fin, nat_t *, nat);
+   DT3(ns_badnatnew, fr_info_t *, fin, nat_t *, nat, ipnat_t *, np);
NBUMPSIDE(fin->fin_out, ns_badnatnew);
if ((hm = nat->nat_hm) != NULL)
ipf_nat_hostmapdel(softc, );
___
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: r337866 - in head/sys: net netinet netinet6

2018-08-21 Thread Matthew Macy
On Tue, Aug 21, 2018 at 16:52 Mark Johnston  wrote:

> On Tue, Aug 21, 2018 at 04:00:10PM -0700, Matthew Macy wrote:
> > Yes. See r338162. Thanks.
>
> You missed instances of the same bug in in_mcast.c and in6_mcast.c.



Thanks

>
>
> > On Tue, Aug 21, 2018 at 2:24 PM Gleb Smirnoff 
> wrote:
> > > On Wed, Aug 15, 2018 at 08:23:09PM +, Matt Macy wrote:
> > > M> @@ -3772,8 +3775,11 @@ if_delmulti_locked(struct ifnet *ifp, struct
> > > ifmultiad
> > > M>  ll_ifma->ifma_ifp = NULL;   /* XXX */
> > > M>  if (--ll_ifma->ifma_refcount == 0) {
> > > M>  if (ifp != NULL) {
> > > M> -CK_STAILQ_REMOVE(>if_multiaddrs,
> > > ll_ifma, ifmultiaddr,
> > > M> -ifma_link);
> > > M> +if (ll_ifma->ifma_flags &
> IFMA_F_ENQUEUED)
> > > {
> > > M> +
> > > CK_STAILQ_REMOVE(>if_multiaddrs, ll_ifma, ifmultiaddr,
> > > M> +ifma_link);
> > > M> +ifma->ifma_flags &=
> > > ~IFMA_F_ENQUEUED;
> > > M> +}
> > > M>  }
> > > M>  if_freemulti(ll_ifma);
> > > M>  }
> > >
> > > Coverity suggested there is a cut and paste mistake here, and it is
> > > compilable.
> > > After quick glance I tend to agree. Looks like flag is cleared on wrong
> > > ifma.
> > >
> > > --
> > > Gleb Smirnoff
> > >
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r337866 - in head/sys: net netinet netinet6

2018-08-21 Thread Mark Johnston
On Tue, Aug 21, 2018 at 04:00:10PM -0700, Matthew Macy wrote:
> Yes. See r338162. Thanks.

You missed instances of the same bug in in_mcast.c and in6_mcast.c.

> On Tue, Aug 21, 2018 at 2:24 PM Gleb Smirnoff  wrote:
> > On Wed, Aug 15, 2018 at 08:23:09PM +, Matt Macy wrote:
> > M> @@ -3772,8 +3775,11 @@ if_delmulti_locked(struct ifnet *ifp, struct
> > ifmultiad
> > M>  ll_ifma->ifma_ifp = NULL;   /* XXX */
> > M>  if (--ll_ifma->ifma_refcount == 0) {
> > M>  if (ifp != NULL) {
> > M> -CK_STAILQ_REMOVE(>if_multiaddrs,
> > ll_ifma, ifmultiaddr,
> > M> -ifma_link);
> > M> +if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED)
> > {
> > M> +
> > CK_STAILQ_REMOVE(>if_multiaddrs, ll_ifma, ifmultiaddr,
> > M> +ifma_link);
> > M> +ifma->ifma_flags &=
> > ~IFMA_F_ENQUEUED;
> > M> +}
> > M>  }
> > M>  if_freemulti(ll_ifma);
> > M>  }
> >
> > Coverity suggested there is a cut and paste mistake here, and it is
> > compilable.
> > After quick glance I tend to agree. Looks like flag is cleared on wrong
> > ifma.
> >
> > --
> > Gleb Smirnoff
> >
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338168 - head/stand/lua

2018-08-21 Thread Kyle Evans
Author: kevans
Date: Tue Aug 21 23:42:20 2018
New Revision: 338168
URL: https://svnweb.freebsd.org/changeset/base/338168

Log:
  lualoader: Refactor config line expressions
  
  A couple of issues addressed:
  
  1.) Modules with - in the name were not recognized as modules
  2.) The module regex was repeated for each place a module name may appear
  3.) The 'strip leading space' bits were repeated for each expression
  4.) The trailing 'comment validation' stuff was repeated every expression
  
  #4 still has some more work to be done. exec lines, for instance, don't
  capture a 'value' -- there's only one capture pattern. This throws off the
  'c' value that we match, so the trailing bits aren't *actually* being
  validated. This isn't a new issue, though, so a future comit will address
  this.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Tue Aug 21 23:34:30 2018(r338167)
+++ head/stand/lua/config.lua   Tue Aug 21 23:42:20 2018(r338168)
@@ -54,6 +54,8 @@ local MSG_KERNLOADING = "Loading kernel..."
 local MSG_MODLOADING = "Loading configured modules..."
 local MSG_MODLOADFAIL = "Could not load one or more modules!"
 
+local MODULEEXPR = '([%w-_]+)'
+
 local function restoreEnv()
-- Examine changed environment variables
for k, v in pairs(env_changed) do
@@ -121,14 +123,19 @@ local function processEnvVar(value)
return value
 end
 
+-- str in this table is a regex pattern.  It will automatically be anchored to
+-- the beginning of a line and any preceding whitespace will be skipped.  The
+-- pattern should have no more than two captures patterns, which correspond to
+-- the two parameters (usually 'key' and 'value') that are passed to the
+-- process function.  All trailing characters will be validated.
 local pattern_table = {
{
-   str = "^%s*(#.*)",
+   str = "(#.*)",
process = function(_, _)  end,
},
--  module_load="value"
{
-   str = "^%s*([%w_]+)_load%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_load%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
if modules[k] == nil then
modules[k] = {}
@@ -138,49 +145,49 @@ local pattern_table = {
},
--  module_name="value"
{
-   str = "^%s*([%w_]+)_name%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_name%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
setKey(k, "name", v)
end,
},
--  module_type="value"
{
-   str = "^%s*([%w_]+)_type%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_type%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
setKey(k, "type", v)
end,
},
--  module_flags="value"
{
-   str = "^%s*([%w_]+)_flags%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_flags%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
setKey(k, "flags", v)
end,
},
--  module_before="value"
{
-   str = "^%s*([%w_]+)_before%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_before%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
setKey(k, "before", v)
end,
},
--  module_after="value"
{
-   str = "^%s*([%w_]+)_after%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_after%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
setKey(k, "after", v)
end,
},
--  module_error="value"
{
-   str = "^%s*([%w_]+)_error%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = MODULEEXPR .. "_error%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
setKey(k, "error", v)
end,
},
--  exec="command"
{
-   str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = "exec%s*=%s*\"([%w%s%p]-)\"",
process = function(k, _)
if cli_execute_unparsed(k) ~= 0 then
print(MSG_FAILEXEC:format(k))
@@ -189,7 +196,7 @@ local pattern_table = {
},
--  env_var="value"
{
-   str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
+   str = "([%w%p]+)%s*=%s*\"([%w%s%p]-)\"",
process = function(k, v)
if setEnv(k, processEnvVar(v)) ~= 0 then
print(MSG_FAILSETENV:format(k, v))
@@ -198,7 +205,7 @@ local 

svn commit: r338167 - head/stand/lua

2018-08-21 Thread Kyle Evans
Author: kevans
Date: Tue Aug 21 23:34:30 2018
New Revision: 338167
URL: https://svnweb.freebsd.org/changeset/base/338167

Log:
  lualoader: Just compare expression directly

Modified:
  head/stand/lua/core.lua

Modified: head/stand/lua/core.lua
==
--- head/stand/lua/core.lua Tue Aug 21 23:33:38 2018(r338166)
+++ head/stand/lua/core.lua Tue Aug 21 23:34:30 2018(r338167)
@@ -328,8 +328,7 @@ end
 
 -- Is the menu skipped in the environment in which we've booted?
 function core.isMenuSkipped()
-   c = string.lower(loader.getenv("beastie_disable") or "")
-   return c == "yes"
+   return string.lower(loader.getenv("beastie_disable") or "") == "yes"
 end
 
 -- This may be a better candidate for a 'utility' module.
___
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: r338166 - head/sys/dev/cxgbe

2018-08-21 Thread Navdeep Parhar
Author: np
Date: Tue Aug 21 23:33:38 2018
New Revision: 338166
URL: https://svnweb.freebsd.org/changeset/base/338166

Log:
  cxgbe(4): Be explicit about ignoring the return value of cmpset in some
  cases.
  
  Reported by:  Coverity (CIDs 1009398, 1009400, 1009401, 1357325, 1394783).  
All false positives.
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_netmap.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_netmap.c
==
--- head/sys/dev/cxgbe/t4_netmap.c  Tue Aug 21 23:12:46 2018
(r338165)
+++ head/sys/dev/cxgbe/t4_netmap.c  Tue Aug 21 23:33:38 2018
(r338166)
@@ -385,7 +385,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi
t4_write_reg(sc, sc->sge_kdoorbell_reg,
nm_rxq->fl_db_val | V_PIDX(j));
 
-   atomic_cmpset_int(_rxq->nm_state, NM_OFF, NM_ON);
+   (void) atomic_cmpset_int(_rxq->nm_state, NM_OFF, NM_ON);
}
 
for_each_nm_txq(vi, i, nm_txq) {

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Tue Aug 21 23:12:46 2018(r338165)
+++ head/sys/dev/cxgbe/t4_sge.c Tue Aug 21 23:33:38 2018(r338166)
@@ -1383,7 +1383,7 @@ t4_intr_evt(void *arg)
 
if (atomic_cmpset_int(>state, IQS_IDLE, IQS_BUSY)) {
service_iq(iq, 0);
-   atomic_cmpset_int(>state, IQS_BUSY, IQS_IDLE);
+   (void) atomic_cmpset_int(>state, IQS_BUSY, IQS_IDLE);
}
 }
 
@@ -1397,7 +1397,7 @@ t4_intr(void *arg)
 
if (atomic_cmpset_int(>state, IQS_IDLE, IQS_BUSY)) {
service_iq_fl(iq, 0);
-   atomic_cmpset_int(>state, IQS_BUSY, IQS_IDLE);
+   (void) atomic_cmpset_int(>state, IQS_BUSY, IQS_IDLE);
}
 }
 
@@ -1412,7 +1412,7 @@ t4_nm_intr(void *arg)
 
if (atomic_cmpset_int(_rxq->nm_state, NM_ON, NM_BUSY)) {
service_nm_rxq(nm_rxq);
-   atomic_cmpset_int(_rxq->nm_state, NM_BUSY, NM_ON);
+   (void) atomic_cmpset_int(_rxq->nm_state, NM_BUSY, NM_ON);
}
 }
 
@@ -1498,7 +1498,7 @@ service_iq(struct sge_iq *iq, int budget)
if (atomic_cmpset_int(>state, IQS_IDLE,
IQS_BUSY)) {
if (service_iq_fl(q, q->qsize / 16) == 
0) {
-   atomic_cmpset_int(>state,
+   (void) 
atomic_cmpset_int(>state,
IQS_BUSY, IQS_IDLE);
} else {
STAILQ_INSERT_TAIL(, q,
@@ -1546,7 +1546,7 @@ service_iq(struct sge_iq *iq, int budget)
q = STAILQ_FIRST();
STAILQ_REMOVE_HEAD(, link);
if (service_iq_fl(q, q->qsize / 8) == 0)
-   atomic_cmpset_int(>state, IQS_BUSY, IQS_IDLE);
+   (void) atomic_cmpset_int(>state, IQS_BUSY, IQS_IDLE);
else
STAILQ_INSERT_TAIL(, q, link);
}
___
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: r338165 - head/usr.sbin/newsyslog

2018-08-21 Thread Conrad Meyer
Author: cem
Date: Tue Aug 21 23:12:46 2018
New Revision: 338165
URL: https://svnweb.freebsd.org/changeset/base/338165

Log:
  newsyslog(8): Reject configurations that specify setuid or executable logs
  
  Prevent some classes of foot-shooting that may result in permissions
  problems.
  
  Reviewed by:  dab, delphij, vangyzen (earlier version)
  Relnotes: yes (behavior change)
  Sponsored by: Dell EMC Isilon
  Differential Revision:D16831

Modified:
  head/usr.sbin/newsyslog/newsyslog.c
  head/usr.sbin/newsyslog/newsyslog.conf.5

Modified: head/usr.sbin/newsyslog/newsyslog.c
==
--- head/usr.sbin/newsyslog/newsyslog.c Tue Aug 21 23:11:26 2018
(r338164)
+++ head/usr.sbin/newsyslog/newsyslog.c Tue Aug 21 23:12:46 2018
(r338165)
@@ -1193,6 +1193,12 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl
if (!sscanf(q, "%o", >permissions))
errx(1, "error in config file; bad permissions:\n%s",
errline);
+   if ((working->permissions & ~DEFFILEMODE) != 0) {
+   warnx("File mode bits 0%o changed to 0%o in line:\n%s",
+   working->permissions,
+   working->permissions & DEFFILEMODE, errline);
+   working->permissions &= DEFFILEMODE;
+   }
 
q = parse = missing_field(sob(parse + 1), errline);
parse = son(parse);

Modified: head/usr.sbin/newsyslog/newsyslog.conf.5
==
--- head/usr.sbin/newsyslog/newsyslog.conf.5Tue Aug 21 23:11:26 2018
(r338164)
+++ head/usr.sbin/newsyslog/newsyslog.conf.5Tue Aug 21 23:12:46 2018
(r338165)
@@ -21,7 +21,7 @@
 .\" the suitability of this software for any purpose.  It is
 .\" provided "as is" without express or implied warranty.
 .\"
-.Dd January 15, 2018
+.Dd August 21, 2018
 .Dt NEWSYSLOG.CONF 5
 .Os
 .Sh NAME
@@ -96,6 +96,11 @@ or
 .Pa /etc/group .
 .It Ar mode
 Specify the file mode of the log file and archives.
+Valid mode bits are
+.Dv 0666 .
+(That is, read and write permissions for the rotated log may be specified for
+the owner, group, and others.)
+All other mode bits are ignored.
 .It Ar count
 Specify the maximum number of archive files which may exist.
 This does not consider the current log file.
___
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: r338164 - head/usr.sbin/bhyve

2018-08-21 Thread Marcelo Araujo
Author: araujo
Date: Tue Aug 21 23:11:26 2018
New Revision: 338164
URL: https://svnweb.freebsd.org/changeset/base/338164

Log:
  Fix resource leak when using strdup(3).
  
  Reported by:  Coverity
  CID:  1394929
  Sponsored by: iXsystems Inc.

Modified:
  head/usr.sbin/bhyve/pci_nvme.c

Modified: head/usr.sbin/bhyve/pci_nvme.c
==
--- head/usr.sbin/bhyve/pci_nvme.c  Tue Aug 21 23:03:02 2018
(r338163)
+++ head/usr.sbin/bhyve/pci_nvme.c  Tue Aug 21 23:11:26 2018
(r338164)
@@ -1726,6 +1726,7 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o
sc->nvstore.sectsz_bits = 12;
if (sc->nvstore.ctx == NULL) {
perror("Unable to allocate RAM");
+   free(uopt);
return (-1);
}
} else if (optidx == 0) {
@@ -1734,12 +1735,14 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o
sc->nvstore.ctx = blockif_open(xopts, bident);
if (sc->nvstore.ctx == NULL) {
perror("Could not open backing file");
+   free(uopt);
return (-1);
}
sc->nvstore.type = NVME_STOR_BLOCKIF;
sc->nvstore.size = blockif_size(sc->nvstore.ctx);
} else {
fprintf(stderr, "Invalid option %s\n", xopts);
+   free(uopt);
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338163 - head/sys/netinet6

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Tue Aug 21 23:03:02 2018
New Revision: 338163
URL: https://svnweb.freebsd.org/changeset/base/338163

Log:
  Fix null deref in mld_v1_transmit_report
  
  After r337866 it is possible for an in_multi6 to be referenced while
  mid teardown. Handle case of cleared ifnet pointer.
  
  Reported by:  ae

Modified:
  head/sys/netinet6/mld6.c

Modified: head/sys/netinet6/mld6.c
==
--- head/sys/netinet6/mld6.cTue Aug 21 22:59:22 2018(r338162)
+++ head/sys/netinet6/mld6.cTue Aug 21 23:03:02 2018(r338163)
@@ -1798,8 +1798,11 @@ mld_v1_transmit_report(struct in6_multi *in6m, const i
 
IN6_MULTI_LIST_LOCK_ASSERT();
MLD_LOCK_ASSERT();
-
+   
ifp = in6m->in6m_ifp;
+   /* in process of being freed */
+   if (ifp == NULL)
+   return (0);
ia = in6ifa_ifpforlinklocal(ifp, IN6_IFF_NOTREADY|IN6_IFF_ANYCAST);
/* ia may be NULL if link-local address is tentative. */
 
___
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: r337866 - in head/sys: net netinet netinet6

2018-08-21 Thread Matthew Macy
Yes. See r338162. Thanks.
-M

On Tue, Aug 21, 2018 at 2:24 PM Gleb Smirnoff  wrote:

> On Wed, Aug 15, 2018 at 08:23:09PM +, Matt Macy wrote:
> M> @@ -3772,8 +3775,11 @@ if_delmulti_locked(struct ifnet *ifp, struct
> ifmultiad
> M>  ll_ifma->ifma_ifp = NULL;   /* XXX */
> M>  if (--ll_ifma->ifma_refcount == 0) {
> M>  if (ifp != NULL) {
> M> -CK_STAILQ_REMOVE(>if_multiaddrs,
> ll_ifma, ifmultiaddr,
> M> -ifma_link);
> M> +if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED)
> {
> M> +
> CK_STAILQ_REMOVE(>if_multiaddrs, ll_ifma, ifmultiaddr,
> M> +ifma_link);
> M> +ifma->ifma_flags &=
> ~IFMA_F_ENQUEUED;
> M> +}
> M>  }
> M>  if_freemulti(ll_ifma);
> M>  }
>
> Coverity suggested there is a cut and paste mistake here, and it is
> compilable.
> After quick glance I tend to agree. Looks like flag is cleared on wrong
> ifma.
>
> --
> Gleb Smirnoff
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338162 - head/sys/net

2018-08-21 Thread Matt Macy
Author: mmacy
Date: Tue Aug 21 22:59:22 2018
New Revision: 338162
URL: https://svnweb.freebsd.org/changeset/base/338162

Log:
  fix copy/paste error when clearing ifma flag
  
  CID: 1395119
  Reported by:  vangyzen

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Tue Aug 21 22:19:34 2018(r338161)
+++ head/sys/net/if.c   Tue Aug 21 22:59:22 2018(r338162)
@@ -3779,7 +3779,7 @@ if_delmulti_locked(struct ifnet *ifp, struct ifmultiad
if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) {
CK_STAILQ_REMOVE(>if_multiaddrs, 
ll_ifma, ifmultiaddr,
ifma_link);
-   ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
+   ll_ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
}
}
if_freemulti(ll_ifma);
___
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: r338161 - head/sys/dev/cxgbe/tom

2018-08-21 Thread Navdeep Parhar
Author: np
Date: Tue Aug 21 22:19:34 2018
New Revision: 338161
URL: https://svnweb.freebsd.org/changeset/base/338161

Log:
  cxgbe/tom: Make sure 'matched' is always initialized before use.
  
  Reported by:  Coverity (CID 1390894)
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/tom/t4_tom.c

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==
--- head/sys/dev/cxgbe/tom/t4_tom.c Tue Aug 21 22:15:57 2018
(r338160)
+++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Aug 21 22:19:34 2018
(r338161)
@@ -1269,6 +1269,7 @@ lookup_offload_policy(struct adapter *sc, int open_typ
if (pkt == NULL || pktlen == 0 || buflen == 0)
return (_offloading_settings);
 
+   matched = 0;
r = >rule[0];
for (i = 0; i < op->nrules; i++, r++) {
if (r->open_type != open_type &&
___
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: r338160 - head/sys/dev/cxgbe

2018-08-21 Thread Navdeep Parhar
Author: np
Date: Tue Aug 21 22:15:57 2018
New Revision: 338160
URL: https://svnweb.freebsd.org/changeset/base/338160

Log:
  cxgbe(4): Do not leak memory in case of errors during VI initialization.
  
  Reported by:  Coverity (CID 1392026)
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Aug 21 21:42:17 2018
(r338159)
+++ head/sys/dev/cxgbe/t4_main.cTue Aug 21 22:15:57 2018
(r338160)
@@ -5099,6 +5099,7 @@ vi_full_init(struct vi_info *vi)
rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss,
vi->rss_size);
if (rc != 0) {
+   free(rss, M_CXGBE);
if_printf(ifp, "rss_config failed: %d\n", rc);
goto done;
}
@@ -5147,6 +5148,7 @@ vi_full_init(struct vi_info *vi)
 #endif
rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, hashen, rss[0], 0, 0);
if (rc != 0) {
+   free(rss, M_CXGBE);
if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc);
goto done;
}
___
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: r338159 - head/sys/dev/cxgbe

2018-08-21 Thread Navdeep Parhar
Author: np
Date: Tue Aug 21 21:42:17 2018
New Revision: 338159
URL: https://svnweb.freebsd.org/changeset/base/338159

Log:
  cxgbe(4): Make it clear that VI_INIT_DONE implies vi->ntxq > 0, and so
  rc will never be returned uninitialized.
  
  Reported by:  Coverity (CID 1394884).  This is a false positive though.
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_sched.c

Modified: head/sys/dev/cxgbe/t4_sched.c
==
--- head/sys/dev/cxgbe/t4_sched.c   Tue Aug 21 21:32:51 2018
(r338158)
+++ head/sys/dev/cxgbe/t4_sched.c   Tue Aug 21 21:42:17 2018
(r338159)
@@ -394,6 +394,7 @@ t4_set_sched_queue(struct adapter *sc, struct t4_sched
/* Checking VI_INIT_DONE outside a synch-op is a harmless race here. */
if (!(vi->flags & VI_INIT_DONE))
return (EAGAIN);
+   MPASS(vi->ntxq > 0);
 
if (!in_range(p->queue, 0, vi->ntxq - 1) ||
!in_range(p->cl, 0, sc->chip_params->nsched_cls - 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"


Re: svn commit: r337932 - in head/sys: net netinet

2018-08-21 Thread Gleb Smirnoff
On Tue, Aug 21, 2018 at 02:28:27PM -0700, Navdeep Parhar wrote:
N> On 8/21/18 2:26 PM, Gleb Smirnoff wrote:
N> >   Navdeep,
N> > 
N> > On Thu, Aug 16, 2018 at 11:46:38PM +, Navdeep Parhar wrote:
N> > N> Author: np
N> > N> Date: Thu Aug 16 23:46:38 2018
N> > N> New Revision: 337932
N> > N> URL: https://svnweb.freebsd.org/changeset/base/337932
N> > N> 
N> > N> Log:
N> > N>   Add the ability to look up the 3b PCP of a VLAN interface.  Use it in
N> > N>   toe_l2_resolve to fill up the complete vtag and not just the vid.
N> > N>   
N> > N>   Reviewed by:  kib@
N> > N>   MFC after:1 week
N> > N>   Sponsored by: Chelsio Communications
N> > N>   Differential Revision:https://reviews.freebsd.org/D16752
N> > ...
N> > N> +static int
N> > N> +vlan_pcp(struct ifnet *ifp, uint16_t *pcpp)
N> > N> +{
N> > N> +   struct ifvlan *ifv;
N> > N> +
N> > N> +   if (ifp->if_type != IFT_L2VLAN)
N> > N> +   return (EINVAL);
N> > N> +   ifv = ifp->if_softc;
N> > N> +   *pcpp = ifv->ifv_pcp;
N> > N> +   return (0);
N> > N> +}
N> > 
N> > Is there any good reason not to assert that ifp->if_type == IFT_L2VLAN?
N> > 
N> 
N> I can't think of any.  But I wrote it this way to match the vlan_tag()
N> function a few lines above.

Hmm, this comes from OFED import. But at the same time it brings macros
like this:

+   (_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL
+#defineVLAN_TAG(_ifp, _tag)\
+   (_ifp)->if_type == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_tag)) : EINVAL
+#defineVLAN_COOKIE(_ifp)   \
+   (_ifp)->if_type == IFT_L2VLAN ? (*vlan_cookie_p)((_ifp)) : NULL
+#defineVLAN_SETCOOKIE(_ifp, _cookie)   \
+   (_ifp)->if_type == IFT_L2VLAN ? \
+   (*vlan_setcookie_p)((_ifp), (_cookie)) : EINVAL
+#defineVLAN_DEVAT(_ifp, _tag)  \
+   (_ifp)->if_vlantrunk != NULL ? (*vlan_devat_p)((_ifp), (_tag)) : NULL

I think it is entirely safe to convert these checks inside functions
into assertions.

-- 
Gleb Smirnoff
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338158 - head/sys/dev/cxgbe

2018-08-21 Thread Navdeep Parhar
Author: np
Date: Tue Aug 21 21:32:51 2018
New Revision: 338158
URL: https://svnweb.freebsd.org/changeset/base/338158

Log:
  cxgbe(4): Check the RO bit properly before disabling relaxed ordering.
  
  Reported by:  Coverity (CID 1384286)
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Aug 21 21:30:19 2018
(r338157)
+++ head/sys/dev/cxgbe/t4_main.cTue Aug 21 21:32:51 2018
(r338158)
@@ -861,7 +861,7 @@ t4_attach(device_t dev)
v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2);
sc->params.pci.mps = 128 << ((v & PCIEM_CTL_MAX_PAYLOAD) >> 5);
if (pcie_relaxed_ordering == 0 &&
-   (v | PCIEM_CTL_RELAXED_ORD_ENABLE) != 0) {
+   (v & PCIEM_CTL_RELAXED_ORD_ENABLE) != 0) {
v &= ~PCIEM_CTL_RELAXED_ORD_ENABLE;
pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2);
} else if (pcie_relaxed_ordering == 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: r338157 - in head/sys: arm64/conf conf

2018-08-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Aug 21 21:30:19 2018
New Revision: 338157
URL: https://svnweb.freebsd.org/changeset/base/338157

Log:
  Add muge(4) to the arm64 GENERIC kernel
  
  muge(4) is the USB ethernet adapter that is used in RPi 3B+. Shipping it
  in GENERIC kernel allows using NFS root out of the box instead of either
  building custom kernel or modifying loader.conf for early loading of 
if_muge.ko
  
  No objections:emaste

Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Tue Aug 21 21:08:58 2018(r338156)
+++ head/sys/arm64/conf/GENERIC Tue Aug 21 21:30:19 2018(r338157)
@@ -188,6 +188,7 @@ device  ukbd# Keyboard
 device umass   # Disks/Mass storage - Requires scbus 
and da
 
 # USB ethernet support
+device muge
 device smcphy
 device smsc
 

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Aug 21 21:08:58 2018(r338156)
+++ head/sys/conf/files Tue Aug 21 21:30:19 2018(r338157)
@@ -3298,6 +3298,7 @@ dev/usb/net/if_cue.c  optional cue
 dev/usb/net/if_ipheth.coptional ipheth
 dev/usb/net/if_kue.c   optional kue
 dev/usb/net/if_mos.c   optional mos
+dev/usb/net/if_muge.c  optional muge
 dev/usb/net/if_rue.c   optional rue
 dev/usb/net/if_smsc.c  optional smsc
 dev/usb/net/if_udav.c  optional udav
___
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: r337932 - in head/sys: net netinet

2018-08-21 Thread Navdeep Parhar
On 8/21/18 2:26 PM, Gleb Smirnoff wrote:
>   Navdeep,
> 
> On Thu, Aug 16, 2018 at 11:46:38PM +, Navdeep Parhar wrote:
> N> Author: np
> N> Date: Thu Aug 16 23:46:38 2018
> N> New Revision: 337932
> N> URL: https://svnweb.freebsd.org/changeset/base/337932
> N> 
> N> Log:
> N>   Add the ability to look up the 3b PCP of a VLAN interface.  Use it in
> N>   toe_l2_resolve to fill up the complete vtag and not just the vid.
> N>   
> N>   Reviewed by: kib@
> N>   MFC after:   1 week
> N>   Sponsored by:Chelsio Communications
> N>   Differential Revision:   https://reviews.freebsd.org/D16752
> ...
> N> +static int
> N> +vlan_pcp(struct ifnet *ifp, uint16_t *pcpp)
> N> +{
> N> +  struct ifvlan *ifv;
> N> +
> N> +  if (ifp->if_type != IFT_L2VLAN)
> N> +  return (EINVAL);
> N> +  ifv = ifp->if_softc;
> N> +  *pcpp = ifv->ifv_pcp;
> N> +  return (0);
> N> +}
> 
> Is there any good reason not to assert that ifp->if_type == IFT_L2VLAN?
> 

I can't think of any.  But I wrote it this way to match the vlan_tag()
function a few lines above.

Regards,
Navdeep
___
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: r337932 - in head/sys: net netinet

2018-08-21 Thread Gleb Smirnoff
  Navdeep,

On Thu, Aug 16, 2018 at 11:46:38PM +, Navdeep Parhar wrote:
N> Author: np
N> Date: Thu Aug 16 23:46:38 2018
N> New Revision: 337932
N> URL: https://svnweb.freebsd.org/changeset/base/337932
N> 
N> Log:
N>   Add the ability to look up the 3b PCP of a VLAN interface.  Use it in
N>   toe_l2_resolve to fill up the complete vtag and not just the vid.
N>   
N>   Reviewed by:   kib@
N>   MFC after: 1 week
N>   Sponsored by:  Chelsio Communications
N>   Differential Revision: https://reviews.freebsd.org/D16752
...
N> +static int
N> +vlan_pcp(struct ifnet *ifp, uint16_t *pcpp)
N> +{
N> +struct ifvlan *ifv;
N> +
N> +if (ifp->if_type != IFT_L2VLAN)
N> +return (EINVAL);
N> +ifv = ifp->if_softc;
N> +*pcpp = ifv->ifv_pcp;
N> +return (0);
N> +}

Is there any good reason not to assert that ifp->if_type == IFT_L2VLAN?

-- 
Gleb Smirnoff
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r337866 - in head/sys: net netinet netinet6

2018-08-21 Thread Gleb Smirnoff
On Wed, Aug 15, 2018 at 08:23:09PM +, Matt Macy wrote:
M> @@ -3772,8 +3775,11 @@ if_delmulti_locked(struct ifnet *ifp, struct ifmultiad
M>  ll_ifma->ifma_ifp = NULL;   /* XXX */
M>  if (--ll_ifma->ifma_refcount == 0) {
M>  if (ifp != NULL) {
M> -CK_STAILQ_REMOVE(>if_multiaddrs, ll_ifma, 
ifmultiaddr,
M> -ifma_link);
M> +if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) {
M> +CK_STAILQ_REMOVE(>if_multiaddrs, 
ll_ifma, ifmultiaddr,
M> +ifma_link);
M> +ifma->ifma_flags &= ~IFMA_F_ENQUEUED;
M> +}
M>  }
M>  if_freemulti(ll_ifma);
M>  }

Coverity suggested there is a cut and paste mistake here, and it is compilable.
After quick glance I tend to agree. Looks like flag is cleared on wrong ifma.

-- 
Gleb Smirnoff
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338156 - head/sys/dev/cxgbe/common

2018-08-21 Thread Navdeep Parhar
Author: np
Date: Tue Aug 21 21:08:58 2018
New Revision: 338156
URL: https://svnweb.freebsd.org/changeset/base/338156

Log:
  cxgbe(4): Avoid overflow while calculating channel rate.
  
  Reported by:  Coverity (CID 1008352)
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Tue Aug 21 19:28:53 2018
(r338155)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Tue Aug 21 21:08:58 2018
(r338156)
@@ -5770,7 +5770,7 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, 
  */
 static u64 chan_rate(struct adapter *adap, unsigned int bytes256)
 {
-   u64 v = bytes256 * adap->params.vpd.cclk;
+   u64 v = (u64)bytes256 * adap->params.vpd.cclk;
 
return v * 62 + v / 2;
 }
___
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: r337978 - in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv

2018-08-21 Thread Kyle Evans
On Tue, Aug 21, 2018 at 1:26 PM, Brooks Davis  wrote:
> On Mon, Aug 20, 2018 at 08:08:01PM +0200, Michal Meloun wrote:
>>
>> On 20.08.2018 18:02, Kyle Evans wrote:
>> > On Mon, Aug 20, 2018 at 11:00 AM, Michal Meloun  
>> > wrote:
>> >>
>> >> On 17.08.2018 18:19, Brooks Davis wrote:
>> >>> Author: brooks
>> >>> Date: Fri Aug 17 16:19:47 2018
>> >>> New Revision: 337978
>> >>> URL: https://svnweb.freebsd.org/changeset/base/337978
>> >>>
>> >>> Log:
>> >>>   Rework rtld's TLS Variant I implementation to match r326794
>> >>>
>> >>>   The above commit fixed handling overaligned TLS segments in libc's
>> >>>   TLS Variant I implementation, but rtld provides its own implementation
>> >>>   for dynamically-linked executables which lacks these fixes.  Thus,
>> >>>   port these changes to rtld.
>> >>>
>> >>>   Submitted by:   James Clarke
>> >>>   Reviewed by:kbowling
>> >>>   Testing byL kbowling (powerpc64), br (riscv), kevans (armv7)
>> >>>   Obtained from:  CheriBSD
>> >>>   Sponsored by:   DARPA, AFRL
>> >>>   Differential Revision:  https://reviews.freebsd.org/D16510
>> >>>
>> >>> Modified:
>> >>>   head/libexec/rtld-elf/aarch64/rtld_machdep.h
>> >>>   head/libexec/rtld-elf/arm/rtld_machdep.h
>> >>>   head/libexec/rtld-elf/mips/rtld_machdep.h
>> >>>   head/libexec/rtld-elf/powerpc/rtld_machdep.h
>> >>>   head/libexec/rtld-elf/powerpc64/rtld_machdep.h
>> >>>   head/libexec/rtld-elf/riscv/rtld_machdep.h
>> >>>   head/libexec/rtld-elf/rtld.c
>> >>>
>> >> This commit breaks TLS handling for (at least) armv7. Can you please
>> >> revert it until I will be able to identify where is problem?
>> >> In my case, the libc _ThreadRuneLocale symbol is not zero on program 
>> >> start.
>> >>
>> >
>> > Interesting that I didn't hit this on my armv7 test
>> >
>>
>> No idea yet. For me, it breaks all ctype (isspace()..) related function.
>> Originally, I found that bash port gets broken. Its funny if shell takes
>> 'a' as non-alphanumeric character, 'x' as whitespace, ...
>> Anyway, give me a while - I need to write testcase because bas is too
>> complex for effective debugging. This commit isn't fundamentally bad, it
>> works for jemalloc thread local variables so I think that only some edge
>> case (tbss handling is my candidate) is affected.
>
> Reverted in r338149.
>
> It's quite surprising to me that the system would boot in this state.
> Is there anything non-default about your build environment?
>

It seems more likely that there's something terribly wrong with my
build environment, but I haven't quite picked out what yet. =(
___
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: r338155 - in head: etc etc/bluetooth etc/defaults lib/libbluetooth usr.sbin/bluetooth/hccontrol usr.sbin/bluetooth/hcsecd

2018-08-21 Thread Brad Davis
Author: brd
Date: Tue Aug 21 19:28:53 2018
New Revision: 338155
URL: https://svnweb.freebsd.org/changeset/base/338155

Log:
  Move all bluetooth related config files out of etc
  
  This helps with pkgbase by switching to CONFS so they are properly tagged as
  config files.
  
  Approved by:  will (mentor)
  Differential Revision:https://reviews.freebsd.org/D16833

Added:
  head/lib/libbluetooth/hosts
 - copied unchanged from r338154, head/etc/bluetooth/hosts
  head/lib/libbluetooth/protocols
 - copied unchanged from r338154, head/etc/bluetooth/protocols
  head/usr.sbin/bluetooth/hccontrol/bluetooth.device.conf
 - copied unchanged from r338154, head/etc/defaults/bluetooth.device.conf
Replaced:
  head/usr.sbin/bluetooth/hcsecd/hcsecd.conf
 - copied unchanged from r338154, head/etc/bluetooth/hcsecd.conf
Deleted:
  head/etc/bluetooth/
  head/etc/defaults/bluetooth.device.conf
Modified:
  head/etc/Makefile
  head/etc/defaults/Makefile
  head/lib/libbluetooth/Makefile
  head/usr.sbin/bluetooth/hccontrol/Makefile
  head/usr.sbin/bluetooth/hcsecd/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Aug 21 19:17:35 2018(r338154)
+++ head/etc/Makefile   Tue Aug 21 19:28:53 2018(r338155)
@@ -142,9 +142,6 @@ distribution:
echo "./var/db/services.db type=file mode=0644 uname=root 
gname=wheel"; \
) | ${METALOG.add}
 .endif
-.if ${MK_BLUETOOTH} != "no"
-   ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
-.endif
${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install

Modified: head/etc/defaults/Makefile
==
--- head/etc/defaults/Makefile  Tue Aug 21 19:17:35 2018(r338154)
+++ head/etc/defaults/Makefile  Tue Aug 21 19:28:53 2018(r338155)
@@ -5,8 +5,4 @@
 FILES= devfs.rules
 FILESDIR= /etc/defaults
 
-.if ${MK_BLUETOOTH} != "no"
-FILES+=bluetooth.device.conf
-.endif
-
 .include 

Modified: head/lib/libbluetooth/Makefile
==
--- head/lib/libbluetooth/Makefile  Tue Aug 21 19:17:35 2018
(r338154)
+++ head/lib/libbluetooth/Makefile  Tue Aug 21 19:28:53 2018
(r338155)
@@ -2,6 +2,9 @@
 # $FreeBSD$
 
 PACKAGE=   lib${LIB}
+CONFS= hosts protocols
+CONFSDIR=  /etc/bluetooth
+CONFSMODE_protocols=   444
 LIB=   bluetooth
 MAN=   bluetooth.3
 

Copied: head/lib/libbluetooth/hosts (from r338154, head/etc/bluetooth/hosts)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libbluetooth/hosts Tue Aug 21 19:28:53 2018(r338155, copy 
of r338154, head/etc/bluetooth/hosts)
@@ -0,0 +1,10 @@
+# $Id: hosts,v 1.1 2003/05/21 17:48:40 max Exp $
+# $FreeBSD$
+#
+# Bluetooth Host Database
+#
+# This file should contain the Bluetooth addresses and aliases for hosts.
+#
+# BD_ADDR   Name [ alias0 alias1 ... ]
+
+# 00:11:22:33:44:55phone

Copied: head/lib/libbluetooth/protocols (from r338154, 
head/etc/bluetooth/protocols)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libbluetooth/protocols Tue Aug 21 19:28:53 2018
(r338155, copy of r338154, head/etc/bluetooth/protocols)
@@ -0,0 +1,22 @@
+# $Id: protocols,v 1.2 2003/05/21 22:17:14 max Exp $
+# $FreeBSD$
+#
+# Bluetooth Protocol/Service Multiplexor (PSM) names and numbers
+#
+# See also
+# https://www.bluetooth.org/foundry/assignnumb/document/assigned_numbers
+#
+# Protocol   PSM Alias Reference
+
+sdp  1   SDP   # Service Discovery Protocol
+rfcomm   3   RFCOMM# RFCOMM with TS 07.10
+tcs-bin  5   TCS-BIN   # Telephony Control Specification
+tcs-bin-cordless 7   TCS-BIN-CORDLESS # Telephony Control Specification
+bnep 15  BNEP  # Bluetooth Network Encapsulation Protocol
+hid-control  17  HID-Control   # Human Interface Device (control)
+hid-interrupt19  HID-Interrupt # Human Interface Device (interrupt)
+upnp 21  UPnP  # See ESDP, Bluetooth SIG
+avctp23  AVCTP # Audio/Video Control Transport Protocol
+avdtp25  AVDTP # Audio/Video Distribution Transport 
Protocol
+udi-c-plane  29  UDI-C-Plane   # Unrestricted Digital Information Profile
+

Modified: head/usr.sbin/bluetooth/hccontrol/Makefile
==
--- head/usr.sbin/bluetooth/hccontrol/Makefile  Tue Aug 21 19:17:35 2018
(r338154)
+++ head/usr.sbin/bluetooth/hccontrol/Makefile  Tue Aug 21 

svn commit: r338154 - head/contrib/wpa/src/drivers

2018-08-21 Thread Cy Schubert
Author: cy
Date: Tue Aug 21 19:17:35 2018
New Revision: 338154
URL: https://svnweb.freebsd.org/changeset/base/338154

Log:
  For CID 1394785, add a comment explaining that global->event_buf is
  not really a char * but a struct rt_msghdr *.
  
  MFC after:3 days

Modified:
  head/contrib/wpa/src/drivers/driver_bsd.c

Modified: head/contrib/wpa/src/drivers/driver_bsd.c
==
--- head/contrib/wpa/src/drivers/driver_bsd.c   Tue Aug 21 18:50:29 2018
(r338153)
+++ head/contrib/wpa/src/drivers/driver_bsd.c   Tue Aug 21 19:17:35 2018
(r338154)
@@ -1234,6 +1234,11 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void
struct ieee80211_join_event *join;
int n;
 
+   /*
+* CID 1394785: Memory - illegal access (STRING_NULL):
+* Though global->event_buf is a char *, it actually contains
+* a struct rt_msghdr *. See below.
+*/
n = read(sock, global->event_buf, global->event_buf_len);
if (n < 0) {
if (errno != EINTR && errno != EAGAIN)
@@ -1242,6 +1247,10 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void
return;
}
 
+   /*
+* CID 1394785: global->event_buf is assigned here to a
+* struct rt_msghdr *.
+*/
rtm = (struct rt_msghdr *) global->event_buf;
if (rtm->rtm_version != RTM_VERSION) {
wpa_printf(MSG_DEBUG, "Invalid routing message version=%d",
___
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: r338153 - head/sys/fs/fuse

2018-08-21 Thread Fedor Uporov
Author: fsu
Date: Tue Aug 21 18:50:29 2018
New Revision: 338153
URL: https://svnweb.freebsd.org/changeset/base/338153

Log:
  FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_* 
(cosmetic only).
  
  Reviewed by:cem, pfg
  MFC after:  2 weeks
  
  Differential Revision:https://reviews.freebsd.org/D13737

Modified:
  head/sys/fs/fuse/fuse_vnops.c

Modified: head/sys/fs/fuse/fuse_vnops.c
==
--- head/sys/fs/fuse/fuse_vnops.c   Tue Aug 21 18:39:47 2018
(r338152)
+++ head/sys/fs/fuse/fuse_vnops.c   Tue Aug 21 18:50:29 2018
(r338153)
@@ -2012,21 +2012,21 @@ fuse_vnop_getextattr(struct vop_getextattr_args *ap)
 {
struct vnode *vp = ap->a_vp;
struct uio *uio = ap->a_uio;
-   struct fuse_dispatcher fdi = {0};
+   struct fuse_dispatcher fdi;
struct fuse_getxattr_in *get_xattr_in;
struct fuse_getxattr_out *get_xattr_out;
struct mount *mp = vnode_mount(vp);
-   char *prefix;
-   size_t len;
-   char *attr_str;
struct thread *td = ap->a_td;
struct ucred *cred = ap->a_cred;
-   int err = 0;
+   char *prefix;
+   char *attr_str;
+   size_t len;
+   int err;
 
fuse_trace_printf_vnop();
 
if (fuse_isdeadfs(vp))
-   return ENXIO;
+   return (ENXIO);
 
/* Default to looking for user attributes. */
if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM)
@@ -2057,7 +2057,6 @@ fuse_vnop_getextattr(struct vop_getextattr_args *ap)
ap->a_name);
 
err = fdisp_wait_answ();
-
if (err != 0) {
if (err == ENOSYS)
fsess_set_notimpl(mp, FUSE_GETXATTR);
@@ -2094,20 +2093,20 @@ fuse_vnop_setextattr(struct vop_setextattr_args *ap)
 {
struct vnode *vp = ap->a_vp;
struct uio *uio = ap->a_uio;
-   struct fuse_dispatcher fdi = {0};
+   struct fuse_dispatcher fdi;
struct fuse_setxattr_in *set_xattr_in;
struct mount *mp = vnode_mount(vp);
+   struct thread *td = ap->a_td;
+   struct ucred *cred = ap->a_cred;
char *prefix;
size_t len;
char *attr_str;
-   struct thread *td = ap->a_td;
-   struct ucred *cred = ap->a_cred;
-   int err = 0;
-
+   int err;
+   
fuse_trace_printf_vnop();
 
if (fuse_isdeadfs(vp))
-   return ENXIO;
+   return (ENXIO);
 
/* Default to looking for user attributes. */
if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM)
@@ -2220,10 +2219,12 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
 {
struct vnode *vp = ap->a_vp;
struct uio *uio = ap->a_uio;
-   struct fuse_dispatcher fdi = {0};
+   struct fuse_dispatcher fdi;
struct fuse_listxattr_in *list_xattr_in;
struct fuse_listxattr_out *list_xattr_out;
struct mount *mp = vnode_mount(vp);
+   struct thread *td = ap->a_td;
+   struct ucred *cred = ap->a_cred;
size_t len;
char *prefix;
char *attr_str;
@@ -2231,14 +2232,12 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
char *linux_list;
int bsd_list_len;
int linux_list_len;
-   struct thread *td = ap->a_td;
-   struct ucred *cred = ap->a_cred;
-   int err = 0;
+   int err;
 
fuse_trace_printf_vnop();
 
if (fuse_isdeadfs(vp))
-   return ENXIO;
+   return (ENXIO);
 
/*
 * Add space for a NUL and the period separator if enabled.
@@ -2332,19 +2331,19 @@ static int
 fuse_vnop_deleteextattr(struct vop_deleteextattr_args *ap)
 {
struct vnode *vp = ap->a_vp;
-   struct fuse_dispatcher fdi = {0};
+   struct fuse_dispatcher fdi;
struct mount *mp = vnode_mount(vp);
+   struct thread *td = ap->a_td;
+   struct ucred *cred = ap->a_cred;
char *prefix;
size_t len;
char *attr_str;
-   struct thread *td = ap->a_td;
-   struct ucred *cred = ap->a_cred;
int err;
 
fuse_trace_printf_vnop();
 
if (fuse_isdeadfs(vp))
-   return ENXIO;
+   return (ENXIO);
 
/* Default to looking for user attributes. */
if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM)
___
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: r338151 - head/sys/fs/ext2fs

2018-08-21 Thread Fedor Uporov
Author: fsu
Date: Tue Aug 21 18:39:29 2018
New Revision: 338151
URL: https://svnweb.freebsd.org/changeset/base/338151

Log:
  Change unused inodes counters behavior in the cylinder groups.
  Make it more close to native ext4 implementation to avoid fsck errors.

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Tue Aug 21 18:39:02 2018
(r338150)
+++ head/sys/fs/ext2fs/ext2_alloc.c Tue Aug 21 18:39:29 2018
(r338151)
@@ -1210,7 +1210,7 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr
struct m_ext2fs *fs;
struct buf *bp;
struct ext2mount *ump;
-   int error, start, len;
+   int error, start, len, ifree;
char *ibp, *loc;
 
ipref--;/* to avoid a lot of (ipref -1) */
@@ -1285,9 +1285,12 @@ gotit:
e2fs_gd_set_nifree(>e2fs_gd[cg],
e2fs_gd_get_nifree(>e2fs_gd[cg]) - 1);
if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) ||
-   EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM))
-   e2fs_gd_set_i_unused(>e2fs_gd[cg],
-   e2fs_gd_get_i_unused(>e2fs_gd[cg]) - 1);
+   EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) {
+   ifree = fs->e2fs->e2fs_ipg - 
e2fs_gd_get_i_unused(>e2fs_gd[cg]);
+   if (ipref + 1 > ifree)
+   e2fs_gd_set_i_unused(>e2fs_gd[cg],
+   fs->e2fs->e2fs_ipg - (ipref + 1));
+   }
fs->e2fs->e2fs_ficount--;
fs->e2fs_fmod = 1;
if ((mode & IFMT) == IFDIR) {
@@ -1391,10 +1394,6 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode)
fs->e2fs->e2fs_ficount++;
e2fs_gd_set_nifree(>e2fs_gd[cg],
e2fs_gd_get_nifree(>e2fs_gd[cg]) + 1);
-   if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) ||
-   EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM))
-   e2fs_gd_set_i_unused(>e2fs_gd[cg],
-   e2fs_gd_get_i_unused(>e2fs_gd[cg]) + 1);
if ((mode & IFMT) == IFDIR) {
e2fs_gd_set_ndirs(>e2fs_gd[cg],
e2fs_gd_get_ndirs(>e2fs_gd[cg]) - 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: r338152 - head/sys/fs/fuse

2018-08-21 Thread Fedor Uporov
Author: fsu
Date: Tue Aug 21 18:39:47 2018
New Revision: 338152
URL: https://svnweb.freebsd.org/changeset/base/338152

Log:
  FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_*.
  
  The requested size was returned incorrectly in case uio == NULL from 
listextattr because the
  nameprefix/name conversion was not applied.
  Also, make a_size/uio returning logic more unified with other filesystems.
  
  Reviewed by:cem, pfg
  MFC after:  2 weeks
  
  Differential Revision:https://reviews.freebsd.org/D13528

Modified:
  head/sys/fs/fuse/fuse_kernel.h
  head/sys/fs/fuse/fuse_vnops.c

Modified: head/sys/fs/fuse/fuse_kernel.h
==
--- head/sys/fs/fuse/fuse_kernel.h  Tue Aug 21 18:39:29 2018
(r338151)
+++ head/sys/fs/fuse/fuse_kernel.h  Tue Aug 21 18:39:47 2018
(r338152)
@@ -282,11 +282,16 @@ struct fuse_fsync_in {
__u32   padding;
 };
 
-struct fuse_setxattr_in {
+struct fuse_listxattr_in {
__u32   size;
__u32   flags;
 };
 
+struct fuse_listxattr_out {
+   __u32   size;
+   __u32   flags;
+};
+
 struct fuse_getxattr_in {
__u32   size;
__u32   padding;
@@ -295,6 +300,11 @@ struct fuse_getxattr_in {
 struct fuse_getxattr_out {
__u32   size;
__u32   padding;
+};
+
+struct fuse_setxattr_in {
+   __u32   size;
+   __u32   flags;
 };
 
 struct fuse_lk_in {

Modified: head/sys/fs/fuse/fuse_vnops.c
==
--- head/sys/fs/fuse/fuse_vnops.c   Tue Aug 21 18:39:29 2018
(r338151)
+++ head/sys/fs/fuse/fuse_vnops.c   Tue Aug 21 18:39:47 2018
(r338152)
@@ -2047,7 +2047,7 @@ fuse_vnop_getextattr(struct vop_getextattr_args *ap)
 * fuse_getxattr_out.  If we pass in a non-zero size, we get back
 * that much data, without the struct fuse_getxattr_out header.
 */
-   if (ap->a_size != NULL)
+   if (uio == NULL)
get_xattr_in->size = 0;
else
get_xattr_in->size = uio->uio_resid;
@@ -2065,25 +2065,13 @@ fuse_vnop_getextattr(struct vop_getextattr_args *ap)
goto out;
}
 
-   /*
-* If we get to this point (i.e. no error), we should have a valid
-* answer of some sort.  i.e. non-zero iosize and a valid pointer.
-*/
-   if ((fdi.answ == NULL) || (fdi.iosize == 0)) {
-   debug_printf("getxattr: err = 0, but answ = %p, iosize = %zu\n",
-   fdi.answ, fdi.iosize);
-   err = EINVAL;
-   goto out;
-   }
get_xattr_out = fdi.answ;
 
-   if (ap->a_size != NULL) {
+   if (ap->a_size != NULL)
*ap->a_size = get_xattr_out->size;
-   } else if (fdi.iosize > 0) {
+
+   if (uio != NULL)
err = uiomove(fdi.answ, fdi.iosize, uio);
-   } else {
-   err = EINVAL;
-   }
 
 out:
fdisp_destroy();
@@ -2233,14 +2221,16 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
struct vnode *vp = ap->a_vp;
struct uio *uio = ap->a_uio;
struct fuse_dispatcher fdi = {0};
-   struct fuse_getxattr_in *get_xattr_in;
-   struct fuse_getxattr_out *get_xattr_out;
+   struct fuse_listxattr_in *list_xattr_in;
+   struct fuse_listxattr_out *list_xattr_out;
struct mount *mp = vnode_mount(vp);
size_t len;
char *prefix;
char *attr_str;
char *bsd_list = NULL;
+   char *linux_list;
int bsd_list_len;
+   int linux_list_len;
struct thread *td = ap->a_td;
struct ucred *cred = ap->a_cred;
int err = 0;
@@ -2261,17 +2251,15 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
 
len = strlen(prefix) + sizeof(extattr_namespace_separator) + 1;
 
-   fdisp_init(, sizeof(*get_xattr_in) + len);
+   fdisp_init(, sizeof(*list_xattr_in) + len);
fdisp_make_vp(, FUSE_LISTXATTR, vp, td, cred);
 
-   get_xattr_in = fdi.indata;
-   if (ap->a_size != NULL)
-   get_xattr_in->size = 0;
-   else
-   get_xattr_in->size = uio->uio_resid + sizeof(*get_xattr_out);
-
-
-   attr_str = (char *)fdi.indata + sizeof(*get_xattr_in);
+   /*
+* Retrieve Linux / FUSE compatible list size.
+*/
+   list_xattr_in = fdi.indata;
+   list_xattr_in->size = 0;
+   attr_str = (char *)fdi.indata + sizeof(*list_xattr_in);
snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator);
 
err = fdisp_wait_answ();
@@ -2282,32 +2270,47 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
goto out;
}
 
-   if ((fdi.answ == NULL) || (fdi.iosize == 0)) {
-   err = EINVAL;
+   list_xattr_out = fdi.answ;
+   linux_list_len = list_xattr_out->size;
+   if (linux_list_len == 0) {
+  

svn commit: r338150 - head/sys/fs/ext2fs

2018-08-21 Thread Fedor Uporov
Author: fsu
Date: Tue Aug 21 18:39:02 2018
New Revision: 338150
URL: https://svnweb.freebsd.org/changeset/base/338150

Log:
  Fix directory blocks checksum updating logic.
  
  Count dirent tail in the searchslot logic in case of directory block search.
  Add htree root csum update function call in case of rename.

Modified:
  head/sys/fs/ext2fs/ext2_csum.c
  head/sys/fs/ext2fs/ext2_extern.h
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_csum.c
==
--- head/sys/fs/ext2fs/ext2_csum.c  Tue Aug 21 18:22:12 2018
(r338149)
+++ head/sys/fs/ext2fs/ext2_csum.c  Tue Aug 21 18:39:02 2018
(r338150)
@@ -162,12 +162,32 @@ ext2_init_dirent_tail(struct ext2fs_direct_tail *tp)
tp->e2dt_reserved_ft = EXT2_FT_DIR_CSUM;
 }
 
+int
+ext2_is_dirent_tail(struct inode *ip, struct ext2fs_direct_2 *ep)
+{
+   struct m_ext2fs *fs;
+   struct ext2fs_direct_tail *tp;
+
+   fs = ip->i_e2fs;
+
+   if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM))
+   return (0);
+
+   tp = (struct ext2fs_direct_tail *)ep;
+   if (tp->e2dt_reserved_zero1 == 0 &&
+   tp->e2dt_rec_len == sizeof(struct ext2fs_direct_tail) &&
+   tp->e2dt_reserved_zero2 == 0 &&
+   tp->e2dt_reserved_ft == EXT2_FT_DIR_CSUM)
+   return (1);
+
+   return (0);
+}
+
 struct ext2fs_direct_tail *
 ext2_dirent_get_tail(struct inode *ip, struct ext2fs_direct_2 *ep)
 {
struct ext2fs_direct_2 *dep;
void *top;
-   struct ext2fs_direct_tail *tp;
unsigned int rec_len;
 
dep = ep;
@@ -184,14 +204,10 @@ ext2_dirent_get_tail(struct inode *ip, struct ext2fs_d
if (dep != top)
return (NULL);
 
-   tp = (struct ext2fs_direct_tail *)dep;
-   if (tp->e2dt_reserved_zero1 ||
-   tp->e2dt_rec_len != sizeof(struct ext2fs_direct_tail) ||
-   tp->e2dt_reserved_zero2 ||
-   tp->e2dt_reserved_ft != EXT2_FT_DIR_CSUM)
-   return (NULL);
+   if (ext2_is_dirent_tail(ip, dep))
+   return ((struct ext2fs_direct_tail *)dep);
 
-   return (tp);
+   return (NULL);
 }
 
 static uint32_t

Modified: head/sys/fs/ext2fs/ext2_extern.h
==
--- head/sys/fs/ext2fs/ext2_extern.hTue Aug 21 18:22:12 2018
(r338149)
+++ head/sys/fs/ext2fs/ext2_extern.hTue Aug 21 18:39:02 2018
(r338150)
@@ -120,6 +120,7 @@ int ext2_dx_csum_verify(struct inode *ip, struct ext2f
 intext2_extent_blk_csum_verify(struct inode *, void *);
 void   ext2_extent_blk_csum_set(struct inode *, void *);
 void   ext2_init_dirent_tail(struct ext2fs_direct_tail *);
+intext2_is_dirent_tail(struct inode *, struct ext2fs_direct_2 *);
 intext2_gd_i_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *);
 void   ext2_gd_i_bitmap_csum_set(struct m_ext2fs *, int, struct buf *);
 intext2_gd_b_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *);

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cTue Aug 21 18:22:12 2018
(r338149)
+++ head/sys/fs/ext2fs/ext2_lookup.cTue Aug 21 18:39:02 2018
(r338150)
@@ -429,16 +429,13 @@ searchloop:
error = ext2_blkatoff(vdp, (off_t)i_offset, NULL, );
if (error != 0)
return (error);
+
entryoffsetinblock = 0;
-   /*
-* If still looking for a slot, and at a DIRBLKSIZE
-* boundary, have to start looking for free space again.
-*/
-   if (ss.slotstatus == NONE &&
-   (entryoffsetinblock & (DIRBLKSIZ - 1)) == 0) {
+   if (ss.slotstatus == NONE) {
ss.slotoffset = -1;
ss.slotfreespace = 0;
}
+
error = ext2_search_dirblock(dp, bp->b_data, _found,
cnp->cn_nameptr, cnp->cn_namelen,
, _offset, ,
@@ -719,9 +716,7 @@ ext2_search_dirblock(struct inode *ip, void *data, int
vdp = ITOV(ip);
 
ep = (struct ext2fs_direct_2 *)((char *)data + offset);
-   top = (struct ext2fs_direct_2 *)((char *)data +
-   bsize - EXT2_DIR_REC_LEN(0));
-
+   top = (struct ext2fs_direct_2 *)((char *)data + bsize);
while (ep < top) {
/*
 * Full validation checks are slow, so we only check
@@ -751,6 +746,8 @@ ext2_search_dirblock(struct inode *ip, void *data, int
 
if (ep->e2d_ino != 0)
size -= EXT2_DIR_REC_LEN(ep->e2d_namlen);
+   else if (ext2_is_dirent_tail(ip, ep))
+   size -= 

Re: svn commit: r337978 - in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv

2018-08-21 Thread Brooks Davis
On Mon, Aug 20, 2018 at 08:08:01PM +0200, Michal Meloun wrote:
> 
> On 20.08.2018 18:02, Kyle Evans wrote:
> > On Mon, Aug 20, 2018 at 11:00 AM, Michal Meloun  
> > wrote:
> >>
> >> On 17.08.2018 18:19, Brooks Davis wrote:
> >>> Author: brooks
> >>> Date: Fri Aug 17 16:19:47 2018
> >>> New Revision: 337978
> >>> URL: https://svnweb.freebsd.org/changeset/base/337978
> >>>
> >>> Log:
> >>>   Rework rtld's TLS Variant I implementation to match r326794
> >>>
> >>>   The above commit fixed handling overaligned TLS segments in libc's
> >>>   TLS Variant I implementation, but rtld provides its own implementation
> >>>   for dynamically-linked executables which lacks these fixes.  Thus,
> >>>   port these changes to rtld.
> >>>
> >>>   Submitted by:   James Clarke
> >>>   Reviewed by:kbowling
> >>>   Testing byL kbowling (powerpc64), br (riscv), kevans (armv7)
> >>>   Obtained from:  CheriBSD
> >>>   Sponsored by:   DARPA, AFRL
> >>>   Differential Revision:  https://reviews.freebsd.org/D16510
> >>>
> >>> Modified:
> >>>   head/libexec/rtld-elf/aarch64/rtld_machdep.h
> >>>   head/libexec/rtld-elf/arm/rtld_machdep.h
> >>>   head/libexec/rtld-elf/mips/rtld_machdep.h
> >>>   head/libexec/rtld-elf/powerpc/rtld_machdep.h
> >>>   head/libexec/rtld-elf/powerpc64/rtld_machdep.h
> >>>   head/libexec/rtld-elf/riscv/rtld_machdep.h
> >>>   head/libexec/rtld-elf/rtld.c
> >>>
> >> This commit breaks TLS handling for (at least) armv7. Can you please
> >> revert it until I will be able to identify where is problem?
> >> In my case, the libc _ThreadRuneLocale symbol is not zero on program start.
> >>
> > 
> > Interesting that I didn't hit this on my armv7 test
> > 
> 
> No idea yet. For me, it breaks all ctype (isspace()..) related function.
> Originally, I found that bash port gets broken. Its funny if shell takes
> 'a' as non-alphanumeric character, 'x' as whitespace, ...
> Anyway, give me a while - I need to write testcase because bas is too
> complex for effective debugging. This commit isn't fundamentally bad, it
> works for jemalloc thread local variables so I think that only some edge
> case (tbss handling is my candidate) is affected.

Reverted in r338149.

It's quite surprising to me that the system would boot in this state. 
Is there anything non-default about your build environment?

-- Brooks


signature.asc
Description: PGP signature


svn commit: r338149 - in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv

2018-08-21 Thread Brooks Davis
Author: brooks
Date: Tue Aug 21 18:22:12 2018
New Revision: 338149
URL: https://svnweb.freebsd.org/changeset/base/338149

Log:
  Revert r337978: Rework rtld's TLS Variant I implementation to match r326794
  
  Michal Meloun reports that it breaks ctype (isspace()..) related
  functions on armv7 so back out while we diagnose the issue.
  
  Reported by:  Michal Meloun 

Modified:
  head/libexec/rtld-elf/aarch64/rtld_machdep.h
  head/libexec/rtld-elf/arm/rtld_machdep.h
  head/libexec/rtld-elf/mips/rtld_machdep.h
  head/libexec/rtld-elf/powerpc/rtld_machdep.h
  head/libexec/rtld-elf/powerpc64/rtld_machdep.h
  head/libexec/rtld-elf/riscv/rtld_machdep.h
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h
==
--- head/libexec/rtld-elf/aarch64/rtld_machdep.hTue Aug 21 17:13:51 
2018(r338148)
+++ head/libexec/rtld-elf/aarch64/rtld_machdep.hTue Aug 21 18:22:12 
2018(r338149)
@@ -69,8 +69,6 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe
 #definecalculate_tls_offset(prev_offset, prev_size, size, align) \
round(prev_offset + prev_size, align)
 #definecalculate_tls_end(off, size)((off) + (size))
-#define calculate_tls_post_size(align) \
-   round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE
 
 #defineTLS_TCB_SIZE16
 typedef struct {

Modified: head/libexec/rtld-elf/arm/rtld_machdep.h
==
--- head/libexec/rtld-elf/arm/rtld_machdep.hTue Aug 21 17:13:51 2018
(r338148)
+++ head/libexec/rtld-elf/arm/rtld_machdep.hTue Aug 21 18:22:12 2018
(r338149)
@@ -69,8 +69,6 @@ typedef struct {
 #define calculate_tls_offset(prev_offset, prev_size, size, align) \
 round(prev_offset + prev_size, align)
 #define calculate_tls_end(off, size)((off) + (size))
-#define calculate_tls_post_size(align) \
-round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE

 extern void *__tls_get_addr(tls_index *ti);
 

Modified: head/libexec/rtld-elf/mips/rtld_machdep.h
==
--- head/libexec/rtld-elf/mips/rtld_machdep.h   Tue Aug 21 17:13:51 2018
(r338148)
+++ head/libexec/rtld-elf/mips/rtld_machdep.h   Tue Aug 21 18:22:12 2018
(r338149)
@@ -64,11 +64,10 @@ typedef struct {
 #define round(size, align) \
 (((size) + (align) - 1) & ~((align) - 1))
 #define calculate_first_tls_offset(size, align) \
-TLS_TCB_SIZE
+round(TLS_TCB_SIZE, align)
 #define calculate_tls_offset(prev_offset, prev_size, size, align) \
 round(prev_offset + prev_size, align)
 #define calculate_tls_end(off, size)((off) + (size))
-#define calculate_tls_post_size(align)  0
 
 extern void *__tls_get_addr(tls_index *ti);
 

Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h
==
--- head/libexec/rtld-elf/powerpc/rtld_machdep.hTue Aug 21 17:13:51 
2018(r338148)
+++ head/libexec/rtld-elf/powerpc/rtld_machdep.hTue Aug 21 18:22:12 
2018(r338149)
@@ -74,11 +74,10 @@ void _rtld_powerpc_pltcall(void);
 #define round(size, align) \
 (((size) + (align) - 1) & ~((align) - 1))
 #define calculate_first_tls_offset(size, align) \
-TLS_TCB_SIZE
+round(8, align)
 #define calculate_tls_offset(prev_offset, prev_size, size, align) \
 round(prev_offset + prev_size, align)
 #define calculate_tls_end(off, size)((off) + (size))
-#define calculate_tls_post_size(align)  0
  
 typedef struct {
unsigned long ti_module;

Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h
==
--- head/libexec/rtld-elf/powerpc64/rtld_machdep.h  Tue Aug 21 17:13:51 
2018(r338148)
+++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h  Tue Aug 21 18:22:12 
2018(r338149)
@@ -66,11 +66,10 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe
 #define round(size, align) \
 (((size) + (align) - 1) & ~((align) - 1))
 #define calculate_first_tls_offset(size, align) \
-TLS_TCB_SIZE
+round(16, align)
 #define calculate_tls_offset(prev_offset, prev_size, size, align) \
 round(prev_offset + prev_size, align)
 #define calculate_tls_end(off, size)((off) + (size))
-#define calculate_tls_post_size(align)  0
  
 typedef struct {
unsigned long ti_module;

Modified: head/libexec/rtld-elf/riscv/rtld_machdep.h
==
--- head/libexec/rtld-elf/riscv/rtld_machdep.h  Tue Aug 21 17:13:51 2018
(r338148)
+++ head/libexec/rtld-elf/riscv/rtld_machdep.h  Tue Aug 21 18:22:12 2018
(r338149)
@@ -89,11 +89,10 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe
 #define round(size, align) \
 (((size) + (align) - 1) & 

svn commit: r338148 - head/sys/x86/isa

2018-08-21 Thread John Baldwin
Author: jhb
Date: Tue Aug 21 17:13:51 2018
New Revision: 338148
URL: https://svnweb.freebsd.org/changeset/base/338148

Log:
  Remove 'imen' global variable from atpic(4).
  
  In pre-SMPng, the global 'imen' was used to track mask state of the
  hardware interrupts and was aligned to the masks used by spl*().
  When the atpic code was converted to using the x86 interrupt source
  abstraction, the global 'imen' was preserved by having each PIC
  instance point to an invididual byte in the global 'imen' to hold its
  8-bit interrupt mask.  The global 'imen' is no longer used for
  anything however, so rather than storing pointers in 'struct atpic',
  just store the individual 8-bit mask for each PIC as a char.
  
  While here, convert the ATPIC macro to using C99 initializers.
  
  Reviewed by:  kib, imp
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D16827

Modified:
  head/sys/x86/isa/atpic.c
  head/sys/x86/isa/icu.h

Modified: head/sys/x86/isa/atpic.c
==
--- head/sys/x86/isa/atpic.cTue Aug 21 17:07:52 2018(r338147)
+++ head/sys/x86/isa/atpic.cTue Aug 21 17:13:51 2018(r338148)
@@ -67,12 +67,12 @@ __FBSDID("$FreeBSD$");
 #defineMASTER  0
 #defineSLAVE   1
 
+#defineIMEN_MASK(ai)   (IRQ_MASK((ai)->at_irq))
+
 #defineNUM_ISA_IRQS16
 
 static voidatpic_init(void *dummy);
 
-unsigned int imen; /* XXX */
-
 inthand_t
IDTVEC(atpic_intr0), IDTVEC(atpic_intr1), IDTVEC(atpic_intr2),
IDTVEC(atpic_intr3), IDTVEC(atpic_intr4), IDTVEC(atpic_intr5),
@@ -93,12 +93,24 @@ inthand_t
 
 #defineIRQ(ap, ai) ((ap)->at_irqbase + (ai)->at_irq)
 
-#defineATPIC(io, base, eoi, imenptr)   
\
-   { { atpic_enable_source, atpic_disable_source, (eoi),   \
-   atpic_enable_intr, atpic_disable_intr, atpic_vector,\
-   atpic_source_pending, NULL, atpic_resume, atpic_config_intr,\
-   atpic_assign_cpu }, (io), (base), IDT_IO_INTS + (base), \
-   (imenptr) }
+#defineATPIC(io, base, eoi) {  
\
+   .at_pic = { \
+   .pic_enable_source = atpic_enable_source,   \
+   .pic_disable_source = atpic_disable_source, \
+   .pic_eoi_source = (eoi),\
+   .pic_enable_intr = atpic_enable_intr,   \
+   .pic_disable_intr = atpic_disable_intr, \
+   .pic_vector = atpic_vector, \
+   .pic_source_pending = atpic_source_pending, \
+   .pic_resume = atpic_resume, \
+   .pic_config_intr = atpic_config_intr,   \
+   .pic_assign_cpu = atpic_assign_cpu  \
+   },  \
+   .at_ioaddr = (io),  \
+   .at_irqbase = (base),   \
+   .at_intbase = IDT_IO_INTS + (base), \
+   .at_imen = 0xff,\
+   }
 
 #defineINTSRC(irq) 
\
{ { [(irq) / 8].at_pic }, IDTVEC(atpic_intr ## irq ),\
@@ -109,7 +121,7 @@ struct atpic {
int at_ioaddr;
int at_irqbase;
uint8_t at_intbase;
-   uint8_t *at_imen;
+   uint8_t at_imen;
 };
 
 struct atpic_intsrc {
@@ -136,8 +148,8 @@ static int atpic_assign_cpu(struct intsrc *isrc, u_int
 static void i8259_init(struct atpic *pic, int slave);
 
 static struct atpic atpics[] = {
-   ATPIC(IO_ICU1, 0, atpic_eoi_master, (uint8_t *)),
-   ATPIC(IO_ICU2, 8, atpic_eoi_slave, ((uint8_t *)) + 1)
+   ATPIC(IO_ICU1, 0, atpic_eoi_master),
+   ATPIC(IO_ICU2, 8, atpic_eoi_slave)
 };
 
 static struct atpic_intsrc atintrs[] = {
@@ -197,9 +209,9 @@ atpic_enable_source(struct intsrc *isrc)
struct atpic *ap = (struct atpic *)isrc->is_pic;
 
spinlock_enter();
-   if (*ap->at_imen & IMEN_MASK(ai)) {
-   *ap->at_imen &= ~IMEN_MASK(ai);
-   outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen);
+   if (ap->at_imen & IMEN_MASK(ai)) {
+   ap->at_imen &= ~IMEN_MASK(ai);
+   outb(ap->at_ioaddr + ICU_IMR_OFFSET, ap->at_imen);
}
spinlock_exit();
 }
@@ -212,8 +224,8 @@ atpic_disable_source(struct intsrc *isrc, int eoi)
 
spinlock_enter();
if (ai->at_trigger != INTR_TRIGGER_EDGE) {
-   *ap->at_imen |= IMEN_MASK(ai);
-   outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen);
+

svn commit: r338147 - in head: etc libexec/ftpd

2018-08-21 Thread Brad Davis
Author: brd
Date: Tue Aug 21 17:07:52 2018
New Revision: 338147
URL: https://svnweb.freebsd.org/changeset/base/338147

Log:
  Move ftpusers to libexec/ftpd/
  
  Thsi helps with pkgbase by switching to CONFS so that ftpusers will be
  properly tagged as a config file.
  
  Approved by:  will (mentor)
  Differential Revision:https://reviews.freebsd.org/D16787

Added:
  head/libexec/ftpd/ftpusers
 - copied unchanged from r338146, head/etc/ftpusers
Deleted:
  head/etc/ftpusers
Modified:
  head/etc/Makefile
  head/libexec/ftpd/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Aug 21 17:01:47 2018(r338146)
+++ head/etc/Makefile   Tue Aug 21 17:07:52 2018(r338147)
@@ -56,10 +56,6 @@ BIN1+=   etc.${MACHINE_CPUARCH}/ttys
 BIN1+= amd.map
 .endif
 
-.if ${MK_FTP} != "no"
-BIN1+= ftpusers
-.endif
-
 .if ${MK_LOCATE} != "no"
 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
 .endif

Modified: head/libexec/ftpd/Makefile
==
--- head/libexec/ftpd/Makefile  Tue Aug 21 17:01:47 2018(r338146)
+++ head/libexec/ftpd/Makefile  Tue Aug 21 17:07:52 2018(r338147)
@@ -3,6 +3,7 @@
 
 .include 
 
+CONFS= ftpusers
 PROG=  ftpd
 MAN=   ftpd.8 ftpchroot.5
 SRCS=  ftpd.c ftpcmd.y logwtmp.c popen.c

Copied: head/libexec/ftpd/ftpusers (from r338146, head/etc/ftpusers)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/libexec/ftpd/ftpusers  Tue Aug 21 17:07:52 2018(r338147, copy 
of r338146, head/etc/ftpusers)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+#
+# list of users disallowed any ftp access.
+# read by ftpd(8).
+root
+toor
+daemon
+operator
+bin
+tty
+kmem
+games
+news
+ntpd
+man
+sshd
+smmsp
+mailnull
+bind
+unbound
+proxy
+_pflogd
+_dhcp
+uucp
+pop
+auditdistd
+www
+hast
+nobody
___
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: r338146 - in head: etc etc/syslog.d usr.sbin/syslogd

2018-08-21 Thread Brad Davis
Author: brd
Date: Tue Aug 21 17:01:47 2018
New Revision: 338146
URL: https://svnweb.freebsd.org/changeset/base/338146

Log:
  Move all syslogd related configs to usr.sbin/syslogd/
  
  This helps with pkgbase as it switches these to use CONFS which properly tags
  them as config files.
  
  Approved by:  will (mentor)
  Differential Revision:https://reviews.freebsd.org/D16783

Added:
  head/usr.sbin/syslogd/ftp.conf
 - copied unchanged from r338145, head/etc/syslog.d/ftp.conf
  head/usr.sbin/syslogd/lpr.conf
 - copied unchanged from r338145, head/etc/syslog.d/lpr.conf
  head/usr.sbin/syslogd/ppp.conf
 - copied unchanged from r338145, head/etc/syslog.d/ppp.conf
  head/usr.sbin/syslogd/syslog.conf
 - copied unchanged from r338145, head/etc/syslog.conf
Deleted:
  head/etc/syslog.conf
  head/etc/syslog.d/
Modified:
  head/etc/Makefile
  head/usr.sbin/syslogd/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Aug 21 16:52:14 2018(r338145)
+++ head/etc/Makefile   Tue Aug 21 17:01:47 2018(r338146)
@@ -38,7 +38,6 @@ BIN1= crontab \
remote \
rpc \
services \
-   syslog.conf \
termcap.small
 
 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
@@ -154,7 +153,6 @@ distribution:
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
-   ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
 .if ${MK_UNBOUND} != "no"

Modified: head/usr.sbin/syslogd/Makefile
==
--- head/usr.sbin/syslogd/Makefile  Tue Aug 21 16:52:14 2018
(r338145)
+++ head/usr.sbin/syslogd/Makefile  Tue Aug 21 17:01:47 2018
(r338146)
@@ -5,6 +5,8 @@
 
 .PATH: ${SRCTOP}/usr.bin/wall
 
+CONFGROUPS=CONFS SYSLOGD_D
+CONFS= syslog.conf
 PROG=  syslogd
 MAN=   syslog.conf.5 syslogd.8
 SRCS=  syslogd.c ttymsg.c
@@ -16,6 +18,20 @@ CFLAGS+= -DINET
 .endif
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
+.endif
+
+SYSLOGD_D=
+SYSLOGD_DDIR=  /etc/syslog.d/
+.if ${MK_FTP} != "no"
+SYSLOGD_D+=ftp.conf
+.endif
+
+.if ${MK_LPR} != "no"
+SYSLOGD_D+=lpr.conf
+.endif
+
+.if ${MK_PPP} != "no"
+SYSLOGD_D+=ppp.conf
 .endif
 
 CFLAGS+= -I${SRCTOP}/usr.bin/wall

Copied: head/usr.sbin/syslogd/ftp.conf (from r338145, 
head/etc/syslog.d/ftp.conf)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/syslogd/ftp.conf  Tue Aug 21 17:01:47 2018
(r338146, copy of r338145, head/etc/syslog.d/ftp.conf)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+ftp.info   /var/log/xferlog

Copied: head/usr.sbin/syslogd/lpr.conf (from r338145, 
head/etc/syslog.d/lpr.conf)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/syslogd/lpr.conf  Tue Aug 21 17:01:47 2018
(r338146, copy of r338145, head/etc/syslog.d/lpr.conf)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+lpr.info   /var/log/lpd-errs

Copied: head/usr.sbin/syslogd/ppp.conf (from r338145, 
head/etc/syslog.d/ppp.conf)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/syslogd/ppp.conf  Tue Aug 21 17:01:47 2018
(r338146, copy of r338145, head/etc/syslog.d/ppp.conf)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+!ppp
+*.*/var/log/ppp.log

Copied: head/usr.sbin/syslogd/syslog.conf (from r338145, head/etc/syslog.conf)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/syslogd/syslog.conf   Tue Aug 21 17:01:47 2018
(r338146, copy of r338145, head/etc/syslog.conf)
@@ -0,0 +1,34 @@
+# $FreeBSD$
+#
+#  Spaces ARE valid field separators in this file. However,
+#  other *nix-like systems still insist on using tabs as field
+#  separators. If you are sharing this file between systems, you
+#  may want to use only tabs as field separators here.
+#  Consult the syslog.conf(5) manpage.
+*.err;kern.warning;auth.notice;mail.crit   /dev/console
+*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err  
/var/log/messages
+security.* /var/log/security
+auth.info;authpriv.info/var/log/auth.log
+mail.info  /var/log/maillog
+cron.* /var/log/cron

svn commit: r338145 - head/tools/build/mk

2018-08-21 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 21 16:52:14 2018
New Revision: 338145
URL: https://svnweb.freebsd.org/changeset/base/338145

Log:
  Relax the check added in 338096
  
  Checking for any include below ${SRCTOP}/sys is too strict and breaks
  e.g. mkimg which includes sys/sys/disk. ABI issues will only be caused
  by including headers in sys/sys since they might not match the host.
  
  Approved By:  jhb (mentor)
  Suggested By: imp

Modified:
  head/tools/build/mk/Makefile.boot

Modified: head/tools/build/mk/Makefile.boot
==
--- head/tools/build/mk/Makefile.boot   Tue Aug 21 16:51:45 2018
(r338144)
+++ head/tools/build/mk/Makefile.boot   Tue Aug 21 16:52:14 2018
(r338145)
@@ -8,12 +8,14 @@ LDFLAGS+= -L${WORLDTMP}/legacy/usr/lib
 # we do not want to capture dependencies referring to the above
 UPDATE_DEPENDFILE= no
 
-.if !make(obj)
 # When building host tools we should never pull in headers from the source sys
 # directory to avoid any ABI issues that might cause the built binary to crash.
 # The only exceptions to this are sys/cddl/compat for dtrace bootstrap tools 
and
 # sys/crypto for libmd bootstrap.
-.if 
!empty(CFLAGS:M*${SRCTOP}/sys*:N*${SRCTOP}/sys/cddl/compat*:N*${SRCTOP}/sys/crypto*)
+# We have to skip this check during make obj since bsd.crunchgen.mk will run
+# make obj on every directory during the build-tools phase.
+.if !make(obj)
+.if !empty(CFLAGS:M*${SRCTOP}/sys)
 .error Do not include $${SRCTOP}/sys when building bootstrap tools. \
 Copy the header to $${WORLDTMP}/legacy in tools/build/Makefile instead. \
 Error was caused by Makefile in ${.CURDIR}
___
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: r338144 - in head: etc etc/devd sbin/devd

2018-08-21 Thread Brad Davis
Author: brd
Date: Tue Aug 21 16:51:45 2018
New Revision: 338144
URL: https://svnweb.freebsd.org/changeset/base/338144

Log:
  Move all devd related configs to sbin/devd/
  
  This helps with pkgbase as it switches these to using CONFS so they are
  properly tagged as config files.
  
  Approved by:  will (mentor), imp
  Differential Revision:https://reviews.freebsd.org/D16781

Added:
  head/sbin/devd/apple.conf
 - copied unchanged from r338143, head/etc/devd/apple.conf
  head/sbin/devd/asus.conf
 - copied unchanged from r338143, head/etc/devd/asus.conf
  head/sbin/devd/devd.conf
 - copied unchanged from r338143, head/etc/devd.conf
  head/sbin/devd/devmatch.conf
 - copied unchanged from r338143, head/etc/devd/devmatch.conf
  head/sbin/devd/hyperv.conf
 - copied unchanged from r338143, head/etc/devd/hyperv.conf
  head/sbin/devd/uath.conf
 - copied unchanged from r338143, head/etc/devd/uath.conf
  head/sbin/devd/ulpt.conf
 - copied unchanged from r338143, head/etc/devd/ulpt.conf
  head/sbin/devd/zfs.conf
 - copied unchanged from r338143, head/etc/devd/zfs.conf
Deleted:
  head/etc/devd/
  head/etc/devd.conf
Modified:
  head/etc/Makefile
  head/sbin/devd/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Aug 21 16:43:46 2018(r338143)
+++ head/etc/Makefile   Tue Aug 21 16:51:45 2018(r338144)
@@ -13,7 +13,6 @@ SUBDIR+=sendmail
 .endif
 
 BIN1=  crontab \
-   devd.conf \
devfs.conf \
dhclient.conf \
disktab \
@@ -152,7 +151,6 @@ distribution:
${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
 .endif
${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
-   ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap

Modified: head/sbin/devd/Makefile
==
--- head/sbin/devd/Makefile Tue Aug 21 16:43:46 2018(r338143)
+++ head/sbin/devd/Makefile Tue Aug 21 16:51:45 2018(r338144)
@@ -4,6 +4,30 @@
 
 WARNS?= 3
 PACKAGE=runtime
+CONFGROUPS=CONFS DEVD
+CONFS= devd.conf
+DEVD=  devmatch.conf
+DEVDDIR=   /etc/devd
+.if ${MK_ACPI} != "no"
+DEVD+= asus.conf
+.endif
+
+.if ${MK_HYPERV} != "no"
+DEVD+= hyperv.conf
+.endif
+
+.if ${MK_USB} != "no"
+DEVD+= uath.conf ulpt.conf
+.endif
+
+.if ${MACHINE_ARCH} == "powerpc"
+DEVD+= apple.conf
+.endif
+
+.if ${MK_ZFS} != "no"
+DEVD+= zfs.conf
+.endif
+
 PROG_CXX=devd
 SRCS=  devd.cc token.l parse.y y.tab.h
 MAN=   devd.8 devd.conf.5

Copied: head/sbin/devd/apple.conf (from r338143, head/etc/devd/apple.conf)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/devd/apple.conf   Tue Aug 21 16:51:45 2018(r338144, copy 
of r338143, head/etc/devd/apple.conf)
@@ -0,0 +1,80 @@
+# $FreeBSD$
+#
+# PowerPC Apple specific devd events
+
+# Keyboard power key
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "Button";
+   action  "shutdown -p now";
+};
+
+
+# PowerBook and iBook lid close.
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "lid";
+   match "type""close";
+   action  "shutdown -p now";
+};
+
+
+# The next blocks enable brightness hotkeys that can be found on Apple laptops
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "keys";
+   match "type""brightness";
+   match "notify"  "down";
+   action  "sysctl dev.backlight.0.level=\
+   $(expr `sysctl -n dev.backlight.0.level` - 10)";
+};
+
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "keys";
+   match "type""brightness";
+   match "notify"  "up";
+   action  "sysctl dev.backlight.0.level=\
+   $(expr `sysctl -n dev.backlight.0.level` + 10)";
+};
+
+
+# The next blocks enable volume hotkeys that can be found on Apple laptops
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "keys";
+   match "type""mute";
+   action  "mixer 0";
+};
+
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "keys";
+   match "type""volume";
+   match "notify"  "down";
+   action  "mixer vol -10";
+};
+
+notify 0 {
+   match "system"  "PMU";
+   match "subsystem"   "keys";
+   match "type""volume";
+   match "notify"  "up";
+   action  "mixer vol +10";
+};
+
+# Eject key
+notify 0 {
+   match 

svn commit: r338143 - in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linuxkpi/common/src dev/hyperv/vmbus i386/i386 mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 vm x86/xen

2018-08-21 Thread Alan Cox
Author: alc
Date: Tue Aug 21 16:43:46 2018
New Revision: 338143
URL: https://svnweb.freebsd.org/changeset/base/338143

Log:
  Eliminate kmem_malloc()'s unused arena parameter.  (The arena parameter
  became unused in FreeBSD 12.x as a side-effect of the NUMA-related
  changes.)
  
  Reviewed by:  kib, markj
  Discussed with:   jeff, re@
  Differential Revision:https://reviews.freebsd.org/D16825

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/arm/arm/mp_machdep.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm64/arm64/mp_machdep.c
  head/sys/arm64/arm64/pmap.c
  head/sys/compat/linuxkpi/common/src/linux_page.c
  head/sys/dev/hyperv/vmbus/hyperv.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/i386/pmap.c
  head/sys/mips/mips/mp_machdep.c
  head/sys/powerpc/powerpc/mp_machdep.c
  head/sys/riscv/riscv/mp_machdep.c
  head/sys/sparc64/sparc64/mp_machdep.c
  head/sys/vm/uma_core.c
  head/sys/vm/vm_extern.h
  head/sys/vm/vm_init.c
  head/sys/vm/vm_kern.c
  head/sys/x86/xen/pv.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Tue Aug 21 16:37:37 2018
(r338142)
+++ head/sys/amd64/amd64/mp_machdep.c   Tue Aug 21 16:43:46 2018
(r338143)
@@ -402,18 +402,14 @@ native_start_all_aps(void)
apic_id = cpu_apic_ids[cpu];
 
/* allocate and set up an idle stack data page */
-   bootstacks[cpu] = (void *)kmem_malloc(kernel_arena,
-   kstack_pages * PAGE_SIZE, M_WAITOK | M_ZERO);
-   doublefault_stack = (char *)kmem_malloc(kernel_arena,
-   PAGE_SIZE, M_WAITOK | M_ZERO);
-   mce_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE,
+   bootstacks[cpu] = (void *)kmem_malloc(kstack_pages * PAGE_SIZE,
M_WAITOK | M_ZERO);
-   nmi_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE,
-   M_WAITOK | M_ZERO);
-   dbg_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE,
-   M_WAITOK | M_ZERO);
-   dpcpu = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
-   M_WAITOK | M_ZERO);
+   doublefault_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK |
+   M_ZERO);
+   mce_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK | M_ZERO);
+   nmi_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK | M_ZERO);
+   dbg_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK | M_ZERO);
+   dpcpu = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO);
 
bootSTK = (char *)bootstacks[cpu] + kstack_pages * PAGE_SIZE - 
8;
bootAP = cpu;

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Aug 21 16:37:37 2018(r338142)
+++ head/sys/amd64/amd64/pmap.c Tue Aug 21 16:43:46 2018(r338143)
@@ -1412,8 +1412,7 @@ pmap_init(void)
 */
s = (vm_size_t)(pv_npg * sizeof(struct md_page));
s = round_page(s);
-   pv_table = (struct md_page *)kmem_malloc(kernel_arena, s,
-   M_WAITOK | M_ZERO);
+   pv_table = (struct md_page *)kmem_malloc(s, M_WAITOK | M_ZERO);
for (i = 0; i < pv_npg; i++)
TAILQ_INIT(_table[i].pv_list);
TAILQ_INIT(_dummy.pv_list);

Modified: head/sys/amd64/amd64/sys_machdep.c
==
--- head/sys/amd64/amd64/sys_machdep.c  Tue Aug 21 16:37:37 2018
(r338142)
+++ head/sys/amd64/amd64/sys_machdep.c  Tue Aug 21 16:43:46 2018
(r338143)
@@ -361,8 +361,8 @@ amd64_set_ioperm(td, uap)
 */
pcb = td->td_pcb;
if (pcb->pcb_tssp == NULL) {
-   tssp = (struct amd64tss *)kmem_malloc(kernel_arena,
-   ctob(IOPAGES + 1), M_WAITOK);
+   tssp = (struct amd64tss *)kmem_malloc(ctob(IOPAGES + 1),
+   M_WAITOK);
pmap_pti_add_kva((vm_offset_t)tssp, (vm_offset_t)tssp +
ctob(IOPAGES + 1), false);
iomap = (char *)[1];
@@ -463,7 +463,7 @@ user_ldt_alloc(struct proc *p, int force)
mtx_unlock(_lock);
new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK);
sz = max_ldt_segment * sizeof(struct user_segment_descriptor);
-   sva = kmem_malloc(kernel_arena, sz, M_WAITOK | M_ZERO);
+   sva = kmem_malloc(sz, M_WAITOK | M_ZERO);
new_ldt->ldt_base = (caddr_t)sva;
pmap_pti_add_kva(sva, sva + sz, false);
new_ldt->ldt_refcnt = 1;

Modified: head/sys/arm/arm/mp_machdep.c
==
--- head/sys/arm/arm/mp_machdep.c   Tue Aug 21 16:37:37 2018
(r338142)

svn commit: r338142 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-08-21 Thread Mark Johnston
Author: markj
Date: Tue Aug 21 16:37:37 2018
New Revision: 338142
URL: https://svnweb.freebsd.org/changeset/base/338142

Log:
  Set arc_kmem_cache_reap_retry_ms to 0 and make it configurable.
  
  r329759 introduced this parameter, which controls the rate at which ZFS
  UMA zones are drained when the ARC reclaim thread is shrinking the ARC.
  The reclamation target is derived from the global free page count, and
  arc_shrink() only frees buffers back to UMA, so the free page count is
  not updated until the zones are drained.  Thus, back-to-back calls to
  arc_shrink() within the arc_kmem_cache_reap_retry_ms interval do not
  provide immediate feedback to the arc_reclaim control loop, so we may
  free more of the ARC than needed to address a transient page shortage.
  
  As we do not implement the asynchronous zone draining added in r329759,
  disable the retry interval, restoring pre-r329759 behaviour.  That is,
  we will drain the ZFS UMA zones before each attempt to shrink the ARC.
  
  Reviewed by:  mav
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Aug 21 
15:30:47 2018(r338141)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Aug 21 
16:37:37 2018(r338142)
@@ -320,7 +320,7 @@ int zfs_arc_evict_batch_limit = 10;
 static int arc_grow_retry = 60;
 
 /* number of milliseconds before attempting a kmem-cache-reap */
-static int arc_kmem_cache_reap_retry_ms = 1000;
+static int arc_kmem_cache_reap_retry_ms = 0;
 
 /* shift of arc_c for calculating overflow limit in arc_get_data_impl */
 intzfs_arc_overflow_shift = 8;
@@ -435,7 +435,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_grow_retry, CTLFLAG
 _grow_retry, 0,
 "Wait in seconds before considering growing ARC");
 SYSCTL_INT(_vfs_zfs, OID_AUTO, compressed_arc_enabled, CTLFLAG_RDTUN,
-_compressed_arc_enabled, 0, "Enable compressed ARC");
+_compressed_arc_enabled, 0,
+"Enable compressed ARC");
+SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_kmem_cache_reap_retry_ms, CTLFLAG_RWTUN,
+_kmem_cache_reap_retry_ms, 0,
+"Interval between ARC kmem_cache reapings");
 
 /*
  * We don't have a tunable for arc_free_target due to the dependency on
___
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: r338141 - head/release

2018-08-21 Thread Colin Percival
Author: cperciva
Date: Tue Aug 21 15:30:47 2018
New Revision: 338141
URL: https://svnweb.freebsd.org/changeset/base/338141

Log:
  Quieten the svn (or svnlite) commands used to extract information from an
  SVN checkout for placement into an EC2 AMI.  We only run these if there
  is a .svn directory; but in the event that SVN was used to check out a
  tree which is then exported over NFS, we were unnecessarily noisy.
  
  Reported by:  Andrey Fesenko
  MFC after:3 days
  X-MFC-With:   r336420, r336433, r336593, r336621,
r336622, r336624, r337394, r337401

Modified:
  head/release/Makefile.ec2

Modified: head/release/Makefile.ec2
==
--- head/release/Makefile.ec2   Tue Aug 21 15:11:43 2018(r338140)
+++ head/release/Makefile.ec2   Tue Aug 21 15:30:47 2018(r338141)
@@ -17,11 +17,11 @@ SVN_CMD=   ${_P}/${_S}
 .endif
 .if exists(${SRCTOP}/.svn)
 .  if empty(EC2_SVNBRANCH)
-   EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} | 
sed -e 's/\^\///'
+   EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} 
2>/dev/null | sed -e 's/\^\///'
 .  export EC2_SVNBRANCH
 .  endif
 .  if empty(EC2_SVNREV)
-   EC2_SVNREV!=${SVN_CMD} info --show-item last-changed-revision 
${WORLDDIR}
+   EC2_SVNREV!=${SVN_CMD} info --show-item last-changed-revision 
${WORLDDIR} 2>/dev/null || true
 .  export EC2_SVNREV
 .  endif
 .else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338140 - head/usr.bin/dtc

2018-08-21 Thread John-Mark Gurney
Author: jmg
Date: Tue Aug 21 15:11:43 2018
New Revision: 338140
URL: https://svnweb.freebsd.org/changeset/base/338140

Log:
  minor grammar nit, to what?  between them..

Modified:
  head/usr.bin/dtc/dtc.1

Modified: head/usr.bin/dtc/dtc.1
==
--- head/usr.bin/dtc/dtc.1  Tue Aug 21 14:34:24 2018(r338139)
+++ head/usr.bin/dtc/dtc.1  Tue Aug 21 15:11:43 2018(r338140)
@@ -56,7 +56,7 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility converts flattened device tree (FDT) representations.
+utility converts between flattened device tree (FDT) representations.
 It is most commonly used to generate device tree blobs (DTB), the binary
 representation of an FDT, from device tree sources (DTS), the ASCII text source
 representation.
___
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: r338139 - head/sys/cam/ctl

2018-08-21 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Aug 21 14:34:24 2018
New Revision: 338139
URL: https://svnweb.freebsd.org/changeset/base/338139

Log:
  Remove unneccessary code, which also introduced a (very minor)
  race condition, due to a missing call to cfiscsi_target_release().
  
  Discussed with:   mav@
  Tested by:Eugene M. Zheganin  (earlier version)
  MFC after:2 weeks
  Sponsored by: playkey.net

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue Aug 21 14:12:30 2018
(r338138)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue Aug 21 14:34:24 2018
(r338139)
@@ -2233,12 +2233,6 @@ cfiscsi_ioctl_port_remove(struct ctl_req *req)
"can't find target \"%s\"", target);
return;
}
-   if (ct->ct_state != CFISCSI_TARGET_STATE_ACTIVE) {
-   req->status = CTL_LUN_ERROR;
-   snprintf(req->error_str, sizeof(req->error_str),
-   "target \"%s\" is already dying", target);
-   return;
-   }
 
ct->ct_state = CFISCSI_TARGET_STATE_DYING;
ctl_port_offline(>ct_port);
___
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: r338138 - head/sys/netinet

2018-08-21 Thread Michael Tuexen
Author: tuexen
Date: Tue Aug 21 14:12:30 2018
New Revision: 338138
URL: https://svnweb.freebsd.org/changeset/base/338138

Log:
  Enabling the IPPROTO_IPV6 level socket option IPV6_USE_MIN_MTU on a TCP
  socket resulted in sending fragmented IPV6 packets.
  
  This is fixes by reducing the MSS to the appropriate value. In addtion,
  if the socket option is set before the handshake happens, announce this
  MSS to the peer. This is not stricly required, but done since TCP
  is conservative.
  
  PR:   173444
  Reviewed by:  bz@, rrs@
  MFC after:1 month
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16796

Modified:
  head/sys/netinet/in_pcb.h
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Tue Aug 21 14:07:36 2018(r338137)
+++ head/sys/netinet/in_pcb.h   Tue Aug 21 14:12:30 2018(r338138)
@@ -122,6 +122,7 @@ struct in_conninfo {
  * Flags for inc_flags.
  */
 #defineINC_ISIPV6  0x01
+#defineINC_IPV6MINMTU  0x02
 
 #defineinc_fport   inc_ie.ie_fport
 #defineinc_lport   inc_ie.ie_lport

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Aug 21 14:07:36 2018
(r338137)
+++ head/sys/netinet/tcp_input.cTue Aug 21 14:12:30 2018
(r338138)
@@ -1051,6 +1051,8 @@ findpcb:
 #ifdef INET6
if (isipv6) {
inc.inc_flags |= INC_ISIPV6;
+   if (inp->inp_inc.inc_flags & INC_IPV6MINMTU)
+   inc.inc_flags |= INC_IPV6MINMTU;
inc.inc6_faddr = ip6->ip6_src;
inc.inc6_laddr = ip6->ip6_dst;
} else

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Tue Aug 21 14:07:36 2018(r338137)
+++ head/sys/netinet/tcp_subr.c Tue Aug 21 14:12:30 2018(r338138)
@@ -2865,6 +2865,9 @@ tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap 
 
KASSERT(inc != NULL, ("tcp_maxmtu6 with NULL in_conninfo pointer"));
 
+   if (inc->inc_flags & INC_IPV6MINMTU)
+   return (IPV6_MMTU);
+
if (!IN6_IS_ADDR_UNSPECIFIED(>inc6_faddr)) {
in6_splitscope(>inc6_faddr, , );
if (fib6_lookup_nh_ext(inc->inc_fibnum, , scopeid, 0,

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Tue Aug 21 14:07:36 2018
(r338137)
+++ head/sys/netinet/tcp_usrreq.c   Tue Aug 21 14:12:30 2018
(r338138)
@@ -1584,6 +1584,42 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
if (inp->inp_vflag & INP_IPV6PROTO) {
INP_WUNLOCK(inp);
error = ip6_ctloutput(so, sopt);
+   /*
+* In case of the IPV6_USE_MIN_MTU socket option,
+* the INC_IPV6MINMTU flag to announce a corresponding
+* MSS during the initial handshake.
+* If the TCP connection is not in the front states,
+* just reduce the MSS being used.
+* This avoids the sending of TCP segments which will
+* be fragmented at the IPv6 layer.
+*/
+   if ((error == 0) &&
+   (sopt->sopt_dir == SOPT_SET) &&
+   (sopt->sopt_level == IPPROTO_IPV6) &&
+   (sopt->sopt_name == IPV6_USE_MIN_MTU)) {
+   INP_WLOCK(inp);
+   if ((inp->inp_flags &
+   (INP_TIMEWAIT | INP_DROPPED))) {
+   INP_WUNLOCK(inp);
+   return (ECONNRESET);
+   }
+   inp->inp_inc.inc_flags |= INC_IPV6MINMTU;
+   tp = intotcpcb(inp);
+   if ((tp->t_state >= TCPS_SYN_SENT) &&
+   (inp->inp_inc.inc_flags & INC_ISIPV6)) {
+   struct ip6_pktopts *opt;
+
+   opt = inp->in6p_outputopts;
+   if ((opt != NULL) &&
+   (opt->ip6po_minmtu ==
+   IP6PO_MINMTU_ALL)) {
+   if (tp->t_maxseg > TCP6_MSS) {

svn commit: r338137 - head/sys/netinet

2018-08-21 Thread Michael Tuexen
Author: tuexen
Date: Tue Aug 21 14:07:36 2018
New Revision: 338137
URL: https://svnweb.freebsd.org/changeset/base/338137

Log:
  Fix the inheritance of IPv6 level socket options on TCP sockets.
  
  This was broken for IPv6 listening socket, which are not IPV6_ONLY,
  and the accepted TCP connection was using IPv4.
  
  Reviewed by:  bz@, rrs@
  MFC after:1 month
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16792

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Tue Aug 21 14:04:30 2018
(r338136)
+++ head/sys/netinet/tcp_syncache.c Tue Aug 21 14:07:36 2018
(r338137)
@@ -770,10 +770,9 @@ syncache_socket(struct syncache *sc, struct socket *ls
goto abort;
}
 #ifdef INET6
-   if (sc->sc_inc.inc_flags & INC_ISIPV6) {
+   if (inp->inp_vflag & INP_IPV6PROTO) {
struct inpcb *oinp = sotoinpcb(lso);
-   struct in6_addr laddr6;
-   struct sockaddr_in6 sin6;
+
/*
 * Inherit socket options from the listening socket.
 * Note that in6p_inputopts are not (and should not be)
@@ -787,6 +786,11 @@ syncache_socket(struct syncache *sc, struct socket *ls
if (oinp->in6p_outputopts)
inp->in6p_outputopts =
ip6_copypktopts(oinp->in6p_outputopts, M_NOWAIT);
+   }
+
+   if (sc->sc_inc.inc_flags & INC_ISIPV6) {
+   struct in6_addr laddr6;
+   struct sockaddr_in6 sin6;
 
sin6.sin6_family = AF_INET6;
sin6.sin6_len = sizeof(sin6);
___
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: r338136 - in head: lib/libc/sys sys/kern sys/sys

2018-08-21 Thread Michael Tuexen
Author: tuexen
Date: Tue Aug 21 14:04:30 2018
New Revision: 338136
URL: https://svnweb.freebsd.org/changeset/base/338136

Log:
  Add SOL_SOCKET level socket option with name SO_DOMAIN to get
  the domain of a socket.
  
  This is helpful when testing and Solaris and Linux have the same
  socket option using the same name.
  
  Reviewed by:  bcr@, rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16791

Modified:
  head/lib/libc/sys/getsockopt.2
  head/sys/kern/uipc_socket.c
  head/sys/sys/socket.h

Modified: head/lib/libc/sys/getsockopt.2
==
--- head/lib/libc/sys/getsockopt.2  Tue Aug 21 13:37:06 2018
(r338135)
+++ head/lib/libc/sys/getsockopt.2  Tue Aug 21 14:04:30 2018
(r338136)
@@ -28,7 +28,7 @@
 .\" @(#)getsockopt.2   8.4 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd May 9, 2018
+.Dd August 21, 2018
 .Dt GETSOCKOPT 2
 .Os
 .Sh NAME
@@ -172,6 +172,7 @@ for the socket
 .It Dv SO_TIMESTAMP Ta "enables reception of a timestamp with datagrams"
 .It Dv SO_BINTIME Ta "enables reception of a timestamp with datagrams"
 .It Dv SO_ACCEPTCONN Ta "get listening status of the socket (get only)"
+.It Dv SO_DOMAIN Ta "get the domain of the socket (get only)"
 .It Dv SO_TYPE Ta "get the type of the socket (get only)"
 .It Dv SO_PROTOCOL Ta "get the protocol number for the socket (get only)"
 .It Dv SO_PROTOTYPE Ta "SunOS alias for the Linux SO_PROTOCOL (get only)"

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Tue Aug 21 13:37:06 2018(r338135)
+++ head/sys/kern/uipc_socket.c Tue Aug 21 14:04:30 2018(r338136)
@@ -3008,6 +3008,10 @@ integer:
error = sooptcopyout(sopt, , sizeof optval);
break;
 
+   case SO_DOMAIN:
+   optval = so->so_proto->pr_domain->dom_family;
+   goto integer;
+
case SO_TYPE:
optval = so->so_type;
goto integer;

Modified: head/sys/sys/socket.h
==
--- head/sys/sys/socket.h   Tue Aug 21 13:37:06 2018(r338135)
+++ head/sys/sys/socket.h   Tue Aug 21 14:04:30 2018(r338136)
@@ -171,6 +171,7 @@ typedef __uintptr_t uintptr_t;
 #defineSO_PROTOTYPESO_PROTOCOL /* alias for SO_PROTOCOL (SunOS 
name) */
 #defineSO_TS_CLOCK 0x1017  /* clock type used for 
SO_TIMESTAMP */
 #defineSO_MAX_PACING_RATE  0x1018  /* socket's max TX pacing rate 
(Linux name) */
+#defineSO_DOMAIN   0x1019  /* get socket domain */
 #endif
 
 #if __BSD_VISIBLE
___
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: r338135 - head/sys/netinet

2018-08-21 Thread Michael Tuexen
Author: tuexen
Date: Tue Aug 21 13:37:06 2018
New Revision: 338135
URL: https://svnweb.freebsd.org/changeset/base/338135

Log:
  Whitespace change.

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Tue Aug 21 13:25:32 2018(r338134)
+++ head/sys/netinet/sctputil.c Tue Aug 21 13:37:06 2018(r338135)
@@ -7381,6 +7381,7 @@ sctp_hc_get_mtu(union sctp_sockstore *addr, uint16_t f
}
return ((uint32_t)tcp_hc_getmtu());
 }
+
 void
 sctp_set_state(struct sctp_tcb *stcb, int new_state)
 {
___
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: r338134 - head/sys/netinet

2018-08-21 Thread Michael Tuexen
Author: tuexen
Date: Tue Aug 21 13:25:32 2018
New Revision: 338134
URL: https://svnweb.freebsd.org/changeset/base/338134

Log:
  Refactor the SHUTDOWN_PENDING state handling.
  
  This is not a functional change but a preperation for the upcoming
  DTrace support. It is necessary to change the state in one
  logical operation, even if it involves clearing the sub state
  SHUTDOWN_PENDING.
  
  MFC after:1 month

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_timer.c
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Tue Aug 21 11:22:49 2018
(r338133)
+++ head/sys/netinet/sctp_constants.h   Tue Aug 21 13:25:32 2018
(r338134)
@@ -473,11 +473,11 @@ __FBSDID("$FreeBSD$");
 #define SCTP_GET_STATE(_stcb) \
((_stcb)->asoc.state & SCTP_STATE_MASK)
 #define SCTP_SET_STATE(_stcb, _state) \
-   (_stcb)->asoc.state = ((_stcb)->asoc.state & ~SCTP_STATE_MASK) | 
(_state)
+   sctp_set_state(_stcb, _state)
 #define SCTP_CLEAR_SUBSTATE(_stcb, _substate) \
(_stcb)->asoc.state &= ~(_substate)
 #define SCTP_ADD_SUBSTATE(_stcb, _substate) \
-   (_stcb)->asoc.state |= (_substate)
+   sctp_add_substate(_stcb, _substate)
 
 /* SCTP reachability state for each address */
 #define SCTP_ADDR_REACHABLE0x001

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Tue Aug 21 11:22:49 2018
(r338133)
+++ head/sys/netinet/sctp_indata.c  Tue Aug 21 13:25:32 2018
(r338134)
@@ -4355,7 +4355,6 @@ again:
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT);
-   SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING);
sctp_stop_timers_for_shutdown(stcb);
if (asoc->alternate) {
netp = asoc->alternate;
@@ -4373,7 +4372,6 @@ again:
 
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT);
-   SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING);
sctp_stop_timers_for_shutdown(stcb);
if (asoc->alternate) {
netp = asoc->alternate;
@@ -5052,7 +5050,6 @@ hopeless_peer:
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT);
-   SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING);
sctp_stop_timers_for_shutdown(stcb);
if (asoc->alternate) {
netp = asoc->alternate;
@@ -5071,7 +5068,6 @@ hopeless_peer:
 
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT);
-   SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING);
sctp_stop_timers_for_shutdown(stcb);
if (asoc->alternate) {
netp = asoc->alternate;

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Tue Aug 21 11:22:49 2018
(r338133)
+++ head/sys/netinet/sctp_input.c   Tue Aug 21 13:25:32 2018
(r338134)
@@ -962,7 +962,6 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
(SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) &&
(SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT)) {
SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_RECEIVED);
-   SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING);
/*
 * notify upper layer that peer has initiated a
 * shutdown
@@ -997,7 +996,6 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
(SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
-   SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING);
if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) {
SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT);
sctp_stop_timers_for_shutdown(stcb);

Modified: 

svn commit: r338133 - head/usr.sbin/gstat

2018-08-21 Thread Marcelo Araujo
Author: araujo
Date: Tue Aug 21 11:22:49 2018
New Revision: 338133
URL: https://svnweb.freebsd.org/changeset/base/338133

Log:
  - Add CSV output to gstat via -C flag.
  
  Add a -C option, similar to -B, that allows gstat to produce basic CSV output
  with absolute timestamps (ISO 8601, nearly.) Multiple devices are handled by
  way of a single-pivot CSV table with duplicated timestamps for each object
  output.
  
  Submitted by: Nick Principe 
  Reviewed by:  myself, imp@, asomers (earlier verison), bcr (manpages)
  Sponsored by: iXsystems Inc.
  Differential Revision:https://reviews.freebsd.org/D16151

Modified:
  head/usr.sbin/gstat/gstat.8
  head/usr.sbin/gstat/gstat.c

Modified: head/usr.sbin/gstat/gstat.8
==
--- head/usr.sbin/gstat/gstat.8 Tue Aug 21 11:17:25 2018(r338132)
+++ head/usr.sbin/gstat/gstat.8 Tue Aug 21 11:22:49 2018(r338133)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 10, 2016
+.Dd August 21, 2018
 .Dt GSTAT 8
 .Os
 .Sh NAME
@@ -61,6 +61,10 @@ consumers too.
 The default is to show statistics only for
 .Xr geom 4
 producers.
+.It Fl C
+CSV output mode.
+Implies endless batch mode, but output is in the form of comma-separated
+values, with ISO 8601-like timestamps.
 .It Fl d
 Enable display of statistics for delete
 .Pq Dv BIO_DELETE

Modified: head/usr.sbin/gstat/gstat.c
==
--- head/usr.sbin/gstat/gstat.c Tue Aug 21 11:17:25 2018(r338132)
+++ head/usr.sbin/gstat/gstat.c Tue Aug 21 11:22:49 2018(r338133)
@@ -53,9 +53,12 @@
 #include 
 #include 
 
-static int flag_a, flag_b, flag_B, flag_c, flag_d, flag_o, flag_p, flag_s;
+static int flag_a, flag_b, flag_B, flag_c, flag_C, flag_d, flag_o, flag_p,
+  flag_s;
 static int flag_I = 100;
 
+#define HIGH_PCT_BUSY_THRESH 80
+#define MEDIUM_PCT_BUSY_THRESH 50
 #define PRINTMSG(...) do { \
if ((flag_b && !loop) || (flag_B))  \
printf(__VA_ARGS__);\
@@ -76,7 +79,7 @@ int
 main(int argc, char **argv)
 {
int error, i, quit;
-   int curx, cury, maxx, maxy, line_len, loop, max_flen;
+   int curx, cury, maxx, maxy, line_len, loop, max_flen, head_printed;
struct devstat *gsp, *gsq;
void *sp, *sq;
double dt;
@@ -89,6 +92,7 @@ main(int argc, char **argv)
short cf, cb;
char *p;
char f_s[100], pf_s[100], tmp_f_s[100];
+   char ts[100], g_name[4096];
const char *line;
long double ld[16];
uint64_t u64;
@@ -106,7 +110,7 @@ main(int argc, char **argv)
flag_b = 1;
 
f_s[0] = '\0';
-   while ((i = getopt(argc, argv, "abBdcf:I:ops")) != -1) {
+   while ((i = getopt(argc, argv, "abBdcCf:I:ops")) != -1) {
switch (i) {
case 'a':
flag_a = 1;
@@ -121,6 +125,13 @@ main(int argc, char **argv)
case 'c':
flag_c = 1;
break;
+   case 'C':
+   flag_C = 1;
+   /* csv out implies repeating batch mode */
+   flag_b = 1;
+   flag_B = 1;
+   head_printed = 0;
+   break;
case 'd':
flag_d = 1;
break;
@@ -214,13 +225,21 @@ main(int argc, char **argv)
dt = tp.tv_sec - tq.tv_sec;
dt += (tp.tv_nsec - tq.tv_nsec) * 1e-9;
tq = tp;
+   if (flag_C) { /* set timestamp string */
+   (void)strftime(ts,sizeof(ts),
+   "%F %T",localtime(_sec));
+   (void)snprintf(ts,sizeof(ts),
+   "%s.%.9ld",ts,tq.tv_nsec);
+   }

geom_stats_snapshot_reset(sp);
geom_stats_snapshot_reset(sq);
if (!flag_b)
move(0,0);
-   PRINTMSG("dT: %5.3fs  w: %.3fs", dt, (float)flag_I / 100);
-   if (f_s[0] != '\0') {
+   if (!flag_C)
+   PRINTMSG("dT: %5.3fs  w: %.3fs", dt,
+   (float)flag_I / 100);
+   if (!flag_C && f_s[0] != '\0') {
PRINTMSG("  filter: ");
if (!flag_b) {
getyx(stdscr, cury, curx);
@@ -239,25 +258,52 @@ main(int argc, char **argv)
}
PRINTMSG("%s", pf_s);
}
-   PRINTMSG("\n");
-   PRINTMSG(" L(q)  ops/s   ");
-   if (flag_s) {
-   PRINTMSG(" r/s kB   kBps   ms/r   

svn commit: r338132 - in stable/10/sys/fs: nfs nfsserver

2018-08-21 Thread Rick Macklem
Author: rmacklem
Date: Tue Aug 21 11:17:25 2018
New Revision: 338132
URL: https://svnweb.freebsd.org/changeset/base/338132

Log:
  MFC: r336839
  Modify the NFSv4.1 server so that it allows ReclaimComplete as done by ESXi 
6.7.
  
  I believe that a ReclaimComplete with rca_one_fs == TRUE is only
  to be used after a file system has been transferred to a different
  file server.  However, RFC5661 is somewhat vague w.r.t. this and
  the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs == TRUE
  and one with ReclaimComplete with rca_one_fs == FALSE.
  Therefore, just ignore the rca_one_fs == TRUE operation and return
  NFS_OK without doing anything instead of replying NFS4ERR_NOTSUPP.
  This allows the ESXi 6.7 NFSv4.1 client to do a mount.
  After discussion on the NFSv4 IETF working group mailing list, doing this
  along with setting a flag to note that a ReclaimComplete with rca_one_fs TRUE
  was an appropriate way to handle this.
  The flag that indicates that a ReclaimComplete with rca_one_fs == TRUE was
  done may be used to disable replies of NFS4ERR_GRACE for non-reclaim
  state operations in a future commit.
  
  This patch along with r332790, r334492 and r336357 allow ESXi 6.7 NFSv4.1 
mounts
  work ok. ESX 6.5 NFSv4.1 mounts do not work well, due to what I believe are
  violations of RFC-5661 and should not be used.

Modified:
  stable/10/sys/fs/nfs/nfs.h
  stable/10/sys/fs/nfs/nfs_var.h
  stable/10/sys/fs/nfsserver/nfs_nfsdserv.c
  stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfs/nfs.h
==
--- stable/10/sys/fs/nfs/nfs.h  Tue Aug 21 11:10:49 2018(r338131)
+++ stable/10/sys/fs/nfs/nfs.h  Tue Aug 21 11:17:25 2018(r338132)
@@ -289,6 +289,7 @@ struct nfsreferral {
 #defineLCL_RECLAIMCOMPLETE 0x0001
 #defineLCL_NFSV41  0x0002
 #defineLCL_DONEBINDCONN0x0004
+#defineLCL_RECLAIMONEFS0x0008
 
 #defineLCL_GSS LCL_KERBV   /* Or of all mechs */
 

Modified: stable/10/sys/fs/nfs/nfs_var.h
==
--- stable/10/sys/fs/nfs/nfs_var.h  Tue Aug 21 11:10:49 2018
(r338131)
+++ stable/10/sys/fs/nfs/nfs_var.h  Tue Aug 21 11:17:25 2018
(r338132)
@@ -135,7 +135,7 @@ void nfsrv_nfsuserddelport(void);
 void nfsrv_throwawayallstate(NFSPROC_T *);
 int nfsrv_checksequence(struct nfsrv_descript *, uint32_t, uint32_t *,
 uint32_t *, int, uint32_t *, NFSPROC_T *);
-int nfsrv_checkreclaimcomplete(struct nfsrv_descript *);
+int nfsrv_checkreclaimcomplete(struct nfsrv_descript *, int);
 void nfsrv_cache_session(uint8_t *, uint32_t, int, struct mbuf **);
 void nfsrv_freeallbackchannel_xprts(void);
 

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Aug 21 11:10:49 2018
(r338131)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Aug 21 11:17:25 2018
(r338132)
@@ -3985,17 +3985,26 @@ nfsrvd_reclaimcomplete(struct nfsrv_descript *nd, __un
 __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff 
*exp)
 {
uint32_t *tl;
-   int error = 0;
+   int error = 0, onefs;
 
if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
nd->nd_repstat = NFSERR_WRONGSEC;
goto nfsmout;
}
NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED);
+   /*
+* I believe that a ReclaimComplete with rca_one_fs == TRUE is only
+* to be used after a file system has been transferred to a different
+* file server.  However, RFC5661 is somewhat vague w.r.t. this and
+* the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs
+* == TRUE and one with ReclaimComplete with rca_one_fs == FALSE.
+* Therefore, just ignore the rca_one_fs == TRUE operation and return
+* NFS_OK without doing anything.
+*/
+   onefs = 0;
if (*tl == newnfs_true)
-   nd->nd_repstat = NFSERR_NOTSUPP;
-   else
-   nd->nd_repstat = nfsrv_checkreclaimcomplete(nd);
+   onefs = 1;
+   nd->nd_repstat = nfsrv_checkreclaimcomplete(nd, onefs);
 nfsmout:
NFSEXITCODE2(error, nd);
return (error);

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Aug 21 11:10:49 2018
(r338131)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Aug 21 11:17:25 2018
(r338132)
@@ -5938,7 +5938,7 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_
  * Check/set reclaim complete for this session/clientid.
  */
 int

svn commit: r338131 - in stable/11/sys/fs: nfs nfsserver

2018-08-21 Thread Rick Macklem
Author: rmacklem
Date: Tue Aug 21 11:10:49 2018
New Revision: 338131
URL: https://svnweb.freebsd.org/changeset/base/338131

Log:
  MFC: r336839
  Modify the NFSv4.1 server so that it allows ReclaimComplete as done by ESXi 
6.7.
  
  I believe that a ReclaimComplete with rca_one_fs == TRUE is only
  to be used after a file system has been transferred to a different
  file server.  However, RFC5661 is somewhat vague w.r.t. this and
  the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs == TRUE
  and one with ReclaimComplete with rca_one_fs == FALSE.
  Therefore, just ignore the rca_one_fs == TRUE operation and return
  NFS_OK without doing anything instead of replying NFS4ERR_NOTSUPP.
  This allows the ESXi 6.7 NFSv4.1 client to do a mount.
  After discussion on the NFSv4 IETF working group mailing list, doing this
  along with setting a flag to note that a ReclaimComplete with rca_one_fs TRUE
  was an appropriate way to handle this.
  The flag that indicates that a ReclaimComplete with rca_one_fs == TRUE was
  done may be used to disable replies of NFS4ERR_GRACE for non-reclaim
  state operations in a future commit.
  
  This patch along with r332790, r334492 and r336357 allow ESXi 6.7 NFSv4.1 
mounts
  work ok. ESX 6.5 NFSv4.1 mounts do not work well, due to what I believe are
  violations of RFC-5661 and should not be used.

Modified:
  stable/11/sys/fs/nfs/nfs.h
  stable/11/sys/fs/nfs/nfs_var.h
  stable/11/sys/fs/nfsserver/nfs_nfsdserv.c
  stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfs/nfs.h
==
--- stable/11/sys/fs/nfs/nfs.h  Tue Aug 21 10:08:12 2018(r338130)
+++ stable/11/sys/fs/nfs/nfs.h  Tue Aug 21 11:10:49 2018(r338131)
@@ -289,6 +289,7 @@ struct nfsreferral {
 #defineLCL_RECLAIMCOMPLETE 0x0001
 #defineLCL_NFSV41  0x0002
 #defineLCL_DONEBINDCONN0x0004
+#defineLCL_RECLAIMONEFS0x0008
 
 #defineLCL_GSS LCL_KERBV   /* Or of all mechs */
 

Modified: stable/11/sys/fs/nfs/nfs_var.h
==
--- stable/11/sys/fs/nfs/nfs_var.h  Tue Aug 21 10:08:12 2018
(r338130)
+++ stable/11/sys/fs/nfs/nfs_var.h  Tue Aug 21 11:10:49 2018
(r338131)
@@ -135,7 +135,7 @@ void nfsrv_nfsuserddelport(void);
 void nfsrv_throwawayallstate(NFSPROC_T *);
 int nfsrv_checksequence(struct nfsrv_descript *, uint32_t, uint32_t *,
 uint32_t *, int, uint32_t *, NFSPROC_T *);
-int nfsrv_checkreclaimcomplete(struct nfsrv_descript *);
+int nfsrv_checkreclaimcomplete(struct nfsrv_descript *, int);
 void nfsrv_cache_session(uint8_t *, uint32_t, int, struct mbuf **);
 void nfsrv_freeallbackchannel_xprts(void);
 

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Aug 21 10:08:12 2018
(r338130)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Aug 21 11:10:49 2018
(r338131)
@@ -4016,17 +4016,26 @@ nfsrvd_reclaimcomplete(struct nfsrv_descript *nd, __un
 __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff 
*exp)
 {
uint32_t *tl;
-   int error = 0;
+   int error = 0, onefs;
 
if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
nd->nd_repstat = NFSERR_WRONGSEC;
goto nfsmout;
}
NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED);
+   /*
+* I believe that a ReclaimComplete with rca_one_fs == TRUE is only
+* to be used after a file system has been transferred to a different
+* file server.  However, RFC5661 is somewhat vague w.r.t. this and
+* the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs
+* == TRUE and one with ReclaimComplete with rca_one_fs == FALSE.
+* Therefore, just ignore the rca_one_fs == TRUE operation and return
+* NFS_OK without doing anything.
+*/
+   onefs = 0;
if (*tl == newnfs_true)
-   nd->nd_repstat = NFSERR_NOTSUPP;
-   else
-   nd->nd_repstat = nfsrv_checkreclaimcomplete(nd);
+   onefs = 1;
+   nd->nd_repstat = nfsrv_checkreclaimcomplete(nd, onefs);
 nfsmout:
NFSEXITCODE2(error, nd);
return (error);

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Aug 21 10:08:12 2018
(r338130)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Aug 21 11:10:49 2018
(r338131)
@@ -5946,7 +5946,7 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_
  * Check/set reclaim complete for this session/clientid.
  */
 int

svn commit: r338130 - head/sys/dev/mly

2018-08-21 Thread John Baldwin
Author: jhb
Date: Tue Aug 21 10:08:12 2018
New Revision: 338130
URL: https://svnweb.freebsd.org/changeset/base/338130

Log:
  De-spl mly(4).
  
  The driver already has mutex locking and holds its per-softc lock across
  calls to the one function that still used splcam().

Modified:
  head/sys/dev/mly/mly.c

Modified: head/sys/dev/mly/mly.c
==
--- head/sys/dev/mly/mly.c  Tue Aug 21 09:35:56 2018(r338129)
+++ head/sys/dev/mly/mly.c  Tue Aug 21 10:08:12 2018(r338130)
@@ -1215,7 +1215,6 @@ mly_fetch_event(struct mly_softc *sc)
 {
 struct mly_command *mc;
 struct mly_command_ioctl   *mci;
-ints;
 u_int32_t  event;
 
 debug_called(1);
@@ -1237,14 +1236,11 @@ mly_fetch_event(struct mly_softc *sc)
  * Get an event number to fetch.  It's possible that we've raced with 
another
  * context for the last event, in which case there will be no more events.
  */
-s = splcam();
 if (sc->mly_event_counter == sc->mly_event_waiting) {
mly_release_command(mc);
-   splx(s);
return;
 }
 event = sc->mly_event_counter++;
-splx(s);
 
 /* 
  * Build the ioctl.
___
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: r338129 - head/tools/build/mk

2018-08-21 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 21 09:35:56 2018
New Revision: 338129
URL: https://svnweb.freebsd.org/changeset/base/338129

Log:
  Fix -DWITHOUT_AUTO_OBJ build of rescue after r338096
  
  Approved By:  jhb (mentor)

Modified:
  head/tools/build/mk/Makefile.boot

Modified: head/tools/build/mk/Makefile.boot
==
--- head/tools/build/mk/Makefile.boot   Tue Aug 21 03:45:09 2018
(r338128)
+++ head/tools/build/mk/Makefile.boot   Tue Aug 21 09:35:56 2018
(r338129)
@@ -8,6 +8,7 @@ LDFLAGS+=   -L${WORLDTMP}/legacy/usr/lib
 # we do not want to capture dependencies referring to the above
 UPDATE_DEPENDFILE= no
 
+.if !make(obj)
 # When building host tools we should never pull in headers from the source sys
 # directory to avoid any ABI issues that might cause the built binary to crash.
 # The only exceptions to this are sys/cddl/compat for dtrace bootstrap tools 
and
@@ -23,4 +24,5 @@ UPDATE_DEPENDFILE= no
 .error Do not include $${SRCTOP}/include when building bootstrap tools. \
 Copy the header to $${WORLDTMP}/legacy in tools/build/Makefile instead. \
 Error was caused by Makefile in ${.CURDIR}
+.endif
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r338096 - head/tools/build/mk

2018-08-21 Thread Alexander Richardson
I'm a quite surprised by this error since I can't see anywhere that gdbe
would be built as a bootstrap tool (otherwise tools/build/mk should not be
used).
I've successfully built resuce with this so there must be some
environment/make variable that causes this.
It seems this happens during the build-tools stages if WITHOUT_AUTO_OBJ is
set. I'll work on a patch immediately.

Alex

On Mon, 20 Aug 2018 at 21:14 Warner Losh  wrote:

> On Mon, Aug 20, 2018 at 1:59 PM, O. Hartmann 
> wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA512
>>
>> Am Mon, 20 Aug 2018 13:48:45 -0600
>> Warner Losh  schrieb:
>>
>> > On Mon, Aug 20, 2018 at 1:45 PM, O. Hartmann 
>> wrote:
>> >
>> > > -BEGIN PGP SIGNED MESSAGE-
>> > > Hash: SHA512
>> > >
>> > > Am Mon, 20 Aug 2018 10:39:43 + (UTC)
>> > > Alex Richardson  schrieb:
>> > >
>> > > > Author: arichardson
>> > > > Date: Mon Aug 20 10:39:42 2018
>> > > > New Revision: 338096
>> > > > URL: https://svnweb.freebsd.org/changeset/base/338096
>> > > >
>> > > > Log:
>> > > >   Avoid depending on system headers from the source tree during
>> bootstrap
>> > > >
>> > > >   This can cause surprising errors if the build tools is built
>> against
>> > > >   headers that don't match the host system. It is also required in
>> order
>> > > >   to allow building on non-FreeBSD systems where the headers in
>> > > >   /usr/include/sys are usually completely incompatible with those
>> in the
>> > > >   source tree.
>> > > >
>> > > >   I added an error to Makefile.boot if this is done and found this
>> was
>> > > >   only the case in libnv. With this error in the Makefile ABI
>> breakages
>> > > >   such as r336019 should no longer be possible.
>> > > >
>> > > >   Reviewed By:bdrewery, kevans
>> > > >   Approved By:jhb (mentor)
>> > > >   Differential Revision: https://reviews.freebsd.org/D16186
>> > > >
>> > > > Modified:
>> > > >   head/tools/build/mk/Makefile.boot
>> > > >
>> > > > Modified: head/tools/build/mk/Makefile.boot
>> > > > 
>> > > ==
>> > > > --- head/tools/build/mk/Makefile.boot Mon Aug 20 10:39:37 2018
>> > > (r338095)
>> > > > +++ head/tools/build/mk/Makefile.boot Mon Aug 20 10:39:42 2018
>> > > (r338096)
>> > > > @@ -7,3 +7,20 @@ LDFLAGS+=-L${WORLDTMP}/legacy/usr/lib
>> > > >
>> > > >  # we do not want to capture dependencies referring to the above
>> > > >  UPDATE_DEPENDFILE= no
>> > > > +
>> > > > +# When building host tools we should never pull in headers from
>> the
>> > > source sys
>> > > > +# directory to avoid any ABI issues that might cause the built
>> binary
>> > > to crash.
>> > > > +# The only exceptions to this are sys/cddl/compat for dtrace
>> bootstrap
>> > > tools and
>> > > > +# sys/crypto for libmd bootstrap.
>> > > > +.if !empty(CFLAGS:M*${SRCTOP}/sys*:N*${SRCTOP}/sys/cddl/compat*:
>> > > N*${SRCTOP}/sys/crypto*)
>> > > > +.error Do not include $${SRCTOP}/sys when building bootstrap
>> tools. \
>> > > > +Copy the header to $${WORLDTMP}/legacy in
>> tools/build/Makefile
>> > > instead. \
>> > > > +Error was caused by Makefile in ${.CURDIR}
>> > > > +.endif
>> > > > +
>> > > > +# ${SRCTOP}/include should also never be used to avoid ABI issues
>> > > > +.if !empty(CFLAGS:M*${SRCTOP}/include*)
>> > > > +.error Do not include $${SRCTOP}/include when building bootstrap
>> tools.
>> > > \
>> > > > +Copy the header to $${WORLDTMP}/legacy in
>> tools/build/Makefile
>> > > instead. \
>> > > > +Error was caused by Makefile in ${.CURDIR}
>> > > > +.endif
>> > > > ___
>> > > > svn-src-h...@freebsd.org mailing list
>> > > > https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> > > > To unsubscribe, send any mail to "
>> svn-src-head-unsubscr...@freebsd.org"
>> > >
>> > >
>> > > This commit seems to break NanoBSD builds!
>> > >
>> > > While r338095 still build my NanoBSD obj tree, >= r338096 fails with:
>> > >
>> > > [...]
>> > > - --- obj_crunchdir_gbde ---
>> > > cd /pool/sources/CURRENT/src/rescue/rescue/../../sbin/gbde &&
>> MK_TESTS=no
>> > > UPDATE_DEPENDFILE=no  _RECURSING_CRUNCH=1
>> > > MAKEOBJDIRPREFIX=/pool/nanobsd/amd64/ALERICH_amd64/
>> > > pool/sources/CURRENT/src/amd64.amd64/rescue/rescue
>> > > make  MK_AUTO_OBJ=no  DIRPRFX=rescue/rescue/gbde/ -DRESCUE
>> > > CRUNCH_CFLAGS=-DRESCUE
>> > > MK_AUTO_OBJ=no   obj make[5]: "/pool/sources/CURRENT/src/
>> > > tools/build/mk/Makefile.boot"
>> > > line 18: Do not include ${SRCTOP}/sys when building bootstrap tools.
>> Copy
>> > > the header to
>> > > ${WORLDTMP}/legacy in tools/build/Makefile instead.  Error was caused
>> by
>> > > Makefile
>> > > in /pool/sources/CURRENT/src/sbin/gbde *** [obj_crunchdir_gbde] Error
>> > > code 1
>> > >
>> >
>> >
>> > NanoBSD just does a buildworld with a few env vars, but nothing
>> exotic
>> >
>> > And in the case of 'obj' target, who cares about the includes...
>> >
>> > Warner
>>
>> So, how to 

Re: svn commit: r338128 - in head: cddl/lib/libzpool cddl/usr.bin/ztest cddl/usr.sbin/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/conf sys/modules/zfs

2018-08-21 Thread Bruce Evans

On Tue, 21 Aug 2018, John Baldwin wrote:


On 8/21/18 4:45 AM, Matt Macy wrote:

...
Log:
  Make dnode definition uniform on !x86

  gcc4 requires -fms-extensions to accept anonymous union members


It does not.  Anonymous unions have been a standard gcc extension since
~1989, but these are turned off by requesting a c99 compiler using CSTD=c99.
Requesting this is broken, but clang is too broken to honor the request.


Modified:
  head/cddl/lib/libzpool/Makefile
  head/cddl/usr.bin/ztest/Makefile
  head/cddl/usr.sbin/zdb/Makefile
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h
  head/sys/conf/kern.pre.mk
  head/sys/modules/zfs/Makefile


Are you really sure you need the CFLAGS changes in all these places?  Userland
already defaults to a 'cstd' of 'gnu99' which allows anonymous unions by
default (whereas the kernel uses 'c99'), and kern.pre.mk already adds
-fms-extensions to CFLAGS earlier in the file (so that change is redundant).
kmod.mk also adds -fms-extensions already (so the ZFS change should be 
redundant).


kern.pre.mk adds it just 3 lines earlier, so it is visibly added twice in
the patch that adds it:

XX Modified: head/sys/conf/kern.pre.mk
XX 
==
XX --- head/sys/conf/kern.pre.mkTue Aug 21 03:33:54 2018
(r338127)
XX +++ head/sys/conf/kern.pre.mkTue Aug 21 03:45:09 2018
(r338128)
XX @@ -89,6 +89,7 @@ CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=10
XX  CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT}
 ^^^
XX  CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH}
XX  CFLAGS.gcc+= --param 
large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} XX +CFLAGS.gcc+= 
-fms-extensions
 ^^^
XX  .if defined(CFLAGS_ARCH_PARAMS)
XX  CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS}
XX  .endif


As mentioned earlier,  already uses anonymous unions, so nothing
would compile unless this already worked.

I suspect the real issue is that ZFS when compiled into the kernel uses a
custom set of CFLAGS that might not be picking up the CFLAGS.gcc.

In summary, all of the CFLAGS changes look wrong / redundant.  Can you share
what build error you were actually seeing without the CFLAGS changes?


cddl/lib/libzpool/Makefile, cddl/usr.bin/ztest/Makefile and
cddl/usr.sbin/zdb/Makefile are most clearly broken.  They hard-code
CSTD=c99.  Since user mk files don't clobber previous settings like
kernel mk files do, this "works" to break the user default of gnu99,
so it should ensure that anonymous unions are uncompilable with any C
compiler.  This commit adds the -fms-extensions wart to these Makefiles
if the compiler is gcc, so anonymous unions should now be compilable
by gcc but by no other C compiler.

The only other changes to makefiles in this commit are the kernel ones,
and these clearly have no effect since they just add -fms-extensions again.

Bruce
___
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: r338128 - in head: cddl/lib/libzpool cddl/usr.bin/ztest cddl/usr.sbin/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/conf sys/modules/zfs

2018-08-21 Thread John Baldwin
On 8/21/18 4:45 AM, Matt Macy wrote:
> Author: mmacy
> Date: Tue Aug 21 03:45:09 2018
> New Revision: 338128
> URL: https://svnweb.freebsd.org/changeset/base/338128
> 
> Log:
>   Make dnode definition uniform on !x86
>   
>   gcc4 requires -fms-extensions to accept anonymous union members
> 
> Modified:
>   head/cddl/lib/libzpool/Makefile
>   head/cddl/usr.bin/ztest/Makefile
>   head/cddl/usr.sbin/zdb/Makefile
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h
>   head/sys/conf/kern.pre.mk
>   head/sys/modules/zfs/Makefile

Are you really sure you need the CFLAGS changes in all these places?  Userland
already defaults to a 'cstd' of 'gnu99' which allows anonymous unions by
default (whereas the kernel uses 'c99'), and kern.pre.mk already adds
-fms-extensions to CFLAGS earlier in the file (so that change is redundant).
kmod.mk also adds -fms-extensions already (so the ZFS change should be 
redundant).

As mentioned earlier,  already uses anonymous unions, so nothing
would compile unless this already worked.

I suspect the real issue is that ZFS when compiled into the kernel uses a
custom set of CFLAGS that might not be picking up the CFLAGS.gcc.

In summary, all of the CFLAGS changes look wrong / redundant.  Can you share
what build error you were actually seeing without the CFLAGS changes?

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r338118 - head/sys/ufs/ffs

2018-08-21 Thread Dimitry Andric
On 20 Aug 2018, at 23:19, Kirk McKusick  wrote:
> 
> Author: mckusick
> Date: Mon Aug 20 21:19:21 2018
> New Revision: 338118
> URL: https://svnweb.freebsd.org/changeset/base/338118
> 
> Log:
>  TRIM consolodation is supposed to be off by default
> 
> Modified:
>  head/sys/ufs/ffs/ffs_alloc.c
> 
> Modified: head/sys/ufs/ffs/ffs_alloc.c
> ==
> --- head/sys/ufs/ffs/ffs_alloc.c  Mon Aug 20 20:44:11 2018
> (r338117)
> +++ head/sys/ufs/ffs/ffs_alloc.c  Mon Aug 20 21:19:21 2018
> (r338118)
> @@ -484,7 +484,7 @@ static int doreallocblks = 1;
> SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, , 0,
> "enable block reallocation");
> 
> -static int dotrimcons = 1;
> +static int dotrimcons = 0;
> SYSCTL_INT(_vfs_ffs, OID_AUTO, dotrimcons, CTLFLAG_RW, , 0,
> "enable BIO_DELETE / TRIM consolodation");

Hi Kirk,

Before it settles in, it's "consolidation", not "consolodation". :)

-Dimitry



signature.asc
Description: Message signed with OpenPGP