svn commit: r346266 - head/sys/arm/conf

2019-09-03 Thread Peter Jeremy
Author: peterj
Date: Tue Apr 16 09:44:46 2019
New Revision: 346266
URL: https://svnweb.freebsd.org/changeset/base/346266

Log:
  Specify correct Ethernet phy for RPI-B
  
  Correct a typo in the RPI-B ethernet config - the RPi-B includes a
  SMC LAN9512 USB bridge and Ethernet 10/100 NIC/phy.  The phy part of
  this is supported by smscphy.
  
  Tested On: RPi1 Model B
  
  Approved by:  grog, jhb (mentors)
  MFC after:3 days

Modified:
  head/sys/arm/conf/RPI-B

Modified: head/sys/arm/conf/RPI-B
==
--- head/sys/arm/conf/RPI-B Tue Apr 16 09:42:42 2019(r346265)
+++ head/sys/arm/conf/RPI-B Tue Apr 16 09:44:46 2019(r346266)
@@ -77,7 +77,7 @@ deviceda
 device umass
 
 # USB ethernet support
-device smcphy
+device smscphy
 device mii
 device smsc
 


___
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: r346341 - head/tools/build

2019-09-03 Thread Ian Lepore
On Wed, 2019-04-17 at 20:32 -0700, Cy Schubert wrote:
> In message <201904180107.x3i17qdc002...@gndrsh.dnsmgr.net>, "Rodney
> W. 
> Grimes"
> writes:
> > > Author: cy
> > > Date: Thu Apr 18 01:02:00 2019
> > > New Revision: 346341
> > > URL: https://svnweb.freebsd.org/changeset/base/346341
> > > 
> > > Log:
> > >   As an interim measure until a more permanent solution is
> > > implemented
> > >   workaround the following error:
> > >   
> > >   /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error:
> > > use of
> > >   undeclared identifier
> > >   'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights,
> > > FA_OPEN);
> > >   
> > >   Reported by:O. Hartmann 
> > >   Reported by:Michael Butler 
> > >   Reported by:gjb@ & cy@ (implicit)
> > >   Reviewed by:emaste@
> > >   Noted by:   rgrimes@
> > > 
> > > Modified:
> > >   head/tools/build/Makefile
> > > 
> > > Modified: head/tools/build/Makefile
> > > =
> > > ==
> > 
> > ===
> > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019(
> > > r34634
> > 
> > 0)
> > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019(
> > > r34634
> > 
> > 1)
> > > @@ -59,9 +59,7 @@ INCS+=  capsicum_helpers.h
> > >  INCS+=   libcasper.h
> > >  .endif
> > >  
> > > -.if !exists(/usr/include/casper/cap_fileargs.h)
> > >  CASPERINC+=  ${SRCTOP}/lib/libcasper/services/cap_fileargs/c
> > > ap_filea
> > 
> > rgs.h
> > > -.endif
> > 
> > As a further note, we should probably hunt for any thing
> > that is explicity looking at /usr/include/... in a Makefile,
> > as that is minimally missing a ${DESTDIR} argument.
> > 
> > The above may of actually worked if it had been written:
> > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h)
> > someone may wish to test that.
> > 
> > Also a pathname rooted at / without ${DESTDIR} is almost certainly
> > a mistake.
> 
> This is a better solution. I tested this in a tree with a duplicated 
> environment: Problem solved. Before this is committed it should be 
> tested on one of the universe machines.
> 
> 

I'm having a hard time understanding how adding $DESTDIR is any kind of
solution to something that happens at build time as opposed to install
time.  I typically run buildworld/kernel without DESTDIR defined.

-- 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"


svn commit: r346262 - stable/10/sys/rpc/rpcsec_gss

2019-09-03 Thread Rick Macklem
Author: rmacklem
Date: Tue Apr 16 02:48:04 2019
New Revision: 346262
URL: https://svnweb.freebsd.org/changeset/base/346262

Log:
  MFC: r345818, r345828
  Fix a race in the RPCSEC_GSS server code that caused crashes.
  
  When a new client structure was allocated, it was added to the list
  so that it was visible to other threads before the expiry time was
  initialized, with only a single reference count.
  The caller would increment the reference count, but it was possible
  for another thread to decrement the reference count to zero and free
  the structure before the caller incremented the reference count.
  This could occur because the expiry time was still set to zero when
  the new client structure was inserted in the list and the list was
  unlocked.
  
  This patch fixes the race by initializing the reference count to two
  and initializing all fields, including the expiry time, before inserting
  it in the list.

Modified:
  stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==
--- stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c   Tue Apr 16 02:46:21 
2019(r346261)
+++ stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c   Tue Apr 16 02:48:04 
2019(r346262)
@@ -543,18 +543,17 @@ svc_rpc_gss_create_client(void)
 
client = mem_alloc(sizeof(struct svc_rpc_gss_client));
memset(client, 0, sizeof(struct svc_rpc_gss_client));
-   refcount_init(&client->cl_refs, 1);
+
+   /*
+* Set the initial value of cl_refs to two.  One for the caller
+* and the other to hold onto the client structure until it expires.
+*/
+   refcount_init(&client->cl_refs, 2);
sx_init(&client->cl_lock, "GSS-client");
getcredhostid(curthread->td_ucred, &hostid);
client->cl_id.ci_hostid = hostid;
client->cl_id.ci_boottime = boottime.tv_sec;
client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
-   list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
-   sx_xlock(&svc_rpc_gss_lock);
-   TAILQ_INSERT_HEAD(list, client, cl_link);
-   TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
-   svc_rpc_gss_client_count++;
-   sx_xunlock(&svc_rpc_gss_lock);
 
/*
 * Start the client off with a short expiration time. We will
@@ -564,6 +563,12 @@ svc_rpc_gss_create_client(void)
client->cl_locked = FALSE;
client->cl_expiration = time_uptime + 5*60;
 
+   list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
+   sx_xlock(&svc_rpc_gss_lock);
+   TAILQ_INSERT_HEAD(list, client, cl_link);
+   TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
+   svc_rpc_gss_client_count++;
+   sx_xunlock(&svc_rpc_gss_lock);
return (client);
 }
 
@@ -1261,7 +1266,6 @@ svc_rpc_gss(struct svc_req *rqst, struct rpc_msg *msg)
goto out;
}
client = svc_rpc_gss_create_client();
-   refcount_acquire(&client->cl_refs);
} else {
struct svc_rpc_gss_clientid *p;
if (gc.gc_handle.length != sizeof(*p)) {


___
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: r346319 - head/sys/netpfil/pf

2019-09-03 Thread Kristof Provost

On 17 Apr 2019, at 22:17, Gleb Smirnoff wrote:

  Kristof,

On Wed, Apr 17, 2019 at 04:42:54PM +, Kristof Provost wrote:
K> Modified: head/sys/netpfil/pf/pf_ioctl.c
K> 
==
K> --- head/sys/netpfil/pf/pf_ioctl.c	Wed Apr 17 16:31:30 
2019	(r346318)
K> +++ head/sys/netpfil/pf/pf_ioctl.c	Wed Apr 17 16:42:54 
2019	(r346319)

K> @@ -3103,24 +3103,24 @@ DIOCCHANGEADDR_error:
K>   break;
K>   }
K>
K> - PF_RULES_WLOCK();
K> + PF_RULES_RLOCK();
K>   n = pfr_table_count(&io->pfrio_table, io->pfrio_flags);
K>   io->pfrio_size = min(io->pfrio_size, n);
K> + PF_RULES_RUNLOCK();
K>
K>   totlen = io->pfrio_size * sizeof(struct pfr_table);
K>   pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table),
K>   M_TEMP, M_NOWAIT);
K>   if (pfrts == NULL) {
K>   error = ENOMEM;
K> - PF_RULES_WUNLOCK();
K>   break;
K>   }
K>   error = copyin(io->pfrio_buffer, pfrts, totlen);
K>   if (error) {
K>   free(pfrts, M_TEMP);
K> - PF_RULES_WUNLOCK();
K>   break;
K>   }
K> + PF_RULES_WLOCK();
K>   error = pfr_set_tflags(pfrts, io->pfrio_size,
K>   io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange,
K>   &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL);

Couple comments:

1) Now we can malloc with M_WAITOK.


That’s a good point. I’ll see about changing that tomorrow.

2) Are we sure that table count won't change while we dropped the 
lock?


No, the table count can indeed change while we’re unlocked. It 
doesn’t really matter though. The initial count only serves to limit 
the memory allocation to something sane.  pfr_set_tflags() still does 
appropriate checks.
It’s always been possible for the table count to change between user 
space preparing its request and it being handled in the kernel, so that 
was always a possibility.


Regards,
Kristof
___
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: r346334 - head/sys/arm/allwinner

2019-09-03 Thread Emmanuel Vadot
Author: manu
Date: Wed Apr 17 21:45:19 2019
New Revision: 346334
URL: https://svnweb.freebsd.org/changeset/base/346334

Log:
  arm: allwinner: Fix audio for Allwinner H3/H5
  
  Due to three conditions the codec driver for Allwinner A10/A20 and H3/H5 did 
not work properly here:
  
  Wrong bit position for the analog audio reset
  Hardware Reset of codec was not de-asserted correctly
  Linux DTS file did not contain the address of the analog register the way 
as the driver was expecting it.
  
  This patch proposes fixes for those three parts.
  
  Submitted by: freebsdnew...@freenet.de (Manuel Stühn)
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D19910

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

Modified: head/sys/arm/allwinner/a10_codec.c
==
--- head/sys/arm/allwinner/a10_codec.c  Wed Apr 17 20:16:48 2019
(r346333)
+++ head/sys/arm/allwinner/a10_codec.c  Wed Apr 17 21:45:19 2019
(r346334)
@@ -164,7 +164,7 @@ struct a10codec_chinfo {
 
 struct a10codec_info {
device_tdev;
-   struct resource *res[3];
+   struct resource *res[2];
struct mtx  *lock;
bus_dma_tag_t   dmat;
unsigneddmasize;
@@ -178,11 +178,12 @@ struct a10codec_info {
 
 static struct resource_spec a10codec_spec[] = {
{ SYS_RES_MEMORY,   0,  RF_ACTIVE },
-   { SYS_RES_MEMORY,   1,  RF_ACTIVE | RF_OPTIONAL },
-   { SYS_RES_IRQ,  0,  RF_ACTIVE },
{ -1, 0 }
 };
 
+#defineCODEC_ANALOG_READ(sc, reg)  
bus_read_4((sc)->res[1], (reg))
+#defineCODEC_ANALOG_WRITE(sc, reg, val)
bus_write_4((sc)->res[1], (reg), (val))
+
 #defineCODEC_READ(sc, reg) bus_read_4((sc)->res[0], (reg))
 #defineCODEC_WRITE(sc, reg, val)   bus_write_4((sc)->res[0], 
(reg), (val))
 
@@ -372,7 +373,7 @@ MIXER_DECLARE(a10_mixer);
  */
 
 #defineH3_PR_CFG   0x00
-#define H3_AC_PR_RST   (1 << 18)
+#define H3_AC_PR_RST   (1 << 28)
 #define H3_AC_PR_RW(1 << 24)
 #define H3_AC_PR_ADDR_SHIFT16
 #define H3_AC_PR_ADDR_MASK (0x1f << H3_AC_PR_ADDR_SHIFT)
@@ -424,23 +425,23 @@ h3_pr_read(struct a10codec_info *sc, u_int addr)
uint32_t val;
 
/* Read current value */
-   val = bus_read_4(sc->res[1], H3_PR_CFG);
+   val = CODEC_ANALOG_READ(sc, H3_PR_CFG);
 
/* De-assert reset */
val |= H3_AC_PR_RST;
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 
/* Read mode */
val &= ~H3_AC_PR_RW;
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 
/* Set address */
val &= ~H3_AC_PR_ADDR_MASK;
val |= (addr << H3_AC_PR_ADDR_SHIFT);
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 
/* Read data */
-   return (bus_read_4(sc->res[1], H3_PR_CFG) & H3_ACDA_PR_RDAT_MASK);
+   return (CODEC_ANALOG_READ(sc , H3_PR_CFG) & H3_ACDA_PR_RDAT_MASK);
 }
 
 static void
@@ -449,25 +450,25 @@ h3_pr_write(struct a10codec_info *sc, u_int addr, u_in
uint32_t val;
 
/* Read current value */
-   val = bus_read_4(sc->res[1], H3_PR_CFG);
+   val = CODEC_ANALOG_READ(sc, H3_PR_CFG);
 
/* De-assert reset */
val |= H3_AC_PR_RST;
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 
/* Set address */
val &= ~H3_AC_PR_ADDR_MASK;
val |= (addr << H3_AC_PR_ADDR_SHIFT);
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 
/* Write data */
val &= ~H3_ACDA_PR_WDAT_MASK;
val |= (data << H3_ACDA_PR_WDAT_SHIFT);
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 
/* Write mode */
val |= H3_AC_PR_RW;
-   bus_write_4(sc->res[1], H3_PR_CFG, val);
+   CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val);
 }
 
 static void
@@ -483,8 +484,28 @@ h3_pr_set_clear(struct a10codec_info *sc, u_int addr, 
 static int
 h3_mixer_init(struct snd_mixer *m)
 {
+   int rid=1;
+   pcell_t reg[2];
+   phandle_t analogref;
struct a10codec_info *sc = mix_getdevinfo(m);
 
+   if (OF_getencprop(ofw_bus_get_node(sc->dev), 
"allwinner,codec-analog-controls",
+   &analogref, sizeof(analogref)) <= 0) {
+   return (ENXIO);
+   }
+
+   if (OF_getencprop(OF_node_from_xref(analogref), "reg",
+   reg, sizeof(reg)) <= 0) {
+   return (ENXIO);
+   }
+
+   sc->res[1] = bus_alloc_resource(sc->dev, SYS_RES_MEMORY, &rid, reg[0],
+   reg[0]+reg[1], reg[1], RF_ACTIVE );
+
+ 

Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Conrad Meyer
On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer  wrote:
> E.g., the CI infrastructure for
> Riscv/Arm is/was generating minimal filesystem images and not
> populating /boot/entropy.

I should add, I say "is/was" because I have a PR out which may address
the problem: https://github.com/freebsd/freebsd-ci/pull/31

Best,
Conrad


___
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: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Conrad Meyer
On Tue, Apr 16, 2019 at 9:33 AM Warner Losh  wrote:
> In that case, we're better off having a MD routine that gets called if 
> there's no loader-provided entropy pool.

Yes, this is more or less the same plan I had.  There's no need to add
anything MD specific; we already abstract MD random sources behind the
harvest mechanism.

> (and requiring an NV store is not even an option to require, so don't go 
> there).

Systems lacking both an NV store and an entropy source available
during mi_startup (i.e., not interrupts...) cannot safely provide
entropy in early boot.  On those systems, we must disable random
consumption during early boot.

> What we can't do is just hang if the loader can't provide an entropy pool.

I think we're all on the same page there.

Best,
Conrad


___
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: r346289 - stable/11/sys/fs/msdosfs

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 16 17:56:53 2019
New Revision: 346289
URL: https://svnweb.freebsd.org/changeset/base/346289

Log:
  MFC r346064:
  Fix dirty buf exhaustion easily triggered with msdosfs.

Modified:
  stable/11/sys/fs/msdosfs/msdosfs_fat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/msdosfs/msdosfs_fat.c
==
--- stable/11/sys/fs/msdosfs/msdosfs_fat.c  Tue Apr 16 17:55:54 2019
(r346288)
+++ stable/11/sys/fs/msdosfs/msdosfs_fat.c  Tue Apr 16 17:56:53 2019
(r346289)
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -977,6 +978,7 @@ extendfile(struct denode *dep, u_long count, struct bu
u_long cn, got;
struct msdosfsmount *pmp = dep->de_pmp;
struct buf *bp;
+   struct vop_fsync_args fsync_ap;
daddr_t blkno;
 
/*
@@ -1086,8 +1088,16 @@ extendfile(struct denode *dep, u_long count, struct bu
if (bpp) {
*bpp = bp;
bpp = NULL;
-   } else
+   } else {
bdwrite(bp);
+   }
+   if (vm_page_count_severe() ||
+   buf_dirty_count_severe()) {
+   fsync_ap.a_vp = DETOV(dep);
+   fsync_ap.a_waitfor = MNT_WAIT;
+   fsync_ap.a_td = curthread;
+   vop_stdfsync(&fsync_ap);
+   }
}
}
}


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


svn commit: r346281 - head/sys/sys

2019-09-03 Thread Andrew Gallatin
Author: gallatin
Date: Tue Apr 16 16:49:34 2019
New Revision: 346281
URL: https://svnweb.freebsd.org/changeset/base/346281

Log:
  Replace cosqos with numa_domain in mbuf pkthdr
  
  The cosqos field was added nearly 6 years ago in r254804, and it is
  still unused by any in-tree consumers.  I have a patchset that I'm
  working on which aligns many network resources by NUMA domain,
  including inps, inpcb lb group, tcp pacing, lagg output link
  selection, backing pages for sendfile, and more.  It reduces
  cross-domain traffic by roughly 50% for a real web workload.
  
  This patchset relies on being able to store the numa domain in the
  mbuf, and grabbing the unused cosqos field for this purpose is the
  first step in starting to usptream it.
  
  Reviewed by:  kib, markj
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D19862

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Tue Apr 16 15:52:04 2019(r346280)
+++ head/sys/sys/mbuf.h Tue Apr 16 16:49:34 2019(r346281)
@@ -98,6 +98,7 @@ struct mbuf;
 #defineMLEN((int)(MSIZE - MHSIZE))
 #defineMHLEN   ((int)(MSIZE - MPKTHSIZE))
 #defineMINCLSIZE   (MHLEN + 1)
+#defineM_NODOM 255
 
 #ifdef _KERNEL
 /*-
@@ -158,7 +159,7 @@ struct pkthdr {
uint32_t flowid;/* packet's 4-tuple system */
uint32_t csum_flags;/* checksum and offload features */
uint16_t fibnum;/* this packet should use this fib */
-   uint8_t  cosqos;/* class/quality of service */
+   uint8_t  numa_domain;   /* NUMA domain of recvd pkt */
uint8_t  rsstype;   /* hash type */
union {
uint64_trcv_tstmp;  /* timestamp in ns */
@@ -405,33 +406,6 @@ struct mbuf {
 #defineM_HASHTYPE_SET(m, v)((m)->m_pkthdr.rsstype = (v))
 #defineM_HASHTYPE_TEST(m, v)   (M_HASHTYPE_GET(m) == (v))
 #defineM_HASHTYPE_ISHASH(m)(M_HASHTYPE_GET(m) & 
M_HASHTYPE_HASHPROP)
-
-/*
- * COS/QOS class and quality of service tags.
- * It uses DSCP code points as base.
- */
-#defineQOS_DSCP_CS00x00
-#defineQOS_DSCP_DEFQOS_DSCP_CS0
-#defineQOS_DSCP_CS10x20
-#defineQOS_DSCP_AF11   0x28
-#defineQOS_DSCP_AF12   0x30
-#defineQOS_DSCP_AF13   0x38
-#defineQOS_DSCP_CS20x40
-#defineQOS_DSCP_AF21   0x48
-#defineQOS_DSCP_AF22   0x50
-#defineQOS_DSCP_AF23   0x58
-#defineQOS_DSCP_CS30x60
-#defineQOS_DSCP_AF31   0x68
-#defineQOS_DSCP_AF32   0x70
-#defineQOS_DSCP_AF33   0x78
-#defineQOS_DSCP_CS40x80
-#defineQOS_DSCP_AF41   0x88
-#defineQOS_DSCP_AF42   0x90
-#defineQOS_DSCP_AF43   0x98
-#defineQOS_DSCP_CS50xa0
-#defineQOS_DSCP_EF 0xb8
-#defineQOS_DSCP_CS60xc0
-#defineQOS_DSCP_CS70xe0
 
 /*
  * External mbuf storage buffer types.


___
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: r346348 - head/share/man/man4

2019-09-03 Thread Tom Jones
Author: thj
Date: Thu Apr 18 11:06:45 2019
New Revision: 346348
URL: https://svnweb.freebsd.org/changeset/base/346348

Log:
  Add a bugs section to pflog man page
  
  FreeBSD does not set the pid field in the pfloghdr struct. This field is
  populated on other platforms, document this to save people from trying
  to use this field.
  
  Event:Aberdeen hackathon 2019
  Reviewed by:  kp, bcr, bz
  Approved by:  bz (mentor)
  Differential Revision:https://reviews.freebsd.org/D19952

Modified:
  head/share/man/man4/pflog.4

Modified: head/share/man/man4/pflog.4
==
--- head/share/man/man4/pflog.4 Thu Apr 18 10:54:08 2019(r346347)
+++ head/share/man/man4/pflog.4 Thu Apr 18 11:06:45 2019(r346348)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 9, 2019
+.Dd April 18, 2019
 .Dt PFLOG 4
 .Os
 .Sh NAME
@@ -110,5 +110,7 @@ The
 .Nm
 device first appeared in
 .Ox 3.0 .
-.\" .Sh BUGS
-.\" Anything here?
+.Sh BUGS
+FreeBSD does not set a process id in the
+.Fa pid
+field in pfloghdr.


___
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: r346292 - in head: . sys/kern

2019-09-03 Thread Conrad Meyer
Author: cem
Date: Tue Apr 16 18:47:20 2019
New Revision: 346292
URL: https://svnweb.freebsd.org/changeset/base/346292

Log:
  stack_protector: Add tunable to bypass random cookies
  
  This is a stopgap measure to unbreak installer/VM/embedded boot issues
  introduced (or at least exposed by) in r346250.
  
  Add the new tunable, "security.stack_protect.permit_nonrandom_cookies," in
  order to continue boot with insecure non-random stack cookies if the random
  device is unavailable.
  
  For now, enable it by default.  This is NOT safe.  It will be disabled by
  default in a future revision.
  
  There is follow-on work planned to use fast random sources (e.g., RDRAND on
  x86 and DARN on Power) to seed when the early entropy file cannot be
  provided, for whatever reason.  Please see D19928.
  
  Some better hacks may be used to make the non-random __stack_chk_guard
  slightly less predictable (from delphij@ and mjg@); those suggestions are
  left for a future revision.  I think it may also be plausible to move stack
  guard initialization far later in the boot process; potentially it could be
  moved all the way to just before userspace is started.
  
  Reported by:  many
  Reviewed by:  delphij, emaste, imp (all w/ caveat: this is a stopgap fix)
  Security: yes
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D19927

Modified:
  head/UPDATING
  head/sys/kern/stack_protector.c

Modified: head/UPDATING
==
--- head/UPDATING   Tue Apr 16 18:32:07 2019(r346291)
+++ head/UPDATING   Tue Apr 16 18:47:20 2019(r346292)
@@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20190416:
+   The tunable "security.stack_protect.permit_nonrandom_cookies" may be
+   set to a non-zero value to boot systems that do not provide early
+   entropy.  Otherwise, such systems may see the panic message:
+   "cannot initialize stack cookies because random device is not yet
+   seeded."
+
+20190416:
The loadable random module KPI has changed; the random_infra_init()
routine now requires a 3rd function pointer for a bool (*)(void)
method that returns true if the random device is seeded (and

Modified: head/sys/kern/stack_protector.c
==
--- head/sys/kern/stack_protector.c Tue Apr 16 18:32:07 2019
(r346291)
+++ head/sys/kern/stack_protector.c Tue Apr 16 18:47:20 2019
(r346292)
@@ -4,12 +4,28 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
 long __stack_chk_guard[8] = {};
 void __stack_chk_fail(void);
 
+/*
+ * XXX This default is unsafe!!!  We intend to change it after resolving issues
+ * with early entropy in the installer; some kinds of systems that do not use
+ * loader(8), such as riscv, aarch64, and power; and perhaps others that I am
+ * forgetting off the top of my head.
+ */
+static bool permit_nonrandom_cookies = true;
+
+SYSCTL_NODE(_security, OID_AUTO, stack_protect, CTLFLAG_RW, 0,
+"-fstack-protect support");
+SYSCTL_BOOL(_security_stack_protect, OID_AUTO, permit_nonrandom_cookies,
+CTLFLAG_RDTUN, &permit_nonrandom_cookies, 0,
+"Allow stack guard to be used without real random cookies");
+
 void
 __stack_chk_fail(void)
 {
@@ -23,8 +39,37 @@ __stack_chk_init(void *dummy __unused)
size_t i;
long guard[nitems(__stack_chk_guard)];
 
-   arc4rand(guard, sizeof(guard), 0);
-   for (i = 0; i < nitems(guard); i++)
-   __stack_chk_guard[i] = guard[i];
+   if (is_random_seeded()) {
+   arc4rand(guard, sizeof(guard), 0);
+   for (i = 0; i < nitems(guard); i++)
+   __stack_chk_guard[i] = guard[i];
+   return;
+   }
+
+   if (permit_nonrandom_cookies) {
+   printf("%s: WARNING: Initializing stack protection with "
+   "non-random cookies!\n", __func__);
+   printf("%s: WARNING: This severely limits the benefit of "
+   "-fstack-protector!\n", __func__);
+
+   /*
+* The emperor is naked, but I rolled some dice and at least
+* these values aren't zero.
+*/
+   __stack_chk_guard[0] = (long)0xe7318d5959af899full;
+   __stack_chk_guard[1] = (long)0x35a9481c089348bfull;
+   __stack_chk_guard[2] = (long)0xde657fdc04117255ull;
+   __stack_chk_guard[3] = (long)0x0dd44c61c22e4a6bull;
+   __stack_chk_guard[4] = (long)0x0a5869a354edb0a5ull;
+   __stack_chk_guard[5] = (long)0x05cebfed255b5232ull;
+   __stack_chk_guard[6] = (long)0x270ffac137c4c72full;
+   __stack_chk_guard[7] = (long)0xd8141a789bad478dull;

svn commit: r346352 - head/sys/x86/iommu

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 18 14:18:06 2019
New Revision: 346352
URL: https://svnweb.freebsd.org/changeset/base/346352

Log:
  Correct handling of RMRR during early enumeration stages.
  
  On some machines, DMAR contexts must be created before all devices
  under the scope of the corresponding DMAR unit are enumerated.
  Current code has two problems with that:
  - scope lookup returns NULL device_t, which causes to skip creating a
context with RMRR, which is fatal for the affected device.
  - calculation of the final pci dbsf address fails if any bridge in the
scope is not yet enumerated, because code relies on pcib_get_bus().
  
  Make creation of contexts work either with device_t, or with DMAR PCI
  scope paths.  Scope provides enough information to infer context
  address, and it is directly matched against DMAR tables scopes.
  
  When calculating bus addresses for the scope or device, use direct
  pci_cfgregread(PCIR_SECBUS_1) to get the secondary bus number, instead
  of pcib_get_bus().
  
  The issue was observed on HP Gen servers, where iLO PCI devices are
  located behind south bridge switch.  Turning on translation without
  satisfying RMRR requests caused iLO to mostly hang, up to the level of
  being unusable to control the server.
  
  While there, remove hw.dmar.dmar_match_verbose tunable, and make the
  normal logging under bootverbose useful and sufficient to diagnose
  DRHD and RMRR parsing and matching.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/x86/iommu/busdma_dmar.c
  head/sys/x86/iommu/intel_ctx.c
  head/sys/x86/iommu/intel_dmar.h
  head/sys/x86/iommu/intel_drv.c
  head/sys/x86/iommu/intel_intrmap.c
  head/sys/x86/iommu/intel_utils.c

Modified: head/sys/x86/iommu/busdma_dmar.c
==
--- head/sys/x86/iommu/busdma_dmar.cThu Apr 18 14:03:59 2019
(r346351)
+++ head/sys/x86/iommu/busdma_dmar.cThu Apr 18 14:18:06 2019
(r346352)
@@ -275,7 +275,7 @@ dmar_get_dma_tag(device_t dev, device_t child)
struct dmar_ctx *ctx;
bus_dma_tag_t res;
 
-   dmar = dmar_find(child);
+   dmar = dmar_find(child, bootverbose);
/* Not in scope of any DMAR ? */
if (dmar == NULL)
return (NULL);

Modified: head/sys/x86/iommu/intel_ctx.c
==
--- head/sys/x86/iommu/intel_ctx.c  Thu Apr 18 14:03:59 2019
(r346351)
+++ head/sys/x86/iommu/intel_ctx.c  Thu Apr 18 14:18:06 2019
(r346352)
@@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -203,7 +205,9 @@ dmar_flush_for_ctx_entry(struct dmar_unit *dmar, bool 
 }
 
 static int
-domain_init_rmrr(struct dmar_domain *domain, device_t dev)
+domain_init_rmrr(struct dmar_domain *domain, device_t dev, int bus,
+int slot, int func, int dev_domain, int dev_busno,
+const void *dev_path, int dev_path_len)
 {
struct dmar_map_entries_tailq rmrr_entries;
struct dmar_map_entry *entry, *entry1;
@@ -214,7 +218,8 @@ domain_init_rmrr(struct dmar_domain *domain, device_t 
 
error = 0;
TAILQ_INIT(&rmrr_entries);
-   dmar_dev_parse_rmrr(domain, dev, &rmrr_entries);
+   dmar_dev_parse_rmrr(domain, dev_domain, dev_busno, dev_path,
+   dev_path_len, &rmrr_entries);
TAILQ_FOREACH_SAFE(entry, &rmrr_entries, unroll_link, entry1) {
/*
 * VT-d specification requires that the start of an
@@ -227,12 +232,19 @@ domain_init_rmrr(struct dmar_domain *domain, device_t 
 */
start = entry->start;
end = entry->end;
+   if (bootverbose)
+   printf("dmar%d ctx pci%d:%d:%d RMRR [%#jx, %#jx]\n",
+   domain->dmar->unit, bus, slot, func,
+   (uintmax_t)start, (uintmax_t)end);
entry->start = trunc_page(start);
entry->end = round_page(end);
if (entry->start == entry->end) {
/* Workaround for some AMI (?) BIOSes */
if (bootverbose) {
-   device_printf(dev, "BIOS bug: dmar%d RMRR "
+   if (dev != NULL)
+   device_printf(dev, "");
+   printf("pci%d:%d:%d ", bus, slot, func);
+   printf("BIOS bug: dmar%d RMRR "
"region (%jx, %jx) corrected\n",
domain->dmar->unit, start, end);
}
@@ -260,9 +272,13 @@ domain_init_rmrr(struct dmar_domain *domain, device_t 
DMAR_UNLOCK(domain->dmar);
} else {
if (error1 != 0) {
- 

svn commit: r346382 - stable/11/sys/dev/pci

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 19 13:04:48 2019
New Revision: 346382
URL: https://svnweb.freebsd.org/changeset/base/346382

Log:
  MFC r345963, r345997:
  Implement resets for PCI buses and PCIe bridges.

Modified:
  stable/11/sys/dev/pci/pci.c
  stable/11/sys/dev/pci/pci_pci.c
  stable/11/sys/dev/pci/pcivar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/pci/pci.c
==
--- stable/11/sys/dev/pci/pci.c Fri Apr 19 12:57:37 2019(r346381)
+++ stable/11/sys/dev/pci/pci.c Fri Apr 19 13:04:48 2019(r346382)
@@ -121,6 +121,10 @@ static voidpci_resume_msi(device_t dev);
 static voidpci_resume_msix(device_t dev);
 static int pci_remap_intr_method(device_t bus, device_t dev,
u_int irq);
+static int pci_reset_post(device_t dev, device_t child);
+static int pci_reset_prepare(device_t dev, device_t child);
+static int pci_reset_child(device_t dev, device_t child,
+   int flags);
 
 static int pci_get_id_method(device_t dev, device_t child,
enum pci_id_type type, uintptr_t *rid);
@@ -145,6 +149,9 @@ static device_method_t pci_methods[] = {
DEVMETHOD(bus_driver_added, pci_driver_added),
DEVMETHOD(bus_setup_intr,   pci_setup_intr),
DEVMETHOD(bus_teardown_intr,pci_teardown_intr),
+   DEVMETHOD(bus_reset_prepare,pci_reset_prepare),
+   DEVMETHOD(bus_reset_post,   pci_reset_post),
+   DEVMETHOD(bus_reset_child,  pci_reset_child),
 
DEVMETHOD(bus_get_dma_tag,  pci_get_dma_tag),
DEVMETHOD(bus_get_resource_list,pci_get_resource_list),
@@ -6295,6 +6302,94 @@ pcie_flr(device_t dev, u_int max_delay, bool force)
PCIEM_STA_TRANSACTION_PND)
pci_printf(&dinfo->cfg, "Transactions pending after FLR!\n");
return (true);
+}
+
+/*
+ * Attempt a power-management reset by cycling the device in/out of D3
+ * state.  PCI spec says we can only go into D3 state from D0 state.
+ * Transition from D[12] into D0 before going to D3 state.
+ */
+int
+pci_power_reset(device_t dev)
+{
+   int ps;
+
+   ps = pci_get_powerstate(dev);
+   if (ps != PCI_POWERSTATE_D0 && ps != PCI_POWERSTATE_D3)
+   pci_set_powerstate(dev, PCI_POWERSTATE_D0);
+   pci_set_powerstate(dev, PCI_POWERSTATE_D3);
+   pci_set_powerstate(dev, ps);
+   return (0);
+}
+
+/*
+ * Try link drop and retrain of the downstream port of upstream
+ * switch, for PCIe.  According to the PCIe 3.0 spec 6.6.1, this must
+ * cause Conventional Hot reset of the device in the slot.
+ * Alternative, for PCIe, could be the secondary bus reset initiatied
+ * on the upstream switch PCIR_BRIDGECTL_1, bit 6.
+ */
+int
+pcie_link_reset(device_t port, int pcie_location)
+{
+   uint16_t v;
+
+   v = pci_read_config(port, pcie_location + PCIER_LINK_CTL, 2);
+   v |= PCIEM_LINK_CTL_LINK_DIS;
+   pci_write_config(port, pcie_location + PCIER_LINK_CTL, v, 2);
+   pause_sbt("pcier1", mstosbt(20), 0, 0);
+   v &= ~PCIEM_LINK_CTL_LINK_DIS;
+   v |= PCIEM_LINK_CTL_RETRAIN_LINK;
+   pci_write_config(port, pcie_location + PCIER_LINK_CTL, v, 2);
+   pause_sbt("pcier2", mstosbt(100), 0, 0); /* 100 ms */
+   v = pci_read_config(port, pcie_location + PCIER_LINK_STA, 2);
+   return ((v & PCIEM_LINK_STA_TRAINING) != 0 ? ETIMEDOUT : 0);
+}
+
+static int
+pci_reset_post(device_t dev, device_t child)
+{
+
+   if (dev == device_get_parent(child))
+   pci_restore_state(child);
+   return (0);
+}
+
+static int
+pci_reset_prepare(device_t dev, device_t child)
+{
+
+   if (dev == device_get_parent(child))
+   pci_save_state(child);
+   return (0);
+}
+
+static int
+pci_reset_child(device_t dev, device_t child, int flags)
+{
+   int error;
+
+   if (dev == NULL || device_get_parent(child) != dev)
+   return (0);
+   if ((flags & DEVF_RESET_DETACH) != 0) {
+   error = device_get_state(child) == DS_ATTACHED ?
+   device_detach(child) : 0;
+   } else {
+   error = BUS_SUSPEND_CHILD(dev, child);
+   }
+   if (error == 0) {
+   if (!pcie_flr(child, 1000, false)) {
+   error = BUS_RESET_PREPARE(dev, child);
+   if (error == 0)
+   pci_power_reset(child);
+   BUS_RESET_POST(dev, child);
+   }
+   if ((flags & DEVF_RESET_DETACH) != 0)
+   device_probe_and_attach(child);
+   else
+   BUS_RESUME_CHILD(dev, child);
+   }
+   return (error);
 }
 
 static void

Modified: stable/11/sys/dev/pci/pci_pci.c
==

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

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Tue Apr 16 20:56:51 2019
New Revision: 346300
URL: https://svnweb.freebsd.org/changeset/base/346300

Log:
  MFC r345180, r345187: if_bridge(4): Fix module teardown
  
  r345180: if_bridge(4): Fix module teardown
  
  bridge_rtnode_zone still has outstanding allocations at the time of
  destruction in the current model because all of the interface teardown
  happens in a VNET_SYSUNINIT, -after- the MOD_UNLOAD has already been
  processed.  The SYSUNINIT triggers destruction of the interfaces, which then
  attempts to free the memory from the zone that's already been destroyed, and
  we hit a panic.
  
  Solve this by virtualizing the uma_zone we allocate the rtnodes from to fix
  the ordering. bridge_rtable_fini should also take care to flush any
  remaining routes that weren't taken care of when dynamic routes were flushed
  in bridge_stop.
  
  r345187: bridge: Fix STP-related panic
  
  After r345180 we need to have the appropriate vnet context set to delete an
  rtnode in bridge_rtnode_destroy().
  That's usually the case, but not when it's called by the STP code (through
  bstp_notify_rtage()).
  
  We have to set the vnet context in bridge_rtable_expire() just as we do in the
  other STP callback bridge_state_change().

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

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

Modified: stable/12/sys/net/if_bridge.c
==
--- stable/12/sys/net/if_bridge.c   Tue Apr 16 20:41:04 2019
(r346299)
+++ stable/12/sys/net/if_bridge.c   Tue Apr 16 20:56:51 2019
(r346300)
@@ -235,7 +235,8 @@ static eventhandler_tag bridge_detach_cookie;
 
 intbridge_rtable_prune_period = BRIDGE_RTABLE_PRUNE_PERIOD;
 
-uma_zone_t bridge_rtnode_zone;
+VNET_DEFINE_STATIC(uma_zone_t, bridge_rtnode_zone);
+#defineV_bridge_rtnode_zoneVNET(bridge_rtnode_zone)
 
 static int bridge_clone_create(struct if_clone *, int, caddr_t);
 static voidbridge_clone_destroy(struct ifnet *);
@@ -527,6 +528,9 @@ static void
 vnet_bridge_init(const void *unused __unused)
 {
 
+   V_bridge_rtnode_zone = uma_zcreate("bridge_rtnode",
+   sizeof(struct bridge_rtnode), NULL, NULL, NULL, NULL,
+   UMA_ALIGN_PTR, 0);
BRIDGE_LIST_LOCK_INIT();
LIST_INIT(&V_bridge_list);
V_bridge_cloner = if_clone_simple(bridge_name,
@@ -542,6 +546,7 @@ vnet_bridge_uninit(const void *unused __unused)
if_clone_detach(V_bridge_cloner);
V_bridge_cloner = NULL;
BRIDGE_LIST_LOCK_DESTROY();
+   uma_zdestroy(V_bridge_rtnode_zone);
 }
 VNET_SYSUNINIT(vnet_bridge_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY,
 vnet_bridge_uninit, NULL);
@@ -552,9 +557,6 @@ bridge_modevent(module_t mod, int type, void *data)
 
switch (type) {
case MOD_LOAD:
-   bridge_rtnode_zone = uma_zcreate("bridge_rtnode",
-   sizeof(struct bridge_rtnode), NULL, NULL, NULL, NULL,
-   UMA_ALIGN_PTR, 0);
bridge_dn_p = bridge_dummynet;
bridge_detach_cookie = EVENTHANDLER_REGISTER(
ifnet_departure_event, bridge_ifdetach, NULL,
@@ -563,7 +565,6 @@ bridge_modevent(module_t mod, int type, void *data)
case MOD_UNLOAD:
EVENTHANDLER_DEREGISTER(ifnet_departure_event,
bridge_detach_cookie);
-   uma_zdestroy(bridge_rtnode_zone);
bridge_dn_p = NULL;
break;
default:
@@ -732,6 +733,9 @@ bridge_clone_destroy(struct ifnet *ifp)
bridge_delete_span(sc, bif);
}
 
+   /* Tear down the routing table. */
+   bridge_rtable_fini(sc);
+
BRIDGE_UNLOCK(sc);
 
callout_drain(&sc->sc_brcallout);
@@ -744,9 +748,6 @@ bridge_clone_destroy(struct ifnet *ifp)
ether_ifdetach(ifp);
if_free(ifp);
 
-   /* Tear down the routing table. */
-   bridge_rtable_fini(sc);
-
BRIDGE_LOCK_DESTROY(sc);
free(sc, M_DEVBUF);
 }
@@ -2671,7 +2672,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t
 * initialize the expiration time and Ethernet
 * address.
 */
-   brt = uma_zalloc(bridge_rtnode_zone, M_NOWAIT | M_ZERO);
+   brt = uma_zalloc(V_bridge_rtnode_zone, M_NOWAIT | M_ZERO);
if (brt == NULL)
return (ENOMEM);
 
@@ -2684,7 +2685,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t
brt->brt_vlan = vlan;
 
if ((error = bridge_rtnode_insert(sc, brt)) != 0) {
-   uma_zfree(bridge_rtnode_zone, brt);
+   uma_zfree(V_bridge_rtnode_zone, brt);
return (error);
}
 

svn commit: r346332 - in head: share/man/man9 sys/conf sys/dev/ofw

2019-09-03 Thread Emmanuel Vadot
Author: manu
Date: Wed Apr 17 20:09:01 2019
New Revision: 346332
URL: https://svnweb.freebsd.org/changeset/base/346332

Log:
  ofw_graph: Add functions for graph bindings
  
  Those functions are helpers to work on graph bindings.
  graphs are mostly use with video related devices.
  See 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/graph.txt?id=4436a3711e3249840e0679e92d3c951bcaf25515
  
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D19877

Added:
  head/share/man/man9/ofw_graph.9   (contents, props changed)
  head/sys/dev/ofw/ofw_graph.c   (contents, props changed)
  head/sys/dev/ofw/ofw_graph.h   (contents, props changed)
Modified:
  head/sys/conf/files

Added: head/share/man/man9/ofw_graph.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/ofw_graph.9 Wed Apr 17 20:09:01 2019
(r346332)
@@ -0,0 +1,106 @@
+.\" Copyright (c) 2019 Emmanuel Vadot 
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 10, 2019
+.Dt ofw_graph 9
+.Os
+.Sh NAME
+.Nm ofw_graph ,
+.Nm ofw_graph_get_port_by_idx ,
+.Nm ofw_graph_port_get_num_endpoints ,
+.Nm ofw_graph_get_endpoint_by_idx ,
+.Nm ofw_graph_get_remote_endpoint ,
+.Nm ofw_graph_get_remote_parent ,
+.Nm ofw_graph_get_device_by_port_ep ,
+.Nd Helpers for the graph bindings
+.Sh SYNOPSIS
+.In dev/ofw/openfirm.h
+.In dev/ofw/ofw_graph.h
+.Ft phandle_t
+.Fn ofw_graph_get_port_by_idx "phandle_t node" "uint32_t idx"
+.Ft size_t
+.Fn ofw_graph_port_get_num_endpoints "phandle_t port"
+.Ft phandle_t
+.Fn ofw_graph_get_endpoint_by_idx "phandle_t port" "uint32_t idx"
+.Ft phandle_t
+.Fn ofw_graph_get_remote_endpoint "phandle_t endpoint"
+.Ft phandle_t
+.Fn ofw_graph_get_remote_parent "phandle_t remote"
+.Ft device_t
+.Fn ofw_graph_get_device_by_port_ep "phandle_t node" "uint32_t port_id" 
"uin32_t ep_id"
+.Sh DESCRIPTION
+.Pp
+The ofw_graph functions are helpers to parse the DTS graph bindings
+.Pp
+.Fn ofw_graph_get_port_by_idx
+return the port with id
+.Fa idx .
+It will first check node named
+.Fa port@idx
+and then fallback on checking the
+.Fa ports
+child for a child node matching the id. If no ports matching
+.Fa idx
+is found the function return 0.
+.Pp
+.Fn ofw_graph_port_get_num_endpoints
+returns the number of endpoints a port node have.
+.Pp
+.Fn ofw_graph_get_endpoint_by_idx
+return the endpoint with id
+.Fa idx .
+It will first check if there is a single child named
+.Fa endpoint
+and returns it if there is. If there is multiple endpoints it will check
+the
+.Fa reg
+property and returns the correct
+.Fa phandle_t
+or 0 if none match.
+.Pp
+.Fn ofw_graph_get_remote_endpoint
+returns the
+.Fa remote-endpoint
+property if it exists or 0.
+.Pp
+.Fn ofw_graph_get_remote_parent
+returns the device node corresponding to the
+.Fa remote-endpoint
+phandle or 0 if none.
+.Fn ofw_graph_get_device_by_port_ep
+returns the device associated with the port and endpoint or
+.Fa NULL
+if none. The device driver should have called
+.Fn OF_device_register_xref
+before.
+.Fn 
+.Sh HISTORY
+The
+.Nm ofw_graph
+functions first appeared in
+.Fx 13.0 .
+The
+.Nm ofw_graph
+functions and manual page were written by
+.An Emmanuel Vadot Aq Mt m...@freebsd.org .

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Apr 17 20:08:01 2019(r346331)
+++ head/sys/conf/files Wed Apr 17 20:09:01 2019(r346332)
@@ -2536,6 +2536,7 @@ dev/ofw/ofw_bus_subr.coptional fdt
 dev/ofw/ofw_cpu.c  optional fd

svn commit: r346271 - in head/sys/arm/allwinner: . clkng

2019-09-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 16 12:39:31 2019
New Revision: 346271
URL: https://svnweb.freebsd.org/changeset/base/346271

Log:
  aw_rtc: Register the clocks
  
  Since latest DTS update the rtc is supposed to register two clocks :
  
  - osc32k (the 32k oscillator on the board that the RTC uses directly and
  that other peripheral can use)
  - iosc (the internal oscillator of the RTC when available which frequency
  depend on the SoC revision)
  
  Since we need the RTC before the proper clock control unit (because it uses
  those clocks) attach it a BUS_PASS_BUS + MIDDLE and attach the clock control
  unit at BUS_PASS_BUS + LAST for the SoC that requires it.
  
  Tested On: A20, H3, A64
  
  MFC after:1 month

Modified:
  head/sys/arm/allwinner/aw_rtc.c
  head/sys/arm/allwinner/clkng/ccu_a31.c
  head/sys/arm/allwinner/clkng/ccu_a64.c
  head/sys/arm/allwinner/clkng/ccu_a83t.c
  head/sys/arm/allwinner/clkng/ccu_h3.c

Modified: head/sys/arm/allwinner/aw_rtc.c
==
--- head/sys/arm/allwinner/aw_rtc.c Tue Apr 16 12:25:15 2019
(r346270)
+++ head/sys/arm/allwinner/aw_rtc.c Tue Apr 16 12:39:31 2019
(r346271)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2019 Emmanuel Vadot 
  * Copyright (c) 2016 Vladimir Belian 
  * All rights reserved.
  *
@@ -43,6 +44,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include "clock_if.h"
@@ -62,7 +65,7 @@ __FBSDID("$FreeBSD$");
 #defineLOSC_MAGIC  0x16aa
 #defineLOSC_BUSY_MASK  0x0380
 
-#defineIS_SUN7I(sc->type == A20_RTC)
+#defineIS_SUN7I(sc->conf->is_a20 == true)
 
 #defineYEAR_MIN(IS_SUN7I ? 1970 : 2010)
 #defineYEAR_MAX(IS_SUN7I ? 2100 : 2073)
@@ -92,27 +95,68 @@ __FBSDID("$FreeBSD$");
 #defineRTC_READ(sc, reg)   bus_read_4((sc)->res, (reg))
 #defineRTC_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), 
(val))
 
-#defineIS_LEAP_YEAR(y) \
-   (((y) % 400) == 0 || (((y) % 100) != 0 && ((y) % 4) == 0))
+#defineIS_LEAP_YEAR(y) (((y) % 400) == 0 || (((y) % 100) != 0 && ((y) 
% 4) == 0))
 
-#defineA10_RTC 1
-#defineA20_RTC 2
-#defineA31_RTC 3
+struct aw_rtc_conf {
+   uint64_tiosc_freq;
+   bus_size_t  rtc_date;
+   bus_size_t  rtc_time;
+   bus_size_t  rtc_losc_sta;
+   boolis_a20;
+};
 
+struct aw_rtc_conf a10_conf = {
+   .rtc_date = A10_RTC_DATE_REG,
+   .rtc_time = A10_RTC_TIME_REG,
+   .rtc_losc_sta = LOSC_CTRL_REG,
+};
+
+struct aw_rtc_conf a20_conf = {
+   .rtc_date = A10_RTC_DATE_REG,
+   .rtc_time = A10_RTC_TIME_REG,
+   .rtc_losc_sta = LOSC_CTRL_REG,
+   .is_a20 = true,
+};
+
+struct aw_rtc_conf a31_conf = {
+   .iosc_freq = 65,/* between 600 and 700 Khz */
+   .rtc_date = A31_RTC_DATE_REG,
+   .rtc_time = A31_RTC_TIME_REG,
+   .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA,
+};
+
+struct aw_rtc_conf h3_conf = {
+   .iosc_freq = 1600,
+   .rtc_date = A31_RTC_DATE_REG,
+   .rtc_time = A31_RTC_TIME_REG,
+   .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA,
+};
+
 static struct ofw_compat_data compat_data[] = {
-   { "allwinner,sun4i-a10-rtc", A10_RTC },
-   { "allwinner,sun7i-a20-rtc", A20_RTC },
-   { "allwinner,sun6i-a31-rtc", A31_RTC },
+   { "allwinner,sun4i-a10-rtc", (uintptr_t) &a10_conf },
+   { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf },
+   { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf },
+   { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf },
{ NULL, 0 }
 };
 
 struct aw_rtc_softc {
struct resource *res;
+   struct aw_rtc_conf  *conf;
int type;
-   bus_size_t  rtc_date;
-   bus_size_t  rtc_time;
 };
 
+static struct clk_fixed_def aw_rtc_osc32k = {
+   .clkdef.id = 0,
+   .freq = 32768,
+};
+
+static struct clk_fixed_def aw_rtc_iosc = {
+   .clkdef.id = 2,
+};
+
+static voidaw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev);
+
 static int aw_rtc_probe(device_t dev);
 static int aw_rtc_attach(device_t dev);
 static int aw_rtc_detach(device_t dev);
@@ -140,9 +184,8 @@ static driver_t aw_rtc_driver = {
 static devclass_t aw_rtc_devclass;
 
 EARLY_DRIVER_MODULE(aw_rtc, simplebus, aw_rtc_driver, aw_rtc_devclass, 0, 0,
-BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
+BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
 
-
 static int
 aw_rtc_probe(device_t dev)
 {
@@ -161,7 +204,6 @@ static int
 aw_rtc_attach(device_t dev)
 {
struct aw_rtc_softc *sc  = device_get_softc(dev);
-   bus_size_t rtc_losc_sta;
uint32_t val;
int rid = 0;
 
@@ -171,20 +213,7 @@ aw_rtc_attach(device_t dev)

Re: svn commit: r345562 - in head/sys: amd64/amd64 i386/i386

2019-09-03 Thread Ed Maste
On Tue, 26 Mar 2019 at 18:45, Conrad Meyer  wrote:
>
> Author: cem
> Date: Tue Mar 26 22:45:41 2019
> New Revision: 345562
> URL: https://svnweb.freebsd.org/changeset/base/345562
>
> Log:
>   x86: Use XSAVEOPT for fpusave(), when available
>
>   Remove redundant npxsave_core definition while here.
>
>   Suggested by: Anton Rang
>   Reviewed by:  kib, Anton Rang 
>   Sponsored by: Dell EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D19665

Note that this introduced failures in the i386 CI tests, PR 236936.

Investigation is ongoing and taking some time, in part because the
behaviour may be different between an i386 userland in an amd64 jail
versus running on an i386 kernel.


___
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: r346341 - head/tools/build

2019-09-03 Thread John Baldwin
On 4/18/19 9:26 AM, Cy Schubert wrote:
> On April 18, 2019 8:11:49 AM PDT, Warner Losh  wrote:
>> On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert 
>> wrote:
>>
>>> On April 18, 2019 7:22:53 AM PDT, "Rodney W. Grimes" <
>>> free...@gndrsh.dnsmgr.net> wrote:
> On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes
>  wrote:
>>
>>> In message <201904180107.x3i17qdc002...@gndrsh.dnsmgr.net>,
 "Rodney W.
>>> Grimes"
>>> writes:
> Author: cy
> Date: Thu Apr 18 01:02:00 2019
> New Revision: 346341
> URL: https://svnweb.freebsd.org/changeset/base/346341
>
> Log:
>   As an interim measure until a more permanent solution is
 implemented
>   workaround the following error:
>
>   /usr/src/contrib/elftoolchain/strings/strings.c:198:55:
 error: use of
>   undeclared identifier
>   'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0,
 &rights, FA_OPEN);
>
>   Reported by:O. Hartmann 
>   Reported by:Michael Butler
>> 
>   Reported by:gjb@ & cy@ (implicit)
>   Reviewed by:emaste@
>   Noted by:   rgrimes@
>
> Modified:
>   head/tools/build/Makefile
>
> Modified: head/tools/build/Makefile
>
>>>
>>>
>>> ===
 ===
> --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019
(r34634
 0)
> +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019
(r34634
 1)
> @@ -59,9 +59,7 @@ INCS+=  capsicum_helpers.h
>  INCS+=   libcasper.h
>  .endif
>
> -.if !exists(/usr/include/casper/cap_fileargs.h)
>  CASPERINC+=
 ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea
 rgs.h
> -.endif

 As a further note, we should probably hunt for any thing
 that is explicity looking at /usr/include/... in a Makefile,
 as that is minimally missing a ${DESTDIR} argument.

 The above may of actually worked if it had been written:
 .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h)
 someone may wish to test that.

 Also a pathname rooted at / without ${DESTDIR} is almost
 certainly a mistake.
>>>
>>> This is a better solution. I tested this in a tree with a
 duplicated
>>> environment: Problem solved. Before this is committed it
>> should
 be
>>> tested on one of the universe machines.
>>
>> From what Ed just said this would also be wrong,
>> as well as CASPERINC+= above being wrong, if this
>> is being built for the host we should not be using
>> any headers from ${SRCTOP} at all.
>>
>> if capfileargs.h does not exist on the host that functionality
>> must not be compiled into the buildtool as the host does not
>> have this feature and attempting to use it from SRCTOP is wrong.
>>
>
> Keep in mind that this is bootstrap; it's being built for the host
> system, but it will link against a version of libcasper that's
>> been
> built in an earlier stage with the proper featureset.

 Ok, flip flop again, if infact this is linked against a
 library that implements the stuff from cap_fileargs.h then
 infact the ${DESTDIR} addition so that the build peaks into
 the cross build tree is correct, or what ever the equivelent
 to DESTDIR is for that ?  BUILDDIR?  The point is it should
 be picking this header up from the object tree, NOT from
 the running system.
>>>
>>> Yes, this was my conclusion when working on kerberos and ntp. This is
>> also
>>> true of libraries,  else one would need to installworld and
>> buildworld
>>> again to get a properly built library/binary.
>>>
>>> IIRC ngie@ fixed a number of these across the tree a couple of years
>> ago.
>>
>>
>> OK. There's a number of different issues going on. As the original
>> author
>> of libegacy (which is what we're seeing fail), let me address the
>> design
>> generically and comment on different things that have come up in this
>> thread.
>>
>> Since this is going into the libegacy that we're using to build the
>> system,
>> the check for file is bogus, for reasons I'll discuss below.  When we
>> add
>> new includes to the system, it is appropriate to do it this way. And
>> when
>> this file was added to the system, the check was correct.
>>
>> First off, DESTDIR is absolutely not correct since this is to build the
>> legacy library and legacy includes which augment the host's sources on
>> legacay system, hence the name. It's never the correct thing to use.
>>
>> The problem that we have here is not that the file is missing (which is
>> why
>> it was added the way it was a long time ago), but rather missing
>> functionality in a file that's been around for 

svn commit: r346311 - head/share/misc

2019-09-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 17 14:20:55 2019
New Revision: 346311
URL: https://svnweb.freebsd.org/changeset/base/346311

Log:
  Add orphan mentee.

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Apr 17 14:12:11 2019
(r346310)
+++ head/share/misc/committers-src.dot  Wed Apr 17 14:20:55 2019
(r346311)
@@ -743,6 +743,7 @@ obrien -> gshapiro
 obrien -> kan
 obrien -> sam
 
+pfg -> pstef
 pfg -> fsu
 
 peter -> asmodai


___
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: r346341 - head/tools/build

2019-09-03 Thread Warner Losh
On Thu, Apr 18, 2019 at 10:26 AM Cy Schubert 
wrote:

> On April 18, 2019 8:11:49 AM PDT, Warner Losh  wrote:
>>
>>
>>
>> On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert 
>> wrote:
>>
>>> On April 18, 2019 7:22:53 AM PDT, "Rodney W. Grimes" <
>>> free...@gndrsh.dnsmgr.net> wrote:
>>> >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes
>>> >>  wrote:
>>> >> >
>>> >> > > In message <201904180107.x3i17qdc002...@gndrsh.dnsmgr.net>,
>>> >"Rodney W.
>>> >> > > Grimes"
>>> >> > > writes:
>>> >> > > > > Author: cy
>>> >> > > > > Date: Thu Apr 18 01:02:00 2019
>>> >> > > > > New Revision: 346341
>>> >> > > > > URL: https://svnweb.freebsd.org/changeset/base/346341
>>> >> > > > >
>>> >> > > > > Log:
>>> >> > > > >   As an interim measure until a more permanent solution is
>>> >implemented
>>> >> > > > >   workaround the following error:
>>> >> > > > >
>>> >> > > > >   /usr/src/contrib/elftoolchain/strings/strings.c:198:55:
>>> >error: use of
>>> >> > > > >   undeclared identifier
>>> >> > > > >   'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0,
>>> >&rights, FA_OPEN);
>>> >> > > > >
>>> >> > > > >   Reported by:O. Hartmann 
>>> >> > > > >   Reported by:Michael Butler 
>>> >> > > > >   Reported by:gjb@ & cy@ (implicit)
>>> >> > > > >   Reviewed by:emaste@
>>> >> > > > >   Noted by:   rgrimes@
>>> >> > > > >
>>> >> > > > > Modified:
>>> >> > > > >   head/tools/build/Makefile
>>> >> > > > >
>>> >> > > > > Modified: head/tools/build/Makefile
>>> >> > > > >
>>>
>>> >===
>>> >> > > > ===
>>> >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019
>>> >(r34634
>>> >> > > > 0)
>>> >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019
>>> >(r34634
>>> >> > > > 1)
>>> >> > > > > @@ -59,9 +59,7 @@ INCS+=  capsicum_helpers.h
>>> >> > > > >  INCS+=   libcasper.h
>>> >> > > > >  .endif
>>> >> > > > >
>>> >> > > > > -.if !exists(/usr/include/casper/cap_fileargs.h)
>>> >> > > > >  CASPERINC+=
>>> >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea
>>> >> > > > rgs.h
>>> >> > > > > -.endif
>>> >> > > >
>>> >> > > > As a further note, we should probably hunt for any thing
>>> >> > > > that is explicity looking at /usr/include/... in a Makefile,
>>> >> > > > as that is minimally missing a ${DESTDIR} argument.
>>> >> > > >
>>> >> > > > The above may of actually worked if it had been written:
>>> >> > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h)
>>> >> > > > someone may wish to test that.
>>> >> > > >
>>> >> > > > Also a pathname rooted at / without ${DESTDIR} is almost
>>> >certainly a mistake.
>>> >> > >
>>> >> > > This is a better solution. I tested this in a tree with a
>>> >duplicated
>>> >> > > environment: Problem solved. Before this is committed it should
>>> >be
>>> >> > > tested on one of the universe machines.
>>> >> >
>>> >> > From what Ed just said this would also be wrong,
>>> >> > as well as CASPERINC+= above being wrong, if this
>>> >> > is being built for the host we should not be using
>>> >> > any headers from ${SRCTOP} at all.
>>> >> >
>>> >> > if capfileargs.h does not exist on the host that functionality
>>> >> > must not be compiled into the buildtool as the host does not
>>> >> > have this feature and attempting to use it from SRCTOP is wrong.
>>> >> >
>>> >>
>>> >> Keep in mind that this is bootstrap; it's being built for the host
>>> >> system, but it will link against a version of libcasper that's been
>>> >> built in an earlier stage with the proper featureset.
>>> >
>>> >Ok, flip flop again, if infact this is linked against a
>>> >library that implements the stuff from cap_fileargs.h then
>>> >infact the ${DESTDIR} addition so that the build peaks into
>>> >the cross build tree is correct, or what ever the equivelent
>>> >to DESTDIR is for that ?  BUILDDIR?  The point is it should
>>> >be picking this header up from the object tree, NOT from
>>> >the running system.
>>>
>>> Yes, this was my conclusion when working on kerberos and ntp. This is
>>> also true of libraries,  else one would need to installworld and buildworld
>>> again to get a properly built library/binary.
>>>
>>> IIRC ngie@ fixed a number of these across the tree a couple of years
>>> ago.
>>
>>
>> OK. There's a number of different issues going on. As the original author
>> of libegacy (which is what we're seeing fail), let me address the design
>> generically and comment on different things that have come up in this
>> thread.
>>
>> Since this is going into the libegacy that we're using to build the
>> system, the check for file is bogus, for reasons I'll discuss below.  When
>> we add new includes to the system, it is appropriate to do it this way. And
>> when this file was added to the system, the check was correct.
>>
>> First off, DESTDIR is absolutely not correct since this is to build the
>> legacy library and legacy includes which augment the host's sources on
>> legacay

Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en

2019-09-03 Thread Slava Shwartsman




On 16-Apr-19 17:39, Andrey V. Elsukov wrote:

On 05.12.2018 17:25, Slava Shwartsman wrote:

Author: slavash
Date: Wed Dec  5 14:25:03 2018
New Revision: 341586
URL: https://svnweb.freebsd.org/changeset/base/341586

Log:
   mlx5en: Implement backpressure indication.
   
   The backpressure indication is implemented using an unlimited rate type of

   mbuf send tag. When the upper layers typically the socket layer has obtained 
such
   a tag, it can then query the destination driver queue for the current
   amount of space available in the send queue.
   
   A single mbuf send tag may be referenced multiple times and a refcount has been added

   to the mlx5e_priv structure to track its usage. Because the send tag resides
   in the mlx5e_channel structure, there is no need to wait for refcounts to 
reach
   zero until the mlx4en(4) driver is detached. The channels structure is 
persistant
   during the lifetime of the mlx5en(4) driver it belongs to and can so be 
accessed
   without any need of synchronization.
   
   The mlx5e_snd_tag structure was extended to contain a type field, because there are now

   two different tag types which end up in the driver which need to be 
distinguished.
   
   Submitted by:   hselasky@

   Approved by:hselasky (mentor)
   MFC after:  1 week
   Sponsored by:   Mellanox Technologies
@@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb)
struct mlx5e_sq *sq;
int ret;
  
-	sq = mlx5e_select_queue(ifp, mb);

-   if (unlikely(sq == NULL)) {
-#ifdef RATELIMIT
-   /* Check for route change */
-   if (mb->m_pkthdr.snd_tag != NULL &&
-   mb->m_pkthdr.snd_tag->ifp != ifp) {
+   if (mb->m_pkthdr.snd_tag != NULL) {
+   sq = mlx5e_select_queue_by_send_tag(ifp, mb);
+   if (unlikely(sq == NULL)) {
+   /* Check for route change */
+   if (mb->m_pkthdr.snd_tag->ifp != ifp) {
+   /* Free mbuf */
+   m_freem(mb);
+
+   /*
+* Tell upper layers about route
+* change and to re-transmit this
+* packet:
+*/
+   return (EAGAIN);
+   }


Hi,

I just discovered something strange and found that this commit is the
cause.
The test system has mlx5en 100G interface. It has two vlans: vlan500 and
vlan100.
Via vlan500 it receives some packets flows. Then it routes these packets
into vlan100.
But packets are dropped in mlx5e_xmit() with EAGAIN error code.

# dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}'
dtrace: description 'fbt::ip6_output:return ' matched 1 probe
CPU IDFUNCTION:NAME
  23  54338ip6_output:return 35
  16  54338ip6_output:return 35
  21  54338ip6_output:return 35
  22  54338ip6_output:return 35
  24  54338ip6_output:return 35
  23  54338ip6_output:return 35
  14  54338ip6_output:return 35
^C

# dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}'
dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe
CPU IDFUNCTION:NAME
  16  69030mlx5e_xmit:return 35
  23  69030mlx5e_xmit:return 35
  26  69030mlx5e_xmit:return 35
  25  69030mlx5e_xmit:return 35
  24  69030mlx5e_xmit:return 35
  21  69030mlx5e_xmit:return 35
  26  69030mlx5e_xmit:return 35
^C

The kernel config is GENERIC.
13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty



Hi Andrey,

Thanks for letting us know about this regression.
I would like to try to reproduce this issue in house.

Can you please share the exact steps to reproduce it?
- Can I reproduce the issue with B2B setup?
- What is the route command you used to make the route between the VLANs?
- What app are you using to generate the traffic?


Slava


___
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: r346349 - head/sys/netpfil/pf

2019-09-03 Thread Kristof Provost
Author: kp
Date: Thu Apr 18 11:37:44 2019
New Revision: 346349
URL: https://svnweb.freebsd.org/changeset/base/346349

Log:
  pf: No need to M_NOWAIT in DIOCRSETTFLAGS
  
  Now that we don't hold a lock during DIOCRSETTFLAGS memory allocation we can
  use M_WAITOK.
  
  MFC after:1 week
  Event:Aberdeen hackathon 2019
  Pointed out by:   glebius@

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

Modified: head/sys/netpfil/pf/pf_ioctl.c
==
--- head/sys/netpfil/pf/pf_ioctl.c  Thu Apr 18 11:06:45 2019
(r346348)
+++ head/sys/netpfil/pf/pf_ioctl.c  Thu Apr 18 11:37:44 2019
(r346349)
@@ -3110,11 +3110,7 @@ DIOCCHANGEADDR_error:
 
totlen = io->pfrio_size * sizeof(struct pfr_table);
pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table),
-   M_TEMP, M_NOWAIT);
-   if (pfrts == NULL) {
-   error = ENOMEM;
-   break;
-   }
+   M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfrts, totlen);
if (error) {
free(pfrts, M_TEMP);


___
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: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Warner Losh
On Tue, Apr 16, 2019 at 9:16 AM Ian Lepore  wrote:

> On Tue, 2019-04-16 at 07:18 -0600, Warner Losh wrote:
> > On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot 
> > wrote:
> >
> > > On Mon, 15 Apr 2019 17:54:56 -0700
> > > Conrad Meyer  wrote:
> > >
> > > > On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer 
> > > > wrote:
> > > > > E.g., the CI infrastructure for
> > > > > Riscv/Arm is/was generating minimal filesystem images and not
> > > > > populating /boot/entropy.
> > > >
> > > > I should add, I say "is/was" because I have a PR out which may
> > > > address
> > > > the problem: https://github.com/freebsd/freebsd-ci/pull/31
> > > >
> > > > Best,
> > > > Conrad
> > >
> > >  It's not only CI, all release images (memstick, iso) don't have
> > > a /boot/entropy.
> > >  Also all arm/arm64 image don't have this file too.
> > >  If /boot/entropy is needed and isn't present loader(8) should
> > > gather
> > > some entropy and pass this to the kernel for the first boot.
> > >
> >
> > Maybe we need to bootstrap the entropy file as part of buildworld.
> > I'm not
> > sure if the loader can find enough...
> >
> >
> Isn't a file full of data which is distributed in identical form to
> everyone the exact opposite of entropy?
>

It's just to bootstrap entropy for installs. The CI stuff doesn't matter if
that's the same since the CI images aren't exposed to the internet in any
way that would make it matter. The normal install would have the same seeds
of entropy, but diverge from there fairly quickly. The stuff that's used
early in the install is the don't care sort of things that won't matter in
the installer (which then creates it's own entropy that's different for
every install).

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


Re: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124

2019-09-03 Thread Warner Losh
On Wed, Apr 17, 2019 at 12:06 PM Andrew Turner  wrote:

>
>
> On 17 Apr 2019, at 17:52, Ian Lepore  wrote:
>
> On Wed, 2019-04-17 at 11:23 +0200, Andrew Turner wrote:
>
> On 16 Apr 2019, at 22:04, Emmanuel Vadot  wrote:
>
> Author: manu
> Date: Tue Apr 16 20:04:22 2019
> New Revision: 346295
> URL: https://svnweb.freebsd.org/changeset/base/346295
>
> Log:
> arm: Add kern_clocksource.c directly in files.arm
>
> This files is needed and included in all our config so move it to
> a common
> location.
>
> MFC after: 2 weeks
>
>
> ...
>
> Modified: head/sys/conf/files.arm
> ===
> ===
> --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019 (r346294)
> +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019 (r346295)
> @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.o optional com
> pat_cloudabi32 \
> no-implicit-rule \
> clean "cloudabi32_vdso_blob.o"
> #
> +
> +kern/kern_clocksource.c standard
>
>
> Could this be moved from the various files.* to files? It seems we
> define it as standard on all architectures.
>
>
>
> I thought mips still had some variants that didn't implement event
> timers.  That's why this stuff was ever in arch-specific files, arm and
> mips had some flavors without ET support.
>
>
> I think it used to be the case on arm. A grep seems to think it’s enabled
> on all architectures now:
>
> grep kern_clocksource files.*
> files.amd64:kern/kern_clocksource.c standard
> files.arm:kern/kern_clocksource.c standard
> files.arm64:kern/kern_clocksource.c standard
> files.i386:kern/kern_clocksource.c standard
> files.mips:kern/kern_clocksource.c standard
> files.powerpc:kern/kern_clocksource.c standard
> files.riscv:kern/kern_clocksource.c standard
> files.sparc64:kern/kern_clocksource.c standard
>

Looks like it can be hoisted and required for all new architectures.

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


svn commit: r346475 - in stable/11/stand: common i386/libi386 i386/loader

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Sun Apr 21 03:30:47 2019
New Revision: 346475
URL: https://svnweb.freebsd.org/changeset/base/346475

Log:
  MFC r339658, r339959, r340047, r340049, r340215
  
  r339658:
  loader: biosdisk interface should be able to cope with 4k sectors
  
  The 4kn support in current bios specific biosdisk.c is broken, as the code
  is only implementing the support for the 512B sector size.
  
  This work is building the support for custom size sectors, we still do assume
  the requested data to be multiple of 512B blocks and we only do address the
  biosdisk.c interface here.
  
  For reference, see also:
  https://www.illumos.org/issues/8303
  https://www.illumos.org/rb/r/547
  
  As the GELI is moved above biosdisk "layer", the GELI should just work
  
  r339959:
  loader: issue edd probe before legacy ah=08 and detect no media
  
  while probing for drives, use int13 extended info before standard one and
  provide workaround for case we are not getting needed information in case
  of floppy drive.
  
  In case of INT13 errors, there are (at least) 3 error codes appearing in case
  of missin media - 20h, 31h and 80h. Flag the no media and do not print an
  error.
  
  r340047:
  loader: do not probe floppy devices for zfs
  
  The subject is telling it all.
  
  r340049:
  loader: biosdisk should check if the media is present
  
  The bd_print/bd_open/bd_strategy need to make sure the device does have
  media, before getting into performing IO operations. Some systems can
  hung if the device without a media is accessed.
  
  r340215:
  loader: always set media size from partition.
  
  The disk access is validated by using partition table definitions, therefore
  we have no need for if statements, just set the disk size.
  
  Of course the partition table itself may be incorrect/inconsistent, but if
  so, we are in trouble anyhow.

Modified:
  stable/11/stand/common/disk.c
  stable/11/stand/common/part.c
  stable/11/stand/i386/libi386/biosdisk.c
  stable/11/stand/i386/loader/main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/common/disk.c
==
--- stable/11/stand/common/disk.c   Sun Apr 21 03:27:12 2019
(r346474)
+++ stable/11/stand/common/disk.c   Sun Apr 21 03:30:47 2019
(r346475)
@@ -265,9 +265,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
rc = ENXIO;
goto out;
}
-   if (mediasize > od->mediasize) {
-   od->mediasize = mediasize;
-   }
+   od->mediasize = mediasize;
 
if (ptable_gettype(od->table) == PTABLE_BSD &&
partition >= 0) {

Modified: stable/11/stand/common/part.c
==
--- stable/11/stand/common/part.c   Sun Apr 21 03:27:12 2019
(r346474)
+++ stable/11/stand/common/part.c   Sun Apr 21 03:30:47 2019
(r346475)
@@ -323,8 +323,7 @@ ptable_gptread(struct ptable *table, void *dev, diskre
 * Note, this is still not a foolproof way to get disk's size. For
 * example, an image file can be truncated when copied to smaller media.
 */
-   if (hdr.hdr_lba_alt + 1 > table->sectors)
-   table->sectors = hdr.hdr_lba_alt + 1;
+   table->sectors = hdr.hdr_lba_alt + 1;
 
for (i = 0; i < size / hdr.hdr_entsz; i++) {
ent = (struct gpt_ent *)(tbl + i * hdr.hdr_entsz);

Modified: stable/11/stand/i386/libi386/biosdisk.c
==
--- stable/11/stand/i386/libi386/biosdisk.c Sun Apr 21 03:27:12 2019
(r346474)
+++ stable/11/stand/i386/libi386/biosdisk.c Sun Apr 21 03:30:47 2019
(r346475)
@@ -80,8 +80,10 @@ static struct bdinfo
 #defineBD_MODEINT130x
 #defineBD_MODEEDD1 0x0001
 #defineBD_MODEEDD3 0x0002
+#defineBD_MODEEDD  (BD_MODEEDD1 | BD_MODEEDD3)
 #defineBD_MODEMASK 0x0003
 #defineBD_FLOPPY   0x0004
+#defineBD_NO_MEDIA 0x0008
int bd_type;/* BIOS 'drive type' (floppy only) */
uint16_tbd_sectorsize;  /* Sector size */
uint64_tbd_sectors; /* Disk size */
@@ -187,60 +189,83 @@ bd_init(void)
 }
 
 /*
- * Try to detect a device supported by the legacy int13 BIOS
+ * Return EDD version or 0 if EDD is not supported on this drive.
  */
 static int
-bd_int13probe(struct bdinfo *bd)
+bd_check_extensions(int unit)
 {
-   struct edd_params params;
-   int ret = 1;/* assume success */
+   /* Determine if we can use EDD with this device. */
+   v86.ctl = V86_FLAGS;
+   v86.addr = 0x13;
+   v86.eax = 0x4100;
+   v86.edx = unit;
+   v86.ebx = 0x55aa;
+   v86int();
 
+   if (V86_CY(v86.efl) ||  /* carry set */
+   (v86.ebx & 0xff

svn commit: r346437 - stable/11/usr.sbin/bhyve

2019-09-03 Thread Mark Johnston
Author: markj
Date: Sat Apr 20 11:03:46 2019
New Revision: 346437
URL: https://svnweb.freebsd.org/changeset/base/346437

Log:
  MFC r346010:
  Fix indentation.

Modified:
  stable/11/usr.sbin/bhyve/uart_emul.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bhyve/uart_emul.c
==
--- stable/11/usr.sbin/bhyve/uart_emul.cSat Apr 20 11:03:16 2019
(r346436)
+++ stable/11/usr.sbin/bhyve/uart_emul.cSat Apr 20 11:03:46 2019
(r346437)
@@ -436,75 +436,75 @@ uart_write(struct uart_softc *sc, int offset, uint8_t 
 */
sc->ier = value & 0x0F;
break;
-   case REG_FCR:
-   /*
-* When moving from FIFO and 16450 mode and vice versa,
-* the FIFO contents are reset.
-*/
-   if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) {
-   fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1;
-   rxfifo_reset(sc, fifosz);
-   }
+   case REG_FCR:
+   /*
+* When moving from FIFO and 16450 mode and vice versa,
+* the FIFO contents are reset.
+*/
+   if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) {
+   fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1;
+   rxfifo_reset(sc, fifosz);
+   }
 
-   /*
-* The FCR_ENABLE bit must be '1' for the programming
-* of other FCR bits to be effective.
-*/
-   if ((value & FCR_ENABLE) == 0) {
-   sc->fcr = 0;
-   } else {
-   if ((value & FCR_RCV_RST) != 0)
-   rxfifo_reset(sc, FIFOSZ);
+   /*
+* The FCR_ENABLE bit must be '1' for the programming
+* of other FCR bits to be effective.
+*/
+   if ((value & FCR_ENABLE) == 0) {
+   sc->fcr = 0;
+   } else {
+   if ((value & FCR_RCV_RST) != 0)
+   rxfifo_reset(sc, FIFOSZ);
 
-   sc->fcr = value &
-(FCR_ENABLE | FCR_DMA | FCR_RX_MASK);
-   }
-   break;
-   case REG_LCR:
-   sc->lcr = value;
-   break;
-   case REG_MCR:
-   /* Apply mask so that bits 5-7 are 0 */
-   sc->mcr = value & 0x1F;
-   msr = modem_status(sc->mcr);
+   sc->fcr = value &
+(FCR_ENABLE | FCR_DMA | FCR_RX_MASK);
+   }
+   break;
+   case REG_LCR:
+   sc->lcr = value;
+   break;
+   case REG_MCR:
+   /* Apply mask so that bits 5-7 are 0 */
+   sc->mcr = value & 0x1F;
+   msr = modem_status(sc->mcr);
 
-   /*
-* Detect if there has been any change between the
-* previous and the new value of MSR. If there is
-* then assert the appropriate MSR delta bit.
-*/
-   if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS))
-   sc->msr |= MSR_DCTS;
-   if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR))
-   sc->msr |= MSR_DDSR;
-   if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD))
-   sc->msr |= MSR_DDCD;
-   if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0)
-   sc->msr |= MSR_TERI;
+   /*
+* Detect if there has been any change between the
+* previous and the new value of MSR. If there is
+* then assert the appropriate MSR delta bit.
+*/
+   if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS))
+   sc->msr |= MSR_DCTS;
+   if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR))
+   sc->msr |= MSR_DDSR;
+   if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD))
+   sc->msr |= MSR_DDCD;
+   if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0)
+   sc->msr |= MSR_TERI;
 
-   /*
-* Update the value of MSR while retaining the delta
-* bits.
-*/
-   sc->msr &= MSR_DELTA_MASK;
-   sc->msr |= msr;
-  

Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Conrad Meyer
Hi John,

On Wed, Apr 17, 2019 at 9:01 AM John Baldwin  wrote:
> You're missing the point which is that you've added potential blocking in a 
> lot of
> places by changing the semantics of arc4random.

I get it.  The thing is, it's a weird blocking semantic.  It's not the
same as any other blocking semantic we have elsewhere in the kernel.
It can't happen in any particular call.  Once it unblocks, it's
nonblocking forever after.  So if the caller a priori knows that
random is seeded, it's not a blocking operation.

> Unless you're intending to
> hand-audit all of them (as well as future uses), I think having the existing
> API be "safe" (and blocking) but use WITNESS_WARN is a way to catch existing
> and future locking problems.

This would essentially just force auditing, no?  I guess it helps
highlight instances that are (a) actually inside a locked region and
(b) run by users.  I'm on board with this approach.  My only concern
is that we will have false positives (and continue to have false
positives after true positives are made safe).  One thing we could do
is teach WITNESS about random's seeded/not status.

Let's take away: I'll owe you a differential implementing some version
of this proposal, as well as a separate one for the giant
unsafe-random knob, and we can discuss the technical details offline.
Expect something today, if at all possible.

> The EWOULDBLOCK API is something a developer
> would choose and it means they would be aware of the constraint and need to
> deal with it, either by handling EWOULDBLOCK in some way, or deferring use
> until seeded, etc.

Ok; if it is attached to a specific need, and it has
'__attribute__((warn_unused_result))' attached to it, I'm tentatively
ok with the idea.  I don't want to add additional interfaces that
don't get used, or make it easy to accidentally get non-results.

Best regards,
Conrad


___
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: r346409 - in head/stand/efi: include libefi

2019-09-03 Thread Warner Losh
Author: imp
Date: Fri Apr 19 19:45:19 2019
New Revision: 346409
URL: https://svnweb.freebsd.org/changeset/base/346409

Log:
  Add wrapper functions to convert strings to EFI_DEVICE_PATH
  
  In anticipation of new functionality, create routines to convert char *
  and a CHAR16 * to a EFI_DEVICE_PATH
EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path);
void efi_devpath_free(EFI_DEVICE_PATH *dp);
  The first two return an EFI_DEVICE_PATH for the passed in paths. The
  third frees up the storage the first two return when the caller is
  done with it.
  
  Differential Revision: https://reviews.freebsd.org/D19971

Modified:
  head/stand/efi/include/efilib.h
  head/stand/efi/libefi/devpath.c

Modified: head/stand/efi/include/efilib.h
==
--- head/stand/efi/include/efilib.h Fri Apr 19 19:45:15 2019
(r346408)
+++ head/stand/efi/include/efilib.h Fri Apr 19 19:45:19 2019
(r346409)
@@ -92,6 +92,9 @@ CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *);
 void efi_free_devpath_name(CHAR16 *);
 EFI_DEVICE_PATH *efi_devpath_to_media_path(EFI_DEVICE_PATH *);
 UINTN efi_devpath_length(EFI_DEVICE_PATH *);
+EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
+EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path);
+void efi_devpath_free(EFI_DEVICE_PATH *dp);
 
 int efi_status_to_errno(EFI_STATUS);
 EFI_STATUS errno_to_efi_status(int errno);

Modified: head/stand/efi/libefi/devpath.c
==
--- head/stand/efi/libefi/devpath.c Fri Apr 19 19:45:15 2019
(r346408)
+++ head/stand/efi/libefi/devpath.c Fri Apr 19 19:45:19 2019
(r346409)
@@ -28,12 +28,15 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 static EFI_GUID ImageDevicePathGUID =
 EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
 static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
 static EFI_GUID DevicePathToTextGUID = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
-static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *textProtocol;
+static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *toTextProtocol;
+static EFI_GUID DevicePathFromTextGUID = 
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
+static EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *fromTextProtocol;
 
 EFI_DEVICE_PATH *
 efi_lookup_image_devpath(EFI_HANDLE handle)
@@ -63,22 +66,20 @@ efi_lookup_devpath(EFI_HANDLE handle)
 CHAR16 *
 efi_devpath_name(EFI_DEVICE_PATH *devpath)
 {
-   static int once = 1;
EFI_STATUS status;
 
if (devpath == NULL)
return (NULL);
-   if (once) {
+   if (toTextProtocol == NULL) {
status = BS->LocateProtocol(&DevicePathToTextGUID, NULL,
-   (VOID **)&textProtocol);
+   (VOID **)&toTextProtocol);
if (EFI_ERROR(status))
-   textProtocol = NULL;
-   once = 0;
+   toTextProtocol = NULL;
}
-   if (textProtocol == NULL)
+   if (toTextProtocol == NULL)
return (NULL);
 
-   return (textProtocol->ConvertDevicePathToText(devpath, TRUE, TRUE));
+   return (toTextProtocol->ConvertDevicePathToText(devpath, TRUE, TRUE));
 }
 
 void
@@ -86,6 +87,46 @@ efi_free_devpath_name(CHAR16 *text)
 {
 
BS->FreePool(text);
+}
+
+EFI_DEVICE_PATH *
+efi_name_to_devpath(const char *path)
+{
+   EFI_DEVICE_PATH *devpath;
+   CHAR16 *uv;
+   size_t ul;
+
+   uv = NULL;
+   if (utf8_to_ucs2(path, &uv, &ul) != 0)
+   return (NULL);
+   devpath = efi_name_to_devpath16(uv);
+   free(uv);
+   return (devpath);
+}
+
+EFI_DEVICE_PATH *
+efi_name_to_devpath16(CHAR16 *path)
+{
+   EFI_STATUS status;
+
+   if (path == NULL)
+   return (NULL);
+   if (fromTextProtocol == NULL) {
+   status = BS->LocateProtocol(&DevicePathFromTextGUID, NULL,
+   (VOID **)&fromTextProtocol);
+   if (EFI_ERROR(status))
+   fromTextProtocol = NULL;
+   }
+   if (fromTextProtocol == NULL)
+   return (NULL);
+
+   return (fromTextProtocol->ConvertTextToDevicePath(path));
+}
+
+void efi_devpath_free(EFI_DEVICE_PATH *devpath)
+{
+
+   BS->FreePool(devpath);
 }
 
 EFI_DEVICE_PATH *


___
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: r346383 - in stable/11/sys: kern sys

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 19 13:09:16 2019
New Revision: 346383
URL: https://svnweb.freebsd.org/changeset/base/346383

Log:
  MFC r345965:
  Add DEV_RESET /dev/devctl2 ioctl.

Modified:
  stable/11/sys/kern/subr_bus.c
  stable/11/sys/sys/bus.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/subr_bus.c
==
--- stable/11/sys/kern/subr_bus.c   Fri Apr 19 13:04:48 2019
(r346382)
+++ stable/11/sys/kern/subr_bus.c   Fri Apr 19 13:09:16 2019
(r346383)
@@ -5476,6 +5476,7 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t d
case DEV_CLEAR_DRIVER:
case DEV_RESCAN:
case DEV_DELETE:
+   case DEV_RESET:
error = priv_check(td, PRIV_DRIVER);
if (error == 0)
error = find_device(req, &dev);
@@ -5683,6 +5684,14 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t d
error = device_delete_child(parent, dev);
break;
}
+   case DEV_RESET:
+   if ((req->dr_flags & ~(DEVF_RESET_DETACH)) != 0) {
+   error = EINVAL;
+   break;
+   }
+   error = BUS_RESET_CHILD(device_get_parent(dev), dev,
+   req->dr_flags);
+   break;
}
mtx_unlock(&Giant);
return (error);

Modified: stable/11/sys/sys/bus.h
==
--- stable/11/sys/sys/bus.h Fri Apr 19 13:04:48 2019(r346382)
+++ stable/11/sys/sys/bus.h Fri Apr 19 13:09:16 2019(r346383)
@@ -120,6 +120,7 @@ struct devreq {
 #defineDEV_CLEAR_DRIVER _IOW('D', 8, struct devreq)
 #defineDEV_RESCAN  _IOW('D', 9, struct devreq)
 #defineDEV_DELETE  _IOW('D', 10, struct devreq)
+#defineDEV_RESET   _IOW('D', 13, struct devreq)
 
 /* Flags for DEV_DETACH and DEV_DISABLE. */
 #defineDEVF_FORCE_DETACH   0x001


___
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: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Justin Hibbits
On Mon, Apr 15, 2019, 18:34 Ed Maste  wrote:

> On Mon, 15 Apr 2019 at 14:40, Conrad Meyer  wrote:
> >
> > Author: cem
> > Date: Mon Apr 15 18:40:36 2019
> > New Revision: 346250
> > URL: https://svnweb.freebsd.org/changeset/base/346250
> >
> > Log:
> >   random(4): Block read_random(9) on initial seeding
>
> Because Gerald (one of the FreeBSD Foundation's co-op students for
> this term) is not on the svn mailing list I'll bring his report from
> GitHub[1] over here:
>
> As probably also seen from the official CI
> (https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/), this commit
> prevents booting on both arm and arm64.
>
> Condensed Error log (arm64 Pine A64-LTS)
>
> random: randomdev_wait_until_seeded unblock wait
> panic: _sleep: curthread not running
> cpuid = 0
> time = 1
> KDB: stack backtrace:
> <...>
> randomdev_wait_until_seeded() at read_random+0x50
> pc = 0x0021b850  lr = 0x0021b930
> sp = 0x00010a00  fp = 0x00010a40
>
> read_random() at arc4rand+0x168
> pc = 0x0021b930  lr = 0x0049ae5c
> sp = 0x00010a50  fp = 0x00010af0
>
> arc4rand() at __stack_chk_init+0x18
> pc = 0x0049ae5c  lr = 0x003f0558
> sp = 0x00010b00  fp = 0x00010b40
>
> <>
>
> [1]
> https://github.com/freebsd/freebsd/commit/654aeb58dd40d3db3af91ce26c9c31d1b02cee5f#commitcomment-33187782


Given the discussion over there it would probably also fail on powernv,
which also does not use loader.

- 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"


Re: svn commit: r346310 - head/share/misc

2019-09-03 Thread Pedro Giffuni


On 2019-04-17 09:12, Pedro F. Giffuni wrote:

Author: pfg
Date: Wed Apr 17 14:12:11 2019
New Revision: 346310
URL: https://svnweb.freebsd.org/changeset/base/346310

Log:
   Add myself to ports committers.
   
   Approved by: pfg (mentor)


Oops:  I meant thierry (mentor)

yikes!


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"


Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread John Baldwin
On 4/15/19 11:40 AM, Conrad Meyer wrote:
> Author: cem
> Date: Mon Apr 15 18:40:36 2019
> New Revision: 346250
> URL: https://svnweb.freebsd.org/changeset/base/346250
> 
> Log:
>   random(4): Block read_random(9) on initial seeding
>   
>   read_random() is/was used, mostly without error checking, in a lot of
>   very sensitive places in the kernel -- including seeding the widely used
>   arc4random(9).
>   
>   Most uses, especially arc4random(9), should block until the device is seeded
>   rather than proceeding with a bogus or empty seed.  I did not spy any
>   obvious kernel consumers where blocking would be inappropriate (in the
>   sense that lack of entropy would be ok -- I did not investigate locking
>   angle thoroughly).  In many instances, arc4random_buf(9) or that family
>   of APIs would be more appropriate anyway; that work was done in r345865.

There are definitely places arc4random is used where sleeping is not allowed.
ipsec generating nonces for AES-CBC is one example I can think of off the
top of my head.  I think it might be useful to add an explicit WITNESS_WARN
in arc4random to catch these cases so they can be found and reasoned about.

>   This change primarily impacts the behavior of /dev/random on embedded
>   systems with read-only media that do not configure "nodevice random".  We
>   toggle the default from 'charge on blindly with no entropy' to 'block
>   indefinitely.'  This default is safer, but may cause frustration.  Embedded
>   system designers using FreeBSD have several options.  The most obvious is to
>   plan to have a small writable NVRAM or NAND to persist entropy, like larger
>   systems.  Early entropy can be fed from any loader, or by writing directly
>   to /dev/random during boot.  Some embedded SoCs now provide a fast hardware
>   entropy source; this would also work for quickly seeding Fortuna.  A 3rd
>   option would be creating an embedded-specific, more simplistic random
>   module, like that designed by DJB in [1] (this design still requires a small
>   rewritable media for forward secrecy).  Finally, the least preferred option
>   might be "nodevice random", although I plan to remove this in a subsequent
>   revision.

Note that I actually often run into unseeded systems when doing development
using qemu for non-x86 architectures.  For example, when booting mips from
qemu, there is no loader, the kernel just starts, and since the endian is
opposite, I frequently regenerate the filesystem using makefs.

-- 
John Baldwin


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


svn commit: r346318 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Ed Maste
Author: emaste
Date: Wed Apr 17 16:31:30 2019
New Revision: 346318
URL: https://svnweb.freebsd.org/changeset/base/346318

Log:
  cap_fileargs: fix GCC build, don't shadow 'stat'
  
  Reported by:  ci.freebsd.org
  MFC after:3 weeks
  MFC with: r346315
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libcasper/services/cap_fileargs/cap_fileargs.c

Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c
==
--- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 
16:27:43 2019(r346317)
+++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 
16:31:30 2019(r346318)
@@ -566,7 +566,7 @@ static int
 fileargs_command_lstat(const nvlist_t *limits, nvlist_t *nvlin,
 nvlist_t *nvlout)
 {
-   int stat;
+   int error;
const char *name;
struct stat sb;
 
@@ -578,7 +578,7 @@ fileargs_command_lstat(const nvlist_t *limits, nvlist_
 
name = nvlist_get_string(nvlin, "name");
 
-   stat = lstat(name, &sb);
+   error = lstat(name, &sb);
if (stat < 0)
return (errno);
 


___
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: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Conrad Meyer
On Tue, Apr 16, 2019 at 4:31 PM John Baldwin  wrote:
> bhyveload is effectively the loader in this case.  It runs the normal loader
> scripts and logic and so would load the guests's /boot/entropy and pass it
> to the guest kernel as metadata just like the regular loader.

Right, except it doesn't seem to do things like nuke /boot/nextboot.conf :-(.

> In addition, bhyve also supports virtio-rng which is another way to provide
> entropy to guest OS's.  That's why in my reply I focused on qemu for mips
> (or riscv) as for x86 hypervisors there are existing, somewhat-standarized
> solutions for the hypervisor to provide entropy to the guest.

Perhaps cryptographically random stack-protector cookies are simply
inappropriate for MIPS or RISCV.  Do we have any other examples of
kernel random consumers blocking after that immediate hiccup is
overcome?

Best,
Conrad


___
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: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Warner Losh
On Tue, Apr 16, 2019 at 9:27 AM Conrad Meyer  wrote:

> On Tue, Apr 16, 2019 at 7:24 AM Justin Hibbits 
> wrote:
> >
> > Hi Conrad,
> > ...
> > [Power] does use bsdinstall to install.  How is entropy loaded at
> startup,
> > which causes the problem noted in github?
>
> There are a couple very early load sources.  loader(8) will load
> early-boot entropy from /boot/entropy and pass it to the kernel as a
> fake module (entropy_cache_load in loader.conf(5)), similar to
> cpu_microcode early load.
>
> The fallback option is random(4) itself groping into the filesystem
> during early auto-conf (SI_SUB_RANDOM:SI_ORDER_FOURTH, IIRC) to access
> /boot/entropy directly.
>

SI_SUB_RANDOM is too early. It's at 0x216,  while SI_SUB_ROOT_CONF
doesn't happen until 0xb00.


> > If it's loaded before
> > filesystems get mounted, that could be a problem for us, because /boot
> > is on a different filesystem (msdosfs, to be read by petitboot).
> > Petitboot also does not have a way to preload modules, so all we have
> > at startup, until spawning init, is the kernel.
>
> Yes, that seems potentially problematic.  Can the Power kernel access
> the non-msdosfs root filesystem?  Let's follow-up offline about
> PPC-specific early entropy seeding.  I would much prefer we figure out
> a way to provide early entropy to Power than disabling or crippling
> every early random consumer on the arch.  Do you know what the Linux
> folks do?
>
> On Power with darn, we could probably just spin in SI_ORDER_FOURTH
> until we have enough darn output to seed random.  Similar for x86 CI
> images, I guess; though they do not have the loader problem, some
> people have non-bsdinstall installation methods.
>

They do have the loader problem because many means to generate an image
don't generate /boot/entropy.

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


svn commit: r346380 - in stable/12: lib/libdevctl usr.sbin/devctl

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 19 12:54:05 2019
New Revision: 346380
URL: https://svnweb.freebsd.org/changeset/base/346380

Log:
  MFC r345966, r345968:
  Implement devctl(8) command 'reset', using DEV_RESET /dev/devctl2 ioctl.

Modified:
  stable/12/lib/libdevctl/devctl.3
  stable/12/lib/libdevctl/devctl.c
  stable/12/lib/libdevctl/devctl.h
  stable/12/usr.sbin/devctl/devctl.8
  stable/12/usr.sbin/devctl/devctl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libdevctl/devctl.3
==
--- stable/12/lib/libdevctl/devctl.3Fri Apr 19 12:50:25 2019
(r346379)
+++ stable/12/lib/libdevctl/devctl.3Fri Apr 19 12:54:05 2019
(r346380)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 22, 2018
+.Dd April 4, 2019
 .Dt DEVCTL 3
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Nm devctl_enable ,
 .Nm devctl_freeze ,
 .Nm devctl_rescan ,
+.Nm devctl_reset ,
 .Nm devctl_resume ,
 .Nm devctl_set_driver ,
 .Nm devctl_suspend ,
@@ -64,6 +65,8 @@
 .Ft int
 .Fn devctl_rescan "const char *device"
 .Ft int
+.Fn devctl_reset "const char *device" "bool detach"
+.Ft int
 .Fn devctl_resume "const char *device"
 .Ft int
 .Fn devctl_set_driver "const char *device" "const char *driver" "bool force"
@@ -205,6 +208,15 @@ The
 .Fn devctl_thaw
 function resumes (thaws the freeze) probe and attach processing
 initiated in response to drivers being loaded.
+.Pp
+The
+.Fn devctl_reset
+function resets the specified device using bus-specific reset method.
+The
+.Fa detach
+argument, if true, specifies that the device driver is detached before
+the reset, and re-attached afterwards.
+If false, the device is suspended before the reset, and resumed after.
 .Sh RETURN VALUES
 .Rv -std devctl_attach devctl_clear_driver devctl_delete devctl_detach \
 devctl_disable devctl_enable devctl_suspend devctl_rescan devctl_resume \
@@ -378,6 +390,21 @@ is false.
 .Fa dev
 is the root device of the device tree.
 .El
+.Pp
+The
+.Fn devctl_reset
+function may fail if:
+.Bl -tag -width Er
+.It Bq Er ENXIO
+The bus does not implement the reset method.
+.It Bq Er ETIMEDOUT
+The device failed to respond after the reset in the time limits
+specific to the bus.
+.El
+The
+.Fn devctl_reset
+function may also return errors caused by the attach, detach, suspend,
+and resume methods of the device driver.
 .Sh SEE ALSO
 .Xr devinfo 3 ,
 .Xr devstat 3 ,
@@ -392,3 +419,20 @@ If a device is suspended individually via
 .Fn devctl_suspend
 and the entire machine is subsequently suspended,
 the device will be resumed when the machine resumes.
+.Pp
+Similarly, if the device is suspended, and
+.Fn devctl_reset
+is called on the device with
+.Fa detach
+set to
+.Va false ,
+the device is resumed by the
+.Fn devctl_reset
+call.
+Or, if the driver for the device is detached manually, and
+.Fn devctl_reset
+is called on the device with
+.Fa detach
+set to
+.Va true ,
+device reset re-attaches the driver.

Modified: stable/12/lib/libdevctl/devctl.c
==
--- stable/12/lib/libdevctl/devctl.cFri Apr 19 12:50:25 2019
(r346379)
+++ stable/12/lib/libdevctl/devctl.cFri Apr 19 12:54:05 2019
(r346380)
@@ -159,3 +159,11 @@ devctl_thaw(void)
 
return (devctl_simple_request(DEV_THAW, "", 0));
 }
+
+int
+devctl_reset(const char *device, bool detach)
+{
+
+   return (devctl_simple_request(DEV_RESET, device, detach ?
+   DEVF_RESET_DETACH : 0));
+}

Modified: stable/12/lib/libdevctl/devctl.h
==
--- stable/12/lib/libdevctl/devctl.hFri Apr 19 12:50:25 2019
(r346379)
+++ stable/12/lib/libdevctl/devctl.hFri Apr 19 12:54:05 2019
(r346380)
@@ -44,6 +44,7 @@ int   devctl_rescan(const char *device);
 intdevctl_delete(const char *device, bool force);
 intdevctl_freeze(void);
 intdevctl_thaw(void);
+intdevctl_reset(const char *device, bool detach);
 __END_DECLS
 
 #endif /* !__DEVCTL_H__ */

Modified: stable/12/usr.sbin/devctl/devctl.8
==
--- stable/12/usr.sbin/devctl/devctl.8  Fri Apr 19 12:50:25 2019
(r346379)
+++ stable/12/usr.sbin/devctl/devctl.8  Fri Apr 19 12:54:05 2019
(r346380)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 29, 2016
+.Dd April 4, 2019
 .Dt DEVCTL 8
 .Os
 .Sh NAME
@@ -67,6 +67,10 @@
 .Cm delete
 .Op Fl f
 .Ar device
+.Nm
+.Cm reset
+.Op Fl d
+.Ar device
 .Sh DESCRIPTION
 The
 .Nm
@@ -167,7 +171,35 @@ the device will be deleted even if it is physically pr
 This command should be used with care as a device that is deleted but present
 can no longer be used unless the parent bus device rediscovers the device via
 a rescan request.
+.It Xo Cm reset
+.Op Fl d
+.Ar device
+.Xc
+Reset the device, using bus-specific reset method.
+Drivers for the devices 

svn commit: r346288 - in stable/12/sys: fs/fuse fs/msdosfs kern sys

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 16 17:55:54 2019
New Revision: 346288
URL: https://svnweb.freebsd.org/changeset/base/346288

Log:
  MFC r346065:
  Add vn_fsync_buf().

Modified:
  stable/12/sys/fs/fuse/fuse_io.c
  stable/12/sys/fs/msdosfs/msdosfs_fat.c
  stable/12/sys/kern/vfs_default.c
  stable/12/sys/kern/vfs_vnops.c
  stable/12/sys/sys/vnode.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/fuse/fuse_io.c
==
--- stable/12/sys/fs/fuse/fuse_io.c Tue Apr 16 17:54:51 2019
(r346287)
+++ stable/12/sys/fs/fuse/fuse_io.c Tue Apr 16 17:55:54 2019
(r346288)
@@ -744,13 +744,8 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp)
 int
 fuse_io_flushbuf(struct vnode *vp, int waitfor, struct thread *td)
 {
-   struct vop_fsync_args a = {
-   .a_vp = vp,
-   .a_waitfor = waitfor,
-   .a_td = td,
-   };
 
-   return (vop_stdfsync(&a));
+   return (vn_fsync_buf(vp, waitfor));
 }
 
 /*

Modified: stable/12/sys/fs/msdosfs/msdosfs_fat.c
==
--- stable/12/sys/fs/msdosfs/msdosfs_fat.c  Tue Apr 16 17:54:51 2019
(r346287)
+++ stable/12/sys/fs/msdosfs/msdosfs_fat.c  Tue Apr 16 17:55:54 2019
(r346288)
@@ -980,7 +980,6 @@ extendfile(struct denode *dep, u_long count, struct bu
u_long cn, got;
struct msdosfsmount *pmp = dep->de_pmp;
struct buf *bp;
-   struct vop_fsync_args fsync_ap;
daddr_t blkno;
 
/*
@@ -1092,12 +1091,8 @@ extendfile(struct denode *dep, u_long count, struct bu
bdwrite(bp);
}
if (vm_page_count_severe() ||
-   buf_dirty_count_severe()) {
-   fsync_ap.a_vp = DETOV(dep);
-   fsync_ap.a_waitfor = MNT_WAIT;
-   fsync_ap.a_td = curthread;
-   vop_stdfsync(&fsync_ap);
-   }
+   buf_dirty_count_severe())
+   vn_fsync_buf(DETOV(dep), MNT_WAIT);
}
}
}

Modified: stable/12/sys/kern/vfs_default.c
==
--- stable/12/sys/kern/vfs_default.cTue Apr 16 17:54:51 2019
(r346287)
+++ stable/12/sys/kern/vfs_default.cTue Apr 16 17:55:54 2019
(r346288)
@@ -638,98 +638,8 @@ vop_stdfsync(ap)
struct thread *a_td;
} */ *ap;
 {
-   struct vnode *vp;
-   struct buf *bp, *nbp;
-   struct bufobj *bo;
-   struct mount *mp;
-   int error, maxretry;
 
-   error = 0;
-   maxretry = 1; /* large, arbitrarily chosen */
-   vp = ap->a_vp;
-   mp = NULL;
-   if (vp->v_type == VCHR) {
-   VI_LOCK(vp);
-   mp = vp->v_rdev->si_mountpt;
-   VI_UNLOCK(vp);
-   }
-   bo = &vp->v_bufobj;
-   BO_LOCK(bo);
-loop1:
-   /*
-* MARK/SCAN initialization to avoid infinite loops.
-*/
-TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) {
-bp->b_vflags &= ~BV_SCANNED;
-   bp->b_error = 0;
-   }
-
-   /*
-* Flush all dirty buffers associated with a vnode.
-*/
-loop2:
-   TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) {
-   if ((bp->b_vflags & BV_SCANNED) != 0)
-   continue;
-   bp->b_vflags |= BV_SCANNED;
-   if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) {
-   if (ap->a_waitfor != MNT_WAIT)
-   continue;
-   if (BUF_LOCK(bp,
-   LK_EXCLUSIVE | LK_INTERLOCK | LK_SLEEPFAIL,
-   BO_LOCKPTR(bo)) != 0) {
-   BO_LOCK(bo);
-   goto loop1;
-   }
-   BO_LOCK(bo);
-   }
-   BO_UNLOCK(bo);
-   KASSERT(bp->b_bufobj == bo,
-   ("bp %p wrong b_bufobj %p should be %p",
-   bp, bp->b_bufobj, bo));
-   if ((bp->b_flags & B_DELWRI) == 0)
-   panic("fsync: not dirty");
-   if ((vp->v_object != NULL) && (bp->b_flags & B_CLUSTEROK)) {
-   vfs_bio_awrite(bp);
-   } else {
-   bremfree(bp);
-   bawrite(bp);
-   }
-   if (maxretry < 1000)
-   pause("dirty", hz < 1000 ? 1 : hz / 1000);
-   BO_LOCK(bo);
-   goto loop2;
-   }
-
-   /*
-   

svn commit: r346284 - in stable/12/sys: amd64/pci i386/pci x86/include x86/x86

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 16 17:16:18 2019
New Revision: 346284
URL: https://svnweb.freebsd.org/changeset/base/346284

Log:
  MFC r346062:
  pci_cfgreg.c: Use io port config access for early boot time.
  
  PR:   236838

Modified:
  stable/12/sys/amd64/pci/pci_cfgreg.c
  stable/12/sys/i386/pci/pci_cfgreg.c
  stable/12/sys/x86/include/pci_cfgreg.h
  stable/12/sys/x86/x86/legacy.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/pci/pci_cfgreg.c
==
--- stable/12/sys/amd64/pci/pci_cfgreg.cTue Apr 16 17:12:27 2019
(r346283)
+++ stable/12/sys/amd64/pci/pci_cfgreg.cTue Apr 16 17:16:18 2019
(r346284)
@@ -44,12 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-enum {
-   CFGMECH_NONE = 0,
-   CFGMECH_1,
-   CFGMECH_PCIE,
-};
-
 static uint32_tpci_docfgregread(int bus, int slot, int func, int reg,
int bytes);
 static int pciereg_cfgread(int bus, unsigned slot, unsigned func,
@@ -61,7 +55,13 @@ static void  pcireg_cfgwrite(int bus, int slot, int fun
 
 SYSCTL_DECL(_hw_pci);
 
-static int cfgmech;
+/*
+ * For amd64 we assume that type 1 I/O port-based access always works.
+ * If an ACPI MCFG table exists, pcie_cfgregopen() will be called to
+ * switch to memory-mapped access.
+ */
+int cfgmech = CFGMECH_1;
+
 static vm_offset_t pcie_base;
 static int pcie_minbus, pcie_maxbus;
 static uint32_t pcie_badslots;
@@ -71,47 +71,10 @@ static int mcfg_enable = 1;
 SYSCTL_INT(_hw_pci, OID_AUTO, mcfg, CTLFLAG_RDTUN, &mcfg_enable, 0,
 "Enable support for PCI-e memory mapped config access");
 
-/* 
- * Initialise access to PCI configuration space 
- */
 int
 pci_cfgregopen(void)
 {
-   uint64_t pciebar;
-   uint16_t did, vid;
 
-   if (cfgmech != CFGMECH_NONE)
-   return (1);
-   cfgmech = CFGMECH_1;
-
-   /*
-* Grope around in the PCI config space to see if this is a
-* chipset that is capable of doing memory-mapped config cycles.
-* This also implies that it can do PCIe extended config cycles.
-*/
-
-   /* Check for supported chipsets */
-   vid = pci_cfgregread(0, 0, 0, PCIR_VENDOR, 2);
-   did = pci_cfgregread(0, 0, 0, PCIR_DEVICE, 2);
-   switch (vid) {
-   case 0x8086:
-   switch (did) {
-   case 0x3590:
-   case 0x3592:
-   /* Intel 7520 or 7320 */
-   pciebar = pci_cfgregread(0, 0, 0, 0xce, 2) << 16;
-   pcie_cfgregopen(pciebar, 0, 255);
-   break;
-   case 0x2580:
-   case 0x2584:
-   case 0x2590:
-   /* Intel 915, 925, or 915GM */
-   pciebar = pci_cfgregread(0, 0, 0, 0x48, 4);
-   pcie_cfgregopen(pciebar, 0, 255);
-   break;
-   }
-   }
-
return (1);
 }
 
@@ -135,9 +98,6 @@ pci_cfgregread(int bus, int slot, int func, int reg, i
 {
uint32_t line;
 
-   if (cfgmech == CFGMECH_NONE)
-   return (0x);
-
/*
 * Some BIOS writers seem to want to ignore the spec and put
 * 0 in the intline rather than 255 to indicate none.  Some use
@@ -161,9 +121,6 @@ pci_cfgregread(int bus, int slot, int func, int reg, i
 void
 pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int 
bytes)
 {
-
-   if (cfgmech == CFGMECH_NONE)
-   return;
 
if (cfgmech == CFGMECH_PCIE &&
(bus >= pcie_minbus && bus <= pcie_maxbus) &&

Modified: stable/12/sys/i386/pci/pci_cfgreg.c
==
--- stable/12/sys/i386/pci/pci_cfgreg.c Tue Apr 16 17:12:27 2019
(r346283)
+++ stable/12/sys/i386/pci/pci_cfgreg.c Tue Apr 16 17:16:18 2019
(r346284)
@@ -64,20 +64,13 @@ struct pcie_cfg_elem {
vm_paddr_t  papage;
 };
 
-enum {
-   CFGMECH_NONE = 0,
-   CFGMECH_1,
-   CFGMECH_2,
-   CFGMECH_PCIE,
-};
-
 SYSCTL_DECL(_hw_pci);
 
 static TAILQ_HEAD(pcie_cfg_list, pcie_cfg_elem) pcie_list[MAXCPU];
 static uint64_t pcie_base;
 static int pcie_minbus, pcie_maxbus;
 static uint32_t pcie_badslots;
-static int cfgmech;
+int cfgmech;
 static int devmax;
 static struct mtx pcicfg_mtx;
 static int mcfg_enable = 1;
@@ -136,10 +129,8 @@ pcibios_get_version(void)
 int
 pci_cfgregopen(void)
 {
-   static int  opened = 0;
-   uint64_tpciebar;
-   u_int16_t   vid, did;
-   u_int16_t   v;
+   uint16_t v;
+   static int opened = 0;
 
if (opened)
return (1);
@@ -158,38 +149,7 @@ pci_cfgregopen(void)
if (v >= 0x0210)
pci_pir_open();
 
-   if (cfgmech == CFGMECH_PCIE)
-   return (1); 
-
-   /*
-* G

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

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Tue Apr 16 21:02:41 2019
New Revision: 346303
URL: https://svnweb.freebsd.org/changeset/base/346303

Log:
  MFC r345192-r345194: if_bridge(4): Drop pointless rtflush
  
  r345192:
  if_bridge(4): Drop pointless rtflush
  
  At this point, all routes should've already been dropped by removing all
  members from the bridge. This condition is in-fact KASSERT'd in the line
  immediately above where this nop flush was added.
  
  r345193:
  Revert r345192: Too many trees in play for bridge(4) bits
  
  An accidental appendage was committed that has not undergone review yet.
  
  r345194:
  if_bridge(4): Drop pointless rtflush
  
  At this point, all routes should've already been dropped by removing all
  members from the bridge. This condition is in-fact KASSERT'd in the line
  immediately above where this nop flush was added.

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

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

Modified: stable/11/sys/net/if_bridge.c
==
--- stable/11/sys/net/if_bridge.c   Tue Apr 16 21:01:07 2019
(r346302)
+++ stable/11/sys/net/if_bridge.c   Tue Apr 16 21:02:41 2019
(r346303)
@@ -2885,7 +2885,6 @@ bridge_rtable_fini(struct bridge_softc *sc)
 
KASSERT(sc->sc_brtcnt == 0,
("%s: %d bridge routes referenced", __func__, sc->sc_brtcnt));
-   bridge_rtflush(sc, 1);
free(sc->sc_rthash, M_DEVBUF);
 }
 


___
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: r346443 - head/tests/sys/opencrypto

2019-09-03 Thread Enji Cooper

> On Apr 20, 2019, at 9:31 AM, Enji Cooper  wrote:
> 
> 
>> On Apr 20, 2019, at 9:30 AM, John Baldwin > > wrote:
>> 
>> On 4/20/19 8:43 AM, Enji Cooper wrote:
>>> Author: ngie
>>> Date: Sat Apr 20 15:43:28 2019
>>> New Revision: 346443
>>> URL: https://svnweb.freebsd.org/changeset/base/346443 
>>> 
>>> 
>>> Log:
>>>  tests/sys/opencrypto: fix whitespace per PEP8
>>> 
>>>  Replace hard tabs with four-character indentations, per PEP8.
>>> 
>>>  This is being done to separate stylistic changes from the tests from 
>>> functional
>>>  ones, as I accidentally introduced a bug to the tests when I used 
>>> four-space
>>>  indentation locally.
>>> 
>>>  No functional change.
>> 
>> Wow, this is really painful for the 4-5 open reviews I have outstanding as it
>> makes a merge disaster.
> 
> Sorry ;_;…

Being more constructive: I will back out the change, then reapply it 
later.
Thank you,
-Enji

___
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: r346554 - head/sys/netinet

2019-09-03 Thread Bruce Evans

On Mon, 22 Apr 2019, Bjoern A. Zeeb wrote:


On 22 Apr 2019, at 14:20, Bjoern A. Zeeb wrote:

Log:
  Remove some excessive brackets.

  No functional change.


But it includes a stye bug; sorry; I had re-indented the lines to validate 
the change.  Ill remedy this with the follow-up commit which will split 
that block up anyway.


Also, it removes excessive parentheses, not excessive brackets.

I think excessive brackets are just syntax errors.  E.g., a[[i]].

Excessive braces are not syntax errors, but I've never more than single
excessive ones.  E.g.,

if (foo != 0) {
bar();
}

is a common style bug, but

if (foo != 0) {{
bar();
  }}

s unusual.

Bruce


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


svn commit: r346484 - stable/12/libexec/rtld-elf

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Sun Apr 21 09:11:22 2019
New Revision: 346484
URL: https://svnweb.freebsd.org/changeset/base/346484

Log:
  MFC r346216:
  ld-elf.so: make LD_DEBUG always functional.

Modified:
  stable/12/libexec/rtld-elf/Makefile
  stable/12/libexec/rtld-elf/debug.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rtld-elf/Makefile
==
--- stable/12/libexec/rtld-elf/Makefile Sun Apr 21 04:35:49 2019
(r346483)
+++ stable/12/libexec/rtld-elf/Makefile Sun Apr 21 09:11:22 2019
(r346484)
@@ -2,7 +2,7 @@
 
 # Use the following command to build local debug version of dynamic
 # linker:
-# make DEBUG_FLAGS=-g DEBUG=-DDEBUG WITHOUT_TESTS=yes all
+# make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all
 
 .include 
 PACKAGE=   clibs

Modified: stable/12/libexec/rtld-elf/debug.h
==
--- stable/12/libexec/rtld-elf/debug.h  Sun Apr 21 04:35:49 2019
(r346483)
+++ stable/12/libexec/rtld-elf/debug.h  Sun Apr 21 09:11:22 2019
(r346484)
@@ -39,10 +39,10 @@
 #include 
 #include 
 
-extern void debug_printf(const char *, ...) __printflike(1, 2);
+void debug_printf(const char *, ...) __printflike(1, 2);
 extern int debug;
 
-#ifdef DEBUG
+#ifndef NO_LD_DEBUG
 #define dbg(...)   debug_printf(__VA_ARGS__)
 #else
 #define dbg(...)   ((void) 0)


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


svn commit: r346361 - in vendor/zstd/dist: . contrib/adaptive-compression contrib/docker contrib/experimental_dict_builders contrib/experimental_dict_builders/benchmarkDictBuilder contrib/experimen...

2019-09-03 Thread Conrad Meyer
Author: cem
Date: Fri Apr 19 00:31:04 2019
New Revision: 346361
URL: https://svnweb.freebsd.org/changeset/base/346361

Log:
  import zstd 1.4.0

Added:
  vendor/zstd/dist/CHANGELOG
  vendor/zstd/dist/contrib/docker/
  vendor/zstd/dist/contrib/docker/Dockerfile
  vendor/zstd/dist/contrib/docker/README.md
  vendor/zstd/dist/contrib/experimental_dict_builders/
  vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/
  
vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/Makefile
   (contents, props changed)
  
vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md
  
vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/benchmark.c
   (contents, props changed)
  
vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/dictBuilder.h
   (contents, props changed)
  
vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/test.sh
   (contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/Makefile   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/README.md
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/fastCover.c   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/fastCover.h   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/main.c   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/test.sh   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/
  
vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/Makefile  
 (contents, props changed)
  
vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/README.md
  vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/io.c   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/io.h   
(contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/main.c  
 (contents, props changed)
  
vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/random.c  
 (contents, props changed)
  
vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/random.h  
 (contents, props changed)
  vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/test.sh 
  (contents, props changed)
  vendor/zstd/dist/contrib/largeNbDicts/
  vendor/zstd/dist/contrib/largeNbDicts/Makefile   (contents, props changed)
  vendor/zstd/dist/contrib/largeNbDicts/README.md
  vendor/zstd/dist/contrib/largeNbDicts/largeNbDicts.c   (contents, props 
changed)
  vendor/zstd/dist/contrib/premake/
  vendor/zstd/dist/contrib/premake/premake4.lua   (contents, props changed)
  vendor/zstd/dist/contrib/premake/zstd.lua   (contents, props changed)
  vendor/zstd/dist/contrib/snap/
  vendor/zstd/dist/contrib/snap/snapcraft.yaml
  vendor/zstd/dist/examples/
  vendor/zstd/dist/examples/.gitignore
  vendor/zstd/dist/examples/Makefile   (contents, props changed)
  vendor/zstd/dist/examples/README.md
  vendor/zstd/dist/examples/common.h   (contents, props changed)
  vendor/zstd/dist/examples/dictionary_compression.c   (contents, props changed)
  vendor/zstd/dist/examples/dictionary_decompression.c   (contents, props 
changed)
  vendor/zstd/dist/examples/multiple_simple_compression.c   (contents, props 
changed)
  vendor/zstd/dist/examples/multiple_streaming_compression.c   (contents, props 
changed)
  vendor/zstd/dist/examples/simple_compression.c   (contents, props changed)
  vendor/zstd/dist/examples/simple_decompression.c   (contents, props changed)
  vendor/zstd/dist/examples/streaming_compression.c   (contents, props changed)
  vendor/zstd/dist/examples/streaming_decompression.c   (contents, props 
changed)
  vendor/zstd/dist/examples/streaming_memory_usage.c   (contents, props changed)
  vendor/zstd/dist/programs/timefn.c   (contents, props changed)
  vendor/zstd/dist/programs/timefn.h   (contents, props changed)
  vendor/zstd/dist/tests/fuzz/dictionary_decompress.c   (contents, props 
changed)
  vendor/zstd/dist/tests/fuzz/dictionary_round_trip.c   (contents, props 
changed)
Modified:
  vendor/zstd/dist/Makefile
  vendor/zstd/dist/README.md
  vendor/zstd/dist/contrib/adaptive-compression/Makefile
  vendor/zstd/dist/contrib/adaptive-compression/adapt.c
  vendor/zstd/dist/contrib/pzstd/Makefile
  vendor/zstd/dist/contrib/pzstd/Pzstd.cpp
  vendor/zstd/dist/contrib/pzstd/utils/Range.h
  vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h
  vendor/zstd/dist/doc/README.md
  vendor/zstd/dist/doc/educational_decoder/Makefile
  vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c
  vendor/zstd/dist/doc/zstd_manual.html
  vendor/zstd/dist/lib/Makefile
  vendor/zstd/dist/lib/README.md
  vendor/zstd/dist/lib/common/compile

svn commit: r346445 - in head/sys/compat/linuxkpi/common: include/linux src

2019-09-03 Thread Ed Maste
Author: emaste
Date: Sat Apr 20 15:57:05 2019
New Revision: 346445
URL: https://svnweb.freebsd.org/changeset/base/346445

Log:
  Enable ioremap for aarch64 in the LinuxKPI
  
  Required for Mellanox drivers (e.g. on Ampere eMAG at Packet.com).
  
  PR:   237055
  Submitted by: Greg V 
  Reviewed by:  hselasky
  Differential Revision:https://reviews.freebsd.org/D19987

Modified:
  head/sys/compat/linuxkpi/common/include/linux/io.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/io.h
==
--- head/sys/compat/linuxkpi/common/include/linux/io.h  Sat Apr 20 15:47:57 
2019(r346444)
+++ head/sys/compat/linuxkpi/common/include/linux/io.h  Sat Apr 20 15:57:05 
2019(r346445)
@@ -350,7 +350,7 @@ _outb(u_char data, u_int port)
 }
 #endif
 
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || 
defined(__aarch64__)
 void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
 #else
 #define_ioremap_attr(...) NULL

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Sat Apr 20 15:47:57 
2019(r346444)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Sat Apr 20 15:57:05 
2019(r346445)
@@ -1773,7 +1773,7 @@ vmmap_remove(void *addr)
return (vmmap);
 }
 
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || 
defined(__aarch64__)
 void *
 _ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr)
 {
@@ -1796,7 +1796,7 @@ iounmap(void *addr)
vmmap = vmmap_remove(addr);
if (vmmap == NULL)
return;
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || 
defined(__aarch64__)
pmap_unmapdev((vm_offset_t)addr, vmmap->vm_size);
 #endif
kfree(vmmap);


___
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: r346341 - head/tools/build

2019-09-03 Thread Rodney W. Grimes
> Author: cy
> Date: Thu Apr 18 01:02:00 2019
> New Revision: 346341
> URL: https://svnweb.freebsd.org/changeset/base/346341
> 
> Log:
>   As an interim measure until a more permanent solution is implemented
>   workaround the following error:
>   
>   /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of
>   undeclared identifier
>   'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
>   
>   Reported by:O. Hartmann 
>   Reported by:Michael Butler 
>   Reported by:gjb@ & cy@ (implicit)
>   Reviewed by:emaste@
>   Noted by:   rgrimes@
> 
> Modified:
>   head/tools/build/Makefile
> 
> Modified: head/tools/build/Makefile
> ==
> --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019(r346340)
> +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019(r346341)
> @@ -59,9 +59,7 @@ INCS+=  capsicum_helpers.h
>  INCS+=   libcasper.h
>  .endif
>  
> -.if !exists(/usr/include/casper/cap_fileargs.h)
>  CASPERINC+=  ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h
> -.endif

As a further note, we should probably hunt for any thing
that is explicity looking at /usr/include/... in a Makefile,
as that is minimally missing a ${DESTDIR} argument.

The above may of actually worked if it had been written:
.if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h)
someone may wish to test that.

Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake.

>  .if empty(SRCS)
>  SRCS=dummy.c

-- 
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"


svn commit: r346270 - head/cddl/usr.sbin/zfsd

2019-09-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Apr 16 12:25:15 2019
New Revision: 346270
URL: https://svnweb.freebsd.org/changeset/base/346270

Log:
  Drop -g from CFLAGS for zfsd(8).  No idea why it was ever there.
  
  Reviewed by:  kib, ngie, asomers
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D19915

Modified:
  head/cddl/usr.sbin/zfsd/Makefile.common

Modified: head/cddl/usr.sbin/zfsd/Makefile.common
==
--- head/cddl/usr.sbin/zfsd/Makefile.common Tue Apr 16 11:37:15 2019
(r346269)
+++ head/cddl/usr.sbin/zfsd/Makefile.common Tue Apr 16 12:25:15 2019
(r346270)
@@ -30,7 +30,7 @@ INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/ut
 INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
 INCFLAGS+= -I${SRCTOP}/cddl/usr.sbin
 
-CFLAGS+= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS}
+CFLAGS+= -DNEED_SOLARIS_BOOLEAN ${INCFLAGS}
 
 LIBADD+=   devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil
 


___
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: r346259 - head/sys/dev/tpm

2019-09-03 Thread Conrad Meyer
Hi Marcin,

Isn't this check racy?  Thread TIDs are allocated from a fixed range
and can be recycled.

Best,
Conrad

On Mon, Apr 15, 2019 at 7:28 PM Marcin Wojtas  wrote:
>
> Author: mw
> Date: Tue Apr 16 02:28:35 2019
> New Revision: 346259
> URL: https://svnweb.freebsd.org/changeset/base/346259
>
> Log:
>   tpm: Prevent session hijack
>
>   Check caller thread id before allowing to read the buffer
>   to make sure that it can only be accessed by the thread that
>   did the associated write to the TPM.
>
>   Submitted by: Kornel Duleba 
>   Reviewed by: delphij
>   Obtained from: Semihalf
>   Sponsored by: Stormshield
>   Differential Revision: https://reviews.freebsd.org/D19713
>
> Modified:
>   head/sys/dev/tpm/tpm20.c
>   head/sys/dev/tpm/tpm20.h
>
> Modified: head/sys/dev/tpm/tpm20.c
> ==
> --- head/sys/dev/tpm/tpm20.cTue Apr 16 02:12:38 2019(r346258)
> +++ head/sys/dev/tpm/tpm20.cTue Apr 16 02:28:35 2019(r346259)
> @@ -77,6 +77,10 @@ tpm20_read(struct cdev *dev, struct uio *uio, int flag
>
> callout_stop(&sc->discard_buffer_callout);
> sx_xlock(&sc->dev_lock);
> +   if (sc->owner_tid != uio->uio_td->td_tid) {
> +   sx_xunlock(&sc->dev_lock);
> +   return (EPERM);
> +   }
>
> bytes_to_transfer = MIN(sc->pending_data_length, uio->uio_resid);
> if (bytes_to_transfer > 0) {
> @@ -128,9 +132,11 @@ tpm20_write(struct cdev *dev, struct uio *uio, int fla
>
> result = sc->transmit(sc, byte_count);
>
> -   if (result == 0)
> +   if (result == 0) {
> callout_reset(&sc->discard_buffer_callout,
> TPM_READ_TIMEOUT / tick, tpm20_discard_buffer, sc);
> +   sc->owner_tid = uio->uio_td->td_tid;
> +   }
>
> sx_xunlock(&sc->dev_lock);
> return (result);
>
> Modified: head/sys/dev/tpm/tpm20.h
> ==
> --- head/sys/dev/tpm/tpm20.hTue Apr 16 02:12:38 2019(r346258)
> +++ head/sys/dev/tpm/tpm20.hTue Apr 16 02:28:35 2019(r346259)
> @@ -120,6 +120,7 @@ struct tpm_sc {
>
> uint8_t *buf;
> size_t  pending_data_length;
> +   lwpid_t owner_tid;
>
> struct callout  discard_buffer_callout;
>  #ifdef TPM_HARVEST
>


___
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: r346293 - in head/sys/arm/allwinner: . clk

2019-09-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Apr 16 19:38:16 2019
New Revision: 346293
URL: https://svnweb.freebsd.org/changeset/base/346293

Log:
  allwinner: clk: Garbage collect old clock implementation
  
  The old clocks are disconneted from the build since r337344.
  Remove all those pseudo drivers. The only one remaining is for gmac
  (the ethernet controller) so move it to sys/arm/allwinner.
  While here remove a83t support from gmacclk as it is unneeded since r326114.
  
  MFC after:1 month

Added:
  head/sys/arm/allwinner/aw_gmacclk.c
 - copied, changed from r346292, head/sys/arm/allwinner/clk/aw_gmacclk.c
Deleted:
  head/sys/arm/allwinner/clk/
Modified:
  head/sys/arm/allwinner/aw_ccu.c
  head/sys/arm/allwinner/files.allwinner

Modified: head/sys/arm/allwinner/aw_ccu.c
==
--- head/sys/arm/allwinner/aw_ccu.c Tue Apr 16 18:47:20 2019
(r346292)
+++ head/sys/arm/allwinner/aw_ccu.c Tue Apr 16 19:38:16 2019
(r346293)
@@ -53,38 +53,18 @@ __FBSDID("$FreeBSD$");
 #defineCCU_BASE0x01c2
 #defineCCU_SIZE0x400
 
-#definePRCM_BASE   0x01f01400
-#definePRCM_SIZE   0x200
-
-#defineSYSCTRL_BASE0x01c0
-#defineSYSCTRL_SIZE0x34
-
 struct aw_ccu_softc {
struct simplebus_softc  sc;
bus_space_tag_t bst;
-   bus_space_handle_t  ccu_bsh;
-   bus_space_handle_t  prcm_bsh;
-   bus_space_handle_t  sysctrl_bsh;
+   bus_space_handle_t  bsh;
struct mtx  mtx;
int flags;
 };
 
-#defineCLOCK_CCU   (1 << 0)
-#defineCLOCK_PRCM  (1 << 1)
-#defineCLOCK_SYSCTRL   (1 << 2)
-
 static struct ofw_compat_data compat_data[] = {
-   { "allwinner,sun4i-a10",CLOCK_CCU },
-   { "allwinner,sun5i-a13",CLOCK_CCU },
-   { "allwinner,sun7i-a20",CLOCK_CCU },
-   { "allwinner,sun6i-a31",CLOCK_CCU },
-   { "allwinner,sun6i-a31s",   CLOCK_CCU },
-   { "allwinner,sun50i-a64",   CLOCK_CCU },
-   { "allwinner,sun50i-h5",CLOCK_CCU },
-   { "allwinner,sun8i-a33",CLOCK_CCU },
-   { "allwinner,sun8i-a83t",   CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL },
-   { "allwinner,sun8i-h2-plus",CLOCK_CCU|CLOCK_PRCM },
-   { "allwinner,sun8i-h3", CLOCK_CCU|CLOCK_PRCM },
+   { "allwinner,sun7i-a20",1 },
+   { "allwinner,sun6i-a31",1 },
+   { "allwinner,sun6i-a31s",   1 },
{ NULL, 0 }
 };
 
@@ -92,24 +72,11 @@ static int
 aw_ccu_check_addr(struct aw_ccu_softc *sc, bus_addr_t addr,
 bus_space_handle_t *pbsh, bus_size_t *poff)
 {
-   if (addr >= CCU_BASE && addr < (CCU_BASE + CCU_SIZE) &&
-   (sc->flags & CLOCK_CCU) != 0) {
+   if (addr >= CCU_BASE && addr < (CCU_BASE + CCU_SIZE)) {
*poff = addr - CCU_BASE;
-   *pbsh = sc->ccu_bsh;
+   *pbsh = sc->bsh;
return (0);
}
-   if (addr >= PRCM_BASE && addr < (PRCM_BASE + PRCM_SIZE) &&
-   (sc->flags & CLOCK_PRCM) != 0) {
-   *poff = addr - PRCM_BASE;
-   *pbsh = sc->prcm_bsh;
-   return (0);
-   }
-   if (addr >= SYSCTRL_BASE && addr < (SYSCTRL_BASE + SYSCTRL_SIZE) &&
-   (sc->flags & CLOCK_SYSCTRL) != 0) {
-   *poff = addr - SYSCTRL_BASE;
-   *pbsh = sc->sysctrl_bsh;
-   return (0);
-   }
return (EINVAL);
 }
 
@@ -241,29 +208,11 @@ aw_ccu_attach(device_t dev)
 * properties.
 */
sc->bst = bus_get_bus_tag(dev);
-   if (sc->flags & CLOCK_CCU) {
-   error = bus_space_map(sc->bst, CCU_BASE, CCU_SIZE, 0,
-   &sc->ccu_bsh);
-   if (error != 0) {
-   device_printf(dev, "couldn't map CCU: %d\n", error);
-   return (error);
-   }
-   }
-   if (sc->flags & CLOCK_PRCM) {
-   error = bus_space_map(sc->bst, PRCM_BASE, PRCM_SIZE, 0,
-   &sc->prcm_bsh);
-   if (error != 0) {
-   device_printf(dev, "couldn't map PRCM: %d\n", error);
-   return (error);
-   }
-   }
-   if (sc->flags & CLOCK_SYSCTRL) {
-   error = bus_space_map(sc->bst, SYSCTRL_BASE, SYSCTRL_SIZE, 0,
-   &sc->sysctrl_bsh);
-   if (error != 0) {
-   device_printf(dev, "couldn't map SYSCTRL: %d\n", error);
-   return (error);
-   }
+   error = bus_space_map(sc->bst, CCU_BASE, CCU_SIZE, 0,
+   &sc->bsh);
+   if (error != 0) {
+   device_printf(dev, "couldn't map CCU: %d\n", error);
+   return (error);
}
 
mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF);

Copied a

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

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 19 12:57:37 2019
New Revision: 346381
URL: https://svnweb.freebsd.org/changeset/base/346381

Log:
  MFC r345960:
  Provide newbus infrastructure for initiating device reset.

Modified:
  stable/11/sys/kern/bus_if.m
  stable/11/sys/kern/subr_bus.c
  stable/11/sys/sys/bus.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/bus_if.m
==
--- stable/11/sys/kern/bus_if.m Fri Apr 19 12:54:05 2019(r346380)
+++ stable/11/sys/kern/bus_if.m Fri Apr 19 12:57:37 2019(r346381)
@@ -66,6 +66,16 @@ CODE {
 
panic("bus_add_child is not implemented");
}
+
+   static int null_reset_post(device_t bus, device_t dev)
+   {
+   return (0);
+   }
+
+   static int null_reset_prepare(device_t bus, device_t dev)
+   {
+   return (0);
+   }
 };
 
 /**
@@ -810,3 +820,48 @@ METHOD int get_cpus {
size_t  _setsize;
cpuset_t*_cpuset;
 } DEFAULT bus_generic_get_cpus;
+
+/**
+ * @brief Prepares the given child of the bus for reset
+ *
+ * Typically bus detaches or suspends children' drivers, and then
+ * calls this method to save bus-specific information, for instance,
+ * PCI config space, which is damaged by reset.
+ *
+ * The bus_helper_reset_prepare() helper is provided to ease
+ * implementing bus reset methods.
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ */
+METHOD int reset_prepare {
+   device_t _dev;
+   device_t _child;
+} DEFAULT null_reset_prepare;
+
+/**
+ * @brief Restores the child operations after the reset
+ *
+ * The bus_helper_reset_post() helper is provided to ease
+ * implementing bus reset methods.
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ */
+METHOD int reset_post {
+   device_t _dev;
+   device_t _child;
+} DEFAULT null_reset_post;
+
+/**
+ * @brief Performs reset of the child
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ * @param _flags   DEVF_RESET_ flags
+ */
+METHOD int reset_child {
+   device_t _dev;
+   device_t _child;
+   int _flags;
+};

Modified: stable/11/sys/kern/subr_bus.c
==
--- stable/11/sys/kern/subr_bus.c   Fri Apr 19 12:54:05 2019
(r346380)
+++ stable/11/sys/kern/subr_bus.c   Fri Apr 19 12:57:37 2019
(r346381)
@@ -3822,6 +3822,96 @@ bus_generic_resume(device_t dev)
return (0);
 }
 
+
+/**
+ * @brief Helper function for implementing BUS_RESET_POST
+ *
+ * Bus can use this function to implement common operations of
+ * re-attaching or resuming the children after the bus itself was
+ * reset, and after restoring bus-unique state of children.
+ *
+ * @param dev  The bus
+ * #param flagsDEVF_RESET_*
+ */
+int
+bus_helper_reset_post(device_t dev, int flags)
+{
+   device_t child;
+   int error, error1;
+
+   error = 0;
+   TAILQ_FOREACH(child, &dev->children,link) {
+   BUS_RESET_POST(dev, child);
+   error1 = (flags & DEVF_RESET_DETACH) != 0 ?
+   device_probe_and_attach(child) :
+   BUS_RESUME_CHILD(dev, child);
+   if (error == 0 && error1 != 0)
+   error = error1;
+   }
+   return (error);
+}
+
+static void
+bus_helper_reset_prepare_rollback(device_t dev, device_t child, int flags)
+{
+
+   child = TAILQ_NEXT(child, link);
+   if (child == NULL)
+   return;
+   TAILQ_FOREACH_FROM(child, &dev->children,link) {
+   BUS_RESET_POST(dev, child);
+   if ((flags & DEVF_RESET_DETACH) != 0)
+   device_probe_and_attach(child);
+   else
+   BUS_RESUME_CHILD(dev, child);
+   }
+}
+
+/**
+ * @brief Helper function for implementing BUS_RESET_PREPARE
+ *
+ * Bus can use this function to implement common operations of
+ * detaching or suspending the children before the bus itself is
+ * reset, and then save bus-unique state of children that must
+ * persists around reset.
+ *
+ * @param dev  The bus
+ * #param flagsDEVF_RESET_*
+ */
+int
+bus_helper_reset_prepare(device_t dev, int flags)
+{
+   device_t child;
+   int error;
+
+   if (dev->state != DS_ATTACHED)
+   return (EBUSY);
+
+   TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) {
+   if ((flags & DEVF_RESET_DETACH) != 0) {
+   error = device_get_state(child) == DS_ATTACHED ?
+   device_detach(child) : 0;
+   } else {
+   error = BUS_SUSPEND_CHILD(dev, child);
+   }
+   if (error == 0) {
+   error = BUS_RESET_PREPARE(dev, child);
+ 

svn commit: r346362 - in vendor/zstd/1.4.0: . contrib/adaptive-compression contrib/docker contrib/experimental_dict_builders contrib/largeNbDicts contrib/premake contrib/pzstd contrib/pzstd/utils c...

2019-09-03 Thread Conrad Meyer
Author: cem
Date: Fri Apr 19 00:32:13 2019
New Revision: 346362
URL: https://svnweb.freebsd.org/changeset/base/346362

Log:
  tag zstd 1.4.0

Added:
  vendor/zstd/1.4.0/
 - copied from r346360, vendor/zstd/dist/
  vendor/zstd/1.4.0/CHANGELOG
 - copied unchanged from r346361, vendor/zstd/dist/CHANGELOG
  vendor/zstd/1.4.0/contrib/docker/
 - copied from r346361, vendor/zstd/dist/contrib/docker/
  vendor/zstd/1.4.0/contrib/experimental_dict_builders/
 - copied from r346361, vendor/zstd/dist/contrib/experimental_dict_builders/
  vendor/zstd/1.4.0/contrib/largeNbDicts/
 - copied from r346361, vendor/zstd/dist/contrib/largeNbDicts/
  vendor/zstd/1.4.0/contrib/premake/
 - copied from r346361, vendor/zstd/dist/contrib/premake/
  vendor/zstd/1.4.0/contrib/snap/
 - copied from r346361, vendor/zstd/dist/contrib/snap/
  vendor/zstd/1.4.0/examples/
 - copied from r346361, vendor/zstd/dist/examples/
  vendor/zstd/1.4.0/programs/timefn.c
 - copied unchanged from r346361, vendor/zstd/dist/programs/timefn.c
  vendor/zstd/1.4.0/programs/timefn.h
 - copied unchanged from r346361, vendor/zstd/dist/programs/timefn.h
  vendor/zstd/1.4.0/tests/fuzz/dictionary_decompress.c
 - copied unchanged from r346361, 
vendor/zstd/dist/tests/fuzz/dictionary_decompress.c
  vendor/zstd/1.4.0/tests/fuzz/dictionary_round_trip.c
 - copied unchanged from r346361, 
vendor/zstd/dist/tests/fuzz/dictionary_round_trip.c
Replaced:
  vendor/zstd/1.4.0/Makefile
 - copied unchanged from r346361, vendor/zstd/dist/Makefile
  vendor/zstd/1.4.0/README.md
 - copied unchanged from r346361, vendor/zstd/dist/README.md
  vendor/zstd/1.4.0/contrib/adaptive-compression/Makefile
 - copied unchanged from r346361, 
vendor/zstd/dist/contrib/adaptive-compression/Makefile
  vendor/zstd/1.4.0/contrib/adaptive-compression/adapt.c
 - copied unchanged from r346361, 
vendor/zstd/dist/contrib/adaptive-compression/adapt.c
  vendor/zstd/1.4.0/contrib/pzstd/Makefile
 - copied unchanged from r346361, vendor/zstd/dist/contrib/pzstd/Makefile
  vendor/zstd/1.4.0/contrib/pzstd/Pzstd.cpp
 - copied unchanged from r346361, vendor/zstd/dist/contrib/pzstd/Pzstd.cpp
  vendor/zstd/1.4.0/contrib/pzstd/utils/Range.h
 - copied unchanged from r346361, 
vendor/zstd/dist/contrib/pzstd/utils/Range.h
  vendor/zstd/1.4.0/contrib/pzstd/utils/ResourcePool.h
 - copied unchanged from r346361, 
vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h
  vendor/zstd/1.4.0/doc/README.md
 - copied unchanged from r346361, vendor/zstd/dist/doc/README.md
  vendor/zstd/1.4.0/doc/educational_decoder/Makefile
 - copied unchanged from r346361, 
vendor/zstd/dist/doc/educational_decoder/Makefile
  vendor/zstd/1.4.0/doc/educational_decoder/zstd_decompress.c
 - copied unchanged from r346361, 
vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c
  vendor/zstd/1.4.0/doc/zstd_manual.html
 - copied unchanged from r346361, vendor/zstd/dist/doc/zstd_manual.html
  vendor/zstd/1.4.0/lib/Makefile
 - copied unchanged from r346361, vendor/zstd/dist/lib/Makefile
  vendor/zstd/1.4.0/lib/README.md
 - copied unchanged from r346361, vendor/zstd/dist/lib/README.md
  vendor/zstd/1.4.0/lib/common/compiler.h
 - copied unchanged from r346361, vendor/zstd/dist/lib/common/compiler.h
  vendor/zstd/1.4.0/lib/common/fse.h
 - copied unchanged from r346361, vendor/zstd/dist/lib/common/fse.h
  vendor/zstd/1.4.0/lib/common/threading.c
 - copied unchanged from r346361, vendor/zstd/dist/lib/common/threading.c
  vendor/zstd/1.4.0/lib/common/xxhash.c
 - copied unchanged from r346361, vendor/zstd/dist/lib/common/xxhash.c
  vendor/zstd/1.4.0/lib/common/zstd_internal.h
 - copied unchanged from r346361, 
vendor/zstd/dist/lib/common/zstd_internal.h
  vendor/zstd/1.4.0/lib/compress/fse_compress.c
 - copied unchanged from r346361, 
vendor/zstd/dist/lib/compress/fse_compress.c
  vendor/zstd/1.4.0/lib/compress/zstd_compress.c
 - copied unchanged from r346361, 
vendor/zstd/dist/lib/compress/zstd_compress.c
  vendor/zstd/1.4.0/lib/compress/zstd_compress_internal.h
 - copied unchanged from r346361, 
vendor/zstd/dist/lib/compress/zstd_compress_internal.h
  vendor/zstd/1.4.0/lib/compress/zstd_fast.c
 - copied unchanged from r346361, vendor/zstd/dist/lib/compress/zstd_fast.c
  vendor/zstd/1.4.0/lib/compress/zstd_lazy.h
 - copied unchanged from r346361, vendor/zstd/dist/lib/compress/zstd_lazy.h
  vendor/zstd/1.4.0/lib/compress/zstd_ldm.c
 - copied unchanged from r346361, vendor/zstd/dist/lib/compress/zstd_ldm.c
  vendor/zstd/1.4.0/lib/compress/zstd_opt.c
 - copied unchanged from r346361, vendor/zstd/dist/lib/compress/zstd_opt.c
  vendor/zstd/1.4.0/lib/compress/zstdmt_compress.c
 - copied unchanged from r346361, 
vendor/zstd/dist/lib/compress/zstdmt_compress.c
  vendor/zstd/1.4.0/lib/compress/zstdmt_compress.h
 - copied unchanged from r346361, 
vendor/zstd/dist/lib/compress/zstdmt_compress.h
  vendor/zstd/1.4.0/li

svn commit: r346337 - in stable/12/sys: dev/e1000 dev/ixgbe dev/ixl net sys

2019-09-03 Thread Eric Joyner
Author: erj
Date: Wed Apr 17 23:02:37 2019
New Revision: 346337
URL: https://svnweb.freebsd.org/changeset/base/346337

Log:
  MFC r345303, r345305, r345657, r345658
  
  Includes:
  - iflib: prevent possible infinite loop in iflib_encap
  - iflib: expose the Rx mbuf buffer size to drivers
  - iflib: hold the CTX lock in iflib_pseudo_register
  - iflib: return ENETDOWN when the network device is down

Modified:
  stable/12/sys/dev/e1000/if_em.c
  stable/12/sys/dev/ixgbe/if_ix.c
  stable/12/sys/dev/ixgbe/if_ixv.c
  stable/12/sys/dev/ixl/if_iavf.c
  stable/12/sys/dev/ixl/ixl_pf_main.c
  stable/12/sys/net/iflib.c
  stable/12/sys/net/iflib.h
  stable/12/sys/sys/param.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/e1000/if_em.c
==
--- stable/12/sys/dev/e1000/if_em.c Wed Apr 17 22:45:19 2019
(r346336)
+++ stable/12/sys/dev/e1000/if_em.c Wed Apr 17 23:02:37 2019
(r346337)
@@ -1270,14 +1270,7 @@ em_if_init(if_ctx_t ctx)
/* Setup Multicast table */
em_if_multi_set(ctx);
 
-   /*
-* Figure out the desired mbuf
-* pool for doing jumbos
-*/
-   if (adapter->hw.mac.max_frame_size <= 2048)
-   adapter->rx_mbuf_sz = MCLBYTES;
-   else
-   adapter->rx_mbuf_sz = MJUMPAGESIZE;
+   adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx);
em_initialize_receive_unit(ctx);
 
/* Use real VLAN Filter support? */

Modified: stable/12/sys/dev/ixgbe/if_ix.c
==
--- stable/12/sys/dev/ixgbe/if_ix.c Wed Apr 17 22:45:19 2019
(r346336)
+++ stable/12/sys/dev/ixgbe/if_ix.c Wed Apr 17 23:02:37 2019
(r346337)
@@ -2880,10 +2880,7 @@ ixgbe_if_init(if_ctx_t ctx)
ixgbe_if_multi_set(ctx);
 
/* Determine the correct mbuf pool, based on frame size */
-   if (adapter->max_frame_size <= MCLBYTES)
-   adapter->rx_mbuf_sz = MCLBYTES;
-   else
-   adapter->rx_mbuf_sz = MJUMPAGESIZE;
+   adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx);
 
/* Configure RX settings */
ixgbe_initialize_receive_units(ctx);

Modified: stable/12/sys/dev/ixgbe/if_ixv.c
==
--- stable/12/sys/dev/ixgbe/if_ixv.cWed Apr 17 22:45:19 2019
(r346336)
+++ stable/12/sys/dev/ixgbe/if_ixv.cWed Apr 17 23:02:37 2019
(r346337)
@@ -629,14 +629,7 @@ ixv_if_init(if_ctx_t ctx)
/* Setup Multicast table */
ixv_if_multi_set(ctx);
 
-   /*
-* Determine the correct mbuf pool
-* for doing jumbo/headersplit
-*/
-   if (ifp->if_mtu > ETHERMTU)
-   adapter->rx_mbuf_sz = MJUMPAGESIZE;
-   else
-   adapter->rx_mbuf_sz = MCLBYTES;
+   adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx);
 
/* Configure RX settings */
ixv_initialize_receive_units(ctx);

Modified: stable/12/sys/dev/ixl/if_iavf.c
==
--- stable/12/sys/dev/ixl/if_iavf.c Wed Apr 17 22:45:19 2019
(r346336)
+++ stable/12/sys/dev/ixl/if_iavf.c Wed Apr 17 23:02:37 2019
(r346337)
@@ -614,7 +614,6 @@ iavf_send_vc_msg(struct iavf_sc *sc, u32 op)
 static void
 iavf_init_queues(struct ixl_vsi *vsi)
 {
-   if_softc_ctx_t scctx = vsi->shared;
struct ixl_tx_queue *tx_que = vsi->tx_queues;
struct ixl_rx_queue *rx_que = vsi->rx_queues;
struct rx_ring *rxr;
@@ -625,10 +624,7 @@ iavf_init_queues(struct ixl_vsi *vsi)
for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) {
rxr = &rx_que->rxr;
 
-   if (scctx->isc_max_frame_size <= MCLBYTES)
-   rxr->mbuf_sz = MCLBYTES;
-   else
-   rxr->mbuf_sz = MJUMPAGESIZE;
+   rxr->mbuf_sz = iflib_get_rx_mbuf_sz(vsi->ctx);
 
wr32(vsi->hw, rxr->tail, 0);
}

Modified: stable/12/sys/dev/ixl/ixl_pf_main.c
==
--- stable/12/sys/dev/ixl/ixl_pf_main.c Wed Apr 17 22:45:19 2019
(r346336)
+++ stable/12/sys/dev/ixl/ixl_pf_main.c Wed Apr 17 23:02:37 2019
(r346337)
@@ -1300,10 +1300,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi)
struct i40e_hmc_obj_rxq rctx;
 
/* Next setup the HMC RX Context  */
-   if (scctx->isc_max_frame_size <= MCLBYTES)
-   rxr->mbuf_sz = MCLBYTES;
-   else
-   rxr->mbuf_sz = MJUMPAGESIZE;
+   rxr->mbuf_sz = iflib_get_rx_mbuf_sz(vsi->ctx);
 
u16 max_rxmax = rxr->mbuf_sz * hw->func_caps.rx_buf_chain_len;
 

Modified: stable/12/sys/net/iflib.c
===

svn commit: r346347 - head/tests/sys/netpfil/pf

2019-09-03 Thread Kristof Provost
Author: kp
Date: Thu Apr 18 10:54:08 2019
New Revision: 346347
URL: https://svnweb.freebsd.org/changeset/base/346347

Log:
  pf tests: Fail the test if we can't set the rules
  
  The test should fail if pf rules can't be set. This is helpful both
  while writing tests and to verify that pfctl works as expected.
  
  MFC after:1 week
  Event:Aberdeen hackathon 2019

Modified:
  head/tests/sys/netpfil/pf/utils.subr

Modified: head/tests/sys/netpfil/pf/utils.subr
==
--- head/tests/sys/netpfil/pf/utils.subrThu Apr 18 05:40:50 2019
(r346346)
+++ head/tests/sys/netpfil/pf/utils.subrThu Apr 18 10:54:08 2019
(r346347)
@@ -40,6 +40,10 @@ pft_set_rules()
printf "$1\n"
shift
done | jexec ${jname} pfctl -f -
+   if [ $? -ne 0 ];
+   then
+   atf_fail "Failed to set PF rules in ${jname}"
+   fi
 }
 
 pft_cleanup()


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


Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf

2019-09-03 Thread Enji Cooper



> On Apr 20, 2019, at 9:44 AM, John Baldwin  wrote:
> 
> On 4/20/19 6:23 AM, Justin Hibbits wrote:
>> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
>> 
>>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
>>> wrote:
 
 
 
 On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> 
> Author: asomers
> Date: Sat Apr 20 12:51:05 2019
> New Revision: 346441
> URL: https://svnweb.freebsd.org/changeset/base/346441
> 
> Log:
>  Use symlinks for kernel modules rather than hardlinks
> 
>  When aliasing a kernel module to a different name (ie if_igb for
>>> if_em),
>  it's better to use symlinks than hard links. kldxref will omit
>>> entries for
>  the links, ensuring that the loaded module has the correct name.
> 
> 
 
 
 Thanks! This should fix installkernel on my POWER9.
 
 - Justin
>>> 
>>> What's the problem with your POWER9?  Is that one of those msdosfs
>>> /boot systems?  If so, I don't think this will fix it.  msdosfs
>>> doesn't support either symlinks or hardlinks.  Or is there some other
>>> problem?
>>> -Alan
>>> 
>> 
>> Yes it is.  Well that's a bummer then. I thought we faked symlinks on
>> msdosfs, but on second thought not sure how well would do that.
> 
> You could just use cp instead of a link?

*eyes `install -l`*:

 -l linkflags
 Instead of copying the file make a link to the source.  The type
 of the link is determined by the linkflags argument.  Valid
 linkflags are: a (absolute), r (relative), h (hard), s
 (symbolic), m (mixed).  Absolute and relative have effect only
 for symbolic links.  Mixed links are hard links for files on the
 same filesystem, symbolic otherwise.

Cheers,
-Enji


___
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: r346404 - in stable/11: usr.bin/netstat usr.sbin/syslogd

2019-09-03 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Apr 19 17:29:20 2019
New Revision: 346404
URL: https://svnweb.freebsd.org/changeset/base/346404

Log:
  MFC 344740:
  
Fix compilation of world with WITHOUT_{INET,INET6}_SUPPORT or both set.
  
Buildworld failed when both WITHOUT_INET6_SUPPORT and INET equivalent were 
set.
Fix netstat and syslogd by applying appropriate #ifdef INET/INET6 to make 
world
compile again.

Modified:
  stable/11/usr.bin/netstat/inet.c
  stable/11/usr.sbin/syslogd/syslogd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/netstat/inet.c
==
--- stable/11/usr.bin/netstat/inet.cFri Apr 19 17:28:38 2019
(r346403)
+++ stable/11/usr.bin/netstat/inet.cFri Apr 19 17:29:20 2019
(r346404)
@@ -84,8 +84,10 @@ __FBSDID("$FreeBSD$");
 #include "netstat.h"
 #include "nl_defs.h"
 
-void   inetprint(const char *, struct in_addr *, int, const char *, int,
+#ifdef INET
+static void inetprint(const char *, struct in_addr *, int, const char *, int,
 const int);
+#endif
 #ifdef INET6
 static int udp_done, tcp_done, sdp_done;
 #endif /* INET6 */
@@ -506,6 +508,7 @@ protopr(u_long off, const char *name, int af1, int pro
so->so_rcv.sb_cc, so->so_snd.sb_cc);
}
if (numeric_port) {
+#ifdef INET
if (inp->inp_vflag & INP_IPV4) {
inetprint("local", &inp->inp_laddr,
(int)inp->inp_lport, name, 1, af1);
@@ -513,8 +516,12 @@ protopr(u_long off, const char *name, int af1, int pro
inetprint("remote", &inp->inp_faddr,
(int)inp->inp_fport, name, 1, af1);
}
+#endif
+#if defined(INET) && defined(INET6)
+   else
+#endif
 #ifdef INET6
-   else if (inp->inp_vflag & INP_IPV6) {
+   if (inp->inp_vflag & INP_IPV6) {
inet6print("local", &inp->in6p_laddr,
(int)inp->inp_lport, name, 1);
if (!Lflag)
@@ -523,6 +530,7 @@ protopr(u_long off, const char *name, int af1, int pro
} /* else nothing printed now */
 #endif /* INET6 */
} else if (inp->inp_flags & INP_ANONPORT) {
+#ifdef INET
if (inp->inp_vflag & INP_IPV4) {
inetprint("local", &inp->inp_laddr,
(int)inp->inp_lport, name, 1, af1);
@@ -530,8 +538,12 @@ protopr(u_long off, const char *name, int af1, int pro
inetprint("remote", &inp->inp_faddr,
(int)inp->inp_fport, name, 0, af1);
}
+#endif
+#if defined(INET) && defined(INET6)
+   else
+#endif
 #ifdef INET6
-   else if (inp->inp_vflag & INP_IPV6) {
+   if (inp->inp_vflag & INP_IPV6) {
inet6print("local", &inp->in6p_laddr,
(int)inp->inp_lport, name, 1);
if (!Lflag)
@@ -540,6 +552,7 @@ protopr(u_long off, const char *name, int af1, int pro
} /* else nothing printed now */
 #endif /* INET6 */
} else {
+#ifdef INET
if (inp->inp_vflag & INP_IPV4) {
inetprint("local", &inp->inp_laddr,
(int)inp->inp_lport, name, 0, af1);
@@ -549,8 +562,12 @@ protopr(u_long off, const char *name, int af1, int pro
inp->inp_lport != inp->inp_fport,
af1);
}
+#endif
+#if defined(INET) && defined(INET6)
+   else
+#endif
 #ifdef INET6
-   else if (inp->inp_vflag & INP_IPV6) {
+   if (inp->inp_vflag & INP_IPV6) {
inet6print("local", &inp->in6p_laddr,
(int)inp->inp_lport, name, 0);
if (!Lflag)
@@ -1415,10 +1432,11 @@ pim_stats(u_long off __unused, const char *name, int a
xo_close_container(name);
 }
 
+#ifdef INET
 /*
  * Pretty print an Internet address (net address + port).
  */
-void
+static void
 inetprint(const char *container, struct in_addr *in, int port,
 const char *proto, int num_port, const int af1)
 {
@@ -1505,3 +1523,4 @@ inetname(struct in_addr *inp)
}
return (line);
 }
+#endif

Modified: stable/11/usr.sbin/syslogd/syslogd.c
==
--- stable/11/usr.sbin/syslogd/syslogd.cFri Apr 19 17:28:38 2019
(r346403)
+++ stab

svn commit: r346355 - head/sys/x86/iommu

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 18 15:31:03 2019
New Revision: 346355
URL: https://svnweb.freebsd.org/changeset/base/346355

Log:
  Use correct type name.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/x86/iommu/intel_drv.c

Modified: head/sys/x86/iommu/intel_drv.c
==
--- head/sys/x86/iommu/intel_drv.c  Thu Apr 18 15:19:28 2019
(r346354)
+++ head/sys/x86/iommu/intel_drv.c  Thu Apr 18 15:31:03 2019
(r346355)
@@ -1010,8 +1010,8 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg
printf("dmar%d no dev found for RMRR "
"[%#jx, %#jx] rid %#x scope path ",
 iria->dmar->unit,
-(uintptr_t)resmem->BaseAddress,
-(uintptr_t)resmem->EndAddress,
+(uintmax_t)resmem->BaseAddress,
+(uintmax_t)resmem->EndAddress,
 rid);
dmar_print_path(devscope->Bus, dev_path_len,
(const ACPI_DMAR_PCI_PATH *)(devscope + 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: r346273 - in head/sys: compat/freebsd32 kern

2019-09-03 Thread Ed Maste
Author: emaste
Date: Tue Apr 16 13:26:31 2019
New Revision: 346273
URL: https://svnweb.freebsd.org/changeset/base/346273

Log:
  correct readlinkat(2) return type
  
  r176215 corrected readlink(2)'s return type and the type of the last
  argument.  readlink(2) was introduced in r177788 after being developed
  as part of Google Summer of Code 2007; it appears to have inherited the
  wrong return type.
  
  Man pages and header files were already ssize_t; update syscalls.master
  to match.
  
  PR:   197915
  Submitted by: Henning Petersen 
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Tue Apr 16 12:40:49 2019
(r346272)
+++ head/sys/compat/freebsd32/syscalls.master   Tue Apr 16 13:26:31 2019
(r346273)
@@ -963,7 +963,7 @@
uint32_t dev); }
 499AUE_OPENAT_RWTC NOPROTO { int openat(int fd, const char *path, \
int flag, mode_t mode); }
-500AUE_READLINKAT  NOPROTO { int readlinkat(int fd, const char *path, \
+500AUE_READLINKAT  NOPROTO { ssize_t readlinkat(int fd, const char *path, \
char *buf, size_t bufsize); }
 501AUE_RENAMEATNOPROTO { int renameat(int oldfd, const char *old, \
int newfd, const char *new); }

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Tue Apr 16 12:40:49 2019
(r346272)
+++ head/sys/kern/syscalls.master   Tue Apr 16 13:26:31 2019
(r346273)
@@ -2716,7 +2716,7 @@
);
}
 500AUE_READLINKAT  STD {
-   int readlinkat(
+   ssize_t readlinkat(
int fd,
_In_z_ const char *path,
_Out_writes_bytes_(bufsize) char *buf,


___
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: r346441 - in head/sys/modules: em fusefs iavf

2019-09-03 Thread Warner Losh
On Sat, Apr 20, 2019, 10:44 AM John Baldwin  wrote:

> On 4/20/19 6:23 AM, Justin Hibbits wrote:
> > On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> >
> >> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> >> wrote:
> >>>
> >>>
> >>>
> >>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> 
>  Author: asomers
>  Date: Sat Apr 20 12:51:05 2019
>  New Revision: 346441
>  URL: https://svnweb.freebsd.org/changeset/base/346441
> 
>  Log:
>    Use symlinks for kernel modules rather than hardlinks
> 
>    When aliasing a kernel module to a different name (ie if_igb for
> >> if_em),
>    it's better to use symlinks than hard links. kldxref will omit
> >> entries for
>    the links, ensuring that the loaded module has the correct name.
> 
> 
> >>>
> >>>
> >>> Thanks! This should fix installkernel on my POWER9.
> >>>
> >>> - Justin
> >>
> >> What's the problem with your POWER9?  Is that one of those msdosfs
> >> /boot systems?  If so, I don't think this will fix it.  msdosfs
> >> doesn't support either symlinks or hardlinks.  Or is there some other
> >> problem?
> >> -Alan
> >>
> >
> > Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> > msdosfs, but on second thought not sure how well would do that.
>
> You could just use cp instead of a link?
>

I don't think this solves the original issue.

Warner

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


svn commit: r346575 - in head/stand/efi: include libefi loader

2019-09-03 Thread Warner Losh
Author: imp
Date: Mon Apr 22 18:40:24 2019
New Revision: 346575
URL: https://svnweb.freebsd.org/changeset/base/346575

Log:
  Create boot_img as a global variable
  
  Get the information from the image that we're booting and store it in
  a global variable. Prefer using this to passing it around. Remove the
  special case for zfs that set the preferred boot handle by having it
  uses this global variable diretly.
  
  Reviewed by: kevans@
  Differential Revision: https://reviews.freebsd.org/D20015

Modified:
  head/stand/efi/include/efi.h
  head/stand/efi/include/efizfs.h
  head/stand/efi/libefi/efizfs.c
  head/stand/efi/loader/main.c

Modified: head/stand/efi/include/efi.h
==
--- head/stand/efi/include/efi.hMon Apr 22 18:38:54 2019
(r346574)
+++ head/stand/efi/include/efi.hMon Apr 22 18:40:24 2019
(r346575)
@@ -62,6 +62,11 @@ Revision History
 #include "efiuga.h"
 
 /*
+ * Global variables
+ */
+extern EFI_LOADED_IMAGE *boot_img;
+
+/*
  * FreeBSD UUID
  */
 #define FREEBSD_BOOT_VAR_GUID \

Modified: head/stand/efi/include/efizfs.h
==
--- head/stand/efi/include/efizfs.h Mon Apr 22 18:38:54 2019
(r346574)
+++ head/stand/efi/include/efizfs.h Mon Apr 22 18:40:24 2019
(r346575)
@@ -50,10 +50,8 @@ void efi_zfs_probe(void);
 EFI_HANDLE efizfs_get_handle_by_guid(uint64_t);
 bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *);
 zfsinfo_list_t *efizfs_get_zfsinfo_list(void);
-void efizfs_set_preferred(EFI_HANDLE);
 
 #else
-#define efizfs_set_preferred(x)
 #define efi_zfs_probe NULL
 #endif
 

Modified: head/stand/efi/libefi/efizfs.c
==
--- head/stand/efi/libefi/efizfs.c  Mon Apr 22 18:38:54 2019
(r346574)
+++ head/stand/efi/libefi/efizfs.c  Mon Apr 22 18:40:24 2019
(r346575)
@@ -45,14 +45,6 @@ static zfsinfo_list_t zfsinfo;
 
 uint64_t pool_guid;
 
-static EFI_HANDLE preferred;
-
-void
-efizfs_set_preferred(EFI_HANDLE h)
-{
-   preferred = h;
-}
-
 zfsinfo_list_t *
 efizfs_get_zfsinfo_list(void)
 {
@@ -122,7 +114,7 @@ efi_zfs_probe(void)
efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit);
if (zfs_probe_dev(devname, &guid) == 0) {
insert_zfs(pd->pd_handle, guid);
-   if (pd->pd_handle == preferred)
+   if (pd->pd_handle == boot_img->DeviceHandle)
pool_guid = guid;
}
 

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cMon Apr 22 18:38:54 2019
(r346574)
+++ head/stand/efi/loader/main.cMon Apr 22 18:40:24 2019
(r346575)
@@ -88,6 +88,11 @@ static int fail_timeout = 5;
  */
 UINT16 boot_current;
 
+/*
+ * Image that we booted from.
+ */
+EFI_LOADED_IMAGE *boot_img;
+
 static bool
 has_keyboard(void)
 {
@@ -300,7 +305,7 @@ fix_dosisms(char *p)
 
 enum { BOOT_INFO_OK = 0, BAD_CHOICE = 1, NOT_SPECIFIC = 2  };
 static int
-match_boot_info(EFI_LOADED_IMAGE *img __unused, char *boot_info, size_t bisz)
+match_boot_info(char *boot_info, size_t bisz)
 {
uint32_t attr;
uint16_t fplen;
@@ -448,7 +453,7 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, char *
  * a drop to the OK boot loader prompt is possible.
  */
 static int
-find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, bool is_last,
+find_currdev(bool do_bootmgr, bool is_last,
 char *boot_info, size_t boot_info_sz)
 {
pdinfo_t *dp, *pp;
@@ -481,7 +486,7 @@ find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, b
 * loader.conf.
 */
if (do_bootmgr) {
-   rv = match_boot_info(img, boot_info, boot_info_sz);
+   rv = match_boot_info(boot_info, boot_info_sz);
switch (rv) {
case BOOT_INFO_OK:  /* We found it */
return (0);
@@ -514,7 +519,7 @@ find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, b
 * boot protocol to do so. We fail and let UEFI go on to
 * the next candidate.
 */
-   dp = efiblk_get_pdinfo_by_handle(img->DeviceHandle);
+   dp = efiblk_get_pdinfo_by_handle(boot_img->DeviceHandle);
if (dp != NULL) {
text = efi_devpath_name(dp->pd_devpath);
if (text != NULL) {
@@ -553,7 +558,7 @@ find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, b
 * any of the nodes in that path match one of the enumerated
 * handles. Currently, this handle list is only for netboot.
 */
-   if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &extra) == 0) {
+   if (efi_handle_lookup(boot_img->DeviceHandle, &dev, &uni

svn commit: r346454 - head/lib/libvgl

2019-09-03 Thread Bruce Evans
Author: bde
Date: Sat Apr 20 20:29:03 2019
New Revision: 346454
URL: https://svnweb.freebsd.org/changeset/base/346454

Log:
  Make libvgl mostly work without superuser privilege in direct modes by
  not doing any unnecessary PIO instructions or refusing to start when the
  i/o privilege needed for these instructions cannot be acquired.
  
  This turns off useless palette management in direct modes.  Palette
  management had no useful effect since the hardware palette is not used
  in these modes.
  
  This transiently acquires i/o privilege if possible as needed to give
  VGLSetBorder() and VGLBlankDisplay() a chance of working.  Neither has
  much chance of working.  I was going to drop support for them in direct
  modes, but found that VGLBlankDisplay() still works with an old graphics
  card on a not so old LCD monitor.
  
  This has some good side effects: reduce glitches for managing the palette
  for screen switches, and speed up and reduce async-signal-unsafeness in
  mouse cursor drawing.

Modified:
  head/lib/libvgl/main.c
  head/lib/libvgl/mouse.c
  head/lib/libvgl/simple.c

Modified: head/lib/libvgl/main.c
==
--- head/lib/libvgl/main.c  Sat Apr 20 17:16:36 2019(r346453)
+++ head/lib/libvgl/main.c  Sat Apr 20 20:29:03 2019(r346454)
@@ -93,7 +93,8 @@ struct vt_mode smode;
 size[2] = VGLOldVInfo.font_size;;
 ioctl(0, KDRASTER, size);
   }
-  ioctl(0, KDDISABIO, 0);
+  if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+ioctl(0, KDDISABIO, 0);
   ioctl(0, KDSETMODE, KD_TEXT);
   smode.mode = VT_AUTO;
   ioctl(0, VT_SETMODE, &smode);
@@ -176,7 +177,7 @@ VGLInit(int mode)
   if (VGLDisplay == NULL)
 return -2;
 
-  if (ioctl(0, KDENABIO, 0)) {
+  if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0)) {
 free(VGLDisplay);
 return -3;
   }
@@ -370,7 +371,8 @@ VGLCheckSwitch()
 
 VGLSwitchPending = 0;
 if (VGLOnDisplay) {
-  ioctl(0, KDENABIO, 0);
+  if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+ioctl(0, KDENABIO, 0);
   ioctl(0, KDSETMODE, KD_GRAPHICS);
   ioctl(0, VGLMode, 0);
   VGLCurWindow = 0;
@@ -531,7 +533,8 @@ VGLCheckSwitch()
   munmap(VGLDisplay->Bitmap, VGLAdpInfo.va_window_size);
   ioctl(0, VGLOldMode, 0);
   ioctl(0, KDSETMODE, KD_TEXT);
-  ioctl(0, KDDISABIO, 0);
+  if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+ioctl(0, KDDISABIO, 0);
   ioctl(0, VT_RELDISP, VT_TRUE);
   VGLDisplay->Bitmap = VGLBuf;
   VGLDisplay->Type = MEMBUF;

Modified: head/lib/libvgl/mouse.c
==
--- head/lib/libvgl/mouse.c Sat Apr 20 17:16:36 2019(r346453)
+++ head/lib/libvgl/mouse.c Sat Apr 20 20:29:03 2019(r346454)
@@ -111,10 +111,12 @@ VGLMousePointerShow()
   if (!VGLMouseVisible) {
 INTOFF();
 VGLMouseVisible = 1;
-crtcidx = inb(0x3c4);
-crtcval = inb(0x3c5);
-gdcidx = inb(0x3ce);
-gdcval = inb(0x3cf);
+if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+  crtcidx = inb(0x3c4);
+  crtcval = inb(0x3c5);
+  gdcidx = inb(0x3ce);
+  gdcval = inb(0x3cf);
+}
 __VGLBitmapCopy(VGLDisplay, VGLMouseXpos, VGLMouseYpos, 
  &VGLMouseSave, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
 bcopy(VGLMouseSave.Bitmap, buffer.Bitmap,
@@ -128,10 +130,12 @@ VGLMousePointerShow()
   }
 __VGLBitmapCopy(&buffer, 0, 0, VGLDisplay, 
  VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
-outb(0x3c4, crtcidx);
-outb(0x3c5, crtcval);
-outb(0x3ce, gdcidx);
-outb(0x3cf, gdcval);
+if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+  outb(0x3c4, crtcidx);
+  outb(0x3c5, crtcval);
+  outb(0x3ce, gdcidx);
+  outb(0x3cf, gdcval);
+}
 INTON();
   }
 }
@@ -144,16 +148,20 @@ VGLMousePointerHide()
   if (VGLMouseVisible) {
 INTOFF();
 VGLMouseVisible = 0;
-crtcidx = inb(0x3c4);
-crtcval = inb(0x3c5);
-gdcidx = inb(0x3ce);
-gdcval = inb(0x3cf);
+if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+  crtcidx = inb(0x3c4);
+  crtcval = inb(0x3c5);
+  gdcidx = inb(0x3ce);
+  gdcval = inb(0x3cf);
+}
 __VGLBitmapCopy(&VGLMouseSave, 0, 0, VGLDisplay, 
  VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
-outb(0x3c4, crtcidx);
-outb(0x3c5, crtcval);
-outb(0x3ce, gdcidx);
-outb(0x3cf, gdcval);
+if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+  outb(0x3c4, crtcidx);
+  outb(0x3c5, crtcval);
+  outb(0x3ce, gdcidx);
+  outb(0x3cf, gdcval);
+}
 INTON();
   }
 }

Modified: head/lib/libvgl/simple.c
==
--- head/lib/libvgl/simple.cSat Apr 20 17:16:36 2019(r346453)
+++ head/lib/libvgl/simple.c   

svn commit: r346552 - stable/11/sys/arm/freescale/imx

2019-09-03 Thread Ian Lepore
Author: ian
Date: Mon Apr 22 13:59:21 2019
New Revision: 346552
URL: https://svnweb.freebsd.org/changeset/base/346552

Log:
  MFC r344267:
  
  Add a compatible string to match recent changes in the upstream dts.

Modified:
  stable/11/sys/arm/freescale/imx/imx6_snvs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/freescale/imx/imx6_snvs.c
==
--- stable/11/sys/arm/freescale/imx/imx6_snvs.c Mon Apr 22 13:58:28 2019
(r346551)
+++ stable/11/sys/arm/freescale/imx/imx6_snvs.c Mon Apr 22 13:59:21 2019
(r346552)
@@ -73,6 +73,7 @@ struct snvs_softc {
 };
 
 static struct ofw_compat_data compat_data[] = {
+   {"fsl,sec-v4.0-mon-rtc-lp", true},
{"fsl,sec-v4.0-mon", true},
{NULL,   false}
 };


___
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: r346439 - stable/12/sys/conf

2019-09-03 Thread Mark Johnston
Author: markj
Date: Sat Apr 20 11:05:56 2019
New Revision: 346439
URL: https://svnweb.freebsd.org/changeset/base/346439

Log:
  MFC r345348, r345594:
  Use -fdebug-prefix-map to map auto-generated kernel build paths.

Modified:
  stable/12/sys/conf/kern.post.mk
  stable/12/sys/conf/kmod.mk
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/kern.post.mk
==
--- stable/12/sys/conf/kern.post.mk Sat Apr 20 11:04:13 2019
(r346438)
+++ stable/12/sys/conf/kern.post.mk Sat Apr 20 11:05:56 2019
(r346439)
@@ -310,6 +310,11 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
 
 .depend: .PRECIOUS ${SRCS}
 
+.if ${COMPILER_TYPE} == "clang" || \
+(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 6)
+_MAP_DEBUG_PREFIX= yes
+.endif
+
 _ILINKS= machine
 .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
 _ILINKS+= ${MACHINE_CPUARCH}
@@ -319,9 +324,17 @@ _ILINKS+= x86
 .endif
 
 # Ensure that the link exists without depending on it when it exists.
+# Ensure that debug info references the path in the source tree.
 .for _link in ${_ILINKS}
 .if !exists(${.OBJDIR}/${_link})
 ${SRCS} ${CLEAN:M*.o}: ${_link}
+.endif
+.if defined(_MAP_DEBUG_PREFIX)
+.if ${_link} == "machine"
+CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include
+.else
+CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include
+.endif
 .endif
 .endfor
 

Modified: stable/12/sys/conf/kmod.mk
==
--- stable/12/sys/conf/kmod.mk  Sat Apr 20 11:04:13 2019(r346438)
+++ stable/12/sys/conf/kmod.mk  Sat Apr 20 11:05:56 2019(r346439)
@@ -267,6 +267,11 @@ ${FULLPROG}: ${OBJS}
${OBJCOPY} --strip-debug ${.TARGET}
 .endif
 
+.if ${COMPILER_TYPE} == "clang" || \
+(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 6)
+_MAP_DEBUG_PREFIX= yes
+.endif
+
 _ILINKS=machine
 .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
 _ILINKS+=${MACHINE_CPUARCH}
@@ -283,9 +288,17 @@ beforebuild: ${_ILINKS}
 
 # Ensure that the links exist without depending on it when it exists which
 # causes all the modules to be rebuilt when the directory pointed to changes.
+# Ensure that debug info references the path in the source tree.
 .for _link in ${_ILINKS}
 .if !exists(${.OBJDIR}/${_link})
 OBJS_DEPEND_GUESS+=${_link}
+.endif
+.if defined(_MAP_DEBUG_PREFIX)
+.if ${_link} == "machine"
+CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include
+.else
+CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include
+.endif
 .endif
 .endfor
 


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


svn commit: r346489 - head/sys/arm/broadcom/bcm2835

2019-09-03 Thread Ian Lepore
Author: ian
Date: Sun Apr 21 17:39:01 2019
New Revision: 346489
URL: https://svnweb.freebsd.org/changeset/base/346489

Log:
  Move the reporting of spurious interrupts under bootverbose control, because
  occasional spurious interrupts are a normal thing on this hardware.  Also,
  change the name of the cpu-local interrupt controller driver from local_intc
  to lintc, because the name gets built into interrupt names, which have to
  fit into a 19-byte field for stats reporting (so this allows 5 more bytes
  of the actual interrupt name to be displayed).

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_intr.c
  head/sys/arm/broadcom/bcm2835/bcm2836.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_intr.cSun Apr 21 16:17:35 
2019(r346488)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.cSun Apr 21 17:39:01 
2019(r346489)
@@ -230,7 +230,7 @@ bcm2835_intc_intr(void *arg)
}
arm_irq_memory_barrier(0); /* XXX */
}
-   if (num == 0)
+   if (num == 0 && bootverbose)
device_printf(sc->sc_dev, "Spurious interrupt detected\n");
 
return (FILTER_HANDLED);

Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2836.c Sun Apr 21 16:17:35 2019
(r346488)
+++ head/sys/arm/broadcom/bcm2835/bcm2836.c Sun Apr 21 17:39:01 2019
(r346489)
@@ -421,7 +421,7 @@ bcm_lintc_intr(void *arg)
reg &= ~BCM_LINTC_PENDING_MASK;
if (reg != 0)
device_printf(sc->bls_dev, "Unknown interrupt(s) %x\n", reg);
-   else if (num == 0)
+   else if (num == 0 && bootverbose)
device_printf(sc->bls_dev, "Spurious interrupt detected\n");
 
return (FILTER_HANDLED);
@@ -730,12 +730,12 @@ static device_method_t bcm_lintc_methods[] = {
 };
 
 static driver_t bcm_lintc_driver = {
-   "local_intc",
+   "lintc",
bcm_lintc_methods,
sizeof(struct bcm_lintc_softc),
 };
 
 static devclass_t bcm_lintc_devclass;
 
-EARLY_DRIVER_MODULE(local_intc, simplebus, bcm_lintc_driver, 
bcm_lintc_devclass,
+EARLY_DRIVER_MODULE(lintc, simplebus, bcm_lintc_driver, bcm_lintc_devclass,
 0, 0, BUS_PASS_INTERRUPT);


___
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: r346377 - in stable/12/sys: kern sys

2019-09-03 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 19 12:45:45 2019
New Revision: 346377
URL: https://svnweb.freebsd.org/changeset/base/346377

Log:
  MFC r345960:
  Provide newbus infrastructure for initiating device reset.

Modified:
  stable/12/sys/kern/bus_if.m
  stable/12/sys/kern/subr_bus.c
  stable/12/sys/sys/bus.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/bus_if.m
==
--- stable/12/sys/kern/bus_if.m Fri Apr 19 12:40:21 2019(r346376)
+++ stable/12/sys/kern/bus_if.m Fri Apr 19 12:45:45 2019(r346377)
@@ -66,6 +66,16 @@ CODE {
 
panic("bus_add_child is not implemented");
}
+
+   static int null_reset_post(device_t bus, device_t dev)
+   {
+   return (0);
+   }
+
+   static int null_reset_prepare(device_t bus, device_t dev)
+   {
+   return (0);
+   }
 };
 
 /**
@@ -848,3 +858,48 @@ METHOD int get_cpus {
size_t  _setsize;
cpuset_t*_cpuset;
 } DEFAULT bus_generic_get_cpus;
+
+/**
+ * @brief Prepares the given child of the bus for reset
+ *
+ * Typically bus detaches or suspends children' drivers, and then
+ * calls this method to save bus-specific information, for instance,
+ * PCI config space, which is damaged by reset.
+ *
+ * The bus_helper_reset_prepare() helper is provided to ease
+ * implementing bus reset methods.
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ */
+METHOD int reset_prepare {
+   device_t _dev;
+   device_t _child;
+} DEFAULT null_reset_prepare;
+
+/**
+ * @brief Restores the child operations after the reset
+ *
+ * The bus_helper_reset_post() helper is provided to ease
+ * implementing bus reset methods.
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ */
+METHOD int reset_post {
+   device_t _dev;
+   device_t _child;
+} DEFAULT null_reset_post;
+
+/**
+ * @brief Performs reset of the child
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ * @param _flags   DEVF_RESET_ flags
+ */
+METHOD int reset_child {
+   device_t _dev;
+   device_t _child;
+   int _flags;
+};

Modified: stable/12/sys/kern/subr_bus.c
==
--- stable/12/sys/kern/subr_bus.c   Fri Apr 19 12:40:21 2019
(r346376)
+++ stable/12/sys/kern/subr_bus.c   Fri Apr 19 12:45:45 2019
(r346377)
@@ -3854,6 +3854,96 @@ bus_generic_resume(device_t dev)
return (0);
 }
 
+
+/**
+ * @brief Helper function for implementing BUS_RESET_POST
+ *
+ * Bus can use this function to implement common operations of
+ * re-attaching or resuming the children after the bus itself was
+ * reset, and after restoring bus-unique state of children.
+ *
+ * @param dev  The bus
+ * #param flagsDEVF_RESET_*
+ */
+int
+bus_helper_reset_post(device_t dev, int flags)
+{
+   device_t child;
+   int error, error1;
+
+   error = 0;
+   TAILQ_FOREACH(child, &dev->children,link) {
+   BUS_RESET_POST(dev, child);
+   error1 = (flags & DEVF_RESET_DETACH) != 0 ?
+   device_probe_and_attach(child) :
+   BUS_RESUME_CHILD(dev, child);
+   if (error == 0 && error1 != 0)
+   error = error1;
+   }
+   return (error);
+}
+
+static void
+bus_helper_reset_prepare_rollback(device_t dev, device_t child, int flags)
+{
+
+   child = TAILQ_NEXT(child, link);
+   if (child == NULL)
+   return;
+   TAILQ_FOREACH_FROM(child, &dev->children,link) {
+   BUS_RESET_POST(dev, child);
+   if ((flags & DEVF_RESET_DETACH) != 0)
+   device_probe_and_attach(child);
+   else
+   BUS_RESUME_CHILD(dev, child);
+   }
+}
+
+/**
+ * @brief Helper function for implementing BUS_RESET_PREPARE
+ *
+ * Bus can use this function to implement common operations of
+ * detaching or suspending the children before the bus itself is
+ * reset, and then save bus-unique state of children that must
+ * persists around reset.
+ *
+ * @param dev  The bus
+ * #param flagsDEVF_RESET_*
+ */
+int
+bus_helper_reset_prepare(device_t dev, int flags)
+{
+   device_t child;
+   int error;
+
+   if (dev->state != DS_ATTACHED)
+   return (EBUSY);
+
+   TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) {
+   if ((flags & DEVF_RESET_DETACH) != 0) {
+   error = device_get_state(child) == DS_ATTACHED ?
+   device_detach(child) : 0;
+   } else {
+   error = BUS_SUSPEND_CHILD(dev, child);
+   }
+   if (error == 0) {
+   error = BUS_RESET_PREPARE(dev, child);
+ 

svn commit: r346480 - in stable/11/stand: common efi/libefi efi/loader fdt i386/pxeldr

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Sun Apr 21 04:15:57 2019
New Revision: 346480
URL: https://svnweb.freebsd.org/changeset/base/346480

Log:
  MFC r338262, r339334, r339796, r340240, r340857, r340917, r341007
  
  r338262:
  stand: fdt: Drop some write-only assignments/variables and leaked bits
  
  Generally straightforward enough; a copy of argv[1] was being made in
  command_fdt_internal, solely used for a comparison within the
  handler-search, then promptly leaked.
  
  r339334:
  loader.efi: add poweroff command
  
  Add poweroff command to make life a bit easier.
  
  r339796:
  Simplify the EFI delay() function by calling BS->Stall()
  
  r340240:
  loader: ptable_open() check for ptable_cd9660read result is wrong
  
  The ptable_*read() functions return NULL on read errors (and partition table
  closed as an side effect). The ptable_open must check the return value and
  act properly.
  
  r340857:
  Nuke out buffer overflow safety marker code, it duplicates similar code in
  the malloc()/free() as well as having potential of softening the handling
  in case error is detected down to a mere warning as compared to hard panic
  in free().
  
  r340917:
  Update pxeboot(8) manual page to reflect the next-server change in the ISC 
DHCP v3 server.
  
  r341007:
  Bump the date of pxeboot(8) manual page for r340917.
  
  PR:   123484, 232483

Modified:
  stable/11/stand/common/bcache.c
  stable/11/stand/common/part.c
  stable/11/stand/efi/libefi/delay.c
  stable/11/stand/efi/loader/main.c
  stable/11/stand/fdt/fdt_loader_cmd.c
  stable/11/stand/i386/pxeldr/pxeboot.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/common/bcache.c
==
--- stable/11/stand/common/bcache.c Sun Apr 21 04:00:19 2019
(r346479)
+++ stable/11/stand/common/bcache.c Sun Apr 21 04:15:57 2019
(r346480)
@@ -86,7 +86,6 @@ static u_int bcache_rablks;
((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno))
 #defineBCACHE_READAHEAD256
 #defineBCACHE_MINREADAHEAD 32
-#defineBCACHE_MARKER   0xdeadbeef
 
 static voidbcache_invalidate(struct bcache *bc, daddr_t blkno);
 static voidbcache_insert(struct bcache *bc, daddr_t blkno);
@@ -123,7 +122,6 @@ bcache_allocate(void)
 u_int i;
 struct bcache *bc = malloc(sizeof (struct bcache));
 int disks = bcache_numdev;
-uint32_t *marker;
 
 if (disks == 0)
disks = 1;  /* safe guard */
@@ -142,8 +140,7 @@ bcache_allocate(void)
 
 bc->bcache_nblks = bcache_total_nblks >> i;
 bcache_unit_nblks = bc->bcache_nblks;
-bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize +
-   sizeof(uint32_t));
+bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize);
 if (bc->bcache_data == NULL) {
/* dont error out yet. fall back to 32 blocks and try again */
bc->bcache_nblks = 32;
@@ -158,9 +155,6 @@ bcache_allocate(void)
errno = ENOMEM;
return (NULL);
 }
-/* Insert cache end marker. */
-marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize);
-*marker = BCACHE_MARKER;
 
 /* Flush the cache */
 for (i = 0; i < bc->bcache_nblks; i++) {
@@ -222,15 +216,12 @@ read_strategy(void *devdata, int rw, daddr_t blk, size
 intresult;
 daddr_tp_blk;
 caddr_tp_buf;
-uint32_t   *marker;
 
 if (bc == NULL) {
errno = ENODEV;
return (-1);
 }
 
-marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize);
-
 if (rsize != NULL)
*rsize = 0;
 
@@ -348,12 +339,6 @@ read_strategy(void *devdata, int rw, daddr_t blk, size
 if (size != 0) {
bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size);
result = 0;
-}
-
-if (*marker != BCACHE_MARKER) {
-   printf("BUG: bcache corruption detected: nblks: %zu p_blk: %lu, "
-   "p_size: %zu, ra: %zu\n", bc->bcache_nblks,
-   (long unsigned)BHASH(bc, p_blk), p_size, ra);
 }
 
  done:

Modified: stable/11/stand/common/part.c
==
--- stable/11/stand/common/part.c   Sun Apr 21 04:00:19 2019
(r346479)
+++ stable/11/stand/common/part.c   Sun Apr 21 04:15:57 2019
(r346480)
@@ -675,10 +675,12 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect
table->type = PTABLE_NONE;
STAILQ_INIT(&table->entries);
 
-   if (ptable_iso9660read(table, dev, dread) != NULL) {
-   if (table->type == PTABLE_ISO9660)
-   goto out;
-   }
+   if (ptable_iso9660read(table, dev, dread) == NULL) {
+   /* Read error. */
+   table = NULL;
+   goto out;
+   } else if (table->type == PTABLE_ISO9660)
+

Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Conrad Meyer
On Tue, Apr 16, 2019 at 6:19 AM Warner Losh  wrote:
> On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot  wrote:
>>  It's not only CI, all release images (memstick, iso) don't have
>> a /boot/entropy.
>>  Also all arm/arm64 image don't have this file too.
>>  If /boot/entropy is needed and isn't present loader(8) should gather
>> some entropy and pass this to the kernel for the first boot.
>
> Maybe we need to bootstrap the entropy file as part of buildworld. I'm not 
> sure if the loader can find enough...

Well, one thing we should explicitly *not do* is distribute the same
"entropy" to everyone in released images.  So there is some difficulty
here.  Buildworld does not know if the target of the build is a
one-off or a release image.  Something like makerelease still seems
inappropriately dangerous.

The idea of loader-provided entropy is not that it generates the
entropy itself, but that it can access the /boot/ filesystem to load
entropy and pass it to the kernel as a fake module.

I think we have identified that at least stack_chk_init was silently
broken on a number of systems, using non-random stack guards.  Now
it's loudly broken.  Ed has proposed a happy medium where we can
check, in stack_chk_init, if the random device is seeded (via new KPI)
and give users a big stick tunable to proceed without entropy or not.
For now, I think we would default that to "proceed" just to unbreak CI
and any other sharp corners.  But the goal would be to default that to
"panic" eventually.

I don't know enough about stack_chk_init to determine how late it can
be seeded.  It seems to have come in in r180012 as a component of
-fstack-protector.  I will do a little investigating.  Suggestions on
appropriate reviewers welcome (I think ru@ is no longer with the
project).

Best regards,
Conrad


___
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: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys

2019-09-03 Thread Conrad Meyer
Hey Adrian,

As discussed with John and Warner upthread, I hope to have a patch out
for review later today to give folks a knob to disable this.  It may
even make sense to default it on, at least for !x86.  I am happy to CC
you on review if you like.

Take care,
Conrad

On Wed, Apr 17, 2019 at 11:22 AM Adrian Chadd  wrote:
>
>
>
> On Mon, 15 Apr 2019 at 11:40, Conrad Meyer  wrote:
>>
>> Author: cem
>> Date: Mon Apr 15 18:40:36 2019
>> New Revision: 346250
>> URL: https://svnweb.freebsd.org/changeset/base/346250
>>
>> Log:
>>   random(4): Block read_random(9) on initial seeding
>
>
> Sniffle, this broke on my mips boards whilst debugging why I'm seeing 
> transmit crashes and other bad behaviours. if_arge has some hacks to randomly 
> allocate mac addresses if the board doesn't supply them. This is going to be 
> a common thing to deal with during board bring-up before you do things like, 
> I dunno, make storage work. I'm going to fix if_arge to use the new API to 
> generate MAC addresses but there'll be other places where this will bite you.
>
> Please reconsider this a bit. I know people are trying to improve our 
> security and cryptography support. But some of us are trying to use FreeBSD 
> code in fun places and maybe occasionally do some more porting work. :-)
>
>
> -adrian
>
>


___
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: r346438 - stable/12/usr.sbin/bhyve

2019-09-03 Thread Mark Johnston
Author: markj
Date: Sat Apr 20 11:04:13 2019
New Revision: 346438
URL: https://svnweb.freebsd.org/changeset/base/346438

Log:
  MFC r346010:
  Fix indentation.

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

Modified: stable/12/usr.sbin/bhyve/uart_emul.c
==
--- stable/12/usr.sbin/bhyve/uart_emul.cSat Apr 20 11:03:46 2019
(r346437)
+++ stable/12/usr.sbin/bhyve/uart_emul.cSat Apr 20 11:04:13 2019
(r346438)
@@ -437,75 +437,75 @@ uart_write(struct uart_softc *sc, int offset, uint8_t 
 */
sc->ier = value & 0x0F;
break;
-   case REG_FCR:
-   /*
-* When moving from FIFO and 16450 mode and vice versa,
-* the FIFO contents are reset.
-*/
-   if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) {
-   fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1;
-   rxfifo_reset(sc, fifosz);
-   }
+   case REG_FCR:
+   /*
+* When moving from FIFO and 16450 mode and vice versa,
+* the FIFO contents are reset.
+*/
+   if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) {
+   fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1;
+   rxfifo_reset(sc, fifosz);
+   }
 
-   /*
-* The FCR_ENABLE bit must be '1' for the programming
-* of other FCR bits to be effective.
-*/
-   if ((value & FCR_ENABLE) == 0) {
-   sc->fcr = 0;
-   } else {
-   if ((value & FCR_RCV_RST) != 0)
-   rxfifo_reset(sc, FIFOSZ);
+   /*
+* The FCR_ENABLE bit must be '1' for the programming
+* of other FCR bits to be effective.
+*/
+   if ((value & FCR_ENABLE) == 0) {
+   sc->fcr = 0;
+   } else {
+   if ((value & FCR_RCV_RST) != 0)
+   rxfifo_reset(sc, FIFOSZ);
 
-   sc->fcr = value &
-(FCR_ENABLE | FCR_DMA | FCR_RX_MASK);
-   }
-   break;
-   case REG_LCR:
-   sc->lcr = value;
-   break;
-   case REG_MCR:
-   /* Apply mask so that bits 5-7 are 0 */
-   sc->mcr = value & 0x1F;
-   msr = modem_status(sc->mcr);
+   sc->fcr = value &
+(FCR_ENABLE | FCR_DMA | FCR_RX_MASK);
+   }
+   break;
+   case REG_LCR:
+   sc->lcr = value;
+   break;
+   case REG_MCR:
+   /* Apply mask so that bits 5-7 are 0 */
+   sc->mcr = value & 0x1F;
+   msr = modem_status(sc->mcr);
 
-   /*
-* Detect if there has been any change between the
-* previous and the new value of MSR. If there is
-* then assert the appropriate MSR delta bit.
-*/
-   if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS))
-   sc->msr |= MSR_DCTS;
-   if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR))
-   sc->msr |= MSR_DDSR;
-   if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD))
-   sc->msr |= MSR_DDCD;
-   if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0)
-   sc->msr |= MSR_TERI;
+   /*
+* Detect if there has been any change between the
+* previous and the new value of MSR. If there is
+* then assert the appropriate MSR delta bit.
+*/
+   if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS))
+   sc->msr |= MSR_DCTS;
+   if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR))
+   sc->msr |= MSR_DDSR;
+   if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD))
+   sc->msr |= MSR_DDCD;
+   if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0)
+   sc->msr |= MSR_TERI;
 
-   /*
-* Update the value of MSR while retaining the delta
-* bits.
-*/
-   sc->msr &= MSR_DELTA_MASK;
-   sc->msr |= msr;
-  

svn commit: r346342 - stable/12/sys/rpc/rpcsec_gss

2019-09-03 Thread Rick Macklem
Author: rmacklem
Date: Thu Apr 18 02:32:04 2019
New Revision: 346342
URL: https://svnweb.freebsd.org/changeset/base/346342

Log:
  MFC: r345866
  Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.
  
  The code enabled when "DEBUG" is defined uses mem_alloc(), which is a
  malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer()
  which does a free(.., M_GSSAPI) to free the memory.
  This patch fixes the problem by replacing mem_alloc() with a
  malloc(.., M_GSSAPI, M_WAITOK | M_ZERO).
  This bug affects almost no one, since the sources are not normally built
  with "DEBUG" defined.

Modified:
  stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==
--- stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c   Thu Apr 18 01:02:00 
2019(r346341)
+++ stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c   Thu Apr 18 02:32:04 
2019(r346342)
@@ -758,7 +758,7 @@ gss_oid_to_str(OM_uint32 *minor_status, gss_OID oid, g
 * here for "{ " and "}\0".
 */
string_length += 4;
-   if ((bp = (char *) mem_alloc(string_length))) {
+   if ((bp = malloc(string_length, M_GSSAPI, M_WAITOK | M_ZERO))) {
strcpy(bp, "{ ");
number = (unsigned long) cp[0];
sprintf(numstr, "%ld ", number/40);


___
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: r346273 - in head/sys: compat/freebsd32 kern

2019-09-03 Thread Dmitry Chagin
вт, 16 апр. 2019 г. в 16:26, Ed Maste :

> Author: emaste
> Date: Tue Apr 16 13:26:31 2019
> New Revision: 346273
> URL: https://svnweb.freebsd.org/changeset/base/346273
>
> Log:
>   correct readlinkat(2) return type
>
>
Hi, Ed
make sysent?



>   r176215 corrected readlink(2)'s return type and the type of the last
>   argument.  readlink(2) was introduced in r177788 after being developed
>   as part of Google Summer of Code 2007; it appears to have inherited the
>   wrong return type.
>
>   Man pages and header files were already ssize_t; update syscalls.master
>   to match.
>
>   PR:   197915
>   Submitted by: Henning Petersen 
>   MFC after:2 weeks
>
> Modified:
>   head/sys/compat/freebsd32/syscalls.master
>   head/sys/kern/syscalls.master
>
> Modified: head/sys/compat/freebsd32/syscalls.master
>
> ==
> --- head/sys/compat/freebsd32/syscalls.master   Tue Apr 16 12:40:49 2019
>   (r346272)
> +++ head/sys/compat/freebsd32/syscalls.master   Tue Apr 16 13:26:31 2019
>   (r346273)
> @@ -963,7 +963,7 @@
> uint32_t dev); }
>  499AUE_OPENAT_RWTC NOPROTO { int openat(int fd, const char *path, \
> int flag, mode_t mode); }
> -500AUE_READLINKAT  NOPROTO { int readlinkat(int fd, const char *path,
> \
> +500AUE_READLINKAT  NOPROTO { ssize_t readlinkat(int fd, const char
> *path, \
> char *buf, size_t bufsize); }
>  501AUE_RENAMEATNOPROTO { int renameat(int oldfd, const char *old,
> \
> int newfd, const char *new); }
>
> Modified: head/sys/kern/syscalls.master
>
> ==
> --- head/sys/kern/syscalls.master   Tue Apr 16 12:40:49 2019
> (r346272)
> +++ head/sys/kern/syscalls.master   Tue Apr 16 13:26:31 2019
> (r346273)
> @@ -2716,7 +2716,7 @@
> );
> }
>  500AUE_READLINKAT  STD {
> -   int readlinkat(
> +   ssize_t readlinkat(
> int fd,
> _In_z_ const char *path,
> _Out_writes_bytes_(bufsize) char *buf,
>
>
___
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: r346341 - head/tools/build

2019-09-03 Thread Ed Maste
On Wed, 17 Apr 2019 at 21:07, Rodney W. Grimes
 wrote:
>
> Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake.

It's not in fact; strings is being built for the host here, and the
headers in /usr/include are the appropriate ones.

In this specific case the Capsicum change needs to be made fully
portable for upstreaming to the ELF Tool Chain project and when that
happens it will build on FreeBSD build hosts older than r346314 the
same way it will build on Linux or other hosts without an up-to-date
cap_fileargs, by using a local portability wrappers.


___
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: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu

2019-09-03 Thread Tycho Nightingale
Author: tychon
Date: Fri Apr 19 13:43:33 2019
New Revision: 346386
URL: https://svnweb.freebsd.org/changeset/base/346386

Log:
  remove the 4GB boundary requirement on PCI DMA segments
  
  Reviewed by:  kib
  Discussed with:   jhb
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D19867

Modified:
  head/sys/dev/bge/if_bgereg.h
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pcivar.h
  head/sys/dev/twa/tw_osl.h
  head/sys/dev/twa/tw_osl_freebsd.c
  head/sys/x86/iommu/intel_ctx.c

Modified: head/sys/dev/bge/if_bgereg.h
==
--- head/sys/dev/bge/if_bgereg.hFri Apr 19 13:23:41 2019
(r346385)
+++ head/sys/dev/bge/if_bgereg.hFri Apr 19 13:43:33 2019
(r346386)
@@ -3067,3 +3067,11 @@ struct bge_softc {
 #defineBGE_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->bge_mtx, MA_OWNED)
 #defineBGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx)
 #defineBGE_LOCK_DESTROY(_sc)   mtx_destroy(&(_sc)->bge_mtx)
+
+#ifdef BUS_SPACE_MAXADDR
+#if (BUS_SPACE_MAXADDR > 0x)
+#defineBGE_DMA_BOUNDARY(0x1)
+#else
+#defineBGE_DMA_BOUNDARY0
+#endif
+#endif

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Fri Apr 19 13:23:41 2019(r346385)
+++ head/sys/dev/pci/pci.c  Fri Apr 19 13:43:33 2019(r346386)
@@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev)
 {
struct pci_softc *sc;
int busno, domain;
-#ifdef PCI_DMA_BOUNDARY
-   int error, tag_valid;
-#endif
 #ifdef PCI_RES_BUS
int rid;
 #endif
@@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev)
if (bootverbose)
device_printf(dev, "domain=%d, physical bus=%d\n",
domain, busno);
-#ifdef PCI_DMA_BOUNDARY
-   tag_valid = 0;
-   if (device_get_devclass(device_get_parent(device_get_parent(dev))) !=
-   devclass_find("pci")) {
-   error = bus_dma_tag_create(bus_get_dma_tag(dev), 1,
-   PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
-   NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED,
-   BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag);
-   if (error)
-   device_printf(dev, "Failed to create DMA tag: %d\n",
-   error);
-   else
-   tag_valid = 1;
-   }
-   if (!tag_valid)
-#endif
-   sc->sc_dma_tag = bus_get_dma_tag(dev);
+   sc->sc_dma_tag = bus_get_dma_tag(dev);
return (0);
 }
 

Modified: head/sys/dev/pci/pcivar.h
==
--- head/sys/dev/pci/pcivar.h   Fri Apr 19 13:23:41 2019(r346385)
+++ head/sys/dev/pci/pcivar.h   Fri Apr 19 13:43:33 2019(r346386)
@@ -693,14 +693,6 @@ intpcie_link_reset(device_t port, int 
pcie_location);
 
 void   pci_print_faulted_dev(void);
 
-#ifdef BUS_SPACE_MAXADDR
-#if (BUS_SPACE_MAXADDR > 0x)
-#definePCI_DMA_BOUNDARY0x1
-#else
-#definePCI_DMA_BOUNDARY0
-#endif
-#endif
-
 #endif /* _SYS_BUS_H_ */
 
 /*

Modified: head/sys/dev/twa/tw_osl.h
==
--- head/sys/dev/twa/tw_osl.h   Fri Apr 19 13:23:41 2019(r346385)
+++ head/sys/dev/twa/tw_osl.h   Fri Apr 19 13:43:33 2019(r346386)
@@ -57,6 +57,12 @@
 #define TW_OSLI_MAX_NUM_IOS(TW_OSLI_MAX_NUM_REQUESTS - 2)
 #define TW_OSLI_MAX_NUM_AENS   0x100
 
+#ifdef PAE
+#defineTW_OSLI_DMA_BOUNDARY(1u << 31)
+#else
+#defineTW_OSLI_DMA_BOUNDARY((bus_size_t)((uint64_t)1 << 
32))
+#endif
+
 /* Possible values of req->state. */
 #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */
 #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */

Modified: head/sys/dev/twa/tw_osl_freebsd.c
==
--- head/sys/dev/twa/tw_osl_freebsd.c   Fri Apr 19 13:23:41 2019
(r346385)
+++ head/sys/dev/twa/tw_osl_freebsd.c   Fri Apr 19 13:43:33 2019
(r346386)
@@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
/* Create the parent dma tag. */
if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */
sc->alignment,  /* alignment */
-   0,  /* boundary */
+   TW_OSLI_DMA_BOUNDARY,   /* boundary */
BUS_SPACE_MAXADDR,  /* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */

svn commit: r346536 - in stable/12: contrib/elftoolchain contrib/elftoolchain/addr2line contrib/elftoolchain/ar contrib/elftoolchain/common contrib/elftoolchain/cxxfilt contrib/elftoolchain/elfcopy...

2019-09-03 Thread Enji Cooper
Author: ngie
Date: Mon Apr 22 08:58:33 2019
New Revision: 346536
URL: https://svnweb.freebsd.org/changeset/base/346536

Log:
  MFC r339473,r340075,r342918,r343592,r343593,r343614,r343665,r343669:
  
  MFC a number of changes to elftoolchain/readelf(1). This brings the copy of
  elftoolchain more in line with the version in ^/head and partially fixes
  the issue with `sys.kern.coredump_phnum_test.coredump_phnum` on ^/stable/12.
  
  Tested with:  make tinderbox
  
  r339473 (by emaste):
  
  libelf: also test for 64-bit ELF in _libelf_is_mips64el
  
  Although _libelf_is_mips64el is only called in contexts where we've
  already checked that e_class is ELFCLASS64 but this may change in the
  future.  Add a safety belt so that we don't access an invalid e_ehdr64
  union member if it does.
  
  r340075 (by emaste):
  
  readelf: decode R_MIPS_HIGHER and R_MIPS_HIGHEST relocation types
  
  r342918 (by emaste):
  
  Update to ELF Tool Chain r3668
  
  Highlights:
  - Make sure that only TLS sections are sorted into TLS segment.
  - Fixed multiple errors in "Section to Segment mapping".
  - Man page updates
  - ar improvements
  - elfcopy: avoid filter_reloc uninitialized variable for rela
  - elfcopy: avoid stripping relocations from static binaries
  - readelf: avoid printing directory in front of absolute path
  - readelf: add NT_FREEBSD_FEATURE_CTL FreeBSD note type
  - test improvements
  
  NOTES:
  
  Some of these changes originated in FreeBSD and simply reduce diffs
  between contrib and vendor.
  
  ELF Tool Chain ar is not (currently) used in FreeBSD, and there are
  improvements in both FreeBSD and ELF Tool Chain ar that are not in
  the other.
  
  r343592 (by emaste):
  
  readelf: decode flag bits in DT_FLAGS/DT_FLAGS_1
  
  Decode d_val when the tag is DT_FLAGS or DT_FLAGS_1 based on the
  information at:
  
  https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-42444.html
  
  PR:   232983
  
  r343593 (by emaste):
  
  readelf: fix i386 build
  
  Use %jx and (uintmax_t) cast.
  
  PR:   232983
  MFC with: r343592
  
  r343614 (by emaste):
  
  readelf: dump elf note data
  
  Output format is compatible with GNU readelf's handling of unknown note
  types (modulo a GNU char signedness bug); future changes will add type-
  specific decoding.
  
  Relnotes: Yes
  
  r343665 (by emaste):
  
  readelf: use table-based DT_FLAGS and DT_FLAGS_1 decoding
  
  Fewer lines of code and more maintainable.
  
  r343669 (by emaste):
  
  readelf: decode FreeBSD note types
  
  Decode NT_FREEBSD_ABI_TAG, NT_FREEBSD_ARCH_TAG, and NT_FREEBSD_FEATURE_CTL.
  
  Relnotes: Yes

Added:
  stable/12/contrib/elftoolchain/README.rst
 - copied unchanged from r342918, head/contrib/elftoolchain/README.rst
  stable/12/contrib/elftoolchain/libelf/libelf_elfmachine.c
 - copied unchanged from r342918, 
head/contrib/elftoolchain/libelf/libelf_elfmachine.c
Modified:
  stable/12/contrib/elftoolchain/addr2line/addr2line.1
  stable/12/contrib/elftoolchain/addr2line/addr2line.c
  stable/12/contrib/elftoolchain/ar/ar.1
  stable/12/contrib/elftoolchain/ar/ar.5
  stable/12/contrib/elftoolchain/ar/ar.c
  stable/12/contrib/elftoolchain/ar/ar.h
  stable/12/contrib/elftoolchain/ar/ranlib.1
  stable/12/contrib/elftoolchain/ar/read.c
  stable/12/contrib/elftoolchain/ar/write.c
  stable/12/contrib/elftoolchain/common/native-elf-format
  stable/12/contrib/elftoolchain/cxxfilt/c++filt.1
  stable/12/contrib/elftoolchain/elfcopy/elfcopy.1
  stable/12/contrib/elftoolchain/elfcopy/elfcopy.h
  stable/12/contrib/elftoolchain/elfcopy/mcs.1
  stable/12/contrib/elftoolchain/elfcopy/sections.c
  stable/12/contrib/elftoolchain/elfcopy/segments.c
  stable/12/contrib/elftoolchain/elfcopy/strip.1
  stable/12/contrib/elftoolchain/libdwarf/dwarf.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_arange.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.

svn commit: r346304 - stable/12/sys/conf

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Tue Apr 16 21:09:57 2019
New Revision: 346304
URL: https://svnweb.freebsd.org/changeset/base/346304

Log:
  MFC r345519: DTS/DTSO makeoptions
  
  Allow kernel config to specify DTS/DTSO to build, and out-of-tree support
  
  This allows for directives such as
  
  makeoptions DTS+=/out/of/tree/myboard.dts
  # in tree! Same rules applied as if this were in a dtb/ module
  makeoptions DTS+=otherboard.dts
  
  to be specified in config(5) and have these built/installed alongside th
  kernel. The assumption that overlays live in an overlays/ directory is only
  made for in-tree DTSO, but we still make the assumption that out-of-tree
  arm64 DTS will be in vendored directories (for now).
  
  This lowers the cost to hacking on an overlay or dts by being able to
  quickly throw it in a custom config, especially if it doesn't fit one of the
  current dtb/modules quite appropriately or it's not intended for commit
  there.
  
  The build/install targets were split out of dtb.mk to centralize the build
  logic and leave out the all/realinstall/CLEANFILES additions... it was
  believed that we didn't want to pollute the kernel build with these.
  
  The build rules were converted to suffix rules at the suggestion of Ian to
  clean things up a little bit in a world where we can have mixed
  in-tree/out-of-tree DTS/DTSO specified.

Added:
  stable/12/sys/conf/dtb.build.mk
 - copied unchanged from r345519, head/sys/conf/dtb.build.mk
Modified:
  stable/12/sys/conf/dtb.mk
  stable/12/sys/conf/kern.post.mk
Directory Properties:
  stable/12/   (props changed)

Copied: stable/12/sys/conf/dtb.build.mk (from r345519, 
head/sys/conf/dtb.build.mk)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/sys/conf/dtb.build.mk Tue Apr 16 21:09:57 2019
(r346304, copy of r345519, head/sys/conf/dtb.build.mk)
@@ -0,0 +1,77 @@
+# $FreeBSD$
+
+.include 
+# Grab all the options for a kernel build. For backwards compat, we need to
+# do this after bsd.own.mk.
+.include "kern.opts.mk"
+
+DTC?=  dtc
+
+.if !defined(SYSDIR)
+.if defined(S)
+SYSDIR=${S}
+.else
+# Search for kernel source tree in standard places.
+.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
+.if exists(${_dir}/kern/)
+SYSDIR=${_dir:tA}
+.endif
+.endfor
+.endif # defined(S)
+.endif # defined(SYSDIR)
+
+.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
+.error "can't find kernel source tree"
+.endif
+
+DTB=${DTS:T:R:S/$/.dtb/}
+DTBO=${DTSO:T:R:S/$/.dtbo/}
+
+.SUFFIXES: .dtb .dts .dtbo .dtso
+.PATH.dts: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/dts/${MACHINE}
+.PATH.dtso: ${SYSDIR}/dts/${MACHINE}/overlays
+
+.export DTC ECHO
+
+.dts.dtb:  ${OP_META}
+   @${ECHO} Generating ${.TARGET} from ${.IMPSRC}
+   @${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${.IMPSRC} ${.OBJDIR}
+
+.dtso.dtbo:${OP_META}
+   @${ECHO} Generating ${.TARGET} from ${.IMPSRC}
+   @${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} ${.IMPSRC} ${.OBJDIR}
+
+# Add dependencies on the source file so that out-of-tree things can be 
included
+# without any .PATH additions.
+.for _dts in ${DTS}
+${_dts:R:T}.dtb: ${_dts}
+.endfor
+
+.for _dtso in ${DTSO}
+${_dtso:R:T}.dtbo: ${_dtso}
+.endfor
+
+_dtbinstall:
+# Need to create this because installkernel doesn't invoke mtree with 
BSD.root.mtree
+# to make sure the tree is setup properly. We don't recreate it to avoid 
duplicate
+# entries in the NO_ROOT case.
+   test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} 
${DESTDIR}${DTBDIR}
+.for _dtb in ${DTB}
+.if ${MACHINE_CPUARCH} == "aarch64"
+   # :H:T here to grab the vendor component of the DTB path in a way that
+   # allows out-of-tree DTS builds, too.  We make the assumption that
+   # out-of-tree DTS will have a similar directory structure to in-tree,
+   # with .dts files appearing in a vendor/ directory.
+   test -d ${DESTDIR}${DTBDIR}/${_dtb:H:T} || ${INSTALL} -d -o ${DTBOWN} 
-g ${DTBGRP} ${DESTDIR}${DTBDIR}/${_dtb:H:T}
+   ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
+   ${_INSTALLFLAGS} ${_dtb:T} ${DESTDIR}${DTBDIR}/${_dtb:H:T}
+.else
+   ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
+   ${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}/
+.endif
+.endfor
+   test -d ${DESTDIR}${DTBODIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} 
${DESTDIR}${DTBODIR}
+.for _dtbo in ${DTBO}
+   ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
+   ${_INSTALLFLAGS} ${_dtbo} ${DESTDIR}${DTBODIR}/
+.endfor

Modified: stable/12/sys/conf/dtb.mk
==
--- stable/12/sys/conf/dtb.mk   Tue Apr 16 21:02:41 2019(r346303)
+++ stable/12/sys/conf/dtb.mk   Tue Apr 16 21:09:57 2019(r346304)
@@ -8,6 +8,8 @@
 #
 # DTS  List of the dts files to build and inst

svn commit: r346279 - head/lib/libvgl

2019-09-03 Thread Bruce Evans
Author: bde
Date: Tue Apr 16 15:41:45 2019
New Revision: 346279
URL: https://svnweb.freebsd.org/changeset/base/346279

Log:
  Oops, r346278 committed a test version with the change annulled.

Modified:
  head/lib/libvgl/main.c

Modified: head/lib/libvgl/main.c
==
--- head/lib/libvgl/main.c  Tue Apr 16 15:31:23 2019(r346278)
+++ head/lib/libvgl/main.c  Tue Apr 16 15:41:45 2019(r346279)
@@ -274,7 +274,7 @@ VGLInit(int mode)
* be too slow, and malloc() may fail).  Restrict ourselves similarly to
* get the same efficiency and bugs for all kernels.
*/
-  if (0 && VGLModeInfo.vi_mode >= M_VESA_BASE)
+  if (VGLModeInfo.vi_mode >= M_VESA_BASE)
 VGLBufSize = 2*VGLAdpInfo.va_line_width*VGLModeInfo.vi_height*
  VGLModeInfo.vi_planes;
   VGLBuf = malloc(VGLBufSize);


___
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: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc

2019-09-03 Thread Ed Maste
On Wed, 17 Apr 2019 at 21:17, Cy Schubert  wrote:
>
> This only tests for the FA_OPEN. It will miss any new macro definitions
> should there be any at some point in the future.

Yes, this should be replaced with a more holistic approach to
addressing includes.


___
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: r346509 - in stable/12/sys: conf geom geom/label modules/geom/geom_label

2019-09-03 Thread Ian Lepore
Author: ian
Date: Mon Apr 22 00:45:09 2019
New Revision: 346509
URL: https://svnweb.freebsd.org/changeset/base/346509

Log:
  MFC r345480, r346013
  
  r345480:
  Support device-independent labels for geom_flashmap slices.
  
  While geom_flashmap has always supported label names for its slices, it does
  so by appending "s.labelname" to the provider device name, meaning you still
  have to know the name and unit of the hardware device to use the labels.
  
  These changes add support for device-independent geom_flashmap labels, using
  the standard geom_label infrastructure. geom_flashmap now creates a softc
  struct attached to its geom, and as it creates slices it stores the label
  into an array in the softc. The new geom_label_flashmap uses those labels
  when tasting a geom_flashmap provider.
  
  Differential Revision:https://reviews.freebsd.org/D19535
  
  r346013:
  Add g_label_flashmap.c to the module, should have been part of r345480.

Added:
  stable/12/sys/geom/geom_flashmap.h
 - copied unchanged from r345480, head/sys/geom/geom_flashmap.h
  stable/12/sys/geom/label/g_label_flashmap.c
 - copied unchanged from r345480, head/sys/geom/label/g_label_flashmap.c
Modified:
  stable/12/sys/conf/files
  stable/12/sys/geom/geom_flashmap.c
  stable/12/sys/geom/label/g_label.c
  stable/12/sys/geom/label/g_label.h
  stable/12/sys/modules/geom/geom_label/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files
==
--- stable/12/sys/conf/filesMon Apr 22 00:38:25 2019(r346508)
+++ stable/12/sys/conf/filesMon Apr 22 00:45:09 2019(r346509)
@@ -3689,6 +3689,7 @@ geom/journal/g_journal.c  optional geom_journal
 geom/journal/g_journal_ufs.c   optional geom_journal
 geom/label/g_label.c   optional geom_label | geom_label_gpt
 geom/label/g_label_ext2fs.coptional geom_label
+geom/label/g_label_flashmap.c  optional geom_label
 geom/label/g_label_iso9660.c   optional geom_label
 geom/label/g_label_msdosfs.c   optional geom_label
 geom/label/g_label_ntfs.c  optional geom_label

Modified: stable/12/sys/geom/geom_flashmap.c
==
--- stable/12/sys/geom/geom_flashmap.c  Mon Apr 22 00:38:25 2019
(r346508)
+++ stable/12/sys/geom/geom_flashmap.c  Mon Apr 22 00:45:09 2019
(r346509)
@@ -39,13 +39,12 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
+#include 
+#include 
 
 #include 
 
-#defineFLASHMAP_CLASS_NAME "Flashmap"
-
 struct g_flashmap_slice {
off_t   sl_start;
off_t   sl_end;
@@ -71,8 +70,8 @@ static g_taste_t g_flashmap_taste;
 
 static int g_flashmap_load(device_t dev, struct g_provider *pp,
 flash_slicer_t slicer, struct g_flashmap_head *head);
-static int g_flashmap_modify(struct g_geom *gp, const char *devname,
-int secsize, struct g_flashmap_head *slices);
+static int g_flashmap_modify(struct g_flashmap *gfp, struct g_geom *gp,
+const char *devname, int secsize, struct g_flashmap_head *slices);
 static void g_flashmap_print(struct g_flashmap_slice *slice);
 
 MALLOC_DECLARE(M_FLASHMAP);
@@ -88,8 +87,8 @@ g_flashmap_print(struct g_flashmap_slice *slice)
 }
 
 static int
-g_flashmap_modify(struct g_geom *gp, const char *devname, int secsize,
-struct g_flashmap_head *slices)
+g_flashmap_modify(struct g_flashmap *gfp, struct g_geom *gp,
+const char *devname, int secsize, struct g_flashmap_head *slices)
 {
struct g_flashmap_slice *slice;
int i, error;
@@ -114,6 +113,8 @@ g_flashmap_modify(struct g_geom *gp, const char *devna
 
i = 0;
STAILQ_FOREACH(slice, slices, sl_link) {
+   free(__DECONST(void *, gfp->labels[i]), M_FLASHMAP);
+   gfp->labels[i] = strdup(slice->sl_name, M_FLASHMAP);
error = g_slice_config(gp, i++, G_SLICE_CONFIG_SET,
slice->sl_start,
slice->sl_end - slice->sl_start + 1,
@@ -153,6 +154,7 @@ g_flashmap_taste(struct g_class *mp, struct g_provider
struct g_consumer *cp;
struct g_flashmap_head head;
struct g_flashmap_slice *slice, *slice_temp;
+   struct g_flashmap *gfp;
flash_slicer_t slicer;
device_t dev;
int i, size;
@@ -164,7 +166,8 @@ g_flashmap_taste(struct g_class *mp, struct g_provider
strcmp(pp->geom->class->name, G_DISK_CLASS_NAME) != 0)
return (NULL);
 
-   gp = g_slice_new(mp, FLASH_SLICES_MAX_NUM, pp, &cp, NULL, 0, NULL);
+   gp = g_slice_new(mp, FLASH_SLICES_MAX_NUM, pp, &cp, (void**)&gfp,
+   sizeof(struct g_flashmap), NULL);
if (gp == NULL)
return (NULL);
 
@@ -186,7 +189,7 @@ g_flashmap_taste(struct g_class *mp, struct g_provider
if (g_flashmap_load(dev, pp, slicer, &head) == 0)
brea

svn commit: r346328 - head/sys/conf

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Wed Apr 17 18:08:28 2019
New Revision: 346328
URL: https://svnweb.freebsd.org/changeset/base/346328

Log:
  Compile sha1.c when ether support is included
  
  sha1 is used by ether_gen_addr after r346324. Perhaps in an ideal world we
  could detect that the kernel's been compiled without sha1_* bits included
  and silently fallback to arc4random instead because these platforms/kernel
  configs are far and few between. It's fairly lightweight, though, so just
  include it for now.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Apr 17 17:50:44 2019(r346327)
+++ head/sys/conf/files Wed Apr 17 18:08:28 2019(r346328)
@@ -680,8 +680,8 @@ crypto/rijndael/rijndael-alg-fst.c optional crypto | e
 crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | random 
!random_loadable
 crypto/rijndael/rijndael-api.c optional crypto | ipsec | ipsec_support | \
wlan_ccmp
-crypto/sha1.c  optional carp | crypto | ipsec | \
-   ipsec_support | netgraph_mppc_encryption | sctp 
+crypto/sha1.c  optional carp | crypto | ether | ipsec | \
+   ipsec_support | netgraph_mppc_encryption | sctp
 crypto/sha2/sha256c.c  optional crypto | ekcd | geom_bde | ipsec | \
ipsec_support | random !random_loadable | sctp | zfs
 crypto/sha2/sha512c.c  optional crypto | geom_bde | ipsec | \


___
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: r346442 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic

2019-09-03 Thread Cy Schubert
Author: cy
Date: Sat Apr 20 15:06:58 2019
New Revision: 346442
URL: https://svnweb.freebsd.org/changeset/base/346442

Log:
  MFC r345996:
  
  Update sqlite3-3.26.0 (326) --> sqlite3-3.27.1 (3270100)

Modified:
  stable/11/contrib/sqlite3/Makefile.in
  stable/11/contrib/sqlite3/Makefile.msc
  stable/11/contrib/sqlite3/aclocal.m4
  stable/11/contrib/sqlite3/config.guess
  stable/11/contrib/sqlite3/config.sub
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/depcomp
  stable/11/contrib/sqlite3/install-sh
  stable/11/contrib/sqlite3/ltmain.sh
  stable/11/contrib/sqlite3/shell.c
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
  stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/sqlite3/Makefile.in
  stable/12/contrib/sqlite3/Makefile.msc
  stable/12/contrib/sqlite3/aclocal.m4
  stable/12/contrib/sqlite3/config.guess
  stable/12/contrib/sqlite3/config.sub
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/depcomp
  stable/12/contrib/sqlite3/install-sh
  stable/12/contrib/sqlite3/ltmain.sh
  stable/12/contrib/sqlite3/shell.c
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
  stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/contrib/sqlite3/Makefile.in
==
--- stable/11/contrib/sqlite3/Makefile.in   Sat Apr 20 12:51:05 2019
(r346441)
+++ stable/11/contrib/sqlite3/Makefile.in   Sat Apr 20 15:06:58 2019
(r346442)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -351,6 +351,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -756,7 +757,7 @@ distdir: $(DISTFILES)
  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-   tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c 
>$(distdir).tar.gz
+   tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c 
>$(distdir).tar.gz
$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -782,7 +783,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
   "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-   shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+   shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -800,7 +801,7 @@ dist dist-all:
 distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -810,7 +811,7 @@ distcheck: dist
*.tar.Z*) \
  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
  unzip $(distdir).zip ;;\
esac

Modified: stable/11/contrib/sqlite3/Makefile.msc
==
--- stable/11/contrib/sqlite3/Makefile.msc  Sat Apr 20 12:51:05 2019
(r346441)
+++ stable/11/contrib/sqlite3/Makefile.msc  Sat Apr 20 15:06:58 2019
(r346442)
@@ -283,6 +283,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1
+OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
 !ENDIF
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
 !ENDIF
@@ -937,6 +938,7 @@ LIBRESOBJS =
 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_

Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Ed Maste
On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota  wrote:
>
> It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to 
> fail as the following with HEAD checked out under "/usr/obj/freebsd":

Hello Hiro-san, sorry about that.

I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but
it failed on the install as DESTDIR wasn't set and I ran as non-root).
Just `make xdev-build` was successful though.

What version were you trying to build? There were (several) followup
commits to address issues with the initial commit of cap_fileargs
lstat support.


___
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: r346301 - stable/12/lib/libbe

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Tue Apr 16 20:59:57 2019
New Revision: 346301
URL: https://svnweb.freebsd.org/changeset/base/346301

Log:
  MFC r346082: libbe(3): use libzfs name validation for datasets/snapshot names
  
  Our home-rolled solution didn't quite capture all of the details, and we
  didn't actually validate snapshot names at all. zfs_name_valid captures the
  important details, but it doesn't necessarily expose the errors that we're
  wanting to see in the be_validate_* functions. Validating lengths
  independently, then the names, should make this a non-issue.

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 Apr 16 20:56:51 2019(r346300)
+++ stable/12/lib/libbe/be.cTue Apr 16 20:59:57 2019(r346301)
@@ -593,6 +593,9 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap
if (strlen(snap_name) >= BE_MAXPATHLEN)
return (BE_ERR_PATHLEN);
 
+   if (!zfs_name_valid(snap_name, ZFS_TYPE_SNAPSHOT))
+   return (BE_ERR_INVALIDNAME);
+
if (!zfs_dataset_exists(lbh->lzh, snap_name,
ZFS_TYPE_SNAPSHOT))
return (BE_ERR_NOENT);
@@ -646,12 +649,6 @@ be_root_concat(libbe_handle_t *lbh, const char *name, 
 int
 be_validate_name(libbe_handle_t *lbh, const char *name)
 {
-   for (int i = 0; *name; i++) {
-   char c = *(name++);
-   if (isalnum(c) || (c == '-') || (c == '_') || (c == '.'))
-   continue;
-   return (BE_ERR_INVALIDNAME);
-   }
 
/*
 * Impose the additional restriction that the entire dataset name must
@@ -659,6 +656,10 @@ be_validate_name(libbe_handle_t *lbh, const char *name
 */
if (strlen(lbh->root) + 1 + strlen(name) > MAXNAMELEN)
return (BE_ERR_PATHLEN);
+
+   if (!zfs_name_valid(name, ZFS_TYPE_DATASET))
+   return (BE_ERR_INVALIDNAME);
+
return (BE_ERR_SUCCESS);
 }
 


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


svn commit: r346481 - stable/11/sbin/init

2019-09-03 Thread Kyle Evans
Author: kevans
Date: Sun Apr 21 04:18:57 2019
New Revision: 346481
URL: https://svnweb.freebsd.org/changeset/base/346481

Log:
  MFC r337534-r337535
  
  r337534:
  Refactor common code into execute_script().
  
  r337535:
  Use NULLs instead of casted zeroes, for consistency.

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

Modified: stable/11/sbin/init/init.c
==
--- stable/11/sbin/init/init.c  Sun Apr 21 04:15:57 2019(r346480)
+++ stable/11/sbin/init/init.c  Sun Apr 21 04:18:57 2019(r346481)
@@ -144,6 +144,7 @@ static void transition(state_t);
 static state_t requested_transition;
 static state_t current_state = death_single;
 
+static void execute_script(char *argv[]);
 static void open_console(void);
 static const char *get_shell(void);
 static void replace_init(char *path);
@@ -314,12 +315,12 @@ invalid:
delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS,
SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP,
SIGALRM, SIGUSR1, SIGUSR2, 0);
-   sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0);
+   sigprocmask(SIG_SETMASK, &mask, NULL);
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_handler = SIG_IGN;
-   sigaction(SIGTTIN, &sa, (struct sigaction *)0);
-   sigaction(SIGTTOU, &sa, (struct sigaction *)0);
+   sigaction(SIGTTIN, &sa, NULL);
+   sigaction(SIGTTOU, &sa, NULL);
 
/*
 * Paranoia.
@@ -438,7 +439,7 @@ handle(sig_t handler, ...)
sa.sa_mask = mask_everything;
/* XXX SA_RESTART? */
sa.sa_flags = sig == SIGCHLD ? SA_NOCLDSTOP : 0;
-   sigaction(sig, &sa, (struct sigaction *) 0);
+   sigaction(sig, &sa, NULL);
}
va_end(ap);
 }
@@ -961,7 +962,7 @@ single_user(void)
 * and those are reset to SIG_DFL on exec.
 */
sigemptyset(&mask);
-   sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0);
+   sigprocmask(SIG_SETMASK, &mask, NULL);
 
/*
 * Fire off a shell.
@@ -1050,6 +1051,46 @@ runcom(void)
return (state_func_t) read_ttys;
 }
 
+static void
+execute_script(char *argv[])
+{
+   struct sigaction sa;
+   const char *shell, *script;
+   int error;
+
+   bzero(&sa, sizeof(sa));
+   sigemptyset(&sa.sa_mask);
+   sa.sa_handler = SIG_IGN;
+   sigaction(SIGTSTP, &sa, NULL);
+   sigaction(SIGHUP, &sa, NULL);
+
+   open_console();
+
+   sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL);
+#ifdef LOGIN_CAP
+   setprocresources(RESOURCE_RC);
+#endif
+
+   /*
+* Try to directly execute the script first.  If it
+* fails, try the old method of passing the script path
+* to sh(1).  Don't complain if it fails because of
+* the missing execute bit.
+*/
+   script = argv[1];
+   error = access(script, X_OK);
+   if (error == 0) {
+   execv(script, argv + 1);
+   warning("can't exec %s: %m", script);
+   } else if (errno != EACCES) {
+   warning("can't access %s: %m", script);
+   }
+
+   shell = get_shell();
+   execv(shell, argv);
+   stall("can't exec %s for %s: %m", shell, script);
+}
+
 /*
  * Execute binary, replacing init(8) as PID 1.
  */
@@ -1077,22 +1118,14 @@ static state_func_t
 run_script(const char *script)
 {
pid_t pid, wpid;
-   int error, status;
+   int status;
char *argv[4];
const char *shell;
-   struct sigaction sa;
 
shell = get_shell();
 
if ((pid = fork()) == 0) {
-   sigemptyset(&sa.sa_mask);
-   sa.sa_flags = 0;
-   sa.sa_handler = SIG_IGN;
-   sigaction(SIGTSTP, &sa, (struct sigaction *)0);
-   sigaction(SIGHUP, &sa, (struct sigaction *)0);
 
-   open_console();
-
char _sh[]  = "sh";
char _autoboot[]= "autoboot";
 
@@ -1101,28 +1134,8 @@ run_script(const char *script)
argv[2] = runcom_mode == AUTOBOOT ? _autoboot : 0;
argv[3] = NULL;
 
-   sigprocmask(SIG_SETMASK, &sa.sa_mask, (sigset_t *) 0);
-
-#ifdef LOGIN_CAP
-   setprocresources(RESOURCE_RC);
-#endif
-
-   /*
-* Try to directly execute the script first.  If it
-* fails, try the old method of passing the script path
-* to sh(1).  Don't complain if it fails because of
-* the missing execute bit.
-*/
-   error = access(script, X_OK);
-   if (error == 0) {
-   execv(script, argv + 1);
-   warning("can't exec %s: %m", script);
-   } else if (errno != EACCES) {
-

Re: svn commit: r346322 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Mariusz Zaborski
On Wed, Apr 17, 2019 at 04:58:38PM +, Adrian Chadd wrote:
> Author: adrian
> Date: Wed Apr 17 16:58:38 2019
> New Revision: 346322
> URL: https://svnweb.freebsd.org/changeset/base/346322
> 
> Log:
>   [casper] fix compilation when casper is disabled.
>   
>   This triggers an error in gcc-mips 6.4.0 complaining about unused arguments.
>   
>   Tested:
>   
>   * compiled/run on mips32; nothing complained.
> 
> Modified:
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
> 
> Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
> ==
> --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h   Wed Apr 17 
> 16:45:42 2019(r346321)
> +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h   Wed Apr 17 
> 16:58:38 2019(r346322)
> @@ -108,8 +108,12 @@ fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t
>   lstat(name, sb)
>  #define  fileargs_open(fa, name) 
> \
>   open(name, fa->fa_flags, fa->fa_mode)
> -#define  fileargs_fopen(fa, name, mode)  
> \
> - fopen(name, mode)
> +static inline
> +FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode)
> +{
> + (void) fa;
__unused is not good enough?
> + return (fopen(name, mode));
> +}
>  #define  fileargs_free(fa)   (free(fa))
>  #endif
>  
> 

-- 
Mariusz Zaborski
oshogbo//vx | http://oshogbo.vexillium.org
FreeBSD committer   | https://freebsd.org
Software developer  | http://wheelsystems.com
If it's not broken, let's fix it till it is!!1


signature.asc
Description: PGP signature


svn commit: r346455 - head/sys/dev/atkbdc

2019-09-03 Thread Vladimir Kondratyev
Author: wulf
Date: Sat Apr 20 21:00:44 2019
New Revision: 346455
URL: https://svnweb.freebsd.org/changeset/base/346455

Log:
  psm(4): Add support for 4 and 5 finger touches in synaptics driver
  
  While 4-th and 5-th finger positions are not exported through PS/2
  interface, total number of touches is reported by MT trackpads.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Sat Apr 20 20:29:03 2019(r346454)
+++ head/sys/dev/atkbdc/psm.c   Sat Apr 20 21:00:44 2019(r346455)
@@ -1830,7 +1830,7 @@ psm_register_synaptics(device_t dev)
if (sc->synhw.capClickPad && sc->synhw.topButtonPad)
evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD);
evdev_support_key(evdev_a, BTN_TOUCH);
-   evdev_support_nfingers(evdev_a, 3);
+   evdev_support_nfingers(evdev_a, sc->synhw.capReportsV ? 5 : 3);
psm_support_abs_bulk(evdev_a, synaptics_absinfo_st);
if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV)
psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt);
@@ -3212,6 +3212,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
 {
static int touchpad_buttons;
static int guest_buttons;
+   static int ew_finger_count;
static finger_t f[PSM_FINGERS];
int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed;
 
@@ -3372,6 +3373,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
(pb->ipacket[1] & 0x01)) + 8,
.flags = PSM_FINGER_FUZZY,
};
+   break;
+   case 2:
+   ew_finger_count = pb->ipacket[1] & 0x0f;
default:
break;
}
@@ -3379,6 +3383,11 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
goto SYNAPTICS_END;
 
case 1:
+   if (sc->synhw.capReportsV && ew_finger_count > 3) {
+   nfingers = ew_finger_count;
+   break;
+   }
+   /* FALLTHROUGH */
case 0:
nfingers = w + 2;
break;


___
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: r346308 - in stable/12/release: . tools

2019-09-03 Thread Colin Percival
Author: cperciva
Date: Wed Apr 17 07:47:03 2019
New Revision: 346308
URL: https://svnweb.freebsd.org/changeset/base/346308

Log:
  MFC r345316, r345317, r345858:
  
  r345316: Register ARM64 EC2 AMIs as being for the ARM64 architecture.
  
  r345317: Don't install amazon-ssm-agent package into ARM64 AMIs.
  
  r345858: Add support for cross-building cloudware images.
  
  With these changes it is possible to build ARM64 EC2 AMIs on stable/12 --
  said images do not *work* yet, however.

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

Modified: stable/12/release/Makefile.ec2
==
--- stable/12/release/Makefile.ec2  Wed Apr 17 03:29:16 2019
(r346307)
+++ stable/12/release/Makefile.ec2  Wed Apr 17 07:47:03 2019
(r346308)
@@ -42,6 +42,9 @@ PUBLICSNAP=   --publicsnap
 EC2SNSREL= ${REVISION}-${BRANCH}
 EC2SNSVERS=${EC2_SVNBRANCH}@${EC2_SVNREV}
 .endif
+.if ${TARGET_ARCH} != "amd64"
+EC2ARCH=   --${TARGET_ARCH:S/aarch64/arm64/}
+.endif
 
 CLEANFILES+=   ec2ami
 
@@ -82,7 +85,8 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
@echo "--"
@false
 .endif
-   /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} --sriov 
--ena \
+   /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
+   ${EC2ARCH} --sriov --ena \
${.OBJDIR}/ec2.raw \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
"${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \

Modified: stable/12/release/Makefile.vm
==
--- stable/12/release/Makefile.vm   Wed Apr 17 03:29:16 2019
(r346307)
+++ stable/12/release/Makefile.vm   Wed Apr 17 07:47:03 2019
(r346308)
@@ -39,6 +39,24 @@ VAGRANT-VMWARE_FORMAT=   vmdk
 VAGRANT-VMWARE_DESC=   Vagrant Image for VMWare
 VAGRANT-VMWARE_DISK=   ${OSRELEASE}.vmware.${VAGRANT_FORMAT}
 
+emulator-portinstall:
+.if ${TARGET_ARCH} != ${MACHINE_ARCH}
+.if ( ${TARGET_ARCH} != "i386" ) || ( ${MACHINE_ARCH} != "amd64" )
+.if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static)
+.if exists(${PORTSDIR}/emulators/qemu-user-static/Makefile)
+   env - PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static 
BATCH=1 all install clean
+.else
+.if !exists(/usr/local/sbin/pkg-static)
+   env ASSUME_ALWAYS_YES=yes pkg bootstrap -y
+.endif
+   env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-user-static
+.endif
+.endif
+
+QEMUSTATIC=/usr/local/bin/qemu-${TARGET_ARCH}-static
+.endif
+.endif
+
 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
 . for _CW in ${CLOUDWARE}
 CLOUDTARGETS+= cw-${_CW:tl}
@@ -53,9 +71,10 @@ ${_CW:tu}IMAGE=  ${_CW:tl}.${${_CW:tu}_FORMAT}
 ${_CW:tu}CONF?=${.CURDIR}/tools/${_CW:tl}.conf
 .  endif
 
-cw-${_CW:tl}:
+cw-${_CW:tl}: emulator-portinstall
mkdir -p ${.OBJDIR}/${.TARGET}
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
+   QEMUSTATIC=${QEMUSTATIC} \
${.CURDIR}/scripts/mk-vmimage.sh \
-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
-i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW:tu}_FORMAT} 
\

Modified: stable/12/release/tools/ec2.conf
==
--- stable/12/release/tools/ec2.confWed Apr 17 03:29:16 2019
(r346307)
+++ stable/12/release/tools/ec2.confWed Apr 17 07:47:03 2019
(r346308)
@@ -6,8 +6,16 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient amazon-ssm-agent"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient"
 
+# Include the amazon-ssm-agent package in amd64 images, since some users want
+# to be able to use it on systems which are not connected to the Internet.
+# (It is not enabled by default, however.)  This package does not exist for
+# aarch64, so we have to be selective about when we install it.
+if [ "${TARGET_ARCH}" = "amd64" ]; then
+   export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} amazon-ssm-agent"
+fi
+
 # Set to a list of third-party software to enable in rc.conf(5).
 export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey 
firstboot_freebsd_update firstboot_pkgs ntpd"
 
@@ -32,7 +40,7 @@ vm_extra_pre_umount() {
# catalogue and install or update pkg when the instance first
# launches, so these files wo

svn commit: r346322 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Adrian Chadd
Author: adrian
Date: Wed Apr 17 16:58:38 2019
New Revision: 346322
URL: https://svnweb.freebsd.org/changeset/base/346322

Log:
  [casper] fix compilation when casper is disabled.
  
  This triggers an error in gcc-mips 6.4.0 complaining about unused arguments.
  
  Tested:
  
  * compiled/run on mips32; nothing complained.

Modified:
  head/lib/libcasper/services/cap_fileargs/cap_fileargs.h

Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
==
--- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 
16:45:42 2019(r346321)
+++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 
16:58:38 2019(r346322)
@@ -108,8 +108,12 @@ fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t
lstat(name, sb)
 #definefileargs_open(fa, name) 
\
open(name, fa->fa_flags, fa->fa_mode)
-#definefileargs_fopen(fa, name, mode)  
\
-   fopen(name, mode)
+static inline
+FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode)
+{
+   (void) fa;
+   return (fopen(name, mode));
+}
 #definefileargs_free(fa)   (free(fa))
 #endif
 


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


svn commit: r346263 - head/contrib/tcpdump

2019-09-03 Thread Mariusz Zaborski
Author: oshogbo
Date: Tue Apr 16 04:12:41 2019
New Revision: 346263
URL: https://svnweb.freebsd.org/changeset/base/346263

Log:
  tcpdump: disable Capsicum if -E option is provided.
  
  The -E is used to provide a secret for decrypting IPsec.
  The secret may be provided through command line or as the file.
  The problem is that tcpdump doesn't support yet opening files in capability 
mode
  and the file may contain a list of the files to open.
  
  As a workaround, for now, let's just disable capsicum if the -E
  the option is provided.
  
  PR:   236819
  MFC after:2 weeks

Modified:
  head/contrib/tcpdump/tcpdump.c

Modified: head/contrib/tcpdump/tcpdump.c
==
--- head/contrib/tcpdump/tcpdump.c  Tue Apr 16 02:48:04 2019
(r346262)
+++ head/contrib/tcpdump/tcpdump.c  Tue Apr 16 04:12:41 2019
(r346263)
@@ -2063,7 +2063,8 @@ main(int argc, char **argv)
}
 
 #ifdef HAVE_CAPSICUM
-   cansandbox = (VFileName == NULL && zflag == NULL);
+   cansandbox = (VFileName == NULL && zflag == NULL &&
+   ndo->ndo_espsecret == NULL);
 #ifdef HAVE_CASPER
cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL));
 #else


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


svn commit: r346398 - in head: sys/netinet6 usr.bin/netstat usr.bin/systat

2019-09-03 Thread Tom Jones
Author: thj
Date: Fri Apr 19 17:06:43 2019
New Revision: 346398
URL: https://svnweb.freebsd.org/changeset/base/346398

Log:
  Add stat counter for ipv6 atomic fragments
  
  Add a stat counter to track ipv6 atomic fragments. Atomic fragments can be
  generated in response to invalid path MTU values, but are also a potential
  attack vector and considered harmful (see RFC6946 and RFC8021).
  
  While here add tracking of the atomic fragment counter to netstat and systat.
  
  Reviewed by:tuexen, jtl, bz
  Approved by:jtl (mentor), bz (mentor)
  Event:  Aberdeen hackathon 2019
  Differential Revision:  https://reviews.freebsd.org/D17511

Modified:
  head/sys/netinet6/frag6.c
  head/sys/netinet6/ip6_var.h
  head/usr.bin/netstat/inet6.c
  head/usr.bin/systat/ip6.c

Modified: head/sys/netinet6/frag6.c
==
--- head/sys/netinet6/frag6.c   Fri Apr 19 15:54:32 2019(r346397)
+++ head/sys/netinet6/frag6.c   Fri Apr 19 17:06:43 2019(r346398)
@@ -277,12 +277,12 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
offset += sizeof(struct ip6_frag);
 
/*
-* RFC 6946: Handle "atomic" fragments (offset and m bit set to 0)
-* upfront, unrelated to any reassembly.  Just skip the fragment header.
+* Handle "atomic" fragments (offset and m bit set to 0) upfront,
+* unrelated to any reassembly (see RFC 6946 and section 4.5 of RFC
+* 8200).  Just skip the fragment header.
 */
if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) {
-   /* XXX-BZ we want dedicated counters for this. */
-   IP6STAT_INC(ip6s_reassembled);
+   IP6STAT_INC(ip6s_atomicfrags);
in6_ifstat_inc(dstifp, ifs6_reass_ok);
*offp = offset;
m->m_flags |= M_FRAGMENTED;

Modified: head/sys/netinet6/ip6_var.h
==
--- head/sys/netinet6/ip6_var.h Fri Apr 19 15:54:32 2019(r346397)
+++ head/sys/netinet6/ip6_var.h Fri Apr 19 17:06:43 2019(r346398)
@@ -208,6 +208,7 @@ struct  ip6stat {
uint64_t ip6s_localout; /* total ip packets generated here */
uint64_t ip6s_odropped; /* lost packets due to nobufs, etc. */
uint64_t ip6s_reassembled;  /* total packets reassembled ok */
+   uint64_t ip6s_atomicfrags;  /* atomic fragments */
uint64_t ip6s_fragmented;   /* datagrams successfully fragmented */
uint64_t ip6s_ofragments;   /* output fragments created */
uint64_t ip6s_cantfrag; /* don't fragment flag was set, etc. */

Modified: head/usr.bin/netstat/inet6.c
==
--- head/usr.bin/netstat/inet6.cFri Apr 19 15:54:32 2019
(r346397)
+++ head/usr.bin/netstat/inet6.cFri Apr 19 17:06:43 2019
(r346398)
@@ -391,6 +391,8 @@ ip6_stats(u_long off, const char *name, int af1 __unus
"{N:/fragment%s dropped after timeout}\n");
p(ip6s_fragoverflow, "\t{:dropped-fragments-overflow/%ju} "
"{N:/fragment%s that exceeded limit}\n");
+   p(ip6s_atomicfrags, "\t{:atomic-fragments/%ju} "
+   "{N:/atomic fragment%s}\n");
p(ip6s_reassembled, "\t{:reassembled-packets/%ju} "
"{N:/packet%s reassembled ok}\n");
p(ip6s_delivered, "\t{:received-local-packets/%ju} "

Modified: head/usr.bin/systat/ip6.c
==
--- head/usr.bin/systat/ip6.c   Fri Apr 19 15:54:32 2019(r346397)
+++ head/usr.bin/systat/ip6.c   Fri Apr 19 17:06:43 2019(r346398)
@@ -121,16 +121,16 @@ labelip6(void)
L(6, "- fragments dropped");R(6, "destinations unreachable");
L(7, "- fragments timed out");  R(7, "packets output via raw IP");
L(8, "- fragments overflown");
-   L(9, "- packets reassembled ok"); R(9, "Input next-header histogram");
-   L(10, "packets forwarded"); R(10, " - destination options");
-   L(11, "- unreachable dests");   R(11, " - hop-by-hop options");
-   L(12, "- redirects generated"); R(12, " - IPv4");
-   L(13, "option errors"); R(13, " - TCP");
-   L(14, "unwanted multicasts");   R(14, " - UDP");
-   L(15, "delivered to upper layer"); R(15, " - IPv6");
-   L(16, "bad scope packets"); R(16, " - routing header");
-   L(17, "address selection failed"); R(17, " - fragmentation header");
-   R(18, " - ICMP6");
+   L(9, "- atomic fragments"); R(9, "Input next-header histogram");
+   L(10, "- packets reassembled ok"); R(10, " - destination options");
+   L(11, "packets forwarded"); R(11, " - hop-by-hop options");
+   L(12, "- unreachable dests");   R(12, " - IPv4");
+   L(13, "- redirects generate

svn commit: r346389 - stable/11/sys/netinet

2019-09-03 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Apr 19 15:34:21 2019
New Revision: 346389
URL: https://svnweb.freebsd.org/changeset/base/346389

Log:
  MFC r340494:
  
Improve the comment for arpresolve_full() in if_ether.c.
No functional changes.

Modified:
  stable/11/sys/netinet/if_ether.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/if_ether.c
==
--- stable/11/sys/netinet/if_ether.cFri Apr 19 15:33:54 2019
(r346388)
+++ stable/11/sys/netinet/if_ether.cFri Apr 19 15:34:21 2019
(r346389)
@@ -431,10 +431,10 @@ arprequest(struct ifnet *ifp, const struct in_addr *si
 /*
  * Resolve an IP address into an ethernet address - heavy version.
  * Used internally by arpresolve().
- * We have already checked than  we can't use existing lle without
- * modification so we have to acquire LLE_EXCLUSIVE lle lock.
+ * We have already checked that we can't use an existing lle without
+ * modification so we have to acquire an LLE_EXCLUSIVE lle lock.
  *
- * On success, desten and flags are filled in and the function returns 0;
+ * On success, desten and pflags are filled in and the function returns 0;
  * If the packet must be held pending resolution, we return EWOULDBLOCK
  * On other errors, we return the corresponding error code.
  * Note that m_freem() handles NULL.


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


svn commit: r346313 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Ed Maste
Author: emaste
Date: Wed Apr 17 15:48:33 2019
New Revision: 346313
URL: https://svnweb.freebsd.org/changeset/base/346313

Log:
  cap_fileargs.3: correct 'filerags' typo
  
  Submitted by: Bora Özarslan" 
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

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

Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3
==
--- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 
15:27:11 2019(r346312)
+++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 
15:48:33 2019(r346313)
@@ -120,7 +120,7 @@ For details see
 The
 .Fa fileargs_free
 close connection to the
-.Nm system.filerags
+.Nm system.fileargs
 service and free are structures.
 The function handle
 .Dv NULL
@@ -139,7 +139,7 @@ expect that all arguments are fetched from the
 structure.
 .Sh LIMITS
 This section describe which values and types should be used to pass arguments 
to the
-.Fa system.filerags
+.Fa system.fileargs
 through the
 .Fn fileargs_ininv
 and
@@ -181,7 +181,7 @@ Any number of
 where the name of the element is name of the file which can be opened.
 .Sh EXAMPLES
 The following example first parse some options and then create the
-.Nm system.filerags
+.Nm system.fileargs
 service with remaining arguments.
 .Bd -literal
 int ch, fd, i;


___
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: r346341 - head/tools/build

2019-09-03 Thread Warner Losh
On Thu, Apr 18, 2019 at 12:03 PM Ed Maste  wrote:

> On Thu, 18 Apr 2019 at 10:03, Kyle Evans  wrote:
> >
> > Keep in mind that this is bootstrap; it's being built for the host
> > system, but it will link against a version of libcasper that's been
> > built in an earlier stage with the proper featureset.
>
> Not exactly the case here: if building on a system with too-old Casper
> then strings just builds without Capsicum/Casper support. Macros /
> static inline stub implementations in the header takes care of this,
> it does not actually link against any libcasper.
>

Yea, we need to do one or the other.

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


svn commit: r346424 - in head/sys/fs: nfs nfsserver

2019-09-03 Thread Rick Macklem
Author: rmacklem
Date: Fri Apr 19 23:35:08 2019
New Revision: 346424
URL: https://svnweb.freebsd.org/changeset/base/346424

Log:
  Add support for the ModeSetMasked attribute to the NFSv4.1 server.
  
  I do not know of an extant NFSv4.1 client that currently does a Setattr
  operation for the ModeSetMasked, but it has been discussed on the linux-nfs
  mailing list.
  This patch adds support for doing a Setattr of ModeSetMasked, so that it
  will work for any future NFSv4.1 client that chooses to do so.
  Tested via a hacked FreeBSD NFSv4.1 client.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfsproto.h
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: head/sys/fs/nfs/nfsproto.h
==
--- head/sys/fs/nfs/nfsproto.h  Fri Apr 19 23:27:23 2019(r346423)
+++ head/sys/fs/nfs/nfsproto.h  Fri Apr 19 23:35:08 2019(r346424)
@@ -1090,7 +1090,7 @@ struct nfsv3_sattr {
  */
 #defineNFSATTRBIT_SUPPSETONLY1  (NFSATTRBM_TIMEACCESSSET | 
\
 NFSATTRBM_TIMEMODIFYSET)
-#defineNFSATTRBIT_SUPPSETONLY2 0
+#defineNFSATTRBIT_SUPPSETONLY2 (NFSATTRBM_MODESETMASKED)
 
 /*
  * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31
@@ -1106,7 +1106,8 @@ struct nfsv3_sattr {
NFSATTRBM_OWNERGROUP |  \
NFSATTRBM_TIMEACCESSSET |   \
NFSATTRBM_TIMEMODIFYSET)
-#defineNFSATTRBIT_SETABLE2 0
+#defineNFSATTRBIT_SETABLE2 
\
+   (NFSATTRBM_MODESETMASKED)
 
 /*
  * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1.

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cFri Apr 19 23:27:23 2019
(r346423)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cFri Apr 19 23:35:08 2019
(r346424)
@@ -2699,10 +2699,12 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
int attrsum = 0;
int i, j;
int error, attrsize, bitpos, aclsize, aceerr, retnotsup = 0;
-   int toclient = 0;
+   int moderet, toclient = 0;
u_char *cp, namestr[NFSV4_SMALLSTR + 1];
uid_t uid;
gid_t gid;
+   u_short mode, mask; /* Same type as va_mode. */
+   struct vattr va;
 
error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup);
if (error)
@@ -2720,6 +2722,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
} else {
bitpos = 0;
}
+   moderet = 0;
for (; bitpos < NFSATTRBIT_MAX; bitpos++) {
if (attrsum > attrsize) {
error = NFSERR_BADXDR;
@@ -2769,6 +2772,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(i));
break;
case NFSATTRBIT_MODE:
+   moderet = NFSERR_INVAL; /* Can't do MODESETMASKED. */
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
nvap->na_mode = nfstov_mode(*tl);
attrsum += NFSX_UNSIGNED;
@@ -2871,6 +2875,32 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
if (!toclient)
nvap->na_vaflags |= VA_UTIMES_NULL;
}
+   break;
+   case NFSATTRBIT_MODESETMASKED:
+   NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED);
+   mode = fxdr_unsigned(u_short, *tl++);
+   mask = fxdr_unsigned(u_short, *tl);
+   /*
+* vp == NULL implies an Open/Create operation.
+* This attribute can only be used for Setattr and
+* only for NFSv4.1 or higher.
+* If moderet != 0, a mode attribute has also been
+* specified and this attribute cannot be done in the
+* same Setattr operation.
+*/
+   if ((nd->nd_flag & ND_NFSV41) == 0)
+   nd->nd_repstat = NFSERR_ATTRNOTSUPP;
+   else if ((mode & ~0) != 0 || (mask & ~0) != 0 ||
+   vp == NULL)
+   nd->nd_repstat = NFSERR_INVAL;
+   else if (moderet == 0)
+   moderet = VOP_GETATTR(vp, &va, nd->nd_cred);
+   if (moderet == 0)
+   nvap->na_mode = (mode & mask) |
+   (va.va_mode & ~mask);
+   else
+   nd->nd_repstat = moderet;
+ 

Re: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124

2019-09-03 Thread Andrew Turner


> On 17 Apr 2019, at 17:52, Ian Lepore  wrote:
> 
> On Wed, 2019-04-17 at 11:23 +0200, Andrew Turner wrote:
>>> On 16 Apr 2019, at 22:04, Emmanuel Vadot  wrote:
>>> 
>>> Author: manu
>>> Date: Tue Apr 16 20:04:22 2019
>>> New Revision: 346295
>>> URL: https://svnweb.freebsd.org/changeset/base/346295
>>> 
>>> Log:
>>> arm: Add kern_clocksource.c directly in files.arm
>>> 
>>> This files is needed and included in all our config so move it to
>>> a common
>>> location.
>>> 
>>> MFC after:  2 weeks
>> 
>> ...
>>> Modified: head/sys/conf/files.arm
>>> ===
>>> ===
>>> --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019(r346294)
>>> +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019(r346295)
>>> @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.ooptionalcom
>>> pat_cloudabi32  \
>>> no-implicit-rule\
>>> clean   "cloudabi32_vdso_blob.o"
>>> #
>>> +
>>> +kern/kern_clocksource.cstandard
>> 
>> Could this be moved from the various files.* to files? It seems we
>> define it as standard on all architectures.
>> 
>> 
> 
> I thought mips still had some variants that didn't implement event
> timers.  That's why this stuff was ever in arch-specific files, arm and
> mips had some flavors without ET support.

I think it used to be the case on arm. A grep seems to think it’s enabled on 
all architectures now:

grep kern_clocksource files.*
files.amd64:kern/kern_clocksource.c standard
files.arm:kern/kern_clocksource.c   standard
files.arm64:kern/kern_clocksource.c standard
files.i386:kern/kern_clocksource.c  standard
files.mips:kern/kern_clocksource.c  standard
files.powerpc:kern/kern_clocksource.c   standard
files.riscv:kern/kern_clocksource.c standard
files.sparc64:kern/kern_clocksource.c   standard

Andrew

___
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: r346505 - stable/12/sys/arm/freescale/imx

2019-09-03 Thread Ian Lepore
Author: ian
Date: Sun Apr 21 22:31:52 2019
New Revision: 346505
URL: https://svnweb.freebsd.org/changeset/base/346505

Log:
  MFC r344267:
  
  Add a compatible string to match recent changes in the upstream dts.

Modified:
  stable/12/sys/arm/freescale/imx/imx6_snvs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/freescale/imx/imx6_snvs.c
==
--- stable/12/sys/arm/freescale/imx/imx6_snvs.c Sun Apr 21 22:28:50 2019
(r346504)
+++ stable/12/sys/arm/freescale/imx/imx6_snvs.c Sun Apr 21 22:31:52 2019
(r346505)
@@ -73,6 +73,7 @@ struct snvs_softc {
 };
 
 static struct ofw_compat_data compat_data[] = {
+   {"fsl,sec-v4.0-mon-rtc-lp", true},
{"fsl,sec-v4.0-mon", true},
{NULL,   false}
 };


___
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: r346263 - head/contrib/tcpdump

2019-09-03 Thread Conrad Meyer
On Tue, Apr 16, 2019 at 6:20 AM Shawn Webb  wrote:
> Is there any documentation anywhere telling users that Capsicum
> support will be disabled under certain circumstances?

Hi Shawn,

I don't think documenting that makes much sense in general.  It would
be extremely burdensome to fully document and quickly become
desynchronized from the code.  It's comparable to OpenBSD pledging
differently in different paths of programs.

To me, "for now," suggests that this is perhaps a temporary workaround
and maybe we can do something better in the future.

Take care,
Conrad

P.S., When do you plan to update your Easy Feature Comparison page to
reflect that FreeBSD has the same procfs and "boot hardening" as HBSD?


___
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: r346319 - head/sys/netpfil/pf

2019-09-03 Thread Kristof Provost
Author: kp
Date: Wed Apr 17 16:42:54 2019
New Revision: 346319
URL: https://svnweb.freebsd.org/changeset/base/346319

Log:
  pf: Fix panic on invalid DIOCRSETTFLAGS
  
  If during DIOCRSETTFLAGS pfrio_buffer is NULL copyin() will fault, which we're
  not allowed to do with a lock held.
  We must count the number of entries in the table and release the lock during
  copyin(). Only then can we re-acquire the lock. Note that this is safe, 
because
  pfr_set_tflags() will check if the table and entries exist.
  
  This was discovered by a local syzcaller instance.
  
  MFC after:1 week
  Event:Aberdeen hackathon 2019

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

Modified: head/sys/netpfil/pf/pf_ioctl.c
==
--- head/sys/netpfil/pf/pf_ioctl.c  Wed Apr 17 16:31:30 2019
(r346318)
+++ head/sys/netpfil/pf/pf_ioctl.c  Wed Apr 17 16:42:54 2019
(r346319)
@@ -3103,24 +3103,24 @@ DIOCCHANGEADDR_error:
break;
}
 
-   PF_RULES_WLOCK();
+   PF_RULES_RLOCK();
n = pfr_table_count(&io->pfrio_table, io->pfrio_flags);
io->pfrio_size = min(io->pfrio_size, n);
+   PF_RULES_RUNLOCK();
 
totlen = io->pfrio_size * sizeof(struct pfr_table);
pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table),
M_TEMP, M_NOWAIT);
if (pfrts == NULL) {
error = ENOMEM;
-   PF_RULES_WUNLOCK();
break;
}
error = copyin(io->pfrio_buffer, pfrts, totlen);
if (error) {
free(pfrts, M_TEMP);
-   PF_RULES_WUNLOCK();
break;
}
+   PF_RULES_WLOCK();
error = pfr_set_tflags(pfrts, io->pfrio_size,
io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange,
&io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL);


___
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: r346459 - in head/contrib/sqlite3: . tea

2019-09-03 Thread Cy Schubert
Author: cy
Date: Sat Apr 20 23:18:19 2019
New Revision: 346459
URL: https://svnweb.freebsd.org/changeset/base/346459

Log:
  MFV r346450:
  
  Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200)
  
  MFC after:11 days

Modified:
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/configure
==
--- head/contrib/sqlite3/configure  Sat Apr 20 21:06:12 2019
(r346458)
+++ head/contrib/sqlite3/configure  Sat Apr 20 23:18:19 2019
(r346459)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.27.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.27.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.27.1'
-PACKAGE_STRING='sqlite 3.27.1'
+PACKAGE_VERSION='3.27.2'
+PACKAGE_STRING='sqlite 3.27.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.27.1:";;
+ short | recursive ) echo "Configuration of sqlite 3.27.2:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.27.1
+sqlite configure 3.27.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.27.1, which was
+It was created by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.27.1'
+ VERSION='3.27.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.27.1, which was
+This file was extended by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.27.1
+sqlite config.status 3.27.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/configure.ac
==
--- head/contrib/sqlite3/configure.ac   Sat Apr 20 21:06:12 2019
(r346458)
+++ head/contrib/sqlite3/configure.ac   Sat Apr 20 23:18:19 2019
(r346459)
@@ -10,7 +10,7 @@
 #
 
 AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.27.1, http://www.sqlite.org)
+AC_INIT(sqlite, 3.27.2, http://www.sqlite.org)
 AC_CONFIG_SRCDIR([sqlite3.c])
 AC_CONFIG_AUX_DIR([.])
 

Modified: head/contrib/sqlite3/sqlite3.c
==
--- head/contrib/sqlite3/sqlite3.c  Sat Apr 20 21:06:12 2019
(r346458)
+++ head/contrib/sqlite3/sqlite3.c  Sat Apr 20 23:18:19 2019
(r346459)
@@ -1,6 +1,6 @@
 /**
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.27.1.  By combining all the individual C code files into this
+** version 3.27.2.  By combining all the individual C code files into this
 ** single large file, the entire code can be compiled as a single translation
 ** unit.  This allows many compilers to do optimizations that would not be
 ** possible if the files were compiled separately.  Performance improvements
@@ -1162,9 +1162,9 @@ extern "C" {
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite_version()] and [sqlite_source_id()].
 */
-#define SQLITE_VERSION"3

Re: svn commit: r346319 - head/sys/netpfil/pf

2019-09-03 Thread Gleb Smirnoff
  Kristof,

On Wed, Apr 17, 2019 at 04:42:54PM +, Kristof Provost wrote:
K> Modified: head/sys/netpfil/pf/pf_ioctl.c
K> 
==
K> --- head/sys/netpfil/pf/pf_ioctl.c   Wed Apr 17 16:31:30 2019
(r346318)
K> +++ head/sys/netpfil/pf/pf_ioctl.c   Wed Apr 17 16:42:54 2019
(r346319)
K> @@ -3103,24 +3103,24 @@ DIOCCHANGEADDR_error:
K>  break;
K>  }
K>  
K> -PF_RULES_WLOCK();
K> +PF_RULES_RLOCK();
K>  n = pfr_table_count(&io->pfrio_table, io->pfrio_flags);
K>  io->pfrio_size = min(io->pfrio_size, n);
K> +PF_RULES_RUNLOCK();
K>  
K>  totlen = io->pfrio_size * sizeof(struct pfr_table);
K>  pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table),
K>  M_TEMP, M_NOWAIT);
K>  if (pfrts == NULL) {
K>  error = ENOMEM;
K> -PF_RULES_WUNLOCK();
K>  break;
K>  }
K>  error = copyin(io->pfrio_buffer, pfrts, totlen);
K>  if (error) {
K>  free(pfrts, M_TEMP);
K> -PF_RULES_WUNLOCK();
K>  break;
K>  }
K> +PF_RULES_WLOCK();
K>  error = pfr_set_tflags(pfrts, io->pfrio_size,
K>  io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange,
K>  &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL);

Couple comments:

1) Now we can malloc with M_WAITOK.
2) Are we sure that table count won't change while we dropped the lock?

-- 
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: r346457 - in head: share/man/man4 sys/dev/atkbdc

2019-09-03 Thread Vladimir Kondratyev
Author: wulf
Date: Sat Apr 20 21:04:56 2019
New Revision: 346457
URL: https://svnweb.freebsd.org/changeset/base/346457

Log:
  psm(4): respect tap_disabled configuration with enabled Extended support
  
  This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps
  were processed.
  tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1).
  To respect PR kern/139272, taps are ignored only when explicity disabled.
  
  Submitted by: Ben LeMasurier  (initial version)
  MFC after:2 weeks

Modified:
  head/share/man/man4/psm.4
  head/sys/dev/atkbdc/psm.c

Modified: head/share/man/man4/psm.4
==
--- head/share/man/man4/psm.4   Sat Apr 20 21:02:41 2019(r346456)
+++ head/share/man/man4/psm.4   Sat Apr 20 21:04:56 2019(r346457)
@@ -354,8 +354,8 @@ Tap and drag gestures can be disabled by setting
 to
 .Em 0
 at boot-time.
-Currently, this is only supported on Synaptics touchpads with Extended
-support disabled.
+Currently, this is supported on Synaptics touchpads regardless of Extended
+support state and on Elantech touchpads with Extended support enabled.
 The behaviour may be changed after boot by setting
 the sysctl with the same name and by restarting
 .Xr moused 8

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Sat Apr 20 21:02:41 2019(r346456)
+++ head/sys/dev/atkbdc/psm.c   Sat Apr 20 21:04:56 2019(r346457)
@@ -3820,9 +3820,15 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i
gest->in_vscroll = 0;
 
/* Compute tap timeout. */
-   gest->taptimeout.tv_sec  = tap_timeout / 100;
-   gest->taptimeout.tv_usec = tap_timeout % 100;
-   timevaladd(&gest->taptimeout, &sc->lastsoftintr);
+   if (tap_enabled != 0) {
+   gest->taptimeout = (struct timeval) {
+   .tv_sec  = tap_timeout / 100,
+   .tv_usec = tap_timeout % 100,
+   };
+   timevaladd(
+   &gest->taptimeout, &sc->lastsoftintr);
+   } else
+   timevalclear(&gest->taptimeout);
 
sc->flags |= PSM_FLAGS_FINGERDOWN;
 


___
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: r346341 - head/tools/build

2019-09-03 Thread Cy Schubert
In message <201904180107.x3i17qdc002...@gndrsh.dnsmgr.net>, "Rodney W. 
Grimes"
writes:
> > Author: cy
> > Date: Thu Apr 18 01:02:00 2019
> > New Revision: 346341
> > URL: https://svnweb.freebsd.org/changeset/base/346341
> > 
> > Log:
> >   As an interim measure until a more permanent solution is implemented
> >   workaround the following error:
> >   
> >   /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of
> >   undeclared identifier
> >   'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
> >   
> >   Reported by:  O. Hartmann 
> >   Reported by:  Michael Butler 
> >   Reported by:  gjb@ & cy@ (implicit)
> >   Reviewed by:  emaste@
> >   Noted by: rgrimes@
> > 
> > Modified:
> >   head/tools/build/Makefile
> > 
> > Modified: head/tools/build/Makefile
> > ===
> ===
> > --- head/tools/build/Makefile   Thu Apr 18 00:38:54 2019(r34634
> 0)
> > +++ head/tools/build/Makefile   Thu Apr 18 01:02:00 2019(r34634
> 1)
> > @@ -59,9 +59,7 @@ INCS+=capsicum_helpers.h
> >  INCS+= libcasper.h
> >  .endif
> >  
> > -.if !exists(/usr/include/casper/cap_fileargs.h)
> >  CASPERINC+=${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea
> rgs.h
> > -.endif
>
> As a further note, we should probably hunt for any thing
> that is explicity looking at /usr/include/... in a Makefile,
> as that is minimally missing a ${DESTDIR} argument.
>
> The above may of actually worked if it had been written:
> .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h)
> someone may wish to test that.
>
> Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake.

This is a better solution. I tested this in a tree with a duplicated 
environment: Problem solved. Before this is committed it should be 
tested on one of the universe machines.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.




___
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: r346394 - stable/12/sys/dev/sdhci

2019-09-03 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Apr 19 15:50:51 2019
New Revision: 346394
URL: https://svnweb.freebsd.org/changeset/base/346394

Log:
  MFC r345370:
  
Align struct sdhci_slot MMCCAM members.
  
Whitespace only, no functional change.

Modified:
  stable/12/sys/dev/sdhci/sdhci.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sdhci/sdhci.h
==
--- stable/12/sys/dev/sdhci/sdhci.h Fri Apr 19 15:48:57 2019
(r346393)
+++ stable/12/sys/dev/sdhci/sdhci.h Fri Apr 19 15:50:51 2019
(r346394)
@@ -413,10 +413,10 @@ struct sdhci_slot {
 #ifdef MMCCAM
/* CAM stuff */
union ccb   *ccb;
-   struct cam_devq *devq;
-   struct cam_sim  *sim;
-   struct mtx  sim_mtx;
-   u_char  card_present; /* XXX Maybe derive this from 
elsewhere? */
+   struct cam_devq *devq;
+   struct cam_sim  *sim;
+   struct mtx  sim_mtx;
+   u_char  card_present;   /* XXX Maybe derive this from 
elsewhere? */
 #endif
 };
 


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


  1   2   3   4   5   6   7   8   9   10   >