svn commit: r321606 - head/sys/cam/ata

2017-07-27 Thread Alexander Motin
Author: mav
Date: Thu Jul 27 07:28:29 2017
New Revision: 321606
URL: https://svnweb.freebsd.org/changeset/base/321606

Log:
  adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE
  
  The attached patch lets adaasync() set ADA_STATE_WCACHE based on
  ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD.
  
  This fixes a regression introduced in r300207 which changed
  the flag names.
  
  PR:   220948
  Submitted by: Fabian Keil 
  Obtained from:ElectroBSD
  MFC after:1 week

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Thu Jul 27 06:26:15 2017(r321605)
+++ head/sys/cam/ata/ata_da.c   Thu Jul 27 07:28:29 2017(r321606)
@@ -1320,7 +1320,7 @@ adaasync(void *callback_arg, u_int32_t code,
xpt_action((union ccb *)&cgd);
if (ADA_RA >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD)
softc->state = ADA_STATE_RAHEAD;
-   else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD)
+   else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_WCACHE)
softc->state = ADA_STATE_WCACHE;
else if ((softc->flags & ADA_FLAG_CAN_LOG)
  && (softc->zone_mode != ADA_ZONE_NONE))
___
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: r321607 - head/libexec/rtld-elf

2017-07-27 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 27 08:33:31 2017
New Revision: 321607
URL: https://svnweb.freebsd.org/changeset/base/321607

Log:
  Allow to specify targets by absolute paths in libmap.conf.
  
  Submitted by: Tatu Kilappa 
  PR:   221032
  MFC after:2 weeks

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

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cThu Jul 27 07:28:29 2017
(r321606)
+++ head/libexec/rtld-elf/rtld.cThu Jul 27 08:33:31 2017
(r321607)
@@ -1590,19 +1590,20 @@ find_library(const char *xname, const Obj_Entry *refob
 bool nodeflib, objgiven;
 
 objgiven = refobj != NULL;
-if (strchr(xname, '/') != NULL) {  /* Hard coded pathname */
-   if (xname[0] != '/' && !trust) {
+
+if (libmap_disable || !objgiven ||
+  (name = lm_find(refobj->path, xname)) == NULL)
+   name = (char *)xname;
+
+if (strchr(name, '/') != NULL) {   /* Hard coded pathname */
+   if (name[0] != '/' && !trust) {
_rtld_error("Absolute pathname required for shared object \"%s\"",
- xname);
-   return NULL;
+ name);
+   return (NULL);
}
return (origin_subst(__DECONST(Obj_Entry *, refobj),
- __DECONST(char *, xname)));
+ __DECONST(char *, name)));
 }
-
-if (libmap_disable || !objgiven ||
-   (name = lm_find(refobj->path, xname)) == NULL)
-   name = (char *)xname;
 
 dbg(" Searching for \"%s\"", name);
 
___
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: r321608 - head/lib/libc/x86/sys

2017-07-27 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 27 08:37:07 2017
New Revision: 321608
URL: https://svnweb.freebsd.org/changeset/base/321608

Log:
  Use MFENCE to serialize RDTSC on non-Intel CPUs.
  
  Kernel already used the stronger barrier instruction for AMDs, correct
  the userspace fast gettimeofday() implementation as well.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D11728

Modified:
  head/lib/libc/x86/sys/__vdso_gettc.c

Modified: head/lib/libc/x86/sys/__vdso_gettc.c
==
--- head/lib/libc/x86/sys/__vdso_gettc.cThu Jul 27 08:33:31 2017
(r321607)
+++ head/lib/libc/x86/sys/__vdso_gettc.cThu Jul 27 08:37:07 2017
(r321608)
@@ -52,57 +52,108 @@ __FBSDID("$FreeBSD$");
 #endif
 #include "libc_private.h"
 
+static enum LMB {
+   LMB_UNKNOWN,
+   LMB_NONE,
+   LMB_MFENCE,
+   LMB_LFENCE
+} lfence_works = LMB_UNKNOWN;
+
 static void
-lfence_mb(void)
+cpuidp(u_int leaf, u_int p[4])
 {
+
+   __asm __volatile(
 #if defined(__i386__)
-   static int lfence_works = -1;
+   "   pushl   %%ebx\n"
+#endif
+   "   cpuid\n"
+#if defined(__i386__)
+   "   movl%%ebx,%1\n"
+   "   popl%%ebx"
+#endif
+   : "=a" (p[0]),
+#if defined(__i386__)
+   "=r" (p[1]),
+#elif defined(__amd64__)
+   "=b" (p[1]),
+#else
+#error "Arch"
+#endif
+   "=c" (p[2]), "=d" (p[3])
+   :  "0" (leaf));
+}
+
+static enum LMB
+select_lmb(void)
+{
+   u_int p[4];
+   static const char intel_id[] = "GenuntelineI";
+
+   cpuidp(0, p);
+   return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ?
+   LMB_LFENCE : LMB_MFENCE);
+}
+
+static void
+init_fence(void)
+{
+#if defined(__i386__)
u_int cpuid_supported, p[4];
 
-   if (lfence_works == -1) {
-   __asm __volatile(
-   "   pushfl\n"
-   "   popl%%eax\n"
-   "   movl%%eax,%%ecx\n"
-   "   xorl$0x20,%%eax\n"
-   "   pushl   %%eax\n"
-   "   popfl\n"
-   "   pushfl\n"
-   "   popl%%eax\n"
-   "   xorl%%eax,%%ecx\n"
-   "   je  1f\n"
-   "   movl$1,%0\n"
-   "   jmp 2f\n"
-   "1: movl$0,%0\n"
-   "2:\n"
-   : "=r" (cpuid_supported) : : "eax", "ecx", "cc");
-   if (cpuid_supported) {
-   __asm __volatile(
-   "   pushl   %%ebx\n"
-   "   cpuid\n"
-   "   movl%%ebx,%1\n"
-   "   popl%%ebx\n"
-   : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3])
-   :  "0" (0x1));
-   lfence_works = (p[3] & CPUID_SSE2) != 0;
-   } else
-   lfence_works = 0;
-   }
-   if (lfence_works == 1)
-   lfence();
+   __asm __volatile(
+   "   pushfl\n"
+   "   popl%%eax\n"
+   "   movl%%eax,%%ecx\n"
+   "   xorl$0x20,%%eax\n"
+   "   pushl   %%eax\n"
+   "   popfl\n"
+   "   pushfl\n"
+   "   popl%%eax\n"
+   "   xorl%%eax,%%ecx\n"
+   "   je  1f\n"
+   "   movl$1,%0\n"
+   "   jmp 2f\n"
+   "1: movl$0,%0\n"
+   "2:\n"
+   : "=r" (cpuid_supported) : : "eax", "ecx", "cc");
+   if (cpuid_supported) {
+   cpuidp(0x1, p);
+   if ((p[3] & CPUID_SSE2) != 0)
+   lfence_works = select_lmb();
+   } else
+   lfence_works = LMB_NONE;
 #elif defined(__amd64__)
-   lfence();
+   lfence_works = select_lmb();
 #else
-#error "arch"
+#error "Arch"
 #endif
 }
 
+static void
+rdtsc_mb(void)
+{
+
+again:
+   if (__predict_true(lfence_works == LMB_LFENCE)) {
+   lfence();
+   return;
+   } else if (lfence_works == LMB_MFENCE) {
+   mfence();
+   return;
+   } else if (lfence_works == LMB_NONE) {
+   return;
+   }
+   init_fence();
+   goto again;
+}
+
 static u_int
 __vdso_gettc_rdtsc_low(const struct vdso_timehands *th)
 {
u_int rv;
 
-   lfence_mb();
+   rdtsc_mb();
__asm __volatile("rdtsc; shrd %%cl, %%edx, %0"
: "=a" (rv) : "c" (th->th_x86_shift) : "edx");
return (rv);
@@ -112,7 +163,7 @@ static u_int
 __vdso_rdtsc32(void)
 {
 
-   lfence_mb();
+   rdtsc_mb();
return (rdtsc32());
 }
 
@@ -212,7 +263,7 @@ __vdso_hyperv_tsc(struct hyperv_reftsc *tsc_ref, u_int
scale = tsc_ref->tsc_scale;
ofs = tsc_ref->t

svn commit: r321616 - head

2017-07-27 Thread Ed Maste
Author: emaste
Date: Thu Jul 27 12:29:31 2017
New Revision: 321616
URL: https://svnweb.freebsd.org/changeset/base/321616

Log:
  genericize target exclusion for missing external toolchain
  
  Previously we excluded riscv from make universe / tinderbox if the
  required xtoolchain package was not installed. Make that logic generic
  so that we can loop over multiple architectures, in preparation to test
  patches to have other architectures rely on external toolchain.
  
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D11652

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Thu Jul 27 10:52:36 2017(r321615)
+++ head/Makefile   Thu Jul 27 12:29:31 2017(r321616)
@@ -441,14 +441,22 @@ TARGET_ARCHES_${target}?= ${target}
 
 MAKE_PARAMS_riscv?=CROSS_TOOLCHAIN=riscv64-gcc
 
-# XXX Remove riscv from universe if the required toolchain package is missing.
-.if !exists(/usr/local/share/toolchains/riscv64-gcc.mk) && ${TARGETS:Mriscv}
-_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Nriscv}
-universe: universe_riscv_skip .PHONY
-universe_epilogue: universe_riscv_skip .PHONY
-universe_riscv_skip: universe_prologue .PHONY
-   @echo ">> riscv skipped - install riscv64-xtoolchain-gcc port or 
package to build"
+# XXX Remove architectures only supported by external toolchain from universe
+# if required toolchain packages are missing.
+TOOLCHAINS_riscv=  riscv64
+.for target in riscv
+.if ${_UNIVERSE_TARGETS:M${target}}
+.for toolchain in ${TOOLCHAINS_${target}}
+.if !exists(/usr/local/share/toolchains/${toolchain}-gcc.mk)
+_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:N${target}}
+universe: universe_${toolchain}_skip .PHONY
+universe_epilogue: universe_${toolchain}_skip .PHONY
+universe_${toolchain}_skip: universe_prologue .PHONY
+   @echo ">> ${target} skipped - install ${toolchain}-xtoolchain-gcc port 
or package to build"
 .endif
+.endfor
+.endif
+.endfor
 
 .if defined(UNIVERSE_TARGET)
 MAKE_JUST_WORLDS=  YES
___
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: r321618 - in head: sys/conf sys/net sys/netinet sys/netinet6 usr.bin/netstat

2017-07-27 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Jul 27 13:03:36 2017
New Revision: 321618
URL: https://svnweb.freebsd.org/changeset/base/321618

Log:
  After inpcb route caching was put back in place there is no need for
  flowtable anymore (as flowtable was never considered to be useful in
  the forwarding path).
  
  Reviewed by:  np
  Differential Revision:https://reviews.freebsd.org/D11448

Deleted:
  head/sys/net/flowtable.c
  head/sys/net/flowtable.h
  head/usr.bin/netstat/flowtable.c
Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/net/route.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/ip6_output.c
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.h

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu Jul 27 12:37:18 2017(r321617)
+++ head/sys/conf/NOTES Thu Jul 27 13:03:36 2017(r321618)
@@ -646,9 +646,6 @@ options LIBMCHAIN
 # libalias library, performing NAT
 optionsLIBALIAS
 
-# flowtable cache
-optionsFLOWTABLE
-
 #
 # SCTP is a NEW transport protocol defined by
 # RFC2960 updated by RFC3309 and RFC3758.. and

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Thu Jul 27 12:37:18 2017(r321617)
+++ head/sys/conf/options   Thu Jul 27 13:03:36 2017(r321618)
@@ -454,8 +454,6 @@ TCP_RFC7413_MAX_KEYSopt_inet.h
 TCP_SIGNATURE  opt_ipsec.h
 VLAN_ARRAY opt_vlan.h
 XBONEHACK
-FLOWTABLE  opt_route.h
-FLOWTABLE_HASH_ALL opt_route.h
 
 #
 # SCTP

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Jul 27 12:37:18 2017(r321617)
+++ head/sys/net/route.cThu Jul 27 13:03:36 2017(r321618)
@@ -59,7 +59,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #ifdef RADIX_MPATH
 #include 
@@ -1504,79 +1503,12 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin
 }
 #endif
 
-#ifdef FLOWTABLE
-static struct rtentry *
-rt_flowtable_check_route(struct rib_head *rnh, struct rt_addrinfo *info)
-{
-#if defined(INET6) || defined(INET)
-   struct radix_node *rn;
-#endif
-   struct rtentry *rt0;
-
-   rt0 = NULL;
-   /* "flow-table" only supports IPv6 and IPv4 at the moment. */
-   switch (dst->sa_family) {
-#ifdef INET6
-   case AF_INET6:
-#endif
-#ifdef INET
-   case AF_INET:
-#endif
-#if defined(INET6) || defined(INET)
-   rn = rnh->rnh_matchaddr(dst, &rnh->head);
-   if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
-   struct sockaddr *mask;
-   u_char *m, *n;
-   int len;
-
-   /*
-* compare mask to see if the new route is
-* more specific than the existing one
-*/
-   rt0 = RNTORT(rn);
-   RT_LOCK(rt0);
-   RT_ADDREF(rt0);
-   RT_UNLOCK(rt0);
-   /*
-* A host route is already present, so
-* leave the flow-table entries as is.
-*/
-   if (rt0->rt_flags & RTF_HOST) {
-   RTFREE(rt0);
-   rt0 = NULL;
-   } else if (!(flags & RTF_HOST) && netmask) {
-   mask = rt_mask(rt0);
-   len = mask->sa_len;
-   m = (u_char *)mask;
-   n = (u_char *)netmask;
-   while (len-- > 0) {
-   if (*n != *m)
-   break;
-   n++;
-   m++;
-   }
-   if (len == 0 || (*n < *m)) {
-   RTFREE(rt0);
-   rt0 = NULL;
-   }
-   }
-   }
-#endif/* INET6 || INET */
-   }
-
-   return (rt0);
-}
-#endif
-
 int
 rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
u_int fibnum)
 {
int error = 0;
struct rtentry *rt, *rt_old;
-#ifdef FLOWTABLE
-   struct rtentry *rt0;
-#endif
struct radix_node *rn;
struct rib_head *rnh;
struct ifaddr *ifa;
@@ -1710,10 +1642,6 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru
}
 #endif
 
-#ifdef FLOWTABLE
-   rt0 = rt_flowtable_check_route(rnh, info);
-#endif /* FLOWTABLE */
-
/* XXX mtu manipulat

svn commit: r321619 - head/release/arm

2017-07-27 Thread Glen Barber
Author: gjb
Date: Thu Jul 27 13:37:21 2017
New Revision: 321619
URL: https://svnweb.freebsd.org/changeset/base/321619

Log:
  Bump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
  1G is no longer large enough.
  
  Reported by:  manu
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/arm/BANANAPI.conf
  head/release/arm/CUBIEBOARD2.conf

Modified: head/release/arm/BANANAPI.conf
==
--- head/release/arm/BANANAPI.conf  Thu Jul 27 13:03:36 2017
(r321618)
+++ head/release/arm/BANANAPI.conf  Thu Jul 27 13:37:21 2017
(r321619)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
 EMBEDDEDPORTS="sysutils/u-boot-bananapi"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="1536M"
 PART_SCHEME="MBR"
 FAT_SIZE="32m -b 1m"
 FAT_TYPE="16"

Modified: head/release/arm/CUBIEBOARD2.conf
==
--- head/release/arm/CUBIEBOARD2.conf   Thu Jul 27 13:03:36 2017
(r321618)
+++ head/release/arm/CUBIEBOARD2.conf   Thu Jul 27 13:37:21 2017
(r321619)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="1536M"
 PART_SCHEME="MBR"
 FAT_SIZE="32m -b 1m"
 FAT_TYPE="16"
___
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: r321620 - head/usr.bin/w

2017-07-27 Thread Alexander Motin
Author: mav
Date: Thu Jul 27 14:34:57 2017
New Revision: 321620
URL: https://svnweb.freebsd.org/changeset/base/321620

Log:
  Fix singular/plural "users" output.
  
  It was broken during libxo'fication.
  
  PR:   221039
  Submitted by: timur@
  MFC after:1 week

Modified:
  head/usr.bin/w/w.c

Modified: head/usr.bin/w/w.c
==
--- head/usr.bin/w/w.c  Thu Jul 27 13:37:21 2017(r321619)
+++ head/usr.bin/w/w.c  Thu Jul 27 14:34:57 2017(r321620)
@@ -511,7 +511,7 @@ pr_header(time_t *nowp, int nusers)
}
 
/* Print number of users logged in to system */
-   xo_emit(" {:users/%d} {N:user%s}", nusers, nusers == 1 ? "" : "s");
+   xo_emit(" {:users/%d} {Np:user,users}", nusers);
 
/*
 * Print 1, 5, and 15 minute load averages.
___
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: r321621 - head/sys/boot/efi/libefi

2017-07-27 Thread Andrew Turner
Author: andrew
Date: Thu Jul 27 15:06:34 2017
New Revision: 321621
URL: https://svnweb.freebsd.org/changeset/base/321621

Log:
  Always set the receive mask in loader.efi. Some UEFI implementations set
  this to be too restrictive. We need to have both broadcast and unicast
  enabled for loader to work. Set them in all cases to ensure this is true.
  
  This allows the Cavium ThunderX 2s in the netperf cluster to netboot using
  a USB NIC.
  
  PR:   221001
  Reviewed by:  emaste, tsoome
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D11732

Modified:
  head/sys/boot/efi/libefi/efinet.c

Modified: head/sys/boot/efi/libefi/efinet.c
==
--- head/sys/boot/efi/libefi/efinet.c   Thu Jul 27 14:34:57 2017
(r321620)
+++ head/sys/boot/efi/libefi/efinet.c   Thu Jul 27 15:06:34 2017
(r321621)
@@ -187,6 +187,7 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
EFI_SIMPLE_NETWORK *net;
EFI_HANDLE h;
EFI_STATUS status;
+   UINT32 mask;
 
if (nif->nif_driver->netif_ifs[nif->nif_unit].dif_unit < 0) {
printf("Invalid network interface %d\n", nif->nif_unit);
@@ -220,16 +221,14 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
}
}
 
-   if (net->Mode->ReceiveFilterSetting == 0) {
-   UINT32 mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
-   EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
+   mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
+   EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
 
-   status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL);
-   if (status != EFI_SUCCESS) {
-   printf("net%d: cannot set rx. filters (status=%lu)\n",
-   nif->nif_unit, EFI_ERROR_CODE(status));
-   return;
-   }
+   status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL);
+   if (status != EFI_SUCCESS) {
+   printf("net%d: cannot set rx. filters (status=%lu)\n",
+   nif->nif_unit, EFI_ERROR_CODE(status));
+   return;
}
 
 #ifdef EFINET_DEBUG
___
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: r321622 - head/sys/dev/isp

2017-07-27 Thread Kenneth D. Merry
Author: ken
Date: Thu Jul 27 15:33:57 2017
New Revision: 321622
URL: https://svnweb.freebsd.org/changeset/base/321622

Log:
  Fix probing FC targets with hard addressing turned on.
  
  This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.
  
  The intent of that change was to keep loop IDs persistent across
  chip reinits.
  
  The problem is that the change turned on the PREVLOOP /
  PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
  Qlogic chip to not participate in the loop if it can't get the
  requested loop address.  It also turned off soft addressing on 2400
  (4Gb) and newer controllers.
  
  The isp(4) driver defaults to loop address 0, and the tape drives
  I have tested default to loop address 0 if hard addressing is turned
  on.  So when hard loop addressing is turned on on the drive, the isp(4)
  driver just refuses to participate in the loop.
  
  The solution is to largely revert that change.  I left some elements
  in place that are related to virtual ports, since they were new.
  
  This does work with IBM tape drives with hard and soft addressing
  turned on.  I have tested it with 4Gb, 8Gb, and 16Gb controllers.
  
  sys/dev/isp.c:
Largely revert FreeBSD SVN change 289937.  I left the
ispmbox.h changes in place.
  
Don't use the PREV_ADDRESS bit on initialization.  It tells
the chip to not participate if it can't get the requested
loop ID.
  
Do use soft addressing on 2400 and newer chips.
  
Use hard addressing when the user has requested a specific
initiator ID.  (hint.isp.X.iid=N in /boot/loader.conf)
  
Leave some of the virtual port options from that change in
place, but don't turn on the PREV_ADDRESS bit.
  
  Reviewed by:  mav
  MFC after:3 days
  Sponsored by: Spectra Logic

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

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Thu Jul 27 15:06:34 2017(r321621)
+++ head/sys/dev/isp/isp.c  Thu Jul 27 15:33:57 2017(r321622)
@@ -1631,6 +1631,7 @@ isp_fibre_init(ispsoftc_t *isp)
fcparam *fcp;
isp_icb_t local, *icbp = &local;
mbreg_t mbs;
+   int ownloopid;
 
/*
 * We only support one channel on non-24XX cards
@@ -1709,15 +1710,22 @@ isp_fibre_init(ispsoftc_t *isp)
}
icbp->icb_retry_delay = fcp->isp_retry_delay;
icbp->icb_retry_count = fcp->isp_retry_count;
-   if (fcp->isp_loopid < LOCAL_LOOP_LIM) {
-   icbp->icb_hardaddr = fcp->isp_loopid;
-   if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
-   icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS;
-   else
-   icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS;
+   icbp->icb_hardaddr = fcp->isp_loopid;
+   ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0;
+   if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) {
+   icbp->icb_hardaddr = 0;
+   ownloopid = 0;
}
 
/*
+* Our life seems so much better with 2200s and later with
+* the latest f/w if we set Hard Address.
+*/
+   if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) {
+   icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS;
+   }
+
+   /*
 * Right now we just set extended options to prefer point-to-point
 * over loop based upon some soft config options.
 *
@@ -1951,6 +1959,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
isp_icb_2400_t local, *icbp = &local;
mbreg_t mbs;
int chan;
+   int ownloopid = 0;
 
/*
 * Check to see whether all channels have *some* kind of role
@@ -2023,14 +2032,18 @@ isp_fibre_init_2400(ispsoftc_t *isp)
icbp->icb_xchgcnt >>= 1;
}
 
-   if (fcp->isp_loopid < LOCAL_LOOP_LIM) {
-   icbp->icb_hardaddr = fcp->isp_loopid;
-   if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
-   icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS;
-   else
-   icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS;
+
+   ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0;
+   icbp->icb_hardaddr = fcp->isp_loopid;
+   if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) {
+   icbp->icb_hardaddr = 0;
+   ownloopid = 0;
}
 
+   if (ownloopid)
+   icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS;
+
+   icbp->icb_fwoptions2 = fcp->isp_xfwoptions;
if (isp->isp_confopts & ISP_CFG_NOFCTAPE) {
icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE;
}
@@ -2093,6 +2106,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHA;
}
 
+   icbp->icb_fwoptions3 = fcp->isp_zfwoptions;
if ((icbp->icb_fwoptions3 & ICB2400_OPT

svn commit: r321623 - head/sys/dev/isp

2017-07-27 Thread Kenneth D. Merry
Author: ken
Date: Thu Jul 27 15:51:56 2017
New Revision: 321623
URL: https://svnweb.freebsd.org/changeset/base/321623

Log:
  Remove duplicate assignments from r321622.
  
  Submitted by: mav
  MFC after:3 days
  Sponsored by: Spectra Logic

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

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Thu Jul 27 15:33:57 2017(r321622)
+++ head/sys/dev/isp/isp.c  Thu Jul 27 15:51:56 2017(r321623)
@@ -2043,7 +2043,6 @@ isp_fibre_init_2400(ispsoftc_t *isp)
if (ownloopid)
icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS;
 
-   icbp->icb_fwoptions2 = fcp->isp_xfwoptions;
if (isp->isp_confopts & ISP_CFG_NOFCTAPE) {
icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE;
}
@@ -2106,7 +2105,6 @@ isp_fibre_init_2400(ispsoftc_t *isp)
icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHA;
}
 
-   icbp->icb_fwoptions3 = fcp->isp_zfwoptions;
if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) {
icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24;
}
___
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: r321625 - in head/sys: kern sys

2017-07-27 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 27 16:40:14 2017
New Revision: 321625
URL: https://svnweb.freebsd.org/changeset/base/321625

Log:
  Make the number of children for pctrie node available outside subr_pctrie.c.
  
  Reviewed by:  alc, markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  X-Differential revision:  https://reviews.freebsd.org/D11435

Modified:
  head/sys/kern/subr_pctrie.c
  head/sys/sys/pctrie.h

Modified: head/sys/kern/subr_pctrie.c
==
--- head/sys/kern/subr_pctrie.c Thu Jul 27 15:59:36 2017(r321624)
+++ head/sys/kern/subr_pctrie.c Thu Jul 27 16:40:14 2017(r321625)
@@ -58,18 +58,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-/*
- * These widths should allow the pointers to a node's children to fit within
- * a single cache line.  The extra levels from a narrow width should not be
- * a problem thanks to path compression.
- */
-#ifdef __LP64__
-#definePCTRIE_WIDTH4
-#else
-#definePCTRIE_WIDTH3
-#endif
-
-#definePCTRIE_COUNT(1 << PCTRIE_WIDTH)
 #definePCTRIE_MASK (PCTRIE_COUNT - 1)
 #definePCTRIE_LIMIT(howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) 
- 1)
 

Modified: head/sys/sys/pctrie.h
==
--- head/sys/sys/pctrie.h   Thu Jul 27 15:59:36 2017(r321624)
+++ head/sys/sys/pctrie.h   Thu Jul 27 16:40:14 2017(r321625)
@@ -133,5 +133,18 @@ pctrie_is_empty(struct pctrie *ptree)
return (ptree->pt_root == 0);
 }
 
+/*
+ * These widths should allow the pointers to a node's children to fit within
+ * a single cache line.  The extra levels from a narrow width should not be
+ * a problem thanks to path compression.
+ */
+#ifdef __LP64__
+#definePCTRIE_WIDTH4
+#else
+#definePCTRIE_WIDTH3
+#endif
+
+#definePCTRIE_COUNT(1 << PCTRIE_WIDTH)
+
 #endif /* _KERNEL */
 #endif /* !_SYS_PCTRIE_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: r321626 - head/sys/arm/allwinner/clkng

2017-07-27 Thread Emmanuel Vadot
Author: manu
Date: Thu Jul 27 17:51:51 2017
New Revision: 321626
URL: https://svnweb.freebsd.org/changeset/base/321626

Log:
  Allwinner A64: fix typo
  
  'pll_ddr0' is the dram parent, not 'pll_ddr'

Modified:
  head/sys/arm/allwinner/clkng/ccu_a64.c

Modified: head/sys/arm/allwinner/clkng/ccu_a64.c
==
--- head/sys/arm/allwinner/clkng/ccu_a64.c  Thu Jul 27 16:40:14 2017
(r321625)
+++ head/sys/arm/allwinner/clkng/ccu_a64.c  Thu Jul 27 17:51:51 2017
(r321626)
@@ -712,7 +712,7 @@ static struct clk_fixed_def *fixed_factor_clks[] = {
 static struct aw_clk_init init_clks[] = {
{"ahb1", "pll_periph0", 0, false},
{"ahb2", "pll_periph0", 0, false},
-   {"dram", "pll_ddr", 0, false},
+   {"dram", "pll_ddr0", 0, false},
 };
 
 void
___
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: r321627 - head/sys/kern

2017-07-27 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 27 20:45:41 2017
New Revision: 321627
URL: https://svnweb.freebsd.org/changeset/base/321627

Log:
  Make it possible to request nosys logging to console.
  
  New kern.lognosys values are
  1 - log to ctty
  2 - log to console
  3 - log to both.
  
  Inspired by:  eugen
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cThu Jul 27 17:51:51 2017(r321626)
+++ head/sys/kern/kern_sig.cThu Jul 27 20:45:41 2017(r321627)
@@ -3579,9 +3579,14 @@ nosys(struct thread *td, struct nosys_args *args)
PROC_LOCK(p);
tdsignal(td, SIGSYS);
PROC_UNLOCK(p);
-   if (kern_lognosys)
+   if (kern_lognosys == 1 || kern_lognosys == 3) {
uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
td->td_sa.code);
+   }
+   if (kern_lognosys == 2 || kern_lognosys == 3) {
+   printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
+   td->td_sa.code);
+   }
return (ENOSYS);
 }
 
___
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: r321628 - in head/sys/fs: nfs nfsclient

2017-07-27 Thread Rick Macklem
Author: rmacklem
Date: Thu Jul 27 20:55:31 2017
New Revision: 321628
URL: https://svnweb.freebsd.org/changeset/base/321628

Log:
  Replace the checks for MNTK_UNMOUNTF with a macro that does the same thing.
  
  This patch defines a macro that checks for MNTK_UNMOUNTF and replaces
  explicit checks with this macro. It has no effect on semantics, but
  prepares the code for a future patch where there will also be a
  NFS specific flag for "forced dismount about to occur".
  
  Suggested by: kib
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfscl.h
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==
--- head/sys/fs/nfs/nfs_commonkrpc.cThu Jul 27 20:45:41 2017
(r321627)
+++ head/sys/fs/nfs/nfs_commonkrpc.cThu Jul 27 20:55:31 2017
(r321628)
@@ -511,7 +511,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmo
if (xidp != NULL)
*xidp = 0;
/* Reject requests while attempting a forced unmount. */
-   if (nmp != NULL && (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)) {
+   if (nmp != NULL && NFSCL_FORCEDISM(nmp->nm_mountp)) {
m_freem(nd->nd_mreq);
return (ESTALE);
}
@@ -1231,7 +1231,7 @@ newnfs_sigintr(struct nfsmount *nmp, struct thread *td
sigset_t tmpset;

/* Terminate all requests while attempting a forced unmount. */
-   if (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)
+   if (NFSCL_FORCEDISM(nmp->nm_mountp))
return (EIO);
if (!(nmp->nm_flag & NFSMNT_INT))
return (0);

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cThu Jul 27 20:45:41 2017
(r321627)
+++ head/sys/fs/nfs/nfs_commonsubs.cThu Jul 27 20:55:31 2017
(r321628)
@@ -1839,7 +1839,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i
lp->nfslock_lock |= NFSV4LOCK_LOCKWANTED;
}
while (lp->nfslock_lock & (NFSV4LOCK_LOCK | NFSV4LOCK_LOCKWANTED)) {
-   if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+   if (mp != NULL && NFSCL_FORCEDISM(mp)) {
lp->nfslock_lock &= ~NFSV4LOCK_LOCKWANTED;
return (0);
}
@@ -1893,7 +1893,7 @@ nfsv4_relref(struct nfsv4lock *lp)
  * not wait for threads that want the exclusive lock. If priority needs
  * to be given to threads that need the exclusive lock, a call to nfsv4_lock()
  * with the 2nd argument == 0 should be done before calling nfsv4_getref().
- * If the mp argument is not NULL, check for MNTK_UNMOUNTF being set and
+ * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and
  * return without getting a refcnt for that case.
  */
 APPLESTATIC void
@@ -1908,7 +1908,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void 
 * Wait for a lock held.
 */
while (lp->nfslock_lock & NFSV4LOCK_LOCK) {
-   if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0)
+   if (mp != NULL && NFSCL_FORCEDISM(mp))
return;
lp->nfslock_lock |= NFSV4LOCK_WANTED;
if (isleptp)
@@ -1916,7 +1916,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void 
(void) nfsmsleep(&lp->nfslock_lock, mutex,
PZERO - 1, "nfsv4gr", NULL);
}
-   if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0)
+   if (mp != NULL && NFSCL_FORCEDISM(mp))
return;
 
lp->nfslock_usecnt++;
@@ -4197,9 +4197,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc
 * This RPC attempt will fail when it calls
 * newnfs_request().
 */
-   if (nmp != NULL &&
-   (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)
-   != 0) {
+   if (nmp != NULL && NFSCL_FORCEDISM(nmp->nm_mountp)) {
mtx_unlock(&sep->nfsess_mtx);
return (ESTALE);
}

Modified: head/sys/fs/nfs/nfscl.h
==
--- head/sys/fs/nfs/nfscl.h Thu Jul 27 20:45:41 2017(r321627)
+++ head/sys/fs/nfs/nfscl.h Thu Jul 27 20:55:31 2017(r321628)
@@ -59,6 +59,9 @@ struct nfsv4node {
 #defineNFSCL_RENEW(l)  (((l) < 2) ? 1 : ((l) / 2))
 #defineNFSCL_LEASE(r)  ((r) * 2)
 
+/* This macro checks to see if a forc

svn commit: r321629 - in head/sys: dev/bnxt net

2017-07-27 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 27 21:21:43 2017
New Revision: 321629
URL: https://svnweb.freebsd.org/changeset/base/321629

Log:
  Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
  were redundant and not being used to set anything up.
  
  Submitted by: Matt Macy 
  Reported by:  Jeb Cramer 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/net/iflib.h

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Thu Jul 27 20:55:31 2017(r321628)
+++ head/sys/dev/bnxt/if_bnxt.c Thu Jul 27 21:21:43 2017(r321629)
@@ -761,12 +761,12 @@ bnxt_attach_pre(if_ctx_t ctx)
scctx->isc_nrxd[1];
scctx->isc_rxqsizes[2] = sizeof(struct rx_prod_pkt_bd) *
scctx->isc_nrxd[2];
-   scctx->isc_max_rxqsets = min(pci_msix_count(softc->dev)-1,
+   scctx->isc_nrxqsets_max = min(pci_msix_count(softc->dev)-1,
softc->func.max_cp_rings - 1);
-   scctx->isc_max_rxqsets = min(scctx->isc_max_rxqsets,
+   scctx->isc_nrxqsets_max = min(scctx->isc_nrxqsets_max,
softc->func.max_rx_rings);
-   scctx->isc_max_txqsets = min(softc->func.max_rx_rings,
-   softc->func.max_cp_rings - scctx->isc_max_rxqsets - 1);
+   scctx->isc_ntxqsets_max = min(softc->func.max_rx_rings,
+   softc->func.max_cp_rings - scctx->isc_nrxqsets_max - 1);
scctx->isc_rss_table_size = HW_HASH_INDEX_SIZE;
scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1;
 

Modified: head/sys/net/iflib.h
==
--- head/sys/net/iflib.hThu Jul 27 20:55:31 2017(r321628)
+++ head/sys/net/iflib.hThu Jul 27 21:21:43 2017(r321629)
@@ -200,8 +200,6 @@ typedef struct if_softc_ctx {
uint8_t isc_txd_size[8];
uint8_t isc_rxd_size[8];
 
-   int isc_max_txqsets;
-   int isc_max_rxqsets;
int isc_tx_tso_segments_max;
int isc_tx_tso_size_max;
int isc_tx_tso_segsize_max;
___
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: r321630 - head/sys/net

2017-07-27 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 27 22:53:47 2017
New Revision: 321630
URL: https://svnweb.freebsd.org/changeset/base/321630

Log:
  Slight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
  when m_collapse() fails.
  
  Submitted by: krzystof.gala...@intel.com
  Reviewed by:  Jeb Cramer 
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D11476

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Jul 27 21:21:43 2017(r321629)
+++ head/sys/net/iflib.cThu Jul 27 22:53:47 2017(r321630)
@@ -2975,6 +2975,8 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
 #endif
ifsd_m[next] = m;
while (buflen > 0) {
+   if (i >= max_segs)
+   goto err;
max_sgsize = MIN(buflen, maxsegsz);
curaddr = pmap_kextract(vaddr);
sgsize = PAGE_SIZE - (curaddr & PAGE_MASK);
@@ -2984,8 +2986,6 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
vaddr += sgsize;
buflen -= sgsize;
i++;
-   if (i >= max_segs)
-   goto err;
}
count++;
tmp = m;
___
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: r321631 - head/sys/dev/ixl

2017-07-27 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 27 23:01:07 2017
New Revision: 321631
URL: https://svnweb.freebsd.org/changeset/base/321631

Log:
  Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
  queue lock when the uppoer stack is called inside TCP_LRO
  
  Submitted by: Kevin Bowling 
  Reviewed by:  erj
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D11724

Modified:
  head/sys/dev/ixl/ixl_txrx.c

Modified: head/sys/dev/ixl/ixl_txrx.c
==
--- head/sys/dev/ixl/ixl_txrx.c Thu Jul 27 22:53:47 2017(r321630)
+++ head/sys/dev/ixl/ixl_txrx.c Thu Jul 27 23:01:07 2017(r321631)
@@ -1400,9 +1400,7 @@ ixl_rx_input(struct rx_ring *rxr, struct ifnet *ifp, s
 return;
 }
 #endif
-   IXL_RX_UNLOCK(rxr);
 (*ifp->if_input)(ifp, m);
-   IXL_RX_LOCK(rxr);
 }
 
 
@@ -1730,7 +1728,9 @@ next_desc:
/* Now send to the stack or do LRO */
if (sendmp != NULL) {
rxr->next_check = i;
+   IXL_RX_UNLOCK(rxr);
ixl_rx_input(rxr, ifp, sendmp, ptype);
+   IXL_RX_LOCK(rxr);
i = rxr->next_check;
}
 
@@ -1747,6 +1747,8 @@ next_desc:
 
rxr->next_check = i;
 
+   IXL_RX_UNLOCK(rxr);
+
 #if defined(INET6) || defined(INET)
/*
 * Flush any outstanding LRO work
@@ -1762,7 +1764,6 @@ next_desc:
 #endif
 #endif /* defined(INET6) || defined(INET) */
 
-   IXL_RX_UNLOCK(rxr);
return (FALSE);
 }
 
___
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: r321633 - in head/sys/arm: arm include

2017-07-27 Thread Zbigniew Bodek
Author: zbb
Date: Thu Jul 27 23:14:17 2017
New Revision: 321633
URL: https://svnweb.freebsd.org/changeset/base/321633

Log:
  Fix TEX index acquisition using L2 attributes
  
  The TEX index is selected using (TEX0 C B) bits
  from the L2 descriptor. Use correct index by masking
  and shifting those bits accordingly.
  
  Differential Revision:https://reviews.freebsd.org/D11703

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/include/pte-v6.h

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Thu Jul 27 23:09:12 2017(r321632)
+++ head/sys/arm/arm/pmap-v6.c  Thu Jul 27 23:14:17 2017(r321633)
@@ -525,8 +525,8 @@ pmap_remap_vm_attr(vm_memattr_t old_attr, vm_memattr_t
int old_idx, new_idx;
 
/* Map VM memattrs to indexes to tex_class table. */
-   old_idx = pte2_attr_tab[(int)old_attr];
-   new_idx = pte2_attr_tab[(int)new_attr];
+   old_idx = PTE2_ATTR2IDX(pte2_attr_tab[(int)old_attr]);
+   new_idx = PTE2_ATTR2IDX(pte2_attr_tab[(int)new_attr]);
 
/* Replace TEX attribute and apply it. */
tex_class[old_idx] = tex_class[new_idx];

Modified: head/sys/arm/include/pte-v6.h
==
--- head/sys/arm/include/pte-v6.h   Thu Jul 27 23:09:12 2017
(r321632)
+++ head/sys/arm/include/pte-v6.h   Thu Jul 27 23:14:17 2017
(r321633)
@@ -149,10 +149,12 @@
 #defineL2_NX   0x0001  /* Not executable */
 #defineL2_B0x0004  /* Bufferable page */
 #defineL2_C0x0008  /* Cacheable page */
+#defineL2_CB_SHIFT 2   /* C,B bit field shift */
 #defineL2_AP(x)((x) << 4)
 #defineL2_AP0  0x0010  /* access permissions bit 0*/
 #defineL2_AP1  0x0020  /* access permissions bit 1*/
-#defineL2_TEX(x)   ((x) << 6)  /* type extension */
+#defineL2_TEX_SHIFT6   /* type extension field shift */
+#defineL2_TEX(x)   ((x) << L2_TEX_SHIFT)   /* type extension */
 #defineL2_TEX0 0x0040  /* type extension bit 0 */
 #defineL2_TEX1 0x0080  /* type extension bit 1 */
 #defineL2_TEX2 0x0100  /* type extension bit 2 */
@@ -271,6 +273,10 @@
 #definePTE2_FRAME  L2_S_FRAME
 
 #definePTE2_ATTR_MASK  (L2_TEX0 | L2_C | L2_B)
+/* PTE2 attributes to TEX class index: (TEX0 C B)  */
+#definePTE2_ATTR2IDX(attr) \
+attr) & (L2_C | L2_B)) >> L2_CB_SHIFT) |   \
+(((attr) & L2_TEX0) >> (L2_TEX_SHIFT - L2_CB_SHIFT)))
 
 #definePTE2_AP_KR  (PTE2_RO | PTE2_NM)
 #definePTE2_AP_KRW 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: r321635 - head/sys/mips/conf

2017-07-27 Thread Adrian Chadd
Author: adrian
Date: Fri Jul 28 01:17:38 2017
New Revision: 321635
URL: https://svnweb.freebsd.org/changeset/base/321635

Log:
  [ar71xx] get rid of ath_pci - it's built as a module now.

Modified:
  head/sys/mips/conf/TL-WDR4300

Modified: head/sys/mips/conf/TL-WDR4300
==
--- head/sys/mips/conf/TL-WDR4300   Thu Jul 27 23:15:24 2017
(r321634)
+++ head/sys/mips/conf/TL-WDR4300   Fri Jul 28 01:17:38 2017
(r321635)
@@ -45,8 +45,7 @@ options   GEOM_UZIP
 # Used for the static uboot partition map
 device  geom_map
 
-# yes, this board has a PCI connected atheros device
-device ath_pci
+# Yes, this board has a PCI connected atheros device
 optionsAR71XX_ATH_EEPROM
 device firmware# Used by the above
 optionsATH_EEPROM_FIRMWARE
___
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: r321637 - head/tools/tools/nanobsd

2017-07-27 Thread Warner Losh
Author: imp
Date: Fri Jul 28 01:59:58 2017
New Revision: 321637
URL: https://svnweb.freebsd.org/changeset/base/321637

Log:
  Ensure that ordinary files that happen to start with .git, .hg and
  .cvs into the image.
  
  This makes .gitignore files in the working tree appear in the final
  tree...
  
  PR: 192178
  Submitted by: Jason Unovitch
  Sponsored by: Netflix
  MFC After: 3 days

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shFri Jul 28 01:59:53 2017
(r321636)
+++ head/tools/tools/nanobsd/defaults.shFri Jul 28 01:59:58 2017
(r321637)
@@ -634,7 +634,7 @@ populate_slice ( ) (
if [ -n "${dir}" -a -d "${dir}" ]; then
echo "Populating ${lbl} from ${dir}"
cd "${dir}"
-   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio 
-dumpv ${mnt}
+   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio 
-dumpv ${mnt}
fi
df -i ${mnt}
nano_umount ${mnt}
@@ -742,7 +742,7 @@ cust_allow_ssh_root ( ) (
 
 cust_install_files ( ) (
cd "${NANO_TOOLS}/Files"
-   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv 
${NANO_WORLDDIR}
+   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio -Ldumpv 
${NANO_WORLDDIR}
 
if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; 
then
CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
___
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: r321638 - head/tools/tools/nanobsd

2017-07-27 Thread Warner Losh
Author: imp
Date: Fri Jul 28 02:00:03 2017
New Revision: 321638
URL: https://svnweb.freebsd.org/changeset/base/321638

Log:
  Allow _.disk.image to be specified.
  
  Submitted by: ask at develooper dot com (reworked to new structure)
  PR: 199191
  Sponsored by: Netflix
  MFC After: 3 days

Modified:
  head/tools/tools/nanobsd/defaults.sh
  head/tools/tools/nanobsd/legacy.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shFri Jul 28 01:59:58 2017
(r321637)
+++ head/tools/tools/nanobsd/defaults.shFri Jul 28 02:00:03 2017
(r321638)
@@ -71,6 +71,7 @@ NANO_PMAKE="make -j 3"
 
 # The default name for any image we create.
 NANO_IMGNAME="_.disk.full"
+NANO_IMG1NAME="_.disk.image"
 
 # Options to put in make.conf during buildworld only
 CONF_BUILD=' '
@@ -652,7 +653,7 @@ last_orders ( ) (
# Redefine this function with any last orders you may have
# after the build completed, for instance to copy the finished
# image to a more convenient place:
-   # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk
+   # cp ${NANO_DISKIMGDIR}/${NANO_IMG1NAME} /home/ftp/pub/nanobsd.disk
true
 )
 
@@ -919,6 +920,7 @@ set_defaults_and_export ( ) {
export_var NANO_HEADS
export_var NANO_IMAGES
export_var NANO_IMGNAME
+   export_var NANO_IMG1NAME
export_var NANO_MAKE
export_var NANO_MAKE_CONF_BUILD
export_var NANO_MAKE_CONF_INSTALL

Modified: head/tools/tools/nanobsd/legacy.sh
==
--- head/tools/tools/nanobsd/legacy.sh  Fri Jul 28 01:59:58 2017
(r321637)
+++ head/tools/tools/nanobsd/legacy.sh  Fri Jul 28 02:00:03 2017
(r321638)
@@ -191,8 +191,9 @@ create_diskimage ( ) (
fi
 
if ${do_copyout_partition} ; then
-   echo "Writing out _.disk.image..."
-   dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} 
of=${NANO_DISKIMGDIR}/_.disk.image bs=64k
+   echo "Writing out ${NANO_IMG1NAME}..."
+   dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} \
+  of=${NANO_DISKIMGDIR}/${NANO_IMG1NAME} bs=64k
fi
mdconfig -d -u $MD
 
___
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: r321636 - head/tools/tools/nanobsd

2017-07-27 Thread Warner Losh
Author: imp
Date: Fri Jul 28 01:59:53 2017
New Revision: 321636
URL: https://svnweb.freebsd.org/changeset/base/321636

Log:
  Properly expand shell glob characters in NANO_PACKAGE_LIST.
  
  The defualt NANO_PACKAGE_LIST is *, which fails to work
  properly. Expand glob characters and make sure that we install the
  special pkg package first.
  
  Sponsored by: Netflix
  Submitted by: wout at canodus dot be
  PR: 219405
  MFC After: 3 days

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shFri Jul 28 01:17:38 2017
(r321635)
+++ head/tools/tools/nanobsd/defaults.shFri Jul 28 01:59:53 2017
(r321636)
@@ -780,7 +780,6 @@ cust_pkgng ( ) (
echo "FAILED: need a pkg/ package for bootstrapping"
exit 2
fi
-   NANO_PACKAGE_LIST="${_NANO_PKG_PACKAGE} ${NANO_PACKAGE_LIST}"
 
# Mount packages into chroot
mkdir -p ${NANO_WORLDDIR}/_.p
@@ -788,14 +787,25 @@ cust_pkgng ( ) (
 
trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 
EXIT
 
-   # Install packages
-   todo="$(echo "${NANO_PACKAGE_LIST}" | awk '{ print NF }')"
-   echo "=== TODO: $todo"
-   echo "${NANO_PACKAGE_LIST}"
-   echo "==="
-   for _PKG in ${NANO_PACKAGE_LIST}; do
-   CR "${PKGCMD} add /_.p/${_PKG}"
-   done
+   # Install pkg-* package
+   CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}"
+
+   (
+   # Expand any glob characters in pacakge list
+   cd "${NANO_PACKAGE_DIR}"
+   _PKGS=`find ${NANO_PACKAGE_LIST} -not -name 
"${_NANO_PKG_PACKAGE}" -print | sort | uniq`
+
+   # Show todo
+   todo=`echo "$_PKGS" | wc -l`
+   echo "=== TODO: $todo"
+   echo "$_PKGS"
+   echo "==="
+
+   # Install packages
+   for _PKG in $_PKGS; do
+   CR "${PKGCMD} add /_.p/${_PKG}"
+   done
+   )
 
CR0 "${PKGCMD} info"
 
___
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: r321639 - head/sys/dev/ksyms

2017-07-27 Thread Mark Johnston
Author: markj
Date: Fri Jul 28 03:14:31 2017
New Revision: 321639
URL: https://svnweb.freebsd.org/changeset/base/321639

Log:
  Restrict permissions on /dev/ksyms to 0400.
  
  The ksyms(4) device was added specifically for use by lockstat(1), which
  as a DTrace consumer must run as root.
  
  Discussed with:   emaste
  MFC after:3 days

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

Modified: head/sys/dev/ksyms/ksyms.c
==
--- head/sys/dev/ksyms/ksyms.c  Fri Jul 28 02:00:03 2017(r321638)
+++ head/sys/dev/ksyms/ksyms.c  Fri Jul 28 03:14:31 2017(r321639)
@@ -592,7 +592,7 @@ ksyms_modevent(module_t mod __unused, int type, void *
case MOD_LOAD:
mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF);
ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL,
-   0444, KSYMS_DNAME);
+   0400, KSYMS_DNAME);
break;
 
case MOD_UNLOAD:
___
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: r321640 - head/sys/dev/ksyms

2017-07-27 Thread Mark Johnston
Author: markj
Date: Fri Jul 28 03:18:18 2017
New Revision: 321640
URL: https://svnweb.freebsd.org/changeset/base/321640

Log:
  Fix style bugs in ksyms.c.
  
  No functional change intended.
  
  MFC after:3 days

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

Modified: head/sys/dev/ksyms/ksyms.c
==
--- head/sys/dev/ksyms/ksyms.c  Fri Jul 28 03:14:31 2017(r321639)
+++ head/sys/dev/ksyms/ksyms.c  Fri Jul 28 03:18:18 2017(r321640)
@@ -62,41 +62,40 @@
 
 #define STR_SYMTAB ".symtab"
 #define STR_STRTAB ".strtab"
-#define STR_SHSTRTAB   ".shstrtab" 
+#define STR_SHSTRTAB   ".shstrtab"
 
 #define KSYMS_DNAME"ksyms"
 
-static d_open_tksyms_open;
-static d_read_tksyms_read;
-static d_close_t   ksyms_close;
-static d_ioctl_t   ksyms_ioctl;
-static d_mmap_tksyms_mmap;
+static d_open_t ksyms_open;
+static d_read_t ksyms_read;
+static d_close_t ksyms_close;
+static d_ioctl_t ksyms_ioctl;
+static d_mmap_t ksyms_mmap;
 
 static struct cdevsw ksyms_cdevsw = {
-.d_version =   D_VERSION,
-.d_flags   =   D_TRACKCLOSE,
-.d_open=   ksyms_open,
-.d_close   =   ksyms_close,
-.d_read=   ksyms_read,
-.d_ioctl   =   ksyms_ioctl,
-.d_mmap=   ksyms_mmap,
-.d_name=   KSYMS_DNAME 
+   .d_version =D_VERSION,
+   .d_flags =  D_TRACKCLOSE,
+   .d_open =   ksyms_open,
+   .d_close =  ksyms_close,
+   .d_read =   ksyms_read,
+   .d_ioctl =  ksyms_ioctl,
+   .d_mmap =   ksyms_mmap,
+   .d_name =   KSYMS_DNAME
 };
 
 struct ksyms_softc {
LIST_ENTRY(ksyms_softc) sc_list;
-   vm_offset_t sc_uaddr;
-   size_t  sc_usize;
+   vm_offset_t sc_uaddr;
+   size_t  sc_usize;
pmap_t  sc_pmap;
struct proc*sc_proc;
 };
 
-static struct mtx   ksyms_mtx;
-static struct cdev *ksyms_dev;
-static LIST_HEAD(, ksyms_softc) ksyms_list = 
-   LIST_HEAD_INITIALIZER(ksyms_list);
+static struct mtx   ksyms_mtx;
+static struct cdev *ksyms_dev;
+static LIST_HEAD(, ksyms_softc) ksyms_list = 
LIST_HEAD_INITIALIZER(ksyms_list);
 
-static const char  ksyms_shstrtab[] = 
+static const char  ksyms_shstrtab[] =
"\0" STR_SYMTAB "\0" STR_STRTAB "\0" STR_SHSTRTAB "\0";
 
 struct ksyms_hdr {
@@ -106,7 +105,7 @@ struct ksyms_hdr {
Elf_Shdrkh_shdr[SHDR_NUM];
charkh_shstrtab[sizeof(ksyms_shstrtab)];
 };
-   
+
 struct tsizes {
size_t  ts_symsz;
size_t  ts_strsz;
@@ -123,7 +122,7 @@ static MALLOC_DEFINE(M_KSYMS, "KSYMS", "Kernel Symbol 
 
 /*
  * Get the symbol and string table sizes for a kernel module. Add it to the
- * running total. 
+ * running total.
  */
 static int
 ksyms_size_permod(linker_file_t lf, void *arg)
@@ -132,35 +131,36 @@ ksyms_size_permod(linker_file_t lf, void *arg)
const Elf_Sym *symtab;
caddr_t strtab;
long syms;
-   
+
ts = arg;
-
+
syms = LINKER_SYMTAB_GET(lf, &symtab);
ts->ts_symsz += syms * sizeof(Elf_Sym);
ts->ts_strsz += LINKER_STRTAB_GET(lf, &strtab);
-   
+
return (0);
 }
 
 /*
  * For kernel module get the symbol and string table sizes, returning the
- * totals in *ts. 
+ * totals in *ts.
  */
-static void 
+static void
 ksyms_size_calc(struct tsizes *ts)
 {
+
ts->ts_symsz = 0;
ts->ts_strsz = 0;
-
-   (void) linker_file_foreach(ksyms_size_permod, ts);
+
+   (void)linker_file_foreach(ksyms_size_permod, ts);
 }
 
-#define KSYMS_EMIT(src, des, sz) do {  \
-   copyout(src, (void *)des, sz);  \
-   des += sz;  \
-   } while (0)
+#define KSYMS_EMIT(src, des, sz) do {  \
+   copyout(src, (void *)des, sz);  \
+   des += sz;  \
+} while (0)
 
-#define SYMBLKSZ   256 * sizeof (Elf_Sym)
+#define SYMBLKSZ   (256 * sizeof(Elf_Sym))
 
 /*
  * For a kernel module, add the symbol and string tables into the
@@ -169,6 +169,7 @@ ksyms_size_calc(struct tsizes *ts)
 static int
 ksyms_add(linker_file_t lf, void *arg)
 {
+   char *buf;
struct toffsets *to;
const Elf_Sym *symtab;
Elf_Sym *symp;
@@ -176,43 +177,42 @@ ksyms_add(linker_file_t lf, void *arg)
long symsz;
size_t strsz, numsyms;
linker_symval_t symval;
-   char *buf;
int i, nsyms, len;
-   
+
to = arg;
-
+
MOD_SLOCK;
numsyms =  LINKER_SYMTAB_GET(lf, &symtab);
strsz = LINKER_STRTAB_GET(lf, &strtab);
symsz = numsyms * sizeof(Elf_Sym);
-   
+
buf = malloc(SYM

svn commit: r321649 - head/sys/net

2017-07-27 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Jul 28 04:41:57 2017
New Revision: 321649
URL: https://svnweb.freebsd.org/changeset/base/321649

Log:
  Remove the unused mutex since r273220.
  
  MFC after:1 week
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/sys/net/if_stf.c

Modified: head/sys/net/if_stf.c
==
--- head/sys/net/if_stf.c   Fri Jul 28 03:33:09 2017(r321648)
+++ head/sys/net/if_stf.c   Fri Jul 28 04:41:57 2017(r321649)
@@ -139,7 +139,6 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CT
 
 struct stf_softc {
struct ifnet*sc_ifp;
-   struct mtx  sc_ro_mtx;
u_int   sc_fibnum;
const struct encaptab *encap_cookie;
 };
@@ -147,10 +146,6 @@ struct stf_softc {
 
 static const char stfname[] = "stf";
 
-/*
- * Note that mutable fields in the softc are not currently locked.
- * We do lock sc_ro in stf_output though.
- */
 static MALLOC_DEFINE(M_STF, stfname, "6to4 Tunnel Interface");
 static const int ip_stf_ttl = 40;
 
@@ -253,7 +248,6 @@ stf_clone_create(struct if_clone *ifc, char *name, siz
ifp->if_dname = stfname;
ifp->if_dunit = IF_DUNIT_NONE;
 
-   mtx_init(&(sc)->sc_ro_mtx, "stf ro", NULL, MTX_DEF);
sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6,
stf_encapcheck, &in_stf_protosw, sc);
if (sc->encap_cookie == NULL) {
@@ -280,7 +274,6 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet *
 
err = encap_detach(sc->encap_cookie);
KASSERT(err == 0, ("Unexpected error detaching encap_cookie"));
-   mtx_destroy(&(sc)->sc_ro_mtx);
bpfdetach(ifp);
if_detach(ifp);
if_free(ifp);
___
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"