svn commit: r303129 - in head/sys/dev/hyperv: include vmbus

2016-07-20 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 21 05:46:26 2016
New Revision: 303129
URL: https://svnweb.freebsd.org/changeset/base/303129

Log:
  hyperv/vmbus: Shuffle function declaration and macro definition.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7259

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/include/vmbus.h
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hThu Jul 21 05:38:05 2016
(r303128)
+++ head/sys/dev/hyperv/include/hyperv.hThu Jul 21 05:46:26 2016
(r303129)
@@ -58,23 +58,6 @@
 #include 
 #include 
 
-/*
- * VMBUS version is 32 bit, upper 16 bit for major_number and lower
- * 16 bit for minor_number.
- *
- * 0.13  --  Windows Server 2008
- * 1.1   --  Windows 7
- * 2.4   --  Windows 8
- * 3.0   --  Windows 8.1
- */
-#define VMBUS_VERSION_WS2008   ((0 << 16) | (13))
-#define VMBUS_VERSION_WIN7 ((1 << 16) | (1))
-#define VMBUS_VERSION_WIN8 ((2 << 16) | (4))
-#define VMBUS_VERSION_WIN8_1   ((3 << 16) | (0))
-
-#define VMBUS_VERSION_MAJOR(ver)   (((uint32_t)(ver)) >> 16)
-#define VMBUS_VERSION_MINOR(ver)   (((uint32_t)(ver)) & 0x)
-
 struct hyperv_guid {
uint8_t hv_guid[16];
 } __packed;
@@ -83,8 +66,6 @@ struct hyperv_guid {
 
 inthyperv_guid2str(const struct hyperv_guid *, char *, size_t);
 
-struct hv_vmbus_channel;
-
 /**
  * @brief Get physical address from virtual
  */
@@ -96,10 +77,4 @@ hv_get_phys_addr(void *virt)
return (ret);
 }
 
-static __inline struct hv_vmbus_channel *
-vmbus_get_channel(device_t dev)
-{
-   return device_get_ivars(dev);
-}
-
 #endif  /* __HYPERV_H__ */

Modified: head/sys/dev/hyperv/include/vmbus.h
==
--- head/sys/dev/hyperv/include/vmbus.h Thu Jul 21 05:38:05 2016
(r303128)
+++ head/sys/dev/hyperv/include/vmbus.h Thu Jul 21 05:46:26 2016
(r303129)
@@ -32,6 +32,23 @@
 #include 
 
 /*
+ * VMBUS version is 32 bit, upper 16 bit for major_number and lower
+ * 16 bit for minor_number.
+ *
+ * 0.13  --  Windows Server 2008
+ * 1.1   --  Windows 7
+ * 2.4   --  Windows 8
+ * 3.0   --  Windows 8.1
+ */
+#define VMBUS_VERSION_WS2008   ((0 << 16) | (13))
+#define VMBUS_VERSION_WIN7 ((1 << 16) | (1))
+#define VMBUS_VERSION_WIN8 ((2 << 16) | (4))
+#define VMBUS_VERSION_WIN8_1   ((3 << 16) | (0))
+
+#define VMBUS_VERSION_MAJOR(ver)   (((uint32_t)(ver)) >> 16)
+#define VMBUS_VERSION_MINOR(ver)   (((uint32_t)(ver)) & 0x)
+
+/*
  * GPA stuffs.
  */
 struct vmbus_gpa_range {
@@ -92,6 +109,12 @@ struct hyperv_guid;
 
 typedef void   (*vmbus_chan_callback_t)(struct hv_vmbus_channel *, void *);
 
+static __inline struct hv_vmbus_channel *
+vmbus_get_channel(device_t dev)
+{
+   return device_get_ivars(dev);
+}
+
 intvmbus_chan_open(struct hv_vmbus_channel *chan,
int txbr_size, int rxbr_size, const void *udata, int udlen,
vmbus_chan_callback_t cb, void *cbarg);

Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Jul 21 05:38:05 2016
(r303128)
+++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Jul 21 05:46:26 2016
(r303129)
@@ -181,4 +181,12 @@ typedef struct hv_vmbus_channel {
 #define VMBUS_CHAN_ST_OPENED_SHIFT 0
 #define VMBUS_CHAN_ST_OPENED   (1 << VMBUS_CHAN_ST_OPENED_SHIFT)
 
+struct vmbus_softc;
+struct vmbus_message;
+
+void   vmbus_event_proc(struct vmbus_softc *, int);
+void   vmbus_event_proc_compat(struct vmbus_softc *, int);
+void   vmbus_chan_msgproc(struct vmbus_softc *, const struct vmbus_message *);
+void   vmbus_chan_destroy_all(struct vmbus_softc *);
+
 #endif /* !_VMBUS_CHANVAR_H_ */

Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_var.h   Thu Jul 21 05:38:05 2016
(r303128)
+++ head/sys/dev/hyperv/vmbus/vmbus_var.h   Thu Jul 21 05:46:26 2016
(r303129)
@@ -143,16 +143,11 @@ struct trapframe;
 struct vmbus_message;
 struct vmbus_msghc;
 
-void   vmbus_event_proc(struct vmbus_softc *, int);
-void   vmbus_event_proc_compat(struct vmbus_softc *, int);
 void   vmbus_handle_intr(struct trapframe *);
 intvmbus_add_child(struct hv_vmbus_channel *);
 intvmbus_delete_child(struct hv_vmbus_channel *);
-
 void   vmbus_et_intr(struct trapframe *);
-
-void   vmbus_chan_msgproc(struct vmbus_softc *, const struct vmbus_message *);
-void   vmbus_chan_destroy_all(struct vmbus_softc *);
+uint32_t 

svn commit: r303128 - head/sys/dev/hyperv/vmbus

2016-07-20 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 21 05:38:05 2016
New Revision: 303128
URL: https://svnweb.freebsd.org/changeset/base/303128

Log:
  hyperv/vmbus: Reorder channel fields.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7258

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_chan.c
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Jul 21 05:30:31 2016
(r303127)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Jul 21 05:38:05 2016
(r303128)
@@ -83,7 +83,7 @@ static __inline void
 vmbus_chan_signal_tx(const struct hv_vmbus_channel *chan)
 {
atomic_set_long(chan->ch_evtflag, chan->ch_evtflag_mask);
-   if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF)
+   if (chan->ch_txflags & VMBUS_CHAN_TXF_HASMNF)
atomic_set_int(chan->ch_montrig, chan->ch_montrig_mask);
else
hypercall_signal_event(chan->ch_monprm_dma.hv_paddr);
@@ -95,7 +95,7 @@ vmbus_chan_sysctl_mnf(SYSCTL_HANDLER_ARG
struct hv_vmbus_channel *chan = arg1;
int mnf = 0;
 
-   if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF)
+   if (chan->ch_txflags & VMBUS_CHAN_TXF_HASMNF)
mnf = 1;
return sysctl_handle_int(oidp, , 0, req);
 }
@@ -1102,7 +1102,7 @@ vmbus_chan_msgproc_choffer(struct vmbus_
/*
 * Setup MNF stuffs.
 */
-   chan->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
+   chan->ch_txflags |= VMBUS_CHAN_TXF_HASMNF;
 
trig_idx = offer->chm_montrig / VMBUS_MONTRIG_LEN;
if (trig_idx >= VMBUS_MONTRIGS_MAX)

Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Jul 21 05:30:31 2016
(r303127)
+++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Jul 21 05:38:05 2016
(r303128)
@@ -71,42 +71,63 @@ typedef struct {
 } hv_vmbus_ring_buffer_info;
 
 typedef struct hv_vmbus_channel {
-   device_tch_dev;
-   struct vmbus_softc  *ch_vmbus;
+   /*
+* NOTE:
+* Fields before ch_txbr are only accessed on this channel's
+* target CPU.
+*/
uint32_tch_flags;   /* VMBUS_CHAN_FLAG_ */
-   uint32_tch_id;  /* channel id */
+
+   /*
+* RX bufring; immediately following ch_txbr.
+*/
+   hv_vmbus_ring_buffer_info   ch_rxbr;
+
+   struct taskqueue*ch_tq;
+   struct task ch_task;
+   vmbus_chan_callback_t   ch_cb;
+   void*ch_cbarg;
+
+   /*
+* TX bufring; at the beginning of ch_bufring.
+*
+* NOTE:
+* Put TX bufring and the following MNF/evtflag to a new
+* cacheline, since they will be accessed on all CPUs by
+* locking ch_txbr first.
+*
+* XXX
+* TX bufring and following MNF/evtflags do _not_ fit in
+* one 64B cacheline.
+*/
+   hv_vmbus_ring_buffer_info   ch_txbr __aligned(CACHE_LINE_SIZE);
+   uint32_tch_txflags; /* VMBUS_CHAN_TXF_ */
 
/*
 * These are based on the vmbus_chanmsg_choffer.chm_montrig.
 * Save it here for easy access.
 */
-   volatile uint32_t   *ch_montrig;/* MNF trigger loc. */
uint32_tch_montrig_mask;/* MNF trig mask */
+   volatile uint32_t   *ch_montrig;/* MNF trigger loc. */
 
/*
 * These are based on the vmbus_chanmsg_choffer.chm_chanid.
 * Save it here for easy access.
 */
-   volatile u_long *ch_evtflag;/* event flag loc. */
u_long  ch_evtflag_mask;/* event flag */
+   volatile u_long *ch_evtflag;/* event flag loc. */
 
/*
-* TX bufring; at the beginning of ch_bufring.
-*/
-   hv_vmbus_ring_buffer_info   ch_txbr;
-   /*
-* RX bufring; immediately following ch_txbr.
+* Rarely used fields.
 */
-   hv_vmbus_ring_buffer_info   ch_rxbr;
-
-   struct taskqueue*ch_tq;
-   struct task ch_task;
-   vmbus_chan_callback_t   ch_cb;
-   void*ch_cbarg;
 
struct hyperv_mon_param *ch_monprm;
struct hyperv_dma   ch_monprm_dma;
 
+   uint32_tch_id;  /* channel id */
+   device_tch_dev;
+   struct vmbus_softc  *ch_vmbus;
+

svn commit: r303127 - head/sys/dev/hyperv/vmbus

2016-07-20 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 21 05:30:31 2016
New Revision: 303127
URL: https://svnweb.freebsd.org/changeset/base/303127

Log:
  hyperv/vmbus: Save event flag location and evet flag mask.
  
  This avoids unnecessary access to the vmbus_softc struct on sending path.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7257

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_chan.c
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Jul 21 03:11:39 2016
(r303126)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Jul 21 05:30:31 2016
(r303127)
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static voidvmbus_chan_signal_tx(struct hv_vmbus_channel *chan);
 static voidvmbus_chan_update_evtflagcnt(struct vmbus_softc *,
const struct hv_vmbus_channel *);
 
@@ -77,18 +76,13 @@ vmbus_chan_msgprocs[VMBUS_CHANMSG_TYPE_M
VMBUS_CHANMSG_PROC_WAKEUP(GPADL_DISCONNRESP)
 };
 
-/**
- *  @brief Trigger an event notification on the specified channel
+/*
+ * Notify host that there are data pending on our TX bufring.
  */
-static void
-vmbus_chan_signal_tx(struct hv_vmbus_channel *chan)
+static __inline void
+vmbus_chan_signal_tx(const struct hv_vmbus_channel *chan)
 {
-   struct vmbus_softc *sc = chan->ch_vmbus;
-   uint32_t chanid = chan->ch_id;
-
-   atomic_set_long(>vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
-   1UL << (chanid & VMBUS_EVTFLAG_MASK));
-
+   atomic_set_long(chan->ch_evtflag, chan->ch_evtflag_mask);
if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF)
atomic_set_int(chan->ch_montrig, chan->ch_montrig_mask);
else
@@ -1120,6 +1114,13 @@ vmbus_chan_msgproc_choffer(struct vmbus_
1 << (offer->chm_montrig % VMBUS_MONTRIG_LEN);
}
 
+   /*
+* Setup event flag.
+*/
+   chan->ch_evtflag =
+   >vmbus_tx_evtflags[chan->ch_id >> VMBUS_EVTFLAG_SHIFT];
+   chan->ch_evtflag_mask = 1UL << (chan->ch_id & VMBUS_EVTFLAG_MASK);
+
/* Select default cpu for this channel. */
vmbus_chan_cpu_default(chan);
 

Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Jul 21 03:11:39 2016
(r303126)
+++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Jul 21 05:30:31 2016
(r303127)
@@ -77,13 +77,20 @@ typedef struct hv_vmbus_channel {
uint32_tch_id;  /* channel id */
 
/*
-* These are based on the offer_msg.monitor_id.
+* These are based on the vmbus_chanmsg_choffer.chm_montrig.
 * Save it here for easy access.
 */
-   volatile uint32_t   *ch_montrig;/* MNF trigger */
+   volatile uint32_t   *ch_montrig;/* MNF trigger loc. */
uint32_tch_montrig_mask;/* MNF trig mask */
 
/*
+* These are based on the vmbus_chanmsg_choffer.chm_chanid.
+* Save it here for easy access.
+*/
+   volatile u_long *ch_evtflag;/* event flag loc. */
+   u_long  ch_evtflag_mask;/* event flag */
+
+   /*
 * TX bufring; at the beginning of ch_bufring.
 */
hv_vmbus_ring_buffer_info   ch_txbr;
___
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: r303125 - head/sys/cam/nvme

2016-07-20 Thread Warner Losh
Author: imp
Date: Thu Jul 21 03:11:37 2016
New Revision: 303125
URL: https://svnweb.freebsd.org/changeset/base/303125

Log:
  Remove some bogus comments and printfs. Also, we can't
  cam_periph_releaes_locked() at the end of nvme_probe_start because we
  hit an assertion which may be bogus. Instead, leak a periph until we
  sort it out. Since these devices don't arrive and depart often, so
  this is the lessor of two evils.
  
  MFC after: 1 week

Modified:
  head/sys/cam/nvme/nvme_xpt.c

Modified: head/sys/cam/nvme/nvme_xpt.c
==
--- head/sys/cam/nvme/nvme_xpt.cThu Jul 21 03:11:36 2016
(r303124)
+++ head/sys/cam/nvme/nvme_xpt.cThu Jul 21 03:11:37 2016
(r303125)
@@ -163,13 +163,14 @@ static struct xpt_xport nvme_xport = {
 struct xpt_xport *
 nvme_get_xport(void)
 {
+
return (_xport);
 }
 
 static void
 nvme_probe_periph_init()
 {
-   printf("nvme cam probe device init\n");
+
 }
 
 static cam_status
@@ -297,18 +298,15 @@ nvme_probe_start(struct cam_periph *peri
start_ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(start_ccb);
}
-// XXX not sure I need this
-// XXX unlike other XPTs, we never freeze the queue since we have a 
super-simple
-// XXX state machine
-   /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. -- did we really 
do this? */
-// cam_release_devq(path, 0, 0, 0, FALSE);
cam_periph_invalidate(periph);
-   cam_periph_release_locked(periph);
+   /* Can't release periph since we hit a (possibly bogus) assertion */
+// cam_periph_release_locked(periph);
 }
 
 static void
 nvme_probe_cleanup(struct cam_periph *periph)
 {
+
free(periph->softc, M_CAMXPT);
 }
 
___
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: r303124 - head/sys/cam

2016-07-20 Thread Warner Losh
Author: imp
Date: Thu Jul 21 03:11:36 2016
New Revision: 303124
URL: https://svnweb.freebsd.org/changeset/base/303124

Log:
  Fix mismerge and add NVME xport support to devstat (or rather, exclude
  it from SCSI).
  
  MFC after: 1 week

Modified:
  head/sys/cam/cam_ccb.h

Modified: head/sys/cam/cam_ccb.h
==
--- head/sys/cam/cam_ccb.h  Thu Jul 21 03:11:35 2016(r303123)
+++ head/sys/cam/cam_ccb.h  Thu Jul 21 03:11:36 2016(r303124)
@@ -285,10 +285,11 @@ typedef enum {
XPORT_NVME, /* NVMe over PCIe */
 } cam_xport;
 
+#define XPORT_IS_NVME(t)   ((t) == XPORT_NVME)
 #define XPORT_IS_ATA(t)((t) == XPORT_ATA || (t) == XPORT_SATA)
 #define XPORT_IS_SCSI(t)   ((t) != XPORT_UNKNOWN && \
 (t) != XPORT_UNSPECIFIED && \
-!XPORT_IS_ATA(t))
+!XPORT_IS_ATA(t) && !XPORT_IS_NVME(t))
 #define XPORT_DEVSTAT_TYPE(t)  (XPORT_IS_ATA(t) ? DEVSTAT_TYPE_IF_IDE : \
 XPORT_IS_SCSI(t) ? DEVSTAT_TYPE_IF_SCSI : \
 DEVSTAT_TYPE_IF_OTHER)
___
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: r303126 - head/sys/dev/nvme

2016-07-20 Thread Warner Losh
Author: imp
Date: Thu Jul 21 03:11:39 2016
New Revision: 303126
URL: https://svnweb.freebsd.org/changeset/base/303126

Log:
  Actually import nvme_sim so the CAM attachment for NVME (nda) actually
  works.
  
  MFC after: 1 week

Added:
  head/sys/dev/nvme/nvme_sim.c   (contents, props changed)
Modified:
  head/sys/dev/nvme/nvme_private.h

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hThu Jul 21 03:11:37 2016
(r303125)
+++ head/sys/dev/nvme/nvme_private.hThu Jul 21 03:11:39 2016
(r303126)
@@ -245,10 +245,6 @@ struct nvme_controller {
 
struct mtx  lock;
 
-   struct cam_sim  *sim;
-   struct cam_path *path;
-   int cam_ref;
-
uint32_tready_timeout_in_ms;
 
bus_space_tag_t bus_tag;

Added: head/sys/dev/nvme/nvme_sim.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/nvme/nvme_sim.cThu Jul 21 03:11:39 2016
(r303126)
@@ -0,0 +1,400 @@
+/*-
+ * Copyright (c) 2016 Netflix, Inc
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer,
+ *without modification, immediately at the beginning of the file.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include   // Yes, this is wrong.
+#include 
+
+#include "nvme_private.h"
+
+#define ccb_accb_ptr spriv_ptr0
+#define ccb_ctrlr_ptr spriv_ptr1
+static voidnvme_sim_action(struct cam_sim *sim, union ccb *ccb);
+static voidnvme_sim_poll(struct cam_sim *sim);
+
+#define sim2softc(sim) ((struct nvme_sim_softc *)cam_sim_softc(sim))
+#define sim2ns(sim)(sim2softc(sim)->s_ns)
+#define sim2ctrlr(sim) (sim2softc(sim)->s_ctrlr)
+
+struct nvme_sim_softc
+{
+   struct nvme_controller  *s_ctrlr;
+   struct nvme_namespace   *s_ns;
+   struct cam_sim  *s_sim;
+   struct cam_path *s_path;
+};
+
+static void
+nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_completion *cpl)
+{
+   union ccb *ccb = (union ccb *)ccb_arg;
+
+   /*
+* Let the periph know the completion, and let it sort out what
+* it means. Make our best guess, though for the status code.
+*/
+   memcpy(>nvmeio.cpl, cpl, sizeof(*cpl));
+   if (nvme_completion_is_error(cpl))
+   ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+   else
+   ccb->ccb_h.status = CAM_REQ_CMP;
+   xpt_done(ccb);
+}
+
+static void
+nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb)
+{
+   struct ccb_nvmeio   *nvmeio = >nvmeio;
+   struct nvme_request *req;
+   void*payload;
+   uint32_tsize;
+   struct nvme_controller *ctrlr;
+
+   ctrlr = sim2ctrlr(sim);
+   payload = nvmeio->data_ptr;
+   size = nvmeio->dxfer_len;
+   /* SG LIST ??? */
+   if ((nvmeio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO)
+   req = nvme_allocate_request_bio((struct bio *)payload,
+   nvme_sim_nvmeio_done, ccb);
+   else if (payload == NULL)
+   req = nvme_allocate_request_null(nvme_sim_nvmeio_done, ccb);
+   else
+   req = nvme_allocate_request_vaddr(payload, size,
+   nvme_sim_nvmeio_done, ccb);
+
+   if (req == NULL) {
+   nvmeio->ccb_h.status = CAM_RESRC_UNAVAIL;
+   xpt_done(ccb);
+   return;
+   }
+
+   memcpy(>cmd, 

svn commit: r303123 - head/sys/cam

2016-07-20 Thread Warner Losh
Author: imp
Date: Thu Jul 21 03:11:35 2016
New Revision: 303123
URL: https://svnweb.freebsd.org/changeset/base/303123

Log:
  Fix mismerge and include the nvme support.
  Also, print out the name of any CCB's functions that's not supported.
  
  MFC after: 1 week

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Thu Jul 21 00:53:14 2016(r303122)
+++ head/sys/cam/cam_xpt.c  Thu Jul 21 03:11:35 2016(r303123)
@@ -1033,6 +1033,8 @@ xpt_announce_periph(struct cam_periph *p
else if (path->device->protocol == PROTO_SEMB)
semb_print_ident(
(struct sep_identify_data *)>device->ident_data);
+   else if (path->device->protocol == PROTO_NVME)
+   nvme_print_ident(path->device->nvme_cdata, 
path->device->nvme_data);
else
printf("Unknown protocol device\n");
if (path->device->serial_num_len > 0) {
@@ -1086,6 +1088,8 @@ xpt_denounce_periph(struct cam_periph *p
else if (path->device->protocol == PROTO_SEMB)
semb_print_ident_short(
(struct sep_identify_data *)>device->ident_data);
+   else if (path->device->protocol == PROTO_NVME)
+   nvme_print_ident(path->device->nvme_cdata, 
path->device->nvme_data);
else
printf("Unknown protocol device");
if (path->device->serial_num_len > 0)
@@ -2516,6 +2520,10 @@ xpt_action_default(union ccb *start_ccb)
if (start_ccb->ccb_h.func_code == XPT_ATA_IO)
start_ccb->ataio.resid = 0;
/* FALLTHROUGH */
+   case XPT_NVME_IO:
+   if (start_ccb->ccb_h.func_code == XPT_NVME_IO)
+   start_ccb->nvmeio.resid = 0;
+   /* FALLTHROUGH */
case XPT_RESET_DEV:
case XPT_ENG_EXEC:
case XPT_SMP_IO:
@@ -2655,6 +2663,8 @@ call_sim:
cgd->inq_data = dev->inq_data;
cgd->ident_data = dev->ident_data;
cgd->inq_flags = dev->inq_flags;
+   cgd->nvme_data = dev->nvme_data;
+   cgd->nvme_cdata = dev->nvme_cdata;
cgd->ccb_h.status = CAM_REQ_CMP;
cgd->serial_num_len = dev->serial_num_len;
if ((dev->serial_num_len > 0)
@@ -3011,8 +3021,10 @@ call_sim:
case XPT_TERM_IO:
case XPT_ENG_INQ:
/* XXX Implement */
-   printf("%s: CCB type %#x not supported\n", __func__,
-  start_ccb->ccb_h.func_code);
+   xpt_print_path(start_ccb->ccb_h.path);
+   printf("%s: CCB type %#x %s not supported\n", __func__,
+   start_ccb->ccb_h.func_code,
+   xpt_action_name(start_ccb->ccb_h.func_code));
start_ccb->ccb_h.status = CAM_PROVIDE_FAIL;
if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) {
xpt_done(start_ccb);
@@ -3315,6 +3327,13 @@ xpt_run_devq(struct cam_devq *devq)
 ata_cmd_string(_ccb->ataio.cmd,
cdb_str, sizeof(cdb_str;
break;
+   case XPT_NVME_IO:
+   CAM_DEBUG(work_ccb->ccb_h.path,
+   CAM_DEBUG_CDB,("%s. NCB: %s\n",
+nvme_op_string(_ccb->nvmeio.cmd),
+nvme_cmd_string(_ccb->nvmeio.cmd,
+   cdb_str, sizeof(cdb_str;
+   break;
default:
break;
}
@@ -3904,6 +3923,9 @@ xpt_bus_register(struct cam_sim *sim, de
case XPORT_SATA:
new_bus->xport = ata_get_xport();
break;
+   case XPORT_NVME:
+   new_bus->xport = nvme_get_xport();
+   break;
default:
new_bus->xport = _default;
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303120 - head/sys/kern

2016-07-20 Thread Conrad Meyer
Sure — r303122.

Conrad

On Wed, Jul 20, 2016 at 4:09 PM, John Baldwin  wrote:
> On Wednesday, July 20, 2016 10:51:33 PM Conrad E. Meyer wrote:
>> Author: cem
>> Date: Wed Jul 20 22:51:33 2016
>> New Revision: 303120
>> URL: https://svnweb.freebsd.org/changeset/base/303120
>>
>> Log:
>>   imgact_elf: Rename the segment iterator to match reality
>>
>>   The each_writable_segment routine evaluates segments on a slightly little 
>> more
>>   nuanced metric than simply "writable" or not.  Rename the function to more
>>   closely match its behavior (each_dumpable_segment).
>>
>>   Suggested by:   jhb
>>   Sponsored by:   EMC / Isilon Storage Division
>
> Please do the same rename in gcore's elfcore.c as well.
>
> --
> John Baldwin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r303122 - head/usr.bin/gcore

2016-07-20 Thread Conrad E. Meyer
Author: cem
Date: Thu Jul 21 00:53:14 2016
New Revision: 303122
URL: https://svnweb.freebsd.org/changeset/base/303122

Log:
  Mirror r303120 to gcore
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.bin/gcore/elfcore.c

Modified: head/usr.bin/gcore/elfcore.c
==
--- head/usr.bin/gcore/elfcore.cThu Jul 21 00:52:53 2016
(r303121)
+++ head/usr.bin/gcore/elfcore.cThu Jul 21 00:53:14 2016
(r303122)
@@ -95,7 +95,7 @@ typedef void* (*notefunc_t)(void *, size
 
 static void cb_put_phdr(vm_map_entry_t, void *);
 static void cb_size_segment(vm_map_entry_t, void *);
-static void each_writable_segment(vm_map_entry_t, segment_callback,
+static void each_dumpable_segment(vm_map_entry_t, segment_callback,
 void *closure);
 static void elf_detach(void);  /* atexit() handler. */
 static void *elf_note_fpregset(void *, size_t *);
@@ -206,7 +206,7 @@ elf_coredump(int efd __unused, int fd, p
/* Size the program segments. */
seginfo.count = 0;
seginfo.size = 0;
-   each_writable_segment(map, cb_size_segment, );
+   each_dumpable_segment(map, cb_size_segment, );
 
/*
 * Build the header and the notes using sbuf and write to the file.
@@ -277,7 +277,7 @@ elf_coredump(int efd __unused, int fd, p
 }
 
 /*
- * A callback for each_writable_segment() to write out the segment's
+ * A callback for each_dumpable_segment() to write out the segment's
  * program header entry.
  */
 static void
@@ -307,7 +307,7 @@ cb_put_phdr(vm_map_entry_t entry, void *
 }
 
 /*
- * A callback for each_writable_segment() to gather information about
+ * A callback for each_dumpable_segment() to gather information about
  * the number of segments and their total size.
  */
 static void
@@ -325,7 +325,7 @@ cb_size_segment(vm_map_entry_t entry, vo
  * data.
  */
 static void
-each_writable_segment(vm_map_entry_t map, segment_callback func, void *closure)
+each_dumpable_segment(vm_map_entry_t map, segment_callback func, void *closure)
 {
vm_map_entry_t entry;
 
@@ -497,7 +497,7 @@ elf_puthdr(pid_t pid, vm_map_entry_t map
/* All the writable segments from the program. */
phc.phdr = phdr;
phc.offset = segoff;
-   each_writable_segment(map, cb_put_phdr, );
+   each_dumpable_segment(map, cb_put_phdr, );
 }
 
 /*
___
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: r303121 - stable/10/release

2016-07-20 Thread Glen Barber
Author: gjb
Date: Thu Jul 21 00:52:53 2016
New Revision: 303121
URL: https://svnweb.freebsd.org/changeset/base/303121

Log:
  MFC r303003:
  
   Make sure we clean up the rdoc and reldoc directories if NODOC
   is not set.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/release/Makefile
==
--- stable/10/release/Makefile  Wed Jul 20 22:51:33 2016(r303120)
+++ stable/10/release/Makefile  Thu Jul 21 00:52:53 2016(r303121)
@@ -137,6 +137,9 @@ CLEANFILES+=${I}.xz
 CLEANFILES+=   pkg-stage
 .endif
 CLEANDIRS= dist ftp disc1 bootonly dvd
+.if !defined(NODOC)
+CLEANDIRS+=reldoc rdoc
+.endif
 beforeclean:
chflags -R noschg .
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303043 - in head: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb

2016-07-20 Thread Kubilay Kocak
On 21/07/2016 5:07 AM, Bryan Drewery wrote:
> On 7/20/16 8:20 AM, Conrad Meyer wrote:
>> On Wed, Jul 20, 2016 at 12:44 AM, Kubilay Kocak  wrote:
>>> On 20/07/2016 5:20 AM, Conrad E. Meyer wrote:
 Author: cem
 Date: Tue Jul 19 19:20:47 2016
 New Revision: 303043
 URL: https://svnweb.freebsd.org/changeset/base/303043

 Log:
   Increase vt(4) framebuffer maximum size

   And rename "DEFAULT" constants to the more accurate "MAX."

   PR: 210382
   Submitted by:   Felix 
   Reviewed by:wblock, cem
   Tested by:  Dave Cottlehuber 
>>>
>>> Can MFC?
>>>
>>> There are high hopes for this coming out in 11.0 / next 10.x
>>>
>>> re is cc'd on the original bugzilla issue
>>
>> If you would like to do so, please go ahead.
>>
>> Best,
>> Conrad
>>
> 
> I'll handle it after it's been in for a week.
> 

Thank you Bryan

./koobs
___
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: r303120 - head/sys/kern

2016-07-20 Thread John Baldwin
On Wednesday, July 20, 2016 10:51:33 PM Conrad E. Meyer wrote:
> Author: cem
> Date: Wed Jul 20 22:51:33 2016
> New Revision: 303120
> URL: https://svnweb.freebsd.org/changeset/base/303120
> 
> Log:
>   imgact_elf: Rename the segment iterator to match reality
>   
>   The each_writable_segment routine evaluates segments on a slightly little 
> more
>   nuanced metric than simply "writable" or not.  Rename the function to more
>   closely match its behavior (each_dumpable_segment).
>   
>   Suggested by:   jhb
>   Sponsored by:   EMC / Isilon Storage Division

Please do the same rename in gcore's elfcore.c as well.

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


svn commit: r303120 - head/sys/kern

2016-07-20 Thread Conrad E. Meyer
Author: cem
Date: Wed Jul 20 22:51:33 2016
New Revision: 303120
URL: https://svnweb.freebsd.org/changeset/base/303120

Log:
  imgact_elf: Rename the segment iterator to match reality
  
  The each_writable_segment routine evaluates segments on a slightly little more
  nuanced metric than simply "writable" or not.  Rename the function to more
  closely match its behavior (each_dumpable_segment).
  
  Suggested by: jhb
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Jul 20 22:49:33 2016(r303119)
+++ head/sys/kern/imgact_elf.c  Wed Jul 20 22:51:33 2016(r303120)
@@ -1163,7 +1163,7 @@ static void cb_put_phdr(vm_map_entry_t, 
 static void cb_size_segment(vm_map_entry_t, void *);
 static int core_write(struct coredump_params *, void *, size_t, off_t,
 enum uio_seg);
-static void each_writable_segment(struct thread *, segment_callback, void *);
+static void each_dumpable_segment(struct thread *, segment_callback, void *);
 static int __elfN(corehdr)(struct coredump_params *, int, void *, size_t,
 struct note_info_list *, size_t);
 static void __elfN(prepare_notes)(struct thread *, struct note_info_list *,
@@ -1317,7 +1317,7 @@ __elfN(coredump)(struct thread *td, stru
/* Size the program segments. */
seginfo.count = 0;
seginfo.size = 0;
-   each_writable_segment(td, cb_size_segment, );
+   each_dumpable_segment(td, cb_size_segment, );
 
/*
 * Collect info about the core file header area.
@@ -1419,7 +1419,7 @@ done:
 }
 
 /*
- * A callback for each_writable_segment() to write out the segment's
+ * A callback for each_dumpable_segment() to write out the segment's
  * program header entry.
  */
 static void
@@ -1445,7 +1445,7 @@ cb_put_phdr(entry, closure)
 }
 
 /*
- * A callback for each_writable_segment() to gather information about
+ * A callback for each_dumpable_segment() to gather information about
  * the number of segments and their total size.
  */
 static void
@@ -1463,7 +1463,7 @@ cb_size_segment(vm_map_entry_t entry, vo
  * caller-supplied data.
  */
 static void
-each_writable_segment(struct thread *td, segment_callback func, void *closure)
+each_dumpable_segment(struct thread *td, segment_callback func, void *closure)
 {
struct proc *p = td->td_proc;
vm_map_t map = >p_vmspace->vm_map;
@@ -1694,7 +1694,7 @@ __elfN(puthdr)(struct thread *td, void *
/* All the writable segments from the program. */
phc.phdr = phdr;
phc.offset = round_page(hdrsize + notesz);
-   each_writable_segment(td, cb_put_phdr, );
+   each_dumpable_segment(td, cb_put_phdr, );
 }
 
 static size_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303119 - head/release/tools

2016-07-20 Thread Glen Barber
Author: gjb
Date: Wed Jul 20 22:49:33 2016
New Revision: 303119
URL: https://svnweb.freebsd.org/changeset/base/303119

Log:
  Create a /usr/home -> /home symlink for the arm images to
  avoid /usr/home confusingly being created as a directory.
  
  Reported by:  Russell Haley
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Wed Jul 20 22:46:56 2016(r303118)
+++ head/release/tools/arm.subr Wed Jul 20 22:49:33 2016(r303119)
@@ -88,6 +88,7 @@ arm_create_user() {
-c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh'
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
usermod root -w yes
+   chroot ${CHROOTDIR} ln -s /home ${DESTDIR}/usr/home
 
return 0
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303118 - head/sys/kern

2016-07-20 Thread Conrad E. Meyer
Author: cem
Date: Wed Jul 20 22:46:56 2016
New Revision: 303118
URL: https://svnweb.freebsd.org/changeset/base/303118

Log:
  ANSI-fy imgact_elf.c
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Jul 20 22:32:19 2016(r303117)
+++ head/sys/kern/imgact_elf.c  Wed Jul 20 22:46:56 2016(r303118)
@@ -1449,9 +1449,7 @@ cb_put_phdr(entry, closure)
  * the number of segments and their total size.
  */
 static void
-cb_size_segment(entry, closure)
-   vm_map_entry_t entry;
-   void *closure;
+cb_size_segment(vm_map_entry_t entry, void *closure)
 {
struct sseg_closure *ssc = (struct sseg_closure *)closure;
 
@@ -1465,10 +1463,7 @@ cb_size_segment(entry, closure)
  * caller-supplied data.
  */
 static void
-each_writable_segment(td, func, closure)
-   struct thread *td;
-   segment_callback func;
-   void *closure;
+each_writable_segment(struct thread *td, segment_callback func, void *closure)
 {
struct proc *p = td->td_proc;
vm_map_t map = >p_vmspace->vm_map;
___
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: r303117 - stable/10/sys/dev/e1000

2016-07-20 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 20 22:32:19 2016
New Revision: 303117
URL: https://svnweb.freebsd.org/changeset/base/303117

Log:
  Fix lem(4) build after r303107
  
  Submitted by: Jason Wolfe 

Modified:
  stable/10/sys/dev/e1000/if_lem.c

Modified: stable/10/sys/dev/e1000/if_lem.c
==
--- stable/10/sys/dev/e1000/if_lem.cWed Jul 20 22:28:26 2016
(r303116)
+++ stable/10/sys/dev/e1000/if_lem.cWed Jul 20 22:32:19 2016
(r303117)
@@ -1047,7 +1047,7 @@ lem_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303116 - stable/10/sys/dev/e1000

2016-07-20 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 20 22:28:26 2016
New Revision: 303116
URL: https://svnweb.freebsd.org/changeset/base/303116

Log:
  Fix em(4) build after r303107
  
  Reported by:  Jason Wolf 

Modified:
  stable/10/sys/dev/e1000/if_em.c

Modified: stable/10/sys/dev/e1000/if_em.c
==
--- stable/10/sys/dev/e1000/if_em.c Wed Jul 20 22:05:44 2016
(r303115)
+++ stable/10/sys/dev/e1000/if_em.c Wed Jul 20 22:28:26 2016
(r303116)
@@ -1220,7 +1220,7 @@ em_ioctl(struct ifnet *ifp, u_long comma
ifp->if_mtu = ifr->ifr_mtu;
adapter->hw.mac.max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
em_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303114 - head/usr.bin/gcore

2016-07-20 Thread Conrad E. Meyer
Author: cem
Date: Wed Jul 20 22:03:45 2016
New Revision: 303114
URL: https://svnweb.freebsd.org/changeset/base/303114

Log:
  Add extended segment support to gcore
  
  A follow-up to r303099, D7255.  Basically, apply the exact same change, with
  the exact same rationale, to gcore.  gcore's elfcore.c is largely a clone of
  the kernel imgact_elf coredump facility.
  
  Reviewed by:  emaste (earlier version, not substantially different)
  Requested by: jhb
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D7265

Modified:
  head/usr.bin/gcore/elfcore.c

Modified: head/usr.bin/gcore/elfcore.c
==
--- head/usr.bin/gcore/elfcore.cWed Jul 20 20:18:52 2016
(r303113)
+++ head/usr.bin/gcore/elfcore.cWed Jul 20 22:03:45 2016
(r303114)
@@ -213,6 +213,8 @@ elf_coredump(int efd __unused, int fd, p
 */
sb = sbuf_new_auto();
hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count);
+   if (seginfo.count + 1 >= PN_XNUM)
+   hdrsize += sizeof(Elf_Shdr);
/* Start header + notes section. */
sbuf_start_section(sb, NULL);
/* Make empty header subsection. */
@@ -423,10 +425,10 @@ elf_puthdr(pid_t pid, vm_map_entry_t map
 {
Elf_Ehdr *ehdr;
Elf_Phdr *phdr;
+   Elf_Shdr *shdr;
struct phdr_closure phc;
 
ehdr = (Elf_Ehdr *)hdr;
-   phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr));
 
ehdr->e_ident[EI_MAG0] = ELFMAG0;
ehdr->e_ident[EI_MAG1] = ELFMAG1;
@@ -446,14 +448,40 @@ elf_puthdr(pid_t pid, vm_map_entry_t map
ehdr->e_flags = 0;
ehdr->e_ehsize = sizeof(Elf_Ehdr);
ehdr->e_phentsize = sizeof(Elf_Phdr);
-   ehdr->e_phnum = numsegs + 1;
ehdr->e_shentsize = sizeof(Elf_Shdr);
-   ehdr->e_shnum = 0;
ehdr->e_shstrndx = SHN_UNDEF;
+   if (numsegs + 1 < PN_XNUM) {
+   ehdr->e_phnum = numsegs + 1;
+   ehdr->e_shnum = 0;
+   } else {
+   ehdr->e_phnum = PN_XNUM;
+   ehdr->e_shnum = 1;
+
+   ehdr->e_shoff = ehdr->e_phoff +
+   (numsegs + 1) * ehdr->e_phentsize;
+
+   shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff);
+   memset(shdr, 0, sizeof(*shdr));
+   /*
+* A special first section is used to hold large segment and
+* section counts.  This was proposed by Sun Microsystems in
+* Solaris and has been adopted by Linux; the standard ELF
+* tools are already familiar with the technique.
+*
+* See table 7-7 of the Solaris "Linker and Libraries Guide"
+* (or 12-7 depending on the version of the document) for more
+* details.
+*/
+   shdr->sh_type = SHT_NULL;
+   shdr->sh_size = ehdr->e_shnum;
+   shdr->sh_link = ehdr->e_shstrndx;
+   shdr->sh_info = numsegs + 1;
+   }
 
/*
 * Fill in the program header entries.
 */
+   phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff);
 
/* The note segement. */
phdr->p_type = PT_NOTE;
___
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: r303113 - head/share/man/man4

2016-07-20 Thread Alexander Motin
Author: mav
Date: Wed Jul 20 20:18:52 2016
New Revision: 303113
URL: https://svnweb.freebsd.org/changeset/base/303113

Log:
  Cross-link some SMBus controller drivers man pages.
  
  Some compatibility cases are not obvious.

Modified:
  head/share/man/man4/amdpm.4
  head/share/man/man4/amdsmb.4
  head/share/man/man4/ichsmb.4
  head/share/man/man4/intpm.4
  head/share/man/man4/ismt.4

Modified: head/share/man/man4/amdpm.4
==
--- head/share/man/man4/amdpm.4 Wed Jul 20 20:12:58 2016(r303112)
+++ head/share/man/man4/amdpm.4 Wed Jul 20 20:18:52 2016(r303113)
@@ -51,6 +51,7 @@ for writing user code to fetch voltages,
 monitoring chip of your mainboard.
 .Sh SEE ALSO
 .Xr amdsmb 4 ,
+.Xr intpm 4 ,
 .Xr smb 4 ,
 .Xr smbus 4
 .Sh HISTORY

Modified: head/share/man/man4/amdsmb.4
==
--- head/share/man/man4/amdsmb.4Wed Jul 20 20:12:58 2016
(r303112)
+++ head/share/man/man4/amdsmb.4Wed Jul 20 20:18:52 2016
(r303113)
@@ -31,6 +31,7 @@
 .Nm amdsmb
 .Nd "AMD-8111 SMBus 2.0 controller driver"
 .Sh SYNOPSIS
+.Cd "device pci"
 .Cd "device smbus"
 .Cd "device smb"
 .Cd "device amdsmb"
@@ -39,6 +40,8 @@ The
 .Nm
 driver provides access to the AMD-8111 SMBus 2.0 controller.
 .Sh SEE ALSO
+.Xr amdpm 4 ,
+.Xr intpm 4 ,
 .Xr smb 4 ,
 .Xr smbus 4
 .Sh HISTORY

Modified: head/share/man/man4/ichsmb.4
==
--- head/share/man/man4/ichsmb.4Wed Jul 20 20:12:58 2016
(r303112)
+++ head/share/man/man4/ichsmb.4Wed Jul 20 20:18:52 2016
(r303113)
@@ -53,6 +53,8 @@ driver provides
 support for the SMBus controller logical device contained in all Intel
 motherboard chipsets starting from 82801AA (ICH).
 .Sh SEE ALSO
+.Xr intpm 4 ,
+.Xr ismt 4 ,
 .Xr smb 4 ,
 .Xr smbus 4
 .Sh AUTHORS

Modified: head/share/man/man4/intpm.4
==
--- head/share/man/man4/intpm.4 Wed Jul 20 20:12:58 2016(r303112)
+++ head/share/man/man4/intpm.4 Wed Jul 20 20:18:52 2016(r303113)
@@ -58,6 +58,9 @@ ATI IXP400
 AMD SB600/700/710/750
 .El
 .Sh SEE ALSO
+.Xr amdpm 4 ,
+.Xr amdsmb 4 ,
+.Xr ichsmb 4 ,
 .Xr smb 4 ,
 .Xr smbus 4
 .Sh HISTORY

Modified: head/share/man/man4/ismt.4
==
--- head/share/man/man4/ismt.4  Wed Jul 20 20:12:58 2016(r303112)
+++ head/share/man/man4/ismt.4  Wed Jul 20 20:18:52 2016(r303113)
@@ -48,6 +48,7 @@
 This driver provides access to the SMBus 2.0 controller device contained
 in the Intel Atom S1200 and C2000 CPUs.
 .Sh SEE ALSO
+.Xr ichsmb 4 ,
 .Xr smb 4 ,
 .Xr smbus 4
 .Sh HISTORY
___
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: r303112 - stable/11/lib/libc/locale

2016-07-20 Thread Baptiste Daroussin
Author: bapt
Date: Wed Jul 20 20:12:58 2016
New Revision: 303112
URL: https://svnweb.freebsd.org/changeset/base/303112

Log:
  MFC: r302916
  
  Revert 302324 and properly fix the crash with ISO-8859-5 locales
  
  PR:   211135
  Reported by:  jkim
  Tested by:jkim
  Approved by:  re (gjb)

Modified:
  stable/11/lib/libc/locale/collate.c

Modified: stable/11/lib/libc/locale/collate.c
==
--- stable/11/lib/libc/locale/collate.c Wed Jul 20 20:10:37 2016
(r303111)
+++ stable/11/lib/libc/locale/collate.c Wed Jul 20 20:12:58 2016
(r303112)
@@ -310,7 +310,7 @@ _collate_lookup(struct xlocale_collate *
if ((sptr = *state) != NULL) {
*pri = *sptr;
sptr++;
-   if ((sptr == *state) || (*sptr == 0))
+   if ((sptr == *state) || (sptr == NULL))
*state = NULL;
else
*state = sptr;
@@ -451,6 +451,7 @@ _collate_wxfrm(struct xlocale_collate *t
errno = EINVAL;
goto fail;
}
+   state = NULL;
pri = COLLATE_MAX_PRIORITY;
}
if (room) {
@@ -469,6 +470,7 @@ _collate_wxfrm(struct xlocale_collate *t
errno = EINVAL;
goto fail;
}
+   state = NULL;
continue;
}
if (room) {
@@ -597,6 +599,7 @@ _collate_sxfrm(struct xlocale_collate *t
errno = EINVAL;
goto fail;
}
+   state = NULL;
pri = COLLATE_MAX_PRIORITY;
}
 
@@ -622,6 +625,7 @@ _collate_sxfrm(struct xlocale_collate *t
errno = EINVAL;
goto fail;
}
+   state = NULL;
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: r303111 - head/share/man/man4

2016-07-20 Thread Alexander Motin
Author: mav
Date: Wed Jul 20 20:10:37 2016
New Revision: 303111
URL: https://svnweb.freebsd.org/changeset/base/303111

Log:
  Document list of supported chipsets.

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

Modified: head/share/man/man4/intpm.4
==
--- head/share/man/man4/intpm.4 Wed Jul 20 19:21:11 2016(r303110)
+++ head/share/man/man4/intpm.4 Wed Jul 20 20:10:37 2016(r303111)
@@ -24,25 +24,39 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 8, 1999
+.Dd July 20, 2016
 .Dt INTPM 4
 .Os
 .Sh NAME
 .Nm intpm
 .Nd Intel PIIX4 Power Management controller driver
 .Sh SYNOPSIS
+.Cd device pci
 .Cd device smbus
 .Cd device smb
 .Cd device intpm
 .Sh DESCRIPTION
-This driver provides access to
-.Tn Intel PIIX4 PCI Controller function 3 ,
-Power management controller.
-Currently, only smbus controller
-function is implemented.
-But it also have bus idle monitoring function.
-It
-will display mapped I/O address for bus monitoring function when attaching.
+The
+.Nm
+driver provides access to
+.Tn Intel PIIX4
+compatible Power Management controllers.
+Currently, only
+.Xr smbus 4
+controller function is implemented.
+.Sh HARDWARE
+The
+.Nm
+driver supports the following chipsets:
+.Pp
+.Bl -bullet -compact
+.It
+Intel 82371AB/82443MX
+.It
+ATI IXP400
+.It
+AMD SB600/700/710/750
+.El
 .Sh SEE ALSO
 .Xr smb 4 ,
 .Xr smbus 4
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302350 - in head: share/man/man9 sys/kern sys/sys

2016-07-20 Thread Bryan Drewery
On 7/13/16 3:11 AM, Hans Petter Selasky wrote:
> Hi,
> 
> Can we agree on the following return values for callout_stop() and
> callout_reset() and their variants:
> 
> If the callout was scheduled regardless of being serviced or not,
> .Dv CALLOUT_RET_CANCELLED
> is returned.
> If the callout was stopped and is still being serviced
> .Dv CALLOUT_RET_DRAINING
> is returned.
> If the callout was stopped and is no longer being serviced
> .Dv CALLOUT_RET_STOPPED
> is returned.
> 
> --HPS
> 

I won't comment on the specific cases, but I do think we should move to
using enums or macros for these return values and other parts of the KPI.

The callout API is getting very abused lately, since r290664, and there
seems to be a lack of review or consensus around most changes.  Even in
the recent changes, the review brought up several points that were
seemingly ignored, and more that are still being ignored.  The constant
churn and reverts on this API is not acceptable.

-- 
Regards,
Bryan Drewery
___
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: r303110 - head/sys/dev/e1000

2016-07-20 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 20 19:21:11 2016
New Revision: 303110
URL: https://svnweb.freebsd.org/changeset/base/303110

Log:
  Remove uneeded parens.
  
  MFC after:1 day

Modified:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Wed Jul 20 18:41:47 2016(r303109)
+++ head/sys/dev/e1000/if_igb.c Wed Jul 20 19:21:11 2016(r303110)
@@ -1106,7 +1106,7 @@ igb_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;

Modified: head/sys/dev/e1000/if_lem.c
==
--- head/sys/dev/e1000/if_lem.c Wed Jul 20 18:41:47 2016(r303109)
+++ head/sys/dev/e1000/if_lem.c Wed Jul 20 19:21:11 2016(r303110)
@@ -1053,7 +1053,7 @@ lem_ioctl(if_t ifp, u_long command, cadd
if_setmtu(ifp, ifr->ifr_mtu);
adapter->max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303043 - in head: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb

2016-07-20 Thread Bryan Drewery
On 7/20/16 8:20 AM, Conrad Meyer wrote:
> On Wed, Jul 20, 2016 at 12:44 AM, Kubilay Kocak  wrote:
>> On 20/07/2016 5:20 AM, Conrad E. Meyer wrote:
>>> Author: cem
>>> Date: Tue Jul 19 19:20:47 2016
>>> New Revision: 303043
>>> URL: https://svnweb.freebsd.org/changeset/base/303043
>>>
>>> Log:
>>>   Increase vt(4) framebuffer maximum size
>>>
>>>   And rename "DEFAULT" constants to the more accurate "MAX."
>>>
>>>   PR: 210382
>>>   Submitted by:   Felix 
>>>   Reviewed by:wblock, cem
>>>   Tested by:  Dave Cottlehuber 
>>
>> Can MFC?
>>
>> There are high hopes for this coming out in 11.0 / next 10.x
>>
>> re is cc'd on the original bugzilla issue
> 
> If you would like to do so, please go ahead.
> 
> Best,
> Conrad
> 

I'll handle it after it's been in for a week.

-- 
Regards,
Bryan Drewery
___
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: r303109 - head/usr.sbin/crashinfo

2016-07-20 Thread John Baldwin
Author: jhb
Date: Wed Jul 20 18:41:47 2016
New Revision: 303109
URL: https://svnweb.freebsd.org/changeset/base/303109

Log:
  Update crashinfo to work with newer gdb from ports.
  
  If gdb from ports is installed, use it instead of the base system gdb
  to extract variables from a kernel.  Note that base gdb and ports gdb
  do not support the same options for invoking a single command in batch
  mode, so a wrapper shell function is used.  In addition, prefer kgdb
  from ports when generating a backtrace if present.
  
  PR:   193335
  Reviewed by:  emaste
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D7218

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==
--- head/usr.sbin/crashinfo/crashinfo.shWed Jul 20 18:27:42 2016
(r303108)
+++ head/usr.sbin/crashinfo/crashinfo.shWed Jul 20 18:41:47 2016
(r303109)
@@ -35,6 +35,22 @@ usage()
exit 1
 }
 
+# Run a single gdb command against a kernel file in batch mode.
+# The kernel file is specified as the first argument and the command
+# is given in the remaining arguments.
+gdb_command()
+{
+   local k
+
+   k=$1 ; shift
+
+   if [ -x /usr/local/bin/gdb ]; then
+   /usr/local/bin/gdb -batch -ex "$@" $k
+   else
+   echo -e "$@" | /usr/bin/gdb -x /dev/stdin -batch $k
+   fi
+}
+
 find_kernel()
 {
local ivers k kvers
@@ -55,8 +71,8 @@ find_kernel()
 
# Look for a matching kernel version.
for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do
-   kvers=$(echo 'printf "  Version String: %s", version' | \
-   gdb -x /dev/stdin -batch $k 2>/dev/null)
+   kvers=$(gdb_command $k 'printf "  Version String: %s", version' 
\
+2>/dev/null)
if [ "$ivers" = "$kvers" ]; then
KERNEL=$k
break
@@ -151,11 +167,10 @@ echo "Writing crash summary to $FILE."
 umask 077
 
 # Simulate uname
-ostype=$(echo -e printf '"%s", ostype' | gdb -x /dev/stdin -batch $KERNEL)
-osrelease=$(echo -e printf '"%s", osrelease' | gdb -x /dev/stdin -batch 
$KERNEL)
-version=$(echo -e printf '"%s", version' | gdb -x /dev/stdin -batch $KERNEL | \
-tr '\t\n' '  ')
-machine=$(echo -e printf '"%s", machine' | gdb -x /dev/stdin -batch $KERNEL)
+ostype=$(gdb_command $KERNEL 'printf "%s", ostype')
+osrelease=$(gdb_command $KERNEL 'printf "%s", osrelease')
+version=$(gdb_command $KERNEL 'printf "%s", version' | tr '\t\n' '  ')
+machine=$(gdb_command $KERNEL 'printf "%s", machine')
 
 exec > $FILE 2>&1
 
@@ -174,7 +189,11 @@ file=`mktemp /tmp/crashinfo.XX`
 if [ $? -eq 0 ]; then
echo "bt" >> $file
echo "quit" >> $file
-   kgdb $KERNEL $VMCORE < $file
+   if [ -x /usr/local/bin/kgdb ]; then
+   /usr/local/bin/kgdb $KERNEL $VMCORE < $file
+   else
+   kgdb $KERNEL $VMCORE < $file
+   fi
rm -f $file
echo
 fi
___
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: r303107 - in stable/10/sys/dev: e1000 ixgb ixgbe ixl

2016-07-20 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 20 18:26:48 2016
New Revision: 303107
URL: https://svnweb.freebsd.org/changeset/base/303107

Log:
  MFC - r302384 to 10-STABLE
  Do not initialize the adapter on MTU change when adapter status is down.
  This fixes long-standing problems when changing settings of the adapter.
  
  Discussed in:
  https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html
  
  Differential Revision:https://reviews.freebsd.org/D7254

Modified:
  stable/10/sys/dev/e1000/if_em.c
  stable/10/sys/dev/e1000/if_igb.c
  stable/10/sys/dev/e1000/if_lem.c
  stable/10/sys/dev/ixgb/if_ixgb.c
  stable/10/sys/dev/ixgbe/if_ix.c
  stable/10/sys/dev/ixgbe/if_ixv.c
  stable/10/sys/dev/ixl/if_ixl.c
  stable/10/sys/dev/ixl/if_ixlv.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/e1000/if_em.c
==
--- stable/10/sys/dev/e1000/if_em.c Wed Jul 20 18:16:58 2016
(r303106)
+++ stable/10/sys/dev/e1000/if_em.c Wed Jul 20 18:26:48 2016
(r303107)
@@ -1220,7 +1220,8 @@ em_ioctl(struct ifnet *ifp, u_long comma
ifp->if_mtu = ifr->ifr_mtu;
adapter->hw.mac.max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   em_init_locked(adapter);
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
+   em_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

Modified: stable/10/sys/dev/e1000/if_igb.c
==
--- stable/10/sys/dev/e1000/if_igb.cWed Jul 20 18:16:58 2016
(r303106)
+++ stable/10/sys/dev/e1000/if_igb.cWed Jul 20 18:26:48 2016
(r303107)
@@ -1090,7 +1090,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   igb_init_locked(adapter);
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
+   igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;
}

Modified: stable/10/sys/dev/e1000/if_lem.c
==
--- stable/10/sys/dev/e1000/if_lem.cWed Jul 20 18:16:58 2016
(r303106)
+++ stable/10/sys/dev/e1000/if_lem.cWed Jul 20 18:26:48 2016
(r303107)
@@ -1047,7 +1047,8 @@ lem_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   lem_init_locked(adapter);
+   if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+   lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

Modified: stable/10/sys/dev/ixgb/if_ixgb.c
==
--- stable/10/sys/dev/ixgb/if_ixgb.cWed Jul 20 18:16:58 2016
(r303106)
+++ stable/10/sys/dev/ixgb/if_ixgb.cWed Jul 20 18:26:48 2016
(r303107)
@@ -538,7 +538,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD
adapter->hw.max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
 
-   ixgb_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixgb_init_locked(adapter);
IXGB_UNLOCK(adapter);
}
break;

Modified: stable/10/sys/dev/ixgbe/if_ix.c
==
--- stable/10/sys/dev/ixgbe/if_ix.c Wed Jul 20 18:16:58 2016
(r303106)
+++ stable/10/sys/dev/ixgbe/if_ix.c Wed Jul 20 18:26:48 2016
(r303107)
@@ -900,7 +900,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
-   ixgbe_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixgbe_init_locked(adapter);
 #ifdef PCI_IOV
ixgbe_recalculate_max_frame(adapter);
 #endif

Modified: stable/10/sys/dev/ixgbe/if_ixv.c
==
--- stable/10/sys/dev/ixgbe/if_ixv.cWed Jul 20 18:16:58 2016
(r303106)
+++ stable/10/sys/dev/ixgbe/if_ixv.cWed Jul 20 18:26:48 2016
(r303107)
@@ -587,7 +587,8 @@ ixv_ioctl(struct ifnet * ifp, u_long com
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =

svn commit: r303106 - head/lib/libc/sys

2016-07-20 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Wed Jul 20 18:16:58 2016
New Revision: 303106
URL: https://svnweb.freebsd.org/changeset/base/303106

Log:
  Change wording to use function rather than system call in the description
  as well.
  
  Reviewed by:  brooks
  MFC after:5 days

Modified:
  head/lib/libc/sys/pipe.2

Modified: head/lib/libc/sys/pipe.2
==
--- head/lib/libc/sys/pipe.2Wed Jul 20 18:11:22 2016(r303105)
+++ head/lib/libc/sys/pipe.2Wed Jul 20 18:16:58 2016(r303106)
@@ -46,7 +46,7 @@
 .Sh DESCRIPTION
 The
 .Fn pipe
-system call
+function
 creates a
 .Em pipe ,
 which is an object allowing
___
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: r303099 - head/sys/kern

2016-07-20 Thread Conrad Meyer
Mea culpa.  Thanks for the report.  Fixed in r303105.

Best,
Conrad

On Wed, Jul 20, 2016 at 10:32 AM, Larry Rosenman  wrote:
> This broke my build:
> --- imgact_elf32.o ---
> In file included from /usr/src/sys/kern/imgact_elf32.c:31:
> /usr/src/sys/kern/imgact_elf.c:1663:8: error: format specifies type 'size_t'
> (aka 'unsigned long') but the argument has type 'Elf32_Off' (aka 'unsigned
> int') [-Werror,-Wformat]
>  ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
>  ^
> /usr/src/sys/sys/systm.h:86:17: note: expanded from macro 'KASSERT'
> kassert_panic msg;  \
>   ^~~
>
>
>
>
> On 2016-07-20 11:59, Conrad E. Meyer wrote:
>>
>> Author: cem
>> Date: Wed Jul 20 16:59:36 2016
>> New Revision: 303099
>> URL: https://svnweb.freebsd.org/changeset/base/303099
>>
>> Log:
>>   Extend ELF coredump to support more than 65535 segments
>>
>>   The ELF e_phnum field is only 16 bits wide. To support more than
>> 65535 segments
>>   (program headers), Sun's "Linker and Libraries Guide" table 7-7 (or
>> 12-7,
>>   depending on document version) prescribes a special first section header
>> where
>>   sh_info represents the real number of program headers.
>>
>>   Test code to follow, when it is ready.
>>
>>   Reference:http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf
>>
>>   Reviewed by:  emaste, markj
>>   Sponsored by: EMC / Isilon Storage Division
>>   Differential Revision:https://reviews.freebsd.org/D7255
>>
>> Modified:
>>   head/sys/kern/imgact_elf.c
>>
>> Modified: head/sys/kern/imgact_elf.c
>>
>> ==
>> --- head/sys/kern/imgact_elf.c  Wed Jul 20 16:48:25 2016(r303098)
>> +++ head/sys/kern/imgact_elf.c  Wed Jul 20 16:59:36 2016(r303099)
>> @@ -1323,6 +1323,8 @@ __elfN(coredump)(struct thread *td, stru
>>  * Collect info about the core file header area.
>>  */
>> hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 +
>> seginfo.count);
>> +   if (seginfo.count + 1 >= PN_XNUM)
>> +   hdrsize += sizeof(Elf_Shdr);
>> __elfN(prepare_notes)(td, , );
>> coresize = round_page(hdrsize + notesz) + seginfo.size;
>>
>> @@ -1618,10 +1620,10 @@ __elfN(puthdr)(struct thread *td, void *
>>  {
>> Elf_Ehdr *ehdr;
>> Elf_Phdr *phdr;
>> +   Elf_Shdr *shdr;
>> struct phdr_closure phc;
>>
>> ehdr = (Elf_Ehdr *)hdr;
>> -   phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr));
>>
>> ehdr->e_ident[EI_MAG0] = ELFMAG0;
>> ehdr->e_ident[EI_MAG1] = ELFMAG1;
>> @@ -1645,14 +1647,43 @@ __elfN(puthdr)(struct thread *td, void *
>> ehdr->e_flags = 0;
>> ehdr->e_ehsize = sizeof(Elf_Ehdr);
>> ehdr->e_phentsize = sizeof(Elf_Phdr);
>> -   ehdr->e_phnum = numsegs + 1;
>> ehdr->e_shentsize = sizeof(Elf_Shdr);
>> -   ehdr->e_shnum = 0;
>> ehdr->e_shstrndx = SHN_UNDEF;
>> +   if (numsegs + 1 < PN_XNUM) {
>> +   ehdr->e_phnum = numsegs + 1;
>> +   ehdr->e_shnum = 0;
>> +   } else {
>> +   ehdr->e_phnum = PN_XNUM;
>> +   ehdr->e_shnum = 1;
>> +
>> +   ehdr->e_shoff = ehdr->e_phoff +
>> +   (numsegs + 1) * ehdr->e_phentsize;
>> +   KASSERT(ehdr->e_shoff == hdrsize - sizeof(Elf_Shdr),
>> +   ("e_shoff: %zu, hdrsize - shdr: %zu",
>> +ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
>> +
>> +   shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff);
>> +   memset(shdr, 0, sizeof(*shdr));
>> +   /*
>> +* A special first section is used to hold large segment
>> and
>> +* section counts.  This was proposed by Sun Microsystems
>> in
>> +* Solaris and has been adopted by Linux; the standard ELF
>> +* tools are already familiar with the technique.
>> +*
>> +* See table 7-7 of the Solaris "Linker and Libraries
>> Guide"
>> +* (or 12-7 depending on the version of the document) for
>> more
>> +* details.
>> +*/
>> +   shdr->sh_type = SHT_NULL;
>> +   shdr->sh_size = ehdr->e_shnum;
>> +   shdr->sh_link = ehdr->e_shstrndx;
>> +   shdr->sh_info = numsegs + 1;
>> +   }
>>
>> /*
>>  * Fill in the program header entries.
>>  */
>> +   phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff);
>>
>> /* The note segement. */
>> phdr->p_type = PT_NOTE;
>> ___
>> 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"
>
>
> --
> Larry Rosenman  

svn commit: r303105 - head/sys/kern

2016-07-20 Thread Conrad E. Meyer
Author: cem
Date: Wed Jul 20 18:11:22 2016
New Revision: 303105
URL: https://svnweb.freebsd.org/changeset/base/303105

Log:
  Fix DEBUG build on 64-bit arch after r303099
  
  Reported by:  Larry Rosenman 

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Jul 20 18:02:07 2016(r303104)
+++ head/sys/kern/imgact_elf.c  Wed Jul 20 18:11:22 2016(r303105)
@@ -1660,7 +1660,7 @@ __elfN(puthdr)(struct thread *td, void *
(numsegs + 1) * ehdr->e_phentsize;
KASSERT(ehdr->e_shoff == hdrsize - sizeof(Elf_Shdr),
("e_shoff: %zu, hdrsize - shdr: %zu",
-ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
+(size_t)ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
 
shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff);
memset(shdr, 0, sizeof(*shdr));
___
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: r303104 - head/lib/libc/sys

2016-07-20 Thread Brooks Davis
Author: brooks
Date: Wed Jul 20 18:02:07 2016
New Revision: 303104
URL: https://svnweb.freebsd.org/changeset/base/303104

Log:
  Update to reflect the fact that pipe() is a wrapper around the pipe2()
  system call.
  
  Reviewed by:  jhb, wblock
  MFC after:5 days
  Sponsored by: DAPRA, AFRL
  Differential Revision:https://reviews.freebsd.org/D6948

Modified:
  head/lib/libc/sys/pipe.2

Modified: head/lib/libc/sys/pipe.2
==
--- head/lib/libc/sys/pipe.2Wed Jul 20 18:00:22 2016(r303103)
+++ head/lib/libc/sys/pipe.2Wed Jul 20 18:02:07 2016(r303104)
@@ -28,7 +28,7 @@
 .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 22, 2016
+.Dd July 20, 2016
 .Dt PIPE 2
 .Os
 .Sh NAME
@@ -109,6 +109,18 @@ The bidirectional nature of this impleme
 portable to older systems, so it is recommended to use the convention
 for using the endpoints in the traditional manner when using a
 pipe in one direction.
+.Sh IMPLEMENTATION NOTES
+The
+.Fn pipe
+function calls the
+.Fn pipe2
+system call.
+As a result, system call traces such as those captured by
+.Xr dtrace 1
+or
+.Xr ktrace 1
+will show calls to
+.Fn pipe2 .
 .Sh RETURN VALUES
 .Rv -std pipe
 .Sh ERRORS
@@ -157,3 +169,10 @@ The
 .Fn pipe2
 function appeared in
 .Fx 10.0 .
+.Pp
+The
+.Fn pipe
+function became a wrapper around
+.Fn pipe2
+in
+.Fx 11.0 .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303103 - head

2016-07-20 Thread Brooks Davis
Author: brooks
Date: Wed Jul 20 18:00:22 2016
New Revision: 303103
URL: https://svnweb.freebsd.org/changeset/base/303103

Log:
  Minor wording improvements to the note about pipe(2) removal.
  
  MFC after:5 days
  Sponsored by: DARPA, AFRL

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Jul 20 17:46:33 2016(r303102)
+++ head/UPDATING   Wed Jul 20 18:00:22 2016(r303103)
@@ -33,11 +33,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 20160622:
The libc stub for the pipe(2) system call has been replaced with
-   a wrapper which calls the pipe2(2) system call and the pipe(2) is now
-   only implemented by the kernels which include "options
-   COMPAT_FREEBSD10" in their config file (this is the default).
-   Users should ensure that this option is enabled in their kernel
-   or upgrade userspace to r302092 before upgrading their kernel.
+   a wrapper that calls the pipe2(2) system call and the pipe(2)
+   system call is now only implemented by the kernels that include
+   "options COMPAT_FREEBSD10" in their config file (this is the
+   default).  Users should ensure that this option is enabled in
+   their kernel or upgrade userspace to r302092 before upgrading their
+   kernel.
 
 20160527:
CAM will now strip leading spaces from SCSI disks' serial numbers.
___
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: r303102 - head/sys/conf

2016-07-20 Thread Andrew Turner
Author: andrew
Date: Wed Jul 20 17:46:33 2016
New Revision: 303102
URL: https://svnweb.freebsd.org/changeset/base/303102

Log:
  Mark the Designware MMC and USB OTG drivers as FDT only. These are normally
  found on arm64 devices that use FDT.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/files.arm64

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Wed Jul 20 17:20:22 2016(r303101)
+++ head/sys/conf/files.arm64   Wed Jul 20 17:46:33 2016(r303102)
@@ -59,8 +59,8 @@ dev/acpica/acpi_if.m  optionalacpi
 dev/ahci/ahci_generic.coptional ahci fdt
 dev/hwpmc/hwpmc_arm64.coptionalhwpmc
 dev/hwpmc/hwpmc_arm64_md.c optionalhwpmc
-dev/mmc/host/dwmmc.c   optionaldwmmc
-dev/mmc/host/dwmmc_hisi.c  optionaldwmmc soc_hisi_hi6220
+dev/mmc/host/dwmmc.c   optionaldwmmc fdt
+dev/mmc/host/dwmmc_hisi.c  optionaldwmmc fdt soc_hisi_hi6220
 dev/ofw/ofw_cpu.c  optionalfdt
 dev/ofw/ofwpci.c   optionalfdt pci
 dev/pci/pci_host_generic.c optionalpci fdt
@@ -68,7 +68,7 @@ dev/psci/psci.c   optionalpsci
 dev/psci/psci_arm64.S  optionalpsci
 dev/uart/uart_cpu_fdt.coptionaluart fdt
 dev/uart/uart_dev_pl011.c  optionaluart pl011
-dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220
+dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220
 dev/usb/controller/generic_ohci.c optional ohci fdt
 dev/usb/controller/generic_usb_if.m optional   ohci fdt
 dev/vnic/mrml_bridge.c optionalvnic fdt
___
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: r303099 - head/sys/kern

2016-07-20 Thread Larry Rosenman

This broke my build:
--- imgact_elf32.o ---
In file included from /usr/src/sys/kern/imgact_elf32.c:31:
/usr/src/sys/kern/imgact_elf.c:1663:8: error: format specifies type 
'size_t' (aka 'unsigned long') but the argument has type 'Elf32_Off' 
(aka 'unsigned int') [-Werror,-Wformat]

 ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
 ^
/usr/src/sys/sys/systm.h:86:17: note: expanded from macro 'KASSERT'
kassert_panic msg;  
\

  ^~~



On 2016-07-20 11:59, Conrad E. Meyer wrote:

Author: cem
Date: Wed Jul 20 16:59:36 2016
New Revision: 303099
URL: https://svnweb.freebsd.org/changeset/base/303099

Log:
  Extend ELF coredump to support more than 65535 segments

  The ELF e_phnum field is only 16 bits wide. To support more than
65535 segments
  (program headers), Sun's "Linker and Libraries Guide" table 7-7 (or 
12-7,
  depending on document version) prescribes a special first section 
header where

  sh_info represents the real number of program headers.

  Test code to follow, when it is ready.

  Reference:http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf

  Reviewed by:  emaste, markj
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D7255

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Jul 20 16:48:25 2016(r303098)
+++ head/sys/kern/imgact_elf.c  Wed Jul 20 16:59:36 2016(r303099)
@@ -1323,6 +1323,8 @@ __elfN(coredump)(struct thread *td, stru
 * Collect info about the core file header area.
 */
hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count);
+   if (seginfo.count + 1 >= PN_XNUM)
+   hdrsize += sizeof(Elf_Shdr);
__elfN(prepare_notes)(td, , );
coresize = round_page(hdrsize + notesz) + seginfo.size;

@@ -1618,10 +1620,10 @@ __elfN(puthdr)(struct thread *td, void *
 {
Elf_Ehdr *ehdr;
Elf_Phdr *phdr;
+   Elf_Shdr *shdr;
struct phdr_closure phc;

ehdr = (Elf_Ehdr *)hdr;
-   phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr));

ehdr->e_ident[EI_MAG0] = ELFMAG0;
ehdr->e_ident[EI_MAG1] = ELFMAG1;
@@ -1645,14 +1647,43 @@ __elfN(puthdr)(struct thread *td, void *
ehdr->e_flags = 0;
ehdr->e_ehsize = sizeof(Elf_Ehdr);
ehdr->e_phentsize = sizeof(Elf_Phdr);
-   ehdr->e_phnum = numsegs + 1;
ehdr->e_shentsize = sizeof(Elf_Shdr);
-   ehdr->e_shnum = 0;
ehdr->e_shstrndx = SHN_UNDEF;
+   if (numsegs + 1 < PN_XNUM) {
+   ehdr->e_phnum = numsegs + 1;
+   ehdr->e_shnum = 0;
+   } else {
+   ehdr->e_phnum = PN_XNUM;
+   ehdr->e_shnum = 1;
+
+   ehdr->e_shoff = ehdr->e_phoff +
+   (numsegs + 1) * ehdr->e_phentsize;
+   KASSERT(ehdr->e_shoff == hdrsize - sizeof(Elf_Shdr),
+   ("e_shoff: %zu, hdrsize - shdr: %zu",
+ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
+
+   shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff);
+   memset(shdr, 0, sizeof(*shdr));
+   /*
+* A special first section is used to hold large segment and
+* section counts.  This was proposed by Sun Microsystems in
+* Solaris and has been adopted by Linux; the standard ELF
+* tools are already familiar with the technique.
+*
+* See table 7-7 of the Solaris "Linker and Libraries Guide"
+* (or 12-7 depending on the version of the document) for more
+* details.
+*/
+   shdr->sh_type = SHT_NULL;
+   shdr->sh_size = ehdr->e_shnum;
+   shdr->sh_link = ehdr->e_shstrndx;
+   shdr->sh_info = numsegs + 1;
+   }

/*
 * Fill in the program header entries.
 */
+   phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff);

/* The note segement. */
phdr->p_type = PT_NOTE;
___
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"


--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281
___
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: r303101 - head/sys/vm

2016-07-20 Thread Alan Cox
Author: alc
Date: Wed Jul 20 17:20:22 2016
New Revision: 303101
URL: https://svnweb.freebsd.org/changeset/base/303101

Log:
  Add a comment describing the 'fast path' that was introduced in r270011.
  
  Reviewed by:  kib
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Wed Jul 20 17:19:47 2016(r303100)
+++ head/sys/vm/vm_fault.c  Wed Jul 20 17:20:22 2016(r303101)
@@ -354,6 +354,15 @@ RetryFault:;
KASSERT((fault_flags & VM_FAULT_WIRE) == 0,
("!wired && VM_FAULT_WIRE"));
 
+   /*
+* Try to avoid lock contention on the top-level object through
+* special-case handling of some types of page faults, specifically,
+* those that are both (1) mapping an existing page from the top-
+* level object and (2) not having to mark that object as containing
+* dirty pages.  Under these conditions, a read lock on the top-level
+* object suffices, allowing multiple page faults of a similar type to
+* run in parallel on the same top-level object.
+*/
if (fs.vp == NULL /* avoid locked vnode leak */ &&
(fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0 &&
/* avoid calling vm_object_set_writeable_dirty() */
___
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: r303100 - head/sys/dev/uart

2016-07-20 Thread Andrew Turner
Author: andrew
Date: Wed Jul 20 17:19:47 2016
New Revision: 303100
URL: https://svnweb.freebsd.org/changeset/base/303100

Log:
  We will be switching to a new arm64 uart cpu driver that handles both FDT
  and ACPI. As such pull out what will be the common parts of the FDT cpu
  detection to a new function that can be shared between them.
  
  Reviewed by:  manu
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7262

Modified:
  head/sys/dev/uart/uart_bus_fdt.c
  head/sys/dev/uart/uart_cpu_fdt.c
  head/sys/dev/uart/uart_cpu_fdt.h

Modified: head/sys/dev/uart/uart_bus_fdt.c
==
--- head/sys/dev/uart/uart_bus_fdt.cWed Jul 20 16:59:36 2016
(r303099)
+++ head/sys/dev/uart/uart_bus_fdt.cWed Jul 20 17:19:47 2016
(r303100)
@@ -105,6 +105,129 @@ uart_fdt_find_device(device_t dev)
 }
 
 static int
+phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node)
+{
+   char buf[64];
+
+   if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0)
+   return (ENXIO);
+   if ((*node = OF_finddevice(buf)) == -1)
+   return (ENXIO);
+
+   return (0);
+}
+
+static const struct ofw_compat_data *
+uart_fdt_find_compatible(phandle_t node, const struct ofw_compat_data *cd)
+{
+   const struct ofw_compat_data *ocd;
+
+   for (ocd = cd; ocd->ocd_str != NULL; ocd++) {
+   if (fdt_is_compatible(node, ocd->ocd_str))
+   return (ocd);
+   }
+   return (NULL);
+}
+
+static uintptr_t
+uart_fdt_find_by_node(phandle_t node, int class_list)
+{
+   struct ofw_compat_data **cd;
+   const struct ofw_compat_data *ocd;
+
+   if (class_list) {
+   SET_FOREACH(cd, uart_fdt_class_set) {
+   ocd = uart_fdt_find_compatible(node, *cd);
+   if ((ocd != NULL) && (ocd->ocd_data != 0))
+   return (ocd->ocd_data);
+   }
+   } else {
+   SET_FOREACH(cd, uart_fdt_class_and_device_set) {
+   ocd = uart_fdt_find_compatible(node, *cd);
+   if ((ocd != NULL) && (ocd->ocd_data != 0))
+   return (ocd->ocd_data);
+   }
+   }
+
+   return (0);
+}
+
+int
+uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst,
+bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp)
+{
+   const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout",
+   "stdin-path", "stdin", NULL};
+   const char **name;
+   struct uart_class *class;
+   phandle_t node, chosen;
+   pcell_t br, clk, shift;
+   char *cp;
+   int err;
+
+   /* Has the user forced a specific device node? */
+   cp = kern_getenv("hw.fdt.console");
+   if (cp == NULL) {
+   /*
+* Retrieve /chosen/std{in,out}.
+*/
+   node = -1;
+   if ((chosen = OF_finddevice("/chosen")) != -1) {
+   for (name = propnames; *name != NULL; name++) {
+   if (phandle_chosen_propdev(chosen, *name,
+   ) == 0)
+   break;
+   }
+   }
+   if (chosen == -1 || *name == NULL)
+   node = OF_finddevice("serial0"); /* Last ditch */
+   } else {
+   node = OF_finddevice(cp);
+   }
+
+   if (node == -1)
+   return (ENXIO);
+
+   /*
+* Check old style of UART definition first. Unfortunately, the common
+* FDT processing is not possible if we have clock, power domains and
+* pinmux stuff.
+*/
+   class = (struct uart_class *)uart_fdt_find_by_node(node, 0);
+   if (class != NULL) {
+   if ((err = uart_fdt_get_clock(node, )) != 0)
+   return (err);
+   } else {
+   /* Check class only linker set */
+   class =
+   (struct uart_class *)uart_fdt_find_by_node(node, 1);
+   if (class == NULL)
+   return (ENXIO);
+   clk = 0;
+   }
+
+   /*
+* Retrieve serial attributes.
+*/
+   if (uart_fdt_get_shift(node, ) != 0)
+   shift = uart_getregshift(class);
+
+   if (OF_getencprop(node, "current-speed", , sizeof(br)) <= 0)
+   br = 0;
+
+   err = OF_decode_addr(node, 0, bst, bsh, NULL);
+   if (err != 0)
+   return (err);
+
+   *classp = class;
+   *baud = br;
+   *rclk = clk;
+   *shiftp = shift;
+
+   return (0);
+}
+
+static int
 uart_fdt_probe(device_t dev)
 {
struct uart_softc *sc;

Modified: head/sys/dev/uart/uart_cpu_fdt.c

svn commit: r303099 - head/sys/kern

2016-07-20 Thread Conrad E. Meyer
Author: cem
Date: Wed Jul 20 16:59:36 2016
New Revision: 303099
URL: https://svnweb.freebsd.org/changeset/base/303099

Log:
  Extend ELF coredump to support more than 65535 segments
  
  The ELF e_phnum field is only 16 bits wide. To support more than 65535 
segments
  (program headers), Sun's "Linker and Libraries Guide" table 7-7 (or 12-7,
  depending on document version) prescribes a special first section header where
  sh_info represents the real number of program headers.
  
  Test code to follow, when it is ready.
  
  Reference:http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf
  
  Reviewed by:  emaste, markj
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D7255

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Jul 20 16:48:25 2016(r303098)
+++ head/sys/kern/imgact_elf.c  Wed Jul 20 16:59:36 2016(r303099)
@@ -1323,6 +1323,8 @@ __elfN(coredump)(struct thread *td, stru
 * Collect info about the core file header area.
 */
hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count);
+   if (seginfo.count + 1 >= PN_XNUM)
+   hdrsize += sizeof(Elf_Shdr);
__elfN(prepare_notes)(td, , );
coresize = round_page(hdrsize + notesz) + seginfo.size;
 
@@ -1618,10 +1620,10 @@ __elfN(puthdr)(struct thread *td, void *
 {
Elf_Ehdr *ehdr;
Elf_Phdr *phdr;
+   Elf_Shdr *shdr;
struct phdr_closure phc;
 
ehdr = (Elf_Ehdr *)hdr;
-   phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr));
 
ehdr->e_ident[EI_MAG0] = ELFMAG0;
ehdr->e_ident[EI_MAG1] = ELFMAG1;
@@ -1645,14 +1647,43 @@ __elfN(puthdr)(struct thread *td, void *
ehdr->e_flags = 0;
ehdr->e_ehsize = sizeof(Elf_Ehdr);
ehdr->e_phentsize = sizeof(Elf_Phdr);
-   ehdr->e_phnum = numsegs + 1;
ehdr->e_shentsize = sizeof(Elf_Shdr);
-   ehdr->e_shnum = 0;
ehdr->e_shstrndx = SHN_UNDEF;
+   if (numsegs + 1 < PN_XNUM) {
+   ehdr->e_phnum = numsegs + 1;
+   ehdr->e_shnum = 0;
+   } else {
+   ehdr->e_phnum = PN_XNUM;
+   ehdr->e_shnum = 1;
+
+   ehdr->e_shoff = ehdr->e_phoff +
+   (numsegs + 1) * ehdr->e_phentsize;
+   KASSERT(ehdr->e_shoff == hdrsize - sizeof(Elf_Shdr),
+   ("e_shoff: %zu, hdrsize - shdr: %zu",
+ehdr->e_shoff, hdrsize - sizeof(Elf_Shdr)));
+
+   shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff);
+   memset(shdr, 0, sizeof(*shdr));
+   /*
+* A special first section is used to hold large segment and
+* section counts.  This was proposed by Sun Microsystems in
+* Solaris and has been adopted by Linux; the standard ELF
+* tools are already familiar with the technique.
+*
+* See table 7-7 of the Solaris "Linker and Libraries Guide"
+* (or 12-7 depending on the version of the document) for more
+* details.
+*/
+   shdr->sh_type = SHT_NULL;
+   shdr->sh_size = ehdr->e_shnum;
+   shdr->sh_link = ehdr->e_shstrndx;
+   shdr->sh_info = numsegs + 1;
+   }
 
/*
 * Fill in the program header entries.
 */
+   phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff);
 
/* The note segement. */
phdr->p_type = PT_NOTE;
___
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: r303097 - head

2016-07-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Jul 20 16:46:13 2016
New Revision: 303097
URL: https://svnweb.freebsd.org/changeset/base/303097

Log:
  Add myself to MAINTAINERS.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSWed Jul 20 16:44:22 2016(r303096)
+++ head/MAINTAINERSWed Jul 20 16:46:13 2016(r303097)
@@ -105,3 +105,4 @@ vmm(4)  neel,grehan Pre-commit review re
 autofs(5)  trasz   Pre-commit review recommended.
 iscsi(4)   trasz   Pre-commit review recommended.
 rctl(8)trasz   Pre-commit review recommended.
+sys/dev/ofwnwhitehorn  Pre-commit review recommended.
___
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: r303037 - head/sys/kern

2016-07-20 Thread Hans Petter Selasky

On 07/20/16 18:35, Gleb Smirnoff wrote:

  Randall,

  I have just tested and r303037 brings the TCP panic back. I
got two crashes during 2.5 hours.


Hi Gleb,

There is more than one way to fix the TCP panic. You don't _need_ to 
change the return values of callout_stop(). You _can_ make a new 
function for this, which doesn't cause problems in case anyone out there 
is depending on the current callout_stop() behaviour.



In your email [1] you are right, there is regression that (-1)
return value is lost. This problem was worked on in the PR 210884,
and we were very close to commiting the fix.

The whole 11.0-RELEASE cycle strongly depends on this change. We
don't want to release with TCP panic, and of course we want the
regression described in 210884 to be fixed.

Your backout mixed with extra code really made things messy. Since
I don't want to go with commit war, on behalf of RE we are asking
for explicit agreement to back out r303037. Then we will proceed with
latest patch from 210884. Is that okay?


I think Randall is right trying to preserve the callout API. My wish 
Gleb, is that you add a new function to handle the new behaviour.




[1] https://lists.freebsd.org/pipermail/svn-src-head/2016-July/089313.html



--HPS
___
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: r303098 - head/sys/kern

2016-07-20 Thread Gleb Smirnoff
Author: glebius
Date: Wed Jul 20 16:48:25 2016
New Revision: 303098
URL: https://svnweb.freebsd.org/changeset/base/303098

Log:
  Redo the r302894: the very new value for a non-scheduled callout is -1.
  This was recently added in r290664.
  
  Noticed by:   hselasky
  Tested by:Larry Rosenman 
  PR:   210884

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cWed Jul 20 16:46:13 2016
(r303097)
+++ head/sys/kern/kern_timeout.cWed Jul 20 16:48:25 2016
(r303098)
@@ -1380,8 +1380,14 @@ again:
if ((c->c_iflags & CALLOUT_PENDING) == 0) {
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
+   /*
+* For not scheduled and not executing callout return
+* negative value.
+*/
+   if (cc_exec_curr(cc, direct) != c)
+   cancelled = -1;
CC_UNLOCK(cc);
-   return (0);
+   return (cancelled);
}
 
c->c_iflags &= ~CALLOUT_PENDING;
___
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: r303096 - head/sys/kern

2016-07-20 Thread Gleb Smirnoff
Author: glebius
Date: Wed Jul 20 16:44:22 2016
New Revision: 303096
URL: https://svnweb.freebsd.org/changeset/base/303096

Log:
  Revert r303037. It re-introduces the panic with TCP timers.
  
  Agreed by:rrs, re (gjb)

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cWed Jul 20 16:36:17 2016
(r303095)
+++ head/sys/kern/kern_timeout.cWed Jul 20 16:44:22 2016
(r303096)
@@ -1050,7 +1050,7 @@ callout_reset_sbt_on(struct callout *c, 
 */
if (c->c_lock != NULL && !cc_exec_cancel(cc, direct))
cancelled = cc_exec_cancel(cc, direct) = true;
-   if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, direct)) {
+   if (cc_exec_waiting(cc, direct)) {
/*
 * Someone has called callout_drain to kill this
 * callout.  Don't reschedule.
@@ -1166,7 +1166,7 @@ _callout_stop_safe(struct callout *c, in
struct callout_cpu *cc, *old_cc;
struct lock_class *class;
int direct, sq_locked, use_lock;
-   int not_on_a_list;
+   int cancelled, not_on_a_list;
 
if ((flags & CS_DRAIN) != 0)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
@@ -1234,47 +1234,17 @@ again:
panic("migration should not happen");
 #endif
}
-   if ((drain != NULL) && (c->c_iflags & CALLOUT_PENDING) &&
-   (cc_exec_curr(cc, direct) != c)) {
-   /* 
-* This callout is executing and we are draining.
-* The only way this can happen is if its also
-* been rescheduled to run on one thread *and* asked to drain
-* on this thread (at the same time it is waiting to execute).
-*/
-   if ((c->c_iflags & CALLOUT_PROCESSED) == 0) {
-   if (cc_exec_next(cc) == c)
-   cc_exec_next(cc) = LIST_NEXT(c, c_links.le);
-   LIST_REMOVE(c, c_links.le);
-   } else {
-   TAILQ_REMOVE(>cc_expireq, c, c_links.tqe);
-   }
-   c->c_iflags &= ~CALLOUT_PENDING;
-   c->c_flags &= ~CALLOUT_ACTIVE;
-   }
+
/*
-* If the callout isn't pending, it's not on the queue, so
-* don't attempt to remove it from the queue.  We can try to
-* stop it by other means however.
+* If the callout is running, try to stop it or drain it.
 */
-   if (!(c->c_iflags & CALLOUT_PENDING)) {
+   if (cc_exec_curr(cc, direct) == c) {
/*
-* If it wasn't on the queue and it isn't the current
-* callout, then we can't stop it, so just bail.
-* It probably has already been run (if locking
-* is properly done). You could get here if the caller
-* calls stop twice in a row for example. The second
-* call would fall here without CALLOUT_ACTIVE set.
+* Succeed we to stop it or not, we must clear the
+* active flag - this is what API users expect.
 */
c->c_flags &= ~CALLOUT_ACTIVE;
-   if (cc_exec_curr(cc, direct) != c) {
-   CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
-   c, c->c_func, c->c_arg);
-   CC_UNLOCK(cc);
-   if (sq_locked)
-   sleepq_release(_exec_waiting(cc, direct));
-   return (-1);
-   }
+
if ((flags & CS_DRAIN) != 0) {
/*
 * The current callout is running (or just
@@ -1308,6 +1278,7 @@ again:
old_cc = cc;
goto again;
}
+
/*
 * Migration could be cancelled here, but
 * as long as it is still not sure when it
@@ -1391,8 +1362,6 @@ again:
cc_exec_drain(cc, direct) = drain;
}
CC_UNLOCK(cc);
-   if (drain)
-   return(0);
return ((flags & CS_EXECUTING) != 0);
}
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
@@ -1400,13 +1369,21 @@ again:
if (drain) {
cc_exec_drain(cc, direct) = drain;
}
-   CC_UNLOCK(cc);
KASSERT(!sq_locked, ("sleepqueue chain still locked"));
-   return (0);
-   }
+   cancelled = ((flags & 

Re: svn commit: r303037 - head/sys/kern

2016-07-20 Thread Randall Stewart via svn-src-all
You are most welcome to backout anything you like.. as far as
I am concerned you own the code..

R
> On Jul 20, 2016, at 6:35 PM, Gleb Smirnoff  wrote:
> 
>  Randall,
> 
>  I have just tested and r303037 brings the TCP panic back. I
> got two crashes during 2.5 hours.
> 
> In your email [1] you are right, there is regression that (-1)
> return value is lost. This problem was worked on in the PR 210884,
> and we were very close to commiting the fix.
> 
> The whole 11.0-RELEASE cycle strongly depends on this change. We
> don't want to release with TCP panic, and of course we want the
> regression described in 210884 to be fixed.
> 
> Your backout mixed with extra code really made things messy. Since
> I don't want to go with commit war, on behalf of RE we are asking
> for explicit agreement to back out r303037. Then we will proceed with
> latest patch from 210884. Is that okay?
> 
> [1] https://lists.freebsd.org/pipermail/svn-src-head/2016-July/089313.html
> 
> On Wed, Jul 20, 2016 at 03:33:37PM +0200, Randall Stewart wrote:
> R> Gleb
> R> 
> R> I wish you would have responded earlier.. I am more than glad to hand
> R> off all kern_timeout.c to you… please take it commit what you want to
> R> it and have it. I hate the code and I dislike having to touch it.
> R> 
> R> Its yours.. I can assure you I will not touch it again.
> R> 
> R> R
> R> > On Jul 20, 2016, at 8:53 AM, Gleb Smirnoff  wrote:
> R> > 
> R> > On Tue, Jul 19, 2016 at 06:31:19PM +, Randall Stewart wrote:
> R> > R> Author: rrs
> R> > R> Date: Tue Jul 19 18:31:19 2016
> R> > R> New Revision: 303037
> R> > R> URL: https://svnweb.freebsd.org/changeset/base/303037
> R> > R> 
> R> > R> Log:
> R> > R>   This reverts out Gleb's changes and adds three small
> R> > R>   fixes that I think closes up the races Gleb was
> R> > R>   looking for. This is running quite nicely in Netflix and
> R> > R>   now no longer causes TCP-tcb leaks.
> R> > R>   
> R> > R>   Differential Revision:  7135
> R> > 
> R> > Just to notice that I am completely pissed of by this commit
> R> > war, that you started.
> R> > 
> R> > I've been testing my changes properly, I gave people time to
> R> > review my changes. You didn't.
> R> > 
> R> > From your explanation in other emails I see that you've been
> R> > testing your changes with a version of FreeBSD that is a heavily
> R> > modified FreeBSD 10, not 11.
> R> > 
> R> > The new code you mixed with revert of mine, doesn't fix the
> R> > problem observed. It fixes another problem that you imagined,
> R> > which might exist, but isn't observed. We already discussed that
> R> > and you didn't prove it wrong.
> R> > 
> R> > Your change doesn't even revert my change completely.
> R> > 
> R> > -- 
> R> > Totus tuus, Glebius.
> R> 
> R> 
> R> Randall Stewart
> R> r...@netflix.com
> R> 803-317-4952
> R> 
> R> 
> R> 
> R> 
> R> 
> R> 
> 
> -- 
> Totus tuus, Glebius.


Randall Stewart
r...@netflix.com
803-317-4952





___
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: r303095 - stable/10/usr.bin/mkuzip

2016-07-20 Thread Maxim Sobolev
Author: sobomax
Date: Wed Jul 20 16:36:17 2016
New Revision: 303095
URL: https://svnweb.freebsd.org/changeset/base/303095

Log:
  MFC: merge in all new features and improvements into mkuzip(8) from current,
  which includes:
  
   o LZMA compression;
   o block de-duplication;
   o performance improvements;
   o multi-thread support.
  
  This includes the following revisions:
r295943,r296626,r296628,r296810,r298504,r298505,r298577
  
  Suggested by: emaste

Added:
  stable/10/usr.bin/mkuzip/mkuz_blk.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_blk.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_blk_chain.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_blockcache.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_blockcache.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_cfg.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_cloop.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_conveyor.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_conveyor.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_format.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_fqueue.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_fqueue.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_lzma.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_lzma.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_time.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_time.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_zlib.c   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuz_zlib.h   (contents, props changed)
  stable/10/usr.bin/mkuzip/mkuzip.h   (contents, props changed)
Modified:
  stable/10/usr.bin/mkuzip/Makefile
  stable/10/usr.bin/mkuzip/mkuzip.8
  stable/10/usr.bin/mkuzip/mkuzip.c

Modified: stable/10/usr.bin/mkuzip/Makefile
==
--- stable/10/usr.bin/mkuzip/Makefile   Wed Jul 20 15:59:37 2016
(r303094)
+++ stable/10/usr.bin/mkuzip/Makefile   Wed Jul 20 16:36:17 2016
(r303095)
@@ -2,9 +2,10 @@
 
 PROG=  mkuzip
 MAN=   mkuzip.8
+SRCS=  mkuzip.c mkuz_blockcache.c mkuz_lzma.c mkuz_zlib.c mkuz_conveyor.c \
+   mkuz_blk.c mkuz_fqueue.c mkuz_time.c
 
-DPADD= ${LIBZ}
-LDADD= -lz
-
+DPADD= ${LIBZ} ${LIBMD} ${LIBLZMA} ${LIBPTHREAD}
+LDADD= -lz -lmd -llzma -lpthread
 
 .include 

Added: stable/10/usr.bin/mkuzip/mkuz_blk.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/usr.bin/mkuzip/mkuz_blk.c Wed Jul 20 16:36:17 2016
(r303095)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2004-2016 Maxim Sobolev 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include "mkuzip.h"
+#include "mkuz_blk.h"
+
+struct mkuz_blk *
+mkuz_blk_ctor(size_t blen)
+{
+struct mkuz_blk *rval;
+
+rval = mkuz_safe_zmalloc(sizeof(struct mkuz_blk) + blen);
+rval->alen = blen;
+rval->br_offset = OFFSET_UNDEF;
+return (rval);
+}

Added: stable/10/usr.bin/mkuzip/mkuz_blk.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/usr.bin/mkuzip/mkuz_blk.h Wed Jul 20 16:36:17 2016
(r303095)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2004-2016 Maxim Sobolev 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, 

Re: svn commit: r303037 - head/sys/kern

2016-07-20 Thread Gleb Smirnoff
  Randall,

  I have just tested and r303037 brings the TCP panic back. I
got two crashes during 2.5 hours.

In your email [1] you are right, there is regression that (-1)
return value is lost. This problem was worked on in the PR 210884,
and we were very close to commiting the fix.

The whole 11.0-RELEASE cycle strongly depends on this change. We
don't want to release with TCP panic, and of course we want the
regression described in 210884 to be fixed.

Your backout mixed with extra code really made things messy. Since
I don't want to go with commit war, on behalf of RE we are asking
for explicit agreement to back out r303037. Then we will proceed with
latest patch from 210884. Is that okay?

[1] https://lists.freebsd.org/pipermail/svn-src-head/2016-July/089313.html

On Wed, Jul 20, 2016 at 03:33:37PM +0200, Randall Stewart wrote:
R> Gleb
R> 
R> I wish you would have responded earlier.. I am more than glad to hand
R> off all kern_timeout.c to you… please take it commit what you want to
R> it and have it. I hate the code and I dislike having to touch it.
R> 
R> Its yours.. I can assure you I will not touch it again.
R> 
R> R
R> > On Jul 20, 2016, at 8:53 AM, Gleb Smirnoff  wrote:
R> > 
R> > On Tue, Jul 19, 2016 at 06:31:19PM +, Randall Stewart wrote:
R> > R> Author: rrs
R> > R> Date: Tue Jul 19 18:31:19 2016
R> > R> New Revision: 303037
R> > R> URL: https://svnweb.freebsd.org/changeset/base/303037
R> > R> 
R> > R> Log:
R> > R>   This reverts out Gleb's changes and adds three small
R> > R>   fixes that I think closes up the races Gleb was
R> > R>   looking for. This is running quite nicely in Netflix and
R> > R>   now no longer causes TCP-tcb leaks.
R> > R>   
R> > R>   Differential Revision:7135
R> > 
R> > Just to notice that I am completely pissed of by this commit
R> > war, that you started.
R> > 
R> > I've been testing my changes properly, I gave people time to
R> > review my changes. You didn't.
R> > 
R> > From your explanation in other emails I see that you've been
R> > testing your changes with a version of FreeBSD that is a heavily
R> > modified FreeBSD 10, not 11.
R> > 
R> > The new code you mixed with revert of mine, doesn't fix the
R> > problem observed. It fixes another problem that you imagined,
R> > which might exist, but isn't observed. We already discussed that
R> > and you didn't prove it wrong.
R> > 
R> > Your change doesn't even revert my change completely.
R> > 
R> > -- 
R> > Totus tuus, Glebius.
R> 
R> 
R> Randall Stewart
R> r...@netflix.com
R> 803-317-4952
R> 
R> 
R> 
R> 
R> 
R> 

-- 
Totus tuus, Glebius.
___
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: r303094 - head/usr.bin

2016-07-20 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 20 15:59:37 2016
New Revision: 303094
URL: https://svnweb.freebsd.org/changeset/base/303094

Log:
  Continuation lines with comments badly affects gprof, it is excluded from
  build on amd64 f.e.

Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Wed Jul 20 15:07:52 2016(r303093)
+++ head/usr.bin/Makefile   Wed Jul 20 15:59:37 2016(r303094)
@@ -270,8 +270,9 @@ SUBDIR.${MK_TOOLCHAIN}+=ctags
 SUBDIR.${MK_TOOLCHAIN}+=   cxxfilt
 SUBDIR.${MK_TOOLCHAIN}+=   elfcopy
 SUBDIR.${MK_TOOLCHAIN}+=   file2c
-.if ${MACHINE_ARCH} != "aarch64" && \ # ARM64TODO gprof does not build
-${MACHINE_CPUARCH} != "riscv" # RISCVTODO gprof does not build
+# ARM64TODO gprof does not build
+# RISCVTODO gprof does not build
+.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
 SUBDIR.${MK_TOOLCHAIN}+=   gprof
 .endif
 SUBDIR.${MK_TOOLCHAIN}+=   indent
___
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: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-20 Thread Nathan Whitehorn



On 07/20/16 04:28, Michal Meloun wrote:

Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):



On 07/19/16 04:13, Michal Meloun wrote:

Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a):
Hi Nathan,
I’m afraid that skra is on vacation, for next 2 weeks (at minimum), so
please don’t expect quick response.


Could you please describe what this change is in more detail?

Short description is appended.

It breaks a lot of encapsulations we have worked very hard to 
maintain,

moves ARM code into MI parts of the kernel, and the OFW parts violate
IEEE 1275 (the Open Firmware standard). In particular, there is no
guarantee that the interrupts for a newbus (or OF) device are 
encoded in

a property called "interrupts" (or, indeed, in any property at all) on
that node and there are many, many device trees where that is not the
case (e.g. ones with interrupt maps, as well as Apple hardware). By
putting that knowledge into the OF root bus device, which we have 
tried
to keep it out of, this enforces a standard that doesn't actually 
exist.

Imho, this patch doesn’t change anything in this area. Only handling of
“interrupts” property is changed, all other cases are unchanged (I
hope).  Also, INTRNG code is currently shared by ARM, ARM64 and MIPS.


But "interrupts" isn't a generic part of OF. This makes it one, 
incorrectly.

How? Can you be little more exact ?


Because it puts knowledge into ofwbus that expects that children at 
arbitrary levels of nesting have interrupts defined by an "interrupts" 
property. You could patch this through on sub-devices, of course, but 
that's already done correctly by the existing ofw_bus_map_intr() code in 
a much more robust way that doesn't involve trying to guess how 
sub-buses and devices have chosen to allocate resources. Why reinvent 
the wheel all the way through the bus hierarchy?







I'm hesitant to ask for reversion on something that landed 6 weeks ago
without me noticing, but this needs a lot more architectural work 
before

any parts of the kernel should use it.
-Nathan

I think that it’s too late.  This patch series consist of r301451
(https://reviews.freebsd.org/D6632),
r301453, r301539 and 301543.  And new GPIO interrupts are currently 
used

(by in tree drivers or in development trees).


Well, then we need in-place rearchitecture.




The root of problem is that standard way of delivering interrupt
resource to consumer driver doesn’t works in OFW world.

So we have some fact:
- the format of interrupt property is dependent of interrupt
   controller and only interrupt controller can parse it.
- the interrupt property can have more data than just interrupt
   number.
- single interrupt controller must be able to handle multiple
   format of interrupt description.

In pre-patchset era, simplebus enumerates children and attempts to set
memory and interrupts to resource list for them. But the interrupt
controllers are not yet populated so nobody can parse interrupt
property. Moreover, in all cases (parsed or not), we cannot store
complete interrupt description into resource list.


We have done this for many years on PowerPC and sparc64 with delayed 
configuration of interrupts and a look-up table. This handles 
complicated bus configurations better than this code and requires no 
changes outside of a few MD files. That is why the (now partially 
duplicated) OFW_BUS_MAP_INTR() function exists. That one also has the 
benefit of still working when used in conjunction with, e.g., devices 
with an interrupt-map-mask property.




The patch simply postpones reading of interrupt property to
bus_alloc_resource() (called by consumer driver) time.

Due to this, we can:
- parse  interrupt property. The interrupt driver must exist
   at this time.


This only works with some types of interrupt properties, not all, and 
breaks if the interrupt driver hasn't attached yet (which it can't be 
guaranteed to -- some PPC systems have interrupt drivers that live on 
the PCI bus, for example).
How you can allocate (and reserve it in rman) interrupt if is not 
mapped (so you have not real IRQ number for it). Just for notice -  
multiple virtual IRQs can be mapped into single real IRQ.


The core idea is to think of the full interrupt specifier -- the 
interrupt parent and the full byte string in the device tree -- as the 
IRQ rather than the interrupt pin on some chip (which is usually, but 
not always, the first word in that byte string). The "virtual" IRQ 
number is just a compression of that longer piece of data, which usually 
can't fit in an rman resource.


There is no need to actually activate those interrupts before interrupts 
are enabled, so you can just cache them in a table until the end of 
device probing, which lets you break circular dependency loops between 
bus and interrupt topology.


So long as you keep track of your mapping and the same (parent, 
interrupt specifier) parent always gives the same virtual IRQ, there is 
no way in this system to map multiple active 

Re: svn commit: r303043 - in head: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb

2016-07-20 Thread Conrad Meyer
On Wed, Jul 20, 2016 at 12:44 AM, Kubilay Kocak  wrote:
> On 20/07/2016 5:20 AM, Conrad E. Meyer wrote:
>> Author: cem
>> Date: Tue Jul 19 19:20:47 2016
>> New Revision: 303043
>> URL: https://svnweb.freebsd.org/changeset/base/303043
>>
>> Log:
>>   Increase vt(4) framebuffer maximum size
>>
>>   And rename "DEFAULT" constants to the more accurate "MAX."
>>
>>   PR: 210382
>>   Submitted by:   Felix 
>>   Reviewed by:wblock, cem
>>   Tested by:  Dave Cottlehuber 
>
> Can MFC?
>
> There are high hopes for this coming out in 11.0 / next 10.x
>
> re is cc'd on the original bugzilla issue

If you would like to do so, please go ahead.

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


svn commit: r303093 - in stable/10: sys/kern sys/sys usr.bin/kdump

2016-07-20 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 20 15:07:52 2016
New Revision: 303093
URL: https://svnweb.freebsd.org/changeset/base/303093

Log:
  MFC r302770:
  Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.

Modified:
  stable/10/sys/kern/kern_time.c
  stable/10/sys/sys/ktrace.h
  stable/10/usr.bin/kdump/kdump.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_time.c
==
--- stable/10/sys/kern/kern_time.c  Wed Jul 20 15:02:37 2016
(r303092)
+++ stable/10/sys/kern/kern_time.c  Wed Jul 20 15:07:52 2016
(r303093)
@@ -32,6 +32,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ktrace.h"
+
 #include 
 #include 
 #include 
@@ -54,6 +56,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef KTRACE
+#include 
+#endif
 
 #include 
 #include 
@@ -699,6 +704,10 @@ kern_getitimer(struct thread *td, u_int 
*aitv = p->p_stats->p_timer[which];
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(aitv);
+#endif
return (0);
 }
 
@@ -740,6 +749,10 @@ kern_setitimer(struct thread *td, u_int 
 
if (which > ITIMER_PROF)
return (EINVAL);
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(aitv);
+#endif
if (itimerfix(>it_value) ||
aitv->it_value.tv_sec > INT32_MAX / 2)
return (EINVAL);
@@ -784,6 +797,10 @@ kern_setitimer(struct thread *td, u_int 
p->p_stats->p_timer[which] = *aitv;
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(oitv);
+#endif
return (0);
 }
 

Modified: stable/10/sys/sys/ktrace.h
==
--- stable/10/sys/sys/ktrace.h  Wed Jul 20 15:02:37 2016(r303092)
+++ stable/10/sys/sys/ktrace.h  Wed Jul 20 15:07:52 2016(r303093)
@@ -270,6 +270,8 @@ voidktrcapfail(enum ktr_cap_fail_type, 
const cap_rights_t *);
 #define ktrcaprights(s) \
ktrstruct("caprights", (s), sizeof(cap_rights_t))
+#definektritimerval(s) \
+   ktrstruct("itimerval", (s), sizeof(struct itimerval))
 #define ktrsockaddr(s) \
ktrstruct("sockaddr", (s), ((struct sockaddr *)(s))->sa_len)
 #define ktrstat(s) \

Modified: stable/10/usr.bin/kdump/kdump.c
==
--- stable/10/usr.bin/kdump/kdump.c Wed Jul 20 15:02:37 2016
(r303092)
+++ stable/10/usr.bin/kdump/kdump.c Wed Jul 20 15:07:52 2016
(r303093)
@@ -106,6 +106,7 @@ void ktruser_malloc(void *);
 void ktruser_rtld(int, void *);
 void ktruser(int, void *);
 void ktrcaprights(cap_rights_t *);
+void ktritimerval(struct itimerval *it);
 void ktrsockaddr(struct sockaddr *);
 void ktrstat(struct stat *);
 void ktrstruct(char *, size_t);
@@ -1616,6 +1617,24 @@ ktrcaprights(cap_rights_t *rightsp)
printf("\n");
 }
 
+static void
+ktrtimeval(struct timeval *tv)
+{
+
+   printf("{%ld, %ld}", (long)tv->tv_sec, tv->tv_usec);
+}
+
+void
+ktritimerval(struct itimerval *it)
+{
+
+   printf("itimerval { .interval = ");
+   ktrtimeval(>it_interval);
+   printf(", .value = ");
+   ktrtimeval(>it_value);
+   printf(" }\n");
+}
+
 void
 ktrsockaddr(struct sockaddr *sa)
 {
@@ -1799,6 +1818,7 @@ ktrstruct(char *buf, size_t buflen)
size_t namelen, datalen;
int i;
cap_rights_t rights;
+   struct itimerval it;
struct stat sb;
struct sockaddr_storage ss;
 
@@ -1823,6 +1843,11 @@ ktrstruct(char *buf, size_t buflen)
goto invalid;
memcpy(, data, datalen);
ktrcaprights();
+   } else if (strcmp(name, "itimerval") == 0) {
+   if (datalen != sizeof(struct itimerval))
+   goto invalid;
+   memcpy(, data, datalen);
+   ktritimerval();
} else if (strcmp(name, "stat") == 0) {
if (datalen != sizeof(struct stat))
goto invalid;
___
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: r303092 - in stable/11: sys/kern sys/sys usr.bin/kdump

2016-07-20 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 20 15:02:37 2016
New Revision: 303092
URL: https://svnweb.freebsd.org/changeset/base/303092

Log:
  MFC r302770:
  Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
  
  Approved by:  re (gjb)

Modified:
  stable/11/sys/kern/kern_time.c
  stable/11/sys/sys/ktrace.h
  stable/11/usr.bin/kdump/kdump.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_time.c
==
--- stable/11/sys/kern/kern_time.c  Wed Jul 20 15:00:05 2016
(r303091)
+++ stable/11/sys/kern/kern_time.c  Wed Jul 20 15:02:37 2016
(r303092)
@@ -32,6 +32,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ktrace.h"
+
 #include 
 #include 
 #include 
@@ -54,6 +56,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef KTRACE
+#include 
+#endif
 
 #include 
 #include 
@@ -701,6 +706,10 @@ kern_getitimer(struct thread *td, u_int 
*aitv = p->p_stats->p_timer[which];
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(aitv);
+#endif
return (0);
 }
 
@@ -742,6 +751,10 @@ kern_setitimer(struct thread *td, u_int 
 
if (which > ITIMER_PROF)
return (EINVAL);
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(aitv);
+#endif
if (itimerfix(>it_value) ||
aitv->it_value.tv_sec > INT32_MAX / 2)
return (EINVAL);
@@ -786,6 +799,10 @@ kern_setitimer(struct thread *td, u_int 
p->p_stats->p_timer[which] = *aitv;
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_STRUCT))
+   ktritimerval(oitv);
+#endif
return (0);
 }
 

Modified: stable/11/sys/sys/ktrace.h
==
--- stable/11/sys/sys/ktrace.h  Wed Jul 20 15:00:05 2016(r303091)
+++ stable/11/sys/sys/ktrace.h  Wed Jul 20 15:02:37 2016(r303092)
@@ -270,6 +270,8 @@ voidktrcapfail(enum ktr_cap_fail_type, 
const cap_rights_t *);
 #define ktrcaprights(s) \
ktrstruct("caprights", (s), sizeof(cap_rights_t))
+#definektritimerval(s) \
+   ktrstruct("itimerval", (s), sizeof(struct itimerval))
 #define ktrsockaddr(s) \
ktrstruct("sockaddr", (s), ((struct sockaddr *)(s))->sa_len)
 #define ktrstat(s) \

Modified: stable/11/usr.bin/kdump/kdump.c
==
--- stable/11/usr.bin/kdump/kdump.c Wed Jul 20 15:00:05 2016
(r303091)
+++ stable/11/usr.bin/kdump/kdump.c Wed Jul 20 15:02:37 2016
(r303092)
@@ -109,6 +109,7 @@ void ktruser_malloc(void *);
 void ktruser_rtld(int, void *);
 void ktruser(int, void *);
 void ktrcaprights(cap_rights_t *);
+void ktritimerval(struct itimerval *it);
 void ktrsockaddr(struct sockaddr *);
 void ktrstat(struct stat *);
 void ktrstruct(char *, size_t);
@@ -1562,6 +1563,24 @@ ktrcaprights(cap_rights_t *rightsp)
printf("\n");
 }
 
+static void
+ktrtimeval(struct timeval *tv)
+{
+
+   printf("{%ld, %ld}", (long)tv->tv_sec, tv->tv_usec);
+}
+
+void
+ktritimerval(struct itimerval *it)
+{
+
+   printf("itimerval { .interval = ");
+   ktrtimeval(>it_interval);
+   printf(", .value = ");
+   ktrtimeval(>it_value);
+   printf(" }\n");
+}
+
 void
 ktrsockaddr(struct sockaddr *sa)
 {
@@ -1737,6 +1756,7 @@ ktrstruct(char *buf, size_t buflen)
size_t namelen, datalen;
int i;
cap_rights_t rights;
+   struct itimerval it;
struct stat sb;
struct sockaddr_storage ss;
 
@@ -1761,6 +1781,11 @@ ktrstruct(char *buf, size_t buflen)
goto invalid;
memcpy(, data, datalen);
ktrcaprights();
+   } else if (strcmp(name, "itimerval") == 0) {
+   if (datalen != sizeof(struct itimerval))
+   goto invalid;
+   memcpy(, data, datalen);
+   ktritimerval();
} else if (strcmp(name, "stat") == 0) {
if (datalen != sizeof(struct stat))
goto invalid;
___
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: r303091 - head/usr.sbin/camdd

2016-07-20 Thread Alan Somers
Author: asomers
Date: Wed Jul 20 15:00:05 2016
New Revision: 303091
URL: https://svnweb.freebsd.org/changeset/base/303091

Log:
  Fix camdd for host-aware and host-managed SMR disks.
  
  This should've gone in as part of r300207
  
  Reviewed by:  ken
  MFC after:3 days
  Sponsored by: Spectra Logic Corp

Modified:
  head/usr.sbin/camdd/camdd.c

Modified: head/usr.sbin/camdd/camdd.c
==
--- head/usr.sbin/camdd/camdd.c Wed Jul 20 14:40:56 2016(r303090)
+++ head/usr.sbin/camdd/camdd.c Wed Jul 20 15:00:05 2016(r303091)
@@ -1292,6 +1292,7 @@ camdd_probe_pass(struct cam_device *cam_
case T_CDROM:
case T_OPTICAL:
case T_RBC:
+   case T_ZBC_HM:
break;
default:
errx(1, "Unsupported SCSI device type %d", scsi_dev_type);
___
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: r303090 - head/sys/ufs/ufs

2016-07-20 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 20 14:40:56 2016
New Revision: 303090
URL: https://svnweb.freebsd.org/changeset/base/303090

Log:
  Ensure that the UFS directory vnode' vm_object is properly sized
  before UFS_BALLOC() is called.  I do not believe that this caused any
  real issue on FreeBSD because the exclusive vnode lock is held over
  the balloc/resize, the change is to make formally correct KPI use.
  
  Based on: the Matthew Dillon' patch from DragonFly BSD
  PR:   93942
  Reviewed by:  mckusick
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/ufs/ufs/ufs_lookup.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_lookup.c
==
--- head/sys/ufs/ufs/ufs_lookup.c   Wed Jul 20 14:38:02 2016
(r303089)
+++ head/sys/ufs/ufs/ufs_lookup.c   Wed Jul 20 14:40:56 2016
(r303090)
@@ -881,6 +881,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir
struct buf *bp;
u_int dsize;
struct direct *ep, *nep;
+   u_int64_t old_isize;
int error, ret, blkoff, loc, spacefree, flags, namlen;
char *dirbuf;
 
@@ -909,16 +910,18 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir
return (error);
}
 #endif
+   old_isize = dp->i_size;
+   vnode_pager_setsize(dvp, (u_long)dp->i_offset + DIRBLKSIZ);
if ((error = UFS_BALLOC(dvp, (off_t)dp->i_offset, DIRBLKSIZ,
cr, flags, )) != 0) {
if (DOINGSOFTDEP(dvp) && newdirbp != NULL)
bdwrite(newdirbp);
+   vnode_pager_setsize(dvp, (u_long)old_isize);
return (error);
}
dp->i_size = dp->i_offset + DIRBLKSIZ;
DIP_SET(dp, i_size, dp->i_size);
dp->i_flag |= IN_CHANGE | IN_UPDATE;
-   vnode_pager_setsize(dvp, (u_long)dp->i_size);
dirp->d_reclen = DIRBLKSIZ;
blkoff = dp->i_offset &
(VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1);

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cWed Jul 20 14:38:02 2016
(r303089)
+++ head/sys/ufs/ufs/ufs_vnops.cWed Jul 20 14:40:56 2016
(r303090)
@@ -1913,13 +1913,13 @@ ufs_mkdir(ap)
dirtemplate = *dtp;
dirtemplate.dot_ino = ip->i_number;
dirtemplate.dotdot_ino = dp->i_number;
+   vnode_pager_setsize(tvp, DIRBLKSIZ);
if ((error = UFS_BALLOC(tvp, (off_t)0, DIRBLKSIZ, cnp->cn_cred,
BA_CLRBUF, )) != 0)
goto bad;
ip->i_size = DIRBLKSIZ;
DIP_SET(ip, i_size, DIRBLKSIZ);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
-   vnode_pager_setsize(tvp, (u_long)ip->i_size);
bcopy((caddr_t), (caddr_t)bp->b_data, sizeof dirtemplate);
if (DOINGSOFTDEP(tvp)) {
/*
___
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: r303089 - in stable/10: share/man/man4 sys/dev/mpr sys/dev/mps

2016-07-20 Thread Stephen McConnell
Author: slm
Date: Wed Jul 20 14:38:02 2016
New Revision: 303089
URL: https://svnweb.freebsd.org/changeset/base/303089

Log:
  MFC r302673
  Use real values to calculate Max I/O size instead of guessing.
  
  Reviewed by:  ken, scottl
  Approved by:  ken, scottl, ambrisko (mentors)
  Differential Revision:https://reviews.freebsd.org/D7043

Modified:
  stable/10/share/man/man4/mpr.4
  stable/10/share/man/man4/mps.4
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mprvar.h
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/mpr.4
==
--- stable/10/share/man/man4/mpr.4  Wed Jul 20 12:46:21 2016
(r303088)
+++ stable/10/share/man/man4/mpr.4  Wed Jul 20 14:38:02 2016
(r303089)
@@ -29,7 +29,7 @@
 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGES.
-.\" 
+.\"
 .\" mpr driver man page.
 .\"
 .\" Author: Ken Merry 
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2016
+.Dd July 6, 2016
 .Dt MPR 4
 .Os
 .Sh NAME
@@ -156,6 +156,29 @@ The current number of active I/O command
 dev.mpr.X.io_cmds_active
 .Xr sysctl 8
 variable.
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for all adapters,
+set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.max_io_pages=
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for a specific
+adapter, set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.max_io_pages=
+.Ed
+.Pp
+The default max_io_pages value is -1, meaning that the maximum I/O size that
+will be used per I/O will be calculated using the IOCFacts values stored in
+the controller.
+The lowest value that the driver will use for max_io_pages is 1, otherwise
+IOCFacts will be used to calculate the maximum I/O size.
+The smaller I/O size calculated from either max_io_pages or IOCFacts will be 
the
+maximum I/O size used by the driver.
 .Pp
 The highest number of active I/O commands seen since boot is stored in the
 dev.mpr.X.io_cmds_highwater
@@ -220,7 +243,7 @@ SATA disks that take several seconds to 
 command might not be discovered by the driver.
 This problem can sometimes be overcome by increasing the value of the spinup
 wait time in
-.Xr loader.conf 5 :
+.Xr loader.conf 5
 with the
 .Bd -literal -offset indent
 hw.mpr.spinup_wait_time=
@@ -250,7 +273,7 @@ hw.mpr.X.debug_level
 .Pp
 tunable, either in
 .Xr loader.conf 5
-or by using  
+or by using
 .Xr sysctl 8 .
 These bits have the described effects:
 .Bd -literal -offset indent

Modified: stable/10/share/man/man4/mps.4
==
--- stable/10/share/man/man4/mps.4  Wed Jul 20 12:46:21 2016
(r303088)
+++ stable/10/share/man/man4/mps.4  Wed Jul 20 14:38:02 2016
(r303089)
@@ -1,5 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
+.\" Copyright (c) 2014 LSI Corp
+.\" Copyright (c) 2016 Avago Technologies
+.\" Copyright (c) 2016 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -30,25 +33,27 @@
 .\" mps driver man page.
 .\"
 .\" Author: Ken Merry 
+.\" Author: Stephen McConnell 
 .\"
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd December 9, 2015
+.Dd July 5, 2016
 .Dt MPS 4
 .Os
 .Sh NAME
 .Nm mps
-.Nd LSI Fusion-MPT 2 Serial Attached SCSI driver
+.Nd "LSI Fusion-MPT 2 IT/IR 6Gb/s Serial Attached SCSI/SATA driver"
 .Sh SYNOPSIS
-To compile this driver into your kernel,
-place the following lines in your kernel configuration file:
+To compile this driver into the kernel, place these lines in the kernel
+configuration file:
 .Bd -ragged -offset indent
+.Cd "device pci"
 .Cd "device scbus"
 .Cd "device mps"
 .Ed
 .Pp
-Or, to load the driver as a module at boot, place the following line in
+The driver can be loaded as a module at boot time by placing this line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 mps_load="YES"
@@ -56,35 +61,30 @@ mps_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for LSI Logic Fusion-MPT 2
+driver provides support for Broadcom Ltd./Avago Tech (LSI)
+Fusion-MPT 2 IT/IR
 .Tn SAS
 controllers and WarpDrive solid state storage cards.
 .Sh HARDWARE
-The
+These controllers are supported by the
 .Nm
-driver supports the following hardware:
+driver:
 .Pp
 .Bl -bullet -compact
 .It
-LSI Logic SAS2004 (4 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2004 (4 Port SAS)
 .It
-LSI Logic SAS2008 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 

Re: svn commit: r303027 - in stable/11/release: . scripts

2016-07-20 Thread Glen Barber
My apologies for not mentioning that in the commit log.  I'd like to
keep the PR open, though, since we're going to fix this differently for
current.

Glen

On Wed, Jul 20, 2016 at 03:46:24PM +0200, Ronald Klop wrote:
> Hi, I made this PR for the issue.
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211029
> 
> Ronald.
> 
> 
> 
> On Tue, 19 Jul 2016 18:22:50 +0200, Glen Barber  wrote:
> 
> >Author: gjb
> >Date: Tue Jul 19 16:22:50 2016
> >New Revision: 303027
> >URL: https://svnweb.freebsd.org/changeset/base/303027
> >
> >Log:
> >  Reduce the disc1.iso size from 850+M to just over 650M.
> > As a result of this change, the 'kernel-dbg.txz' distribution
> >  is no longer provided on disc1.iso, and deselected by default
> >  in bsdinstall(8).  When 'kernel-dbg.txz' is selected, network
> >  configuration happens before the installer proceeds, to fetch
> >  the distribution from the mirrors.
> > This is a direct commit to stable/11, as there is intention
> >  to solve this differently for 12.0-RELEASE.
> > Reviewed by:nwhitehorn (glanced at)
> >  Approved by:   re (hrs)
> >  Sponsored by:  The FreeBSD Foundation
> >
> >Modified:
> >  stable/11/release/Makefile
> >  stable/11/release/scripts/make-manifest.sh
> >
> >Modified: stable/11/release/Makefile
> >==
> >--- stable/11/release/Makefile   Tue Jul 19 16:02:07 2016
> >(r303026)
> >+++ stable/11/release/Makefile   Tue Jul 19 16:22:50 2016
> >(r303027)
> >@@ -172,11 +172,12 @@ disc1: packagesystem
> > mkdir -p ${.TARGET}
> > cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
> > DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no 
> > \
> >-MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \
> >-MK_DEBUG_FILES=no
> >+MK_PROFILE=no MK_MAIL=no MK_TESTS=no MK_LIB32=no \
> >+MK_DEBUG_FILES=no MK_LLDB=no \
> >+MK_TOOLCHAIN=no
> > # Copy distfiles
> > mkdir -p ${.TARGET}/usr/freebsd-dist
> >-for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \
> >+for dist in MANIFEST $$(ls *.txz | grep -vE --
> >'(base|lib32|kernel)-dbg'); \
> > do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
> > done
> > # Copy documentation, if generated
> >
> >Modified: stable/11/release/scripts/make-manifest.sh
> >==
> >--- stable/11/release/scripts/make-manifest.sh   Tue Jul 19 16:02:07
> >2016 (r303026)
> >+++ stable/11/release/scripts/make-manifest.sh   Tue Jul 19 16:22:50
> >2016 (r303027)
> >@@ -36,7 +36,7 @@ default_tests=off
> > default_base_dbg=off
> > default_lib32_dbg=off
> > default_kernel_alt=off
> >-default_kernel_dbg=on
> >+default_kernel_dbg=off
> > default_kernel_alt_dbg=off
> >for i in ${*}; do
> >___
> >svn-src-all@freebsd.org mailing list
> >https://lists.freebsd.org/mailman/listinfo/svn-src-all
> >To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> 


signature.asc
Description: PGP signature


Re: svn commit: r303027 - in stable/11/release: . scripts

2016-07-20 Thread Ronald Klop

Hi, I made this PR for the issue.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211029

Ronald.



On Tue, 19 Jul 2016 18:22:50 +0200, Glen Barber  wrote:


Author: gjb
Date: Tue Jul 19 16:22:50 2016
New Revision: 303027
URL: https://svnweb.freebsd.org/changeset/base/303027

Log:
  Reduce the disc1.iso size from 850+M to just over 650M.
 As a result of this change, the 'kernel-dbg.txz' distribution
  is no longer provided on disc1.iso, and deselected by default
  in bsdinstall(8).  When 'kernel-dbg.txz' is selected, network
  configuration happens before the installer proceeds, to fetch
  the distribution from the mirrors.
 This is a direct commit to stable/11, as there is intention
  to solve this differently for 12.0-RELEASE.
 Reviewed by:   nwhitehorn (glanced at)
  Approved by:  re (hrs)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/Makefile
  stable/11/release/scripts/make-manifest.sh

Modified: stable/11/release/Makefile
==
--- stable/11/release/Makefile  Tue Jul 19 16:02:07 2016(r303026)
+++ stable/11/release/Makefile  Tue Jul 19 16:22:50 2016(r303027)
@@ -172,11 +172,12 @@ disc1: packagesystem
mkdir -p ${.TARGET}
cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no 
\
-   MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \
-   MK_DEBUG_FILES=no
+   MK_PROFILE=no MK_MAIL=no MK_TESTS=no MK_LIB32=no \
+   MK_DEBUG_FILES=no MK_LLDB=no \
+   MK_TOOLCHAIN=no
 # Copy distfiles
mkdir -p ${.TARGET}/usr/freebsd-dist
-   for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \
+	for dist in MANIFEST $$(ls *.txz | grep -vE --  
'(base|lib32|kernel)-dbg'); \

do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
done
 # Copy documentation, if generated

Modified: stable/11/release/scripts/make-manifest.sh
==
--- stable/11/release/scripts/make-manifest.sh	Tue Jul 19 16:02:07  
2016	(r303026)
+++ stable/11/release/scripts/make-manifest.sh	Tue Jul 19 16:22:50  
2016	(r303027)

@@ -36,7 +36,7 @@ default_tests=off
 default_base_dbg=off
 default_lib32_dbg=off
 default_kernel_alt=off
-default_kernel_dbg=on
+default_kernel_dbg=off
 default_kernel_alt_dbg=off
for i in ${*}; do
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

___
svn-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: r303037 - head/sys/kern

2016-07-20 Thread Randall Stewart via svn-src-all
Gleb

I wish you would have responded earlier.. I am more than glad to hand
off all kern_timeout.c to you… please take it commit what you want to
it and have it. I hate the code and I dislike having to touch it.

Its yours.. I can assure you I will not touch it again.

R
> On Jul 20, 2016, at 8:53 AM, Gleb Smirnoff  wrote:
> 
> On Tue, Jul 19, 2016 at 06:31:19PM +, Randall Stewart wrote:
> R> Author: rrs
> R> Date: Tue Jul 19 18:31:19 2016
> R> New Revision: 303037
> R> URL: https://svnweb.freebsd.org/changeset/base/303037
> R> 
> R> Log:
> R>   This reverts out Gleb's changes and adds three small
> R>   fixes that I think closes up the races Gleb was
> R>   looking for. This is running quite nicely in Netflix and
> R>   now no longer causes TCP-tcb leaks.
> R>   
> R>   Differential Revision:   7135
> 
> Just to notice that I am completely pissed of by this commit
> war, that you started.
> 
> I've been testing my changes properly, I gave people time to
> review my changes. You didn't.
> 
> From your explanation in other emails I see that you've been
> testing your changes with a version of FreeBSD that is a heavily
> modified FreeBSD 10, not 11.
> 
> The new code you mixed with revert of mine, doesn't fix the
> problem observed. It fixes another problem that you imagined,
> which might exist, but isn't observed. We already discussed that
> and you didn't prove it wrong.
> 
> Your change doesn't even revert my change completely.
> 
> -- 
> Totus tuus, Glebius.


Randall Stewart
r...@netflix.com
803-317-4952





___
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: r303088 - head/lib/libc/gen

2016-07-20 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 20 12:46:21 2016
New Revision: 303088
URL: https://svnweb.freebsd.org/changeset/base/303088

Log:
  In addition to r303074 case 1, search for protected L'/' too in globtilde()

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==
--- head/lib/libc/gen/glob.cWed Jul 20 11:23:06 2016(r303087)
+++ head/lib/libc/gen/glob.cWed Jul 20 12:46:21 2016(r303088)
@@ -126,7 +126,6 @@ struct glob_limit {
 #defineTILDE   L'~'
 #defineLBRACE  L'{'
 #defineRBRACE  L'}'
-#defineSLASH   L'/'
 #defineCOMMA   L','
 
 #ifndef DEBUG
@@ -427,10 +426,10 @@ globtilde(const Char *pattern, Char *pat
 */
eb = [patbuf_len - 1];
for (p = pattern + 1, b = patbuf;
-   b < eb && *p != EOS && *p != SLASH; *b++ = *p++)
+   b < eb && *p != EOS && UNPROT(*p) != SEP; *b++ = *p++)
continue;
 
-   if (*p != EOS && *p != SLASH)
+   if (*p != EOS && UNPROT(*p) != SEP)
return (NULL);
 
*b = EOS;
___
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: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-20 Thread Michal Meloun
Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):
>
>
> On 07/19/16 04:13, Michal Meloun wrote:
>> Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a):
>> Hi Nathan,
>> I’m afraid that skra is on vacation, for next 2 weeks (at minimum), so
>> please don’t expect quick response.
>>
>>> Could you please describe what this change is in more detail?
>> Short description is appended.
>>
>>> It breaks a lot of encapsulations we have worked very hard to maintain,
>>> moves ARM code into MI parts of the kernel, and the OFW parts violate
>>> IEEE 1275 (the Open Firmware standard). In particular, there is no
>>> guarantee that the interrupts for a newbus (or OF) device are
>>> encoded in
>>> a property called "interrupts" (or, indeed, in any property at all) on
>>> that node and there are many, many device trees where that is not the
>>> case (e.g. ones with interrupt maps, as well as Apple hardware). By
>>> putting that knowledge into the OF root bus device, which we have tried
>>> to keep it out of, this enforces a standard that doesn't actually
>>> exist.
>> Imho, this patch doesn’t change anything in this area. Only handling of
>> “interrupts” property is changed, all other cases are unchanged (I
>> hope).  Also, INTRNG code is currently shared by ARM, ARM64 and MIPS.
>
> But "interrupts" isn't a generic part of OF. This makes it one,
> incorrectly.
How? Can you be little more exact ?
>
>>
>>> I'm hesitant to ask for reversion on something that landed 6 weeks ago
>>> without me noticing, but this needs a lot more architectural work
>>> before
>>> any parts of the kernel should use it.
>>> -Nathan
>> I think that it’s too late.  This patch series consist of r301451
>> (https://reviews.freebsd.org/D6632),
>> r301453, r301539 and 301543.  And new GPIO interrupts are currently used
>> (by in tree drivers or in development trees).
>
> Well, then we need in-place rearchitecture.
>
>>
>>
>> The root of problem is that standard way of delivering interrupt
>> resource to consumer driver doesn’t works in OFW world.
>>
>> So we have some fact:
>> - the format of interrupt property is dependent of interrupt
>>controller and only interrupt controller can parse it.
>> - the interrupt property can have more data than just interrupt
>>number.
>> - single interrupt controller must be able to handle multiple
>>format of interrupt description.
>>
>> In pre-patchset era, simplebus enumerates children and attempts to set
>> memory and interrupts to resource list for them. But the interrupt
>> controllers are not yet populated so nobody can parse interrupt
>> property. Moreover, in all cases (parsed or not), we cannot store
>> complete interrupt description into resource list.
>
> We have done this for many years on PowerPC and sparc64 with delayed
> configuration of interrupts and a look-up table. This handles
> complicated bus configurations better than this code and requires no
> changes outside of a few MD files. That is why the (now partially
> duplicated) OFW_BUS_MAP_INTR() function exists. That one also has the
> benefit of still working when used in conjunction with, e.g., devices
> with an interrupt-map-mask property.
>
>>
>> The patch simply postpones reading of interrupt property to
>> bus_alloc_resource() (called by consumer driver) time.
>>
>> Due to this, we can:
>> - parse  interrupt property. The interrupt driver must exist
>>at this time.
>
> This only works with some types of interrupt properties, not all, and
> breaks if the interrupt driver hasn't attached yet (which it can't be
> guaranteed to -- some PPC systems have interrupt drivers that live on
> the PCI bus, for example).
How you can allocate (and reserve it in rman) interrupt if is not mapped
(so you have not real IRQ number for it). Just for notice -  multiple
virtual IRQs can be mapped into single real IRQ.

>
>> - bus_alloc_resource() returns resource, so we can attach parsed
>>interrupt data to it. By this, the resource itself can be used
>>for delivering configuration data to subsequent call to
>>bus_setup_intr() (or to all related  bus_() calls).
>>
>>
>> The patched code still accepts delivering of interrupts in resource
>> list.
>>
>> Michal
>>
>
> Given that other code depends on this, fixing it will likely require
> some complex work. I wish I had known about it when it went in.
>
> There are three main problems:
> 1. It doesn't work for interrupts defined by other mechanisms (e.g.
> interrupt-map properties)
I aggree, but missing ' interrupt-map' functioanlity is not caused by
this patch.
 
> 2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(),
> but is both problematically more general and less flexible (it has
> requirements on timing of PIC attachment vs. driver resource allocation)
OFW_BUS_MAP_INTR()  can parse only OFW  based data and expect that
parsed data are magicaly stored within the call.
The new method, bus_map_intr(),  can parse data from multiple sources 
(OFW, UEFI / ACPI, synthetic[gpio 

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

2016-07-20 Thread Emmanuel Vadot
Author: manu
Date: Wed Jul 20 11:23:06 2016
New Revision: 303087
URL: https://svnweb.freebsd.org/changeset/base/303087

Log:
  Add support for the SID (Security ID Module) on Allwinner A10 and A20.
  The rootkey is burnt at production and can't be changed, thus is can be used
  as a device unique ID or to generate a MAC address (This is was u-boot does).
  The rootkey is exposed as a sysctl (dev.aw_sid..rootkey).
  
  Reviewed by:  jmcneill
  Differential Revision:https://reviews.freebsd.org/D6383

Modified:
  head/sys/arm/allwinner/aw_sid.c
  head/sys/arm/allwinner/aw_sid.h

Modified: head/sys/arm/allwinner/aw_sid.c
==
--- head/sys/arm/allwinner/aw_sid.c Wed Jul 20 11:15:32 2016
(r303086)
+++ head/sys/arm/allwinner/aw_sid.c Wed Jul 20 11:23:06 2016
(r303087)
@@ -33,12 +33,14 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -50,13 +52,22 @@ __FBSDID("$FreeBSD$");
 #defineSID_THERMAL_CALIB0  (SID_SRAM + 0x34)
 #defineSID_THERMAL_CALIB1  (SID_SRAM + 0x38)
 
+enum sid_type {
+   A10_SID = 1,
+   A20_SID,
+   A83T_SID,
+};
+
 static struct ofw_compat_data compat_data[] = {
-   { "allwinner,sun8i-a83t-sid",   1 },
+   { "allwinner,sun4i-a10-sid",A10_SID},
+   { "allwinner,sun7i-a20-sid",A20_SID},
+   { "allwinner,sun8i-a83t-sid",   A83T_SID},
{ NULL, 0 }
 };
 
 struct aw_sid_softc {
struct resource *res;
+   int type;
 };
 
 static struct aw_sid_softc *aw_sid_sc;
@@ -66,9 +77,18 @@ static struct resource_spec aw_sid_spec[
{ -1, 0 }
 };
 
+enum sid_keys {
+   AW_SID_ROOT_KEY,
+};
+
+#defineROOT_KEY_OFF0x0
+#defineROOT_KEY_SIZE   4
+
 #defineRD4(sc, reg)bus_read_4((sc)->res, (reg))
 #defineWR4(sc, reg, val)   bus_write_4((sc)->res, (reg), (val))
 
+static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS);
+
 static int
 aw_sid_probe(device_t dev)
 {
@@ -96,6 +116,19 @@ aw_sid_attach(device_t dev)
 
aw_sid_sc = sc;
 
+   sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+   switch (sc->type) {
+   case A10_SID:
+   case A20_SID:
+   SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+   OID_AUTO, "rootkey",
+   CTLTYPE_STRING | CTLFLAG_RD,
+   dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key");
+   break;
+   default:
+   break;
+   }
return (0);
 }
 
@@ -107,6 +140,8 @@ aw_sid_read_tscalib(uint32_t *calib0, ui
sc = aw_sid_sc;
if (sc == NULL)
return (ENXIO);
+   if (sc->type != A83T_SID)
+   return (ENXIO);
 
*calib0 = RD4(sc, SID_THERMAL_CALIB0);
*calib1 = RD4(sc, SID_THERMAL_CALIB1);
@@ -114,6 +149,45 @@ aw_sid_read_tscalib(uint32_t *calib0, ui
return (0);
 }
 
+int
+aw_sid_get_rootkey(u_char *out)
+{
+   struct aw_sid_softc *sc;
+   int i;
+   u_int tmp;
+
+   sc = aw_sid_sc;
+   if (sc == NULL)
+   return (ENXIO);
+   if (sc->type != A10_SID && sc->type != A20_SID)
+   return (ENXIO);
+
+   for (i = 0; i < ROOT_KEY_SIZE ; i++) {
+   tmp = RD4(aw_sid_sc, ROOT_KEY_OFF + (i * 4));
+   be32enc([i * 4], tmp);
+   }
+
+   return (0);
+}
+
+static int
+aw_sid_sysctl(SYSCTL_HANDLER_ARGS)
+{
+   enum sid_keys key = arg2;
+   u_char rootkey[16];
+   char out[33];
+
+   if (key != AW_SID_ROOT_KEY)
+   return (ENOENT);
+
+   if (aw_sid_get_rootkey(rootkey) != 0)
+   return (ENOENT);
+   snprintf(out, sizeof(out),
+ "%16D", rootkey, "");
+
+   return sysctl_handle_string(oidp, out, sizeof(out), req);
+}
+
 static device_method_t aw_sid_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, aw_sid_probe),

Modified: head/sys/arm/allwinner/aw_sid.h
==
--- head/sys/arm/allwinner/aw_sid.h Wed Jul 20 11:15:32 2016
(r303086)
+++ head/sys/arm/allwinner/aw_sid.h Wed Jul 20 11:23:06 2016
(r303087)
@@ -30,5 +30,6 @@
 #define __AW_SID_H__
 
 intaw_sid_read_tscalib(uint32_t *, uint32_t *);
+intaw_sid_get_rootkey(u_char *out);
 
 #endif /* !__AW_SID_H__ */
___
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: r303086 - head/cddl/contrib/opensolaris/cmd/zdb

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 11:15:32 2016
New Revision: 303086
URL: https://svnweb.freebsd.org/changeset/base/303086

Log:
  MFV r303083: 7164 zdb should be able to open the root dataset
  
  Note: conversion of the manual page change from roff to mdoc is mine.
  
  illumos/illumos-gate@b702644a6eb66615d67b492fd73ecd9efa11fc7d
  
https://github.com/illumos/illumos-gate/commit/b702644a6eb66615d67b492fd73ecd9efa11fc7d
  
  https://www.illumos.org/issues/7164
If the pool/dataset command-line argument is specified with a trailing
slash, for example, "tank/", we should interpret it as the topmost
dataset (rather than the whole pool)
  
  Reviewed by: Pavel Zakharov 
  Reviewed by: Matthew Ahrens 
  Approved by: Robert Mustacchi 
  Author: Tim Chase 
  PR:   204661
  MFC after:1 week
  Relnotes: yes

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed Jul 20 11:04:49 2016
(r303085)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed Jul 20 11:15:32 2016
(r303086)
@@ -86,6 +86,17 @@ pool, and is inherently unstable.
 The precise output of most invocations is not documented, a knowledge of ZFS
 internals is assumed.
 .Pp
+If the
+.Ar dataset
+argument does not contain any
+.Sy /
+or
+.Sy @
+characters, it is interpreted as a pool name.
+The root dataset can be specified as
+.Pa pool Ns Sy /
+(pool name followed by a slash).
+.Pp
 When operating on an imported and active pool it is possible, though unlikely,
 that zdb may interpret inconsistent pool data and behave erratically.
 .Sh OPTIONS

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Jul 20 11:04:49 2016
(r303085)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Jul 20 11:15:32 2016
(r303086)
@@ -3559,6 +3559,7 @@ main(int argc, char **argv)
uint64_t max_txg = UINT64_MAX;
int rewind = ZPOOL_NEVER_REWIND;
char *spa_config_path_env;
+   boolean_t target_is_spa = B_TRUE;
 
(void) setrlimit(RLIMIT_NOFILE, );
(void) enable_extended_FILE_stdio(-1, -1);
@@ -3738,8 +3739,23 @@ main(int argc, char **argv)
}
}
 
+   if (strpbrk(target, "/@") != NULL) {
+   size_t targetlen;
+
+   target_is_spa = B_FALSE;
+   /*
+* Remove any trailing slash.  Later code would get confused
+* by it, but we want to allow it so that "pool/" can
+* indicate that we want to dump the topmost filesystem,
+* rather than the whole pool.
+*/
+   targetlen = strlen(target);
+   if (targetlen != 0 && target[targetlen - 1] == '/')
+   target[targetlen - 1] = '\0';
+   }
+
if (error == 0) {
-   if (strpbrk(target, "/@") == NULL || dump_opt['R']) {
+   if (target_is_spa || dump_opt['R']) {
error = spa_open_rewind(target, , FTAG, policy,
NULL);
if (error) {
___
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: r303085 - head/share/man/man4

2016-07-20 Thread Alexander Motin
Author: mav
Date: Wed Jul 20 11:04:49 2016
New Revision: 303085
URL: https://svnweb.freebsd.org/changeset/base/303085

Log:
  Remove outdated list of supported chipsets, generalizing it.

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

Modified: head/share/man/man4/ichsmb.4
==
--- head/share/man/man4/ichsmb.4Wed Jul 20 10:06:56 2016
(r303084)
+++ head/share/man/man4/ichsmb.4Wed Jul 20 11:04:49 2016
(r303085)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 28, 2007
+.Dd July 20, 2016
 .Dt ICHSMB 4
 .Os
 .Sh NAME
@@ -46,10 +46,12 @@
 .Cd device smb
 .Cd device ichsmb
 .Sh DESCRIPTION
-This driver provides access to the SMBus controller logical
-device contained in the Intel 82801AA (ICH), 82801AB (ICH0),
-82801BA (ICH2), 82801CA (ICH3), 82801DC (ICH4), 82801EB (ICH5),
-82801FB (ICH6) and 82801GB (ICH7) PCI chips.
+The
+.Nm
+driver provides
+.Xr smbus 4
+support for the SMBus controller logical device contained in all Intel
+motherboard chipsets starting from 82801AA (ICH).
 .Sh SEE ALSO
 .Xr smb 4 ,
 .Xr smbus 4
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303084 - head/cddl/contrib/opensolaris/cmd/zdb

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 10:06:56 2016
New Revision: 303084
URL: https://svnweb.freebsd.org/changeset/base/303084

Log:
  MFV r303082: 6391 Override default SPA config location via environment
  
  illumos/illumos-gate@ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
  
https://github.com/illumos/illumos-gate/commit/ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
  
  https://www.illumos.org/issues/6391
When using zdb with non-default SPA config file it is not convenient
to add -U  all the time. This commit
introduces support for setting/overriding SPA config location via
environment variable 'SPA_CONFIG_PATH'.
If -U flag is specified in the command line it will override any other
value as usual.
  
  
https://github.com/zfsonlinux/zfs/commit/64d7b6cf75e52a4698d9bdec61745573c39d2e5a
  
  Reviewed by: Brian Behlendorf 
  Reviewed by: Richard Yao 
  Reviewed by: Matthew Ahrens 
  Reviewed by: Will Andrews 
  Reviewed by: George Wilson 
  Approved by: Robert Mustacchi 
  Author: Cyril Plisko 
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Jul 20 09:58:10 2016
(r303083)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Jul 20 10:06:56 2016
(r303084)
@@ -3558,12 +3558,22 @@ main(int argc, char **argv)
nvlist_t *policy = NULL;
uint64_t max_txg = UINT64_MAX;
int rewind = ZPOOL_NEVER_REWIND;
+   char *spa_config_path_env;
 
(void) setrlimit(RLIMIT_NOFILE, );
(void) enable_extended_FILE_stdio(-1, -1);
 
dprintf_setup(, argv);
 
+   /*
+* If there is an environment variable SPA_CONFIG_PATH it overrides
+* default spa_config_path setting. If -U flag is specified it will
+* override this environment variable settings once again.
+*/
+   spa_config_path_env = getenv("SPA_CONFIG_PATH");
+   if (spa_config_path_env != NULL)
+   spa_config_path = spa_config_path_env;
+
while ((c = getopt(argc, argv,
"bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) {
switch (c) {
___
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: r303083 - in vendor/illumos/dist: cmd/zdb man/man1m

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:58:10 2016
New Revision: 303083
URL: https://svnweb.freebsd.org/changeset/base/303083

Log:
  7164 zdb should be able to open the root dataset
  
  illumos/illumos-gate@b702644a6eb66615d67b492fd73ecd9efa11fc7d
  
https://github.com/illumos/illumos-gate/commit/b702644a6eb66615d67b492fd73ecd9efa11fc7d
  
  https://www.illumos.org/issues/7164
If the pool/dataset command-line argument is specified with a trailing
slash, for example, "tank/", we should interpret it as the topmost
dataset (rather than the whole pool)
  
  Reviewed by: Pavel Zakharov 
  Reviewed by: Matthew Ahrens 
  Approved by: Robert Mustacchi 
  Author: Tim Chase 

Modified:
  vendor/illumos/dist/cmd/zdb/zdb.c
  vendor/illumos/dist/man/man1m/zdb.1m

Modified: vendor/illumos/dist/cmd/zdb/zdb.c
==
--- vendor/illumos/dist/cmd/zdb/zdb.c   Wed Jul 20 09:57:16 2016
(r303082)
+++ vendor/illumos/dist/cmd/zdb/zdb.c   Wed Jul 20 09:58:10 2016
(r303083)
@@ -3530,6 +3530,7 @@ main(int argc, char **argv)
uint64_t max_txg = UINT64_MAX;
int rewind = ZPOOL_NEVER_REWIND;
char *spa_config_path_env;
+   boolean_t target_is_spa = B_TRUE;
 
(void) setrlimit(RLIMIT_NOFILE, );
(void) enable_extended_FILE_stdio(-1, -1);
@@ -3708,8 +3709,23 @@ main(int argc, char **argv)
}
}
 
+   if (strpbrk(target, "/@") != NULL) {
+   size_t targetlen;
+
+   target_is_spa = B_FALSE;
+   /*
+* Remove any trailing slash.  Later code would get confused
+* by it, but we want to allow it so that "pool/" can
+* indicate that we want to dump the topmost filesystem,
+* rather than the whole pool.
+*/
+   targetlen = strlen(target);
+   if (targetlen != 0 && target[targetlen - 1] == '/')
+   target[targetlen - 1] = '\0';
+   }
+
if (error == 0) {
-   if (strpbrk(target, "/@") == NULL || dump_opt['R']) {
+   if (target_is_spa || dump_opt['R']) {
error = spa_open_rewind(target, , FTAG, policy,
NULL);
if (error) {

Modified: vendor/illumos/dist/man/man1m/zdb.1m
==
--- vendor/illumos/dist/man/man1m/zdb.1mWed Jul 20 09:57:16 2016
(r303082)
+++ vendor/illumos/dist/man/man1m/zdb.1mWed Jul 20 09:58:10 2016
(r303083)
@@ -56,6 +56,11 @@ pool, and is inherently unstable. The pr
 not documented, a knowledge of ZFS internals is assumed.
 
 .P
+If the \fIdataset\fR argument does not contain any \fB/\fR or \fB@\fR
+characters, it is interpreted as a pool name.  The root dataset can be
+specified as \fIpool\fB/\fR (pool name followed by a slash).
+
+.P
 When operating on an imported and active pool it is possible, though unlikely,
 that zdb may interpret inconsistent pool data and behave erratically.
 
___
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: r303082 - vendor/illumos/dist/cmd/zdb

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:57:16 2016
New Revision: 303082
URL: https://svnweb.freebsd.org/changeset/base/303082

Log:
  6391 Override default SPA config location via environment
  
  illumos/illumos-gate@ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
  
https://github.com/illumos/illumos-gate/commit/ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
  
  https://www.illumos.org/issues/6391
When using zdb with non-default SPA config file it is not convenient
to add -U  all the time. This commit
introduces support for setting/overriding SPA config location via
environment variable 'SPA_CONFIG_PATH'.
If -U flag is specified in the command line it will override any other
value as usual.
  
  
https://github.com/zfsonlinux/zfs/commit/64d7b6cf75e52a4698d9bdec61745573c39d2e5a
  
  Reviewed by: Brian Behlendorf 
  Reviewed by: Richard Yao 
  Reviewed by: Matthew Ahrens 
  Reviewed by: Will Andrews 
  Reviewed by: George Wilson 
  Approved by: Robert Mustacchi 
  Author: Cyril Plisko 

Modified:
  vendor/illumos/dist/cmd/zdb/zdb.c

Modified: vendor/illumos/dist/cmd/zdb/zdb.c
==
--- vendor/illumos/dist/cmd/zdb/zdb.c   Wed Jul 20 09:54:18 2016
(r303081)
+++ vendor/illumos/dist/cmd/zdb/zdb.c   Wed Jul 20 09:57:16 2016
(r303082)
@@ -3529,12 +3529,22 @@ main(int argc, char **argv)
nvlist_t *policy = NULL;
uint64_t max_txg = UINT64_MAX;
int rewind = ZPOOL_NEVER_REWIND;
+   char *spa_config_path_env;
 
(void) setrlimit(RLIMIT_NOFILE, );
(void) enable_extended_FILE_stdio(-1, -1);
 
dprintf_setup(, argv);
 
+   /*
+* If there is an environment variable SPA_CONFIG_PATH it overrides
+* default spa_config_path setting. If -U flag is specified it will
+* override this environment variable settings once again.
+*/
+   spa_config_path_env = getenv("SPA_CONFIG_PATH");
+   if (spa_config_path_env != NULL)
+   spa_config_path = spa_config_path_env;
+
while ((c = getopt(argc, argv,
"bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) {
switch (c) {
___
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: r303081 - vendor/illumos/dist/cmd/ztest

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:54:18 2016
New Revision: 303081
URL: https://svnweb.freebsd.org/changeset/base/303081

Log:
  7163 ztest failures due to excess error injection
  
  illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155
  
https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c3101155
  
  https://www.illumos.org/issues/7163
Running zloop from zfs-precommit hit this assertion:
 *panicstr/s
0xfd7fd7419370: assertion failed for thread 0xfd7fe29ed240,
thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line
1827
 $c
libc.so.1`_lwp_kill+0xa()
libc.so.1`_assfail+0x182(fd7ffb1c29fa, fd7ffb1cc028, 723)
libc.so.1`assfail+0x19(fd7ffb1c29fa, fd7ffb1cc028, 723)
libzpool.so.1`dbuf_dirty+0xc69(10e3bc10, 3601700)
libzpool.so.1`dbuf_dirty+0x61e(10c73640, 3601700)
libzpool.so.1`dbuf_dirty+0x61e(10e28280, 3601700)
libzpool.so.1`dmu_buf_will_fill+0x64(10e28280, 3601700)
libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 40002e00, 200, 3717b40,
3601700)
ztest_replay_write+0x568(4950d0, 3717a80, 0)
ztest_write+0x125(4950d0, d, 40002e00, 200, 413f000)
ztest_io+0x1bb(4950d0, d, 40002e00)
ztest_dmu_write_parallel+0xaa(4950d0, 6)
ztest_execute+0x83(1, 420c98, 6)
ztest_thread+0xf4(6)
libc.so.1`_thrp_setup+0x8a(fd7fe29ed240)
libc.so.1`_lwp_start()
This is another manifestation of ECKSUM in ztest:
The lowest level ancestor that’s in memory is the L8 (topmost). The L7
ancestor is blkid 0x10:
 ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf
addr object lvl blkid holds os
600be50 d 7 4 1 ztest/ds_6
719d880 d 7 0 4 ztest/ds_6
  
  Reviewed by: George Wilson 
  Reviewed by: Paul Dagnelie 
  Approved by: Robert Mustacchi 
  Author: Matthew Ahrens 

Modified:
  vendor/illumos/dist/cmd/ztest/ztest.c

Modified: vendor/illumos/dist/cmd/ztest/ztest.c
==
--- vendor/illumos/dist/cmd/ztest/ztest.c   Wed Jul 20 09:53:46 2016
(r303080)
+++ vendor/illumos/dist/cmd/ztest/ztest.c   Wed Jul 20 09:54:18 2016
(r303081)
@@ -4792,7 +4792,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6
char path0[MAXPATHLEN];
char pathrand[MAXPATHLEN];
size_t fsize;
-   int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */
+   int bshift = SPA_MAXBLOCKSHIFT + 2;
int iters = 1000;
int maxfaults;
int mirror_save;
@@ -4982,7 +4982,29 @@ ztest_fault_inject(ztest_ds_t *zd, uint6
(leaves << bshift) + (leaf << bshift) +
(ztest_random(1ULL << (bshift - 1)) & -8ULL);
 
-   if (offset >= fsize)
+   /*
+* Only allow damage to the labels at one end of the vdev.
+*
+* If all labels are damaged, the device will be totally
+* inaccessible, which will result in loss of data,
+* because we also damage (parts of) the other side of
+* the mirror/raidz.
+*
+* Additionally, we will always have both an even and an
+* odd label, so that we can handle crashes in the
+* middle of vdev_config_sync().
+*/
+   if ((leaf & 1) == 0 && offset < VDEV_LABEL_START_SIZE)
+   continue;
+
+   /*
+* The two end labels are stored at the "end" of the disk, but
+* the end of the disk (vdev_psize) is aligned to
+* sizeof (vdev_label_t).
+*/
+   uint64_t psize = P2ALIGN(fsize, sizeof (vdev_label_t));
+   if ((leaf & 1) == 1 &&
+   offset + sizeof (bad) > psize - VDEV_LABEL_END_SIZE)
continue;
 
VERIFY(mutex_lock(_vdev_lock) == 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r303080 - vendor/illumos/dist/cmd/ztest

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:53:46 2016
New Revision: 303080
URL: https://svnweb.freebsd.org/changeset/base/303080

Log:
  6451 ztest fails due to checksum errors
  
  illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7
  
https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7
  
  https://www.illumos.org/issues/6451
Sometimes ztest fails because zdb detects checksum errors. e.g.:
Traversing all blocks to verify checksums and verify nothing leaked ...
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000:
18> [L0 other uint64[]] sha256 uncompressed LE contiguou
s unique single size=10L/10P birth=271L/271P fill=1
cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf --
skipping
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 80180> DVA0=<0:ce16800:
18> [L0 other uint64[]] sha256 uncompressed LE contigu
ous unique single size=10L/10P birth=840L/840P fill=1
cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75
-- skipping
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 100360> 
DVA0=<0:10d37400:
18> [L0 other uint64[]] sha256 uncompressed LE conti
guous unique single size=10L/10P birth=904L/904P fill=1
cksum=fa1e11d4138bd14b:86c9488c73e3:f31e43c72e72e46b:e3446472d1174d
ba -- skipping
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 40002c0> 
DVA0=<0:127ef400:
18> [L0 other uint64[]] sha256 uncompressed LE cont
iguous dedup single size=10L/10P birth=549L/549P fill=1
cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb
58 -- skipping
zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> 
DVA0=<0:1a180400:18>
[L0 other uint64[]] fletcher4 uncompressed LE contiguou
s unique single size=10L/10P birth=1091L/1091P fill=1 
cksum=a6cf1e50:
29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin
g
The problem is that ztest_fault_inject() can inject multiple faults into the
same block. It is designed such that it can inject errors on all leafs of a
RAID-Z or mirror, but for a given range of offsets, it will only inject 
errors
  
  Reviewed by: George Wilson 
  Reviewed by: Prakash Surya 
  Reviewed by: Jorgen Lundman 
  Approved by: Dan McDonald 
  Author: Matthew Ahrens 

Modified:
  vendor/illumos/dist/cmd/ztest/ztest.c

Modified: vendor/illumos/dist/cmd/ztest/ztest.c
==
--- vendor/illumos/dist/cmd/ztest/ztest.c   Wed Jul 20 09:51:33 2016
(r303079)
+++ vendor/illumos/dist/cmd/ztest/ztest.c   Wed Jul 20 09:53:46 2016
(r303080)
@@ -4792,7 +4792,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6
char path0[MAXPATHLEN];
char pathrand[MAXPATHLEN];
size_t fsize;
-   int bshift = SPA_OLD_MAXBLOCKSHIFT + 2; /* don't scrog all labels */
+   int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */
int iters = 1000;
int maxfaults;
int mirror_save;
@@ -4953,6 +4953,31 @@ ztest_fault_inject(ztest_ds_t *zd, uint6
fsize = lseek(fd, 0, SEEK_END);
 
while (--iters != 0) {
+   /*
+* The offset must be chosen carefully to ensure that
+* we do not inject a given logical block with errors
+* on two different leaf devices, because ZFS can not
+* tolerate that (if maxfaults==1).
+*
+* We divide each leaf into chunks of size
+* (# leaves * SPA_MAXBLOCKSIZE * 4).  Within each chunk
+* there is a series of ranges to which we can inject errors.
+* Each range can accept errors on only a single leaf vdev.
+* The error injection ranges are separated by ranges
+* which we will not inject errors on any device (DMZs).
+* Each DMZ must be large enough such that a single block
+* can not straddle it, so that a single block can not be
+* a target in two different injection ranges (on different
+* leaf vdevs).
+*
+* For example, with 3 leaves, each chunk looks like:
+*0 to  32M: injection range for leaf 0
+*  32M to  64M: DMZ - no injection allowed
+*  64M to  96M: injection range for leaf 1
+*  96M to 128M: DMZ - no injection allowed
+* 128M to 160M: injection range for leaf 2
+* 160M to 192M: DMZ - no injection allowed
+*/
offset = ztest_random(fsize / (leaves << bshift)) *
(leaves << bshift) + (leaf << bshift) +

svn commit: r303079 - vendor/illumos/dist/cmd/ztest

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:51:33 2016
New Revision: 303079
URL: https://svnweb.freebsd.org/changeset/base/303079

Log:
  7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion
  
  illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3
  
https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d73a51e3
  
  https://www.illumos.org/issues/7147
Here's the dbuf we're currently reading:
 966f200::dbuf
addr object lvl blkid holds os
966f200 4 0 0 1 ztest/ds_3
 966f200::print dmu_buf_t db_data
db_data = 0x9ae0400
 0x9ae0400/10J
0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
c1c7ced932020d c1c7ced932020d
The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt 
to
read the block on disk we find that it has matches what ztest_ddt_repair()
would have written:
 ~c1c7ced932020d=J
ff3e383126cdfdf2
 966f200::print dmu_buf_impl_t db_blkptr | ::blkptr
DVA0=<0:71d3c00:800>
[L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single
size=400L/400P birth=55L/55P fill=1
cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0
   1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head
  Found vdev type: mirror
0:71d3c00:800
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>&18>.
10: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>&18>.
20: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>&18>.
30: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>&18>.
40: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>&18>.
50: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>&18>.
  
  Reviewed by: Matthew Ahrens 
  Reviewed by: Prakash Surya 
  Approved by: Robert Mustacchi 
  Author: George Wilson 

Modified:
  vendor/illumos/dist/cmd/ztest/ztest.c

Modified: vendor/illumos/dist/cmd/ztest/ztest.c
==
--- vendor/illumos/dist/cmd/ztest/ztest.c   Wed Jul 20 09:49:09 2016
(r303078)
+++ vendor/illumos/dist/cmd/ztest/ztest.c   Wed Jul 20 09:51:33 2016
(r303079)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  * Copyright (c) 2014 Integros [integros.com]
@@ -5021,9 +5021,14 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_
return;
}
 
+   dmu_objset_stats_t dds;
+   dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
+   dmu_objset_fast_stat(os, );
+   dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
+
object = od[0].od_object;
blocksize = od[0].od_blocksize;
-   pattern = zs->zs_guid ^ dmu_objset_fsid_guid(os);
+   pattern = zs->zs_guid ^ dds.dds_guid;
 
ASSERT(object != 0);
 
@@ -5625,9 +5630,13 @@ ztest_run(ztest_shared_t *zs)
metaslab_preload_limit = ztest_random(20) + 1;
ztest_spa = spa;
 
+   dmu_objset_stats_t dds;
VERIFY0(dmu_objset_own(ztest_opts.zo_pool,
DMU_OST_ANY, B_TRUE, FTAG, ));
-   zs->zs_guid = dmu_objset_fsid_guid(os);
+   dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
+   dmu_objset_fast_stat(os, );
+   dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
+   zs->zs_guid = dds.dds_guid;
dmu_objset_disown(os, FTAG);
 
spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN;
___
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: r303078 - vendor-sys/illumos/dist/uts/common/fs/zfs

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:49:09 2016
New Revision: 303078
URL: https://svnweb.freebsd.org/changeset/base/303078

Log:
  7086 ztest attempts dva_get_dsize_sync on an embedded blockpointer
  
  illumos/illumos-gate@926549256b71acd595f69b236779ff6b78fa08ef
  
https://github.com/illumos/illumos-gate/commit/926549256b71acd595f69b236779ff6b78fa08ef
  
  https://www.illumos.org/issues/7086
In dbuf_dirty(), we need to grab the dn_struct_rwlock before looking at the
db_blkptr, to prevent it from being changed by syncing context.
Otherwise we may see that ztest got a segfault from this stack:
libzpool.so.1`dva_get_dsize_sync+0x98(872f000, b32b240, fed7811b, 0, 
b4cda20, 0)
libzpool.so.1`bp_get_dsize+0x60(872f000, b32b240, 0, 97cb780, 9d4c1a8, 0)
libzpool.so.1`dbuf_dirty+0x9b3(ce0a100, 97cb780, 9, fecd2530)
libzpool.so.1`dmu_buf_will_dirty+0xc3(ce0a100, 97cb780, ea293d6c, 1)
libzpool.so.1`zap_lockdir+0x1a0(8aaa3c0, 1, 0, 97cb780, 1, 1)
libzpool.so.1`zap_remove_norm+0x30(8aaa3c0, 1, 0, 8728b10, 0, 97cb780)
libzpool.so.1`zap_remove+0x29(8aaa3c0, 1, 0, 8728b10, 97cb780, a)
ztest_replay_remove+0x225(ea294588, 8728ae8, 0, 3801, 0, 0)
ztest_remove+0x9f(ea294588, ea293f50, 4, 3)
ztest_object_init+0x78(ea294588, ea293f50, 4e0, 1)
ztest_dmu_object_alloc_free+0x71(ea294588, 13)
ztest_dmu_objset_create_destroy+0x224(80cef08, 13, 0, 805d36c, 9017ad44, 0)
ztest_execute+0x89(a, 807c720, 13, 0)
ztest_thread+0xea(13, 0, 0, 0)
libc.so.1`_thrp_setup+0x88(f0983240)
libc.so.1`_lwp_start(f0983240, 0, 0, 0, 0, 0)
Looking into it a bit, we see that this is an embedded blockpointer, so
BP_GET_NDVAS should have returned 0:
 b32b240::blkptr
EMBEDDED [L0 ZAP_OTHER] et=0 LZ4 size=200L/4aP birth=80L
Instead, it looks like another thread is modifying this blockpointer:
 b32b240::ugrep | ::whatis
f47a0e0c is in [ stack tid=0x19f ]
ebd6ec40 is in [ stack tid=0x226 ]
ea293bd0 is in [ stack tid=0x244 ]
ea293be4 is in [ stack tid=0x244 ]
  
  Reviewed by: Prakash Surya 
  Reviewed by: George Wilson 
  Approved by: Robert Mustacchi 
  Author: Matthew Ahrens 

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.cWed Jul 20 09:47:35 
2016(r303077)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.cWed Jul 20 09:49:09 
2016(r303078)
@@ -1662,7 +1662,20 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t 
dnode_setdirty(dn, tx);
DB_DNODE_EXIT(db);
return (dr);
-   } else if (do_free_accounting) {
+   }
+
+   /*
+* The dn_struct_rwlock prevents db_blkptr from changing
+* due to a write from syncing context completing
+* while we are running, so we want to acquire it before
+* looking at db_blkptr.
+*/
+   if (!RW_WRITE_HELD(>dn_struct_rwlock)) {
+   rw_enter(>dn_struct_rwlock, RW_READER);
+   drop_struct_lock = TRUE;
+   }
+
+   if (do_free_accounting) {
blkptr_t *bp = db->db_blkptr;
int64_t willfree = (bp && !BP_IS_HOLE(bp)) ?
bp_get_dsize(os->os_spa, bp) : db->db.db_size;
@@ -1678,11 +1691,6 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t 
dnode_willuse_space(dn, -willfree, tx);
}
 
-   if (!RW_WRITE_HELD(>dn_struct_rwlock)) {
-   rw_enter(>dn_struct_rwlock, RW_READER);
-   drop_struct_lock = TRUE;
-   }
-
if (db->db_level == 0) {
dnode_new_blkid(dn, db->db_blkid, tx, drop_struct_lock);
ASSERT(dn->dn_maxblkid >= db->db_blkid);
___
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: r303077 - vendor-sys/illumos/dist/uts/common/fs/zfs

2016-07-20 Thread Andriy Gapon
Author: avg
Date: Wed Jul 20 09:47:35 2016
New Revision: 303077
URL: https://svnweb.freebsd.org/changeset/base/303077

Log:
  7072 zfs fails to expand if lun added when os is in shutdown state
  
  illumos/illumos-gate@c39a2aae1e2c439d156021edfc20910dad7f9891
  
https://github.com/illumos/illumos-gate/commit/c39a2aae1e2c439d156021edfc20910dad7f9891
  
  https://www.illumos.org/issues/7072
upstream:
38733 zfs fails to expand if lun added when os is in shutdown state
DLPX-36910 spares and caches should not display expandable space
DLPX-39262 vdev_disk_open spam zfs_dbgmsg buffer
  
  Reviewed by: Igor Kozhukhov 
  Reviewed by: Dan Kimmel 
  Reviewed by: Matthew Ahrens 
  Reviewed by: Prakash Surya 
  Reviewed by: Alex Reece 
  Approved by: Dan McDonald 
  Author: George Wilson 

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.cWed Jul 20 
09:29:39 2016(r303076)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.cWed Jul 20 
09:47:35 2016(r303077)
@@ -381,7 +381,13 @@ metaslab_class_expandable_space(metaslab
continue;
}
 
-   space += tvd->vdev_max_asize - tvd->vdev_asize;
+   /*
+* Calculate if we have enough space to add additional
+* metaslabs. We report the expandable space in terms
+* of the metaslab size since that's the unit of expansion.
+*/
+   space += P2ALIGN(tvd->vdev_max_asize - tvd->vdev_asize,
+   1ULL << tvd->vdev_ms_shift);
}
spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG);
return (space);

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.cWed Jul 20 09:29:39 
2016(r303076)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.cWed Jul 20 09:47:35 
2016(r303077)
@@ -2731,6 +2731,7 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t *
 {
spa_t *spa = vd->vdev_spa;
vdev_t *rvd = spa->spa_root_vdev;
+   vdev_t *tvd = vd->vdev_top;
 
ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0);
 
@@ -2741,7 +2742,15 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t *
vs->vs_rsize = vdev_get_min_asize(vd);
if (vd->vdev_ops->vdev_op_leaf)
vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE;
-   vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize;
+   /*
+* Report expandable space on top-level, non-auxillary devices only.
+* The expandable space is reported in terms of metaslab sized units
+* since that determines how much space the pool can expand.
+*/
+   if (vd->vdev_aux == NULL && tvd != NULL) {
+   vs->vs_esize = P2ALIGN(vd->vdev_max_asize - vd->vdev_asize,
+   1ULL << tvd->vdev_ms_shift);
+   }
if (vd->vdev_aux == NULL && vd == vd->vdev_top && !vd->vdev_ishole) {
vs->vs_fragmentation = vd->vdev_mg->mg_fragmentation;
}

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c   Wed Jul 20 
09:29:39 2016(r303076)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c   Wed Jul 20 
09:47:35 2016(r303077)
@@ -241,34 +241,6 @@ vdev_disk_rele(vdev_t *vd)
}
 }
 
-static uint64_t
-vdev_disk_get_space(vdev_t *vd, uint64_t capacity, uint_t blksz)
-{
-   ASSERT(vd->vdev_wholedisk);
-
-   vdev_disk_t *dvd = vd->vdev_tsd;
-   dk_efi_t dk_ioc;
-   efi_gpt_t *efi;
-   uint64_t avail_space = 0;
-   int efisize = EFI_LABEL_SIZE * 2;
-
-   dk_ioc.dki_data = kmem_alloc(efisize, KM_SLEEP);
-   dk_ioc.dki_lba = 1;
-   dk_ioc.dki_length = efisize;
-   dk_ioc.dki_data_64 = (uint64_t)(uintptr_t)dk_ioc.dki_data;
-   efi = dk_ioc.dki_data;
-
-   if (ldi_ioctl(dvd->vd_lh, DKIOCGETEFI, (intptr_t)_ioc,
-   FKIOCTL, kcred, NULL) == 0) {
-   uint64_t efi_altern_lba = LE_64(efi->efi_gpt_AlternateLBA);
-
-   if (capacity > efi_altern_lba)
-   avail_space = (capacity - efi_altern_lba) * blksz;
-   }
-   kmem_free(dk_ioc.dki_data, efisize);
-   return (avail_space);
-}
-
 /*
  * We want to be loud in DEBUG kernels when DKIOCGMEDIAINFOEXT 

svn commit: r303076 - head/sys/dev/fb

2016-07-20 Thread Roger Pau Monné
Author: royger
Date: Wed Jul 20 09:29:39 2016
New Revision: 303076
URL: https://svnweb.freebsd.org/changeset/base/303076

Log:
  vesa: fix panic on suspend
  
  Fix the following panic seen when migrating a FreeBSD guest on Xen:
  
  panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541
  cpuid = 0
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe001d2fa4f0
  vpanic() at vpanic+0x182/frame 0xfe001d2fa570
  kassert_panic() at kassert_panic+0x126/frame 0xfe001d2fa5e0
  __mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfe001d2fa630
  vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 
0xfe001d2fa680
  vga_suspend() at vga_suspend+0xa3/frame 0xfe001d2fa6b0
  isavga_suspend() at isavga_suspend+0x1d/frame 0xfe001d2fa6d0
  bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame
  [...]
  
  This is caused because vga_sub_configure (which is called if the VGA adapter
  is attached after VESA tried to initialize), points to vesa_configure, which
  doesn't initialize the VESA mutex. In order to fix it, make sure
  vga_sub_configure points to vesa_load, so that all the needed vesa
  components are properly initialized.
  
  Sponsored by: Citrix Systems R
  MFC after:3 days
  PR:   209203
  Reviewed by:  dumbbell
  Differential revision:https://reviews.freebsd.org/D7196

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Wed Jul 20 07:33:48 2016(r303075)
+++ head/sys/dev/fb/vesa.c  Wed Jul 20 09:29:39 2016(r303076)
@@ -134,6 +134,7 @@ static vi_fill_rect_t   vesa_fill_rect;
 static vi_bitblt_t vesa_bitblt;
 static vi_diag_t   vesa_diag;
 static int vesa_bios_info(int level);
+static int vesa_late_load(int flags);
 
 static video_switch_t vesavidsw = {
vesa_probe,
@@ -1141,7 +1142,7 @@ vesa_configure(int flags)
 * initialization for now and try again later.
 */
if (adp == NULL) {
-   vga_sub_configure = vesa_configure;
+   vga_sub_configure = vesa_late_load;
return (ENODEV);
}
 
@@ -1909,6 +1910,17 @@ vesa_bios_info(int level)
 static int
 vesa_load(void)
 {
+
+   return (vesa_late_load(0));
+}
+
+/*
+ * To be called from the vga_sub_configure hook in case the VGA adapter is
+ * not found when VESA is loaded.
+ */
+static int
+vesa_late_load(int flags)
+{
int error;
 
if (vesa_init_done)
@@ -1918,7 +1930,7 @@ vesa_load(void)
 
/* locate a VGA adapter */
vesa_adp = NULL;
-   error = vesa_configure(0);
+   error = vesa_configure(flags);
 
if (error == 0)
vesa_bios_info(bootverbose);
___
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: r303043 - in head: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb

2016-07-20 Thread Kubilay Kocak
On 20/07/2016 5:20 AM, Conrad E. Meyer wrote:
> Author: cem
> Date: Tue Jul 19 19:20:47 2016
> New Revision: 303043
> URL: https://svnweb.freebsd.org/changeset/base/303043
> 
> Log:
>   Increase vt(4) framebuffer maximum size
>   
>   And rename "DEFAULT" constants to the more accurate "MAX."
>   
>   PR: 210382
>   Submitted by:   Felix 
>   Reviewed by:wblock, cem
>   Tested by:  Dave Cottlehuber 

Can MFC?

There are high hopes for this coming out in 11.0 / next 10.x

re is cc'd on the original bugzilla issue

> Modified:
>   head/share/man/man4/vt.4
>   head/sys/dev/vt/hw/fb/vt_fb.c
>   head/sys/dev/vt/vt.h
>   head/sys/dev/vt/vt_core.c
> 
> Modified: head/share/man/man4/vt.4
> ==
> --- head/share/man/man4/vt.4  Tue Jul 19 19:19:03 2016(r303042)
> +++ head/share/man/man4/vt.4  Tue Jul 19 19:20:47 2016(r303043)
> @@ -24,7 +24,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd June 21, 2016
> +.Dd July 19, 2016
>  .Dt "VIRTUAL TERMINALS" 4
>  .Os
>  .Sh NAME
> @@ -36,8 +36,8 @@
>  .Cd "options VT_MAXWINDOWS=N"
>  .Cd "options VT_ALT_TO_ESC_HACK=1"
>  .Cd "options VT_TWOBUTTON_MOUSE"
> -.Cd "options VT_FB_DEFAULT_WIDTH=X"
> -.Cd "options VT_FB_DEFAULT_HEIGHT=Y"
> +.Cd "options VT_FB_MAX_WIDTH=X"
> +.Cd "options VT_FB_MAX_HEIGHT=Y"
>  .Cd "options SC_NO_CUTPASTE"
>  .Cd "device vt"
>  .Pp
> 
> Modified: head/sys/dev/vt/hw/fb/vt_fb.c
> ==
> --- head/sys/dev/vt/hw/fb/vt_fb.c Tue Jul 19 19:19:03 2016
> (r303042)
> +++ head/sys/dev/vt/hw/fb/vt_fb.c Tue Jul 19 19:20:47 2016
> (r303043)
> @@ -416,10 +416,10 @@ vt_fb_init(struct vt_device *vd)
>   int err;
>  
>   info = vd->vd_softc;
> - vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height);
> + vd->vd_height = MIN(VT_FB_MAX_HEIGHT, info->fb_height);
>   margin = (info->fb_height - vd->vd_height) >> 1;
>   vd->vd_transpose = margin * info->fb_stride;
> - vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width);
> + vd->vd_width = MIN(VT_FB_MAX_WIDTH, info->fb_width);
>   margin = (info->fb_width - vd->vd_width) >> 1;
>   vd->vd_transpose += margin * (info->fb_bpp / NBBY);
>   vd->vd_video_dev = info->fb_video_dev;
> 
> Modified: head/sys/dev/vt/vt.h
> ==
> --- head/sys/dev/vt/vt.h  Tue Jul 19 19:19:03 2016(r303042)
> +++ head/sys/dev/vt/vt.h  Tue Jul 19 19:20:47 2016(r303043)
> @@ -377,11 +377,11 @@ void vt_upgrade(struct vt_device *vd);
>  #define  PIXEL_WIDTH(w)  ((w) / 8)
>  #define  PIXEL_HEIGHT(h) ((h) / 16)
>  
> -#ifndef VT_FB_DEFAULT_WIDTH
> -#define  VT_FB_DEFAULT_WIDTH 2048
> +#ifndef VT_FB_MAX_WIDTH
> +#define  VT_FB_MAX_WIDTH 4096
>  #endif
> -#ifndef VT_FB_DEFAULT_HEIGHT
> -#define  VT_FB_DEFAULT_HEIGHT1200
> +#ifndef VT_FB_MAX_HEIGHT
> +#define  VT_FB_MAX_HEIGHT2400
>  #endif
>  
>  /* name argument is not used yet. */
> 
> Modified: head/sys/dev/vt/vt_core.c
> ==
> --- head/sys/dev/vt/vt_core.c Tue Jul 19 19:19:03 2016(r303042)
> +++ head/sys/dev/vt/vt_core.c Tue Jul 19 19:20:47 2016(r303043)
> @@ -181,8 +181,8 @@ static void vt_resume_handler(void *priv
>  
>  SET_DECLARE(vt_drv_set, struct vt_driver);
>  
> -#define  _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT))
> -#define  _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH))
> +#define  _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_MAX_HEIGHT))
> +#define  _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_MAX_WIDTH))
>  
>  struct terminal  vt_consterm;
>  static struct vt_window  vt_conswindow;
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
> 

___
svn-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: r303075 - stable/10/usr.bin/ul

2016-07-20 Thread Pietro Cerutti
Author: gahr (ports committer)
Date: Wed Jul 20 07:33:48 2016
New Revision: 303075
URL: https://svnweb.freebsd.org/changeset/base/303075

Log:
  MFC r302558:
  Do not truncate lines longer than 512 chars.
  
  PR:   210344
  Differential Revision:https://reviews.freebsd.org/D6881

Modified:
  stable/10/usr.bin/ul/ul.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/ul/ul.c
==
--- stable/10/usr.bin/ul/ul.c   Wed Jul 20 07:30:44 2016(r303074)
+++ stable/10/usr.bin/ul/ul.c   Wed Jul 20 07:33:48 2016(r303075)
@@ -78,7 +78,9 @@ structCHAR{
int c_width;/* width or -1 if multi-column char. filler */
 } ;
 
-static struct  CHARobuf[MAXBUF];
+static struct  CHARsobuf[MAXBUF]; /* static output buffer */
+static struct  CHAR*obuf = sobuf;
+static int buflen = MAXBUF;
 static int col, maxcol;
 static int mode;
 static int halfpos;
@@ -155,6 +157,9 @@ main(int argc, char **argv)
else
filter(f);
}
+   if (obuf != sobuf) {
+   free(obuf);
+   }
exit(0);
 }
 
@@ -170,128 +175,148 @@ filter(FILE *f)
 {
wint_t c;
int i, w;
+   int copy;
+   
+   copy = 0;
+
+   while ((c = getwc(f)) != WEOF) {
+   if (col == buflen) {
+   if (obuf == sobuf) {
+   obuf = NULL;
+   copy = 1;
+   }
+   obuf = realloc(obuf, sizeof(*obuf) * 2 * buflen);
+   if (obuf == NULL) {
+   obuf = sobuf;
+   break;
+   } else if (copy) {
+   memcpy(obuf, sobuf, sizeof(*obuf) * buflen);
+   copy = 0;
+   }
+   bzero((char *)(obuf + buflen), sizeof(*obuf) * buflen);
+   buflen *= 2;
+   }
+   switch(c) {
+   case '\b':
+   if (col > 0)
+   col--;
+   continue;
 
-   while ((c = getwc(f)) != WEOF && col < MAXBUF) switch(c) {
+   case '\t':
+   col = (col+8) & ~07;
+   if (col > maxcol)
+   maxcol = col;
+   continue;
 
-   case '\b':
-   if (col > 0)
-   col--;
-   continue;
-
-   case '\t':
-   col = (col+8) & ~07;
-   if (col > maxcol)
-   maxcol = col;
-   continue;
-
-   case '\r':
-   col = 0;
-   continue;
-
-   case SO:
-   mode |= ALTSET;
-   continue;
-
-   case SI:
-   mode &= ~ALTSET;
-   continue;
-
-   case IESC:
-   switch (c = getwc(f)) {
-
-   case HREV:
-   if (halfpos == 0) {
-   mode |= SUPERSC;
-   halfpos--;
-   } else if (halfpos > 0) {
-   mode &= ~SUBSC;
-   halfpos--;
-   } else {
-   halfpos = 0;
-   reverse();
-   }
+   case '\r':
+   col = 0;
continue;
 
-   case HFWD:
-   if (halfpos == 0) {
-   mode |= SUBSC;
-   halfpos++;
-   } else if (halfpos < 0) {
-   mode &= ~SUPERSC;
-   halfpos++;
-   } else {
-   halfpos = 0;
-   fwd();
-   }
+   case SO:
+   mode |= ALTSET;
continue;
 
-   case FREV:
-   reverse();
+   case SI:
+   mode &= ~ALTSET;
continue;
 
-   default:
-   errx(1, "unknown escape sequence in input: %o, %o", 
IESC, c);
-   }
-   continue;
+   case IESC:
+   switch (c = getwc(f)) {
 
-   case '_':
-   if (obuf[col].c_char || obuf[col].c_width < 0) {
-   while (col > 0 && obuf[col].c_width < 0)
-   col--;
-   w = obuf[col].c_width;
-   for (i = 0; i < w; i++)
-   obuf[col++].c_mode |= UNDERL | mode;
+   case HREV:
+   

Re: svn commit: r303033 - head/share/man/man7

2016-07-20 Thread Bruce Evans

On Tue, 19 Jul 2016, Warner Losh wrote:


On Tue, Jul 19, 2016 at 9:01 PM, Jan Beich  wrote:

Ed Maste  writes:


+.Ss Predefined Macros
+The compiler provides a number of predefined macros.
+Some of these provide architecture-specific details and are explained below.
+Other macros, including those required by the language standard, are not
+included here.

[...]

+cc -x c -Dm -E /dev/null


Typo: -Dm vs. -dM


+.It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN .


Are these really compiler macros? I think,  defines them.


These are non-compiler-predefined macros.  They are namespace pollution
in  which is only there in the __BSD_VISIBLE case.


sys/endian.h defines them (and it implements that by including machine/endian.h
in part).


$ clang38 -x c -dM -E /dev/null | fgrep ENDIAN
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412


These are the related compiler definitions in the implementation
namespace.  Their spelling is quite different and there are no
consistency checks between values, but the ABI requires similar values.
The values are as different as the spellings in some cases.
__LITTLE_ENDIAN__ is 1, but FreeBSD's _LITTLE_ENDIAN is 1234.
Actually, the semantics of these is very different too.  FreeBSD's
_LITTLE_ENDIAN corresponds to __ORDER_LITTLE_ENDIAN.


$ gcc5 -x c -dM -E /dev/null | fgrep ENDIAN
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __ORDER_PDP_ENDIAN__ 3412
#define __ORDER_BIG_ENDIAN__ 4321
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__


gcc apparently doesn't even have the confusing __LITTLE_ENDIAN__.


This is why they are defined in machine/endian.h. Compilers have been
somewhat inconsistent in the past.


But they aren't defined in machine/endian.h.  Compilers had no trace
of them in the past.  Even gcc-4.2 in the present /usr/src doesn't have
them.  The FreeBSD macros should be used since they have been portable
in BSD for at last 25 years, with a better spelling which is unsuitable
for standards because it is not ugly enough to not be already in use
with possibly inconsistent semantics.

glibc is different again.  In an old version (2.6), it uses __BYTE_ORDER
where FreeBSD uses _BYTE_ORDER and compilers use __BYTE_ORDER__.  It
also defines the FreeBSD pollution BYTE_ORDER in string/endian.h and
uses this in dangerous places like netinet/icmp6.h, but in the
standard netinet/in.h which doesn't allow this, it is more careful
and uses __BYTE_ORDER.

The man page might need to be more careful about this.  BYTE_ORDER is
not a compiler predefine or standard spelling and determing the
applicable spelling is time-consuming.

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


svn commit: r303074 - head/lib/libc/gen

2016-07-20 Thread Andrey A. Chernov
Author: ache
Date: Wed Jul 20 07:30:44 2016
New Revision: 303074
URL: https://svnweb.freebsd.org/changeset/base/303074

Log:
  1) Per POSIX (and glibc) GLOB_NOCHECK should return original pattern,
  unmodified, if no matches found. But our original code strips all '\'
  returning it. Rewrite the code to allow to reconstruct exact the
  original pattern with backslashes for this case.
  
  2) Prevent to use truncated pattern if MAXPATHLEN exceeded, return
  GLOB_NOMATCH instead.
  
  3) Fix few end loop conditions filling Char arrays with mbrtowc(),
  MB_CUR_MAX is unneeded in two places and condition is less by one
  in other place.
  
  4) Prevent to use truncated filenames match if MAXPATHLEN exceeded,
  skip such directory entries.
  
  5) Don't end *pathend with L'/' in glob3() if limit is reached, this
  change will be not visible since error is returned.
  
  6) If error happens in (*readdirfunc)(), do the same GLOB_ABORTED
  processing as for g_opendir() as POSIX requires.

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==
--- head/lib/libc/gen/glob.cWed Jul 20 06:29:26 2016(r303073)
+++ head/lib/libc/gen/glob.cWed Jul 20 07:30:44 2016(r303074)
@@ -152,6 +152,7 @@ typedef char Char;
 
 #defineCHAR(c) ((Char)((c)_CHAR))
 #defineMETA(c) ((Char)((c)|M_QUOTE))
+#defineUNPROT(c)   ((c) & ~M_PROTECT)
 #defineM_ALL   META(L'*')
 #defineM_END   META(L']')
 #defineM_NOT   META(L'!')
@@ -159,10 +160,11 @@ typedef char Char;
 #defineM_RNG   META(L'-')
 #defineM_SET   META(L'[')
 #defineismeta(c)   (((c)_QUOTE) != 0)
+#defineisprot(c)   (((c)_PROTECT) != 0)
 
 
 static int  compare(const void *, const void *);
-static int  g_Ctoc(const Char *, char *, size_t);
+static int  g_Ctoc(const Char *, char *, size_t, int);
 static int  g_lstat(Char *, struct stat *, glob_t *);
 static DIR *g_opendir(Char *, glob_t *);
 static const Char *g_strchr(const Char *, wchar_t);
@@ -176,7 +178,7 @@ static int   glob2(Char *, Char *, Char *
 struct glob_limit *);
 static int  glob3(Char *, Char *, Char *, Char *, Char *, glob_t *,
 struct glob_limit *);
-static int  globextend(const Char *, glob_t *, struct glob_limit *);
+static int  globextend(const Char *, glob_t *, struct glob_limit *, int);
 static const Char *
 globtilde(const Char *, Char *, size_t, glob_t *);
 static int  globexp1(const Char *, glob_t *, struct glob_limit *);
@@ -197,6 +199,7 @@ glob(const char * __restrict pattern, in
mbstate_t mbs;
wchar_t wc;
size_t clen;
+   int too_long;
 
patnext = pattern;
if (!(flags & GLOB_APPEND)) {
@@ -216,24 +219,27 @@ glob(const char * __restrict pattern, in
 
bufnext = patbuf;
bufend = bufnext + MAXPATHLEN - 1;
+   too_long = 1;
if (flags & GLOB_NOESCAPE) {
memset(, 0, sizeof(mbs));
-   while (bufend - bufnext >= MB_CUR_MAX) {
+   while (bufnext <= bufend) {
clen = mbrtowc(, patnext, MB_LEN_MAX, );
if (clen == (size_t)-1 || clen == (size_t)-2)
return (GLOB_NOMATCH);
-   else if (clen == 0)
+   else if (clen == 0) {
+   too_long = 0;
break;
+   }
*bufnext++ = wc;
patnext += clen;
}
} else {
/* Protect the quoted characters. */
memset(, 0, sizeof(mbs));
-   while (bufend - bufnext >= MB_CUR_MAX) {
+   while (bufnext <= bufend) {
if (*patnext == '\\') {
if (*++patnext == '\0') {
-   *bufnext++ = QUOTE | M_PROTECT;
+   *bufnext++ = QUOTE;
continue;
}
prot = M_PROTECT;
@@ -242,13 +248,16 @@ glob(const char * __restrict pattern, in
clen = mbrtowc(, patnext, MB_LEN_MAX, );
if (clen == (size_t)-1 || clen == (size_t)-2)
return (GLOB_NOMATCH);
-   else if (clen == 0)
+   else if (clen == 0) {
+   too_long = 0;
break;
-   *bufnext++ = wc | ((wc != DOT && wc != SEP) ?
-   prot : 0);
+   }
+   *bufnext++ = wc | prot;
patnext += clen;
}
}
+ 

Re: svn commit: r303037 - head/sys/kern

2016-07-20 Thread Gleb Smirnoff
On Tue, Jul 19, 2016 at 06:31:19PM +, Randall Stewart wrote:
R> Author: rrs
R> Date: Tue Jul 19 18:31:19 2016
R> New Revision: 303037
R> URL: https://svnweb.freebsd.org/changeset/base/303037
R> 
R> Log:
R>   This reverts out Gleb's changes and adds three small
R>   fixes that I think closes up the races Gleb was
R>   looking for. This is running quite nicely in Netflix and
R>   now no longer causes TCP-tcb leaks.
R>   
R>   Differential Revision: 7135

Just to notice that I am completely pissed of by this commit
war, that you started.

I've been testing my changes properly, I gave people time to
review my changes. You didn't.

>From your explanation in other emails I see that you've been
testing your changes with a version of FreeBSD that is a heavily
modified FreeBSD 10, not 11.

The new code you mixed with revert of mine, doesn't fix the
problem observed. It fixes another problem that you imagined,
which might exist, but isn't observed. We already discussed that
and you didn't prove it wrong.

Your change doesn't even revert my change completely.

-- 
Totus tuus, Glebius.
___
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: r303073 - head/sys/netinet

2016-07-20 Thread Michael Tuexen
Author: tuexen
Date: Wed Jul 20 06:29:26 2016
New Revision: 303073
URL: https://svnweb.freebsd.org/changeset/base/303073

Log:
  Fix a bug in deferred stream reset processing which results
  in using a length field before it is set.
  
  Thanks to Taylor Brandstetter for reporting the issue and
  providing a fix.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Wed Jul 20 06:12:32 2016
(r303072)
+++ head/sys/netinet/sctp_output.c  Wed Jul 20 06:29:26 2016
(r303073)
@@ -11940,7 +11940,6 @@ sctp_send_deferred_reset_response(struct
return;
}
SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD);
-   sctp_add_stream_reset_result(chk, ent->seq, response);
/* setup chunk parameters */
chk->sent = SCTP_DATAGRAM_UNSENT;
chk->snd_count = 0;
@@ -11955,6 +11954,7 @@ sctp_send_deferred_reset_response(struct
ch->chunk_length = htons(chk->book_size);
atomic_add_int(>whoTo->ref_count, 1);
SCTP_BUF_LEN(chk->data) = chk->send_size;
+   sctp_add_stream_reset_result(chk, ent->seq, response);
/* insert the chunk for sending */
TAILQ_INSERT_TAIL(>control_send_queue,
chk,
___
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: r303072 - head/sys/dev/hyperv/vmbus

2016-07-20 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 20 06:12:32 2016
New Revision: 303072
URL: https://svnweb.freebsd.org/changeset/base/303072

Log:
  hyperv/vmbus: Save MNF trigger location instead of MNF trigger index.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7246

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_chan.c
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c  Wed Jul 20 06:00:27 2016
(r303071)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c  Wed Jul 20 06:12:32 2016
(r303072)
@@ -89,13 +89,10 @@ vmbus_chan_signal_tx(struct hv_vmbus_cha
atomic_set_long(>vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
1UL << (chanid & VMBUS_EVTFLAG_MASK));
 
-   if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF) {
-   atomic_set_int(
-   >vmbus_mnf2->mnf_trigs[chan->ch_montrig_idx].mt_pending,
-   chan->ch_montrig_mask);
-   } else {
+   if (chan->ch_flags & VMBUS_CHAN_FLAG_HASMNF)
+   atomic_set_int(chan->ch_montrig, chan->ch_montrig_mask);
+   else
hypercall_signal_event(chan->ch_monprm_dma.hv_paddr);
-   }
 }
 
 static int
@@ -1106,13 +1103,19 @@ vmbus_chan_msgproc_choffer(struct vmbus_
chan->ch_monprm->mp_connid = offer->chm_connid;
 
if (offer->chm_flags1 & VMBUS_CHOFFER_FLAG1_HASMNF) {
+   int trig_idx;
+
/*
 * Setup MNF stuffs.
 */
chan->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
-   chan->ch_montrig_idx = offer->chm_montrig / VMBUS_MONTRIG_LEN;
-   if (chan->ch_montrig_idx >= VMBUS_MONTRIGS_MAX)
+
+   trig_idx = offer->chm_montrig / VMBUS_MONTRIG_LEN;
+   if (trig_idx >= VMBUS_MONTRIGS_MAX)
panic("invalid monitor trigger %u", offer->chm_montrig);
+   chan->ch_montrig =
+   >vmbus_mnf2->mnf_trigs[trig_idx].mt_pending;
+
chan->ch_montrig_mask =
1 << (offer->chm_montrig % VMBUS_MONTRIG_LEN);
}

Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Wed Jul 20 06:00:27 2016
(r303071)
+++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Wed Jul 20 06:12:32 2016
(r303072)
@@ -80,7 +80,7 @@ typedef struct hv_vmbus_channel {
 * These are based on the offer_msg.monitor_id.
 * Save it here for easy access.
 */
-   int ch_montrig_idx; /* MNF trig index */
+   volatile uint32_t   *ch_montrig;/* MNF trigger */
uint32_tch_montrig_mask;/* MNF trig mask */
 
/*
___
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: r303071 - in head/sys/dev/hyperv: include netvsc storvsc utilities vmbus

2016-07-20 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Jul 20 06:00:27 2016
New Revision: 303071
URL: https://svnweb.freebsd.org/changeset/base/303071

Log:
  hyperv/vmbus: Hide channel struct definition.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7245

Added:
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   (contents, props changed)
Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/include/vmbus.h
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  head/sys/dev/hyperv/utilities/hv_kvp.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
  head/sys/dev/hyperv/vmbus/vmbus_chan.c

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hWed Jul 20 05:48:52 2016
(r303070)
+++ head/sys/dev/hyperv/include/hyperv.hWed Jul 20 06:00:27 2016
(r303071)
@@ -83,122 +83,8 @@ struct hyperv_guid {
 
 inthyperv_guid2str(const struct hyperv_guid *, char *, size_t);
 
-typedef struct {
-   /*
-* offset in bytes from the start of ring data below
-*/
-   volatile uint32_t   write_index;
-   /*
-* offset in bytes from the start of ring data below
-*/
-   volatile uint32_t   read_index;
-   /*
-* NOTE: The interrupt_mask field is used only for channels, but
-* vmbus connection also uses this data structure
-*/
-   volatile uint32_t   interrupt_mask;
-   /* pad it to PAGE_SIZE so that data starts on a page */
-   uint8_t reserved[4084];
-
-   /*
-* WARNING: Ring data starts here
-*  !!! DO NOT place any fields below this !!!
-*/
-   uint8_t buffer[0];  /* doubles as interrupt mask */
-} __packed hv_vmbus_ring_buffer;
-
-typedef struct {
-   hv_vmbus_ring_buffer*   ring_buffer;
-   struct mtx  ring_lock;
-   uint32_tring_data_size; /* ring_size */
-} hv_vmbus_ring_buffer_info;
-
 struct hv_vmbus_channel;
 
-typedef void   (*vmbus_chan_callback_t)(struct hv_vmbus_channel *, void *);
-
-typedef struct hv_vmbus_channel {
-   device_tch_dev;
-   struct vmbus_softc  *ch_vmbus;
-   uint32_tch_flags;   /* VMBUS_CHAN_FLAG_ */
-   uint32_tch_id;  /* channel id */
-
-   /*
-* These are based on the offer_msg.monitor_id.
-* Save it here for easy access.
-*/
-   int ch_montrig_idx; /* MNF trig index */
-   uint32_tch_montrig_mask;/* MNF trig mask */
-
-   /*
-* TX bufring; at the beginning of ch_bufring.
-*/
-   hv_vmbus_ring_buffer_info   ch_txbr;
-   /*
-* RX bufring; immediately following ch_txbr.
-*/
-   hv_vmbus_ring_buffer_info   ch_rxbr;
-
-   struct taskqueue*ch_tq;
-   struct task ch_task;
-   vmbus_chan_callback_t   ch_cb;
-   void*ch_cbarg;
-
-   struct hyperv_mon_param *ch_monprm;
-   struct hyperv_dma   ch_monprm_dma;
-
-   int ch_cpuid;   /* owner cpu */
-   /*
-* Virtual cpuid for ch_cpuid; it is used to communicate cpuid
-* related information w/ Hyper-V.  If MSR_HV_VP_INDEX does not
-* exist, ch_vcpuid will always be 0 for compatibility.
-*/
-   uint32_tch_vcpuid;
-
-   /*
-* If this is a primary channel, ch_subchan* fields
-* contain sub-channels belonging to this primary
-* channel.
-*/
-   struct mtx  ch_subchan_lock;
-   TAILQ_HEAD(, hv_vmbus_channel)  ch_subchans;
-   int ch_subchan_cnt;
-
-   /* If this is a sub-channel */
-   TAILQ_ENTRY(hv_vmbus_channel)   ch_sublink; /* sub-channel link */
-   struct hv_vmbus_channel *ch_prichan;/* owner primary chan */
-
-   void*ch_bufring;/* TX+RX bufrings */
-   struct hyperv_dma   ch_bufring_dma;
-   uint32_tch_bufring_gpadl;
-
-   struct task ch_detach_task;
-   TAILQ_ENTRY(hv_vmbus_channel)   ch_prilink; /* primary chan link */
-   uint32_tch_subidx;  /* subchan index */
-   volatile uint32_t   ch_stflags; /* atomic-op */
-   /* VMBUS_CHAN_ST_ */
-   struct hyperv_guid  ch_guid_type;
-   struct hyperv_guid  ch_guid_inst;
-
-   struct