Re: svn commit: r365899 - in head: share/man/man9 sys/arm/include sys/arm64/arm64 sys/arm64/include sys/kern sys/mips/include sys/powerpc/include sys/riscv/include sys/sys sys/tools sys/x86/include

2020-09-21 Thread Ravi Pokala
This breaks amd64.GENERIC-KCSAN:


${SRCTOP}/sys/kern/subr_csan.c:895:1: error: implicit declaration of function 
'bus_space_peek_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
CSAN_BUS_PEEK_FUNC(8, uint64_t)
^
${SRCTOP}/sys/kern/subr_csan.c:888:11: note: expanded from macro 
'CSAN_BUS_PEEK_FUNC'
return (bus_space_peek_##width(tag, hnd, offset, value)); \
^
:56:1: note: expanded from here
bus_space_peek_8
^
${SRCTOP}/sys/kern/subr_csan.c:909:1: error: implicit declaration of function 
'bus_space_poke_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
CSAN_BUS_POKE_FUNC(8, uint64_t)
^
${SRCTOP}/sys/kern/subr_csan.c:902:11: note: expanded from macro 
'CSAN_BUS_POKE_FUNC'
return (bus_space_poke_##width(tag, hnd, offset, value)); \
^
:64:1: note: expanded from here
bus_space_poke_8
^
2 errors generated.
--- subr_csan.o ---
*** [subr_csan.o] Error code 1


Thanks,

Ravi (rpokala@)

-Original Message-
From:  on behalf of Michal Meloun 

Date: 2020-09-19, Saturday at 04:06
To: , , 

Subject: svn commit: r365899 - in head: share/man/man9 sys/arm/include 
sys/arm64/arm64 sys/arm64/include sys/kern sys/mips/include sys/powerpc/include 
sys/riscv/include sys/sys sys/tools sys/x86/include

Author: mmel
Date: Sat Sep 19 11:06:41 2020
New Revision: 365899
URL: https://svnweb.freebsd.org/changeset/base/365899

Log:
  Add NetBSD compatible bus_space_peek_N() and bus_space_poke_N() functions.
  One problem with the bus_space_read_N() and bus_space_write_N() family of
  functions is that they provide no protection against exceptions which can
  occur when no physical hardware or device responds to the read or write
  cycles. In such a situation, the system typically would panic due to a
  kernel-mode bus error. The bus_space_peek_N() and bus_space_poke_N() 
family
  of functions provide a mechanism to handle these exceptions gracefully
  without the risk of crashing the system.

  Typical example is access to PCI(e) configuration space in bus enumeration
  function on badly implemented PCI(e) root complexes (RK3399 or Neoverse
  N1 N1SDP and/or access to PCI(e) register when device is in deep sleep 
state.

  This commit adds a real implementation for arm64 only. The remaining
  architectures have bus_space_peek()/bus_space_poke() emulated by using
  bus_space_read()/bus_space_write() (without exception handling).

  MFC after:1 month
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D25371

Modified:
  head/share/man/man9/bus_space.9
  head/sys/arm/include/bus.h
  head/sys/arm64/arm64/bus_machdep.c
  head/sys/arm64/arm64/bus_space_asm.S
  head/sys/arm64/arm64/trap.c
  head/sys/arm64/include/bus.h
  head/sys/arm64/include/md_var.h
  head/sys/kern/subr_csan.c
  head/sys/mips/include/bus.h
  head/sys/powerpc/include/bus.h
  head/sys/riscv/include/bus.h
  head/sys/sys/_cscan_bus.h
  head/sys/sys/bus.h
  head/sys/tools/bus_macro.sh
  head/sys/x86/include/bus.h

Modified: head/share/man/man9/bus_space.9

==
--- head/share/man/man9/bus_space.9 Sat Sep 19 02:15:56 2020
(r365898)
+++ head/share/man/man9/bus_space.9 Sat Sep 19 11:06:41 2020
(r365899)
@@ -52,7 +52,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 15, 2017
+.Dd July 7, 2020
 .Dt BUS_SPACE 9
 .Os
 .Sh NAME
@@ -68,6 +68,14 @@
 .Nm bus_space_copy_region_stream_8 ,
 .Nm bus_space_free ,
 .Nm bus_space_map ,
+.Nm bus_space_peek_1 ,
+.Nm bus_space_peek_2 ,
+.Nm bus_space_peek_4 ,
+.Nm bus_space_peek_8 ,
+.Nm bus_space_poke_1 ,
+.Nm bus_space_poke_2 ,
+.Nm bus_space_poke_4 ,
+.Nm bus_space_poke_8 ,
 .Nm bus_space_read_1 ,
 .Nm bus_space_read_2 ,
 .Nm bus_space_read_4 ,
@@ -161,6 +169,46 @@
 .Fo bus_space_free
 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t size"
 .Fc
+.Ft int
+.Fo bus_space_peek_1
+.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
+.Fa "uint8_t *datap"
+.Fc
+.Ft int
+.Fo bus_space_peek_2
+.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
+.Fa "uint8_t *datap"
+.Fc
+.Ft int
+.Fo bus_space_peek_4
+.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
+.Fa "uint8_t *datap"
+.Fc
+.Ft int
+.Fo bus_space_peek_8
+.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset"
+.Fa "uint8_t *datap"
+.Fc
+.Ft int
+.Fo bus_space_poke_1

svn commit: r365993 - in head: share/man/man4 sys/dev/cxgbe

2020-09-21 Thread Navdeep Parhar
Author: np
Date: Tue Sep 22 04:16:40 2020
New Revision: 365993
URL: https://svnweb.freebsd.org/changeset/base/365993

Log:
  cxgbe(4): let the PF driver use VM work requests for transmit.
  
  This allows the PF interfaces to communicate with the VF interfaces over
  the internal switch in the ASIC.  Fix the GL limits for VM work requests
  while here.
  
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/share/man/man4/cxgbe.4
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Tue Sep 22 03:57:48 2020(r365992)
+++ head/share/man/man4/cxgbe.4 Tue Sep 22 04:16:40 2020(r365993)
@@ -351,6 +351,17 @@ This tunable is for specialized applications only and 
 normal operation.
 The capabilities for which hardware resources have been reserved are listed in
 dev..X.*caps sysctls.
+.It Va hw.cxgbe.tx_vm_wr
+Setting this to 1 instructs the driver to use VM work requests to transmit 
data.
+This lets PF interfaces transmit frames to VF interfaces over the internal
+switch in the ASIC.
+Note that the
+.Xr cxgbev 4
+VF driver always uses VM work requests and is not affected by this tunable.
+The default value is 0 and should be changed only if PF and VF interfaces need
+to communicate with each other.
+Different interfaces can be assigned different values using the
+dev..X.tx_vm_wr sysctl when the interface is administratively down.
 .El
 .Sh SUPPORT
 For general information and support,

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hTue Sep 22 03:57:48 2020
(r365992)
+++ head/sys/dev/cxgbe/adapter.hTue Sep 22 04:16:40 2020
(r365993)
@@ -118,6 +118,8 @@ enum {
SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */
TX_SGL_SEGS = 39,
TX_SGL_SEGS_TSO = 38,
+   TX_SGL_SEGS_VM = 38,
+   TX_SGL_SEGS_VM_TSO = 37,
TX_SGL_SEGS_EO_TSO = 30,/* XXX: lower for IPv6. */
TX_SGL_SEGS_VXLAN_TSO = 37,
TX_WR_FLITS = SGE_MAX_WR_LEN / 8
@@ -173,6 +175,7 @@ enum {
DOOMED  = (1 << 0),
VI_INIT_DONE= (1 << 1),
VI_SYSCTL_CTX   = (1 << 2),
+   TX_USES_VM_WR   = (1 << 3),
 
/* adapter debug_flags */
DF_DUMP_MBOX= (1 << 0), /* Log all mbox cmd/rpl. */
@@ -1267,7 +1270,7 @@ void t4_intr_evt(void *);
 void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);
 void t4_update_fl_bufsize(struct ifnet *);
 struct mbuf *alloc_wr_mbuf(int, int);
-int parse_pkt(struct adapter *, struct mbuf **);
+int parse_pkt(struct mbuf **, bool);
 void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *);
 void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *);
 int tnl_cong(struct port_info *, int);

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Sep 22 03:57:48 2020
(r365992)
+++ head/sys/dev/cxgbe/t4_main.cTue Sep 22 04:16:40 2020
(r365993)
@@ -591,6 +591,10 @@ static int t4_panic_on_fatal_err = 0;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, panic_on_fatal_err, CTLFLAG_RDTUN,
 _panic_on_fatal_err, 0, "panic on fatal errors");
 
+static int t4_tx_vm_wr = 0;
+SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_vm_wr, CTLFLAG_RWTUN, _tx_vm_wr, 0,
+"Use VM work requests to transmit packets.");
+
 #ifdef TCP_OFFLOAD
 /*
  * TOE tunables.
@@ -695,6 +699,7 @@ static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS);
 static int sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS);
 static int sysctl_btphy(SYSCTL_HANDLER_ARGS);
 static int sysctl_noflowq(SYSCTL_HANDLER_ARGS);
+static int sysctl_tx_vm_wr(SYSCTL_HANDLER_ARGS);
 static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
@@ -1723,6 +1728,8 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
 
vi->xact_addr_filt = -1;
callout_init(>tick, 1);
+   if (sc->flags & IS_VF || t4_tx_vm_wr != 0)
+   vi->flags |= TX_USES_VM_WR;
 
/* Allocate an ifnet and set it up */
ifp = if_alloc_dev(IFT_ETHER, dev);
@@ -1775,7 +1782,10 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
 #endif
 
ifp->if_hw_tsomax = IP_MAXPACKET;
-   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO;
+   if (vi->flags & TX_USES_VM_WR)
+   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_VM_TSO;
+   else
+   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO;
 #ifdef RATELIMIT
if (is_ethoffload(sc) && vi->nofldtxq != 0)
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO;
@@ -2174,7 +2184,7 @@ cxgbe_transmit(struct 

svn commit: r365992 - head/sbin/growfs

2020-09-21 Thread Kirk McKusick
Author: mckusick
Date: Tue Sep 22 03:57:48 2020
New Revision: 365992
URL: https://svnweb.freebsd.org/changeset/base/365992

Log:
  Add missing cylinder group check-hash updates when doing large expansions
  of filesystems.
  
  Reported by:  Colin Percival (cperciva@)
  Tested by:Colin Percival (cperciva@)
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.c
==
--- head/sbin/growfs/growfs.c   Tue Sep 22 03:06:36 2020(r365991)
+++ head/sbin/growfs/growfs.c   Tue Sep 22 03:57:48 2020(r365992)
@@ -590,6 +590,7 @@ updjcg(int cylno, time_t modtime, int fsi, int fso, un
if (sblock.fs_magic == FS_UFS1_MAGIC)
acg.cg_old_ncyl = sblock.fs_old_cpg;
 
+   cgckhash();
wtfs(fsbtodb(, cgtod(, cylno)),
(size_t)sblock.fs_cgsize, (void *), fso, Nflag);
DBG_PRINT0("jcg written\n");
@@ -965,6 +966,7 @@ updcsloc(time_t modtime, int fsi, int fso, unsigned in
 * Now write the former cylinder group containing the cylinder
 * summary back to disk.
 */
+   cgckhash();
wtfs(fsbtodb(, cgtod(, ocscg)),
(size_t)sblock.fs_cgsize, (void *), fso, Nflag);
DBG_PRINT0("oscg written\n");
@@ -1057,6 +1059,7 @@ updcsloc(time_t modtime, int fsi, int fso, unsigned in
 * Write the new cylinder group containing the cylinder summary
 * back to disk.
 */
+   cgckhash();
wtfs(fsbtodb(, cgtod(, ncscg)),
(size_t)sblock.fs_cgsize, (void *), fso, Nflag);
DBG_PRINT0("nscg written\n");
___
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: r365991 - head/sys/dev/cxgbe

2020-09-21 Thread Navdeep Parhar
Author: np
Date: Tue Sep 22 03:06:36 2020
New Revision: 365991
URL: https://svnweb.freebsd.org/changeset/base/365991

Log:
  cxgbe(4): add counters for mbuf pullups and defrags.
  
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Tue Sep 22 02:22:37 2020(r365990)
+++ head/sys/dev/cxgbe/t4_sge.c Tue Sep 22 03:06:36 2020(r365991)
@@ -204,6 +204,15 @@ static int lro_mbufs = 0;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, lro_mbufs, CTLFLAG_RDTUN, _mbufs, 0,
 "Enable presorting of LRO frames");
 
+static counter_u64_t pullups;
+SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, pullups, CTLFLAG_RD, ,
+"Number of mbuf pullups performed");
+
+static counter_u64_t defrags;
+SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, defrags, CTLFLAG_RD, ,
+"Number of mbuf defrags performed");
+
+
 static int service_iq(struct sge_iq *, int);
 static int service_iq_fl(struct sge_iq *, int);
 static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, 
uint32_t);
@@ -535,8 +544,12 @@ t4_sge_modload(void)
 
extfree_refs = counter_u64_alloc(M_WAITOK);
extfree_rels = counter_u64_alloc(M_WAITOK);
+   pullups = counter_u64_alloc(M_WAITOK);
+   defrags = counter_u64_alloc(M_WAITOK);
counter_u64_zero(extfree_refs);
counter_u64_zero(extfree_rels);
+   counter_u64_zero(pullups);
+   counter_u64_zero(defrags);
 
t4_init_shared_cpl_handlers();
t4_register_cpl_handler(CPL_FW4_MSG, handle_fw_msg);
@@ -556,6 +569,8 @@ t4_sge_modunload(void)
 
counter_u64_free(extfree_refs);
counter_u64_free(extfree_rels);
+   counter_u64_free(pullups);
+   counter_u64_free(defrags);
 }
 
 uint64_t
@@ -2714,16 +2729,22 @@ restart:
}
 #endif
if (nsegs > max_nsegs_allowed(m0)) {
-   if (defragged++ > 0 || (m = m_defrag(m0, M_NOWAIT)) == NULL) {
+   if (defragged++ > 0) {
rc = EFBIG;
goto fail;
}
+   counter_u64_add(defrags, 1);
+   if ((m = m_defrag(m0, M_NOWAIT)) == NULL) {
+   rc = ENOMEM;
+   goto fail;
+   }
*mp = m0 = m;   /* update caller's copy after defrag */
goto restart;
}
 
if (__predict_false(nsegs > 2 && m0->m_pkthdr.len <= MHLEN &&
!(cflags & MC_NOMAP))) {
+   counter_u64_add(pullups, 1);
m0 = m_pullup(m0, m0->m_pkthdr.len);
if (m0 == NULL) {
/* Should have left well enough alone. */
___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-21 Thread Conrad Meyer
Big ol plus one from me.

On Mon, Sep 21, 2020 at 4:16 PM Cy Schubert  wrote:
>
> In message <202009212255.08lmtpsp078...@repo.freebsd.org>, Greg Lehey
> writes:
> > Author: grog
> > Date: Mon Sep 21 22:55:51 2020
> > New Revision: 365984
> > URL: https://svnweb.freebsd.org/changeset/base/365984
> >
> > Log:
> >   Remove claim that Allied Forces created "West Germany" in 1953.  I can
> >   find no historic substantiation for such a claim.  The Federal
> >   Republic of Germany was created by Germans on 23 May 1949, as also
> >   noted in this file.
> >
> > Modified:
> >   head/usr.bin/calendar/calendars/calendar.history
> >
> > Modified: head/usr.bin/calendar/calendars/calendar.history
> > =
> > =
> > --- head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:52:57 
> > 202
> > 0 (r365983)
> > +++ head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:55:51 
> > 202
> > 0 (r365984)
> > @@ -521,7 +521,6 @@
> >  09/20Magellan leaves Spain on the first Round the World passage, 
> > 151
> > 9
> >  09/20The Roxy Theater opens in Hollywood, 1973
> >  09/21J. R. R. Tolkien's The Hobbit is published, 1937
> > -09/22Allied forces form the independent nation West Germany, 1953
> >  09/22US President Lincoln issues the Emancipation Proclamation, 
> > 1862
> >  09/22Special prosecutor Leon Jeworski subpoenas US President Nixon,
> > 1974
> >  09/22The first Soviet atomic bomb explodes, 1949
> >
>
> Does this file still need to be in FreeBSD? It may have been a novelty back
> in the day but IMO calendar.history has nothing to do with BSD, computers
> or anything else of interest to FreeBSD. At the very least this file should
> be moved to ports or better yet, removed entirely. I simply don't see the
> point of it being in the tree and distributed with an O/S, any O/S.
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  https://FreeBSD.org
> NTP:   Web:  https://nwtime.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: r365990 - in stable: 11 12

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 02:22:37 2020
New Revision: 365990
URL: https://svnweb.freebsd.org/changeset/base/365990

Log:
  Record-only MFC of r365018
  
  MFC r365018: Makefile.inc1: comment .endif to ease finding matching .if
  
  This was effectively merged back in r365987 and r365988.

Modified:
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
Directory Properties:
  stable/11/   (props changed)
___
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: r365990 - in stable: 11 12

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 02:22:37 2020
New Revision: 365990
URL: https://svnweb.freebsd.org/changeset/base/365990

Log:
  Record-only MFC of r365018
  
  MFC r365018: Makefile.inc1: comment .endif to ease finding matching .if
  
  This was effectively merged back in r365987 and r365988.

Modified:
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
Directory Properties:
  stable/12/   (props changed)
___
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: r365989 - stable/11

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 02:20:10 2020
New Revision: 365989
URL: https://svnweb.freebsd.org/changeset/base/365989

Log:
  Record-only MFC of r361257
  
  r365988 inadvertently added r365852 into svn:mergeinfo. That commit reverted
  this one, so just go ahead and mark this one as merged to avoid any
  whoopsmerges in the future.
  
  My apologies-

Modified:
Directory Properties:
  stable/11/   (props changed)
___
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: r365988 - stable/11

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 02:15:28 2020
New Revision: 365988
URL: https://svnweb.freebsd.org/changeset/base/365988

Log:
  MFC r365829, r365837: certctl rehash upon install/distribute
  
  r365829:
  installworld: run `certctl rehash` after installation completes
  
  This was originally introduced back in r360833, and subsequently reverted
  because it was broken for -DNO_ROOT builds and it may not have been the
  correct place for it.
  
  While debatably this may still not be 'the correct place,' it's much cleaner
  than scattering rehashes all throughout the tree. brooks has fixed the issue
  with -DNO_ROOT by properly writing to the METALOG in r361397.
  
  Do note that this is different than what was originally committed; brooks
  had revisions in D24932 that made it actually use the revised unprivileged
  mode and write to METALOG, along with being a little more friendly to
  foreign crossbuilds and just using the certctl in-tree.
  
  With this change, I believe we should now have a populated /etc/ssl/certs in
  the VM images.
  
  r365837:
  Promote the installworld `certctl rehash` to distributeworld
  
  Contrary to my belief, installworld is not sufficient for getting certs
  installed into VM images. Promote the rehash to both installworld and
  distributeworld (notably: not stageworld) and rehash the base distdir so we
  end up with /etc/ssl/certs populated in the base dist archive. A future
  commit will remove the rehash from bsdinstall, which doesn't really need to
  happen if they're installed into base.txz.
  
  While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/

Modified:
  stable/11/Makefile.inc1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/Makefile.inc1
==
--- stable/11/Makefile.inc1 Tue Sep 22 02:14:55 2020(r365987)
+++ stable/11/Makefile.inc1 Tue Sep 22 02:15:28 2020(r365988)
@@ -647,7 +647,9 @@ INSTALL_DDIR=   ${_INSTALL_DDIR:S://:/:g:C:/$::}
 METALOG?=  ${DESTDIR}/${DISTDIR}/METALOG
 METALOG:=  ${METALOG:C,//+,/,g}
 IMAKE+=-DNO_ROOT METALOG=${METALOG}
-INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
+METALOG_INSTALLFLAGS=  -U -M ${METALOG} -D ${INSTALL_DDIR}
+INSTALLFLAGS+= ${METALOG_INSTALLFLAGS}
+CERTCTLFLAGS=  ${METALOG_INSTALLFLAGS}
 MTREEFLAGS+=   -W
 .endif
 .if defined(BUILD_PKGS)
@@ -657,6 +659,11 @@ INSTALLFLAGS+= -h sha256
 IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
 IMAKE_MTREE=   MTREE_CMD="mtree ${MTREEFLAGS}"
 .endif
+.if make(distributeworld)
+CERTCTLDESTDIR=${DESTDIR}/${DISTDIR}/base
+.else
+CERTCTLDESTDIR=${DESTDIR}
+.endif
 
 # kernel stage
 KMAKEENV=  ${WMAKEENV}
@@ -1104,6 +,14 @@ distributeworld installworld stageworld: _installcheck
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
 .endfor
 .endif
+.endif # make(distributeworld)
+.if !make(packageworld) && ${MK_CAROOT} != "no"
+   @if which openssl>/dev/null; then \
+   DESTDIR=${CERTCTLDESTDIR} \
+   sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} 
rehash \
+   else \
+   echo "No openssl on the host, not rehashing certificates target 
-- /etc/ssl may not be populated."; \
+   fi
 .endif
 
 packageworld: .PHONY
___
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: r365987 - in stable/12: . usr.sbin/bsdinstall/scripts

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 02:14:55 2020
New Revision: 365987
URL: https://svnweb.freebsd.org/changeset/base/365987

Log:
  MFC r365829, r365837, r365852: certctl rehash upon install/distribute
  
  r365829:
  installworld: run `certctl rehash` after installation completes
  
  This was originally introduced back in r360833, and subsequently reverted
  because it was broken for -DNO_ROOT builds and it may not have been the
  correct place for it.
  
  While debatably this may still not be 'the correct place,' it's much cleaner
  than scattering rehashes all throughout the tree. brooks has fixed the issue
  with -DNO_ROOT by properly writing to the METALOG in r361397.
  
  Do note that this is different than what was originally committed; brooks
  had revisions in D24932 that made it actually use the revised unprivileged
  mode and write to METALOG, along with being a little more friendly to
  foreign crossbuilds and just using the certctl in-tree.
  
  With this change, I believe we should now have a populated /etc/ssl/certs in
  the VM images.
  
  r365837:
  Promote the installworld `certctl rehash` to distributeworld
  
  Contrary to my belief, installworld is not sufficient for getting certs
  installed into VM images. Promote the rehash to both installworld and
  distributeworld (notably: not stageworld) and rehash the base distdir so we
  end up with /etc/ssl/certs populated in the base dist archive. A future
  commit will remove the rehash from bsdinstall, which doesn't really need to
  happen if they're installed into base.txz.
  
  While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/
  
  r365852:
  Revert r361257: bsdinstall: do a `certctl rehash` upon installation [...]
  
  As of r365829, any given base distribution set will now include the /etc/ssl
  symlinks that this rehash would've otherwise installed. This extra step is
  no longer required.

Modified:
  stable/12/Makefile.inc1
  stable/12/usr.sbin/bsdinstall/scripts/config
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/Makefile.inc1
==
--- stable/12/Makefile.inc1 Tue Sep 22 01:58:18 2020(r365986)
+++ stable/12/Makefile.inc1 Tue Sep 22 02:14:55 2020(r365987)
@@ -849,7 +849,9 @@ INSTALL_DDIR=   ${_INSTALL_DDIR:S://:/:g:C:/$::}
 METALOG?=  ${DESTDIR}/${DISTDIR}/METALOG
 METALOG:=  ${METALOG:C,//+,/,g}
 IMAKE+=-DNO_ROOT METALOG=${METALOG}
-INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
+METALOG_INSTALLFLAGS=  -U -M ${METALOG} -D ${INSTALL_DDIR}
+INSTALLFLAGS+= ${METALOG_INSTALLFLAGS}
+CERTCTLFLAGS=  ${METALOG_INSTALLFLAGS}
 MTREEFLAGS+=   -W
 .endif
 .if defined(BUILD_PKGS)
@@ -859,6 +861,11 @@ INSTALLFLAGS+= -h sha256
 IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
 IMAKE_MTREE=   MTREE_CMD="mtree ${MTREEFLAGS}"
 .endif
+.if make(distributeworld)
+CERTCTLDESTDIR=${DESTDIR}/${DISTDIR}/base
+.else
+CERTCTLDESTDIR=${DESTDIR}
+.endif
 
 DESTDIR_MTREEFLAGS=-deU
 # When creating worldtmp we don't need to set the directories as owned by root
@@ -1419,6 +1426,14 @@ distributeworld installworld stageworld: _installcheck
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
 .endfor
 .endif
+.endif # make(distributeworld)
+.if !make(packageworld) && ${MK_CAROOT} != "no"
+   @if which openssl>/dev/null; then \
+   DESTDIR=${CERTCTLDESTDIR} \
+   sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} 
rehash \
+   else \
+   echo "No openssl on the host, not rehashing certificates target 
-- /etc/ssl may not be populated."; \
+   fi
 .endif
 
 packageworld: .PHONY

Modified: stable/12/usr.sbin/bsdinstall/scripts/config
==
--- stable/12/usr.sbin/bsdinstall/scripts/configTue Sep 22 01:58:18 
2020(r365986)
+++ stable/12/usr.sbin/bsdinstall/scripts/configTue Sep 22 02:14:55 
2020(r365987)
@@ -55,9 +55,6 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
 
 # Set up other things from installed config
 chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
-if [ -x $BSDINSTALL_CHROOT/usr/sbin/certctl ]; then
-   chroot $BSDINSTALL_CHROOT /usr/sbin/certctl rehash
-fi
 
 exit 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: r365986 - in stable: 11/secure/caroot/blacklisted 11/secure/caroot/trusted 12/secure/caroot/blacklisted 12/secure/caroot/trusted

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 01:58:18 2020
New Revision: 365986
URL: https://svnweb.freebsd.org/changeset/base/365986

Log:
  MFC r365896: caroot: update base store
  
  Count:
  - Two (2) removed
  - Three (3) added

Added:
  stable/11/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
  stable/11/secure/caroot/blacklisted/Taiwan_GRCA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/Taiwan_GRCA.pem
  stable/11/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
  
stable/11/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
  
stable/11/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
Deleted:
  stable/11/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem
  stable/11/secure/caroot/trusted/Taiwan_GRCA.pem
Modified:
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/12/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
  stable/12/secure/caroot/blacklisted/Taiwan_GRCA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/Taiwan_GRCA.pem
  stable/12/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
  
stable/12/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
  
stable/12/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
Deleted:
  stable/12/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem
  stable/12/secure/caroot/trusted/Taiwan_GRCA.pem
Modified:
Directory Properties:
  stable/12/   (props changed)

Copied: stable/11/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem 
(from r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem 
Tue Sep 22 01:58:18 2020(r365986, copy of r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem)
@@ -0,0 +1,96 @@
+##
+##  EE Certification Centre Root CA
+##
+##  This is a single X.509 certificate for a public Certificate
+##  Authority (CA). It was automatically extracted from Mozilla's
+##  root CA list (the file `certdata.txt' in security/nss).
+##
+##  Extracted from nss
+##  with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 
01:27:50Z kevans $
+##
+##  @generated
+##
+Certificate:
+Data:
+Version: 3 (0x2)
+Serial Number:
+54:80:f9:a0:73:ed:3f:00:4c:ca:89:d8:e3:71:e6:4a
+Signature Algorithm: sha1WithRSAEncryption
+Issuer: C = EE, O = AS Sertifitseerimiskeskus, CN = EE Certification 
Centre Root CA, emailAddress = p...@sk.ee
+Validity
+Not Before: Oct 30 10:10:30 2010 GMT
+Not After : Dec 17 23:59:59 2030 GMT
+Subject: C = EE, O = AS Sertifitseerimiskeskus, CN = EE Certification 
Centre Root CA, emailAddress = p...@sk.ee
+Subject Public Key Info:
+Public Key Algorithm: rsaEncryption
+RSA Public-Key: (2048 bit)
+Modulus:
+00:c8:20:c0:ec:e0:c5:4b:ab:07:78:95:f3:44:ee:
+fb:0b:0c:ff:74:8e:61:bb:b1:62:ea:23:d8:ab:a1:
+65:32:7a:eb:8e:17:4f:96:d8:0a:7b:91:a2:63:6c:
+c7:8c:4c:2e:79:bf:a9:05:fc:69:5c:95:8d:62:f9:
+b9:70:ed:c3:51:7d:d0:93:e6:6c:eb:30:4b:e1:bc:
+7d:bf:52:9b:ce:6e:7b:65:f2:38:b1:c0:a2:32:ef:
+62:b2:68:e0:61:53:c1:36:95:ff:ec:94:ba:36:ae:
+9c:1c:a7:32:0f:e5:7c:b4:c6:6f:74:fd:7b:18:e8:
+ac:57:ed:06:20:4b:32:30:58:5b:fd:cd:a8:e6:a1:
+fc:70:bc:8e:92:73:db:97:a7:7c:21:ae:3d:c1:f5:
+48:87:6c:27:bd:9f:25:74:81:55:b0:f7:75:f6:3d:
+a4:64:6b:d6:4f:e7:ce:40:ad:0f:dd:32:d3:bc:8a:
+

svn commit: r365986 - in stable: 11/secure/caroot/blacklisted 11/secure/caroot/trusted 12/secure/caroot/blacklisted 12/secure/caroot/trusted

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Tue Sep 22 01:58:18 2020
New Revision: 365986
URL: https://svnweb.freebsd.org/changeset/base/365986

Log:
  MFC r365896: caroot: update base store
  
  Count:
  - Two (2) removed
  - Three (3) added

Added:
  stable/12/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
  stable/12/secure/caroot/blacklisted/Taiwan_GRCA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/Taiwan_GRCA.pem
  stable/12/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
  
stable/12/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
  
stable/12/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
Deleted:
  stable/12/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem
  stable/12/secure/caroot/trusted/Taiwan_GRCA.pem
Modified:
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/11/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem
  stable/11/secure/caroot/blacklisted/Taiwan_GRCA.pem
 - copied unchanged from r365896, 
head/secure/caroot/blacklisted/Taiwan_GRCA.pem
  stable/11/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem
  
stable/11/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
  
stable/11/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
 - copied unchanged from r365896, 
head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
Deleted:
  stable/11/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem
  stable/11/secure/caroot/trusted/Taiwan_GRCA.pem
Modified:
Directory Properties:
  stable/11/   (props changed)

Copied: stable/12/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem 
(from r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem 
Tue Sep 22 01:58:18 2020(r365986, copy of r365896, 
head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem)
@@ -0,0 +1,96 @@
+##
+##  EE Certification Centre Root CA
+##
+##  This is a single X.509 certificate for a public Certificate
+##  Authority (CA). It was automatically extracted from Mozilla's
+##  root CA list (the file `certdata.txt' in security/nss).
+##
+##  Extracted from nss
+##  with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 
01:27:50Z kevans $
+##
+##  @generated
+##
+Certificate:
+Data:
+Version: 3 (0x2)
+Serial Number:
+54:80:f9:a0:73:ed:3f:00:4c:ca:89:d8:e3:71:e6:4a
+Signature Algorithm: sha1WithRSAEncryption
+Issuer: C = EE, O = AS Sertifitseerimiskeskus, CN = EE Certification 
Centre Root CA, emailAddress = p...@sk.ee
+Validity
+Not Before: Oct 30 10:10:30 2010 GMT
+Not After : Dec 17 23:59:59 2030 GMT
+Subject: C = EE, O = AS Sertifitseerimiskeskus, CN = EE Certification 
Centre Root CA, emailAddress = p...@sk.ee
+Subject Public Key Info:
+Public Key Algorithm: rsaEncryption
+RSA Public-Key: (2048 bit)
+Modulus:
+00:c8:20:c0:ec:e0:c5:4b:ab:07:78:95:f3:44:ee:
+fb:0b:0c:ff:74:8e:61:bb:b1:62:ea:23:d8:ab:a1:
+65:32:7a:eb:8e:17:4f:96:d8:0a:7b:91:a2:63:6c:
+c7:8c:4c:2e:79:bf:a9:05:fc:69:5c:95:8d:62:f9:
+b9:70:ed:c3:51:7d:d0:93:e6:6c:eb:30:4b:e1:bc:
+7d:bf:52:9b:ce:6e:7b:65:f2:38:b1:c0:a2:32:ef:
+62:b2:68:e0:61:53:c1:36:95:ff:ec:94:ba:36:ae:
+9c:1c:a7:32:0f:e5:7c:b4:c6:6f:74:fd:7b:18:e8:
+ac:57:ed:06:20:4b:32:30:58:5b:fd:cd:a8:e6:a1:
+fc:70:bc:8e:92:73:db:97:a7:7c:21:ae:3d:c1:f5:
+48:87:6c:27:bd:9f:25:74:81:55:b0:f7:75:f6:3d:
+a4:64:6b:d6:4f:e7:ce:40:ad:0f:dd:32:d3:bc:8a:
+

svn commit: r365985 - releng/12.2/sys/cddl/compat/opensolaris/kern

2020-09-21 Thread Mark Johnston
Author: markj
Date: Tue Sep 22 01:35:55 2020
New Revision: 365985
URL: https://svnweb.freebsd.org/changeset/base/365985

Log:
  MFS r365979:
  Mark sysctls added in r365689 as MPSAFE.
  
  Approved by:  re (gjb)

Modified:
  releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
==
--- releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.cMon Sep 
21 22:55:51 2020(r365984)
+++ releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.cTue Sep 
22 01:35:55 2020(r365985)
@@ -184,16 +184,16 @@ kstat_install(kstat_t *ksp)
SYSCTL_ADD_PROC(>ks_sysctl_ctx,
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
OID_AUTO, ksent->name,
-   CTLTYPE_STRING | CTLFLAG_RD, ksp, i,
-   kstat_sysctl_string, "A", ksent->desc);
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   ksp, i, kstat_sysctl_string, "A", ksent->desc);
continue;
}
KASSERT(ksent->data_type == KSTAT_DATA_UINT64,
("data_type=%d", ksent->data_type));
SYSCTL_ADD_PROC(>ks_sysctl_ctx,
SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name,
-   CTLTYPE_U64 | CTLFLAG_RD, ksp, i,
-   kstat_sysctl, "QU", ksent->desc);
+   CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   ksp, i, kstat_sysctl, "QU", ksent->desc);
}
 }
 
___
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: r365846 - head

2020-09-21 Thread Ravi Pokala
-Original Message-
From:  on behalf of Ed Maste 

Date: 2020-09-17, Thursday at 11:47
To: , , 

Subject: svn commit: r365846 - head

Author: emaste
Date: Thu Sep 17 18:47:23 2020
New Revision: 365846
URL: https://svnweb.freebsd.org/changeset/base/365846

Log:
  Cirrus-CI: build as an unprivileged user

  The Cirrus-CI-provided working tree is owned by root.  Leave that as is
  for simplicity but build as an unprivileged user; this tests building
  with an unmodifiable source tree as a side effect.

Hi Ed,

We're still generating the LINT kernconfs into the src tree though, right? 
Moving that to allow for universe/tinderboxing a r/o src tree seems like an 
obvious idea. The fact that we don't already do that implies that there's a 
non-obvious complication with that idea; does anyone know why that is?

Thanks,

Ravi (rpokala@)

  Continue running the smoke test as root for now, as it failed when run
  as an unprivileged user - pkg reported "Fail to chmod
  /usr/bin/.pkgtemp.lpq.dUHpEqPGJ9pq:Operation not permitted"

  Sponsored by: The FreeBSD Foundation

Modified:
  head/.cirrus.yml

Modified: head/.cirrus.yml

==
--- head/.cirrus.ymlThu Sep 17 18:24:51 2020(r365845)
+++ head/.cirrus.ymlThu Sep 17 18:47:23 2020(r365846)
@@ -12,9 +12,13 @@ task:
   timeout_in: 120m
   install_script:
   - pkg install -y qemu-devel uefi-edk2-qemu-x86_64
+  setup_user_script:
+  - pw useradd user
+  - mkdir -p /usr/obj/$(pwd -P)
+  - chown user:user /usr/obj/$(pwd -P)
   script:
-  - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld 
buildkernel
+  - su user -c "make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes 
buildworld buildkernel"
   package_script:
-  - make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages
+  - su user -c "make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages"
   test_script:
   - sh tools/boot/ci-qemu-test.sh


___
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: r365984 - head/usr.bin/calendar/calendars

2020-09-21 Thread Cy Schubert
In message <202009212255.08lmtpsp078...@repo.freebsd.org>, Greg Lehey 
writes:
> Author: grog
> Date: Mon Sep 21 22:55:51 2020
> New Revision: 365984
> URL: https://svnweb.freebsd.org/changeset/base/365984
>
> Log:
>   Remove claim that Allied Forces created "West Germany" in 1953.  I can
>   find no historic substantiation for such a claim.  The Federal
>   Republic of Germany was created by Germans on 23 May 1949, as also
>   noted in this file.
>
> Modified:
>   head/usr.bin/calendar/calendars/calendar.history
>
> Modified: head/usr.bin/calendar/calendars/calendar.history
> =
> =
> --- head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:52:57 202
> 0 (r365983)
> +++ head/usr.bin/calendar/calendars/calendar.history  Mon Sep 21 22:55:51 202
> 0 (r365984)
> @@ -521,7 +521,6 @@
>  09/20Magellan leaves Spain on the first Round the World passage, 151
> 9
>  09/20The Roxy Theater opens in Hollywood, 1973
>  09/21J. R. R. Tolkien's The Hobbit is published, 1937
> -09/22Allied forces form the independent nation West Germany, 1953
>  09/22US President Lincoln issues the Emancipation Proclamation, 1862
>  09/22Special prosecutor Leon Jeworski subpoenas US President Nixon, 
> 1974
>  09/22The first Soviet atomic bomb explodes, 1949
>

Does this file still need to be in FreeBSD? It may have been a novelty back 
in the day but IMO calendar.history has nothing to do with BSD, computers 
or anything else of interest to FreeBSD. At the very least this file should 
be moved to ports or better yet, removed entirely. I simply don't see the 
point of it being in the tree and distributed with an O/S, any O/S.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.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: r365984 - head/usr.bin/calendar/calendars

2020-09-21 Thread Greg Lehey
Author: grog
Date: Mon Sep 21 22:55:51 2020
New Revision: 365984
URL: https://svnweb.freebsd.org/changeset/base/365984

Log:
  Remove claim that Allied Forces created "West Germany" in 1953.  I can
  find no historic substantiation for such a claim.  The Federal
  Republic of Germany was created by Germans on 23 May 1949, as also
  noted in this file.

Modified:
  head/usr.bin/calendar/calendars/calendar.history

Modified: head/usr.bin/calendar/calendars/calendar.history
==
--- head/usr.bin/calendar/calendars/calendar.historyMon Sep 21 22:52:57 
2020(r365983)
+++ head/usr.bin/calendar/calendars/calendar.historyMon Sep 21 22:55:51 
2020(r365984)
@@ -521,7 +521,6 @@
 09/20  Magellan leaves Spain on the first Round the World passage, 1519
 09/20  The Roxy Theater opens in Hollywood, 1973
 09/21  J. R. R. Tolkien's The Hobbit is published, 1937
-09/22  Allied forces form the independent nation West Germany, 1953
 09/22  US President Lincoln issues the Emancipation Proclamation, 1862
 09/22  Special prosecutor Leon Jeworski subpoenas US President Nixon, 1974
 09/22  The first Soviet atomic bomb explodes, 1949
___
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: r365983 - stable/12/sys/dev/e1000

2020-09-21 Thread Eric Joyner
Author: erj
Date: Mon Sep 21 22:52:57 2020
New Revision: 365983
URL: https://svnweb.freebsd.org/changeset/base/365983

Log:
  MFC r365774 and r365776
  
  These two commits fix issues in em(4)/igb(4):
  - Fix define and includes with RSS option enabled
  - Properly retain promisc flag in init
  
  PR:   249191, 248869
  MFC after:1 day

Modified:
  stable/12/sys/dev/e1000/if_em.c
  stable/12/sys/dev/e1000/if_em.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/e1000/if_em.c
==
--- stable/12/sys/dev/e1000/if_em.c Mon Sep 21 22:24:46 2020
(r365982)
+++ stable/12/sys/dev/e1000/if_em.c Mon Sep 21 22:52:57 2020
(r365983)
@@ -1338,7 +1338,7 @@ em_if_init(if_ctx_t ctx)
}
 
/* Don't lose promiscuous settings */
-   em_if_set_promisc(ctx, IFF_PROMISC);
+   em_if_set_promisc(ctx, if_getflags(ifp));
e1000_clear_hw_cntrs_base_generic(>hw);
 
/* MSI-X configuration for 82574 */

Modified: stable/12/sys/dev/e1000/if_em.h
==
--- stable/12/sys/dev/e1000/if_em.h Mon Sep 21 22:24:46 2020
(r365982)
+++ stable/12/sys/dev/e1000/if_em.h Mon Sep 21 22:52:57 2020
(r365983)
@@ -30,6 +30,7 @@
 #include "opt_ddb.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
+#include "opt_rss.h"
 
 #ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_device_polling.h"
@@ -69,6 +70,10 @@
 #include 
 #include 
 #include 
+#ifdef RSS
+#include 
+#include 
+#endif
 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365982 - head/stand/common

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:24:46 2020
New Revision: 365982
URL: https://svnweb.freebsd.org/changeset/base/365982

Log:
  stand/reloc_elf: Handle relative relocations for arm{,64} and riscv
  
  Extend the powerpc relative relocation handling from r240782 to a
  handful of other architectures.  This is needed to properly read
  dependency information from kernel modules.
  
  Reviewed by:  jhb
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26365

Modified:
  head/stand/common/reloc_elf.c

Modified: head/stand/common/reloc_elf.c
==
--- head/stand/common/reloc_elf.c   Mon Sep 21 22:23:57 2020
(r365981)
+++ head/stand/common/reloc_elf.c   Mon Sep 21 22:24:46 2020
(r365982)
@@ -175,7 +175,8 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr
}
 
return (0);
-#elif defined(__powerpc__)
+#elif defined(__aarch64__) || defined(__arm__) || defined(__powerpc__) || \
+defined(__riscv)
Elf_Size w;
const Elf_Rela *rela;
 
@@ -185,7 +186,15 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr
if (relbase + rela->r_offset >= dataaddr &&
relbase + rela->r_offset < dataaddr + len) {
switch (ELF_R_TYPE(rela->r_info)) {
+#if defined(__aarch64__)
+   case R_AARCH64_RELATIVE:
+#elif defined(__arm__)
+   case R_ARM_RELATIVE:
+#elif defined(__powerpc__)
case R_PPC_RELATIVE:
+#elif defined(__riscv)
+   case R_RISCV_RELATIVE:
+#endif
w = relbase + rela->r_addend;
bcopy(, (u_char *)data + (relbase +
  rela->r_offset - dataaddr), sizeof(w));
___
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: r365981 - in head/sys: arm64/arm64 vm

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:23:57 2020
New Revision: 365981
URL: https://svnweb.freebsd.org/changeset/base/365981

Log:
  arm64/pmap: Sparsify pv_table
  
  Reviewed by:  markj, kib
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26132

Modified:
  head/sys/arm64/arm64/pmap.c
  head/sys/vm/vm_phys.h

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Sep 21 22:22:53 2020(r365980)
+++ head/sys/arm64/arm64/pmap.c Mon Sep 21 22:23:57 2020(r365981)
@@ -178,8 +178,32 @@ __FBSDID("$FreeBSD$");
 #endif
 
 #definepmap_l2_pindex(v)   ((v) >> L2_SHIFT)
-#definepa_to_pvh(pa)   (_table[pmap_l2_pindex(pa)])
 
+static struct md_page *
+pa_to_pvh(vm_paddr_t pa)
+{
+   struct vm_phys_seg *seg;
+   int segind;
+
+   for (segind = 0; segind < vm_phys_nsegs; segind++) {
+   seg = _phys_segs[segind];
+   if (pa >= seg->start && pa < seg->end)
+   return ((struct md_page *)seg->md_first +
+   pmap_l2_pindex(pa) - pmap_l2_pindex(seg->start));
+   }
+   panic("pa 0x%jx not within vm_phys_segs", (uintmax_t)pa);
+}
+
+static struct md_page *
+page_to_pvh(vm_page_t m)
+{
+   struct vm_phys_seg *seg;
+
+   seg = _phys_segs[m->segind];
+   return ((struct md_page *)seg->md_first +
+   pmap_l2_pindex(VM_PAGE_TO_PHYS(m)) - pmap_l2_pindex(seg->start));
+}
+
 #defineNPV_LIST_LOCKS  MAXCPU
 
 #definePHYS_TO_PV_LIST_LOCK(pa)\
@@ -1049,6 +1073,8 @@ pmap_init_asids(struct asid_set *set, int bits)
 void
 pmap_init(void)
 {
+   struct vm_phys_seg *seg, *next_seg;
+   struct md_page *pvh;
vm_size_t s;
uint64_t mmfr1;
int i, pv_npg, vmid_bits;
@@ -1093,7 +1119,12 @@ pmap_init(void)
/*
 * Calculate the size of the pv head table for superpages.
 */
-   pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, L2_SIZE);
+   pv_npg = 0;
+   for (i = 0; i < vm_phys_nsegs; i++) {
+   seg = _phys_segs[i];
+   pv_npg += pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) -
+   pmap_l2_pindex(seg->start);
+   }
 
/*
 * Allocate memory for the pv head table for superpages.
@@ -1105,6 +1136,31 @@ pmap_init(void)
TAILQ_INIT(_table[i].pv_list);
TAILQ_INIT(_dummy.pv_list);
 
+   /*
+* Set pointers from vm_phys_segs to pv_table.
+*/
+   for (i = 0, pvh = pv_table; i < vm_phys_nsegs; i++) {
+   seg = _phys_segs[i];
+   seg->md_first = pvh;
+   pvh += pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) -
+   pmap_l2_pindex(seg->start);
+
+   /*
+* If there is a following segment, and the final
+* superpage of this segment and the initial superpage
+* of the next segment are the same then adjust the
+* pv_table entry for that next segment down by one so
+* that the pv_table entries will be shared.
+*/
+   if (i + 1 < vm_phys_nsegs) {
+   next_seg = _phys_segs[i + 1];
+   if (pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - 1 ==
+   pmap_l2_pindex(next_seg->start)) {
+   pvh--;
+   }
+   }
+   }
+
vm_initialized = 1;
 }
 
@@ -2247,7 +2303,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
m->md.pv_gen++;
if (TAILQ_EMPTY(>md.pv_list) &&
(m->flags & PG_FICTITIOUS) == 0) {
-   pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
+   pvh = page_to_pvh(m);
if (TAILQ_EMPTY(>pv_list)) {
vm_page_aflag_clear(m,
PGA_WRITEABLE);
@@ -2788,7 +2844,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_
pmap_pvh_free(>md, pmap, va);
if (TAILQ_EMPTY(>md.pv_list) &&
(m->flags & PG_FICTITIOUS) == 0) {
-   pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
+   pvh = page_to_pvh(m);
if (TAILQ_EMPTY(>pv_list))
vm_page_aflag_clear(m, PGA_WRITEABLE);
}
@@ -2858,7 +2914,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_o
pmap_pvh_free(>md, pmap, sva);
if (TAILQ_EMPTY(>md.pv_list) &&
(m->flags & PG_FICTITIOUS) == 

svn commit: r365980 - head/sys/vm

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:22:53 2020
New Revision: 365980
URL: https://svnweb.freebsd.org/changeset/base/365980

Log:
  vm_reserv: Sparsify the vm_reserv_array when VM_PHYSSEG_SPARSE
  
  On an Ampere Altra system, the physical memory is populated
  sparsely within the physical address space, with only about 0.4%
  of physical addresses backed by RAM in the range [0, last_pa].
  
  This is causing the vm_reserv_array to be over-sized by a few
  orders of magnitude, wasting roughly 5 GiB on a system with
  256 GiB of RAM.
  
  The sparse allocation of vm_reserv_array is controlled by defining
  VM_PHYSSEG_SPARSE, with the dense allocation still remaining for
  platforms with VM_PHYSSEG_DENSE.
  
  Reviewed by:  markj, alc, kib
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26130

Modified:
  head/sys/vm/vm_phys.h
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_phys.h
==
--- head/sys/vm/vm_phys.h   Mon Sep 21 22:22:06 2020(r365979)
+++ head/sys/vm/vm_phys.h   Mon Sep 21 22:22:53 2020(r365980)
@@ -69,6 +69,9 @@ struct vm_phys_seg {
vm_paddr_t  start;
vm_paddr_t  end;
vm_page_t   first_page;
+#if VM_NRESERVLEVEL > 0
+   vm_reserv_t first_reserv;
+#endif
int domain;
struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX];
 };

Modified: head/sys/vm/vm_reserv.c
==
--- head/sys/vm/vm_reserv.c Mon Sep 21 22:22:06 2020(r365979)
+++ head/sys/vm/vm_reserv.c Mon Sep 21 22:22:53 2020(r365980)
@@ -333,11 +333,17 @@ sysctl_vm_reserv_fullpop(SYSCTL_HANDLER_ARGS)
for (segind = 0; segind < vm_phys_nsegs; segind++) {
seg = _phys_segs[segind];
paddr = roundup2(seg->start, VM_LEVEL_0_SIZE);
+#ifdef VM_PHYSSEG_SPARSE
+   rv = seg->first_reserv + (paddr >> VM_LEVEL_0_SHIFT) -
+   (seg->start >> VM_LEVEL_0_SHIFT);
+#else
+   rv = _reserv_array[paddr >> VM_LEVEL_0_SHIFT];
+#endif
while (paddr + VM_LEVEL_0_SIZE > paddr && paddr +
VM_LEVEL_0_SIZE <= seg->end) {
-   rv = _reserv_array[paddr >> VM_LEVEL_0_SHIFT];
fullpop += rv->popcnt == VM_LEVEL_0_NPAGES;
paddr += VM_LEVEL_0_SIZE;
+   rv++;
}
}
return (sysctl_handle_int(oidp, , 0, req));
@@ -496,8 +502,15 @@ vm_reserv_depopulate(vm_reserv_t rv, int index)
 static __inline vm_reserv_t
 vm_reserv_from_page(vm_page_t m)
 {
+#ifdef VM_PHYSSEG_SPARSE
+   struct vm_phys_seg *seg;
 
+   seg = _phys_segs[m->segind];
+   return (seg->first_reserv + (VM_PAGE_TO_PHYS(m) >> VM_LEVEL_0_SHIFT) -
+   (seg->start >> VM_LEVEL_0_SHIFT));
+#else
return (_reserv_array[VM_PAGE_TO_PHYS(m) >> VM_LEVEL_0_SHIFT]);
+#endif
 }
 
 /*
@@ -1054,22 +1067,38 @@ vm_reserv_init(void)
struct vm_phys_seg *seg;
struct vm_reserv *rv;
struct vm_reserv_domain *rvd;
+#ifdef VM_PHYSSEG_SPARSE
+   vm_pindex_t used;
+#endif
int i, j, segind;
 
/*
 * Initialize the reservation array.  Specifically, initialize the
 * "pages" field for every element that has an underlying superpage.
 */
+#ifdef VM_PHYSSEG_SPARSE
+   used = 0;
+#endif
for (segind = 0; segind < vm_phys_nsegs; segind++) {
seg = _phys_segs[segind];
+#ifdef VM_PHYSSEG_SPARSE
+   seg->first_reserv = _reserv_array[used];
+   used += howmany(seg->end, VM_LEVEL_0_SIZE) -
+   seg->start / VM_LEVEL_0_SIZE;
+#else
+   seg->first_reserv =
+   _reserv_array[seg->start >> VM_LEVEL_0_SHIFT];
+#endif
paddr = roundup2(seg->start, VM_LEVEL_0_SIZE);
+   rv = seg->first_reserv + (paddr >> VM_LEVEL_0_SHIFT) -
+   (seg->start >> VM_LEVEL_0_SHIFT);
while (paddr + VM_LEVEL_0_SIZE > paddr && paddr +
VM_LEVEL_0_SIZE <= seg->end) {
-   rv = _reserv_array[paddr >> VM_LEVEL_0_SHIFT];
rv->pages = PHYS_TO_VM_PAGE(paddr);
rv->domain = seg->domain;
mtx_init(>lock, "vm reserv", NULL, MTX_DEF);
paddr += VM_LEVEL_0_SIZE;
+   rv++;
}
}
for (i = 0; i < MAXMEMDOM; i++) {
@@ -1400,30 +1429,40 @@ vm_reserv_size(int level)
 vm_paddr_t
 vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end)
 {
-   vm_paddr_t new_end, high_water;
+   vm_paddr_t new_end;
+   vm_pindex_t count;
size_t size;
int i;
 
-   high_water = 

svn commit: r365978 - in head: lib/libkvm sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/i386/i386 sys/i386/include sys/mips/include sys/mips/mi...

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:21:59 2020
New Revision: 365978
URL: https://svnweb.freebsd.org/changeset/base/365978

Log:
  Sparsify the vm_page_dump bitmap
  
  On Ampere Altra systems, the sparse population of RAM within the
  physical address space causes the vm_page_dump bitmap to be much
  larger than necessary, increasing the size from ~8 Mib to > 2 Gib
  (and overflowing `int` for the size).
  
  Changing the page dump bitmap also changes the minidump file
  format, so changes are also necessary in libkvm.
  
  Reviewed by:  jhb
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26131

Modified:
  head/lib/libkvm/kvm_minidump_aarch64.c
  head/lib/libkvm/kvm_minidump_amd64.c
  head/lib/libkvm/kvm_minidump_arm.c
  head/lib/libkvm/kvm_minidump_i386.c
  head/lib/libkvm/kvm_minidump_mips.c
  head/lib/libkvm/kvm_minidump_powerpc64.c
  head/lib/libkvm/kvm_minidump_riscv.c
  head/lib/libkvm/kvm_private.c
  head/lib/libkvm/kvm_private.h
  head/sys/amd64/amd64/minidump_machdep.c
  head/sys/amd64/include/minidump.h
  head/sys/arm/arm/minidump_machdep.c
  head/sys/arm/include/minidump.h
  head/sys/arm64/arm64/minidump_machdep.c
  head/sys/arm64/include/minidump.h
  head/sys/i386/i386/minidump_machdep_base.c
  head/sys/i386/include/minidump.h
  head/sys/mips/include/minidump.h
  head/sys/mips/mips/minidump_machdep.c
  head/sys/powerpc/include/minidump.h
  head/sys/powerpc/powerpc/minidump_machdep.c
  head/sys/riscv/include/minidump.h
  head/sys/riscv/riscv/minidump_machdep.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_phys.h

Modified: head/lib/libkvm/kvm_minidump_aarch64.c
==
--- head/lib/libkvm/kvm_minidump_aarch64.c  Mon Sep 21 22:20:37 2020
(r365977)
+++ head/lib/libkvm/kvm_minidump_aarch64.c  Mon Sep 21 22:21:59 2020
(r365978)
@@ -82,7 +82,7 @@ static int
 _aarch64_minidump_initvtop(kvm_t *kd)
 {
struct vmstate *vmst;
-   off_t off, sparse_off;
+   off_t off, dump_avail_off, sparse_off;
 
vmst = _kvm_malloc(kd, sizeof(*vmst));
if (vmst == NULL) {
@@ -102,7 +102,7 @@ _aarch64_minidump_initvtop(kvm_t *kd)
}
 
vmst->hdr.version = le32toh(vmst->hdr.version);
-   if (vmst->hdr.version != MINIDUMP_VERSION) {
+   if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) {
_kvm_err(kd, kd->program, "wrong minidump version. "
"Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version);
return (-1);
@@ -114,15 +114,21 @@ _aarch64_minidump_initvtop(kvm_t *kd)
vmst->hdr.dmapphys = le64toh(vmst->hdr.dmapphys);
vmst->hdr.dmapbase = le64toh(vmst->hdr.dmapbase);
vmst->hdr.dmapend = le64toh(vmst->hdr.dmapend);
+   vmst->hdr.dumpavailsize = vmst->hdr.version == MINIDUMP_VERSION ?
+   le32toh(vmst->hdr.dumpavailsize) : 0;
 
/* Skip header and msgbuf */
-   off = AARCH64_PAGE_SIZE + aarch64_round_page(vmst->hdr.msgbufsize);
+   dump_avail_off = AARCH64_PAGE_SIZE + 
aarch64_round_page(vmst->hdr.msgbufsize);
 
+   /* Skip dump_avail */
+   off = dump_avail_off + aarch64_round_page(vmst->hdr.dumpavailsize);
+
/* build physical address lookup table for sparse pages */
sparse_off = off + aarch64_round_page(vmst->hdr.bitmapsize) +
aarch64_round_page(vmst->hdr.pmapsize);
-   if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off,
-   AARCH64_PAGE_SIZE, sizeof(uint64_t)) == -1) {
+   if (_kvm_pt_init(kd, vmst->hdr.dumpavailsize, dump_avail_off,
+   vmst->hdr.bitmapsize, off, sparse_off, AARCH64_PAGE_SIZE,
+   sizeof(uint64_t)) == -1) {
return (-1);
}
off += aarch64_round_page(vmst->hdr.bitmapsize);
@@ -257,7 +263,9 @@ _aarch64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages
}
 
while (_kvm_bitmap_next(, )) {
-   pa = bmindex * AARCH64_PAGE_SIZE;
+   pa = _kvm_bit_id_pa(kd, bmindex, AARCH64_PAGE_SIZE);
+   if (pa == _KVM_PA_INVALID)
+   break;
dva = vm->hdr.dmapbase + pa;
if (vm->hdr.dmapend < (dva + AARCH64_PAGE_SIZE))
break;

Modified: head/lib/libkvm/kvm_minidump_amd64.c
==
--- head/lib/libkvm/kvm_minidump_amd64.cMon Sep 21 22:20:37 2020
(r365977)
+++ head/lib/libkvm/kvm_minidump_amd64.cMon Sep 21 22:21:59 2020
(r365978)
@@ -123,7 +123,7 @@ static int
 _amd64_minidump_initvtop(kvm_t *kd)
 {
struct vmstate *vmst;
-   off_t off, sparse_off;
+   off_t off, dump_avail_off, sparse_off;
 
vmst = _kvm_malloc(kd, sizeof(*vmst));
if (vmst == NULL) {
@@ -143,10 +143,10 @@ 

svn commit: r365979 - stable/12/sys/cddl/compat/opensolaris/kern

2020-09-21 Thread Mark Johnston
Author: markj
Date: Mon Sep 21 22:22:06 2020
New Revision: 365979
URL: https://svnweb.freebsd.org/changeset/base/365979

Log:
  Mark sysctls added in r365689 as MPSAFE.
  
  This is a direct commit to stable/12.
  
  Reviewed by:  allanjude
  Differential Revision:https://reviews.freebsd.org/D26507

Modified:
  stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c

Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
==
--- stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c  Mon Sep 
21 22:21:59 2020(r365978)
+++ stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c  Mon Sep 
21 22:22:06 2020(r365979)
@@ -184,16 +184,16 @@ kstat_install(kstat_t *ksp)
SYSCTL_ADD_PROC(>ks_sysctl_ctx,
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
OID_AUTO, ksent->name,
-   CTLTYPE_STRING | CTLFLAG_RD, ksp, i,
-   kstat_sysctl_string, "A", ksent->desc);
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   ksp, i, kstat_sysctl_string, "A", ksent->desc);
continue;
}
KASSERT(ksent->data_type == KSTAT_DATA_UINT64,
("data_type=%d", ksent->data_type));
SYSCTL_ADD_PROC(>ks_sysctl_ctx,
SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name,
-   CTLTYPE_U64 | CTLFLAG_RD, ksp, i,
-   kstat_sysctl, "QU", ksent->desc);
+   CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   ksp, i, kstat_sysctl, "QU", ksent->desc);
}
 }
 
___
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: r365977 - in head: . sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/i386/i386 sys/i386/include sys/mips/include sys/mips/mips sys/po...

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:20:37 2020
New Revision: 365977
URL: https://svnweb.freebsd.org/changeset/base/365977

Log:
  Move vm_page_dump bitset array definition to MI code
  
  These definitions were repeated by all architectures, with small
  variations. Consolidate the common definitons in machine
  independent code and use bitset(9) macros for manipulation. Many
  opportunities for deduplication remain in the machine dependent
  minidump logic. The only intended functional change is increasing
  the bit index type to vm_pindex_t, allowing the indexing of pages
  with address of 8 TiB and greater.
  
  Reviewed by:  kib, markj
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26129

Modified:
  head/.clang-format
  head/sys/amd64/amd64/minidump_machdep.c
  head/sys/amd64/include/md_var.h
  head/sys/amd64/include/vmparam.h
  head/sys/arm/arm/minidump_machdep.c
  head/sys/arm/include/md_var.h
  head/sys/arm/include/vmparam.h
  head/sys/arm64/arm64/minidump_machdep.c
  head/sys/arm64/include/md_var.h
  head/sys/arm64/include/vmparam.h
  head/sys/i386/i386/minidump_machdep.c
  head/sys/i386/i386/minidump_machdep_base.c
  head/sys/i386/include/md_var.h
  head/sys/i386/include/vmparam.h
  head/sys/mips/include/md_var.h
  head/sys/mips/include/vmparam.h
  head/sys/mips/mips/minidump_machdep.c
  head/sys/powerpc/include/md_var.h
  head/sys/powerpc/include/vmparam.h
  head/sys/powerpc/powerpc/minidump_machdep.c
  head/sys/riscv/include/md_var.h
  head/sys/riscv/include/vmparam.h
  head/sys/riscv/riscv/minidump_machdep.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/x86/include/x86_var.h

Modified: head/.clang-format
==
--- head/.clang-format  Mon Sep 21 22:19:21 2020(r365976)
+++ head/.clang-format  Mon Sep 21 22:20:37 2020(r365977)
@@ -76,6 +76,7 @@ ForEachMacros:
   - TAILQ_FOREACH_REVERSE_SAFE
   - TAILQ_FOREACH_SAFE
   - VM_MAP_ENTRY_FOREACH
+  - VM_PAGE_DUMP_FOREACH
 IndentCaseLabels: false
 IndentPPDirectives: None
 Language: Cpp

Modified: head/sys/amd64/amd64/minidump_machdep.c
==
--- head/sys/amd64/amd64/minidump_machdep.c Mon Sep 21 22:19:21 2020
(r365976)
+++ head/sys/amd64/amd64/minidump_machdep.c Mon Sep 21 22:20:37 2020
(r365977)
@@ -54,9 +54,6 @@ __FBSDID("$FreeBSD$");
 
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
-uint64_t *vm_page_dump;
-int vm_page_dump_size;
-
 static struct kerneldumpheader kdh;
 
 /* Handle chunked writes. */
@@ -64,7 +61,6 @@ static size_t fragsz;
 static void *dump_va;
 static size_t counter, progress, dumpsize, wdog_next;
 
-CTASSERT(sizeof(*vm_page_dump) == 8);
 static int dump_retry_count = 5;
 SYSCTL_INT(_machdep, OID_AUTO, dump_retry_count, CTLFLAG_RWTUN,
 _retry_count, 0, "Number of times dump has to retry before bailing 
out");
@@ -223,9 +219,8 @@ minidumpsys(struct dumperinfo *di)
uint32_t pmapsize;
vm_offset_t va;
int error;
-   uint64_t bits;
uint64_t *pml4, *pdp, *pd, *pt, pa;
-   int i, ii, j, k, n, bit;
+   int i, ii, j, k, n;
int retry_count;
struct minidumphdr mdhdr;
 
@@ -304,19 +299,13 @@ minidumpsys(struct dumperinfo *di)
/* Calculate dump size. */
dumpsize = pmapsize;
dumpsize += round_page(msgbufp->msg_size);
-   dumpsize += round_page(vm_page_dump_size);
-   for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) {
-   bits = vm_page_dump[i];
-   while (bits) {
-   bit = bsfq(bits);
-   pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + 
bit) * PAGE_SIZE;
-   /* Clear out undumpable pages now if needed */
-   if (is_dumpable(pa)) {
-   dumpsize += PAGE_SIZE;
-   } else {
-   dump_drop_page(pa);
-   }
-   bits &= ~(1ul << bit);
+   dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
+   VM_PAGE_DUMP_FOREACH(pa) {
+   /* Clear out undumpable pages now if needed */
+   if (is_dumpable(pa)) {
+   dumpsize += PAGE_SIZE;
+   } else {
+   dump_drop_page(pa);
}
}
dumpsize += PAGE_SIZE;
@@ -328,7 +317,7 @@ minidumpsys(struct dumperinfo *di)
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
mdhdr.msgbufsize = msgbufp->msg_size;
-   mdhdr.bitmapsize = vm_page_dump_size;
+   mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.pmapsize = pmapsize;
mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
mdhdr.dmapbase = 

svn commit: r365975 - in head: share/man/man9 sys/sys

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:19:12 2020
New Revision: 365975
URL: https://svnweb.freebsd.org/changeset/base/365975

Log:
  bitset: expand bit index type to `long`
  
  An upcoming patch to use the bitset macros for tracking vm page
  dump information could conceivably need more than INT_MAX bits.
  Expand the bit type to long so that the extra range is available
  on 64-bit platforms where it would most likely be needed.
  
  CPUSET_COUNT and DOMAINSET_COUNT are also modified to remain of
  type `int`.
  
  Reviewed by:  kib, markj
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26190

Modified:
  head/share/man/man9/bitset.9
  head/sys/sys/bitset.h
  head/sys/sys/cpuset.h
  head/sys/sys/domainset.h

Modified: head/share/man/man9/bitset.9
==
--- head/share/man/man9/bitset.9Mon Sep 21 22:18:09 2020
(r365974)
+++ head/share/man/man9/bitset.9Mon Sep 21 22:19:12 2020
(r365975)
@@ -84,13 +84,13 @@
 .Fn BIT_EMPTY "const SETSIZE" "struct STRUCTNAME *bitset"
 .Ft bool
 .Fn BIT_ISFULLSET "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft int
+.Ft long
 .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft int
-.Fn BIT_FFS_AT "const SETSIZE" "struct STRUCTNAME *bitset" "int start"
-.Ft int
+.Ft long
+.Fn BIT_FFS_AT "const SETSIZE" "struct STRUCTNAME *bitset" "long start"
+.Ft long
 .Fn BIT_FLS "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft int
+.Ft long
 .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset"
 .\"
 .Ft bool

Modified: head/sys/sys/bitset.h
==
--- head/sys/sys/bitset.h   Mon Sep 21 22:18:09 2020(r365974)
+++ head/sys/sys/bitset.h   Mon Sep 21 22:19:12 2020(r365975)
@@ -213,8 +213,7 @@
  */
 #defineBIT_FFS_AT(_s, p, start) __extension__ ({   
\
__size_t __i;   \
-   long __mask;\
-   int __bit;  \
+   long __bit, __mask; \
\
__mask = ~0UL << ((start) % _BITSET_BITS);  \
__bit = 0;  \
@@ -235,7 +234,7 @@
 
 #defineBIT_FLS(_s, p) __extension__ ({ 
\
__size_t __i;   \
-   int __bit;  \
+   long __bit; \
\
__bit = 0;  \
for (__i = __bitset_words((_s)); __i > 0; __i--) {  \
@@ -250,7 +249,7 @@
 
 #defineBIT_COUNT(_s, p) __extension__ ({   
\
__size_t __i;   \
-   int __count;\
+   long __count;   \
\
__count = 0;\
for (__i = 0; __i < __bitset_words((_s)); __i++)\

Modified: head/sys/sys/cpuset.h
==
--- head/sys/sys/cpuset.h   Mon Sep 21 22:18:09 2020(r365974)
+++ head/sys/sys/cpuset.h   Mon Sep 21 22:19:12 2020(r365975)
@@ -65,7 +65,7 @@
 #defineCPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s)
 #defineCPU_COPY_STORE_REL(f, t)BIT_COPY_STORE_REL(CPU_SETSIZE, 
f, t)
 #defineCPU_FFS(p)  BIT_FFS(CPU_SETSIZE, p)
-#defineCPU_COUNT(p)BIT_COUNT(CPU_SETSIZE, p)
+#defineCPU_COUNT(p)((int)BIT_COUNT(CPU_SETSIZE, p))
 #defineCPUSET_FSET BITSET_FSET(_NCPUWORDS)
 #defineCPUSET_T_INITIALIZERBITSET_T_INITIALIZER
 

Modified: head/sys/sys/domainset.h
==
--- head/sys/sys/domainset.hMon Sep 21 22:18:09 2020(r365974)
+++ head/sys/sys/domainset.hMon Sep 21 22:19:12 2020(r365975)
@@ -68,7 +68,7 @@
BIT_COPY_STORE_REL(DOMAINSET_SETSIZE, f, t)
 #defineDOMAINSET_FFS(p)BIT_FFS(DOMAINSET_SETSIZE, p)
 #defineDOMAINSET_FLS(p)BIT_FLS(DOMAINSET_SETSIZE, p)
-#defineDOMAINSET_COUNT(p) 

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

2020-09-21 Thread Mark Johnston
Author: markj
Date: Mon Sep 21 22:19:21 2020
New Revision: 365976
URL: https://svnweb.freebsd.org/changeset/base/365976

Log:
  Weaken assertions in pmap_l1_to_l2() and pmap_l2_to_l3().
  
  pmap_update_entry() will temporarily clear the valid bit of page table
  entries in order to satisfy the arm64 pmap's break-before-make
  constraint.  pmap_kextract() may operate concurrently on kernel page
  table pages, introducing windows where the assertions added in r365879
  may fail incorrectly since they implicitly assert that the valid bit is
  set.  Modify the assertions to handle this.
  
  Reviewed by:  andrew, mmel (previous version)
  Reviewed by:  alc, kib
  Reported by:  mmel, scottph
  MFC with: r365879

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Sep 21 22:19:12 2020(r365975)
+++ head/sys/arm64/arm64/pmap.c Mon Sep 21 22:19:21 2020(r365976)
@@ -438,8 +438,15 @@ pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va)
pd_entry_t l1, *l2p;
 
l1 = pmap_load(l1p);
-   KASSERT((l1 & ATTR_DESCR_MASK) == L1_TABLE,
-   ("%s: L1 entry %#lx is a leaf", __func__, l1));
+
+   /*
+* The valid bit may be clear if pmap_update_entry() is concurrently
+* modifying the entry, so for KVA only the entry type may be checked.
+*/
+   KASSERT(va >= VM_MAX_USER_ADDRESS || (l1 & ATTR_DESCR_VALID) != 0,
+   ("%s: L1 entry %#lx for %#lx is invalid", __func__, l1, va));
+   KASSERT((l1 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE,
+   ("%s: L1 entry %#lx for %#lx is a leaf", __func__, l1, va));
l2p = (pd_entry_t *)PHYS_TO_DMAP(l1 & ~ATTR_MASK);
return ([pmap_l2_index(va)]);
 }
@@ -463,8 +470,15 @@ pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va)
pt_entry_t *l3p;
 
l2 = pmap_load(l2p);
-   KASSERT((l2 & ATTR_DESCR_MASK) == L2_TABLE,
-   ("%s: L2 entry %#lx is a leaf", __func__, l2));
+
+   /*
+* The valid bit may be clear if pmap_update_entry() is concurrently
+* modifying the entry, so for KVA only the entry type may be checked.
+*/
+   KASSERT(va >= VM_MAX_USER_ADDRESS || (l2 & ATTR_DESCR_VALID) != 0,
+   ("%s: L2 entry %#lx for %#lx is invalid", __func__, l2, va));
+   KASSERT((l2 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE,
+   ("%s: L2 entry %#lx for %#lx is a leaf", __func__, l2, va));
l3p = (pt_entry_t *)PHYS_TO_DMAP(l2 & ~ATTR_MASK);
return ([pmap_l3_index(va)]);
 }
___
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: r365974 - head/sys/contrib/vchiq/interface/vchiq_arm

2020-09-21 Thread D Scott Phillips
Author: scottph
Date: Mon Sep 21 22:18:09 2020
New Revision: 365974
URL: https://svnweb.freebsd.org/changeset/base/365974

Log:
  vchi: rename bitset macros to avoid collision with bitset(9)
  
  An upcoming change to include bitset(9) macros from vm_page.h
  causes a macro name collision with vchi's custom bitset macros.
  
  This change was performed mechanically by:
  
sed -i .orig s/BITSET/VCHI_BITSET/g $(grep -rl BITSET sys/contrib/vchiq)
  
  Reviewed by:  andrew
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26177

Modified:
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h

Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c
==
--- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Mon Sep 21 
20:02:26 2020(r365973)
+++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Mon Sep 21 
22:18:09 2020(r365974)
@@ -619,7 +619,7 @@ static void
 process_free_queue(VCHIQ_STATE_T *state)
 {
VCHIQ_SHARED_STATE_T *local = state->local;
-   BITSET_T service_found[BITSET_SIZE(VCHIQ_MAX_SERVICES)];
+   VCHI_BITSET_T service_found[VCHI_BITSET_SIZE(VCHIQ_MAX_SERVICES)];
int slot_queue_available;
 
/* Find slots which have been freed by the other side, and return them
@@ -646,7 +646,7 @@ process_free_queue(VCHIQ_STATE_T *state)
 
/* Initialise the bitmask for services which have used this
** slot */
-   BITSET_ZERO(service_found);
+   VCHI_BITSET_ZERO(service_found);
 
pos = 0;
 
@@ -686,9 +686,9 @@ process_free_queue(VCHIQ_STATE_T *state)
header->size);
WARN(1, "invalid message use count\n");
}
-   if (!BITSET_IS_SET(service_found, port)) {
+   if (!VCHI_BITSET_IS_SET(service_found, port)) {
/* Set the found bit for this service */
-   BITSET_SET(service_found, port);
+   VCHI_BITSET_SET(service_found, port);
 
spin_lock(_spinlock);
count = service_quota->slot_use_count;
@@ -1276,7 +1276,7 @@ poll_services(VCHIQ_STATE_T *state)
 {
int group, i;
 
-   for (group = 0; group < BITSET_SIZE(state->unused_service); group++) {
+   for (group = 0; group < VCHI_BITSET_SIZE(state->unused_service); 
group++) {
uint32_t flags;
flags = atomic_xchg(>poll_services[group], 0);
for (i = 0; flags; i++) {

Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h
==
--- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Sep 21 
20:02:26 2020(r365973)
+++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Sep 21 
22:18:09 2020(r365974)
@@ -141,17 +141,17 @@ vchiq_static_assert((unsigned int)VCHIQ_PORT_MAX <
 
 #define VCHIQ_BULK_ACTUAL_ABORTED -1
 
-typedef uint32_t BITSET_T;
+typedef uint32_t VCHI_BITSET_T;
 
-vchiq_static_assert((sizeof(BITSET_T) * 8) == 32);
+vchiq_static_assert((sizeof(VCHI_BITSET_T) * 8) == 32);
 
-#define BITSET_SIZE(b)((b + 31) >> 5)
-#define BITSET_WORD(b)(b >> 5)
-#define BITSET_BIT(b) (1 << (b & 31))
-#define BITSET_ZERO(bs)   memset(bs, 0, sizeof(bs))
-#define BITSET_IS_SET(bs, b)  (bs[BITSET_WORD(b)] & BITSET_BIT(b))
-#define BITSET_SET(bs, b) (bs[BITSET_WORD(b)] |= BITSET_BIT(b))
-#define BITSET_CLR(bs, b) (bs[BITSET_WORD(b)] &= ~BITSET_BIT(b))
+#define VCHI_BITSET_SIZE(b)((b + 31) >> 5)
+#define VCHI_BITSET_WORD(b)(b >> 5)
+#define VCHI_BITSET_BIT(b) (1 << (b & 31))
+#define VCHI_BITSET_ZERO(bs)   memset(bs, 0, sizeof(bs))
+#define VCHI_BITSET_IS_SET(bs, b)  (bs[VCHI_BITSET_WORD(b)] & 
VCHI_BITSET_BIT(b))
+#define VCHI_BITSET_SET(bs, b) (bs[VCHI_BITSET_WORD(b)] |= 
VCHI_BITSET_BIT(b))
+#define VCHI_BITSET_CLR(bs, b) (bs[VCHI_BITSET_WORD(b)] &= 
~VCHI_BITSET_BIT(b))
 
 #if VCHIQ_ENABLE_STATS
 #define VCHIQ_STATS_INC(state, stat) (state->stats. stat++)
@@ -478,7 +478,7 @@ struct vchiq_state_struct {
unsigned short data_quota;
 
/* An array of bit sets indicating which services must be polled. */
-   atomic_t poll_services[BITSET_SIZE(VCHIQ_MAX_SERVICES)];
+   atomic_t poll_services[VCHI_BITSET_SIZE(VCHIQ_MAX_SERVICES)];
 
/* The number of the first unused service */
int unused_service;
___

Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-21 Thread Gleb Smirnoff
  Mateusz,

On Fri, Sep 04, 2020 at 02:15:04PM -0400, Andrew Gallatin wrote:
A> I do the upstream sync between the Netflix tree and
A> FreeBSD-current about every 3 weeks (unless glebius beats
A> me to the punch and does it first :).  I anticipate that
A> this blank line sweep will cause lots of conflicts for us.
A> I understand this is progress, and I don't object, and I'm
A> not asking for a revert, but please understand that cleanups
A> like this do have hidden costs.  I expect that other commercial
A> entities who contribute to FreeBSD will have the same issue,
A> and I also anticipate it will cause problems with MFCs

sorry for chiming in late, but I'm about to bump at this change.

An advice for future sweeps like that. Include the script you
used for the sweep into the commit message. Then, mergers, like
me, will run same script on their tree before doing a merge and
there will be no conflict.

Example commit: https://svnweb.freebsd.org/base?view=revision=360579

-- 
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: r365973 - in head/sys: net net/route netinet netinet6

2020-09-21 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Sep 21 20:02:26 2020
New Revision: 365973
URL: https://svnweb.freebsd.org/changeset/base/365973

Log:
  Rework part of routing code to reduce difference to D26449.
  
  * Split rt_setmetrics into get_info_weight() and rt_set_expire_info(),
   as these two can be applied at different entities and at different times.
  * Start filling route weight in route change notifications
  * Pass flowid to UDP/raw IP route lookups
  * Rework nd6_subscription_cb() and sysctl_dumpentry() to prepare for the fact
   that rtentry can contain multiple nexthops.
  
  Differential Revision:https://reviews.freebsd.org/D26497

Modified:
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/route/route_ctl.c
  head/sys/net/route/route_var.h
  head/sys/net/rtsock.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/nd6.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cMon Sep 21 19:50:39 2020(r365972)
+++ head/sys/net/route.cMon Sep 21 20:02:26 2020(r365973)
@@ -849,18 +849,6 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin
 #endif
 
 void
-rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt)
-{
-
-   if (info->rti_mflags & RTV_WEIGHT)
-   rt->rt_weight = info->rti_rmx->rmx_weight;
-   /* Kernel -> userland timebase conversion. */
-   if (info->rti_mflags & RTV_EXPIRE)
-   rt->rt_expire = info->rti_rmx->rmx_expire ?
-   info->rti_rmx->rmx_expire - time_second + time_uptime : 0;
-}
-
-void
 rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr 
*netmask)
 {
u_char *cp1 = (u_char *)src;

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hMon Sep 21 19:50:39 2020(r365972)
+++ head/sys/net/route.hMon Sep 21 20:02:26 2020(r365973)
@@ -104,6 +104,10 @@ struct rt_metrics {
 /* lle state is exported in rmx_state rt_metrics field */
 #definermx_state   rmx_weight
 
+/* default route weight */
+#defineRT_DEFAULT_WEIGHT   1
+#defineRT_MAX_WEIGHT   16777215/* 3 bytes */
+
 /*
  * Keep a generation count of routing table, incremented on route addition,
  * so we can invalidate caches.  This is accessed without a lock, as precision

Modified: head/sys/net/route/route_ctl.c
==
--- head/sys/net/route/route_ctl.c  Mon Sep 21 19:50:39 2020
(r365972)
+++ head/sys/net/route/route_ctl.c  Mon Sep 21 20:02:26 2020
(r365973)
@@ -175,6 +175,32 @@ get_rnh(uint32_t fibnum, const struct rt_addrinfo *inf
return (rnh);
 }
 
+static int
+get_info_weight(const struct rt_addrinfo *info, uint32_t default_weight)
+{
+   uint32_t weight;
+
+   if (info->rti_mflags & RTV_WEIGHT)
+   weight = info->rti_rmx->rmx_weight;
+   else
+   weight = default_weight;
+   /* Keep upper 1 byte for adm distance purposes */
+   if (weight > RT_MAX_WEIGHT)
+   weight = RT_MAX_WEIGHT;
+
+   return (weight);
+}
+
+static void
+rt_set_expire_info(struct rtentry *rt, const struct rt_addrinfo *info)
+{
+
+   /* Kernel -> userland timebase conversion. */
+   if (info->rti_mflags & RTV_EXPIRE)
+   rt->rt_expire = info->rti_rmx->rmx_expire ?
+   info->rti_rmx->rmx_expire - time_second + time_uptime : 0;
+}
+
 /*
  * Check if specified @gw matches gw data in the nexthop @nh.
  *
@@ -423,10 +449,9 @@ create_rtentry(struct rib_head *rnh, struct rt_addrinf
 * examine the ifa and  ifa->ifa_ifp if it so desires.
 */
ifa = info->rti_ifa;
-   rt->rt_weight = 1;
+   rt->rt_weight = get_info_weight(info, RT_DEFAULT_WEIGHT);
+   rt_set_expire_info(rt, info);
 
-   rt_setmetrics(info, rt);
-
*prt = rt;
return (0);
 }
@@ -815,7 +840,7 @@ change_route_nhop(struct rib_head *rnh, struct rtentry
 
if (rnd->rnd_nhop != NULL) {
/* Changing expiration & nexthop & weight to a new one */
-   rt_setmetrics(info, rt);
+   rt_set_expire_info(rt, info);
rt->rt_nhop = rnd->rnd_nhop;
rt->rt_weight = rnd->rnd_weight;
if (rt->rt_expire > 0)

Modified: head/sys/net/route/route_var.h
==
--- head/sys/net/route/route_var.h  Mon Sep 21 19:50:39 2020
(r365972)
+++ head/sys/net/route/route_var.h  Mon Sep 21 20:02:26 2020
(r365973)
@@ -115,7 +115,6 @@ _Static_assert(__offsetof(struct route, ro_dst) == __o
 struct rib_head *rt_tables_get_rnh(uint32_t table, sa_family_t family);
 void rt_mpath_init_rnh(struct rib_head *rnh);
 int rt_getifa_fib(struct rt_addrinfo 

svn commit: r365972 - head/tools/bsdbox

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Mon Sep 21 19:50:39 2020
New Revision: 365972
URL: https://svnweb.freebsd.org/changeset/base/365972

Log:
  bsdbox: fix build after recent libifconfig changes
  
  libifconfig now generates file(s) into its .OBJDIR that are essential to the
  build. Make sure we -I that in, like we already do in the ^/rescue build.

Modified:
  head/tools/bsdbox/Makefile

Modified: head/tools/bsdbox/Makefile
==
--- head/tools/bsdbox/Makefile  Mon Sep 21 19:25:41 2020(r365971)
+++ head/tools/bsdbox/Makefile  Mon Sep 21 19:50:39 2020(r365972)
@@ -74,6 +74,7 @@ CRUNCH_LIBS+= -l80211 -lalias -lcam -lcursesw -ldevsta
 # Don't forget this - ifconfig, etc -adrian
 CRUNCH_LIBS+= ${LDADD_ifconfig}
 CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs
+CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS+=-I${OBJTOP}/lib/libifconfig
 
 ##
 # Programs from stock /usr/bin
___
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: r365249 - head

2020-09-21 Thread Slawa Olhovchenkov
On Wed, Sep 02, 2020 at 11:53:57AM -0400, Ryan Moeller wrote:

> 
> On 9/2/20 11:43 AM, Andriy Gapon wrote:
> > On 02/09/2020 18:23, Ryan Moeller wrote:
> >> On 9/2/20 10:28 AM, Warner Losh wrote:
> >>> Author: imp
> >>> Date: Wed Sep  2 14:28:54 2020
> >>> New Revision: 365249
> >>> URL: https://svnweb.freebsd.org/changeset/base/365249
> >>>
> >>> Log:
> >>>     Add note about needing to manually import the zfs pools or update
> >>>     /etc/rc.d due to the cache file moving to /etc.
> >>>
> >>> Modified:
> >>>     head/UPDATING
> >>>
> >>> Modified: head/UPDATING
> >>> ==
> >>> --- head/UPDATING    Wed Sep  2 12:57:34 2020    (r365248)
> >>> +++ head/UPDATING    Wed Sep  2 14:28:54 2020    (r365249)
> >>> @@ -36,6 +36,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
> >>>    scenarios have been tested and fixed, but rebuilding kernels 
> >>> without
> >>>    rebuilding world may fail.
> >>>    +    The ZFS cache file has moved from /boot to /etc to match the 
> >>> OpenZFS
> >>> +    upstream default. This means your zpool won't auto import until you
> >>> +    upgrade your /etc/rc.d files or you import them manually.
> >>> +
> >>>    20200824:
> >>>    The resume code now notifies devd with the 'kernel' system
> >>>    rather than the old 'kern' subsystem to be consistent with
> >> Thanks, enough people seemed to be getting tripped up by this.
> > I think that this is a very useful note.
> >
> > But I do not see a direct connection between the change of zpool.cache 
> > location
> > and the new ZFS's not automatically importing zpool.cache pools on boot.
> >
> 
> True, the real reason is that the kernel module in OpenZFS does not 
> autoimport pools.
> Instead we explicitly "zpool import -a" in one of the ZFS rc scripts. 

Is posible to restore old behavior?
___
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: r365971 - stable/12/sbin/newfs

2020-09-21 Thread Kirk McKusick
Author: mckusick
Date: Mon Sep 21 19:25:41 2020
New Revision: 365971
URL: https://svnweb.freebsd.org/changeset/base/365971

Log:
  MFC of 365700
  
  Switch to more appropriate libufs interfaces in newfs.
  
  Sponsored by: Netflix

Modified:
  stable/12/sbin/newfs/mkfs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/newfs/mkfs.c
==
--- stable/12/sbin/newfs/mkfs.c Mon Sep 21 19:03:17 2020(r365970)
+++ stable/12/sbin/newfs/mkfs.c Mon Sep 21 19:25:41 2020(r365971)
@@ -544,8 +544,8 @@ restart:
}
}
}
-   if (!Nflag && sbput(disk.d_fd, _fs, 0) != 0)
-   err(1, "sbput: %s", disk.d_error);
+   if (!Nflag && sbwrite(, 0) != 0)
+   err(1, "sbwrite: %s", disk.d_error);
if (Xflag == 1) {
printf("** Exiting on Xflag 1\n");
exit(0);
@@ -611,8 +611,8 @@ restart:
 * Reference the summary information so it will also be written.
 */
sblock.fs_csp = fscs;
-   if (sbput(disk.d_fd, _fs, 0) != 0)
-   err(1, "sbput: %s", disk.d_error);
+   if (sbwrite(, 0) != 0)
+   err(1, "sbwrite: %s", disk.d_error);
/*
 * For UFS1 filesystems with a blocksize of 64K, the first
 * alternate superblock resides at the location used for
@@ -803,11 +803,11 @@ initcg(int cylno, time_t utime)
savedactualloc = sblock.fs_sblockactualloc;
sblock.fs_sblockactualloc =
dbtob(fsbtodb(, cgsblock(, cylno)));
-   if (sbput(disk.d_fd, _fs, 0) != 0)
-   err(1, "sbput: %s", disk.d_error);
+   if (sbwrite(, 0) != 0)
+   err(1, "sbwrite: %s", disk.d_error);
sblock.fs_sblockactualloc = savedactualloc;
-   if (cgput(, ) != 0)
-   err(1, "initcg: cgput: %s", disk.d_error);
+   if (cgwrite() != 0)
+   err(1, "initcg: cgwrite: %s", disk.d_error);
start = 0;
dp1 = (struct ufs1_dinode *)([start]);
dp2 = (struct ufs2_dinode *)([start]);
@@ -1016,8 +1016,8 @@ goth:
for (i = frag; i < sblock.fs_frag; i++)
setbit(cg_blksfree(), d + i);
}
-   if (cgput(, ) != 0)
-   err(1, "alloc: cgput: %s", disk.d_error);
+   if (cgwrite() != 0)
+   err(1, "alloc: cgwrite: %s", disk.d_error);
return ((ufs2_daddr_t)d);
 }
 
@@ -1037,8 +1037,8 @@ iput(union dinode *ip, ino_t ino)
}
acg.cg_cs.cs_nifree--;
setbit(cg_inosused(), ino);
-   if (cgput(, ) != 0)
-   err(1, "iput: cgput: %s", disk.d_error);
+   if (cgwrite() != 0)
+   err(1, "iput: cgwrite: %s", disk.d_error);
sblock.fs_cstotal.cs_nifree--;
fscs[0].cs_nifree--;
if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) {
___
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: r365969 - head/contrib/one-true-awk

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 19:03:12 2020
New Revision: 365969
URL: https://svnweb.freebsd.org/changeset/base/365969

Log:
  Fix another UBSan error in awk
  
  This applies my upstreamed fix: 
https://github.com/onetrueawk/awk/commit/ad9bd2f40a89ec9533b92254b86a756cf4f40fd4
  Found By: UBSan

Modified:
  head/contrib/one-true-awk/lex.c

Modified: head/contrib/one-true-awk/lex.c
==
--- head/contrib/one-true-awk/lex.c Mon Sep 21 19:03:07 2020
(r365968)
+++ head/contrib/one-true-awk/lex.c Mon Sep 21 19:03:12 2020
(r365969)
@@ -467,9 +467,8 @@ int word(char *w) 
int c, n;
 
n = binsearch(w, keywords, sizeof(keywords)/sizeof(keywords[0]));
-/* BUG: this ought to be inside the if; in theory could fault (daniel barrett) 
*/
-   kp = keywords + n;
if (n != -1) {  /* found in table */
+   kp = keywords + n;
yylval.i = kp->sub;
switch (kp->type) { /* special handling */
case BLTIN:
___
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: r365970 - head/usr.bin/mkcsmapper

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 19:03:17 2020
New Revision: 365970
URL: https://svnweb.freebsd.org/changeset/base/365970

Log:
  mkcsmapper: Fix UBSan signed shift error
  
  usr.bin/mkcsmapper/yacc.y:466:18: runtime error: left shift of 1 by 31 places 
cannot be represented in type 'int'

Modified:
  head/usr.bin/mkcsmapper/yacc.y

Modified: head/usr.bin/mkcsmapper/yacc.y
==
--- head/usr.bin/mkcsmapper/yacc.y  Mon Sep 21 19:03:12 2020
(r365969)
+++ head/usr.bin/mkcsmapper/yacc.y  Mon Sep 21 19:03:17 2020
(r365970)
@@ -463,7 +463,7 @@ set_src_zone(u_int32_t val)
default: 
goto bad;
}
-   rowcol_mask = 1 << (rowcol_bits - 1);
+   rowcol_mask = 1u << (rowcol_bits - 1);
rowcol_mask |= rowcol_mask - 1;
for (i = 0; i < rowcol_len; ++i) {
p = [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"


svn commit: r365968 - head/contrib/one-true-awk

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 19:03:07 2020
New Revision: 365968
URL: https://svnweb.freebsd.org/changeset/base/365968

Log:
  awk: Fix subobject out-of-bounds access
  
  When matching a regex with ^, it would attempt to access
  gototab[NSTATES][NCHARS+2], and therefore access the state for the \002
  character instead. This change is required to run awk under CHERI (with
  sub-object bounds) and when running with UBSan instrumentation.
  
  This was committed upstream as 
https://github.com/onetrueawk/awk/commit/cbf924342b63a095a4c6842280c3085b1b63ae45
  
  Found by: CHERI (with subobject bounds enabled)
  Obtained from:CheriBSD
  Reviewed By:  imp
  Differential Revision: https://reviews.freebsd.org/D26509

Modified:
  head/contrib/one-true-awk/awk.h
  head/contrib/one-true-awk/b.c

Modified: head/contrib/one-true-awk/awk.h
==
--- head/contrib/one-true-awk/awk.h Mon Sep 21 18:34:13 2020
(r365967)
+++ head/contrib/one-true-awk/awk.h Mon Sep 21 19:03:07 2020
(r365968)
@@ -218,6 +218,8 @@ extern  int pairstack[], paircnt;
 #define NCHARS (256+3) /* 256 handles 8-bit chars; 128 does 7-bit */
/* watch out in match(), etc. */
 #define NSTATES32
+#defineHAT (NCHARS+2)  /* matches ^ in regular expr */
+   /* NCHARS is 2**n */
 
 typedef struct rrow {
longltype;  /* long avoids pointer warnings on 64-bit */
@@ -230,7 +232,7 @@ typedef struct rrow {
 } rrow;
 
 typedef struct fa {
-   uschar  gototab[NSTATES][NCHARS];
+   uschar  gototab[NSTATES][HAT + 1];
uschar  out[NSTATES];
uschar  *restr;
int *posns[NSTATES];

Modified: head/contrib/one-true-awk/b.c
==
--- head/contrib/one-true-awk/b.c   Mon Sep 21 18:34:13 2020
(r365967)
+++ head/contrib/one-true-awk/b.c   Mon Sep 21 19:03:07 2020
(r365968)
@@ -37,8 +37,6 @@ __FBSDID("$FreeBSD$");
 #include "awk.h"
 #include "ytab.h"
 
-#defineHAT (NCHARS+2)  /* matches ^ in regular expr */
-   /* NCHARS is 2**n */
 #define MAXLIN 22
 
 #define type(v)(v)->nobj   /* badly overloaded here */
___
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: r365967 - head/sbin/nvmecontrol

2020-09-21 Thread David Bright
Author: dab
Date: Mon Sep 21 18:34:13 2020
New Revision: 365967
URL: https://svnweb.freebsd.org/changeset/base/365967

Log:
  Whitespace fix after r365948
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/sbin/nvmecontrol/firmware.c

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cMon Sep 21 18:32:57 2020
(r365966)
+++ head/sbin/nvmecontrol/firmware.cMon Sep 21 18:34:13 2020
(r365967)
@@ -168,9 +168,9 @@ update_firmware(int fd, uint8_t *payload, int32_t payl
if (fwug != 0 && fwug != 0xFF)
max_xfer_size = ((uint64_t)fwug << 12);
else if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, _xfer_size) < 0)
-   err(1, "query max transfer size failed");
-   if (max_xfer_size > NVME_MAX_XFER_SIZE)
-   max_xfer_size = NVME_MAX_XFER_SIZE;
+   err(1, "query max transfer size failed");
+   if (max_xfer_size > NVME_MAX_XFER_SIZE)
+   max_xfer_size = NVME_MAX_XFER_SIZE;
 
if ((chunk = aligned_alloc(PAGE_SIZE, max_xfer_size)) == NULL)
errx(1, "unable to malloc %zd bytes", (size_t)max_xfer_size);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365966 - in head/sys/dev/usb: . serial

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:32:57 2020
New Revision: 365966
URL: https://svnweb.freebsd.org/changeset/base/365966

Log:
  Add support for Winbond USB CDC modem device found in Tenma power supply.
  
  PR:   249384
  MFC after:1 week
  Submitted by: dar...@dons.net.au
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/umodem.c
==
--- head/sys/dev/usb/serial/umodem.cMon Sep 21 18:28:23 2020
(r365965)
+++ head/sys/dev/usb/serial/umodem.cMon Sep 21 18:32:57 2020
(r365966)
@@ -150,6 +150,8 @@ static const STRUCT_USB_HOST_ID umodem_host_devs[] = {
{USB_VPI(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 1)},
{USB_VPI(USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 1)},
{USB_VPI(USB_VENDOR_CURITEL, USB_PRODUCT_CURITEL_PC5740, 1)},
+   /* Winbond */
+   {USB_VENDOR(USB_VENDOR_WINBOND), USB_PRODUCT(USB_PRODUCT_WINBOND_CDC)},
 };
 
 /*

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsMon Sep 21 18:28:23 2020(r365965)
+++ head/sys/dev/usb/usbdevsMon Sep 21 18:32:57 2020(r365966)
@@ -4851,6 +4851,7 @@ product WIENERPLEINBAUS MPOD  0x0012  MPOD PSU
 product WIENERPLEINBAUS CML0x0015  CML Data Logger
 
 /* Windbond Electronics */
+product WINBOND CDC0x5011  CDC serial device
 product WINBOND UH104  0x5518  4-port USB Hub
 
 /* WinMaxGroup products */
___
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: r365965 - stable/11/sys/dev/usb

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:28:23 2020
New Revision: 365965
URL: https://svnweb.freebsd.org/changeset/base/365965

Log:
  MFC r364932:
  Allow slow USB devices to be given more time to return their USB descriptors,
  like Logitech HD Pro Webcam C920.
  
  PR:   248926
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/usb/usb_request.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/usb_request.c
==
--- stable/11/sys/dev/usb/usb_request.c Mon Sep 21 18:27:44 2020
(r365964)
+++ stable/11/sys/dev/usb/usb_request.c Mon Sep 21 18:28:23 2020
(r365965)
@@ -719,7 +719,8 @@ done:
case USB_ERR_CANCELLED:
break;
default:
-   DPRINTF("I/O error - waiting a bit for TT cleanup\n");
+   DPRINTF("error=%s - waiting a bit for TT cleanup\n",
+   usbd_errstr(err));
usb_pause_mtx(mtx, hz / 16);
break;
}
@@ -1008,7 +1009,7 @@ usbd_req_get_desc(struct usb_device *udev,
USETW(req.wLength, min_len);
 
err = usbd_do_request_flags(udev, mtx, ,
-   desc, 0, NULL, 500 /* ms */);
+   desc, 0, NULL, 1000 /* ms */);
 
if (err != 0 && err != USB_ERR_TIMEOUT &&
min_len != max_len) {
@@ -1019,7 +1020,7 @@ usbd_req_get_desc(struct usb_device *udev,
USETW(req.wLength, max_len);
 
err = usbd_do_request_flags(udev, mtx, ,
-   desc, USB_SHORT_XFER_OK, NULL, 500 /* ms */);
+   desc, USB_SHORT_XFER_OK, NULL, 1000 /* ms */);
 
if (err == 0) {
/* verify length */
___
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: r365964 - stable/12/sys/dev/usb

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:27:44 2020
New Revision: 365964
URL: https://svnweb.freebsd.org/changeset/base/365964

Log:
  MFC r364932:
  Allow slow USB devices to be given more time to return their USB descriptors,
  like Logitech HD Pro Webcam C920.
  
  PR:   248926
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/usb/usb_request.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/usb_request.c
==
--- stable/12/sys/dev/usb/usb_request.c Mon Sep 21 18:24:28 2020
(r365963)
+++ stable/12/sys/dev/usb/usb_request.c Mon Sep 21 18:27:44 2020
(r365964)
@@ -721,7 +721,8 @@ done:
case USB_ERR_CANCELLED:
break;
default:
-   DPRINTF("I/O error - waiting a bit for TT cleanup\n");
+   DPRINTF("error=%s - waiting a bit for TT cleanup\n",
+   usbd_errstr(err));
usb_pause_mtx(mtx, hz / 16);
break;
}
@@ -1010,7 +1011,7 @@ usbd_req_get_desc(struct usb_device *udev,
USETW(req.wLength, min_len);
 
err = usbd_do_request_flags(udev, mtx, ,
-   desc, 0, NULL, 500 /* ms */);
+   desc, 0, NULL, 1000 /* ms */);
 
if (err != 0 && err != USB_ERR_TIMEOUT &&
min_len != max_len) {
@@ -1021,7 +1022,7 @@ usbd_req_get_desc(struct usb_device *udev,
USETW(req.wLength, max_len);
 
err = usbd_do_request_flags(udev, mtx, ,
-   desc, USB_SHORT_XFER_OK, NULL, 500 /* ms */);
+   desc, USB_SHORT_XFER_OK, NULL, 1000 /* ms */);
 
if (err == 0) {
/* verify length */
___
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: r365963 - stable/12/sys/kern

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:24:28 2020
New Revision: 365963
URL: https://svnweb.freebsd.org/changeset/base/365963

Log:
  MFC r365238:
  Assert that cc_exec_drain(cc, direct) is NULL before assigning a new value.
  
  Suggested by: markj@
  Tested by:callout_test
  Sponsored by: Mellanox Technologies // NVIDIA Networking

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

Modified: stable/12/sys/kern/kern_timeout.c
==
--- stable/12/sys/kern/kern_timeout.c   Mon Sep 21 18:21:59 2020
(r365962)
+++ stable/12/sys/kern/kern_timeout.c   Mon Sep 21 18:24:28 2020
(r365963)
@@ -1382,6 +1382,9 @@ again:
CTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p",
c, c->c_func, c->c_arg);
if (drain) {
+   KASSERT(cc_exec_drain(cc, direct) == NULL,
+   ("callout drain function already set to %p",
+   cc_exec_drain(cc, direct)));
cc_exec_drain(cc, direct) = drain;
}
CC_UNLOCK(cc);
@@ -1390,6 +1393,9 @@ again:
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
if (drain) {
+   KASSERT(cc_exec_drain(cc, direct) == NULL,
+   ("callout drain function already set to %p",
+   cc_exec_drain(cc, direct)));
cc_exec_drain(cc, direct) = drain;
}
}
___
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: r365962 - stable/12/sys/kern

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:21:59 2020
New Revision: 365962
URL: https://svnweb.freebsd.org/changeset/base/365962

Log:
  MFC r365237:
  Micro optimise _callout_stop_safe() by removing dead code.
  
  The CS_DRAIN flag cannot be set at the same time like the async-drain function
  pointer is set. These are orthogonal features. Assert this at the beginning
  of the function.
  
  Before:
  if (flags & CS_DRAIN) {
  /* FALLTHROUGH */
  } else if (xxx) {
  return yyy;
  }
  if (drain) {
  zzz = drain;
  }
  After:
  if (flags & CS_DRAIN) {
  /* FALLTHROUGH */
  } else if (xxx) {
  return yyy;
  } else {
  if (drain) {
  zzz = drain;
  }
  }
  
  Reviewed by:  markj@
  Tested by:callout_test
  Differential Revision:https://reviews.freebsd.org/D26285
  Sponsored by: Mellanox Technologies // NVIDIA Networking

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

Modified: stable/12/sys/kern/kern_timeout.c
==
--- stable/12/sys/kern/kern_timeout.c   Mon Sep 21 18:19:48 2020
(r365961)
+++ stable/12/sys/kern/kern_timeout.c   Mon Sep 21 18:21:59 2020
(r365962)
@@ -1188,6 +1188,9 @@ _callout_stop_safe(struct callout *c, int flags, callo
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
"calling %s", __func__);
 
+   KASSERT((flags & CS_DRAIN) == 0 || drain == NULL,
+   ("Cannot set drain callback and CS_DRAIN flag at the same time"));
+
/*
 * Some old subsystems don't hold Giant while running a callout_stop(),
 * so just discard this check for the moment.
@@ -1383,11 +1386,12 @@ again:
}
CC_UNLOCK(cc);
return ((flags & CS_EXECUTING) != 0);
-   }
-   CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
-   c, c->c_func, c->c_arg);
-   if (drain) {
-   cc_exec_drain(cc, direct) = drain;
+   } else {
+   CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
+   c, c->c_func, c->c_arg);
+   if (drain) {
+   cc_exec_drain(cc, direct) = drain;
+   }
}
KASSERT(!sq_locked, ("sleepqueue chain still locked"));
cancelled = ((flags & CS_EXECUTING) != 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: r365961 - in releng/12.2/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware

2020-09-21 Thread Navdeep Parhar
Author: np
Date: Mon Sep 21 18:19:48 2020
New Revision: 365961
URL: https://svnweb.freebsd.org/changeset/base/365961

Log:
  MFS r365937, which merged r365861 and r365872 from head to stable/12.
  
  r365861:
  cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0.
  
  r365872:
  cxgbe(4): add the firmware binaries instead of the empty files that were added
  in r365861.
  
  Approved by:  re@ (gjb@)

Added:
  releng/12.2/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin
 - copied unchanged from r365937, 
stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin
  releng/12.2/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin
 - copied unchanged from r365937, 
stable/12/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin
  releng/12.2/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin
 - copied unchanged from r365937, 
stable/12/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin
Deleted:
  releng/12.2/sys/dev/cxgbe/firmware/t4fw-1.24.12.0.bin
  releng/12.2/sys/dev/cxgbe/firmware/t5fw-1.24.12.0.bin
  releng/12.2/sys/dev/cxgbe/firmware/t6fw-1.24.12.0.bin
Modified:
  releng/12.2/sys/conf/files
  releng/12.2/sys/dev/cxgbe/firmware/t4fw_interface.h
  releng/12.2/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  releng/12.2/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
  releng/12.2/sys/modules/cxgbe/t4_firmware/Makefile
  releng/12.2/sys/modules/cxgbe/t5_firmware/Makefile
  releng/12.2/sys/modules/cxgbe/t6_firmware/Makefile
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/conf/files
==
--- releng/12.2/sys/conf/files  Mon Sep 21 18:19:35 2020(r365960)
+++ releng/12.2/sys/conf/files  Mon Sep 21 18:19:48 2020(r365961)
@@ -1476,7 +1476,7 @@ t4fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t4fw.fwo"
 t4fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t4fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t4fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t4fw.fw"
@@ -1510,7 +1510,7 @@ t5fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t5fw.fwo"
 t5fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t5fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t5fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t5fw.fw"
@@ -1544,7 +1544,7 @@ t6fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t6fw.fwo"
 t6fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t6fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t6fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t6fw.fw"

Copied: releng/12.2/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin (from r365937, 
stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin)
==
Binary file (source and/or target). No diff available.

Modified: releng/12.2/sys/dev/cxgbe/firmware/t4fw_interface.h
==
--- releng/12.2/sys/dev/cxgbe/firmware/t4fw_interface.h Mon Sep 21 18:19:35 
2020(r365960)
+++ releng/12.2/sys/dev/cxgbe/firmware/t4fw_interface.h Mon Sep 21 18:19:48 
2020(r365961)
@@ -4690,6 +4690,7 @@ enum fw_caps_config_crypto {
FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x0001,
FW_CAPS_CONFIG_TLSKEYS = 0x0002,
FW_CAPS_CONFIG_IPSEC_INLINE = 0x0004,
+   FW_CAPS_CONFIG_TLS_HW = 0x0008,
 };
 
 enum fw_caps_config_fcoe {
@@ -4838,6 +4839,7 @@ enum fw_params_param_dev {
FW_PARAMS_PARAM_DEV_TCB_CACHE_FLUSH = 0x2D,
FW_PARAMS_PARAM_DEV_FILTER = 0x2E,
FW_PARAMS_PARAM_DEV_CLIP2_CMD = 0x2F,
+   FW_PARAMS_PARAM_DEV_KTLS_HW = 0x31,
 };
 
 /*
@@ -4874,6 +4876,13 @@ enum fw_params_param_dev_filter{
FW_PARAM_DEV_FILTER_MODE_MASK   = 0x01,
 };
 
+enum fw_params_param_dev_ktls_hw {
+   FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE = 0x00,
+   FW_PARAMS_PARAM_DEV_KTLS_HW_ENABLE  = 0x01,
+   FW_PARAMS_PARAM_DEV_KTLS_HW_USER_DISABLE = 0x00,
+   

svn commit: r365959 - stable/12/sys/dev/mlx5/mlx5_en

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:18:53 2020
New Revision: 365959
URL: https://svnweb.freebsd.org/changeset/base/365959

Log:
  MFC r365719:
  Poll statistics more frequently in mlx5en(4).
  
  This makes traffic steering algorithms more accurate.
  
  Submitted by: gallatin @
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Sep 21 18:17:01 
2020(r365958)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Sep 21 18:18:53 
2020(r365959)
@@ -1066,7 +1066,7 @@ mlx5e_update_stats(void *arg)
 
queue_work(priv->wq, >update_stats_work);
 
-   callout_reset(>watchdog, hz, _update_stats, priv);
+   callout_reset(>watchdog, hz / 4, _update_stats, priv);
 }
 
 static void
___
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: r365960 - stable/11/sys/dev/mlx5/mlx5_en

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:19:35 2020
New Revision: 365960
URL: https://svnweb.freebsd.org/changeset/base/365960

Log:
  MFC r365719:
  Poll statistics more frequently in mlx5en(4).
  
  This makes traffic steering algorithms more accurate.
  
  Submitted by: gallatin @
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Sep 21 18:18:53 
2020(r365959)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Sep 21 18:19:35 
2020(r365960)
@@ -1058,7 +1058,7 @@ mlx5e_update_stats(void *arg)
 
queue_work(priv->wq, >update_stats_work);
 
-   callout_reset(>watchdog, hz, _update_stats, priv);
+   callout_reset(>watchdog, hz / 4, _update_stats, priv);
 }
 
 static void
___
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: r365958 - head/share/man/man4

2020-09-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 21 18:17:01 2020
New Revision: 365958
URL: https://svnweb.freebsd.org/changeset/base/365958

Log:
  Add example to ng_bpf(4) showing how ng_bpf(4) can be used to prevent 
spoofing.
  
  Differential Revision:https://reviews.freebsd.org/D26488
  MFC after:1 week
  Reviewed by:  pi, bcr (manpages)
  Submitted by: lutz_donnerhacke.de (Lutz Donnerhacke)
  Sponsored by: Mellanox Technologies // NVIDIA Networking

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

Modified: head/share/man/man4/ng_bpf.4
==
--- head/share/man/man4/ng_bpf.4Mon Sep 21 17:59:45 2020
(r365957)
+++ head/share/man/man4/ng_bpf.4Mon Sep 21 18:17:01 2020
(r365958)
@@ -35,7 +35,7 @@
 .\" $FreeBSD$
 .\" $Whistle: ng_bpf.8,v 1.2 1999/12/03 01:57:12 archie Exp $
 .\"
-.Dd April 29, 2020
+.Dd September 20, 2020
 .Dt NG_BPF 4
 .Os
 .Sh NAME
@@ -113,21 +113,18 @@ program or else
 .Er EINVAL
 is returned.
 .It Dv NGM_BPF_GET_PROGRAM Pq Ic getprogram
-This command takes an
-.Tn ASCII
+This command takes an ASCII
 string argument, the hook name, and returns the
 corresponding
 .Dv "struct ng_bpf_hookprog"
 as shown above.
 .It Dv NGM_BPF_GET_STATS Pq Ic getstats
-This command takes an
-.Tn ASCII
+This command takes an ASCII
 string argument, the hook name, and returns the
 statistics associated with the hook as a
 .Dv "struct ng_bpf_hookstat" .
 .It Dv NGM_BPF_CLR_STATS Pq Ic clrstats
-This command takes an
-.Tn ASCII
+This command takes an ASCII
 string argument, the hook name, and clears the
 statistics associated with the hook.
 .It Dv NGM_BPF_GETCLR_STATS Pq Ic getclrstats
@@ -142,9 +139,8 @@ control message, or when all hooks have been disconnec
 .Sh EXAMPLES
 It is possible to configure a node from the command line, using
 .Xr tcpdump 1
-to generate raw BPF instructions which are then fed into an
-.Xr awk 1
-script to create the ASCII form of a
+to generate raw BPF instructions which are then transformed
+into the ASCII form of a
 .Dv NGM_BPF_SET_PROGRAM
 control message, as demonstrated here:
 .Bd -literal -offset 4n
@@ -169,6 +165,51 @@ ngctl msg ${NODEPATH} setprogram { thisHook=\\"${INHOO
   ifMatch=\\"${MATCHHOOK}\\" \\
   ifNotMatch=\\"${NOTMATCHHOOK}\\" \\
   ${BPFPROG} }
+.Ed
+.Pp
+Based on the previous example, it is possible to prevent a jail (or a VM)
+from spoofing by allowing only traffic that has the expected ethernet and
+IP addresses:
+.Bd -literal -offset 4n
+#!/bin/sh
+
+NODEPATH="my_node:"
+JAIL_MAC="0a:00:de:ad:be:ef"
+JAIL_IP="128.66.1.42"
+JAIL_HOOK="jail"
+HOST_HOOK="host"
+DEBUG_HOOK="nomatch"
+
+bpf_prog() {
+local PATTERN=$1
+
+tcpdump -s 8192 -p -ddd ${PATTERN} | (
+read len
+echo -n "bpf_prog_len=$len "
+echo -n "bpf_prog=["
+while read code jt jf k ; do
+echo -n " { code=$code jt=$jt jf=$jf k=$k }"
+done
+echo " ]"
+)
+}
+
+# Prevent jail from spoofing (filter packets coming from jail)
+ngctl msg ${NODEPATH} setprogram {\\
+thisHook=\\"${JAIL_HOOK}\\" \\
+ifMatch=\\"${HOST_HOOK}\\"  \\
+ifNotMatch=\\"${DEBUG_HOOK}\\"  \\
+$(bpf_prog "ether src ${JAIL_MAC} && src ${JAIL_IP}") \\
+}
+
+# Prevent jail from receiving spoofed packets (filter packets
+# coming from host)
+ngctl msg ${NODEPATH} setprogram {\\
+thisHook=\\"${HOST_HOOK}\\" \\
+ifMatch=\\"${JAIL_HOOK}\\"  \\
+ifNotMatch=\\"${DEBUG_HOOK}\\"  \\
+$(bpf_prog "ether dst ${JAIL_MAC} && dst ${JAIL_IP}") \\
+}
 .Ed
 .Sh SEE ALSO
 .Xr bpf 4 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365957 - in head: sbin/rcorder usr.sbin/crunch/crunchgen

2020-09-21 Thread Adrian Chadd
Author: adrian
Date: Mon Sep 21 17:59:45 2020
New Revision: 365957
URL: https://svnweb.freebsd.org/changeset/base/365957

Log:
  [rcorder] [crunch] Fix C function declarations to include void
  
  This fixes a compile issue under gcc6 which complains about
  legacy style C function declarations.
  
  Differential Revision:https://reviews.freebsd.org/D26504

Modified:
  head/sbin/rcorder/rcorder.c
  head/usr.sbin/crunch/crunchgen/crunched_main.c

Modified: head/sbin/rcorder/rcorder.c
==
--- head/sbin/rcorder/rcorder.c Mon Sep 21 17:48:28 2020(r365956)
+++ head/sbin/rcorder/rcorder.c Mon Sep 21 17:59:45 2020(r365957)
@@ -990,7 +990,7 @@ do_file(filenode *fnode, strnodelist *stack_ptr)
 }
 
 static void
-generate_graphviz_header()
+generate_graphviz_header(void)
 {
 
if (do_graphviz != true)
@@ -1003,7 +1003,7 @@ generate_graphviz_header()
 }
 
 static void
-generate_graphviz_footer()
+generate_graphviz_footer(void)
 {
 
if (do_graphviz == true)
@@ -1011,7 +1011,7 @@ generate_graphviz_footer()
 }
 
 static void
-generate_graphviz_providers()
+generate_graphviz_providers(void)
 {
Hash_Entry *entry;
Hash_Search psearch;

Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c
==
--- head/usr.sbin/crunch/crunchgen/crunched_main.c  Mon Sep 21 17:48:28 
2020(r365956)
+++ head/usr.sbin/crunch/crunchgen/crunched_main.c  Mon Sep 21 17:59:45 
2020(r365957)
@@ -183,7 +183,7 @@ crunched_main(int argc, char **argv, char **envp)
 }
 
 static void
-crunched_usage()
+crunched_usage(void)
 {
int columns, len;
struct stub *ep;
___
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: r365956 - head/tools/regression/fsx

2020-09-21 Thread Alan Somers
Author: asomers
Date: Mon Sep 21 17:48:28 2020
New Revision: 365956
URL: https://svnweb.freebsd.org/changeset/base/365956

Log:
  fsx: fix build with WARNS=6
  
  * signed/unsigned comparisons
  * use standard warn(3)
  * Suppress warnings about local vars and funcs not declared static
  * const-correctness
  * declaration shadows a variable in the global scope
  
  Reviewed by:  kevans
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D26516

Modified:
  head/tools/regression/fsx/Makefile
  head/tools/regression/fsx/fsx.c

Modified: head/tools/regression/fsx/Makefile
==
--- head/tools/regression/fsx/Makefile  Mon Sep 21 17:28:41 2020
(r365955)
+++ head/tools/regression/fsx/Makefile  Mon Sep 21 17:48:28 2020
(r365956)
@@ -4,4 +4,9 @@ PROG=   fsx
 
 MAN=
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include 
+
+# Don't require static declarations.  It's line noise in a single-file program.
+CWARNFLAGS+= -Wno-strict-prototypes -Wno-missing-prototypes

Modified: head/tools/regression/fsx/fsx.c
==
--- head/tools/regression/fsx/fsx.c Mon Sep 21 17:28:41 2020
(r365955)
+++ head/tools/regression/fsx/fsx.c Mon Sep 21 17:48:28 2020
(r365956)
@@ -112,7 +112,7 @@ int closeprob = 0;  /* -c flag */
 intinvlprob = 0;   /* -i flag */
 intdebug = 0;  /* -d flag */
 unsigned long  debugstart = 0; /* -D flag */
-unsigned long  maxfilelen = 256 * 1024;/* -l flag */
+off_t  maxfilelen = 256 * 1024;/* -l flag */
 intsizechecks = 1; /* -n flag disables them */
 intmaxoplen = 64 * 1024;   /* -o flag */
 intquiet = 0;  /* -q flag */
@@ -138,33 +138,8 @@ int invl = 0;
 
 
 void
-vwarnc(code, fmt, ap)
-   int code;
-   const char *fmt;
-   va_list ap;
+prt(const char *fmt, ...)
 {
-   fprintf(stderr, "fsx: ");
-   if (fmt != NULL) {
-   vfprintf(stderr, fmt, ap);
-   fprintf(stderr, ": ");
-   }
-   fprintf(stderr, "%s\n", strerror(code));
-}
-
-
-void
-warn(const char * fmt, ...)
-{
-   va_list ap;
-   va_start(ap, fmt);
-   vwarnc(errno, fmt, ap);
-   va_end(ap);
-}
-
-
-void
-prt(char *fmt, ...)
-{
va_list args;
 
va_start(args, fmt);
@@ -179,7 +154,7 @@ prt(char *fmt, ...)
 }
 
 void
-prterr(char *prefix)
+prterr(const char *prefix)
 {
prt("%s%s%s\n", prefix, prefix ? ": " : "", strerror(errno));
 }
@@ -317,12 +292,12 @@ logdump(void)
 
 
 void
-save_buffer(char *buffer, off_t bufferlength, int fd)
+save_buffer(char *buffer, off_t bufferlength, int savefd)
 {
off_t ret;
ssize_t byteswritten;
 
-   if (fd <= 0 || bufferlength == 0)
+   if (savefd <= 0 || bufferlength == 0)
return;
 
if (bufferlength > SSIZE_MAX) {
@@ -330,7 +305,7 @@ save_buffer(char *buffer, off_t bufferlength, int fd)
exit(67);
}
if (lite) {
-   off_t size_by_seek = lseek(fd, (off_t)0, SEEK_END);
+   off_t size_by_seek = lseek(savefd, (off_t)0, SEEK_END);
if (size_by_seek == (off_t)-1)
prterr("save_buffer: lseek eof");
else if (bufferlength > size_by_seek) {
@@ -340,11 +315,11 @@ save_buffer(char *buffer, off_t bufferlength, int fd)
}
}
 
-   ret = lseek(fd, (off_t)0, SEEK_SET);
+   ret = lseek(savefd, (off_t)0, SEEK_SET);
if (ret == (off_t)-1)
prterr("save_buffer: lseek 0");

-   byteswritten = write(fd, buffer, (size_t)bufferlength);
+   byteswritten = write(savefd, buffer, (size_t)bufferlength);
if (byteswritten != bufferlength) {
if (byteswritten == -1)
prterr("save_buffer write");
@@ -458,10 +433,10 @@ check_trunc_hack(void)
 
 
 void
-doread(unsigned offset, unsigned size)
+doread(off_t offset, off_t size)
 {
off_t ret;
-   unsigned iret;
+   ssize_t iret;
 
offset -= offset % readbdy;
if (size == 0) {
@@ -509,7 +484,7 @@ doread(unsigned offset, unsigned size)
 
 
 void
-check_eofpage(char *s, unsigned offset, char *p, int size)
+check_eofpage(const char *s, unsigned offset, char *p, int size)
 {
uintptr_t last_page, should_be_zero;
 
@@ -592,7 +567,7 @@ domapread(unsigned offset, unsigned size)
 
 
 void
-gendata(char *original_buf, char *good_buf, unsigned offset, unsigned size)
+gendata(unsigned offset, unsigned size)
 {
while (size--) {
good_buf[offset] = testcalls % 256; 
@@ -607,7 +582,7 @@ void
 dowrite(unsigned offset, unsigned size)
 {
off_t ret;
-   unsigned iret;
+   ssize_t iret;
 
offset -= offset % writebdy;
if (size == 0) {

svn commit: r365955 - head/sys/sys

2020-09-21 Thread Mitchell Horne
Author: mhorne
Date: Mon Sep 21 17:28:41 2020
New Revision: 365955
URL: https://svnweb.freebsd.org/changeset/base/365955

Log:
  Hide tunable definitions behind _KERNEL
  
  Some userspace code include sys/kernel.h. Namely, some OpenZFS tests do
  this, and it was causing breakage after r365945 due to a lack of bool
  typedef. Userspace should not need the TUNABLE_** stuff, so hide it
  behind an #ifdef _KERNEL.
  
  Sorry for the breakage.
  
  Reported by:  andrew, Michael Butler, Jenkins
  Discussed with: kevans, allanjude

Modified:
  head/sys/sys/kernel.h

Modified: head/sys/sys/kernel.h
==
--- head/sys/sys/kernel.h   Mon Sep 21 17:06:36 2020(r365954)
+++ head/sys/sys/kernel.h   Mon Sep 21 17:28:41 2020(r365955)
@@ -297,6 +297,8 @@ sysinit_tslog_shim(const void * data)
 
 void   sysinit_add(struct sysinit **set, struct sysinit **set_end);
 
+#ifdef _KERNEL
+
 /*
  * Infrastructure for tunable 'constants'.  Value may be specified at compile
  * time or kernel load time.  Rules relating tunables together can be placed
@@ -458,6 +460,8 @@ struct tunable_str {
 
 #defineTUNABLE_STR_FETCH(path, var, size)  \
getenv_string((path), (var), (size))
+
+#endif /* _KERNEL */
 
 typedef void (*ich_func_t)(void *_arg);
 
___
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: r365954 - head/usr.bin/xargs

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Mon Sep 21 17:06:36 2020
New Revision: 365954
URL: https://svnweb.freebsd.org/changeset/base/365954

Log:
  xargs: add some long options for GNU compatibility
  
  These are low-effort to add, so let's just do it.
  
  Reported by:  "LukeShu" on Hacker News (-r / --no-run-if-empty)
  MFC after:1 week

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

Modified: head/usr.bin/xargs/xargs.1
==
--- head/usr.bin/xargs/xargs.1  Mon Sep 21 16:59:12 2020(r365953)
+++ head/usr.bin/xargs/xargs.1  Mon Sep 21 17:06:36 2020(r365954)
@@ -33,7 +33,7 @@
 .\" $FreeBSD$
 .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $
 .\"
-.Dd June 11, 2020
+.Dd September 21, 2020
 .Dt XARGS 1
 .Os
 .Sh NAME
@@ -84,7 +84,7 @@ Any single character, including newlines, may be escap
 .Pp
 The options are as follows:
 .Bl -tag -width indent
-.It Fl 0
+.It Fl 0 , Fl -null
 Change
 .Nm
 to expect NUL
@@ -175,7 +175,7 @@ If EOF is reached and fewer lines have been read than
 then
 .Ar utility
 will be called with the available lines.
-.It Fl n Ar number
+.It Fl n Ar number , Fl -max-args= Ns Ar number
 Set the maximum number of arguments taken from standard input for each
 invocation of
 .Ar utility .
@@ -201,7 +201,7 @@ in the child process before executing the command.
 This is useful if you want
 .Nm
 to run an interactive application.
-.It Fl P Ar maxprocs
+.It Fl P Ar maxprocs , Fl -max-procs= Ns Ar maxprocs
 Parallel mode: run at most
 .Ar maxprocs
 invocations of
@@ -212,7 +212,7 @@ If
 is set to 0,
 .Nm
 will run as many processes as possible.
-.It Fl p
+.It Fl p , Fl -interactive
 Echo each command to be executed and ask the user whether it should be
 executed.
 An affirmative response,
@@ -221,7 +221,7 @@ in the POSIX locale,
 causes the command to be executed, any other response causes it to be
 skipped.
 No commands are executed if the process is not attached to a terminal.
-.It Fl r
+.It Fl r , Fl -no-run-if-empty
 Compatibility with GNU
 .Nm .
 The GNU version of
@@ -263,7 +263,7 @@ can use for replacements.
 The default for
 .Ar replsize
 is 255.
-.It Fl s Ar size
+.It Fl s Ar size , Fl -max-chars= Ns Ar size
 Set the maximum number of bytes for the command line length provided to
 .Ar utility .
 The sum of the length of the utility name, the arguments passed to
@@ -277,10 +277,10 @@ The current default value for
 is
 .Dv ARG_MAX
 - 4096.
-.It Fl t
+.It Fl t , Fl -verbose
 Echo the command to be executed to standard error immediately before it
 is executed.
-.It Fl x
+.It Fl x , Fl -exit
 Force
 .Nm
 to terminate immediately if a command line containing

Modified: head/usr.bin/xargs/xargs.c
==
--- head/usr.bin/xargs/xargs.c  Mon Sep 21 16:59:12 2020(r365953)
+++ head/usr.bin/xargs/xargs.c  Mon Sep 21 17:06:36 2020(r365954)
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -98,6 +99,22 @@ static volatile int childerr;
 
 extern char **environ;
 
+static const char *optstr = "+0E:I:J:L:n:oP:pR:S:s:rtx";
+
+static const struct option long_options[] =
+{
+   {"exit",no_argument,NULL,   'x'},
+   {"interactive", no_argument,NULL,   'p'},
+   {"max-args",required_argument,  NULL,   'n'},
+   {"max-chars",   required_argument,  NULL,   's'},
+   {"max-procs",   required_argument,  NULL,   'P'},
+   {"no-run-if-empty", no_argument,NULL,   'r'},
+   {"null",no_argument,NULL,   '0'},
+   {"verbose", no_argument,NULL,   't'},
+
+   {NULL,  no_argument,NULL,   0},
+};
+
 int
 main(int argc, char *argv[])
 {
@@ -137,7 +154,7 @@ main(int argc, char *argv[])
nline -= strlen(*ep++) + 1 + sizeof(*ep);
}
maxprocs = 1;
-   while ((ch = getopt(argc, argv, "0E:I:J:L:n:oP:pR:S:s:rtx")) != -1)
+   while ((ch = getopt_long(argc, argv, optstr, long_options, NULL)) != -1)
switch (ch) {
case 'E':
eofstr = optarg;
___
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: r365953 -

2020-09-21 Thread Kyle Evans
Author: kevans
Date: Mon Sep 21 16:59:12 2020
New Revision: 365953
URL: https://svnweb.freebsd.org/changeset/base/365953

Log:
  base: add a *.pem hint to svn:auto-props
  
  caroot means that we're adding .pem files with some frequency to base; add
  a prop hint so that I don't need to keep this locally synced across boxen
  that I do updates on.

Modified:
Directory Properties:
  /   (props changed)
___
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: r365952 - head/contrib/libexecinfo

2020-09-21 Thread Poul-Henning Kamp
Author: phk
Date: Mon Sep 21 16:43:38 2020
New Revision: 365952
URL: https://svnweb.freebsd.org/changeset/base/365952

Log:
  Pull in fix from upstream NetBSD rev. 1.5:
  
  If Unwind_Backtrace is broken, ctx.n will still contain ~0, and we will
  return that which poor behavior for the user, so return 0 instead.
  We could document ~0 to be an error, but that would deviate from the
  Linux behavior which is not desirable. Noted by Poul-Henning Kamp
  
  PR:   209842

Modified:
  head/contrib/libexecinfo/unwind.c

Modified: head/contrib/libexecinfo/unwind.c
==
--- head/contrib/libexecinfo/unwind.c   Mon Sep 21 15:53:41 2020
(r365951)
+++ head/contrib/libexecinfo/unwind.c   Mon Sep 21 16:43:38 2020
(r365952)
@@ -67,7 +67,9 @@ backtrace(void **arr, size_t len)
ctx.n = (size_t)~0;
 
_Unwind_Backtrace(tracer, );
-   if (ctx.n != (size_t)~0 && ctx.n > 0)
+   if (ctx.n == (size_t)~0)
+   ctx.n = 0;
+   else if (ctx.n > 0)
ctx.arr[--ctx.n] = NULL;/* Skip frame below __start */
 
return ctx.n;
___
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: r365951 - head/sys/amd64/amd64

2020-09-21 Thread Konstantin Belousov
Author: kib
Date: Mon Sep 21 15:53:41 2020
New Revision: 365951
URL: https://svnweb.freebsd.org/changeset/base/365951

Log:
  amd64 pmap: only calculate page table page when needed.
  
  Noted by: alc
  Reviewed by:  alc, markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D26499

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Mon Sep 21 15:49:02 2020(r365950)
+++ head/sys/amd64/amd64/pmap.c Mon Sep 21 15:53:41 2020(r365951)
@@ -6525,12 +6525,13 @@ restart:
origpte = *pdpe;
MPASS(origpte == 0);
} else {
-   mp = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME);
pdpe = pmap_pdpe(pmap, va);
KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va));
origpte = *pdpe;
-   if ((origpte & PG_V) == 0)
+   if ((origpte & PG_V) == 0) {
+   mp = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME);
mp->ref_count++;
+   }
}
KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
(origpte & PG_FRAME) == (pten & PG_FRAME)),
@@ -6563,10 +6564,11 @@ restart:
} else {
pdpe = pmap_pdpe(pmap, va);
MPASS(pdpe != NULL && (*pdpe & PG_V) != 0);
-   mp = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME);
origpte = *pde;
-   if ((origpte & PG_V) == 0)
+   if ((origpte & PG_V) == 0) {
+   mp = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME);
mp->ref_count++;
+   }
}
KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
(origpte & PG_FRAME) == (pten & PG_FRAME)),
___
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: r365950 - head/tools/build

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 15:49:02 2020
New Revision: 365950
URL: https://svnweb.freebsd.org/changeset/base/365950

Log:
  When building on Ubuntu bootstrap bmake with bash as the default shell
  
  The Ubuntu /bin/sh (dash) removes all environment variables that contain
  characters outside the [a-zA-Z0-9_] range and this breaks the bmake tests that
  run as part of bootstrapping bmake.
  This can be reverted when the bmake tests have been updated.

Modified:
  head/tools/build/make.py

Modified: head/tools/build/make.py
==
--- head/tools/build/make.pyMon Sep 21 15:48:57 2020(r365949)
+++ head/tools/build/make.pyMon Sep 21 15:49:02 2020(r365950)
@@ -81,6 +81,14 @@ def bootstrap_bmake(source_root, objdir_prefix):
 "--with-default-sys-path=" + str(bmake_install_dir / "share/mk"),
 "--with-machine=amd64",  # TODO? "--with-machine-arch=amd64",
 "--without-filemon", "--prefix=" + str(bmake_install_dir)]
+
+if Path("/bin/sh").resolve().name == "dash":
+# Note: we have to avoid using dash as the default shell since it
+# filters out variables containing characters such as '-' and that
+# breaks the bmake bootstrap tests.
+# TODO: remove this when the bootstrap tests have been fixed.
+configure_args.append("--with-defshell=/bin/bash")
+
 run(["sh", bmake_source_dir / "boot-strap"] + configure_args,
 cwd=str(bmake_build_dir), env=env)
 
___
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: r365949 - head/tools/build

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 15:48:57 2020
New Revision: 365949
URL: https://svnweb.freebsd.org/changeset/base/365949

Log:
  Add a tools/build/make.py script that bootstraps bmake and then runs the build
  
  This makes it possible to compile on non-FreeBSD systems since make will
  usually be GNU make there. Even if they include bmake, it will often
  either be a broken version or too old to build FreeBSD.
  
  This should be the last commit needed to compile FreeBSD on Linux+macOS.
  After over two years, I've finally managed to upstream all our local CheriBSD
  changes to allow building on Linux (and as a result of being reviewed by more
  people they are slightly less ugly than they were before).
  
  It should now be possible to run the following to build on Linux+macOS if you
  have LLVM/Clang 10 or newer installed:
  MAKEOBJDIRPREFIX=/somewhere ./tools/build/make.py TARGET=amd64 
TARGET_ARCH=amd64 buildworld
  
  I have only tested macOS 15, Ubuntu 18.04 and openSUSE Leap, but other Linux
  distributions might also work (as long as they ship a recent GLibc and 
compiler).
  
  Reviewed By:  emaste (should be fine to commit to tools/)
  Differential Revision: https://reviews.freebsd.org/D16767

Added:
  head/tools/build/make.py   (contents, props changed)

Added: head/tools/build/make.py
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/make.pyMon Sep 21 15:48:57 2020(r365949)
@@ -0,0 +1,241 @@
+#!/usr/bin/env python3
+# PYTHON_ARGCOMPLETE_OKAY
+# -
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
+# Copyright (c) 2018 Alex Richardson 
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+# This script makes it easier to build on non-FreeBSD systems by bootstrapping
+# bmake and inferring required compiler variables.
+#
+# On FreeBSD you can use it the same way as just calling make:
+# `MAKEOBJDIRPREFIX=~/obj ./tools/build/make.py buildworld -DWITH_FOO`
+#
+# On Linux and MacOS you will either need to set XCC/XCXX/XLD/XCPP or pass
+# --cross-bindir to specify the path to the cross-compiler bindir:
+# `MAKEOBJDIRPREFIX=~/obj ./tools/build/make.py
+# --cross-bindir=/path/to/cross/compiler buildworld -DWITH_FOO TARGET=foo
+# TARGET_ARCH=bar`
+import argparse
+import os
+import shlex
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+
+
+def run(cmd, **kwargs):
+cmd = list(map(str, cmd))  # convert all Path objects to str
+debug("Running", cmd)
+subprocess.check_call(cmd, **kwargs)
+
+
+def bootstrap_bmake(source_root, objdir_prefix):
+bmake_source_dir = source_root / "contrib/bmake"
+bmake_build_dir = objdir_prefix / "bmake-build"
+bmake_install_dir = objdir_prefix / "bmake-install"
+bmake_binary = bmake_install_dir / "bin/bmake"
+
+if (bmake_install_dir / "bin/bmake").exists():
+return bmake_binary
+print("Bootstrapping bmake...")
+# TODO: check if the host system bmake is new enough and use that instead
+if not bmake_build_dir.exists():
+os.makedirs(str(bmake_build_dir))
+env = os.environ.copy()
+global new_env_vars
+env.update(new_env_vars)
+
+if sys.platform.startswith("linux"):
+# Work around the deleted file bmake/missing/sys/cdefs.h
+# TODO: bmake should keep the compat sys/cdefs.h
+env["CFLAGS"] = "-I{src}/tools/build/cross-build/include/common " \
+"-I{src}/tools/build/cross-build/include/linux " \
+"-D_GNU_SOURCE=1".format(src=source_root)
+configure_args = [
+"--with-default-sys-path=" + str(bmake_install_dir / "share/mk"),
+

svn commit: r365948 - head/sbin/nvmecontrol

2020-09-21 Thread David Bright
Author: dab
Date: Mon Sep 21 15:45:49 2020
New Revision: 365948
URL: https://svnweb.freebsd.org/changeset/base/365948

Log:
  Honor the FWUG value of some drives in nvmecontrol
  
  nvmecontrol tries to upload firmware in chunks as large as it thinks
  the device permits. It fails to take into account the FWUG value used
  by some drives to advertise the size and alignment limits for firmware
  chunks.
  
- Use the firwmare update granularity value from the
- If the granularity is not reported or not restricted, fall back to
  the previously existing logic that calculates the max transfer
  size based on MDTS.
- Add firmware update granularity to the identify-controller output.
  
  Reviewed by:  imp (previous version), chuck
  Obtained from:Dell EMC Isilon
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D26390

Modified:
  head/sbin/nvmecontrol/firmware.c
  head/sbin/nvmecontrol/identify_ext.c

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cMon Sep 21 15:44:23 2020
(r365947)
+++ head/sbin/nvmecontrol/firmware.cMon Sep 21 15:45:49 2020
(r365948)
@@ -155,21 +155,29 @@ read_image_file(const char *path, void **buf, int32_t 
 }
 
 static void
-update_firmware(int fd, uint8_t *payload, int32_t payload_size)
+update_firmware(int fd, uint8_t *payload, int32_t payload_size, uint8_t fwug)
 {
struct nvme_pt_command  pt;
+   uint64_tmax_xfer_size;
int32_t off, resid, size;
void*chunk;
 
off = 0;
resid = payload_size;
 
-   if ((chunk = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE)) == NULL)
-   errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE);
+   if (fwug != 0 && fwug != 0xFF)
+   max_xfer_size = ((uint64_t)fwug << 12);
+   else if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, _xfer_size) < 0)
+   err(1, "query max transfer size failed");
+   if (max_xfer_size > NVME_MAX_XFER_SIZE)
+   max_xfer_size = NVME_MAX_XFER_SIZE;
 
+   if ((chunk = aligned_alloc(PAGE_SIZE, max_xfer_size)) == NULL)
+   errx(1, "unable to malloc %zd bytes", (size_t)max_xfer_size);
+
while (resid > 0) {
-   size = (resid >= NVME_MAX_XFER_SIZE) ?
-   NVME_MAX_XFER_SIZE : resid;
+   size = (resid >= (int32_t)max_xfer_size) ?
+   max_xfer_size : resid;
memcpy(chunk, payload + off, size);
 
memset(, 0, sizeof(pt));
@@ -333,7 +341,7 @@ firmware(const struct cmd *f, int argc, char *argv[])
}
 
if (opt.fw_img != NULL) {
-   update_firmware(fd, buf, size);
+   update_firmware(fd, buf, size, cdata.fwug);
if (opt.activate)
activate_action = NVME_AA_REPLACE_ACTIVATE;
else

Modified: head/sbin/nvmecontrol/identify_ext.c
==
--- head/sbin/nvmecontrol/identify_ext.cMon Sep 21 15:44:23 2020
(r365947)
+++ head/sbin/nvmecontrol/identify_ext.cMon Sep 21 15:45:49 2020
(r365948)
@@ -56,6 +56,7 @@ nvme_print_controller(struct nvme_controller_data *cda
uint8_t ns_smart;
uint8_t sqes_max, sqes_min;
uint8_t cqes_max, cqes_min;
+   uint8_t fwug;
 
oncs = cdata->oncs;
compare = (oncs >> NVME_CTRLR_DATA_ONCS_COMPARE_SHIFT) &
@@ -79,6 +80,7 @@ nvme_print_controller(struct nvme_controller_data *cda
NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK;
fw_slot1_ro = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) &
NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK;
+   fwug = cdata->fwug;
 
ns_smart = (cdata->lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) &
NVME_CTRLR_DATA_LPA_NS_SMART_MASK;
@@ -192,6 +194,13 @@ nvme_print_controller(struct nvme_controller_data *cda
uint128_to_str(to128(cdata->untncap.unvmcap),
cbuf, sizeof(cbuf)));
}
+   printf("Firmware Update Granularity: %02x ", fwug);
+   if (fwug == 0)
+   printf("(Not Reported)\n");
+   else if (fwug == 0xFF)
+   printf("(No Granularity)\n");
+   else
+   printf("(%d bytes)\n", ((uint32_t)fwug << 12));
printf("Host Buffer Preferred Size:  %llu bytes\n",
(long long unsigned)cdata->hmpre * 4096);
printf("Host Buffer Minimum Size:%llu bytes\n",
___
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: r365947 - head/sys/kern

2020-09-21 Thread Mitchell Horne
Author: mhorne
Date: Mon Sep 21 15:44:23 2020
New Revision: 365947
URL: https://svnweb.freebsd.org/changeset/base/365947

Log:
  Use getenv_is_true() in init_static_kenv()
  
  A small example of how these functions can be used to simplify checks of
  this nature.
  
  Sponsored by: Klara, Inc.
  Differential Revision:https://reviews.freebsd.org/D26271

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cMon Sep 21 15:41:47 2020
(r365946)
+++ head/sys/kern/kern_environment.cMon Sep 21 15:44:23 2020
(r365947)
@@ -253,7 +253,6 @@ done:
 void
 init_static_kenv(char *buf, size_t len)
 {
-   char *eval;
 
KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized"));
/*
@@ -301,20 +300,17 @@ init_static_kenv(char *buf, size_t len)
 * if the static environment has disabled the loader environment.
 */
kern_envp = static_env;
-   eval = kern_getenv("loader_env.disabled");
-   if (eval == NULL || strcmp(eval, "1") != 0) {
+   if (!getenv_is_true("loader_env.disabled")) {
md_envp = buf;
md_env_len = len;
md_env_pos = 0;
 
-   eval = kern_getenv("static_env.disabled");
-   if (eval != NULL && strcmp(eval, "1") == 0) {
+   if (getenv_is_true("static_env.disabled")) {
kern_envp[0] = '\0';
kern_envp[1] = '\0';
}
}
-   eval = kern_getenv("static_hints.disabled");
-   if (eval != NULL && strcmp(eval, "1") == 0) {
+   if (getenv_is_true("static_hints.disabled")) {
static_hints[0] = '\0';
static_hints[1] = '\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: r365946 - head/sys/dev/nvme

2020-09-21 Thread David Bright
Author: dab
Date: Mon Sep 21 15:41:47 2020
New Revision: 365946
URL: https://svnweb.freebsd.org/changeset/base/365946

Log:
  Add an ioctl to get an NVMe device's maximum transfer size
  
  Reviewed by:  imp, chuck
  Obtained from:Dell EMC Isilon
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D26390

Modified:
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme.h
==
--- head/sys/dev/nvme/nvme.hMon Sep 21 15:24:44 2020(r365945)
+++ head/sys/dev/nvme/nvme.hMon Sep 21 15:41:47 2020(r365946)
@@ -41,6 +41,7 @@
 #defineNVME_PASSTHROUGH_CMD_IOWR('n', 0, struct 
nvme_pt_command)
 #defineNVME_RESET_CONTROLLER   _IO('n', 1)
 #defineNVME_GET_NSID   _IOR('n', 2, struct 
nvme_get_nsid)
+#defineNVME_GET_MAX_XFER_SIZE  _IOR('n', 3, uint64_t)
 
 #defineNVME_IO_TEST_IOWR('n', 100, struct 
nvme_io_test)
 #defineNVME_BIO_TEST   _IOWR('n', 101, struct 
nvme_io_test)

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Mon Sep 21 15:24:44 2020
(r365945)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Mon Sep 21 15:41:47 2020
(r365946)
@@ -1345,6 +1345,9 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_long cmd, caddr_
gnsid->nsid = 0;
break;
}
+   case NVME_GET_MAX_XFER_SIZE:
+   *(uint64_t *)arg = ctrlr->max_xfer_size;
+   break;
default:
return (ENOTTY);
}
___
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: r365945 - in head: share/man/man9 sys/kern sys/sys

2020-09-21 Thread Mitchell Horne
Author: mhorne
Date: Mon Sep 21 15:24:44 2020
New Revision: 365945
URL: https://svnweb.freebsd.org/changeset/base/365945

Log:
  Add getenv(9) boolean parsing functions
  
  This adds the getenv_bool() function, to parse a boolean value from a
  kernel environment variable or tunable. This works for traditional
  boolean values like "0" and "1", and also "true" and "false"
  (case-insensitive). These semantics do not yet apply to sysctls declared
  using SYSCTL_BOOL with CTLFLAG_TUN (they still only parse 1 and 0).
  
  Also added are two wrapper functions, getenv_is_true() and
  getenv_is_false(). These are slightly simpler for callers wishing to
  perform a single check of a configuration variable.
  
  Reviewed by:  jhb (slightly earlier version)
  Sponsored by: NetApp, Inc.
  Sponsored by: Klara, Inc.
  Differential Revision:https://reviews.freebsd.org/D26270

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/getenv.9
  head/sys/kern/kern_environment.c
  head/sys/sys/kernel.h
  head/sys/sys/systm.h

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileMon Sep 21 12:37:41 2020
(r365944)
+++ head/share/man/man9/MakefileMon Sep 21 15:24:44 2020
(r365945)
@@ -1092,6 +1092,9 @@ MLINKS+=getenv.9 freeenv.9 \
getenv.9 getenv_quad.9 \
getenv.9 getenv_uint.9 \
getenv.9 getenv_ulong.9 \
+   getenv.9 getenv_bool.9 \
+   getenv.9 getenv_is_true.9 \
+   getenv.9 getenv_is_false.9 \
getenv.9 kern_getenv.9 \
getenv.9 kern_setenv.9 \
getenv.9 kern_unsetenv.9 \

Modified: head/share/man/man9/getenv.9
==
--- head/share/man/man9/getenv.9Mon Sep 21 12:37:41 2020
(r365944)
+++ head/share/man/man9/getenv.9Mon Sep 21 15:24:44 2020
(r365945)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 1, 2017
+.Dd September 21, 2020
 .Dt GETENV 9
 .Os
 .Sh NAME
@@ -39,6 +39,9 @@
 .Nm getenv_quad ,
 .Nm getenv_uint ,
 .Nm getenv_ulong ,
+.Nm getenv_bool ,
+.Nm getenv_is_true ,
+.Nm getenv_is_false ,
 .Nm kern_setenv ,
 .Nm testenv ,
 .Nm kern_unsetenv
@@ -63,6 +66,12 @@
 .Ft int
 .Fn getenv_ulong "const char *name" "unsigned long *data"
 .Ft int
+.Fn getenv_bool "const char *name" "bool *data"
+.Ft bool
+.Fn getenv_is_true "const char *name"
+.Ft bool
+.Fn getenv_is_false "const char *name"
+.Ft int
 .Fn kern_setenv "const char *name" "const char *value"
 .Ft int
 .Fn testenv "const char *name"
@@ -194,6 +203,28 @@ up to
 characters of its value are copied to the buffer pointed to by
 .Fa data
 followed by a null character and a non-zero value is returned.
+.Pp
+The
+.Fn getenv_bool
+function interprets the value of the kernel environment variable
+.Fa name
+as a boolean value by performing a case-insensitive comparison against the
+strings "1",
+"0",
+"true",
+and "false".
+If the environment variable exists and has a valid boolean value, then that
+value will be copied to the variable pointed to by
+.Fa data .
+If the environment variable exists but is not a boolean value, then a warning
+will be printed to the kernel message buffer.
+The
+.Fn getenv_is_true
+and
+.Fn getenv_is_false
+functions are wrappers around
+.Fn getenv_bool
+that simplify testing for a desired boolean value.
 .Sh RETURN VALUES
 The
 .Fn kern_getenv
@@ -211,12 +242,25 @@ The
 .Fn testenv
 function returns zero if the specified environment variable does not exist and
 a non-zero value if it does exist.
+.Pp
 The
 .Fn getenv_int ,
 .Fn getenv_long ,
 .Fn getenv_string ,
 .Fn getenv_quad ,
 .Fn getenv_uint ,
+.Fn getenv_ulong ,
 and
-.Fn getenv_ulong
+.Fn getenv_bool
 functions return a non-zero value on success and zero on failure.
+.Pp
+The
+.Fn getenv_is_true
+and
+.Fn getenv_is_false
+functions return
+.Dv true
+if the specified environment variable exists and its value matches the desired
+boolean condition, and
+.Dv false
+otherwise.

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cMon Sep 21 12:37:41 2020
(r365944)
+++ head/sys/kern/kern_environment.cMon Sep 21 15:24:44 2020
(r365945)
@@ -942,6 +942,65 @@ error:
 }
 
 /*
+ * Return a boolean value from an environment variable. This can be in
+ * numerical or string form, i.e. "1" or "true".
+ */
+int
+getenv_bool(const char *name, bool *data)
+{
+   char *val;
+   int ret = 0;
+
+   if (name == NULL)
+   return (0);
+
+   val = kern_getenv(name);
+   if (val == NULL)
+   return (0);
+
+   if ((strcmp(val, "1") == 0) || (strcasecmp(val, "true") == 0)) {
+   *data = true;
+   ret = 1;
+   } else if ((strcmp(val, "0") == 0) || (strcasecmp(val, "false") == 0)) {
+   *data = false;

svn commit: r365944 - releng/12.2/sys/geom/part

2020-09-21 Thread Eugene Grosbein
Author: eugen
Date: Mon Sep 21 12:37:41 2020
New Revision: 365944
URL: https://svnweb.freebsd.org/changeset/base/365944

Log:
  MFS r365667,r365920: extend kern.geom.part.check_integrity to work on GPT
  
  There are multiple USB/SATA bridges on the market that unconditionally
  cut some LBAs off connected media. This could be a problem
  for pre-partitioned drives so GEOM complains and does not create
  devices in /dev for slices/partitions preventing access to existing data.
  
  We have a knob kern.geom.part.check_integrity that allows us to correct
  partitioning if changed from default 1 to 0 but it works for MBR only.
  If backup copy of GPT is unavailable due to decreased number of LBAs,
  the kernel does not give access to partitions still and prints to dmesg:
  
  GEOM: md0: corrupt or invalid GPT detected.
  GEOM: md0: GPT rejected -- may not be recoverable.
  
  This change makes it work for GPT too, so it created partitions in /dev
  and prints to dmesg this instead:
  
  GEOM: md0: the secondary GPT table is corrupt or invalid.
  GEOM: md0: using the primary only -- recovery suggested.
  
  Then "gpart recover" re-creates backup copy of GPT
  and allows further manipulations with partitions.
  
  This change is no-op for default configuration having
  kern.geom.part.check_integrity=1
  
  Reported by:  Alex Korchmar
  Approved by:  re (gjb)

Modified:
  releng/12.2/sys/geom/part/g_part.c
  releng/12.2/sys/geom/part/g_part_gpt.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/geom/part/g_part.c
==
--- releng/12.2/sys/geom/part/g_part.c  Mon Sep 21 10:02:11 2020
(r365943)
+++ releng/12.2/sys/geom/part/g_part.c  Mon Sep 21 12:37:41 2020
(r365944)
@@ -135,9 +135,9 @@ struct g_part_alias_list {
 SYSCTL_DECL(_kern_geom);
 SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0,
 "GEOM_PART stuff");
-static u_int check_integrity = 1;
+u_int geom_part_check_integrity = 1;
 SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity,
-CTLFLAG_RWTUN, _integrity, 1,
+CTLFLAG_RWTUN, _part_check_integrity, 1,
 "Enable integrity checking");
 static u_int auto_resize = 1;
 SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize,
@@ -420,7 +420,7 @@ g_part_check_integrity(struct g_part_table *table, str
if (failed != 0) {
printf("GEOM_PART: integrity check failed (%s, %s)\n",
pp->name, table->gpt_scheme->name);
-   if (check_integrity != 0)
+   if (geom_part_check_integrity != 0)
return (EINVAL);
table->gpt_corrupt = 1;
}
@@ -1846,7 +1846,8 @@ g_part_ctlreq(struct gctl_req *req, struct g_class *mp
table = gpp.gpp_geom->softc;
if (table != NULL && table->gpt_corrupt &&
ctlreq != G_PART_CTL_DESTROY &&
-   ctlreq != G_PART_CTL_RECOVER) {
+   ctlreq != G_PART_CTL_RECOVER &&
+   geom_part_check_integrity) {
gctl_error(req, "%d table '%s' is corrupt",
EPERM, gpp.gpp_geom->name);
return;

Modified: releng/12.2/sys/geom/part/g_part_gpt.c
==
--- releng/12.2/sys/geom/part/g_part_gpt.c  Mon Sep 21 10:02:11 2020
(r365943)
+++ releng/12.2/sys/geom/part/g_part_gpt.c  Mon Sep 21 12:37:41 2020
(r365944)
@@ -64,6 +64,8 @@ SYSCTL_UINT(_kern_geom_part_gpt, OID_AUTO, allow_nesti
 CTASSERT(offsetof(struct gpt_hdr, padding) == 92);
 CTASSERT(sizeof(struct gpt_ent) == 128);
 
+extern u_int geom_part_check_integrity;
+
 #defineEQUUID(a,b) (memcmp(a, b, sizeof(struct uuid)) == 0)
 
 #defineMBRSIZE 512
@@ -460,8 +462,9 @@ gpt_read_hdr(struct g_part_gpt_table *table, struct g_
if (hdr->hdr_lba_self != table->lba[elt])
goto fail;
hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt);
-   if (hdr->hdr_lba_alt == hdr->hdr_lba_self ||
-   hdr->hdr_lba_alt > last)
+   if (hdr->hdr_lba_alt == hdr->hdr_lba_self)
+   goto fail;
+   if (hdr->hdr_lba_alt > last && geom_part_check_integrity)
goto fail;
 
/* Check the managed area. */
___
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"


Fax #8943475 received, an answer required

2020-09-21 Thread White Snow via svn-src-all
Invoice urgent notification #82699

Sincerely,
White Snow
___
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: r365943 - head/sys/arm/allwinner

2020-09-21 Thread Andriy Gapon
Author: avg
Date: Mon Sep 21 10:02:11 2020
New Revision: 365943
URL: https://svnweb.freebsd.org/changeset/base/365943

Log:
  aw_usbphy: add support for device mode operation
  
  OTG mode is not supported still.  It's easy to do it as a one-off
  detection, but the proper support requires continuous monitoring and
  communicating the current state to the USB layer.
  
  Also, fix phy0_route setting for H3.  Remove duplicate register
  definitions.
  
  Tested on Orange Pi PC Plus with dr_mode="peripheral" using
hw.usb.template=3
umodem_load="YES"
  
  Reviewed by:  manu
  MFC after:5 weeks
  Differential Revision: https://reviews.freebsd.org/D26348

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

Modified: head/sys/arm/allwinner/aw_usbphy.c
==
--- head/sys/arm/allwinner/aw_usbphy.c  Mon Sep 21 09:50:57 2020
(r365942)
+++ head/sys/arm/allwinner/aw_usbphy.c  Mon Sep 21 10:02:11 2020
(r365943)
@@ -102,7 +102,7 @@ static const struct aw_usbphy_conf h3_usbphy_conf = {
.num_phys = 4,
.phy_type = AWUSBPHY_TYPE_H3,
.pmu_unk1 = true,
-   .phy0_route = false,
+   .phy0_route = true,
 };
 
 static const struct aw_usbphy_conf a64_usbphy_conf = {
@@ -175,8 +175,10 @@ DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_clas
 #define FORCE_ID   (0x3 << 14)
 #define FORCE_ID_SHIFT 14
 #define FORCE_ID_LOW   2
+#define FORCE_ID_HIGH  3
 #define FORCE_VBUS_VALID   (0x3 << 12)
 #define FORCE_VBUS_VALID_SHIFT 12
+#define FORCE_VBUS_VALID_LOW   2
 #define FORCE_VBUS_VALID_HIGH  3
 #define VBUS_CHANGE_DET(1 << 6)
 #define ID_CHANGE_DET  (1 << 5)
@@ -190,18 +192,6 @@ DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_clas
 #define PMU_ULPI_BYPASS(1 << 0)
 #definePMU_UNK_H3  0x10
 #define PMU_UNK_H3_CLR 0x2
-#definePHY_CSR 0x00
-#define ID_PULLUP_EN   (1 << 17)
-#define DPDM_PULLUP_EN (1 << 16)
-#define FORCE_ID   (0x3 << 14)
-#define FORCE_ID_SHIFT 14
-#define FORCE_ID_LOW   2
-#define FORCE_VBUS_VALID   (0x3 << 12)
-#define FORCE_VBUS_VALID_SHIFT 12
-#define FORCE_VBUS_VALID_HIGH  3
-#define VBUS_CHANGE_DET(1 << 6)
-#define ID_CHANGE_DET  (1 << 5)
-#define DPDM_CHANGE_DET(1 << 4)
 
 static void
 awusbphy_configure(device_t dev, int phyno)
@@ -335,7 +325,12 @@ awusbphy_vbus_detect(device_t dev, int *val)
return (0);
}
 
-   *val = 0;
+   /* TODO check vbus_power-supply. */
+
+   /*
+* If there is no way to detect, assume present.
+*/
+   *val = 1;
return (0);
 }
 
@@ -369,10 +364,11 @@ awusbphy_phy_enable(struct phynode *phynode, bool enab
if (error)
goto out;
 
-   if (vbus_det == 1) {
+   /* TODO check vbus_power-supply as well. */
+   if (sc->vbus_det_valid && vbus_det == 1) {
if (bootverbose)
-   device_printf(dev, "External VBUS detected, not 
enabling the regulator\n");
-
+   device_printf(dev, "External VBUS detected, "
+   "not enabling the regulator\n");
return (0);
}
}
@@ -426,36 +422,40 @@ awusbphy_set_mode(struct phynode *phynode, int mode)
return (0);
}
 
+   if (sc->mode == mode)
+   return (0);
+   if (mode == PHY_USB_MODE_OTG)   /* TODO */
+   return (EOPNOTSUPP);
+
+   error = awusbphy_vbus_detect(dev, _det);
+   if (error != 0)
+   return (error);
+
+   val = bus_read_4(sc->phy_ctrl, PHY_CSR);
+   val &= ~(VBUS_CHANGE_DET | ID_CHANGE_DET | DPDM_CHANGE_DET);
+   val |= (ID_PULLUP_EN | DPDM_PULLUP_EN);
+   val &= ~FORCE_VBUS_VALID;
+   val |= (vbus_det ? FORCE_VBUS_VALID_HIGH : FORCE_VBUS_VALID_LOW) <<
+   FORCE_VBUS_VALID_SHIFT;
+   val &= ~FORCE_ID;
+
switch (mode) {
case PHY_USB_MODE_HOST:
-   val = bus_read_4(sc->phy_ctrl, PHY_CSR);
-   val &= ~(VBUS_CHANGE_DET | ID_CHANGE_DET | DPDM_CHANGE_DET);
-   val |= (ID_PULLUP_EN | DPDM_PULLUP_EN);
-   val &= ~FORCE_ID;
val |= (FORCE_ID_LOW << FORCE_ID_SHIFT);
-   val &= ~FORCE_VBUS_VALID;
-   val |= (FORCE_VBUS_VALID_HIGH << FORCE_VBUS_VALID_SHIFT);
-   bus_write_4(sc->phy_ctrl, PHY_CSR, val);
-   if (sc->phy_conf->phy0_route == true) {
-   error = awusbphy_vbus_detect(dev, _det);
-   if (error)
- 

svn commit: r365942 - in stable/12/sys: arm/allwinner/clkng dev/extres/clk

2020-09-21 Thread Andriy Gapon
Author: avg
Date: Mon Sep 21 09:50:57 2020
New Revision: 365942
URL: https://svnweb.freebsd.org/changeset/base/365942

Log:
  MFC r363887 (by manu), r365395: allwinner: clk: Fix nm clock calculation
  
  r363887:
  Use the right factor when finding the best frequency and compare the
  absolute value of the result.
  Submitted by: kibab
  
  r365395:
  aw_clk_nm: fix incorrect use of abs()
  abs() takes a (signed) int as input.
  Instead, it was used with unsigned 64-bit integers.
  So, add and use a new helper function to calculate a difference between
  two uint64_t-s.

Modified:
  stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c
  stable/12/sys/dev/extres/clk/clk.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c
==
--- stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c   Mon Sep 21 09:03:42 
2020(r365941)
+++ stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c   Mon Sep 21 09:50:57 
2020(r365942)
@@ -152,9 +152,10 @@ aw_clk_nm_find_best(struct aw_clk_nm_sc *sc, uint64_t 
min_n = aw_clk_factor_get_min(>n);
 
for (m = min_m; m <= max_m; ) {
-   for (n = min_m; n <= max_n; ) {
+   for (n = min_n; n <= max_n; ) {
cur = fparent / n / m;
-   if (abs(*fout - cur) < abs(*fout - best)) {
+   if (clk_freq_diff(*fout, cur) <
+   clk_freq_diff(*fout, best)) {
best = cur;
*factor_n = n;
*factor_m = m;
@@ -197,7 +198,8 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare
clknode_get_freq(p_clk, );
 
cur = aw_clk_nm_find_best(sc, fparent, fout, , );
-   if ((*fout - cur) < (*fout - best)) {
+   if (clk_freq_diff(*fout, cur) <
+   clk_freq_diff(*fout, best)) {
best = cur;
best_parent = p_idx;
best_n = n;

Modified: stable/12/sys/dev/extres/clk/clk.h
==
--- stable/12/sys/dev/extres/clk/clk.h  Mon Sep 21 09:03:42 2020
(r365941)
+++ stable/12/sys/dev/extres/clk/clk.h  Mon Sep 21 09:50:57 2020
(r365942)
@@ -135,6 +135,12 @@ int clk_get_parent(clk_t clk, clk_t *parent);
 int clk_set_parent_by_clk(clk_t clk, clk_t parent);
 const char *clk_get_name(clk_t clk);
 
+static inline uint64_t
+clk_freq_diff(uint64_t x, uint64_t y)
+{
+   return (x >= y ? x - y : y - x);
+}
+
 #ifdef FDT
 int clk_set_assigned(device_t dev, phandle_t node);
 int clk_get_by_ofw_index(device_t dev, phandle_t node, int idx, clk_t *clk);
___
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: r365939 - head

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 09:03:32 2020
New Revision: 365939
URL: https://svnweb.freebsd.org/changeset/base/365939

Log:
  Prefer bootstrapped tools when running certctl.sh
  
  Otherwise we get lots of warnings when building on Linux/macOS during
  installworld:
  Scanning 
/local/scratch/alr48/cheri/output/freebsd-x86/usr/share/certs/blacklisted for 
certificates...
  install: invalid option -- 'U'
  Try 'install --help' for more information.
  install: invalid option -- 'U'
  
  
  Reviewed By:  kevans
  Differential Revision: https://reviews.freebsd.org/D26481

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Sep 21 09:01:10 2020(r365938)
+++ head/Makefile.inc1  Mon Sep 21 09:03:32 2020(r365939)
@@ -1451,7 +1451,7 @@ distributeworld installworld stageworld: _installcheck
 .endif # make(distributeworld)
 .if !make(packageworld) && ${MK_CAROOT} != "no"
@if which openssl>/dev/null; then \
-   DESTDIR=${CERTCTLDESTDIR} \
+   DESTDIR=${CERTCTLDESTDIR} PATH=${TMPPATH}:${PATH} \
sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} 
rehash \
else \
echo "No openssl on the host, not rehashing certificates target 
-- /etc/ssl may not be populated."; \
___
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: r365941 - head/contrib/nvi/common

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 09:03:42 2020
New Revision: 365941
URL: https://svnweb.freebsd.org/changeset/base/365941

Log:
  Fix vi build on Linux/macOS
  
  This absolute include causes a build failure on Linux for me:
  .../cheri/freebsd/contrib/nvi/cl/../common/common.h:10:10: fatal error: 
'/usr/include/db.h' file not found
  
  This change patches the file to use #include  instead until a
  solution has been found upstream. See also 
https://github.com/lichray/nvi2/issues/69
  
  Reviewed By:  bapt
  Differential Revision: https://reviews.freebsd.org/D26480

Modified:
  head/contrib/nvi/common/common.h

Modified: head/contrib/nvi/common/common.h
==
--- head/contrib/nvi/common/common.hMon Sep 21 09:03:37 2020
(r365940)
+++ head/contrib/nvi/common/common.hMon Sep 21 09:03:42 2020
(r365941)
@@ -7,7 +7,7 @@
  * See the LICENSE file for redistribution information.
  */
 
-#include "/usr/include/db.h"   /* Only include db1. */
+#include /* Only include db1. */
 #include  /* May refer to the bundled regex. */
 
 /*
___
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: r365940 - head/usr.bin/grep

2020-09-21 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 21 09:03:37 2020
New Revision: 365940
URL: https://svnweb.freebsd.org/changeset/base/365940

Log:
  Fix -Wpointer-sign warnings in usr.bin/grep
  
  Reviewed By:  kevans
  Differential Revision: https://reviews.freebsd.org/D26479

Modified:
  head/usr.bin/grep/file.c

Modified: head/usr.bin/grep/file.c
==
--- head/usr.bin/grep/file.cMon Sep 21 09:03:32 2020(r365939)
+++ head/usr.bin/grep/file.cMon Sep 21 09:03:37 2020(r365940)
@@ -55,12 +55,12 @@ __FBSDID("$FreeBSD$");
 #defineMAXBUFSIZ   (32 * 1024)
 #defineLNBUFBUMP   80
 
-static unsigned char *buffer;
-static unsigned char *bufpos;
+static char *buffer;
+static char *bufpos;
 static size_t bufrem;
 static size_t fsiz;
 
-static unsigned char *lnbuf;
+static char *lnbuf;
 static size_t lnbuflen;
 
 static inline int
@@ -97,7 +97,7 @@ grep_lnbufgrow(size_t newlen)
 char *
 grep_fgetln(struct file *f, struct parsec *pc)
 {
-   unsigned char *p;
+   char *p;
char *ret;
size_t len;
size_t off;
___
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: r365938 - in head: . cddl/lib cddl/lib/libzfsbootenv cddl/lib/libzpool lib/libbe libexec/rc libexec/rc/rc.d rescue/rescue sbin/bectl sbin/reboot sbin/zfsbootcfg share/man/man5 share/mk ...

2020-09-21 Thread Toomas Soome
Author: tsoome
Date: Mon Sep 21 09:01:10 2020
New Revision: 365938
URL: https://svnweb.freebsd.org/changeset/base/365938

Log:
  loader: zfs should support bootonce an nextboot
  
  bootonce feature is temporary, one time boot, activated by
  "bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.
  
  By default, the bootonce setting is reset on attempt to boot and the next
  boot will use previously active BE.
  
  By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
  be set permanently active.
  
  bootonce dataset name is recorded in boot pool labels, bootenv area.
  
  in case of nextboot, the nextboot_enable boolean variable is recorded in
  freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
  On boot, the loader will process /boot/nextboot.conf if nextboot_enable
  is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
  processing on next boot.
  
  bootonce and nextboot features are usable in both UEFI and BIOS boot.
  
  To use bootonce/nextboot features, the boot loader needs to be updated on 
disk;
  if loader.efi is stored on ESP, then ESP needs to be updated and
  for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
  (gpart or other tools).
  
  At this time, only lua loader is updated.
  
  Sponsored by: Netflix, Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D25512

Added:
  head/cddl/lib/libzfsbootenv/
  head/cddl/lib/libzfsbootenv/Makefile   (contents, props changed)
  head/stand/common/nvstore.c   (contents, props changed)
Replaced:
  head/sys/contrib/openzfs/lib/libzfsbootenv/.gitignore
  head/sys/contrib/openzfs/lib/libzfsbootenv/Makefile.am
Modified:
  head/Makefile.inc1
  head/cddl/lib/Makefile
  head/cddl/lib/libzpool/Makefile
  head/lib/libbe/Makefile
  head/lib/libbe/be.c
  head/lib/libbe/be.h
  head/lib/libbe/be_impl.h
  head/lib/libbe/be_info.c
  head/lib/libbe/libbe.3
  head/libexec/rc/rc.conf
  head/libexec/rc/rc.d/zfsbe
  head/rescue/rescue/Makefile
  head/sbin/bectl/Makefile
  head/sbin/bectl/bectl.8
  head/sbin/bectl/bectl.c
  head/sbin/bectl/bectl_list.c
  head/sbin/reboot/nextboot.8
  head/sbin/reboot/nextboot.sh
  head/sbin/zfsbootcfg/Makefile
  head/sbin/zfsbootcfg/zfsbootcfg.8
  head/sbin/zfsbootcfg/zfsbootcfg.c
  head/share/man/man5/rc.conf.5
  head/share/mk/bsd.libnames.mk
  head/share/mk/src.libnames.mk
  head/stand/common/bootstrap.h
  head/stand/defaults/loader.conf
  head/stand/efi/boot1/Makefile
  head/stand/efi/boot1/zfs_module.c
  head/stand/efi/loader/Makefile
  head/stand/efi/loader/main.c
  head/stand/forth/support.4th
  head/stand/i386/gptzfsboot/Makefile
  head/stand/i386/loader/Makefile
  head/stand/i386/loader/main.c
  head/stand/i386/zfsboot/Makefile
  head/stand/i386/zfsboot/zfsboot.c
  head/stand/libsa/zfs/Makefile.inc
  head/stand/libsa/zfs/libzfs.h
  head/stand/libsa/zfs/nvlist.c
  head/stand/libsa/zfs/zfs.c
  head/stand/libsa/zfs/zfsimpl.c
  head/stand/loader.mk
  head/stand/lua/config.lua
  head/stand/userboot/test/test.c
  head/stand/userboot/userboot.h
  head/stand/userboot/userboot/Makefile
  head/stand/userboot/userboot/main.c
  head/stand/userboot/userboot/userboot_disk.c
  head/sys/cddl/boot/zfs/zfsimpl.h
  head/tools/tools/zfsboottest/zfsboottest.c

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Sep 21 08:16:42 2020(r365937)
+++ head/Makefile.inc1  Mon Sep 21 09:01:10 2020(r365938)
@@ -2835,7 +2835,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
${_cddl_lib_libtpool} \
${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \
${_cddl_lib_libzutil} \
-   ${_cddl_lib_libctf} \
+   ${_cddl_lib_libctf} ${_cddl_lib_libzfsbootenv} \
lib/libufs \
lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \
${_secure_lib_libcrypto} ${_secure_lib_libssl} \
@@ -2915,6 +2915,7 @@ _cddl_lib_libtpool= cddl/lib/libtpool
 _cddl_lib_libzutil= cddl/lib/libzutil
 _cddl_lib_libzfs_core= cddl/lib/libzfs_core
 _cddl_lib_libzfs= cddl/lib/libzfs
+_cddl_lib_libzfsbootenv= cddl/lib/libzfsbootenv
 
 cddl/lib/libtpool__L: cddl/lib/libspl__L
 
@@ -2928,7 +2929,8 @@ cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/liba
 cddl/lib/libzfs__L: cddl/lib/libnvpair__L cddl/lib/libzutil__L
 cddl/lib/libzfs__L: secure/lib/libcrypto__L
 
-lib/libbe__L: cddl/lib/libzfs__L
+cddl/lib/libzfsbootenv__L: cddl/lib/libzfs__L
+lib/libbe__L: cddl/lib/libzfs__L cddl/lib/libzfsbootenv__L
 .endif
 _cddl_lib_libctf= cddl/lib/libctf
 _cddl_lib= cddl/lib

Modified: head/cddl/lib/Makefile
==
--- head/cddl/lib/Makefile  Mon Sep 21 08:16:42 2020(r365937)
+++ head/cddl/lib/Makefile  Mon Sep 21 09:01:10 2020(r365938)
@@ -15,6 +15,7 @@ SUBDIR=   drti \

svn commit: r365937 - in stable/12/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware

2020-09-21 Thread Navdeep Parhar
Author: np
Date: Mon Sep 21 08:16:42 2020
New Revision: 365937
URL: https://svnweb.freebsd.org/changeset/base/365937

Log:
  MFC r365861 and r365872.
  
  r365861:
  cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0.
  
  r365872:
  cxgbe(4): add the firmware binaries instead of the empty files that were added
  in r365861.
  
  Obtained from:Chelsio Communications
  Sponsored by: Chelsio Communications

Added:
  stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin   (contents, props changed)
 - copied, changed from r365861, 
head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin
  stable/12/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin   (contents, props changed)
 - copied, changed from r365861, 
head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin
  stable/12/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin   (contents, props changed)
 - copied, changed from r365861, 
head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin
Deleted:
  stable/12/sys/dev/cxgbe/firmware/t4fw-1.24.12.0.bin
  stable/12/sys/dev/cxgbe/firmware/t5fw-1.24.12.0.bin
  stable/12/sys/dev/cxgbe/firmware/t6fw-1.24.12.0.bin
Modified:
  stable/12/sys/conf/files
  stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h
  stable/12/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  stable/12/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
  stable/12/sys/modules/cxgbe/t4_firmware/Makefile
  stable/12/sys/modules/cxgbe/t5_firmware/Makefile
  stable/12/sys/modules/cxgbe/t6_firmware/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files
==
--- stable/12/sys/conf/filesMon Sep 21 03:16:10 2020(r365936)
+++ stable/12/sys/conf/filesMon Sep 21 08:16:42 2020(r365937)
@@ -1476,7 +1476,7 @@ t4fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t4fw.fwo"
 t4fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t4fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t4fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t4fw.fw"
@@ -1510,7 +1510,7 @@ t5fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t5fw.fwo"
 t5fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t5fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t5fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t5fw.fw"
@@ -1544,7 +1544,7 @@ t6fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t6fw.fwo"
 t6fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t6fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t6fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t6fw.fw"

Copied and modified: stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin (from 
r365861, head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin)
==
Binary file (source and/or target). No diff available.

Modified: stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h
==
--- stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h   Mon Sep 21 03:16:10 
2020(r365936)
+++ stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h   Mon Sep 21 08:16:42 
2020(r365937)
@@ -4690,6 +4690,7 @@ enum fw_caps_config_crypto {
FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x0001,
FW_CAPS_CONFIG_TLSKEYS = 0x0002,
FW_CAPS_CONFIG_IPSEC_INLINE = 0x0004,
+   FW_CAPS_CONFIG_TLS_HW = 0x0008,
 };
 
 enum fw_caps_config_fcoe {
@@ -4838,6 +4839,7 @@ enum fw_params_param_dev {
FW_PARAMS_PARAM_DEV_TCB_CACHE_FLUSH = 0x2D,
FW_PARAMS_PARAM_DEV_FILTER = 0x2E,
FW_PARAMS_PARAM_DEV_CLIP2_CMD = 0x2F,
+   FW_PARAMS_PARAM_DEV_KTLS_HW = 0x31,
 };
 
 /*
@@ -4874,6 +4876,13 @@ enum fw_params_param_dev_filter{
FW_PARAM_DEV_FILTER_MODE_MASK   = 0x01,
 };
 
+enum fw_params_param_dev_ktls_hw {
+   FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE = 0x00,
+   FW_PARAMS_PARAM_DEV_KTLS_HW_ENABLE  = 0x01,
+