svn commit: r304657 - in stable/11: contrib/llvm/lib/Target/ARM/MCTargetDesc lib/clang

2016-08-22 Thread Dimitry Andric
Author: dim
Date: Tue Aug 23 05:22:03 2016
New Revision: 304657
URL: https://svnweb.freebsd.org/changeset/base/304657

Log:
  MFC r304530:
  
  Pull in r265122 from upstream llvm trunk (by James Molloy):
  
Fix for pr24346: arm asm label calculation error in sub
  
Some ARM instructions encode 32-bit immediates as a 8-bit integer
(0-255) and a 4-bit rotation (0-30, even) in its least significant 12
bits. The original fixup, FK_Data_4, patches the instruction by the
value bit-to-bit, regardless of the encoding. For example, assuming
the label L1 and L2 are 0x0 and 0x104 respectively, the following
instruction:
  
  add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260
  
would be assembled to the following, which adds 1 to r0, instead of
260:
  
  e2800104 add r0, r0, #4, 2 ; equivalently 1
  
The new fixup kind fixup_arm_mod_imm takes care of the encoding:
  
  e2800f41 add r0, r0, #260
  
Patch by Ting-Yuan Huang!
  
  This fixes label calculation for ARM assembly, and is needed to enable
  ARM assembly sources for OpenSSL.
  
  Requested by: jkim

Modified:
  stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
  stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h
  stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
  stable/11/lib/clang/freebsd_cc_version.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
==
--- stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
Tue Aug 23 04:37:03 2016(r304656)
+++ stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
Tue Aug 23 05:22:03 2016(r304657)
@@ -90,6 +90,7 @@ const MCFixupKindInfo &ARMAsmBackend::ge
   {"fixup_arm_movw_lo16", 0, 20, 0},
   {"fixup_t2_movt_hi16", 0, 20, 0},
   {"fixup_t2_movw_lo16", 0, 20, 0},
+  {"fixup_arm_mod_imm", 0, 12, 0},
   };
   const static MCFixupKindInfo InfosBE[ARM::NumTargetFixupKinds] = {
   // This table *must* be in the order that the fixup_* kinds are defined 
in
@@ -133,6 +134,7 @@ const MCFixupKindInfo &ARMAsmBackend::ge
   {"fixup_arm_movw_lo16", 12, 20, 0},
   {"fixup_t2_movt_hi16", 12, 20, 0},
   {"fixup_t2_movw_lo16", 12, 20, 0},
+  {"fixup_arm_mod_imm", 20, 12, 0},
   };
 
   if (Kind < FirstTargetFixupKind)
@@ -624,6 +626,13 @@ unsigned ARMAsmBackend::adjustFixupValue
 
 return Value;
   }
+  case ARM::fixup_arm_mod_imm:
+Value = ARM_AM::getSOImmVal(Value);
+if (Ctx && Value >> 12) {
+  Ctx->reportError(Fixup.getLoc(), "out of range immediate fixup value");
+  return 0;
+}
+return Value;
   }
 }
 
@@ -690,6 +699,7 @@ static unsigned getFixupKindNumBytes(uns
   case FK_Data_2:
   case ARM::fixup_arm_thumb_br:
   case ARM::fixup_arm_thumb_cb:
+  case ARM::fixup_arm_mod_imm:
 return 2;
 
   case ARM::fixup_arm_pcrel_10_unscaled:
@@ -766,6 +776,7 @@ static unsigned getFixupKindContainerSiz
   case ARM::fixup_arm_movw_lo16:
   case ARM::fixup_t2_movt_hi16:
   case ARM::fixup_t2_movw_lo16:
+  case ARM::fixup_arm_mod_imm:
 // Instruction size is 4 bytes.
 return 4;
   }

Modified: stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h
==
--- stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h  Tue Aug 
23 04:37:03 2016(r304656)
+++ stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h  Tue Aug 
23 05:22:03 2016(r304657)
@@ -100,6 +100,9 @@ enum Fixups {
   fixup_t2_movt_hi16, // :upper16:
   fixup_t2_movw_lo16, // :lower16:
 
+  // fixup_arm_mod_imm - Fixup for mod_imm
+  fixup_arm_mod_imm,
+
   // Marker
   LastTargetFixupKind,
   NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind

Modified: 
stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
==
--- stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp 
Tue Aug 23 04:37:03 2016(r304656)
+++ stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp 
Tue Aug 23 05:22:03 2016(r304657)
@@ -312,12 +312,8 @@ public:
 // Support for fixups (MCFixup)
 if (MO.isExpr()) {
   const MCExpr *Expr = MO.getExpr();
-  // In instruction code this value always encoded as lowest 12 bits,
-  // so we don't have to perform any specific adjustments.
-  // Due to requirements of relocatable records we have to use FK_Data_4.
-  // See ARMELFObjectWriter::ExplicitRelSym and
-  // ARMELFObjectWriter::GetRelocTypeInner for more details.
-  MCFixupKind Kind = MCFixupKind(FK_Data_4);
+  // Fixups resolve to plain values that need to be encoded.
+  MCFixupKind Kind 

svn commit: r304656 - head/sys/powerpc/powerpc

2016-08-22 Thread Justin Hibbits
Author: jhibbits
Date: Tue Aug 23 04:37:03 2016
New Revision: 304656
URL: https://svnweb.freebsd.org/changeset/base/304656

Log:
  tlb1_init() can be called twice on BookE
  
  Summary:
  There is no need to call tlb1_init() twice. Now it is called first time from
  booke_init() and second time from powerpc_init() (where it is under BOOKE
  switch). Although this does not cause immediate problems in the mainline 
kernel,
  this can lead to undesirable side effects like two TLB entries with the same 
VA
  in the TLB1. Presence of two TLB entries with the same VA can hang CPU.
  
  Test Plan:
  Add initial mapping for UART to the tlb1_init(), build and boot the kernel,
  ensure that mapping presents only once (most convinient way - through 
Lauterbah
  or similar hardware debugger)
  
  Submitted by: Ivan Krivonos 
  Differential Revision: https://reviews.freebsd.org/D7607

Modified:
  head/sys/powerpc/powerpc/machdep.c

Modified: head/sys/powerpc/powerpc/machdep.c
==
--- head/sys/powerpc/powerpc/machdep.c  Tue Aug 23 04:26:30 2016
(r304655)
+++ head/sys/powerpc/powerpc/machdep.c  Tue Aug 23 04:37:03 2016
(r304656)
@@ -288,10 +288,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_
bzero(__bss_start, _end - __bss_start);
init_static_kenv(NULL, 0);
}
-#ifdef BOOKE
-   tlb1_init();
-#endif
-
/* Store boot environment state */
OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304655 - head/sys/powerpc/booke

2016-08-22 Thread Justin Hibbits
Author: jhibbits
Date: Tue Aug 23 04:26:30 2016
New Revision: 304655
URL: https://svnweb.freebsd.org/changeset/base/304655

Log:
  Take into account mas7/8 when reading/writing TLB entries on e6500
  
  Summary: Current booke/pmap code ignores mas7 and mas8 on e6500 CPU.
  
  Submitted by: Ivan Krivonos 
  Differential Revision: https://reviews.freebsd.org/D7606

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Tue Aug 23 02:54:06 2016
(r304654)
+++ head/sys/powerpc/booke/pmap.c   Tue Aug 23 04:26:30 2016
(r304655)
@@ -3166,6 +3166,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsi
case FSL_E500v2:
case FSL_E500mc:
case FSL_E5500:
+   case FSL_E6500:
entry->mas7 = mfspr(SPR_MAS7);
break;
default:
@@ -3206,6 +3207,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigne
switch ((mfpvr() >> 16) & 0x) {
case FSL_E500mc:
case FSL_E5500:
+   case FSL_E6500:
mtspr(SPR_MAS8, 0);
__asm __volatile("isync");
/* FALLTHROUGH */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304654 - in head/sys: dev/usb/net net

2016-08-22 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Aug 23 02:54:06 2016
New Revision: 304654
URL: https://svnweb.freebsd.org/changeset/base/304654

Log:
  net: Split RNDIS protocol structs/macros out of dev/usb/net/if_urndisreg.h
  
  So that Hyper-V can leverage them instead of rolling its own definition.
  
  Discussed with:   hps
  Reviewed by:  hps
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7592

Added:
  head/sys/net/rndis.h   (contents, props changed)
Modified:
  head/sys/dev/usb/net/if_urndis.c
  head/sys/dev/usb/net/if_urndisreg.h

Modified: head/sys/dev/usb/net/if_urndis.c
==
--- head/sys/dev/usb/net/if_urndis.cTue Aug 23 02:07:08 2016
(r304653)
+++ head/sys/dev/usb/net/if_urndis.cTue Aug 23 02:54:06 2016
(r304654)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -79,17 +80,17 @@ static uether_fn_t urndis_setmulti;
 static uether_fn_t urndis_setpromisc;
 
 static uint32_turndis_ctrl_query(struct urndis_softc *sc, uint32_t oid,
-   struct urndis_query_req *msg, uint16_t len,
+   struct rndis_query_req *msg, uint16_t len,
const void **rbuf, uint16_t *rbufsz);
 static uint32_turndis_ctrl_set(struct urndis_softc *sc, uint32_t oid,
-   struct urndis_set_req *msg, uint16_t len);
+   struct rndis_set_req *msg, uint16_t len);
 static uint32_turndis_ctrl_handle_init(struct urndis_softc *sc,
-   const struct urndis_comp_hdr *hdr);
+   const struct rndis_comp_hdr *hdr);
 static uint32_turndis_ctrl_handle_query(struct urndis_softc *sc,
-   const struct urndis_comp_hdr *hdr, const void **buf,
+   const struct rndis_comp_hdr *hdr, const void **buf,
uint16_t *bufsz);
 static uint32_turndis_ctrl_handle_reset(struct urndis_softc *sc,
-   const struct urndis_comp_hdr *hdr);
+   const struct rndis_comp_hdr *hdr);
 static uint32_turndis_ctrl_init(struct urndis_softc *sc);
 static uint32_turndis_ctrl_halt(struct urndis_softc *sc);
 
@@ -212,8 +213,8 @@ urndis_attach(device_t dev)
 {
static struct {
union {
-   struct urndis_query_req query;
-   struct urndis_set_req set;
+   struct rndis_query_req query;
+   struct rndis_set_req set;
} hdr;
union {
uint8_t eaddr[ETHER_ADDR_LEN];
@@ -453,10 +454,10 @@ urndis_ctrl_send(struct urndis_softc *sc
return (err);
 }
 
-static struct urndis_comp_hdr *
+static struct rndis_comp_hdr *
 urndis_ctrl_recv(struct urndis_softc *sc)
 {
-   struct urndis_comp_hdr *hdr;
+   struct rndis_comp_hdr *hdr;
usb_error_t err;
 
err = urndis_ctrl_msg(sc, UT_READ_CLASS_INTERFACE,
@@ -466,7 +467,7 @@ urndis_ctrl_recv(struct urndis_softc *sc
if (err != USB_ERR_NORMAL_COMPLETION)
return (NULL);
 
-   hdr = (struct urndis_comp_hdr *)sc->sc_response_buf;
+   hdr = (struct rndis_comp_hdr *)sc->sc_response_buf;
 
DPRINTF("type 0x%x len %u\n", le32toh(hdr->rm_type),
le32toh(hdr->rm_len));
@@ -480,7 +481,7 @@ urndis_ctrl_recv(struct urndis_softc *sc
 }
 
 static uint32_t
-urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr,
+urndis_ctrl_handle(struct urndis_softc *sc, struct rndis_comp_hdr *hdr,
 const void **buf, uint16_t *bufsz)
 {
uint32_t rval;
@@ -521,11 +522,11 @@ urndis_ctrl_handle(struct urndis_softc *
 
 static uint32_t
 urndis_ctrl_handle_init(struct urndis_softc *sc,
-const struct urndis_comp_hdr *hdr)
+const struct rndis_comp_hdr *hdr)
 {
-   const struct urndis_init_comp *msg;
+   const struct rndis_init_comp *msg;
 
-   msg = (const struct urndis_init_comp *)hdr;
+   msg = (const struct rndis_init_comp *)hdr;
 
DPRINTF("len %u rid %u status 0x%x "
"ver_major %u ver_minor %u devflags 0x%x medium 0x%x pktmaxcnt %u "
@@ -564,12 +565,12 @@ urndis_ctrl_handle_init(struct urndis_so
 
 static uint32_t
 urndis_ctrl_handle_query(struct urndis_softc *sc,
-const struct urndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz)
+const struct rndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz)
 {
-   const struct urndis_query_comp *msg;
+   const struct rndis_query_comp *msg;
uint64_t limit;
 
-   msg = (const struct urndis_query_comp *)hdr;
+   msg = (const struct rndis_query_comp *)hdr;
 
DPRINTF("len %u rid %u status 0x%x "
"buflen %u bufoff %u\n",
@@ -609,12 +610,12 @@ urndis_ctrl_handle_query(struct urndis_s
 
 static uint32_t
 urndis_ctrl_handle_reset(struct urndis_softc *sc,
-const 

svn commit: r304653 - head/usr.bin/indent

2016-08-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug 23 02:07:08 2016
New Revision: 304653
URL: https://svnweb.freebsd.org/changeset/base/304653

Log:
  indent(1): Fix off-by-one in control flow leading dead code.
  
  Coverity correctly reported that it's impossible for /comparison/ to be 0
  here, because the only way for the for loop to end is by /comparison/
  being < 0.
  
  Fortunately the consequences of this bug weren't severe; for duplicated
  entries in the typedef names file it would unnecessarily duplicate strings
  with strdup(), but pointers to those would replace existing ones. So this
  was a memory leak at worst.
  
  CID:   1361477
  Obtained from: Piotr Stephaniak

Modified:
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/lexi.c
==
--- head/usr.bin/indent/lexi.c  Tue Aug 23 02:06:20 2016(r304652)
+++ head/usr.bin/indent/lexi.c  Tue Aug 23 02:07:08 2016(r304653)
@@ -613,7 +613,7 @@ add_typename(const char *key)
 else {
int p;
 
-   for (p = 0; (comparison = strcmp(key, typenames[p])) >= 0; p++)
+   for (p = 0; (comparison = strcmp(key, typenames[p])) > 0; p++)
/* find place for the new key */;
if (comparison == 0)/* remove duplicates */
return;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304652 - head/sbin/resolvconf

2016-08-22 Thread Eric Badger
Author: badger
Date: Tue Aug 23 02:06:20 2016
New Revision: 304652
URL: https://svnweb.freebsd.org/changeset/base/304652

Log:
  Fix missing substitution of @SBINDIR@ in resolvconf scripts
  
  Certain features, such as resolv_conf_passthrough=NULL, do not work
  correctly due to this missing substitution.
  
  Also remove the @PREFIX@ substitution, which is no longer needed.
  
  Reviewed by:  pfg
  Approved by:  vangyzen (mentor)
  MFC after:1 week
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D7572

Modified:
  head/sbin/resolvconf/Makefile

Modified: head/sbin/resolvconf/Makefile
==
--- head/sbin/resolvconf/Makefile   Tue Aug 23 01:58:02 2016
(r304651)
+++ head/sbin/resolvconf/Makefile   Tue Aug 23 02:06:20 2016
(r304652)
@@ -16,6 +16,7 @@ CLEANFILES=   ${SCRIPTS} ${FILES} ${MAN}
 SYSCONFDIR=/etc
 RCDIR= ${SYSCONFDIR}/rc.d
 VARDIR=/var/run/resolvconf
+SBINDIR=   /sbin
 
 # We don't assume to restart the services in /sbin.  So, though
 # our service(8) is in /usr/sbin, we can use it, here.
@@ -28,13 +29,13 @@ RESTARTCMD= "/usr/sbin/service ${CMD1} \
 
 .for f in ${SCRIPTS} ${FILES} ${MAN}
 ${f}:  ${f}.in
-   sed -e 's:@PREFIX@::g' \
-   -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
+   sed -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
-e 's:@LIBEXECDIR@:${FILESDIR}:g' \
-e 's:@VARDIR@:${VARDIR}:g' \
-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \
-e 's:@RESTARTCMD@:${RESTARTCMD}:g' \
-e 's:@RCDIR@:${RCDIR}:g' \
+   -e 's:@SBINDIR@:${SBINDIR}:g' \
-e 's: vpn : ng[0-9]*&:g' \
${DIST}/$@.in > $@
 .endfor
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304651 - head/usr.bin/indent

2016-08-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug 23 01:58:02 2016
New Revision: 304651
URL: https://svnweb.freebsd.org/changeset/base/304651

Log:
  indent(1): add some comments to quiet down Coverity.
  
  Hopefully adding comments should help explain the code to both static
  checkers and humans.
  
  CID:  976543, 976544, 976545
  Obtained from:Piotr Stephaniak

Modified:
  head/usr.bin/indent/io.c
  head/usr.bin/indent/parse.c

Modified: head/usr.bin/indent/io.c
==
--- head/usr.bin/indent/io.cTue Aug 23 01:40:45 2016(r304650)
+++ head/usr.bin/indent/io.cTue Aug 23 01:58:02 2016(r304651)
@@ -200,6 +200,7 @@ dump_line(void)
break;
case '\\':
putc('\\', output);
+   /* add a backslash to escape the '\' */
default:
putc(*follow, output);
}

Modified: head/usr.bin/indent/parse.c
==
--- head/usr.bin/indent/parse.c Tue Aug 23 01:40:45 2016(r304650)
+++ head/usr.bin/indent/parse.c Tue Aug 23 01:58:02 2016(r304651)
@@ -95,6 +95,7 @@ parse(int tk) /* tk: the code for the co
 case ifstmt:   /* scanned if (...) */
if (ps.p_stack[ps.tos] == elsehead && ps.else_if)   /* "else if 
..." */
ps.i_l_follow = ps.il[ps.tos];
+   /* the rest is the same as for dolit and forstmt */
 case dolit:/* 'do' */
 case forstmt:  /* for (...) */
ps.p_stack[++ps.tos] = tk;
@@ -301,7 +302,7 @@ reduce(void)
case swstmt:
/*   */
case_ind = ps.cstk[ps.tos - 1];
-
+   /* FALLTHROUGH */
case decl:  /* finish of a declaration */
case elsehead:
/* <  else>  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304650 - head/usr.bin/indent

2016-08-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug 23 01:40:45 2016
New Revision: 304650
URL: https://svnweb.freebsd.org/changeset/base/304650

Log:
  indent(1): Fix memory leaks pointed out by clang-analyzer.
  
  Shift the responsibility of allocating memory for the string duplicate
  from the caller (set_option, add_typedefs_from_file) to the callee
  (add_typename) as it has more knowledge about when the duplication
  actually needs to occur.
  
  Taken from:   Piotr Stefaniak

Modified:
  head/usr.bin/indent/args.c
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/args.c
==
--- head/usr.bin/indent/args.c  Tue Aug 23 00:46:22 2016(r304649)
+++ head/usr.bin/indent/args.c  Tue Aug 23 01:40:45 2016(r304650)
@@ -294,12 +294,7 @@ found:
case KEY:
if (*param_start == 0)
goto need_param;
-   {
-   char *str = strdup(param_start);
-   if (str == NULL)
-   err(1, NULL);
-   add_typename(str);
-   }
+   add_typename(param_start);
break;
 
case KEY_FILE:
@@ -342,7 +337,6 @@ add_typedefs_from_file(const char *str)
 {
 FILE *file;
 char line[BUFSIZ];
-char *copy;
 
 if ((file = fopen(str, "r")) == NULL) {
fprintf(stderr, "indent: cannot open file %s\n", str);
@@ -351,10 +345,7 @@ add_typedefs_from_file(const char *str)
 while ((fgets(line, BUFSIZ, file)) != NULL) {
/* Remove trailing whitespace */
line[strcspn(line, " \t\n\r")] = '\0';
-   if ((copy = strdup(line)) == NULL) {
-   err(1, NULL);
-   }
-   add_typename(copy);
+   add_typename(line);
 }
 fclose(file);
 }

Modified: head/usr.bin/indent/lexi.c
==
--- head/usr.bin/indent/lexi.c  Tue Aug 23 00:46:22 2016(r304649)
+++ head/usr.bin/indent/lexi.c  Tue Aug 23 01:40:45 2016(r304650)
@@ -594,6 +594,7 @@ void
 add_typename(const char *key)
 {
 int comparison;
+const char *copy;
 
 if (typename_top + 1 >= typename_count) {
typenames = realloc((void *)typenames,
@@ -602,11 +603,12 @@ add_typename(const char *key)
err(1, NULL);
 }
 if (typename_top == -1)
-   typenames[++typename_top] = key;
+   typenames[++typename_top] = copy = strdup(key);
 else if ((comparison = strcmp(key, typenames[typename_top])) >= 0) {
/* take advantage of sorted input */
-   if (comparison != 0)/* remove duplicates */
-   typenames[++typename_top] = key;
+   if (comparison == 0)/* remove duplicates */
+   return;
+   typenames[++typename_top] = copy = strdup(key);
 }
 else {
int p;
@@ -617,6 +619,9 @@ add_typename(const char *key)
return;
memmove(&typenames[p + 1], &typenames[p],
sizeof(typenames[0]) * (++typename_top - p));
-   typenames[p] = key;
+   typenames[p] = copy = strdup(key);
 }
+
+if (copy == NULL)
+   err(1, NULL);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304649 - head/sys/arm/allwinner

2016-08-22 Thread Emmanuel Vadot
Author: manu
Date: Tue Aug 23 00:46:22 2016
New Revision: 304649
URL: https://svnweb.freebsd.org/changeset/base/304649

Log:
  Do not include file from dt-bindings and simply use the already present 
defines.
  
  Reported by:  jmcneill
  MFC after:1 week

Modified:
  head/sys/arm/allwinner/a10_gpio.c

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Tue Aug 23 00:00:06 2016
(r304648)
+++ head/sys/arm/allwinner/a10_gpio.c   Tue Aug 23 00:46:22 2016
(r304649)
@@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #if defined(__aarch64__)
 #include "opt_soc.h"
 #endif
@@ -602,8 +600,8 @@ aw_fdt_configure_pins(device_t dev, phan
if (a10_gpio_get_drv(sc, pin_num) != pin_drive)
a10_gpio_set_drv(sc, pin_num, pin_drive);
if (a10_gpio_get_pud(sc, pin_num) != pin_pull &&
-   (pin_pull == SUN4I_PINCTRL_PULL_UP ||
-   pin_pull == SUN4I_PINCTRL_PULL_DOWN))
+   (pin_pull == A10_GPIO_PULLUP ||
+   pin_pull == A10_GPIO_PULLDOWN))
a10_gpio_set_pud(sc, pin_num, pin_pull);
A10_GPIO_UNLOCK(sc);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304648 - stable/10/lib/libc/stdio

2016-08-22 Thread Andrey A. Chernov
Author: ache
Date: Tue Aug 23 00:00:06 2016
New Revision: 304648
URL: https://svnweb.freebsd.org/changeset/base/304648

Log:
  Direct commit, equal to MFC part of r295632 which is not planned for
  MFC at whole.
  Set __SERR on  __slbexpand() errors.

Modified:
  stable/10/lib/libc/stdio/fgetln.c

Modified: stable/10/lib/libc/stdio/fgetln.c
==
--- stable/10/lib/libc/stdio/fgetln.c   Mon Aug 22 22:51:10 2016
(r304647)
+++ stable/10/lib/libc/stdio/fgetln.c   Tue Aug 23 00:00:06 2016
(r304648)
@@ -159,6 +159,7 @@ fgetln(FILE *fp, size_t *lenp)
 
 error:
*lenp = 0;  /* ??? */
+   fp->_flags |= __SERR;
FUNLOCKFILE(fp);
return (NULL);  /* ??? */
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304646 - head/share/mk

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 22:51:07 2016
New Revision: 304646
URL: https://svnweb.freebsd.org/changeset/base/304646

Log:
  For 'make ' hook into the all_subdir_ targets.
  
  This fixes parallel build issues when trying to depend on ${SUBDIR}.  An
  example of this in share/i18n/csmapper/Makefile where mapper.dir depends
  on ${SUBDIR} having been traversed and built already.  Before this
  change running make in that directory would build the subdirectories
  twice.  This led to obscure build races.  While reworking that build
  may be possible, the framework should not so easily allow creating such
  problems.
  
  Now depending on  will properly redirect to the
  all_subdir_ target rather than invoking the inline shell.
  
  This also makes 'make -jX ' now respect any
  SUBDIR_DEPEND_ statements when SUBDIR_PARALLEL is defined.
  This is not entirely intended and may be changed later.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.subdir.mk

Modified: head/share/mk/bsd.subdir.mk
==
--- head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:04 2016(r304645)
+++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:07 2016(r304646)
@@ -122,10 +122,10 @@ _SUBDIR: .USEBEFORE
for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done
 .endif
 
-${SUBDIR:N.WAIT}: .PHONY .MAKE
-   ${_+_}@target=all; \
-   dir=${.TARGET}; \
-   ${_SUBDIR_SH};
+# Create 'make subdir' targets to run the real 'all' target.
+.for __dir in ${SUBDIR:N.WAIT}
+${__dir}: all_subdir_${DIRPRFX}${__dir} .PHONY
+.endfor
 
 .for __target in ${SUBDIR_TARGETS}
 # Can ordering be skipped for this and SUBDIR_PARALLEL forced?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304647 - head/lib

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 22:51:10 2016
New Revision: 304647
URL: https://svnweb.freebsd.org/changeset/base/304647

Log:
  Rename ORDERED to BOOTSTRAP since no order is respected in the list.
  
  The directories in SUBDIR_ORDERED are built in parallel, so the name is
  misleading.
  
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Mon Aug 22 22:51:07 2016(r304646)
+++ head/lib/Makefile   Mon Aug 22 22:51:10 2016(r304647)
@@ -3,12 +3,13 @@
 
 .include 
 
-# The SUBDIR_ORDERED list is a small set of libraries which are used by many
+# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
 # of the other libraries.  These are built first with a .WAIT between them
 # and the main list to avoid needing a SUBDIR_DEPEND line on every library
 # naming just these few items.
 
-SUBDIR_ORDERED=csu \
+SUBDIR_BOOTSTRAP= \
+   csu \
.WAIT \
libc \
libc_nonshared \
@@ -21,7 +22,7 @@ SUBDIR_ORDERED=   csu \
 
 # The main list; please keep these sorted alphabetically.
 
-SUBDIR=${SUBDIR_ORDERED} \
+SUBDIR=${SUBDIR_BOOTSTRAP} \
.WAIT \
libalias \
libarchive \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304643 - head/share/i18n/esdb

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 22:50:58 2016
New Revision: 304643
URL: https://svnweb.freebsd.org/changeset/base/304643

Log:
  Fix building on read-only source trees.
  
  This partially reverts r296702 and reworks the original check to only
  look in .CURDIR.  This avoids ever trying to rebuild a .src file that is
  already in the source tree as an override.
  
  PR:   211952
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/i18n/esdb/Makefile.part

Modified: head/share/i18n/esdb/Makefile.part
==
--- head/share/i18n/esdb/Makefile.part  Mon Aug 22 22:29:57 2016
(r304642)
+++ head/share/i18n/esdb/Makefile.part  Mon Aug 22 22:50:58 2016
(r304643)
@@ -67,9 +67,11 @@ codesets: ${ESDB}
 
 .if !defined(NO_PREPROC)
 .for i in ${PART}
+.if !exists(${.CURDIR}/${EPREFIX}${i:S/:/@/}.src)
 ${EPREFIX}${i:S/:/@/}.src: ${CODE}.src
sed ${SED_EXP:S@%%PART%%@${i}@} ${.ALLSRC} > ${.TARGET}
@echo ${.TARGET} >>.tmpfiles
+.endif
 .endfor
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304645 - head/share/mk

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 22:51:04 2016
New Revision: 304645
URL: https://svnweb.freebsd.org/changeset/base/304645

Log:
  Always define the various _subdir_ targets, even if not 
used.
  
  This is part of an effort to cleanup handling of some edge cases
  involving 'make '.  It also provides the targets for
  other uses.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.subdir.mk

Modified: head/share/mk/bsd.subdir.mk
==
--- head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:01 2016(r304644)
+++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:04 2016(r304645)
@@ -128,12 +128,6 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE
${_SUBDIR_SH};
 
 .for __target in ${SUBDIR_TARGETS}
-# Only recurse on directly-called targets.  I.e., don't recurse on dependencies
-# such as 'install' becoming {before,real,after}install, just recurse
-# 'install'.  Despite that, 'realinstall' is special due to ordering issues
-# with 'afterinstall'.
-.if !defined(NO_SUBDIR) && (make(${__target}) || \
-(${__target} == realinstall && make(install)))
 # Can ordering be skipped for this and SUBDIR_PARALLEL forced?
 .if ${STANDALONE_SUBDIR_TARGETS:M${__target}}
 _is_standalone_target= 1
@@ -165,6 +159,14 @@ ${__target}_subdir_${DIRPRFX}${__dir}: .
 __subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir}
 .endif # ${__dir} == .WAIT
 .endfor# __dir in ${SUBDIR}
+
+# Attach the subdir targets to the real target.
+# Only recurse on directly-called targets.  I.e., don't recurse on dependencies
+# such as 'install' becoming {before,real,after}install, just recurse
+# 'install'.  Despite that, 'realinstall' is special due to ordering issues
+# with 'afterinstall'.
+.if !defined(NO_SUBDIR) && (make(${__target}) || \
+(${__target} == realinstall && make(install)))
 ${__target}: ${__subdir_targets} .PHONY
 .endif # make(${__target})
 .endfor# __target in ${SUBDIR_TARGETS}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304644 - head/share/mk

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 22:51:01 2016
New Revision: 304644
URL: https://svnweb.freebsd.org/changeset/base/304644

Log:
  Stop using _SUBDIR internally for non-SUBDIR_PARALLEL builds.
  
  This is unifying more of the logic.  Rather than create targets such
  as 'all: all_subdir_foo' when using SUBDIR_PARALLEL and using
  'all: _SUBDIR' when not using SUBDIR_PARALLEL, always use the
  expanded out _subdir_ pattern.  When not using
  SUBDIR_PARALLEL, have each directory-target depend on the previously
  defined targets as to respect the *order* of SUBDIR.
  
  Using 'make -N' now prints all directory traversals individually rather
  than using a loop, since a loop is no longer used to traverse.
  
  This is part of an effort to cleanup handling of some edge cases
  involving 'make ' and making it simpler in the sense
  that the pattern used to build is the same for all modes.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.subdir.mk

Modified: head/share/mk/bsd.subdir.mk
==
--- head/share/mk/bsd.subdir.mk Mon Aug 22 22:50:58 2016(r304643)
+++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:01 2016(r304644)
@@ -114,6 +114,8 @@ _SUBDIR_SH= \
cd ${.CURDIR}/$${dir}; \
${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/
 
+# This is kept for compatibility only.  The normal handling of attaching to
+# SUBDIR_TARGETS will create a target for each directory.
 _SUBDIR: .USEBEFORE
 .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR)
@${_+_}target=${.TARGET:realinstall=install}; \
@@ -139,29 +141,31 @@ SUBDIR:=  ${SUBDIR:N.WAIT}
 .else
 _is_standalone_target= 0
 .endif
-.if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1
 __subdir_targets=
 .for __dir in ${SUBDIR}
 .if ${__dir} == .WAIT
 __subdir_targets+= .WAIT
 .else
-__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir}
 __deps=
 .if ${_is_standalone_target} == 0
+.if defined(SUBDIR_PARALLEL)
+# Apply SUBDIR_DEPEND dependencies for SUBDIR_PARALLEL.
 .for __dep in ${SUBDIR_DEPEND_${__dir}}
 __deps+= ${__target}_subdir_${DIRPRFX}${__dep}
 .endfor
-.endif
+.else
+# For non-parallel builds, directories depend on all targets before them.
+__deps:= ${__subdir_targets}
+.endif # defined(SUBDIR_PARALLEL)
+.endif # ${_is_standalone_target} == 0
 ${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE .SILENT ${__deps}
@${_+_}target=${__target:realinstall=install}; \
dir=${__dir}; \
${_SUBDIR_SH};
-.endif
+__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir}
+.endif # ${__dir} == .WAIT
 .endfor# __dir in ${SUBDIR}
 ${__target}: ${__subdir_targets} .PHONY
-.else
-${__target}: _SUBDIR .PHONY
-.endif # SUBDIR_PARALLEL || _is_standalone_target
 .endif # make(${__target})
 .endfor# __target in ${SUBDIR_TARGETS}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304642 - releng/11.0/sys/netinet6

2016-08-22 Thread Mike Karels
Author: karels
Date: Mon Aug 22 22:29:57 2016
New Revision: 304642
URL: https://svnweb.freebsd.org/changeset/base/304642

Log:
  MFC r304546: Disable L2 caching for UDP over IPv6
  
  The ip6_output routine is missing L2 cache invalication as done
  in ip_output.  Even with that code, some problems with UDP over
  IPv6 have been reported.  Diabling L2 cache for that problem works
  around the problem for now.
  
  PR: 211872 211926
  Reviewed by:gnn
  Approved by:gnn (mentor)
  Approved by:re (gjb)
  Tested by:  peter@, Mike Andrews

Modified:
  releng/11.0/sys/netinet6/udp6_usrreq.c
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/sys/netinet6/udp6_usrreq.c
==
--- releng/11.0/sys/netinet6/udp6_usrreq.c  Mon Aug 22 22:28:41 2016
(r304641)
+++ releng/11.0/sys/netinet6/udp6_usrreq.c  Mon Aug 22 22:29:57 2016
(r304642)
@@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb
 
UDP_PROBE(send, NULL, inp, ip6, inp, udp6);
UDPSTAT_INC(udps_opackets);
-   error = ip6_output(m, optp, &inp->inp_route6, flags,
+   error = ip6_output(m, optp, NULL, flags,
inp->in6p_moptions, NULL, inp);
break;
case AF_INET:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304641 - head/lib/libc/stdio

2016-08-22 Thread Andrey A. Chernov
Author: ache
Date: Mon Aug 22 22:28:41 2016
New Revision: 304641
URL: https://svnweb.freebsd.org/changeset/base/304641

Log:
  1) Back out r304607 case 2). fgetwln() as its pair fgetln() supposed to
  return partial line on any errors. See the comment in fgetln.c.
  Add corresponding comment to fgetwln() too.
  2) Rewrite r304607 case 1).
  3) Remove "Fast path" from __fgetwc_mbs() since it can't detect encoding
  errors and ignores them all.
  
  PR: 212033
  MFC after:  7 days

Modified:
  head/lib/libc/stdio/fgetwc.c
  head/lib/libc/stdio/fgetwln.c

Modified: head/lib/libc/stdio/fgetwc.c
==
--- head/lib/libc/stdio/fgetwc.cMon Aug 22 21:49:17 2016
(r304640)
+++ head/lib/libc/stdio/fgetwc.cMon Aug 22 22:28:41 2016
(r304641)
@@ -79,18 +79,9 @@ __fgetwc_mbs(FILE *fp, mbstate_t *mbs, i
size_t nconv;
struct xlocale_ctype *l = XLOCALE_CTYPE(locale);
 
-   if (fp->_r <= 0 && __srefill(fp)) {
-   *nread = 0;
-   return (WEOF);
-   }
-   if (MB_CUR_MAX == 1) {
-   /* Fast path for single-byte encodings. */
-   wc = *fp->_p++;
-   fp->_r--;
-   *nread = 1;
-   return (wc);
-   }
*nread = 0;
+   if (fp->_r <= 0 && __srefill(fp))
+   return (WEOF);
do {
nconv = l->__mbrtowc(&wc, fp->_p, fp->_r, mbs);
if (nconv == (size_t)-1)

Modified: head/lib/libc/stdio/fgetwln.c
==
--- head/lib/libc/stdio/fgetwln.c   Mon Aug 22 21:49:17 2016
(r304640)
+++ head/lib/libc/stdio/fgetwln.c   Mon Aug 22 22:28:41 2016
(r304641)
@@ -33,7 +33,6 @@
 __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
-#include 
 #include 
 #include 
 #include "un-namespace.h"
@@ -48,39 +47,32 @@ fgetwln_l(FILE * __restrict fp, size_t *
 {
wint_t wc;
size_t len;
-   int saverrno;
FIX_LOCALE(locale);
 
FLOCKFILE(fp);
ORIENT(fp, 1);
 
len = 0;
-   saverrno = errno;
-   errno = 0;
+   /* WEOF or error: return partial line, see fgetln(3). */
while ((wc = __fgetwc(fp, locale)) != WEOF) {
 #defineGROW512
if (len * sizeof(wchar_t) >= fp->_lb._size &&
-   __slbexpand(fp, (len + GROW) * sizeof(wchar_t)))
+   __slbexpand(fp, (len + GROW) * sizeof(wchar_t))) {
+   fp->_flags |= __SERR;
goto error;
+   }
*((wchar_t *)fp->_lb._base + len++) = wc;
if (wc == L'\n')
break;
-   errno = 0;
}
-   if (wc == WEOF && errno != 0)
-   goto error;
-   if (errno == 0)
-   errno = saverrno;
if (len == 0)
-   goto eof;
+   goto error;
 
FUNLOCKFILE(fp);
*lenp = len;
return ((wchar_t *)fp->_lb._base);
 
 error:
-   fp->_flags |= __SERR;
-eof:
FUNLOCKFILE(fp);
*lenp = 0;
return (NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304640 - in head/secure/lib/libcrypto: . amd64 arm i386

2016-08-22 Thread Jung-uk Kim
Author: jkim
Date: Mon Aug 22 21:49:17 2016
New Revision: 304640
URL: https://svnweb.freebsd.org/changeset/base/304640

Log:
  Prefer C-style comments in assembly sources.

Modified:
  head/secure/lib/libcrypto/Makefile.asm
  head/secure/lib/libcrypto/amd64/aes-x86_64.S
  head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S
  head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S
  head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S
  head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S
  head/secure/lib/libcrypto/amd64/aesni-x86_64.S
  head/secure/lib/libcrypto/amd64/bsaes-x86_64.S
  head/secure/lib/libcrypto/amd64/cmll-x86_64.S
  head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S
  head/secure/lib/libcrypto/amd64/ghash-x86_64.S
  head/secure/lib/libcrypto/amd64/md5-x86_64.S
  head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S
  head/secure/lib/libcrypto/amd64/rc4-x86_64.S
  head/secure/lib/libcrypto/amd64/rsaz-avx2.S
  head/secure/lib/libcrypto/amd64/rsaz-x86_64.S
  head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S
  head/secure/lib/libcrypto/amd64/sha1-x86_64.S
  head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S
  head/secure/lib/libcrypto/amd64/sha256-x86_64.S
  head/secure/lib/libcrypto/amd64/sha512-x86_64.S
  head/secure/lib/libcrypto/amd64/vpaes-x86_64.S
  head/secure/lib/libcrypto/amd64/wp-x86_64.S
  head/secure/lib/libcrypto/amd64/x86_64-gf2m.S
  head/secure/lib/libcrypto/amd64/x86_64-mont.S
  head/secure/lib/libcrypto/amd64/x86_64-mont5.S
  head/secure/lib/libcrypto/amd64/x86_64cpuid.S
  head/secure/lib/libcrypto/arm/aes-armv4.S
  head/secure/lib/libcrypto/arm/aesv8-armx.S
  head/secure/lib/libcrypto/arm/armv4-gf2m.S
  head/secure/lib/libcrypto/arm/armv4-mont.S
  head/secure/lib/libcrypto/arm/bsaes-armv7.S
  head/secure/lib/libcrypto/arm/ghash-armv4.S
  head/secure/lib/libcrypto/arm/ghashv8-armx.S
  head/secure/lib/libcrypto/arm/sha1-armv4-large.S
  head/secure/lib/libcrypto/arm/sha256-armv4.S
  head/secure/lib/libcrypto/arm/sha512-armv4.S
  head/secure/lib/libcrypto/i386/aes-586.S
  head/secure/lib/libcrypto/i386/aesni-x86.S
  head/secure/lib/libcrypto/i386/bf-586.S
  head/secure/lib/libcrypto/i386/bf-686.S
  head/secure/lib/libcrypto/i386/bn-586.S
  head/secure/lib/libcrypto/i386/cmll-x86.S
  head/secure/lib/libcrypto/i386/co-586.S
  head/secure/lib/libcrypto/i386/crypt586.S
  head/secure/lib/libcrypto/i386/des-586.S
  head/secure/lib/libcrypto/i386/ghash-x86.S
  head/secure/lib/libcrypto/i386/md5-586.S
  head/secure/lib/libcrypto/i386/rc4-586.S
  head/secure/lib/libcrypto/i386/rc5-586.S
  head/secure/lib/libcrypto/i386/rmd-586.S
  head/secure/lib/libcrypto/i386/sha1-586.S
  head/secure/lib/libcrypto/i386/sha256-586.S
  head/secure/lib/libcrypto/i386/sha512-586.S
  head/secure/lib/libcrypto/i386/vpaes-x86.S
  head/secure/lib/libcrypto/i386/wp-mmx.S
  head/secure/lib/libcrypto/i386/x86-gf2m.S
  head/secure/lib/libcrypto/i386/x86-mont.S
  head/secure/lib/libcrypto/i386/x86cpuid.S

Modified: head/secure/lib/libcrypto/Makefile.asm
==
--- head/secure/lib/libcrypto/Makefile.asm  Mon Aug 22 21:40:51 2016
(r304639)
+++ head/secure/lib/libcrypto/Makefile.asm  Mon Aug 22 21:49:17 2016
(r304640)
@@ -64,8 +64,8 @@ CLEANFILES=   ${ASM} ${SHA_ASM:S/$/.s/}
 .SUFFIXES: .pl
 
 .pl.S:
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' 
;\
+   ( echo '/* $$'FreeBSD'$$ */' ;\
+   echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. 
*/' ;\
env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET}
 
 ${SHA_TMP}: ${SHA_SRC}
@@ -73,8 +73,8 @@ ${SHA_TMP}: ${SHA_SRC}
 
 .for s in ${SHA_ASM}
 ${s}.S: ${s}.s
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '# Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\
+   ( echo '/* $$'FreeBSD'$$ */' ;\
+   echo '/* Do not modify. This file is auto-generated from ${SHA_SRC}. 
*/' ;\
cat ${s}.s ) > ${.TARGET}
 .endfor
 
@@ -108,14 +108,14 @@ CLEANFILES=   ${ASM} ${SRCS:R:S/$/.s/}
 .SUFFIXES: .pl
 
 aes-armv4.S:   aes-armv4.pl
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '# Do not modify. This file is auto-generated from ${.ALLSRC:T}.' 
;\
+   ( echo '/* $$'FreeBSD'$$ */' ;\
+   echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. 
*/' ;\
env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET}
 
 .pl.S:
env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/}
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '# Do not modify. This file is auto-generated from 
${.IMPSRC:T:R:S/$/.pl/}.' ;\
+   ( echo '/* $$'FreeBSD'$$ */' ;\
+   echo '/* Do not modify. This file is auto-generated from 
${.IMPSRC:T:R:S/$/.pl/}. */' ;\
cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
 
 .elif defined(ASM_i386)
@@ -183,8 +183,8 @@ CLEANFILES= ${ASM}
 .SUFFIXES: .pl
 
 .pl.S:
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '# Do not modify. This fil

svn commit: r304638 - in head/secure/lib/libcrypto: . amd64 arm

2016-08-22 Thread Jung-uk Kim
Author: jkim
Date: Mon Aug 22 21:30:59 2016
New Revision: 304638
URL: https://svnweb.freebsd.org/changeset/base/304638

Log:
  Fix white spaces in assembly sources.

Modified:
  head/secure/lib/libcrypto/Makefile.asm
  head/secure/lib/libcrypto/amd64/sha256-x86_64.S
  head/secure/lib/libcrypto/amd64/sha512-x86_64.S
  head/secure/lib/libcrypto/arm/aesv8-armx.S
  head/secure/lib/libcrypto/arm/armv4-gf2m.S
  head/secure/lib/libcrypto/arm/armv4-mont.S
  head/secure/lib/libcrypto/arm/bsaes-armv7.S
  head/secure/lib/libcrypto/arm/ghash-armv4.S
  head/secure/lib/libcrypto/arm/ghashv8-armx.S
  head/secure/lib/libcrypto/arm/sha1-armv4-large.S
  head/secure/lib/libcrypto/arm/sha256-armv4.S
  head/secure/lib/libcrypto/arm/sha512-armv4.S

Modified: head/secure/lib/libcrypto/Makefile.asm
==
--- head/secure/lib/libcrypto/Makefile.asm  Mon Aug 22 21:23:17 2016
(r304637)
+++ head/secure/lib/libcrypto/Makefile.asm  Mon Aug 22 21:30:59 2016
(r304638)
@@ -73,8 +73,8 @@ ${SHA_TMP}: ${SHA_SRC}
 
 .for s in ${SHA_ASM}
 ${s}.S: ${s}.s
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '  # Do not modify. This file is auto-generated from ${SHA_SRC}.' 
;\
+   ( echo '# $$'FreeBSD'$$' ;\
+   echo '# Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\
cat ${s}.s ) > ${.TARGET}
 .endfor
 
@@ -114,8 +114,8 @@ aes-armv4.S:aes-armv4.pl
 
 .pl.S:
env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/}
-   ( echo '# $$'FreeBSD'$$' ;\
-   echo '  # Do not modify. This file is auto-generated from 
${.IMPSRC:T:R:S/$/.pl/}.' ;\
+   ( echo '# $$'FreeBSD'$$' ;\
+   echo '# Do not modify. This file is auto-generated from 
${.IMPSRC:T:R:S/$/.pl/}.' ;\
cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
 
 .elif defined(ASM_i386)

Modified: head/secure/lib/libcrypto/amd64/sha256-x86_64.S
==
--- head/secure/lib/libcrypto/amd64/sha256-x86_64.S Mon Aug 22 21:23:17 
2016(r304637)
+++ head/secure/lib/libcrypto/amd64/sha256-x86_64.S Mon Aug 22 21:30:59 
2016(r304638)
@@ -1,5 +1,5 @@
-   # $FreeBSD$
-   # Do not modify. This file is auto-generated from sha512-x86_64.pl.
+# $FreeBSD$
+# Do not modify. This file is auto-generated from sha512-x86_64.pl.
 .text  
 
 

Modified: head/secure/lib/libcrypto/amd64/sha512-x86_64.S
==
--- head/secure/lib/libcrypto/amd64/sha512-x86_64.S Mon Aug 22 21:23:17 
2016(r304637)
+++ head/secure/lib/libcrypto/amd64/sha512-x86_64.S Mon Aug 22 21:30:59 
2016(r304638)
@@ -1,5 +1,5 @@
-   # $FreeBSD$
-   # Do not modify. This file is auto-generated from sha512-x86_64.pl.
+# $FreeBSD$
+# Do not modify. This file is auto-generated from sha512-x86_64.pl.
 .text  
 
 

Modified: head/secure/lib/libcrypto/arm/aesv8-armx.S
==
--- head/secure/lib/libcrypto/arm/aesv8-armx.S  Mon Aug 22 21:23:17 2016
(r304637)
+++ head/secure/lib/libcrypto/arm/aesv8-armx.S  Mon Aug 22 21:30:59 2016
(r304638)
@@ -1,5 +1,5 @@
-   # $FreeBSD$
-   # Do not modify. This file is auto-generated from aesv8-armx.pl.
+# $FreeBSD$
+# Do not modify. This file is auto-generated from aesv8-armx.pl.
 #include "arm_arch.h"
 
 #if __ARM_MAX_ARCH__>=7

Modified: head/secure/lib/libcrypto/arm/armv4-gf2m.S
==
--- head/secure/lib/libcrypto/arm/armv4-gf2m.S  Mon Aug 22 21:23:17 2016
(r304637)
+++ head/secure/lib/libcrypto/arm/armv4-gf2m.S  Mon Aug 22 21:30:59 2016
(r304638)
@@ -1,5 +1,5 @@
-   # $FreeBSD$
-   # Do not modify. This file is auto-generated from armv4-gf2m.pl.
+# $FreeBSD$
+# Do not modify. This file is auto-generated from armv4-gf2m.pl.
 #include "arm_arch.h"
 
 .text

Modified: head/secure/lib/libcrypto/arm/armv4-mont.S
==
--- head/secure/lib/libcrypto/arm/armv4-mont.S  Mon Aug 22 21:23:17 2016
(r304637)
+++ head/secure/lib/libcrypto/arm/armv4-mont.S  Mon Aug 22 21:30:59 2016
(r304638)
@@ -1,5 +1,5 @@
-   # $FreeBSD$
-   # Do not modify. This file is auto-generated from armv4-mont.pl.
+# $FreeBSD$
+# Do not modify. This file is auto-generated from armv4-mont.pl.
 #include "arm_arch.h"
 
 .text

Modified: head/secure/lib/libcrypto/arm/bsaes-armv7.S
==
--- head/secure/lib/libcrypto/arm/bsaes-armv7.S Mon Aug 22 21:23:17 2016
(r304637)
+++ head/secure/lib/libcrypto/arm/bsaes-armv7.S Mon Aug 22 21:30:59 2016
(r304638)
@@ -1,5 +1,5 @@
-   # $FreeBSD$
-   # Do not modify. This file is auto-generated fro

svn commit: r304637 - in head/sys: amd64/include i386/include x86/x86 x86/xen

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 21:23:17 2016
New Revision: 304637
URL: https://svnweb.freebsd.org/changeset/base/304637

Log:
  Fix build for !SMP kernels after the Xen MSIX workaround.
  
  Move msix_disable_migration under #ifdef SMP since it doesn't make sense
  for !SMP kernels.
  
  PR:   212014
  Reported by:  Glyn Grinstead 
  MFC after:3 days

Modified:
  head/sys/amd64/include/intr_machdep.h
  head/sys/i386/include/intr_machdep.h
  head/sys/x86/x86/msi.c
  head/sys/x86/xen/hvm.c

Modified: head/sys/amd64/include/intr_machdep.h
==
--- head/sys/amd64/include/intr_machdep.h   Mon Aug 22 20:59:34 2016
(r304636)
+++ head/sys/amd64/include/intr_machdep.h   Mon Aug 22 21:23:17 2016
(r304637)
@@ -148,8 +148,9 @@ extern cpuset_t intr_cpus;
 #endif
 extern struct mtx icu_lock;
 extern int elcr_found;
-
+#ifdef SMP
 extern int msix_disable_migration;
+#endif
 
 #ifndef DEV_ATPIC
 void   atpic_reset(void);

Modified: head/sys/i386/include/intr_machdep.h
==
--- head/sys/i386/include/intr_machdep.hMon Aug 22 20:59:34 2016
(r304636)
+++ head/sys/i386/include/intr_machdep.hMon Aug 22 21:23:17 2016
(r304637)
@@ -139,8 +139,9 @@ extern cpuset_t intr_cpus;
 #endif
 extern struct mtx icu_lock;
 extern int elcr_found;
-
+#ifdef SMP
 extern int msix_disable_migration;
+#endif
 
 #ifndef DEV_ATPIC
 void   atpic_reset(void);

Modified: head/sys/x86/x86/msi.c
==
--- head/sys/x86/x86/msi.c  Mon Aug 22 20:59:34 2016(r304636)
+++ head/sys/x86/x86/msi.c  Mon Aug 22 21:23:17 2016(r304637)
@@ -149,6 +149,7 @@ struct pic msi_pic = {
.pic_reprogram_pin = NULL,
 };
 
+#ifdef SMP
 /**
  * Xen hypervisors prior to 4.6.0 do not properly handle updates to
  * enabled MSI-X table entries.  Allow migration of MSI-X interrupts
@@ -162,6 +163,7 @@ int msix_disable_migration = -1;
 SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, CTLFLAG_RDTUN,
 &msix_disable_migration, 0,
 "Disable migration of MSI-X interrupts between CPUs");
+#endif
 
 static int msi_enabled;
 static int msi_last_irq;
@@ -241,8 +243,10 @@ msi_assign_cpu(struct intsrc *isrc, u_in
if (msi->msi_first != msi)
return (EINVAL);
 
+#ifdef SMP
if (msix_disable_migration && msi->msi_msix)
return (EINVAL);
+#endif
 
/* Store information to free existing irq. */
old_vector = msi->msi_vector;
@@ -316,10 +320,12 @@ msi_init(void)
return;
}
 
+#ifdef SMP
if (msix_disable_migration == -1) {
/* The default is to allow migration of MSI-X interrupts. */
msix_disable_migration = 0;
}
+#endif
 
msi_enabled = 1;
intr_register_pic(&msi_pic);

Modified: head/sys/x86/xen/hvm.c
==
--- head/sys/x86/xen/hvm.c  Mon Aug 22 20:59:34 2016(r304636)
+++ head/sys/x86/xen/hvm.c  Mon Aug 22 21:23:17 2016(r304637)
@@ -143,6 +143,7 @@ xen_hvm_init_hypercall_stubs(enum xen_hv
printf("XEN: Hypervisor version %d.%d detected.\n", major,
minor);
 
+#ifdef SMP
if (((major < 4) || (major == 4 && minor <= 5)) &&
msix_disable_migration == -1) {
/*
@@ -157,6 +158,7 @@ xen_hvm_init_hypercall_stubs(enum xen_hv
 "Set machdep.msix_disable_migration=0 to forcefully enable it.\n");
msix_disable_migration = 1;
}
+#endif
}
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304636 - in head: crypto/openssl/crypto/bn/asm crypto/openssl/crypto/sha/asm secure/lib/libcrypto secure/lib/libcrypto/arm

2016-08-22 Thread Jung-uk Kim
Author: jkim
Date: Mon Aug 22 20:59:34 2016
New Revision: 304636
URL: https://svnweb.freebsd.org/changeset/base/304636

Log:
  Build OpenSSL assembly sources for arm.  Tested with Raspberry Pi 2 Model B.
  
  MFC after:1 week

Added:
  head/secure/lib/libcrypto/arm/
  head/secure/lib/libcrypto/arm/aes-armv4.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/aesv8-armx.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/armv4-gf2m.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/armv4-mont.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/bsaes-armv7.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/ghash-armv4.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/ghashv8-armx.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/sha1-armv4-large.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/sha256-armv4.S   (contents, props changed)
  head/secure/lib/libcrypto/arm/sha512-armv4.S   (contents, props changed)
Modified:
  head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
  head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl
  head/secure/lib/libcrypto/Makefile
  head/secure/lib/libcrypto/Makefile.asm
  head/secure/lib/libcrypto/Makefile.inc

Modified: head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
==
--- head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Mon Aug 22 20:48:46 
2016(r304635)
+++ head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Mon Aug 22 20:59:34 
2016(r304636)
@@ -213,8 +213,8 @@ $code.=<<___;
 .align 5
 .LNEON:
ldr r12, [sp]   @ 5th argument
-   vmov.32 $a, r2, r1
-   vmov.32 $b, r12, r3
+   vmov$a, r2, r1
+   vmov$b, r12, r3
vmov.i64$k48, #0x
vmov.i64$k32, #0x
vmov.i64$k16, #0x

Modified: head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl
==
--- head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl  Mon Aug 22 20:48:46 
2016(r304635)
+++ head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl  Mon Aug 22 20:59:34 
2016(r304636)
@@ -595,7 +595,7 @@ sha256_block_data_order_armv8:
adr $Ktbl,.LARMv8
sub $Ktbl,$Ktbl,#.LARMv8-K256
 # else
-   adrl$Ktbl,K256
+   sub $Ktbl,$Ktbl,#256+32
 # endif
add $len,$inp,$len,lsl#6@ len to point at the end of inp
 

Modified: head/secure/lib/libcrypto/Makefile
==
--- head/secure/lib/libcrypto/Makefile  Mon Aug 22 20:48:46 2016
(r304635)
+++ head/secure/lib/libcrypto/Makefile  Mon Aug 22 20:59:34 2016
(r304636)
@@ -24,6 +24,8 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex
o_fips.c o_init.c o_str.c o_time.c uid.c
 .if defined(ASM_amd64)
 SRCS+= x86_64cpuid.S
+.elif defined(ASM_arm)
+SRCS+= armcap.c armv4cpuid.S
 .elif defined(ASM_i386)
 SRCS+= x86cpuid.S
 .else
@@ -36,6 +38,8 @@ SRCS+=aes_cfb.c aes_ctr.c aes_ecb.c aes
 .if defined(ASM_amd64)
 SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \
aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S
+.elif defined(ASM_arm)
+SRCS+= aes-armv4.S aes_cbc.c aesv8-armx.S bsaes-armv7.S
 .elif defined(ASM_i386)
 SRCS+= aes-586.S aesni-x86.S vpaes-x86.S
 .else
@@ -85,6 +89,8 @@ SRCS+=bn_add.c bn_blind.c bn_const.c bn
 .if defined(ASM_amd64)
 SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \
x86_64-mont.S x86_64-mont5.S
+.elif defined(ASM_arm)
+SRCS+= armv4-mont.S armv4-gf2m.S bn_asm.c
 .elif defined(ASM_i386)
 SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S
 .else
@@ -234,6 +240,8 @@ SRCS+=  cbc128.c ccm128.c cfb128.c ctr128
wrap128.c xts128.c
 .if defined(ASM_amd64)
 SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S
+.elif defined(ASM_arm)
+SRCS+= ghash-armv4.S ghashv8-armx.S
 .elif defined(ASM_i386)
 SRCS+= ghash-x86.S
 .endif
@@ -319,6 +327,8 @@ SRCS+=  sha1_one.c sha1dgst.c sha256.c sh
 .if defined(ASM_amd64)
 SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \
sha512-x86_64.S
+.elif defined(ASM_arm)
+SRCS+= sha1-armv4-large.S sha256-armv4.S sha512-armv4.S
 .elif defined(ASM_i386)
 SRCS+= sha1-586.S sha256-586.S sha512-586.S
 .endif

Modified: head/secure/lib/libcrypto/Makefile.asm
==
--- head/secure/lib/libcrypto/Makefile.asm  Mon Aug 22 20:48:46 2016
(r304635)
+++ head/secure/lib/libcrypto/Makefile.asm  Mon Aug 22 20:59:34 2016
(r304636)
@@ -78,6 +78,46 @@ ${s}.S: ${s}.s
cat ${s}.s ) > ${.TARGET}
 .endfor
 
+.elif defined(ASM_arm)
+
+.PATH: ${LCRYPTO_SRC}/crypto \
+   ${LCRYPTO_SRC}/crypto/aes/asm \
+  

svn commit: r304635 - head/lib/libpam/modules/pam_ssh

2016-08-22 Thread Ollivier Robert
Author: roberto
Date: Mon Aug 22 20:48:46 2016
New Revision: 304635
URL: https://svnweb.freebsd.org/changeset/base/304635

Log:
  Remove support for SSH1 as it is already disabled in our OpenSSH.
  
  Submitted by: vangyzen
  MFC after:2 weeks

Modified:
  head/lib/libpam/modules/pam_ssh/pam_ssh.8
  head/lib/libpam/modules/pam_ssh/pam_ssh.c

Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8
==
--- head/lib/libpam/modules/pam_ssh/pam_ssh.8   Mon Aug 22 20:23:39 2016
(r304634)
+++ head/lib/libpam/modules/pam_ssh/pam_ssh.8   Mon Aug 22 20:48:46 2016
(r304635)
@@ -128,9 +128,7 @@ Start an agent even if no keys were decr
 authentication phase.
 .El
 .Sh FILES
-.Bl -tag -width ".Pa $HOME/.ssh/identity" -compact
-.It Pa $HOME/.ssh/identity
-SSH1 RSA key
+.Bl -tag -width ".Pa $HOME/.ssh/id_ed25519" -compact
 .It Pa $HOME/.ssh/id_rsa
 SSH2 RSA key
 .It Pa $HOME/.ssh/id_dsa

Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c
==
--- head/lib/libpam/modules/pam_ssh/pam_ssh.c   Mon Aug 22 20:23:39 2016
(r304634)
+++ head/lib/libpam/modules/pam_ssh/pam_ssh.c   Mon Aug 22 20:48:46 2016
(r304635)
@@ -77,7 +77,6 @@ static const char *pam_ssh_prompt = "SSH
 static const char *pam_ssh_have_keys = "pam_ssh_have_keys";
 
 static const char *pam_ssh_keyfiles[] = {
-   ".ssh/identity",/* SSH1 RSA key */
".ssh/id_rsa",  /* SSH2 RSA key */
".ssh/id_dsa",  /* SSH2 DSA key */
".ssh/id_ecdsa",/* SSH2 ECDSA key */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304634 - releng/11.0/lib/libc/sys

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 20:23:39 2016
New Revision: 304634
URL: https://svnweb.freebsd.org/changeset/base/304634

Log:
  MF11 304617: Fix various nits in the aio operation manpages.
  
  - Avoid double use of "request" in a single sentence.  Instead, describe
aio_sigevent as being used to request notification of the associated
operation's completion.  This matches the language used to describe
aio_sigevent in aio(4).
  - Simplify the prohibition on modifying buffers while requests are in
flight.
  - Fix case mismatch.
  - Drop note about not using stack variables. C programmers should be able
to figure out if a stack variable is safe based on the later warning
about the life cycle requirements of control blocks.
  - Remove prohibition on modifying the I/O buffer for aio_fsync() since
it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
prohibit modifications to the memory backing the buffer (stores into
the pages backing the buffer).
  
  Approved by:  re (kib)

Modified:
  releng/11.0/lib/libc/sys/aio_fsync.2
  releng/11.0/lib/libc/sys/aio_mlock.2
  releng/11.0/lib/libc/sys/aio_read.2
  releng/11.0/lib/libc/sys/aio_write.2
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/lib/libc/sys/aio_fsync.2
==
--- releng/11.0/lib/libc/sys/aio_fsync.2Mon Aug 22 20:22:40 2016
(r304633)
+++ releng/11.0/lib/libc/sys/aio_fsync.2Mon Aug 22 20:23:39 2016
(r304634)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 21, 2016
+.Dd August 19, 2016
 .Dt AIO_FSYNC 2
 .Os
 .Sh NAME
@@ -74,16 +74,14 @@ the call returns without having enqueued
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
-The asynchronous I/O Control Block structure pointed to by
+The Asynchronous I/O Control Block structure pointed to by
 .Fa iocb
 must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -91,9 +89,8 @@ should be zeroed before the
 .Fn aio_fsync
 call to avoid passing bogus context information to the kernel.
 .Pp
-Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+Modification of the Asynchronous I/O Control Block structure is not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_fsync
 .Sh ERRORS

Modified: releng/11.0/lib/libc/sys/aio_mlock.2
==
--- releng/11.0/lib/libc/sys/aio_mlock.2Mon Aug 22 20:22:40 2016
(r304633)
+++ releng/11.0/lib/libc/sys/aio_mlock.2Mon Aug 22 20:23:39 2016
(r304634)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 21, 2016
+.Dd August 19, 2016
 .Dt AIO_MLOCK 2
 .Os
 .Sh NAME
@@ -67,7 +67,7 @@ then the call returns without having enq
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
@@ -77,8 +77,6 @@ and the buffer that the
 .Fa iocb->aio_buf
 member of that structure references must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -87,8 +85,8 @@ should be zeroed before the
 call to avoid passing bogus context information to the kernel.
 .Pp
 Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+memory mapping described by the virtual address range are not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_mlock
 .Sh ERRORS

Modified: releng/11.0/lib/libc/sys/aio_read.2
==
--- releng/11.0/lib/libc/sys/aio_read.2 Mon Aug 22 20:22:40 2016
(r304633)
+++ releng/11.0/lib/libc/sys/aio_read.2 Mon Aug 22 20:23:39 2016
(r304634)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 21, 2016
+.Dd August 19, 2016
 .Dt AIO_READ 2
 .Os
 .Sh NAME
@@ -82,7 +82,7 @@ not be referenced after the request is e
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
@@ -92,8 +92,6 @@ and the buffer that the
 .F

svn commit: r304629 - head/sys/dev/usb/controller

2016-08-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Aug 22 19:32:50 2016
New Revision: 304629
URL: https://svnweb.freebsd.org/changeset/base/304629

Log:
  Don't separate the status stage of the XHCI USB control transfers into
  its own job because this breaks the simplified QEMU XHCI TRB parser,
  which expects the complete USB control transfer as a series of back to
  back TRBs. The old behaviour is kept under #ifdef in case this change
  breaks enumeration of any USB devices.
  
  PR:   212021
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Mon Aug 22 19:28:54 2016
(r304628)
+++ head/sys/dev/usb/controller/xhci.c  Mon Aug 22 19:32:50 2016
(r304629)
@@ -2221,7 +2221,11 @@ xhci_setup_generic_chain(struct usb_xfer
 * Send a DATA1 message and invert the current
 * endpoint direction.
 */
+#ifdef XHCI_STEP_STATUS_STAGE
temp.step_td = (xfer->nframes != 0);
+#else
+   temp.step_td = 0;
+#endif
temp.direction = UE_GET_DIR(xfer->endpointno) ^ UE_DIR_IN;
temp.len = 0;
temp.pc = NULL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304626 - head/lib/libpam/modules/pam_ssh

2016-08-22 Thread Ollivier Robert
Author: roberto
Date: Mon Aug 22 19:27:20 2016
New Revision: 304626
URL: https://svnweb.freebsd.org/changeset/base/304626

Log:
  Add support for Ed25519 keys.
  
  Reported by:  mwlucas
  MFH:  2 weeks

Modified:
  head/lib/libpam/modules/pam_ssh/pam_ssh.8
  head/lib/libpam/modules/pam_ssh/pam_ssh.c

Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8
==
--- head/lib/libpam/modules/pam_ssh/pam_ssh.8   Mon Aug 22 19:05:11 2016
(r304625)
+++ head/lib/libpam/modules/pam_ssh/pam_ssh.8   Mon Aug 22 19:27:20 2016
(r304626)
@@ -137,6 +137,8 @@ SSH2 RSA key
 SSH2 DSA key
 .It Pa $HOME/.ssh/id_ecdsa
 SSH2 ECDSA key
+.It Pa $HOME/.ssh/id_ed25519
+SSH2 Ed25519 key
 .El
 .Sh SEE ALSO
 .Xr ssh-agent 1 ,

Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c
==
--- head/lib/libpam/modules/pam_ssh/pam_ssh.c   Mon Aug 22 19:05:11 2016
(r304625)
+++ head/lib/libpam/modules/pam_ssh/pam_ssh.c   Mon Aug 22 19:27:20 2016
(r304626)
@@ -81,6 +81,7 @@ static const char *pam_ssh_keyfiles[] = 
".ssh/id_rsa",  /* SSH2 RSA key */
".ssh/id_dsa",  /* SSH2 DSA key */
".ssh/id_ecdsa",/* SSH2 ECDSA key */
+   ".ssh/id_ed25519",  /* SSH2 Ed25519 key */
NULL
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304560 - head/release/doc/en_US.ISO8859-1/hardware

2016-08-22 Thread John Baldwin
On Sunday, August 21, 2016 03:39:46 PM Benjamin Kaduk wrote:
> Author: bjk (doc committer)
> Date: Sun Aug 21 15:39:46 2016
> New Revision: 304560
> URL: https://svnweb.freebsd.org/changeset/base/304560
> 
> Log:
>   Remove the ie(4) hardware list from the release documentation
>   
>   The driver was removed by jhb in r304513, and the &hwlist.ie; entity
>   is no longer generated, causing the website build to fail.

Sorry, I had grepped for other drivers but missed this one. :(

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


svn commit: r304625 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 19:05:11 2016
New Revision: 304625
URL: https://svnweb.freebsd.org/changeset/base/304625

Log:
  Fix the arm64 non-SMP build, active_irq is a uint64_t so cast it through
  a uintmax_t.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/gic_v3.c

Modified: head/sys/arm64/arm64/gic_v3.c
==
--- head/sys/arm64/arm64/gic_v3.c   Mon Aug 22 18:50:57 2016
(r304624)
+++ head/sys/arm64/arm64/gic_v3.c   Mon Aug 22 19:05:11 2016
(r304625)
@@ -408,8 +408,8 @@ arm_gic_v3_intr(void *arg)
 #ifdef SMP
intr_ipi_dispatch(sgi_to_ipi[gi->gi_irq], tf);
 #else
-   device_printf(sc->dev, "SGI %u on UP system detected\n",
-   active_irq - GIC_FIRST_SGI);
+   device_printf(sc->dev, "SGI %ju on UP system 
detected\n",
+   (uintmax_t)(active_irq - GIC_FIRST_SGI));
 #endif
} else if (active_irq >= GIC_FIRST_PPI &&
active_irq <= GIC_LAST_SPI) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304624 - head/crypto/heimdal/lib/hx509

2016-08-22 Thread Ed Maste
Author: emaste
Date: Mon Aug 22 18:50:57 2016
New Revision: 304624
URL: https://svnweb.freebsd.org/changeset/base/304624

Log:
  Remove duplicate symbol from libhx509 version-script.map
  
  Upstream commit r21331 (7758a5d0) added semiprivate function
  _hx509_request_to_pkcs10 twice. This change has been committed upstream
  as 8ef0071d.

Modified:
  head/crypto/heimdal/lib/hx509/version-script.map

Modified: head/crypto/heimdal/lib/hx509/version-script.map
==
--- head/crypto/heimdal/lib/hx509/version-script.mapMon Aug 22 18:33:56 
2016(r304623)
+++ head/crypto/heimdal/lib/hx509/version-script.mapMon Aug 22 18:50:57 
2016(r304624)
@@ -23,7 +23,6 @@ HEIMDAL_X509_1.2 {
_hx509_request_print;
_hx509_request_set_email;
_hx509_request_to_pkcs10;
-   _hx509_request_to_pkcs10;
_hx509_unmap_file_os;
_hx509_write_file;
hx509_bitstring_print;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304623 - head/sys/arm/arm

2016-08-22 Thread Emmanuel Vadot
Author: manu
Date: Mon Aug 22 18:33:56 2016
New Revision: 304623
URL: https://svnweb.freebsd.org/changeset/base/304623

Log:
  Fix building for ARM kernel that have FLASHADDR, PHYSADDR and LOADERRAMADDR 
defined.
  
  Pointy Hat: myself
  
  Reported by:  bz

Modified:
  head/sys/arm/arm/elf_trampoline.c

Modified: head/sys/arm/arm/elf_trampoline.c
==
--- head/sys/arm/arm/elf_trampoline.c   Mon Aug 22 18:19:46 2016
(r304622)
+++ head/sys/arm/arm/elf_trampoline.c   Mon Aug 22 18:33:56 2016
(r304623)
@@ -228,7 +228,7 @@ _startC(unsigned r0, unsigned r1, unsign
"mov pc, %0\n"
: : "r" (target_addr), "r" (tmp_sp),
"r" (s_boot_params.abp_r0), "r" (s_boot_params.abp_r1),
-   "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3),
+   "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3)
: "r0", "r1", "r2", "r3");
 
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304622 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 18:19:46 2016
New Revision: 304622
URL: https://svnweb.freebsd.org/changeset/base/304622

Log:
  Ensure map is valid, even before userland exists and the fault address
  register points to an address in the userland range.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 week
  Sponsored by: the FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==
--- head/sys/arm64/arm64/trap.c Mon Aug 22 18:17:29 2016(r304621)
+++ head/sys/arm64/arm64/trap.c Mon Aug 22 18:19:46 2016(r304622)
@@ -184,10 +184,13 @@ data_abort(struct trapframe *frame, uint
map = &p->p_vmspace->vm_map;
else {
/* The top bit tells us which range to use */
-   if ((far >> 63) == 1)
+   if ((far >> 63) == 1) {
map = kernel_map;
-   else
+   } else {
map = &p->p_vmspace->vm_map;
+   if (map == NULL)
+   map = kernel_map;
+   }
}
 
if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304621 - in head/share/man/man4: . man4.i386

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 18:17:29 2016
New Revision: 304621
URL: https://svnweb.freebsd.org/changeset/base/304621

Log:
  Remove cross references to el(4) and ie(4).

Modified:
  head/share/man/man4/man4.i386/ep.4
  head/share/man/man4/sn.4

Modified: head/share/man/man4/man4.i386/ep.4
==
--- head/share/man/man4/man4.i386/ep.4  Mon Aug 22 18:12:44 2016
(r304620)
+++ head/share/man/man4/man4.i386/ep.4  Mon Aug 22 18:17:29 2016
(r304621)
@@ -200,8 +200,6 @@ This should never happen.
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr ed 4 ,
-.Xr el 4 ,
-.Xr ie 4 ,
 .Xr intro 4 ,
 .Xr ng_ether 4 ,
 .Xr sn 4 ,

Modified: head/share/man/man4/sn.4
==
--- head/share/man/man4/sn.4Mon Aug 22 18:12:44 2016(r304620)
+++ head/share/man/man4/sn.4Mon Aug 22 18:17:29 2016(r304621)
@@ -97,7 +97,6 @@ driver.
 .Sh SEE ALSO
 .Xr ed 4 ,
 .Xr ep 4 ,
-.Xr ie 4 ,
 .Xr intro 4 ,
 .Xr ng_ether 4 ,
 .Xr vx 4 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304620 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 18:12:44 2016
New Revision: 304620
URL: https://svnweb.freebsd.org/changeset/base/304620

Log:
  Fix pmap_update_entry, pmap_invalidate_range takes the end address, not
  the size.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Aug 22 18:12:24 2016(r304619)
+++ head/sys/arm64/arm64/pmap.c Mon Aug 22 18:12:44 2016(r304620)
@@ -2290,7 +2290,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_
/* Clear the old mapping */
pmap_load_clear(pte);
PTE_SYNC(pte);
-   pmap_invalidate_range(pmap, va, size);
+   pmap_invalidate_range(pmap, va, va + size);
 
/* Create the new mapping */
pmap_load_store(pte, newpte);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304619 - in stable: 10/sys/sys 9/sys/sys

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 18:12:24 2016
New Revision: 304619
URL: https://svnweb.freebsd.org/changeset/base/304619

Log:
  MFC 302379: Correct locking annotation for p_comm.
  
  p_comm is changed during exec, it is not read-only after fork.

Modified:
  stable/9/sys/sys/proc.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/sys/proc.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/sys/sys/proc.h
==
--- stable/9/sys/sys/proc.h Mon Aug 22 17:53:18 2016(r304618)
+++ stable/9/sys/sys/proc.h Mon Aug 22 18:12:24 2016(r304619)
@@ -558,7 +558,7 @@ struct proc {
u_int   p_magic;/* (b) Magic number. */
int p_osrel;/* (x) osreldate for the
   binary (from ELF note, if any) */
-   charp_comm[MAXCOMLEN + 1];  /* (b) Process name. */
+   charp_comm[MAXCOMLEN + 1];  /* (x) Process name. */
struct pgrp *p_pgrp;/* (c + e) Pointer to process group. */
struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */
struct pargs*p_args;/* (c) Process arguments. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304619 - in stable: 10/sys/sys 9/sys/sys

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 18:12:24 2016
New Revision: 304619
URL: https://svnweb.freebsd.org/changeset/base/304619

Log:
  MFC 302379: Correct locking annotation for p_comm.
  
  p_comm is changed during exec, it is not read-only after fork.

Modified:
  stable/10/sys/sys/proc.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/sys/sys/proc.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/10/sys/sys/proc.h
==
--- stable/10/sys/sys/proc.hMon Aug 22 17:53:18 2016(r304618)
+++ stable/10/sys/sys/proc.hMon Aug 22 18:12:24 2016(r304619)
@@ -564,7 +564,7 @@ struct proc {
u_int   p_magic;/* (b) Magic number. */
int p_osrel;/* (x) osreldate for the
   binary (from ELF note, if any) */
-   charp_comm[MAXCOMLEN + 1];  /* (b) Process name. */
+   charp_comm[MAXCOMLEN + 1];  /* (x) Process name. */
void*p_pad0;
struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */
struct pargs*p_args;/* (c) Process arguments. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304618 - head/share/man/man5

2016-08-22 Thread Ed Maste
Author: emaste
Date: Mon Aug 22 17:53:18 2016
New Revision: 304618
URL: https://svnweb.freebsd.org/changeset/base/304618

Log:
  Regenerate src.conf.5 after r304616

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Mon Aug 22 17:52:10 2016
(r304617)
+++ head/share/man/man5/src.conf.5  Mon Aug 22 17:53:18 2016
(r304618)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z 
bdrewery
 .\" $FreeBSD$
-.Dd July 28, 2016
+.Dd August 22, 2016
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -479,9 +479,15 @@ When set, it also enforces the following
 .It
 .Va WITHOUT_CLANG_FULL
 .It
+.Va WITHOUT_DTRACE_TESTS
+.It
 .Va WITHOUT_GNUCXX
 .It
 .Va WITHOUT_GROFF
+.It
+.Va WITHOUT_TESTS
+.It
+.Va WITHOUT_TESTS_SUPPORT
 .El
 .It Va WITHOUT_DEBUG_FILES
 .\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 
2015-10-27 20:49:56Z emaste
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304617 - in stable: 10/lib/libc/sys 11/lib/libc/sys 9/lib/libc/sys

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 17:52:10 2016
New Revision: 304617
URL: https://svnweb.freebsd.org/changeset/base/304617

Log:
  MFC 304476: Fix various nits in the aio operation manpages.
  
  - Avoid double use of "request" in a single sentence.  Instead, describe
aio_sigevent as being used to request notification of the associated
operation's completion.  This matches the language used to describe
aio_sigevent in aio(4).
  - Simplify the prohibition on modifying buffers while requests are in
flight.
  - Fix case mismatch.
  - Drop note about not using stack variables. C programmers should be able
to figure out if a stack variable is safe based on the later warning
about the life cycle requirements of control blocks.
  - Remove prohibition on modifying the I/O buffer for aio_fsync() since
it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
prohibit modifications to the memory backing the buffer (stores into
the pages backing the buffer).

Modified:
  stable/9/lib/libc/sys/aio_fsync.2
  stable/9/lib/libc/sys/aio_read.2
  stable/9/lib/libc/sys/aio_write.2
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/lib/libc/sys/aio_fsync.2
  stable/10/lib/libc/sys/aio_mlock.2
  stable/10/lib/libc/sys/aio_read.2
  stable/10/lib/libc/sys/aio_write.2
  stable/11/lib/libc/sys/aio_fsync.2
  stable/11/lib/libc/sys/aio_mlock.2
  stable/11/lib/libc/sys/aio_read.2
  stable/11/lib/libc/sys/aio_write.2
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/9/lib/libc/sys/aio_fsync.2
==
--- stable/9/lib/libc/sys/aio_fsync.2   Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/9/lib/libc/sys/aio_fsync.2   Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd August 19, 2016
 .Dt AIO_FSYNC 2
 .Os
 .Sh NAME
@@ -74,16 +74,14 @@ the call returns without having enqueued
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
-The asynchronous I/O Control Block structure pointed to by
+The Asynchronous I/O Control Block structure pointed to by
 .Fa iocb
 must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -91,9 +89,8 @@ should be zeroed before the
 .Fn aio_fsync
 call to avoid passing bogus context information to the kernel.
 .Pp
-Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+Modification of the Asynchronous I/O Control Block structure is not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_fsync
 .Sh ERRORS

Modified: stable/9/lib/libc/sys/aio_read.2
==
--- stable/9/lib/libc/sys/aio_read.2Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/9/lib/libc/sys/aio_read.2Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd August 19, 2016
 .Dt AIO_READ 2
 .Os
 .Sh NAME
@@ -82,7 +82,7 @@ not be referenced after the request is e
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
@@ -92,8 +92,6 @@ and the buffer that the
 .Fa iocb->aio_buf
 member of that structure references must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -102,8 +100,7 @@ should be zeroed before the
 call to avoid passing bogus context information to the kernel.
 .Pp
 Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+buffer contents are not allowed while the request is queued.
 .Pp
 If the file offset in
 .Fa iocb->aio_offset

Modified: stable/9/lib/libc/sys/aio_write.2
==
--- stable/9/lib/libc/sys/aio_write.2   Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/9/lib/libc/sys/aio_write.2   Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd August 19, 2016
 .Dt AIO_WRITE 2
 .Os
 .Sh NAME

svn commit: r304617 - in stable: 10/lib/libc/sys 11/lib/libc/sys 9/lib/libc/sys

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 17:52:10 2016
New Revision: 304617
URL: https://svnweb.freebsd.org/changeset/base/304617

Log:
  MFC 304476: Fix various nits in the aio operation manpages.
  
  - Avoid double use of "request" in a single sentence.  Instead, describe
aio_sigevent as being used to request notification of the associated
operation's completion.  This matches the language used to describe
aio_sigevent in aio(4).
  - Simplify the prohibition on modifying buffers while requests are in
flight.
  - Fix case mismatch.
  - Drop note about not using stack variables. C programmers should be able
to figure out if a stack variable is safe based on the later warning
about the life cycle requirements of control blocks.
  - Remove prohibition on modifying the I/O buffer for aio_fsync() since
it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
prohibit modifications to the memory backing the buffer (stores into
the pages backing the buffer).

Modified:
  stable/10/lib/libc/sys/aio_fsync.2
  stable/10/lib/libc/sys/aio_mlock.2
  stable/10/lib/libc/sys/aio_read.2
  stable/10/lib/libc/sys/aio_write.2
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/lib/libc/sys/aio_fsync.2
  stable/11/lib/libc/sys/aio_mlock.2
  stable/11/lib/libc/sys/aio_read.2
  stable/11/lib/libc/sys/aio_write.2
  stable/9/lib/libc/sys/aio_fsync.2
  stable/9/lib/libc/sys/aio_read.2
  stable/9/lib/libc/sys/aio_write.2
Directory Properties:
  stable/11/   (props changed)
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Modified: stable/10/lib/libc/sys/aio_fsync.2
==
--- stable/10/lib/libc/sys/aio_fsync.2  Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/10/lib/libc/sys/aio_fsync.2  Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd August 19, 2016
 .Dt AIO_FSYNC 2
 .Os
 .Sh NAME
@@ -74,16 +74,14 @@ the call returns without having enqueued
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
-The asynchronous I/O Control Block structure pointed to by
+The Asynchronous I/O Control Block structure pointed to by
 .Fa iocb
 must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -91,9 +89,8 @@ should be zeroed before the
 .Fn aio_fsync
 call to avoid passing bogus context information to the kernel.
 .Pp
-Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+Modification of the Asynchronous I/O Control Block structure is not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_fsync
 .Sh ERRORS

Modified: stable/10/lib/libc/sys/aio_mlock.2
==
--- stable/10/lib/libc/sys/aio_mlock.2  Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/10/lib/libc/sys/aio_mlock.2  Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd August 19, 2016
 .Dt AIO_MLOCK 2
 .Os
 .Sh NAME
@@ -67,7 +67,7 @@ then the call returns without having enq
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
@@ -77,8 +77,6 @@ and the buffer that the
 .Fa iocb->aio_buf
 member of that structure references must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -87,8 +85,8 @@ should be zeroed before the
 call to avoid passing bogus context information to the kernel.
 .Pp
 Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+memory mapping described by the virtual address range are not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_mlock
 .Sh ERRORS

Modified: stable/10/lib/libc/sys/aio_read.2
==
--- stable/10/lib/libc/sys/aio_read.2   Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/10/lib/libc/sys/aio_read.2   Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd Augus

svn commit: r304617 - in stable: 10/lib/libc/sys 11/lib/libc/sys 9/lib/libc/sys

2016-08-22 Thread John Baldwin
Author: jhb
Date: Mon Aug 22 17:52:10 2016
New Revision: 304617
URL: https://svnweb.freebsd.org/changeset/base/304617

Log:
  MFC 304476: Fix various nits in the aio operation manpages.
  
  - Avoid double use of "request" in a single sentence.  Instead, describe
aio_sigevent as being used to request notification of the associated
operation's completion.  This matches the language used to describe
aio_sigevent in aio(4).
  - Simplify the prohibition on modifying buffers while requests are in
flight.
  - Fix case mismatch.
  - Drop note about not using stack variables. C programmers should be able
to figure out if a stack variable is safe based on the later warning
about the life cycle requirements of control blocks.
  - Remove prohibition on modifying the I/O buffer for aio_fsync() since
it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
prohibit modifications to the memory backing the buffer (stores into
the pages backing the buffer).

Modified:
  stable/11/lib/libc/sys/aio_fsync.2
  stable/11/lib/libc/sys/aio_mlock.2
  stable/11/lib/libc/sys/aio_read.2
  stable/11/lib/libc/sys/aio_write.2
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/lib/libc/sys/aio_fsync.2
  stable/10/lib/libc/sys/aio_mlock.2
  stable/10/lib/libc/sys/aio_read.2
  stable/10/lib/libc/sys/aio_write.2
  stable/9/lib/libc/sys/aio_fsync.2
  stable/9/lib/libc/sys/aio_read.2
  stable/9/lib/libc/sys/aio_write.2
Directory Properties:
  stable/10/   (props changed)
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Modified: stable/11/lib/libc/sys/aio_fsync.2
==
--- stable/11/lib/libc/sys/aio_fsync.2  Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/11/lib/libc/sys/aio_fsync.2  Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 21, 2016
+.Dd August 19, 2016
 .Dt AIO_FSYNC 2
 .Os
 .Sh NAME
@@ -74,16 +74,14 @@ the call returns without having enqueued
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
-The asynchronous I/O Control Block structure pointed to by
+The Asynchronous I/O Control Block structure pointed to by
 .Fa iocb
 must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -91,9 +89,8 @@ should be zeroed before the
 .Fn aio_fsync
 call to avoid passing bogus context information to the kernel.
 .Pp
-Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+Modification of the Asynchronous I/O Control Block structure is not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_fsync
 .Sh ERRORS

Modified: stable/11/lib/libc/sys/aio_mlock.2
==
--- stable/11/lib/libc/sys/aio_mlock.2  Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/11/lib/libc/sys/aio_mlock.2  Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 21, 2016
+.Dd August 19, 2016
 .Dt AIO_MLOCK 2
 .Os
 .Sh NAME
@@ -67,7 +67,7 @@ then the call returns without having enq
 .Pp
 The
 .Fa iocb->aio_sigevent
-structure can be used to request notification of the request's
+structure can be used to request notification of the operation's
 completion as described in
 .Xr aio 4 .
 .Sh RESTRICTIONS
@@ -77,8 +77,6 @@ and the buffer that the
 .Fa iocb->aio_buf
 member of that structure references must remain valid until the
 operation has completed.
-For this reason, use of auto (stack) variables
-for these objects is discouraged.
 .Pp
 The asynchronous I/O control buffer
 .Fa iocb
@@ -87,8 +85,8 @@ should be zeroed before the
 call to avoid passing bogus context information to the kernel.
 .Pp
 Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
+memory mapping described by the virtual address range are not allowed
+while the request is queued.
 .Sh RETURN VALUES
 .Rv -std aio_mlock
 .Sh ERRORS

Modified: stable/11/lib/libc/sys/aio_read.2
==
--- stable/11/lib/libc/sys/aio_read.2   Mon Aug 22 17:45:30 2016
(r304616)
+++ stable/11/lib/libc/sys/aio_read.2   Mon Aug 22 17:52:10 2016
(r304617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 21, 2016
+.Dd Augus

svn commit: r304616 - head/share/mk

2016-08-22 Thread Ed Maste
Author: emaste
Date: Mon Aug 22 17:45:30 2016
New Revision: 304616
URL: https://svnweb.freebsd.org/changeset/base/304616

Log:
  Forcibly disable MK_TESTS if building without C++
  
  Several atf components require C++, and the test suite is not usable
  if building WITHOUT_CXX.
  
  Reviewed by:  bdrewery, jmmv
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7597

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Mon Aug 22 17:37:31 2016(r304615)
+++ head/share/mk/src.opts.mk   Mon Aug 22 17:45:30 2016(r304616)
@@ -318,6 +318,7 @@ MK_KERBEROS:=   no
 MK_CLANG:= no
 MK_GROFF:= no
 MK_GNUCXX:=no
+MK_TESTS:= no
 .endif
 
 .if ${MK_MAIL} == "no"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304615 - in head/sys: conf contrib/cloudabi i386/cloudabi32 i386/conf

2016-08-22 Thread Ed Schouten
Author: ed
Date: Mon Aug 22 17:37:31 2016
New Revision: 304615
URL: https://svnweb.freebsd.org/changeset/base/304615

Log:
  Make CloudABI work on i386.
  
  Copy over amd64's cloudabi64_sysvec.c into i386 and tailor it to work.
  Again, we use a system call convention similar to FreeBSD, except that
  there is no support for indirect system calls (%eax == 0).
  
  Where i386 differs from amd64 is that we have to store thread/process
  entry arguments on the stack instead of using registers. We also have to
  put an extra pointer on the stack for TLS (for GSBASE). Place that
  pointer in the empty slot that is normally used to hold return
  addresses. That seems to keep the code simple.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D7590

Added:
  head/sys/contrib/cloudabi/cloudabi_vdso_i686.S   (contents, props changed)
  head/sys/i386/cloudabi32/
  head/sys/i386/cloudabi32/cloudabi32_sysvec.c
 - copied, changed from r304565, 
head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
Modified:
  head/sys/conf/files.i386
  head/sys/i386/conf/NOTES

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Mon Aug 22 17:23:27 2016(r304614)
+++ head/sys/conf/files.i386Mon Aug 22 17:37:31 2016(r304615)
@@ -7,6 +7,18 @@
 # limitations in config: backslash-newline doesn't work in strings, and
 # dependency lines other than the first are silently ignored.
 #
+cloudabi32_vdso.o  optionalcompat_cloudabi32   \
+   dependency  "$S/contrib/cloudabi/cloudabi_vdso_i686.S" \
+   compile-with"${CC} -x assembler-with-cpp -shared -nostdinc 
-nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds 
$S/contrib/cloudabi/cloudabi_vdso_i686.S -o ${.TARGET}" \
+   no-obj no-implicit-rule \
+   clean   "cloudabi32_vdso.o"
+#
+cloudabi32_vdso_blob.o optionalcompat_cloudabi32   \
+   dependency  "cloudabi32_vdso.o" \
+   compile-with"${OBJCOPY} --input-target binary --output-target 
elf32-i386-freebsd --binary-architecture i386 cloudabi32_vdso.o ${.TARGET}" \
+   no-implicit-rule\
+   clean   "cloudabi32_vdso_blob.o"
+#
 linux_genassym.o   optionalcompat_linux\
dependency  "$S/i386/linux/linux_genassym.c"\
compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
@@ -456,6 +468,7 @@ i386/bios/apm.c optional apm
 i386/bios/mca_machdep.coptional mca
 i386/bios/smapi.c  optional smapi
 i386/bios/smapi_bios.S optional smapi
+i386/cloudabi32/cloudabi32_sysvec.coptional compat_cloudabi32
 #i386/i386/apic_vector.s   optional apic
 i386/i386/atomic.c standard\
compile-with"${CC} -c ${CFLAGS} 
${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"

Added: head/sys/contrib/cloudabi/cloudabi_vdso_i686.S
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/contrib/cloudabi/cloudabi_vdso_i686.S  Mon Aug 22 17:37:31 
2016(r304615)
@@ -0,0 +1,477 @@
+// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors.
+//
+// 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+//
+// This file is automatically generated. Do not edit.
+//
+// Source: https://github.com/NuxiNL/cloudabi
+
+#define ENTRY(name)  \
+  .text; \
+  .p2align 2, 0x90;  \
+  .gl

svn commit: r304614 - in stable/11/sys: kern sys

2016-08-22 Thread Mark Johnston
Author: markj
Date: Mon Aug 22 17:23:27 2016
New Revision: 304614
URL: https://svnweb.freebsd.org/changeset/base/304614

Log:
  MFC r304440, r304487:
  Fix some handling of P2_PTRACE_FSTP.

Modified:
  stable/11/sys/kern/kern_fork.c
  stable/11/sys/kern/kern_sig.c
  stable/11/sys/kern/sys_process.c
  stable/11/sys/sys/proc.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_fork.c
==
--- stable/11/sys/kern/kern_fork.c  Mon Aug 22 17:21:45 2016
(r304613)
+++ stable/11/sys/kern/kern_fork.c  Mon Aug 22 17:23:27 2016
(r304614)
@@ -1075,7 +1075,7 @@ fork_return(struct thread *td, struct tr
 * parent's children, do it now.
 */
dbg = p->p_pptr->p_pptr;
-   proc_set_traced(p);
+   proc_set_traced(p, true);
CTR2(KTR_PTRACE,
"fork_return: attaching to new child pid %d: oppid %d",
p->p_pid, p->p_oppid);

Modified: stable/11/sys/kern/kern_sig.c
==
--- stable/11/sys/kern/kern_sig.c   Mon Aug 22 17:21:45 2016
(r304613)
+++ stable/11/sys/kern/kern_sig.c   Mon Aug 22 17:23:27 2016
(r304614)
@@ -2537,7 +2537,7 @@ ptracestop(struct thread *td, int sig)
 * a chance to report itself upon the next iteration.
 */
if ((td->td_dbgflags & TDB_FSTP) != 0 ||
-   ((p->p_flag & P2_PTRACE_FSTP) == 0 &&
+   ((p->p_flag2 & P2_PTRACE_FSTP) == 0 &&
p->p_xthread == NULL)) {
p->p_xsig = sig;
p->p_xthread = td;

Modified: stable/11/sys/kern/sys_process.c
==
--- stable/11/sys/kern/sys_process.cMon Aug 22 17:21:45 2016
(r304613)
+++ stable/11/sys/kern/sys_process.cMon Aug 22 17:23:27 2016
(r304614)
@@ -693,12 +693,13 @@ sys_ptrace(struct thread *td, struct ptr
 #endif
 
 void
-proc_set_traced(struct proc *p)
+proc_set_traced(struct proc *p, bool stop)
 {
 
PROC_LOCK_ASSERT(p, MA_OWNED);
p->p_flag |= P_TRACED;
-   p->p_flag2 |= P2_PTRACE_FSTP;
+   if (stop)
+   p->p_flag2 |= P2_PTRACE_FSTP;
p->p_ptevents = PTRACE_DEFAULT;
p->p_oppid = p->p_pptr->p_pid;
 }
@@ -910,7 +911,7 @@ kern_ptrace(struct thread *td, int req, 
switch (req) {
case PT_TRACE_ME:
/* set my trace flag and "owner" so it can read/write me */
-   proc_set_traced(p);
+   proc_set_traced(p, false);
if (p->p_flag & P_PPWAIT)
p->p_flag |= P_PPTRACE;
CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid);
@@ -927,7 +928,7 @@ kern_ptrace(struct thread *td, int req, 
 * The old parent is remembered so we can put things back
 * on a "detach".
 */
-   proc_set_traced(p);
+   proc_set_traced(p, true);
if (p->p_pptr != td->td_proc) {
proc_reparent(p, td->td_proc);
}

Modified: stable/11/sys/sys/proc.h
==
--- stable/11/sys/sys/proc.hMon Aug 22 17:21:45 2016(r304613)
+++ stable/11/sys/sys/proc.hMon Aug 22 17:23:27 2016(r304614)
@@ -1005,7 +1005,7 @@ void  proc_linkup(struct proc *p, struct 
 struct proc *proc_realparent(struct proc *child);
 void   proc_reap(struct thread *td, struct proc *p, int *status, int options);
 void   proc_reparent(struct proc *child, struct proc *newparent);
-void   proc_set_traced(struct proc *p);
+void   proc_set_traced(struct proc *p, bool stop);
 struct pstats *pstats_alloc(void);
 void   pstats_fork(struct pstats *src, struct pstats *dst);
 void   pstats_free(struct pstats *ps);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304613 - in stable/10/sys: kern sys

2016-08-22 Thread Mark Johnston
Author: markj
Date: Mon Aug 22 17:21:45 2016
New Revision: 304613
URL: https://svnweb.freebsd.org/changeset/base/304613

Log:
  MFC r304440, r304487:
  Fix some handling of P2_PTRACE_FSTP.

Modified:
  stable/10/sys/kern/kern_fork.c
  stable/10/sys/kern/kern_sig.c
  stable/10/sys/kern/sys_process.c
  stable/10/sys/sys/proc.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_fork.c
==
--- stable/10/sys/kern/kern_fork.c  Mon Aug 22 16:39:51 2016
(r304612)
+++ stable/10/sys/kern/kern_fork.c  Mon Aug 22 17:21:45 2016
(r304613)
@@ -1064,7 +1064,7 @@ fork_return(struct thread *td, struct tr
 * parent's children, do it now.
 */
dbg = p->p_pptr->p_pptr;
-   proc_set_traced(p);
+   proc_set_traced(p, true);
CTR2(KTR_PTRACE,
"fork_return: attaching to new child pid %d: oppid %d",
p->p_pid, p->p_oppid);

Modified: stable/10/sys/kern/kern_sig.c
==
--- stable/10/sys/kern/kern_sig.c   Mon Aug 22 16:39:51 2016
(r304612)
+++ stable/10/sys/kern/kern_sig.c   Mon Aug 22 17:21:45 2016
(r304613)
@@ -2510,7 +2510,7 @@ ptracestop(struct thread *td, int sig)
 * a chance to report itself upon the next iteration.
 */
if ((td->td_dbgflags & TDB_FSTP) != 0 ||
-   ((p->p_flag & P2_PTRACE_FSTP) == 0 &&
+   ((p->p_flag2 & P2_PTRACE_FSTP) == 0 &&
p->p_xthread == NULL)) {
p->p_xstat = sig;
p->p_xthread = td;

Modified: stable/10/sys/kern/sys_process.c
==
--- stable/10/sys/kern/sys_process.cMon Aug 22 16:39:51 2016
(r304612)
+++ stable/10/sys/kern/sys_process.cMon Aug 22 17:21:45 2016
(r304613)
@@ -649,12 +649,13 @@ sys_ptrace(struct thread *td, struct ptr
 #endif
 
 void
-proc_set_traced(struct proc *p)
+proc_set_traced(struct proc *p, bool stop)
 {
 
PROC_LOCK_ASSERT(p, MA_OWNED);
p->p_flag |= P_TRACED;
-   p->p_flag2 |= P2_PTRACE_FSTP;
+   if (stop)
+   p->p_flag2 |= P2_PTRACE_FSTP;
p->p_ptevents = PTRACE_DEFAULT;
p->p_oppid = p->p_pptr->p_pid;
 }
@@ -867,7 +868,7 @@ kern_ptrace(struct thread *td, int req, 
switch (req) {
case PT_TRACE_ME:
/* set my trace flag and "owner" so it can read/write me */
-   proc_set_traced(p);
+   proc_set_traced(p, false);
if (p->p_flag & P_PPWAIT)
p->p_flag |= P_PPTRACE;
CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid);
@@ -884,7 +885,7 @@ kern_ptrace(struct thread *td, int req, 
 * The old parent is remembered so we can put things back
 * on a "detach".
 */
-   proc_set_traced(p);
+   proc_set_traced(p, true);
if (p->p_pptr != td->td_proc) {
proc_reparent(p, td->td_proc);
}

Modified: stable/10/sys/sys/proc.h
==
--- stable/10/sys/sys/proc.hMon Aug 22 16:39:51 2016(r304612)
+++ stable/10/sys/sys/proc.hMon Aug 22 17:21:45 2016(r304613)
@@ -933,7 +933,7 @@ voidproc_linkup(struct proc *p, struct 
 struct proc *proc_realparent(struct proc *child);
 void   proc_reap(struct thread *td, struct proc *p, int *status, int options);
 void   proc_reparent(struct proc *child, struct proc *newparent);
-void   proc_set_traced(struct proc *p);
+void   proc_set_traced(struct proc *p, bool stop);
 struct pstats *pstats_alloc(void);
 void   pstats_fork(struct pstats *src, struct pstats *dst);
 void   pstats_free(struct pstats *ps);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304612 - head/sys/dev/usb/input

2016-08-22 Thread Bruce Evans
Author: bde
Date: Mon Aug 22 16:39:51 2016
New Revision: 304612
URL: https://svnweb.freebsd.org/changeset/base/304612

Log:
  Further fixes for translation of PrintScreen/SysRq.
  
  The previous fix was tested mainly on 3 AT keyboards with USB adaptors where
  it works.  1 USB keyboard doesn't translate Alt-PrintScreen, so the software
  has to do it.
  
  Reorganize a little to share some code and to not translate the unusual usb
  scan code0x8a unless an Alt modified is set.  Remove redundant check of Alt
  modifiers.  Translation now more clearly filters out Alt-PrintScreen before
  the check.
  
  The table of errors fixed in the previous commit had many bugs.  Correct
  table:
  
  K_RAW  Ctl-PrintScreen: E0-2A-E0-37 -> E0-37
  K_RAW  Alt-PrintScreen (with 4 comb. of Ctl/Shift): 79 -> 54
  K_RAW  Pause/Break (with 4 comb. of Alt/Shift): E0-46 -> E1-1D-45
  K_CODE PrintScreen (with 4 comb. of Ctl/Shift): 54 -> 5c
  K_CODE Alt-PrintScreen (with 4 comb. of Ctl/Shift): 7e -> 54
  K_CODE Pause/Break (with 8 comb. of Ctl/Alt/Shift): 6c -> 68
  
  That is 25 of 32 shift combinations for 2 keys fixed.  All 16 combinations
  were broken for K_CODE and thus also for K_XLATE.

Modified:
  head/sys/dev/usb/input/ukbd.c

Modified: head/sys/dev/usb/input/ukbd.c
==
--- head/sys/dev/usb/input/ukbd.c   Mon Aug 22 16:35:50 2016
(r304611)
+++ head/sys/dev/usb/input/ukbd.c   Mon Aug 22 16:39:51 2016
(r304612)
@@ -324,7 +324,7 @@ static const uint8_t ukbd_trtab[256] = {
NN, NN, NN, NN, 115, 108, 111, 113, /* 70 - 77 */
109, 110, 112, 118, 114, 116, 117, 119, /* 78 - 7F */
121, 120, NN, NN, NN, NN, NN, 123,  /* 80 - 87 */
-   124, 125, 84, 127, 128, NN, NN, NN, /* 88 - 8F */
+   124, 125, 126, 127, 128, NN, NN, NN,/* 88 - 8F */
129, 130, NN, NN, NN, NN, NN, NN,   /* 90 - 97 */
NN, NN, NN, NN, NN, NN, NN, NN, /* 98 - 9F */
NN, NN, NN, NN, NN, NN, NN, NN, /* A0 - A7 */
@@ -362,6 +362,7 @@ static void ukbd_timeout(void *);
 static voidukbd_set_leds(struct ukbd_softc *, uint8_t);
 static int ukbd_set_typematic(keyboard_t *, int);
 #ifdef UKBD_EMULATE_ATSCANCODE
+static uint32_tukbd_atkeycode(int, int);
 static int ukbd_key2scan(struct ukbd_softc *, int, int, int);
 #endif
 static uint32_tukbd_read_char(keyboard_t *, int);
@@ -1580,7 +1581,7 @@ ukbd_read(keyboard_t *kbd, int wait)
++(kbd->kb_count);
 
 #ifdef UKBD_EMULATE_ATSCANCODE
-   keycode = ukbd_trtab[KEY_INDEX(usbcode)];
+   keycode = ukbd_atkeycode(usbcode, sc->sc_ndata.modifiers);
if (keycode == NN) {
return -1;
}
@@ -1651,7 +1652,7 @@ next_code:
 
 #ifdef UKBD_EMULATE_ATSCANCODE
/* USB key index -> key code -> AT scan code */
-   keycode = ukbd_trtab[KEY_INDEX(usbcode)];
+   keycode = ukbd_atkeycode(usbcode, sc->sc_ndata.modifiers);
if (keycode == NN) {
return (NOKEY);
}
@@ -2060,6 +2061,31 @@ ukbd_set_typematic(keyboard_t *kbd, int 
 }
 
 #ifdef UKBD_EMULATE_ATSCANCODE
+static uint32_t
+ukbd_atkeycode(int usbcode, int shift)
+{
+   uint32_t keycode;
+
+   keycode = ukbd_trtab[KEY_INDEX(usbcode)];
+   /*
+* Translate Alt-PrintScreen to SysRq.
+*
+* Some or all AT keyboards connected through USB have already
+* mapped Alted PrintScreens to an unusual usbcode (0x8a).
+* ukbd_trtab translates this to 0x7e, and key2scan() would
+* translate that to 0x79 (Intl' 4).  Assume that if we have
+* an Alted 0x7e here then it actually is an Alted PrintScreen.
+*
+* The usual usbcode for all PrintScreens is 0x46.  ukbd_trtab
+* translates this to 0x5c, so the Alt check to classify 0x5c
+* is routine.
+*/
+   if ((keycode == 0x5c || keycode == 0x7e) &&
+   shift & (MOD_ALT_L | MOD_ALT_R))
+   return (0x54);
+   return (keycode);
+}
+
 static int
 ukbd_key2scan(struct ukbd_softc *sc, int code, int shift, int up)
 {
@@ -2082,7 +2108,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int
0x151,  /* PageDown */
0x152,  /* Insert */
0x153,  /* Delete */
-   0x146,  /* XXX Pause/Break */
+   0x146,  /* Pause/Break */
0x15b,  /* Win_L(Super_L) */
0x15c,  /* Win_R(Super_R) */
0x15d,  /* Application(Menu) */
@@ -2122,7 +2148,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int
}
/* PrintScreen */
if (code == 0x137 && (!(shift & (MOD_CONTROL_L | MOD_CONTROL_R |
-   MOD_ALT_L | MOD_ALT_R | MOD_SHIFT_L | MOD_SHIFT_R {
+   MOD_SHIFT_L | MOD_SHIFT_R {
code |= SCAN_PREFIX_SHIFT;
}
/* Pause/Break */
___

svn commit: r304611 - stable/10/sys/sys

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 16:35:50 2016
New Revision: 304611
URL: https://svnweb.freebsd.org/changeset/base/304611

Log:
  MFC r304608:
  
Bump __FreeBSD_version for C++11 thread_local support in r303795.
  
  PR:   192320

Modified:
  stable/10/sys/sys/param.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/sys/param.h
==
--- stable/10/sys/sys/param.h   Mon Aug 22 16:04:25 2016(r304610)
+++ stable/10/sys/sys/param.h   Mon Aug 22 16:35:50 2016(r304611)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1003505  /* Master, propagated to newvers */
+#define __FreeBSD_version 1003506  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304610 - releng/11.0/sys/sys

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 16:04:25 2016
New Revision: 304610
URL: https://svnweb.freebsd.org/changeset/base/304610

Log:
  MFS r304609:
  
MFC r304608:
  
  Bump __FreeBSD_version for C++11 thread_local support in r303795.
  
  PR: 192320
  Approved by:  re (gjb)

Modified:
  releng/11.0/sys/sys/param.h
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/sys/sys/param.h
==
--- releng/11.0/sys/sys/param.h Mon Aug 22 15:53:32 2016(r304609)
+++ releng/11.0/sys/sys/param.h Mon Aug 22 16:04:25 2016(r304610)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100121  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100122  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304609 - stable/11/sys/sys

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 15:53:32 2016
New Revision: 304609
URL: https://svnweb.freebsd.org/changeset/base/304609

Log:
  MFC r304608:
  
Bump __FreeBSD_version for C++11 thread_local support in r303795.
  
  PR:   192320

Modified:
  stable/11/sys/sys/param.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/param.h
==
--- stable/11/sys/sys/param.h   Mon Aug 22 15:52:03 2016(r304608)
+++ stable/11/sys/sys/param.h   Mon Aug 22 15:53:32 2016(r304609)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100500  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100501  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304608 - head/sys/sys

2016-08-22 Thread Bryan Drewery
Author: bdrewery
Date: Mon Aug 22 15:52:03 2016
New Revision: 304608
URL: https://svnweb.freebsd.org/changeset/base/304608

Log:
  Bump __FreeBSD_version for C++11 thread_local support in r303795.
  
  PR:   192320

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Aug 22 15:44:54 2016(r304607)
+++ head/sys/sys/param.hMon Aug 22 15:52:03 2016(r304608)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 122  /* Master, propagated to newvers */
+#define __FreeBSD_version 123  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304607 - head/lib/libc/stdio

2016-08-22 Thread Andrey A. Chernov
Author: ache
Date: Mon Aug 22 15:44:54 2016
New Revision: 304607
URL: https://svnweb.freebsd.org/changeset/base/304607

Log:
  Fix error processing.
  1) Don't forget to set __SERR on __slbexpand() error.
  2) Check for __fgetwc() errors using errno. Don't check for __SERR
  as PR suggested, it user-visible flag which can stick from previous
  functions and stdio code don't check it for this purpose.
  
  PR: 212033
  MFC after:  3 days

Modified:
  head/lib/libc/stdio/fgetwln.c

Modified: head/lib/libc/stdio/fgetwln.c
==
--- head/lib/libc/stdio/fgetwln.c   Mon Aug 22 15:27:37 2016
(r304606)
+++ head/lib/libc/stdio/fgetwln.c   Mon Aug 22 15:44:54 2016
(r304607)
@@ -33,6 +33,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
+#include 
 #include 
 #include 
 #include "un-namespace.h"
@@ -47,12 +48,15 @@ fgetwln_l(FILE * __restrict fp, size_t *
 {
wint_t wc;
size_t len;
+   int saverrno;
FIX_LOCALE(locale);
 
FLOCKFILE(fp);
ORIENT(fp, 1);
 
len = 0;
+   saverrno = errno;
+   errno = 0;
while ((wc = __fgetwc(fp, locale)) != WEOF) {
 #defineGROW512
if (len * sizeof(wchar_t) >= fp->_lb._size &&
@@ -61,19 +65,27 @@ fgetwln_l(FILE * __restrict fp, size_t *
*((wchar_t *)fp->_lb._base + len++) = wc;
if (wc == L'\n')
break;
+   errno = 0;
}
-   if (len == 0)
+   if (wc == WEOF && errno != 0)
goto error;
+   if (errno == 0)
+   errno = saverrno;
+   if (len == 0)
+   goto eof;
 
FUNLOCKFILE(fp);
*lenp = len;
return ((wchar_t *)fp->_lb._base);
 
 error:
+   fp->_flags |= __SERR;
+eof:
FUNLOCKFILE(fp);
*lenp = 0;
return (NULL);
 }
+
 wchar_t *
 fgetwln(FILE * __restrict fp, size_t *lenp)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304606 - head/sys/netinet

2016-08-22 Thread Ryan Stone
Author: rstone
Date: Mon Aug 22 15:27:37 2016
New Revision: 304606
URL: https://svnweb.freebsd.org/changeset/base/304606

Log:
  Temporarily disable the optimization from r304436
  
  r304436 attempted to optimize the handling of incoming UDP packet by only
  making an expensive call to in_broadcast() if the mbuf was marked as an
  broadcast packet.  Unfortunately, this cannot work in the case of point-to-
  point L2 protocols like PPP, which have no notion of "broadcast".
  
  Discussions on how to properly fix r304436 are ongoing, but in the meantime
  disable the optimization to ensure that no existing network setups are broken.
  
  Reported by:  bms

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Mon Aug 22 15:01:39 2016
(r304605)
+++ head/sys/netinet/udp_usrreq.c   Mon Aug 22 15:27:37 2016
(r304606)
@@ -126,7 +126,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac
 &VNET_NAME(udp_blackhole), 0,
 "Do not send port unreachables for refused connects");
 
-static VNET_DEFINE(int, udp_require_l2_bcast) = 1;
+static VNET_DEFINE(int, udp_require_l2_bcast) = 0;
 #defineV_udp_require_l2_bcast  VNET(udp_require_l2_bcast)
 SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | 
CTLFLAG_RW,
 &VNET_NAME(udp_require_l2_bcast), 0,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/z

2016-08-22 Thread Toomas Soome

> On 22. aug 2016, at 17:19, Warner Losh  wrote:
> 
> On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome  wrote:
>> I do suspect the size difference there is partially due to ficl, in illumos 
>> (ficl 4):
>> 
>> -rw-r--r--   1 tsoome   staff 132508 aug 22 09:18 libficl.a
>> 
>> and freebsd (ficl 3):
>> 
>> -rw-r--r--  1 root  wheel  213748 Aug 19 01:57 libficl.a
>> 
>> so, there definitely is some space…
> 
> Same compiler? Clang bloats the boot code rather substantially, even after
> all the flags to tell it to generate smaller code are used. gcc 4.2.x
> built stuff
> was substantially smaller.
> 
> There's a 520kb limit enforced in the boot1 for similar reasons. Looks like
> the combination of options makes us use just enough extra memory to
> sink the battleship...
> 
> Warner
> 


Actually I only now realized I was comparing apples with oranges… I forgot the 
fbsd builds 32bit version in ficl32, this one is 64bit. and yes the 32bit 
version is not that big at all:D

Also, after done some digging, I have found few instances of duplicated code 
(we can share sha2 with geli and so if sha512 is already needed, it will become 
another “free lunch”). Also, unless I’m mistaken, for some reason the bzip 
*compression* is brought in - correct me if I’m wrong, but afaik only 
decompression is needed…

So before going after “useless features”, there are some “hidden” resources to 
remove extra fat.

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

svn commit: r304605 - in head/usr.sbin: ctld iscsid

2016-08-22 Thread Marcelo Araujo
Author: araujo
Date: Mon Aug 22 15:01:39 2016
New Revision: 304605
URL: https://svnweb.freebsd.org/changeset/base/304605

Log:
  Fix calloc(3) argument order.
  
  Reviewed by:  trasz
  MFC after:4 weeks.
  Differential Revision:https://reviews.freebsd.org/D7532

Modified:
  head/usr.sbin/ctld/chap.c
  head/usr.sbin/ctld/keys.c
  head/usr.sbin/ctld/pdu.c
  head/usr.sbin/iscsid/chap.c
  head/usr.sbin/iscsid/keys.c
  head/usr.sbin/iscsid/pdu.c

Modified: head/usr.sbin/ctld/chap.c
==
--- head/usr.sbin/ctld/chap.c   Mon Aug 22 14:53:39 2016(r304604)
+++ head/usr.sbin/ctld/chap.c   Mon Aug 22 15:01:39 2016(r304605)
@@ -232,7 +232,7 @@ chap_new(void)
 {
struct chap *chap;
 
-   chap = calloc(sizeof(*chap), 1);
+   chap = calloc(1, sizeof(*chap));
if (chap == NULL)
log_err(1, "calloc");
 
@@ -333,7 +333,7 @@ rchap_new(const char *secret)
 {
struct rchap *rchap;
 
-   rchap = calloc(sizeof(*rchap), 1);
+   rchap = calloc(1, sizeof(*rchap));
if (rchap == NULL)
log_err(1, "calloc");
 

Modified: head/usr.sbin/ctld/keys.c
==
--- head/usr.sbin/ctld/keys.c   Mon Aug 22 14:53:39 2016(r304604)
+++ head/usr.sbin/ctld/keys.c   Mon Aug 22 15:01:39 2016(r304605)
@@ -43,7 +43,7 @@ keys_new(void)
 {
struct keys *keys;
 
-   keys = calloc(sizeof(*keys), 1);
+   keys = calloc(1, sizeof(*keys));
if (keys == NULL)
log_err(1, "calloc");
 

Modified: head/usr.sbin/ctld/pdu.c
==
--- head/usr.sbin/ctld/pdu.cMon Aug 22 14:53:39 2016(r304604)
+++ head/usr.sbin/ctld/pdu.cMon Aug 22 15:01:39 2016(r304605)
@@ -81,11 +81,11 @@ pdu_new(struct connection *conn)
 {
struct pdu *pdu;
 
-   pdu = calloc(sizeof(*pdu), 1);
+   pdu = calloc(1, sizeof(*pdu));
if (pdu == NULL)
log_err(1, "calloc");
 
-   pdu->pdu_bhs = calloc(sizeof(*pdu->pdu_bhs), 1);
+   pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs));
if (pdu->pdu_bhs == NULL)
log_err(1, "calloc");
 

Modified: head/usr.sbin/iscsid/chap.c
==
--- head/usr.sbin/iscsid/chap.c Mon Aug 22 14:53:39 2016(r304604)
+++ head/usr.sbin/iscsid/chap.c Mon Aug 22 15:01:39 2016(r304605)
@@ -232,7 +232,7 @@ chap_new(void)
 {
struct chap *chap;
 
-   chap = calloc(sizeof(*chap), 1);
+   chap = calloc(1, sizeof(*chap));
if (chap == NULL)
log_err(1, "calloc");
 
@@ -333,7 +333,7 @@ rchap_new(const char *secret)
 {
struct rchap *rchap;
 
-   rchap = calloc(sizeof(*rchap), 1);
+   rchap = calloc(1, sizeof(*rchap));
if (rchap == NULL)
log_err(1, "calloc");
 

Modified: head/usr.sbin/iscsid/keys.c
==
--- head/usr.sbin/iscsid/keys.c Mon Aug 22 14:53:39 2016(r304604)
+++ head/usr.sbin/iscsid/keys.c Mon Aug 22 15:01:39 2016(r304605)
@@ -43,7 +43,7 @@ keys_new(void)
 {
struct keys *keys;
 
-   keys = calloc(sizeof(*keys), 1);
+   keys = calloc(1, sizeof(*keys));
if (keys == NULL)
log_err(1, "calloc");
 

Modified: head/usr.sbin/iscsid/pdu.c
==
--- head/usr.sbin/iscsid/pdu.c  Mon Aug 22 14:53:39 2016(r304604)
+++ head/usr.sbin/iscsid/pdu.c  Mon Aug 22 15:01:39 2016(r304605)
@@ -81,11 +81,11 @@ pdu_new(struct connection *conn)
 {
struct pdu *pdu;
 
-   pdu = calloc(sizeof(*pdu), 1);
+   pdu = calloc(1, sizeof(*pdu));
if (pdu == NULL)
log_err(1, "calloc");
 
-   pdu->pdu_bhs = calloc(sizeof(*pdu->pdu_bhs), 1);
+   pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs));
if (pdu->pdu_bhs == NULL)
log_err(1, "calloc");
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304604 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 14:53:39 2016
New Revision: 304604
URL: https://svnweb.freebsd.org/changeset/base/304604

Log:
  Use switch statements in pmap_remove_pages. While only one level of
  pagetable is supported more will be added soon to support removing
  superpages.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Aug 22 14:51:09 2016(r304603)
+++ head/sys/arm64/arm64/pmap.c Mon Aug 22 14:53:39 2016(r304604)
@@ -3115,14 +3115,21 @@ pmap_remove_pages(pmap_t pmap)
pde = pmap_pde(pmap, pv->pv_va, &lvl);
KASSERT(pde != NULL,
("Attempting to remove an unmapped page"));
-   KASSERT(lvl == 2,
-   ("Invalid page directory level: %d", lvl));
 
-   pte = pmap_l2_to_l3(pde, pv->pv_va);
-   KASSERT(pte != NULL,
-   ("Attempting to remove an unmapped page"));
-
-   tpte = pmap_load(pte);
+   switch(lvl) {
+   case 2:
+   pte = pmap_l2_to_l3(pde, pv->pv_va);
+   tpte = pmap_load(pte);
+   KASSERT((tpte & ATTR_DESCR_MASK) ==
+   L3_PAGE,
+   ("Attempting to remove an invalid "
+"page: %lx", tpte));
+   break;
+   default:
+   panic(
+   "Invalid page directory level: %d",
+   lvl);
+   }
 
 /*
  * We cannot remove wired pages from a process' mapping at this time
@@ -3156,18 +3163,27 @@ pmap_remove_pages(pmap_t pmap)
/*
 * Update the vm_page_t clean/reference bits.
 */
-   if ((tpte & ATTR_AP_RW_BIT) == 
ATTR_AP(ATTR_AP_RW))
-   vm_page_dirty(m);
+   if ((tpte & ATTR_AP_RW_BIT) ==
+   ATTR_AP(ATTR_AP_RW)) {
+   switch (lvl) {
+   case 2:
+   vm_page_dirty(m);
+   break;
+   }
+   }
 
CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m);
 
/* Mark free */
pc->pc_map[field] |= bitmask;
-
-   pmap_resident_count_dec(pmap, 1);
-   TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
-   m->md.pv_gen++;
-
+   switch (lvl) {
+   case 2:
+   pmap_resident_count_dec(pmap, 1);
+   TAILQ_REMOVE(&m->md.pv_list, pv,
+   pv_next);
+   m->md.pv_gen++;
+   break;
+   }
pmap_unuse_l3(pmap, pv->pv_va, pmap_load(pde),
&free);
freed++;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304603 - head/sys/dev/ioat

2016-08-22 Thread Conrad E. Meyer
Author: cem
Date: Mon Aug 22 14:51:09 2016
New Revision: 304603
URL: https://svnweb.freebsd.org/changeset/base/304603

Log:
  ioat(4): Allow callouts to be scheduled after hw reset
  
  is_completion_pending governs whether or not a callout will be scheduled
  when new work is queued on the IOAT device.  If true, a callout is
  already scheduled, so we do not need a new one.  If false, we schedule
  one and set it true.  Because resetting the hardware completed all
  outstanding work but failed to clear is_completion_pending, no new
  callout could be scheduled after a reset with pending work.
  
  This resulted in a driver hang for polled-only work.

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

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cMon Aug 22 14:51:07 2016(r304602)
+++ head/sys/dev/ioat/ioat.cMon Aug 22 14:51:09 2016(r304603)
@@ -768,6 +768,13 @@ ioat_process_events(struct ioat_softc *i
ioat->stats.descriptors_error++;
}
 
+   if (ioat->is_completion_pending) {
+   ioat->is_completion_pending = FALSE;
+   callout_reset(&ioat->shrink_timer, IOAT_SHRINK_PERIOD,
+   ioat_shrink_timer_callback, ioat);
+   callout_stop(&ioat->poll_timer);
+   }
+
/* Clear error status */
ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr);
 
@@ -1898,6 +1905,7 @@ ioat_reset_hw(struct ioat_softc *ioat)
ioat->tail = ioat->head = ioat->hw_head = 0;
ioat->last_seen = 0;
*ioat->comp_update = 0;
+   KASSERT(!ioat->is_completion_pending, ("bogus completion_pending"));
 
ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN);
ioat_write_chancmp(ioat, ioat->comp_update_bus_addr);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304602 - head/sys/dev/ioat

2016-08-22 Thread Conrad E. Meyer
Author: cem
Date: Mon Aug 22 14:51:07 2016
New Revision: 304602
URL: https://svnweb.freebsd.org/changeset/base/304602

Log:
  ioat(4): Don't process events past queue head
  
  Fix a race where the completion routine could overrun the active ring
  area in some situations.

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

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cMon Aug 22 13:43:25 2016(r304601)
+++ head/sys/dev/ioat/ioat.cMon Aug 22 14:51:07 2016(r304602)
@@ -678,19 +678,12 @@ ioat_process_events(struct ioat_softc *i
}
 
completed = 0;
-   comp_update = *ioat->comp_update;
+   comp_update = ioat_get_chansts(ioat);
+   CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx",
+   __func__, ioat->chan_idx, comp_update, ioat->last_seen);
status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK;
 
-   if (status == ioat->last_seen) {
-   /*
-* If we landed in process_events and nothing has been
-* completed, check for a timeout due to channel halt.
-*/
-   comp_update = ioat_get_chansts(ioat);
-   goto out;
-   }
-
-   while (1) {
+   while (ioat_get_active(ioat) > 0) {
desc = ioat_get_ring_entry(ioat, ioat->tail);
dmadesc = &desc->bus_dmadesc;
CTR4(KTR_IOAT, "channel=%u completing desc %u ok  cb %p(%p)",
@@ -704,17 +697,13 @@ ioat_process_events(struct ioat_softc *i
ioat->tail++;
if (desc->hw_desc_bus_addr == status)
break;
-
-   KASSERT(ioat_get_active(ioat) > 0, ("overrunning ring t:%u "
-   "h:%u st:0x%016lx last_seen:%016lx completed:%u\n",
-   ioat->tail, ioat->head, comp_update, ioat->last_seen,
-   completed));
}
 
-   ioat->last_seen = desc->hw_desc_bus_addr;
-   ioat->stats.descriptors_processed += completed;
+   if (completed != 0) {
+   ioat->last_seen = desc->hw_desc_bus_addr;
+   ioat->stats.descriptors_processed += completed;
+   }
 
-out:
ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN);
 
/* Perform a racy check first; only take the locks if it passes. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304548 - head/sys/netinet

2016-08-22 Thread Ryan Stone
Thanks!

On Sat, Aug 20, 2016 at 6:12 PM, Marko Zec  wrote:

> Author: zec
> Date: Sat Aug 20 22:12:26 2016
> New Revision: 304548
> URL: https://svnweb.freebsd.org/changeset/base/304548
>
> Log:
>   Permit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels.
>
>   The default value of the tunable introduced in r304436 couldn't be
>   effectively overrided on VIMAGE kernels, because instead of being
>   accessed via the appropriate VNET() accessor macro, it was accessed
>   via the VNET_NAME() macro, which resolves to the (should-be) read-only
>   master template of initial values of per-VNET data.  Hence, while the
>   value of udp_require_l2_bcast could be altered on per-VNET basis, the
>   code in udp_input() would ignore it as it would always read the default
>   value (one) from the VNET master template.
>
>   Silence from: rstone
>
> Modified:
>   head/sys/netinet/udp_usrreq.c
>
> Modified: head/sys/netinet/udp_usrreq.c
> 
> ==
> --- head/sys/netinet/udp_usrreq.c   Sat Aug 20 21:34:41 2016
> (r304547)
> +++ head/sys/netinet/udp_usrreq.c   Sat Aug 20 22:12:26 2016
> (r304548)
> @@ -127,6 +127,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac
>  "Do not send port unreachables for refused connects");
>
>  static VNET_DEFINE(int, udp_require_l2_bcast) = 1;
> +#defineV_udp_require_l2_bcast  VNET(udp_require_l2_bcast)
>  SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET |
> CTLFLAG_RW,
>  &VNET_NAME(udp_require_l2_bcast), 0,
>  "Only treat packets sent to an L2 broadcast address as broadcast
> packets");
> @@ -528,7 +529,7 @@ udp_input(struct mbuf **mp, int *offp, i
>
> pcbinfo = udp_get_inpcbinfo(proto);
> if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
> -   ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) &&
> +   ((!V_udp_require_l2_bcast || m->m_flags & M_BCAST) &&
> in_broadcast(ip->ip_dst, ifp))) {
> struct inpcb *last;
> struct inpcbhead *pcblist;
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/z

2016-08-22 Thread Warner Losh
On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome  wrote:
> I do suspect the size difference there is partially due to ficl, in illumos 
> (ficl 4):
>
> -rw-r--r--   1 tsoome   staff 132508 aug 22 09:18 libficl.a
>
> and freebsd (ficl 3):
>
> -rw-r--r--  1 root  wheel  213748 Aug 19 01:57 libficl.a
>
> so, there definitely is some space…

Same compiler? Clang bloats the boot code rather substantially, even after
all the flags to tell it to generate smaller code are used. gcc 4.2.x
built stuff
was substantially smaller.

There's a 520kb limit enforced in the boot1 for similar reasons. Looks like
the combination of options makes us use just enough extra memory to
sink the battleship...

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

Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs

2016-08-22 Thread Andriy Gapon
On 22/08/2016 16:54, Allan Jude wrote:
> On 2016-08-22 04:21, Andriy Gapon wrote:
>> On 01/08/2016 22:37, Allan Jude wrote:
>>> Author: allanjude
>>> Date: Mon Aug  1 19:37:43 2016
>>> New Revision: 303630
>>> URL: https://svnweb.freebsd.org/changeset/base/303630
>>>
>>> Log:
>>>   Make boot code and loader check for unsupported ZFS feature flags
>>>   
>>>   OpenZFS uses feature flags instead of a zpool version number to track
>>>   features since the split from Oracle. In addition to avoiding confusion
>>>   on ZFS vs OpenZFS version numbers, this also allows features to be added
>>>   to different operating systems that use OpenZFS in different order.
>>>   
>>>   The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly
>>>   tries to read the pool, and if failed provided only a vague error message.
>>>   
>>>   With this change, both the boot code and loader check the MOS features
>>>   list in the ZFS label and compare it against the list of features that
>>>   the loader supports. If any unsupported feature is active, the pool is
>>>   not considered as a candidate for booting, and a helpful diagnostic
>>>   message is printed to the screen. Features that are merely enabled via
>>>   zpool upgrade, but not in use, do not block booting from the pool.
>>>   
>>>   Submitted by: Toomas Soome 
>>>   Reviewed by:  delphij, mav
>>>   Relnotes: yes
>>>   Differential Revision:https://reviews.freebsd.org/D6857
>>
>> It is really great to get a helpful diagnostic message when an unsupported
>> feature is seen.  Thank you for that!
>>
>> But I would prefer that the check is done on a filesystem level, not on a 
>> pool
>> level.  That is, I would like to be able to enable features that are not
>> supported by ZFS boot chain on a boot pool as long as I do not enable such
>> features on a boot filesystem.  E.g., the large blocks support could be one 
>> of
>> such features.
> 
> This was my though originally, but it is not as easy to tell if a
> filesystem has ever used a feature. For pool wide, it is just a property.
> 
> Do you know of an easy way to get this information for a specific file
> system?

I do not know any as easy way as just querying the feature flags.

It's possible to query properties of a filesystem and reject any values that we
do not support.
Or we could do what we did before, that is, just try to read any data we need.
But if we encounter something that we do not understand we can fail with a nice
message (e.g. "unsupported checksum type foobar") instead of failing a "vague
error message" like we did before.

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


Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs

2016-08-22 Thread Allan Jude
On 2016-08-22 04:21, Andriy Gapon wrote:
> On 01/08/2016 22:37, Allan Jude wrote:
>> Author: allanjude
>> Date: Mon Aug  1 19:37:43 2016
>> New Revision: 303630
>> URL: https://svnweb.freebsd.org/changeset/base/303630
>>
>> Log:
>>   Make boot code and loader check for unsupported ZFS feature flags
>>   
>>   OpenZFS uses feature flags instead of a zpool version number to track
>>   features since the split from Oracle. In addition to avoiding confusion
>>   on ZFS vs OpenZFS version numbers, this also allows features to be added
>>   to different operating systems that use OpenZFS in different order.
>>   
>>   The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly
>>   tries to read the pool, and if failed provided only a vague error message.
>>   
>>   With this change, both the boot code and loader check the MOS features
>>   list in the ZFS label and compare it against the list of features that
>>   the loader supports. If any unsupported feature is active, the pool is
>>   not considered as a candidate for booting, and a helpful diagnostic
>>   message is printed to the screen. Features that are merely enabled via
>>   zpool upgrade, but not in use, do not block booting from the pool.
>>   
>>   Submitted by:  Toomas Soome 
>>   Reviewed by:   delphij, mav
>>   Relnotes:  yes
>>   Differential Revision: https://reviews.freebsd.org/D6857
> 
> It is really great to get a helpful diagnostic message when an unsupported
> feature is seen.  Thank you for that!
> 
> But I would prefer that the check is done on a filesystem level, not on a pool
> level.  That is, I would like to be able to enable features that are not
> supported by ZFS boot chain on a boot pool as long as I do not enable such
> features on a boot filesystem.  E.g., the large blocks support could be one of
> such features.

This was my though originally, but it is not as easy to tell if a
filesystem has ever used a feature. For pool wide, it is just a property.

Do you know of an easy way to get this information for a specific file
system?

> 
> And, as I've said in another email, I really do not think that we should 
> strive
> to support all possible (non-essential) ZFS features in the ZFS boot chain.
> 



-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r304601 - head/sys/dev/mlx5/mlx5_en

2016-08-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Aug 22 13:43:25 2016
New Revision: 304601
URL: https://svnweb.freebsd.org/changeset/base/304601

Log:
  Increase the maximum RX/TX queue size. This allows for a RX/TX queue
  size of 16384 mbufs. Previously the limit was 8192.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Mon Aug 22 12:56:40 2016
(r304600)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Mon Aug 22 13:43:25 2016
(r304601)
@@ -70,11 +70,11 @@
 
 #defineMLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE0x7
 #defineMLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE0xa
-#defineMLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE0xd
+#defineMLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE0xe
 
 #defineMLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE0x7
 #defineMLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE0xa
-#defineMLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE0xd
+#defineMLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE0xe
 
 /* freeBSD HW LRO is limited by 16KB - the size of max mbuf */
 #defineMLX5E_PARAMS_DEFAULT_LRO_WQE_SZ MJUM16BYTES
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304600 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 12:56:40 2016
New Revision: 304600
URL: https://svnweb.freebsd.org/changeset/base/304600

Log:
  Use pmap_update_entry in pmap_enter when updating an entry with a new
  physical address. This is required when either mapping is writeable.
  
  While here remove an unneeded call to pmap_pde, we already have the pde
  from earlier in the function.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Aug 22 12:17:40 2016(r304599)
+++ head/sys/arm64/arm64/pmap.c Mon Aug 22 12:56:40 2016(r304600)
@@ -2429,7 +2429,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
 
l3 = pmap_l2_to_l3(pde, va);
} else {
-   pde = pmap_pde(pmap, va, &lvl);
/*
 * If we get a level 2 pde it must point to a level 3 entry
 * otherwise we will need to create the intermediate tables
@@ -2572,10 +2571,11 @@ havel3:
 */
if (orig_l3 != 0) {
 validate:
-   orig_l3 = pmap_load_store(l3, new_l3);
+   orig_l3 = pmap_load(l3);
opa = orig_l3 & ~ATTR_MASK;
 
if (opa != pa) {
+   pmap_update_entry(pmap, l3, new_l3, va, PAGE_SIZE);
if ((orig_l3 & ATTR_SW_MANAGED) != 0) {
om = PHYS_TO_VM_PAGE(opa);
if (pmap_page_dirty(orig_l3))
@@ -2585,8 +2585,11 @@ validate:
CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa);
pmap_pvh_free(&om->md, pmap, va);
}
-   } else if (pmap_page_dirty(orig_l3)) {
-   if ((orig_l3 & ATTR_SW_MANAGED) != 0)
+   } else {
+   pmap_load_store(l3, new_l3);
+   PTE_SYNC(l3);
+   pmap_invalidate_page(pmap, va);
+   if (pmap_page_dirty(orig_l3) && (orig_l3 & 
ATTR_SW_MANAGED) != 0)
vm_page_dirty(m);
}
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304599 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 12:17:40 2016
New Revision: 304599
URL: https://svnweb.freebsd.org/changeset/base/304599

Log:
  Add sysctls to report on superpages statistics. While here add extra
  logging to these paths.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Aug 22 10:50:30 2016(r304598)
+++ head/sys/arm64/arm64/pmap.c Mon Aug 22 12:17:40 2016(r304599)
@@ -874,6 +874,21 @@ pmap_init(void)
rw_init(&pv_list_locks[i], "pmap pv list");
 }
 
+static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0,
+"2MB page mapping counters");
+
+static u_long pmap_l2_demotions;
+SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD,
+&pmap_l2_demotions, 0, "2MB page demotions");
+
+static u_long pmap_l2_p_failures;
+SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, p_failures, CTLFLAG_RD,
+&pmap_l2_p_failures, 0, "2MB page promotion failures");
+
+static u_long pmap_l2_promotions;
+SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLAG_RD,
+&pmap_l2_promotions, 0, "2MB page promotions");
+
 /*
  * Invalidate a single TLB entry.
  */
@@ -2309,14 +2324,22 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t 
return;
 
/* Check the alingment is valid */
-   if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0)
+   if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) {
+   atomic_add_long(&pmap_l2_p_failures, 1);
+   CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx"
+   " in pmap %p", va, pmap);
return;
+   }
 
pa = newl2 + L2_SIZE - PAGE_SIZE;
for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) {
oldl3 = pmap_load(l3);
-   if (oldl3 != pa)
+   if (oldl3 != pa) {
+   atomic_add_long(&pmap_l2_p_failures, 1);
+   CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx"
+   " in pmap %p", va, pmap);
return;
+   }
pa -= PAGE_SIZE;
}
 
@@ -2324,6 +2347,8 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t 
newl2 |= L2_BLOCK;
 
pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE);
+
+   atomic_add_long(&pmap_l2_promotions, 1);
 }
 
 /*
@@ -3745,6 +3770,10 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en
 
pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE);
 
+   atomic_add_long(&pmap_l2_demotions, 1);
+   CTR3(KTR_PMAP, "pmap_demote_l2: success for va %#lx"
+   " in pmap %p %lx", va, pmap, l3[0]);
+
if (tmpl2 != 0) {
pmap_kremove(tmpl2);
kva_free(tmpl2, PAGE_SIZE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304598 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 10:50:30 2016
New Revision: 304598
URL: https://svnweb.freebsd.org/changeset/base/304598

Log:
  Add a size argument to pmap_update_entry.
  Make use of this in pmap_promote_l2.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Aug 22 10:21:25 2016(r304597)
+++ head/sys/arm64/arm64/pmap.c Mon Aug 22 10:50:30 2016(r304598)
@@ -2258,7 +2258,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
  */
 static void
 pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte,
-vm_offset_t va)
+vm_offset_t va, vm_size_t size)
 {
register_t intr;
 
@@ -2275,7 +2275,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_
/* Clear the old mapping */
pmap_load_clear(pte);
PTE_SYNC(pte);
-   pmap_invalidate_page(pmap, va);
+   pmap_invalidate_range(pmap, va, size);
 
/* Create the new mapping */
pmap_load_store(pte, newpte);
@@ -2297,11 +2297,12 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t 
 struct rwlock **lockp)
 {
pt_entry_t *firstl3, *l3, newl2, oldl3, pa;
-   register_t intr;
+   vm_offset_t sva;
 
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
 
-   firstl3 = (pt_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK);
+   sva = va & ~L2_OFFSET;
+   firstl3 = pmap_l2_to_l3(l2, sva);
newl2 = pmap_load(firstl3);
/* Ignore managed pages for now */
if ((newl2 & ATTR_SW_MANAGED) != 0)
@@ -2322,26 +2323,7 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t 
newl2 &= ~ATTR_DESCR_MASK;
newl2 |= L2_BLOCK;
 
-   /*
-* Ensure we don't get switched out with the page table in an
-* inconsistent state. We also need to ensure no interrupts fire
-* as they may make use of an address we are about to invalidate.
-*/
-   intr = intr_disable();
-   critical_enter();
-
-   /* Clear the old mapping */
-   pmap_load_clear(l2);
-   PTE_SYNC(l2);
-   pmap_invalidate_range(pmap, rounddown2(va, L2_SIZE),
-   roundup2(va, L2_SIZE));
-
-   /* Create the new mapping */
-   pmap_load_store(l2, newl2);
-   PTE_SYNC(l2);
-
-   critical_exit();
-   intr_restore(intr);
+   pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE);
 }
 
 /*
@@ -3621,7 +3603,8 @@ pmap_change_attr_locked(vm_offset_t va, 
l3 &= ~ATTR_IDX_MASK;
l3 |= ATTR_IDX(mode);
 
-   pmap_update_entry(kernel_pmap, pte, l3, tmpva);
+   pmap_update_entry(kernel_pmap, pte, l3, tmpva,
+   PAGE_SIZE);
 
/*
 * If moving to a non-cacheable entry flush
@@ -3693,7 +3676,7 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t *
l1 = (pt_entry_t *)(tmpl1 + ((vm_offset_t)l1 & PAGE_MASK));
}
 
-   pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va);
+   pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va, PAGE_SIZE);
 
if (tmpl1 != 0) {
pmap_kremove(tmpl1);
@@ -3760,7 +3743,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en
l2 = (pt_entry_t *)(tmpl2 + ((vm_offset_t)l2 & PAGE_MASK));
}
 
-   pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va);
+   pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE);
 
if (tmpl2 != 0) {
pmap_kremove(tmpl2);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304596 - head/sys/arm64/arm64

2016-08-22 Thread Andrew Turner
Author: andrew
Date: Mon Aug 22 10:21:09 2016
New Revision: 304596
URL: https://svnweb.freebsd.org/changeset/base/304596

Log:
  Add KASSERTS in pmap_alloc_l3 to ensure we are not encountering superpages
  when we don't yet expect them;
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Aug 22 08:00:14 2016(r304595)
+++ head/sys/arm64/arm64/pmap.c Mon Aug 22 10:21:09 2016(r304596)
@@ -1537,6 +1537,9 @@ pmap_alloc_l3(pmap_t pmap, vm_offset_t v
 {
vm_pindex_t ptepindex;
pd_entry_t *pde, tpde;
+#ifdef INVARIANTS
+   pt_entry_t *pte;
+#endif
vm_page_t m;
int lvl;
 
@@ -1555,13 +1558,33 @@ retry:
 * and activate it. If we get a level 2 pde it will point to a level 3
 * table.
 */
-   if (lvl == 2) {
+   switch (lvl) {
+   case -1:
+   break;
+   case 0:
+#ifdef INVARIANTS
+   pte = pmap_l0_to_l1(pde, va);
+   KASSERT(pmap_load(pte) == 0,
+   ("pmap_alloc_l3: TODO: l0 superpages"));
+#endif
+   break;
+   case 1:
+#ifdef INVARIANTS
+   pte = pmap_l1_to_l2(pde, va);
+   KASSERT(pmap_load(pte) == 0,
+   ("pmap_alloc_l3: TODO: l1 superpages"));
+#endif
+   break;
+   case 2:
tpde = pmap_load(pde);
if (tpde != 0) {
m = PHYS_TO_VM_PAGE(tpde & ~ATTR_MASK);
m->wire_count++;
return (m);
}
+   break;
+   default:
+   panic("pmap_alloc_l3: Invalid level %d", lvl);
}
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304597 - head/sys/dev/usb/controller

2016-08-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Aug 22 10:21:25 2016
New Revision: 304597
URL: https://svnweb.freebsd.org/changeset/base/304597

Log:
  Fix for invalid use of bits in input context. Basically split
  configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and
  xhci_cmd_configure_ep() respectivly. This resolves some errors when
  using XHCI under QEMU and gets is more in line with the XHCI
  specification.
  
  PR:   212021
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Mon Aug 22 10:21:09 2016
(r304596)
+++ head/sys/dev/usb/controller/xhci.c  Mon Aug 22 10:21:25 2016
(r304597)
@@ -3867,12 +3867,10 @@ xhci_configure_reset_endpoint(struct usb
 
xhci_configure_mask(udev, (1U << epno) | 1U, 0);
 
-   err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
-
-   if (err != 0)
-   DPRINTF("Could not configure endpoint %u\n", epno);
-
-   err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
+   if (epno > 1)
+   err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
+   else
+   err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
 
if (err != 0)
DPRINTF("Could not configure endpoint %u\n", epno);
@@ -4255,6 +4253,10 @@ xhci_device_state_change(struct usb_devi
 
sc->sc_hw.devs[index].state = XHCI_ST_ADDRESSED;
 
+   /* set configure mask to slot only */
+   xhci_configure_mask(udev, 1, 0);
+
+   /* deconfigure all endpoints, except EP0 */
err = xhci_cmd_configure_ep(sc, 0, 1, index);
 
if (err) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304555 - head/sys/compat/cloudabi

2016-08-22 Thread Konstantin Belousov
On Mon, Aug 22, 2016 at 06:55:58PM +1000, Bruce Evans wrote:
> No.  PSL_AC is ignored in kernel mode.
Not quite.  On recent processors there is a feature called SMAP.  If enabled,
user mode pages accesses from kernel mode require eflags.ac set to 1.  If
EFLAGS.AC == 0, usermode access causes #PF with protection violation AFAIR.

> Not quite that short.  i386 has the 1-byte cli instruction for conveniently
> setting the interrupt enable flag, but setting PSL_AC seems to take at
> least 3 instructions and 6-7 bytes (pushf; orb $N,$M(%[re][bs]p); popf).
In ring 0, when SMAP is present, there are two new instructions
STAC (set AC) and CLAC (clear AC).  From the manual, the instructions
are not available in ring 3 for convenient manipulation of EFLAGS.AC.

But I think that the original question was about accesses which cause
#AC and not about instructions which manipulate EFLAGS.AC.  The description
of #AC in SDM contains all relevant details.  In short, or userspace
accesses must be naturally aligned, otherwise #AC is triggered.

I used to have trivial LD_PRELOAD-able dso which just set EFLAGS.AC, but
it is not much useful exactly because x86 compilers systematically generate
unaligned accesses.

Typed languages runtimes sometimes use a witty trick with AC to get
tag checking for free. If you assign e.g. a tag 0x7 to pointers, i.e.
store tag 0x7 in three low bits of the pointer representation, then load
instruction would be
movq-0x7(%rdx), %rax
and you get the #AC fault in case of any other tag.  Quite nifty and gives
zero runtime cost for basic dynamic type checking.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/z

2016-08-22 Thread Toomas Soome

> On 22. aug 2016, at 11:09, Andriy Gapon  wrote:
> 
> On 22/08/2016 10:20, Andriy Gapon wrote:
>> This commit breaks boot process for me and in a quite weird way.
>> I don't have a serial console, so a couple of screenshots.
>> This is what happens with this change:
>> https://people.freebsd.org/~avg/boot-fail-1024x768.jpg
>> This is what I have with the previous loader:
>> https://people.freebsd.org/~avg/boot-success-1024x768.jpg
>> 
>> As you can see somehow the HDD gets misdetected as a floppy, BIOS disk ID is 
>> 0x0
>> as opposed to 0x80.  Also, the disk size is incorrect too.  Additionally the
>> firewire is not detected.
>> 
>> I suspect that the problem may have to do with the increased loader size.
>> I must add that I have these in src.conf:
>> LOADER_BZIP2_SUPPORT=yes
>> LOADER_FIREWIRE_SUPPORT=yes
> 
> Removing both of those options allows the boot to succeed.
> Which sort of, maybe confirms the hypothesis.
> 

yep, just enabling firewire does not blow it. 


> Also, as extra data points, this is how SMAP is reported by a good zfsloader:
> https://people.freebsd.org/~avg/boot-smap-1024x768.jpg
> And it seems to be corrupted when using the bad zfsloader:
> https://people.freebsd.org/~avg/boot-smap-corrupt-1024x768.jpg
> 
> Base memory size is 634880 (almost enough for everyone).
> Extended memory is ~ 3.5GB and the high memory is 64MB at the top of it.
> 
> File size of the loader that does not work is 483328 bytes.
> $ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin
>textdata  bss  dec   hex   filename
>  438000   26416   130896   595312   0x91570
> /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin
> 
> File size of the loader that works is 450560 bytes.
> $ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin
>textdata bss  dec   hex   filename
>  410920   23304   50636   484860   0x765fc
> /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin
> 
> So, it seems that there is a practical limit on a loader size for real-world 
> x86
> BIOS-based systems.  We are very close to the limit with the default ZFS 
> loader
> and we cross that limit if additional loader features are enabled.
> 
> My opinion is that we should stop cramming all possible ZFS features into the
> loader.  Instead we should admit that the boot pool, or at least boot
> filesystem, must have certain limitations on features that it can use.  Then
> there is no need to add support for those features to the loader.


Well, it is arguable if its more important to have bzip in loader or support 
for checksum algorithms, especially as zfs does compression, but lets not get 
onto this slippery ground;)

but, yes, the root cause of the issue is that if additional [relatively large] 
code is included by src.conf setup, we will hit the ceiling of <1MB memory 
area, as client base (0xa000) + code + data are all occupying sequential memory 
and we are reaching EBDA area in low memory.

And indeed, it does mean more conservative approach about what is included and 
how.

btw, just to compare, zfsloader with ficl 4 + zfs additionally with gzip (as 
gzip is needed for for other reasons anyhow, so its “free lunch”) in my illumos 
build is:

-r--r--r--   1 root sys   434176 aug 21 16:04 /boot/zfsloader

and the current head + firewire in freebsd is:

-rw-r--r--  1 root  wheel  454656 Aug 22 11:54 /boot/zfsloader

I do suspect the size difference there is partially due to ficl, in illumos 
(ficl 4):

-rw-r--r--   1 tsoome   staff 132508 aug 22 09:18 libficl.a

and freebsd (ficl 3):

-rw-r--r--  1 root  wheel  213748 Aug 19 01:57 libficl.a

so, there definitely is some space… 

rgds,
toomas

> 
> Personally, I would prefer that this commit is backed out unless it can be
> strongly justified.  Unless we can quickly find a way to run the loader at a
> different, less restricted memory location.
> 
>> My memory of loader's memory placement and layout has faded, so I can't
>> elaborate further on my guess.
>> 
>> Also, there is this report: 
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212038
>> That problem could have a different cause.  It should be easier to analyze as
>> the it happens with bhyveload, i.e., in userland.
> 
> 
> -- 
> Andriy Gapon

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

Re: svn commit: r304555 - head/sys/compat/cloudabi

2016-08-22 Thread Slawa Olhovchenkov
On Mon, Aug 22, 2016 at 06:55:58PM +1000, Bruce Evans wrote:

> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote:
> 
> > On Mon, Aug 22, 2016 at 02:49:07AM +1000, Bruce Evans wrote:
> >
> >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote:
> >>
> >>> On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote:
> >>>
>  On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote:
> > I am remeber about platforms with missaligment trap when
> > accessing int16 by odd address. Now platforms like this do not exist
> > anymore?
> 
>  i386 still exists, and it supports trapping on misalignement for at least
>  CPL 3 (not kernel CPL 0).  IIRC, amd64 drops support for this.
> >>>
> >>> Someone enable and support this? I am don't see.
> >>> May be PPC trap on this?
> >>> Alpha trap on this, but support of Alpha is droped.
> >>
> >> It is a 1-line change in asm (or a little more in C with #includes) to
> >> enable the trap:
> >
> > OK, we can turn amd64 in this mode.
> > And cat do request to kernel with unalligned access, this cause trap
> > and panic, yes?
> 
> No.  PSL_AC is ignored in kernel mode.

OK. I.e. i386 and amd64 is not target.
cloudabi work in kernel mode, yes?

> >> It is a trillion-line change to fix the compilers and applications to not
> >> do misaligned accesses :-).  I only tried to use this ~25 years ago.  Then
> >> the most obvious compiler bug was generating 32-bit acccesses to assign
> >> large but misaligned structs.  If the compiler just generated calls to
> >> memcpy(), that might work, but in practice libraries also assume alignment.
> >
> > This issuse can be trigerred and by two-bytes assigmen, yes?
> 
> Not quite that short.  i386 has the 1-byte cli instruction for conveniently
> setting the interrupt enable flag, but setting PSL_AC seems to take at
> least 3 instructions and 6-7 bytes (pushf; orb $N,$M(%[re][bs]p); popf).

I am miss something. Why you talk about bytes per instruction?
I think this is about returning value to applications unaligning
buffer? 8 bytes in this commit or 2 bytes in my example.

(for this commit, as I see, td_retval always aligned)

> >> There are also endianness problems.  The old version was even more 
> >> broken
> >> on big endian systems.  The current version needs some magic to reverse
> >> the memcpy() of the bits.  We already depend on this for some 64-bit
> >> syscalls like lseek().
> >
> > Can you explain some more?
> > This is not transfer over network and don't read from external media.
> > Where is problem?
> 
>  It is similar to a network transfer.  It needs a protocol to pass values
>  to applications.  Type puns are fragile even within a single compilation
>  unit.
> >>>
> >>> Application ad kernel run with same byte order, not?
> >>
> >> The application can do anything it wants, but has to translate if it uses
> >> the kernel or a library written in another language.
> >
> > You talk about different byte order in differenr languages?
> 
> Could be, or the same language with a different ABI.

ABI enforced by `server`, ex: kernel, or cloudabi in this case.
If language need communicate -- language need adopted, not kernel or
cloadabi. No simple way from kernel/cloudabi/etc detect caller abi.
Or I am missunderstund you.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304567 - head/sys/dev/usb/input

2016-08-22 Thread Bruce Evans

On Sun, 21 Aug 2016, Hans Petter Selasky wrote:


On 08/21/16 18:06, Bruce Evans wrote:

Author: bde
Date: Sun Aug 21 16:06:00 2016
New Revision: 304567
URL: https://svnweb.freebsd.org/changeset/base/304567


Don't forget to MFC.


I had forgotten if for this commit.  I might do it for combined
commits, but don't have enough svn fu for as many MFCs as I would
like.  I want a few things back to FreeBSD-7.

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


Re: svn commit: r304555 - head/sys/compat/cloudabi

2016-08-22 Thread Bruce Evans

On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote:


On Mon, Aug 22, 2016 at 02:49:07AM +1000, Bruce Evans wrote:


On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote:


On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote:


On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote:

I am remeber about platforms with missaligment trap when
accessing int16 by odd address. Now platforms like this do not exist
anymore?


i386 still exists, and it supports trapping on misalignement for at least
CPL 3 (not kernel CPL 0).  IIRC, amd64 drops support for this.


Someone enable and support this? I am don't see.
May be PPC trap on this?
Alpha trap on this, but support of Alpha is droped.


It is a 1-line change in asm (or a little more in C with #includes) to
enable the trap:


OK, we can turn amd64 in this mode.
And cat do request to kernel with unalligned access, this cause trap
and panic, yes?


No.  PSL_AC is ignored in kernel mode.


It is a trillion-line change to fix the compilers and applications to not
do misaligned accesses :-).  I only tried to use this ~25 years ago.  Then
the most obvious compiler bug was generating 32-bit acccesses to assign
large but misaligned structs.  If the compiler just generated calls to
memcpy(), that might work, but in practice libraries also assume alignment.


This issuse can be trigerred and by two-bytes assigmen, yes?


Not quite that short.  i386 has the 1-byte cli instruction for conveniently
setting the interrupt enable flag, but setting PSL_AC seems to take at
least 3 instructions and 6-7 bytes (pushf; orb $N,$M(%[re][bs]p); popf).


There are also endianness problems.  The old version was even more broken
on big endian systems.  The current version needs some magic to reverse
the memcpy() of the bits.  We already depend on this for some 64-bit
syscalls like lseek().


Can you explain some more?
This is not transfer over network and don't read from external media.
Where is problem?


It is similar to a network transfer.  It needs a protocol to pass values
to applications.  Type puns are fragile even within a single compilation
unit.


Application ad kernel run with same byte order, not?


The application can do anything it wants, but has to translate if it uses
the kernel or a library written in another language.


You talk about different byte order in differenr languages?


Could be, or the same language with a different ABI.

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


Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs

2016-08-22 Thread Andriy Gapon
On 01/08/2016 22:37, Allan Jude wrote:
> Author: allanjude
> Date: Mon Aug  1 19:37:43 2016
> New Revision: 303630
> URL: https://svnweb.freebsd.org/changeset/base/303630
> 
> Log:
>   Make boot code and loader check for unsupported ZFS feature flags
>   
>   OpenZFS uses feature flags instead of a zpool version number to track
>   features since the split from Oracle. In addition to avoiding confusion
>   on ZFS vs OpenZFS version numbers, this also allows features to be added
>   to different operating systems that use OpenZFS in different order.
>   
>   The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly
>   tries to read the pool, and if failed provided only a vague error message.
>   
>   With this change, both the boot code and loader check the MOS features
>   list in the ZFS label and compare it against the list of features that
>   the loader supports. If any unsupported feature is active, the pool is
>   not considered as a candidate for booting, and a helpful diagnostic
>   message is printed to the screen. Features that are merely enabled via
>   zpool upgrade, but not in use, do not block booting from the pool.
>   
>   Submitted by:   Toomas Soome 
>   Reviewed by:delphij, mav
>   Relnotes:   yes
>   Differential Revision:  https://reviews.freebsd.org/D6857

It is really great to get a helpful diagnostic message when an unsupported
feature is seen.  Thank you for that!

But I would prefer that the check is done on a filesystem level, not on a pool
level.  That is, I would like to be able to enable features that are not
supported by ZFS boot chain on a boot pool as long as I do not enable such
features on a boot filesystem.  E.g., the large blocks support could be one of
such features.

And, as I've said in another email, I really do not think that we should strive
to support all possible (non-essential) ZFS features in the ZFS boot chain.

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


Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/z

2016-08-22 Thread Andriy Gapon
On 22/08/2016 10:20, Andriy Gapon wrote:
> This commit breaks boot process for me and in a quite weird way.
> I don't have a serial console, so a couple of screenshots.
> This is what happens with this change:
> https://people.freebsd.org/~avg/boot-fail-1024x768.jpg
> This is what I have with the previous loader:
> https://people.freebsd.org/~avg/boot-success-1024x768.jpg
> 
> As you can see somehow the HDD gets misdetected as a floppy, BIOS disk ID is 
> 0x0
> as opposed to 0x80.  Also, the disk size is incorrect too.  Additionally the
> firewire is not detected.
> 
> I suspect that the problem may have to do with the increased loader size.
> I must add that I have these in src.conf:
> LOADER_BZIP2_SUPPORT=yes
> LOADER_FIREWIRE_SUPPORT=yes

Removing both of those options allows the boot to succeed.
Which sort of, maybe confirms the hypothesis.

Also, as extra data points, this is how SMAP is reported by a good zfsloader:
https://people.freebsd.org/~avg/boot-smap-1024x768.jpg
And it seems to be corrupted when using the bad zfsloader:
https://people.freebsd.org/~avg/boot-smap-corrupt-1024x768.jpg

Base memory size is 634880 (almost enough for everyone).
Extended memory is ~ 3.5GB and the high memory is 64MB at the top of it.

File size of the loader that does not work is 483328 bytes.
$ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin
textdata  bss  dec   hex   filename
  438000   26416   130896   595312   0x91570
/usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin

File size of the loader that works is 450560 bytes.
$ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin
textdata bss  dec   hex   filename
  410920   23304   50636   484860   0x765fc
/usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin

So, it seems that there is a practical limit on a loader size for real-world x86
BIOS-based systems.  We are very close to the limit with the default ZFS loader
and we cross that limit if additional loader features are enabled.

My opinion is that we should stop cramming all possible ZFS features into the
loader.  Instead we should admit that the boot pool, or at least boot
filesystem, must have certain limitations on features that it can use.  Then
there is no need to add support for those features to the loader.

Personally, I would prefer that this commit is backed out unless it can be
strongly justified.  Unless we can quickly find a way to run the loader at a
different, less restricted memory location.

> My memory of loader's memory placement and layout has faded, so I can't
> elaborate further on my guess.
> 
> Also, there is this report: 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212038
> That problem could have a different cause.  It should be easier to analyze as
> the it happens with bhyveload, i.e., in userland.


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


svn commit: r304595 - head/sys/dev/hyperv/netvsc

2016-08-22 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 22 08:00:14 2016
New Revision: 304595
URL: https://svnweb.freebsd.org/changeset/base/304595

Log:
  hyperv/hn: Factor out function to simplify NVS request sending
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7578

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:51:46 2016
(r304594)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 08:00:14 2016
(r304595)
@@ -126,6 +126,14 @@ hn_nvs_xact_execute(struct hn_softc *sc,
return (vmbus_xact_wait(xact, resp_len));
 }
 
+static __inline int
+hn_nvs_req_send(struct hn_softc *sc, void *req, int reqlen)
+{
+
+   return (hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE,
+   req, reqlen, &hn_send_ctx_none));
+}
+
 /*
  * Net VSC initialize receive buffer with net VSP
  * 
@@ -342,8 +350,7 @@ hv_nv_destroy_rx_buffer(struct hn_softc 
disconn.nvs_sig = HN_NVS_RXBUF_SIG;
 
/* NOTE: No response. */
-   ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE,
-   &disconn, sizeof(disconn), &hn_send_ctx_none);
+   ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn));
if (ret != 0) {
if_printf(sc->hn_ifp,
"send rxbuf disconn failed: %d\n", ret);
@@ -387,8 +394,7 @@ hv_nv_destroy_send_buffer(struct hn_soft
disconn.nvs_sig = HN_NVS_CHIM_SIG;
 
/* NOTE: No response. */
-   ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE,
-   &disconn, sizeof(disconn), &hn_send_ctx_none);
+   ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn));
if (ret != 0) {
if_printf(sc->hn_ifp,
"send chim disconn failed: %d\n", ret);
@@ -485,8 +491,7 @@ hv_nv_send_ndis_config(struct hn_softc *
conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN;
 
/* NOTE: No response. */
-   error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE,
-   &conf, sizeof(conf), &hn_send_ctx_none);
+   error = hn_nvs_req_send(sc, &conf, sizeof(conf));
if (error)
if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error);
return (error);
@@ -551,8 +556,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc
ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30;
 
/* NOTE: No response. */
-   ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE,
-   &ndis, sizeof(ndis), &hn_send_ctx_none);
+   ret = hn_nvs_req_send(sc, &ndis, sizeof(ndis));
if (ret != 0) {
if_printf(sc->hn_ifp, "send nvs ndis init failed: %d\n", ret);
goto cleanup;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304594 - head/sys/dev/hyperv/netvsc

2016-08-22 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 22 07:51:46 2016
New Revision: 304594
URL: https://svnweb.freebsd.org/changeset/base/304594

Log:
  hyperv/hn: Factor out function to execute NVS transactions.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7577

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/netvsc/if_hnvar.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:44:11 2016
(r304593)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:51:46 2016
(r304594)
@@ -74,6 +74,8 @@ static void hv_nv_on_receive(struct hn_s
 static void hn_nvs_sent_none(struct hn_send_ctx *sndc,
 struct hn_softc *, struct vmbus_channel *chan,
 const void *, int);
+static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc,
+struct vmbus_channel *, const void *, int);
 
 static struct hn_send_ctx  hn_send_ctx_none =
 HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL);
@@ -105,6 +107,25 @@ hn_chim_alloc(struct hn_softc *sc)
return (ret);
 }
 
+const void *
+hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact,
+void *req, int reqlen, size_t *resp_len)
+{
+   struct hn_send_ctx sndc;
+   int error;
+
+   hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact);
+   vmbus_xact_activate(xact);
+
+   error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC,
+   req, reqlen, &sndc);
+   if (error) {
+   vmbus_xact_deactivate(xact);
+   return NULL;
+   }
+   return (vmbus_xact_wait(xact, resp_len));
+}
+
 /*
  * Net VSC initialize receive buffer with net VSP
  * 
@@ -114,11 +135,10 @@ hn_chim_alloc(struct hn_softc *sc)
 static int 
 hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc, int rxbuf_size)
 {
-   struct vmbus_xact *xact;
+   struct vmbus_xact *xact = NULL;
struct hn_nvs_rxbuf_conn *conn;
const struct hn_nvs_rxbuf_connresp *resp;
size_t resp_len;
-   struct hn_send_ctx sndc;
uint32_t status;
int error;
 
@@ -150,43 +170,33 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
error = ENXIO;
goto cleanup;
}
-
conn = vmbus_xact_req_data(xact);
conn->nvs_type = HN_NVS_TYPE_RXBUF_CONN;
conn->nvs_gpadl = sc->hn_rxbuf_gpadl;
conn->nvs_sig = HN_NVS_RXBUF_SIG;
 
-   hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact);
-   vmbus_xact_activate(xact);
-
-   error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC,
-   conn, sizeof(*conn), &sndc);
-   if (error != 0) {
-   if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n",
-   error);
-   vmbus_xact_deactivate(xact);
-   vmbus_xact_put(xact);
+   resp = hn_nvs_xact_execute(sc, xact, conn, sizeof(*conn), &resp_len);
+   if (resp == NULL) {
+   if_printf(sc->hn_ifp, "exec rxbuf conn failed\n");
+   error = EIO;
goto cleanup;
}
-
-   resp = vmbus_xact_wait(xact, &resp_len);
if (resp_len < sizeof(*resp)) {
if_printf(sc->hn_ifp, "invalid rxbuf conn resp length %zu\n",
resp_len);
-   vmbus_xact_put(xact);
error = EINVAL;
goto cleanup;
}
if (resp->nvs_type != HN_NVS_TYPE_RXBUF_CONNRESP) {
if_printf(sc->hn_ifp, "not rxbuf conn resp, type %u\n",
resp->nvs_type);
-   vmbus_xact_put(xact);
error = EINVAL;
goto cleanup;
}
 
status = resp->nvs_status;
vmbus_xact_put(xact);
+   xact = NULL;
 
if (status != HN_NVS_STATUS_OK) {
if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status);
@@ -198,6 +208,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
return (0);
 
 cleanup:
+   if (xact != NULL)
+   vmbus_xact_put(xact);
hv_nv_destroy_rx_buffer(sc);
return (error);
 }
@@ -208,8 +220,7 @@ cleanup:
 static int 
 hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc)
 {
-   struct hn_send_ctx sndc;
-   struct vmbus_xact *xact;
+   struct vmbus_xact *xact = NULL;
struct hn_nvs_chim_conn *chim;
const struct hn_nvs_chim_connresp *resp;
size_t resp_len;
@@ -242,37 +253,26 @@ hv_nv_init_send_buffer_with_net_vsp(stru
error = ENXIO;
goto cleanup;
}
-
chim = vmbus_xact_req_data(xact);
chim->nvs_type = HN_NVS_TYPE_CHIM_CONN;
chim->nvs_gpadl = sc->hn_chim_gpadl;
chim->nvs_sig = HN_NVS_CHIM_SIG;
 
-   hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact);
-   vmbus_xact_activa

svn commit: r304593 - head/sys/dev/hyperv/netvsc

2016-08-22 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 22 07:44:11 2016
New Revision: 304593
URL: https://svnweb.freebsd.org/changeset/base/304593

Log:
  hyperv/hn: Get rid of netvsc_dev
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7575

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:38:44 2016
(r304592)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:44:11 2016
(r304593)
@@ -68,7 +68,7 @@ static void hv_nv_on_send_completion(str
 struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt);
 static void hv_nv_on_receive_completion(struct vmbus_channel *chan,
 uint64_t tid);
-static void hv_nv_on_receive(netvsc_dev *net_dev,
+static void hv_nv_on_receive(struct hn_softc *sc,
 struct hn_rx_ring *rxr, struct vmbus_channel *chan,
 const struct vmbus_chanpkt_hdr *pkt);
 static void hn_nvs_sent_none(struct hn_send_ctx *sndc,
@@ -78,40 +78,6 @@ static void hn_nvs_sent_none(struct hn_s
 static struct hn_send_ctx  hn_send_ctx_none =
 HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL);
 
-/*
- *
- */
-static inline netvsc_dev *
-hv_nv_alloc_net_device(struct hn_softc *sc)
-{
-   netvsc_dev *net_dev;
-
-   net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_WAITOK | M_ZERO);
-
-   net_dev->sc = sc;
-   sc->net_dev = net_dev;
-
-   return (net_dev);
-}
-
-/*
- * XXX unnecessary; nuke it.
- */
-static inline netvsc_dev *
-hv_nv_get_outbound_net_device(struct hn_softc *sc)
-{
-   return sc->net_dev;
-}
-
-/*
- * XXX unnecessary; nuke it.
- */
-static inline netvsc_dev *
-hv_nv_get_inbound_net_device(struct hn_softc *sc)
-{
-   return sc->net_dev;
-}
-
 uint32_t
 hn_chim_alloc(struct hn_softc *sc)
 {
@@ -451,8 +417,7 @@ hv_nv_destroy_send_buffer(struct hn_soft
 }
 
 static int
-hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, netvsc_dev *net_dev,
-uint32_t nvs_ver)
+hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, uint32_t nvs_ver)
 {
struct hn_send_ctx sndc;
struct vmbus_xact *xact;
@@ -540,7 +505,6 @@ hv_nv_send_ndis_config(struct hn_softc *
 static int
 hv_nv_connect_to_vsp(struct hn_softc *sc)
 {
-   netvsc_dev *net_dev;
uint32_t protocol_list[] = { NVSP_PROTOCOL_VERSION_1,
NVSP_PROTOCOL_VERSION_2,
NVSP_PROTOCOL_VERSION_4,
@@ -553,14 +517,11 @@ hv_nv_connect_to_vsp(struct hn_softc *sc
struct hn_nvs_ndis_init ndis;
int rxbuf_size;
 
-   net_dev = hv_nv_get_outbound_net_device(sc);
-
/*
 * Negotiate the NVSP version.  Try the latest NVSP first.
 */
for (i = protocol_number - 1; i >= 0; i--) {
-   if (hv_nv_negotiate_nvsp_protocol(sc, net_dev,
-   protocol_list[i]) == 0) {
+   if (hv_nv_negotiate_nvsp_protocol(sc, protocol_list[i]) == 0) {
sc->hn_nvs_ver = protocol_list[i];
if (bootverbose) {
device_printf(dev, "NVS version 0x%x\n",
@@ -644,20 +605,12 @@ hv_nv_subchan_attach(struct vmbus_channe
  * 
  * Callback when the device belonging to this driver is added
  */
-netvsc_dev *
-hv_nv_on_device_add(struct hn_softc *sc, void *additional_info,
-struct hn_rx_ring *rxr)
+int
+hv_nv_on_device_add(struct hn_softc *sc, struct hn_rx_ring *rxr)
 {
struct vmbus_channel *chan = sc->hn_prichan;
-   netvsc_dev *net_dev;
int ret = 0;
 
-   net_dev = hv_nv_alloc_net_device(sc);
-   if (net_dev == NULL)
-   return NULL;
-
-   /* Initialize the NetVSC channel extension */
-
/*
 * Open the channel
 */
@@ -677,20 +630,13 @@ hv_nv_on_device_add(struct hn_softc *sc,
if (ret != 0)
goto close;
 
-   return (net_dev);
+   return (0);
 
 close:
/* Now, we can close the channel safely */
vmbus_chan_close(chan);
-
 cleanup:
-   /*
-* Free the packet buffers on the netvsc device packet queue.
-* Release other resources.
-*/
-   free(net_dev, M_NETVSC);
-
-   return (NULL);
+   return (ret);
 }
 
 /*
@@ -706,8 +652,6 @@ hv_nv_on_device_remove(struct hn_softc *
 
vmbus_chan_close(sc->hn_prichan);
 
-   free(sc->net_dev, M_NETVSC);
-
return (0);
 }
 
@@ -801,7 +745,7 @@ hv_nv_on_send(struct vmbus_channel *chan
  * with virtual addresses.
  */
 static void
-hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr,
+hv_nv_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr,
 struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr)
 {
const struct vmbus_chanpkt_rxbuf *pkt;
@

svn commit: r304592 - in releng/11.0/lib: libc libc/include libc/stdlib libc/tests/stdlib libthr/thread

2016-08-22 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 22 07:38:44 2016
New Revision: 304592
URL: https://svnweb.freebsd.org/changeset/base/304592

Log:
  MFC r303794:
  Create namespace for the symbols added during 12-CURRENT cycle.
  
  MFC r303795:
  Add __cxa_thread_atexit(3) API implementation.
  
  Approved by:  re (gjb, bdrewery (?))

Added:
  releng/11.0/lib/libc/stdlib/cxa_thread_atexit.c
 - copied unchanged from r304524, 
stable/11/lib/libc/stdlib/cxa_thread_atexit.c
  releng/11.0/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
 - copied unchanged from r304524, 
stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
  releng/11.0/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
 - copied unchanged from r304524, 
stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
Modified:
  releng/11.0/lib/libc/Versions.def
  releng/11.0/lib/libc/include/libc_private.h
  releng/11.0/lib/libc/stdlib/Makefile.inc
  releng/11.0/lib/libc/stdlib/Symbol.map
  releng/11.0/lib/libc/stdlib/exit.c
  releng/11.0/lib/libc/tests/stdlib/Makefile
  releng/11.0/lib/libc/tests/stdlib/Makefile.depend
  releng/11.0/lib/libthr/thread/thr_exit.c
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/lib/libc/Versions.def
==
--- releng/11.0/lib/libc/Versions.def   Mon Aug 22 07:34:39 2016
(r304591)
+++ releng/11.0/lib/libc/Versions.def   Mon Aug 22 07:38:44 2016
(r304592)
@@ -27,6 +27,10 @@ FBSD_1.3 {
 FBSD_1.4 {
 } FBSD_1.3;
 
+# This version was first added to 12.0-current.
+FBSD_1.5 {
+} FBSD_1.4;
+
 
 # This is our private namespace.  Any global interfaces that are
 # strictly for use only by other FreeBSD applications and libraries
@@ -35,4 +39,4 @@ FBSD_1.4 {
 #
 # Please do NOT increment the version of this namespace.
 FBSDprivate_1.0 {
-} FBSD_1.4;
+} FBSD_1.5;

Modified: releng/11.0/lib/libc/include/libc_private.h
==
--- releng/11.0/lib/libc/include/libc_private.h Mon Aug 22 07:34:39 2016
(r304591)
+++ releng/11.0/lib/libc/include/libc_private.h Mon Aug 22 07:38:44 2016
(r304592)
@@ -267,6 +267,12 @@ extern const char *__progname;
 void _malloc_thread_cleanup(void);
 
 /*
+ * This function is used by the threading libraries to notify libc that a
+ * thread is exiting, so its thread-local dtors should be called.
+ */
+void __cxa_thread_call_dtors(void);
+
+/*
  * These functions are used by the threading libraries in order to protect
  * malloc across fork().
  */

Modified: releng/11.0/lib/libc/stdlib/Makefile.inc
==
--- releng/11.0/lib/libc/stdlib/Makefile.incMon Aug 22 07:34:39 2016
(r304591)
+++ releng/11.0/lib/libc/stdlib/Makefile.incMon Aug 22 07:38:44 2016
(r304592)
@@ -5,7 +5,7 @@
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib
 
 MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
-   bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \
+   bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c 
getopt_long.c \
getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \
hsearch_r.c imaxabs.c imaxdiv.c \
insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \

Modified: releng/11.0/lib/libc/stdlib/Symbol.map
==
--- releng/11.0/lib/libc/stdlib/Symbol.map  Mon Aug 22 07:34:39 2016
(r304591)
+++ releng/11.0/lib/libc/stdlib/Symbol.map  Mon Aug 22 07:38:44 2016
(r304592)
@@ -116,8 +116,13 @@ FBSD_1.4 {
reallocarray;
 };
 
+FBSD_1.5 {
+   __cxa_thread_atexit;
+};
+
 FBSDprivate_1.0 {
__system;
_system;
__libc_system;
+   __cxa_thread_call_dtors;
 };

Copied: releng/11.0/lib/libc/stdlib/cxa_thread_atexit.c (from r304524, 
stable/11/lib/libc/stdlib/cxa_thread_atexit.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/11.0/lib/libc/stdlib/cxa_thread_atexit.c Mon Aug 22 07:38:44 
2016(r304592, copy of r304524, 
stable/11/lib/libc/stdlib/cxa_thread_atexit.c)
@@ -0,0 +1,140 @@
+/*-
+ * Copyright (c) 2016 Mahdi Mokhtari 
+ * 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 SO

svn commit: r304591 - head/sys/dev/hyperv/netvsc

2016-08-22 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 22 07:34:39 2016
New Revision: 304591
URL: https://svnweb.freebsd.org/changeset/base/304591

Log:
  hyperv/hn: Move chimney sending buffer to hn_softc
  
  And don't recreate chimney sending buffer for each primary channel
  open, it is now created in device_attach DEVMETHOD and destroyed
  in device_detach DEVMETHOD.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7574

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/netvsc/if_hnvar.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:26:43 2016
(r304590)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:34:39 2016
(r304591)
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,10 +61,10 @@ static void hv_nv_on_channel_callback(st
 void *xrxr);
 static int  hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc);
 static int  hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *, int);
-static int  hv_nv_destroy_send_buffer(netvsc_dev *net_dev);
+static int  hv_nv_destroy_send_buffer(struct hn_softc *sc);
 static int  hv_nv_destroy_rx_buffer(struct hn_softc *sc);
 static int  hv_nv_connect_to_vsp(struct hn_softc *sc);
-static void hv_nv_on_send_completion(netvsc_dev *net_dev,
+static void hv_nv_on_send_completion(struct hn_softc *sc,
 struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt);
 static void hv_nv_on_receive_completion(struct vmbus_channel *chan,
 uint64_t tid);
@@ -71,7 +72,7 @@ static void hv_nv_on_receive(netvsc_dev 
 struct hn_rx_ring *rxr, struct vmbus_channel *chan,
 const struct vmbus_chanpkt_hdr *pkt);
 static void hn_nvs_sent_none(struct hn_send_ctx *sndc,
-struct netvsc_dev_ *net_dev, struct vmbus_channel *chan,
+struct hn_softc *, struct vmbus_channel *chan,
 const void *, int);
 
 static struct hn_send_ctx  hn_send_ctx_none =
@@ -111,31 +112,30 @@ hv_nv_get_inbound_net_device(struct hn_s
return sc->net_dev;
 }
 
-int
-hv_nv_get_next_send_section(netvsc_dev *net_dev)
+uint32_t
+hn_chim_alloc(struct hn_softc *sc)
 {
-   unsigned long bitsmap_words = net_dev->bitsmap_words;
-   unsigned long *bitsmap = net_dev->send_section_bitsmap;
-   unsigned long idx;
-   int ret = HN_NVS_CHIM_IDX_INVALID;
-   int i;
+   int i, bmap_cnt = sc->hn_chim_bmap_cnt;
+   u_long *bmap = sc->hn_chim_bmap;
+   uint32_t ret = HN_NVS_CHIM_IDX_INVALID;
 
-   for (i = 0; i < bitsmap_words; i++) {
-   idx = ffsl(~bitsmap[i]);
-   if (0 == idx)
+   for (i = 0; i < bmap_cnt; ++i) {
+   int idx;
+
+   idx = ffsl(~bmap[i]);
+   if (idx == 0)
continue;
 
-   idx--;
-   KASSERT(i * BITS_PER_LONG + idx < net_dev->send_section_count,
-   ("invalid i %d and idx %lu", i, idx));
+   --idx; /* ffsl is 1-based */
+   KASSERT(i * LONG_BIT + idx < sc->hn_chim_cnt,
+   ("invalid i %d and idx %d", i, idx));
 
-   if (atomic_testandset_long(&bitsmap[i], idx))
+   if (atomic_testandset_long(&bmap[i], idx))
continue;
 
-   ret = i * BITS_PER_LONG + idx;
+   ret = i * LONG_BIT + idx;
break;
}
-
return (ret);
 }
 
@@ -248,22 +248,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru
const struct hn_nvs_chim_connresp *resp;
size_t resp_len;
uint32_t status, sectsz;
-   netvsc_dev *net_dev;
int error;
 
-   net_dev = hv_nv_get_outbound_net_device(sc);
-   if (!net_dev) {
-   return (ENODEV);
-   }
-
-   net_dev->send_buf = hyperv_dmamem_alloc(bus_get_dma_tag(sc->hn_dev),
-   PAGE_SIZE, 0, net_dev->send_buf_size, &net_dev->txbuf_dma,
-   BUS_DMA_WAITOK | BUS_DMA_ZERO);
-   if (net_dev->send_buf == NULL) {
-   device_printf(sc->hn_dev, "allocate chimney txbuf failed\n");
-   return (ENOMEM);
-   }
-
/*
 * Connect chimney sending buffer GPADL to the primary channel.
 *
@@ -272,8 +258,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru
 * Sub-channels just share this chimney sending buffer.
 */
error = vmbus_chan_gpadl_connect(sc->hn_prichan,
-   net_dev->txbuf_dma.hv_paddr, net_dev->send_buf_size,
-   &net_dev->send_buf_gpadl_handle);
+   sc->hn_chim_dma.hv_paddr, NETVSC_SEND_BUFFER_SIZE,
+   &sc->hn_chim_gpadl);
if (error) {
if_printf(sc->hn_ifp, "chimney sending buffer g

svn commit: r304590 - stable/10/sys/kern

2016-08-22 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 22 07:26:43 2016
New Revision: 304590
URL: https://svnweb.freebsd.org/changeset/base/304590

Log:
  MFC r304174:
  VOP_FSYNC() does not take cred as an argument.  Correct comment.

Modified:
  stable/10/sys/kern/vfs_default.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_default.c
==
--- stable/10/sys/kern/vfs_default.cMon Aug 22 07:25:09 2016
(r304589)
+++ stable/10/sys/kern/vfs_default.cMon Aug 22 07:26:43 2016
(r304590)
@@ -635,7 +635,6 @@ int
 vop_stdfsync(ap)
struct vop_fsync_args /* {
struct vnode *a_vp;
-   struct ucred *a_cred;
int a_waitfor;
struct thread *a_td;
} */ *ap;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-08-22 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 22 07:25:09 2016
New Revision: 304589
URL: https://svnweb.freebsd.org/changeset/base/304589

Log:
  MFC r304174:
  VOP_FSYNC() does not take cred as an argument.  Correct comment.

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

Modified: stable/11/sys/kern/vfs_default.c
==
--- stable/11/sys/kern/vfs_default.cMon Aug 22 07:24:02 2016
(r304588)
+++ stable/11/sys/kern/vfs_default.cMon Aug 22 07:25:09 2016
(r304589)
@@ -640,7 +640,6 @@ int
 vop_stdfsync(ap)
struct vop_fsync_args /* {
struct vnode *a_vp;
-   struct ucred *a_cred;
int a_waitfor;
struct thread *a_td;
} */ *ap;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304588 - in releng/11.0: contrib/dma libexec/dma

2016-08-22 Thread Baptiste Daroussin
Author: bapt
Date: Mon Aug 22 07:24:02 2016
New Revision: 304588
URL: https://svnweb.freebsd.org/changeset/base/304588

Log:
  Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
  
  Most important change being:
  dma - Fix security hole
  
  Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
  finding out from BSDNow Episode 152. Comments following were from his commit
  which explains better than I. Just taking his change and putting it here as 
well.
  
  * dma makes an age-old mistake of not properly checking whether a file
  owned by a user is a symlink or not, a bug which the original mail.local
  also had.
  
  * Add O_NOFOLLOW to disallow symlinks.
  Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
  about the mail.local bug.
  
  Approved by:  re (kib)

Modified:
  releng/11.0/contrib/dma/VERSION
  releng/11.0/contrib/dma/dma-mbox-create.c
  releng/11.0/contrib/dma/dma.c
  releng/11.0/contrib/dma/dma.h
  releng/11.0/contrib/dma/dns.c
  releng/11.0/contrib/dma/local.c
  releng/11.0/contrib/dma/net.c
  releng/11.0/libexec/dma/Makefile.inc
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/contrib/dma/VERSION
==
--- releng/11.0/contrib/dma/VERSION Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/VERSION Mon Aug 22 07:24:02 2016
(r304588)
@@ -1 +1 @@
-v0.10
+v0.11

Modified: releng/11.0/contrib/dma/dma-mbox-create.c
==
--- releng/11.0/contrib/dma/dma-mbox-create.c   Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/dma-mbox-create.c   Mon Aug 22 07:24:02 2016
(r304588)
@@ -142,7 +142,7 @@ main(int argc, char **argv)
logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", 
_PATH_MAILDIR, user);
}
 
-   f = open(fn, O_RDONLY|O_CREAT, 0600);
+   f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600);
if (f < 0)
logfail(EX_NOINPUT, "cannt open mbox `%s'", fn);
 

Modified: releng/11.0/contrib/dma/dma.c
==
--- releng/11.0/contrib/dma/dma.c   Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/dma.c   Mon Aug 22 07:24:02 2016
(r304588)
@@ -321,7 +321,7 @@ deliver(struct qitem *it)
snprintf(errmsg, sizeof(errmsg), "unknown bounce reason");
 
 retry:
-   syslog(LOG_INFO, "trying delivery");
+   syslog(LOG_INFO, "<%s> trying delivery", it->addr);
 
if (it->remote)
error = deliver_remote(it);
@@ -331,7 +331,7 @@ retry:
switch (error) {
case 0:
delqueue(it);
-   syslog(LOG_INFO, "delivery successful");
+   syslog(LOG_INFO, "<%s> delivery successful", it->addr);
exit(EX_OK);
 
case 1:

Modified: releng/11.0/contrib/dma/dma.h
==
--- releng/11.0/contrib/dma/dma.h   Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/dma.h   Mon Aug 22 07:24:02 2016
(r304588)
@@ -49,7 +49,7 @@
 #define VERSION"DragonFly Mail Agent " DMA_VERSION
 
 #define BUF_SIZE   2048
-#define ERRMSG_SIZE200
+#define ERRMSG_SIZE1024
 #define USERNAME_SIZE  50
 #define MIN_RETRY  300 /* 5 minutes */
 #define MAX_RETRY  (3*60*60)   /* retry at least every 3 hours */

Modified: releng/11.0/contrib/dma/dns.c
==
--- releng/11.0/contrib/dma/dns.c   Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/dns.c   Mon Aug 22 07:24:02 2016
(r304588)
@@ -34,6 +34,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: releng/11.0/contrib/dma/local.c
==
--- releng/11.0/contrib/dma/local.c Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/local.c Mon Aug 22 07:24:02 2016
(r304588)
@@ -196,7 +196,7 @@ retry:
goto out;
}
 
-   error = snprintf(line, sizeof(line), "%sFrom %s\t%s", newline, sender, 
ctime(&now));
+   error = snprintf(line, sizeof(line), "%sFrom %s %s", newline, sender, 
ctime(&now));
if (error < 0 || (size_t)error >= sizeof(line)) {
syslog(LOG_NOTICE, "local delivery deferred: can not write 
header: %m");
goto out;

Modified: releng/11.0/contrib/dma/net.c
==
--- releng/11.0/contrib/dma/net.c   Mon Aug 22 07:08:00 2016
(r304587)
+++ releng/11.0/contrib/dma/net.c   Mon Aug 22 07:24:02 2016
(r304588)
@@ -372,11 +

Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/z

2016-08-22 Thread Andriy Gapon
On 18/08/2016 03:37, Toomas Soome wrote:
> Author: tsoome
> Date: Thu Aug 18 00:37:07 2016
> New Revision: 304321
> URL: https://svnweb.freebsd.org/changeset/base/304321
> 
> Log:
>   Add SHA512, skein, large blocks support for loader zfs.
>   
>   Updated sha512 from illumos.
>   Using skein from freebsd crypto tree.
>   Since loader itself is using 64MB memory for heap, updated zfsboot to
>   use same, and this also allows to support zfs large blocks.
>   
>   Note, adding additional features does increate zfsboot code, therefore
>   this update does increase zfsboot code to 128k, also I have ported gptldr.S
>   update to zfsldr.S to support 64k+ code.


This commit breaks boot process for me and in a quite weird way.
I don't have a serial console, so a couple of screenshots.
This is what happens with this change:
https://people.freebsd.org/~avg/boot-fail-1024x768.jpg
This is what I have with the previous loader:
https://people.freebsd.org/~avg/boot-success-1024x768.jpg

As you can see somehow the HDD gets misdetected as a floppy, BIOS disk ID is 0x0
as opposed to 0x80.  Also, the disk size is incorrect too.  Additionally the
firewire is not detected.

I suspect that the problem may have to do with the increased loader size.
I must add that I have these in src.conf:
LOADER_BZIP2_SUPPORT=yes
LOADER_FIREWIRE_SUPPORT=yes

My memory of loader's memory placement and layout has faded, so I can't
elaborate further on my guess.

Also, there is this report: 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212038
That problem could have a different cause.  It should be easier to analyze as
the it happens with bhyveload, i.e., in userland.

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


svn commit: r304587 - in stable/11: contrib/dma libexec/dma

2016-08-22 Thread Baptiste Daroussin
Author: bapt
Date: Mon Aug 22 07:08:00 2016
New Revision: 304587
URL: https://svnweb.freebsd.org/changeset/base/304587

Log:
  Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
  
  Most important change being:
  dma - Fix security hole
  
  Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
  finding out from BSDNow Episode 152. Comments following were from his commit
  which explains better than I. Just taking his change and putting it here as 
well.
  
  * dma makes an age-old mistake of not properly checking whether a file
  owned by a user is a symlink or not, a bug which the original mail.local
  also had.
  
  * Add O_NOFOLLOW to disallow symlinks.
  Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
  about the mail.local bug.

Modified:
  stable/11/contrib/dma/VERSION
  stable/11/contrib/dma/dma-mbox-create.c
  stable/11/contrib/dma/dma.c
  stable/11/contrib/dma/dma.h
  stable/11/contrib/dma/dns.c
  stable/11/contrib/dma/local.c
  stable/11/contrib/dma/net.c
  stable/11/libexec/dma/Makefile.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/dma/VERSION
==
--- stable/11/contrib/dma/VERSION   Mon Aug 22 05:38:44 2016
(r304586)
+++ stable/11/contrib/dma/VERSION   Mon Aug 22 07:08:00 2016
(r304587)
@@ -1 +1 @@
-v0.10
+v0.11

Modified: stable/11/contrib/dma/dma-mbox-create.c
==
--- stable/11/contrib/dma/dma-mbox-create.c Mon Aug 22 05:38:44 2016
(r304586)
+++ stable/11/contrib/dma/dma-mbox-create.c Mon Aug 22 07:08:00 2016
(r304587)
@@ -142,7 +142,7 @@ main(int argc, char **argv)
logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", 
_PATH_MAILDIR, user);
}
 
-   f = open(fn, O_RDONLY|O_CREAT, 0600);
+   f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600);
if (f < 0)
logfail(EX_NOINPUT, "cannt open mbox `%s'", fn);
 

Modified: stable/11/contrib/dma/dma.c
==
--- stable/11/contrib/dma/dma.c Mon Aug 22 05:38:44 2016(r304586)
+++ stable/11/contrib/dma/dma.c Mon Aug 22 07:08:00 2016(r304587)
@@ -321,7 +321,7 @@ deliver(struct qitem *it)
snprintf(errmsg, sizeof(errmsg), "unknown bounce reason");
 
 retry:
-   syslog(LOG_INFO, "trying delivery");
+   syslog(LOG_INFO, "<%s> trying delivery", it->addr);
 
if (it->remote)
error = deliver_remote(it);
@@ -331,7 +331,7 @@ retry:
switch (error) {
case 0:
delqueue(it);
-   syslog(LOG_INFO, "delivery successful");
+   syslog(LOG_INFO, "<%s> delivery successful", it->addr);
exit(EX_OK);
 
case 1:

Modified: stable/11/contrib/dma/dma.h
==
--- stable/11/contrib/dma/dma.h Mon Aug 22 05:38:44 2016(r304586)
+++ stable/11/contrib/dma/dma.h Mon Aug 22 07:08:00 2016(r304587)
@@ -49,7 +49,7 @@
 #define VERSION"DragonFly Mail Agent " DMA_VERSION
 
 #define BUF_SIZE   2048
-#define ERRMSG_SIZE200
+#define ERRMSG_SIZE1024
 #define USERNAME_SIZE  50
 #define MIN_RETRY  300 /* 5 minutes */
 #define MAX_RETRY  (3*60*60)   /* retry at least every 3 hours */

Modified: stable/11/contrib/dma/dns.c
==
--- stable/11/contrib/dma/dns.c Mon Aug 22 05:38:44 2016(r304586)
+++ stable/11/contrib/dma/dns.c Mon Aug 22 07:08:00 2016(r304587)
@@ -34,6 +34,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: stable/11/contrib/dma/local.c
==
--- stable/11/contrib/dma/local.c   Mon Aug 22 05:38:44 2016
(r304586)
+++ stable/11/contrib/dma/local.c   Mon Aug 22 07:08:00 2016
(r304587)
@@ -196,7 +196,7 @@ retry:
goto out;
}
 
-   error = snprintf(line, sizeof(line), "%sFrom %s\t%s", newline, sender, 
ctime(&now));
+   error = snprintf(line, sizeof(line), "%sFrom %s %s", newline, sender, 
ctime(&now));
if (error < 0 || (size_t)error >= sizeof(line)) {
syslog(LOG_NOTICE, "local delivery deferred: can not write 
header: %m");
goto out;

Modified: stable/11/contrib/dma/net.c
==
--- stable/11/contrib/dma/net.c Mon Aug 22 05:38:44 2016(r304586)
+++ stable/11/contrib/dma/net.c Mon Aug 22 07:08:00 2016(r304587)
@@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct
   host->host, host->addr, c, neterr); \
snpr