svn commit: r340175 - head/sbin/ipfw

2018-11-05 Thread Andrey V. Elsukov
Author: ae
Date: Tue Nov  6 07:41:32 2018
New Revision: 340175
URL: https://svnweb.freebsd.org/changeset/base/340175

Log:
  Do not print "ip6" keyword in print_icmp6types() for O_ICMP6TYPE opcode.
  
  It produces incompatibility when rules listing is used again to
  restore saved ruleset, because "ip6" keyword produces separate opcode.
  The kernel already has the check and only IPv6 packets will be checked
  for matching.
  
  PR:   232939
  MFC after:3 days

Modified:
  head/sbin/ipfw/ipv6.c

Modified: head/sbin/ipfw/ipv6.c
==
--- head/sbin/ipfw/ipv6.c   Tue Nov  6 02:52:54 2018(r340174)
+++ head/sbin/ipfw/ipv6.c   Tue Nov  6 07:41:32 2018(r340175)
@@ -169,7 +169,7 @@ print_icmp6types(struct buf_pr *bp, ipfw_insn_u32 *cmd
int i, j;
char sep= ' ';
 
-   bprintf(bp, " ip6 icmp6types");
+   bprintf(bp, " icmp6types");
for (i = 0; i < 7; i++)
for (j=0; j < 32; ++j) {
if ( (cmd->d[i] & (1 << (j))) == 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340157 - in head: . tools/build tools/tools/nanobsd/embedded

2018-11-05 Thread Michal Meloun



On 05.11.2018 20:51, Alex Richardson wrote:
> Author: arichardson
> Date: Mon Nov  5 19:51:10 2018
> New Revision: 340157
> URL: https://svnweb.freebsd.org/changeset/base/340157
> 
> Log:
>   Allow building world without inheriting $PATH
>   
>   Inheriting $PATH during the build phase can cause the build to fail when
>   compiling on a different system due to missing build tools or incompatible
>   versions somewhere in $PATH. This has cause build failures for us before
>   due to the jenkins slaves still running FreeBSD 10.
>   Listing the tools we depend on explicitly instead of just using whatever
>   happens to be in $PATH allows us to check that we don't accidentally add a
>   new build dependency.
>   
>   All tools that do no need to be bootstrapped will now be symlinked to
>   ${WORLDTMP}/legacy/bin and during the build phase $PATH will only contain
>   ${WORLDTMP}. There is also a new variable "BOOTSTRAP_ALL_TOOLS" which can
>   be set to force compiling almost all bootstrap tools instead of symlinking
>   them. This will not bootstrap tools such as cp,mv, etc. since they may be
>   used during the build and for those we should really only be using POSIX
>   compatible options.
>   
>   Furthermore, this change is required in order to be able to build on
>   non-FreeBSD hosts. While the same binaries may exist on Linux/MacOS they
>   often accept different flags or produce incompatible output.
>   
>   Approved By:brooks (mentor)
>   Differential Revision: https://reviews.freebsd.org/D16815
> 
> Modified:
>   head/Makefile
>   head/Makefile.inc1
>   head/tools/build/Makefile
>   head/tools/tools/nanobsd/embedded/common
> 
> Modified: head/Makefile
> ==
> --- head/Makefile Mon Nov  5 19:25:57 2018(r340156)
> +++ head/Makefile Mon Nov  5 19:51:10 2018(r340157)
> @@ -610,10 +610,13 @@ _need_lld_${target}_${target_arch} != \
>  # XXX: Passing HOST_OBJTOP into the PATH would allow skipping legacy,
>  #  bootstrap-tools, and cross-tools.  Need to ensure each tool actually
>  #  supports all TARGETS though.
> +# For now we only pass UNIVERSE_TOOLCHAIN_PATH which will be added at the end
> +# of STRICTTMPPATH to ensure that the target-specific binaries come first.
>  MAKE_PARAMS_${target}+= \
>   XCC="${HOST_OBJTOP}/tmp/usr/bin/cc" \
>   XCXX="${HOST_OBJTOP}/tmp/usr/bin/c++" \
> - XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp"
> + XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp" \
> + UNIVERSE_TOOLCHAIN_PATH=${HOST_OBJTOP}/tmp/usr/bin
>  .endif
>  .if defined(_need_lld_${target}_${target_arch}) && \
>  ${_need_lld_${target}_${target_arch}} == "yes"
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Mon Nov  5 19:25:57 2018(r340156)
> +++ head/Makefile.inc1Mon Nov  5 19:51:10 2018(r340157)
> @@ -580,8 +580,21 @@ BUILD_ARCH!= uname -p
>  WORLDTMP?=   ${OBJTOP}/tmp
>  BPATH=   
> ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
>  XPATH=   ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
> -STRICTTMPPATH=   ${BPATH}:${XPATH}
> +
> +# When building we want to find the cross tools before the host tools in 
> ${BPATH}.
> +# We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared
> +# toolchain files (clang, lld, etc.) during make universe/tinderbox
> +STRICTTMPPATH=   ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH}
> +# We should not be using tools from /usr/bin accidentally since this could 
> cause
> +# the build to break on other systems that don't have that tool. For now we
> +# still allow using the old behaviour (inheriting $PATH) if
> +# BUILD_WITH_STRICT_TMPPATH is set to 0 but this will eventually be removed.
> +BUILD_WITH_STRICT_TMPPATH?=1
> +.if ${BUILD_WITH_STRICT_TMPPATH} != 0
> +TMPPATH= ${STRICTTMPPATH}
> +.else
>  TMPPATH= ${STRICTTMPPATH}:${PATH}
> +.endif
>  
>  #
>  # Avoid running mktemp(1) unless actually needed.
> @@ -589,8 +602,16 @@ TMPPATH= ${STRICTTMPPATH}:${PATH}
>  # when in the middle of installing over this system.
>  #
>  .if make(distributeworld) || make(installworld) || make(stageworld)
> -INSTALLTMP!= mktemp -d -u -t install
> +.if ${BUILD_WITH_STRICT_TMPPATH} != 0
> +MKTEMP=${WORLDTMP}/legacy/usr/bin/mktemp
> +.if !exists(${MKTEMP})
> +.error "mktemp binary doesn't exist in expected location: ${MKTEMP}"
>  .endif
> +.else
> +MKTEMP=mktemp
> +.endif
> +INSTALLTMP!= ${MKTEMP} -d -u -t install
> +.endif
>  
>  .if make(stagekernel) || make(distributekernel)
>  TAGS+=   kernel
> @@ -647,6 +668,8 @@ CROSSENV+=BUILD_TOOLS_META=.NOMETA
>  CROSSENV+=   ${TARGET_CFLAGS}
>  .endif
>  
> +BOOTSTRAPPING_OSRELDATE?=${OSRELDATE}
> +
>  # bootstrap-tools stage
>  BMAKEENV=INSTALL="sh ${.CURDIR}/tools/install.sh" \
>

svn commit: r340174 - head/sys/vm

2018-11-05 Thread Mark Johnston
Author: markj
Date: Tue Nov  6 02:52:54 2018
New Revision: 340174
URL: https://svnweb.freebsd.org/changeset/base/340174

Log:
  Initialize last_target in the laundry thread control loop.
  
  In practice it is always initialized because nfreed must be positive
  in order to trigger background laundering, but this isn't obvious.
  
  CID:  1387997
  MFC after:1 week

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cTue Nov  6 00:11:36 2018(r340173)
+++ head/sys/vm/vm_pageout.cTue Nov  6 02:52:54 2018(r340174)
@@ -973,7 +973,7 @@ vm_pageout_laundry_worker(void *arg)
shortfall = 0;
in_shortfall = false;
shortfall_cycle = 0;
-   target = 0;
+   last_target = target = 0;
nfreed = 0;
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r339898 - head/lib/libc/amd64/sys

2018-11-05 Thread Konstantin Belousov
On Mon, Nov 05, 2018 at 09:10:13PM -0500, Charlie Li wrote:
> On 03/11/2018 19:45, Konstantin Belousov wrote:
> > Or rather, it is a middle of the valid instruction.
> > Next frame looks like it is process_irelocs(), if trusting the line
> > numbers.  So most likely it is something related to calling wrong
> > relocator function, if anything.
> > 
> > Perhaps you could try to trace the things manually, doing
> > single-stepping of the startup code in debugger. There should be very
> > modest amount of the irelocs, perhaps only one, and see where things go
> > off the way.
> > 
> After a few more complete buildworlds, including one with all
> bootstrapping enabled, this doesn't look compiler-specific. Static
> binaries built with the in-tree base LLVM (6.0.1) also crash.
For you, but not for me.

> 
> I stepped through bmake with base lldb, comparing the working copy in my
> system from circa r339990 with r340173 built with bootstrapped
> toolchain. Only the differing parts are shown for conciseness.
> 
> Circa r339990:
> Process 82271 stopped
> * thread #1, name = 'make', stop reason = step over
> frame #0: 0x0024ab06 make`_init_tls at tls.c:471
>468  }
>469  tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN);
>470
> -> 471  _set_tp(tls);
>472  #endif
>473  }
> (lldb) n
> Process 82271 stopped
> * thread #1, name = 'make', stop reason = step over
> frame #0: 0x00255e60 make`_set_tp(tp=0x0008002f7830) at
> _set_tp.c:38
>35
>36   void
>37   _set_tp(void *tp)
> -> 38   {
>39
>40   amd64_set_fsbase(tp);
>41   }
> (lldb) s
> Process 82271 stopped
> * thread #1, name = 'make', stop reason = step in
> frame #0: 0x00255e64 make`_set_tp(tp=0x0008002f7830) at
> _set_tp.c:40
>37   _set_tp(void *tp)
>38   {
>39
> -> 40   amd64_set_fsbase(tp);
>41   }
> (lldb) s
> Process 82271 stopped
> * thread #1, name = 'make', stop reason = step in
> frame #0: 0x00256580
> make`amd64_set_fsbase(addr=0x0008002f7830) at amd64_set_fsbase.c:43
>40   #include 
>41   #include 
>42   #include 
> -> 43   #include "libc_private.h"
>44
>45   static int
>46   amd64_set_fsbase_cpu(void *addr)
> (lldb)
> 
> r340173:
> Process 22663 stopped
> * thread #1, name = 'make', stop reason = step over
> frame #0: 0x00247c96 make`_init_tls at tls.c:471
>468  }
>469  tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN);
>470
> -> 471  _set_tp(tls);
>472  #endif
>473  }
> (lldb) n
> Process 22663 stopped
> * thread #1, name = 'make', stop reason = step over
> frame #0: 0x00252eb0 make`_set_tp(tp=0x0008002ed830) at
> _set_tp.c:38
>35
>36   void
>37   _set_tp(void *tp)
> -> 38   {
>39
>40   amd64_set_fsbase(tp);
>41   }
> (lldb) s
> Process 22663 stopped
> * thread #1, name = 'make', stop reason = step in
> frame #0: 0x00252eb4 make`_set_tp(tp=0x0008002ed830) at
> _set_tp.c:40
>37   _set_tp(void *tp)
>38   {
>39
> -> 40   amd64_set_fsbase(tp);
>41   }
> (lldb) s
> Process 22663 stopped
> * thread #1, name = 'make', stop reason = step in
> frame #0: 0x00252eb5 make`_set_tp(tp=0x0008002ed830) at
> _set_tp.c:40
>37   _set_tp(void *tp)
>38   {
>39
> -> 40   amd64_set_fsbase(tp);
>41   }
> (lldb) s
> Process 22663 stopped
> * thread #1, name = 'make', stop reason = step in
> frame #0: 0x002ebdb0 make
> ->  0x2ebdb0: movq   0x3ce9(%rip), %r11
> 0x2ebdb7: callq  0x2ebda0  ; _fini
> 0x2ebdbc: jmp0x2ebd92  ; _init + 6
> 0x2ebdc1: pushq  $0x0
> (lldb) n
> Process 22663 stopped
> * thread #1, name = 'make', stop reason = instruction step over
> frame #0: 0x002ebdb7 make
> ->  0x2ebdb7: callq  0x2ebda0  ; _fini
I guess this is where things go off for you, but I may be wrong.
After ifuncification, 'amd64_set_fsbase()' line should be represented
by the asm as either
call
and the place in plt is just
jmp *(rip-based offset to GOT)(%rip)
In fact the call to amd64_set_fsbase() in the tail-call position, so
the first call is jmp.

For me, everything works.  If for you it does not you should look at the
instructions and see which values went off.  You completely omitted that
details from your trace, so I cannot even guess which part was corrupted.
Again, for me it works with the in-tree toolchain, so I am quite sure that
you have trouble with the toolchain.

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


svn commit: r339898 - head/lib/libc/amd64/sys

2018-11-05 Thread Charlie Li
On 03/11/2018 19:45, Konstantin Belousov wrote:
> Or rather, it is a middle of the valid instruction.
> Next frame looks like it is process_irelocs(), if trusting the line
> numbers.  So most likely it is something related to calling wrong
> relocator function, if anything.
> 
> Perhaps you could try to trace the things manually, doing
> single-stepping of the startup code in debugger. There should be very
> modest amount of the irelocs, perhaps only one, and see where things go
> off the way.
> 
After a few more complete buildworlds, including one with all
bootstrapping enabled, this doesn't look compiler-specific. Static
binaries built with the in-tree base LLVM (6.0.1) also crash.

I stepped through bmake with base lldb, comparing the working copy in my
system from circa r339990 with r340173 built with bootstrapped
toolchain. Only the differing parts are shown for conciseness.

Circa r339990:
Process 82271 stopped
* thread #1, name = 'make', stop reason = step over
frame #0: 0x0024ab06 make`_init_tls at tls.c:471
   468  }
   469  tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN);
   470
-> 471  _set_tp(tls);
   472  #endif
   473  }
(lldb) n
Process 82271 stopped
* thread #1, name = 'make', stop reason = step over
frame #0: 0x00255e60 make`_set_tp(tp=0x0008002f7830) at
_set_tp.c:38
   35
   36   void
   37   _set_tp(void *tp)
-> 38   {
   39
   40   amd64_set_fsbase(tp);
   41   }
(lldb) s
Process 82271 stopped
* thread #1, name = 'make', stop reason = step in
frame #0: 0x00255e64 make`_set_tp(tp=0x0008002f7830) at
_set_tp.c:40
   37   _set_tp(void *tp)
   38   {
   39
-> 40   amd64_set_fsbase(tp);
   41   }
(lldb) s
Process 82271 stopped
* thread #1, name = 'make', stop reason = step in
frame #0: 0x00256580
make`amd64_set_fsbase(addr=0x0008002f7830) at amd64_set_fsbase.c:43
   40   #include 
   41   #include 
   42   #include 
-> 43   #include "libc_private.h"
   44
   45   static int
   46   amd64_set_fsbase_cpu(void *addr)
(lldb)

r340173:
Process 22663 stopped
* thread #1, name = 'make', stop reason = step over
frame #0: 0x00247c96 make`_init_tls at tls.c:471
   468  }
   469  tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN);
   470
-> 471  _set_tp(tls);
   472  #endif
   473  }
(lldb) n
Process 22663 stopped
* thread #1, name = 'make', stop reason = step over
frame #0: 0x00252eb0 make`_set_tp(tp=0x0008002ed830) at
_set_tp.c:38
   35
   36   void
   37   _set_tp(void *tp)
-> 38   {
   39
   40   amd64_set_fsbase(tp);
   41   }
(lldb) s
Process 22663 stopped
* thread #1, name = 'make', stop reason = step in
frame #0: 0x00252eb4 make`_set_tp(tp=0x0008002ed830) at
_set_tp.c:40
   37   _set_tp(void *tp)
   38   {
   39
-> 40   amd64_set_fsbase(tp);
   41   }
(lldb) s
Process 22663 stopped
* thread #1, name = 'make', stop reason = step in
frame #0: 0x00252eb5 make`_set_tp(tp=0x0008002ed830) at
_set_tp.c:40
   37   _set_tp(void *tp)
   38   {
   39
-> 40   amd64_set_fsbase(tp);
   41   }
(lldb) s
Process 22663 stopped
* thread #1, name = 'make', stop reason = step in
frame #0: 0x002ebdb0 make
->  0x2ebdb0: movq   0x3ce9(%rip), %r11
0x2ebdb7: callq  0x2ebda0  ; _fini
0x2ebdbc: jmp0x2ebd92  ; _init + 6
0x2ebdc1: pushq  $0x0
(lldb) n
Process 22663 stopped
* thread #1, name = 'make', stop reason = instruction step over
frame #0: 0x002ebdb7 make
->  0x2ebdb7: callq  0x2ebda0  ; _fini
0x2ebdbc: jmp0x2ebd92  ; _init + 6
0x2ebdc1: pushq  $0x0
0x2ebdc6: jmp0x2ebd80  ; __do_global_ctors_aux + 48
(lldb) n
Process 22663 stopped
* thread #1, name = 'make', stop reason = instruction step over
frame #0: 0x002ebda0 make`_fini at crti.S:41
   38   .globl  _fini
   39   .type   _fini,@function
   40   _fini:
-> 41   subq$8,%rsp
   42
   43   .section .note.GNU-stack,"",%progbits
(lldb) n
Process 22663 stopped
* thread #1, name = 'make', stop reason = step over
frame #0: 0x002ebda4 make`_fini + 4
make`_fini:
->  0x2ebda4 <+4>:  callq  0x226310  ; __do_global_dtors_aux
0x2ebda9 <+9>:  addq   $0x8, %rsp
0x2ebdad <+13>: retq
0x2ebdae:   addb   %al, (%rax)
(lldb) n
Process 22663 stopped
* thread #1, name = 'make', stop reason = instruction step over
frame #0: 0x002ebda9 make`_fini at crtn.S:34
   31   ret
   32
   33   .section .fini,"ax",@progbits
-> 34   addq$8,%rsp
   35   ret
   36
   37   .section .note.GNU-stack,"",%progbits
(lldb) n
Process 22663 stopped
* thread #1, name = 'make', stop reason = step over
frame #0: 0x002ebdad make`_fini at crtn.S:35
   32
   33   .section .fini,"ax",@progbits

Re: svn commit: r340171 - head/sys/sys

2018-11-05 Thread Ed Maste
On Mon, 5 Nov 2018 at 19:05, Ed Maste  wrote:
>
> Author: emaste
> Date: Tue Nov  6 00:05:17 2018
> New Revision: 340171
> URL: https://svnweb.freebsd.org/changeset/base/340171
>
> Log:
>   capability.h: add comment about planned removal timeline
>
>   PR:   233007

Oops, this was meant to reference PR 228878, the exp-run.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340157 - in head: . tools/build tools/tools/nanobsd/embedded

2018-11-05 Thread Alexander Richardson
On Mon, 5 Nov 2018, 23:32 Bryan Drewery  On 11/5/2018 11:51 AM, Alex Richardson wrote:
> > Author: arichardson
> > Date: Mon Nov  5 19:51:10 2018
> > New Revision: 340157
> > URL: https://svnweb.freebsd.org/changeset/base/340157
> >
> > Log:
> >   Allow building world without inheriting $PATH
> >
>
> This change has a summary that doesn't seem to match its change (to
> build host tools for cross-os builds).
> Does $PATH go into the build still or not? SYSTEM_COMPILER relies on
> $PATH inheriting into the build.


Bootstrapping of host tools does not change unless BOOTSTRAP_ALL_TOOLS is
set on the make command line (this will be the default for cross-os builds
but that still requires more changes). This patch only ensures that the
required tools are symlinked into worldtmp.

$PATH should only be inherited for the bootstrap-tools phase. I thought I
had tested all variations of universe builds but it looks like I forgot to
test on a SYSTEM_COMPILER machine so didn't notice it is needed there. This
should be fixed in r340167.
$PATH will now be inherited when using the system compiler or linker but
otherwise the strict path will be used.

In case I missed more cases: the new strict path behaviour can be disabled
by setting BUILD_WITH_STRICT_TMPPATH=0.

Sorry about any breakage.

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


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

2018-11-05 Thread John Baldwin
Author: jhb
Date: Tue Nov  6 00:11:36 2018
New Revision: 340173
URL: https://svnweb.freebsd.org/changeset/base/340173

Log:
  Add a facility for transmitting "raw" work requests on regular NIC queues.
  
  - Use PH_loc.eight[1] as a general 'cflags' (Chelsio flags) field to
describe properties of a queued packet.  The MC_RAW_WR flag
indicates an mbuf holding a raw work request.  mbuf_cflags() returns
the current flags.
  - Raw work request mbufs are allocated via alloc_wr_mbuf() which will
allocate a single contiguous range to hold the mbuf data.  The
consumer can use mtod() to obtain the start of the work request and
write the required work request in the buffer.  The mbuf can then be
enqueued directly to the txq via mp_ring_enqueue().
  - Since raw work requests might potentially send arbitrary work
requests, only set the EQUIQ and EQUEQ bits on work requests that
support them such as the normal tunneled Ethernet packet work
requests.
  
  Reviewed by:  np
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D17811

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hTue Nov  6 00:09:43 2018
(r340172)
+++ head/sys/dev/cxgbe/adapter.hTue Nov  6 00:11:36 2018
(r340173)
@@ -574,6 +574,7 @@ struct sge_txq {
uint64_t txpkts1_wrs;   /* # of type1 coalesced tx work requests */
uint64_t txpkts0_pkts;  /* # of frames in type0 coalesced tx WRs */
uint64_t txpkts1_pkts;  /* # of frames in type1 coalesced tx WRs */
+   uint64_t raw_wrs;   /* # of raw work requests (alloc_wr_mbuf) */
 
/* stats for not-that-common events */
 } __aligned(CACHE_LINE_SIZE);
@@ -1170,6 +1171,7 @@ void t4_intr_err(void *);
 void t4_intr_evt(void *);
 void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);
 void t4_update_fl_bufsize(struct ifnet *);
+struct mbuf *alloc_wr_mbuf(int, int);
 int parse_pkt(struct adapter *, struct mbuf **);
 void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *);
 void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *);

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Nov  6 00:09:43 2018
(r340172)
+++ head/sys/dev/cxgbe/t4_main.cTue Nov  6 00:11:36 2018
(r340173)
@@ -9804,6 +9804,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t 
txq->txpkts1_wrs = 0;
txq->txpkts0_pkts = 0;
txq->txpkts1_pkts = 0;
+   txq->raw_wrs = 0;
mp_ring_reset_stats(txq->r);
}
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Tue Nov  6 00:09:43 2018(r340172)
+++ head/sys/dev/cxgbe/t4_sge.c Tue Nov  6 00:11:36 2018(r340173)
@@ -82,6 +82,9 @@ __FBSDID("$FreeBSD$");
 #define RX_COPY_THRESHOLD MINCLSIZE
 #endif
 
+/* Internal mbuf flags stored in PH_loc.eight[1]. */
+#defineMC_RAW_WR   0x02
+
 /*
  * Ethernet frames are DMA'd at this byte offset into the freelist buffer.
  * 0-7 are valid values.
@@ -270,6 +273,7 @@ static inline u_int txpkt_len16(u_int, u_int);
 static inline u_int txpkt_vm_len16(u_int, u_int);
 static inline u_int txpkts0_len16(u_int);
 static inline u_int txpkts1_len16(void);
+static u_int write_raw_wr(struct sge_txq *, void *, struct mbuf *, u_int);
 static u_int write_txpkt_wr(struct sge_txq *, struct fw_eth_tx_pkt_wr *,
 struct mbuf *, u_int);
 static u_int write_txpkt_vm_wr(struct adapter *, struct sge_txq *,
@@ -2196,6 +2200,22 @@ set_mbuf_nsegs(struct mbuf *m, uint8_t nsegs)
 }
 
 static inline int
+mbuf_cflags(struct mbuf *m)
+{
+
+   M_ASSERTPKTHDR(m);
+   return (m->m_pkthdr.PH_loc.eight[4]);
+}
+
+static inline void
+set_mbuf_cflags(struct mbuf *m, uint8_t flags)
+{
+
+   M_ASSERTPKTHDR(m);
+   m->m_pkthdr.PH_loc.eight[4] = flags;
+}
+
+static inline int
 mbuf_len16(struct mbuf *m)
 {
int n;
@@ -2276,6 +2296,31 @@ needs_eo(struct mbuf *m)
 }
 #endif
 
+/*
+ * Try to allocate an mbuf to contain a raw work request.  To make it
+ * easy to construct the work request, don't allocate a chain but a
+ * single mbuf.
+ */
+struct mbuf *
+alloc_wr_mbuf(int len, int how)
+{
+   struct mbuf *m;
+
+   if (len <= MHLEN)
+   m = m_gethdr(how, MT_DATA);
+   else if (len <= MCLBYTES)
+   m = m_getcl(how, MT_DATA, M_PKTHDR);
+   else
+   m = NULL;
+   if 

svn commit: r340172 - head/sys/kern

2018-11-05 Thread Brooks Davis
Author: brooks
Date: Tue Nov  6 00:09:43 2018
New Revision: 340172
URL: https://svnweb.freebsd.org/changeset/base/340172

Log:
  Fix a couple indentation errors in r339958.

Modified:
  head/sys/kern/syscalls.master

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Tue Nov  6 00:05:17 2018
(r340171)
+++ head/sys/kern/syscalls.master   Tue Nov  6 00:09:43 2018
(r340172)
@@ -761,8 +761,8 @@
 120AUE_READV   STD {
int readv(
int fd,
-  _Inout_updates_(iovcnt) struct iovec *iovp,
-  u_int iovcnt
+   _Inout_updates_(iovcnt) struct iovec *iovp,
+   u_int iovcnt
);
}
 121AUE_WRITEV  STD {
@@ -848,7 +848,7 @@
int s,
_In_reads_bytes_(len) caddr_t buf,
size_t len,
-int flags,
+   int flags,
_In_reads_bytes_opt_(tolen) caddr_t to,
int tolen
);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340171 - head/sys/sys

2018-11-05 Thread Ed Maste
Author: emaste
Date: Tue Nov  6 00:05:17 2018
New Revision: 340171
URL: https://svnweb.freebsd.org/changeset/base/340171

Log:
  capability.h: add comment about planned removal timeline
  
  PR:   233007
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/capability.h

Modified: head/sys/sys/capability.h
==
--- head/sys/sys/capability.h   Mon Nov  5 22:54:03 2018(r340170)
+++ head/sys/sys/capability.h   Tue Nov  6 00:05:17 2018(r340171)
@@ -35,7 +35,8 @@
  * Historically, the key userspace and kernel Capsicum definitions were found
  * in this file.  However, it conflicted with POSIX.1e's capability.h, so has
  * been renamed capsicum.h.  The file remains for backwards compatibility
- * reasons as a nested include.
+ * reasons as a nested include.  It is expected to be removed before
+ * FreeBSD 13.
  */
 #ifndef _SYS_CAPABILITY_H_
 #define_SYS_CAPABILITY_H_
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r338268 - head

2018-11-05 Thread Alexander Richardson
On Mon, 5 Nov 2018 at 23:03, Bryan Drewery  wrote:
>
> On 8/23/2018 11:19 AM, Alex Richardson wrote:
> > Author: arichardson
> > Date: Thu Aug 23 18:19:10 2018
> > New Revision: 338268
> > URL: https://svnweb.freebsd.org/changeset/base/338268
> >
> > Log:
> >   Fix non-FreeBSD host lib32 build for TARGET=amd64
> >
> >   When building on non-FreeBSD systems we need to pass an explicit target
> >   triple to clang otherwise it will attempt to build with the host triple.
> >   This also has advantages when building on a FreeBSD host: we now tell
> >   clang that we are targeting at least FreeBSD 12.0 instead of an older
> >   version so it can enable newer features.
> >
> >   Reviewed By:brooks (mentor)
> >   Approved By:jhb (mentor)
> >   Differential Revision: https://reviews.freebsd.org/D16842
> >
> > Modified:
> >   head/Makefile.libcompat
> >
> > Modified: head/Makefile.libcompat
> > ==
> > --- head/Makefile.libcompat   Thu Aug 23 18:19:01 2018(r338267)
> > +++ head/Makefile.libcompat   Thu Aug 23 18:19:10 2018(r338268)
> > @@ -14,6 +14,11 @@ LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
> >  .else
> >  LIB32CPUFLAGS=   -march=${TARGET_CPUTYPE}
> >  .endif
> > +.if ${WANT_COMPILER_TYPE} == gcc || \
> > +(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
> > +.else
> > +LIB32CPUFLAGS+=  -target x86_64-unknown-freebsd12.0
>
> This can be ${TARGET_TRIPLE}, no?
> It also seems like it should be in the LIBSOFT flags too; via
> LIBCOMPATCFLAGS.

Yes, that would be better. I didn't see that we already had a variable
with the target triple when I wrote this patch.
I can fix this tomorrow morning.

Alex
>
> > +.endif
> >  LIB32CPUFLAGS+=  -m32
> >  LIB32WMAKEENV=   MACHINE=i386 MACHINE_ARCH=i386 \
> >   MACHINE_CPU="i686 mmx sse sse2"
> >
>
>
> --
> Regards,
> Bryan Drewery
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340157 - in head: . tools/build tools/tools/nanobsd/embedded

2018-11-05 Thread Bryan Drewery
On 11/5/2018 11:51 AM, Alex Richardson wrote:
> Author: arichardson
> Date: Mon Nov  5 19:51:10 2018
> New Revision: 340157
> URL: https://svnweb.freebsd.org/changeset/base/340157
> 
> Log:
>   Allow building world without inheriting $PATH
>   

This change has a summary that doesn't seem to match its change (to
build host tools for cross-os builds).
Does $PATH go into the build still or not? SYSTEM_COMPILER relies on
$PATH inheriting into the build.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r339636 - in head: . share/mk

2018-11-05 Thread Alexander Richardson
On Mon, 5 Nov 2018 at 23:00, Bryan Drewery  wrote:
>
> On 10/22/2018 11:31 PM, Alex Richardson wrote:
> > Author: arichardson
> > Date: Tue Oct 23 06:31:25 2018
> > New Revision: 339636
> > URL: https://svnweb.freebsd.org/changeset/base/339636
> >
> > Log:
> >   Only compute the X_COMPILER_*/X_LINKER_* variables when needed
> >
> >   When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
> >   This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
> >   in bsd.linker.mk) which causes it to call ${XCC} --version and
> >   ${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
> >   For incremental builds and stages that only walk the source tree this is
> >   often the majority of the time spent in that directory.
> >
> ...
>
> >   By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
> >   _WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
> >   to once per build stage instead of once per recursive make.
>
> This sounds wrong. bsd.compiler.mk *already* handles that kind of thing
> by exporting its computations. Adding a second hack for a similar
> problem isn't the right solution.
>

I added debug .info statements for every time bsd.compiler.mk was
running cc --version and it was always running it for $XCC during make
buildworld.
As far as I can tell this happens because $CC and $XCC no longer match.
I believe the problem is that the toplevel makefile runs the cross
stages with CC="${XCC} ${XCFLAGS}" so if you have XCFLAGS set in your
environment $CC will never be equal to $XCC.
This also means there is not cached variable for $XCC since it was
computed for "${XCC} ${XCFLAGS}" rather than $XCC .

This patch massively reduced the incremental build time for CheriBSD
but if you can suggest I better fix that would be great.

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


Re: svn commit: r338268 - head

2018-11-05 Thread Bryan Drewery
On 8/23/2018 11:19 AM, Alex Richardson wrote:
> Author: arichardson
> Date: Thu Aug 23 18:19:10 2018
> New Revision: 338268
> URL: https://svnweb.freebsd.org/changeset/base/338268
> 
> Log:
>   Fix non-FreeBSD host lib32 build for TARGET=amd64
>   
>   When building on non-FreeBSD systems we need to pass an explicit target
>   triple to clang otherwise it will attempt to build with the host triple.
>   This also has advantages when building on a FreeBSD host: we now tell
>   clang that we are targeting at least FreeBSD 12.0 instead of an older
>   version so it can enable newer features.
>   
>   Reviewed By:brooks (mentor)
>   Approved By:jhb (mentor)
>   Differential Revision: https://reviews.freebsd.org/D16842
> 
> Modified:
>   head/Makefile.libcompat
> 
> Modified: head/Makefile.libcompat
> ==
> --- head/Makefile.libcompat   Thu Aug 23 18:19:01 2018(r338267)
> +++ head/Makefile.libcompat   Thu Aug 23 18:19:10 2018(r338268)
> @@ -14,6 +14,11 @@ LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
>  .else
>  LIB32CPUFLAGS=   -march=${TARGET_CPUTYPE}
>  .endif
> +.if ${WANT_COMPILER_TYPE} == gcc || \
> +(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
> +.else
> +LIB32CPUFLAGS+=  -target x86_64-unknown-freebsd12.0

This can be ${TARGET_TRIPLE}, no?
It also seems like it should be in the LIBSOFT flags too; via
LIBCOMPATCFLAGS.

> +.endif
>  LIB32CPUFLAGS+=  -m32
>  LIB32WMAKEENV=   MACHINE=i386 MACHINE_ARCH=i386 \
>   MACHINE_CPU="i686 mmx sse sse2"
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r339636 - in head: . share/mk

2018-11-05 Thread Bryan Drewery
On 10/22/2018 11:31 PM, Alex Richardson wrote:
> Author: arichardson
> Date: Tue Oct 23 06:31:25 2018
> New Revision: 339636
> URL: https://svnweb.freebsd.org/changeset/base/339636
> 
> Log:
>   Only compute the X_COMPILER_*/X_LINKER_* variables when needed
>   
>   When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
>   This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
>   in bsd.linker.mk) which causes it to call ${XCC} --version and
>   ${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
>   For incremental builds and stages that only walk the source tree this is
>   often the majority of the time spent in that directory.
>   
...

>   By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
>   _WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
>   to once per build stage instead of once per recursive make.

This sounds wrong. bsd.compiler.mk *already* handles that kind of thing
by exporting its computations. Adding a second hack for a similar
problem isn't the right solution.

>   
>   With this change (and no changes to the sources) the `make includes` stage
>   now takes 28 seconds at -j1 instead of 86 seconds.
>   
>   Approved By:brooks (mentor)
>   Differential Revision: https://reviews.freebsd.org/D17046


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r339946 - in head: . share/mk

2018-11-05 Thread Bryan Drewery
On 10/31/2018 3:45 AM, Alex Richardson wrote:
> Author: arichardson
> Date: Wed Oct 31 10:45:28 2018
> New Revision: 339946
> URL: https://svnweb.freebsd.org/changeset/base/339946
> 
> Log:
>   Don't run cc --version during cleandir/obj stages
>   

I haven't had a chance to look at this fully or r339636 but I don't
think this change, r339946, is complete. There's far more tree-walks
than these named ones that should not be running cc.


>   This will no work when there is no cc in $PATH (which is the case before the
>   cross-tools stage once we no longer inherit $PATH in $WMAKE).
>   The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these
>   stages so this avoids a little bit of makefile parsing.
>   
>   Reviewed By:emaste
>   Approved By:jhb (mentor)
>   Differential Revision: https://reviews.freebsd.org/D16814
> 
> Modified:
>   head/Makefile.inc1
>   head/share/mk/bsd.compiler.mk
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Wed Oct 31 10:30:19 2018(r339945)
> +++ head/Makefile.inc1Wed Oct 31 10:45:28 2018(r339946)
> @@ -950,7 +950,7 @@ _worldtmp: .PHONY
>  .else
>   ${_+_}@if [ -e "${WORLDTMP}" ]; then \
>   echo ">>> Deleting stale files in build tree..."; \
> - cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
> + cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES 
> _NO_INCLUDE_COMPILERMK=t \
>   delete-old delete-old-libs >/dev/null; \
>   fi
>   rm -rf ${WORLDTMP}/legacy/usr/include
> @@ -1003,19 +1003,21 @@ _cleanobj:
>   @echo "--"
>   @echo ">>> stage 2.1: cleaning up the object tree"
>   @echo "--"
> - ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR}
> + # Avoid including bsd.compiler.mk in clean and obj with 
> _NO_INCLUDE_COMPILERMK
> + # since the restricted $PATH might not contain a valid cc binary
> + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t ${CLEANDIR}
>  .if defined(LIBCOMPAT)
> - ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR}
> + ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} _NO_INCLUDE_COMPILERMK=t -f 
> Makefile.inc1 ${CLEANDIR}
>  .endif
>  .else
> - ${_+_}cd ${.CURDIR}; ${WMAKE} _cleanobj_fast_depend_hack
> + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t 
> _cleanobj_fast_depend_hack
>  .endif   # !defined(NO_CLEAN)
>  _obj:
>   @echo
>   @echo "--"
>   @echo ">>> stage 2.2: rebuilding the object tree"
>   @echo "--"
> - ${_+_}cd ${.CURDIR}; ${WMAKE} obj
> + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t obj
>  _build-tools:
>   @echo
>   @echo "--"
> 
> Modified: head/share/mk/bsd.compiler.mk
> ==
> --- head/share/mk/bsd.compiler.mk Wed Oct 31 10:30:19 2018
> (r339945)
> +++ head/share/mk/bsd.compiler.mk Wed Oct 31 10:45:28 2018
> (r339946)
> @@ -33,6 +33,16 @@ :
>  
>  .include 
>  
> +.if defined(_NO_INCLUDE_COMPILERMK)
> +# If _NO_INCLUDE_COMPILERMK is set we are doing a make obj/cleandir/cleanobj
> +# and might not have a valid compiler in $PATH yet. In this case just set the
> +# variables that are expected by the other .mk files and return
> +COMPILER_TYPE=none
> +X_COMPILER_TYPE=none
> +COMPILER_VERSION=0
> +X_COMPILER_VERSION=0
> +COMPILER_FEATURES=none
> +.else
>  # command = /usr/local/bin/ccache cc ...
>  # wrapper = /usr/local/libexec/ccache/cc ...
>  CCACHE_BUILD_TYPE?=  command
> @@ -220,4 +230,5 @@ ${var}.${${X_}_cc_hash}:= ${${var}}
>  .if !defined(_NO_INCLUDE_LINKERMK)
>  .include 
>  .endif
> +.endif   # defined(_NO_INCLUDE_COMPILERMK)
>  .endif   # !target()
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r340169 - head/usr.bin/elfdump

2018-11-05 Thread Brooks Davis
Author: brooks
Date: Mon Nov  5 22:53:50 2018
New Revision: 340169
URL: https://svnweb.freebsd.org/changeset/base/340169

Log:
  elfdump: Add -E to test if a file is an ELF binary.
  
  This is intended to replace potentially unreliable checks like:
  
file -b $1 | grep -q '^ELF ..-bit .SB executable'
  
  Reviewed by:  emaste
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D15971

Modified:
  head/usr.bin/elfdump/elfdump.1
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.1
==
--- head/usr.bin/elfdump/elfdump.1  Mon Nov  5 22:51:45 2018
(r340168)
+++ head/usr.bin/elfdump/elfdump.1  Mon Nov  5 22:53:50 2018
(r340169)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 15, 2003
+.Dd November 5, 2018
 .Dt ELFDUMP 1
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 files
 .Sh SYNOPSIS
 .Nm
-.Fl a | cdeGhinprs
+.Fl a | E | cdeGhinprs
 .Op Fl w Ar file
 .Ar file
 .Sh DESCRIPTION
@@ -55,6 +55,11 @@ Dump section headers.
 Dump dynamic symbols.
 .It Fl e
 Dump ELF header.
+.It Fl E
+Return success if
+.Ar file
+is an ELF file and failure if it is not.
+This option is exclusive with other options.
 .It Fl G
 Dump the GOT.
 .It Fl h

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Mon Nov  5 22:51:45 2018
(r340168)
+++ head/usr.bin/elfdump/elfdump.c  Mon Nov  5 22:53:50 2018
(r340169)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #defineED_SHDR (1<<8)
 #defineED_SYMTAB   (1<<9)
 #defineED_ALL  ((1<<10)-1)
+#defineED_IS_ELF   (1<<10) /* Exclusive with other flags */
 
 #defineelf_get_addrelf_get_quad
 #defineelf_get_off elf_get_quad
@@ -518,7 +519,7 @@ main(int ac, char **av)
 
out = stdout;
flags = 0;
-   while ((ch = getopt(ac, av, "acdeiGhnprsw:")) != -1)
+   while ((ch = getopt(ac, av, "acdEeiGhnprsw:")) != -1)
switch (ch) {
case 'a':
flags = ED_ALL;
@@ -529,6 +530,9 @@ main(int ac, char **av)
case 'd':
flags |= ED_DYN;
break;
+   case 'E':
+   flags = ED_IS_ELF;
+   break;
case 'e':
flags |= ED_EHDR;
break;
@@ -566,7 +570,8 @@ main(int ac, char **av)
}
ac -= optind;
av += optind;
-   if (ac == 0 || flags == 0)
+   if (ac == 0 || flags == 0 || ((flags & ED_IS_ELF) &&
+   (ac != 1 || (flags & ~ED_IS_ELF) || out != stdout)))
usage();
if ((fd = open(*av, O_RDONLY)) < 0 ||
fstat(fd, ) < 0)
@@ -584,8 +589,12 @@ main(int ac, char **av)
e = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (e == MAP_FAILED)
err(1, NULL);
-   if (!IS_ELF(*(Elf32_Ehdr *)e))
+   if (!IS_ELF(*(Elf32_Ehdr *)e)) {
+   if (flags & ED_IS_ELF)
+   exit(1);
errx(1, "not an elf file");
+   } else if (flags & ED_IS_ELF)
+   exit (0);
phoff = elf_get_off(e, e, E_PHOFF);
shoff = elf_get_off(e, e, E_SHOFF);
phentsize = elf_get_quarter(e, e, E_PHENTSIZE);
@@ -1254,6 +1263,7 @@ elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t m
 static void
 usage(void)
 {
-   fprintf(stderr, "usage: elfdump -a | -cdeGhinprs [-w file] file\n");
+   fprintf(stderr,
+   "usage: elfdump -a | -E | -cdeGhinprs [-w file] file\n");
exit(1);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-11-05 Thread John Baldwin
Author: jhb
Date: Mon Nov  5 22:54:03 2018
New Revision: 340170
URL: https://svnweb.freebsd.org/changeset/base/340170

Log:
  Add a custom implementation of cpu_lock_delay() for x86.
  
  Avoid using DELAY() since it can try to use spin locks on CPUs without
  a P-state invariant TSC.  For cpu_lock_delay(), always use the TSC if
  it exists (even if it is not P-state invariant) to delay for a
  microsecond.  If the TSC does not exist, read from I/O port 0x84 to
  delay instead.
  
  PR:   228768
  Reported by:  Roger Hammerstein 
  Reviewed by:  kib
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D17851

Modified:
  head/sys/amd64/include/cpu.h
  head/sys/i386/include/cpu.h
  head/sys/x86/x86/delay.c

Modified: head/sys/amd64/include/cpu.h
==
--- head/sys/amd64/include/cpu.hMon Nov  5 22:53:50 2018
(r340169)
+++ head/sys/amd64/include/cpu.hMon Nov  5 22:54:03 2018
(r340170)
@@ -50,7 +50,6 @@
 #definecpu_getstack(td)((td)->td_frame->tf_rsp)
 #definecpu_setstack(td, ap)((td)->td_frame->tf_rsp = (ap))
 #definecpu_spinwait()  ia32_pause()
-#definecpu_lock_delay()DELAY(1)
 
 #defineTRAPF_USERMODE(framep) \
(ISPL((framep)->tf_cs) == SEL_UPL)
@@ -78,6 +77,7 @@ extern char   etext[];
 extern void (*vmm_resume_p)(void);
 
 void   cpu_halt(void);
+void   cpu_lock_delay(void);
 void   cpu_reset(void);
 void   fork_trampoline(void);
 void   swi_vm(void *);

Modified: head/sys/i386/include/cpu.h
==
--- head/sys/i386/include/cpu.h Mon Nov  5 22:53:50 2018(r340169)
+++ head/sys/i386/include/cpu.h Mon Nov  5 22:54:03 2018(r340170)
@@ -50,7 +50,6 @@
 #definecpu_getstack(td)((td)->td_frame->tf_esp)
 #definecpu_setstack(td, ap)((td)->td_frame->tf_esp = (ap))
 #definecpu_spinwait()  ia32_pause()
-#definecpu_lock_delay()DELAY(1)
 
 #defineTRAPF_USERMODE(framep) \
((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM))
@@ -73,6 +72,7 @@ extern char   btext[];
 extern charetext[];
 
 void   cpu_halt(void);
+void   cpu_lock_delay(void);
 void   cpu_reset(void);
 void   fork_trampoline(void);
 void   swi_vm(void *);

Modified: head/sys/x86/x86/delay.c
==
--- head/sys/x86/x86/delay.cMon Nov  5 22:53:50 2018(r340169)
+++ head/sys/x86/x86/delay.cMon Nov  5 22:54:03 2018(r340170)
@@ -122,3 +122,22 @@ DELAY(int n)
init_ops.early_delay(n);
TSEXIT();
 }
+
+void
+cpu_lock_delay(void)
+{
+
+   /*
+* Use TSC to wait for a usec if present, otherwise fall back
+* to reading from port 0x84.  We can't call into timecounters
+* for this delay since timecounters might use spin locks.
+*
+* Note that unlike delay_tc(), this uses the TSC even if it
+* is not P-state invariant.  For this function it is ok to
+* wait even a few usecs.
+*/
+   if (tsc_freq != 0)
+   delay_tsc(1);
+   else
+   inb(0x84);
+}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340167 - head

2018-11-05 Thread Alex Richardson
Author: arichardson
Date: Mon Nov  5 22:51:44 2018
New Revision: 340167
URL: https://svnweb.freebsd.org/changeset/base/340167

Log:
  Keep inheriting $PATH when using system linker/compiler
  
  I missed this case when testing r340157. For now just keep
  $PATH when we aren't bootstrapping a compiler so that the build
  can find cc/c++/ld without an absolute path.
  
  Reported by:  yuripv

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Nov  5 22:36:45 2018(r340166)
+++ head/Makefile.inc1  Mon Nov  5 22:51:44 2018(r340167)
@@ -589,7 +589,12 @@ STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_
 # the build to break on other systems that don't have that tool. For now we
 # still allow using the old behaviour (inheriting $PATH) if
 # BUILD_WITH_STRICT_TMPPATH is set to 0 but this will eventually be removed.
+.if ${USING_SYSTEM_LINKER} != "no" || ${USING_SYSTEM_COMPILER} != "no"
+# strict $PATH does not work yet with USING_SYSTEM_LINKER/USING_SYSTEM_COMPILER
+BUILD_WITH_STRICT_TMPPATH?=0
+.else
 BUILD_WITH_STRICT_TMPPATH?=1
+.endif
 .if ${BUILD_WITH_STRICT_TMPPATH} != 0
 TMPPATH=   ${STRICTTMPPATH}
 .else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340168 - head/sys/x86/x86

2018-11-05 Thread John Baldwin
Author: jhb
Date: Mon Nov  5 22:51:45 2018
New Revision: 340168
URL: https://svnweb.freebsd.org/changeset/base/340168

Log:
  Add a delay_tsc() static function for when DELAY() uses the TSC.
  
  This uses slightly simpler logic than the existing code by using the
  full 64-bit counter and thus not having to worry about counter
  overflow.
  
  Reviewed by:  kib
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D17850

Modified:
  head/sys/x86/x86/delay.c

Modified: head/sys/x86/x86/delay.c
==
--- head/sys/x86/x86/delay.cMon Nov  5 22:51:44 2018(r340167)
+++ head/sys/x86/x86/delay.cMon Nov  5 22:51:45 2018(r340168)
@@ -51,11 +51,23 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static u_int
-get_tsc(__unused struct timecounter *tc)
+static void
+delay_tsc(int n)
 {
+   uint64_t end, now;
 
-   return (rdtsc32());
+   /*
+* Pin the current thread ensure correct behavior if the TSCs
+* on different CPUs are not in sync.
+*/
+   sched_pin();
+   now = rdtsc();
+   end = now + tsc_freq * n / 100;
+   do {
+   cpu_spinwait();
+   now = rdtsc();
+   } while (now < end);
+   sched_unpin();
 }
 
 static int
@@ -66,22 +78,24 @@ delay_tc(int n)
uint64_t end, freq, now;
u_int last, mask, u;
 
-   tc = timecounter;
-   freq = atomic_load_acq_64(_freq);
-   if (tsc_is_invariant && freq != 0) {
-   func = get_tsc;
-   mask = ~0u;
-   } else {
-   if (tc->tc_quality <= 0)
-   return (0);
-   func = tc->tc_get_timecount;
-   mask = tc->tc_counter_mask;
-   freq = tc->tc_frequency;
+   /*
+* Only use the TSC if it is P-state invariant.  If the TSC is
+* not P-state invariant and the CPU is not running at the
+* "full" P-state, then the TSC will increment at some rate
+* less than tsc_freq and delay_tsc() will wait too long.
+*/
+   if (tsc_is_invariant && tsc_freq != 0) {
+   delay_tsc(n);
+   return (1);
}
+   tc = timecounter;
+   if (tc->tc_quality <= 0)
+   return (0);
+   func = tc->tc_get_timecount;
+   mask = tc->tc_counter_mask;
+   freq = tc->tc_frequency;
now = 0;
end = freq * n / 100;
-   if (func == get_tsc)
-   sched_pin();
last = func(tc) & mask;
do {
cpu_spinwait();
@@ -92,8 +106,6 @@ delay_tc(int n)
now += u - last;
last = u;
} while (now < end);
-   if (func == get_tsc)
-   sched_unpin();
return (1);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340166 - in head: . sys/sys

2018-11-05 Thread Ed Maste
Author: emaste
Date: Mon Nov  5 22:36:45 2018
New Revision: 340166
URL: https://svnweb.freebsd.org/changeset/base/340166

Log:
  revert r340156, restoring sys/sys/capability.h
  
  More time is still needed for ports to accommodate the migration to
  capsicum.h.
  
  The header was renamed in 2014 due to concerns about conflicts with with
  a draft POSIX.1e capability.h header on other systems and there is (now)
  no need for complex autoconf tests for both capability.h and capsicum.h.
  Any supported Capsicum-capable system has capsicum.h.
  
  Reported by:  antoine
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/sys/capability.h
 - copied unchanged from r340155, head/sys/sys/capability.h
Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Nov  5 22:26:57 2018(r340165)
+++ head/ObsoleteFiles.inc  Mon Nov  5 22:36:45 2018(r340166)
@@ -38,8 +38,6 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20181105: backwards-compatibility capability.h header removed
-OLD_FILES+=usr/include/sys/capability.h
 # 20181030: malloc_domain(9) KPI change
 OLD_FILES+=share/man/man9/malloc_domain.9.gz
 # 20181026: joy(4) removal

Copied: head/sys/sys/capability.h (from r340155, head/sys/sys/capability.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/capability.h   Mon Nov  5 22:36:45 2018(r340166, copy 
of r340155, head/sys/sys/capability.h)
@@ -0,0 +1,46 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2014 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Historically, the key userspace and kernel Capsicum definitions were found
+ * in this file.  However, it conflicted with POSIX.1e's capability.h, so has
+ * been renamed capsicum.h.  The file remains for backwards compatibility
+ * reasons as a nested include.
+ */
+#ifndef _SYS_CAPABILITY_H_
+#define_SYS_CAPABILITY_H_
+
+#warning this file includes  which is deprecated
+#include 
+
+#endif /* !_SYS_CAPABILITY_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340156 - in head: . sys/sys

2018-11-05 Thread Antoine Brodin
On Mon, Nov 5, 2018 at 8:26 PM Ed Maste  wrote:
>
> Author: emaste
> Date: Mon Nov  5 19:25:57 2018
> New Revision: 340156
> URL: https://svnweb.freebsd.org/changeset/base/340156
>
> Log:
>   Remove backwards-compatibility sys/capability.h
>
>   In r263232 sys/capability.h was renamed to sys/capsicum.h, to avoid
>   conflicts with a capability.h header found on other operating systems.
>
>   Sufficient time has now passed, so remove the old header at the
>   beginning of FreeBSD 13.
>
>   Discussed with:   oshogbo
>   Sponsored by: The FreeBSD Foundation
>
> Deleted:
>   head/sys/sys/capability.h
> Modified:
>   head/ObsoleteFiles.inc

Hi,

Please revert,  after this change, most ports converted to capsicum
are no longer sandboxed (including pkg, tcpdump).

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


svn commit: r340164 - in head/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include sparc64/include

2018-11-05 Thread John Baldwin
Author: jhb
Date: Mon Nov  5 21:34:17 2018
New Revision: 340164
URL: https://svnweb.freebsd.org/changeset/base/340164

Log:
  Add a KPI for the delay while spinning on a spin lock.
  
  Replace a call to DELAY(1) with a new cpu_lock_delay() KPI.  Currently
  cpu_lock_delay() is defined to DELAY(1) on all platforms.  However,
  platforms with a DELAY() implementation that uses spin locks should
  implement a custom cpu_lock_delay() doesn't use locks.
  
  Reviewed by:  kib
  MFC after:3 days

Modified:
  head/sys/amd64/include/cpu.h
  head/sys/arm/include/cpu.h
  head/sys/arm64/include/cpu.h
  head/sys/i386/include/cpu.h
  head/sys/kern/kern_mutex.c
  head/sys/mips/include/cpu.h
  head/sys/powerpc/include/cpu.h
  head/sys/riscv/include/cpu.h
  head/sys/sparc64/include/cpu.h

Modified: head/sys/amd64/include/cpu.h
==
--- head/sys/amd64/include/cpu.hMon Nov  5 21:32:41 2018
(r340163)
+++ head/sys/amd64/include/cpu.hMon Nov  5 21:34:17 2018
(r340164)
@@ -50,6 +50,7 @@
 #definecpu_getstack(td)((td)->td_frame->tf_rsp)
 #definecpu_setstack(td, ap)((td)->td_frame->tf_rsp = (ap))
 #definecpu_spinwait()  ia32_pause()
+#definecpu_lock_delay()DELAY(1)
 
 #defineTRAPF_USERMODE(framep) \
(ISPL((framep)->tf_cs) == SEL_UPL)

Modified: head/sys/arm/include/cpu.h
==
--- head/sys/arm/include/cpu.h  Mon Nov  5 21:32:41 2018(r340163)
+++ head/sys/arm/include/cpu.h  Mon Nov  5 21:34:17 2018(r340164)
@@ -61,6 +61,7 @@ get_cyclecount(void)
 #define cpu_getstack(td)   ((td)->td_frame->tf_usr_sp)
 #define cpu_setstack(td, sp)   ((td)->td_frame->tf_usr_sp = (sp))
 #define cpu_spinwait() /* nothing */
+#definecpu_lock_delay()DELAY(1)
 
 #define ARM_NVEC   8
 #define ARM_VEC_ALL0x

Modified: head/sys/arm64/include/cpu.h
==
--- head/sys/arm64/include/cpu.hMon Nov  5 21:32:41 2018
(r340163)
+++ head/sys/arm64/include/cpu.hMon Nov  5 21:34:17 2018
(r340164)
@@ -51,6 +51,7 @@
 #definecpu_getstack(td)((td)->td_frame->tf_sp)
 #definecpu_setstack(td, sp)((td)->td_frame->tf_sp = (sp))
 #definecpu_spinwait()  __asm __volatile("yield" ::: "memory")
+#definecpu_lock_delay()DELAY(1)
 
 /* Extract CPU affinity levels 0-3 */
 #defineCPU_AFF0(mpidr) (u_int)(((mpidr) >> 0) & 0xff)

Modified: head/sys/i386/include/cpu.h
==
--- head/sys/i386/include/cpu.h Mon Nov  5 21:32:41 2018(r340163)
+++ head/sys/i386/include/cpu.h Mon Nov  5 21:34:17 2018(r340164)
@@ -50,6 +50,7 @@
 #definecpu_getstack(td)((td)->td_frame->tf_esp)
 #definecpu_setstack(td, ap)((td)->td_frame->tf_esp = (ap))
 #definecpu_spinwait()  ia32_pause()
+#definecpu_lock_delay()DELAY(1)
 
 #defineTRAPF_USERMODE(framep) \
((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM))

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Mon Nov  5 21:32:41 2018(r340163)
+++ head/sys/kern/kern_mutex.c  Mon Nov  5 21:34:17 2018(r340164)
@@ -1206,7 +1206,7 @@ _mtx_lock_indefinite_check(struct mtx *m, struct lock_
 
ldap->spin_cnt++;
if (ldap->spin_cnt < 6000 || kdb_active || panicstr != NULL)
-   DELAY(1);
+   cpu_lock_delay();
else {
td = mtx_owner(m);
 

Modified: head/sys/mips/include/cpu.h
==
--- head/sys/mips/include/cpu.h Mon Nov  5 21:32:41 2018(r340163)
+++ head/sys/mips/include/cpu.h Mon Nov  5 21:34:17 2018(r340164)
@@ -71,6 +71,7 @@
 #definecpu_getstack(td)((td)->td_frame->sp)
 #definecpu_setstack(td, nsp)   ((td)->td_frame->sp = (nsp))
 #definecpu_spinwait()  /* nothing */
+#definecpu_lock_delay()DELAY(1)
 
 /*
  * A machine-independent interface to the CPU's counter.

Modified: head/sys/powerpc/include/cpu.h
==
--- head/sys/powerpc/include/cpu.h  Mon Nov  5 21:32:41 2018
(r340163)
+++ head/sys/powerpc/include/cpu.h  Mon Nov  5 21:34:17 2018
(r340164)
@@ -128,6 +128,7 @@ get_cyclecount(void)
 
 #definecpu_getstack(td)((td)->td_frame->fixreg[1])
 #definecpu_spinwait()  __asm __volatile("or 

svn commit: r340162 - head/tools/build

2018-11-05 Thread Alex Richardson
Author: arichardson
Date: Mon Nov  5 21:30:00 2018
New Revision: 340162
URL: https://svnweb.freebsd.org/changeset/base/340162

Log:
  Fix -DNO_CLEAN build after r340157
  
  Approved By:  jhb (mentor)

Modified:
  head/tools/build/Makefile

Modified: head/tools/build/Makefile
==
--- head/tools/build/Makefile   Mon Nov  5 21:28:32 2018(r340161)
+++ head/tools/build/Makefile   Mon Nov  5 21:30:00 2018(r340162)
@@ -114,9 +114,17 @@ installdirs:
 # bootstrap-tools phase. We could also overrride BINDIR when building bootstrap
 # tools but adding the symlinks is easier and means all tools are also
 # in the directory that they are installed to normally.
-   ln -sf bin ${DESTDIR}/sbin
-   ln -sf ../bin ${DESTDIR}/usr/bin
-   ln -sf ../bin ${DESTDIR}/usr/sbin
+
+.for _dir in sbin usr/sbin usr/bin
+# delete existing directories from before r340157
+   @if [ ! -L ${DESTDIR}/${_dir} ]; then \
+   echo "removing old non-symlink ${DESTDIR}/${_dir}"; \
+   rm -rf "${DESTDIR}/${_dir}"; \
+   fi
+.endfor
+   ln -sfn bin ${DESTDIR}/sbin
+   ln -sfn ../bin ${DESTDIR}/usr/bin
+   ln -sfn ../bin ${DESTDIR}/usr/sbin
 .for _group in ${INCSGROUPS:NINCS}
mkdir -p "${DESTDIR}/${${_group}DIR}"
 .endfor
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340160 - head/lib/libcasper/libcasper

2018-11-05 Thread Mark Johnston
Author: markj
Date: Mon Nov  5 21:01:45 2018
New Revision: 340160
URL: https://svnweb.freebsd.org/changeset/base/340160

Log:
  Document the fact that cap_limit_set() always frees the input nvlist.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libcasper/libcasper/libcasper.3

Modified: head/lib/libcasper/libcasper/libcasper.3
==
--- head/lib/libcasper/libcasper/libcasper.3Mon Nov  5 20:00:36 2018
(r340159)
+++ head/lib/libcasper/libcasper/libcasper.3Mon Nov  5 21:01:45 2018
(r340160)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 6, 2018
+.Dd November 5, 2018
 .Dt LIBCASPER 3
 .Os
 .Sh NAME
@@ -161,9 +161,11 @@ it means there are no limits set.
 The
 .Fn cap_limit_set
 function sets limits for the given capability.
-The limits are provided as
+The limits are provided as a
 .Xr nvlist 9 .
 The exact format depends on the service the capability represents.
+.Fn cap_limit_set
+frees the limits regardless of whether the operation succeeds or fails.
 .Pp
 The
 .Fn cap_send_nvlist
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340159 - head/sys/riscv/riscv

2018-11-05 Thread John Baldwin
Author: jhb
Date: Mon Nov  5 20:00:36 2018
New Revision: 340159
URL: https://svnweb.freebsd.org/changeset/base/340159

Log:
  Rework setting PTE_D for kernel mappings.
  
  Rather than unconditionally setting PTE_D for all writeable kernel
  mappings, set PTE_D for writable mappings of unmanaged pages (whether
  user or kernel).  This matches what amd64 does and also matches what
  the RISC-V spec suggests (preset the A and D bits on mappings where
  the OS doesn't care about the state).
  
  Suggested by: alc
  Reviewed by:  alc, markj
  Sponsored by: DARPA

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

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Mon Nov  5 19:51:16 2018(r340158)
+++ head/sys/riscv/riscv/pmap.c Mon Nov  5 20:00:36 2018(r340159)
@@ -2098,13 +2098,20 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
new_l3 |= PTE_W;
if ((va >> 63) == 0)
new_l3 |= PTE_U;
-   else if (prot & VM_PROT_WRITE)
-   new_l3 |= PTE_D;
 
new_l3 |= (pn << PTE_PPN0_S);
if ((flags & PMAP_ENTER_WIRED) != 0)
new_l3 |= PTE_SW_WIRED;
-   if ((m->oflags & VPO_UNMANAGED) == 0)
+
+   /*
+* Set modified bit gratuitously for writeable mappings if
+* the page is unmanaged. We do not want to take a fault
+* to do the dirty bit accounting for these mappings.
+*/
+   if ((m->oflags & VPO_UNMANAGED) != 0) {
+   if (prot & VM_PROT_WRITE)
+   new_l3 |= PTE_D;
+   } else
new_l3 |= PTE_SW_MANAGED;
 
CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340158 - head

2018-11-05 Thread Alex Richardson
Author: arichardson
Date: Mon Nov  5 19:51:16 2018
New Revision: 340158
URL: https://svnweb.freebsd.org/changeset/base/340158

Log:
  Build the elftoolchain libraries as part of bootstrap-tools
  
  It is not necessary to build libelf and libdwarf this early. Furthermore,
  when building on Linux/MacOS, m4 will only be built during the bootstrap
  tools phase and not be available in $PATH before.
  
  Reviewed By:  emaste
  Approved By:  brooks (mentor)
  Differential Revision: https://reviews.freebsd.org/D17800

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Nov  5 19:51:10 2018(r340157)
+++ head/Makefile.inc1  Mon Nov  5 19:51:16 2018(r340158)
@@ -1967,15 +1967,6 @@ update: .PHONY
 # build-tools or cross-tools.
 #
 
-# ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
-# r296685 fix cross-endian objcopy
-# r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2.
-# r334881 added libdwarf constants used by ctfconvert.
-# r338478 fixed a crash in objcopy for mips64el objects
-# r339083 libelf: correct mips64el test to use ELF header
-.if ${BOOTSTRAPPING} < 1200085
-_elftoolchain_libs= lib/libelf lib/libdwarf
-.endif
 
 # libnv and libl are both requirements for config(8), which is an unconditional
 # bootstrap-tool.
@@ -1987,7 +1978,7 @@ legacy: .PHONY
false
 .endif
 
-.for _tool in tools/build ${_elftoolchain_libs} ${_config_deps}
+.for _tool in tools/build ${_config_deps}
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \
cd ${.CURDIR}/${_tool}; \
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
@@ -2001,7 +1992,8 @@ legacy: .PHONY
 # bootstrap-tools: Build tools needed for compatibility. These are binaries 
that
 # are built to build other binaries in the system. However, the focus of these
 # binaries is usually quite narrow. Bootstrap tools use the host's compiler and
-# libraries, augmented by -legacy.
+# libraries, augmented by -legacy, in addition to the libraries built during
+# bootstrap-tools.
 #
 _bt=   _bootstrap-tools
 
@@ -2052,11 +2044,24 @@ _lex=   usr.bin/lex
 # Note: lex needs m4 to build but m4 also depends on lex. However, lex can be
 # bootstrapped so we build lex first.
 ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-${_lex}
-_bt_lex_depend=${_bt}-usr.bin/lex ${_bt}-usr.bin/m4
+_bt_m4_depend=${_bt}-${_m4}
+_bt_lex_depend=${_bt}-${_lex} ${_bt_m4_depend}
 .else
 _bootstrap_tools_links+=m4 lex
 .endif
 
+# ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
+# r296685 fix cross-endian objcopy
+# r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2.
+# r334881 added libdwarf constants used by ctfconvert.
+# r338478 fixed a crash in objcopy for mips64el objects
+# r339083 libelf: correct mips64el test to use ELF header
+.if ${BOOTSTRAPPING} < 1200085
+_elftoolchain_libs= lib/libelf lib/libdwarf
+${_bt}-lib/libelf: ${_bt_m4_depend}
+${_bt}-lib/libdwarf: ${_bt_m4_depend}
+.endif
+
 # r245440 mtree -N support added
 # r313404 requires sha384.h for libnetbsd, added to libmd in r292782
 .if ${BOOTSTRAPPING} < 1100093
@@ -2264,6 +2269,7 @@ bootstrap-tools: ${_bt}-links .PHONY
 ${_dtc} \
 ${_cat} \
 ${_kbdcontrol} \
+${_elftoolchain_libs} \
 usr.bin/lorder \
 lib/libopenbsd \
 usr.bin/mandoc \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340157 - in head: . tools/build tools/tools/nanobsd/embedded

2018-11-05 Thread Alex Richardson
Author: arichardson
Date: Mon Nov  5 19:51:10 2018
New Revision: 340157
URL: https://svnweb.freebsd.org/changeset/base/340157

Log:
  Allow building world without inheriting $PATH
  
  Inheriting $PATH during the build phase can cause the build to fail when
  compiling on a different system due to missing build tools or incompatible
  versions somewhere in $PATH. This has cause build failures for us before
  due to the jenkins slaves still running FreeBSD 10.
  Listing the tools we depend on explicitly instead of just using whatever
  happens to be in $PATH allows us to check that we don't accidentally add a
  new build dependency.
  
  All tools that do no need to be bootstrapped will now be symlinked to
  ${WORLDTMP}/legacy/bin and during the build phase $PATH will only contain
  ${WORLDTMP}. There is also a new variable "BOOTSTRAP_ALL_TOOLS" which can
  be set to force compiling almost all bootstrap tools instead of symlinking
  them. This will not bootstrap tools such as cp,mv, etc. since they may be
  used during the build and for those we should really only be using POSIX
  compatible options.
  
  Furthermore, this change is required in order to be able to build on
  non-FreeBSD hosts. While the same binaries may exist on Linux/MacOS they
  often accept different flags or produce incompatible output.
  
  Approved By:  brooks (mentor)
  Differential Revision: https://reviews.freebsd.org/D16815

Modified:
  head/Makefile
  head/Makefile.inc1
  head/tools/build/Makefile
  head/tools/tools/nanobsd/embedded/common

Modified: head/Makefile
==
--- head/Makefile   Mon Nov  5 19:25:57 2018(r340156)
+++ head/Makefile   Mon Nov  5 19:51:10 2018(r340157)
@@ -610,10 +610,13 @@ _need_lld_${target}_${target_arch} != \
 # XXX: Passing HOST_OBJTOP into the PATH would allow skipping legacy,
 #  bootstrap-tools, and cross-tools.  Need to ensure each tool actually
 #  supports all TARGETS though.
+# For now we only pass UNIVERSE_TOOLCHAIN_PATH which will be added at the end
+# of STRICTTMPPATH to ensure that the target-specific binaries come first.
 MAKE_PARAMS_${target}+= \
XCC="${HOST_OBJTOP}/tmp/usr/bin/cc" \
XCXX="${HOST_OBJTOP}/tmp/usr/bin/c++" \
-   XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp"
+   XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp" \
+   UNIVERSE_TOOLCHAIN_PATH=${HOST_OBJTOP}/tmp/usr/bin
 .endif
 .if defined(_need_lld_${target}_${target_arch}) && \
 ${_need_lld_${target}_${target_arch}} == "yes"

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Nov  5 19:25:57 2018(r340156)
+++ head/Makefile.inc1  Mon Nov  5 19:51:10 2018(r340157)
@@ -580,8 +580,21 @@ BUILD_ARCH!=   uname -p
 WORLDTMP?= ${OBJTOP}/tmp
 BPATH= 
${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
-STRICTTMPPATH= ${BPATH}:${XPATH}
+
+# When building we want to find the cross tools before the host tools in 
${BPATH}.
+# We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared
+# toolchain files (clang, lld, etc.) during make universe/tinderbox
+STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH}
+# We should not be using tools from /usr/bin accidentally since this could 
cause
+# the build to break on other systems that don't have that tool. For now we
+# still allow using the old behaviour (inheriting $PATH) if
+# BUILD_WITH_STRICT_TMPPATH is set to 0 but this will eventually be removed.
+BUILD_WITH_STRICT_TMPPATH?=1
+.if ${BUILD_WITH_STRICT_TMPPATH} != 0
+TMPPATH=   ${STRICTTMPPATH}
+.else
 TMPPATH=   ${STRICTTMPPATH}:${PATH}
+.endif
 
 #
 # Avoid running mktemp(1) unless actually needed.
@@ -589,8 +602,16 @@ TMPPATH=   ${STRICTTMPPATH}:${PATH}
 # when in the middle of installing over this system.
 #
 .if make(distributeworld) || make(installworld) || make(stageworld)
-INSTALLTMP!=   mktemp -d -u -t install
+.if ${BUILD_WITH_STRICT_TMPPATH} != 0
+MKTEMP=${WORLDTMP}/legacy/usr/bin/mktemp
+.if !exists(${MKTEMP})
+.error "mktemp binary doesn't exist in expected location: ${MKTEMP}"
 .endif
+.else
+MKTEMP=mktemp
+.endif
+INSTALLTMP!=   ${MKTEMP} -d -u -t install
+.endif
 
 .if make(stagekernel) || make(distributekernel)
 TAGS+= kernel
@@ -647,6 +668,8 @@ CROSSENV+=  BUILD_TOOLS_META=.NOMETA
 CROSSENV+= ${TARGET_CFLAGS}
 .endif
 
+BOOTSTRAPPING_OSRELDATE?=${OSRELDATE}
+
 # bootstrap-tools stage
 BMAKEENV=  INSTALL="sh ${.CURDIR}/tools/install.sh" \
TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \
@@ -658,7 +681,7 @@ BSARGS= DESTDIR= \
OBJTOP='${WORLDTMP}/obj-tools' \
OBJROOT='$${OBJTOP}/' \
MAKEOBJDIRPREFIX= \
-   BOOTSTRAPPING=${OSRELDATE} \
+   

svn commit: r340156 - in head: . sys/sys

2018-11-05 Thread Ed Maste
Author: emaste
Date: Mon Nov  5 19:25:57 2018
New Revision: 340156
URL: https://svnweb.freebsd.org/changeset/base/340156

Log:
  Remove backwards-compatibility sys/capability.h
  
  In r263232 sys/capability.h was renamed to sys/capsicum.h, to avoid
  conflicts with a capability.h header found on other operating systems.
  
  Sufficient time has now passed, so remove the old header at the
  beginning of FreeBSD 13.
  
  Discussed with:   oshogbo
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/sys/sys/capability.h
Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Nov  5 18:47:29 2018(r340155)
+++ head/ObsoleteFiles.inc  Mon Nov  5 19:25:57 2018(r340156)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20181105: backwards-compatibility capability.h header removed
+OLD_FILES+=usr/include/sys/capability.h
 # 20181030: malloc_domain(9) KPI change
 OLD_FILES+=share/man/man9/malloc_domain.9.gz
 # 20181026: joy(4) removal
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340152 - head/stand/lua

2018-11-05 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Nov 5, 2018 at 11:47 AM Kyle Evans  wrote:
> 
> > On Mon, Nov 5, 2018 at 12:44 PM Rodney W. Grimes
> >  wrote:
> > >
> > > > Author: kevans
> > > > Date: Mon Nov  5 16:20:07 2018
> > > > New Revision: 340152
> > > > URL: https://svnweb.freebsd.org/changeset/base/340152
> > > >
> > > > Log:
> > > >   lualoader: Add chainload menu entry
> > > >
> > > >   MFC after:  4 days
> > >
> > > Please do this a bit sooner so that it makes the next
> > > build on stable/12 which starts in ~72 hours.  So maybe
> > > MFC: 2 days?
> > >
> >
> > Will do, since it's a fairly trivial change... I'll plan to put in a
> > request for this and the boot-conf addition Wednesday night or
> > Thursday morning (in GMT-6, for reference).
> >
> 
> Hmmm, I just committed something that should definitely be in the next
> build... didn't know we were doing builds early this week... I had a 3 day
> MFC on it...

Another data point is you may notice gjb commits marked:
MFC after:  3 days
MFC after:  Before 12.0BETA3

That does inform RE@ that you want this in the next build...
though I do not think there is any prompting system that makes
sure this happens, it does make it clear the intent.
We may wish to add some automagic that we can do a search
for these to see if there are any pending.

Thoughs?
-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340152 - head/stand/lua

2018-11-05 Thread Rodney W. Grimes
> On Mon, Nov 5, 2018 at 12:44 PM Rodney W. Grimes
>  wrote:
> >
> > > Author: kevans
> > > Date: Mon Nov  5 16:20:07 2018
> > > New Revision: 340152
> > > URL: https://svnweb.freebsd.org/changeset/base/340152
> > >
> > > Log:
> > >   lualoader: Add chainload menu entry
> > >
> > >   MFC after:  4 days
> >
> > Please do this a bit sooner so that it makes the next
> > build on stable/12 which starts in ~72 hours.  So maybe
> > MFC: 2 days?
> >
> 
> Will do, since it's a fairly trivial change... I'll plan to put in a
> request for this and the boot-conf addition Wednesday night or
> Thursday morning (in GMT-6, for reference).

Ok, sounds good.  Thanks, again.
-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340152 - head/stand/lua

2018-11-05 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Nov 5, 2018 at 11:47 AM Kyle Evans  wrote:
> 
> > On Mon, Nov 5, 2018 at 12:44 PM Rodney W. Grimes
> >  wrote:
> > >
> > > > Author: kevans
> > > > Date: Mon Nov  5 16:20:07 2018
> > > > New Revision: 340152
> > > > URL: https://svnweb.freebsd.org/changeset/base/340152
> > > >
> > > > Log:
> > > >   lualoader: Add chainload menu entry
> > > >
> > > >   MFC after:  4 days
> > >
> > > Please do this a bit sooner so that it makes the next
> > > build on stable/12 which starts in ~72 hours.  So maybe
> > > MFC: 2 days?
> > >
> >
> > Will do, since it's a fairly trivial change... I'll plan to put in a
> > request for this and the boot-conf addition Wednesday night or
> > Thursday morning (in GMT-6, for reference).
> >
> 
> Hmmm, I just committed something that should definitely be in the next
> build... didn't know we were doing builds early this week... I had a 3 day
> MFC on it...

We are not doing them early.  Today is Monday, builds start on thursday,
a 3 day mfc today is thursday.   Kyle had marked this 4 days, that would
of certainly missed the build.  Your 3 day may or may not depending on
when you commit on thursday.

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


Re: svn commit: r340152 - head/stand/lua

2018-11-05 Thread Warner Losh
On Mon, Nov 5, 2018 at 11:47 AM Kyle Evans  wrote:

> On Mon, Nov 5, 2018 at 12:44 PM Rodney W. Grimes
>  wrote:
> >
> > > Author: kevans
> > > Date: Mon Nov  5 16:20:07 2018
> > > New Revision: 340152
> > > URL: https://svnweb.freebsd.org/changeset/base/340152
> > >
> > > Log:
> > >   lualoader: Add chainload menu entry
> > >
> > >   MFC after:  4 days
> >
> > Please do this a bit sooner so that it makes the next
> > build on stable/12 which starts in ~72 hours.  So maybe
> > MFC: 2 days?
> >
>
> Will do, since it's a fairly trivial change... I'll plan to put in a
> request for this and the boot-conf addition Wednesday night or
> Thursday morning (in GMT-6, for reference).
>

Hmmm, I just committed something that should definitely be in the next
build... didn't know we were doing builds early this week... I had a 3 day
MFC on it...

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


svn commit: r340155 - head/sys/cam/scsi

2018-11-05 Thread Warner Losh
Author: imp
Date: Mon Nov  5 18:47:29 2018
New Revision: 340155
URL: https://svnweb.freebsd.org/changeset/base/340155

Log:
  Only assert locked for many async events.
  
  Many async events that we see are called for this specific path. When
  calling an async callback for a targetted device, XTP will lock that
  specific device's path lock (same as what cam_periph_lock does). For
  those AC_ events, assert we have the lock rather than trying to
  recusrively take it (which causes panics since it's not recursive).
  
  Add annotations about this and about the fact that AC_SCSI_AEN events
  are generated now only in the ata stack (which cannot have a scsi_da
  attachment). Leave it in place in case I've overlooked something as
  the code is harmless.
  
  This is fallout from my attempts to "fix" locking for softc->flags in
  r330796 that's not been triggered often enough to get my attention
  until now.
  
  Sponsored by: Netflix
  MFC After: 3 days
  Differential Revision: https://reviews.freebsd.org/D17837

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Mon Nov  5 18:12:41 2018(r340154)
+++ head/sys/cam/scsi/scsi_da.c Mon Nov  5 18:47:29 2018(r340155)
@@ -2005,7 +2005,7 @@ daasync(void *callback_arg, u_int32_t code,
 
periph = (struct cam_periph *)callback_arg;
switch (code) {
-   case AC_FOUND_DEVICE:
+   case AC_FOUND_DEVICE:   /* callback to create periph, no locking yet */
{
struct ccb_getdev *cgd;
cam_status status;
@@ -2041,7 +2041,7 @@ daasync(void *callback_arg, u_int32_t code,
"due to status 0x%x\n", status);
return;
}
-   case AC_ADVINFO_CHANGED:
+   case AC_ADVINFO_CHANGED:/* Doesn't touch periph */
{
uintptr_t buftype;
 
@@ -2064,8 +2064,10 @@ daasync(void *callback_arg, u_int32_t code,
ccb = (union ccb *)arg;
 
/*
-* Handle all UNIT ATTENTIONs except our own,
-* as they will be handled by daerror().
+* Handle all UNIT ATTENTIONs except our own, as they will be
+* handled by daerror(). Since this comes from a different 
periph,
+* that periph's lock is held, not ours, so we have to take it 
ours
+* out to touch softc flags.
 */
if (xpt_path_periph(ccb->ccb_h.path) != periph &&
scsi_extract_sense_ccb(ccb,
@@ -2093,9 +2095,13 @@ daasync(void *callback_arg, u_int32_t code,
}
break;
}
-   case AC_SCSI_AEN:
+   case AC_SCSI_AEN:   /* Called for this path: periph locked 
*/
+   /*
+* Appears to be currently unused for SCSI devices, only ata 
SIMs
+* generate this.
+*/
+   cam_periph_assert(periph, MA_OWNED);
softc = (struct da_softc *)periph->softc;
-   cam_periph_lock(periph);
if (!cam_iosched_has_work_flags(softc->cam_iosched, 
DA_WORK_TUR) &&
(softc->flags & DA_FLAG_TUR_PENDING) == 0) {
if (da_periph_acquire(periph, DA_REF_TUR) == 0) {
@@ -2103,31 +2109,28 @@ daasync(void *callback_arg, u_int32_t code,
daschedule(periph);
}
}
-   cam_periph_unlock(periph);
/* FALLTHROUGH */
-   case AC_SENT_BDR:
-   case AC_BUS_RESET:
+   case AC_SENT_BDR:   /* Called for this path: periph locked 
*/
+   case AC_BUS_RESET:  /* Called for this path: periph locked 
*/
{
struct ccb_hdr *ccbh;
 
+   cam_periph_assert(periph, MA_OWNED);
softc = (struct da_softc *)periph->softc;
/*
 * Don't fail on the expected unit attention
 * that will occur.
 */
-   cam_periph_lock(periph);
softc->flags |= DA_FLAG_RETRY_UA;
LIST_FOREACH(ccbh, >pending_ccbs, periph_links.le)
ccbh->ccb_state |= DA_CCB_RETRY_UA;
-   cam_periph_unlock(periph);
break;
}
-   case AC_INQ_CHANGED:
-   cam_periph_lock(periph);
+   case AC_INQ_CHANGED:/* Called for this path: periph locked 
*/
+   cam_periph_assert(periph, MA_OWNED);
softc = (struct da_softc *)periph->softc;
softc->flags &= ~DA_FLAG_PROBED;
dareprobe(periph);
-   cam_periph_unlock(periph);
break;
default:
break;
___
svn-src-head@freebsd.org 

Re: svn commit: r340152 - head/stand/lua

2018-11-05 Thread Kyle Evans
On Mon, Nov 5, 2018 at 12:44 PM Rodney W. Grimes
 wrote:
>
> > Author: kevans
> > Date: Mon Nov  5 16:20:07 2018
> > New Revision: 340152
> > URL: https://svnweb.freebsd.org/changeset/base/340152
> >
> > Log:
> >   lualoader: Add chainload menu entry
> >
> >   MFC after:  4 days
>
> Please do this a bit sooner so that it makes the next
> build on stable/12 which starts in ~72 hours.  So maybe
> MFC: 2 days?
>

Will do, since it's a fairly trivial change... I'll plan to put in a
request for this and the boot-conf addition Wednesday night or
Thursday morning (in GMT-6, for reference).

Thanks,

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


Re: svn commit: r340152 - head/stand/lua

2018-11-05 Thread Rodney W. Grimes
> Author: kevans
> Date: Mon Nov  5 16:20:07 2018
> New Revision: 340152
> URL: https://svnweb.freebsd.org/changeset/base/340152
> 
> Log:
>   lualoader: Add chainload menu entry
>   
>   MFC after:  4 days

Please do this a bit sooner so that it makes the next
build on stable/12 which starts in ~72 hours.  So maybe
MFC: 2 days?


Thanks,
Rod  Modified:
>   head/stand/lua/menu.lua
> 
> Modified: head/stand/lua/menu.lua
> ==
> --- head/stand/lua/menu.lua   Mon Nov  5 15:30:13 2018(r340151)
> +++ head/stand/lua/menu.lua   Mon Nov  5 16:20:07 2018(r340152)
> @@ -337,6 +337,22 @@ menu.welcome = {
>   submenu = menu.boot_environments,
>   alias = {"e", "E"},
>   },
> + -- chainload
> + {
> + entry_type = core.MENU_ENTRY,
> + name = function()
> + return 'Chain' .. color.highlight("L") ..
> + "oad " .. loader.getenv('chain_disk')
> + end,
> + func = function()
> + loader.perform("chain " ..
> + loader.getenv('chain_disk'))
> + end,
> + visible = function()
> + return loader.getenv('chain_disk') ~= nil
> + end,
> + alias = {"l", "L"},
> + },
>   },
>  }
>  
> 
> 

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


Re: svn commit: r339338 - in head/sys: amd64/conf conf dev/ixl modules modules/iavf modules/ixl modules/ixlv net

2018-11-05 Thread Eric Joyner
I think this should be fixed as of several days ago.

- Eric

On Wed, Oct 24, 2018, 7:10 AM Bjoern A. Zeeb  On 12 Oct 2018, at 22:40, Eric Joyner wrote:
>
> > Author: erj
> > Date: Fri Oct 12 22:40:54 2018
> > New Revision: 339338
> > URL: https://svnweb.freebsd.org/changeset/base/339338
> >
> > Log:
> >   ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9)
> >
> >   Finishes the conversion of the 40Gb Intel Ethernet drivers to
> > iflib(9) for
> >   FreeBSD 12.0, and fixes numerous bugs in both ixl(4) and iavf(4).
> >
> >   This commit also re-adds the VF driver to GENERIC since it now
> > compiles and
> >   functions.
> >
> >   The VF driver name was changed from ixlv(4) to iavf(4) because the
> > VF driver is
> >   now intended to be used with future products, not just with
> > Fortville/Fort Park
> >   VFs.
> >
> >   A man page update that documents these drivers is forthcoming in a
> > separate
> >   commit.
> >
> >   Reviewed by:sbruno@, kbowling@
> >   Tested by:  jeffrey.e.pie...@intel.com
>
>
> Trying to compile a kernel with RSS enabled (as universe does):
>
>   10 --
>   11 >>> stage 3.1: building everything
>   12 --
>   13 /tank/users/bz/head.svn/sys/dev/ixl/if_iavf.c:1952:26: error:
> no member named 'num_queues' in 'struct ixl_vsi'
>   14 que_id = que_id % vsi->num_queues;
>   15   ~~~  ^
>   16 1 error generated.
>   17 --- if_iavf.o ---
>   18 *** [if_iavf.o] Error code 1
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340152 - head/stand/lua

2018-11-05 Thread Kyle Evans
Author: kevans
Date: Mon Nov  5 16:20:07 2018
New Revision: 340152
URL: https://svnweb.freebsd.org/changeset/base/340152

Log:
  lualoader: Add chainload menu entry
  
  MFC after:4 days

Modified:
  head/stand/lua/menu.lua

Modified: head/stand/lua/menu.lua
==
--- head/stand/lua/menu.lua Mon Nov  5 15:30:13 2018(r340151)
+++ head/stand/lua/menu.lua Mon Nov  5 16:20:07 2018(r340152)
@@ -337,6 +337,22 @@ menu.welcome = {
submenu = menu.boot_environments,
alias = {"e", "E"},
},
+   -- chainload
+   {
+   entry_type = core.MENU_ENTRY,
+   name = function()
+   return 'Chain' .. color.highlight("L") ..
+   "oad " .. loader.getenv('chain_disk')
+   end,
+   func = function()
+   loader.perform("chain " ..
+   loader.getenv('chain_disk'))
+   end,
+   visible = function()
+   return loader.getenv('chain_disk') ~= nil
+   end,
+   alias = {"l", "L"},
+   },
},
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-11-05 Thread Ed Maste
Author: emaste
Date: Mon Nov  5 15:30:13 2018
New Revision: 340151
URL: https://svnweb.freebsd.org/changeset/base/340151

Log:
  Regen src.conf.5 after r340150

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Mon Nov  5 15:22:41 2018
(r340150)
+++ head/share/man/man5/src.conf.5  Mon Nov  5 15:30:13 2018
(r340151)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd November 3, 2018
+.Dd November 5, 2018
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1014,7 +1014,8 @@ enabled unless an alternate linker is provided via XLD
 This is a default setting on
 arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, 
mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, 
powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and 
sparc64/sparc64.
 .It Va WITH_LLD_BOOTSTRAP
-Set to build the LLD linker during the bootstrap phase of the build.
+Set to build the LLD linker during the bootstrap phase of the build,
+and use it during buildworld and buildkernel.
 .Pp
 This is a default setting on
 amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340150 - head/tools/build/options

2018-11-05 Thread Ed Maste
Author: emaste
Date: Mon Nov  5 15:22:41 2018
New Revision: 340150
URL: https://svnweb.freebsd.org/changeset/base/340150

Log:
  Expand WITH_LLD_BOOTSTRAP description
  
  Reported by:  bz

Modified:
  head/tools/build/options/WITH_LLD_BOOTSTRAP

Modified: head/tools/build/options/WITH_LLD_BOOTSTRAP
==
--- head/tools/build/options/WITH_LLD_BOOTSTRAP Mon Nov  5 08:11:16 2018
(r340149)
+++ head/tools/build/options/WITH_LLD_BOOTSTRAP Mon Nov  5 15:22:41 2018
(r340150)
@@ -1,2 +1,3 @@
 .\" $FreeBSD$
-Set to build the LLD linker during the bootstrap phase of the build.
+Set to build the LLD linker during the bootstrap phase of the build,
+and use it during buildworld and buildkernel.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-05 Thread Baptiste Daroussin
On Mon, Nov 05, 2018 at 11:47:44AM +0300, Yuri Pankov wrote:
> Baptiste Daroussin wrote:
> > On Sun, Nov 04, 2018 at 10:13:22PM +, Yuri Pankov wrote:
> >> Author: yuripv
> >> Date: Sun Nov  4 22:13:22 2018
> >> New Revision: 340144
> >> URL: https://svnweb.freebsd.org/changeset/base/340144
> >>
> >> Log:
> >>   Add hybrid C.UTF-8 locale being identical to default C locale except
> >>   that it uses the same ctype maps and functions as other UTF-8 locales.
> >>   
> >>   Reviewed by: bapt, cem, eadler
> >>   Approved by: kib (mentor, implicit)
> >>   Differential Revision:   https://reviews.freebsd.org/D17833
> >>
> > Excellent, do you plan to MFC that so freebsd 12.1 and freebsd 11.3 can 
> > benefit
> > it?
> 
> Yes, will do along with CLDR 34 data (MFC period specified as 1 month
> there).
> 

Wonderful thanks!

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-05 Thread Yuri Pankov
Baptiste Daroussin wrote:
> On Sun, Nov 04, 2018 at 10:13:22PM +, Yuri Pankov wrote:
>> Author: yuripv
>> Date: Sun Nov  4 22:13:22 2018
>> New Revision: 340144
>> URL: https://svnweb.freebsd.org/changeset/base/340144
>>
>> Log:
>>   Add hybrid C.UTF-8 locale being identical to default C locale except
>>   that it uses the same ctype maps and functions as other UTF-8 locales.
>>   
>>   Reviewed by:   bapt, cem, eadler
>>   Approved by:   kib (mentor, implicit)
>>   Differential Revision: https://reviews.freebsd.org/D17833
>>
> Excellent, do you plan to MFC that so freebsd 12.1 and freebsd 11.3 can 
> benefit
> it?

Yes, will do along with CLDR 34 data (MFC period specified as 1 month
there).



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-05 Thread Baptiste Daroussin
On Sun, Nov 04, 2018 at 10:13:22PM +, Yuri Pankov wrote:
> Author: yuripv
> Date: Sun Nov  4 22:13:22 2018
> New Revision: 340144
> URL: https://svnweb.freebsd.org/changeset/base/340144
> 
> Log:
>   Add hybrid C.UTF-8 locale being identical to default C locale except
>   that it uses the same ctype maps and functions as other UTF-8 locales.
>   
>   Reviewed by:bapt, cem, eadler
>   Approved by:kib (mentor, implicit)
>   Differential Revision:  https://reviews.freebsd.org/D17833
> 
Excellent, do you plan to MFC that so freebsd 12.1 and freebsd 11.3 can benefit
it?

Best regards,
Bapt


signature.asc
Description: PGP signature


svn commit: r340149 - head/sys/dev/hwpmc

2018-11-05 Thread Matt Macy
Author: mmacy
Date: Mon Nov  5 08:11:16 2018
New Revision: 340149
URL: https://svnweb.freebsd.org/changeset/base/340149

Log:
  hwpmc: limit wait for user callchain collection to 1 tick
  
  The hwpmc pcpu sample buffer is prone to head of line blocking
  when waiting for user process to return to user space and
  collect a pending callchain. If more than one tick has elapsed
  between the time the sample entry was marked for collection and
  the time that the hardclock pmc handler runs to copy the records
  to a larger temporary buffer, mark the sample entry as not in
  use.
  
  This changes reduces the number of samples marked as not valid
  when collecting under load from ~99.5% to 5-20%.
  
  Reported by:  mjg@
  MFC after:3 days

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Mon Nov  5 06:59:41 2018
(r340148)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Mon Nov  5 08:11:16 2018
(r340149)
@@ -4949,8 +4949,11 @@ pmc_process_samples(int cpu, ring_type_t ring)
 
/* If there is a pending AST wait for completion */
if (ps->ps_nsamples == PMC_USER_CALLCHAIN_PENDING) {
-   /* if sample is more than 65 ms old, drop it */
-   if (ticks - ps->ps_ticks > (hz >> 4)) {
+   /* if we've been waiting more than 1 tick to 
+* collect a callchain for this record then
+* drop it and move on.
+*/
+   if (ticks - ps->ps_ticks > 1) {
/*
 * track how often we hit this as it will
 * preferentially lose user samples
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"