svn commit: r311919 - head/contrib/netbsd-tests/lib/libc/sys

2017-01-10 Thread Ngie Cooper
Author: ngie
Date: Wed Jan 11 07:22:21 2017
New Revision: 311919
URL: https://svnweb.freebsd.org/changeset/base/311919

Log:
  Partially revert r311236
  
  There's no sense in trying to close a file descriptor from the negative cases
  with unlink_test; it's best to ignore these cases.
  
  The mkfifo case does make sense to keep though.
  
  MFC after:3 days

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
==
--- head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c   Wed Jan 11 07:21:59 
2017(r311918)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c   Wed Jan 11 07:22:21 
2017(r311919)
@@ -63,12 +63,7 @@ ATF_TC_BODY(unlink_basic, tc)
ATF_REQUIRE(unlink(path) == 0);
 
errno = 0;
-#ifdef __FreeBSD__
-   ATF_REQUIRE_ERRNO(ENOENT, (fd = open(path, O_RDONLY)) == -1);
-   (void)close(fd);
-#else
ATF_REQUIRE_ERRNO(ENOENT, open(path, O_RDONLY) == -1);
-#endif
}
 }
 
@@ -128,12 +123,7 @@ ATF_TC_BODY(unlink_fifo, tc)
ATF_REQUIRE(unlink(path) == 0);
 
errno = 0;
-#ifdef __FreeBSD__
-   ATF_REQUIRE_ERRNO(ENOENT, (fd = open(path, O_RDONLY)) == -1);
-   (void)close(fd);
-#else
ATF_REQUIRE_ERRNO(ENOENT, open(path, O_RDONLY) == -1);
-#endif
 }
 
 ATF_TC_CLEANUP(unlink_fifo, tc)
___
svn-src-head@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"


svn commit: r311918 - head/usr.sbin/syslogd

2017-01-10 Thread Hiroki Sato
Author: hrs
Date: Wed Jan 11 07:21:59 2017
New Revision: 311918
URL: https://svnweb.freebsd.org/changeset/base/311918

Log:
  Add more #ifdef INET and INET6.

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

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Wed Jan 11 07:17:03 2017
(r311917)
+++ head/usr.sbin/syslogd/syslogd.c Wed Jan 11 07:21:59 2017
(r311918)
@@ -89,9 +89,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(INET) || defined(INET6) 
 #include 
-#include 
 #include 
+#endif
+#include 
 
 #include 
 #include 
@@ -127,8 +129,11 @@ static const char include_ext[] = ".conf
 #defineMAXUNAMES   20  /* maximum number of user names */
 
 #definesstosa(ss)  ((struct sockaddr *)(ss))
+#ifdef INET
 #definesstosin(ss) ((struct sockaddr_in *)(void *)(ss))
 #definesatosin(sa) ((struct sockaddr_in *)(void *)(sa))
+#endif
+#ifdef INET6
 #definesstosin6(ss)((struct sockaddr_in6 *)(void *)(ss))
 #definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa))
 #defines6_addr32   __u6_addr.__u6_addr32
@@ -137,6 +142,7 @@ static const char include_ext[] = ".conf
(((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \
(((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \
(((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 )
+#endif
 /*
  * List of peers and sockets for binding.
  */
@@ -1305,10 +1311,12 @@ fprintlog(struct filed *f, int flags, co
case F_FORW:
dprintf(" %s", f->fu_forw_hname);
switch (f->fu_forw_addr->ai_addr->sa_family) {
+#ifdef INET
case AF_INET:
dprintf(":%d\n",
ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port));
break;
+#endif
 #ifdef INET6
case AF_INET6:
dprintf(":%d\n",
@@ -1929,7 +1937,20 @@ init(int signo)
break;
 
case F_FORW:
-   port = 
ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
+   switch (f->fu_forw_addr->ai_addr->sa_family) {
+#ifdef INET
+   case AF_INET:
+   port = 
ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
+   break;
+#endif
+#ifdef INET6
+   case AF_INET6:
+   port = 
ntohs(satosin6(f->fu_forw_addr->ai_addr)->sin6_port);
+   break;
+#endif
+   default:
+   port = 0;
+   }
if (port != 514) {
printf("%s:%d",
f->fu_forw_hname, port);
@@ -2410,6 +2431,7 @@ timedout(int sig __unused)
 static int
 allowaddr(char *s)
 {
+#if defined(INET) || defined(INET6)
char *cp1, *cp2;
struct allowedpeer *ap;
struct servent *se;
@@ -2571,6 +2593,7 @@ allowaddr(char *s)
}
printf("port = %d\n", ap->port);
}
+#endif
return (0);
 }
 
___
svn-src-head@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"


svn commit: r311917 - head/contrib/netbsd-tests/lib/libc/gen

2017-01-10 Thread Ngie Cooper
Author: ngie
Date: Wed Jan 11 07:17:03 2017
New Revision: 311917
URL: https://svnweb.freebsd.org/changeset/base/311917

Log:
  Fix up r311227
  
  Check for creat returning a value != -1, not a non-zero value
  
  MFC after:3 days
  Pointyhat to: ngie
  Reported by:  Coverity
  CID:  1368366

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_dir.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/t_dir.c  Wed Jan 11 06:01:23 
2017(r311916)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_dir.c  Wed Jan 11 07:17:03 
2017(r311917)
@@ -59,12 +59,12 @@ ATF_TC_BODY(seekdir_basic, tc)
long here;
 
 #ifdef __FreeBSD__
-#defineCREAT(x, m) do {\
-   int _creat_fd;  \
-   ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))),  \
-   "creat(%s, %x) failed: %s", (x), (m),   \
-   strerror(errno));   \
-   (void)close(_creat_fd); \
+#defineCREAT(x, m) do {
\
+   int _creat_fd;  \
+   ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1,\
+   "creat(%s, %x) failed: %s", (x), (m),   \
+   strerror(errno));   \
+   (void)close(_creat_fd); \
} while(0);
 
ATF_REQUIRE_MSG(mkdir("t", 0755) == 0,
___
svn-src-head@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"


svn commit: r311914 - head/crypto/openssh

2017-01-10 Thread Xin LI
Author: delphij
Date: Wed Jan 11 05:49:39 2017
New Revision: 311914
URL: https://svnweb.freebsd.org/changeset/base/311914

Log:
  MFV r311913:
  
  Fix multiple OpenSSH vulnerabilities.
  
  Submitted by: des
  Approved by:  so

Modified:
  head/crypto/openssh/serverloop.c
  head/crypto/openssh/ssh-agent.1
  head/crypto/openssh/ssh-agent.c
  head/crypto/openssh/ssh_config
  head/crypto/openssh/ssh_config.5
  head/crypto/openssh/sshd_config
  head/crypto/openssh/sshd_config.5
  head/crypto/openssh/version.h
Directory Properties:
  head/crypto/openssh/   (props changed)

Modified: head/crypto/openssh/serverloop.c
==
--- head/crypto/openssh/serverloop.cWed Jan 11 05:42:06 2017
(r311913)
+++ head/crypto/openssh/serverloop.cWed Jan 11 05:49:39 2017
(r311914)
@@ -995,7 +995,7 @@ server_request_direct_streamlocal(void)
 
/* XXX fine grained permissions */
if ((options.allow_streamlocal_forwarding & FORWARD_LOCAL) != 0 &&
-   !no_port_forwarding_flag) {
+   !no_port_forwarding_flag && use_privsep) {
c = channel_connect_to_path(target,
"direct-streamlo...@openssh.com", "direct-streamlocal");
} else {
@@ -1279,7 +1279,7 @@ server_input_global_request(int type, u_
 
/* check permissions */
if ((options.allow_streamlocal_forwarding & FORWARD_REMOTE) == 0
-   || no_port_forwarding_flag) {
+   || no_port_forwarding_flag || !use_privsep) {
success = 0;
packet_send_debug("Server has disabled port 
forwarding.");
} else {

Modified: head/crypto/openssh/ssh-agent.1
==
--- head/crypto/openssh/ssh-agent.1 Wed Jan 11 05:42:06 2017
(r311913)
+++ head/crypto/openssh/ssh-agent.1 Wed Jan 11 05:49:39 2017
(r311914)
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ssh-agent.1,v 1.62 2015/11/15 23:54:15 jmc Exp $
+.\" $OpenBSD: ssh-agent.1,v 1.63 2016/11/30 03:07:37 djm Exp $
 .\" $FreeBSD$
 .\"
 .\" Author: Tatu Ylonen 
@@ -48,6 +48,7 @@
 .Op Fl a Ar bind_address
 .Op Fl E Ar fingerprint_hash
 .Op Fl t Ar life
+.Op Fl P Ar pkcs11_whitelist
 .Op Ar command Op Ar arg ...
 .Nm ssh-agent
 .Op Fl c | s
@@ -122,6 +123,18 @@ The default is
 Kill the current agent (given by the
 .Ev SSH_AGENT_PID
 environment variable).
+.It Fl P
+Specify a pattern-list of acceptable paths for PKCS#11 shared libraries
+that may be added using the
+.Fl s
+option to
+.Xr ssh-add 1 .
+The default is to allow loading PKCS#11 libraries from
+.Dq /usr/lib/*,/usr/local/lib/* .
+PKCS#11 libraries that do not match the whitelist will be refused.
+See PATTERNS in
+.Xr ssh_config 5
+for a description of pattern-list syntax.
 .It Fl s
 Generate Bourne shell commands on
 .Dv stdout .

Modified: head/crypto/openssh/ssh-agent.c
==
--- head/crypto/openssh/ssh-agent.c Wed Jan 11 05:42:06 2017
(r311913)
+++ head/crypto/openssh/ssh-agent.c Wed Jan 11 05:49:39 2017
(r311914)
@@ -84,11 +84,16 @@ __RCSID("$FreeBSD$");
 #include "misc.h"
 #include "digest.h"
 #include "ssherr.h"
+#include "match.h"
 
 #ifdef ENABLE_PKCS11
 #include "ssh-pkcs11.h"
 #endif
 
+#ifndef DEFAULT_PKCS11_WHITELIST
+# define DEFAULT_PKCS11_WHITELIST "/usr/lib/*,/usr/local/lib/*"
+#endif
+
 #if defined(HAVE_SYS_PRCTL_H)
 #include  /* For prctl() and PR_SET_DUMPABLE */
 #endif
@@ -140,6 +145,9 @@ pid_t cleanup_pid = 0;
 char socket_name[PATH_MAX];
 char socket_dir[PATH_MAX];
 
+/* PKCS#11 path whitelist */
+static char *pkcs11_whitelist;
+
 /* locking */
 #define LOCK_SIZE  32
 #define LOCK_SALT_SIZE 16
@@ -761,7 +769,7 @@ no_identities(SocketEntry *e, u_int type
 static void
 process_add_smartcard_key(SocketEntry *e)
 {
-   char *provider = NULL, *pin;
+   char *provider = NULL, *pin, canonical_provider[PATH_MAX];
int r, i, version, count = 0, success = 0, confirm = 0;
u_int seconds;
time_t death = 0;
@@ -793,10 +801,21 @@ process_add_smartcard_key(SocketEntry *e
goto send;
}
}
+   if (realpath(provider, canonical_provider) == NULL) {
+   verbose("failed PKCS#11 add of \"%.100s\": realpath: %s",
+   provider, strerror(errno));
+   goto send;
+   }
+   if (match_pattern_list(canonical_provider, pkcs11_whitelist, 0) != 1) {
+   verbose("refusing PKCS#11 add of \"%.100s\": "
+   "provider not whitelisted", canonical_provider);
+   goto send;
+   }
+   debug("%s: add %.100s", __func__, canonical_provider);
if (lifetime && !death)
death = monotime() + lifetime;
 
-   count = pkcs11_add_provider(provider, pin, 

svn commit: r311912 - head/sys/powerpc/include

2017-01-10 Thread Justin Hibbits
Author: jhibbits
Date: Wed Jan 11 02:21:34 2017
New Revision: 311912
URL: https://svnweb.freebsd.org/changeset/base/311912

Log:
  Force all TOC references in asm to include '@toc'
  
  This reportedly fixes one problem with booting a clang kernel.
  
  PR:   kern/215819
  Submitted by: Mark Millard 
  MFC after:2 weeks

Modified:
  head/sys/powerpc/include/asm.h

Modified: head/sys/powerpc/include/asm.h
==
--- head/sys/powerpc/include/asm.h  Wed Jan 11 01:53:54 2017
(r311911)
+++ head/sys/powerpc/include/asm.h  Wed Jan 11 02:21:34 2017
(r311912)
@@ -89,10 +89,11 @@
name:
 
 #ifdef __powerpc64__
-#define TOC_REF(name)  __CONCAT(.L,name)
+#define TOC_NAME_FOR_REF(name) __CONCAT(.L,name)
+#defineTOC_REF(name)   TOC_NAME_FOR_REF(name)@toc
 #define TOC_ENTRY(name) \
.section ".toc","aw"; \
-   TOC_REF(name): \
+   TOC_NAME_FOR_REF(name): \
 .tc name[TC],name
 #endif
 
___
svn-src-head@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"


svn commit: r311911 - in head/sys: conf dev/sdhci modules modules/sdhci_acpi

2017-01-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jan 11 01:53:54 2017
New Revision: 311911
URL: https://svnweb.freebsd.org/changeset/base/311911

Log:
  [sdhci] Add ACPI platform support for SDHCI driver
  
  - Create ACPI version of SDHCI attach/detach/accessors logic. Some
  platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices
  via ACPI, not PCI
  - Add sdchi_acpi kernel module
  
  Reviewed by:  ian, imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9112

Added:
  head/sys/dev/sdhci/sdhci_acpi.c   (contents, props changed)
  head/sys/modules/sdhci_acpi/
  head/sys/modules/sdhci_acpi/Makefile   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Jan 11 01:18:06 2017(r311910)
+++ head/sys/conf/files Wed Jan 11 01:53:54 2017(r311911)
@@ -2826,6 +2826,7 @@ dev/scc/scc_dev_z8530.c   optional scc
 dev/sdhci/sdhci.c  optional sdhci
 dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio
 dev/sdhci/sdhci_if.m   optional sdhci
+dev/sdhci/sdhci_acpi.c optional sdhci acpi
 dev/sdhci/sdhci_pci.c  optional sdhci pci
 dev/sf/if_sf.c optional sf pci
 dev/sge/if_sge.c   optional sge pci

Added: head/sys/dev/sdhci/sdhci_acpi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/sdhci/sdhci_acpi.c Wed Jan 11 01:53:54 2017
(r311911)
@@ -0,0 +1,370 @@
+/*-
+ * Copyright (c) 2017 Oleksandr Tymoshenko 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "sdhci.h"
+#include "mmcbr_if.h"
+#include "sdhci_if.h"
+
+static const struct sdhci_acpi_device {
+   const char* hid;
+   int uid;
+   const char  *desc;
+   u_int   quirks;
+} sdhci_acpi_devices[] = {
+   { "80860F14",   1,  "Intel Bay Trail eMMC 4.5 Controller",
+   SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
+   SDHCI_QUIRK_INTEL_POWER_UP_RESET },
+   { "80860F16",   0,  "Intel Bay Trail SD Host Controller",
+   0 },
+   { NULL, 0, NULL, 0}
+};
+
+static char *sdhci_ids[] = {
+   "80860F14",
+   "80860F16",
+   NULL
+};
+
+struct sdhci_acpi_softc {
+   u_int   quirks; /* Chip specific quirks */
+   struct resource *irq_res;   /* IRQ resource */
+   void*intrhand;  /* Interrupt handle */
+
+   struct sdhci_slot slot;
+   struct resource *mem_res;   /* Memory resource */
+};
+
+static void sdhci_acpi_intr(void *arg);
+static int sdhci_acpi_detach(device_t dev);
+
+static uint8_t
+sdhci_acpi_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off)
+{
+   struct sdhci_acpi_softc *sc = device_get_softc(dev);
+
+   bus_barrier(sc->mem_res, 0, 0xFF,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+   return bus_read_1(sc->mem_res, off);
+}
+
+static void
+sdhci_acpi_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, 
uint8_t val)
+{
+   struct sdhci_acpi_softc *sc = device_get_softc(dev);
+
+   bus_barrier(sc->mem_res, 0, 0xFF,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+   bus_write_1(sc->mem_res, off, val);
+}
+
+static 

svn commit: r311910 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-01-10 Thread Mark Johnston
Author: markj
Date: Wed Jan 11 01:18:06 2017
New Revision: 311910
URL: https://svnweb.freebsd.org/changeset/base/311910

Log:
  Have DTrace handle faults when dereferencing a lock object pointer.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Jan 
11 01:15:55 2017(r311909)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Jan 
11 01:18:06 2017(r311910)
@@ -4335,7 +4335,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr((uintptr_t)[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, );
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
 
case DIF_SUBR_MUTEX_OWNER:
@@ -4345,7 +4347,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr((uintptr_t)[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
LOCK_CLASS(l.li)->lc_owner(l.li, );
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
regs[rd] = (uintptr_t)lowner;
break;
 
@@ -4356,7 +4360,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr((uintptr_t)[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = (LOCK_CLASS(l.li)->lc_flags & LC_SLEEPLOCK) != 0;
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
 
case DIF_SUBR_MUTEX_TYPE_SPIN:
@@ -4366,7 +4372,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr((uintptr_t)[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = (LOCK_CLASS(l.li)->lc_flags & LC_SPINLOCK) != 0;
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
 
case DIF_SUBR_RW_READ_HELD: 
@@ -4377,8 +4385,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr((uintptr_t)[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, ) &&
lowner == NULL;
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
 
case DIF_SUBR_RW_WRITE_HELD:
@@ -4389,8 +4399,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr(tupregs[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, ) &&
lowner != NULL;
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
 
case DIF_SUBR_RW_ISWRITER:
@@ -4401,7 +4413,9 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr(tupregs[0].dttk_value);
+   DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
LOCK_CLASS(l.li)->lc_owner(l.li, );
+   DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
regs[rd] = (lowner == curthread);
break;
 #endif /* illumos */
___
svn-src-head@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"


svn commit: r311909 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-01-10 Thread Mark Johnston
Author: markj
Date: Wed Jan 11 01:15:55 2017
New Revision: 311909
URL: https://svnweb.freebsd.org/changeset/base/311909

Log:
  Ignore LC_SLEEPABLE when testing whether a mutex is adaptive.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Jan 
11 00:50:19 2017(r311908)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Jan 
11 01:15:55 2017(r311909)
@@ -4356,9 +4356,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr((uintptr_t)[0].dttk_value);
-   /* XXX - should be only LC_SLEEPABLE? */
-   regs[rd] = (LOCK_CLASS(l.li)->lc_flags &
-   (LC_SLEEPLOCK | LC_SLEEPABLE)) != 0;
+   regs[rd] = (LOCK_CLASS(l.li)->lc_flags & LC_SLEEPLOCK) != 0;
break;
 
case DIF_SUBR_MUTEX_TYPE_SPIN:
___
svn-src-head@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"


svn commit: r311907 - head/etc/rc.d

2017-01-10 Thread Ian Lepore
Author: ian
Date: Wed Jan 11 00:14:47 2017
New Revision: 311907
URL: https://svnweb.freebsd.org/changeset/base/311907

Log:
  Follow r311103: add "pool" to the keywords that rc.d/ntpdate examines to
  find a server address in ntp.conf.
  
  Submitted by: Ronald Klop 
  Pointy hat to:ian

Modified:
  head/etc/rc.d/ntpdate

Modified: head/etc/rc.d/ntpdate
==
--- head/etc/rc.d/ntpdate   Wed Jan 11 00:02:51 2017(r311906)
+++ head/etc/rc.d/ntpdate   Wed Jan 11 00:14:47 2017(r311907)
@@ -20,7 +20,7 @@ ntpdate_start()
if [ -z "$ntpdate_hosts" -a -f "$ntpdate_config" ]; then
ntpdate_hosts=`awk '
/^server[ \t]*127.127/  {next}
-   /^(server|peer)/{
+   /^(server|peer|pool)/   {
if ($2 ~/^-/)   {print $3}
else{print $2}}
' < "$ntpdate_config"`
___
svn-src-head@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"


svn commit: r311906 - in head/sys/contrib/dev/acpica: components/namespace components/tables include

2017-01-10 Thread Conrad E. Meyer
Author: cem
Date: Wed Jan 11 00:02:51 2017
New Revision: 311906
URL: https://svnweb.freebsd.org/changeset/base/311906

Log:
  Revert r311843, r311667
  
  As jkim@ points out, it isn't needed.

Modified:
  head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
  head/sys/contrib/dev/acpica/components/tables/tbxface.c
  head/sys/contrib/dev/acpica/include/acpixf.h

Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
==
--- head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c Tue Jan 10 
22:13:44 2017(r311905)
+++ head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c Wed Jan 11 
00:02:51 2017(r311906)
@@ -1022,25 +1022,23 @@ ACPI_EXPORT_SYMBOL (AcpiDetachData)
 
 
/***
  *
- * FUNCTION:AcpiGetDataFull
+ * FUNCTION:AcpiGetData
  *
  * PARAMETERS:  ObjHandle   - Namespace node
- *  Handle  - Handler used in call to attach_data
+ *  Handler - Handler used in call to AttachData
  *  Data- Where the data is returned
- *  Callback- function to execute before returning
  *
  * RETURN:  Status
  *
- * DESCRIPTION: Retrieve data that was previously attached to a namespace node
- *  and execute a callback before returning.
+ * DESCRIPTION: Retrieve data that was previously attached to a namespace node.
  *
  
**/
+
 ACPI_STATUS
-AcpiGetDataFull (
+AcpiGetData (
 ACPI_HANDLE ObjHandle,
 ACPI_OBJECT_HANDLER Handler,
-void**Data,
-void (*Callback)(void *))
+void**Data)
 {
 ACPI_NAMESPACE_NODE *Node;
 ACPI_STATUS Status;
@@ -1071,34 +1069,10 @@ AcpiGetDataFull (
 }
 
 Status = AcpiNsGetAttachedData (Node, Handler, Data);
-if (ACPI_SUCCESS(Status) && Callback) {
-   Callback(*Data);
-}
+
 UnlockAndExit:
 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
 return (Status);
 }
-ACPI_EXPORT_SYMBOL (AcpiGetDataFull)
 
-/***
- *
- * FUNCTION:AcpiGetData
- *
- * PARAMETERS:  ObjHandle   - Namespace node
- *  Handler - Handler used in call to AttachData
- *  Data- Where the data is returned
- *
- * RETURN:  Status
- *
- * DESCRIPTION: Retrieve data that was previously attached to a namespace node.
- *
- 
**/
-ACPI_STATUS
-AcpiGetData (
-ACPI_HANDLE ObjHandle,
-ACPI_OBJECT_HANDLER Handler,
-void**Data)
-{
-   return (AcpiGetDataFull(ObjHandle, Handler, Data, NULL));
-}
 ACPI_EXPORT_SYMBOL (AcpiGetData)

Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c
==
--- head/sys/contrib/dev/acpica/components/tables/tbxface.c Tue Jan 10 
22:13:44 2017(r311905)
+++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Wed Jan 11 
00:02:51 2017(r311906)
@@ -314,12 +314,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader)
 
 
/***
  *
- * FUNCTION:AcpiGetTableWithSize
+ * FUNCTION:AcpiGetTable
  *
  * PARAMETERS:  Signature   - ACPI signature of needed table
  *  Instance- Which instance (for SSDTs)
  *  OutTable- Where the pointer to the table is 
returned
- *  TblSize - Size of the table
  *
  * RETURN:  Status and pointer to the requested table
  *
@@ -334,11 +333,10 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader)
  
**/
 
 ACPI_STATUS
-AcpiGetTableWithSize (
+AcpiGetTable (
 char*Signature,
 UINT32  Instance,
-ACPI_TABLE_HEADER   **OutTable,
-ACPI_SIZE  *TblSize)
+ACPI_TABLE_HEADER   **OutTable)
 {
 UINT32  i;
 UINT32  j;
@@ -386,7 +384,7 @@ AcpiGetTableWithSize (
 return (Status);
 }
 
-ACPI_EXPORT_SYMBOL (AcpiGetTableWithSize)
+ACPI_EXPORT_SYMBOL (AcpiGetTable)
 
 
 
/***
@@ -436,36 +434,8 @@ AcpiPutTable (
 (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
 return_VOID;
 }
-ACPI_EXPORT_SYMBOL (AcpiPutTable)
-
-
-/***
- *
- * FUNCTION:AcpiGetTable
- *
- * PARAMETERS:  Signature   - ACPI signature of needed table

Re: svn commit: r311887 - head/sys/net80211

2017-01-10 Thread Adrian Chadd
Yeah, give me a little while. I'm knee deep in water.


-a


On 10 January 2017 at 15:17, Ngie Cooper  wrote:
> On Tue, Jan 10, 2017 at 11:28 AM, Sergey Kandaurov  
> wrote:
>> Author: pluknet
>> Date: Tue Jan 10 19:28:40 2017
>> New Revision: 311887
>> URL: https://svnweb.freebsd.org/changeset/base/311887
>>
>> Log:
>>   Fix build without IEEE80211_DEBUG.
>
> This may fix clang builds, but I anticipate gcc failures now because
> the parameters are unused.
>
> I think stub functions/macros should be added to workaround this issue.
>
> Thanks,
> -Ngie
>
___
svn-src-head@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"


Re: svn commit: r311887 - head/sys/net80211

2017-01-10 Thread Ngie Cooper
On Tue, Jan 10, 2017 at 11:28 AM, Sergey Kandaurov  wrote:
> Author: pluknet
> Date: Tue Jan 10 19:28:40 2017
> New Revision: 311887
> URL: https://svnweb.freebsd.org/changeset/base/311887
>
> Log:
>   Fix build without IEEE80211_DEBUG.

This may fix clang builds, but I anticipate gcc failures now because
the parameters are unused.

I think stub functions/macros should be added to workaround this issue.

Thanks,
-Ngie
___
svn-src-head@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"


Re: svn commit: r311887 - head/sys/net80211

2017-01-10 Thread Adrian Chadd
Thanks!

(I should make a debug vap printf that doesn't include the MAC/node
requirements so this stuff is easier..)


-adrian


On 10 January 2017 at 11:28, Sergey Kandaurov  wrote:
> Author: pluknet
> Date: Tue Jan 10 19:28:40 2017
> New Revision: 311887
> URL: https://svnweb.freebsd.org/changeset/base/311887
>
> Log:
>   Fix build without IEEE80211_DEBUG.
>
>   Reported by:  many
>
> Modified:
>   head/sys/net80211/ieee80211_vht.c
>
> Modified: head/sys/net80211/ieee80211_vht.c
> ==
> --- head/sys/net80211/ieee80211_vht.c   Tue Jan 10 19:26:55 2017
> (r311886)
> +++ head/sys/net80211/ieee80211_vht.c   Tue Jan 10 19:28:40 2017
> (r311887)
> @@ -91,11 +91,12 @@ vht_recv_action_placeholder(struct ieee8
>  const uint8_t *frm, const uint8_t *efrm)
>  {
>
> +#ifdef IEEE80211_DEBUG
> ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
> __func__,
> wh->i_fc[0],
> wh->i_fc[1]);
> -
> +#endif
> return (0);
>  }
>
> @@ -104,10 +105,12 @@ vht_send_action_placeholder(struct ieee8
>  int category, int action, void *arg0)
>  {
>
> +#ifdef IEEE80211_DEBUG
> ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
> __func__,
> category,
> action);
> +#endif
> return (EINVAL);
>  }
>
>
___
svn-src-head@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"


Re: svn commit: r311860 - head/sys/net80211

2017-01-10 Thread Adrian Chadd
Yeah, oops! Thanks for getting it fixed!


-adrian


On 10 January 2017 at 09:23, Shawn Webb  wrote:
> On Tue, Jan 10, 2017 at 07:21:07AM +, Adrian Chadd wrote:
>> Author: adrian
>> Date: Tue Jan 10 07:21:07 2017
>> New Revision: 311860
>> URL: https://svnweb.freebsd.org/changeset/base/311860
>>
>> Log:
>>   [net80211] add VHT action frame placeholders for when it's time to 
>> implement.
>>
>> Modified:
>>   head/sys/net80211/ieee80211_vht.c
>>
>> Modified: head/sys/net80211/ieee80211_vht.c
>> ==
>> --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 05:37:53 2017
>> (r311859)
>> +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 07:21:07 2017
>> (r311860)
>> @@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$");
>>   * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details.
>>   */
>>
>> +static int
>> +vht_recv_action_placeholder(struct ieee80211_node *ni,
>> +const struct ieee80211_frame *wh,
>> +const uint8_t *frm, const uint8_t *efrm)
>> +{
>> +
>> + ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
>> + __func__,
>> + wh->i_fc[0],
>> + wh->i_fc[1]);
>> +
>> + return (0);
>> +}
>> +
>> +static int
>> +vht_send_action_placeholder(struct ieee80211_node *ni,
>> +int category, int action, void *arg0)
>> +{
>> +
>> + ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
>> + __func__,
>> + category,
>> + action);
>> + return (EINVAL);
>> +}
>> +
>
> This broke the build for kernel configurations that don't have the
> IEEE80211_DEBUG option set. ieee80211_note is only a valid function when
> IEEE80211_DEBUG is defined.
>
> Thanks,
>
> --
> Shawn Webb
> Cofounder and Security Engineer
> HardenedBSD
>
> GPG Key ID:  0x6A84658F52456EEE
> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE
___
svn-src-head@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"


svn commit: r311904 - head/lib/libarchive/tests

2017-01-10 Thread Martin Matuska
Author: mm
Date: Tue Jan 10 22:01:37 2017
New Revision: 311904
URL: https://svnweb.freebsd.org/changeset/base/311904

Log:
  Build libarchive tests missing in r311899
  
  MFC after:1 week
  X-MFC with:   r311899

Modified:
  head/lib/libarchive/tests/Makefile

Modified: head/lib/libarchive/tests/Makefile
==
--- head/lib/libarchive/tests/Makefile  Tue Jan 10 21:59:35 2017
(r311903)
+++ head/lib/libarchive/tests/Makefile  Tue Jan 10 22:01:37 2017
(r311904)
@@ -196,6 +196,7 @@ TESTS_SRCS= \
test_read_format_zip_winzip_aes_large.c \
test_read_format_zip_zip64.c\
test_read_large.c   \
+   test_read_pax_schily_xattr.c\
test_read_pax_truncated.c   \
test_read_position.c\
test_read_set_format.c  \
@@ -549,6 +550,7 @@ ${PACKAGE}FILES+=   test_read_large_splitt
 ${PACKAGE}FILES+=  test_read_large_splitted_rar_ac.uu
 ${PACKAGE}FILES+=  test_read_large_splitted_rar_ad.uu
 ${PACKAGE}FILES+=  test_read_large_splitted_rar_ae.uu
+${PACKAGE}FILES+=  test_read_pax_schily_xattr.tar.uu
 ${PACKAGE}FILES+=  test_read_splitted_rar_aa.uu
 ${PACKAGE}FILES+=  test_read_splitted_rar_ab.uu
 ${PACKAGE}FILES+=  test_read_splitted_rar_ac.uu
___
svn-src-head@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"


Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include

2017-01-10 Thread Jung-uk Kim

On 01/09/2017 13:01, Jung-uk Kim wrote:

On 01/09/2017 12:08, John Baldwin wrote:

On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote:

Author: cem
Date: Sun Jan  8 06:26:33 2017
New Revision: 311667
URL: https://svnweb.freebsd.org/changeset/base/311667

Log:
  Add some additional ACPI methods for DRM

  Add AcpiGetDataFull and AcpiGetTableWithSize.

  Submitted by:Matt Macy


Have these been submitted upstream?  The Intel folks are generally quite
responsive on freebsd-a...@freebsd.org and this codebase is actively
maintained externally.


Please submit upstream first.

https://github.com/acpica/acpica


Since nobody responded, I just googled about it.  It seems these two 
functions, AcpiGetDataFull() (aka. acpi_get_data_full() in Linux) and 
AcpiGetTableWithSize() (aka. acpi_get_table_with_size() in Linux), were 
only added in linux-pm tree and we only need them for "Graphics" repository.


- AcpiGetDataFull()

This function is only called by acpi_get_device_data(), which is, in 
turn, only called by acpi_bus_get_device() with *NULL* callback. 
Therefore, I don't see any reason to pollute contrib code for this.


- AcpiGetTableWithSize()

This API is now deprecated by the upstream:

http://marc.info/?l=linux-acpi=148169906815835
http://marc.info/?l=linux-acpi=148169907615836
http://marc.info/?l=linux-acpi=148169908115837
http://marc.info/?l=linux-acpi=148169908615838
http://marc.info/?l=linux-acpi=148169909215840

The code changes were committed to both ACPICA:

https://github.com/acpica/acpica/commit/cac67909

and committed to linux-pm tree:

https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit?id=6b11d1d677132816252004426ef220ccd3c92d2f

This means it will be removed from future Linux kernel.  Therefore, we 
should NOT implement the deprecated API.


Please back out r311667 and r311843 and let me know if you need any help 
in resolving this matter.


Jung-uk Kim
___
svn-src-head@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"


svn commit: r311903 - in head/contrib/libarchive/libarchive: . test

2017-01-10 Thread Martin Matuska
Author: mm
Date: Tue Jan 10 21:59:35 2017
New Revision: 311903
URL: https://svnweb.freebsd.org/changeset/base/311903

Log:
  MFV r311899:
  
  Sync libarchive with vendor.
  
  Vendor bugfixes:
  #691: Support for SCHILY.xattr extended attributes
  #854: Spelling fixes
  
  Multiple fixes in ACL code:
- prefer acl_set_fd_np() to acl_set_fd()
- if acl_set_fd_np() fails, do no fallback to acl_set_file()
- do not warn if trying to write ACLs to a filesystem without ACL support
- fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs
  
  MFC after:1 week
  X-MFC with:   r310866

Added:
  head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c
 - copied unchanged from r311899, 
vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c
  head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu
 - copied unchanged from r311899, 
vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu
Modified:
  head/contrib/libarchive/libarchive/archive_acl.c
  head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
  head/contrib/libarchive/libarchive/archive_read_disk_posix.c
  head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c
  head/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c
  head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c
  head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c
  head/contrib/libarchive/libarchive/archive_read_support_format_lha.c
  head/contrib/libarchive/libarchive/archive_read_support_format_rar.c
  head/contrib/libarchive/libarchive/archive_read_support_format_tar.c
  head/contrib/libarchive/libarchive/archive_read_support_format_warc.c
  head/contrib/libarchive/libarchive/archive_read_support_format_zip.c
  head/contrib/libarchive/libarchive/archive_string.c
  head/contrib/libarchive/libarchive/archive_string.h
  head/contrib/libarchive/libarchive/archive_string_composition.h
  head/contrib/libarchive/libarchive/archive_write.c
  head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c
  head/contrib/libarchive/libarchive/archive_write_disk_acl.c
  head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
  head/contrib/libarchive/libarchive/archive_write_set_format_pax.c
  head/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_zip.c
  head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c
  head/contrib/libarchive/libarchive/test/test_compat_uudecode.c
  head/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c
  
head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c
  head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c
  
head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c
  head/contrib/libarchive/libarchive/test/test_sparse_basic.c
  head/contrib/libarchive/libarchive/xxhash.c
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/libarchive/archive_acl.c
==
--- head/contrib/libarchive/libarchive/archive_acl.cTue Jan 10 21:52:48 
2017(r311902)
+++ head/contrib/libarchive/libarchive/archive_acl.cTue Jan 10 21:59:35 
2017(r311903)
@@ -786,7 +786,8 @@ append_entry_w(wchar_t **wp, const wchar
} else if (tag == ARCHIVE_ENTRY_ACL_USER
|| tag == ARCHIVE_ENTRY_ACL_GROUP) {
append_id_w(wp, id);
-   id = -1;
+   if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0)
+   id = -1;
}
/* Solaris style has no second colon after other and mask */
if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0)
@@ -1042,7 +1043,8 @@ append_entry(char **p, const char *prefi
} else if (tag == ARCHIVE_ENTRY_ACL_USER
|| tag == ARCHIVE_ENTRY_ACL_GROUP) {
append_id(p, id);
-   id = -1;
+   if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0)
+   id = -1;
}
/* Solaris style has no second colon after other and mask */
if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0)
@@ -1328,6 +1330,7 @@ archive_acl_from_text_w(struct archive_a
tag == ARCHIVE_ENTRY_ACL_GROUP) {
n = 1;
name = field[1];
+   isint_w(name.start, name.end, );
} else
n = 0;
 
@@ -1799,6 +1802,7 @@ archive_acl_from_text_l(struct archive_a
tag == ARCHIVE_ENTRY_ACL_GROUP) {

svn commit: r311902 - in head/sys: amd64/amd64 i386/i386

2017-01-10 Thread Mark Johnston
Author: markj
Date: Tue Jan 10 21:52:48 2017
New Revision: 311902
URL: https://svnweb.freebsd.org/changeset/base/311902

Log:
  Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.
  
  We would previously invalidate such entries individually, resulting in more
  IPIs than necessary.
  
  Reviewed by:  alc, kib
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D9094

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Jan 10 21:41:28 2017(r311901)
+++ head/sys/amd64/amd64/pmap.c Tue Jan 10 21:52:48 2017(r311902)
@@ -6010,7 +6010,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva
pdp_entry_t *pdpe;
pd_entry_t oldpde, *pde;
pt_entry_t *pte, PG_A, PG_G, PG_M, PG_RW, PG_V;
-   vm_offset_t va_next;
+   vm_offset_t va, va_next;
vm_page_t m;
boolean_t anychanged;
 
@@ -6090,11 +6090,11 @@ pmap_advise(pmap_t pmap, vm_offset_t sva
}
if (va_next > eva)
va_next = eva;
+   va = va_next;
for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++,
sva += PAGE_SIZE) {
-   if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED |
-   PG_V))
-   continue;
+   if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | PG_V))
+   goto maybe_invlrng;
else if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) {
if (advice == MADV_DONTNEED) {
/*
@@ -6109,12 +6109,22 @@ pmap_advise(pmap_t pmap, vm_offset_t sva
} else if ((*pte & PG_A) != 0)
atomic_clear_long(pte, PG_A);
else
-   continue;
-   if ((*pte & PG_G) != 0)
-   pmap_invalidate_page(pmap, sva);
-   else
+   goto maybe_invlrng;
+
+   if ((*pte & PG_G) != 0) {
+   if (va == va_next)
+   va = sva;
+   } else
anychanged = TRUE;
+   continue;
+maybe_invlrng:
+   if (va != va_next) {
+   pmap_invalidate_range(pmap, va, sva);
+   va = va_next;
+   }
}
+   if (va != va_next)
+   pmap_invalidate_range(pmap, va, sva);
}
if (anychanged)
pmap_invalidate_all(pmap);

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Tue Jan 10 21:41:28 2017(r311901)
+++ head/sys/i386/i386/pmap.c   Tue Jan 10 21:52:48 2017(r311902)
@@ -4905,7 +4905,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva
 {
pd_entry_t oldpde, *pde;
pt_entry_t *pte;
-   vm_offset_t pdnxt;
+   vm_offset_t va, pdnxt;
vm_page_t m;
boolean_t anychanged, pv_lists_locked;
 
@@ -4966,11 +4966,11 @@ resume:
}
if (pdnxt > eva)
pdnxt = eva;
+   va = pdnxt;
for (pte = pmap_pte_quick(pmap, sva); sva != pdnxt; pte++,
sva += PAGE_SIZE) {
-   if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED |
-   PG_V))
-   continue;
+   if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | PG_V))
+   goto maybe_invlrng;
else if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) {
if (advice == MADV_DONTNEED) {
/*
@@ -4985,12 +4985,21 @@ resume:
} else if ((*pte & PG_A) != 0)
atomic_clear_int((u_int *)pte, PG_A);
else
-   continue;
-   if ((*pte & PG_G) != 0)
-   pmap_invalidate_page(pmap, sva);
-   else
+   goto maybe_invlrng;
+   if ((*pte & PG_G) != 0) {
+   if (va == pdnxt)
+   va = sva;
+   } else
anychanged = TRUE;
+   continue;
+maybe_invlrng:
+   if (va != pdnxt) {
+   pmap_invalidate_range(pmap, va, sva);
+ 

svn commit: r311901 - head/sys/kern

2017-01-10 Thread Mark Johnston
Author: markj
Date: Tue Jan 10 21:41:28 2017
New Revision: 311901
URL: https://svnweb.freebsd.org/changeset/base/311901

Log:
  Do not set BIO_DONE if the BIO specifies a completion handler.
  
  biowait() will otherwise race with completions of such BIOs. In-tree code
  only calls biowait() on BIOs that do not specify a handler, so this change
  should not have any functional impact.
  
  Reviewed by:  mav
  MFC after:1 month
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D9070

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Jan 10 21:21:00 2017(r311900)
+++ head/sys/kern/vfs_bio.c Tue Jan 10 21:41:28 2017(r311901)
@@ -3905,10 +3905,8 @@ biodone(struct bio *bp)
bp->bio_flags |= BIO_DONE;
wakeup(bp);
mtx_unlock(mtxp);
-   } else {
-   bp->bio_flags |= BIO_DONE;
+   } else
done(bp);
-   }
 }
 
 /*
___
svn-src-head@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"


svn commit: r311900 - head/sys/modules/em

2017-01-10 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 21:21:00 2017
New Revision: 311900
URL: https://svnweb.freebsd.org/changeset/base/311900

Log:
  Set CFLAGS correctly for sys/modules/em
  
  Unbreak gcc sparc64 builds (or any gcc build that uses em(4)).
  
  Reported by:  l...@freebsd.org

Modified:
  head/sys/modules/em/Makefile

Modified: head/sys/modules/em/Makefile
==
--- head/sys/modules/em/MakefileTue Jan 10 21:18:32 2017
(r311899)
+++ head/sys/modules/em/MakefileTue Jan 10 21:21:00 2017
(r311900)
@@ -17,7 +17,7 @@ PCIE_SHARED = e1000_80003es2lan.c e1000_
 LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c
 
 
-CFLAGS += -I${.CURDIR}/../../../dev/e1000
+CFLAGS += -I${.CURDIR}/../../dev/e1000
 
 # DEVICE_POLLING for a non-interrupt-driven method
 #CFLAGS  += -DDEVICE_POLLING
___
svn-src-head@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"


svn commit: r311898 - head/sys/sparc64/include

2017-01-10 Thread Mateusz Guzik
Author: mjg
Date: Tue Jan 10 21:10:20 2017
New Revision: 311898
URL: https://svnweb.freebsd.org/changeset/base/311898

Log:
  sparc64: add atomic_fcmpset
  
  Tested on hardware provided by feld.
  
  Reviewed by:  marius

Modified:
  head/sys/sparc64/include/atomic.h

Modified: head/sys/sparc64/include/atomic.h
==
--- head/sys/sparc64/include/atomic.h   Tue Jan 10 20:52:44 2017
(r311897)
+++ head/sys/sparc64/include/atomic.h   Tue Jan 10 21:10:20 2017
(r311898)
@@ -219,6 +219,40 @@ atomic_cmpset_rel_ ## name(volatile ptyp
return (((vtype)atomic_cas_rel((p), (e), (s), sz)) == (e)); \
 }  \
\
+static __inline int\
+atomic_fcmpset_ ## name(volatile ptype p, vtype *ep, vtype s)  \
+{  \
+   vtype t;\
+   \
+   t = (vtype)atomic_cas((p), (*ep), (s), sz); \
+   if (t == (*ep)) \
+   return (1); \
+   *ep = t;\
+   return (0); \
+}  \
+static __inline int\
+atomic_fcmpset_acq_ ## name(volatile ptype p, vtype *ep, vtype s)  \
+{  \
+   vtype t;\
+   \
+   t = (vtype)atomic_cas_acq((p), (*ep), (s), sz); \
+   if (t == (*ep)) \
+   return (1); \
+   *ep = t;\
+   return (0); \
+}  \
+static __inline int\
+atomic_fcmpset_rel_ ## name(volatile ptype p, vtype *ep, vtype s)  \
+{  \
+   vtype t;\
+   \
+   t = (vtype)atomic_cas_rel((p), (*ep), (s), sz); \
+   if (t == (*ep)) \
+   return (1); \
+   *ep = t;\
+   return (0); \
+}  \
+   \
 static __inline vtype  \
 atomic_load_ ## name(volatile ptype p) \
 {  \
___
svn-src-head@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"


svn commit: r311897 - head/sbin/camcontrol

2017-01-10 Thread Alexander Motin
Author: mav
Date: Tue Jan 10 20:52:44 2017
New Revision: 311897
URL: https://svnweb.freebsd.org/changeset/base/311897

Log:
  Add checks for received mode page length.
  
  If our buffer is too small, we may receive part of the page, and should
  not try read/write past the end of the buffer.
  
  Reported by:  Coverity
  CID:  1368374, 1368375
  MFC after:1 week

Modified:
  head/sbin/camcontrol/modeedit.c

Modified: head/sbin/camcontrol/modeedit.c
==
--- head/sbin/camcontrol/modeedit.c Tue Jan 10 20:44:31 2017
(r311896)
+++ head/sbin/camcontrol/modeedit.c Tue Jan 10 20:52:44 2017
(r311897)
@@ -557,7 +557,7 @@ editlist_populate(struct cam_device *dev
struct scsi_mode_header_6 *mh;  /* Location of mode header. */
struct scsi_mode_page_header *mph;
struct scsi_mode_page_header_sp *mphsp;
-   int len;
+   size_t len;
 
STAILQ_INIT();
 
@@ -575,6 +575,7 @@ editlist_populate(struct cam_device *dev
mode_pars = (uint8_t *)(mphsp + 1);
len = scsi_2btoul(mphsp->page_length);
}
+   len = MIN(len, sizeof(data) - (mode_pars - data));
 
/* Decode the value data, creating edit_entries for each value. */
buff_decode_visit(mode_pars, len, format, editentry_create, 0);
@@ -594,7 +595,7 @@ editlist_save(struct cam_device *device,
struct scsi_mode_header_6 *mh;  /* Location of mode header. */
struct scsi_mode_page_header *mph;
struct scsi_mode_page_header_sp *mphsp;
-   int len, hlen;
+   size_t len, hlen;
 
/* Make sure that something changed before continuing. */
if (! editlist_changed)
@@ -617,6 +618,7 @@ editlist_save(struct cam_device *device,
mode_pars = (uint8_t *)(mphsp + 1);
len = scsi_2btoul(mphsp->page_length);
}
+   len = MIN(len, sizeof(data) - (mode_pars - data));
 
/* Encode the value data to be passed back to the device. */
buff_encode_visit(mode_pars, len, format, editentry_save, 0);
@@ -814,7 +816,7 @@ modepage_dump(struct cam_device *device,
struct scsi_mode_header_6 *mh;  /* Location of mode header. */
struct scsi_mode_page_header *mph;
struct scsi_mode_page_header_sp *mphsp;
-   int indx, len;
+   size_t indx, len;
 
mode_sense(device, dbd, pc, page, subpage, retries, timeout,
data, sizeof(data));
@@ -829,6 +831,7 @@ modepage_dump(struct cam_device *device,
mode_pars = (uint8_t *)(mphsp + 1);
len = scsi_2btoul(mphsp->page_length);
}
+   len = MIN(len, sizeof(data) - (mode_pars - data));
 
/* Print the raw mode page data with newlines each 8 bytes. */
for (indx = 0; indx < len; indx++) {
___
svn-src-head@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"


svn commit: r311896 - head/sys/sys

2017-01-10 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Jan 10 20:44:31 2017
New Revision: 311896
URL: https://svnweb.freebsd.org/changeset/base/311896

Log:
  Remove unused __gnu_inline() attribute.
  
  This was meant to be used by a future FORTIFY_SOURCE implementation.
  Probably for good, FORTIFY_SOURCE and this particular GCCism were never
  well supported by clang or other compilers. Furthermore, the technology
  has long since been replaced by either static checkers, sanitizers, or
  even just the strong stack protector that was enabled by default.
  
  Drop __gnu_inline to avoid cluttering the headers.
  
  MFC after:5 days

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hTue Jan 10 20:43:32 2017(r311895)
+++ head/sys/sys/cdefs.hTue Jan 10 20:44:31 2017(r311896)
@@ -543,22 +543,6 @@
__attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
 #endif
 
-/*
- * FORTIFY_SOURCE, and perhaps other compiler-specific features, require
- * the use of non-standard inlining.  In general we should try to avoid
- * using these but GCC-compatible compilers tend to support the extensions
- * well enough to use them in limited cases.
- */ 
-#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
-#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__)
-#define__gnu_inline__attribute__((__gnu_inline__, __artificial__))
-#else
-#define__gnu_inline__attribute__((__gnu_inline__))
-#endif /* artificial */
-#else
-#define__gnu_inline
-#endif
-
 /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
 #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 31 && \
 defined(__GNUC__) && !defined(__INTEL_COMPILER)
___
svn-src-head@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"


svn commit: r311895 - in head: etc/mtree usr.bin/tail usr.bin/tail/tests

2017-01-10 Thread Alan Somers
Author: asomers
Date: Tue Jan 10 20:43:32 2017
New Revision: 311895
URL: https://svnweb.freebsd.org/changeset/base/311895

Log:
  Fix memory leaks during "tail -r" of an irregular file
  
  * Rewrite r_buf to use standard tail queues instead of a hand-rolled
circular linked list. Free dynamic allocations when done.
  * Remove an optimization for the case where the file is a multiple of 128KB
in size and there is a scarcity of memory.
  * Add ATF tests for "tail -r" and its variants.
  
  Reported by:  Valgrind
  Reviewed by:  ngie
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D9067

Added:
  head/usr.bin/tail/tests/
  head/usr.bin/tail/tests/Makefile   (contents, props changed)
  head/usr.bin/tail/tests/tail_test.sh   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/tail/Makefile
  head/usr.bin/tail/reverse.c

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Tue Jan 10 20:37:44 2017
(r311894)
+++ head/etc/mtree/BSD.tests.dist   Tue Jan 10 20:43:32 2017
(r311895)
@@ -644,6 +644,8 @@
 ..
 soelim
 ..
+tail
+..
 tar
 ..
 timeout

Modified: head/usr.bin/tail/Makefile
==
--- head/usr.bin/tail/Makefile  Tue Jan 10 20:37:44 2017(r311894)
+++ head/usr.bin/tail/Makefile  Tue Jan 10 20:43:32 2017(r311895)
@@ -1,7 +1,13 @@
 # $FreeBSD$
 #  @(#)Makefile8.1 (Berkeley) 6/6/93
 
+.include 
+
 PROG=  tail
 SRCS=  forward.c misc.c read.c reverse.c tail.c
 
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
 .include 

Modified: head/usr.bin/tail/reverse.c
==
--- head/usr.bin/tail/reverse.c Tue Jan 10 20:37:44 2017(r311894)
+++ head/usr.bin/tail/reverse.c Tue Jan 10 20:43:32 2017(r311895)
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)reverse.c 8.
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 
@@ -169,12 +170,12 @@ r_reg(FILE *fp, const char *fn, enum STY
ierr(fn);
 }
 
-typedef struct bf {
-   struct bf *next;
-   struct bf *prev;
-   int len;
-   char *l;
-} BF;
+static const size_t bsz = 128 * 1024;
+typedef struct bfelem {
+   TAILQ_ENTRY(bfelem) entries;
+   size_t len;
+   char l[bsz];
+} bfelem_t;
 
 /*
  * r_buf -- display a non-regular file in reverse order by line.
@@ -189,64 +190,42 @@ typedef struct bf {
 static void
 r_buf(FILE *fp, const char *fn)
 {
-   BF *mark, *tl, *tr;
-   int ch, len, llen;
+   struct bfelem *tl, *temp, *first = NULL;
+   size_t len, llen;
char *p;
-   off_t enomem;
+   off_t enomem = 0;
+   TAILQ_HEAD(bfhead, bfelem) head;
 
-   tl = NULL;
-#defineBSZ (128 * 1024)
-   for (mark = NULL, enomem = 0;;) {
+   TAILQ_INIT();
+
+   while (!feof(fp)) {
/*
 * Allocate a new block and link it into place in a doubly
 * linked list.  If out of memory, toss the LRU block and
 * keep going.
 */
-   if (enomem || (tl = malloc(sizeof(BF))) == NULL ||
-   (tl->l = malloc(BSZ)) == NULL) {
-   if (!mark)
+   while ((tl = malloc(sizeof(bfelem_t))) == NULL) {
+   first = TAILQ_FIRST();
+   if (TAILQ_EMPTY())
err(1, "malloc");
-   if (enomem)
-   tl = tl->next;
-   else {
-   if (tl)
-   free(tl);
-   tl = mark;
-   }
-   enomem += tl->len;
-   } else if (mark) {
-   tl->next = mark;
-   tl->prev = mark->prev;
-   mark->prev->next = tl;
-   mark->prev = tl;
-   } else {
-   mark = tl;
-   mark->next = mark->prev = mark;
+   enomem += first->len;
+   TAILQ_REMOVE(, first, entries);
+   free(first);
}
+   TAILQ_INSERT_TAIL(, tl, entries);
 
/* Fill the block with input data. */
-   for (p = tl->l, len = 0;
-   len < BSZ && (ch = getc(fp)) != EOF; ++len)
-   *p++ = ch;
-
-   if (ferror(fp)) {
-   ierr(fn);
-   return;
-   }
-
-   /*
-* If no input data for this block and we tossed some data,
-  

svn commit: r311894 - head

2017-01-10 Thread Alan Somers
Author: asomers
Date: Tue Jan 10 20:37:44 2017
New Revision: 311894
URL: https://svnweb.freebsd.org/changeset/base/311894

Log:
  Fix typo from change 310985 in ObsoleteFiles.inc
  
  MFC after:16 days
  X-MFC-With:   310803
  Sponsored by: Spectra Logic Corp

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Jan 10 20:35:09 2017(r311893)
+++ head/ObsoleteFiles.inc  Tue Jan 10 20:37:44 2017(r311894)
@@ -53,8 +53,8 @@ OLD_FILES+=usr/share/man/man3/sysdecode_
 # 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu
 OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu
 # 20161229: Three files from gnop tests consolidated into one
-OLD_FILES+=usr/tests/sys/geom/class/nop/1_test.sh
-OLD_FILES+=usr/tests/sys/geom/class/nop/2_test.sh
+OLD_FILES+=usr/tests/sys/geom/class/nop/1_test
+OLD_FILES+=usr/tests/sys/geom/class/nop/2_test
 OLD_FILES+=usr/tests/sys/geom/class/nop/conf.sh
 # 20161217: new clang import which bumps version from 3.9.0 to 3.9.1.
 OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h
___
svn-src-head@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"


svn commit: r311893 - in head: . tests/sys/geom/class/gate

2017-01-10 Thread Alan Somers
Author: asomers
Date: Tue Jan 10 20:35:09 2017
New Revision: 311893
URL: https://svnweb.freebsd.org/changeset/base/311893

Log:
  ATFify the geom gate tests.
  
  This ensures their cleanup routines will be run even if they should timeout.
  
  tests/sys/geom/class/gate/ggate_test.sh
  tests/sys/geom/class/gate/Makefile
Add an ATF test with three testcases, one for each TAP test. Use
ATF-style cleanup functions, and convert sleeps to polling loops.
  
  ObsoleteFiles.inc
  tests/sys/geom/class/gate/conf.sh
  tests/sys/geom/class/gate/1_test.sh
  tests/sys/geom/class/gate/2_test.sh
  tests/sys/geom/class/gate/3_test.sh
Delete TAP test files
  
  Reviewed by:  ngie
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D8891

Added:
  head/tests/sys/geom/class/gate/ggate_test.sh   (contents, props changed)
Deleted:
  head/tests/sys/geom/class/gate/1_test.sh
  head/tests/sys/geom/class/gate/2_test.sh
  head/tests/sys/geom/class/gate/3_test.sh
  head/tests/sys/geom/class/gate/conf.sh
Modified:
  head/ObsoleteFiles.inc
  head/tests/sys/geom/class/gate/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Jan 10 20:16:16 2017(r311892)
+++ head/ObsoleteFiles.inc  Tue Jan 10 20:35:09 2017(r311893)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170110: Four files from ggate tests consolidated into one
+OLD_FILES+=usr/tests/sys/geom/class/gate/1_test
+OLD_FILES+=usr/tests/sys/geom/class/gate/2_test
+OLD_FILES+=usr/tests/sys/geom/class/gate/3_test
+OLD_FILES+=usr/tests/sys/geom/class/gate/conf.sh
 # 20170103: libbsnmptools.so made into an INTERNALLIB
 OLD_FILES+=usr/lib/libbsnmptools.a
 OLD_FILES+=usr/lib/libbsnmptools_p.a

Modified: head/tests/sys/geom/class/gate/Makefile
==
--- head/tests/sys/geom/class/gate/Makefile Tue Jan 10 20:16:16 2017
(r311892)
+++ head/tests/sys/geom/class/gate/Makefile Tue Jan 10 20:35:09 2017
(r311893)
@@ -4,14 +4,6 @@ PACKAGE=   tests
 
 TESTSDIR=  ${TESTSBASE}/sys/geom/class/${.CURDIR:T}
 
-TAP_TESTS_SH+= 1_test
-TAP_TESTS_SH+= 2_test
-TAP_TESTS_SH+= 3_test
-
-${PACKAGE}FILES+=  conf.sh
-
-.for t in ${TAP_TESTS_SH}
-TEST_METADATA.$t+= required_user="root"
-.endfor
+ATF_TESTS_SH+= ggate_test
 
 .include 

Added: head/tests/sys/geom/class/gate/ggate_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/geom/class/gate/ggate_test.shTue Jan 10 20:35:09 
2017(r311893)
@@ -0,0 +1,193 @@
+# $FreeBSD$
+
+PIDFILE=ggated.pid
+PLAINFILES=plainfiles
+PORT=33080
+CONF=gg.exports
+RETRIES=16
+
+atf_test_case ggated cleanup
+ggated_head()
+{
+   atf_set "descr" "ggated can proxy geoms"
+   atf_set "require.progs" "ggatec ggated"
+   atf_set "require.user" "root"
+   atf_set "timeout" 60
+}
+
+ggated_body()
+{
+   us=$(alloc_ggate_dev)
+   work=$(alloc_md)
+   src=$(alloc_md)
+
+   dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc
+   dd if=/dev/random of=/dev/$src bs=1m count=1 conv=notrunc
+
+   echo $CONF >> $PLAINFILES
+   echo "127.0.0.1 RW /dev/$work" > $CONF
+
+   atf_check ggated -p $PORT -F $PIDFILE $CONF
+   for try in `jot $RETRIES`; do
+   ggatec create -p $PORT -u $us 127.0.0.1 /dev/$work && break
+   # wait for ggated to be ready
+   sleep 0.25
+   done
+   if [ "$try" -eq "$RETRIES" ]; then
+   atf_fail "ggatec create failed"
+   fi
+
+   for try in `jot $RETRIES`; do
+   dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=notrunc\
+   && break
+   # Wait for /dev/ggate${us} to be ready
+   sleep 0.25
+   done
+   if [ "$try" -eq "$RETRIES" ]; then
+   atf_fail "dd failed; /dev/ggate${us} isn't working"
+   fi
+
+   checksum /dev/$src /dev/$work
+}
+
+ggated_cleanup()
+{
+   common_cleanup
+}
+
+atf_test_case ggatel_file cleanup
+ggatel_file_head()
+{
+   atf_set "descr" "ggatel can proxy files"
+   atf_set "require.progs" "ggatel"
+   atf_set "require.user" "root"
+   atf_set "timeout" 15
+}
+
+ggatel_file_body()
+{
+   us=$(alloc_ggate_dev)
+
+   echo src work >> ${PLAINFILES}
+   dd if=/dev/random of=work bs=1m count=1
+   dd if=/dev/random of=src bs=1m count=1
+
+   atf_check ggatel create -u $us work
+
+

svn commit: r311892 - head/sys/cam/ctl

2017-01-10 Thread Alexander Motin
Author: mav
Date: Tue Jan 10 20:16:16 2017
New Revision: 311892
URL: https://svnweb.freebsd.org/changeset/base/311892

Log:
  Do not wait for HA thread shutdown if scheduler is stopped.
  
  This wait loop made system hang on panic instead of reboot.
  
  MFC after:1 week

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

Modified: head/sys/cam/ctl/ctl_ha.c
==
--- head/sys/cam/ctl/ctl_ha.c   Tue Jan 10 20:15:24 2017(r311891)
+++ head/sys/cam/ctl/ctl_ha.c   Tue Jan 10 20:16:16 2017(r311892)
@@ -1001,7 +1001,7 @@ ctl_ha_msg_shutdown(struct ctl_softc *ct
softc->ha_shutdown = 1;
softc->ha_wakeup = 1;
wakeup(>ha_wakeup);
-   while (softc->ha_shutdown < 2) {
+   while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) {
msleep(>ha_wakeup, >ha_lock, 0,
"shutdown", hz);
}
___
svn-src-head@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"


svn commit: r311891 - head/sys/boot/efi

2017-01-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jan 10 20:15:24 2017
New Revision: 311891
URL: https://svnweb.freebsd.org/changeset/base/311891

Log:
  [efi] Build EFI bits with -fPIC on ARM
  
  clang 3.9.0 without -fPIC generates absolute jump table for
  switch/case statement which trips boot1.efi and loader.efi
  on ARM platform.
  
  Reviewed by:  andrew
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D9108

Modified:
  head/sys/boot/efi/Makefile.inc

Modified: head/sys/boot/efi/Makefile.inc
==
--- head/sys/boot/efi/Makefile.inc  Tue Jan 10 20:12:07 2017
(r311890)
+++ head/sys/boot/efi/Makefile.inc  Tue Jan 10 20:15:24 2017
(r311891)
@@ -23,4 +23,8 @@ CFLAGS+=  -fshort-wchar
 CFLAGS+=   -fPIC
 .endif
 
+.if ${MACHINE_CPUARCH} == "arm"
+CFLAGS+=   -fPIC
+.endif
+
 .include "../Makefile.inc"
___
svn-src-head@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"


svn commit: r311890 - head/sys/boot/efi/loader/arch/arm

2017-01-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jan 10 20:12:07 2017
New Revision: 311890
URL: https://svnweb.freebsd.org/changeset/base/311890

Log:
  [efi] Fix .rel.data.* being erroneously merged into .data on ARM
  
  Fix section pattern code to exclude .rel.data.* sections from being
  merged into .data. Otherwise relocations in those sections are lost
  in final binary
  
  Reviewed by:  andrew
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D9108

Modified:
  head/sys/boot/efi/loader/arch/arm/ldscript.arm

Modified: head/sys/boot/efi/loader/arch/arm/ldscript.arm
==
--- head/sys/boot/efi/loader/arch/arm/ldscript.arm  Tue Jan 10 20:09:35 
2017(r311889)
+++ head/sys/boot/efi/loader/arch/arm/ldscript.arm  Tue Jan 10 20:12:07 
2017(r311890)
@@ -18,7 +18,7 @@ SECTIONS
   . = ALIGN(16);
   .data:
   {
-*(.data *.data.*)
+*(.data .data.*)
 *(.gnu.linkonce.d*)
 *(.rodata)
 *(.rodata.*)
___
svn-src-head@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"


svn commit: r311888 - head/sys/boot/efi/loader/arch/arm

2017-01-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jan 10 20:08:21 2017
New Revision: 311888
URL: https://svnweb.freebsd.org/changeset/base/311888

Log:
  [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
  
  __bss_end should not be included in .bss zeroing code. Otherwise first 4
  bytes of the section that follows .bss (in loader's case it's .sdata) are
  overwritten by zero.
  
  Reviewed by:  andrew
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D9108

Modified:
  head/sys/boot/efi/loader/arch/arm/start.S

Modified: head/sys/boot/efi/loader/arch/arm/start.S
==
--- head/sys/boot/efi/loader/arch/arm/start.S   Tue Jan 10 19:28:40 2017
(r311887)
+++ head/sys/boot/efi/loader/arch/arm/start.S   Tue Jan 10 20:08:21 2017
(r311888)
@@ -161,7 +161,7 @@ _start:
mov r2, #0
 
 1: cmp r0, r1
-   bgt 2f
+   bge 2f
str r2, [r0], #4
b   1b
 2:
___
svn-src-head@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"


svn commit: r311887 - head/sys/net80211

2017-01-10 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Jan 10 19:28:40 2017
New Revision: 311887
URL: https://svnweb.freebsd.org/changeset/base/311887

Log:
  Fix build without IEEE80211_DEBUG.
  
  Reported by:  many

Modified:
  head/sys/net80211/ieee80211_vht.c

Modified: head/sys/net80211/ieee80211_vht.c
==
--- head/sys/net80211/ieee80211_vht.c   Tue Jan 10 19:26:55 2017
(r311886)
+++ head/sys/net80211/ieee80211_vht.c   Tue Jan 10 19:28:40 2017
(r311887)
@@ -91,11 +91,12 @@ vht_recv_action_placeholder(struct ieee8
 const uint8_t *frm, const uint8_t *efrm)
 {
 
+#ifdef IEEE80211_DEBUG
ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
__func__,
wh->i_fc[0],
wh->i_fc[1]);
-
+#endif
return (0);
 }
 
@@ -104,10 +105,12 @@ vht_send_action_placeholder(struct ieee8
 int category, int action, void *arg0)
 {
 
+#ifdef IEEE80211_DEBUG
ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
__func__,
category,
action);
+#endif
return (EINVAL);
 }
 
___
svn-src-head@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"


svn commit: r311886 - head/libexec/rtld-elf

2017-01-10 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 10 19:26:55 2017
New Revision: 311886
URL: https://svnweb.freebsd.org/changeset/base/311886

Log:
  Fix acquisition of nested write compat rtld locks.
  
  Obtaining compat rtld lock in write mode sets process signal mask to
  block all signals.  Previous mask is stored in the global variable
  oldsigmask.  If a lock is write-locked while another lock is already
  write-locked, oldsigmask is overwritten by the total mask and on the
  last unlock, all signals except traps appear to be blocked.
  
  Fix this by counting the write-lock nested level, and only storing to
  oldsigmask/restoring from it at the outermost level.
  
  Masking signals disables involuntary preemption for libc_r, and there
  could be no voluntary context switches in the locked code
  (dl_iterate_phdr(3) keeps a lock around user callback, but it was
  added long after libc_r was renounced).  Due to this, remembering the
  level in the global variable after the lock is obtained should be
  safe, because no two libc_r threads can acquire different write locks
  in parallel.
  
  PR:   215826
  Reported by:  kami
  Tested by:yam...@yamagi.org (previous version)
  To be reviewed by:kan
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/rtld_lock.c

Modified: head/libexec/rtld-elf/rtld_lock.c
==
--- head/libexec/rtld-elf/rtld_lock.c   Tue Jan 10 19:16:50 2017
(r311885)
+++ head/libexec/rtld-elf/rtld_lock.c   Tue Jan 10 19:26:55 2017
(r311886)
@@ -64,7 +64,7 @@ typedef struct Struct_Lock {
 } Lock;
 
 static sigset_t fullsigmask, oldsigmask;
-static int thread_flag;
+static int thread_flag, wnested;
 
 static void *
 def_lock_create(void)
@@ -117,29 +117,34 @@ def_rlock_acquire(void *lock)
 static void
 def_wlock_acquire(void *lock)
 {
-Lock *l = (Lock *)lock;
-sigset_t tmp_oldsigmask;
+   Lock *l;
+   sigset_t tmp_oldsigmask;
 
-for ( ; ; ) {
-   sigprocmask(SIG_BLOCK, , _oldsigmask);
-   if (atomic_cmpset_acq_int(>lock, 0, WAFLAG))
-   break;
-   sigprocmask(SIG_SETMASK, _oldsigmask, NULL);
-}
-oldsigmask = tmp_oldsigmask;
+   l = (Lock *)lock;
+   for (;;) {
+   sigprocmask(SIG_BLOCK, , _oldsigmask);
+   if (atomic_cmpset_acq_int(>lock, 0, WAFLAG))
+   break;
+   sigprocmask(SIG_SETMASK, _oldsigmask, NULL);
+   }
+   if (atomic_fetchadd_int(, 1) == 0)
+   oldsigmask = tmp_oldsigmask;
 }
 
 static void
 def_lock_release(void *lock)
 {
-Lock *l = (Lock *)lock;
+   Lock *l;
 
-if ((l->lock & WAFLAG) == 0)
-   atomic_add_rel_int(>lock, -RC_INCR);
-else {
-   atomic_add_rel_int(>lock, -WAFLAG);
-   sigprocmask(SIG_SETMASK, , NULL);
-}
+   l = (Lock *)lock;
+   if ((l->lock & WAFLAG) == 0)
+   atomic_add_rel_int(>lock, -RC_INCR);
+   else {
+   assert(wnested > 0);
+   atomic_add_rel_int(>lock, -WAFLAG);
+   if (atomic_fetchadd_int(, -1) == 1)
+   sigprocmask(SIG_SETMASK, , NULL);
+   }
 }
 
 static int
@@ -373,12 +378,12 @@ _rtld_atfork_pre(int *locks)
return;
 
/*
-* Warning: this does not work with the rtld compat locks
-* above, since the thread signal mask is corrupted (set to
-* all signals blocked) if two locks are taken in write mode.
-* The caller of the _rtld_atfork_pre() must provide the
-* working implementation of the locks, and libthr locks are
-* fine.
+* Warning: this did not worked well with the rtld compat
+* locks above, when the thread signal mask was corrupted (set
+* to all signals blocked) if two locks were taken
+* simultaneously in the write mode.  The caller of the
+* _rtld_atfork_pre() must provide the working implementation
+* of the locks anyway, and libthr locks are fine.
 */
wlock_acquire(rtld_phdr_lock, [0]);
wlock_acquire(rtld_bind_lock, [1]);
___
svn-src-head@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"


svn commit: r311881 - head/sys/tools

2017-01-10 Thread Li-Wen Hsu
Author: lwhsu (ports committer)
Date: Tue Jan 10 18:46:40 2017
New Revision: 311881
URL: https://svnweb.freebsd.org/changeset/base/311881

Log:
  Replace using of objdump with elfdump
  
  In-tree objdump is too old to dump new ELF headers.  But for example if we
  use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
  CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
  This patch just replaces using of objdump with elfdump to collect needed
  information.
  
  Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .
  
  Reviewed by:  emaste, br
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D9062

Modified:
  head/sys/tools/embed_mfs.sh

Modified: head/sys/tools/embed_mfs.sh
==
--- head/sys/tools/embed_mfs.sh Tue Jan 10 18:39:53 2017(r311880)
+++ head/sys/tools/embed_mfs.sh Tue Jan 10 18:46:40 2017(r311881)
@@ -36,12 +36,12 @@ mfs_size=`stat -f '%z' $2 2> /dev/null`
 # If we can't determine MFS image size - bail.
 [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1
 
-sec_info=`${CROSS_BINUTILS_PREFIX}objdump -h $1 2> /dev/null | grep " oldmfs "`
+sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"`
 # If we can't find the mfs section within the given kernel - bail.
 [ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1
 
-sec_size=`echo ${sec_info} | awk '{printf("%d", "0x" $3)}' 2> /dev/null`
-sec_start=`echo ${sec_info} | awk '{printf("%d", "0x" $6)}' 2> /dev/null`
+sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2> /dev/null`
+sec_start=`echo "${sec_info}" | awk '/sh_offset/ {print $2}' 2> /dev/null`
 
 # If the mfs section size is smaller than the mfs image - bail.
 [ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1
___
svn-src-head@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"


svn commit: r311880 - in head/sys/dev: cxgb/ulp/iw_cxgb cxgbe/iw_cxgbe

2017-01-10 Thread Navdeep Parhar
Author: np
Date: Tue Jan 10 18:39:53 2017
New Revision: 311880
URL: https://svnweb.freebsd.org/changeset/base/311880

Log:
  The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
  a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
  using this field then we'll have to figure out whether to create fake
  devices for these drivers or have linuxkpi deal with NULL device.
  
  This mismatch was first reported as part of D6585.

Modified:
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c
  head/sys/dev/cxgbe/iw_cxgbe/provider.c

Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c
==
--- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.cTue Jan 10 17:05:34 
2017(r311879)
+++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.cTue Jan 10 18:39:53 
2017(r311880)
@@ -1094,7 +1094,7 @@ int iwch_register_device(struct iwch_dev
memcpy(dev->ibdev.node_desc, IWCH_NODE_DESC, sizeof(IWCH_NODE_DESC));
dev->ibdev.phys_port_cnt = sc->params.nports;
dev->ibdev.num_comp_vectors = 1;
-   dev->ibdev.dma_device = dev->rdev.adap->dev;
+   dev->ibdev.dma_device = NULL;
dev->ibdev.query_device = iwch_query_device;
dev->ibdev.query_port = iwch_query_port;
dev->ibdev.modify_port = iwch_modify_port;

Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/provider.c  Tue Jan 10 17:05:34 2017
(r311879)
+++ head/sys/dev/cxgbe/iw_cxgbe/provider.c  Tue Jan 10 18:39:53 2017
(r311880)
@@ -429,7 +429,7 @@ c4iw_register_device(struct c4iw_dev *de
strlcpy(ibdev->node_desc, C4IW_NODE_DESC, sizeof(ibdev->node_desc));
ibdev->phys_port_cnt = sc->params.nports;
ibdev->num_comp_vectors = 1;
-   ibdev->dma_device = sc->dev;
+   ibdev->dma_device = NULL;
ibdev->query_device = c4iw_query_device;
ibdev->query_port = c4iw_query_port;
ibdev->modify_port = c4iw_modify_port;
___
svn-src-head@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"


Re: svn commit: r311860 - head/sys/net80211

2017-01-10 Thread Shawn Webb
On Tue, Jan 10, 2017 at 07:21:07AM +, Adrian Chadd wrote:
> Author: adrian
> Date: Tue Jan 10 07:21:07 2017
> New Revision: 311860
> URL: https://svnweb.freebsd.org/changeset/base/311860
> 
> Log:
>   [net80211] add VHT action frame placeholders for when it's time to 
> implement.
> 
> Modified:
>   head/sys/net80211/ieee80211_vht.c
> 
> Modified: head/sys/net80211/ieee80211_vht.c
> ==
> --- head/sys/net80211/ieee80211_vht.c Tue Jan 10 05:37:53 2017
> (r311859)
> +++ head/sys/net80211/ieee80211_vht.c Tue Jan 10 07:21:07 2017
> (r311860)
> @@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$");
>   * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details.
>   */
>  
> +static int
> +vht_recv_action_placeholder(struct ieee80211_node *ni,
> +const struct ieee80211_frame *wh,
> +const uint8_t *frm, const uint8_t *efrm)
> +{
> +
> + ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
> + __func__,
> + wh->i_fc[0],
> + wh->i_fc[1]);
> +
> + return (0);
> +}
> +
> +static int
> +vht_send_action_placeholder(struct ieee80211_node *ni,
> +int category, int action, void *arg0)
> +{
> +
> + ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
> + __func__,
> + category,
> + action);
> + return (EINVAL);
> +}
> +

This broke the build for kernel configurations that don't have the
IEEE80211_DEBUG option set. ieee80211_note is only a valid function when
IEEE80211_DEBUG is defined.

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r311879 - head/libexec/rtld-elf

2017-01-10 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 10 17:05:34 2017
New Revision: 311879
URL: https://svnweb.freebsd.org/changeset/base/311879

Log:
  Use ANSI C definitions, update comment.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld_lock.c

Modified: head/libexec/rtld-elf/rtld_lock.c
==
--- head/libexec/rtld-elf/rtld_lock.c   Tue Jan 10 16:30:56 2017
(r311878)
+++ head/libexec/rtld-elf/rtld_lock.c   Tue Jan 10 17:05:34 2017
(r311879)
@@ -38,8 +38,8 @@
  * In this algorithm the lock is a single word.  Its low-order bit is
  * set when a writer holds the lock.  The remaining high-order bits
  * contain a count of readers desiring the lock.  The algorithm requires
- * atomic "compare_and_store" and "add" operations, which we implement
- * using assembly language sequences in "rtld_start.S".
+ * atomic "compare_and_store" and "add" operations, which we take
+ * from machine/atomic.h.
  */
 
 #include 
@@ -67,7 +67,7 @@ static sigset_t fullsigmask, oldsigmask;
 static int thread_flag;
 
 static void *
-def_lock_create()
+def_lock_create(void)
 {
 void *base;
 char *p;
@@ -269,7 +269,7 @@ lock_restart_for_upgrade(RtldLockState *
 }
 
 void
-lockdflt_init()
+lockdflt_init(void)
 {
 int i;
 
___
svn-src-head@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"


svn commit: r311877 - head/sys/dev/sfxge

2017-01-10 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Jan 10 16:25:39 2017
New Revision: 311877
URL: https://svnweb.freebsd.org/changeset/base/311877

Log:
  sfxge(4): avoid unnecessary mbuf data prefetch
  
  Unnecessary prefetch just loads HW prefetcher and displaces other
  cache entries (which could be really useful).
  
  If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
  expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
  option descriptors.  If packet header needs to be linearized or finally
  FATSO cannot be used because of, for example, too big header, we do not
  care about a bit more performance degradation because of prefetch
  absence (it is better to optimize more common case).
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D9120

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Tue Jan 10 14:40:30 2017
(r311876)
+++ head/sys/dev/sfxge/sfxge_tx.c   Tue Jan 10 16:25:39 2017
(r311877)
@@ -363,8 +363,22 @@ static int sfxge_tx_queue_mbuf(struct sf
 
KASSERT(!txq->blocked, ("txq->blocked"));
 
+#if SFXGE_TX_PARSE_EARLY
+   /*
+* If software TSO is used, we still need to copy packet header,
+* even if we have already parsed it early before enqueue.
+*/
+   if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) &&
+   (txq->tso_fw_assisted == 0))
+   prefetch_read_many(mbuf->m_data);
+#else
+   /*
+* Prefetch packet header since we need to parse it and extract
+* IP ID, TCP sequence number and flags.
+*/
if (mbuf->m_pkthdr.csum_flags & CSUM_TSO)
prefetch_read_many(mbuf->m_data);
+#endif
 
if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) {
rc = EINTR;
___
svn-src-head@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"


svn commit: r311876 - head/usr.sbin/crunch/crunchide

2017-01-10 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Jan 10 14:40:30 2017
New Revision: 311876
URL: https://svnweb.freebsd.org/changeset/base/311876

Log:
  Teach crunchide about EM_S390 to make bootstrapping from future
  releases easier unless someone will fix the PR properly.
  
  MFC after:3 days
  PR:   215940

Modified:
  head/usr.sbin/crunch/crunchide/exec_elf32.c

Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c
==
--- head/usr.sbin/crunch/crunchide/exec_elf32.c Tue Jan 10 13:36:33 2017
(r311875)
+++ head/usr.sbin/crunch/crunchide/exec_elf32.c Tue Jan 10 14:40:30 2017
(r311876)
@@ -191,6 +191,7 @@ ELFNAMEEND(check)(int fd, const char *fn
 #defineEM_RISCV243
 #endif
case EM_RISCV: break;
+   case EM_S390: break;
case EM_SPARCV9: break;
case EM_X86_64: break;
 /*ELFDEFNNAME(MACHDEP_ID_CASES) */
___
svn-src-head@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"


Re: svn commit: r310025 - head/libexec/rtld-elf

2017-01-10 Thread Dominic Fandrey
On Tue, 2016-12-13 at 18:05 +, Bryan Drewery wrote:
> Author: bdrewery
> Date: Tue Dec 13 18:05:14 2016
> New Revision: 310025
> URL: https://svnweb.freebsd.org/changeset/base/310025
> 
> Log:
>   Take write lock for rtld_bind before modifying obj_list in 
> dl_iterate_phdr().

This commit causes a regression in C++, where an exception
smashes the sigprocmask, causing all signal handling to fail.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215826

Look at #2 for a demonstration.


Regards
kami

-- 
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


___
svn-src-head@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"

svn commit: r311875 - head/sys/modules/ahci

2017-01-10 Thread Andrew Turner
Author: andrew
Date: Tue Jan 10 13:36:33 2017
New Revision: 311875
URL: https://svnweb.freebsd.org/changeset/base/311875

Log:
  Add acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/modules/ahci/Makefile

Modified: head/sys/modules/ahci/Makefile
==
--- head/sys/modules/ahci/Makefile  Tue Jan 10 10:56:33 2017
(r311874)
+++ head/sys/modules/ahci/Makefile  Tue Jan 10 13:36:33 2017
(r311875)
@@ -6,7 +6,7 @@ KMOD=   ahci
 SRCS=  ahci.c ahci_pci.c ahciem.c ahci.h device_if.h bus_if.h pci_if.h 
opt_cam.h
 
 .if ${MACHINE_CPUARCH} == "aarch64"
-SRCS+= ahci_generic.c ofw_bus_if.h
+SRCS+= ahci_generic.c acpi_if.h ofw_bus_if.h
 .endif
 
 .include 
___
svn-src-head@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"


svn commit: r311874 - in head/sys: conf dev/ahci

2017-01-10 Thread Andrew Turner
Author: andrew
Date: Tue Jan 10 10:56:33 2017
New Revision: 311874
URL: https://svnweb.freebsd.org/changeset/base/311874

Log:
  Add an ACPI attachment to the existing ahci_generic driver. This is used
  in some arm64 hardware, for example the AMD Opteron A1100.
  
  Reviewed by:  mav
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8852

Modified:
  head/sys/conf/files.arm64
  head/sys/dev/ahci/ahci_generic.c

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Tue Jan 10 10:33:36 2017(r311873)
+++ head/sys/conf/files.arm64   Tue Jan 10 10:56:33 2017(r311874)
@@ -145,7 +145,7 @@ armv8_crypto_wrap.o optionalarmv8crypt
 crypto/blowfish/bf_enc.c   optionalcrypto | ipsec
 crypto/des/des_enc.c   optionalcrypto | ipsec | netsmb
 dev/acpica/acpi_if.m   optionalacpi
-dev/ahci/ahci_generic.coptional ahci fdt
+dev/ahci/ahci_generic.coptionalahci
 dev/cpufreq/cpufreq_dt.c   optionalcpufreq fdt
 dev/hwpmc/hwpmc_arm64.coptionalhwpmc
 dev/hwpmc/hwpmc_arm64_md.c optionalhwpmc

Modified: head/sys/dev/ahci/ahci_generic.c
==
--- head/sys/dev/ahci/ahci_generic.cTue Jan 10 10:33:36 2017
(r311873)
+++ head/sys/dev/ahci/ahci_generic.cTue Jan 10 10:56:33 2017
(r311874)
@@ -27,6 +27,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_acpi.h"
+#include "opt_platform.h"
+
 #include 
 #include 
 #include 
@@ -44,6 +47,15 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef DEV_ACPI
+#include 
+#include 
+
+#include 
+#include 
+#endif
+
+#ifdef FDT
 #include 
 #include 
 
@@ -54,14 +66,7 @@ static struct ofw_compat_data compat_dat
 };
 
 static int
-ahci_gen_ctlr_reset(device_t dev)
-{
-
-   return ahci_ctlr_reset(dev);
-}
-
-static int
-ahci_probe(device_t dev)
+ahci_fdt_probe(device_t dev)
 {
 
if (!ofw_bus_status_okay(dev))
@@ -73,6 +78,34 @@ ahci_probe(device_t dev)
device_set_desc_copy(dev, "AHCI SATA controller");
return (BUS_PROBE_DEFAULT);
 }
+#endif
+
+#ifdef DEV_ACPI
+static int
+ahci_acpi_probe(device_t dev)
+{
+   ACPI_HANDLE h;
+
+   if ((h = acpi_get_handle(dev)) == NULL)
+   return (ENXIO);
+
+   if (pci_get_class(dev) == PCIC_STORAGE &&
+   pci_get_subclass(dev) == PCIS_STORAGE_SATA &&
+   pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) {
+   device_set_desc_copy(dev, "AHCI SATA controller");
+   return (BUS_PROBE_DEFAULT);
+   }
+
+   return (ENXIO);
+}
+#endif
+
+static int
+ahci_gen_ctlr_reset(device_t dev)
+{
+
+   return ahci_ctlr_reset(dev);
+}
 
 static int
 ahci_gen_attach(device_t dev)
@@ -109,9 +142,34 @@ ahci_gen_detach(device_t dev)
return (0);
 }
 
-static devclass_t ahci_gen_devclass;
-static device_method_t ahci_methods[] = {
-   DEVMETHOD(device_probe, ahci_probe),
+#ifdef FDT
+static devclass_t ahci_gen_fdt_devclass;
+static device_method_t ahci_fdt_methods[] = {
+   DEVMETHOD(device_probe, ahci_fdt_probe),
+   DEVMETHOD(device_attach,ahci_gen_attach),
+   DEVMETHOD(device_detach,ahci_gen_detach),
+   DEVMETHOD(bus_print_child,  ahci_print_child),
+   DEVMETHOD(bus_alloc_resource,   ahci_alloc_resource),
+   DEVMETHOD(bus_release_resource, ahci_release_resource),
+   DEVMETHOD(bus_setup_intr,   ahci_setup_intr),
+   DEVMETHOD(bus_teardown_intr,ahci_teardown_intr),
+   DEVMETHOD(bus_child_location_str, ahci_child_location_str),
+   DEVMETHOD(bus_get_dma_tag,  ahci_get_dma_tag),
+   DEVMETHOD_END
+};
+static driver_t ahci_fdt_driver = {
+   "ahci",
+   ahci_fdt_methods,
+   sizeof(struct ahci_controller)
+};
+DRIVER_MODULE(ahci_fdt, simplebus, ahci_fdt_driver, ahci_gen_fdt_devclass,
+NULL, NULL);
+#endif
+
+#ifdef DEV_ACPI
+static devclass_t ahci_gen_acpi_devclass;
+static device_method_t ahci_acpi_methods[] = {
+   DEVMETHOD(device_probe, ahci_acpi_probe),
DEVMETHOD(device_attach,ahci_gen_attach),
DEVMETHOD(device_detach,ahci_gen_detach),
DEVMETHOD(bus_print_child,  ahci_print_child),
@@ -123,9 +181,11 @@ static device_method_t ahci_methods[] = 
DEVMETHOD(bus_get_dma_tag,  ahci_get_dma_tag),
DEVMETHOD_END
 };
-static driver_t ahci_driver = {
+static driver_t ahci_acpi_driver = {
"ahci",
-   ahci_methods,
+   ahci_acpi_methods,
sizeof(struct ahci_controller)
 };
-DRIVER_MODULE(ahci, simplebus, ahci_driver, ahci_gen_devclass, NULL, NULL);
+DRIVER_MODULE(ahci_acpi, acpi, ahci_acpi_driver, ahci_gen_acpi_devclass,
+NULL, NULL);
+#endif

svn commit: r311873 - head/sys/cam/ctl

2017-01-10 Thread Alexander Motin
Author: mav
Date: Tue Jan 10 10:33:36 2017
New Revision: 311873
URL: https://svnweb.freebsd.org/changeset/base/311873

Log:
  Fix malloc(M_WAITOK) under mutex, introduced at r311787.
  
  MFC after:13 days

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

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Tue Jan 10 10:27:09 2017(r311872)
+++ head/sys/cam/ctl/ctl.c  Tue Jan 10 10:33:36 2017(r311873)
@@ -4593,6 +4593,8 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
printf("ctl: requested LUN ID %d is already "
   "in use\n", be_lun->req_lun_id);
}
+fail:
+   free(lun->lun_devid, M_CTL);
if (lun->flags & CTL_LUN_MALLOCED)
free(lun, M_CTL);
be_lun->lun_config_status(be_lun->be_lun,
@@ -4605,14 +4607,11 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
if (lun_number == -1) {
mtx_unlock(_softc->ctl_lock);
printf("ctl: can't allocate LUN, out of LUNs\n");
-   if (lun->flags & CTL_LUN_MALLOCED)
-   free(lun, M_CTL);
-   be_lun->lun_config_status(be_lun->be_lun,
- CTL_LUN_CONFIG_FAILURE);
-   return (ENOSPC);
+   goto fail;
}
}
ctl_set_mask(ctl_softc->ctl_lun_mask, lun_number);
+   mtx_unlock(_softc->ctl_lock);
 
mtx_init(>lun_lock, "CTL LUN", NULL, MTX_DEF);
lun->lun = lun_number;
@@ -4664,22 +4663,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
ctl_init_page_index(lun);
ctl_init_log_page_index(lun);
 
-   /*
-* Now, before we insert this lun on the lun list, set the lun
-* inventory changed UA for all other luns.
-*/
-   STAILQ_FOREACH(nlun, _softc->lun_list, links) {
-   mtx_lock(>lun_lock);
-   ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE);
-   mtx_unlock(>lun_lock);
-   }
-
-   STAILQ_INSERT_TAIL(_softc->lun_list, lun, links);
-
-   ctl_softc->ctl_luns[lun_number] = lun;
-
-   ctl_softc->num_luns++;
-
/* Setup statistics gathering */
 #ifdef CTL_LEGACY_STATS
lun->legacy_stats.device_type = be_lun->lun_type;
@@ -4692,6 +4675,19 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 #endif /* CTL_LEGACY_STATS */
lun->stats.item = lun_number;
 
+   /*
+* Now, before we insert this lun on the lun list, set the lun
+* inventory changed UA for all other luns.
+*/
+   mtx_lock(_softc->ctl_lock);
+   STAILQ_FOREACH(nlun, _softc->lun_list, links) {
+   mtx_lock(>lun_lock);
+   ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE);
+   mtx_unlock(>lun_lock);
+   }
+   STAILQ_INSERT_TAIL(_softc->lun_list, lun, links);
+   ctl_softc->ctl_luns[lun_number] = lun;
+   ctl_softc->num_luns++;
mtx_unlock(_softc->ctl_lock);
 
lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK);
___
svn-src-head@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"


svn commit: r311872 - head/contrib/netbsd-tests/lib/libc/stdio

2017-01-10 Thread Ngie Cooper
Author: ngie
Date: Tue Jan 10 10:27:09 2017
New Revision: 311872
URL: https://svnweb.freebsd.org/changeset/base/311872

Log:
  Diff reduce with upstream by removing signal.h #include
  
  MFC after:3 days

Modified:
  head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c

Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
==
--- head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Tue Jan 10 10:16:59 
2017(r311871)
+++ head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Tue Jan 10 10:27:09 
2017(r311872)
@@ -36,10 +36,6 @@
 #include 
 #include 
 
-#ifndef __NetBSD__
-#include 
-#endif
-
 ATF_TC(snprintf_c99);
 ATF_TC_HEAD(snprintf_c99, tc)
 {
___
svn-src-head@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"


Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb

2017-01-10 Thread Hans Petter Selasky

On 01/10/17 00:56, Andriy Voskoboinyk wrote:

Mon, 09 Jan 2017 10:08:13 +0200 було написано Hans Petter Selasky
:

Hi,

The race should be fixed in r311838.



Perfect :-)

--HPS

___
svn-src-head@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"

svn commit: r311871 - head/contrib/netbsd-tests/lib/libc/ttyio

2017-01-10 Thread Ngie Cooper
Author: ngie
Date: Tue Jan 10 10:16:59 2017
New Revision: 311871
URL: https://svnweb.freebsd.org/changeset/base/311871

Log:
  Merge ^/vendor/NetBSD/tests/dist@r311868
  
  This is the vendor accepted version of ^/head@r311245
  
  MFC after:3 days

Modified:
  head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
Directory Properties:
  head/contrib/netbsd-tests/   (props changed)

Modified: head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c
==
--- head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c  Tue Jan 10 10:12:36 
2017(r311870)
+++ head/contrib/netbsd-tests/lib/libc/ttyio/t_ttyio.c  Tue Jan 10 10:16:59 
2017(r311871)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */
+/* $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */
 
 /*
  * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $");
+__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $");
 
 #include 
 #include 
@@ -150,11 +150,9 @@ ATF_TC_BODY(ioctl, tc)
/* wait for last child */
sa.sa_handler = SIG_DFL;
REQUIRE_ERRNO(sigaction(SIGCHLD, , NULL), -1);
-   (void) wait(NULL);
+   (void)wait(NULL);
 
-#ifdef __FreeBSD__
(void)close(s);
-#endif
ATF_REQUIRE_EQ(rc, 0);
 }
 
___
svn-src-head@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"


svn commit: r311870 - head/contrib/netbsd-tests/lib/libc/gen

2017-01-10 Thread Ngie Cooper
Author: ngie
Date: Tue Jan 10 10:12:36 2017
New Revision: 311870
URL: https://svnweb.freebsd.org/changeset/base/311870

Log:
  Merge the grammar fix for lib/libc/gen/raise_test:raise_stress
  
  MFC after:3 days

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_raise.c
Directory Properties:
  head/contrib/netbsd-tests/   (props changed)

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_raise.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/t_raise.cTue Jan 10 10:09:12 
2017(r311869)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_raise.cTue Jan 10 10:12:36 
2017(r311870)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $ */
+/* $NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_raise.c,v 1.5 2011/05/10 12:43:42 jruoho Exp $");
+__RCSID("$NetBSD: t_raise.c,v 1.6 2016/11/03 22:08:31 kamil Exp $");
 
 #include 
 
@@ -180,7 +180,7 @@ ATF_TC_BODY(raise_stress, tc)
(void)raise(SIGUSR1);
 
if (count != maxiter)
-   atf_tc_fail("not all signals were catched");
+   atf_tc_fail("not all signals were caught");
 }
 
 ATF_TP_ADD_TCS(tp)
___
svn-src-head@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"