svn commit: r365742 - stable/12/sys/cam/mmc

2020-09-14 Thread Andriy Gapon
Author: avg
Date: Tue Sep 15 05:51:03 2020
New Revision: 365742
URL: https://svnweb.freebsd.org/changeset/base/365742

Log:
  MFC r365447: mmc_da: universally use uint8_t for the partition index

Modified:
  stable/12/sys/cam/mmc/mmc_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/mmc/mmc_da.c
==
--- stable/12/sys/cam/mmc/mmc_da.c  Tue Sep 15 05:48:55 2020
(r365741)
+++ stable/12/sys/cam/mmc/mmc_da.c  Tue Sep 15 05:51:03 2020
(r365742)
@@ -170,7 +170,6 @@ static void sdda_start_init(void *context, union ccb *
 static void sdda_start_init_task(void *context, int pending);
 static void sdda_process_mmc_partitions(struct cam_periph *periph, union ccb 
*start_ccb);
 static uint32_t sdda_get_host_caps(struct cam_periph *periph, union ccb *ccb);
-static void sdda_init_switch_part(struct cam_periph *periph, union ccb 
*start_ccb, u_int part);
 static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t 
rca);
 static inline uint32_t mmc_get_sector_size(struct cam_periph *periph) {return 
MMC_SECTOR_SIZE;}
 
@@ -1658,10 +1657,13 @@ sdda_process_mmc_partitions(struct cam_periph *periph,
  * This function cannot fail, instead check switch errors in sddadone().
  */
 static void
-sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, u_int 
part) {
+sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb,
+uint8_t part)
+{
struct sdda_softc *sc = (struct sdda_softc *)periph->softc;
uint8_t value;
 
+   KASSERT(part < MMC_PART_MAX, ("%s: invalid partition index", __func__));
sc->part_requested = part;
 
value = (sc->raw_ext_csd[EXT_CSD_PART_CONFIG] &
@@ -1685,7 +1687,7 @@ sddastart(struct cam_periph *periph, union ccb *start_
struct sdda_softc *softc = (struct sdda_softc *)periph->softc;
struct sdda_part *part;
struct mmc_params *mmcp = >path->device->mmc_ident_data;
-   int part_index;
+   uint8_t part_index;
 
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddastart\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: r365741 - stable/12/sys/cam/mmc

2020-09-14 Thread Andriy Gapon
Author: avg
Date: Tue Sep 15 05:48:55 2020
New Revision: 365741
URL: https://svnweb.freebsd.org/changeset/base/365741

Log:
  MFC r365445: mmc_da: make sure that part_index is not used uninitialized in 
sddastart

Modified:
  stable/12/sys/cam/mmc/mmc_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/mmc/mmc_da.c
==
--- stable/12/sys/cam/mmc/mmc_da.c  Tue Sep 15 05:46:51 2020
(r365740)
+++ stable/12/sys/cam/mmc/mmc_da.c  Tue Sep 15 05:48:55 2020
(r365741)
@@ -1696,6 +1696,7 @@ sddastart(struct cam_periph *periph, union ccb *start_
}
 
/* Find partition that has outstanding commands.  Prefer current 
partition. */
+   part_index = softc->part_curr;
part = softc->part[softc->part_curr];
bp = bioq_first(>bio_queue);
if (bp == NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365740 - stable/12/sys/cam/mmc

2020-09-14 Thread Andriy Gapon
Author: avg
Date: Tue Sep 15 05:46:51 2020
New Revision: 365740
URL: https://svnweb.freebsd.org/changeset/base/365740

Log:
  MFC r365446: mmc_da: fix a typo and a too long line

Modified:
  stable/12/sys/cam/mmc/mmc_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/mmc/mmc_da.c
==
--- stable/12/sys/cam/mmc/mmc_da.c  Tue Sep 15 04:22:28 2020
(r365739)
+++ stable/12/sys/cam/mmc/mmc_da.c  Tue Sep 15 05:46:51 2020
(r365740)
@@ -1847,7 +1847,8 @@ sddadone(struct cam_periph *periph, union ccb *done_cc
/* Process result of switching MMC partitions */
if (softc->state == SDDA_STATE_PART_SWITCH) {
CAM_DEBUG(path, CAM_DEBUG_TRACE,
-   ("Compteting partition switch to %d\n", 
softc->part_requested));
+   ("Completing partition switch to %d\n",
+   softc->part_requested));
softc->outstanding_cmds--;
/* Complete partition switch */
softc->state = SDDA_STATE_NORMAL;
___
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: 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-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: r365738 - stable/11/sys/dev/usb/net

2020-09-14 Thread John-Mark Gurney
Author: jmg
Date: Tue Sep 15 00:22:30 2020
New Revision: 365738
URL: https://svnweb.freebsd.org/changeset/base/365738

Log:
  MFC r365623: Don't clear reserved bits per RealTek
  
  This is a direct commit as the driver is significantly different.

Modified:
  stable/11/sys/dev/usb/net/if_ure.c

Modified: stable/11/sys/dev/usb/net/if_ure.c
==
--- stable/11/sys/dev/usb/net/if_ure.c  Mon Sep 14 23:51:14 2020
(r365737)
+++ stable/11/sys/dev/usb/net/if_ure.c  Tue Sep 15 00:22:30 2020
(r365738)
@@ -710,7 +710,9 @@ ure_init(struct usb_ether *ue)
~URE_RXDY_GATED_EN);
 
/* Set Rx mode. */
-   rxmode = URE_RCR_APM;
+   rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA);
+   rxmode &= ~URE_RCR_ACPT_ALL;
+   rxmode |= URE_RCR_APM;
 
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
___
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: 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-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: r365736 - releng/12.2/sys/dev/ixl

2020-09-14 Thread Eric Joyner
Author: erj
Date: Mon Sep 14 23:49:17 2020
New Revision: 365736
URL: https://svnweb.freebsd.org/changeset/base/365736

Log:
  MFS r365647: ixl powerpc64 fixes
  
  PR:   249254
  Approved by:  re (gjb@)

Modified:
  releng/12.2/sys/dev/ixl/i40e_prototype.h
  releng/12.2/sys/dev/ixl/ixl_pf_main.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/dev/ixl/i40e_prototype.h
==
--- releng/12.2/sys/dev/ixl/i40e_prototype.hMon Sep 14 23:30:04 2020
(r365735)
+++ releng/12.2/sys/dev/ixl/i40e_prototype.hMon Sep 14 23:49:17 2020
(r365736)
@@ -627,6 +627,4 @@ enum i40e_status_code i40e_read_phy_register(struct i4
 enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 value);
 u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num);
-enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw,
- u32 time, u32 interval);
 #endif /* _I40E_PROTOTYPE_H_ */

Modified: releng/12.2/sys/dev/ixl/ixl_pf_main.c
==
--- releng/12.2/sys/dev/ixl/ixl_pf_main.c   Mon Sep 14 23:30:04 2020
(r365735)
+++ releng/12.2/sys/dev/ixl/ixl_pf_main.c   Mon Sep 14 23:49:17 2020
(r365736)
@@ -729,20 +729,22 @@ ixl_switch_config(struct ixl_pf *pf)
if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) {
device_printf(dev,
"Switch config: header reported: %d in structure, %d 
total\n",
-   sw_config->header.num_reported, 
sw_config->header.num_total);
-   for (int i = 0; i < sw_config->header.num_reported; i++) {
+   LE16_TO_CPU(sw_config->header.num_reported),
+   LE16_TO_CPU(sw_config->header.num_total));
+   for (int i = 0;
+   i < LE16_TO_CPU(sw_config->header.num_reported); i++) {
device_printf(dev,
"-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i,
sw_config->element[i].element_type,
-   sw_config->element[i].seid,
-   sw_config->element[i].uplink_seid,
-   sw_config->element[i].downlink_seid);
+   LE16_TO_CPU(sw_config->element[i].seid),
+   LE16_TO_CPU(sw_config->element[i].uplink_seid),
+   LE16_TO_CPU(sw_config->element[i].downlink_seid));
}
}
/* Simplified due to a single VSI */
-   vsi->uplink_seid = sw_config->element[0].uplink_seid;
-   vsi->downlink_seid = sw_config->element[0].downlink_seid;
-   vsi->seid = sw_config->element[0].seid;
+   vsi->uplink_seid = LE16_TO_CPU(sw_config->element[0].uplink_seid);
+   vsi->downlink_seid = LE16_TO_CPU(sw_config->element[0].downlink_seid);
+   vsi->seid = LE16_TO_CPU(sw_config->element[0].seid);
return (ret);
 }
 
@@ -1219,12 +1221,14 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, int flags, int
bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN);
if (f->vlan == IXL_VLAN_ANY) {
b->vlan_tag = 0;
-   b->flags = I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;
+   b->flags = CPU_TO_LE16(
+   I40E_AQC_MACVLAN_ADD_IGNORE_VLAN);
} else {
-   b->vlan_tag = f->vlan;
+   b->vlan_tag = CPU_TO_LE16(f->vlan);
b->flags = 0;
}
-   b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH;
+   b->flags |= CPU_TO_LE16(
+   I40E_AQC_MACVLAN_ADD_PERFECT_MATCH);
f->flags &= ~IXL_FILTER_ADD;
j++;
 
___
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: 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-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: 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-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: r365733 - in releng/12.2: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys

2020-09-14 Thread Eric Joyner
Author: erj
Date: Mon Sep 14 22:42:17 2020
New Revision: 365733
URL: https://svnweb.freebsd.org/changeset/base/365733

Log:
  ice(4): Add Intel 100GbE Ethernet Driver to kernel
  
  This also adds the "package" file that's loaded by the device for
  configuration, used in the included ice_ddp kernel module.
  
  MFS of r365612 and r365731.
  
  Approved by:  re (gjb@)
  Relnotes: yes
  Sponsored by: Intel Corporation

Added:
  releng/12.2/sys/contrib/dev/ice/
 - copied from r365612, stable/12/sys/contrib/dev/ice/
  releng/12.2/sys/contrib/dev/ice/ice-1.3.16.0.pkg
 - copied unchanged from r365731, 
stable/12/sys/contrib/dev/ice/ice-1.3.16.0.pkg
  releng/12.2/sys/dev/ice/
 - copied from r365612, stable/12/sys/dev/ice/
  releng/12.2/sys/modules/ice/
 - copied from r365612, stable/12/sys/modules/ice/
  releng/12.2/sys/modules/ice_ddp/
 - copied from r365612, stable/12/sys/modules/ice_ddp/
  releng/12.2/tools/kerneldoc/subsys/Doxyfile-dev_ice
 - copied unchanged from r365612, 
stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice
Deleted:
  releng/12.2/sys/contrib/dev/ice/ice-1.3.9.0.pkg
Modified:
  releng/12.2/MAINTAINERS
  releng/12.2/sys/amd64/conf/GENERIC
  releng/12.2/sys/amd64/conf/NOTES
  releng/12.2/sys/conf/files.amd64
  releng/12.2/sys/conf/files.arm64
  releng/12.2/sys/contrib/dev/ice/README
  releng/12.2/sys/dev/ice/ice_adminq_cmd.h
  releng/12.2/sys/dev/ice/ice_bitops.h
  releng/12.2/sys/dev/ice/ice_common.c
  releng/12.2/sys/dev/ice/ice_common.h
  releng/12.2/sys/dev/ice/ice_controlq.c
  releng/12.2/sys/dev/ice/ice_controlq.h
  releng/12.2/sys/dev/ice/ice_dcb.c
  releng/12.2/sys/dev/ice/ice_dcb.h
  releng/12.2/sys/dev/ice/ice_drv_info.h
  releng/12.2/sys/dev/ice/ice_flex_pipe.c
  releng/12.2/sys/dev/ice/ice_flex_pipe.h
  releng/12.2/sys/dev/ice/ice_flex_type.h
  releng/12.2/sys/dev/ice/ice_flow.c
  releng/12.2/sys/dev/ice/ice_flow.h
  releng/12.2/sys/dev/ice/ice_hw_autogen.h
  releng/12.2/sys/dev/ice/ice_lan_tx_rx.h
  releng/12.2/sys/dev/ice/ice_lib.c
  releng/12.2/sys/dev/ice/ice_lib.h
  releng/12.2/sys/dev/ice/ice_nvm.c
  releng/12.2/sys/dev/ice/ice_nvm.h
  releng/12.2/sys/dev/ice/ice_protocol_type.h
  releng/12.2/sys/dev/ice/ice_sched.c
  releng/12.2/sys/dev/ice/ice_sched.h
  releng/12.2/sys/dev/ice/ice_status.h
  releng/12.2/sys/dev/ice/ice_strings.c
  releng/12.2/sys/dev/ice/ice_switch.c
  releng/12.2/sys/dev/ice/ice_switch.h
  releng/12.2/sys/dev/ice/ice_type.h
  releng/12.2/sys/dev/ice/if_ice_iflib.c
  releng/12.2/sys/dev/ice/virtchnl.h
  releng/12.2/sys/dev/ice/virtchnl_inline_ipsec.h
  releng/12.2/sys/modules/Makefile
  releng/12.2/sys/modules/ice_ddp/Makefile
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/MAINTAINERS
==
--- releng/12.2/MAINTAINERS Mon Sep 14 22:15:54 2020(r365732)
+++ releng/12.2/MAINTAINERS Mon Sep 14 22:42:17 2020(r365733)
@@ -89,9 +89,11 @@ share/mk/*.test.mk   freebsd-testing,ngie (same list as 
 stand/forthdteske  Pre-commit review requested.
 stand/lua  kevans  Pre-commit review requested
 sys/compat/linuxkpihselaskyIf in doubt, ask.
+sys/contrib/dev/iceerj Pre-commit phabricator review requested.
 sys/dev/e1000  erj Pre-commit phabricator review requested.
 sys/dev/ixgbe  erj Pre-commit phabricator review requested.
 sys/dev/ixlerj Pre-commit phabricator review requested.
+sys/dev/iceerj Pre-commit phabricator review requested.
 sys/dev/sound/usb  hselaskyIf in doubt, ask.
 sys/dev/usbhselaskyIf in doubt, ask.
 sys/dev/xenroyger  Pre-commit review recommended.

Modified: releng/12.2/sys/amd64/conf/GENERIC
==
--- releng/12.2/sys/amd64/conf/GENERIC  Mon Sep 14 22:15:54 2020
(r365732)
+++ releng/12.2/sys/amd64/conf/GENERIC  Mon Sep 14 22:42:17 2020
(r365733)
@@ -225,6 +225,7 @@ device  ix  # Intel 
PRO/10GbE PCIE PF Ethernet
 device ixv # Intel PRO/10GbE PCIE VF Ethernet
 device ixl # Intel 700 Series Physical Function
 device iavf# Intel Adaptive Virtual Function
+device ice # Intel 800 Series Physical Function
 device vmx # VMware VMXNET3 Ethernet
 
 # PCI Ethernet NICs.

Modified: releng/12.2/sys/amd64/conf/NOTES
==
--- releng/12.2/sys/amd64/conf/NOTESMon Sep 14 22:15:54 2020
(r365732)
+++ releng/12.2/sys/amd64/conf/NOTESMon Sep 14 22:42:17 2020
(r365733)
@@ -306,6 +306,8 @@ options DRM_DEBUG   # Include debug printfs (slow)
 # ed:   Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503
 #   HP PC Lan+, various PC Card devices
 

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-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: r365731 - in stable/12/sys: conf contrib/dev/ice dev/ice modules/ice_ddp

2020-09-14 Thread Eric Joyner
Author: erj
Date: Mon Sep 14 21:33:11 2020
New Revision: 365731
URL: https://svnweb.freebsd.org/changeset/base/365731

Log:
  ice: MFC commits for update to 0.26.16
  
  These include r365332, r365550, and r365617, which update
  both the ice_ddp package and the ice(4) driver itself.
  
  Relnotes: yes
  Sponsored by: Intel Corporation

Added:
  stable/12/sys/contrib/dev/ice/ice-1.3.16.0.pkg
 - copied, changed from r365332, head/sys/contrib/dev/ice/ice-1.3.16.0.pkg
Deleted:
  stable/12/sys/contrib/dev/ice/ice-1.3.9.0.pkg
Modified:
  stable/12/sys/conf/files.amd64
  stable/12/sys/conf/files.arm64
  stable/12/sys/contrib/dev/ice/README
  stable/12/sys/dev/ice/ice_adminq_cmd.h
  stable/12/sys/dev/ice/ice_bitops.h
  stable/12/sys/dev/ice/ice_common.c
  stable/12/sys/dev/ice/ice_common.h
  stable/12/sys/dev/ice/ice_controlq.c
  stable/12/sys/dev/ice/ice_controlq.h
  stable/12/sys/dev/ice/ice_dcb.c
  stable/12/sys/dev/ice/ice_dcb.h
  stable/12/sys/dev/ice/ice_drv_info.h
  stable/12/sys/dev/ice/ice_flex_pipe.c
  stable/12/sys/dev/ice/ice_flex_pipe.h
  stable/12/sys/dev/ice/ice_flex_type.h
  stable/12/sys/dev/ice/ice_flow.c
  stable/12/sys/dev/ice/ice_flow.h
  stable/12/sys/dev/ice/ice_hw_autogen.h
  stable/12/sys/dev/ice/ice_lan_tx_rx.h
  stable/12/sys/dev/ice/ice_lib.c
  stable/12/sys/dev/ice/ice_lib.h
  stable/12/sys/dev/ice/ice_nvm.c
  stable/12/sys/dev/ice/ice_nvm.h
  stable/12/sys/dev/ice/ice_protocol_type.h
  stable/12/sys/dev/ice/ice_sched.c
  stable/12/sys/dev/ice/ice_sched.h
  stable/12/sys/dev/ice/ice_status.h
  stable/12/sys/dev/ice/ice_strings.c
  stable/12/sys/dev/ice/ice_switch.c
  stable/12/sys/dev/ice/ice_switch.h
  stable/12/sys/dev/ice/ice_type.h
  stable/12/sys/dev/ice/if_ice_iflib.c
  stable/12/sys/dev/ice/virtchnl.h
  stable/12/sys/dev/ice/virtchnl_inline_ipsec.h
  stable/12/sys/modules/ice_ddp/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files.amd64
==
--- stable/12/sys/conf/files.amd64  Mon Sep 14 19:39:43 2020
(r365730)
+++ stable/12/sys/conf/files.amd64  Mon Sep 14 21:33:11 2020
(r365731)
@@ -288,7 +288,7 @@ dev/ice/ice_sriov.c optionalice pci \
 dev/ice/ice_switch.c   optionalice pci \
compile-with "${NORMAL_C} -I$S/dev/ice"
 ice_ddp.c  optional ice_ddp\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}"   \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}"   \
no-implicit-rule before-depend local\
clean   "ice_ddp.c"
 ice_ddp.fwooptional ice_ddp\
@@ -297,8 +297,8 @@ ice_ddp.fwo optional ice_ddp\
no-implicit-rule\
clean   "ice_ddp.fwo"
 ice_ddp.fw optional ice_ddp\
-   dependency  "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \
-   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \
+   dependency  "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \
+   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \
no-obj no-implicit-rule \
clean   "ice_ddp.fw"
 dev/ioat/ioat.coptionalioat pci

Modified: stable/12/sys/conf/files.arm64
==
--- stable/12/sys/conf/files.arm64  Mon Sep 14 19:39:43 2020
(r365730)
+++ stable/12/sys/conf/files.arm64  Mon Sep 14 21:33:11 2020
(r365731)
@@ -254,7 +254,7 @@ dev/ice/ice_sriov.c optionalice pci \
 dev/ice/ice_switch.c   optionalice pci \
compile-with "${NORMAL_C} -I$S/dev/ice"
 ice_ddp.c  optional ice_ddp\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}"   \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}"   \
no-implicit-rule before-depend local\
clean   "ice_ddp.c"
 ice_ddp.fwooptional ice_ddp\
@@ -263,8 +263,8 @@ ice_ddp.fwo optional ice_ddp\
no-implicit-rule\
clean   "ice_ddp.fwo"
 ice_ddp.fw optional ice_ddp\
-   dependency  "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \
-   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \
+   dependency  "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \
+   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \
no-obj no-implicit-rule \
clean   

svn commit: r365730 - stable/12/sys/dev/usb/net

2020-09-14 Thread John-Mark Gurney
Author: jmg
Date: Mon Sep 14 19:39:43 2020
New Revision: 365730
URL: https://svnweb.freebsd.org/changeset/base/365730

Log:
  MFC r365623: Don't clear reserved bits per RealTek

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

Modified: stable/12/sys/dev/usb/net/if_ure.c
==
--- stable/12/sys/dev/usb/net/if_ure.c  Mon Sep 14 17:33:28 2020
(r365729)
+++ stable/12/sys/dev/usb/net/if_ure.c  Mon Sep 14 19:39:43 2020
(r365730)
@@ -784,9 +784,10 @@ ure_rxfilter(struct usb_ether *ue)
 
URE_LOCK_ASSERT(sc, MA_OWNED);
 
-   rxmode = URE_RCR_APM;
-   if (ifp->if_flags & IFF_BROADCAST)
-rxmode |= URE_RCR_AB;
+   rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA);
+   rxmode &= ~(URE_RCR_AAP | URE_RCR_AM);
+   rxmode |= URE_RCR_APM;  /* accept physical match packets */
+   rxmode |= URE_RCR_AB;   /* always accept broadcasts */
if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
if (ifp->if_flags & IFF_PROMISC)
rxmode |= URE_RCR_AAP;
___
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: 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-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: r365728 - releng/12.2/sys/vm

2020-09-14 Thread Mark Johnston
Author: markj
Date: Mon Sep 14 17:21:52 2020
New Revision: 365728
URL: https://svnweb.freebsd.org/changeset/base/365728

Log:
  MFS r365718:
  MFC r365437:
  vm_object_split(): Handle orig_object type changes.
  
  Approved by:  re (gjb)

Modified:
  releng/12.2/sys/vm/vm_object.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/vm/vm_object.c
==
--- releng/12.2/sys/vm/vm_object.c  Mon Sep 14 16:18:53 2020
(r365727)
+++ releng/12.2/sys/vm/vm_object.c  Mon Sep 14 17:21:52 2020
(r365728)
@@ -1313,7 +1313,7 @@ vm_object_shadow(
 void
 vm_object_split(vm_map_entry_t entry)
 {
-   vm_page_t m, m_next;
+   vm_page_t m, m_busy, m_next;
vm_object_t orig_object, new_object, source;
vm_pindex_t idx, offidxstart;
vm_size_t size;
@@ -1370,8 +1370,14 @@ vm_object_split(vm_map_entry_t entry)
("orig_object->charge < 0"));
orig_object->charge -= ptoa(size);
}
+   m_busy = NULL;
+#ifdef INVARIANTS
+   idx = 0;
+#endif
 retry:
m = vm_page_find_least(orig_object, offidxstart);
+   KASSERT(m == NULL || idx <= m->pindex - offidxstart,
+   ("%s: object %p was repopulated", __func__, orig_object));
for (; m != NULL && (idx = m->pindex - offidxstart) < size;
m = m_next) {
m_next = TAILQ_NEXT(m, listq);
@@ -1417,8 +1423,16 @@ retry:
 */
vm_reserv_rename(m, new_object, orig_object, offidxstart);
 #endif
-   if (orig_object->type == OBJT_SWAP)
+
+   /*
+* orig_object's type may change while sleeping, so keep track
+* of the beginning of the busied range.
+*/
+   if (orig_object->type == OBJT_SWAP) {
vm_page_xbusy(m);
+   if (m_busy == NULL)
+   m_busy = m;
+   }
}
if (orig_object->type == OBJT_SWAP) {
/*
@@ -1426,8 +1440,9 @@ retry:
 * and new_object's locks are released and reacquired. 
 */
swap_pager_copy(orig_object, new_object, offidxstart, 0);
-   TAILQ_FOREACH(m, _object->memq, listq)
-   vm_page_xunbusy(m);
+   if (m_busy != NULL)
+   TAILQ_FOREACH_FROM(m_busy, _object->memq, listq)
+   vm_page_xunbusy(m_busy);
}
VM_OBJECT_WUNLOCK(orig_object);
VM_OBJECT_WUNLOCK(new_object);
___
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: 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-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: 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-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: 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-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: 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-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: 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-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: 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-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: r365722 - in releng/12.2: . contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options

2020-09-14 Thread Dimitry Andric
Author: dim
Date: Mon Sep 14 14:53:09 2020
New Revision: 365722
URL: https://svnweb.freebsd.org/changeset/base/365722

Log:
  MF12 r365662:
  
  MFC r365371:
  
  Turn MALLOC_PRODUCTION into a regular src.conf(5) option
  
  For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has
  been used to turn off potentially expensive debug checks and statistics
  gathering in the implementation of malloc(3).
  
  It seems more consistent to turn this into a regular src.conf(5) option,
  e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then
  be toggled similar to any other source build option, and turned on or
  off by default for e.g. stable branches.
  
  Reviewed by:  imp, #manpages
  Differential Revision: https://reviews.freebsd.org/D26337
  
  MFC r365373:
  
  Follow-up r365371 by removing sentences which indicate the state of the
  MK_MALLOC_PRODUCTION option on -CURRENT.
  
  Also, for the sake of backwards compatibility, support the old way of
  enabling 'production malloc', e.g. by adding a define in make.conf(5).
  
  MF12 r365671:
  
  Follow-up r365662 (MFC of r365371 and r365373) by correctly setting
  WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING,
  to inform users about the new setting.
  
  Direct commit to stable/{11,12} as this does not apply to head.
  
  Noticed by:   imp, Ronald Klop 
  
  MF12 r365672:
  
  Follow-up r365662 (MFC of r365371 and r365373) by also removing the
  header hack from jemalloc_FreeBSD.h, which rendered any make.conf
  MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant.
  
  Direct commit to stable/{11,12} as this does not apply to head.
  
  Noticed by:   kevans
  
  Approved by:  re (gjb)

Added:
  releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION
 - copied unchanged from r365662, 
stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION
  releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION
 - copied unchanged from r365662, 
stable/12/tools/build/options/WITH_MALLOC_PRODUCTION
Modified:
  releng/12.2/UPDATING
  releng/12.2/contrib/jemalloc/FREEBSD-diffs
  releng/12.2/contrib/jemalloc/doc/jemalloc.3
  releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
  releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc
  releng/12.2/share/man/man5/make.conf.5
  releng/12.2/share/man/man5/src.conf.5
  releng/12.2/share/mk/src.opts.mk
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/UPDATING
==
--- releng/12.2/UPDATINGMon Sep 14 14:52:22 2020(r365721)
+++ releng/12.2/UPDATINGMon Sep 14 14:53:09 2020(r365722)
@@ -16,6 +16,18 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20200912:
+   The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and
+   enabling assertions and statistics gathering in malloc(3), has been
+   migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option.
+
+   On stable branches, WITH_MALLOC_PRODUCTION is set by default, which
+   means that malloc(3) has assertions and statistics gathering disabled,
+   for improved performance.
+
+   For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still
+   honored, but it is now deprecated and undocumented.
+
 20200909:
The resume code now notifies devd with the 'kernel' system
rather than the old 'kern' subsystem to be consistent with

Modified: releng/12.2/contrib/jemalloc/FREEBSD-diffs
==
--- releng/12.2/contrib/jemalloc/FREEBSD-diffs  Mon Sep 14 14:52:22 2020
(r365721)
+++ releng/12.2/contrib/jemalloc/FREEBSD-diffs  Mon Sep 14 14:53:09 2020
(r365722)
@@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644
 +--with-malloc-conf=abort_conf:false.
 +Additionally, --enable-debug is enabled in development
 +versions of FreeBSD (controlled by the
-+MALLOC_PRODUCTION make variable).
++MK_MALLOC_PRODUCTION make variable).
 +



Modified: releng/12.2/contrib/jemalloc/doc/jemalloc.3
==
--- releng/12.2/contrib/jemalloc/doc/jemalloc.3 Mon Sep 14 14:52:22 2020
(r365721)
+++ releng/12.2/contrib/jemalloc/doc/jemalloc.3 Mon Sep 14 14:53:09 2020
(r365722)
@@ -43,7 +43,7 @@ The following configuration options are enabled in lib
 \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally,
 \fB\-\-enable\-debug\fR
 is enabled in development versions of FreeBSD (controlled by the
-\fBMALLOC_PRODUCTION\fR
+\fBMK_MALLOC_PRODUCTION\fR
 make variable)\&.
 .SH "SYNOPSIS"
 .sp

Modified: releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

svn commit: r365721 - in releng/12.2: contrib/llvm-project/compiler-rt/lib/builtins lib/libcompiler_rt

2020-09-14 Thread Dimitry Andric
Author: dim
Date: Mon Sep 14 14:52:22 2020
New Revision: 365721
URL: https://svnweb.freebsd.org/changeset/base/365721

Log:
  MF12 r365661:
  
  MFC r364753:
  
  Add atomic and bswap functions to libcompiler_rt
  
  There have been several mentions on our mailing lists about missing
  atomic functions in our system libraries (e.g. __atomic_load_8 and
  friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.
  
  To address this, add implementations for the functions from compiler-rt
  to the system compiler support libraries, e.g. libcompiler_rt.a and and
  libgcc_s.so.
  
  This also needs a small fixup in compiler-rt's atomic.c, to ensure that
  32-bit mips can build correctly.
  
  Bump __FreeBSD_version to make it easier for port maintainers to detect
  when these functions were added.
  
  Differential Revision: https://reviews.freebsd.org/D26159
  
  MFC r364782:
  
  After r364753, there should be no need to suppress -Watomic-alignment
  warnings anymore for compiler-rt's atomic.c. This occurred because the
  IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
  caused the compiler to emit a runtime call to __atomic_is_lock_free(),
  and that triggers the warning.
  
  MFC r365509:
  
  Follow-up r364753 by enabling compiler-rt's atomic implementation only
  for clang, as it uses clang specific builtins, and does not compile
  correctly with gcc. Note that gcc packages usually come with their own
  libatomic, providing these primitives.
  
  MFC r365588:
  
  Follow-up r364753 by only using arm's stdatomic.c implementation, as it
  already covers the functions in compiler-rt's atomic.c, leading to
  conflicts when linking.
  
  PR:   230888
  Approved by:  re (gjb)

Modified:
  releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
  releng/12.2/lib/libcompiler_rt/Makefile.inc
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
==
--- releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c  Mon Sep 
14 14:45:30 2020(r365720)
+++ releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c  Mon Sep 
14 14:52:22 2020(r365721)
@@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) {
 #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2)
 #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4)
 
-/// 32 bit PowerPC doesn't support 8-byte lock_free atomics
-#if !defined(__powerpc64__) && defined(__powerpc__)
+/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics
+#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__))
 #define IS_LOCK_FREE_8 0
 #else
 #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8)

Modified: releng/12.2/lib/libcompiler_rt/Makefile.inc
==
--- releng/12.2/lib/libcompiler_rt/Makefile.inc Mon Sep 14 14:45:30 2020
(r365720)
+++ releng/12.2/lib/libcompiler_rt/Makefile.inc Mon Sep 14 14:52:22 2020
(r365721)
@@ -18,6 +18,8 @@ SRCF+=ashldi3
 SRCF+= ashlti3
 SRCF+= ashrdi3
 SRCF+= ashrti3
+SRCF+= bswapdi2
+SRCF+= bswapsi2
 SRCF+= clear_cache
 SRCF+= clzdi2
 SRCF+= clzsi2
@@ -121,6 +123,13 @@ SRCF+= umoddi3
 SRCF+= umodsi3
 SRCF+= umodti3
 
+# Enable compiler-rt's atomic implementation only for clang, as it uses clang
+# specific builtins, and gcc packages usually come with their own libatomic.
+# Exclude arm which has its own implementations of atomic functions, below.
+.if "${COMPILER_TYPE}" == "clang" && ${MACHINE_CPUARCH} != "arm"
+SRCF+= atomic
+.endif
+
 # Avoid using SSE2 instructions on i386, if unsupported.
 .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
 SRCS+= floatdidf.c
@@ -213,12 +222,6 @@ CFLAGS+=   -DEMIT_SYNC_ATOMICS
 SRCF+= stdatomic
 .endif
 
-.if "${COMPILER_TYPE}" == "clang" && \
-(${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe")
-SRCS+=  atomic.c
-CFLAGS.atomic.c+=  -Wno-atomic-alignment
-.endif
-
 .for file in ${SRCF}
 .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == 
"") \
 && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
@@ -240,18 +243,9 @@ SRCS+= aeabi_memmove.S
 SRCS+= aeabi_memset.S
 SRCS+= aeabi_uidivmod.S
 SRCS+= aeabi_uldivmod.S
-SRCS+= bswapdi2.S
-SRCS+= bswapsi2.S
 SRCS+= switch16.S
 SRCS+= switch32.S
 SRCS+= switch8.S
 SRCS+= switchu8.S
 SRCS+= sync_synchronize.S
-.endif
-
-# On some archs GCC-6.3 requires bswap32 built-in.
-.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \
-${MACHINE_CPUARCH} == "sparc64"
-SRCS+= bswapdi2.c
-SRCS+= bswapsi2.c
 .endif

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-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: 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-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: r365718 - stable/12/sys/vm

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

Log:
  MFC r365437:
  vm_object_split(): Handle orig_object type changes.

Modified:
  stable/12/sys/vm/vm_object.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_object.c
==
--- stable/12/sys/vm/vm_object.cMon Sep 14 11:03:18 2020
(r365717)
+++ stable/12/sys/vm/vm_object.cMon Sep 14 12:22:19 2020
(r365718)
@@ -1313,7 +1313,7 @@ vm_object_shadow(
 void
 vm_object_split(vm_map_entry_t entry)
 {
-   vm_page_t m, m_next;
+   vm_page_t m, m_busy, m_next;
vm_object_t orig_object, new_object, source;
vm_pindex_t idx, offidxstart;
vm_size_t size;
@@ -1370,8 +1370,14 @@ vm_object_split(vm_map_entry_t entry)
("orig_object->charge < 0"));
orig_object->charge -= ptoa(size);
}
+   m_busy = NULL;
+#ifdef INVARIANTS
+   idx = 0;
+#endif
 retry:
m = vm_page_find_least(orig_object, offidxstart);
+   KASSERT(m == NULL || idx <= m->pindex - offidxstart,
+   ("%s: object %p was repopulated", __func__, orig_object));
for (; m != NULL && (idx = m->pindex - offidxstart) < size;
m = m_next) {
m_next = TAILQ_NEXT(m, listq);
@@ -1417,8 +1423,16 @@ retry:
 */
vm_reserv_rename(m, new_object, orig_object, offidxstart);
 #endif
-   if (orig_object->type == OBJT_SWAP)
+
+   /*
+* orig_object's type may change while sleeping, so keep track
+* of the beginning of the busied range.
+*/
+   if (orig_object->type == OBJT_SWAP) {
vm_page_xbusy(m);
+   if (m_busy == NULL)
+   m_busy = m;
+   }
}
if (orig_object->type == OBJT_SWAP) {
/*
@@ -1426,8 +1440,9 @@ retry:
 * and new_object's locks are released and reacquired. 
 */
swap_pager_copy(orig_object, new_object, offidxstart, 0);
-   TAILQ_FOREACH(m, _object->memq, listq)
-   vm_page_xunbusy(m);
+   if (m_busy != NULL)
+   TAILQ_FOREACH_FROM(m_busy, _object->memq, listq)
+   vm_page_xunbusy(m_busy);
}
VM_OBJECT_WUNLOCK(orig_object);
VM_OBJECT_WUNLOCK(new_object);
___
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: r365717 - stable/11/sys/kern

2020-09-14 Thread Konstantin Belousov
Author: kib
Date: Mon Sep 14 11:03:18 2020
New Revision: 365717
URL: https://svnweb.freebsd.org/changeset/base/365717

Log:
  MFC r365433:
  imgact_elf.c: unify check for phdr fitting into the first page.

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

Modified: stable/11/sys/kern/imgact_elf.c
==
--- stable/11/sys/kern/imgact_elf.c Mon Sep 14 11:02:41 2020
(r365716)
+++ stable/11/sys/kern/imgact_elf.c Mon Sep 14 11:03:18 2020
(r365717)
@@ -389,6 +389,13 @@ __elfN(get_brandinfo)(struct image_params *imgp, const
return (NULL);
 }
 
+static bool
+__elfN(phdr_in_zero_page)(const Elf_Ehdr *hdr)
+{
+   return (hdr->e_phoff <= PAGE_SIZE &&
+   (u_int)hdr->e_phentsize * hdr->e_phnum <= PAGE_SIZE - hdr->e_phoff);
+}
+
 static int
 __elfN(check_header)(const Elf_Ehdr *hdr)
 {
@@ -728,8 +735,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_
}
 
/* Only support headers that fit within first page for now  */
-   if ((hdr->e_phoff > PAGE_SIZE) ||
-   (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
+   if (!__elfN(phdr_in_zero_page)(hdr)) {
error = ENOEXEC;
goto fail;
}
@@ -809,9 +815,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
 * detected an ELF file.
 */
 
-   if ((hdr->e_phoff > PAGE_SIZE) ||
-   (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
-   /* Only support headers in first page for now */
+   if (!__elfN(phdr_in_zero_page)(hdr)) {
uprintf("Program headers not in the first page\n");
return (ENOEXEC);
}
___
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: r365716 - stable/11/libexec/rtld-elf

2020-09-14 Thread Konstantin Belousov
Author: kib
Date: Mon Sep 14 11:02:41 2020
New Revision: 365716
URL: https://svnweb.freebsd.org/changeset/base/365716

Log:
  MFC r365432:
  rtld: pass argc/argv/env to dso inits.
  
  PR:   249162

Modified:
  stable/11/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rtld-elf/rtld.c
==
--- stable/11/libexec/rtld-elf/rtld.c   Mon Sep 14 11:01:46 2020
(r365715)
+++ stable/11/libexec/rtld-elf/rtld.c   Mon Sep 14 11:02:41 2020
(r365716)
@@ -2786,7 +2786,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockst
(void *)elm->obj->init);
LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)elm->obj->init,
0, 0, elm->obj->path);
-   call_initfini_pointer(elm->obj, elm->obj->init);
+   call_init_pointer(elm->obj, elm->obj->init);
}
init_addr = (Elf_Addr *)elm->obj->init_array;
if (init_addr != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2020-09-14 Thread Konstantin Belousov
Author: kib
Date: Mon Sep 14 11:01:46 2020
New Revision: 365715
URL: https://svnweb.freebsd.org/changeset/base/365715

Log:
  MFC r365433:
  imgact_elf.c: unify check for phdr fitting into the first page.

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Mon Sep 14 10:49:38 2020
(r365714)
+++ stable/12/sys/kern/imgact_elf.c Mon Sep 14 11:01:46 2020
(r365715)
@@ -438,6 +438,13 @@ __elfN(get_brandinfo)(struct image_params *imgp, const
return (NULL);
 }
 
+static bool
+__elfN(phdr_in_zero_page)(const Elf_Ehdr *hdr)
+{
+   return (hdr->e_phoff <= PAGE_SIZE &&
+   (u_int)hdr->e_phentsize * hdr->e_phnum <= PAGE_SIZE - hdr->e_phoff);
+}
+
 static int
 __elfN(check_header)(const Elf_Ehdr *hdr)
 {
@@ -803,8 +810,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_
}
 
/* Only support headers that fit within first page for now  */
-   if ((hdr->e_phoff > PAGE_SIZE) ||
-   (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
+   if (!__elfN(phdr_in_zero_page)(hdr)) {
error = ENOEXEC;
goto fail;
}
@@ -1080,9 +1086,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i
 * detected an ELF file.
 */
 
-   if ((hdr->e_phoff > PAGE_SIZE) ||
-   (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
-   /* Only support headers in first page for now */
+   if (!__elfN(phdr_in_zero_page)(hdr)) {
uprintf("Program headers not in the first page\n");
return (ENOEXEC);
}
___
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: r365714 - stable/12/libexec/rtld-elf

2020-09-14 Thread Konstantin Belousov
Author: kib
Date: Mon Sep 14 10:49:38 2020
New Revision: 365714
URL: https://svnweb.freebsd.org/changeset/base/365714

Log:
  MFC r365432:
  rtld: pass argc/argv/env to dso inits.
  
  PR:   249162

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

Modified: stable/12/libexec/rtld-elf/rtld.c
==
--- stable/12/libexec/rtld-elf/rtld.c   Mon Sep 14 10:35:39 2020
(r365713)
+++ stable/12/libexec/rtld-elf/rtld.c   Mon Sep 14 10:49:38 2020
(r365714)
@@ -2810,7 +2810,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockst
(void *)elm->obj->init);
LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)elm->obj->init,
0, 0, elm->obj->path);
-   call_initfini_pointer(elm->obj, elm->obj->init);
+   call_init_pointer(elm->obj, elm->obj->init);
}
init_addr = (Elf_Addr *)elm->obj->init_array;
if (init_addr != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: 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-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: 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-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: 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-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: 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-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: 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-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: 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-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: 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-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"