Re: svn commit: r315925 - head/sys/dev/iwm

2017-03-25 Thread Chagin Dmitry
On Sat, Mar 25, 2017 at 02:49:20AM +, Adrian Chadd wrote:
> Author: adrian
> Date: Sat Mar 25 02:49:20 2017
> New Revision: 315925
> URL: https://svnweb.freebsd.org/changeset/base/315925
> 
> Log:
>   [iwm] Enable Energy Based Scan (EBS).
>   
>   This can significantly reduce scan duration thus saving time and power.
>   EBS failure reported by FW disables EBS for current connection. It is
>   re-enabled upon new connection attempt on any WLAN interface.
>   
>   Obtained from:  dragonflybsd.git 
> 89f579e9823a5c446ca172cf82bbc210d6a054a4
> 
> Modified:
>   head/sys/dev/iwm/if_iwm.c
>   head/sys/dev/iwm/if_iwm_scan.c
>   head/sys/dev/iwm/if_iwm_scan.h
>   head/sys/dev/iwm/if_iwmreg.h
>   head/sys/dev/iwm/if_iwmvar.h
> 
> Modified: head/sys/dev/iwm/if_iwm.c
> ==
> --- head/sys/dev/iwm/if_iwm.c Sat Mar 25 02:44:25 2017(r315924)
> +++ head/sys/dev/iwm/if_iwm.c Sat Mar 25 02:49:20 2017(r315925)
> @@ -4518,6 +4518,11 @@ iwm_newstate(struct ieee80211vap *vap, e
>   break;
>  
>   case IEEE80211_S_ASSOC:
> + /*
> +  * EBS may be disabled due to previous failures reported by FW.
> +  * Reset EBS status here assuming environment has been changed.
> +  */
> +sc->last_ebs_successful = TRUE;
>   if ((error = iwm_assoc(vap, sc)) != 0) {
>   device_printf(sc->sc_dev,
>   "%s: failed to associate: %d\n", __func__,
> @@ -5525,36 +5530,27 @@ iwm_notif_intr(struct iwm_softc *sc)
>   case IWM_INIT_COMPLETE_NOTIF:
>   break;
>  
> - case IWM_SCAN_OFFLOAD_COMPLETE: {
> - struct iwm_periodic_scan_complete *notif;
> - notif = (void *)pkt->data;
> + case IWM_SCAN_OFFLOAD_COMPLETE:
> + iwm_mvm_rx_lmac_scan_complete_notif(sc, pkt);
>   if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) {
>   sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING;
>   ieee80211_runtask(ic, &sc->sc_es_task);
>   }
>   break;
> - }
>  
>   case IWM_SCAN_ITERATION_COMPLETE: {
>   struct iwm_lmac_scan_complete_notif *notif;
>   notif = (void *)pkt->data;
> - ieee80211_runtask(&sc->sc_ic, &sc->sc_es_task);
> - break;
> + break;
>   }
> - 
> - case IWM_SCAN_COMPLETE_UMAC: {
> - struct iwm_umac_scan_complete *notif;
> - notif = (void *)pkt->data;
>  
> - IWM_DPRINTF(sc, IWM_DEBUG_SCAN,
> - "UMAC scan complete, status=0x%x\n",
> - notif->status);
> + case IWM_SCAN_COMPLETE_UMAC:
> + iwm_mvm_rx_umac_scan_complete_notif(sc, pkt);
>   if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) {
>   sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING;
>   ieee80211_runtask(ic, &sc->sc_es_task);
>   }
>   break;
> - }
>  
>   case IWM_SCAN_ITERATION_COMPLETE_UMAC: {
>   struct iwm_umac_scan_iter_complete_notif *notif;
> @@ -5563,7 +5559,6 @@ iwm_notif_intr(struct iwm_softc *sc)
>   IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan iteration "
>   "complete, status=0x%x, %d channels scanned\n",
>   notif->status, notif->scanned_channels);
> - ieee80211_runtask(&sc->sc_ic, &sc->sc_es_task);
>   break;
>   }
>  
> @@ -5967,6 +5962,9 @@ iwm_attach(device_t dev)
>   goto fail;
>   }
>  
> + /* Set EBS as successful as long as not stated otherwise by the FW. */
> + sc->last_ebs_successful = TRUE;
> +
>   /* PCI attach */
>   error = iwm_pci_attach(dev);
>   if (error != 0)
> 
> Modified: head/sys/dev/iwm/if_iwm_scan.c
> ==
> --- head/sys/dev/iwm/if_iwm_scan.cSat Mar 25 02:44:25 2017
> (r315924)
> +++ head/sys/dev/iwm/if_iwm_scan.cSat Mar 25 02:49:20 2017
> (r315925)
> @@ -161,6 +161,9 @@ __FBSDID("$FreeBSD$");
>   * BEGIN mvm/scan.c
>   */
>  
> +#define IWM_DENSE_EBS_SCAN_RATIO 5
> +#define IWM_SPARSE_EBS_SCAN_RATIO 1
> +
>  static uint16_t
>  iwm_mvm_scan_rx_chain(struct iwm_softc *sc)
>  {
> @@ -198,6 +201,67 @@ iwm_mvm_scan_rate_n_flags(struct iwm_sof
>   return htole32(IWM_RATE_6M_PLCP | tx_ant);
>  }
>  
> +static const char *
> +iwm_mvm_ebs_status_str(enum iwm_scan_ebs_status status)
> +{
> + switch (status) {
> + case IWM_SCAN_EBS_SUCCESS:
> +

svn commit: r315931 - head/sys/arm/allwinner

2017-03-25 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Sat Mar 25 10:39:24 2017
New Revision: 315931
URL: https://svnweb.freebsd.org/changeset/base/315931

Log:
  Fix and add comments to match selected frequency sample.
  Add debug printfs when bootverbose is used.
  No functional changes.

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

Modified: head/sys/arm/allwinner/aw_cir.c
==
--- head/sys/arm/allwinner/aw_cir.c Sat Mar 25 05:41:34 2017
(r315930)
+++ head/sys/arm/allwinner/aw_cir.c Sat Mar 25 10:39:24 2017
(r315931)
@@ -89,7 +89,12 @@ __FBSDID("$FreeBSD$");
 
 /* IR Sample Configure Reg */
 #defineAW_IR_CIR   0x34
-/* Filter Threshold = 8 * 21.3 = ~128us < 200us */
+
+/*
+ * Frequency sample: 23437.5Hz (Cycle: 42.7us)
+ * Pulse of NEC Remote > 560us
+ */
+/* Filter Threshold = 8 * 42.7 = ~341us < 500us */
 #define AW_IR_RXFILT_VAL   (((8) & 0x3f) << 2)
 /* Idle Threshold = (2 + 1) * 128 * 42.7 = ~16.4ms > 9ms */
 #define AW_IR_RXIDLE_VAL   (((2) & 0xff) << 8)
@@ -317,12 +322,17 @@ aw_ir_intr(void *arg)
 
/* Read RX interrupt status */
val = READ(sc, AW_IR_RXSTA);
+   if (bootverbose)
+   device_printf(sc->dev, "RX interrupt status: %x\n", val);
 
/* Clean all pending interrupt statuses */
WRITE(sc, AW_IR_RXSTA, val | AW_IR_RXSTA_CLEARALL);
 
/* When Rx FIFO Data available or Packet end */
if (val & (AW_IR_RXINT_RAI_EN | AW_IR_RXINT_RPEI_EN)) {
+   if (bootverbose)
+   device_printf(sc->dev,
+   "RX FIFO Data available or Packet end\n");
/* Get available message count in RX FIFO */
dcnt  = AW_IR_RXSTA_COUNTER(val);
/* Read FIFO */
___
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: r315932 - head/sys/x86/iommu

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sat Mar 25 10:42:10 2017
New Revision: 315932
URL: https://svnweb.freebsd.org/changeset/base/315932

Log:
  Slight cleanup of the comment.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/x86/iommu/intel_dmar.h

Modified: head/sys/x86/iommu/intel_dmar.h
==
--- head/sys/x86/iommu/intel_dmar.h Sat Mar 25 10:39:24 2017
(r315931)
+++ head/sys/x86/iommu/intel_dmar.h Sat Mar 25 10:42:10 2017
(r315932)
@@ -82,8 +82,8 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar
 
 /*
  * The domain abstraction.  Most non-constant members of the domain
- * are locked by the owning dmar unit lock, not by the domain lock.
- * Most important, dmar lock protects the contexts list.
+ * are protected by owning dmar unit lock, not by the domain lock.
+ * Most important, the dmar lock protects the contexts list.
  *
  * The domain lock protects the address map for the domain, and list
  * of unload entries delayed.
___
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: r315933 - head/sys/x86/iommu

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sat Mar 25 10:45:16 2017
New Revision: 315933
URL: https://svnweb.freebsd.org/changeset/base/315933

Log:
  Do not create RMRR entries for identity-mapped domains.
  
  It does not make sense since identity mapping already provides the
  required mapping for RMRR ranges.  More, since identity page tables do
  not reflect content of map entries for id domains, creating RMRR
  entries makes domain data inconsistent.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/x86/iommu/intel_ctx.c
==
--- head/sys/x86/iommu/intel_ctx.c  Sat Mar 25 10:42:10 2017
(r315932)
+++ head/sys/x86/iommu/intel_ctx.c  Sat Mar 25 10:45:16 2017
(r315933)
@@ -433,11 +433,13 @@ dmar_get_ctx_for_dev(struct dmar_unit *d
TD_PINNED_ASSERT;
return (NULL);
}
-   error = domain_init_rmrr(domain1, dev);
-   if (error != 0) {
-   dmar_domain_destroy(domain1);
-   TD_PINNED_ASSERT;
-   return (NULL);
+   if (!id_mapped) {
+   error = domain_init_rmrr(domain1, dev);
+   if (error != 0) {
+   dmar_domain_destroy(domain1);
+   TD_PINNED_ASSERT;
+   return (NULL);
+   }
}
ctx1 = dmar_ctx_alloc(domain1, rid);
ctxp = dmar_map_ctx_entry(ctx1, &sf);
___
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: r315934 - head/sys/x86/iommu

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sat Mar 25 10:47:35 2017
New Revision: 315934
URL: https://svnweb.freebsd.org/changeset/base/315934

Log:
  Avoid leaking allocated but unused context after creation race.
  
  As noted in the comment, nothing special needs to be done to destroy
  the unneeded context after the allocation race, but the context memory
  itself still should to be freed.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/x86/iommu/intel_ctx.c
==
--- head/sys/x86/iommu/intel_ctx.c  Sat Mar 25 10:45:16 2017
(r315933)
+++ head/sys/x86/iommu/intel_ctx.c  Sat Mar 25 10:47:35 2017
(r315934)
@@ -472,13 +472,15 @@ dmar_get_ctx_for_dev(struct dmar_unit *d
dmar->unit, dmar->segment, bus, slot,
func, rid, domain->domain, domain->mgaw,
domain->agaw, id_mapped ? "id" : "re");
+   dmar_unmap_pgtbl(sf);
} else {
-   /* Nothing needs to be done to destroy ctx1. */
+   dmar_unmap_pgtbl(sf);
dmar_domain_destroy(domain1);
+   /* Nothing needs to be done to destroy ctx1. */
+   free(ctx1, M_DMAR_CTX);
domain = ctx->domain;
ctx->refs++; /* tag referenced us */
}
-   dmar_unmap_pgtbl(sf);
} else {
domain = ctx->domain;
ctx->refs++; /* tag referenced us */
___
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: r315935 - head/usr.sbin/pw/tests

2017-03-25 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 25 10:47:58 2017
New Revision: 315935
URL: https://svnweb.freebsd.org/changeset/base/315935

Log:
  Add a regression test for r31512 fix
  
  PR:   217934
  MFC after:1 week

Modified:
  head/usr.sbin/pw/tests/pw_useradd_test.sh

Modified: head/usr.sbin/pw/tests/pw_useradd_test.sh
==
--- head/usr.sbin/pw/tests/pw_useradd_test.sh   Sat Mar 25 10:47:35 2017
(r315934)
+++ head/usr.sbin/pw/tests/pw_useradd_test.sh   Sat Mar 25 10:47:58 2017
(r315935)
@@ -384,6 +384,19 @@ user_add_with_pw_conf_body()
atf_check -s exit:0 \
${PW} useradd foo -C ${HOME}/pw.conf
 }
+atf_test_case user_add_defaultgroup
+user_add_defaultgroup_body()
+{
+   populate_etc_skel
+   echo 'defaultgroup = "plop"' > ${HOME}/pw.conf
+   atf_check -s exit:0 \
+   ${PW} groupadd plop -g 442
+   atf_check -s exit:0 \
+   ${PW} useradd foo -C ${HOME}/pw.conf
+   atf_check -s exit:0 \
+   -o inline:"foo:*:1001:442::0:0:User &:/home/foo:/bin/sh\n" \
+   ${PW} usershow foo
+}
 
 atf_init_test_cases() {
atf_add_test_case user_add
@@ -419,4 +432,5 @@ atf_init_test_cases() {
atf_add_test_case user_add_w_random
atf_add_test_case user_add_w_yes
atf_add_test_case user_add_with_pw_conf
+   atf_add_test_case user_add_defaultgroup
 }
___
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: r315936 - stable/11/sys/cam

2017-03-25 Thread Alexander Motin
Author: mav
Date: Sat Mar 25 11:35:31 2017
New Revision: 315936
URL: https://svnweb.freebsd.org/changeset/base/315936

Log:
  MFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
  
  Queue statistics has nothing to do with presence or absence of INQUIRY
  data, etc.  Target mode devices are never configured, but have queues.

Modified:
  stable/11/sys/cam/cam_xpt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/cam_xpt.c
==
--- stable/11/sys/cam/cam_xpt.c Sat Mar 25 10:47:58 2017(r315935)
+++ stable/11/sys/cam/cam_xpt.c Sat Mar 25 11:35:31 2017(r315936)
@@ -2688,36 +2688,25 @@ call_sim:
}
case XPT_GDEV_STATS:
{
-   struct cam_ed *dev;
+   struct ccb_getdevstats *cgds = &start_ccb->cgds;
+   struct cam_ed *dev = path->device;
+   struct cam_eb *bus = path->bus;
+   struct cam_et *tar = path->target;
+   struct cam_devq *devq = bus->sim->devq;
 
-   dev = path->device;
-   if ((dev->flags & CAM_DEV_UNCONFIGURED) != 0) {
-   start_ccb->ccb_h.status = CAM_DEV_NOT_THERE;
-   } else {
-   struct ccb_getdevstats *cgds;
-   struct cam_eb *bus;
-   struct cam_et *tar;
-   struct cam_devq *devq;
-
-   cgds = &start_ccb->cgds;
-   bus = path->bus;
-   tar = path->target;
-   devq = bus->sim->devq;
-   mtx_lock(&devq->send_mtx);
-   cgds->dev_openings = dev->ccbq.dev_openings;
-   cgds->dev_active = dev->ccbq.dev_active;
-   cgds->allocated = dev->ccbq.allocated;
-   cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq);
-   cgds->held = cgds->allocated - cgds->dev_active -
-   cgds->queued;
-   cgds->last_reset = tar->last_reset;
-   cgds->maxtags = dev->maxtags;
-   cgds->mintags = dev->mintags;
-   if (timevalcmp(&tar->last_reset, &bus->last_reset, <))
-   cgds->last_reset = bus->last_reset;
-   mtx_unlock(&devq->send_mtx);
-   cgds->ccb_h.status = CAM_REQ_CMP;
-   }
+   mtx_lock(&devq->send_mtx);
+   cgds->dev_openings = dev->ccbq.dev_openings;
+   cgds->dev_active = dev->ccbq.dev_active;
+   cgds->allocated = dev->ccbq.allocated;
+   cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq);
+   cgds->held = cgds->allocated - cgds->dev_active - cgds->queued;
+   cgds->last_reset = tar->last_reset;
+   cgds->maxtags = dev->maxtags;
+   cgds->mintags = dev->mintags;
+   if (timevalcmp(&tar->last_reset, &bus->last_reset, <))
+   cgds->last_reset = bus->last_reset;
+   mtx_unlock(&devq->send_mtx);
+   cgds->ccb_h.status = CAM_REQ_CMP;
break;
}
case XPT_GDEVLIST:
___
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: r315937 - stable/10/sys/cam

2017-03-25 Thread Alexander Motin
Author: mav
Date: Sat Mar 25 11:36:06 2017
New Revision: 315937
URL: https://svnweb.freebsd.org/changeset/base/315937

Log:
  MFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
  
  Queue statistics has nothing to do with presence or absence of INQUIRY
  data, etc.  Target mode devices are never configured, but have queues.

Modified:
  stable/10/sys/cam/cam_xpt.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/cam_xpt.c
==
--- stable/10/sys/cam/cam_xpt.c Sat Mar 25 11:35:31 2017(r315936)
+++ stable/10/sys/cam/cam_xpt.c Sat Mar 25 11:36:06 2017(r315937)
@@ -2674,36 +2674,25 @@ call_sim:
}
case XPT_GDEV_STATS:
{
-   struct cam_ed *dev;
+   struct ccb_getdevstats *cgds = &start_ccb->cgds;
+   struct cam_ed *dev = path->device;
+   struct cam_eb *bus = path->bus;
+   struct cam_et *tar = path->target;
+   struct cam_devq *devq = bus->sim->devq;
 
-   dev = path->device;
-   if ((dev->flags & CAM_DEV_UNCONFIGURED) != 0) {
-   start_ccb->ccb_h.status = CAM_DEV_NOT_THERE;
-   } else {
-   struct ccb_getdevstats *cgds;
-   struct cam_eb *bus;
-   struct cam_et *tar;
-   struct cam_devq *devq;
-
-   cgds = &start_ccb->cgds;
-   bus = path->bus;
-   tar = path->target;
-   devq = bus->sim->devq;
-   mtx_lock(&devq->send_mtx);
-   cgds->dev_openings = dev->ccbq.dev_openings;
-   cgds->dev_active = dev->ccbq.dev_active;
-   cgds->allocated = dev->ccbq.allocated;
-   cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq);
-   cgds->held = cgds->allocated - cgds->dev_active -
-   cgds->queued;
-   cgds->last_reset = tar->last_reset;
-   cgds->maxtags = dev->maxtags;
-   cgds->mintags = dev->mintags;
-   if (timevalcmp(&tar->last_reset, &bus->last_reset, <))
-   cgds->last_reset = bus->last_reset;
-   mtx_unlock(&devq->send_mtx);
-   cgds->ccb_h.status = CAM_REQ_CMP;
-   }
+   mtx_lock(&devq->send_mtx);
+   cgds->dev_openings = dev->ccbq.dev_openings;
+   cgds->dev_active = dev->ccbq.dev_active;
+   cgds->allocated = dev->ccbq.allocated;
+   cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq);
+   cgds->held = cgds->allocated - cgds->dev_active - cgds->queued;
+   cgds->last_reset = tar->last_reset;
+   cgds->maxtags = dev->maxtags;
+   cgds->mintags = dev->mintags;
+   if (timevalcmp(&tar->last_reset, &bus->last_reset, <))
+   cgds->last_reset = bus->last_reset;
+   mtx_unlock(&devq->send_mtx);
+   cgds->ccb_h.status = CAM_REQ_CMP;
break;
}
case XPT_GDEVLIST:
___
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: r315938 - stable/11/sys/cam/ctl

2017-03-25 Thread Alexander Motin
Author: mav
Date: Sat Mar 25 11:44:34 2017
New Revision: 315938
URL: https://svnweb.freebsd.org/changeset/base/315938

Log:
  MFC r315084: Increase device openings to tagged maximum.
  
  Some SIMs report much less untagged device openings then tagged ones.
  Target mode devices are not handled by regular probing routines, and so
  there is nothing to increase queue size for them to the SIM's maximum.
  To fix that resize the queue explicitly on ctl periph registration.
  This radically improves performance of mpt(4) in target mode.
  
  Also fetch and report device queue statistics in `ctladm dumpstructs`,
  since regular way of `camcontrol tags` is not usable in target mode.

Modified:
  stable/11/sys/cam/ctl/scsi_ctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/ctl/scsi_ctl.c
==
--- stable/11/sys/cam/ctl/scsi_ctl.cSat Mar 25 11:36:06 2017
(r315937)
+++ stable/11/sys/cam/ctl/scsi_ctl.cSat Mar 25 11:44:34 2017
(r315938)
@@ -457,6 +457,16 @@ ctlferegister(struct cam_periph *periph,
softc->periph = periph;
periph->softc = softc;
 
+   /* Increase device openings to maximum for the SIM. */
+   if (bus_softc->sim->max_tagged_dev_openings >
+   bus_softc->sim->max_dev_openings) {
+   cam_release_devq(periph->path,
+   /*relsim_flags*/RELSIM_ADJUST_OPENINGS,
+   /*openings*/bus_softc->sim->max_tagged_dev_openings,
+   /*timeout*/0,
+   /*getcount_only*/1);
+   }
+
xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
ccb.ccb_h.func_code = XPT_EN_LUN;
ccb.cel.grp6_len = 0;
@@ -1816,9 +1826,9 @@ static void
 ctlfe_dump_sim(struct cam_sim *sim)
 {
 
-   printf("%s%d: max tagged openings: %d, max dev openings: %d\n",
-  sim->sim_name, sim->unit_number,
-  sim->max_tagged_dev_openings, sim->max_dev_openings);
+   printf("%s%d: max dev openings: %d, max tagged dev openings: %d\n",
+   sim->sim_name, sim->unit_number, sim->max_dev_openings,
+   sim->max_tagged_dev_openings);
 }
 
 /*
@@ -1827,11 +1837,21 @@ ctlfe_dump_sim(struct cam_sim *sim)
 static void
 ctlfe_dump_queue(struct ctlfe_lun_softc *softc)
 {
+   struct cam_periph *periph = softc->periph;
struct ccb_hdr *hdr;
-   struct cam_periph *periph;
+   struct ccb_getdevstats cgds;
int num_items;
 
-   periph = softc->periph;
+   xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
+   cgds.ccb_h.func_code = XPT_GDEV_STATS;
+   xpt_action((union ccb *)&cgds);
+   if ((cgds.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+   xpt_print(periph->path, "devq: openings %d, active %d, "
+   "allocated %d, queued %d, held %d\n",
+   cgds.dev_openings, cgds.dev_active, cgds.allocated,
+   cgds.queued, cgds.held);
+   }
+
num_items = 0;
 
STAILQ_FOREACH(hdr, &softc->work_queue, periph_links.stqe) {
___
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: r315939 - stable/10/sys/cam/ctl

2017-03-25 Thread Alexander Motin
Author: mav
Date: Sat Mar 25 11:45:19 2017
New Revision: 315939
URL: https://svnweb.freebsd.org/changeset/base/315939

Log:
  MFC r315084: Increase device openings to tagged maximum.
  
  Some SIMs report much less untagged device openings then tagged ones.
  Target mode devices are not handled by regular probing routines, and so
  there is nothing to increase queue size for them to the SIM's maximum.
  To fix that resize the queue explicitly on ctl periph registration.
  This radically improves performance of mpt(4) in target mode.
  
  Also fetch and report device queue statistics in `ctladm dumpstructs`,
  since regular way of `camcontrol tags` is not usable in target mode.

Modified:
  stable/10/sys/cam/ctl/scsi_ctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/scsi_ctl.c
==
--- stable/10/sys/cam/ctl/scsi_ctl.cSat Mar 25 11:44:34 2017
(r315938)
+++ stable/10/sys/cam/ctl/scsi_ctl.cSat Mar 25 11:45:19 2017
(r315939)
@@ -457,6 +457,16 @@ ctlferegister(struct cam_periph *periph,
softc->periph = periph;
periph->softc = softc;
 
+   /* Increase device openings to maximum for the SIM. */
+   if (bus_softc->sim->max_tagged_dev_openings >
+   bus_softc->sim->max_dev_openings) {
+   cam_release_devq(periph->path,
+   /*relsim_flags*/RELSIM_ADJUST_OPENINGS,
+   /*openings*/bus_softc->sim->max_tagged_dev_openings,
+   /*timeout*/0,
+   /*getcount_only*/1);
+   }
+
xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
ccb.ccb_h.func_code = XPT_EN_LUN;
ccb.cel.grp6_len = 0;
@@ -1815,9 +1825,9 @@ static void
 ctlfe_dump_sim(struct cam_sim *sim)
 {
 
-   printf("%s%d: max tagged openings: %d, max dev openings: %d\n",
-  sim->sim_name, sim->unit_number,
-  sim->max_tagged_dev_openings, sim->max_dev_openings);
+   printf("%s%d: max dev openings: %d, max tagged dev openings: %d\n",
+   sim->sim_name, sim->unit_number, sim->max_dev_openings,
+   sim->max_tagged_dev_openings);
 }
 
 /*
@@ -1826,11 +1836,21 @@ ctlfe_dump_sim(struct cam_sim *sim)
 static void
 ctlfe_dump_queue(struct ctlfe_lun_softc *softc)
 {
+   struct cam_periph *periph = softc->periph;
struct ccb_hdr *hdr;
-   struct cam_periph *periph;
+   struct ccb_getdevstats cgds;
int num_items;
 
-   periph = softc->periph;
+   xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
+   cgds.ccb_h.func_code = XPT_GDEV_STATS;
+   xpt_action((union ccb *)&cgds);
+   if ((cgds.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+   xpt_print(periph->path, "devq: openings %d, active %d, "
+   "allocated %d, queued %d, held %d\n",
+   cgds.dev_openings, cgds.dev_active, cgds.allocated,
+   cgds.queued, cgds.held);
+   }
+
num_items = 0;
 
STAILQ_FOREACH(hdr, &softc->work_queue, periph_links.stqe) {
___
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: r315940 - stable/11/share/man/man4

2017-03-25 Thread Alexander Motin
Author: mav
Date: Sat Mar 25 11:47:23 2017
New Revision: 315940
URL: https://svnweb.freebsd.org/changeset/base/315940

Log:
  MFC r315087, r315146:
  Improve ctl(4) description, including frontends and backends.

Modified:
  stable/11/share/man/man4/ctl.4
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/ctl.4
==
--- stable/11/share/man/man4/ctl.4  Sat Mar 25 11:45:19 2017
(r315939)
+++ stable/11/share/man/man4/ctl.4  Sat Mar 25 11:47:23 2017
(r315940)
@@ -1,5 +1,5 @@
 .\" Copyright (c) 2013 Edward Tomasz Napierala
-.\" Copyright (c) 2015 Alexander Motin 
+.\" Copyright (c) 2015-2017 Alexander Motin 
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,12 +24,12 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd January 19, 2017
+.Dd March 11, 2017
 .Dt CTL 4
 .Os
 .Sh NAME
 .Nm ctl
-.Nd CAM Target Layer / iSCSI target
+.Nd CAM Target Layer / SCSI target subsystem
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following line in your
@@ -48,12 +48,12 @@ ctl_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-subsystem provides SCSI disk and processor emulation.
+subsystem provides SCSI target devices emulation.
 It supports features such as:
 .Pp
 .Bl -bullet -compact
 .It
-Disk, processor and cdrom device emulation
+Disk, CD-ROM and processor device emulation
 .It
 Tagged queueing
 .It
@@ -61,32 +61,73 @@ SCSI task attribute support (ordered, he
 .It
 SCSI implicit command ordering support
 .It
-Full task management support (abort, LUN reset, target reset, etc.)
+Full task management support (abort, query, reset, etc.)
 .It
-Support for multiple ports
+Support for multiple ports, initiators, targets and backing stores
 .It
-Support for multiple simultaneous initiators
-.It
-Support for multiple simultaneous backing stores
-.It
-Support for VMWare VAAI: COMPARE AND WRITE, XCOPY, WRITE SAME,
-and UNMAP commands
-.It
-Support for Microsoft ODX: POPULATE TOKEN/WRITE USING TOKEN,
-WRITE SAME, and UNMAP commands
+Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE,
+XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP)
 .It
 Persistent reservation support
 .It
-Mode sense/select support
+Extensive VPD/mode/log pages support
 .It
-Error injection support
+Featured error reporting, error injection and basic SMART support
 .It
 High Availability clustering support with ALUA
 .It
 All I/O handled in-kernel, no userland context switch overhead
 .El
 .Pp
-It also serves as a kernel component of the native iSCSI target.
+The
+.Nm
+subsystem includes multiple frontends to provide access using different
+transport protocols and implementations:
+.Bl -tag -width cfumass
+.It camsim
+Provides access for local system via virtual initiator mode
+.Xr CAM 4
+SIM.
+.It camtgt
+Provides access for remote systems via target mode
+.Xr CAM 4
+SIMs, such as Fibre Channel
+.Xr isp 4
+and
+.Xr mpt 4 .
+.It cfumass
+Provides access for remote systems via USB Mass Storage Class
+Bulk Only (BBB) Transport.
+.It ha
+Internal frontend used to receive requests from other node ports in
+High Availability cluster.
+.It ioctl
+Provides access for local user-level applications via
+.Xr ioctl 2
+based API.
+.It iscsi
+Combined with
+.Xr iscsi 4
+and
+.Xr ctld 8 ,
+provides access for remote systems via iSCSI protocol.
+.It tpc
+Internal frontend used to receive requests from Third Party Copy engine,
+implementing copy offload operations.
+.El
+.Pp
+The
+.Nm
+subsystem includes two backends to create logical units using different
+kinds of backing stores:
+.Bl -tag -width ramdisk
+.It block
+Stores data in ZFS ZVOLs, files or raw block devices.
+.It ramdisk
+Stores data in RAM, that makes it mostly useful for performance testing.
+Depending on configured capacity can work as black hole, thin or thick
+provisioned disk.
+.El
 .Sh SYSCTL VARIABLES
 The following variables are available as both
 .Xr sysctl 8
@@ -146,7 +187,7 @@ primary;
 .It 1
 secondary.
 .El
-This role can be overriden on per-LUN basis using "ha_role" LUN option,
+This role can be overridden on per-LUN basis using "ha_role" LUN option,
 so that for one LUN one node is primary, while for another -- another.
 Role change from primary to secondary for HA modes 0 and 2 closes backends,
 the opposite change -- opens.
___
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: r315941 - stable/10/share/man/man4

2017-03-25 Thread Alexander Motin
Author: mav
Date: Sat Mar 25 11:48:12 2017
New Revision: 315941
URL: https://svnweb.freebsd.org/changeset/base/315941

Log:
  MFC r315087, r315146:
  Improve ctl(4) description, including frontends and backends.

Modified:
  stable/10/share/man/man4/ctl.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/ctl.4
==
--- stable/10/share/man/man4/ctl.4  Sat Mar 25 11:47:23 2017
(r315940)
+++ stable/10/share/man/man4/ctl.4  Sat Mar 25 11:48:12 2017
(r315941)
@@ -1,5 +1,5 @@
 .\" Copyright (c) 2013 Edward Tomasz Napierala
-.\" Copyright (c) 2015 Alexander Motin 
+.\" Copyright (c) 2015-2017 Alexander Motin 
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,12 +24,12 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd September 27, 2015
+.Dd March 11, 2017
 .Dt CTL 4
 .Os
 .Sh NAME
 .Nm ctl
-.Nd CAM Target Layer / iSCSI target
+.Nd CAM Target Layer / SCSI target subsystem
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following line in your
@@ -48,12 +48,12 @@ ctl_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-subsystem provides SCSI disk and processor emulation.
+subsystem provides SCSI target devices emulation.
 It supports features such as:
 .Pp
 .Bl -bullet -compact
 .It
-Disk, processor and cdrom device emulation
+Disk, CD-ROM and processor device emulation
 .It
 Tagged queueing
 .It
@@ -61,32 +61,73 @@ SCSI task attribute support (ordered, he
 .It
 SCSI implicit command ordering support
 .It
-Full task management support (abort, LUN reset, target reset, etc.)
+Full task management support (abort, query, reset, etc.)
 .It
-Support for multiple ports
+Support for multiple ports, initiators, targets and backing stores
 .It
-Support for multiple simultaneous initiators
-.It
-Support for multiple simultaneous backing stores
-.It
-Support for VMWare VAAI: COMPARE AND WRITE, XCOPY, WRITE SAME,
-and UNMAP commands
-.It
-Support for Microsoft ODX: POPULATE TOKEN/WRITE USING TOKEN,
-WRITE SAME, and UNMAP commands
+Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE,
+XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP)
 .It
 Persistent reservation support
 .It
-Mode sense/select support
+Extensive VPD/mode/log pages support
 .It
-Error injection support
+Featured error reporting, error injection and basic SMART support
 .It
 High Availability clustering support with ALUA
 .It
 All I/O handled in-kernel, no userland context switch overhead
 .El
 .Pp
-It also serves as a kernel component of the native iSCSI target.
+The
+.Nm
+subsystem includes multiple frontends to provide access using different
+transport protocols and implementations:
+.Bl -tag -width cfumass
+.It camsim
+Provides access for local system via virtual initiator mode
+.Xr CAM 4
+SIM.
+.It camtgt
+Provides access for remote systems via target mode
+.Xr CAM 4
+SIMs, such as Fibre Channel
+.Xr isp 4
+and
+.Xr mpt 4 .
+.It cfumass
+Provides access for remote systems via USB Mass Storage Class
+Bulk Only (BBB) Transport.
+.It ha
+Internal frontend used to receive requests from other node ports in
+High Availability cluster.
+.It ioctl
+Provides access for local user-level applications via
+.Xr ioctl 2
+based API.
+.It iscsi
+Combined with
+.Xr iscsi 4
+and
+.Xr ctld 8 ,
+provides access for remote systems via iSCSI protocol.
+.It tpc
+Internal frontend used to receive requests from Third Party Copy engine,
+implementing copy offload operations.
+.El
+.Pp
+The
+.Nm
+subsystem includes two backends to create logical units using different
+kinds of backing stores:
+.Bl -tag -width ramdisk
+.It block
+Stores data in ZFS ZVOLs, files or raw block devices.
+.It ramdisk
+Stores data in RAM, that makes it mostly useful for performance testing.
+Depending on configured capacity can work as black hole, thin or thick
+provisioned disk.
+.El
 .Sh SYSCTL VARIABLES
 The following variables are available as both
 .Xr sysctl 8
@@ -146,7 +187,7 @@ primary;
 .It 1
 secondary.
 .El
-This role can be overriden on per-LUN basis using "ha_role" LUN option,
+This role can be overridden on per-LUN basis using "ha_role" LUN option,
 so that for one LUN one node is primary, while for another -- another.
 Role change from primary to secondary for HA modes 0 and 2 closes backends,
 the opposite change -- opens.
___
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: r315773 - head/sbin/devd

2017-03-25 Thread Dag-Erling Smørgrav
Warner Losh  writes:
> Log:
>   Implement quote escaping. String values may now contain " if you
>   it is preceded by \.

If you're interested, openpam_readword(3) implements the full POSIX
shell quoting rules, including line continuations and multi-line quoted
strings, and should be fairly easy to translate to C++.  There is also
an openpam_readlinev(3) which reads a full line (or more in case of line
continuations) and returns an array of words.  Obviously, you'll want to
copy & adapt them rather than link devd with libpam.

contrib/openpam/lib/libpam/openpam_read{word,linev}.c

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r315942 - stable/11/lib/libcompiler_rt

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 12:21:20 2017
New Revision: 315942
URL: https://svnweb.freebsd.org/changeset/base/315942

Log:
  MFC r315689:
  
  Gcc has incompatible internal declarations for __divtc3 and __multc3 as
  defined in compiler-rt, but it has no option to silence its warning, so
  make gcc warnings for libcompiler_rt non-fatal.
  
  Noticed by:   lwhsu

Modified:
  stable/11/lib/libcompiler_rt/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libcompiler_rt/Makefile
==
--- stable/11/lib/libcompiler_rt/Makefile   Sat Mar 25 11:48:12 2017
(r315941)
+++ stable/11/lib/libcompiler_rt/Makefile   Sat Mar 25 12:21:20 2017
(r315942)
@@ -16,6 +16,10 @@ CFLAGS+= -I${SRCTOP}/contrib/libcxxrt
 CWARNFLAGS.gcc_personality_v0.c+= -Wno-typedef-redefinition
 .endif
 
+# gcc has incompatible internal declarations for __divtc3 and __multc3, but has
+# no option to silence its warning, so make warnings non-fatal.
+NO_WERROR.gcc=
+
 .include "Makefile.inc"
 
 .if ${MK_INSTALLLIB} != "no"
___
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: r315943 - in stable: 10/contrib/libcxxrt 11/contrib/libcxxrt 9/contrib/libcxxrt

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 12:29:15 2017
New Revision: 315943
URL: https://svnweb.freebsd.org/changeset/base/315943

Log:
  MFC r315745:
  
  Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:
  
  Author: David Chisnall 
  Date:   Wed Mar 22 12:27:08 2017 +
  
  Simplify some code.
  
  realloc() with a null pointer is equivalent to malloc, so we don't need
  to handle the two cases independently.
  
  Fixes #46
  
  This should help with lang/beignet and other programs, which expect
  __cxa_demangle(name, NULL, NULL, &status) to return zero in status.
  
  PR:   213732

Modified:
  stable/9/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)
  stable/9/contrib/libcxxrt/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/libcxxrt/typeinfo.cc
  stable/11/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/9/contrib/libcxxrt/typeinfo.cc
==
--- stable/9/contrib/libcxxrt/typeinfo.cc   Sat Mar 25 12:21:20 2017
(r315942)
+++ stable/9/contrib/libcxxrt/typeinfo.cc   Sat Mar 25 12:29:15 2017
(r315943)
@@ -86,15 +86,7 @@ extern "C" char* __cxa_demangle(const ch
if (NULL != demangled)
{
size_t len = strlen(demangled);
-   if (buf == NULL)
-   {
-   if (n)
-   {
-   *n = len;
-   }
-   return demangled;
-   }
-   if (*n < len+1)
+   if (!buf || (*n < len+1))
{
buf = static_cast(realloc(buf, len+1));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r315943 - in stable: 10/contrib/libcxxrt 11/contrib/libcxxrt 9/contrib/libcxxrt

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 12:29:15 2017
New Revision: 315943
URL: https://svnweb.freebsd.org/changeset/base/315943

Log:
  MFC r315745:
  
  Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:
  
  Author: David Chisnall 
  Date:   Wed Mar 22 12:27:08 2017 +
  
  Simplify some code.
  
  realloc() with a null pointer is equivalent to malloc, so we don't need
  to handle the two cases independently.
  
  Fixes #46
  
  This should help with lang/beignet and other programs, which expect
  __cxa_demangle(name, NULL, NULL, &status) to return zero in status.
  
  PR:   213732

Modified:
  stable/10/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/libcxxrt/typeinfo.cc
  stable/9/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/11/   (props changed)
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/10/contrib/libcxxrt/typeinfo.cc
==
--- stable/10/contrib/libcxxrt/typeinfo.cc  Sat Mar 25 12:21:20 2017
(r315942)
+++ stable/10/contrib/libcxxrt/typeinfo.cc  Sat Mar 25 12:29:15 2017
(r315943)
@@ -86,15 +86,7 @@ extern "C" char* __cxa_demangle(const ch
if (NULL != demangled)
{
size_t len = strlen(demangled);
-   if (buf == NULL)
-   {
-   if (n)
-   {
-   *n = len;
-   }
-   return demangled;
-   }
-   if (*n < len+1)
+   if (!buf || (*n < len+1))
{
buf = static_cast(realloc(buf, len+1));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r315943 - in stable: 10/contrib/libcxxrt 11/contrib/libcxxrt 9/contrib/libcxxrt

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 12:29:15 2017
New Revision: 315943
URL: https://svnweb.freebsd.org/changeset/base/315943

Log:
  MFC r315745:
  
  Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:
  
  Author: David Chisnall 
  Date:   Wed Mar 22 12:27:08 2017 +
  
  Simplify some code.
  
  realloc() with a null pointer is equivalent to malloc, so we don't need
  to handle the two cases independently.
  
  Fixes #46
  
  This should help with lang/beignet and other programs, which expect
  __cxa_demangle(name, NULL, NULL, &status) to return zero in status.
  
  PR:   213732

Modified:
  stable/11/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/libcxxrt/typeinfo.cc
  stable/9/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/10/   (props changed)
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/11/contrib/libcxxrt/typeinfo.cc
==
--- stable/11/contrib/libcxxrt/typeinfo.cc  Sat Mar 25 12:21:20 2017
(r315942)
+++ stable/11/contrib/libcxxrt/typeinfo.cc  Sat Mar 25 12:29:15 2017
(r315943)
@@ -86,15 +86,7 @@ extern "C" char* __cxa_demangle(const ch
if (NULL != demangled)
{
size_t len = strlen(demangled);
-   if (buf == NULL)
-   {
-   if (n)
-   {
-   *n = len;
-   }
-   return demangled;
-   }
-   if (*n < len+1)
+   if (!buf || (*n < len+1))
{
buf = static_cast(realloc(buf, len+1));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r315944 - vendor/libcxxrt/dist

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 12:51:11 2017
New Revision: 315944
URL: https://svnweb.freebsd.org/changeset/base/315944

Log:
  Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.
  
  Interesting fixes:
  c9601e9 __cxa_demangle_gnu3: fix demangling of wchar_t (#39)
  0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40)
  2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41)
  c94e7e0 Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header (#42)
  8a85371 Simplify some code.

Modified:
  vendor/libcxxrt/dist/CMakeLists.txt
  vendor/libcxxrt/dist/libelftc_dem_gnu3.c
  vendor/libcxxrt/dist/typeinfo.cc
  vendor/libcxxrt/dist/unwind-arm.h

Modified: vendor/libcxxrt/dist/CMakeLists.txt
==
--- vendor/libcxxrt/dist/CMakeLists.txt Sat Mar 25 12:29:15 2017
(r315943)
+++ vendor/libcxxrt/dist/CMakeLists.txt Sat Mar 25 12:51:11 2017
(r315944)
@@ -13,11 +13,8 @@ set(CXXRT_SOURCES
 
 add_library(cxxrt-static STATIC ${CXXRT_SOURCES})
 add_library(cxxrt-shared SHARED ${CXXRT_SOURCES})
-
-if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
-target_link_libraries(cxxrt-shared dl)
-target_link_libraries(cxxrt-static dl)
-endif()
+target_link_libraries(cxxrt-shared ${CMAKE_DL_LIBS})
+target_link_libraries(cxxrt-static ${CMAKE_DL_LIBS})
 
 set_target_properties(cxxrt-static cxxrt-shared PROPERTIES
   OUTPUT_NAME "cxxrt"

Modified: vendor/libcxxrt/dist/libelftc_dem_gnu3.c
==
--- vendor/libcxxrt/dist/libelftc_dem_gnu3.cSat Mar 25 12:29:15 2017
(r315943)
+++ vendor/libcxxrt/dist/libelftc_dem_gnu3.cSat Mar 25 12:51:11 2017
(r315944)
@@ -846,7 +846,7 @@ cpp_demangle_push_type_qualifier(struct 
free(buf);
++e_idx;
break;
-   };
+   }
--idx;
}
 
@@ -1007,7 +1007,7 @@ cpp_demangle_read_expr_primary(struct cp
return (cpp_demangle_push_str(ddata, "true", 4));
default:
return (0);
-   };
+   }
 
case 'd':
++ddata->cur;
@@ -1057,7 +1057,7 @@ cpp_demangle_read_expr_primary(struct cp
 
default:
return (0);
-   };
+   }
 }
 
 static int
@@ -1332,14 +1332,14 @@ cpp_demangle_read_expression(struct cpp_
/* operator sizeof */
ddata->cur += 2;
return (cpp_demangle_read_expression_unary(ddata, "sizeof", 6));
-   };
+   }
 
switch (*ddata->cur) {
case 'L':
return (cpp_demangle_read_expr_primary(ddata));
case 'T':
return (cpp_demangle_read_tmpl_param(ddata));
-   };
+   }
 
return (0);
 }
@@ -1555,11 +1555,13 @@ cpp_demangle_read_encoding(struct cpp_de
if (!cpp_demangle_push_str(ddata,
"non-transaction clone for ", 26))
return (0);
+   break;
case 't':
default:
if (!cpp_demangle_push_str(ddata,
"transaction clone for ", 22))
return (0);
+   break;
}
++ddata->cur;
return (cpp_demangle_read_encoding(ddata));
@@ -1712,7 +1714,7 @@ cpp_demangle_read_encoding(struct cpp_de
if (*ddata->cur == '\0')
return (0);
break;
-   };
+   }
 
return (cpp_demangle_read_name(ddata));
 }
@@ -1784,7 +1786,7 @@ cpp_demangle_read_name(struct cpp_demang
return (cpp_demangle_read_nested_name(ddata));
case 'Z':
return (cpp_demangle_read_local_name(ddata));
-   };
+   }
 
if (!vector_str_init(&v))
return (0);
@@ -1885,7 +1887,7 @@ cpp_demangle_read_nested_name(struct cpp
case 'K':
ddata->mem_cst = true;
break;
-   };
+   }
++ddata->cur;
}
 
@@ -1913,7 +1915,7 @@ cpp_demangle_read_nested_name(struct cpp
default:
if (!cpp_demangle_read_uqname(ddata))
goto clean;
-   };
+   }
 
if ((subst_str = vector_str_substr(output, p_idx,
output->size - 1, &subst_str_len)) == NULL)
@@ -2188,35 +2190,35 @@ cpp_demangle_read_subst(struct cpp_deman
 
case SIMPLE_HASH('S', 'd'):
/* std::basic_iostream > */
-   if (!cpp_demangle_push_str(ddata, "std::iostream", 19))
+   if (!cpp_demangle_push_str(ddata, "std::basic_iostream", 19))

svn commit: r315945 - vendor/libcxxrt/2017-03-22-8a853717e61d5d55cbdf74d9d0a7545da5d5ff92

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 12:53:20 2017
New Revision: 315945
URL: https://svnweb.freebsd.org/changeset/base/315945

Log:
  Tag libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.

Added:
  vendor/libcxxrt/2017-03-22-8a853717e61d5d55cbdf74d9d0a7545da5d5ff92/
 - copied from r315944, vendor/libcxxrt/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r315946 - head/sys/dev/iwn

2017-03-25 Thread Andriy Voskoboinyk
Author: avos
Date: Sat Mar 25 13:15:43 2017
New Revision: 315946
URL: https://svnweb.freebsd.org/changeset/base/315946

Log:
  iwn: add few missing notification types into iwn_intr_str()

Modified:
  head/sys/dev/iwn/if_iwn_debug.h

Modified: head/sys/dev/iwn/if_iwn_debug.h
==
--- head/sys/dev/iwn/if_iwn_debug.h Sat Mar 25 12:53:20 2017
(r315945)
+++ head/sys/dev/iwn/if_iwn_debug.h Sat Mar 25 13:15:43 2017
(r315946)
@@ -72,6 +72,7 @@ iwn_intr_str(uint8_t cmd)
case IWN_RX_PHY:return "RX_PHY";
case IWN_MPDU_RX_DONE:  return "MPDU_RX_DONE";
case IWN_RX_DONE:   return "RX_DONE";
+   case IWN_RX_COMPRESSED_BA:  return "RX_COMPRESSED_BA";
 
/* Command Notifications */
case IWN_CMD_RXON:  return "IWN_CMD_RXON";
@@ -81,6 +82,7 @@ iwn_intr_str(uint8_t cmd)
case IWN_CMD_LINK_QUALITY:  return "IWN_CMD_LINK_QUALITY";
case IWN_CMD_SET_LED:   return "IWN_CMD_SET_LED";
case IWN5000_CMD_WIMAX_COEX:return "IWN5000_CMD_WIMAX_COEX";
+   case IWN_TEMP_NOTIFICATION: return "IWN_TEMP_NOTIFICATION";
case IWN5000_CMD_CALIB_CONFIG:  return "IWN5000_CMD_CALIB_CONFIG";
case IWN5000_CMD_CALIB_RESULT:  return "IWN5000_CMD_CALIB_RESULT";
case IWN5000_CMD_CALIB_COMPLETE: return "IWN5000_CMD_CALIB_COMPLETE";
___
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: r315947 - head/contrib/libcxxrt

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 13:17:48 2017
New Revision: 315947
URL: https://svnweb.freebsd.org/changeset/base/315947

Log:
  Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.
  
  Interesting fixes which were not already merged:
  0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40)
  2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41)
  
  MFC after:3 days

Modified:
  head/contrib/libcxxrt/libelftc_dem_gnu3.c
Directory Properties:
  head/contrib/libcxxrt/   (props changed)

Modified: head/contrib/libcxxrt/libelftc_dem_gnu3.c
==
--- head/contrib/libcxxrt/libelftc_dem_gnu3.c   Sat Mar 25 13:15:43 2017
(r315946)
+++ head/contrib/libcxxrt/libelftc_dem_gnu3.c   Sat Mar 25 13:17:48 2017
(r315947)
@@ -846,7 +846,7 @@ cpp_demangle_push_type_qualifier(struct 
free(buf);
++e_idx;
break;
-   };
+   }
--idx;
}
 
@@ -1007,7 +1007,7 @@ cpp_demangle_read_expr_primary(struct cp
return (cpp_demangle_push_str(ddata, "true", 4));
default:
return (0);
-   };
+   }
 
case 'd':
++ddata->cur;
@@ -1057,7 +1057,7 @@ cpp_demangle_read_expr_primary(struct cp
 
default:
return (0);
-   };
+   }
 }
 
 static int
@@ -1332,14 +1332,14 @@ cpp_demangle_read_expression(struct cpp_
/* operator sizeof */
ddata->cur += 2;
return (cpp_demangle_read_expression_unary(ddata, "sizeof", 6));
-   };
+   }
 
switch (*ddata->cur) {
case 'L':
return (cpp_demangle_read_expr_primary(ddata));
case 'T':
return (cpp_demangle_read_tmpl_param(ddata));
-   };
+   }
 
return (0);
 }
@@ -1555,11 +1555,13 @@ cpp_demangle_read_encoding(struct cpp_de
if (!cpp_demangle_push_str(ddata,
"non-transaction clone for ", 26))
return (0);
+   break;
case 't':
default:
if (!cpp_demangle_push_str(ddata,
"transaction clone for ", 22))
return (0);
+   break;
}
++ddata->cur;
return (cpp_demangle_read_encoding(ddata));
@@ -1712,7 +1714,7 @@ cpp_demangle_read_encoding(struct cpp_de
if (*ddata->cur == '\0')
return (0);
break;
-   };
+   }
 
return (cpp_demangle_read_name(ddata));
 }
@@ -1784,7 +1786,7 @@ cpp_demangle_read_name(struct cpp_demang
return (cpp_demangle_read_nested_name(ddata));
case 'Z':
return (cpp_demangle_read_local_name(ddata));
-   };
+   }
 
if (!vector_str_init(&v))
return (0);
@@ -1885,7 +1887,7 @@ cpp_demangle_read_nested_name(struct cpp
case 'K':
ddata->mem_cst = true;
break;
-   };
+   }
++ddata->cur;
}
 
@@ -1913,7 +1915,7 @@ cpp_demangle_read_nested_name(struct cpp
default:
if (!cpp_demangle_read_uqname(ddata))
goto clean;
-   };
+   }
 
if ((subst_str = vector_str_substr(output, p_idx,
output->size - 1, &subst_str_len)) == NULL)
@@ -2188,35 +2190,35 @@ cpp_demangle_read_subst(struct cpp_deman
 
case SIMPLE_HASH('S', 'd'):
/* std::basic_iostream > */
-   if (!cpp_demangle_push_str(ddata, "std::iostream", 19))
+   if (!cpp_demangle_push_str(ddata, "std::basic_iostream", 19))
return (0);
-   ddata->last_sname = "iostream";
+   ddata->last_sname = "basic_iostream";
ddata->cur += 2;
if (*ddata->cur == 'I')
return (cpp_demangle_read_subst_stdtmpl(ddata,
-   "std::iostream", 19));
+   "std::basic_iostream", 19));
return (1);
 
case SIMPLE_HASH('S', 'i'):
/* std::basic_istream > */
-   if (!cpp_demangle_push_str(ddata, "std::istream", 18))
+   if (!cpp_demangle_push_str(ddata, "std::basic_istream", 18))
return (0);
-   ddata->last_sname = "istream";
+   ddata->last_sname = "basic_istream";
ddata->cur += 2;
if (*ddata->cur == 'I')
return (cpp_demangle_read_subst_stdtmpl(ddata,
-   "std::is

svn commit: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ger...

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 13:32:28 2017
New Revision: 315948
URL: https://svnweb.freebsd.org/changeset/base/315948

Log:
  Update to tcsh 6.20.00

Added:
  head/contrib/tcsh/dotlock.c
 - copied unchanged from r315512, vendor/tcsh/dist/dotlock.c
  head/contrib/tcsh/dotlock.h
 - copied unchanged from r315512, vendor/tcsh/dist/dotlock.h
  head/contrib/tcsh/tcsh.man.new
 - copied unchanged from r315512, vendor/tcsh/dist/tcsh.man.new
Deleted:
  head/contrib/tcsh/configure.in
Modified:
  head/bin/csh/Makefile
  head/contrib/tcsh/Fixes   (contents, props changed)
  head/contrib/tcsh/Imakefile   (contents, props changed)
  head/contrib/tcsh/Makefile.in   (contents, props changed)
  head/contrib/tcsh/Makefile.std   (contents, props changed)
  head/contrib/tcsh/Makefile.vms   (contents, props changed)
  head/contrib/tcsh/README   (contents, props changed)
  head/contrib/tcsh/complete.tcsh   (contents, props changed)
  head/contrib/tcsh/config.guess   (contents, props changed)
  head/contrib/tcsh/config.h.in   (contents, props changed)
  head/contrib/tcsh/config.sub   (contents, props changed)
  head/contrib/tcsh/config/bsd4.4   (contents, props changed)
  head/contrib/tcsh/config_f.h   (contents, props changed)
  head/contrib/tcsh/configure   (contents, props changed)
  head/contrib/tcsh/ed.chared.c   (contents, props changed)
  head/contrib/tcsh/ed.decls.h   (contents, props changed)
  head/contrib/tcsh/ed.defns.c   (contents, props changed)
  head/contrib/tcsh/ed.inputl.c   (contents, props changed)
  head/contrib/tcsh/ed.refresh.c   (contents, props changed)
  head/contrib/tcsh/ed.screen.c   (contents, props changed)
  head/contrib/tcsh/ed.term.h   (contents, props changed)
  head/contrib/tcsh/ed.xmap.c   (contents, props changed)
  head/contrib/tcsh/gethost.c   (contents, props changed)
  head/contrib/tcsh/glob.c   (contents, props changed)
  head/contrib/tcsh/host.defs   (contents, props changed)
  head/contrib/tcsh/nls/C/set1   (contents, props changed)
  head/contrib/tcsh/nls/C/set20   (contents, props changed)
  head/contrib/tcsh/nls/C/set9   (contents, props changed)
  head/contrib/tcsh/nls/Makefile.in
  head/contrib/tcsh/nls/catgen
  head/contrib/tcsh/nls/et/set1   (contents, props changed)
  head/contrib/tcsh/nls/et/set20   (contents, props changed)
  head/contrib/tcsh/nls/et/set9   (contents, props changed)
  head/contrib/tcsh/nls/finnish/set1   (contents, props changed)
  head/contrib/tcsh/nls/finnish/set20   (contents, props changed)
  head/contrib/tcsh/nls/finnish/set3   (contents, props changed)
  head/contrib/tcsh/nls/finnish/set9   (contents, props changed)
  head/contrib/tcsh/nls/french/set1   (contents, props changed)
  head/contrib/tcsh/nls/french/set20   (contents, props changed)
  head/contrib/tcsh/nls/french/set9   (contents, props changed)
  head/contrib/tcsh/nls/german/set1   (contents, props changed)
  head/contrib/tcsh/nls/german/set20   (contents, props changed)
  head/contrib/tcsh/nls/german/set9   (contents, props changed)
  head/contrib/tcsh/nls/greek/set1   (contents, props changed)
  head/contrib/tcsh/nls/greek/set20   (contents, props changed)
  head/contrib/tcsh/nls/greek/set9   (contents, props changed)
  head/contrib/tcsh/nls/italian/set1   (contents, props changed)
  head/contrib/tcsh/nls/italian/set20   (contents, props changed)
  head/contrib/tcsh/nls/italian/set9   (contents, props changed)
  head/contrib/tcsh/nls/ja/set1   (contents, props changed)
  head/contrib/tcsh/nls/russian/set1   (contents, props changed)
  head/contrib/tcsh/nls/russian/set20   (contents, props changed)
  head/contrib/tcsh/nls/russian/set9   (contents, props changed)
  head/contrib/tcsh/nls/spanish/set1   (contents, props changed)
  head/contrib/tcsh/nls/spanish/set20   (contents, props changed)
  head/contrib/tcsh/nls/spanish/set9   (contents, props changed)
  head/contrib/tcsh/nls/ukrainian/set1   (contents, props changed)
  head/contrib/tcsh/nls/ukrainian/set20   (contents, props changed)
  head/contrib/tcsh/nls/ukrainian/set9   (contents, props changed)
  head/contrib/tcsh/patchlevel.h   (contents, props changed)
  head/contrib/tcsh/sh.c   (contents, props changed)
  head/contrib/tcsh/sh.char.h   (contents, props changed)
  head/contrib/tcsh/sh.decls.h   (contents, props changed)
  head/contrib/tcsh/sh.dir.c   (contents, props changed)
  head/contrib/tcsh/sh.dol.c   (contents, props changed)
  head/contrib/tcsh/sh.err.c   (contents, props changed)
  head/contrib/tcsh/sh.exec.c   (contents, props changed)
  head/contrib/tcsh/sh.exp.c   (contents, props changed)
  head/contrib/tcsh/sh.file.c   (contents, props changed)
  head/contrib/tcsh/sh.func.c   (contents, props changed)
  head/contrib/tcsh/sh.glob.c   (contents, props changed)
  head/contrib/tcsh/sh.h   (contents, props changed)
  head/contrib/tcsh/sh.hist.c   (contents, props changed)
  head/contrib/tcsh/sh.init.c   (contents, props changed)
  head/contrib/tcsh/sh.lex.c   (contents, props changed)
  head/contrib/tcsh/sh.mi

svn commit: r315949 - in stable: 10/sys/kern 10/sys/sys 10/tests/sys/kern 11/sys/kern 11/sys/sys 11/tests/sys/kern

2017-03-25 Thread Eric Badger
Author: badger
Date: Sat Mar 25 13:33:23 2017
New Revision: 315949
URL: https://svnweb.freebsd.org/changeset/base/315949

Log:
  MFC r313992, r314075, r314118, r315484:
  
  r315484:
  ptrace_test: eliminate assumption about thread scheduling
  
  A couple of the ptrace tests make assumptions about which thread in a
  multithreaded process will run after a halt. This makes the tests less
  portable across branches, and susceptible to future breakage. Instead,
  twiddle thread scheduling and priorities to match the tests'
  expectation.
  
  r314118:
  Actually fix buildworlds other than i386/amd64/sparc64 after r313992
  
  Disable offending test for platforms without a userspace visible
  breakpoint().
  
  r314075:
  Fix world build for archs where __builtin_debugtrap() does not work.
  
  The offending code was introduced in r313992.
  
  r313992:
  Defer ptracestop() signals that cannot be delivered immediately
  
  When a thread is stopped in ptracestop(), the ptrace(2) user may request
  a signal be delivered upon resumption of the thread. Heretofore, those 
signals
  were discarded unless ptracestop()'s caller was issignal(). Fix this by
  modifying ptracestop() to queue up signals requested by the ptrace user 
that
  will be delivered when possible. Take special care when the signal is 
SIGKILL
  (usually generated from a PT_KILL request); no new stop events should be
  triggered after a PT_KILL.
  
  Add a number of tests for the new functionality. Several tests were 
authored
  by jhb.
  
  PR:   212607
  Sponsored by: Dell EMC

Modified:
  stable/11/sys/kern/kern_fork.c
  stable/11/sys/kern/kern_sig.c
  stable/11/sys/kern/kern_thr.c
  stable/11/sys/kern/subr_syscall.c
  stable/11/sys/kern/sys_process.c
  stable/11/sys/sys/signalvar.h
  stable/11/tests/sys/kern/Makefile
  stable/11/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/kern/kern_fork.c
  stable/10/sys/kern/kern_sig.c
  stable/10/sys/kern/kern_thr.c
  stable/10/sys/kern/subr_syscall.c
  stable/10/sys/kern/sys_process.c
  stable/10/sys/sys/signalvar.h
  stable/10/tests/sys/kern/Makefile
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/kern/kern_fork.c
==
--- stable/11/sys/kern/kern_fork.c  Sat Mar 25 13:32:28 2017
(r315948)
+++ stable/11/sys/kern/kern_fork.c  Sat Mar 25 13:33:23 2017
(r315949)
@@ -1083,7 +1083,7 @@ fork_return(struct thread *td, struct tr
proc_reparent(p, dbg);
sx_xunlock(&proctree_lock);
td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP;
-   ptracestop(td, SIGSTOP);
+   ptracestop(td, SIGSTOP, NULL);
td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX);
} else {
/*
@@ -1104,7 +1104,7 @@ fork_return(struct thread *td, struct tr
_STOPEVENT(p, S_SCX, td->td_dbg_sc_code);
if ((p->p_ptevents & PTRACE_SCX) != 0 ||
(td->td_dbgflags & TDB_BORN) != 0)
-   ptracestop(td, SIGTRAP);
+   ptracestop(td, SIGTRAP, NULL);
td->td_dbgflags &= ~(TDB_SCX | TDB_BORN);
PROC_UNLOCK(p);
}

Modified: stable/11/sys/kern/kern_sig.c
==
--- stable/11/sys/kern/kern_sig.c   Sat Mar 25 13:32:28 2017
(r315948)
+++ stable/11/sys/kern/kern_sig.c   Sat Mar 25 13:33:23 2017
(r315949)
@@ -278,6 +278,7 @@ sigqueue_init(sigqueue_t *list, struct p
 {
SIGEMPTYSET(list->sq_signals);
SIGEMPTYSET(list->sq_kill);
+   SIGEMPTYSET(list->sq_ptrace);
TAILQ_INIT(&list->sq_list);
list->sq_proc = p;
list->sq_flags = SQ_INIT;
@@ -301,9 +302,15 @@ sigqueue_get(sigqueue_t *sq, int signo, 
if (!SIGISMEMBER(sq->sq_signals, signo))
return (0);
 
+   if (SIGISMEMBER(sq->sq_ptrace, signo)) {
+   count++;
+   SIGDELSET(sq->sq_ptrace, signo);
+   si->ksi_flags |= KSI_PTRACE;
+   }
if (SIGISMEMBER(sq->sq_kill, signo)) {
count++;
-   SIGDELSET(sq->sq_kill, signo);
+   if (count == 1)
+   SIGDELSET(sq->sq_kill, signo);
}
 
TAILQ_FOREACH_SAFE(ksi, &sq->sq_list, ksi_link, next) {
@@ -347,7 +354,8 @@ sigqueue_take(ksiginfo_t *ksi)
if (kp->ksi_signo == ksi->ksi_signo)
break;
}
-   if (kp == NULL && !SIGISMEMBER(sq->sq_kill, ksi->ksi_signo))
+   if (kp == NULL && !SIGISMEMBER(sq->sq_kill, ksi-

svn commit: r315949 - in stable: 10/sys/kern 10/sys/sys 10/tests/sys/kern 11/sys/kern 11/sys/sys 11/tests/sys/kern

2017-03-25 Thread Eric Badger
Author: badger
Date: Sat Mar 25 13:33:23 2017
New Revision: 315949
URL: https://svnweb.freebsd.org/changeset/base/315949

Log:
  MFC r313992, r314075, r314118, r315484:
  
  r315484:
  ptrace_test: eliminate assumption about thread scheduling
  
  A couple of the ptrace tests make assumptions about which thread in a
  multithreaded process will run after a halt. This makes the tests less
  portable across branches, and susceptible to future breakage. Instead,
  twiddle thread scheduling and priorities to match the tests'
  expectation.
  
  r314118:
  Actually fix buildworlds other than i386/amd64/sparc64 after r313992
  
  Disable offending test for platforms without a userspace visible
  breakpoint().
  
  r314075:
  Fix world build for archs where __builtin_debugtrap() does not work.
  
  The offending code was introduced in r313992.
  
  r313992:
  Defer ptracestop() signals that cannot be delivered immediately
  
  When a thread is stopped in ptracestop(), the ptrace(2) user may request
  a signal be delivered upon resumption of the thread. Heretofore, those 
signals
  were discarded unless ptracestop()'s caller was issignal(). Fix this by
  modifying ptracestop() to queue up signals requested by the ptrace user 
that
  will be delivered when possible. Take special care when the signal is 
SIGKILL
  (usually generated from a PT_KILL request); no new stop events should be
  triggered after a PT_KILL.
  
  Add a number of tests for the new functionality. Several tests were 
authored
  by jhb.
  
  PR:   212607
  Sponsored by: Dell EMC

Modified:
  stable/10/sys/kern/kern_fork.c
  stable/10/sys/kern/kern_sig.c
  stable/10/sys/kern/kern_thr.c
  stable/10/sys/kern/subr_syscall.c
  stable/10/sys/kern/sys_process.c
  stable/10/sys/sys/signalvar.h
  stable/10/tests/sys/kern/Makefile
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/kern/kern_fork.c
  stable/11/sys/kern/kern_sig.c
  stable/11/sys/kern/kern_thr.c
  stable/11/sys/kern/subr_syscall.c
  stable/11/sys/kern/sys_process.c
  stable/11/sys/sys/signalvar.h
  stable/11/tests/sys/kern/Makefile
  stable/11/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/kern/kern_fork.c
==
--- stable/10/sys/kern/kern_fork.c  Sat Mar 25 13:32:28 2017
(r315948)
+++ stable/10/sys/kern/kern_fork.c  Sat Mar 25 13:33:23 2017
(r315949)
@@ -1072,7 +1072,7 @@ fork_return(struct thread *td, struct tr
proc_reparent(p, dbg);
sx_xunlock(&proctree_lock);
td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP;
-   ptracestop(td, SIGSTOP);
+   ptracestop(td, SIGSTOP, NULL);
td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX);
} else {
/*
@@ -1093,7 +1093,7 @@ fork_return(struct thread *td, struct tr
_STOPEVENT(p, S_SCX, td->td_dbg_sc_code);
if ((p->p_ptevents & PTRACE_SCX) != 0 ||
(td->td_dbgflags & TDB_BORN) != 0)
-   ptracestop(td, SIGTRAP);
+   ptracestop(td, SIGTRAP, NULL);
td->td_dbgflags &= ~(TDB_SCX | TDB_BORN);
PROC_UNLOCK(p);
}

Modified: stable/10/sys/kern/kern_sig.c
==
--- stable/10/sys/kern/kern_sig.c   Sat Mar 25 13:32:28 2017
(r315948)
+++ stable/10/sys/kern/kern_sig.c   Sat Mar 25 13:33:23 2017
(r315949)
@@ -277,6 +277,7 @@ sigqueue_init(sigqueue_t *list, struct p
 {
SIGEMPTYSET(list->sq_signals);
SIGEMPTYSET(list->sq_kill);
+   SIGEMPTYSET(list->sq_ptrace);
TAILQ_INIT(&list->sq_list);
list->sq_proc = p;
list->sq_flags = SQ_INIT;
@@ -300,9 +301,15 @@ sigqueue_get(sigqueue_t *sq, int signo, 
if (!SIGISMEMBER(sq->sq_signals, signo))
return (0);
 
+   if (SIGISMEMBER(sq->sq_ptrace, signo)) {
+   count++;
+   SIGDELSET(sq->sq_ptrace, signo);
+   si->ksi_flags |= KSI_PTRACE;
+   }
if (SIGISMEMBER(sq->sq_kill, signo)) {
count++;
-   SIGDELSET(sq->sq_kill, signo);
+   if (count == 1)
+   SIGDELSET(sq->sq_kill, signo);
}
 
TAILQ_FOREACH_SAFE(ksi, &sq->sq_list, ksi_link, next) {
@@ -346,7 +353,8 @@ sigqueue_take(ksiginfo_t *ksi)
if (kp->ksi_signo == ksi->ksi_signo)
break;
}
-   if (kp == NULL && !SIGISMEMBER(sq->sq_kill, ksi->ksi_signo))
+   if (kp == NULL && !SIGISMEMBER(sq->sq_kill, ksi-

svn commit: r315950 - vendor/tcsh/dist

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 14:09:12 2017
New Revision: 315950
URL: https://svnweb.freebsd.org/changeset/base/315950

Log:
  Update vendor/tcsh to git b605cb561d
  
  Vendor changes:
  
  1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
  our startup files (which can change the NLS environment).
  
  2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).
  
  3. Fix out of bounds read (Brooks Davis)
  (reproduce by starting tcsh and hitting tab at the prompt).
  
  4. Don't play pointer tricks that are undefined in modern c
  (Brooks Davis).

Modified:
  vendor/tcsh/dist/Fixes
  vendor/tcsh/dist/ed.chared.c
  vendor/tcsh/dist/sh.c
  vendor/tcsh/dist/sh.func.c
  vendor/tcsh/dist/tw.init.c

Modified: vendor/tcsh/dist/Fixes
==
--- vendor/tcsh/dist/Fixes  Sat Mar 25 13:33:23 2017(r315949)
+++ vendor/tcsh/dist/Fixes  Sat Mar 25 14:09:12 2017(r315950)
@@ -1,3 +1,4 @@
+ 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar)
  20. V6.20.00 - 20161124
  19. Don't resize the screen if it did not change size.
  18. V6.19.01 - 20161025

Modified: vendor/tcsh/dist/ed.chared.c
==
--- vendor/tcsh/dist/ed.chared.cSat Mar 25 13:33:23 2017
(r315949)
+++ vendor/tcsh/dist/ed.chared.cSat Mar 25 14:09:12 2017
(r315950)
@@ -750,7 +750,7 @@ c_substitute(void)
 /*
  * If we found a history character, go expand it.
  */
-if (HIST != '\0' && *p == HIST)
+if (p >= InputBuf && HIST != '\0' && *p == HIST)
nr_exp = c_excl(p);
 else
 nr_exp = 0;

Modified: vendor/tcsh/dist/sh.c
==
--- vendor/tcsh/dist/sh.c   Sat Mar 25 13:33:23 2017(r315949)
+++ vendor/tcsh/dist/sh.c   Sat Mar 25 14:09:12 2017(r315950)
@@ -248,6 +248,7 @@ main(int argc, char **argv)
 char *tcp, *ttyn;
 int f, reenter;
 char **tempv;
+const char *targinp = NULL;
 int osetintr;
 struct sigaction oparintr;
 
@@ -937,30 +938,7 @@ main(int argc, char **argv)
  *p &= ASCII;
  }
 #endif
-   arginp = SAVE(tempv[0]);
-
-   /*
-* we put the command into a variable
-*/
-   if (arginp != NULL)
-   setv(STRcommand, quote(Strsave(arginp)), VAR_READWRITE);
-
-   /*
-* * Give an error on -c arguments that end in * backslash to
-* ensure that you don't make * nonportable csh scripts.
-*/
-   {
-   int count;
-
-   cp = Strend(arginp);
-   count = 0;
-   while (cp > arginp && *--cp == '\\')
-   ++count;
-   if ((count & 1) != 0) {
-   exiterr = 1;
-   stderror(ERR_ARGC);
-   }
-   }
+   targinp = tempv[0];
prompt = 0;
nofile = 1;
break;
@@ -1205,7 +1183,7 @@ main(int argc, char **argv)
sigset_interrupting(SIGXFSZ, queue_phup);
 #endif
 
-   if (quitit == 0 && arginp == 0) {
+   if (quitit == 0 && targinp == 0) {
 #ifdef SIGTSTP
(void) signal(SIGTSTP, SIG_IGN);
 #endif
@@ -1323,7 +1301,7 @@ main(int argc, char **argv)
  */
 sigset_interrupting(SIGCHLD, queue_pchild);
 
-if (intty && !arginp)  
+if (intty && !targinp) 
(void) ed_Setup(editing);/* Get the tty state, and set defaults */
 /* Only alter the tty state if editing */
 
@@ -1358,7 +1336,7 @@ main(int argc, char **argv)
 #ifdef _PATH_DOTCSHRC
(void) srcfile(_PATH_DOTCSHRC, 0, 0, NULL);
 #endif
-   if (!arginp && !onelflg && !havhash)
+   if (!targinp && !onelflg && !havhash)
dohash(NULL,NULL);
 #ifndef LOGINFIRST
 #ifdef _PATH_DOTLOGIN
@@ -1378,7 +1356,7 @@ main(int argc, char **argv)
if (!srccat(varval(STRhome), STRsldottcshrc))
(void) srccat(varval(STRhome), STRsldotcshrc);
 
-   if (!arginp && !onelflg && !havhash)
+   if (!targinp && !onelflg && !havhash)
dohash(NULL,NULL);
 
/*
@@ -1398,7 +1376,7 @@ main(int argc, char **argv)
 exitset--;
 
 /* Initing AFTER .cshrc is the Right Way */
-if (intty && !arginp) {/* PWP setup stuff */
+if (intty && !targinp) {   /* PWP setup stuff */
ed_Init();  /* init the new line editor */
 #ifdef SIG_WINDOW
check_window_size(1);   /* mung environment */
@@ -1413,6 +1391,32 @@ main(int argc, char **argv)
 if (nexececho)
setNS(STRecho);
 
+
+if (targinp) {
+   arginp = SAVE(targinp);
+   /*
+* 

svn commit: r315951 - svnadmin/conf

2017-03-25 Thread George V. Neville-Neil
Author: gnn
Date: Sat Mar 25 14:12:12 2017
New Revision: 315951
URL: https://svnweb.freebsd.org/changeset/base/315951

Log:
  Free Mike Karels from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Sat Mar 25 14:09:12 2017(r315950)
+++ svnadmin/conf/mentors   Sat Mar 25 14:12:12 2017(r315951)
@@ -20,7 +20,6 @@ jceel trasz
 jkhrwatson
 jwdrmacklem
 kadesaiken Co-mentor: scottl, ambrisko
-karels gnn
 mahrensmckusick
 peterj jhb Co-mentor: grog
 phil   theravenCo-mentor: sjg
___
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: r315952 - head/contrib/tcsh

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 14:14:11 2017
New Revision: 315952
URL: https://svnweb.freebsd.org/changeset/base/315952

Log:
  MFV r315950:
  
  Update vendor/tcsh to git b605cb561d
  
  Vendor changes:
  
  1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
  our startup files (which can change the NLS environment).
  
  2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).
  
  3. Fix out of bounds read (Brooks Davis)
  (reproduce by starting tcsh and hitting tab at the prompt).
  
  4. Don't play pointer tricks that are undefined in modern c
  (Brooks Davis).

Modified:
  head/contrib/tcsh/Fixes
  head/contrib/tcsh/ed.chared.c
  head/contrib/tcsh/sh.c
  head/contrib/tcsh/sh.func.c
  head/contrib/tcsh/tw.init.c
Directory Properties:
  head/contrib/tcsh/   (props changed)

Modified: head/contrib/tcsh/Fixes
==
--- head/contrib/tcsh/Fixes Sat Mar 25 14:12:12 2017(r315951)
+++ head/contrib/tcsh/Fixes Sat Mar 25 14:14:11 2017(r315952)
@@ -1,3 +1,4 @@
+ 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar)
  20. V6.20.00 - 20161124
  19. Don't resize the screen if it did not change size.
  18. V6.19.01 - 20161025

Modified: head/contrib/tcsh/ed.chared.c
==
--- head/contrib/tcsh/ed.chared.c   Sat Mar 25 14:12:12 2017
(r315951)
+++ head/contrib/tcsh/ed.chared.c   Sat Mar 25 14:14:11 2017
(r315952)
@@ -750,7 +750,7 @@ c_substitute(void)
 /*
  * If we found a history character, go expand it.
  */
-if (HIST != '\0' && *p == HIST)
+if (p >= InputBuf && HIST != '\0' && *p == HIST)
nr_exp = c_excl(p);
 else
 nr_exp = 0;

Modified: head/contrib/tcsh/sh.c
==
--- head/contrib/tcsh/sh.c  Sat Mar 25 14:12:12 2017(r315951)
+++ head/contrib/tcsh/sh.c  Sat Mar 25 14:14:11 2017(r315952)
@@ -248,6 +248,7 @@ main(int argc, char **argv)
 char *tcp, *ttyn;
 int f, reenter;
 char **tempv;
+const char *targinp = NULL;
 int osetintr;
 struct sigaction oparintr;
 
@@ -937,30 +938,7 @@ main(int argc, char **argv)
  *p &= ASCII;
  }
 #endif
-   arginp = SAVE(tempv[0]);
-
-   /*
-* we put the command into a variable
-*/
-   if (arginp != NULL)
-   setv(STRcommand, quote(Strsave(arginp)), VAR_READWRITE);
-
-   /*
-* * Give an error on -c arguments that end in * backslash to
-* ensure that you don't make * nonportable csh scripts.
-*/
-   {
-   int count;
-
-   cp = Strend(arginp);
-   count = 0;
-   while (cp > arginp && *--cp == '\\')
-   ++count;
-   if ((count & 1) != 0) {
-   exiterr = 1;
-   stderror(ERR_ARGC);
-   }
-   }
+   targinp = tempv[0];
prompt = 0;
nofile = 1;
break;
@@ -1205,7 +1183,7 @@ main(int argc, char **argv)
sigset_interrupting(SIGXFSZ, queue_phup);
 #endif
 
-   if (quitit == 0 && arginp == 0) {
+   if (quitit == 0 && targinp == 0) {
 #ifdef SIGTSTP
(void) signal(SIGTSTP, SIG_IGN);
 #endif
@@ -1323,7 +1301,7 @@ main(int argc, char **argv)
  */
 sigset_interrupting(SIGCHLD, queue_pchild);
 
-if (intty && !arginp)  
+if (intty && !targinp) 
(void) ed_Setup(editing);/* Get the tty state, and set defaults */
 /* Only alter the tty state if editing */
 
@@ -1358,7 +1336,7 @@ main(int argc, char **argv)
 #ifdef _PATH_DOTCSHRC
(void) srcfile(_PATH_DOTCSHRC, 0, 0, NULL);
 #endif
-   if (!arginp && !onelflg && !havhash)
+   if (!targinp && !onelflg && !havhash)
dohash(NULL,NULL);
 #ifndef LOGINFIRST
 #ifdef _PATH_DOTLOGIN
@@ -1378,7 +1356,7 @@ main(int argc, char **argv)
if (!srccat(varval(STRhome), STRsldottcshrc))
(void) srccat(varval(STRhome), STRsldotcshrc);
 
-   if (!arginp && !onelflg && !havhash)
+   if (!targinp && !onelflg && !havhash)
dohash(NULL,NULL);
 
/*
@@ -1398,7 +1376,7 @@ main(int argc, char **argv)
 exitset--;
 
 /* Initing AFTER .cshrc is the Right Way */
-if (intty && !arginp) {/* PWP setup stuff */
+if (intty && !targinp) {   /* PWP setup stuff */
ed_Init();  /* init the new line editor */
 #ifdef SIG_WINDOW
check_window_size(1);   /* mung environment */
@@ -1413,6 +1391,32 @@ main(int argc, char **argv)
 if (nexececho)
setNS(STRec

svn commit: r315953 - stable/11/sys/compat/linux

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 14:25:20 2017
New Revision: 315953
URL: https://svnweb.freebsd.org/changeset/base/315953

Log:
  MFC r315278:
  
  Fix usage of the same 'i' variable in the external and nested loops.

Modified:
  stable/11/sys/compat/linux/linux_vdso.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_vdso.c
==
--- stable/11/sys/compat/linux/linux_vdso.c Sat Mar 25 14:14:11 2017
(r315952)
+++ stable/11/sys/compat/linux/linux_vdso.c Sat Mar 25 14:25:20 2017
(r315953)
@@ -147,7 +147,7 @@ __elfN(linux_vdso_reloc)(struct sysentve
Elf_Shdr *shdr;
Elf_Dyn *dyn;
Elf_Sym *sym;
-   int i, symcnt;
+   int i, j, symcnt;
 
ehdr = (Elf_Ehdr *) sv->sv_sigcode;
 
@@ -205,7 +205,7 @@ __elfN(linux_vdso_reloc)(struct sysentve
sym = (Elf_Sym *)((caddr_t)ehdr + shdr[i].sh_offset);
symcnt = shdr[i].sh_size / sizeof(*sym);
 
-   for(i = 0; i < symcnt; i++, sym++) {
+   for(j = 0; j < symcnt; j++, sym++) {
if (sym->st_shndx == SHN_UNDEF ||
sym->st_shndx == SHN_ABS)
continue;
___
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: r315954 - stable/11/sys/compat/linux

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 14:26:45 2017
New Revision: 315954
URL: https://svnweb.freebsd.org/changeset/base/315954

Log:
  MFC r315503:
  
  As noted by Roel Bouwman Linux allows a large buffer size than the
  struct ucred size. Fix this.
  
  PR:   102956

Modified:
  stable/11/sys/compat/linux/linux_socket.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_socket.c
==
--- stable/11/sys/compat/linux/linux_socket.c   Sat Mar 25 14:25:20 2017
(r315953)
+++ stable/11/sys/compat/linux/linux_socket.c   Sat Mar 25 14:26:45 2017
(r315954)
@@ -1621,7 +1621,7 @@ linux_getsockopt(struct thread *td, stru
/* NOTREACHED */
break;
case LOCAL_PEERCRED:
-   if (args->optlen != sizeof(lxu))
+   if (args->optlen < sizeof(lxu))
return (EINVAL);
xulen = sizeof(xu);
error = kern_getsockopt(td, args->s, bsd_args.level,
___
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: r315955 - stable/11/sys/compat/linux

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 14:28:20 2017
New Revision: 315955
URL: https://svnweb.freebsd.org/changeset/base/315955

Log:
  MFC r315499:
  
  Remove superflous break statment.

Modified:
  stable/11/sys/compat/linux/linux_socket.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_socket.c
==
--- stable/11/sys/compat/linux/linux_socket.c   Sat Mar 25 14:26:45 2017
(r315954)
+++ stable/11/sys/compat/linux/linux_socket.c   Sat Mar 25 14:28:20 2017
(r315955)
@@ -1547,7 +1547,6 @@ linux_setsockopt(struct thread *td, stru
return (kern_setsockopt(td, args->s, bsd_args.level,
name, &tv, UIO_SYSSPACE, sizeof(tv)));
/* NOTREACHED */
-   break;
default:
break;
}
@@ -1619,7 +1618,6 @@ linux_getsockopt(struct thread *td, stru
return (copyout(&linux_tv, PTRIN(args->optval),
sizeof(linux_tv)));
/* NOTREACHED */
-   break;
case LOCAL_PEERCRED:
if (args->optlen < sizeof(lxu))
return (EINVAL);
@@ -1636,7 +1634,6 @@ linux_getsockopt(struct thread *td, stru
lxu.gid = xu.cr_gid;
return (copyout(&lxu, PTRIN(args->optval), 
sizeof(lxu)));
/* NOTREACHED */
-   break;
case SO_ERROR:
len = sizeof(newval);
error = kern_getsockopt(td, args->s, bsd_args.level,
___
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: r315956 - in head/sys: netinet netinet6

2017-03-25 Thread Mike Karels
Author: karels
Date: Sat Mar 25 15:06:28 2017
New Revision: 315956
URL: https://svnweb.freebsd.org/changeset/base/315956

Log:
  Fix reference count leak with L2 caching.
  
  ip_forward, TCP/IPv6, and probably SCTP leaked references to L2 cache
  entry because they used their own routes on the stack, not in_pcb routes.
  The original model for route caching was callers that provided a route
  structure to ip{,6}input() would keep the route, and this model was used
  for L2 caching as well. Instead, change L2 caching to be done by default
  only when using a route structure in the in_pcb; the pcb deallocation
  code frees L2 as well as L3 cacches. A separate change will add route
  caching to TCP/IPv6.
  
  Another suggestion was to have the transport protocols indicate willingness
  to use L2 caching, but this approach keeps the changes in the network
  level
  
  Reviewed by:ae gnn
  MFC after:  2 weeks
  Differential Revision:  https://reviews.freebsd.org/D10059
  and those below, will be ignored--
  > Description of fields to fill in above: 76 columns --|
  > PR:   If and which Problem Report is related.
  > Submitted by: If someone else sent in the change.
  > Reported by:  If someone else reported the issue.
  > Reviewed by:  If someone else reviewed your modification.
  > Approved by:  If you needed approval for this commit.
  > Obtained from:If the change is from a third party.
  > MFC after:N [day[s]|week[s]|month[s]].  Request a reminder 
email.
  > MFH:  Ports tree branch name.  Request approval for 
merge.
  > Relnotes: Set to 'yes' for mention in release notes.
  > Security: Vulnerability reference (one per line) or 
description.
  > Sponsored by: If the change was sponsored by an organization.
  > Differential Revision:https://reviews.freebsd.org/D### (*full* phabric 
URL needed).
  > Empty fields above will be automatically removed.
  
  Mnetinet/in_pcb.c
  Mnetinet/ip_output.c
  Mnetinet6/ip6_output.c

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Sat Mar 25 14:28:20 2017(r315955)
+++ head/sys/netinet/in_pcb.c   Sat Mar 25 15:06:28 2017(r315956)
@@ -328,6 +328,12 @@ in_pcballoc(struct socket *so, struct in
 #endif
inp->inp_gencnt = ++pcbinfo->ipi_gencnt;
refcount_init(&inp->inp_refcount, 1);   /* Reference from inpcbinfo */
+
+   /*
+* Routes in inpcb's can cache L2 as well; they are guaranteed
+* to be cleaned up.
+*/
+   inp->inp_route.ro_flags = RT_LLE_CACHE;
INP_LIST_WUNLOCK(pcbinfo);
 #if defined(IPSEC) || defined(IPSEC_SUPPORT) || defined(MAC)
 out:

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cSat Mar 25 14:28:20 2017
(r315955)
+++ head/sys/netinet/ip_output.cSat Mar 25 15:06:28 2017
(r315956)
@@ -242,8 +242,7 @@ ip_output(struct mbuf *m, struct mbuf *o
if (ro == NULL) {
ro = &iproute;
bzero(ro, sizeof (*ro));
-   } else
-   ro->ro_flags |= RT_LLE_CACHE;
+   }
 
 #ifdef FLOWTABLE
if (ro->ro_rt == NULL)

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Sat Mar 25 14:28:20 2017
(r315955)
+++ head/sys/netinet6/ip6_output.c  Sat Mar 25 15:06:28 2017
(r315956)
@@ -494,8 +494,7 @@ ip6_output(struct mbuf *m0, struct ip6_p
if (ro == NULL) {
ro = &ip6route;
bzero((caddr_t)ro, sizeof(*ro));
-   } else
-   ro->ro_flags |= RT_LLE_CACHE;
+   }
ro_pmtu = ro;
if (opt && opt->ip6po_rthdr)
ro = &opt->ip6po_route;
___
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: r315957 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux

2017-03-25 Thread Dmitry Chagin
Author: dchagin
Date: Sat Mar 25 15:47:29 2017
New Revision: 315957
URL: https://svnweb.freebsd.org/changeset/base/315957

Log:
  Implement Linux mincore() system call.
  This is necessary for the upcoming drm-next.
  
  Suggested by: hselasky@
  MFC after:1 month

Modified:
  head/sys/amd64/linux/linux_dummy.c
  head/sys/amd64/linux32/linux32_dummy.c
  head/sys/compat/linux/linux_misc.c
  head/sys/i386/linux/linux_dummy.c

Modified: head/sys/amd64/linux/linux_dummy.c
==
--- head/sys/amd64/linux/linux_dummy.c  Sat Mar 25 15:06:28 2017
(r315956)
+++ head/sys/amd64/linux/linux_dummy.c  Sat Mar 25 15:47:29 2017
(r315957)
@@ -59,7 +59,6 @@ UNIMPLEMENTED(tuxcall);
 UNIMPLEMENTED(uselib);
 UNIMPLEMENTED(vserver);
 
-DUMMY(mincore);
 DUMMY(sendfile);
 DUMMY(syslog);
 DUMMY(setfsuid);

Modified: head/sys/amd64/linux32/linux32_dummy.c
==
--- head/sys/amd64/linux32/linux32_dummy.c  Sat Mar 25 15:06:28 2017
(r315956)
+++ head/sys/amd64/linux32/linux32_dummy.c  Sat Mar 25 15:47:29 2017
(r315957)
@@ -79,7 +79,6 @@ DUMMY(sendfile);
 DUMMY(setfsuid);
 DUMMY(setfsgid);
 DUMMY(pivot_root);
-DUMMY(mincore);
 DUMMY(ptrace);
 DUMMY(lookup_dcookie);
 DUMMY(remap_file_pages);

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Sat Mar 25 15:06:28 2017
(r315956)
+++ head/sys/compat/linux/linux_misc.c  Sat Mar 25 15:47:29 2017
(r315957)
@@ -2534,3 +2534,17 @@ linux_getrandom(struct thread *td, struc
 
return (read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK));
 }
+
+int
+linux_mincore(struct thread *td, struct linux_mincore_args *args)
+{
+   struct mincore_args bsd_args;
+
+   /* Needs to be page-aligned */
+   if (args->start & PAGE_MASK)
+   return (EINVAL);
+   bsd_args.addr = PTRIN(args->start);
+   bsd_args.len = args->len;
+   bsd_args.vec = args->vec;
+   return (sys_mincore(td, &bsd_args));
+}

Modified: head/sys/i386/linux/linux_dummy.c
==
--- head/sys/i386/linux/linux_dummy.c   Sat Mar 25 15:06:28 2017
(r315956)
+++ head/sys/i386/linux/linux_dummy.c   Sat Mar 25 15:47:29 2017
(r315957)
@@ -82,7 +82,6 @@ DUMMY(sendfile);  /* different semantics
 DUMMY(setfsuid);
 DUMMY(setfsgid);
 DUMMY(pivot_root);
-DUMMY(mincore);
 DUMMY(lookup_dcookie);
 DUMMY(remap_file_pages);
 DUMMY(mbind);
___
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: r315958 - head/sys/dev/iwn

2017-03-25 Thread Andriy Voskoboinyk
Author: avos
Date: Sat Mar 25 15:57:47 2017
New Revision: 315958
URL: https://svnweb.freebsd.org/changeset/base/315958

Log:
  iwn: do not try to update node configuration when the node does not exist.
  
  Firmware will just respond with status '0x8' (node does not exist) or
  will hang -> cause 'device timeout's (sometimes).

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnreg.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Sat Mar 25 15:47:29 2017(r315957)
+++ head/sys/dev/iwn/if_iwn.c   Sat Mar 25 15:57:47 2017(r315958)
@@ -2651,7 +2651,15 @@ iwn_read_eeprom_enhinfo(struct iwn_softc
 static struct ieee80211_node *
 iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
 {
-   return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO);
+   struct iwn_node *wn;
+
+   wn = malloc(sizeof (struct iwn_node), M_80211_NODE, M_NOWAIT | M_ZERO);
+   if (wn == NULL)
+   return (NULL);
+
+   wn->id = IWN_ID_UNDEFINED;
+
+   return (&wn->ni);
 }
 
 static __inline int
@@ -7355,6 +7363,9 @@ iwn_ampdu_rx_start(struct ieee80211_node
tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID);
ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START);
 
+   if (wn->id == IWN_ID_UNDEFINED)
+   return (ENOENT);
+
memset(&node, 0, sizeof node);
node.id = wn->id;
node.control = IWN_NODE_UPDATE;
@@ -7386,6 +7397,9 @@ iwn_ampdu_rx_stop(struct ieee80211_node 
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
 
+   if (wn->id == IWN_ID_UNDEFINED)
+   goto end;
+
/* XXX: tid as an argument */
for (tid = 0; tid < WME_NUM_TID; tid++) {
if (&ni->ni_rx_ampdu[tid] == rap)
@@ -7399,6 +7413,7 @@ iwn_ampdu_rx_stop(struct ieee80211_node 
node.delba_tid = tid;
DPRINTF(sc, IWN_DEBUG_RECV, "DELBA RA=%d TID=%d\n", wn->id, tid);
(void)ops->add_node(sc, &node, 1);
+end:
sc->sc_ampdu_rx_stop(ni, rap);
 }
 
@@ -7473,6 +7488,9 @@ iwn_ampdu_tx_start(struct ieee80211com *
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
 
+   if (wn->id == IWN_ID_UNDEFINED)
+   return (0);
+
/* Enable TX for the specified RA/TID. */
wn->disable_tid &= ~(1 << tid);
memset(&node, 0, sizeof node);

Modified: head/sys/dev/iwn/if_iwnreg.h
==
--- head/sys/dev/iwn/if_iwnreg.hSat Mar 25 15:47:29 2017
(r315957)
+++ head/sys/dev/iwn/if_iwnreg.hSat Mar 25 15:57:47 2017
(r315958)
@@ -690,13 +690,15 @@ struct iwn_node_info {
uint8_t macaddr[IEEE80211_ADDR_LEN];
uint16_treserved2;
uint8_t id;
-#define IWN_ID_BSS  0
+#define IWN_ID_BSS 0
 #defineIWN_STA_ID  1
 
-#defineIWN_PAN_ID_BCAST14
+#defineIWN_PAN_ID_BCAST14
 #define IWN5000_ID_BROADCAST   15
 #define IWN4965_ID_BROADCAST   31
 
+#define IWN_ID_UNDEFINED   (uint8_t)-1
+
uint8_t flags;
 #define IWN_FLAG_SET_KEY   (1 << 0)
 #define IWN_FLAG_SET_DISABLE_TID   (1 << 1)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ge

2017-03-25 Thread Ngie Cooper

> On Mar 25, 2017, at 06:32, Dmitry Chagin  wrote:
> 
> Author: dchagin
> Date: Sat Mar 25 13:32:28 2017
> New Revision: 315948
> URL: https://svnweb.freebsd.org/changeset/base/315948
> 
> Log:
>  Update to tcsh 6.20.00

Relnotes: yes

Should this be MFCed?

Thanks!
-Ngie
___
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: r315959 - in head/sys: amd64/amd64 amd64/vmm amd64/vmm/amd i386/i386 x86/include x86/x86 x86/xen

2017-03-25 Thread Andriy Gapon
Author: avg
Date: Sat Mar 25 18:45:09 2017
New Revision: 315959
URL: https://svnweb.freebsd.org/changeset/base/315959

Log:
  specific end of interrupt implementation for AMD Local APIC
  
  The change is more intrusive than I would like because the feature
  requires that a vector number is written to a special register.
  Thus, now the vector number has to be provided to lapic_eoi().
  It was readily available in the IO-APIC and MSI cases, but the IPI
  handlers required more work.
  Also, we now store the VMM IPI number in a global variable, so that it
  is available to the justreturn handler for the same reason.
  
  Reviewed by:  kib
  MFC after:6 weeks
  Differential Revision: https://reviews.freebsd.org/D9880

Modified:
  head/sys/amd64/amd64/apic_vector.S
  head/sys/amd64/amd64/genassym.c
  head/sys/amd64/vmm/amd/svm.c
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_host.h
  head/sys/i386/i386/apic_vector.s
  head/sys/i386/i386/genassym.c
  head/sys/x86/include/apicvar.h
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/local_apic.c
  head/sys/x86/x86/msi.c
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/amd64/amd64/apic_vector.S
==
--- head/sys/amd64/amd64/apic_vector.S  Sat Mar 25 15:57:47 2017
(r315958)
+++ head/sys/amd64/amd64/apic_vector.S  Sat Mar 25 18:45:09 2017
(r315959)
@@ -50,22 +50,6 @@
 #define LK
 #endif
 
-   .text
-   SUPERALIGN_TEXT
-   /* End Of Interrupt to APIC */
-as_lapic_eoi:
-   cmpl$0,x2apic_mode
-   jne 1f
-   movqlapic_map,%rax
-   movl$0,LA_EOI(%rax)
-   ret
-1:
-   movl$MSR_APIC_EOI,%ecx
-   xorl%eax,%eax
-   xorl%edx,%edx
-   wrmsr
-   ret
-
 /*
  * I/O Interrupt Entry Point.  Rather than having one entry point for
  * each interrupt source, we use one entry point for each 32-bit word
@@ -182,7 +166,7 @@ IDTVEC(xen_intr_upcall)
 
SUPERALIGN_TEXT
 invltlb_ret:
-   callas_lapic_eoi
+   callnative_lapic_eoi
POP_FRAME
jmp doreti_iret
 
@@ -191,18 +175,21 @@ IDTVEC(invltlb)
PUSH_FRAME
 
callinvltlb_handler
+   movl$IPI_INVLTLB, %edi
jmp invltlb_ret
 
 IDTVEC(invltlb_pcid)
PUSH_FRAME
 
callinvltlb_pcid_handler
+   movl$IPI_INVLTLB, %edi
jmp invltlb_ret
 
 IDTVEC(invltlb_invpcid)
PUSH_FRAME
 
callinvltlb_invpcid_handler
+   movl$IPI_INVLTLB, %edi
jmp invltlb_ret
 
 /*
@@ -215,6 +202,7 @@ IDTVEC(invlpg)
PUSH_FRAME
 
callinvlpg_handler
+   movl$IPI_INVLPG, %edi
jmp invltlb_ret
 
 /*
@@ -226,6 +214,7 @@ IDTVEC(invlrng)
PUSH_FRAME
 
callinvlrng_handler
+   movl$IPI_INVLRNG, %edi
jmp invltlb_ret
 
 /*
@@ -237,6 +226,7 @@ IDTVEC(invlcache)
PUSH_FRAME
 
callinvlcache_handler
+   movl$IPI_INVLCACHE, %edi
jmp invltlb_ret
 
 /*
@@ -247,7 +237,8 @@ IDTVEC(invlcache)
 IDTVEC(ipi_intr_bitmap_handler)
PUSH_FRAME
 
-   callas_lapic_eoi
+   movl$IPI_BITMAP_VECTOR, %edi
+   callnative_lapic_eoi

FAKE_MCOUNT(TF_RIP(%rsp))
 
@@ -263,7 +254,8 @@ IDTVEC(ipi_intr_bitmap_handler) 
 IDTVEC(cpustop)
PUSH_FRAME
 
-   callas_lapic_eoi
+   movl$IPI_STOP, %edi
+   callnative_lapic_eoi
 
callcpustop_handler
jmp doreti
@@ -277,7 +269,8 @@ IDTVEC(cpususpend)
PUSH_FRAME
 
callcpususpend_handler
-   callas_lapic_eoi
+   movl$IPI_SUSPEND, %edi
+   callnative_lapic_eoi
jmp doreti
 
 /*
@@ -295,37 +288,22 @@ IDTVEC(rendezvous)
incq(%rax)
 #endif
callsmp_rendezvous_action
-   callas_lapic_eoi
+   movl$IPI_RENDEZVOUS, %edi
+   callnative_lapic_eoi
jmp doreti
 
 /*
  * IPI handler whose purpose is to interrupt the CPU with minimum overhead.
  * This is used by bhyve to force a host cpu executing in guest context to
  * trap into the hypervisor.
- *
- * This handler is different from other IPI handlers in the following aspects:
- *
- * 1. It doesn't push a trapframe on the stack.
- *
- * This implies that a DDB backtrace involving 'justreturn' will skip the
- * function that was interrupted by this handler.
- *
- * 2. It doesn't 'swapgs' when userspace is interrupted.
- *
- * The 'justreturn' handler does not access any pcpu data so it is not an
- * issue. Moreover the 'justreturn' handler can only be interrupted by an NMI
- * whose handler already doesn't trust GS.base when kernel code is interrupted.
  */
.text
SUPERALIGN_TEXT
 IDTVEC(justreturn)
-   pushq   %rax
-   pushq   %rcx
-   pushq   %rdx
-   callas_lapic_eoi
-   popq%rdx
-   popq%rcx
-   popq%rax
+

svn commit: r315960 - head/sys/kern

2017-03-25 Thread Andriy Gapon
Author: avg
Date: Sat Mar 25 19:08:51 2017
New Revision: 315960
URL: https://svnweb.freebsd.org/changeset/base/315960

Log:
  dtrace sched:::preempt should fire only when there is preemption
  
  The probe fire on any thread switch before.
  
  Reviewed by:  markj
  MFC after:1 week
  Sponsored by: Panzura

Modified:
  head/sys/kern/kern_synch.c

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Sat Mar 25 18:45:09 2017(r315959)
+++ head/sys/kern/kern_synch.c  Sat Mar 25 19:08:51 2017(r315960)
@@ -430,7 +430,11 @@ mi_switch(int flags, struct thread *newt
PCPU_SET(switchticks, ticks);
CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)",
td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name);
-   SDT_PROBE0(sched, , , preempt);
+#ifdef KDTRACE_HOOKS
+   if ((flags & SW_PREEMPT) != 0 || ((flags & SW_INVOL) != 0 &&
+   (flags & SW_TYPE_MASK) == SWT_NEEDRESCHED))
+   SDT_PROBE0(sched, , , preempt);
+#endif
sched_switch(td, newtd, flags);
CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)",
td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_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: r315961 - head/sys/dev/sound/pci/hda

2017-03-25 Thread Sean Bruno
Author: sbruno
Date: Sat Mar 25 19:12:09 2017
New Revision: 315961
URL: https://svnweb.freebsd.org/changeset/base/315961

Log:
  Add ids for ALC233 found on Intel Skull Mountain NUC.

Modified:
  head/sys/dev/sound/pci/hda/hdac.h
  head/sys/dev/sound/pci/hda/hdacc.c

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Sat Mar 25 19:08:51 2017
(r315960)
+++ head/sys/dev/sound/pci/hda/hdac.h   Sat Mar 25 19:12:09 2017
(r315961)
@@ -339,6 +339,7 @@
 /* Realtek */
 #define REALTEK_VENDORID   0x10ec
 #define HDA_CODEC_ALC221   HDA_CODEC_CONSTRUCT(REALTEK, 0x0221)
+#define HDA_CODEC_ALC233   HDA_CODEC_CONSTRUCT(REALTEK, 0x0233)
 #define HDA_CODEC_ALC260   HDA_CODEC_CONSTRUCT(REALTEK, 0x0260)
 #define HDA_CODEC_ALC262   HDA_CODEC_CONSTRUCT(REALTEK, 0x0262)
 #define HDA_CODEC_ALC267   HDA_CODEC_CONSTRUCT(REALTEK, 0x0267)

Modified: head/sys/dev/sound/pci/hda/hdacc.c
==
--- head/sys/dev/sound/pci/hda/hdacc.c  Sat Mar 25 19:08:51 2017
(r315960)
+++ head/sys/dev/sound/pci/hda/hdacc.c  Sat Mar 25 19:12:09 2017
(r315961)
@@ -77,6 +77,7 @@ static const struct {
{ HDA_CODEC_CS4207, 0,  "Cirrus Logic CS4207" },
{ HDA_CODEC_CS4210, 0,  "Cirrus Logic CS4210" },
{ HDA_CODEC_ALC221, 0,  "Realtek ALC221" },
+   { HDA_CODEC_ALC233, 0,  "Realtek ALC233" },
{ HDA_CODEC_ALC260, 0,  "Realtek ALC260" },
{ HDA_CODEC_ALC262, 0,  "Realtek ALC262" },
{ HDA_CODEC_ALC267, 0,  "Realtek ALC267" },
___
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: r315963 - in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern

2017-03-25 Thread Eric Badger
Author: badger
Date: Sat Mar 25 20:14:08 2017
New Revision: 315963
URL: https://svnweb.freebsd.org/changeset/base/315963

Log:
  MFC r315412, r314852:
  
  r315412:
  Don't clear p_ptevents on normal SIGKILL delivery
  
  The ptrace() user has the option of discarding the signal. In such a
  case, p_ptevents should not be modified. If the ptrace() user decides to
  send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events
  do not have the capability to discard the signal, so continue to clear
  the mask in that case.
  
  r314852:
  don't stop in issignal() if P_SINGLE_EXIT is set
  
  Suppose a traced process is stopped in ptracestop() due to receipt of a
  SIGSTOP signal, and is awaiting orders from the tracing process on how
  to handle the signal. Before sending any such orders, the tracing
  process exits. This should kill the traced process. But suppose a second
  thread handles the SIGKILL and proceeds to exit1(), calling
  thread_single(). The first thread will now awaken and will have a chance
  to check once more if it should go to sleep due to the SIGSTOP.  It must
  not sleep after P_SINGLE_EXIT has been set; this would prevent the
  SIGKILL from taking effect, leaving a stopped orphan behind after the
  tracing process dies.
  
  Also add new tests for this condition.
  
  Sponsored by: Dell EMC

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

Changes in other areas also in this revision:
Modified:
  stable/10/sys/kern/kern_sig.c
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/kern/kern_sig.c
==
--- stable/11/sys/kern/kern_sig.c   Sat Mar 25 19:46:53 2017
(r315962)
+++ stable/11/sys/kern/kern_sig.c   Sat Mar 25 20:14:08 2017
(r315963)
@@ -2213,11 +2213,9 @@ tdsendsignal(struct proc *p, struct thre
if (action == SIG_HOLD &&
!((prop & SA_CONT) && (p->p_flag & P_STOPPED_SIG)))
return (ret);
-   /*
-* SIGKILL: Remove procfs STOPEVENTs and ptrace events.
-*/
+
+   /* SIGKILL: Remove procfs STOPEVENTs. */
if (sig == SIGKILL) {
-   p->p_ptevents = 0;
/* from procfs_ioctl.c: PIOCBIC */
p->p_stops = 0;
/* from procfs_ioctl.c: PIOCCONT */
@@ -2893,14 +2891,15 @@ issignal(struct thread *td)
break;  /* == ignore */
}
/*
-* If there is a pending stop signal to process
-* with default action, stop here,
-* then clear the signal.  However,
-* if process is member of an orphaned
-* process group, ignore tty stop signals.
+* If there is a pending stop signal to process with
+* default action, stop here, then clear the signal.
+* Traced or exiting processes should ignore stops.
+* Additionally, a member of an orphaned process group
+* should ignore tty stops.
 */
if (prop & SA_STOP) {
-   if (p->p_flag & (P_TRACED|P_WEXIT) ||
+   if (p->p_flag &
+   (P_TRACED | P_WEXIT | P_SINGLE_EXIT) ||
(p->p_pgrp->pg_jobc == 0 &&
 prop & SA_TTYSTOP))
break;  /* == ignore */

Modified: stable/11/tests/sys/kern/ptrace_test.c
==
--- stable/11/tests/sys/kern/ptrace_test.c  Sat Mar 25 19:46:53 2017
(r315962)
+++ stable/11/tests/sys/kern/ptrace_test.c  Sat Mar 25 20:14:08 2017
(r315963)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2818,6 +2819,212 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_with_sig
ATF_REQUIRE(errno == ECHILD);
 }
 
+static void *
+raise_sigstop_thread(void *arg __unused)
+{
+
+   raise(SIGSTOP);
+   return NULL;
+}
+
+static void *
+sleep_thread(void *arg __unused)
+{
+
+   sleep(60);
+   return NULL;
+}
+
+static void
+terminate_with_pending_sigstop(bool sigstop_from_main_thread)
+{
+   pid_t fpid, wpid;
+   int status, i;
+   cpuset_t setmask;
+   cpusetid_t setid;
+   pthread_t t;
+
+   /*
+* Become the reaper for this process tree. We need to be able to check
+* that both child and grandchild have died.
+*/
+   ATF_REQUIRE(procctl(P_PID, 

svn commit: r315963 - in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern

2017-03-25 Thread Eric Badger
Author: badger
Date: Sat Mar 25 20:14:08 2017
New Revision: 315963
URL: https://svnweb.freebsd.org/changeset/base/315963

Log:
  MFC r315412, r314852:
  
  r315412:
  Don't clear p_ptevents on normal SIGKILL delivery
  
  The ptrace() user has the option of discarding the signal. In such a
  case, p_ptevents should not be modified. If the ptrace() user decides to
  send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events
  do not have the capability to discard the signal, so continue to clear
  the mask in that case.
  
  r314852:
  don't stop in issignal() if P_SINGLE_EXIT is set
  
  Suppose a traced process is stopped in ptracestop() due to receipt of a
  SIGSTOP signal, and is awaiting orders from the tracing process on how
  to handle the signal. Before sending any such orders, the tracing
  process exits. This should kill the traced process. But suppose a second
  thread handles the SIGKILL and proceeds to exit1(), calling
  thread_single(). The first thread will now awaken and will have a chance
  to check once more if it should go to sleep due to the SIGSTOP.  It must
  not sleep after P_SINGLE_EXIT has been set; this would prevent the
  SIGKILL from taking effect, leaving a stopped orphan behind after the
  tracing process dies.
  
  Also add new tests for this condition.
  
  Sponsored by: Dell EMC

Modified:
  stable/10/sys/kern/kern_sig.c
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/kern/kern_sig.c
  stable/11/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/kern/kern_sig.c
==
--- stable/10/sys/kern/kern_sig.c   Sat Mar 25 19:46:53 2017
(r315962)
+++ stable/10/sys/kern/kern_sig.c   Sat Mar 25 20:14:08 2017
(r315963)
@@ -2197,11 +2197,9 @@ tdsendsignal(struct proc *p, struct thre
if (action == SIG_HOLD &&
!((prop & SA_CONT) && (p->p_flag & P_STOPPED_SIG)))
return (ret);
-   /*
-* SIGKILL: Remove procfs STOPEVENTs and ptrace events.
-*/
+
+   /* SIGKILL: Remove procfs STOPEVENTs. */
if (sig == SIGKILL) {
-   p->p_ptevents = 0;
/* from procfs_ioctl.c: PIOCBIC */
p->p_stops = 0;
/* from procfs_ioctl.c: PIOCCONT */
@@ -2824,14 +2822,15 @@ issignal(struct thread *td)
break;  /* == ignore */
}
/*
-* If there is a pending stop signal to process
-* with default action, stop here,
-* then clear the signal.  However,
-* if process is member of an orphaned
-* process group, ignore tty stop signals.
+* If there is a pending stop signal to process with
+* default action, stop here, then clear the signal.
+* Traced or exiting processes should ignore stops.
+* Additionally, a member of an orphaned process group
+* should ignore tty stops.
 */
if (prop & SA_STOP) {
-   if (p->p_flag & (P_TRACED|P_WEXIT) ||
+   if (p->p_flag &
+   (P_TRACED | P_WEXIT | P_SINGLE_EXIT) ||
(p->p_pgrp->pg_jobc == 0 &&
 prop & SA_TTYSTOP))
break;  /* == ignore */

Modified: stable/10/tests/sys/kern/ptrace_test.c
==
--- stable/10/tests/sys/kern/ptrace_test.c  Sat Mar 25 19:46:53 2017
(r315962)
+++ stable/10/tests/sys/kern/ptrace_test.c  Sat Mar 25 20:14:08 2017
(r315963)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2732,6 +2733,212 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_with_sig
ATF_REQUIRE(errno == ECHILD);
 }
 
+static void *
+raise_sigstop_thread(void *arg __unused)
+{
+
+   raise(SIGSTOP);
+   return NULL;
+}
+
+static void *
+sleep_thread(void *arg __unused)
+{
+
+   sleep(60);
+   return NULL;
+}
+
+static void
+terminate_with_pending_sigstop(bool sigstop_from_main_thread)
+{
+   pid_t fpid, wpid;
+   int status, i;
+   cpuset_t setmask;
+   cpusetid_t setid;
+   pthread_t t;
+
+   /*
+* Become the reaper for this process tree. We need to be able to check
+* that both child and grandchild have died.
+*/
+   ATF_REQUIRE(procctl(P_PID, 

Re: svn commit: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ge

2017-03-25 Thread Chagin Dmitry
On Sat, Mar 25, 2017 at 10:45:30AM -0700, Ngie Cooper wrote:
> 
> > On Mar 25, 2017, at 06:32, Dmitry Chagin  wrote:
> > 
> > Author: dchagin
> > Date: Sat Mar 25 13:32:28 2017
> > New Revision: 315948
> > URL: https://svnweb.freebsd.org/changeset/base/315948
> > 
> > Log:
> >  Update to tcsh 6.20.00
> 
> Relnotes: yes
>
don't think it matters,
 
> Should this be MFCed?
> 
I did not plan
-- 
___
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: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ge

2017-03-25 Thread Ed Maste
On 25 March 2017 at 16:19, Chagin Dmitry  wrote:
>> > Log:
>> >  Update to tcsh 6.20.00
>>
>> Relnotes: yes
>>
> don't think it matters,

In general I'd expect release notes to mention the version numbers for
all updated third-party software components.
___
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: r315964 - head/usr.sbin/ppp

2017-03-25 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Mar 25 21:33:48 2017
New Revision: 315964
URL: https://svnweb.freebsd.org/changeset/base/315964

Log:
  ftp.microsoft.com is dead and the document was not archived, point to the full
  protocol spec document instead.
  Fix spelling mistake flagged by igor.
  Rephrase bad sentence flagged by igor.
  
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision: https://reviews.freebsd.org/D10111

Modified:
  head/usr.sbin/ppp/ppp.8

Modified: head/usr.sbin/ppp/ppp.8
==
--- head/usr.sbin/ppp/ppp.8 Sat Mar 25 20:14:08 2017(r315963)
+++ head/usr.sbin/ppp/ppp.8 Sat Mar 25 21:33:48 2017(r315964)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 25, 2009
+.Dd March 25, 2017
 .Dt PPP 8
 .Os
 .Sh NAME
@@ -265,7 +265,7 @@ will force it to exit.
 .It Supports client callback.
 .Nm
 can use either the standard LCP callback protocol or the Microsoft
-CallBack Control Protocol (ftp://ftp.microsoft.com/developr/rfc/cbcp.txt).
+CallBack Control Protocol 
(https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CBCP/[MS-CBCP].pdf).
 .It Supports NAT or packet aliasing.
 Packet aliasing (a.k.a.\& IP masquerading) allows computers on a
 private, unregistered network to access the Internet.
@@ -3523,7 +3523,7 @@ for details of the available commands.
 This command tells
 .Nm
 to punch holes in the firewall for FTP or IRC DCC connections.
-This is done dynamically by installing termporary firewall rules which
+This is done dynamically by installing temporary firewall rules which
 allow a particular connection (and only that connection) to go through
 the firewall.
 The rules are removed once the corresponding connection terminates.
@@ -,7 +,7 @@ seconds.
 .It set rad_port_id Ar option
 When RADIUS is configured, setting the
 .Dq rad_port_id
-value allows to specify what should be sent to the RADIUS server as
+value specifies what should be sent to the RADIUS server as
 NAS-Port-Id.
 The
 .Ar option Ns No s
___
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: r315965 - in stable/10: contrib/libcxxrt lib/libcxxrt

2017-03-25 Thread Dimitry Andric
Author: dim
Date: Sat Mar 25 21:46:02 2017
New Revision: 315965
URL: https://svnweb.freebsd.org/changeset/base/315965

Log:
  Synchronize libcxxrt in stable/10 with stable/11.
  
  MFC r284553 (by emaste):
  
  Update libcxxrt upgrade instructions
  
  The typeinfo file no longer exists upstream.
  
  MFC r297299:
  
  Compile libcxxrt as C++11, since it is only really used in combination
  with libc++, which is also C++11.  Also change one _Static_assert (which
  is really C11) back into static_assert, like upstream.
  
  This should help when compiling libcxxrt with newer versions of gcc,
  which refuse to recognize any form of static assertions, if not
  compiling for C++11 or higher.
  
  While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
  headers outside the source tree.
  
  MFC r299144:
  
  Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef.
  
  Interesting fixes:
  3adaa2e Fix _Unwind_Exception cleanup functions
  286776c Check exception cleanup function ptr before calling
  edda626 Correct exception specifications on new and delete operators
  
  MFC r303157 (by emaste):
  
  libcxxrt: add padding in __cxa_allocate_* to fix alignment
  
  The addition of the referenceCount to __cxa_allocate_exception put the
  unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
  alignment. In order to avoid changing the current __cxa_exception ABI
  (and thus breaking its consumers), add explicit padding in the
  allocation routines (and account for it when freeing).
  
  This is intended as a lower-risk change for FreeBSD 11. A "more correct"
  fix should be prepared for upstream and -CURRENT.
  
  Reviewed by:  dim
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7271
  
  MFC r305396:
  
  Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header.  This
  value is used in newer versions of compiler-rt.

Modified:
  stable/10/contrib/libcxxrt/FREEBSD-upgrade
  stable/10/contrib/libcxxrt/exception.cc
  stable/10/contrib/libcxxrt/guard.cc
  stable/10/contrib/libcxxrt/memory.cc
  stable/10/contrib/libcxxrt/unwind-arm.h
  stable/10/lib/libcxxrt/Makefile
  stable/10/lib/libcxxrt/Version.map
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/libcxxrt/FREEBSD-upgrade
==
--- stable/10/contrib/libcxxrt/FREEBSD-upgrade  Sat Mar 25 21:33:48 2017
(r315964)
+++ stable/10/contrib/libcxxrt/FREEBSD-upgrade  Sat Mar 25 21:46:02 2017
(r315965)
@@ -3,4 +3,4 @@ $FreeBSD$
 This is the FreeBSD copy of libcxxrt.  It contains the src directory from the 
 upstream repository.
 
-When updating, copy *.{c,cc,h} and typeinfo from the upstream src/.
+When updating, copy *.{c,cc,h} from the upstream src/.

Modified: stable/10/contrib/libcxxrt/exception.cc
==
--- stable/10/contrib/libcxxrt/exception.cc Sat Mar 25 21:33:48 2017
(r315964)
+++ stable/10/contrib/libcxxrt/exception.cc Sat Mar 25 21:46:02 2017
(r315965)
@@ -304,13 +304,17 @@ static pthread_key_t eh_key;
 static void exception_cleanup(_Unwind_Reason_Code reason, 
   struct _Unwind_Exception *ex)
 {
-   __cxa_free_exception(static_cast(ex));
+   // Exception layout:
+   // [__cxa_exception [_Unwind_Exception]] [exception object]
+   //
+   // __cxa_free_exception expects a pointer to the exception object
+   __cxa_free_exception(static_cast(ex + 1));
 }
 static void dependent_exception_cleanup(_Unwind_Reason_Code reason, 
   struct _Unwind_Exception *ex)
 {
 
-   __cxa_free_dependent_exception(static_cast(ex));
+   __cxa_free_dependent_exception(static_cast(ex + 1));
 }
 
 /**
@@ -340,7 +344,8 @@ static void thread_cleanup(void* thread_
if (info->foreign_exception_state != __cxa_thread_info::none)
{
_Unwind_Exception *e = 
reinterpret_cast<_Unwind_Exception*>(info->globals.caughtExceptions);
-   e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e);
+   if (e->exception_cleanup)
+   
e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e);
}
else
{
@@ -567,6 +572,19 @@ static void free_exception(char *e)
}
 }
 
+#ifdef __LP64__
+/**
+ * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte
+ * alignment but it was broken by the addition of the referenceCount.
+ * The unwindHeader is at offset 0x58 in __cxa_exception.  In order to keep
+ * compatibility with consumers of the broken __cxa_exception, explicitly add
+ * padding on allocation (and account for it on free).
+ */
+static const int exception_alignment_padding = 8;
+#else
+static const int exception_alignment_padding = 0;
+

svn commit: r315966 - head/sys/dev/iwn

2017-03-25 Thread Andriy Voskoboinyk
Author: avos
Date: Sat Mar 25 22:07:21 2017
New Revision: 315966
URL: https://svnweb.freebsd.org/changeset/base/315966

Log:
  iwn: fix return code conflict in iwn_init_locked()
  
  Do not try to use errno(2) codes here; instead, just return unique
  value (1) when radio is disabled via hardware switch and another
  one (-1) for any other error in initialization path.
  
  Tested with Intel 6205, STA mode.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Sat Mar 25 21:46:02 2017(r315965)
+++ head/sys/dev/iwn/if_iwn.c   Sat Mar 25 22:07:21 2017(r315966)
@@ -5120,7 +5120,7 @@ iwn_parent(struct ieee80211com *ic)
case 0:
ieee80211_start_all(ic);
break;
-   case EAGAIN:
+   case 1:
/* radio is disabled via RFkill switch */
taskqueue_enqueue(sc->sc_tq, &sc->sc_rftoggle_task);
break;
@@ -8879,8 +8879,10 @@ iwn_init_locked(struct iwn_softc *sc)
 
/* Check that the radio is not disabled by hardware switch. */
if (!(IWN_READ(sc, IWN_GP_CNTRL) & IWN_GP_CNTRL_RFKILL)) {
-   error = EAGAIN;
-   goto fail;
+   iwn_stop_locked(sc);
+   DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);
+
+   return (1);
}
 
/* Read firmware images from the filesystem. */
@@ -8921,7 +8923,7 @@ fail:
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);
 
-   return (error);
+   return (-1);
 }
 
 static int
___
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: r315967 - head/sys/arm/broadcom/bcm2835

2017-03-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 25 22:58:37 2017
New Revision: 315967
URL: https://svnweb.freebsd.org/changeset/base/315967

Log:
  [rpi] Use compatibility string from upstream DTB for I2C controller
  
  FreeBSD uses upstream DTB for RPi3 build and compatibility string for
  i2c device is different there. Add this new string to compatibility data.
  
  Reported by:  Karl Denninger
  MFC after:3 days

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sat Mar 25 22:07:21 2017
(r315966)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sat Mar 25 22:58:37 2017
(r315967)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 static struct ofw_compat_data compat_data[] = {
{"broadcom,bcm2835-bsc",1},
{"brcm,bcm2708-i2c",1},
+   {"brcm,bcm2835-i2c",1},
{NULL,  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"


Re: svn commit: r315957 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux

2017-03-25 Thread Konstantin Belousov
On Sat, Mar 25, 2017 at 03:47:30PM +, Dmitry Chagin wrote:
> Author: dchagin
> Date: Sat Mar 25 15:47:29 2017
> New Revision: 315957
> URL: https://svnweb.freebsd.org/changeset/base/315957
> 
> Log:
>   Implement Linux mincore() system call.
>   This is necessary for the upcoming drm-next.
> +int
> +linux_mincore(struct thread *td, struct linux_mincore_args *args)
> +{
> + struct mincore_args bsd_args;
> +
> + /* Needs to be page-aligned */
> + if (args->start & PAGE_MASK)
> + return (EINVAL);
> + bsd_args.addr = PTRIN(args->start);
> + bsd_args.len = args->len;
> + bsd_args.vec = args->vec;
> + return (sys_mincore(td, &bsd_args));
> +}

Almost all syscalls implementations in vm/vm_mmap.c got the kern_*
helpers, sys_mincore() did not because it was not called outside the
file.  Please add kern_mincore() and use it, instead of abusing syscall
entry.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 26 00:40:35 2017
New Revision: 315968
URL: https://svnweb.freebsd.org/changeset/base/315968

Log:
  Provide less laborius way to enable busdma DMAR to only short list of devices.
  
  Kernel environment variable hw.busdma.default can take values 'bounce'
  and 'dmar' and selects corresponding busdma backend as default.
  Per-device environment variable hw.busdma.pci...
  takes the same values and overrides hw.busdma.default for the given device.
  
  Note that even with hw.busdma.default=bounce, DMA translation engines
  are still started if DMARs are enabled, to disable them use
  hw.dmar.dma tunable, as before.
  
  Sponsored by: The FreeBSD Foundation
  MFC after: 1 week

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

Modified: head/sys/x86/iommu/busdma_dmar.c
==
--- head/sys/x86/iommu/busdma_dmar.cSat Mar 25 22:58:37 2017
(r315967)
+++ head/sys/x86/iommu/busdma_dmar.cSun Mar 26 00:40:35 2017
(r315968)
@@ -74,14 +74,34 @@ static bool
 dmar_bus_dma_is_dev_disabled(int domain, int bus, int slot, int func)
 {
char str[128], *env;
+   int default_bounce;
+   bool ret;
+   static const char bounce_str[] = "bounce";
+   static const char dmar_str[] = "dmar";
+
+   default_bounce = 0;
+   env = kern_getenv("hw.busdma.default");
+   if (env != NULL) {
+   if (strcmp(env, bounce_str) == 0)
+   default_bounce = 1;
+   else if (strcmp(env, dmar_str) == 0)
+   default_bounce = 0;
+   freeenv(env);
+   }
 
-   snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d.bounce",
+   snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d",
domain, bus, slot, func);
env = kern_getenv(str);
if (env == NULL)
-   return (false);
+   return (default_bounce != 0);
+   if (strcmp(env, bounce_str) == 0)
+   ret = true;
+   else if (strcmp(env, dmar_str) == 0)
+   ret = false;
+   else
+   ret = default_bounce != 0;
freeenv(env);
-   return (true);
+   return (ret);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r315969 - stable/11/sys/dev/cpuctl

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 26 00:53:34 2017
New Revision: 315969
URL: https://svnweb.freebsd.org/changeset/base/315969

Log:
  MFC r315586:
  Style.

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

Modified: stable/11/sys/dev/cpuctl/cpuctl.c
==
--- stable/11/sys/dev/cpuctl/cpuctl.c   Sun Mar 26 00:40:35 2017
(r315968)
+++ stable/11/sys/dev/cpuctl/cpuctl.c   Sun Mar 26 00:53:34 2017
(r315969)
@@ -126,7 +126,8 @@ set_cpu(int cpu, struct thread *td)
sched_bind(td, cpu);
thread_unlock(td);
KASSERT(td->td_oncpu == cpu,
-   ("[cpuctl,%d]: cannot bind to target cpu %d on cpu %d", __LINE__, 
cpu, td->td_oncpu));
+   ("[cpuctl,%d]: cannot bind to target cpu %d on cpu %d", __LINE__,
+   cpu, td->td_oncpu));
 }
 
 static void
@@ -145,11 +146,11 @@ restore_cpu(int oldcpu, int is_bound, st
 
 int
 cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
-   int flags, struct thread *td)
+int flags, struct thread *td)
 {
-   int ret;
-   int cpu = dev2unit(dev);
+   int cpu, ret;
 
+   cpu = dev2unit(dev);
if (cpu > mp_maxid || !cpu_enabled(cpu)) {
DPRINTF("[cpuctl,%d]: bad cpu number %d\n", __LINE__, cpu);
return (ENXIO);
@@ -279,7 +280,8 @@ cpuctl_do_msr(int cpu, cpuctl_msr_args_t
ret = wrmsr_safe(data->msr, reg & ~data->data);
critical_exit();
} else
-   panic("[cpuctl,%d]: unknown operation requested: %lu", 
__LINE__, cmd);
+   panic("[cpuctl,%d]: unknown operation requested: %lu",
+   __LINE__, cmd);
restore_cpu(oldcpu, is_bound, td);
return (ret);
 }
@@ -311,7 +313,8 @@ cpuctl_do_update(int cpu, cpuctl_update_
ret = update_intel(cpu, data, td);
else if(strncmp(vendor, AMD_VENDOR_ID, sizeof(AMD_VENDOR_ID)) == 0)
ret = update_amd(cpu, data, td);
-   else if(strncmp(vendor, CENTAUR_VENDOR_ID, sizeof(CENTAUR_VENDOR_ID)) 
== 0)
+   else if(strncmp(vendor, CENTAUR_VENDOR_ID, sizeof(CENTAUR_VENDOR_ID))
+   == 0)
ret = update_via(cpu, data, td);
else
ret = ENXIO;
___
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: r315970 - stable/11/sys/dev/cpuctl

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 26 00:56:24 2017
New Revision: 315970
URL: https://svnweb.freebsd.org/changeset/base/315970

Log:
  MFC r315588:
  Update the list of cpudev ioctls which require write access.

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

Modified: stable/11/sys/dev/cpuctl/cpuctl.c
==
--- stable/11/sys/dev/cpuctl/cpuctl.c   Sun Mar 26 00:53:34 2017
(r315969)
+++ stable/11/sys/dev/cpuctl/cpuctl.c   Sun Mar 26 00:56:24 2017
(r315970)
@@ -156,8 +156,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
return (ENXIO);
}
/* Require write flag for "write" requests. */
-   if ((cmd == CPUCTL_WRMSR || cmd == CPUCTL_UPDATE) &&
-   ((flags & FWRITE) == 0))
+   if ((cmd == CPUCTL_MSRCBIT || cmd == CPUCTL_MSRSBIT ||
+   cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR) &&
+   (flags & FWRITE) == 0)
return (EPERM);
switch (cmd) {
case CPUCTL_RDMSR:
___
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: r315971 - stable/11/sys/vm

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 26 00:59:15 2017
New Revision: 315971
URL: https://svnweb.freebsd.org/changeset/base/315971

Log:
  MFC r315552:
  Fix off-by-one in the vm_fault_populate() code.

Modified:
  stable/11/sys/vm/vm_fault.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_fault.c
==
--- stable/11/sys/vm/vm_fault.c Sun Mar 26 00:56:24 2017(r315970)
+++ stable/11/sys/vm/vm_fault.c Sun Mar 26 00:59:15 2017(r315971)
@@ -409,7 +409,7 @@ vm_fault_populate(struct faultstate *fs,
vm_fault_populate_cleanup(fs->first_object, pager_first,
map_first - 1);
map_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start +
-   fs->entry->offset), pager_last);
+   fs->entry->offset) - 1, pager_last);
if (map_last < pager_last)
vm_fault_populate_cleanup(fs->first_object, map_last + 1,
pager_last);
___
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: r315972 - stable/10/sys/dev/cpuctl

2017-03-25 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 26 01:10:59 2017
New Revision: 315972
URL: https://svnweb.freebsd.org/changeset/base/315972

Log:
  MFC r315588:
  Update the list of cpudev ioctls which require write access.

Modified:
  stable/10/sys/dev/cpuctl/cpuctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cpuctl/cpuctl.c
==
--- stable/10/sys/dev/cpuctl/cpuctl.c   Sun Mar 26 00:59:15 2017
(r315971)
+++ stable/10/sys/dev/cpuctl/cpuctl.c   Sun Mar 26 01:10:59 2017
(r315972)
@@ -155,8 +155,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
return (ENXIO);
}
/* Require write flag for "write" requests. */
-   if ((cmd == CPUCTL_WRMSR || cmd == CPUCTL_UPDATE) &&
-   ((flags & FWRITE) == 0))
+   if ((cmd == CPUCTL_MSRCBIT || cmd == CPUCTL_MSRSBIT ||
+   cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR) &&
+   (flags & FWRITE) == 0)
return (EPERM);
switch (cmd) {
case CPUCTL_RDMSR:
___
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"