svn commit: r365739 - in head: share/man/man5 share/mk stand tools/build/options

2020-09-14 Thread Brandon Bergren
Author: bdragon
Date: Tue Sep 15 04:22:28 2020
New Revision: 365739
URL: https://svnweb.freebsd.org/changeset/base/365739

Log:
  [PowerPC] Remove obsolete MK_LOADER_FORCE_LE
  
  In D12421, the ability to compile stand/ in little-endian was added, with the
  intention to extend loader.kboot to run in Petitboot.
  
  However, no further work was done, as the kernel then gained self-execution
  capabilities as Petitboot was taught to load FreeBSD kernels directly.
  
  The FreeBSD installer on powerpc64 (on POWER8 and POWER9) uses
  /boot/etc/kboot.conf instead of loader.
  
  As this option does nothing but cause stand/ to be miscompiled and actively
  causes confusion, remove it.
  
  (I have a functioning petitboot loader in my local tree, however, it turned
  out to be quite inconvient to use due to the current petitboot plugin design
  so I put it on hold.)
  
  Reviewed by:  emaste, imp, jhibbits
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D26430

Deleted:
  head/tools/build/options/WITH_LOADER_FORCE_LE
Modified:
  head/share/man/man5/src.conf.5
  head/share/mk/src.opts.mk
  head/stand/defs.mk

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Sep 15 00:22:30 2020
(r365738)
+++ head/share/man/man5/src.conf.5  Tue Sep 15 04:22:28 2020
(r365739)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd September 11, 2020
+.Dd September 14, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -983,9 +983,6 @@ with support for verification based on certificates ob
 .It Va WITH_LOADER_FIREWIRE
 Enable firewire support in /boot/loader on x86. This option is a nop
 on all other platforms.
-.It Va WITH_LOADER_FORCE_LE
-Set to force the powerpc boot loader to launch the kernel in little
-endian mode.
 .It Va WITHOUT_LOADER_GELI
 Disable inclusion of GELI crypto support in the boot chain binaries.
 .Pp

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Tue Sep 15 00:22:30 2020(r365738)
+++ head/share/mk/src.opts.mk   Tue Sep 15 04:22:28 2020(r365739)
@@ -211,7 +211,6 @@ __DEFAULT_NO_OPTIONS = \
 HESIOD \
 LIBSOFT \
 LOADER_FIREWIRE \
-LOADER_FORCE_LE \
 LOADER_VERBOSE \
 LOADER_VERIEXEC_PASS_MANIFEST \
 MALLOC_PRODUCTION \

Modified: head/stand/defs.mk
==
--- head/stand/defs.mk  Tue Sep 15 00:22:30 2020(r365738)
+++ head/stand/defs.mk  Tue Sep 15 04:22:28 2020(r365739)
@@ -175,12 +175,6 @@ DD=dd ${DD_NOSTATUS}
 CFLAGS+=   -G0 -fno-pic -mno-abicalls
 .endif
 
-.if ${MK_LOADER_FORCE_LE} != "no"
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+=   -mlittle-endian
-.endif
-.endif
-
 #
 # Have a sensible default
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365737 - head/sys/geom/eli

2020-09-14 Thread Warner Losh
Author: imp
Date: Mon Sep 14 23:51:14 2020
New Revision: 365737
URL: https://svnweb.freebsd.org/changeset/base/365737

Log:
  We don't need the sc_ekeys_lock in standalone environment.
  
  When we bring in geli into the boot loader, we are single threaded so
  we don't have to worry about locking. We have no mutexes, and don't need
  to use them, so comment it out.
  
  MFC After: 3 days

Modified:
  head/sys/geom/eli/g_eli.h

Modified: head/sys/geom/eli/g_eli.h
==
--- head/sys/geom/eli/g_eli.h   Mon Sep 14 23:49:17 2020(r365736)
+++ head/sys/geom/eli/g_eli.h   Mon Sep 14 23:51:14 2020(r365737)
@@ -181,7 +181,9 @@ struct g_eli_softc {
uint8_t  sc_ekey[G_ELI_DATAKEYLEN];
TAILQ_HEAD(, g_eli_key) sc_ekeys_queue;
RB_HEAD(g_eli_key_tree, g_eli_key) sc_ekeys_tree;
+#ifndef _STANDALONE
struct mtx   sc_ekeys_lock;
+#endif
uint64_t sc_ekeys_total;
uint64_t sc_ekeys_allocated;
u_intsc_ealgo;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365735 - head/sys/dev/iicbus

2020-09-14 Thread Warner Losh
Author: imp
Date: Mon Sep 14 23:30:04 2020
New Revision: 365735
URL: https://svnweb.freebsd.org/changeset/base/365735

Log:
  Don't do the busy dance in icee_open/close
  
  We don't need to do the busy dance for this driver. It's handled by
  destroy_dev() entirely. Since all we did was busy/unbusy in
  open/close, just delete them. We therefore don't need to track closes
  either.
  
  Reviewed by: ian@
  Differential Revision: https://reviews.freebsd.org/D26431

Modified:
  head/sys/dev/iicbus/icee.c

Modified: head/sys/dev/iicbus/icee.c
==
--- head/sys/dev/iicbus/icee.c  Mon Sep 14 23:27:51 2020(r365734)
+++ head/sys/dev/iicbus/icee.c  Mon Sep 14 23:30:04 2020(r365735)
@@ -113,17 +113,12 @@ static struct ofw_compat_data compat_data[] = {
 #define CDEV2SOFTC(dev)((dev)->si_drv1)
 
 /* cdev routines */
-static d_open_t icee_open;
-static d_close_t icee_close;
 static d_read_t icee_read;
 static d_write_t icee_write;
 
 static struct cdevsw icee_cdevsw =
 {
.d_version = D_VERSION,
-   .d_flags = D_TRACKCLOSE,
-   .d_open = icee_open,
-   .d_close = icee_close,
.d_read = icee_read,
.d_write = icee_write
 };
@@ -227,28 +222,6 @@ icee_detach(device_t dev)
struct icee_softc *sc = device_get_softc(dev);
 
destroy_dev(sc->cdev);
-   return (0);
-}
-
-static int 
-icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
-{
-   struct icee_softc *sc;
-
-   sc = CDEV2SOFTC(dev);
-   if (device_get_state(sc->dev) < DS_BUSY)
-   device_busy(sc->dev);
-
-   return (0);
-}
-
-static int
-icee_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
-{
-   struct icee_softc *sc;
-
-   sc = CDEV2SOFTC(dev);
-   device_unbusy(sc->dev);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365734 - head/sys/sys

2020-09-14 Thread Warner Losh
Author: imp
Date: Mon Sep 14 23:27:51 2020
New Revision: 365734
URL: https://svnweb.freebsd.org/changeset/base/365734

Log:
  Tweak what's visible in the standalone environment. We define offsetof
  in stand.h typically, but when this is included we can define it
  multiple times. However, we don't define bool in stand.h at the
  moment, so allow it to be defined inside types.h when we're building
  for the standalone environment.
  
  MFC After: 3 days

Modified:
  head/sys/sys/types.h

Modified: head/sys/sys/types.h
==
--- head/sys/sys/types.hMon Sep 14 22:42:17 2020(r365733)
+++ head/sys/sys/types.hMon Sep 14 23:27:51 2020(r365734)
@@ -292,6 +292,10 @@ typedef__uint64_t  uoff_t;
 typedefcharvm_memattr_t;   /* memory attribute codes */
 typedefstruct vm_page  *vm_page_t;
 
+#define offsetof(type, field) __offsetof(type, field)
+#endif /* _KERNEL */
+
+#ifdefined(_KERNEL) || defined(_STANDALONE)
 #if !defined(__bool_true_false_are_defined) && !defined(__cplusplus)
 #define__bool_true_false_are_defined   1
 #definefalse   0
@@ -301,10 +305,7 @@ typedefint _Bool;
 #endif
 typedef_Bool   bool;
 #endif /* !__bool_true_false_are_defined && !__cplusplus */
-
-#define offsetof(type, field) __offsetof(type, field)
-
-#endif /* _KERNEL */
+#endif /* KERNEL || _STANDALONE */
 
 /*
  * The following are all things that really shouldn't exist in this header,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365732 - head/sys/dev/cxgbe/common

2020-09-14 Thread Navdeep Parhar
Author: np
Date: Mon Sep 14 22:15:54 2020
New Revision: 365732
URL: https://svnweb.freebsd.org/changeset/base/365732

Log:
  cxgbe(4): Get the count of FCS errors from the MAC and not MPS for T6 ports.
  
  The MPS register on the T6 counts something other than FCS errors despite its
  name.
  
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Mon Sep 14 21:33:11 2020
(r365731)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Mon Sep 14 22:15:54 2020
(r365732)
@@ -6853,6 +6853,7 @@ void t4_get_port_stats_offset(struct adapter *adap, in
 void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p)
 {
u32 bgmap = adap2pinfo(adap, idx)->mps_bg_map;
+   struct link_config *lc = >port[idx]->link_cfg;
u32 stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL);
 
 #define GET_STAT(name) \
@@ -6902,7 +6903,6 @@ void t4_get_port_stats(struct adapter *adap, int idx, 
p->rx_ucast_frames  = GET_STAT(RX_PORT_UCAST);
p->rx_too_long  = GET_STAT(RX_PORT_MTU_ERROR);
p->rx_jabber= GET_STAT(RX_PORT_MTU_CRC_ERROR);
-   p->rx_fcs_err   = GET_STAT(RX_PORT_CRC_ERROR);
p->rx_len_err   = GET_STAT(RX_PORT_LEN_ERROR);
p->rx_symbol_err= GET_STAT(RX_PORT_SYM_ERROR);
p->rx_runt  = GET_STAT(RX_PORT_LESS_64B);
@@ -6922,6 +6922,26 @@ void t4_get_port_stats(struct adapter *adap, int idx, 
p->rx_ppp6  = GET_STAT(RX_PORT_PPP6);
p->rx_ppp7  = GET_STAT(RX_PORT_PPP7);
 
+   /*
+* The T6's MPS's RX_PORT_CRC_ERROR register doesn't actually count CRC
+* errors so get that information from the MAC instead.  Which MAC is in
+* use depends on speed and FEC.  The MAC counters clear on reset or
+* link state change so we are only reporting errors for this
+* incarnation of the link here.
+*/
+   if (chip_id(adap) != CHELSIO_T6)
+   p->rx_fcs_err = GET_STAT(RX_PORT_CRC_ERROR);
+   else if (lc->link_ok) {
+   if (lc->speed > 25000 ||
+   (lc->speed == 25000 && lc->fec == FEC_RS)) {
+   p->rx_fcs_err = t4_read_reg64(adap, T5_PORT_REG(idx,
+   A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS));
+   } else {
+   p->rx_fcs_err = t4_read_reg64(adap, T5_PORT_REG(idx,
+   A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS));
+   }
+   }
+
if (chip_id(adap) >= CHELSIO_T5) {
if (stat_ctl & F_COUNTPAUSESTATRX) {
p->rx_frames -= p->rx_pause;
@@ -10757,6 +10777,12 @@ void t4_clr_port_stats(struct adapter *adap, int idx)
t4_write_reg(adap,
A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L + i * 8, 0);
}
+   if (chip_id(adap) == CHELSIO_T6) {
+   t4_write_reg64(adap, T5_PORT_REG(idx,
+   A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS), 0);
+   t4_write_reg64(adap, T5_PORT_REG(idx,
+   A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS), 0);
+   }
 }
 
 /**
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365729 - head/sys/dev/usb

2020-09-14 Thread Ian Lepore
Author: ian
Date: Mon Sep 14 17:33:28 2020
New Revision: 365729
URL: https://svnweb.freebsd.org/changeset/base/365729

Log:
  Add product ID strings for a couple Microchip usb hubs.  Also, update the
  vendor ID string to say just "Microchip Technology" -- the buyout of
  Standard Microsystems happened in 2012 and the SMC/SMSC names are pretty
  much retired at this point.
  
  PR:   241406

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsMon Sep 14 17:21:52 2020(r365728)
+++ head/sys/dev/usb/usbdevsMon Sep 14 17:33:28 2020(r365729)
@@ -103,7 +103,7 @@ vendor CREATIVE 0x041e  Creative Labs
 vendor NOKIA   0x0421  Nokia
 vendor ADI 0x0422  ADI Systems
 vendor CATC0x0423  Computer Access Technology
-vendor SMC20x0424  Microchip (Standard Microsystems)
+vendor SMC20x0424  Microchip Technology
 vendor MOTOROLA_HK 0x0425  Motorola HK
 vendor GRAVIS  0x0428  Advanced Gravis Computer
 vendor CIRRUSLOGIC 0x0429  Cirrus Logic
@@ -4427,13 +4427,15 @@ product SMART2 G2MEMKEY 0x1700  G2 Memory Key
 product SMARTBRIDGES SMARTLINK 0x0001  SmartLink USB Ethernet
 product SMARTBRIDGES SMARTNIC  0x0003  smartNIC 2 PnP Ethernet
 
-/* SMC products */
+/* Microchip Technology (formerly SMC) products */
 product SMC 2102USB0x0100  10Mbps Ethernet
 product SMC 2202USB0x0200  10/100 Ethernet
 product SMC 2206USB0x0201  EZ Connect USB Ethernet
 product SMC 2862WG 0xee13  EZ Connect Wireless Adapter
 product SMC2 2020HUB   0x2020  USB Hub
+product SMC2 2513HUB   0x2513  USB Hub
 product SMC2 2514HUB   0x2514  USB Hub
+product SMC2 2517HUB   0x2517  USB Hub
 product SMC3 2662WUSB  0xa002  2662W-AR Wireless
 product SMC2 LAN7800_ETH   0x7800  USB/Ethernet
 product SMC2 LAN7801_ETH   0x7801  USB/Ethernet
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365720 - head/sys/conf

2020-09-14 Thread Warner Losh
On Mon, Sep 14, 2020 at 8:45 AM Gordon Tetlow  wrote:

> Author: gordon
> Date: Mon Sep 14 14:45:30 2020
> New Revision: 365720
> URL: https://svnweb.freebsd.org/changeset/base/365720
>
> Log:
>   Partially revert r346018 and use the if/then construct instead of shell.
>
>   There are a couple of places in the tree that directly parse the
> newvers.sh
>   script looking for the BRANCH variable. I found two locations, one in
>   release/Makefile and the other in bin/freebsd-version/Makefile.
>
>   While there is a good argument that BRANCH_OVERRIDE should properly
>   propagate in those circumstances and the new behavior is thus better, the
>   reality is this change broke freebsd-update's ability to find timestamps
> in
>   binaries and resulted in a large number of gratuitous changes.
>

Where? I fixed all those ages ago.

Warner


>   Reported by:  freebsd-update
>   Discussed with:   cperciva
>   MFC after:1 day
>
> Modified:
>   head/sys/conf/newvers.sh
>
> Modified: head/sys/conf/newvers.sh
>
> ==
> --- head/sys/conf/newvers.shMon Sep 14 14:24:54 2020(r365719)
> +++ head/sys/conf/newvers.shMon Sep 14 14:45:30 2020(r365720)
> @@ -54,7 +54,10 @@
>
>  TYPE="FreeBSD"
>  REVISION="13.0"
> -BRANCH="${BRANCH_OVERRIDE:-CURRENT}"
> +BRANCH="CURRENT"
> +if [ -n "${BRANCH_OVERRIDE}" ]; then
> +   BRANCH=${BRANCH_OVERRIDE}
> +fi
>  RELEASE="${REVISION}-${BRANCH}"
>  VERSION="${TYPE} ${RELEASE}"
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365727 - in head/usr.bin: . gprof

2020-09-14 Thread Andrew Turner
Author: andrew
Date: Mon Sep 14 16:18:53 2020
New Revision: 365727
URL: https://svnweb.freebsd.org/changeset/base/365727

Log:
  Cleanups for gprof:
  
   * Remove identical or almost identical headers
   * Only build aout.c on amd64 and i386. None of the the other current
 architectures ever supported running a.out binaries
   * Enable on all architectures
  
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D26369

Deleted:
  head/usr.bin/gprof/amd64.h
  head/usr.bin/gprof/arm.h
  head/usr.bin/gprof/i386.h
  head/usr.bin/gprof/mips.h
  head/usr.bin/gprof/powerpc.h
  head/usr.bin/gprof/riscv.h
  head/usr.bin/gprof/sparc64.h
Modified:
  head/usr.bin/Makefile
  head/usr.bin/gprof/Makefile
  head/usr.bin/gprof/gprof.h

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Mon Sep 14 16:12:28 2020(r365726)
+++ head/usr.bin/Makefile   Mon Sep 14 16:18:53 2020(r365727)
@@ -262,11 +262,7 @@ SUBDIR.${MK_TOOLCHAIN}+=   ctags
 SUBDIR.${MK_TOOLCHAIN}+=   cxxfilt
 SUBDIR.${MK_TOOLCHAIN}+=   objcopy
 SUBDIR.${MK_TOOLCHAIN}+=   file2c
-# ARM64TODO gprof does not build
-# RISCVTODO gprof does not build
-.if ${MACHINE_ARCH} != "aarch64"
 SUBDIR.${MK_TOOLCHAIN}+=   gprof
-.endif
 SUBDIR.${MK_TOOLCHAIN}+=   indent
 SUBDIR.${MK_TOOLCHAIN}+=   lex
 SUBDIR.${MK_TOOLCHAIN}+=   mkstr

Modified: head/usr.bin/gprof/Makefile
==
--- head/usr.bin/gprof/Makefile Mon Sep 14 16:12:28 2020(r365726)
+++ head/usr.bin/gprof/Makefile Mon Sep 14 16:18:53 2020(r365727)
@@ -5,8 +5,7 @@ PROG=   gprof
 SRCS=  gprof.c arcs.c dfn.c elf.c lookup.c hertz.c \
printgprof.c printlist.c kernel.c
 
-.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv" && \
-${MACHINE_ARCH} != "s390x"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" 
 SRCS+= aout.c
 CFLAGS+=   -DWITH_AOUT
 .endif

Modified: head/usr.bin/gprof/gprof.h
==
--- head/usr.bin/gprof/gprof.h  Mon Sep 14 16:12:28 2020(r365726)
+++ head/usr.bin/gprof/gprof.h  Mon Sep 14 16:18:53 2020(r365727)
@@ -39,27 +39,14 @@
 #include 
 #include 
 
-#if __amd64__
-#   include "amd64.h"
-#endif
-#if __arm__
-#   include "arm.h"
-#endif
-#if __i386__
-#   include "i386.h"
-#endif
-#if __mips__
-#   include "mips.h"
-#endif
-#if __powerpc__
-#   include "powerpc.h"
-#endif
-#if __sparc64__
-#   include "sparc64.h"
-#endif
-#if __riscv
-#include "riscv.h"
-#endif
+/*
+ * offset (in bytes) of the code from the entry address of a routine.
+ * (see asgnsamples for use and explanation.)
+ */
+#define OFFSET_OF_CODE 0
+
+enum opermodes { dummy };
+typedef enum opermodes operandenum;
 
 /*
  * booleans
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365726 - in head: cddl/lib/libzfs cddl/lib/libzpool lib/libpmc share/mk sys/conf tests/sys/kern usr.bin/gcore

2020-09-14 Thread Andrew Turner



> On 14 Sep 2020, at 17:12, Andrew Turner  wrote:
> 
> Author: andrew
> Date: Mon Sep 14 16:12:28 2020
> New Revision: 365726
> URL: https://svnweb.freebsd.org/changeset/base/365726
> 
> Log:
>  Use MACHINE_CPUARCH when checking for arm64
> 
>  Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run
>  on any 64-bit Arm instruction set. This will simplify checks in downstream
>  consumers targeting prototype instruction sets.
> 
>  The only place we check for MACHINE_ARCH == aarch64 is when building the
>  device tree blobs. As these are targeting current generation ISAs.
> 
>  Sponsored by:Innovate UK
>  Differential Revision:   https://reviews.freebsd.org/D26370
I missed:

Reviewed by: brooks

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


svn commit: r365726 - in head: cddl/lib/libzfs cddl/lib/libzpool lib/libpmc share/mk sys/conf tests/sys/kern usr.bin/gcore

2020-09-14 Thread Andrew Turner
Author: andrew
Date: Mon Sep 14 16:12:28 2020
New Revision: 365726
URL: https://svnweb.freebsd.org/changeset/base/365726

Log:
  Use MACHINE_CPUARCH when checking for arm64
  
  Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run
  on any 64-bit Arm instruction set. This will simplify checks in downstream
  consumers targeting prototype instruction sets.
  
  The only place we check for MACHINE_ARCH == aarch64 is when building the
  device tree blobs. As these are targeting current generation ISAs.
  
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D26370

Modified:
  head/cddl/lib/libzfs/Makefile
  head/cddl/lib/libzpool/Makefile
  head/lib/libpmc/Makefile
  head/share/mk/bsd.endian.mk
  head/share/mk/bsd.sys.mk
  head/sys/conf/dtb.build.mk
  head/tests/sys/kern/Makefile
  head/usr.bin/gcore/Makefile

Modified: head/cddl/lib/libzfs/Makefile
==
--- head/cddl/lib/libzfs/Makefile   Mon Sep 14 15:58:10 2020
(r365725)
+++ head/cddl/lib/libzfs/Makefile   Mon Sep 14 16:12:28 2020
(r365726)
@@ -82,7 +82,7 @@ CFLAGS +=  -DHAVE_SSE2
 ARCH_C +=  zfs_fletcher_avx512.c
 CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F
 .endif
-.if ${MACHINE_ARCH} == "aarch64"
+.if ${MACHINE_CPUARCH} == "aarch64"
 ARCH_C +=  zfs_fletcher_aarch64_neon.c
 .endif
 

Modified: head/cddl/lib/libzpool/Makefile
==
--- head/cddl/lib/libzpool/Makefile Mon Sep 14 15:58:10 2020
(r365725)
+++ head/cddl/lib/libzpool/Makefile Mon Sep 14 16:12:28 2020
(r365726)
@@ -187,7 +187,7 @@ ARCH_C +=   zfs_fletcher_avx512.c
 CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F \
-DHAVE_AVX512BW
 .endif
-.if ${MACHINE_ARCH} == "aarch64"
+.if ${MACHINE_CPUARCH} == "aarch64"
 ARCH_C +=  zfs_fletcher_aarch64_neon.c
 .endif
 

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileMon Sep 14 15:58:10 2020(r365725)
+++ head/lib/libpmc/MakefileMon Sep 14 16:12:28 2020(r365726)
@@ -7,10 +7,10 @@ INCS= pmc.h pmclog.h pmcformat.h
 
 CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat
 
-.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
 ${MACHINE_ARCH} == "i386"
 
-.if ${MACHINE_ARCH} == "aarch64"
+.if ${MACHINE_CPUARCH} == "aarch64"
 EVENT_ARCH="arm64"
 .elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 EVENT_ARCH="x86"

Modified: head/share/mk/bsd.endian.mk
==
--- head/share/mk/bsd.endian.mk Mon Sep 14 15:58:10 2020(r365725)
+++ head/share/mk/bsd.endian.mk Mon Sep 14 16:12:28 2020(r365726)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-.if ${MACHINE_ARCH} == "aarch64" || \
+.if ${MACHINE_CPUARCH} == "aarch64" || \
 ${MACHINE_ARCH} == "amd64" || \
 ${MACHINE_ARCH} == "i386" || \
 (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkMon Sep 14 15:58:10 2020(r365725)
+++ head/share/mk/bsd.sys.mkMon Sep 14 16:12:28 2020(r365726)
@@ -187,7 +187,7 @@ CWARNFLAGS+=
-Wno-error=aggressive-loop-optimizations
 .endif
 
 # GCC's own arm_neon.h triggers various warnings
-.if ${MACHINE_ARCH} == "aarch64"
+.if ${MACHINE_CPUARCH} == "aarch64"
 CWARNFLAGS+=   -Wno-system-headers
 .endif
 .endif # gcc

Modified: head/sys/conf/dtb.build.mk
==
--- head/sys/conf/dtb.build.mk  Mon Sep 14 15:58:10 2020(r365725)
+++ head/sys/conf/dtb.build.mk  Mon Sep 14 16:12:28 2020(r365726)
@@ -22,7 +22,7 @@ SYSDIR=   ${S}
 .for _dts in ${DTS}
 # DTB for aarch64 needs to preserve the immediate parent of the .dts, because
 # these DTS are vendored and should be installed into their vendored directory.
-.if ${MACHINE_ARCH} == "aarch64"
+.if ${MACHINE_CPUARCH} == "aarch64"
 DTB+=  ${_dts:R:S/$/.dtb/}
 .else
 DTB+=  ${_dts:T:R:S/$/.dtb/}

Modified: head/tests/sys/kern/Makefile
==
--- head/tests/sys/kern/MakefileMon Sep 14 15:58:10 2020
(r365725)
+++ head/tests/sys/kern/MakefileMon Sep 14 16:12:28 2020
(r365726)
@@ -57,7 +57,7 @@ LIBADD.mqueue_test+=  rt
 
 .if ${MACHINE_ARCH} == "amd64" || \
 ${MACHINE_ARCH} == "i386" || \
-${MACHINE_ARCH} == "aarch64"
+${MACHINE_CPUARCH} == "aarch64"
 ATF_TESTS_C+=  libkern_crc32
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 LDADD.libkern_crc32+=  

svn commit: r365725 - head/release

2020-09-14 Thread Glen Barber
Author: gjb
Date: Mon Sep 14 15:58:10 2020
New Revision: 365725
URL: https://svnweb.freebsd.org/changeset/base/365725

Log:
  Fix setting RELENGDIR when release.sh is called from an external
  script.
  
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  head/release/release.sh

Modified: head/release/release.sh
==
--- head/release/release.sh Mon Sep 14 15:48:30 2020(r365724)
+++ head/release/release.sh Mon Sep 14 15:58:10 2020(r365725)
@@ -57,7 +57,9 @@ usage() {
 env_setup() {
# The directory within which the release will be built.
CHROOTDIR="/scratch"
-   RELENGDIR="$(dirname $(realpath ${0}))"
+   if [ -z "${RELENGDIR}" ]; then
+   export RELENGDIR="$(dirname $(realpath ${0}))"
+   fi
 
# The default version control system command to obtain the sources.
for _dir in /usr/bin /usr/local/bin; do
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365724 - in head/stand: ficl ficl/powerpc powerpc/ofw

2020-09-14 Thread Brandon Bergren
Author: bdragon
Date: Mon Sep 14 15:48:30 2020
New Revision: 365724
URL: https://svnweb.freebsd.org/changeset/base/365724

Log:
  stand/ficl 64-bit compatibility
  
  Currently, the only thing that prevents a functioning 64-bit FICL build is
  a few integer types that were intended to be fixed-width.
  
  Changing them to C99 integer types allows building a functioning 64-bit
  FICL.
  
  While this isn't applicable to the default settings of any in-tree loaders,
  it is necessary for a future Petitboot loader, due to the requirement that
  it be compiled as a 64-bit program.
  
  Reviewed by:  tsoome, imp (earlier revision)
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D26364

Modified:
  head/stand/ficl/ficl.h
  head/stand/ficl/powerpc/sysdep.h
  head/stand/powerpc/ofw/main.c

Modified: head/stand/ficl/ficl.h
==
--- head/stand/ficl/ficl.h  Mon Sep 14 15:20:37 2020(r365723)
+++ head/stand/ficl/ficl.h  Mon Sep 14 15:48:30 2020(r365724)
@@ -249,7 +249,7 @@ typedef struct ficl_system_info FICL_SYSTEM_INFO;
 ** complement of false... that unifies logical and bitwise operations
 ** nicely.
 */
-#define FICL_TRUE  ((unsigned long)~(0L))
+#define FICL_TRUE  ((FICL_UNS)~(0LL))
 #define FICL_FALSE (0)
 #define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE)
 

Modified: head/stand/ficl/powerpc/sysdep.h
==
--- head/stand/ficl/powerpc/sysdep.hMon Sep 14 15:20:37 2020
(r365723)
+++ head/stand/ficl/powerpc/sysdep.hMon Sep 14 15:48:30 2020
(r365724)
@@ -79,15 +79,15 @@
 ** System dependent data type declarations...
 */
 #if !defined INT32
-#define INT32 int
+#define INT32 int32_t
 #endif
 
 #if !defined UNS32
-#define UNS32 unsigned int
+#define UNS32 uint32_t
 #endif
 
 #if !defined UNS16
-#define UNS16 unsigned short
+#define UNS16 uint16_t
 #endif
 
 #if !defined UNS8
@@ -367,6 +367,9 @@ typedef struct
 */
 #if !defined FICL_ALIGN
 #define FICL_ALIGN 2
+#endif
+
+#if !defined FICL_ALIGN_ADD
 #define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
 #endif
 

Modified: head/stand/powerpc/ofw/main.c
==
--- head/stand/powerpc/ofw/main.c   Mon Sep 14 15:20:37 2020
(r365723)
+++ head/stand/powerpc/ofw/main.c   Mon Sep 14 15:48:30 2020
(r365724)
@@ -63,7 +63,7 @@ init_heap(void)
 {
bzero(heap, HEAP_SIZE);
 
-   setheap(heap, (void *)((int)heap + HEAP_SIZE));
+   setheap(heap, (void *)((uintptr_t)heap + HEAP_SIZE));
 }
 
 uint64_t
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365723 - head/sys/powerpc/powerpc

2020-09-14 Thread Brandon Bergren
Author: bdragon
Date: Mon Sep 14 15:20:37 2020
New Revision: 365723
URL: https://svnweb.freebsd.org/changeset/base/365723

Log:
  [PowerPC] Make cpu frequency detection endian-independent
  
  On ibm,extended-clock-frequency, ensure we be64toh() the value.
  
  On clock-frequency, remove the right-shifting hack (which was needed due to
  reading a 32 bit value into a 64 bit variable) and switch to OF_getencprop()
  for reading (which will handle endian conversion internally.)
  
  Reviewed by:  jhibbits (in irc)
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/powerpc/cpu.c
==
--- head/sys/powerpc/powerpc/cpu.c  Mon Sep 14 14:53:09 2020
(r365722)
+++ head/sys/powerpc/powerpc/cpu.c  Mon Sep 14 15:20:37 2020
(r365723)
@@ -72,6 +72,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -358,6 +359,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *cps)
uint16_tvers;
register_t  msr;
phandle_t   cpu, dev, root;
+   uint32_tfreq32;
int res  = 0;
charbuf[8];
 
@@ -428,10 +430,11 @@ cpu_est_clockrate(int cpu_id, uint64_t *cps)
return (ENOENT);
if (OF_getprop(cpu, "ibm,extended-clock-frequency",
cps, sizeof(*cps)) >= 0) {
+   *cps = be64toh(*cps);
return (0);
-   } else if (OF_getprop(cpu, "clock-frequency", cps, 
-   sizeof(cell_t)) >= 0) {
-   *cps >>= 32;
+   } else if (OF_getencprop(cpu, "clock-frequency",
+   , sizeof(freq32)) >= 0) {
+   *cps = freq32;
return (0);
} else {
return (ENOENT);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365720 - head/sys/conf

2020-09-14 Thread Gordon Tetlow
Author: gordon
Date: Mon Sep 14 14:45:30 2020
New Revision: 365720
URL: https://svnweb.freebsd.org/changeset/base/365720

Log:
  Partially revert r346018 and use the if/then construct instead of shell.
  
  There are a couple of places in the tree that directly parse the newvers.sh
  script looking for the BRANCH variable. I found two locations, one in
  release/Makefile and the other in bin/freebsd-version/Makefile.
  
  While there is a good argument that BRANCH_OVERRIDE should properly
  propagate in those circumstances and the new behavior is thus better, the
  reality is this change broke freebsd-update's ability to find timestamps in
  binaries and resulted in a large number of gratuitous changes.
  
  Reported by:  freebsd-update
  Discussed with:   cperciva
  MFC after:1 day

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shMon Sep 14 14:24:54 2020(r365719)
+++ head/sys/conf/newvers.shMon Sep 14 14:45:30 2020(r365720)
@@ -54,7 +54,10 @@
 
 TYPE="FreeBSD"
 REVISION="13.0"
-BRANCH="${BRANCH_OVERRIDE:-CURRENT}"
+BRANCH="CURRENT"
+if [ -n "${BRANCH_OVERRIDE}" ]; then
+   BRANCH=${BRANCH_OVERRIDE}
+fi
 RELEASE="${REVISION}-${BRANCH}"
 VERSION="${TYPE} ${RELEASE}"
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365719 - head/sys/dev/mlx5/mlx5_en

2020-09-14 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 14 14:24:54 2020
New Revision: 365719
URL: https://svnweb.freebsd.org/changeset/base/365719

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

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cMon Sep 14 12:22:19 2020
(r365718)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cMon Sep 14 14:24:54 2020
(r365719)
@@ -1073,7 +1073,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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365713 - in head: lib/libbe/tests sbin/bectl/tests

2020-09-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 14 10:35:39 2020
New Revision: 365713
URL: https://svnweb.freebsd.org/changeset/base/365713

Log:
  Skip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2").
  
  PR:   249229
  Sponsored by: DARPA

Modified:
  head/lib/libbe/tests/be_create.sh
  head/sbin/bectl/tests/bectl_test.sh

Modified: head/lib/libbe/tests/be_create.sh
==
--- head/lib/libbe/tests/be_create.sh   Mon Sep 14 10:17:07 2020
(r365712)
+++ head/lib/libbe/tests/be_create.sh   Mon Sep 14 10:35:39 2020
(r365713)
@@ -93,6 +93,11 @@ libbe_create_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(atf_get_srcdir)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img

Modified: head/sbin/bectl/tests/bectl_test.sh
==
--- head/sbin/bectl/tests/bectl_test.sh Mon Sep 14 10:17:07 2020
(r365712)
+++ head/sbin/bectl/tests/bectl_test.sh Mon Sep 14 10:35:39 2020
(r365713)
@@ -98,6 +98,11 @@ bectl_create_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -153,6 +158,11 @@ bectl_destroy_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -238,6 +248,11 @@ bectl_export_import_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -271,6 +286,11 @@ bectl_list_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -311,6 +331,11 @@ bectl_mount_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -350,6 +375,11 @@ bectl_rename_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -382,6 +412,11 @@ bectl_jail_body()
atf_skip "https://bugs.freebsd.org/249055;
fi
 
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
@@ -455,6 +490,11 @@ bectl_jail_cleanup()
if [ "$(atf_config_get ci false)" = "true" ] && \
[ "$(uname -p)" = "i386" ]; then
atf_skip "https://bugs.freebsd.org/249055;
+   fi
+
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "armv7" ]; then
+   atf_skip "https://bugs.freebsd.org/249229;
fi
 
zpool=$(get_zpool_name)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365712 - head/sys/kern

2020-09-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 14 10:17:07 2020
New Revision: 365712
URL: https://svnweb.freebsd.org/changeset/base/365712

Log:
  Move td_softdep_cleanup() from userret() to ast(); it's infrequent
  at best.  The schedule_cleanup() function already sets TDF_ASTPENDING.
  
  Reviewed by:  kib, mckusick
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26375

Modified:
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/subr_trap.c
==
--- head/sys/kern/subr_trap.c   Mon Sep 14 10:14:03 2020(r365711)
+++ head/sys/kern/subr_trap.c   Mon Sep 14 10:17:07 2020(r365712)
@@ -134,9 +134,6 @@ userret(struct thread *td, struct trapframe *frame)
KTRUSERRET(td);
 #endif
 
-   td_softdep_cleanup(td);
-   MPASS(td->td_su == NULL);
-
/*
 * Charge system time if profiling.
 */
@@ -188,8 +185,6 @@ userret(struct thread *td, struct trapframe *frame)
("userret: Returning with preallocated vnode"));
KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0,
("userret: Returning with stop signals deferred"));
-   KASSERT(td->td_su == NULL,
-   ("userret: Returning with SU cleanup request not handled"));
KASSERT(td->td_vslock_sz == 0,
("userret: Returning with vslock-wired space"));
 #ifdef VIMAGE
@@ -278,6 +273,9 @@ ast(struct trapframe *framep)
ktrcsw(0, 1, __func__);
 #endif
}
+
+   td_softdep_cleanup(td);
+   MPASS(td->td_su == NULL);
 
/*
 * If this thread tickled GEOM, we need to wait for the giggling to
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365711 - in head/sys: geom kern

2020-09-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 14 10:14:03 2020
New Revision: 365711
URL: https://svnweb.freebsd.org/changeset/base/365711

Log:
  Move TDP_GEOM check from userret() to ast(); this code path is quite
  infrequent.
  
  Reviewed by:  kib
  No objections:mav
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26374

Modified:
  head/sys/geom/geom_event.c
  head/sys/kern/subr_trap.c

Modified: head/sys/geom/geom_event.c
==
--- head/sys/geom/geom_event.c  Mon Sep 14 09:44:24 2020(r365710)
+++ head/sys/geom/geom_event.c  Mon Sep 14 10:14:03 2020(r365711)
@@ -374,6 +374,9 @@ g_post_event_x(g_event_t *func, void *arg, int flag, i
if (epp != NULL)
*epp = ep;
curthread->td_pflags |= TDP_GEOM;
+   thread_lock(curthread);
+   curthread->td_flags |= TDF_ASTPENDING;
+   thread_unlock(curthread);
return (0);
 }
 

Modified: head/sys/kern/subr_trap.c
==
--- head/sys/kern/subr_trap.c   Mon Sep 14 09:44:24 2020(r365710)
+++ head/sys/kern/subr_trap.c   Mon Sep 14 10:14:03 2020(r365711)
@@ -138,13 +138,6 @@ userret(struct thread *td, struct trapframe *frame)
MPASS(td->td_su == NULL);
 
/*
-* If this thread tickled GEOM, we need to wait for the giggling to
-* stop before we return to userland
-*/
-   if (__predict_false(td->td_pflags & TDP_GEOM))
-   g_waitidle();
-
-   /*
 * Charge system time if profiling.
 */
if (__predict_false(p->p_flag & P_PROFIL))
@@ -285,6 +278,13 @@ ast(struct trapframe *framep)
ktrcsw(0, 1, __func__);
 #endif
}
+
+   /*
+* If this thread tickled GEOM, we need to wait for the giggling to
+* stop before we return to userland
+*/
+   if (__predict_false(td->td_pflags & TDP_GEOM))
+   g_waitidle();
 
 #ifdef DIAGNOSTIC
if (p->p_numthreads == 1 && (flags & TDF_NEEDSIGCHK) == 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365710 - head/sys/kern

2020-09-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 14 09:44:24 2020
New Revision: 365710
URL: https://svnweb.freebsd.org/changeset/base/365710

Log:
  Move racct/rctl throttling from userret() to ast().  There's no reason
  for it to sit in the syscall fast path.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26368

Modified:
  head/sys/kern/kern_racct.c
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Mon Sep 14 08:59:16 2020(r365709)
+++ head/sys/kern/kern_racct.c  Mon Sep 14 09:44:24 2020(r365710)
@@ -1146,6 +1146,8 @@ racct_proc_throttle(struct proc *p, int timeout)
 
FOREACH_THREAD_IN_PROC(p, td) {
thread_lock(td);
+   td->td_flags |= TDF_ASTPENDING;
+
switch (td->td_state) {
case TDS_RUNQ:
/*

Modified: head/sys/kern/subr_trap.c
==
--- head/sys/kern/subr_trap.c   Mon Sep 14 08:59:16 2020(r365709)
+++ head/sys/kern/subr_trap.c   Mon Sep 14 09:44:24 2020(r365710)
@@ -206,10 +206,6 @@ userret(struct thread *td, struct trapframe *frame)
__func__, td, p->p_pid, td->td_name, curvnet,
(td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A"));
 #endif
-#ifdef RACCT
-   if (__predict_false(racct_enable && p->p_throttled != 0))
-   racct_proc_throttled(p);
-#endif
 }
 
 /*
@@ -361,6 +357,11 @@ ast(struct trapframe *framep)
td->td_pflags &= ~TDP_OLDMASK;
kern_sigprocmask(td, SIG_SETMASK, >td_oldsigmask, NULL, 0);
}
+
+#ifdef RACCT
+   if (__predict_false(racct_enable && p->p_throttled != 0))
+   racct_proc_throttled(p);
+#endif
 
userret(td, framep);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365709 - head/sys/dev/gpio

2020-09-14 Thread Andrew Turner
Author: andrew
Date: Mon Sep 14 08:59:16 2020
New Revision: 365709
URL: https://svnweb.freebsd.org/changeset/base/365709

Log:
  Allow for interrupts on pl061 children
  
  Add enough infrastructure for interrupts on children of the pl061 GPIO
  controller. As gpiobus already provided these the pl061 driver also needs
  to pass requests up the newbus hierarchy.
  
  Currently there are no children that expect to configure interrupts, however
  this is expected to change to support the ACPI Event Information interface.
  
  Sponsored by: Innovate UK

Modified:
  head/sys/dev/gpio/pl061.c

Modified: head/sys/dev/gpio/pl061.c
==
--- head/sys/dev/gpio/pl061.c   Mon Sep 14 08:51:18 2020(r365708)
+++ head/sys/dev/gpio/pl061.c   Mon Sep 14 08:59:16 2020(r365709)
@@ -553,6 +553,11 @@ static device_method_t pl061_methods[] = {
DEVMETHOD(device_attach,pl061_attach),
DEVMETHOD(device_detach,pl061_detach),
 
+   /* Bus interface */
+   DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
+   DEVMETHOD(bus_activate_resource,bus_generic_activate_resource),
+   DEVMETHOD(bus_deactivate_resource,  
bus_generic_deactivate_resource),
+
/* GPIO protocol */
DEVMETHOD(gpio_get_bus, pl061_get_bus),
DEVMETHOD(gpio_pin_max, pl061_pin_max),
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365708 - head/sbin/pfctl/tests

2020-09-14 Thread Alex Richardson
Author: arichardson
Date: Mon Sep 14 08:51:18 2020
New Revision: 365708
URL: https://svnweb.freebsd.org/changeset/base/365708

Log:
  pfctl_test: avoid 200 calls to atf_get_srcdir
  
  I have been trying to reduce the time that testsuite runs take for CheriBSD
  on QEMU (currently about 22 hours). One of the slowest tests is pfctl_test:
  Just listing the available test cases currently takes 98 seconds on a
  CheriBSD RISC-V system due to all the processes being spawned. This trivial
  patch reduces the time to 92 seconds. The better solution would be to
  rewrite the test in C/C++ which I may do as a follow-up change.
  
  Reviewed By:  kp
  Differential Revision: https://reviews.freebsd.org/D26417

Modified:
  head/sbin/pfctl/tests/pfctl_test.sh

Modified: head/sbin/pfctl/tests/pfctl_test.sh
==
--- head/sbin/pfctl/tests/pfctl_test.sh Mon Sep 14 06:26:36 2020
(r365707)
+++ head/sbin/pfctl/tests/pfctl_test.sh Mon Sep 14 08:51:18 2020
(r365708)
@@ -24,21 +24,22 @@ pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 
 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096
 0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005"
 
-. $(atf_get_srcdir)/files/pfctl_test_descr.sh
+atf_srcdir=$(atf_get_srcdir)
+. "${atf_srcdir}/files/pfctl_test_descr.sh"
 
 for i in ${pftests} ; do
 atf_test_case "pf${i}"
 eval "pf${i}_head () { atf_set descr \"$(pf${i}_descr)\" ; }"
 eval "pf${i}_body () { \
   kldstat -m pf || atf_skip \"pf(4) is not loaded\" && \
-  cd $(atf_get_srcdir)/files && \
+  cd ${atf_srcdir}/files && \
   atf_check -o file:pf${i}.ok \
   pfctl -o none -nvf - < pf${i}.in ; }"
 
 atf_test_case "selfpf${i}"
 eval "selfpf${i}_head () { atf_set descr \"self$(pf${i}_descr)\" ; }"
 eval "selfpf${i}_body () { \
-  cd $(atf_get_srcdir)/files && \
+  cd ${atf_srcdir}/files && \
   atf_check -o file:pf${i}.ok \
   pfctl -o none -nvf - < pf${i}.ok ; }"
 done
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365707 - head/share/man/man9

2020-09-14 Thread Scott Long
Author: scottl
Date: Mon Sep 14 06:26:36 2020
New Revision: 365707
URL: https://svnweb.freebsd.org/changeset/base/365707

Log:
  Update bus_dma.9 for the expanded template API.  Add some
  clarifying language about the operation of parent tags in templates.

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

Modified: head/share/man/man9/bus_dma.9
==
--- head/share/man/man9/bus_dma.9   Mon Sep 14 05:58:12 2020
(r365706)
+++ head/share/man/man9/bus_dma.9   Mon Sep 14 06:26:36 2020
(r365707)
@@ -63,6 +63,8 @@
 .Nm bus_dma_template_init ,
 .Nm bus_dma_template_tag ,
 .Nm bus_dma_template_clone ,
+.Nm bus_dma_template_fill,
+.Nm BUS_DMA_TEMPLATE_FILL,
 .Nm bus_dmamap_create ,
 .Nm bus_dmamap_destroy ,
 .Nm bus_dmamap_load ,
@@ -90,19 +92,29 @@
 .Fn bus_dma_tag_destroy "bus_dma_tag_t dmat"
 .Ft void
 .Fo bus_dma_template_init
-.Fa "bus_dma_template_t template"
+.Fa "bus_dma_template_t *template"
 .Fa "bus_dma_tag_t parent"
 .Fc
 .Ft int
 .Fo bus_dma_template_tag
-.Fa "bus_dma_template_t template"
+.Fa "bus_dma_template_t *template"
 .Fa "bus_dma_tag_t *dmat"
 .Fc
 .Ft void
 .Fo bus_dma_template_clone
-.Fa "bus_dma_template_t template"
+.Fa "bus_dma_template_t *template"
 .Fa "bus_dma_tag_t dmat"
 .Fc
+.Ft void
+.Fo bus_dma_template_fill
+.Fa "bus_dma_template_t *template"
+.Fa "bus_dma_param_t params[]"
+.Fa "u_int count"
+.Fc
+.Fo BUS_DMA_TEMPLATE_FILL
+.Fa "bus_dma_template_t *template"
+.Fa "bus_dma_param_t param ..."
+.Fc
 .Ft int
 .Fn bus_dmamap_create "bus_dma_tag_t dmat" "int flags" "bus_dmamap_t *mapp"
 .Ft int
@@ -697,8 +709,12 @@ Initializes a
 .Fa bus_dma_template_t
 structure.  If the
 .Fa parent 
-argument is non-NULL, values from this tag will be copied into the template,
-replacing any defaults.
+argument is non-NULL, this parent tag is associated with the template and
+will be compiled into the dma tag that is later created.  The values
+of the parent are not copied into the template.  During tag creation in
+.Fn bus_dma_tag_template ,
+any parameters from the parent tag that are more restrictive than what is
+in the provided template will overwrite what goes into the new tag.
 .It Fn bus_dma_template_tag "*template" "*dmat"
 Unpacks a template into a tag, and returns the tag via the
 .Fa dmat .
@@ -712,6 +728,31 @@ The template does not need to be initialized first.  A
 be overwritten by the values contained in the tag.  When paired with
 .Fn bus_dma_template_tag ,
 this function is useful for creating copies of tags.
+.It Fn bus_dma_template_fill "*template" "params[]" "count"
+Fills in the selected fields of the template with the keyed values from the
+.Fa params
+array.  This is not meant to be called directly, use
+.Fn BUS_DMA_TEMPLATE_FILL
+instead.
+.It Fn BUS_DMA_TEMPLATE_FILL "*template" "param ..."
+Fills in the selected fields of the template with a variable number of
+key-value parameters.  The macros listed below take an argument of the
+specified type and encapsulate it into a key-value structure that is directly
+usable as a parameter argument.  Muliple parameters may be provided at once.
+.Bd -literal
+   BD_PARENT() void *
+   BD_ALIGNMENT()  uintmax_t
+   BD_BOUNDARY()   uintmax_t
+   BD_LOWADDR()vm_paddr_t
+   BD_HIGHADDR()   vm_paddr_t
+   BD_MAXSIZE()uintmax_t
+   BD_NSEGMENTS()  uintmax_t
+   BD_MAXSEGSIZE() uintmax_t
+   BD_FLAGS()  uintmax_t
+   BD_LOCKFUNC()   void *
+   BD_LOCKFUNCARG() void *
+.Ed
+.Pp
 .It Fn bus_dmamap_create "dmat" "flags" "*mapp"
 Allocates and initializes a DMA map.
 Arguments are as follows:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"