svn commit: r358156 - head/sys/dev/ath

2020-02-19 Thread Adrian Chadd
Author: adrian
Date: Thu Feb 20 07:12:43 2020
New Revision: 358156
URL: https://svnweb.freebsd.org/changeset/base/358156

Log:
  [ath] Attempt to fix epoch handling.
  
  The epoch stuff with taskqueues works fine if the driver never calls
  the receive path in other contexts, but this driver does.  If there was
  a chip reset during active receive then part of the reset will call
  the receive path to flush out any active packets before reinitialising
  the receive queue and that needs to be done with the epoch held.
  
  So:
  
  * make the receive task a normal task again
  * explicitly call epoch enter/exit around the legacy and newer DMA
receive paths
  * add a couple of epoch asserts to ensure that the receive packet
path itself is called with epoch held.
  
  This fixes it on my Atom eeepc laptop (circa 2010!) that I did
  all of my initial 802.11n work in this driver and net80211.
  
  Tested:
  
  * AR9285, STA mode
  
  TODO:
  
  * Test on EDMA chipset (AR9380)
  * Test in AP/adhoc modes, just to be sure (eg for beacon
receive processing in particular.)

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_ath_rx_edma.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Thu Feb 20 06:45:51 2020(r358155)
+++ head/sys/dev/ath/if_ath.c   Thu Feb 20 07:12:43 2020(r358156)
@@ -760,7 +760,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
taskqueue_start_threads(>sc_tq, 1, PI_NET, "%s taskq",
device_get_nameunit(sc->sc_dev));
 
-   NET_TASK_INIT(>sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc);
+   TASK_INIT(>sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc);
TASK_INIT(>sc_bmisstask, 0, ath_bmiss_proc, sc);
TASK_INIT(>sc_bstucktask,0, ath_bstuck_proc, sc);
TASK_INIT(>sc_resettask,0, ath_reset_proc, sc);

Modified: head/sys/dev/ath/if_ath_rx.c
==
--- head/sys/dev/ath/if_ath_rx.cThu Feb 20 06:45:51 2020
(r358155)
+++ head/sys/dev/ath/if_ath_rx.cThu Feb 20 07:12:43 2020
(r358156)
@@ -656,6 +656,8 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status 
int is_good = 0;
struct ath_rx_edma *re = >sc_rxedma[qtype];
 
+   NET_EPOCH_ASSERT();
+
/*
 * Calculate the correct 64 bit TSF given
 * the TSF64 register value and rs_tstamp.
@@ -1074,6 +1076,8 @@ ath_rx_proc(struct ath_softc *sc, int resched)
int kickpcu = 0;
int ret;
 
+   NET_EPOCH_ASSERT();
+
/* XXX we must not hold the ATH_LOCK here */
ATH_UNLOCK_ASSERT(sc);
ATH_PCU_UNLOCK_ASSERT(sc);
@@ -1293,6 +1297,7 @@ static void
 ath_legacy_rx_tasklet(void *arg, int npending)
 {
struct ath_softc *sc = arg;
+   struct epoch_tracker et;
 
ATH_KTR(sc, ATH_KTR_RXPROC, 1, "ath_rx_proc: pending=%d", npending);
DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending);
@@ -1305,14 +1310,18 @@ ath_legacy_rx_tasklet(void *arg, int npending)
}
ATH_PCU_UNLOCK(sc);
 
+   NET_EPOCH_ENTER(et);
ath_rx_proc(sc, 1);
+   NET_EPOCH_EXIT(et);
 }
 
 static void
 ath_legacy_flushrecv(struct ath_softc *sc)
 {
-
+   struct epoch_tracker et;
+   NET_EPOCH_ENTER(et);
ath_rx_proc(sc, 0);
+   NET_EPOCH_EXIT(et);
 }
 
 static void

Modified: head/sys/dev/ath/if_ath_rx_edma.c
==
--- head/sys/dev/ath/if_ath_rx_edma.c   Thu Feb 20 06:45:51 2020
(r358155)
+++ head/sys/dev/ath/if_ath_rx_edma.c   Thu Feb 20 07:12:43 2020
(r358156)
@@ -521,6 +521,7 @@ ath_edma_recv_proc_deferred_queue(struct ath_softc *sc
int16_t nf;
ath_bufhead rxlist;
struct mbuf *m;
+   struct epoch_tracker et;
 
TAILQ_INIT();
 
@@ -537,6 +538,8 @@ ath_edma_recv_proc_deferred_queue(struct ath_softc *sc
TAILQ_CONCAT(, >sc_rx_rxlist[qtype], bf_list);
ATH_RX_UNLOCK(sc);
 
+   NET_EPOCH_ENTER(et);
+
/* Handle the completed descriptors */
/*
 * XXX is this SAFE call needed? The ath_buf entries
@@ -560,6 +563,7 @@ ath_edma_recv_proc_deferred_queue(struct ath_softc *sc
if (ngood) {
sc->sc_lastrx = tsf;
}
+   NET_EPOCH_EXIT(et);
 
ATH_KTR(sc, ATH_KTR_INTERRUPTS, 1,
"ath edma rx deferred proc: ngood=%d\n",
___
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: r358155 - head/share/man/man4

2020-02-19 Thread Xin LI
Author: delphij
Date: Thu Feb 20 06:45:51 2020
New Revision: 358155
URL: https://svnweb.freebsd.org/changeset/base/358155

Log:
  Actually install hwpstate_intel.4.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Feb 20 06:03:41 2020
(r358154)
+++ head/share/man/man4/MakefileThu Feb 20 06:45:51 2020
(r358155)
@@ -192,6 +192,7 @@ MAN=aac.4 \
${_hv_vmbus.4} \
${_hv_vss.4} \
hwpmc.4 \
+   ${_hwpstate_intel.4} \
iavf.4 \
ichsmb.4 \
${_ichwd.4} \
@@ -787,6 +788,7 @@ _hv_storvsc.4=  hv_storvsc.4
 _hv_utils.4=   hv_utils.4
 _hv_vmbus.4=   hv_vmbus.4
 _hv_vss.4= hv_vss.4
+_hwpstate_intel.4= hwpstate_intel.4
 _i8254.4=  i8254.4
 _ichwd.4=  ichwd.4
 _if_bxe.4= if_bxe.4
___
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: r358153 - head/usr.sbin/services_mkdb

2020-02-19 Thread Xin Li via svn-src-head


On 2/19/20 10:01 PM, Yuri Pankov wrote:
> On 20 Feb 2020, at 06:54, Pedro F. Giffuni  wrote:
>>
>> Author: pfg
>> Date: Thu Feb 20 03:54:07 2020
>> New Revision: 358153
>> URL: https://svnweb.freebsd.org/changeset/base/358153
>>
>> Log:
>>  /etc/services: attempt bring the database to this century.
>>
>>  Document better this file, updating the URL to the IANA registry and closely
>>  match the official services.
>>
>>  For system ports (0 to 1023) we now try to follow the registry closely, 
>> noting
>>  some historical differences where applicable.
>>  For the User ports (1024 - 49151) we try to keep some sensible balance only
>>  of services that are likely to be found on FreeBSD/UNIX systems. This 
>> attempts
>>  to strike a balance between complexity and usefulness.
>>
>>  As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
>>  on Oct 2006[1]. While it is conceivable some people may still use it in some
>>  very old FreeBSD machines that can't be replaced easily, the use of it is
>>  considered a security risk. Also drop the unofficial netatalk, which we
>>  supported long ago in the kernel but was dropped long ago.
>>
>>  [1] https://web.mit.edu/kerberos/krb4-end-of-life.html
>>
>>  MFC after:  3 weeks (likely to 12-stable only)
>>  Differential Revision:  https://reviews.freebsd.org/D23621
>>
>> Modified:
>>  head/usr.sbin/services_mkdb/services
> 
> I noticed `mergemaster` failing, and it seems to be not happy with this 
> change:
> 
> # make installconfig
> installing DIRS CONFSDIR
> install  -d -m 0755 -o root  -g wheel  /etc
> install  -C -o root  -g wheel -m 644  
> /usr/src/usr.sbin/services_mkdb/services /etc/services
> services_mkdb -l -q -o /var/db/services.db  /etc/services
> services_mkdb: Ran out of protocols adding `divert'; recompile with larger 
> PROTOMAX
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/src/usr.sbin/services_mkdb

Fixed in r358154.  Please merge the revision with r358153 when MFC'ing.



signature.asc
Description: OpenPGP digital signature


svn commit: r358154 - head/usr.sbin/services_mkdb

2020-02-19 Thread Xin LI
Author: delphij
Date: Thu Feb 20 06:03:41 2020
New Revision: 358154
URL: https://svnweb.freebsd.org/changeset/base/358154

Log:
  Bump PROTOMAX.
  
  MFC after:3 weeks
  X-MFC-with:   r358153

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

Modified: head/usr.sbin/services_mkdb/services_mkdb.c
==
--- head/usr.sbin/services_mkdb/services_mkdb.c Thu Feb 20 03:54:07 2020
(r358153)
+++ head/usr.sbin/services_mkdb/services_mkdb.c Thu Feb 20 06:03:41 2020
(r358154)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
 static char tname[MAXPATHLEN];
 
 #definePMASK   0x
-#define PROTOMAX   5
+#define PROTOMAX   6
 
 static voidadd(DB *, StringList *, size_t, const char *, size_t *, int);
 static StringList ***parseservices(const char *, StringList *);
___
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: r358153 - head/usr.sbin/services_mkdb

2020-02-19 Thread Yuri Pankov
On 20 Feb 2020, at 06:54, Pedro F. Giffuni  wrote:
> 
> Author: pfg
> Date: Thu Feb 20 03:54:07 2020
> New Revision: 358153
> URL: https://svnweb.freebsd.org/changeset/base/358153
> 
> Log:
>  /etc/services: attempt bring the database to this century.
> 
>  Document better this file, updating the URL to the IANA registry and closely
>  match the official services.
> 
>  For system ports (0 to 1023) we now try to follow the registry closely, 
> noting
>  some historical differences where applicable.
>  For the User ports (1024 - 49151) we try to keep some sensible balance only
>  of services that are likely to be found on FreeBSD/UNIX systems. This 
> attempts
>  to strike a balance between complexity and usefulness.
> 
>  As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
>  on Oct 2006[1]. While it is conceivable some people may still use it in some
>  very old FreeBSD machines that can't be replaced easily, the use of it is
>  considered a security risk. Also drop the unofficial netatalk, which we
>  supported long ago in the kernel but was dropped long ago.
> 
>  [1] https://web.mit.edu/kerberos/krb4-end-of-life.html
> 
>  MFC after:   3 weeks (likely to 12-stable only)
>  Differential Revision:   https://reviews.freebsd.org/D23621
> 
> Modified:
>  head/usr.sbin/services_mkdb/services

I noticed `mergemaster` failing, and it seems to be not happy with this change:

# make installconfig
installing DIRS CONFSDIR
install  -d -m 0755 -o root  -g wheel  /etc
install  -C -o root  -g wheel -m 644  /usr/src/usr.sbin/services_mkdb/services 
/etc/services
services_mkdb -l -q -o /var/db/services.db  /etc/services
services_mkdb: Ran out of protocols adding `divert'; recompile with larger 
PROTOMAX
*** Error code 1

Stop.
make: stopped in /usr/src/usr.sbin/services_mkdb
___
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: r358153 - head/usr.sbin/services_mkdb

2020-02-19 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 20 03:54:07 2020
New Revision: 358153
URL: https://svnweb.freebsd.org/changeset/base/358153

Log:
  /etc/services: attempt bring the database to this century.
  
  Document better this file, updating the URL to the IANA registry and closely
  match the official services.
  
  For system ports (0 to 1023) we now try to follow the registry closely, noting
  some historical differences where applicable.
  For the User ports (1024 - 49151) we try to keep some sensible balance only
  of services that are likely to be found on FreeBSD/UNIX systems. This attempts
  to strike a balance between complexity and usefulness.
  
  As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
  on Oct 2006[1]. While it is conceivable some people may still use it in some
  very old FreeBSD machines that can't be replaced easily, the use of it is
  considered a security risk. Also drop the unofficial netatalk, which we
  supported long ago in the kernel but was dropped long ago.
  
  [1] https://web.mit.edu/kerberos/krb4-end-of-life.html
  
  MFC after:3 weeks (likely to 12-stable only)
  Differential Revision:https://reviews.freebsd.org/D23621

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesThu Feb 20 03:01:27 2020
(r358152)
+++ head/usr.sbin/services_mkdb/servicesThu Feb 20 03:54:07 2020
(r358153)
@@ -1,65 +1,62 @@
 #
 # Network services, Internet style
 #
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, most entries here have two entries
-# even if the protocol doesn't support UDP operations.
+# Service names and port numbers are used to distinguish between different
+# services that run over transport protocols such as TCP, UDP, DCCP, and
+# SCTP.
 #
 # The latest IANA port assignments can be gotten from
 #
-#  http://www.iana.org/assignments/port-numbers
+#  https://www.iana.org/assignments/service-names-port-numbers/
 #
-# The Well Known Ports are those from 0 through 1023.
-# The Registered Ports are those from 1024 through 49151
-# The Dynamic and/or Private Ports are those from 49152 through 65535
+# System Ports are those from 0 through 1023.
+# User Ports are those from 1024 through 49151.
+# Dynamic and/or Private Ports are those from 49152 through 65535.
 #
-# Kerberos services are for Kerberos v4, and are unofficial.  Sites running
-# v5 should uncomment v5 entries and comment v4 entries.
+# Note that it is presently the policy of IANA to assign a single well-known
+# port number for both TCP and UDP; hence, most entries here have two entries
+# even if the protocol doesn't support UDP operations.
 #
 # $FreeBSD$
 #  From: @(#)services  5.8 (Berkeley) 5/9/91
 #
 # WELL KNOWN PORT NUMBERS
 #
-rtmp 1/ddp#Routing Table Maintenance Protocol
 tcpmux   1/tcp#TCP Port Service Multiplexer
 tcpmux   1/udp#TCP Port Service Multiplexer
-nbp  2/ddp#Name Binding Protocol
 compressnet  2/tcp#Management Utility
 compressnet  2/udp#Management Utility
 compressnet  3/tcp#Compression Process
 compressnet  3/udp#Compression Process
-echo 4/ddp#AppleTalk Echo Protocol
 rje  5/tcp#Remote Job Entry
 rje  5/udp#Remote Job Entry
-zip  6/ddp#Zone Information Protocol
-echo 7/sctp
 echo 7/tcp
 echo 7/udp
-discard  9/sctp   sink null
+echo 7/sctp
 discard  9/tcpsink null
 discard  9/udpsink null
+discard  9/sctp   sink null
 systat  11/tcpusers#Active Users
 systat  11/udpusers#Active Users
-daytime 13/sctp
 daytime 13/tcp
 daytime 13/udp
+daytime 13/sctp
 qotd17/tcpquote#Quote of the Day
 qotd17/udpquote#Quote of the Day
 msp 18/tcp#Message Send Protocol
 msp 18/udp#Message Send Protocol
-chargen 19/sctp   ttytst source#Character Generator
 chargen 19/tcpttytst source#Character Generator
 chargen 19/udpttytst source#Character Generator
-ftp-data20/sctp   #File Transfer [Default Data]
+chargen 19/sctp   ttytst source#Character Generator
 ftp-data20/tcp#File Transfer [Default Data]
 ftp-data20/udp#File Transfer [Default Data]
-ftp 21/sctp   #File Transfer [Control]
+ftp-data20/sctp   #File Transfer [Default Data]
 ftp 21/tcp#File Transfer [Control]
 ftp 21/udp#File 

svn commit: r358152 - head/bin/sh

2020-02-19 Thread Hiroki Sato
Author: hrs
Date: Thu Feb 20 03:01:27 2020
New Revision: 358152
URL: https://svnweb.freebsd.org/changeset/base/358152

Log:
  Improve performance of "read" built-in command when using a seekable
  fd.
  
  The read built-in command calls read(2) with a 1-byte buffer because
  newline characters need to be detected even on a byte stream which
  comes from a non-seekable file descriptor.  Because of this, the
  following script calls >6,000 read(2) to show a 6KiB file:
  
   while read IN; do echo "$IN"; done < /COPYRIGHT
  
  When the input byte stream is seekable, it is possible to read a data
  block and then reposition the file pointer to where a newline
  character found.  This change adds a small buffer to do this and
  reduces the number of read(2) calls.
  
  Theoretically, multiple built-in commands reading the same seekable
  byte stream in a single pipe chain can share the buffer.  However,
  this change just makes a single invocation of the read built-in
  allocate a buffer and deallocate it every time for simplicity.
  Although this causes read(2) to read the same regions multiple times,
  the performance penalty should be small compared to the reduction of
  read(2) calls.
  
  Reviewed by:  jilles
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23747

Modified:
  head/bin/sh/miscbltin.c

Modified: head/bin/sh/miscbltin.c
==
--- head/bin/sh/miscbltin.c Thu Feb 20 01:45:55 2020(r358151)
+++ head/bin/sh/miscbltin.c Thu Feb 20 03:01:27 2020(r358152)
@@ -66,10 +66,79 @@ __FBSDID("$FreeBSD$");
 
 #undef eflag
 
+#defineREAD_BUFLEN 1024
+struct fdctx {
+   int fd;
+   size_t  off;/* offset in buf */
+   size_t  buflen;
+   char*ep;/* tail pointer */
+   charbuf[READ_BUFLEN];
+};
+
+static void fdctx_init(int, struct fdctx *);
+static void fdctx_destroy(struct fdctx *);
+static ssize_t fdgetc(struct fdctx *, char *);
 int readcmd(int, char **);
 int umaskcmd(int, char **);
 int ulimitcmd(int, char **);
 
+static void
+fdctx_init(int fd, struct fdctx *fdc)
+{
+   off_t cur;
+
+   /* Check if fd is seekable. */
+   cur = lseek(fd, 0, SEEK_CUR);
+   *fdc = (struct fdctx){
+   .fd = fd,
+   .buflen = (cur != -1) ? READ_BUFLEN : 1,
+   .ep = >buf[0], /* No data */
+   };
+}
+
+static ssize_t
+fdgetc(struct fdctx *fdc, char *c)
+{
+   ssize_t nread;
+
+   if (>buf[fdc->off] == fdc->ep) {
+   nread = read(fdc->fd, fdc->buf, fdc->buflen);
+   if (nread > 0) {
+   fdc->off = 0;
+   fdc->ep = fdc->buf + nread;
+   } else
+   return (nread);
+   }
+   *c = fdc->buf[fdc->off++];
+
+   return (1);
+}
+
+static void
+fdctx_destroy(struct fdctx *fdc)
+{
+   size_t residue;
+
+   if (fdc->buflen > 1) {
+   /*
+* Reposition the file offset.  Here is the layout of buf:
+*
+* | off
+* v 
+* |*|---|
+* buf   ep   buf+buflen
+* |<- residue ->|
+*
+* off: current character
+* ep:  offset just after read(2)
+* residue: length for reposition
+*/
+   residue = (fdc->ep - fdc->buf) - fdc->off;
+   if (residue > 0)
+   (void) lseek(fdc->fd, -residue, SEEK_CUR);
+   }
+}
+
 /*
  * The read builtin.  The -r option causes backslashes to be treated like
  * ordinary characters.
@@ -108,6 +177,7 @@ readcmd(int argc __unused, char **argv __unused)
fd_set ifds;
ssize_t nread;
int sig;
+   struct fdctx fdctx;
 
rflag = 0;
prompt = NULL;
@@ -173,8 +243,9 @@ readcmd(int argc __unused, char **argv __unused)
backslash = 0;
STARTSTACKSTR(p);
lastnonifs = lastnonifsws = -1;
+   fdctx_init(STDIN_FILENO, );
for (;;) {
-   nread = read(STDIN_FILENO, , 1);
+   nread = fdgetc(, );
if (nread == -1) {
if (errno == EINTR) {
sig = pendingsig;
@@ -260,6 +331,7 @@ readcmd(int argc __unused, char **argv __unused)
STARTSTACKSTR(p);
lastnonifs = lastnonifsws = -1;
}
+   fdctx_destroy();
STACKSTRNUL(p);
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r358143 - head/sys/vm

2020-02-19 Thread Warner Losh
Author: imp
Date: Thu Feb 20 01:33:01 2020
New Revision: 358143
URL: https://svnweb.freebsd.org/changeset/base/358143

Log:
  Don't convert all lower-layer errors to EIO.
  
  Don't convert all lower layer errors to EIO. Instead, pass the actual error up
  the stack. This will allow the upper layers that look for ENXIO to react
  properly to that signal from the lower layers and, for UFS, unmount the
  filesystem.
  
  Reviewed by: kib@
  Differential Revision:  https://reviews.freebsd.org/D23755

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Thu Feb 20 01:27:35 2020(r358142)
+++ head/sys/vm/vnode_pager.c   Thu Feb 20 01:33:01 2020(r358143)
@@ -628,8 +628,11 @@ vnode_pager_input_smlfs(vm_object_t object, vm_page_t 
 
bwait(bp, PVM, "vnsrd");
 
-   if ((bp->b_ioflags & BIO_ERROR) != 0)
-   error = EIO;
+   if ((bp->b_ioflags & BIO_ERROR) != 0) {
+   KASSERT(bp->b_error != 0,
+   ("%s: buf error but b_error == 0\n", 
__func__));
+   error = bp->b_error;
+   }
 
/*
 * free the buffer header back to the swap buffer pool
@@ -1113,7 +1116,9 @@ vnode_pager_generic_getpages_done(struct buf *bp)
off_t tfoff, nextoff;
int i, error;
 
-   error = (bp->b_ioflags & BIO_ERROR) != 0 ? EIO : 0;
+   KASSERT((bp->b_ioflags & BIO_ERROR) == 0 || bp->b_error != 0,
+   ("%s: buf error but b_error == 0\n", __func__));
+   error = (bp->b_ioflags & BIO_ERROR) != 0 ? bp->b_error : 0;
object = bp->b_vp->v_object;
 
if (error == 0 && bp->b_bcount != bp->b_npages * PAGE_SIZE) {
___
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: r358135 - in head/stand: efi/loader i386/libi386 i386/loader libsa

2020-02-19 Thread Warner Losh
Author: imp
Date: Thu Feb 20 00:46:16 2020
New Revision: 358135
URL: https://svnweb.freebsd.org/changeset/base/358135

Log:
  Create ptov() function.
  
  Create a ptov() function. It's basically the same as the btx PTOV
  macro, but works everywhere. smbios needs this to translate addresses,
  but the translation differs between BIOS booting and EFI booting. Make
  it a function so one smbios.o can be used everywhere. Provide
  definitions for it in the two loaders affected.
  
  Differential Revision: https://reviews.freebsd.org/D23660

Modified:
  head/stand/efi/loader/main.c
  head/stand/i386/libi386/smbios.c
  head/stand/i386/loader/main.c
  head/stand/libsa/stand.h

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cThu Feb 20 00:34:46 2020
(r358134)
+++ head/stand/efi/loader/main.cThu Feb 20 00:46:16 2020
(r358135)
@@ -852,7 +852,11 @@ read_loader_env(const char *name, char *def_fn, bool o
}
 }
 
-
+caddr_t
+ptov(uintptr_t x)
+{
+   return ((caddr_t)x);
+}
 
 EFI_STATUS
 main(int argc, CHAR16 *argv[])

Modified: head/stand/i386/libi386/smbios.c
==
--- head/stand/i386/libi386/smbios.cThu Feb 20 00:34:46 2020
(r358134)
+++ head/stand/i386/libi386/smbios.cThu Feb 20 00:46:16 2020
(r358135)
@@ -28,16 +28,9 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 
-#ifdef EFI
-/* In EFI, we don't need PTOV(). */
-#define PTOV(x)(caddr_t)(x)
-#else
-#include "btxv86.h"
-#endif
-#include "smbios.h"
+#define PTOV(x)ptov(x)
 
 /*
  * Detect SMBIOS and export information about the SMBIOS into the

Modified: head/stand/i386/loader/main.c
==
--- head/stand/i386/loader/main.c   Thu Feb 20 00:34:46 2020
(r358134)
+++ head/stand/i386/loader/main.c   Thu Feb 20 00:46:16 2020
(r358135)
@@ -86,6 +86,12 @@ extern char end[];
 static void *heap_top;
 static void *heap_bottom;
 
+caddr_t
+ptov(uintptr_t x)
+{
+   return (PTOV(x));
+}
+
 int
 main(void)
 {

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hThu Feb 20 00:34:46 2020(r358134)
+++ head/stand/libsa/stand.hThu Feb 20 00:46:16 2020(r358135)
@@ -452,4 +452,9 @@ const char *x86_hypervisor(void);
 #define reallocf(x, y) Reallocf(x, y, NULL, 0)
 #endif
 
+/*
+ * va <-> pa routines. MD code must supply.
+ */
+caddr_t ptov(uintptr_t);
+
 #endif /* STAND_H */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r358136 - in head/stand: efi/loader i386/libi386 i386/loader libsa

2020-02-19 Thread Warner Losh
Author: imp
Date: Thu Feb 20 00:46:22 2020
New Revision: 358136
URL: https://svnweb.freebsd.org/changeset/base/358136

Log:
  Move smbios.c to libsa.
  
  smbios used to be an i386 only kinda weird quirk to the x86
  architecture. But UEFI picked it up, dusted it off and now it's many
  other locations. Make it base technology by moving it to libsa and
  fixing up the compliation. The code has issues with unaligned access
  still, but that will be addressed in a followup commit.
  
  Differential Revision: https://reviews.freebsd.org/D23660

Added:
  head/stand/libsa/smbios.c   (contents, props changed)
 - copied, changed from r358135, head/stand/i386/libi386/smbios.c
  head/stand/libsa/smbios.h   (contents, props changed)
 - copied, changed from r358135, head/stand/i386/libi386/smbios.h
Deleted:
  head/stand/i386/libi386/smbios.c
  head/stand/i386/libi386/smbios.h
Modified:
  head/stand/efi/loader/Makefile
  head/stand/i386/libi386/Makefile
  head/stand/i386/loader/main.c
  head/stand/libsa/Makefile

Modified: head/stand/efi/loader/Makefile
==
--- head/stand/efi/loader/Makefile  Thu Feb 20 00:46:16 2020
(r358135)
+++ head/stand/efi/loader/Makefile  Thu Feb 20 00:46:22 2020
(r358136)
@@ -22,7 +22,6 @@ SRCS= autoload.c \
framebuffer.c \
main.c \
self_reloc.c \
-   smbios.c \
vers.c
 
 CFLAGS+=   -I${.CURDIR}/../loader
@@ -45,8 +44,6 @@ CWARNFLAGS.main.c+=   -Wno-format
 
 .PATH: ${.CURDIR}/../loader
 .PATH: ${.CURDIR}/../loader/arch/${MACHINE}
-# For smbios.c XXX need to abstract properly
-.PATH: ${BOOTSRC}/i386/libi386
 .include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc"
 
 CFLAGS+=   -I${.CURDIR}
@@ -56,18 +53,6 @@ CFLAGS+= -I${EFISRC}/include/${MACHINE}
 CFLAGS+=   -I${SYSDIR}/contrib/dev/acpica/include
 CFLAGS+=   -I${BOOTSRC}/i386/libi386
 CFLAGS+=   -DEFI
-
-.if !defined(BOOT_HIDE_SERIAL_NUMBERS)
-# Export serial numbers, UUID, and asset tag from loader.
-CFLAGS+= -DSMBIOS_SERIAL_NUMBERS
-.if defined(BOOT_LITTLE_ENDIAN_UUID)
-# Use little-endian UUID format as defined in SMBIOS 2.6.
-CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID
-.elif defined(BOOT_NETWORK_ENDIAN_UUID)
-# Use network-endian UUID format for backward compatibility.
-CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
-.endif
-.endif
 
 .if defined(HAVE_FDT) && ${MK_FDT} != "no"
 .include   "${BOOTSRC}/fdt.mk"

Modified: head/stand/i386/libi386/Makefile
==
--- head/stand/i386/libi386/MakefileThu Feb 20 00:46:16 2020
(r358135)
+++ head/stand/i386/libi386/MakefileThu Feb 20 00:46:22 2020
(r358136)
@@ -9,7 +9,7 @@ SRCS=   bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c 
comconsole.c devicename.c elf32_freebsd.c \
elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \
i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.S \
-   smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c
+   time.c vidconsole.c amd64_tramp.S spinconsole.c
 .PATH: ${ZFSSRC}
 SRCS+=  devicename_stubs.c
 CFLAGS+= -I${ZFSSRC}
@@ -26,18 +26,6 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
 .ifdef(BOOT_BIOSDISK_DEBUG)
 # Make the disk code more talkative
 CFLAGS+= -DDISK_DEBUG
-.endif
-
-.if !defined(BOOT_HIDE_SERIAL_NUMBERS)
-# Export serial numbers, UUID, and asset tag from loader.
-CFLAGS+= -DSMBIOS_SERIAL_NUMBERS
-.if defined(BOOT_LITTLE_ENDIAN_UUID)
-# Use little-endian UUID format as defined in SMBIOS 2.6.
-CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID
-.elif defined(BOOT_NETWORK_ENDIAN_UUID)
-# Use network-endian UUID format for backward compatibility.
-CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
-.endif
 .endif
 
 # terminal emulation

Modified: head/stand/i386/loader/main.c
==
--- head/stand/i386/loader/main.c   Thu Feb 20 00:46:16 2020
(r358135)
+++ head/stand/i386/loader/main.c   Thu Feb 20 00:46:22 2020
(r358136)
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
 #include "bootstrap.h"
 #include "common/bootargs.h"
 #include "libi386/libi386.h"
-#include "libi386/smbios.h"
+#include 
 #include "btxv86.h"
 
 #ifdef LOADER_ZFS_SUPPORT

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Thu Feb 20 00:46:16 2020(r358135)
+++ head/stand/libsa/Makefile   Thu Feb 20 00:46:22 2020(r358136)
@@ -137,6 +137,20 @@ CLEANFILES+= ${SAFE_INCS} ${STAND_H_INC} ${OTHER_INC}
 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
fstat.c close.c lseek.c open.c read.c write.c readdir.c
 
+# SMBios routines
+SRCS+= smbios.c
+.if !defined(BOOT_HIDE_SERIAL_NUMBERS)
+# Export serial numbers, UUID, and asset tag from loader.
+CFLAGS.smbios.c+= -DSMBIOS_SERIAL_NUMBERS
+.if 

svn commit: r358134 - head/sys/vm

2020-02-19 Thread Warner Losh
Author: imp
Date: Thu Feb 20 00:34:46 2020
New Revision: 358134
URL: https://svnweb.freebsd.org/changeset/base/358134

Log:
  Don't spam the console with an additional, and useless, error message.
  
  There's no need to spam the console with this error message. If there's an I/O
  error, the disk/cam driver will report it at the lower levels. If that's an
  actual problem, the upper layers will report that.
  
  Reviewed by: kib@
  Differential Revision:  https://reviews.freebsd.org/D23756

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Wed Feb 19 22:34:22 2020(r358133)
+++ head/sys/vm/vnode_pager.c   Thu Feb 20 00:34:46 2020(r358134)
@@ -1169,8 +1169,6 @@ vnode_pager_generic_getpages_done(struct buf *bp)
vm_page_readahead_finish(mt);
}
VM_OBJECT_RUNLOCK(object);
-   if (error != 0)
-   printf("%s: I/O read error %d\n", __func__, error);
 
return (error);
 }
___
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: r358133 - head/sys/vm

2020-02-19 Thread Kyle Evans
On Wed, Feb 19, 2020 at 4:49 PM Joerg Sonnenberger  wrote:
>
> On Wed, Feb 19, 2020 at 10:34:23PM +, Jeff Roberson wrote:
> > Author: jeff
> > Date: Wed Feb 19 22:34:22 2020
> > New Revision: 358133
> > URL: https://svnweb.freebsd.org/changeset/base/358133
> >
> > Log:
> >   Silence a gcc warning about no return from a function that handles every
> >   possible enum in a switch statement.  I verified that this emits nothing
> >   as expected on clang.  radix relies on constant propagation to eliminate
> >   any branching from these access routines.
>
> __builtin_unreachable() ?
>

We seem to call that __unreachable() to address compilers where it may
not be defined, but it does seem to be the ideal way to handle it.
___
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: r358133 - head/sys/vm

2020-02-19 Thread Joerg Sonnenberger
On Wed, Feb 19, 2020 at 10:34:23PM +, Jeff Roberson wrote:
> Author: jeff
> Date: Wed Feb 19 22:34:22 2020
> New Revision: 358133
> URL: https://svnweb.freebsd.org/changeset/base/358133
> 
> Log:
>   Silence a gcc warning about no return from a function that handles every
>   possible enum in a switch statement.  I verified that this emits nothing
>   as expected on clang.  radix relies on constant propagation to eliminate
>   any branching from these access routines.

__builtin_unreachable() ?

Joerg
___
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: r358133 - head/sys/vm

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 22:34:22 2020
New Revision: 358133
URL: https://svnweb.freebsd.org/changeset/base/358133

Log:
  Silence a gcc warning about no return from a function that handles every
  possible enum in a switch statement.  I verified that this emits nothing
  as expected on clang.  radix relies on constant propagation to eliminate
  any branching from these access routines.
  
  Reported by:  lwhsu/tinderbox

Modified:
  head/sys/vm/vm_radix.c

Modified: head/sys/vm/vm_radix.c
==
--- head/sys/vm/vm_radix.c  Wed Feb 19 21:12:59 2020(r358132)
+++ head/sys/vm/vm_radix.c  Wed Feb 19 22:34:22 2020(r358133)
@@ -208,6 +208,8 @@ vm_radix_node_load(smrnode_t *p, enum vm_radix_access 
case SMR:
return (smr_entered_load(p, vm_radix_smr));
}
+   /* This is unreachable, silence gcc. */
+   panic("vm_radix_node_get: Unknown access type");
 }
 
 static __inline void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r358132 - in head: . share/mk

2020-02-19 Thread Dimitry Andric
Author: dim
Date: Wed Feb 19 21:12:59 2020
New Revision: 358132
URL: https://svnweb.freebsd.org/changeset/base/358132

Log:
  Take LINKER_FREEBSD_VERSION from numerical field after dash
  
  Summary:
  With COMPILER_FREEBSD_VERSION, we use a numeric value that we bump each
  time we make a change that requires re-bootstrapping, but with the
  linker variant, we instead take the entire part after "FreeBSD", as in
  this example version output:
  
  LLD 9.0.1 (FreeBSD c1a0a213378a458fbea1a5c77b315c7dce08fd05-136) 
(compatible with GNU linkers)
  
  E.g., LINKER_FREEBSD_VERSION is currently being set to
  "c1a0a213378a458fbea1a5c77b315c7dce08fd05-136".  This means that
  *any* new upstream lld version will cause re-bootstrapping.
  
  We should only look at the numerical field we append after a dash
  instead.  This review attempts to make it so.
  
  The only thing I am not happy about is the post-processing of awk output
  in Makefile.inc1.  I notice that our awk does not have gensub(), so it
  can't substitute a numbered sub-regex with \1, \2, etc.  Suggestions
  welcome. :)
  
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D23691

Modified:
  head/Makefile.inc1
  head/share/mk/bsd.linker.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Feb 19 21:03:06 2020(r358131)
+++ head/Makefile.inc1  Wed Feb 19 21:12:59 2020(r358132)
@@ -272,9 +272,10 @@ WANT_LINKER_TYPE=
 !make(test-system-compiler)
 .if ${WANT_LINKER_TYPE} == "lld"
 WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/VCSVersion.inc
-WANT_LINKER_FREEBSD_VERSION!= \
+_WANT_LINKER_FREEBSD_VERSION!= \
awk '$$2 == "LLD_REVISION" {gsub(/"/, "", $$3); print $$3}' \
${SRCDIR}/${WANT_LINKER_FREEBSD_VERSION_FILE} || echo unknown
+WANT_LINKER_FREEBSD_VERSION=${_WANT_LINKER_FREEBSD_VERSION:C/.*-(.*)/\1/}
 WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc
 WANT_LINKER_VERSION!= \
awk '$$2 == "LLD_VERSION" {split($$3, a, "."); print a[1] * 1 + 
a[2] * 100 + a[3]}' \

Modified: head/share/mk/bsd.linker.mk
==
--- head/share/mk/bsd.linker.mk Wed Feb 19 21:03:06 2020(r358131)
+++ head/share/mk/bsd.linker.mk Wed Feb 19 21:12:59 2020(r358132)
@@ -69,9 +69,11 @@ _v=  ${_ld_version:M[1-9]*.[0-9]*:[1]}
 .elif ${_ld_version:[1]} == "LLD"
 ${X_}LINKER_TYPE=  lld
 _v=${_ld_version:[2]}
-${X_}LINKER_FREEBSD_VERSION!= \
-   ${${ld}} --version | \
-   awk '$$3 ~ /FreeBSD/ {print substr($$4, 1, length($$4)-1)}'
+.if ${_ld_version:[3]} == "(FreeBSD"
+${X_}LINKER_FREEBSD_VERSION:=  ${_ld_version:[4]:C/.*-(.*)\)/\1/}
+.else
+${X_}LINKER_FREEBSD_VERSION=   0
+.endif
 .else
 .warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd
 ${X_}LINKER_TYPE=  bfd
___
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: r358130 - head/sys/vm

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 19:58:31 2020
New Revision: 358130
URL: https://svnweb.freebsd.org/changeset/base/358130

Log:
  Use SMR to provide a safe unlocked lookup for vm_radix.
  
  The tree is kept correct for readers with store barriers and careful
  ordering.  The existing object lock serializes writers.  Consumers
  will be introduced in later commits.
  
  Reviewed by:  markj, kib
  Differential Revision:https://reviews.freebsd.org/D23446

Modified:
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_radix.h

Modified: head/sys/vm/vm_radix.c
==
--- head/sys/vm/vm_radix.c  Wed Feb 19 19:51:09 2020(r358129)
+++ head/sys/vm/vm_radix.c  Wed Feb 19 19:58:31 2020(r358130)
@@ -58,11 +58,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -95,26 +98,47 @@ __FBSDID("$FreeBSD$");
 #defineVM_RADIX_UNITLEVEL(lev) 
\
((vm_pindex_t)1 << ((lev) * VM_RADIX_WIDTH))
 
+enum vm_radix_access { SMR, LOCKED, UNSERIALIZED };
+
+struct vm_radix_node;
+SMR_TYPE_DECLARE(smrnode_t, struct vm_radix_node *);
+
 struct vm_radix_node {
-   vm_pindex_t  rn_owner;  /* Owner of record. */
-   uint16_t rn_count;  /* Valid children. */
-   uint16_t rn_clev;   /* Current level. */
-   void*rn_child[VM_RADIX_COUNT];  /* Child nodes. */
+   vm_pindex_t rn_owner;   /* Owner of record. */
+   uint16_trn_count;   /* Valid children. */
+   uint8_t rn_clev;/* Current level. */
+   int8_t  rn_last;/* zero last ptr. */
+   smrnode_t   rn_child[VM_RADIX_COUNT];   /* Child nodes. */
 };
 
 static uma_zone_t vm_radix_node_zone;
+static smr_t vm_radix_smr;
 
+static void vm_radix_node_store(smrnode_t *p, struct vm_radix_node *v,
+enum vm_radix_access access);
+
 /*
  * Allocate a radix node.
  */
-static __inline struct vm_radix_node *
+static struct vm_radix_node *
 vm_radix_node_get(vm_pindex_t owner, uint16_t count, uint16_t clevel)
 {
struct vm_radix_node *rnode;
 
-   rnode = uma_zalloc(vm_radix_node_zone, M_NOWAIT);
+   rnode = uma_zalloc_smr(vm_radix_node_zone, M_NOWAIT);
if (rnode == NULL)
return (NULL);
+
+   /*
+* We want to clear the last child pointer after the final section
+* has exited so lookup can not return false negatives.  It is done
+* here because it will be cache-cold in the dtor callback.
+*/
+   if (rnode->rn_last != 0) {
+   vm_radix_node_store(>rn_child[rnode->rn_last - 1],
+   NULL, UNSERIALIZED);
+   rnode->rn_last = 0;
+   }
rnode->rn_owner = owner;
rnode->rn_count = count;
rnode->rn_clev = clevel;
@@ -125,10 +149,24 @@ vm_radix_node_get(vm_pindex_t owner, uint16_t count, u
  * Free radix node.
  */
 static __inline void
-vm_radix_node_put(struct vm_radix_node *rnode)
+vm_radix_node_put(struct vm_radix_node *rnode, int8_t last)
 {
+#ifdef INVARIANTS
+   int slot;
 
-   uma_zfree(vm_radix_node_zone, rnode);
+   KASSERT(rnode->rn_count == 0,
+   ("vm_radix_node_put: rnode %p has %d children", rnode,
+   rnode->rn_count));
+   for (slot = 0; slot < VM_RADIX_COUNT; slot++) {
+   if (slot == last)
+   continue;
+   KASSERT(smr_unserialized_load(>rn_child[slot], true) ==
+   NULL, ("vm_radix_node_put: rnode %p has a child", rnode));
+   }
+#endif
+   /* Off by one so a freshly zero'd node is not assigned to. */
+   rnode->rn_last = last + 1;
+   uma_zfree_smr(vm_radix_node_zone, rnode);
 }
 
 /*
@@ -156,23 +194,59 @@ vm_radix_trimkey(vm_pindex_t index, uint16_t level)
 }
 
 /*
+ * Fetch a node pointer from a slot in another node.
+ */
+static __inline struct vm_radix_node *
+vm_radix_node_load(smrnode_t *p, enum vm_radix_access access)
+{
+
+   switch (access) {
+   case UNSERIALIZED:
+   return (smr_unserialized_load(p, true));
+   case LOCKED:
+   return (smr_serialized_load(p, true));
+   case SMR:
+   return (smr_entered_load(p, vm_radix_smr));
+   }
+}
+
+static __inline void
+vm_radix_node_store(smrnode_t *p, struct vm_radix_node *v,
+enum vm_radix_access access)
+{
+
+
+   switch (access) {
+   case UNSERIALIZED:
+   smr_unserialized_store(p, v, true);
+   break;
+   case LOCKED:
+   smr_serialized_store(p, v, true);
+   break;
+   case SMR:
+   panic("vm_radix_node_store: Not supported in smr section.");
+   

svn commit: r358129 - head/sys/sys

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 19:51:09 2020
New Revision: 358129
URL: https://svnweb.freebsd.org/changeset/base/358129

Log:
  Since r357940 it is no longer possible to use a single type cast for all
  atomic_*_ptr functions.

Modified:
  head/sys/sys/smr.h

Modified: head/sys/sys/smr.h
==
--- head/sys/sys/smr.h  Wed Feb 19 18:48:46 2020(r358128)
+++ head/sys/sys/smr.h  Wed Feb 19 19:51:09 2020(r358129)
@@ -120,7 +120,7 @@ typedef struct {
\
  */
 #definesmr_serialized_load(p, ex) ({   
\
SMR_ASSERT(ex, "smr_serialized_load");  \
-   (__typeof((p)->__ptr))atomic_load_ptr((uintptr_t *)&(p)->__ptr);\
+   (__typeof((p)->__ptr))atomic_load_ptr(&(p)->__ptr); \
 })
 
 /*
@@ -155,7 +155,7 @@ typedef struct {
\
  */
 #definesmr_unserialized_load(p, ex) ({ 
\
SMR_ASSERT(ex, "smr_unserialized_load");\
-   (__typeof((p)->__ptr))atomic_load_ptr((uintptr_t *)&(p)->__ptr);\
+   (__typeof((p)->__ptr))atomic_load_ptr(&(p)->__ptr); \
 })
 
 /*
___
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: r358128 - in head: lib/libmemstat sys/vm

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 18:48:46 2020
New Revision: 358128
URL: https://svnweb.freebsd.org/changeset/base/358128

Log:
  Use per-domain locks for the bucket cache.
  
  This gives much better concurrency when there are a large number of
  cores per-domain and multiple domains.  Avoid taking the lock entirely
  if it will not be productive.  ROUNDROBIN domains will have mixed
  memory in each domain and will load balance to all domains.
  
  While here refactor the zone/domain separation and bucket limits to
  simplify callers.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D23673

Modified:
  head/lib/libmemstat/memstat_uma.c
  head/sys/vm/uma_core.c
  head/sys/vm/uma_int.h

Modified: head/lib/libmemstat/memstat_uma.c
==
--- head/lib/libmemstat/memstat_uma.c   Wed Feb 19 17:09:08 2020
(r358127)
+++ head/lib/libmemstat/memstat_uma.c   Wed Feb 19 18:48:46 2020
(r358128)
@@ -425,12 +425,13 @@ memstat_kvm_uma(struct memory_type_list *list, void *k
(unsigned long )uz.uz_frees);
mtp->mt_failures = kvm_counter_u64_fetch(kvm,
(unsigned long )uz.uz_fails);
+   mtp->mt_xdomain = kvm_counter_u64_fetch(kvm,
+   (unsigned long )uz.uz_xdomain);
mtp->mt_sleeps = uz.uz_sleeps;
/* See comment above in memstat_sysctl_uma(). */
if (mtp->mt_numallocs < mtp->mt_numfrees)
mtp->mt_numallocs = mtp->mt_numfrees;
 
-   mtp->mt_xdomain = uz.uz_xdomain;
if (kz.uk_flags & UMA_ZFLAG_INTERNAL)
goto skip_percpu;
for (i = 0; i < mp_maxid + 1; i++) {
@@ -454,8 +455,9 @@ skip_percpu:
mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size;
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
for (i = 0; i < ndomains; i++) {
-   ret = kread(kvm, _domain[i], ,
-  sizeof(uzd), 0);
+   ret = kread(kvm,
+   _cpu[mp_maxid + 1] + i * sizeof(uzd),
+   , sizeof(uzd), 0);
if (ret != 0)
continue;
for (ubp =

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Wed Feb 19 17:09:08 2020(r358127)
+++ head/sys/vm/uma_core.c  Wed Feb 19 18:48:46 2020(r358128)
@@ -285,6 +285,8 @@ static void zone_dtor(void *, int, void *);
 static inline void item_dtor(uma_zone_t zone, void *item, int size,
 void *udata, enum zfreeskip skip);
 static int zero_init(void *, int, int);
+static void zone_free_bucket(uma_zone_t zone, uma_bucket_t bucket, void *udata,
+int itemdomain, bool ws);
 static void zone_foreach(void (*zfunc)(uma_zone_t, void *), void *);
 static void zone_foreach_unlocked(void (*zfunc)(uma_zone_t, void *), void *);
 static void zone_timeout(uma_zone_t zone, void *);
@@ -518,6 +520,9 @@ bucket_free(uma_zone_t zone, uma_bucket_t bucket, void
 {
struct uma_bucket_zone *ubz;
 
+   if (bucket->ub_cnt != 0)
+   bucket_drain(zone, bucket);
+
KASSERT(bucket->ub_cnt == 0,
("bucket_free: Freeing a non free bucket."));
KASSERT(bucket->ub_seq == SMR_SEQ_INVALID,
@@ -538,17 +543,122 @@ bucket_zone_drain(void)
 }
 
 /*
+ * Acquire the domain lock and record contention.
+ */
+static uma_zone_domain_t
+zone_domain_lock(uma_zone_t zone, int domain)
+{
+   uma_zone_domain_t zdom;
+   bool lockfail;
+
+   zdom = ZDOM_GET(zone, domain);
+   lockfail = false;
+   if (ZDOM_OWNED(zdom))
+   lockfail = true;
+   ZDOM_LOCK(zdom);
+   /* This is unsynchronized.  The counter does not need to be precise. */
+   if (lockfail && zone->uz_bucket_size < zone->uz_bucket_size_max)
+   zone->uz_bucket_size++;
+   return (zdom);
+}
+
+/*
+ * Search for the domain with the least cached items and return it, breaking
+ * ties with a preferred domain by returning it.
+ */
+static __noinline int
+zone_domain_lowest(uma_zone_t zone, int pref)
+{
+   long least, nitems;
+   int domain;
+   int i;
+
+   least = LONG_MAX;
+   domain = 0;
+   for (i = 0; i < vm_ndomains; i++) {
+   nitems = ZDOM_GET(zone, i)->uzd_nitems;
+   if (nitems < least) {
+   domain = i;
+   least = nitems;
+   } else if (nitems == least && (i == pref || domain == pref))
+   domain = pref;
+   }
+
+ 

svn commit: r358127 - in head: contrib/ncurses contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/misc contrib/ncurses/nc...

2020-02-19 Thread Baptiste Daroussin
Author: bapt
Date: Wed Feb 19 17:09:08 2020
New Revision: 358127
URL: https://svnweb.freebsd.org/changeset/base/358127

Log:
  Update to 6.2-20200215
  
  While I didn't plan another upgrade, This version incorporate fixes from
  kevans@ so let's upgrade to it

Modified:
  head/contrib/ncurses/ANNOUNCE
  head/contrib/ncurses/AUTHORS
  head/contrib/ncurses/COPYING
  head/contrib/ncurses/INSTALL
  head/contrib/ncurses/MANIFEST
  head/contrib/ncurses/Makefile.in
  head/contrib/ncurses/Makefile.os2
  head/contrib/ncurses/NEWS
  head/contrib/ncurses/README
  head/contrib/ncurses/README.MinGW
  head/contrib/ncurses/README.emx
  head/contrib/ncurses/TO-DO
  head/contrib/ncurses/VERSION
  head/contrib/ncurses/aclocal.m4
  head/contrib/ncurses/announce.html.in
  head/contrib/ncurses/configure
  head/contrib/ncurses/configure.in
  head/contrib/ncurses/convert_configure.pl
  head/contrib/ncurses/dist.mk
  head/contrib/ncurses/doc/html/announce.html
  head/contrib/ncurses/doc/html/hackguide.html
  head/contrib/ncurses/doc/html/ncurses-intro.html
  head/contrib/ncurses/form/Makefile.in
  head/contrib/ncurses/form/READ.ME
  head/contrib/ncurses/form/f_trace.c
  head/contrib/ncurses/form/fld_arg.c
  head/contrib/ncurses/form/fld_attr.c
  head/contrib/ncurses/form/fld_current.c
  head/contrib/ncurses/form/fld_def.c
  head/contrib/ncurses/form/fld_dup.c
  head/contrib/ncurses/form/fld_ftchoice.c
  head/contrib/ncurses/form/fld_ftlink.c
  head/contrib/ncurses/form/fld_info.c
  head/contrib/ncurses/form/fld_just.c
  head/contrib/ncurses/form/fld_link.c
  head/contrib/ncurses/form/fld_max.c
  head/contrib/ncurses/form/fld_move.c
  head/contrib/ncurses/form/fld_newftyp.c
  head/contrib/ncurses/form/fld_opts.c
  head/contrib/ncurses/form/fld_pad.c
  head/contrib/ncurses/form/fld_page.c
  head/contrib/ncurses/form/fld_stat.c
  head/contrib/ncurses/form/fld_type.c
  head/contrib/ncurses/form/fld_user.c
  head/contrib/ncurses/form/form.h
  head/contrib/ncurses/form/form.priv.h
  head/contrib/ncurses/form/frm_cursor.c
  head/contrib/ncurses/form/frm_data.c
  head/contrib/ncurses/form/frm_def.c
  head/contrib/ncurses/form/frm_driver.c
  head/contrib/ncurses/form/frm_hook.c
  head/contrib/ncurses/form/frm_opts.c
  head/contrib/ncurses/form/frm_page.c
  head/contrib/ncurses/form/frm_post.c
  head/contrib/ncurses/form/frm_req_name.c
  head/contrib/ncurses/form/frm_scale.c
  head/contrib/ncurses/form/frm_sub.c
  head/contrib/ncurses/form/frm_user.c
  head/contrib/ncurses/form/frm_win.c
  head/contrib/ncurses/form/fty_alnum.c
  head/contrib/ncurses/form/fty_alpha.c
  head/contrib/ncurses/form/fty_enum.c
  head/contrib/ncurses/form/fty_generic.c
  head/contrib/ncurses/form/fty_int.c
  head/contrib/ncurses/form/fty_ipv4.c
  head/contrib/ncurses/form/fty_num.c
  head/contrib/ncurses/form/fty_regex.c
  head/contrib/ncurses/form/headers
  head/contrib/ncurses/form/llib-lform
  head/contrib/ncurses/form/llib-lformt
  head/contrib/ncurses/form/llib-lformtw
  head/contrib/ncurses/form/llib-lformw
  head/contrib/ncurses/form/modules
  head/contrib/ncurses/include/Caps
  head/contrib/ncurses/include/Caps-ncurses
  head/contrib/ncurses/include/Caps.aix4
  head/contrib/ncurses/include/Caps.hpux11
  head/contrib/ncurses/include/Caps.keys
  head/contrib/ncurses/include/Caps.osf1r5
  head/contrib/ncurses/include/Caps.uwin
  head/contrib/ncurses/include/MKhashsize.sh
  head/contrib/ncurses/include/MKkey_defs.sh
  head/contrib/ncurses/include/MKncurses_def.sh
  head/contrib/ncurses/include/MKparametrized.sh
  head/contrib/ncurses/include/MKterm.h.awk.in
  head/contrib/ncurses/include/Makefile.in
  head/contrib/ncurses/include/capdefaults.c
  head/contrib/ncurses/include/curses.h.in
  head/contrib/ncurses/include/edit_cfg.sh
  head/contrib/ncurses/include/hashed_db.h
  head/contrib/ncurses/include/headers
  head/contrib/ncurses/include/nc_alloc.h
  head/contrib/ncurses/include/nc_mingw.h
  head/contrib/ncurses/include/nc_panel.h
  head/contrib/ncurses/include/nc_string.h
  head/contrib/ncurses/include/nc_termios.h
  head/contrib/ncurses/include/nc_tparm.h
  head/contrib/ncurses/include/ncurses_cfg.hin
  head/contrib/ncurses/include/ncurses_defs
  head/contrib/ncurses/include/ncurses_dll.h.in
  head/contrib/ncurses/include/ncurses_mingw.h
  head/contrib/ncurses/include/term_entry.h
  head/contrib/ncurses/include/termcap.h.in
  head/contrib/ncurses/include/tic.h
  head/contrib/ncurses/include/unctrl.h.in
  head/contrib/ncurses/man/MKada_config.in
  head/contrib/ncurses/man/MKncu_config.in
  head/contrib/ncurses/man/MKterminfo.sh
  head/contrib/ncurses/man/Makefile.in
  head/contrib/ncurses/man/captoinfo.1m
  head/contrib/ncurses/man/clear.1
  head/contrib/ncurses/man/curs_add_wch.3x
  head/contrib/ncurses/man/curs_add_wchstr.3x
  head/contrib/ncurses/man/curs_addch.3x
  head/contrib/ncurses/man/curs_addchstr.3x
  head/contrib/ncurses/man/curs_addstr.3x
  head/contrib/ncurses/man/curs_addwstr.3x
  head/contrib/ncurses/man/curs_attr.3x
  

svn commit: r358124 - head/tests/sys/net

2020-02-19 Thread Kristof Provost
Author: kp
Date: Wed Feb 19 16:44:16 2020
New Revision: 358124
URL: https://svnweb.freebsd.org/changeset/base/358124

Log:
  bridge tests: Remove unneeded 'All rights reserved.'
  
  The FreeBSD foundation no longer requires this, as per
  https://lists.freebsd.org/pipermail/svn-src-all/2019-February/177215.html and
  private communications.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/net/if_bridge_test.sh

Modified: head/tests/sys/net/if_bridge_test.sh
==
--- head/tests/sys/net/if_bridge_test.shWed Feb 19 16:23:21 2020
(r358123)
+++ head/tests/sys/net/if_bridge_test.shWed Feb 19 16:44:16 2020
(r358124)
@@ -3,7 +3,6 @@
 # SPDX-License-Identifier: BSD-2-Clause-FreeBSD
 #
 # Copyright (c) 2020 The FreeBSD Foundation
-# All rights reserved.
 #
 # This software was developed by Kristof Provost under sponsorship
 # from the FreeBSD Foundation.
___
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: r358123 - head/tools/tools/nanobsd/dhcpd

2020-02-19 Thread Ed Maste
Author: emaste
Date: Wed Feb 19 16:23:21 2020
New Revision: 358123
URL: https://svnweb.freebsd.org/changeset/base/358123

Log:
  nanobsd: add WITHOUT_LLVM_COV, akin to WITHOUT_GCOV
  
  Another case, missed in r358105

Modified:
  head/tools/tools/nanobsd/dhcpd/common

Modified: head/tools/tools/nanobsd/dhcpd/common
==
--- head/tools/tools/nanobsd/dhcpd/common   Wed Feb 19 16:18:27 2020
(r358122)
+++ head/tools/tools/nanobsd/dhcpd/common   Wed Feb 19 16:23:21 2020
(r358123)
@@ -111,6 +111,7 @@ WITHOUT_GAMES=true
 WITHOUT_GCOV=true
 WITHOUT_HTML=true
 WITHOUT_IPFILTER=true
+WITHOUT_LLVM_COV=true
 WITHOUT_LOCALES=true
 WITHOUT_LPR=true
 WITHOUT_MAN=true
___
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: r358120 - head

2020-02-19 Thread Ed Maste
Author: emaste
Date: Wed Feb 19 15:56:40 2020
New Revision: 358120
URL: https://svnweb.freebsd.org/changeset/base/358120

Log:
  Cirrus-CI: increase timeout to 120m
  
  For some reason build+package+test time went from about 1h10 to over
  1h30 (killed due to timeout prior to completion).
  
  The reason for the increase still needs investigation.

Modified:
  head/.cirrus.yml

Modified: head/.cirrus.yml
==
--- head/.cirrus.ymlWed Feb 19 15:30:13 2020(r358119)
+++ head/.cirrus.ymlWed Feb 19 15:56:40 2020(r358120)
@@ -9,7 +9,7 @@ env:
   CIRRUS_CLONE_DEPTH: 1
 
 task:
-  timeout_in: 90m
+  timeout_in: 120m
   install_script:
   - pkg install -y qemu-devel uefi-edk2-qemu-x86_64
   script:
___
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: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Baptiste Daroussin
On Wed, Feb 19, 2020 at 05:18:25PM +0200, Konstantin Belousov wrote:
> On Wed, Feb 19, 2020 at 10:41:27AM +0100, Baptiste Daroussin wrote:
> > On Wed, Feb 19, 2020 at 11:02:11AM +0300, Yuri Pankov wrote:
> > > On 18 Feb 2020, at 11:11, Baptiste Daroussin  wrote:
> > > > 
> > > > Author: bapt
> > > > Date: Tue Feb 18 08:11:52 2020
> > > > New Revision: 358062
> > > > URL: https://svnweb.freebsd.org/changeset/base/358062
> > > > 
> > > > Log:
> > > >  Update ncurses to 20200118
> > > > 
> > > >  Among the changes from before:
> > > >  - Add support for extended colors on widechar version
> > > >  - Enable ncurses extended functions
> > > >  - Enable version 2 of the extended mouse support
> > > >  - Enable SCREEN extensions
> > > > 
> > > >  Modification that differs from upstream:
> > > >  - _nc_delink_entries used to be exposed and was turn static,
> > > >turn it back as dynamic to not break abi
> > > >  - Adapt our old termcap.c to modern ncurses
> > > > 
> > > >  MFC after: 3 weeks
> > > 
> > > Somewhat confusingly, I had to rebuild e.g. dialog4ports after this 
> > > change as it was displaying garbage.  May be a brief headsup is in order 
> > > (or am I the only one seeing it)?
> > 
> > I will add a not in UPDATING
> 
> Does this mean that the ABI of the libraries changed ?
> If yes, that means that the dso version bump is needed (curses seems to be
> not versioned).

That is what I do not understand yet, according to abi lab, no it hasn't
changed. but the reality if that some unicode caracters are not properly
rendered when using that new library without having been rebuilt with it.

Best regards,
Bapt


signature.asc
Description: PGP signature


Re: svn commit: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Konstantin Belousov
On Wed, Feb 19, 2020 at 10:41:27AM +0100, Baptiste Daroussin wrote:
> On Wed, Feb 19, 2020 at 11:02:11AM +0300, Yuri Pankov wrote:
> > On 18 Feb 2020, at 11:11, Baptiste Daroussin  wrote:
> > > 
> > > Author: bapt
> > > Date: Tue Feb 18 08:11:52 2020
> > > New Revision: 358062
> > > URL: https://svnweb.freebsd.org/changeset/base/358062
> > > 
> > > Log:
> > >  Update ncurses to 20200118
> > > 
> > >  Among the changes from before:
> > >  - Add support for extended colors on widechar version
> > >  - Enable ncurses extended functions
> > >  - Enable version 2 of the extended mouse support
> > >  - Enable SCREEN extensions
> > > 
> > >  Modification that differs from upstream:
> > >  - _nc_delink_entries used to be exposed and was turn static,
> > >turn it back as dynamic to not break abi
> > >  - Adapt our old termcap.c to modern ncurses
> > > 
> > >  MFC after:   3 weeks
> > 
> > Somewhat confusingly, I had to rebuild e.g. dialog4ports after this change 
> > as it was displaying garbage.  May be a brief headsup is in order (or am I 
> > the only one seeing it)?
> 
> I will add a not in UPDATING

Does this mean that the ABI of the libraries changed ?
If yes, that means that the dso version bump is needed (curses seems to be
not versioned).
___
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: r358118 - head/usr.bin/truss

2020-02-19 Thread Kyle Evans
Author: kevans
Date: Wed Feb 19 15:12:01 2020
New Revision: 358118
URL: https://svnweb.freebsd.org/changeset/base/358118

Log:
  truss: fix shm_open2 oversight (BinString -> Name)
  
  BinString assumes a length in the next argument; Name is more appropriate
  for the final argument.

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Wed Feb 19 14:55:59 2020
(r358117)
+++ head/usr.bin/truss/syscalls.c   Wed Feb 19 15:12:01 2020
(r358118)
@@ -473,7 +473,7 @@ static struct syscall decoded_syscalls[] = {
  .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
{ .name = "shm_open2", .ret_type = 1, .nargs = 5,
  .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 },
-   { ShmFlags, 3 }, { BinString | IN, 4 } } },
+   { ShmFlags, 3 }, { Name | IN, 4 } } },
{ .name = "shm_rename", .ret_type = 1, .nargs = 3,
  .args = { { Name | IN, 0 }, { Name | IN, 1 }, { Hex, 2 } } },
{ .name = "shm_unlink", .ret_type = 1, .nargs = 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: r358117 - head/usr.bin/kdump

2020-02-19 Thread Kyle Evans
Author: kevans
Date: Wed Feb 19 14:55:59 2020
New Revision: 358117
URL: https://svnweb.freebsd.org/changeset/base/358117

Log:
  kdump: decode shm_open2
  
  This is the kdump counterpart of the truss support added in r358116, and
  also a part of D23733. shm_open2 is the successor to shm_open.
  
  Reviewed by:  kaktus

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Wed Feb 19 14:54:33 2020(r358116)
+++ head/usr.bin/kdump/kdump.c  Wed Feb 19 14:55:59 2020(r358117)
@@ -1263,6 +1263,22 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
narg -= 2;
break;
 #endif
+   case SYS_shm_open2:
+   if (ip[0] == (uintptr_t)SHM_ANON) {
+   printf("(SHM_ANON");
+   ip++;
+   } else {
+   print_number(ip, narg, c);
+   }
+   putchar(',');
+   print_mask_arg(sysdecode_open_flags, ip[0]);
+   putchar(',');
+   decode_filemode(ip[1]);
+   putchar(',');
+   print_mask_arg(sysdecode_shmflags, ip[2]);
+   ip += 3;
+   narg -= 3;
+   break;
case SYS_minherit:
print_number(ip, narg, c);
print_number(ip, narg, c);
___
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: r358116 - head/usr.bin/truss

2020-02-19 Thread Kyle Evans
Author: kevans
Date: Wed Feb 19 14:54:33 2020
New Revision: 358116
URL: https://svnweb.freebsd.org/changeset/base/358116

Log:
  truss: decode shm_open2
  
  shm_open2 is similar to shm_open, except it also takes shmflags and optional
  name to label the anonymous region for, e.g., debugging purposes.
  
  The appropriate support for decoding shmflags was added to libsysdecode in
  r358115.
  
  This is a part of D23733.
  
  Reviewed by:  kaktus

Modified:
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscall.h
==
--- head/usr.bin/truss/syscall.hWed Feb 19 14:52:32 2020
(r358115)
+++ head/usr.bin/truss/syscall.hWed Feb 19 14:54:33 2020
(r358116)
@@ -122,6 +122,7 @@ enum Argtype {
Rtpriofunc,
RusageWho,
Schedpolicy,
+   ShmFlags,
Shutdown,
Signal,
Sigprocmask,

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Wed Feb 19 14:52:32 2020
(r358115)
+++ head/usr.bin/truss/syscalls.c   Wed Feb 19 14:54:33 2020
(r358116)
@@ -471,6 +471,9 @@ static struct syscall decoded_syscalls[] = {
{ Ptr | IN, 3 }, { Socklent, 4 } } },
{ .name = "shm_open", .ret_type = 1, .nargs = 3,
  .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
+   { .name = "shm_open2", .ret_type = 1, .nargs = 5,
+ .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 },
+   { ShmFlags, 3 }, { BinString | IN, 4 } } },
{ .name = "shm_rename", .ret_type = 1, .nargs = 3,
  .args = { { Name | IN, 0 }, { Name | IN, 1 }, { Hex, 2 } } },
{ .name = "shm_unlink", .ret_type = 1, .nargs = 1,
@@ -2008,6 +2011,9 @@ print_arg(struct syscall_args *sc, unsigned long *args
break;
case Whence:
print_integer_arg(sysdecode_whence, fp, args[sc->offset]);
+   break;
+   case ShmFlags:
+   print_mask_arg(sysdecode_shmflags, fp, args[sc->offset]);
break;
case Sockdomain:
print_integer_arg(sysdecode_socketdomain, fp, args[sc->offset]);
___
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: r358115 - head/lib/libsysdecode

2020-02-19 Thread Kyle Evans
Author: kevans
Date: Wed Feb 19 14:52:32 2020
New Revision: 358115
URL: https://svnweb.freebsd.org/changeset/base/358115

Log:
  libsysdecode: grab shmflags from sys/mman.h, add decode method
  
  Any SHM_* flag here is (and likely will continue to be) a shmflag that may
  be passed to shm_open2(), with exception to SHM_ANON. This is a prereq to
  adding appropriate support to truss/kdump.
  
  Reviewed by:  kaktus (slightly earlier version)
  Differential Revision:https://reviews.freebsd.org/D23733

Modified:
  head/lib/libsysdecode/flags.c
  head/lib/libsysdecode/mktables
  head/lib/libsysdecode/sysdecode.h

Modified: head/lib/libsysdecode/flags.c
==
--- head/lib/libsysdecode/flags.c   Wed Feb 19 14:51:39 2020
(r358114)
+++ head/lib/libsysdecode/flags.c   Wed Feb 19 14:52:32 2020
(r358115)
@@ -1277,3 +1277,10 @@ sysdecode_sctp_sinfo_flags(FILE *fp, int sinfo_flags)
}
}
 }
+
+bool
+sysdecode_shmflags(FILE *fp, int flags, int *rem)
+{
+
+   return (print_mask_0(fp, shmflags, flags, rem));
+}

Modified: head/lib/libsysdecode/mktables
==
--- head/lib/libsysdecode/mktables  Wed Feb 19 14:51:39 2020
(r358114)
+++ head/lib/libsysdecode/mktables  Wed Feb 19 14:52:32 2020
(r358115)
@@ -165,6 +165,7 @@ if [ -e "${include_dir}/x86/sysarch.h" ]; then
 else
gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" 
"machine/sysarch.h"
 fi
+gen_table "shmflags"  "SHM_[A-Z_]+[[:space:]]+0x[0-9]+"
"sys/mman.h" "SHM_ANON"
 
 # Generate a .depend file for our output file
 if [ -n "$output_file" ]; then

Modified: head/lib/libsysdecode/sysdecode.h
==
--- head/lib/libsysdecode/sysdecode.h   Wed Feb 19 14:51:39 2020
(r358114)
+++ head/lib/libsysdecode/sysdecode.h   Wed Feb 19 14:52:32 2020
(r358115)
@@ -128,5 +128,6 @@ const char *sysdecode_vmresult(int _result);
 bool   sysdecode_wait4_options(FILE *_fp, int _options, int *_rem);
 bool   sysdecode_wait6_options(FILE *_fp, int _options, int *_rem);
 const char *sysdecode_whence(int _whence);
+bool   sysdecode_shmflags(FILE *_fp, int _flags, int *_rem);
 
 #endif /* !__SYSDECODE_H__ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r358111 - head/usr.bin/whereis

2020-02-19 Thread Ed Maste
Author: emaste
Date: Wed Feb 19 14:40:53 2020
New Revision: 358111
URL: https://svnweb.freebsd.org/changeset/base/358111

Log:
  whereis: remove gnu/libexec from source search paths
  
  The last subdirectory of gnu/libexec was removed in r85742.

Modified:
  head/usr.bin/whereis/pathnames.h

Modified: head/usr.bin/whereis/pathnames.h
==
--- head/usr.bin/whereis/pathnames.hWed Feb 19 14:37:56 2020
(r358110)
+++ head/usr.bin/whereis/pathnames.hWed Feb 19 14:40:53 2020
(r358111)
@@ -36,7 +36,7 @@
 "/usr/src/usr.sbin:/usr/src/libexec:"  \
 "/usr/src/gnu/bin:/usr/src/gnu/usr.bin:"   \
 "/usr/src/gnu/sbin:/usr/src/gnu/usr.sbin:" \
-"/usr/src/gnu/libexec:/usr/src/contrib:"   \
+"/usr/src/contrib:"\
 "/usr/src/secure/bin:/usr/src/secure/usr.bin:" \
 "/usr/src/secure/sbin:/usr/src/secure/usr.sbin:"   \
 "/usr/src/secure/libexec:/usr/src/crypto:" \
___
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: r358109 - head/usr.bin/kdump

2020-02-19 Thread Kyle Evans
Author: kevans
Date: Wed Feb 19 14:32:55 2020
New Revision: 358109
URL: https://svnweb.freebsd.org/changeset/base/358109

Log:
  kdump: decode SHM_ANON as first arg to legacy shm_open(2)
  
  The first argument to shm_open(2) as well as shm_open2(2) may be a path or
  SHM_ANON. Decode SHM_ANON, at least- paths will show up as namei results in
  kdump output, which may be sufficient; in those cases, we'll have printed an
  address.
  
  Future commits will add support for shm_open2() to libsysdecode/truss/kdump.
  
  Reported by:  kaktus
  MFC after:3 days

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Wed Feb 19 14:29:47 2020(r358108)
+++ head/usr.bin/kdump/kdump.c  Wed Feb 19 14:32:55 2020(r358109)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1248,7 +1249,12 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
break;
 #ifdef SYS_freebsd12_shm_open
case SYS_freebsd12_shm_open:
-   print_number(ip, narg, c);
+   if (ip[0] == (uintptr_t)SHM_ANON) {
+   printf("(SHM_ANON");
+   ip++;
+   } else {
+   print_number(ip, narg, c);
+   }
putchar(',');
print_mask_arg(sysdecode_open_flags, ip[0]);
putchar(',');
___
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: r358105 - head/tools/tools/nanobsd/embedded

2020-02-19 Thread Ed Maste
Author: emaste
Date: Wed Feb 19 14:26:27 2020
New Revision: 358105
URL: https://svnweb.freebsd.org/changeset/base/358105

Log:
  nanobsd: add WITHOUT_LLVM_COV, akin to WITHOUT_GCOV

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonWed Feb 19 14:24:05 2020
(r358104)
+++ head/tools/tools/nanobsd/embedded/commonWed Feb 19 14:26:27 2020
(r358105)
@@ -142,6 +142,7 @@ WITHOUT_GAMES=true
 WITHOUT_GCOV=true
 WITHOUT_HTML=true
 WITHOUT_IPFILTER=true
+WITHOUT_LLVM_COV=true
 WITHOUT_LOCALES=true
 WITHOUT_LPR=true
 WITHOUT_MAN=true
___
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: r358103 - head

2020-02-19 Thread Baptiste Daroussin
Author: bapt
Date: Wed Feb 19 14:18:17 2020
New Revision: 358103
URL: https://svnweb.freebsd.org/changeset/base/358103

Log:
  Add a note about some fallouts due to the ncurses update

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Feb 19 14:16:48 2020(r358102)
+++ head/UPDATING   Wed Feb 19 14:18:17 2020(r358103)
@@ -26,6 +26,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20200218:
+   ncurses has been updated to a newer version (6.1-20200118). After an
+   update some applications using ncurses may results have some rendering
+   problems and would need to be rebuilt.
+
 20200217:
The size of struct vnet and the magic cookie have changed.
Users need to recompile libkvm and all modules using VIMAGE
___
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: r358102 - head/share/man/man5

2020-02-19 Thread Ed Maste
Author: emaste
Date: Wed Feb 19 14:16:48 2020
New Revision: 358102
URL: https://svnweb.freebsd.org/changeset/base/358102

Log:
  src.conf.5: regen after r358101, WITHOUT_GCOV default

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Feb 19 14:12:59 2020
(r358101)
+++ head/share/man/man5/src.conf.5  Wed Feb 19 14:16:48 2020
(r358102)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd February 6, 2020
+.Dd February 19, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -705,8 +705,8 @@ This option is deprecated and will be removed before
 Set to build gcc and g++ as part of the bootstrap process.
 This option is deprecated and will be removed before
 .Fx 13 .
-.It Va WITHOUT_GCOV
-Set to not build the
+.It Va WITH_GCOV
+Build and install the GNU
 .Xr gcov 1
 tool.
 .It Va WITHOUT_GDB
@@ -747,6 +747,17 @@ Set to neither build nor install
 .Lb libgmock ,
 .Lb libgtest ,
 and dependent tests.
+.Pp
+This is a default setting on
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
+.It Va WITH_GOOGLETEST
+Set to build and install
+.Lb libgmock ,
+.Lb libgtest ,
+and dependent tests.
+.Pp
+This is a default setting on
+amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, 
powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf.
 .It Va WITHOUT_GPIO
 Set to not build
 .Xr gpioctl 8
___
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: r358101 - head/share/mk

2020-02-19 Thread Ed Maste
Author: emaste
Date: Wed Feb 19 14:12:59 2020
New Revision: 358101
URL: https://svnweb.freebsd.org/changeset/base/358101

Log:
  Move GCOV option to default NO
  
  GNU gcov will be removed along with GCC 4.2.1 at the end of the month.
  Change the default to NO in preparation.

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

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Wed Feb 19 14:09:15 2020(r358100)
+++ head/share/mk/src.opts.mk   Wed Feb 19 14:12:59 2020(r358101)
@@ -102,7 +102,6 @@ __DEFAULT_YES_OPTIONS = \
 FREEBSD_UPDATE \
 FTP \
 GAMES \
-GCOV \
 GDB \
 GNU_DIFF \
 GNU_GREP \
@@ -201,6 +200,7 @@ __DEFAULT_NO_OPTIONS = \
 EXPERIMENTAL \
 GCC \
 GCC_BOOTSTRAP \
+GCOV \
 GNUCXX \
 GNU_GREP_COMPAT \
 GPL_DTC \
___
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: r358100 - head/lib/ncurses/ncurses

2020-02-19 Thread Baptiste Daroussin
Author: bapt
Date: Wed Feb 19 14:09:15 2020
New Revision: 358100
URL: https://svnweb.freebsd.org/changeset/base/358100

Log:
  lib_gen.c now also depends on ncurses_dll.h specify it to prevent some 
breakage
  if ncurses_dll.h is already present in base while building

Modified:
  head/lib/ncurses/ncurses/Makefile

Modified: head/lib/ncurses/ncurses/Makefile
==
--- head/lib/ncurses/ncurses/Makefile   Wed Feb 19 12:49:49 2020
(r358099)
+++ head/lib/ncurses/ncurses/Makefile   Wed Feb 19 14:09:15 2020
(r358100)
@@ -345,7 +345,7 @@ names.c: MKnames.awk
 codes.c: MKcodes.awk
${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk 
bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c
 
-lib_gen.c: MKlib_gen.sh curses.h
+lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h
LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh 
"${CPP:N${CCACHE_BIN}} ${CPPFLAGS}" \
"${AWK}" generated < curses.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: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Baptiste Daroussin
On Wed, Feb 19, 2020 at 04:45:27AM -0800, Rodney W. Grimes wrote:
> > On 18 Feb 2020, at 11:11, Baptiste Daroussin  wrote:
> > > 
> > > Author: bapt
> > > Date: Tue Feb 18 08:11:52 2020
> > > New Revision: 358062
> > > URL: https://svnweb.freebsd.org/changeset/base/358062
> > > 
> > > Log:
> > >  Update ncurses to 20200118
> > > 
> > >  Among the changes from before:
> > >  - Add support for extended colors on widechar version
> > >  - Enable ncurses extended functions
> > >  - Enable version 2 of the extended mouse support
> > >  - Enable SCREEN extensions
> > > 
> > >  Modification that differs from upstream:
> > >  - _nc_delink_entries used to be exposed and was turn static,
> > >turn it back as dynamic to not break abi
> > >  - Adapt our old termcap.c to modern ncurses
> > > 
> > >  MFC after:   3 weeks
> > 
> > Somewhat confusingly, I had to rebuild e.g. dialog4ports after this change 
> > as it was displaying garbage.  May be a brief headsup is in order (or am I 
> > the only one seeing it)?
> 
> If this is infact found to cause those types of dependency breakage I would 
> wonder about MFC: status.
> 
Yes I don't plan to MFC without a fix on this, if any.

Best regards,
Bapt


signature.asc
Description: PGP signature


svn commit: r358099 - in head: lib/msun/man share/man/man7 usr.sbin/ac usr.sbin/sa

2020-02-19 Thread Sergio Carlavilla Delgado
Author: carlavilla (doc committer)
Date: Wed Feb 19 12:49:49 2020
New Revision: 358099
URL: https://svnweb.freebsd.org/changeset/base/358099

Log:
  Add some HISTORY sections to manpages
  
  environ(7) was in AT Version 7
  ac(8): Add a HISTORY section
  sa(8): Add a HISTORY section
  sqrt(3): Add the actual sqrt function to the HISTORY section
  
  Obtained from: OpenBSD
  
  Submitted by: gbergl...@gmail.com
  Approved by:  bcr@(mentor)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23693

Modified:
  head/lib/msun/man/sqrt.3
  head/share/man/man7/environ.7
  head/usr.sbin/ac/ac.8
  head/usr.sbin/sa/sa.8

Modified: head/lib/msun/man/sqrt.3
==
--- head/lib/msun/man/sqrt.3Wed Feb 19 09:10:11 2020(r358098)
+++ head/lib/msun/man/sqrt.3Wed Feb 19 12:49:49 2020(r358099)
@@ -28,7 +28,7 @@
 .\" from: @(#)sqrt.3   6.4 (Berkeley) 5/6/91
 .\" $FreeBSD$
 .\"
-.Dd March 5, 2011
+.Dd February 15, 2020
 .Dt SQRT 3
 .Os
 .Sh NAME
@@ -113,6 +113,9 @@ The
 function appeared in
 .Bx 4.3 .
 The
+.Fn sqrt
+function appeared in
+.At v2 .
 .Fn sqrtl
 function appeared in
 .Fx 8.0 .

Modified: head/share/man/man7/environ.7
==
--- head/share/man/man7/environ.7   Wed Feb 19 09:10:11 2020
(r358098)
+++ head/share/man/man7/environ.7   Wed Feb 19 12:49:49 2020
(r358099)
@@ -28,7 +28,7 @@
 .\"@(#)environ.7   8.3 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2003
+.Dd February 14, 2020
 .Dt ENVIRON 7
 .Os
 .Sh NAME
@@ -261,4 +261,4 @@ built-in command in
 The
 .Nm
 manual page appeared in
-.Bx 4.2 .
+.At v7 .

Modified: head/usr.sbin/ac/ac.8
==
--- head/usr.sbin/ac/ac.8   Wed Feb 19 09:10:11 2020(r358098)
+++ head/usr.sbin/ac/ac.8   Wed Feb 19 12:49:49 2020(r358099)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 21, 2010
+.Dd February 14, 2020
 .Dt AC 8
 .Os
 .Sh NAME
@@ -126,6 +126,16 @@ ac -p -t "!ttyd*" > other
 .Xr getutxent 3 ,
 .Xr init 8 ,
 .Xr sa 8
+.Sh HISTORY
+An
+.Nm
+command appeared in
+.At v5 .
+This version of
+.Nm
+was written for
+.Nx 0.9a
+from the specification provided by various systems' manual pages.
 .\" .Sh NOTES
 .\" If COMPAT_SUNOS is defined
 .\" .Nm ac

Modified: head/usr.sbin/sa/sa.8
==
--- head/usr.sbin/sa/sa.8   Wed Feb 19 09:10:11 2020(r358098)
+++ head/usr.sbin/sa/sa.8   Wed Feb 19 12:49:49 2020(r358099)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 18, 2007
+.Dd February 14, 2020
 .Dt SA 8
 .Os
 .Sh NAME
@@ -234,6 +234,14 @@ per-user accounting summary database
 .Xr acct 5 ,
 .Xr ac 8 ,
 .Xr accton 8
+.Sh HISTORY
+.Nm
+first appeared in
+.At v5 .
+.Nm
+was rewritten for
+.Nx 0.9a
+from the specification provided by various systems' manual pages.
 .Sh AUTHORS
 .An Chris G. Demetriou Aq Mt c...@postgres.berkeley.edu
 .Sh CAVEATS
___
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: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Rodney W. Grimes
> On 18 Feb 2020, at 11:11, Baptiste Daroussin  wrote:
> > 
> > Author: bapt
> > Date: Tue Feb 18 08:11:52 2020
> > New Revision: 358062
> > URL: https://svnweb.freebsd.org/changeset/base/358062
> > 
> > Log:
> >  Update ncurses to 20200118
> > 
> >  Among the changes from before:
> >  - Add support for extended colors on widechar version
> >  - Enable ncurses extended functions
> >  - Enable version 2 of the extended mouse support
> >  - Enable SCREEN extensions
> > 
> >  Modification that differs from upstream:
> >  - _nc_delink_entries used to be exposed and was turn static,
> >turn it back as dynamic to not break abi
> >  - Adapt our old termcap.c to modern ncurses
> > 
> >  MFC after: 3 weeks
> 
> Somewhat confusingly, I had to rebuild e.g. dialog4ports after this change as 
> it was displaying garbage.  May be a brief headsup is in order (or am I the 
> only one seeing it)?

If this is infact found to cause those types of dependency breakage I would 
wonder about MFC: status.


-- 
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: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Li-Wen Hsu
On Wed, Feb 19, 2020 at 5:04 PM Dimitry Andric  wrote:
>
> On 2020-02-18 09:11, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Tue Feb 18 08:11:52 2020
> > New Revision: 358062
> > URL: https://svnweb.freebsd.org/changeset/base/358062
> >
> > Log:
> >Update ncurses to 20200118
>
> Apparently this breaks the gcc builds, because it can't find the
> function "box" anymore:
>
> --- all_subdir_usr.bin/clang/lldb ---
> /usr/local/bin/x86_64-unknown-freebsd12.0-ld:
> /tmp/obj/workspace/src/amd64.amd64/lib/clang/liblldb/liblldb.a(IOHandler.o):
> in function `curses::Window::Box(unsigned int, unsigned int)':
> /workspace/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:926:
> undefined reference to `box'
> /usr/local/bin/x86_64-unknown-freebsd12.0-ld:
> /workspace/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:926:
> undefined reference to `box'
> collect2: error: ld returned 1 exit status
> *** [lldb.full] Error code 1
>
> See also: https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/13322/

For more information, currently the FreeBSD-head-amd64-gcc is using
amd64-gcc package via amd64-xtoolchain-gcc, which is 6.4
A test build with amd64-gcc6, which is 6.5, just completed and it's fine.
I haven't checked this failure is due to our code itself, gcc versions
or the difference in the configuration of two gcc ports.

I think I will create FreeBSD-head-amd64-gcc6 job uses newer and
preferred external tool chain, then the experimental ones like
FreeBSD-head-amd64-gcc9, 10 and llvm-devel.

Best,
Li-Wen
___
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: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Baptiste Daroussin
On Wed, Feb 19, 2020 at 11:02:11AM +0300, Yuri Pankov wrote:
> On 18 Feb 2020, at 11:11, Baptiste Daroussin  wrote:
> > 
> > Author: bapt
> > Date: Tue Feb 18 08:11:52 2020
> > New Revision: 358062
> > URL: https://svnweb.freebsd.org/changeset/base/358062
> > 
> > Log:
> >  Update ncurses to 20200118
> > 
> >  Among the changes from before:
> >  - Add support for extended colors on widechar version
> >  - Enable ncurses extended functions
> >  - Enable version 2 of the extended mouse support
> >  - Enable SCREEN extensions
> > 
> >  Modification that differs from upstream:
> >  - _nc_delink_entries used to be exposed and was turn static,
> >turn it back as dynamic to not break abi
> >  - Adapt our old termcap.c to modern ncurses
> > 
> >  MFC after: 3 weeks
> 
> Somewhat confusingly, I had to rebuild e.g. dialog4ports after this change as 
> it was displaying garbage.  May be a brief headsup is in order (or am I the 
> only one seeing it)?

I will add a not in UPDATING

Best regards,
Bapt


signature.asc
Description: PGP signature


svn commit: r358098 - head/sys/vm

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 09:10:11 2020
New Revision: 358098
URL: https://svnweb.freebsd.org/changeset/base/358098

Log:
  Don't release xbusy on kmem pages.  After lockless page lookup we will not
  be able to guarantee that they can be racquired without blocking.
  
  Reviewed by:  kib
  Discussed with:   markj
  Differential Revision:https://reviews.freebsd.org/D23506

Modified:
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_kern.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_swapout.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Wed Feb 19 08:17:27 2020(r358097)
+++ head/sys/vm/vm_glue.c   Wed Feb 19 09:10:11 2020(r358098)
@@ -342,10 +342,8 @@ vm_thread_stack_create(struct domainset *ds, vm_object
VM_OBJECT_WLOCK(ksobj);
(void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED,
ma, pages);
-   for (i = 0; i < pages; i++) {
+   for (i = 0; i < pages; i++)
vm_page_valid(ma[i]);
-   vm_page_xunbusy(ma[i]);
-   }
VM_OBJECT_WUNLOCK(ksobj);
pmap_qenter(ks, ma, pages);
*ksobjp = ksobj;
@@ -365,7 +363,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t
m = vm_page_lookup(ksobj, i);
if (m == NULL)
panic("%s: kstack already missing?", __func__);
-   vm_page_busy_acquire(m, 0);
+   vm_page_xbusy_claim(m);
vm_page_unwire_noq(m);
vm_page_free(m);
}

Modified: head/sys/vm/vm_kern.c
==
--- head/sys/vm/vm_kern.c   Wed Feb 19 08:17:27 2020(r358097)
+++ head/sys/vm/vm_kern.c   Wed Feb 19 09:10:11 2020(r358098)
@@ -224,7 +224,6 @@ retry:
if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0)
pmap_zero_page(m);
vm_page_valid(m);
-   vm_page_xunbusy(m);
pmap_enter(kernel_pmap, addr + i, m, prot,
prot | PMAP_ENTER_WIRED, 0);
}
@@ -317,7 +316,6 @@ retry:
if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0)
pmap_zero_page(m);
vm_page_valid(m);
-   vm_page_xunbusy(m);
pmap_enter(kernel_pmap, tmp, m, VM_PROT_RW,
VM_PROT_RW | PMAP_ENTER_WIRED, 0);
tmp += PAGE_SIZE;
@@ -501,7 +499,6 @@ retry:
KASSERT((m->oflags & VPO_UNMANAGED) != 0,
("kmem_malloc: page %p is managed", m));
vm_page_valid(m);
-   vm_page_xunbusy(m);
pmap_enter(kernel_pmap, addr + i, m, prot,
prot | PMAP_ENTER_WIRED, 0);
 #if VM_NRESERVLEVEL > 0
@@ -591,7 +588,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_
 #endif
for (; offset < end; offset += PAGE_SIZE, m = next) {
next = vm_page_next(m);
-   vm_page_busy_acquire(m, 0);
+   vm_page_xbusy_claim(m);
vm_page_unwire_noq(m);
vm_page_free(m);
}

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Wed Feb 19 08:17:27 2020(r358097)
+++ head/sys/vm/vm_page.h   Wed Feb 19 09:10:11 2020(r358098)
@@ -764,9 +764,14 @@ void vm_page_object_busy_assert(vm_page_t m);
 void vm_page_assert_pga_writeable(vm_page_t m, uint16_t bits);
 #defineVM_PAGE_ASSERT_PGA_WRITEABLE(m, bits)   
\
vm_page_assert_pga_writeable(m, bits)
+#definevm_page_xbusy_claim(m) do { 
\
+   vm_page_assert_xbusied_unchecked((m));  \
+   (m)->busy_lock = VPB_CURTHREAD_EXCLUSIVE;   \
+} while (0)
 #else
 #defineVM_PAGE_OBJECT_BUSY_ASSERT(m)   (void)0
 #defineVM_PAGE_ASSERT_PGA_WRITEABLE(m, bits)   (void)0
+#definevm_page_xbusy_claim(m)
 #endif
 
 #if BYTE_ORDER == BIG_ENDIAN

Modified: head/sys/vm/vm_swapout.c
==
--- head/sys/vm/vm_swapout.cWed Feb 19 08:17:27 2020(r358097)
+++ head/sys/vm/vm_swapout.cWed Feb 19 09:10:11 2020(r358098)
@@ -540,6 +540,7 @@ vm_thread_swapout(struct thread *td)
if (m == NULL)
panic("vm_thread_swapout: kstack already missing?");
vm_page_dirty(m);
+   vm_page_xunbusy_unchecked(m);
vm_page_unwire(m, PQ_LAUNDRY);
}
VM_OBJECT_WUNLOCK(ksobj);
@@ -564,7 +565,6 @@ vm_thread_swapin(struct thread *td, int oom_alloc)
for (i = 0; i < pages;) {
vm_page_assert_xbusied(ma[i]);
if 

Re: svn commit: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Dimitry Andric

On 2020-02-18 09:11, Baptiste Daroussin wrote:

Author: bapt
Date: Tue Feb 18 08:11:52 2020
New Revision: 358062
URL: https://svnweb.freebsd.org/changeset/base/358062

Log:
   Update ncurses to 20200118


Apparently this breaks the gcc builds, because it can't find the 
function "box" anymore:


--- all_subdir_usr.bin/clang/lldb ---
/usr/local/bin/x86_64-unknown-freebsd12.0-ld: 
/tmp/obj/workspace/src/amd64.amd64/lib/clang/liblldb/liblldb.a(IOHandler.o): 
in function `curses::Window::Box(unsigned int, unsigned int)':
/workspace/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:926: 
undefined reference to `box'
/usr/local/bin/x86_64-unknown-freebsd12.0-ld: 
/workspace/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:926: 
undefined reference to `box'

collect2: error: ld returned 1 exit status
*** [lldb.full] Error code 1

See also: https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/13322/

-Dimitry
___
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: r358097 - in head/sys: kern vm

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 08:17:27 2020
New Revision: 358097
URL: https://svnweb.freebsd.org/changeset/base/358097

Log:
  Eliminate some unnecessary uses of UMA_ZONE_VM.  Only zones involved in
  virtual address or physical page allocation need to be marked with this
  flag.
  
  Reviewed by:  markj
  Tested by:pho
  Differential Revision:https://reviews.freebsd.org/D23712

Modified:
  head/sys/kern/subr_vmem.c
  head/sys/kern/vfs_subr.c
  head/sys/vm/swap_pager.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_pager.c

Modified: head/sys/kern/subr_vmem.c
==
--- head/sys/kern/subr_vmem.c   Wed Feb 19 08:15:20 2020(r358096)
+++ head/sys/kern/subr_vmem.c   Wed Feb 19 08:17:27 2020(r358097)
@@ -561,8 +561,7 @@ qc_init(vmem_t *vm, vmem_size_t qcache_max)
qc->qc_vmem = vm;
qc->qc_size = size;
qc->qc_cache = uma_zcache_create(qc->qc_name, size,
-   NULL, NULL, NULL, NULL, qc_import, qc_release, qc,
-   UMA_ZONE_VM);
+   NULL, NULL, NULL, NULL, qc_import, qc_release, qc, 0);
MPASS(qc->qc_cache);
}
 }
@@ -668,10 +667,10 @@ vmem_startup(void)
mtx_init(_list_lock, "vmem list lock", NULL, MTX_DEF);
vmem_zone = uma_zcreate("vmem",
sizeof(struct vmem), NULL, NULL, NULL, NULL,
-   UMA_ALIGN_PTR, UMA_ZONE_VM);
+   UMA_ALIGN_PTR, 0);
vmem_bt_zone = uma_zcreate("vmem btag",
sizeof(struct vmem_btag), NULL, NULL, NULL, NULL,
-   UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
+   UMA_ALIGN_PTR, UMA_ZONE_VM);
 #ifndef UMA_MD_SMALL_ALLOC
mtx_init(_bt_lock, "btag lock", NULL, MTX_DEF);
uma_prealloc(vmem_bt_zone, BT_MAXALLOC);

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Feb 19 08:15:20 2020(r358096)
+++ head/sys/kern/vfs_subr.cWed Feb 19 08:17:27 2020(r358097)
@@ -671,7 +671,7 @@ vntblinit(void *dummy __unused)
 */
buf_trie_zone = uma_zcreate("BUF TRIE", pctrie_node_size(),
NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, 
-   UMA_ZONE_NOFREE | UMA_ZONE_VM);
+   UMA_ZONE_NOFREE);
uma_prealloc(buf_trie_zone, nbuf);
 
vnodes_created = counter_u64_alloc(M_WAITOK);

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cWed Feb 19 08:15:20 2020(r358096)
+++ head/sys/vm/swap_pager.cWed Feb 19 08:17:27 2020(r358097)
@@ -585,11 +585,11 @@ swap_pager_swap_init(void)
n = maxswzone != 0 ? maxswzone / sizeof(struct swblk) :
vm_cnt.v_page_count / 2;
swpctrie_zone = uma_zcreate("swpctrie", pctrie_node_size(), NULL, NULL,
-   pctrie_zone_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM);
+   pctrie_zone_init, NULL, UMA_ALIGN_PTR, 0);
if (swpctrie_zone == NULL)
panic("failed to create swap pctrie zone.");
swblk_zone = uma_zcreate("swblk", sizeof(struct swblk), NULL, NULL,
-   NULL, NULL, _Alignof(struct swblk) - 1, UMA_ZONE_VM);
+   NULL, NULL, _Alignof(struct swblk) - 1, 0);
if (swblk_zone == NULL)
panic("failed to create swap blk zone.");
n2 = n;

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Feb 19 08:15:20 2020(r358096)
+++ head/sys/vm/vm_page.c   Wed Feb 19 08:17:27 2020(r358097)
@@ -202,7 +202,7 @@ vm_page_init(void *dummy)
 {
 
fakepg_zone = uma_zcreate("fakepg", sizeof(struct vm_page), NULL, NULL,
-   NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM);
+   NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
bogus_page = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ |
VM_ALLOC_NORMAL | VM_ALLOC_WIRED);
 }
@@ -2022,7 +2022,7 @@ again:
 #endif
vmd = VM_DOMAIN(domain);
if (vmd->vmd_pgcache[pool].zone != NULL) {
-   m = uma_zalloc(vmd->vmd_pgcache[pool].zone, M_NOWAIT);
+   m = uma_zalloc(vmd->vmd_pgcache[pool].zone, M_NOWAIT | M_NOVM);
if (m != NULL) {
flags |= PG_PCPU_CACHE;
goto found;

Modified: head/sys/vm/vm_pager.c
==
--- head/sys/vm/vm_pager.c  Wed Feb 19 08:15:20 2020(r358096)
+++ head/sys/vm/vm_pager.c  Wed Feb 19 08:17:27 2020(r358097)
@@ -185,7 +185,7 @@ vm_pager_bufferinit(void)
/* Main zone for paging bufs. */
pbuf_zone = uma_zcreate("pbuf", sizeof(struct buf),
pbuf_ctor, pbuf_dtor, pbuf_init, NULL, UMA_ALIGN_CACHE,
-   

svn commit: r358096 - head/sys/sys

2020-02-19 Thread Jeff Roberson
Author: jeff
Date: Wed Feb 19 08:15:20 2020
New Revision: 358096
URL: https://svnweb.freebsd.org/changeset/base/358096

Log:
  Type validating smr protected pointer accessors.
  
  This API is intended to provide some measure of safety with SMR
  protected pointers.  A struct wrapper provides type checking and
  a guarantee that all access is mediated by the API unless abused.  All
  modifying functions take an assert as an argument to guarantee that
  the required synchronization is present.
  
  Reviewed by:  kib, markj, mjg
  Differential Revision:https://reviews.freebsd.org/D23711

Modified:
  head/sys/sys/smr.h

Modified: head/sys/sys/smr.h
==
--- head/sys/sys/smr.h  Wed Feb 19 06:28:55 2020(r358095)
+++ head/sys/sys/smr.h  Wed Feb 19 08:15:20 2020(r358096)
@@ -77,6 +77,98 @@ struct smr {
 #defineSMR_ASSERT_NOT_ENTERED(smr) 
\
 KASSERT(!SMR_ENTERED(smr), ("In smr section."));
 
+#define SMR_ASSERT(ex, fn) \
+KASSERT((ex), (fn ": Assertion " #ex " failed at %s:%d", __FILE__, 
__LINE__))
+
+/*
+ * SMR Accessors are meant to provide safe access to SMR protected
+ * pointers and prevent misuse and accidental access.
+ *
+ * Accessors are grouped by type:
+ * entered - Use while in a read section (between smr_enter/smr_exit())
+ * serialized  - Use while holding a lock that serializes writers.   Updates
+ *   are synchronized with readers via included barriers.
+ * unserialized- Use after the memory is out of scope and not visible 
to
+ *   readers.
+ *
+ * All acceses include a parameter for an assert to verify the required
+ * synchronization.  For example, a writer might use:
+ *
+ * smr_serilized_store(pointer, value, mtx_owned());
+ *
+ * These are only enabled in INVARIANTS kernels.
+ */
+
+/* Type restricting pointer access to force smr accessors. */
+#defineSMR_TYPE_DECLARE(smrtype, type) 
\
+typedef struct {   \
+   type__ptr;  /* Do not access directly */\
+} smrtype
+
+/*
+ * Read from an SMR protected pointer while in a read section.
+ */
+#definesmr_entered_load(p, smr) ({ 
\
+   SMR_ASSERT(SMR_ENTERED((smr)), "smr_entered_load"); \
+   (__typeof((p)->__ptr))atomic_load_acq_ptr((uintptr_t *)&(p)->__ptr); \
+})
+
+/*
+ * Read from an SMR protected pointer while serialized by an
+ * external mechanism.  'ex' should contain an assert that the
+ * external mechanism is held.  i.e. mtx_owned()
+ */
+#definesmr_serialized_load(p, ex) ({   
\
+   SMR_ASSERT(ex, "smr_serialized_load");  \
+   (__typeof((p)->__ptr))atomic_load_ptr((uintptr_t *)&(p)->__ptr);\
+})
+
+/*
+ * Store 'v' to an SMR protected pointer while serialized by an
+ * external mechanism.  'ex' should contain an assert that the
+ * external mechanism is held.  i.e. mtx_owned()
+ */
+#definesmr_serialized_store(p, v, ex) do { 
\
+   SMR_ASSERT(ex, "smr_serialized_store"); \
+   __typeof((p)->__ptr) _v = (v);  \
+   atomic_store_rel_ptr((uintptr_t *)&(p)->__ptr, (uintptr_t)_v);  \
+} while (0)
+
+/*
+ * swap 'v' with an SMR protected pointer and return the old value
+ * while serialized by an external mechanism.  'ex' should contain
+ * an assert that the external mechanism is provided.  i.e. mtx_owned()
+ */
+#definesmr_serialized_swap(p, v, ex) ({
\
+   SMR_ASSERT(ex, "smr_serialized_swap");  \
+   __typeof((p)->__ptr) _v = (v);  \
+   /* Release barrier guarantees contents are visible to reader */ \
+   atomic_thread_fence_rel();  \
+   (__typeof((p)->__ptr))atomic_swap_ptr(  \
+   (uintptr_t *)&(p)->__ptr, (uintptr_t)_v);   \
+})
+
+/*
+ * Read from an SMR protected pointer when no serialization is required
+ * such as in the destructor callback or when the caller guarantees other
+ * synchronization.
+ */
+#definesmr_unserialized_load(p, ex) ({ 
\
+   SMR_ASSERT(ex, "smr_unserialized_load");\
+   (__typeof((p)->__ptr))atomic_load_ptr((uintptr_t *)&(p)->__ptr);\
+})
+
+/*
+ * Store to an SMR protected pointer when no serialiation is required
+ * such as in the destructor callback or when the caller guarantees other
+ * synchronization.
+ */
+#definesmr_unserialized_store(p, v, ex) do {   
\
+   SMR_ASSERT(ex, "smr_unserialized_store");

Re: svn commit: r358062 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mi

2020-02-19 Thread Yuri Pankov
On 18 Feb 2020, at 11:11, Baptiste Daroussin  wrote:
> 
> Author: bapt
> Date: Tue Feb 18 08:11:52 2020
> New Revision: 358062
> URL: https://svnweb.freebsd.org/changeset/base/358062
> 
> Log:
>  Update ncurses to 20200118
> 
>  Among the changes from before:
>  - Add support for extended colors on widechar version
>  - Enable ncurses extended functions
>  - Enable version 2 of the extended mouse support
>  - Enable SCREEN extensions
> 
>  Modification that differs from upstream:
>  - _nc_delink_entries used to be exposed and was turn static,
>turn it back as dynamic to not break abi
>  - Adapt our old termcap.c to modern ncurses
> 
>  MFC after:   3 weeks

Somewhat confusingly, I had to rebuild e.g. dialog4ports after this change as 
it was displaying garbage.  May be a brief headsup is in order (or am I the 
only one seeing it)?
___
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"