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

2019-01-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jan 16 06:10:55 2019
New Revision: 343087
URL: https://svnweb.freebsd.org/changeset/base/343087

Log:
  Style(9) fixes for x86/busdma_bounce.c.
  
  Remove extra parentheses.  Adjust indents and lines fill.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/x86/x86/busdma_bounce.c
==
--- head/sys/x86/x86/busdma_bounce.cWed Jan 16 05:51:03 2019
(r343086)
+++ head/sys/x86/x86/busdma_bounce.cWed Jan 16 06:10:55 2019
(r343087)
@@ -137,19 +137,16 @@ static void init_bounce_pages(void *dummy);
 static int alloc_bounce_zone(bus_dma_tag_t dmat);
 static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages);
 static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
-   int commit);
+int commit);
 static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
- vm_offset_t vaddr, bus_addr_t addr1,
- bus_addr_t addr2, bus_size_t size);
+vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size);
 static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
 static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
-   pmap_t pmap, void *buf, bus_size_t buflen,
-   int flags);
+pmap_t pmap, void *buf, bus_size_t buflen, int flags);
 static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map,
-  vm_paddr_t buf, bus_size_t buflen,
-  int flags);
+vm_paddr_t buf, bus_size_t buflen, int flags);
 static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
-int flags);
+int flags);
 
 static int
 bounce_bus_dma_zone_setup(bus_dma_tag_t dmat)
@@ -202,15 +199,15 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si
newtag->map_count = 0;
newtag->segments = NULL;
 
-   if (parent != NULL && ((newtag->common.filter != NULL) ||
-   ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0)))
+   if (parent != NULL && (newtag->common.filter != NULL ||
+   (parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))
newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE;
 
if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) ||
newtag->common.alignment > 1)
newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE;
 
-   if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) &&
+   if ((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 &&
(flags & BUS_DMA_ALLOCNOW) != 0)
error = bounce_bus_dma_zone_setup(newtag);
else
@@ -309,7 +306,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags
 * exclusion region, a data alignment that is stricter than 1, and/or
 * an active address boundary.
 */
-   if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) {
+   if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) {
/* Must bounce */
if (dmat->bounce_zone == NULL) {
if ((error = alloc_bounce_zone(dmat)) != 0)
@@ -448,14 +445,15 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad
 *
 * In the meantime warn the user if malloc gets it wrong.
 */
-   if ((dmat->common.maxsize <= PAGE_SIZE) &&
-  (dmat->common.alignment <= dmat->common.maxsize) &&
+   if (dmat->common.maxsize <= PAGE_SIZE &&
+   dmat->common.alignment <= dmat->common.maxsize &&
dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) &&
attr == VM_MEMATTR_DEFAULT) {
*vaddr = malloc_domainset(dmat->common.maxsize, M_DEVBUF,
DOMAINSET_PREF(dmat->common.domain), mflags);
} else if (dmat->common.nsegments >=
-   howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, 
PAGE_SIZE)) &&
+   howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz,
+   PAGE_SIZE)) &&
dmat->common.alignment <= PAGE_SIZE &&
(dmat->common.boundary % PAGE_SIZE) == 0) {
/* Page-based multi-segment allocations allowed */
@@ -512,7 +510,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_
bus_addr_t curaddr;
bus_size_t sgsize;
 
-   if ((map != _dmamap && map->pagesneeded == 0)) {
+   if (map != _dmamap && map->pagesneeded == 0) {
/*
 * Count the number of bounce pages
 * needed in order to complete this transfer
@@ -541,7 +539,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap
bus_addr_t paddr;
bus_size_t sg_len;
 
-   if ((map != _dmamap && map->pagesneeded == 0)) {
+ 

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

2019-01-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jan 16 05:51:03 2019
New Revision: 343086
URL: https://svnweb.freebsd.org/changeset/base/343086

Log:
  Remove unused prototype.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/x86/x86/busdma_bounce.c
==
--- head/sys/x86/x86/busdma_bounce.cWed Jan 16 05:44:14 2019
(r343085)
+++ head/sys/x86/x86/busdma_bounce.cWed Jan 16 05:51:03 2019
(r343086)
@@ -142,7 +142,6 @@ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, 
  vm_offset_t vaddr, bus_addr_t addr1,
  bus_addr_t addr2, bus_size_t size);
 static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
-int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr);
 static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
pmap_t pmap, void *buf, bus_size_t buflen,
int flags);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343085 - head/sys/net

2019-01-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jan 16 05:44:14 2019
New Revision: 343085
URL: https://svnweb.freebsd.org/changeset/base/343085

Log:
  Improve iflib busdma(9) KPI use.
  
  - Specify BUS_DMA_NOWAIT for bus_dmamap_load() on rx refill, since
callbacks are not supposed to be used.
  - Match tso/non-tso tags to corresponding tx map operations.  Create
separate tso maps for tx descriptors.  In particular, do not use
non-tso tag to load, unload, or destroy a map created with tso tag.
  - Add missed bus_dmamap_sync() calls.
Submitted by: marius.
  
  Reported and tested by:   pho
  Reviewed by:  marius
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Jan 16 05:17:27 2019(r343084)
+++ head/sys/net/iflib.cWed Jan 16 05:44:14 2019(r343085)
@@ -282,6 +282,7 @@ typedef struct iflib_sw_rx_desc_array {
 
 typedef struct iflib_sw_tx_desc_array {
bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
+   bus_dmamap_t*ifsd_tso_map; /* bus_dma maps for TSO packet */
struct mbuf**ifsd_m;   /* pkthdr mbufs */
 } if_txsd_vec_t;
 
@@ -1491,6 +1492,8 @@ iflib_fast_intr_rxtx(void *arg)
 
ctx = rxq->ifr_ctx;
 
+   bus_dmamap_sync(rxq->ifr_ifdi->idi_tag, rxq->ifr_ifdi->idi_map,
+   BUS_DMASYNC_POSTREAD);
if (!ctx->isc_txd_credits_update(ctx->ifc_softc, txqid, false)) 
{
IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid);
continue;
@@ -1583,6 +1586,7 @@ iflib_txsd_alloc(iflib_txq_t txq)
device_t dev = ctx->ifc_dev;
bus_size_t tsomaxsize;
int err, nsegments, ntsosegments;
+   bool tso;
 
nsegments = scctx->isc_tx_nsegments;
ntsosegments = scctx->isc_tx_tso_segments_max;
@@ -1617,8 +1621,8 @@ iflib_txsd_alloc(iflib_txq_t txq)
(uintmax_t)sctx->isc_tx_maxsize, nsegments, 
(uintmax_t)sctx->isc_tx_maxsegsize);
goto fail;
}
-   if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) &&
-   (err = bus_dma_tag_create(bus_get_dma_tag(dev),
+   tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0;
+   if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev),
   1, 0,/* alignment, bounds */
   BUS_SPACE_MAXADDR,   /* lowaddr */
   BUS_SPACE_MAXADDR,   /* highaddr */
@@ -1631,7 +1635,6 @@ iflib_txsd_alloc(iflib_txq_t txq)
   NULL,/* lockfuncarg */
   >ift_tso_desc_tag))) {
device_printf(dev,"Unable to allocate TX TSO DMA tag: %d\n", 
err);
-
goto fail;
}
if (!(txq->ift_sds.ifsd_m =
@@ -1643,19 +1646,38 @@ iflib_txsd_alloc(iflib_txq_t txq)
}
 
 /* Create the descriptor buffer dma maps */
-   if (!(txq->ift_sds.ifsd_map =
-   (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * 
scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) {
+   if ((txq->ift_sds.ifsd_map = (bus_dmamap_t *)malloc(
+   sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset],
+   M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) {
device_printf(dev, "Unable to allocate tx_buffer map memory\n");
err = ENOMEM;
goto fail;
}
 
+   if (tso && (txq->ift_sds.ifsd_tso_map = (bus_dmamap_t *)malloc(
+   sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset],
+   M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) {
+   device_printf(dev, "Unable to allocate TSO tx_buffer "
+   "map memory\n");
+   err = ENOMEM;
+   goto fail;
+   }
+
for (int i = 0; i < scctx->isc_ntxd[txq->ift_br_offset]; i++) {
-   err = bus_dmamap_create(txq->ift_desc_tag, 0, 
>ift_sds.ifsd_map[i]);
+   err = bus_dmamap_create(txq->ift_desc_tag, 0,
+   >ift_sds.ifsd_map[i]);
if (err != 0) {
device_printf(dev, "Unable to create TX DMA map\n");
goto fail;
}
+   if (!tso)
+   continue;
+   err = bus_dmamap_create(txq->ift_tso_desc_tag, 0,
+   >ift_sds.ifsd_tso_map[i]);
+   if (err != 0) {
+   device_printf(dev, "Unable to create TSO TX DMA map\n");
+   goto fail;
+   }
}
return (0);
 fail:
@@ -1673,10 +1695,22 @@ iflib_txsd_destroy(if_ctx_t ctx, iflib_txq_t txq, int 
if (txq->ift_sds.ifsd_map != NULL)
map = txq->ift_sds.ifsd_map[i];
if (map != NULL) {

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

2019-01-15 Thread Kristof Provost
Author: kp
Date: Wed Jan 16 05:17:27 2019
New Revision: 343084
URL: https://svnweb.freebsd.org/changeset/base/343084

Log:
  MFC r342591,342599:
  
  Make kernel print jail ID when logging a process exit
  
  Kernel now includes jail ID when logging a process exit. jid is 0 for unjailed
  processes.
  
  Submitted by: Marie Helene Kvello-Aune 
  Relnotes: yes
  Sponsored by: Modirum MDPay

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

Modified: stable/11/sys/kern/kern_sig.c
==
--- stable/11/sys/kern/kern_sig.c   Wed Jan 16 05:17:24 2019
(r343083)
+++ stable/11/sys/kern/kern_sig.c   Wed Jan 16 05:17:27 2019
(r343084)
@@ -3109,8 +3109,9 @@ killproc(struct proc *p, char *why)
PROC_LOCK_ASSERT(p, MA_OWNED);
CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid,
p->p_comm);
-   log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid,
-   p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why);
+   log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n",
+   p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id,
+   p->p_ucred ? p->p_ucred->cr_uid : -1, why);
proc_wkilled(p);
kern_psignal(p, SIGKILL);
 }
@@ -3152,8 +3153,9 @@ sigexit(struct thread *td, int sig)
sig |= WCOREFLAG;
if (kern_logsigexit)
log(LOG_INFO,
-   "pid %d (%s), uid %d: exited on signal %d%s\n",
-   p->p_pid, p->p_comm,
+   "pid %d (%s), jid %d, uid %d: exited on "
+   "signal %d%s\n", p->p_pid, p->p_comm,
+   p->p_ucred->cr_prison->pr_id,
td->td_ucred ? td->td_ucred->cr_uid : -1,
sig &~ WCOREFLAG,
sig & WCOREFLAG ? " (core dumped)" : "");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343083 - stable/12/sys/kern

2019-01-15 Thread Kristof Provost
Author: kp
Date: Wed Jan 16 05:17:24 2019
New Revision: 343083
URL: https://svnweb.freebsd.org/changeset/base/343083

Log:
  MFC r342591,342599:
  
  Make kernel print jail ID when logging a process exit
  
  Kernel now includes jail ID when logging a process exit. jid is 0 for unjailed
  processes.
  
  Submitted by: Marie Helene Kvello-Aune 
  Relnotes: yes
  Sponsored by: Modirum MDPay

Modified:
  stable/12/sys/kern/kern_sig.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_sig.c
==
--- stable/12/sys/kern/kern_sig.c   Wed Jan 16 05:15:57 2019
(r343082)
+++ stable/12/sys/kern/kern_sig.c   Wed Jan 16 05:17:24 2019
(r343083)
@@ -3098,8 +3098,9 @@ killproc(struct proc *p, char *why)
PROC_LOCK_ASSERT(p, MA_OWNED);
CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid,
p->p_comm);
-   log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid,
-   p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why);
+   log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n",
+   p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id,
+   p->p_ucred ? p->p_ucred->cr_uid : -1, why);
proc_wkilled(p);
kern_psignal(p, SIGKILL);
 }
@@ -3142,8 +3143,9 @@ sigexit(struct thread *td, int sig)
sig |= WCOREFLAG;
if (kern_logsigexit)
log(LOG_INFO,
-   "pid %d (%s), uid %d: exited on signal %d%s\n",
-   p->p_pid, p->p_comm,
+   "pid %d (%s), jid %d, uid %d: exited on "
+   "signal %d%s\n", p->p_pid, p->p_comm,
+   p->p_ucred->cr_prison->pr_id,
td->td_ucred ? td->td_ucred->cr_uid : -1,
sig &~ WCOREFLAG,
sig & WCOREFLAG ? " (core dumped)" : "");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343082 - in head: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm

2019-01-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jan 16 05:15:57 2019
New Revision: 343082
URL: https://svnweb.freebsd.org/changeset/base/343082

Log:
  Implement shmat(2) flag SHM_REMAP.
  
  Based on the description in Linux man page.
  
  Reviewed by:  markj, ngie (previous version)
  Sponsored by: Mellanox Technologies
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D18837

Modified:
  head/contrib/netbsd-tests/kernel/t_sysv.c
  head/lib/libc/sys/shmat.2
  head/sys/kern/sysv_shm.c
  head/sys/sys/shm.h
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h

Modified: head/contrib/netbsd-tests/kernel/t_sysv.c
==
--- head/contrib/netbsd-tests/kernel/t_sysv.c   Wed Jan 16 05:09:29 2019
(r343081)
+++ head/contrib/netbsd-tests/kernel/t_sysv.c   Wed Jan 16 05:15:57 2019
(r343082)
@@ -47,6 +47,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -772,19 +773,27 @@ ATF_TC_BODY(shm, tc)
atf_tc_fail("sender: received unexpected signal");
 }
 
-ATF_TC_CLEANUP(shm, tc)
+static void
+shmid_cleanup(const char *name)
 {
-   int sender_shmid;
+   int shmid;
 
/*
 * Remove the shared memory area if it exists.
 */
-   sender_shmid = read_int("sender_shmid");
-   if (sender_shmid != -1)
-   if (shmctl(sender_shmid, IPC_RMID, NULL) == -1)
+   shmid = read_int(name);
+   if (shmid != -1) {
+   if (shmctl(shmid, IPC_RMID, NULL) == -1)
err(1, "shmctl IPC_RMID");
+   }
 }
 
+ATF_TC_CLEANUP(shm, tc)
+{
+
+   shmid_cleanup("sender_shmid");
+}
+
 void
 print_shmid_ds(struct shmid_ds *sp, mode_t mode)
 {
@@ -837,12 +846,53 @@ sharer(void)
exit(0);
 }
 
+#ifdef SHM_REMAP
+ATF_TC_WITH_CLEANUP(shm_remap);
+ATF_TC_HEAD(shm_remap, tc)
+{
+
+   atf_tc_set_md_var(tc, "descr", "Checks SHM_REMAP");
+}
+
+ATF_TC_BODY(shm_remap, tc)
+{
+   char *shm_buf;
+   int shmid_remap;
+
+   pgsize = sysconf(_SC_PAGESIZE);
+
+   shmkey = get_ftok(4160);
+   ATF_REQUIRE_MSG(shmkey != (key_t)-1, "get_ftok failed");
+
+   ATF_REQUIRE_MSG((shmid_remap = shmget(shmkey, pgsize,
+   IPC_CREAT | 0640)) != -1, "shmget: %d", errno);
+   write_int("shmid_remap", shmid_remap);
+
+   ATF_REQUIRE_MSG((shm_buf = mmap(NULL, pgsize, PROT_READ | PROT_WRITE,
+   MAP_ANON | MAP_PRIVATE, -1, 0)) != MAP_FAILED, "mmap: %d", errno);
+
+   ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, 0) == (void *)-1,
+   "shmat without MAP_REMAP succeeded");
+   ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, SHM_REMAP) == shm_buf,
+   "shmat(SHM_REMAP): %d", errno);
+}
+
+ATF_TC_CLEANUP(shm_remap, tc)
+{
+
+   shmid_cleanup("shmid_remap");
+}
+#endif /* SHM_REMAP */
+
 ATF_TP_ADD_TCS(tp)
 {
 
ATF_TP_ADD_TC(tp, msg);
ATF_TP_ADD_TC(tp, sem);
ATF_TP_ADD_TC(tp, shm);
+#ifdef SHM_REMAP
+   ATF_TP_ADD_TC(tp, shm_remap);
+#endif
 
return atf_no_error();
 }

Modified: head/lib/libc/sys/shmat.2
==
--- head/lib/libc/sys/shmat.2   Wed Jan 16 05:09:29 2019(r343081)
+++ head/lib/libc/sys/shmat.2   Wed Jan 16 05:15:57 2019(r343082)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2018
+.Dd January 14, 2019
 .Dt SHMAT 2
 .Os
 .Sh NAME
@@ -64,17 +64,38 @@ kernel.
 .It
 If
 .Fa addr
-is nonzero and SHM_RND is not specified in
+is nonzero and
+.Va SHM_RND
+is not specified in
 .Fa flag ,
 the segment is attached the specified address.
 .It
 If
 .Fa addr
-is specified and SHM_RND is specified,
+is specified and
+.Va SHM_RND
+is specified,
 .Fa addr
 is rounded down to the nearest multiple of SHMLBA.
 .El
 .Pp
+If the
+.Va SHM_REMAP
+flag is specified and the passed
+.Fa addr
+is not
+.Dv NULL ,
+any existing mappings in the virtual addresses range are
+cleared before the segment is attached.
+If the flag is not specified,
+.Fa addr
+is not
+.Dv NULL ,
+and the virtual address range contains
+some pre-existing mappings, the
+.Fn shmat
+call fails.
+.Pp
 The
 .Fn shmdt
 system call
@@ -104,6 +125,14 @@ The
 .Fa addr
 argument
 was not an acceptable address.
+.It Bq Er ENOMEM
+The specified
+.Fa addr
+cannot be used for mapping, for instance due to the amount of available
+space being smaller than the segment size,
+or because pre-existing mappings are in the range and no
+.Va SHM_REMAP
+flag was provided.
 .It Bq Er EMFILE
 Failed to attach the shared memory segment because the per-process
 .Va kern.ipc.shmseg

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cWed Jan 16 05:09:29 2019(r343081)
+++ head/sys/kern/sysv_shm.cWed Jan 16 05:15:57 2019(r343082)
@@ -388,7 +388,7 @@ kern_shmat_locked(struct thread *td, int shmid, const 
vm_offset_t 

svn commit: r343081 - head/contrib/netbsd-tests/kernel

2019-01-15 Thread Konstantin Belousov
Author: kib
Date: Wed Jan 16 05:09:29 2019
New Revision: 343081
URL: https://svnweb.freebsd.org/changeset/base/343081

Log:
  Trim spaces at the end of lines.
  
  Reviewed by:  markj, ngie
  Sponsored by: Mellanox Technologies
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D18837

Modified:
  head/contrib/netbsd-tests/kernel/t_sysv.c

Modified: head/contrib/netbsd-tests/kernel/t_sysv.c
==
--- head/contrib/netbsd-tests/kernel/t_sysv.c   Wed Jan 16 04:02:08 2019
(r343080)
+++ head/contrib/netbsd-tests/kernel/t_sysv.c   Wed Jan 16 05:09:29 2019
(r343081)
@@ -840,9 +840,9 @@ sharer(void)
 ATF_TP_ADD_TCS(tp)
 {
 
-   ATF_TP_ADD_TC(tp, msg); 
-   ATF_TP_ADD_TC(tp, sem); 
-   ATF_TP_ADD_TC(tp, shm); 
+   ATF_TP_ADD_TC(tp, msg);
+   ATF_TP_ADD_TC(tp, sem);
+   ATF_TP_ADD_TC(tp, shm);
 
return atf_no_error();
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343080 - head/sys/vm

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Wed Jan 16 04:02:08 2019
New Revision: 343080
URL: https://svnweb.freebsd.org/changeset/base/343080

Log:
  Whitespace.

Modified:
  head/sys/vm/uma_int.h

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Wed Jan 16 04:01:30 2019(r343079)
+++ head/sys/vm/uma_int.h   Wed Jan 16 04:02:08 2019(r343080)
@@ -365,7 +365,7 @@ struct uma_zone {
uint16_tuz_count_min;   /* Minimal amount of items in bucket */
 
/* Offset 256, stats. */
-   counter_u64_t   uz_allocs; /* Total number of allocations */
+   counter_u64_t   uz_allocs;  /* Total number of allocations */
counter_u64_t   uz_frees;   /* Total number of frees */
counter_u64_t   uz_fails;   /* Total number of alloc failures */
uint64_tuz_sleeps;  /* Total number of alloc sleeps */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343079 - stable/11/contrib/file/magic/Magdir

2019-01-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jan 16 04:01:30 2019
New Revision: 343079
URL: https://svnweb.freebsd.org/changeset/base/343079

Log:
  MFC r335675:
  
  Fix file(1) dumpdate reporting for dump(8) files
  
  Magic file for dump(8) had this dump and previous dump dates reversed.
  Fix order for all three flavours of the dump(8) format.
  This fix was committed to upstream repo as magic/Magdir/dump,v 1.17
  and will be merged during next vendor import.
  
  PR:   223155

Modified:
  stable/11/contrib/file/magic/Magdir/dump

Modified: stable/11/contrib/file/magic/Magdir/dump
==
--- stable/11/contrib/file/magic/Magdir/dumpWed Jan 16 03:52:43 2019
(r343078)
+++ stable/11/contrib/file/magic/Magdir/dumpWed Jan 16 04:01:30 2019
(r343079)
@@ -6,8 +6,8 @@
 # We specify both byte orders in order to recognize byte-swapped dumps.
 #
 0  namenew-dump-be
->4 bedate  x   Previous dump %s,
->8 bedate  x   This dump %s,
+>4 bedate  x   This dump %s,
+>8 bedate  x   Previous dump %s,
 >12belong  >0  Volume %d,
 >692   belong  0   Level zero, type:
 >692   belong  >0  Level %d, type:
@@ -25,8 +25,8 @@
 >888   belong  >0  Flags %x
 
 0  nameold-dump-be
-#>4bedate  x   Previous dump %s,
-#>8bedate  x   This dump %s,
+#>4bedate  x   This dump %s,
+#>8bedate  x   Previous dump %s,
 >12belong  >0  Volume %d,
 >692   belong  0   Level zero, type:
 >692   belong  >0  Level %d, type:
@@ -44,8 +44,8 @@
 >888   belong  >0  Flags %x
 
 0  nameufs2-dump-be
->896   beqdate x   Previous dump %s,
->904   beqdate x   This dump %s,
+>896   beqdate x   This dump %s,
+>904   beqdate x   Previous dump %s,
 >12belong  >0  Volume %d,
 >692   belong  0   Level zero, type:
 >692   belong  >0  Level %d, type:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343078 - head/sys/powerpc/fpu

2019-01-15 Thread Justin Hibbits
Author: jhibbits
Date: Wed Jan 16 03:52:43 2019
New Revision: 343078
URL: https://svnweb.freebsd.org/changeset/base/343078

Log:
  powerpc: Fix FPU fsqrt emulation special case results
  
  If fsqrts is emulated with +INF as its argument, the 0 return value causes a
  NULL pointer dereference, panicking the system.  Follow the PowerISA and
  return +INF with no FP exception.
  
  MFC after:1 week

Modified:
  head/sys/powerpc/fpu/fpu_sqrt.c

Modified: head/sys/powerpc/fpu/fpu_sqrt.c
==
--- head/sys/powerpc/fpu/fpu_sqrt.c Wed Jan 16 03:46:27 2019
(r343077)
+++ head/sys/powerpc/fpu/fpu_sqrt.c Wed Jan 16 03:52:43 2019
(r343078)
@@ -226,12 +226,12 @@ fpu_sqrt(struct fpemu *fe)
return (x);
}
if (x->fp_sign) {
+   fe->fe_cx |= FPSCR_VXSQRT;
return (fpu_newnan(fe));
}
if (ISINF(x)) {
-   fe->fe_cx |= FPSCR_VXSQRT;
-   DUMPFPN(FPE_REG, 0);
-   return (0);
+   DUMPFPN(FPE_REG, x);
+   return (x);
}
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343077 - head/usr.sbin/bhyve

2019-01-15 Thread Marcelo Araujo
Author: araujo
Date: Wed Jan 16 03:46:27 2019
New Revision: 343077
URL: https://svnweb.freebsd.org/changeset/base/343077

Log:
  Fix broken uart on Win2016 guest.
  
  Obtained from:Joyent (commit/2bf1a940afbd1382faff159e7c93c72779ca10f4)
  MFC after:3 weeks.

Modified:
  head/usr.sbin/bhyve/uart_emul.c

Modified: head/usr.sbin/bhyve/uart_emul.c
==
--- head/usr.sbin/bhyve/uart_emul.c Wed Jan 16 03:07:32 2019
(r343076)
+++ head/usr.sbin/bhyve/uart_emul.c Wed Jan 16 03:46:27 2019
(r343077)
@@ -431,6 +431,13 @@ uart_write(struct uart_softc *sc, int offset, uint8_t 
sc->thre_int_pending = true;
break;
case REG_IER:
+   /* Assert an interrupt if re-enabling the THRE intr, since we
+* always report THRE as active in the status register.
+*/
+   if ((sc->ier & IER_ETXRDY) == 0 &&
+   (value & IER_ETXRDY) != 0) {
+   sc->thre_int_pending = true;
+   }
/*
 * Apply mask so that bits 4-7 are 0
 * Also enables bits 0-3 only if they're 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343076 - in stable: 11/sys/net 12/sys/net

2019-01-15 Thread Mark Johnston
Author: markj
Date: Wed Jan 16 03:07:32 2019
New Revision: 343076
URL: https://svnweb.freebsd.org/changeset/base/343076

Log:
  MFC r342887:
  Stop setting if_linkmib in vlan(4) ifnets.
  
  PR:   219472

Modified:
  stable/12/sys/net/if_vlan.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/net/if_vlan.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/net/if_vlan.c
==
--- stable/12/sys/net/if_vlan.c Wed Jan 16 02:19:04 2019(r343075)
+++ stable/12/sys/net/if_vlan.c Wed Jan 16 03:07:32 2019(r343076)
@@ -156,7 +156,7 @@ struct vlan_mc_entry {
struct epoch_contextmc_epoch_ctx;
 };
 
-struct ifvlan {
+struct ifvlan {
struct  ifvlantrunk *ifv_trunk;
struct  ifnet *ifv_ifp;
 #defineTRUNK(ifv)  ((ifv)->ifv_trunk)
@@ -164,28 +164,19 @@ structifvlan {
void*ifv_cookie;
int ifv_pflags; /* special flags we have set on parent */
int ifv_capenable;
-   struct  ifv_linkmib {
-   int ifvm_encaplen;  /* encapsulation length */
-   int ifvm_mtufudge;  /* MTU fudged by this much */
-   int ifvm_mintu; /* min transmission unit */
-   uint16_t ifvm_proto;/* encapsulation ethertype */
-   uint16_t ifvm_tag;  /* tag to apply on packets leaving if */
-   uint16_t ifvm_vid;  /* VLAN ID */
-   uint8_t ifvm_pcp;   /* Priority Code Point (PCP). */
-   }   ifv_mib;
+   int ifv_encaplen;   /* encapsulation length */
+   int ifv_mtufudge;   /* MTU fudged by this much */
+   int ifv_mintu;  /* min transmission unit */
+   uint16_t ifv_proto; /* encapsulation ethertype */
+   uint16_t ifv_tag;   /* tag to apply on packets leaving if */
+   uint16_t ifv_vid;   /* VLAN ID */
+   uint8_t ifv_pcp;/* Priority Code Point (PCP). */
struct task lladdr_task;
CK_SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead;
 #ifndef VLAN_ARRAY
CK_SLIST_ENTRY(ifvlan) ifv_list;
 #endif
 };
-#defineifv_proto   ifv_mib.ifvm_proto
-#defineifv_tag ifv_mib.ifvm_tag
-#defineifv_vid ifv_mib.ifvm_vid
-#defineifv_pcp ifv_mib.ifvm_pcp
-#defineifv_encaplenifv_mib.ifvm_encaplen
-#defineifv_mtufudgeifv_mib.ifvm_mtufudge
-#defineifv_mintu   ifv_mib.ifvm_mintu
 
 /* Special flags we should propagate to parent. */
 static struct {
@@ -1053,10 +1044,6 @@ vlan_clone_create(struct if_clone *ifc, char *name, si
strlcpy(ifp->if_xname, name, IFNAMSIZ);
ifp->if_dname = vlanname;
ifp->if_dunit = unit;
-   /* NB: flags are not set here */
-   ifp->if_linkmib = >ifv_mib;
-   ifp->if_linkmiblen = sizeof(ifv->ifv_mib);
-   /* NB: mtu is not set here */
 
ifp->if_init = vlan_init;
ifp->if_transmit = vlan_transmit;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343076 - in stable: 11/sys/net 12/sys/net

2019-01-15 Thread Mark Johnston
Author: markj
Date: Wed Jan 16 03:07:32 2019
New Revision: 343076
URL: https://svnweb.freebsd.org/changeset/base/343076

Log:
  MFC r342887:
  Stop setting if_linkmib in vlan(4) ifnets.
  
  PR:   219472

Modified:
  stable/11/sys/net/if_vlan.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/net/if_vlan.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/net/if_vlan.c
==
--- stable/11/sys/net/if_vlan.c Wed Jan 16 02:19:04 2019(r343075)
+++ stable/11/sys/net/if_vlan.c Wed Jan 16 03:07:32 2019(r343076)
@@ -154,7 +154,7 @@ struct vlan_mc_entry {
SLIST_ENTRY(vlan_mc_entry)  mc_entries;
 };
 
-struct ifvlan {
+struct ifvlan {
struct  ifvlantrunk *ifv_trunk;
struct  ifnet *ifv_ifp;
 #defineTRUNK(ifv)  ((ifv)->ifv_trunk)
@@ -162,28 +162,19 @@ structifvlan {
void*ifv_cookie;
int ifv_pflags; /* special flags we have set on parent */
int ifv_capenable;
-   struct  ifv_linkmib {
-   int ifvm_encaplen;  /* encapsulation length */
-   int ifvm_mtufudge;  /* MTU fudged by this much */
-   int ifvm_mintu; /* min transmission unit */
-   uint16_t ifvm_proto;/* encapsulation ethertype */
-   uint16_t ifvm_tag;  /* tag to apply on packets leaving if */
-   uint16_t ifvm_vid;  /* VLAN ID */
-   uint8_t ifvm_pcp;   /* Priority Code Point (PCP). */
-   }   ifv_mib;
+   int ifv_encaplen;   /* encapsulation length */
+   int ifv_mtufudge;   /* MTU fudged by this much */
+   int ifv_mintu;  /* min transmission unit */
+   uint16_t ifv_proto; /* encapsulation ethertype */
+   uint16_t ifv_tag;   /* tag to apply on packets leaving if */
+   uint16_t ifv_vid;   /* VLAN ID */
+   uint8_t ifv_pcp;/* Priority Code Point (PCP). */
struct task lladdr_task;
SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead;
 #ifndef VLAN_ARRAY
LIST_ENTRY(ifvlan) ifv_list;
 #endif
 };
-#defineifv_proto   ifv_mib.ifvm_proto
-#defineifv_tag ifv_mib.ifvm_tag
-#defineifv_vid ifv_mib.ifvm_vid
-#defineifv_pcp ifv_mib.ifvm_pcp
-#defineifv_encaplenifv_mib.ifvm_encaplen
-#defineifv_mtufudgeifv_mib.ifvm_mtufudge
-#defineifv_mintu   ifv_mib.ifvm_mintu
 
 /* Special flags we should propagate to parent. */
 static struct {
@@ -1067,10 +1058,6 @@ vlan_clone_create(struct if_clone *ifc, char *name, si
strlcpy(ifp->if_xname, name, IFNAMSIZ);
ifp->if_dname = vlanname;
ifp->if_dunit = unit;
-   /* NB: flags are not set here */
-   ifp->if_linkmib = >ifv_mib;
-   ifp->if_linkmiblen = sizeof(ifv->ifv_mib);
-   /* NB: mtu is not set here */
 
ifp->if_init = vlan_init;
ifp->if_transmit = vlan_transmit;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343075 - in head/sys: amd64/vmm x86/x86

2019-01-15 Thread Conrad Meyer
Author: cem
Date: Wed Jan 16 02:19:04 2019
New Revision: 343075
URL: https://svnweb.freebsd.org/changeset/base/343075

Log:
  vmm(4): Take steps towards multicore bhyve AMD support
  
  vmm's CPUID emulation presented Intel topology information to the guest, but
  disabled AMD topology information and in some cases passed through garbage.
  I.e., CPUID leaves 0x8000_001[de] were passed through to the guest, but
  guest CPUs can migrate between host threads, so the information presented
  was not consistent.  This could easily be observed with 'cpucontrol -i 0xfoo
  /dev/cpuctl0'.
  
  Slightly improve this situation by enabling the AMD topology feature flag
  and presenting at least the CPUID fields used by FreeBSD itself to probe
  topology on more modern AMD64 hardware (Family 15h+).  Older stuff is
  probably less interesting.  I have not been able to empirically confirm it
  is sufficient, but it should not regress anything either.
  
  Reviewed by:  araujo (previous version)
  Relnotes: sure

Modified:
  head/sys/amd64/vmm/x86.c
  head/sys/amd64/vmm/x86.h
  head/sys/x86/x86/mp_x86.c

Modified: head/sys/amd64/vmm/x86.c
==
--- head/sys/amd64/vmm/x86.cWed Jan 16 02:13:21 2019(r343074)
+++ head/sys/amd64/vmm/x86.cWed Jan 16 02:19:04 2019(r343075)
@@ -136,18 +136,23 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
case CPUID_8000_0008:
cpuid_count(*eax, *ecx, regs);
if (vmm_is_amd()) {
+   vm_get_topology(vm, , , ,
+   );
/*
-* XXX this might appear silly because AMD
-* cpus don't have threads.
+* Here, width is ApicIdCoreIdSize, present on
+* at least Family 15h and newer.  It
+* represents the "number of bits in the
+* initial apicid that indicate thread id
+* within a package."
 *
-* However this matches the logical cpus as
-* advertised by leaf 0x1 and will work even
-* if threads is set incorrectly on an AMD host.
+* Our topo_probe_amd() uses it for
+* pkg_id_shift and other OSes may rely on it.
 */
-   vm_get_topology(vm, , , ,
-   );
-   logical_cpus = threads * cores;
-   regs[2] = logical_cpus - 1;
+   width = MIN(0xF, log2(threads * cores));
+   if (width < 0x4)
+   width = 0;
+   logical_cpus = MIN(0xFF, threads * cores - 1);
+   regs[2] = (width << AMDID_COREID_SIZE_SHIFT) | 
logical_cpus;
}
break;
 
@@ -155,9 +160,9 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
cpuid_count(*eax, *ecx, regs);
 
/*
-* Hide SVM and Topology Extension features from guest.
+* Hide SVM from guest.
 */
-   regs[2] &= ~(AMDID2_SVM | AMDID2_TOPOLOGY);
+   regs[2] &= ~AMDID2_SVM;
 
/*
 * Don't advertise extended performance counter MSRs
@@ -219,6 +224,68 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
regs[3] |= AMDPM_TSC_INVARIANT;
break;
 
+   case CPUID_8000_001D:
+   /* AMD Cache topology, like _0004 for Intel. */
+   if (!vmm_is_amd())
+   goto default_leaf;
+
+   /*
+* Similar to Intel, generate a ficticious cache
+* topology for the guest with L3 shared by the
+* package, and L1 and L2 local to a core.
+*/
+   vm_get_topology(vm, , , ,
+   );
+   switch (*ecx) {
+   case 0:
+   logical_cpus = threads;
+   level = 1;
+   func = 1;   /* data cache */
+   break;
+   case 1:
+   logical_cpus = threads;
+   level = 2;
+   func = 3;   /* unified cache */
+  

svn commit: r343074 - in head/sys: contrib/ena-com dev/ena

2019-01-15 Thread Marcin Wojtas
Author: mw
Date: Wed Jan 16 02:13:21 2019
New Revision: 343074
URL: https://svnweb.freebsd.org/changeset/base/343074

Log:
  Suppress excessive error prints in ENA TX hotpath
  
  In FreeBSD, this is normal situation that the Tx ring is being full. In
  hat case, the packet is put back into drbr and the next attempt to send
  it is taken after the cleanup.
  
  Too much logs like this can cause system instability and even cause the
  device reset (because keep alive or cleanup could be missed).
  
  To fix that, the log level of this message is changed to debug.
  
  Upon this change upgrade the driver version to v0.8.2.
  
  Submitted by: Michal Krawczyk 
  Obtained from: Semihalf
  Sponsored by: Amazon, Inc.

Modified:
  head/sys/contrib/ena-com/ena_eth_com.c
  head/sys/dev/ena/ena.c
  head/sys/dev/ena/ena.h
Directory Properties:
  head/sys/contrib/ena-com/   (props changed)

Modified: head/sys/contrib/ena-com/ena_eth_com.c
==
--- head/sys/contrib/ena-com/ena_eth_com.c  Wed Jan 16 02:05:42 2019
(r343073)
+++ head/sys/contrib/ena-com/ena_eth_com.c  Wed Jan 16 02:13:21 2019
(r343074)
@@ -386,7 +386,7 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
 
/* num_bufs +1 for potential meta desc */
if (!ena_com_sq_have_enough_space(io_sq, num_bufs + 1)) {
-   ena_trc_err("Not enough space in the tx queue\n");
+   ena_trc_dbg("Not enough space in the tx queue\n");
return ENA_COM_NO_MEM;
}
 

Modified: head/sys/dev/ena/ena.c
==
--- head/sys/dev/ena/ena.c  Wed Jan 16 02:05:42 2019(r343073)
+++ head/sys/dev/ena/ena.c  Wed Jan 16 02:13:21 2019(r343074)
@@ -2813,7 +2813,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **
/* Prepare the packet's descriptors and send them to device */
rc = ena_com_prepare_tx(io_sq, _tx_ctx, _hw_desc);
if (unlikely(rc != 0)) {
-   device_printf(adapter->pdev, "failed to prepare tx bufs\n");
+   ena_trace(ENA_DBG | ENA_TXPTH, "failed to prepare tx bufs\n");
counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1);
goto dma_error;
}

Modified: head/sys/dev/ena/ena.h
==
--- head/sys/dev/ena/ena.h  Wed Jan 16 02:05:42 2019(r343073)
+++ head/sys/dev/ena/ena.h  Wed Jan 16 02:13:21 2019(r343074)
@@ -41,7 +41,7 @@
 
 #define DRV_MODULE_VER_MAJOR   0
 #define DRV_MODULE_VER_MINOR   8
-#define DRV_MODULE_VER_SUBMINOR 1
+#define DRV_MODULE_VER_SUBMINOR 2
 
 #define DRV_MODULE_NAME"ena"
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343073 - head/contrib/ipfilter

2019-01-15 Thread Cy Schubert
Author: cy
Date: Wed Jan 16 02:05:42 2019
New Revision: 343073
URL: https://svnweb.freebsd.org/changeset/base/343073

Log:
  Remove an IRIX-only source file.
  
  MFC after:1 week

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


svn commit: r343072 - vendor-sys/ena-com/1.1.4.6

2019-01-15 Thread Marcin Wojtas
Author: mw
Date: Wed Jan 16 01:58:21 2019
New Revision: 343072
URL: https://svnweb.freebsd.org/changeset/base/343072

Log:
  Create 1.1.4.6 tag in ena-com
  
  Tag is added after applying fix to ENA HAL code
  in r343071.
  
  Obtained from: Semihalf
  Sponsored by: Amazon, Inc.

Added:
  vendor-sys/ena-com/1.1.4.6/
 - copied from r343071, vendor-sys/ena-com/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343071 - vendor-sys/ena-com/dist

2019-01-15 Thread Marcin Wojtas
Author: mw
Date: Wed Jan 16 01:54:04 2019
New Revision: 343071
URL: https://svnweb.freebsd.org/changeset/base/343071

Log:
  Suppress excessive print in ENA HAL
  
  In FreeBSD, this is normal situation that the Tx ring is being full. In
  that case, the packet is put back into drbr and the next attempt to send
  it is taken after the cleanup.
  
  Too much logs like this can cause system instability and even cause the
  device reset (because keep alive or cleanup could be missed).
  
  To fix that, the log level of this message is changed to debug.
  
  Submitted by: Michal Krawczyk 
  Obtained from: Semihalf
  Sponsored by: Amazon, Inc.

Modified:
  vendor-sys/ena-com/dist/ena_eth_com.c

Modified: vendor-sys/ena-com/dist/ena_eth_com.c
==
--- vendor-sys/ena-com/dist/ena_eth_com.c   Wed Jan 16 01:32:42 2019
(r343070)
+++ vendor-sys/ena-com/dist/ena_eth_com.c   Wed Jan 16 01:54:04 2019
(r343071)
@@ -386,7 +386,7 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
 
/* num_bufs +1 for potential meta desc */
if (!ena_com_sq_have_enough_space(io_sq, num_bufs + 1)) {
-   ena_trc_err("Not enough space in the tx queue\n");
+   ena_trc_dbg("Not enough space in the tx queue\n");
return ENA_COM_NO_MEM;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343070 - stable/12/release/tools

2019-01-15 Thread Colin Percival
Author: cperciva
Date: Wed Jan 16 01:32:42 2019
New Revision: 343070
URL: https://svnweb.freebsd.org/changeset/base/343070

Log:
  MFC r342875: Turn off ec2_ephemeralswap for now
  
  PR:   234686

Modified:
  stable/12/release/tools/ec2.conf
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/release/tools/ec2.conf
==
--- stable/12/release/tools/ec2.confWed Jan 16 01:08:34 2019
(r343069)
+++ stable/12/release/tools/ec2.confWed Jan 16 01:32:42 2019
(r343070)
@@ -9,7 +9,7 @@
 export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient amazon-ssm-agent"
 
 # Set to a list of third-party software to enable in rc.conf(5).
-export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap 
ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd"
+export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey 
firstboot_freebsd_update firstboot_pkgs ntpd"
 
 # Build with a 3 GB UFS partition; the growfs rc.d script will expand
 # the partition to fill the root disk after the EC2 instance is launched.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343069 - in head/sys: arm64/conf dts/arm/overlays dts/arm64/overlays modules/dtb/rpi

2019-01-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jan 16 01:08:34 2019
New Revision: 343069
URL: https://svnweb.freebsd.org/changeset/base/343069

Log:
  [rpi] Reorganize spigen(4) overlays for Raspberry Pi
  
  - Remove CS=2 entry from spigen-rpi2 since it didn't work
  - Add spigen-rpi3 overlay for Raspberry Pi 3
  - Enable rpi overlay modules for GENERIC kernel on aarch64
  
  PR:   233489
  Submitted by: b...@mrp3.com
  Reviewed by:  db
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D16088

Added:
  head/sys/dts/arm64/overlays/spigen-rpi3.dtso   (contents, props changed)
Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/dts/arm/overlays/spigen-rpi2.dtso
  head/sys/modules/dtb/rpi/Makefile

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Wed Jan 16 00:39:23 2019(r343068)
+++ head/sys/arm64/conf/GENERIC Wed Jan 16 01:08:34 2019(r343069)
@@ -296,4 +296,4 @@ options FDT
 device acpi
 
 # DTBs
-makeoptionsMODULES_EXTRA="dtb/allwinner dtb/rockchip"
+makeoptionsMODULES_EXTRA="dtb/allwinner dtb/rockchip dtb/rpi"

Modified: head/sys/dts/arm/overlays/spigen-rpi2.dtso
==
--- head/sys/dts/arm/overlays/spigen-rpi2.dtso  Wed Jan 16 00:39:23 2019
(r343068)
+++ head/sys/dts/arm/overlays/spigen-rpi2.dtso  Wed Jan 16 01:08:34 2019
(r343069)
@@ -12,6 +12,7 @@
spigen0: spigen0 {
compatible = "freebsd,spigen";
reg = <0>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
status = "okay";
};
spigen1: spigen1 {
@@ -20,20 +21,10 @@
spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
status = "okay";
};
-   spigen2: spigen2 {
-   compatible = "freebsd,spigen";
-   reg = <2>;
-   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
-   status = "okay";
-   };
 };
 
 &{/soc/gpio@7e20/spi0_cs_pins} {
-   brcm,pins = <8 7 16>;
+   brcm,pins = <8 7>;
brcm,function = <4>; /* ALT0 */
-};
-
-&{/soc/gpio@7e20/spi0_gpio7} {
-   brcm,pins = <7 8 16 9 10 11>;
 };
 

Added: head/sys/dts/arm64/overlays/spigen-rpi3.dtso
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/overlays/spigen-rpi3.dtsoWed Jan 16 01:08:34 
2019(r343069)
@@ -0,0 +1,30 @@
+/* $FreeBSD$ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+   compatible = "brcm,bcm2837";
+};
+   
+&{/soc/spi@7e204000} {
+   status = "okay";
+   spigen0: spigen0 {
+   compatible = "freebsd,spigen";
+   reg = <0>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
+   status = "okay";
+   };
+   spigen1: spigen1 {
+   compatible = "freebsd,spigen";
+   reg = <1>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
+   status = "okay";
+   };
+};
+
+&{/soc/gpio@7e20/spi0_cs_pins} {
+   brcm,pins = <8 7>;
+   brcm,function = <4>; /* ALT0 */
+};
+

Modified: head/sys/modules/dtb/rpi/Makefile
==
--- head/sys/modules/dtb/rpi/Makefile   Wed Jan 16 00:39:23 2019
(r343068)
+++ head/sys/modules/dtb/rpi/Makefile   Wed Jan 16 01:08:34 2019
(r343069)
@@ -1,7 +1,12 @@
 # $FreeBSD$
 # DTS files for the Raspberry Pi-B
+.if ${MACHINE_ARCH:Marmv[67]*} != ""
 DTSO=  \
spigen-rpi-b.dtso \
-   spigen-rpi2.dtso \
+   spigen-rpi2.dtso
+.elif ${MACHINE_ARCH} == "aarch64"
+DTSO=  \
+   spigen-rpi3.dtso
+.endif
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343068 - head/usr.sbin/bhyve

2019-01-15 Thread Marcelo Araujo
Author: araujo
Date: Wed Jan 16 00:39:23 2019
New Revision: 343068
URL: https://svnweb.freebsd.org/changeset/base/343068

Log:
  Use capsicum_helpers(3) that allow us to simplify the code and its functions
  will return success when the kernel is built without support of
  the capability mode.
  
  It is important to note, that I'm taking a more conservative approach
  with these changes and it will be done in small steps.
  
  Reviewed by:  jhb
  MFC after:6 weeks
  Differential Revision:https://reviews.freebsd.org/D18744

Modified:
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/block_if.c
  head/usr.sbin/bhyve/consport.c
  head/usr.sbin/bhyve/dbgport.c
  head/usr.sbin/bhyve/gdb.c
  head/usr.sbin/bhyve/mevent.c
  head/usr.sbin/bhyve/pci_e82545.c
  head/usr.sbin/bhyve/pci_passthru.c
  head/usr.sbin/bhyve/pci_virtio_console.c
  head/usr.sbin/bhyve/pci_virtio_net.c
  head/usr.sbin/bhyve/pci_virtio_rnd.c
  head/usr.sbin/bhyve/rfb.c
  head/usr.sbin/bhyve/uart_emul.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Tue Jan 15 23:37:49 2019
(r343067)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Jan 16 00:39:23 2019
(r343068)
@@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -949,15 +948,13 @@ do_open(const char *vmname)
 
 #ifndef WITHOUT_CAPSICUM
cap_rights_init(, CAP_IOCTL, CAP_MMAP_RW);
-   if (cap_rights_limit(vm_get_device_fd(ctx), ) == -1 &&
-   errno != ENOSYS)
+   if (caph_rights_limit(vm_get_device_fd(ctx), ) == -1) 
errx(EX_OSERR, "Unable to apply rights for sandbox");
vm_get_ioctls();
cmds = vm_get_ioctls(NULL);
if (cmds == NULL)
errx(EX_OSERR, "out of memory");
-   if (cap_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1 &&
-   errno != ENOSYS)
+   if (caph_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1)
errx(EX_OSERR, "Unable to apply rights for sandbox");
free((cap_ioctl_t *)cmds);
 #endif

Modified: head/usr.sbin/bhyve/block_if.c
==
--- head/usr.sbin/bhyve/block_if.c  Tue Jan 15 23:37:49 2019
(r343067)
+++ head/usr.sbin/bhyve/block_if.c  Wed Jan 16 00:39:23 2019
(r343068)
@@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#ifndef WITHOUT_CAPSICUM
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -473,7 +476,7 @@ blockif_open(const char *optstr, const char *ident)
if (ro)
cap_rights_clear(, CAP_FSYNC, CAP_WRITE);
 
-   if (cap_rights_limit(fd, ) == -1 && errno != ENOSYS)
+   if (caph_rights_limit(fd, ) == -1)
errx(EX_OSERR, "Unable to apply rights for sandbox");
 #endif
 
@@ -504,7 +507,7 @@ blockif_open(const char *optstr, const char *ident)
psectsz = sbuf.st_blksize;
 
 #ifndef WITHOUT_CAPSICUM
-   if (cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS)
+   if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1)
errx(EX_OSERR, "Unable to apply rights for sandbox");
 #endif
 

Modified: head/usr.sbin/bhyve/consport.c
==
--- head/usr.sbin/bhyve/consport.c  Tue Jan 15 23:37:49 2019
(r343067)
+++ head/usr.sbin/bhyve/consport.c  Wed Jan 16 00:39:23 2019
(r343068)
@@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$");
 #endif
 #include 
 
+#ifndef WITHOUT_CAPSICUM
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -138,11 +141,9 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i
 #ifndef WITHOUT_CAPSICUM
cap_rights_init(, CAP_EVENT, CAP_IOCTL, CAP_READ,
CAP_WRITE);
-   if (cap_rights_limit(STDIN_FILENO, ) == -1 &&
-   errno != ENOSYS)
+   if (caph_rights_limit(STDIN_FILENO, ) == -1)
errx(EX_OSERR, "Unable to apply rights for sandbox");
-   if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 &&
-   errno != ENOSYS)
+   if (caph_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1)
errx(EX_OSERR, "Unable to apply rights for sandbox");
 #endif
ttyopen();

Modified: head/usr.sbin/bhyve/dbgport.c
==
--- head/usr.sbin/bhyve/dbgport.c   Tue Jan 15 23:37:49 2019
(r343067)
+++ head/usr.sbin/bhyve/dbgport.c   Wed Jan 16 00:39:23 2019
(r343068)
@@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef WITHOUT_CAPSICUM
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -167,7 +170,7 @@ init_dbgport(int sport)
 
 #ifndef WITHOUT_CAPSICUM

svn commit: r343067 - head/share/mk

2019-01-15 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jan 15 23:37:49 2019
New Revision: 343067
URL: https://svnweb.freebsd.org/changeset/base/343067

Log:
  Fix STAGE_DIR.* to handle indirect *DIR variables.
  
  bsd.{files,conf}.mk recently changed to allow *DIR to name a variable
  rather than a path.
  STAGE_DIR.* need to adapt.
  
  Reviewed by:  bdrewery
  Differential Revision:D18847

Modified:
  head/share/mk/bsd.confs.mk
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.confs.mk
==
--- head/share/mk/bsd.confs.mk  Tue Jan 15 23:35:53 2019(r343066)
+++ head/share/mk/bsd.confs.mk  Tue Jan 15 23:37:49 2019(r343067)
@@ -40,7 +40,6 @@ ${group}GRP?= ${SHAREGRP}
 ${group}MODE?= ${CONFMODE}
 ${group}DIR?=  ${CONFDIR}
 STAGE_SETS+=   ${group:C,[/*],_,g}
-STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
 
 .  if defined(NO_ROOT)
 .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
@@ -65,6 +64,7 @@ DIRS+=${group}DIR
 _${group}DIR=  ${group}DIR
 .  endif
 
+STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}}
 
 .  for cnf in ${${group}}
 ${group}OWN_${cnf}?=   ${${group}OWN}
@@ -119,7 +119,7 @@ INSTALL_COPY=  -C
 STAGE_AS_SETS+= ${cnf:T}
 STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}}
 # XXX {group}OWN,GRP,MODE
-STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}}
+STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${_${group}DIR_${cnf}}}
 stage_as.${cnf:T}: ${cnf}
 
 realinstallconfig: installdirs-${_${group}DIR_${cnf}} _${group}INS_${cnf:T}

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Tue Jan 15 23:35:53 2019(r343066)
+++ head/share/mk/bsd.files.mk  Tue Jan 15 23:37:49 2019(r343067)
@@ -37,7 +37,6 @@ ${group}GRP=  ${SHAREGRP}
 ${group}MODE?= ${SHAREMODE}
 ${group}DIR?=  BINDIR
 STAGE_SETS+=   ${group:C,[/*],_,g}
-STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
 
 .if defined(NO_ROOT)
 .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
@@ -57,6 +56,7 @@ DIRS+=${group}DIR
 _${group}DIR=  ${group}DIR
 .endif
 
+STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}}
 
 .for file in ${${group}}
 ${group}OWN_${file}?=  ${${group}OWN}
@@ -100,7 +100,7 @@ ${group}NAME_${file}?=  ${file:T}
 STAGE_AS_SETS+=${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
 # XXX {group}OWN,GRP,MODE
-STAGE_DIR.${file}= ${STAGE_OBJTOP}${${group}DIR_${file}}
+STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}}
 stage_as.${file}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343066 - head/share/mk

2019-01-15 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jan 15 23:35:53 2019
New Revision: 343066
URL: https://svnweb.freebsd.org/changeset/base/343066

Log:
  Use .undef per variable
  
  Attempting to expand a variable to a list of vars to .undef
  does not actually work.
  
  Reviewed by:  bdrewery
  Differential Revision:D17251

Modified:
  head/share/mk/dirdeps-options.mk

Modified: head/share/mk/dirdeps-options.mk
==
--- head/share/mk/dirdeps-options.mkTue Jan 15 22:31:54 2019
(r343065)
+++ head/share/mk/dirdeps-options.mkTue Jan 15 23:35:53 2019
(r343066)
@@ -1,5 +1,5 @@
 # $FreeBSD$
-# $Id: dirdeps-options.mk,v 1.8 2018/05/29 22:31:21 sjg Exp $
+# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $
 #
 #  @(#) Copyright (c) 2018, Simon J. Gerraty
 #
@@ -54,7 +54,8 @@ DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U}
 DIRDEPS := ${DIRDEPS:O:u}
 # avoid cross contamination
 .for o in ${DIRDEPS_OPTIONS:tu}
-.undef DIRDEPS.$o.yes DIRDEPS.$o.no
+.undef DIRDEPS.$o.yes
+.undef DIRDEPS.$o.no
 .endfor
 .else
 # whether options are enabled or not,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343065 - head/sys/dev/iwm

2019-01-15 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Jan 15 22:31:54 2019
New Revision: 343065
URL: https://svnweb.freebsd.org/changeset/base/343065

Log:
  With the sync from Dragonfly BSD in r318216 a bug slipped in (also still 
present
  upstream it seems).
  
  The tlv variable was changed to a pointer but the advancement of the data 
pointer
  was left as sizeof(tlv).  While the sizeof the (now) pointer equals the
  sizeof 2 x uint32_t (size of the struct) on 64bit platforms, on 32bit 
platforms
  the size of the advancement of the data pointer was wrong leading to
  firmware load issues.
  
  Correctly advance the data pointer by the size of the structure and not by
  the size of a pointer.
  
  PR:   219683
  Submitted by: waddlesplash gamil.com (Haiku) on irc
  MFC after:1 week

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Tue Jan 15 21:43:18 2019(r343064)
+++ head/sys/dev/iwm/if_iwm.c   Tue Jan 15 22:31:54 2019(r343065)
@@ -626,7 +626,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode
goto parse_out;
}
len -= roundup2(tlv_len, 4);
-   data += sizeof(tlv) + roundup2(tlv_len, 4);
+   data += sizeof(*tlv) + roundup2(tlv_len, 4);
 
switch ((int)tlv_type) {
case IWM_UCODE_TLV_PROBE_MAX_LEN:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343064 - stable/12/sys/dev/cxgbe/tom

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 21:43:18 2019
New Revision: 343064
URL: https://svnweb.freebsd.org/changeset/base/343064

Log:
  MFC 340469: Remove bogus roundup2() of the key programming work request 
header.
  
  The key context is always placed immediately after the work request
  header.  The total work request length has to be rounded up by 16
  however.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tls.cTue Jan 15 21:40:51 2019
(r343063)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.cTue Jan 15 21:43:18 2019
(r343064)
@@ -492,9 +492,9 @@ tls_program_key_id(struct toepcb *toep, struct tls_key
struct tls_key_req *kwr;
struct tls_keyctx *kctx;
 
-   kwrlen = roundup2(sizeof(*kwr), 16);
+   kwrlen = sizeof(*kwr);
kctxlen = roundup2(sizeof(*kctx), 32);
-   len = kwrlen + kctxlen;
+   len = roundup2(kwrlen + kctxlen, 16);
 
if (toep->txsd_avail == 0)
return (EAGAIN);
@@ -536,7 +536,6 @@ tls_program_key_id(struct toepcb *toep, struct tls_key
kwr->sc_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM));
kwr->sc_len = htobe32(kctxlen);
 
-   /* XXX: This assumes that kwrlen == sizeof(*kwr). */
kctx = (struct tls_keyctx *)(kwr + 1);
memset(kctx, 0, kctxlen);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343063 - stable/12/sys/dev/cxgbe

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 21:40:51 2019
New Revision: 343063
URL: https://svnweb.freebsd.org/changeset/base/343063

Log:
  MFC 340468: Change the quantum for TLS key addresses to 32 bytes.
  
  The addresses passed when reading and writing keys are always shifted
  right by 5 as the memory locations are addressed in 32-byte chunks, so
  the quantum needs to be 32, not 8.

Modified:
  stable/12/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==
--- stable/12/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:33:26 2019
(r343062)
+++ stable/12/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:40:51 2019
(r343063)
@@ -1153,7 +1153,7 @@ t4_attach(device_t dev)
 #endif
if (sc->vres.key.size != 0)
sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start,
-   sc->vres.key.size, 8, 0, M_FIRSTFIT | M_WAITOK);
+   sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK);
 
/*
 * Second pass over the ports.  This time we know the number of rx and
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343062 - in stable/12/sys/dev/cxgbe: . tom

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 21:33:26 2019
New Revision: 343062
URL: https://svnweb.freebsd.org/changeset/base/343062

Log:
  MFC 340466,340473: Move the TLS key map into the adapter softc.
  
  340466:
  Move the TLS key map into the adapter softc so non-TOE code can use it.
  
  340473:
  Restore the  header to fix build of cxgbe(4) TOM.
  
  vmem's are not just used for TLS memory in TOM and the #include actually
  predates the TLS code so should not have been removed when the TLS vmem
  moved in r340466.

Modified:
  stable/12/sys/dev/cxgbe/adapter.h
  stable/12/sys/dev/cxgbe/t4_main.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
  stable/12/sys/dev/cxgbe/tom/t4_tom.c
  stable/12/sys/dev/cxgbe/tom/t4_tom.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/adapter.h
==
--- stable/12/sys/dev/cxgbe/adapter.h   Tue Jan 15 21:07:40 2019
(r343061)
+++ stable/12/sys/dev/cxgbe/adapter.h   Tue Jan 15 21:33:26 2019
(r343062)
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -823,6 +824,7 @@ struct adapter {
struct l2t_data *l2t;   /* L2 table */
struct smt_data *smt;   /* Source MAC Table */
struct tid_info tids;
+   vmem_t *key_map;
 
uint8_t doorbells;
int offload_map;/* ports with IFCAP_TOE enabled */

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==
--- stable/12/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:07:40 2019
(r343061)
+++ stable/12/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:33:26 2019
(r343062)
@@ -1151,6 +1151,9 @@ t4_attach(device_t dev)
 #ifdef RATELIMIT
t4_init_etid_table(sc);
 #endif
+   if (sc->vres.key.size != 0)
+   sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start,
+   sc->vres.key.size, 8, 0, M_FIRSTFIT | M_WAITOK);
 
/*
 * Second pass over the ports.  This time we know the number of rx and
@@ -1436,6 +1439,8 @@ t4_detach_common(device_t dev)
 #ifdef RATELIMIT
t4_free_etid_table(sc);
 #endif
+   if (sc->key_map)
+   vmem_destroy(sc->key_map);
 
 #if defined(TCP_OFFLOAD) || defined(RATELIMIT)
free(sc->sge.ofld_txq, M_CXGBE);

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tls.cTue Jan 15 21:07:40 2019
(r343061)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.cTue Jan 15 21:33:26 2019
(r343062)
@@ -429,32 +429,13 @@ prepare_txkey_wr(struct tls_keyctx *kwr, struct tls_ke
 }
 
 /* TLS Key memory management */
-int
-tls_init_kmap(struct adapter *sc, struct tom_data *td)
-{
-
-   td->key_map = vmem_create("T4TLS key map", sc->vres.key.start,
-   sc->vres.key.size, 8, 0, M_FIRSTFIT | M_NOWAIT);
-   if (td->key_map == NULL)
-   return (ENOMEM);
-   return (0);
-}
-
-void
-tls_free_kmap(struct tom_data *td)
-{
-
-   if (td->key_map != NULL)
-   vmem_destroy(td->key_map);
-}
-
 static int
 get_new_keyid(struct toepcb *toep, struct tls_key_context *k_ctx)
 {
-   struct tom_data *td = toep->td;
+   struct adapter *sc = td_adapter(toep->td);
vmem_addr_t addr;
 
-   if (vmem_alloc(td->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | M_FIRSTFIT,
+   if (vmem_alloc(sc->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | M_FIRSTFIT,
) != 0)
return (-1);
 
@@ -464,9 +445,9 @@ get_new_keyid(struct toepcb *toep, struct tls_key_cont
 static void
 free_keyid(struct toepcb *toep, int keyid)
 {
-   struct tom_data *td = toep->td;
+   struct adapter *sc = td_adapter(toep->td);
 
-   vmem_free(td->key_map, keyid, TLS_KEY_CONTEXT_SZ);
+   vmem_free(sc->key_map, keyid, TLS_KEY_CONTEXT_SZ);
 }
 
 static void

Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tom.cTue Jan 15 21:07:40 2019
(r343061)
+++ stable/12/sys/dev/cxgbe/tom/t4_tom.cTue Jan 15 21:33:26 2019
(r343062)
@@ -1093,7 +1093,6 @@ free_tom_data(struct adapter *sc, struct tom_data *td)
KASSERT(td->lctx_count == 0,
("%s: lctx hash table is not empty.", __func__));
 
-   tls_free_kmap(td);
t4_free_ppod_region(>pr);
destroy_clip_table(sc, td);
 
@@ -1372,12 +1371,6 @@ t4_tom_activate(struct adapter *sc)
 
/* CLIP table for IPv6 offload */
init_clip_table(sc, td);
-
-   if (sc->vres.key.size != 0) {
-   rc = tls_init_kmap(sc, td);
-   if (rc != 0)
-   goto done;
-   }
 
/* toedev ops */
tod = >tod;

Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.h

svn commit: r343061 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 21:07:40 2019
New Revision: 343061
URL: https://svnweb.freebsd.org/changeset/base/343061

Log:
  MFC 340206: Treat the memory lengths for CHELSIO_T4_GET_MEM as unsigned.
  
  Previously attempts to read the MC region were failing since the
  length was greater than 2^31.

Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:06:58 2019
(r343060)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:07:40 2019
(r343061)
@@ -523,9 +523,9 @@ static inline int read_via_memwin(struct adapter *, in
 int);
 static inline int write_via_memwin(struct adapter *, int, uint32_t,
 const uint32_t *, int);
-static int validate_mem_range(struct adapter *, uint32_t, int);
+static int validate_mem_range(struct adapter *, uint32_t, uint32_t);
 static int fwmtype_to_hwmtype(int);
-static int validate_mt_off_len(struct adapter *, int, uint32_t, int,
+static int validate_mt_off_len(struct adapter *, int, uint32_t, uint32_t,
 uint32_t *);
 static int fixup_devlog_params(struct adapter *);
 static int cfg_itype_and_nqueues(struct adapter *, struct intrs_and_queues *);
@@ -2681,14 +2681,14 @@ t4_range_cmp(const void *a, const void *b)
  * the card's address space.
  */
 static int
-validate_mem_range(struct adapter *sc, uint32_t addr, int len)
+validate_mem_range(struct adapter *sc, uint32_t addr, uint32_t len)
 {
struct t4_range mem_ranges[4], *r, *next;
uint32_t em, addr_len;
int i, n, remaining;
 
/* Memory can only be accessed in naturally aligned 4 byte units */
-   if (addr & 3 || len & 3 || len <= 0)
+   if (addr & 3 || len & 3 || len == 0)
return (EINVAL);
 
/* Enabled memories */
@@ -2827,7 +2827,7 @@ fwmtype_to_hwmtype(int mtype)
  * the start of the range is returned in addr.
  */
 static int
-validate_mt_off_len(struct adapter *sc, int mtype, uint32_t off, int len,
+validate_mt_off_len(struct adapter *sc, int mtype, uint32_t off, uint32_t len,
 uint32_t *addr)
 {
uint32_t em, addr_len, maddr;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343061 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 21:07:40 2019
New Revision: 343061
URL: https://svnweb.freebsd.org/changeset/base/343061

Log:
  MFC 340206: Treat the memory lengths for CHELSIO_T4_GET_MEM as unsigned.
  
  Previously attempts to read the MC region were failing since the
  length was greater than 2^31.

Modified:
  stable/12/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==
--- stable/12/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:06:58 2019
(r343060)
+++ stable/12/sys/dev/cxgbe/t4_main.c   Tue Jan 15 21:07:40 2019
(r343061)
@@ -527,9 +527,9 @@ struct intrs_and_queues {
 
 static void setup_memwin(struct adapter *);
 static void position_memwin(struct adapter *, int, uint32_t);
-static int validate_mem_range(struct adapter *, uint32_t, int);
+static int validate_mem_range(struct adapter *, uint32_t, uint32_t);
 static int fwmtype_to_hwmtype(int);
-static int validate_mt_off_len(struct adapter *, int, uint32_t, int,
+static int validate_mt_off_len(struct adapter *, int, uint32_t, uint32_t,
 uint32_t *);
 static int fixup_devlog_params(struct adapter *);
 static int cfg_itype_and_nqueues(struct adapter *, struct intrs_and_queues *);
@@ -2816,14 +2816,14 @@ t4_range_cmp(const void *a, const void *b)
  * the card's address space.
  */
 static int
-validate_mem_range(struct adapter *sc, uint32_t addr, int len)
+validate_mem_range(struct adapter *sc, uint32_t addr, uint32_t len)
 {
struct t4_range mem_ranges[4], *r, *next;
uint32_t em, addr_len;
int i, n, remaining;
 
/* Memory can only be accessed in naturally aligned 4 byte units */
-   if (addr & 3 || len & 3 || len <= 0)
+   if (addr & 3 || len & 3 || len == 0)
return (EINVAL);
 
/* Enabled memories */
@@ -2962,7 +2962,7 @@ fwmtype_to_hwmtype(int mtype)
  * the start of the range is returned in addr.
  */
 static int
-validate_mt_off_len(struct adapter *sc, int mtype, uint32_t off, int len,
+validate_mt_off_len(struct adapter *sc, int mtype, uint32_t off, uint32_t len,
 uint32_t *addr)
 {
uint32_t em, addr_len, maddr;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343060 - head/sys/dev/drm

2019-01-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jan 15 21:06:58 2019
New Revision: 343060
URL: https://svnweb.freebsd.org/changeset/base/343060

Log:
  [drm] Fix off-by-one error when accessing driver-specific ioctl handlers array
  
  PR:   231513
  Submitted by: Young_X 
  Approved by:  imp
  MFC after:1 week

Modified:
  head/sys/dev/drm/drm_drv.c

Modified: head/sys/dev/drm/drm_drv.c
==
--- head/sys/dev/drm/drm_drv.c  Tue Jan 15 20:27:21 2019(r343059)
+++ head/sys/dev/drm/drm_drv.c  Tue Jan 15 21:06:58 2019(r343060)
@@ -745,7 +745,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t d
if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) {
/* The array entries begin at DRM_COMMAND_BASE ioctl nr */
nr -= DRM_COMMAND_BASE;
-   if (nr > dev->driver->max_ioctl) {
+   if (nr >= dev->driver->max_ioctl) {
DRM_DEBUG("Bad driver ioctl number, 0x%x (of 0x%x)\n",
nr, dev->driver->max_ioctl);
return EINVAL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread John Baldwin
On 1/15/19 12:33 PM, Gleb Smirnoff wrote:
> On Tue, Jan 15, 2019 at 01:20:14PM -0700, Ian Lepore wrote:
> I> On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote:
> I> > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote:
> I> > J> Why not #include counter.h in the relevant vm_machdep.c files
> I> > instead?
> I> > 
> I> > This also is ugly :( Not sure more or less. Probably less, but I
> I> > urged to plug all possible compilation failures at a time.
> I> > 
> I> > What is ugly is that most files just need counter_u64_t size,
> I> > and they don't use counter(9) KPI.
> I> > 
> I> > The fact that vm_machdep or Linux KPI want to look into internal
> I> > type uma_zone_t is also ugly.
> I> > 
> I> 
> I> Isn't the usual fix for this problem to create a __counter_u64_t in
> I> sys/types.h and use it in places where including the full header file
> I> is undesirable for some reason?
> 
> I'm inclined to this solution. Do you want to sign up as reviewer? :)

I think normally we'd put the __counter_u64_t in sys/_types.h if we went
that route.

-- 
John Baldwin


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


Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread Gleb Smirnoff
On Tue, Jan 15, 2019 at 01:20:14PM -0700, Ian Lepore wrote:
I> On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote:
I> > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote:
I> > J> Why not #include counter.h in the relevant vm_machdep.c files
I> > instead?
I> > 
I> > This also is ugly :( Not sure more or less. Probably less, but I
I> > urged to plug all possible compilation failures at a time.
I> > 
I> > What is ugly is that most files just need counter_u64_t size,
I> > and they don't use counter(9) KPI.
I> > 
I> > The fact that vm_machdep or Linux KPI want to look into internal
I> > type uma_zone_t is also ugly.
I> > 
I> 
I> Isn't the usual fix for this problem to create a __counter_u64_t in
I> sys/types.h and use it in places where including the full header file
I> is undesirable for some reason?

I'm inclined to this solution. Do you want to sign up as reviewer? :)

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


Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread Ian Lepore
On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote:
> On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote:
> J> Why not #include counter.h in the relevant vm_machdep.c files
> instead?
> 
> This also is ugly :( Not sure more or less. Probably less, but I
> urged to plug all possible compilation failures at a time.
> 
> What is ugly is that most files just need counter_u64_t size,
> and they don't use counter(9) KPI.
> 
> The fact that vm_machdep or Linux KPI want to look into internal
> type uma_zone_t is also ugly.
> 

Isn't the usual fix for this problem to create a __counter_u64_t in
sys/types.h and use it in places where including the full header file
is undesirable for some reason?

-- Ian

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


Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread Gleb Smirnoff
On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote:
J> Why not #include counter.h in the relevant vm_machdep.c files instead?

This also is ugly :( Not sure more or less. Probably less, but I
urged to plug all possible compilation failures at a time.

What is ugly is that most files just need counter_u64_t size,
and they don't use counter(9) KPI.

The fact that vm_machdep or Linux KPI want to look into internal
type uma_zone_t is also ugly.

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


Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread Justin Hibbits
On Tue, 15 Jan 2019 19:33:47 + (UTC)
Gleb Smirnoff  wrote:

> Author: glebius
> Date: Tue Jan 15 19:33:47 2019
> New Revision: 343058
> URL: https://svnweb.freebsd.org/changeset/base/343058
> 
> Log:
>   Fix compilation failures on different arches that have vm_machdep.c
> not aware of counter_u64_t by including counter.h into uma_int.h. I'm
> not happy about this inclusion, but it fixes compilation ASAP.
> 
> Modified:
>   head/sys/compat/linuxkpi/common/src/linux_page.c
>   head/sys/vm/uma_dbg.c
>   head/sys/vm/uma_int.h
> 
> Modified: head/sys/compat/linuxkpi/common/src/linux_page.c
> ==
> --- head/sys/compat/linuxkpi/common/src/linux_page.c  Tue Jan
> 15 19:01:04 2019  (r343057) +++
> head/sys/compat/linuxkpi/common/src/linux_page.c  Tue Jan 15
> 19:33:47 2019 (r343058) @@ -31,7 +31,6 @@
> __FBSDID("$FreeBSD$"); #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> 
> Modified: head/sys/vm/uma_dbg.c
> ==
> --- head/sys/vm/uma_dbg.c Tue Jan 15 19:01:04 2019
> (r343057) +++ head/sys/vm/uma_dbg.c   Tue Jan 15 19:33:47
> 2019  (r343058) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> 
> Modified: head/sys/vm/uma_int.h
> ==
> --- head/sys/vm/uma_int.h Tue Jan 15 19:01:04 2019
> (r343057) +++ head/sys/vm/uma_int.h   Tue Jan 15 19:33:47
> 2019  (r343058) @@ -30,6 +30,7 @@
>   *
>   */
>  
> +#include 
>  #include 
>  #include 
>  #include 
> 

Why not #include counter.h in the relevant vm_machdep.c files instead?

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


svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 15 19:33:47 2019
New Revision: 343058
URL: https://svnweb.freebsd.org/changeset/base/343058

Log:
  Fix compilation failures on different arches that have vm_machdep.c not
  aware of counter_u64_t by including counter.h into uma_int.h. I'm not
  happy about this inclusion, but it fixes compilation ASAP.

Modified:
  head/sys/compat/linuxkpi/common/src/linux_page.c
  head/sys/vm/uma_dbg.c
  head/sys/vm/uma_int.h

Modified: head/sys/compat/linuxkpi/common/src/linux_page.c
==
--- head/sys/compat/linuxkpi/common/src/linux_page.cTue Jan 15 19:01:04 
2019(r343057)
+++ head/sys/compat/linuxkpi/common/src/linux_page.cTue Jan 15 19:33:47 
2019(r343058)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/vm/uma_dbg.c
==
--- head/sys/vm/uma_dbg.c   Tue Jan 15 19:01:04 2019(r343057)
+++ head/sys/vm/uma_dbg.c   Tue Jan 15 19:33:47 2019(r343058)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Tue Jan 15 19:01:04 2019(r343057)
+++ head/sys/vm/uma_int.h   Tue Jan 15 19:33:47 2019(r343058)
@@ -30,6 +30,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343057 - stable/12/usr.sbin/bhyve

2019-01-15 Thread Rodney W. Grimes
Author: rgrimes
Date: Tue Jan 15 19:01:04 2019
New Revision: 343057
URL: https://svnweb.freebsd.org/changeset/base/343057

Log:
  MFC: r342944
  Fix spelling of identifier
  
  Approved by:  phk (mfc blanket)

Modified:
  stable/12/usr.sbin/bhyve/bhyve.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/bhyve.8
==
--- stable/12/usr.sbin/bhyve/bhyve.8Tue Jan 15 18:53:45 2019
(r343056)
+++ stable/12/usr.sbin/bhyve/bhyve.8Tue Jan 15 19:01:04 2019
(r343057)
@@ -386,7 +386,7 @@ address and a
 VNC should listen on.
 The default is to listen on localhost IPv4 address and default VNC port 5900.
 An IPv6 address must be enclosed in square brackets and may contain an
-optional zone identifer.
+optional zone identifier.
 .It Ar width No and Ar height
 A display resolution, width and height, respectively.
 If not specified, a default resolution of 1024x768 pixels will be used.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343056 - head/sys/dev/cxgbe/crypto

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 18:53:45 2019
New Revision: 343056
URL: https://svnweb.freebsd.org/changeset/base/343056

Log:
  Reject new sessions if the necessary queues aren't initialized.
  
  ccr reuses the control queue and first rx queue from the first port on
  each adapter.  The driver cannot send requests until those queues are
  initialized.  Refuse to create sessions for now if the queues aren't
  ready.  This is a workaround until cxgbe allocates one or more
  dedicated queues for ccr.
  
  PR:   233851
  MFC after:1 week
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D18478

Modified:
  head/sys/dev/cxgbe/crypto/t4_crypto.c

Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c
==
--- head/sys/dev/cxgbe/crypto/t4_crypto.c   Tue Jan 15 18:50:11 2019
(r343055)
+++ head/sys/dev/cxgbe/crypto/t4_crypto.c   Tue Jan 15 18:53:45 2019
(r343056)
@@ -1652,12 +1652,6 @@ ccr_attach(device_t dev)
struct ccr_softc *sc;
int32_t cid;
 
-   /*
-* TODO: Crypto requests will panic if the parent device isn't
-* initialized so that the queues are up and running.  Need to
-* figure out how to handle that correctly, maybe just reject
-* requests if the adapter isn't fully initialized?
-*/
sc = device_get_softc(dev);
sc->dev = dev;
sc->adapter = device_get_softc(device_get_parent(dev));
@@ -2058,6 +2052,16 @@ ccr_newsession(device_t dev, crypto_session_t cses, st
}
 
sc = device_get_softc(dev);
+
+   /*
+* XXX: Don't create a session if the queues aren't
+* initialized.  This is racy as the rxq can be destroyed by
+* the associated VI detaching.  Eventually ccr should use
+* dedicated queues.
+*/
+   if (sc->rxq->iq.adapter == NULL || sc->txq->adapter == NULL)
+   return (ENXIO);
+   
mtx_lock(>lock);
if (sc->detaching) {
mtx_unlock(>lock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343055 - head/sys/vm

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 15 18:50:11 2019
New Revision: 343055
URL: https://svnweb.freebsd.org/changeset/base/343055

Log:
  style(9): break long line.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Jan 15 18:49:31 2019(r343054)
+++ head/sys/vm/uma_core.c  Tue Jan 15 18:50:11 2019(r343055)
@@ -2924,7 +2924,8 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i
zone->uz_sleeps++;
zone->uz_sleepers++;
while (zone->uz_items >= zone->uz_max_items)
-   mtx_sleep(zone, zone->uz_lockptr, PVM, 
"zonelimit", 0);
+   mtx_sleep(zone, zone->uz_lockptr, PVM,
+   "zonelimit", 0);
zone->uz_sleepers--;
if (zone->uz_sleepers > 0 &&
zone->uz_items + 1 < zone->uz_max_items)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343054 - head/sys/vm

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 15 18:49:31 2019
New Revision: 343054
URL: https://svnweb.freebsd.org/changeset/base/343054

Log:
  Remove harmless leftover from code that cycles over zone's kegs. Just use +
  instead of +=. There is no functional change.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Jan 15 18:47:19 2019(r343053)
+++ head/sys/vm/uma_core.c  Tue Jan 15 18:49:31 2019(r343054)
@@ -3914,10 +3914,10 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS)
kz->uk_ppera;
else
uth.uth_pages = kz->uk_pages;
-   uth.uth_maxpages += (z->uz_max_items / kz->uk_ipers) *
+   uth.uth_maxpages = (z->uz_max_items / kz->uk_ipers) *
kz->uk_ppera;
uth.uth_limit = z->uz_max_items;
-   uth.uth_keg_free += z->uz_keg->uk_free;
+   uth.uth_keg_free = z->uz_keg->uk_free;
 
/*
 * A zone is secondary is it is not the first entry
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343053 - head/lib/libmemstat

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 15 18:47:19 2019
New Revision: 343053
URL: https://svnweb.freebsd.org/changeset/base/343053

Log:
  This was missed in r343051: make uz_allocs, uz_frees and uz_fails counter(9).

Modified:
  head/lib/libmemstat/memstat_uma.c

Modified: head/lib/libmemstat/memstat_uma.c
==
--- head/lib/libmemstat/memstat_uma.c   Tue Jan 15 18:32:26 2019
(r343052)
+++ head/lib/libmemstat/memstat_uma.c   Tue Jan 15 18:47:19 2019
(r343053)
@@ -29,6 +29,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -406,9 +407,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *k
 * Reset the statistics on a current node.
 */
_memstat_mt_reset_stats(mtp, mp_maxid + 1);
-   mtp->mt_numallocs = uz.uz_allocs;
-   mtp->mt_numfrees = uz.uz_frees;
-   mtp->mt_failures = uz.uz_fails;
+   mtp->mt_numallocs = kvm_counter_u64_fetch(kvm,
+   (unsigned long )uz.uz_allocs);
+   mtp->mt_numfrees = kvm_counter_u64_fetch(kvm,
+   (unsigned long )uz.uz_frees);
+   mtp->mt_failures = kvm_counter_u64_fetch(kvm,
+   (unsigned long )uz.uz_fails);
mtp->mt_sleeps = uz.uz_sleeps;
if (kz.uk_flags & UMA_ZFLAG_INTERNAL)
goto skip_percpu;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343052 - head/sys/vm

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 15 18:32:26 2019
New Revision: 343052
URL: https://svnweb.freebsd.org/changeset/base/343052

Log:
  Only do uz_items accounting for zones that have a limit set in uz_max_items.
  This reduces amount of locking required for these zones.
  
  Also, for cache only zones (UMA_ZFLAG_CACHE) accounting uz_items wasn't
  correct at all, since they may allocate items directly from their backing
  store and then free them via UMA underflowing uz_items.
  
  Tested by:pho

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Jan 15 18:24:34 2019(r343051)
+++ head/sys/vm/uma_core.c  Tue Jan 15 18:32:26 2019(r343052)
@@ -736,11 +736,13 @@ bucket_drain(uma_zone_t zone, uma_bucket_t bucket)
for (i = 0; i < bucket->ub_cnt; i++) 
zone->uz_fini(bucket->ub_bucket[i], zone->uz_size);
zone->uz_release(zone->uz_arg, bucket->ub_bucket, bucket->ub_cnt);
-   ZONE_LOCK(zone);
-   zone->uz_items -= bucket->ub_cnt;
-   if (zone->uz_sleepers && zone->uz_items < zone->uz_max_items)
-   wakeup_one(zone);
-   ZONE_UNLOCK(zone);
+   if (zone->uz_max_items > 0) {
+   ZONE_LOCK(zone);
+   zone->uz_items -= bucket->ub_cnt;
+   if (zone->uz_sleepers && zone->uz_items < zone->uz_max_items)
+   wakeup_one(zone);
+   ZONE_UNLOCK(zone);
+   }
bucket->ub_cnt = 0;
 }
 
@@ -2515,9 +2517,9 @@ zalloc_start:
goto zalloc_item;
maxbucket = MIN(zone->uz_count,
zone->uz_max_items - zone->uz_items);
+   zone->uz_items += maxbucket;
} else
maxbucket = zone->uz_count;
-   zone->uz_items += maxbucket;
ZONE_UNLOCK(zone);
 
/*
@@ -2530,9 +2532,8 @@ zalloc_start:
zone->uz_name, zone, bucket);
ZONE_LOCK(zone);
if (bucket != NULL) {
-   if (bucket->ub_cnt < maxbucket) {
-   MPASS(zone->uz_flags & UMA_ZFLAG_CACHE ||
-   zone->uz_items >= maxbucket - bucket->ub_cnt);
+   if (zone->uz_max_items > 0 && bucket->ub_cnt < maxbucket) {
+   MPASS(zone->uz_items >= maxbucket - bucket->ub_cnt);
zone->uz_items -= maxbucket - bucket->ub_cnt;
if (zone->uz_sleepers > 0 &&
zone->uz_items < zone->uz_max_items)
@@ -2562,7 +2563,7 @@ zalloc_start:
zone_put_bucket(zone, zdom, bucket, false);
ZONE_UNLOCK(zone);
goto zalloc_start;
-   } else {
+   } else if (zone->uz_max_items > 0) {
zone->uz_items -= maxbucket;
if (zone->uz_sleepers > 0 &&
zone->uz_items + 1 < zone->uz_max_items)
@@ -2912,24 +2913,25 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i
 
ZONE_LOCK_ASSERT(zone);
 
-   if (zone->uz_max_items > 0 && zone->uz_items >= zone->uz_max_items) {
-   zone_log_warning(zone);
-   zone_maxaction(zone);
-   if (flags & M_NOWAIT) {
-   ZONE_UNLOCK(zone);
-   return (NULL);
+   if (zone->uz_max_items > 0) {
+   if (zone->uz_items >= zone->uz_max_items) {
+   zone_log_warning(zone);
+   zone_maxaction(zone);
+   if (flags & M_NOWAIT) {
+   ZONE_UNLOCK(zone);
+   return (NULL);
+   }
+   zone->uz_sleeps++;
+   zone->uz_sleepers++;
+   while (zone->uz_items >= zone->uz_max_items)
+   mtx_sleep(zone, zone->uz_lockptr, PVM, 
"zonelimit", 0);
+   zone->uz_sleepers--;
+   if (zone->uz_sleepers > 0 &&
+   zone->uz_items + 1 < zone->uz_max_items)
+   wakeup_one(zone);
}
-   zone->uz_sleeps++;
-   zone->uz_sleepers++;
-   while (zone->uz_items >= zone->uz_max_items)
-   mtx_sleep(zone, zone->uz_lockptr, PVM, "zonelimit", 0);
-   zone->uz_sleepers--;
-   if (zone->uz_sleepers > 0 &&
-   zone->uz_items + 1 < zone->uz_max_items)
-   wakeup_one(zone);
+   zone->uz_items++;
}
-
-   zone->uz_items++;
ZONE_UNLOCK(zone);
 
if (domain != UMA_ANYDOMAIN) {
@@ -2978,9 +2980,11 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i
return (item);
 
 fail:
-   ZONE_LOCK(zone);
-   zone->uz_items--;
-   ZONE_UNLOCK(zone);
+   if 

svn commit: r343051 - in head/sys: compat/linuxkpi/common/src vm

2019-01-15 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 15 18:24:34 2019
New Revision: 343051
URL: https://svnweb.freebsd.org/changeset/base/343051

Log:
  Make uz_allocs, uz_frees and uz_fails counter(9). This removes some
  atomic updates and reduces amount of data protected by zone lock.
  
  During startup point these fields to EARLY_COUNTER. After startup
  allocate them for all early zones.
  
  Tested by:pho

Modified:
  head/sys/compat/linuxkpi/common/src/linux_page.c
  head/sys/vm/uma_core.c
  head/sys/vm/uma_dbg.c
  head/sys/vm/uma_int.h

Modified: head/sys/compat/linuxkpi/common/src/linux_page.c
==
--- head/sys/compat/linuxkpi/common/src/linux_page.cTue Jan 15 18:22:16 
2019(r343050)
+++ head/sys/compat/linuxkpi/common/src/linux_page.cTue Jan 15 18:24:34 
2019(r343051)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Jan 15 18:22:16 2019(r343050)
+++ head/sys/vm/uma_core.c  Tue Jan 15 18:24:34 2019(r343051)
@@ -1715,6 +1715,15 @@ keg_ctor(void *mem, int size, void *udata, int flags)
return (0);
 }
 
+static void
+zone_alloc_counters(uma_zone_t zone)
+{
+
+   zone->uz_allocs = counter_u64_alloc(M_WAITOK);
+   zone->uz_frees = counter_u64_alloc(M_WAITOK);
+   zone->uz_fails = counter_u64_alloc(M_WAITOK);
+}
+
 /*
  * Zone header ctor.  This initializes all fields, locks, etc.
  *
@@ -1736,9 +1745,6 @@ zone_ctor(void *mem, int size, void *udata, int flags)
zone->uz_slab = zone_fetch_slab;
zone->uz_init = NULL;
zone->uz_fini = NULL;
-   zone->uz_allocs = 0;
-   zone->uz_frees = 0;
-   zone->uz_fails = 0;
zone->uz_sleeps = 0;
zone->uz_count = 0;
zone->uz_count_min = 0;
@@ -1750,6 +1756,14 @@ zone_ctor(void *mem, int size, void *udata, int flags)
zone->uz_bkt_max = ULONG_MAX;
timevalclear(>uz_ratecheck);
 
+   if (__predict_true(booted == BOOT_RUNNING))
+   zone_alloc_counters(zone);
+   else {
+   zone->uz_allocs = EARLY_COUNTER;
+   zone->uz_frees = EARLY_COUNTER;
+   zone->uz_fails = EARLY_COUNTER;
+   }
+
/*
 * This is a pure cache zone, no kegs.
 */
@@ -1908,6 +1922,9 @@ zone_dtor(void *arg, int size, void *udata)
rw_wunlock(_rwlock);
zone_free_item(kegs, keg, NULL, SKIP_NONE);
}
+   counter_u64_free(zone->uz_allocs);
+   counter_u64_free(zone->uz_frees);
+   counter_u64_free(zone->uz_fails);
if (zone->uz_lockptr == >uz_lock)
ZONE_LOCK_FINI(zone);
 }
@@ -1928,12 +1945,19 @@ zone_foreach(void (*zfunc)(uma_zone_t))
uma_keg_t keg;
uma_zone_t zone;
 
-   rw_rlock(_rwlock);
+   /*
+* Before BOOT_RUNNING we are guaranteed to be single
+* threaded, so locking isn't needed. Startup functions
+* are allowed to use M_WAITOK.
+*/
+   if (__predict_true(booted == BOOT_RUNNING))
+   rw_rlock(_rwlock);
LIST_FOREACH(keg, _kegs, uk_link) {
LIST_FOREACH(zone, >uk_zones, uz_link)
zfunc(zone);
}
-   rw_runlock(_rwlock);
+   if (__predict_true(booted == BOOT_RUNNING))
+   rw_runlock(_rwlock);
 }
 
 /*
@@ -2109,6 +2133,7 @@ uma_startup3(void)
uma_dbg_cnt = counter_u64_alloc(M_WAITOK);
uma_skip_cnt = counter_u64_alloc(M_WAITOK);
 #endif
+   zone_foreach(zone_alloc_counters);
callout_init(_callout, 1);
callout_reset(_callout, UMA_TIMEOUT * hz, uma_timeout, NULL);
booted = BOOT_RUNNING;
@@ -2387,7 +2412,7 @@ zalloc_start:
zone->uz_dtor != trash_dtor) &&
 #endif
zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) {
-   atomic_add_long(>uz_fails, 1);
+   counter_u64_add(zone->uz_fails, 1);
zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT);
return (NULL);
}
@@ -2845,7 +2870,7 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do
 
if (bucket->ub_cnt == 0) {
bucket_free(zone, bucket, udata);
-   atomic_add_long(>uz_fails, 1);
+   counter_u64_add(zone->uz_fails, 1);
return (NULL);
}
 
@@ -2905,7 +2930,6 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i
}
 
zone->uz_items++;
-   zone->uz_allocs++;
ZONE_UNLOCK(zone);
 
if (domain != UMA_ANYDOMAIN) {
@@ -2947,6 +2971,7 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i
if (flags & M_ZERO)
uma_zero_item(item, zone);
 
+   

svn commit: r343050 - stable/12/usr.bin/grep

2019-01-15 Thread Kyle Evans
Author: kevans
Date: Tue Jan 15 18:22:16 2019
New Revision: 343050
URL: https://svnweb.freebsd.org/changeset/base/343050

Log:
  MFC r342874: Fix bsdgrep manpage clobbering grep(1) with default build
  
  The default build should install bsdgrep(1) and grep(1), with the latter
  being gnugrep(1). WITH_BSD_GREP flips this situation such that we have
  gnugrep(1) and grep(1), with the latter being bsdgrep(1).
  
  Changes to start installing the zgrep script out of usr.bin/grep
  inadvertently altered the default build such that grep(1) was being
  installed, and it was bsdgrep(1). Correct the typo.

Modified:
  stable/12/usr.bin/grep/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/grep/Makefile
==
--- stable/12/usr.bin/grep/Makefile Tue Jan 15 18:21:06 2019
(r343049)
+++ stable/12/usr.bin/grep/Makefile Tue Jan 15 18:22:16 2019
(r343050)
@@ -10,7 +10,7 @@ MAN1= grep.1 zgrep.1
 .else
 PROG=  bsdgrep
 CLEANFILES+= bsdgrep.1
-MAN1=  grep.1 zgrep.1
+MAN1=  bsdgrep.1 zgrep.1
 
 bsdgrep.1: grep.1
${CP} ${.ALLSRC} ${.TARGET}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343049 - stable/12/lib/libbe

2019-01-15 Thread Kyle Evans
Author: kevans
Date: Tue Jan 15 18:21:06 2019
New Revision: 343049
URL: https://svnweb.freebsd.org/changeset/base/343049

Log:
  MFC r342849: libbe(3): Don't allow bootfs to be destroyed
  
  Previously, the following sequence of events was feasible under some
  circumstance:
  
  bectl create test
  bectl activate test
  # the test BE dataset gets promoted and set as bootfs
  bectl destroy test
  
  I was unable to reproduce the destroy succeeding, but we should be rejecting
  this before it even gets to libzfs because it would leave the system in an
  inconsistent state. Forcing the user to be explicit as to which environment
  should be activated instead is much better.

Modified:
  stable/12/lib/libbe/be.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libbe/be.c
==
--- stable/12/lib/libbe/be.cTue Jan 15 18:20:20 2019(r343048)
+++ stable/12/lib/libbe/be.cTue Jan 15 18:21:06 2019(r343049)
@@ -211,7 +211,8 @@ be_destroy(libbe_handle_t *lbh, const char *name, int 
if (!zfs_dataset_exists(lbh->lzh, path, ZFS_TYPE_FILESYSTEM))
return (set_error(lbh, BE_ERR_NOENT));
 
-   if (strcmp(path, lbh->rootfs) == 0)
+   if (strcmp(path, lbh->rootfs) == 0 ||
+   strcmp(path, lbh->bootfs) == 0)
return (set_error(lbh, BE_ERR_DESTROYACT));
 
fs = zfs_open(lbh->lzh, p, ZFS_TYPE_FILESYSTEM);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343048 - head

2019-01-15 Thread John Baldwin
Author: jhb
Date: Tue Jan 15 18:20:20 2019
New Revision: 343048
URL: https://svnweb.freebsd.org/changeset/base/343048

Log:
  Update the note about the need for COMPAT_FREEBSD kernel options.
  
  Rather than mentioning the requirement for 4.x binaries but not
  explaining why (it was assuming an upgrade from 4.x to 5.0-current),
  explain when compat options are needed (for running existing host
  binaries) in a more general way while using a more modern example
  (COMPAT_FREEBSD11 for 11.x binaries).  While here, explicitly mention
  that a GENERIC kernel should always work.
  
  Reported by:  Robert Huff 
  Reviewed by:  imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18740

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jan 15 17:40:19 2019(r343047)
+++ head/UPDATING   Tue Jan 15 18:20:20 2019(r343048)
@@ -1901,12 +1901,13 @@ COMMON ITEMS:
can be deleted by "make delete-old-libs", but you have to make
sure that no program is using those libraries anymore.
 
-   [8] In order to have a kernel that can run the 4.x binaries needed to
-   do an installworld, you must include the COMPAT_FREEBSD4 option in
-   your kernel.  Failure to do so may leave you with a system that is
-   hard to boot to recover. A similar kernel option COMPAT_FREEBSD5 is
-   required to run the 5.x binaries on more recent kernels.  And so on
-   for COMPAT_FREEBSD6 and COMPAT_FREEBSD7.
+   [8] The new kernel must be able to run existing binaries used by
+   an installworld.  When upgrading across major versions, the new
+   kernel's configuration must include the correct COMPAT_FREEBSD
+   option for existing binaries (e.g. COMPAT_FREEBSD11 to run 11.x
+   binaries).  Failure to do so may leave you with a system that is
+   hard to boot to recover.  A GENERIC kernel will include suitable
+   compatibility options to run binaries from older branches.
 
Make sure that you merge any new devices from GENERIC since the
last time you updated your kernel config file.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm

2019-01-15 Thread Gleb Smirnoff
On Tue, Jan 15, 2019 at 11:13:18AM -0500, Pedro Giffuni wrote:
P> >>    Allocate pager bufs from UMA instead of 80-ish mutex protected 
P> >> linked list.
P> >
P> >>    Together with:    gallatin
P> >
P> > Thank you so much for carrying this over the finish line!
P> >
P> It appears to be very impressive! Plans for MFC?

Nope. I'm very conservative about stable branch being stable branch :)

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


svn commit: r343047 - head/sys/netinet

2019-01-15 Thread Stephen Hurd
Author: shurd
Date: Tue Jan 15 17:40:19 2019
New Revision: 343047
URL: https://svnweb.freebsd.org/changeset/base/343047

Log:
  Fix window update issue when scaling disabled
  
  When the TCP window scale option is not used, and the window
  opens up enough in one soreceive, a window update will not be sent.
  
  For example, if recwin == 65535, so->so_rcv.sb_hiwat >= 262144, and
  so->so_rcv.sb_hiwat <= 524272, the window update will never be sent.
  This is because recwin and adv are clamped to TCP_MAXWIN << tp->rcv_scale,
  and so will never be >= so->so_rcv.sb_hiwat / 4
  or <= so->so_rcv.sb_hiwat / 8.
  
  This patch ensures a window update is sent if the window opens by
  TCP_MAXWIN << tp->rcv_scale, which should only happen when the window
  size goes from zero to the max expressible.
  
  This issue looks like it was introduced in r306769 when recwin was clamped
  to TCP_MAXWIN << tp->rcv_scale.
  
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D18821

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Tue Jan 15 16:12:47 2019
(r343046)
+++ head/sys/netinet/tcp_output.c   Tue Jan 15 17:40:19 2019
(r343047)
@@ -656,7 +656,8 @@ after_sack_rexmit:
if (adv >= (int32_t)(2 * tp->t_maxseg) &&
(adv >= (int32_t)(so->so_rcv.sb_hiwat / 4) ||
 recwin <= (so->so_rcv.sb_hiwat / 8) ||
-so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg))
+so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg ||
+adv >= TCP_MAXWIN << tp->rcv_scale))
goto send;
if (2 * adv >= (int32_t)so->so_rcv.sb_hiwat)
goto send;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343043 - head/crypto/openssh

2019-01-15 Thread Rodney W. Grimes
> Author: emaste
> Date: Tue Jan 15 15:35:14 2019
> New Revision: 343043
> URL: https://svnweb.freebsd.org/changeset/base/343043
> 
> Log:
>   scp: disallow empty or current directory
>   
>   Obtained from:  OpenBSD scp.c 1.198
>   Security:   CVE-2018-20685
>   Sponsored by:   The FreeBSD Foundation

Can this be MFCed to 12, 11 and 10?

> 
> Modified:
>   head/crypto/openssh/scp.c
> 
> Modified: head/crypto/openssh/scp.c
> ==
> --- head/crypto/openssh/scp.c Tue Jan 15 09:48:18 2019(r343042)
> +++ head/crypto/openssh/scp.c Tue Jan 15 15:35:14 2019(r343043)
> @@ -1106,7 +1106,8 @@ sink(int argc, char **argv)
>   SCREWUP("size out of range");
>   size = (off_t)ull;
>  
> - if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
> + if (*cp == '\0' || strchr(cp, '/') != NULL ||
> + strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
>   run_err("error: unexpected filename: %s", cp);
>   exit(1);
>   }
> 
> 

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


Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm

2019-01-15 Thread Pedro Giffuni


On 1/15/19 11:07 AM, Andrew Gallatin wrote:

On 1/14/19 8:02 PM, Gleb Smirnoff wrote:


Log:
   Allocate pager bufs from UMA instead of 80-ish mutex protected 
linked list.


<...>


   Together with:    gallatin


Thank you so much for carrying this over the finish line!

Drew



It appears to be very impressive! Plans for MFC?

Pedro.

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


svn commit: r343046 - in stable/11: etc share/man/man8

2019-01-15 Thread Kyle Evans
Author: kevans
Date: Tue Jan 15 16:12:47 2019
New Revision: 343046
URL: https://svnweb.freebsd.org/changeset/base/343046

Log:
  MFC r342792, r342805: Provide rc_service variable for rc service scripts
  
  r342792: rc.subr: Provide rc_service variable for service scripts
  
  Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for
  'application profiles' that usually require the rc script to be invoked
  again for each active profile. Because there's no consistent way to
  determine the path because it differs between manual/service(8) invocations
  and /etc/rc invocations, this leads to patterns like these:
  
  - www/uwsgi hardcodes the script path
  - security/openvpn guesses either $_file or $0 based on $0 = /etc/rc
  
  Instead of forcing rc scripts to guess, provide an rc_service variable to
  the scripts that gets set appropriately both for direct execution or when a
  script is being executed via run_rc_script (e.g. /etc/rc).
  
  This is our analog of an OpenRC variable with the same name, different case
  (RC_SERVICE).
  
  r342805: rc.subr: Fix typo
  
  Originally intended as 'in case in needs to be re-invoked', but it was later
  decided (by myself) that 're-invoke itself' makes it more clear that the
  script is expected to use this in a way.
  
  PR:   234614

Modified:
  stable/11/etc/rc.subr
  stable/11/share/man/man8/rc.subr.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.subr
==
--- stable/11/etc/rc.subr   Tue Jan 15 15:52:23 2019(r343045)
+++ stable/11/etc/rc.subr   Tue Jan 15 16:12:47 2019(r343046)
@@ -52,6 +52,14 @@ ID="/usr/bin/id"
 IDCMD="if [ -x $ID ]; then $ID -un; fi"
 PS="/bin/ps -ww"
 JID=0
+# rc_service provides the path to the service script that we are executing.
+# This is not being set here in an execution context, necessarily, so it's
+# really just a reasonable guess, and it will get overwritten later if
+# we are executing from some other means than direct execution by service(8)
+# or manual invocation of the service script.  The prime example of this is
+# during system startup, all rc scripts will be invoked via /etc/rc, so
+# run_rc_script will overwrite rc_service with the file being sourced.
+rc_service="$0"
 
 #
 #  functions
@@ -863,6 +871,9 @@ check_startmsgs()
 #  by $flags from the environment.
 #  This variable may be changed by the precmd method.
 #
+#   rc_service  Path to the service being executed, in case the service
+#   needs to re-invoke itself.
+#
 #  rc_pid  PID of command (if appropriate)
 #
 #  rc_fast Not empty if "fast" was provided (q.v.)
@@ -1333,6 +1344,7 @@ run_rc_script()
required_vars
eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd
 
+   rc_service="$_file"
case "$_file" in
/etc/rc.d/*.sh) # no longer allowed in the base
warn "Ignoring old-style startup script $_file"

Modified: stable/11/share/man/man8/rc.subr.8
==
--- stable/11/share/man/man8/rc.subr.8  Tue Jan 15 15:52:23 2019
(r343045)
+++ stable/11/share/man/man8/rc.subr.8  Tue Jan 15 16:12:47 2019
(r343046)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 4, 2016
+.Dd January 15, 2019
 .Dt RC.SUBR 8
 .Os
 .Sh NAME
@@ -764,7 +764,7 @@ The following variables are available to the methods
 as well as after
 .Ic run_rc_command
 has completed:
-.Bl -tag -width ".Va rc_flags" -offset indent
+.Bl -tag -width ".Va rc_service" -offset indent
 .It Va rc_arg
 Argument provided to
 .Ic run_rc_command ,
@@ -778,6 +778,8 @@ unless overridden by the environment variable
 This variable may be changed by the
 .Ar argument Ns Va _precmd
 method.
+.It Va rc_service
+Path to the service script being executed, in case it needs to re-invoke 
itself.
 .It Va rc_pid
 PID of
 .Va command
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm

2019-01-15 Thread Andrew Gallatin

On 1/14/19 8:02 PM, Gleb Smirnoff wrote:


Log:
   Allocate pager bufs from UMA instead of 80-ish mutex protected linked list.


<...>


   Together with:   gallatin


Thank you so much for carrying this over the finish line!

Drew

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


svn commit: r343045 - in stable/12: libexec/rc share/man/man8

2019-01-15 Thread Kyle Evans
Author: kevans
Date: Tue Jan 15 15:52:23 2019
New Revision: 343045
URL: https://svnweb.freebsd.org/changeset/base/343045

Log:
  MFC r342792, r342805: Provide rc_service variable for rc service scripts
  
  r342792: rc.subr: Provide rc_service variable for service scripts
  
  Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for
  'application profiles' that usually require the rc script to be invoked
  again for each active profile. Because there's no consistent way to
  determine the path because it differs between manual/service(8) invocations
  and /etc/rc invocations, this leads to patterns like these:
  
  - www/uwsgi hardcodes the script path
  - security/openvpn guesses either $_file or $0 based on $0 = /etc/rc
  
  Instead of forcing rc scripts to guess, provide an rc_service variable to
  the scripts that gets set appropriately both for direct execution or when a
  script is being executed via run_rc_script (e.g. /etc/rc).
  
  This is our analog of an OpenRC variable with the same name, different case
  (RC_SERVICE).
  
  r342805: rc.subr: Fix typo
  
  Originally intended as 'in case in needs to be re-invoked', but it was later
  decided (by myself) that 're-invoke itself' makes it more clear that the
  script is expected to use this in a way.
  
  PR:   234614

Modified:
  stable/12/libexec/rc/rc.subr
  stable/12/share/man/man8/rc.subr.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rc/rc.subr
==
--- stable/12/libexec/rc/rc.subrTue Jan 15 15:47:01 2019
(r343044)
+++ stable/12/libexec/rc/rc.subrTue Jan 15 15:52:23 2019
(r343045)
@@ -52,6 +52,14 @@ ID="/usr/bin/id"
 IDCMD="if [ -x $ID ]; then $ID -un; fi"
 PS="/bin/ps -ww"
 JID=0
+# rc_service provides the path to the service script that we are executing.
+# This is not being set here in an execution context, necessarily, so it's
+# really just a reasonable guess, and it will get overwritten later if
+# we are executing from some other means than direct execution by service(8)
+# or manual invocation of the service script.  The prime example of this is
+# during system startup, all rc scripts will be invoked via /etc/rc, so
+# run_rc_script will overwrite rc_service with the file being sourced.
+rc_service="$0"
 
 #
 #  functions
@@ -867,6 +875,9 @@ check_startmsgs()
 #  by $flags from the environment.
 #  This variable may be changed by the precmd method.
 #
+#   rc_service  Path to the service being executed, in case the service
+#   needs to re-invoke itself.
+#
 #  rc_pid  PID of command (if appropriate)
 #
 #  rc_fast Not empty if "fast" was provided (q.v.)
@@ -1370,6 +1381,7 @@ run_rc_script()
required_vars
eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd
 
+   rc_service="$_file"
case "$_file" in
/etc/rc.d/*.sh) # no longer allowed in the base
warn "Ignoring old-style startup script $_file"

Modified: stable/12/share/man/man8/rc.subr.8
==
--- stable/12/share/man/man8/rc.subr.8  Tue Jan 15 15:47:01 2019
(r343044)
+++ stable/12/share/man/man8/rc.subr.8  Tue Jan 15 15:52:23 2019
(r343045)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 19, 2018
+.Dd January 15, 2019
 .Dt RC.SUBR 8
 .Os
 .Sh NAME
@@ -763,7 +763,7 @@ The following variables are available to the methods
 as well as after
 .Ic run_rc_command
 has completed:
-.Bl -tag -width ".Va rc_flags" -offset indent
+.Bl -tag -width ".Va rc_service" -offset indent
 .It Va rc_arg
 Argument provided to
 .Ic run_rc_command ,
@@ -777,6 +777,8 @@ unless overridden by the environment variable
 This variable may be changed by the
 .Ar argument Ns Va _precmd
 method.
+.It Va rc_service
+Path to the service script being executed, in case it needs to re-invoke 
itself.
 .It Va rc_pid
 PID of
 .Va command
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343044 - stable/11/sbin/newfs_msdos

2019-01-15 Thread Kyle Evans
Author: kevans
Date: Tue Jan 15 15:47:01 2019
New Revision: 343044
URL: https://svnweb.freebsd.org/changeset/base/343044

Log:
  MFC r305074-r305075, r327275, r327570: newfs_msdos updates
  
  r305074:
  Remove CHS alignment. It's not needed and causes problems for the BBB
  boot partition. NetBSD removed it in 1.10 in their repo some time ago.
  
  r305075:
  The code only converts from bpbHugeSectors to bpbSectors if the sum of
  the hidden and huge sectors is less than or equal MAXU16. When
  formatting in Windows bpbSectors is still used for 63488 sectors and
  2048 hidden (sum > MAXU16). The hidden sectors count is the number of
  sectors before the FAT16 Boot Record so it shouldn't affect the sector
  count. Attached patch (huge_sec_conversion.patch) to only check for
  bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors.
  
  r327275:
  Close fd and fd1 before returning now that we're done with them.
  
  r327570:
  Only call close if fd and fd1 are not -1.
  
  PR: 183234

Modified:
  stable/11/sbin/newfs_msdos/mkfs_msdos.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c
==
--- stable/11/sbin/newfs_msdos/mkfs_msdos.c Tue Jan 15 15:35:14 2019
(r343043)
+++ stable/11/sbin/newfs_msdos/mkfs_msdos.c Tue Jan 15 15:47:01 2019
(r343044)
@@ -249,6 +249,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 
 img = NULL;
 rv = -1;
+fd = fd1 = -1;
 
 if (o.block_size && o.sectors_per_cluster) {
warnx("Cannot specify both block size and sectors per cluster");
@@ -315,15 +316,8 @@ mkfs_msdos(const char *fname, const char *dtype, const
bpb.bpbHiddenSecs = o.hidden_sectors;
 if (!(o.floppy || (o.drive_heads && o.sectors_per_track &&
o.bytes_per_sector && o.size && o.hidden_sectors_set))) {
-   off_t delta;
getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, );
bpb.bpbHugeSectors -= (o.offset / bpb.bpbBytesPerSec);
-   delta = bpb.bpbHugeSectors % bpb.bpbSecPerTrack;
-   if (delta != 0) {
-   warnx("trim %d sectors to adjust to a multiple of %d",
-   (int)delta, bpb.bpbSecPerTrack);
-   bpb.bpbHugeSectors -= delta;
-   }
if (bpb.bpbSecPerClust == 0) {  /* set defaults */
if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */
bpb.bpbSecPerClust = 1;
@@ -598,7 +592,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
bpb.bpbMedia = !bpb.bpbHiddenSecs ? 0xf0 : 0xf8;
 if (fat == 32)
bpb.bpbRootClust = RESFTE;
-if (bpb.bpbHiddenSecs + bpb.bpbHugeSectors <= MAXU16) {
+if (bpb.bpbHugeSectors <= MAXU16) {
bpb.bpbSectors = bpb.bpbHugeSectors;
bpb.bpbHugeSectors = 0;
 }
@@ -758,6 +752,10 @@ mkfs_msdos(const char *fname, const char *dtype, const
 rv = 0;
 done:
 free(img);
+if (fd != -1)
+   close(fd);
+if (fd1 != -1)
+   close(fd1);
 
 return rv;
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343043 - head/crypto/openssh

2019-01-15 Thread Ed Maste
Author: emaste
Date: Tue Jan 15 15:35:14 2019
New Revision: 343043
URL: https://svnweb.freebsd.org/changeset/base/343043

Log:
  scp: disallow empty or current directory
  
  Obtained from:OpenBSD scp.c 1.198
  Security: CVE-2018-20685
  Sponsored by: The FreeBSD Foundation

Modified:
  head/crypto/openssh/scp.c

Modified: head/crypto/openssh/scp.c
==
--- head/crypto/openssh/scp.c   Tue Jan 15 09:48:18 2019(r343042)
+++ head/crypto/openssh/scp.c   Tue Jan 15 15:35:14 2019(r343043)
@@ -1106,7 +1106,8 @@ sink(int argc, char **argv)
SCREWUP("size out of range");
size = (off_t)ull;
 
-   if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
+   if (*cp == '\0' || strchr(cp, '/') != NULL ||
+   strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
run_err("error: unexpected filename: %s", cp);
exit(1);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-01-15 Thread Andrew Turner
Author: andrew
Date: Tue Jan 15 09:48:18 2019
New Revision: 343042
URL: https://svnweb.freebsd.org/changeset/base/343042

Log:
  Ensure the I-Cache is correctly handled in arm64_icache_sync_range
  
  The cache_handle_range macro to handle the arm64 instruction and data
  cache operations would return when it was complete. This causes problems
  for arm64_icache_sync_range and arm64_icache_sync_range_checked as they
  assume they can execute the i-cache handling instruction after it has been
  called.
  
  Fix this by making this assumption correct.
  
  While here add missing instruction barriers and adjust the style to
  match the rest of the assembly.
  
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18838

Modified:
  head/sys/arm64/arm64/cpufunc_asm.S

Modified: head/sys/arm64/arm64/cpufunc_asm.S
==
--- head/sys/arm64/arm64/cpufunc_asm.S  Tue Jan 15 08:59:51 2019
(r343041)
+++ head/sys/arm64/arm64/cpufunc_asm.S  Tue Jan 15 09:48:18 2019
(r343042)
@@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$");
 .if \ic != 0
isb
 .endif
-   ret
 .endm
 
 ENTRY(arm64_nullop)
@@ -112,6 +111,7 @@ END(arm64_tlb_flushID)
  */
 ENTRY(arm64_dcache_wb_range)
cache_handle_range  dcop = cvac
+   ret
 END(arm64_dcache_wb_range)
 
 /*
@@ -119,6 +119,7 @@ END(arm64_dcache_wb_range)
  */
 ENTRY(arm64_dcache_wbinv_range)
cache_handle_range  dcop = civac
+   ret
 END(arm64_dcache_wbinv_range)
 
 /*
@@ -129,6 +130,7 @@ END(arm64_dcache_wbinv_range)
  */
 ENTRY(arm64_dcache_inv_range)
cache_handle_range  dcop = ivac
+   ret
 END(arm64_dcache_inv_range)
 
 /*
@@ -136,6 +138,7 @@ END(arm64_dcache_inv_range)
  */
 ENTRY(arm64_idcache_wbinv_range)
cache_handle_range  dcop = civac, ic = 1, icop = ivau
+   ret
 END(arm64_idcache_wbinv_range)
 
 /*
@@ -150,6 +153,8 @@ ENTRY(arm64_icache_sync_range)
cache_handle_range  dcop = cvau
ic  ialluis
dsb ish
+   isb
+   ret
 END(arm64_icache_sync_range)
 
 /*
@@ -161,7 +166,8 @@ ENTRY(arm64_icache_sync_range_checked)
/* XXX: See comment in arm64_icache_sync_range */
cache_handle_range  dcop = cvau
ic  ialluis
-   dsb ish
+   dsb ish
+   isb
SET_FAULT_HANDLER(xzr, x6)
mov x0, #0
ret
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343041 - head/sys/netpfil/pf

2019-01-15 Thread Kristof Provost
Author: kp
Date: Tue Jan 15 08:59:51 2019
New Revision: 343041
URL: https://svnweb.freebsd.org/changeset/base/343041

Log:
  pf: silence a runtime warning
  
  Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion 
failed'.
  This warning does not clarify anything for users, so silence it, just as
  OpenBSD has.
  
  PR:   234874
  MFC after:1 week

Modified:
  head/sys/netpfil/pf/pf_table.c

Modified: head/sys/netpfil/pf/pf_table.c
==
--- head/sys/netpfil/pf/pf_table.c  Tue Jan 15 06:52:34 2019
(r343040)
+++ head/sys/netpfil/pf/pf_table.c  Tue Jan 15 08:59:51 2019
(r343041)
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
+
 #defineACCEPT_FLAGS(flags, oklist) \
do {\
if ((flags & ~(oklist)) &   \
@@ -1992,7 +1994,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr
}
if ((ke == NULL || ke->pfrke_not) != notrule) {
if (op_pass != PFR_OP_PASS)
-   printf("pfr_update_stats: assertion failed.\n");
+   DPFPRINTF(PF_DEBUG_URGENT,
+   ("pfr_update_stats: assertion failed.\n"));
op_pass = PFR_OP_XPASS;
}
kt->pfrkt_packets[dir_out][op_pass]++;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"