svn commit: r309085 - head/sys/dev/hyperv/netvsc

2016-11-23 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Nov 24 07:35:16 2016
New Revision: 309085
URL: https://svnweb.freebsd.org/changeset/base/309085

Log:
  hyperv/hn: Fix primary channel revocation
  
  Since hypervisor will not drain the TX bufring, once the channels are
  revoked:
  - Setup vmbus orphan handler properly.
  - Make sure that suspension will not wait the TX bufring draining
forever.
  - GC the pending TX descs on detach path, before freeing the busdma
stuffs.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8559

Modified:
  head/sys/dev/hyperv/netvsc/hn_nvs.c
  head/sys/dev/hyperv/netvsc/if_hn.c

Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c
==
--- head/sys/dev/hyperv/netvsc/hn_nvs.c Thu Nov 24 06:43:11 2016
(r309084)
+++ head/sys/dev/hyperv/netvsc/hn_nvs.c Thu Nov 24 07:35:16 2016
(r309085)
@@ -336,8 +336,13 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc
 
/*
 * Wait for the hypervisor to receive this NVS request.
+*
+* NOTE:
+* The TX bufring will not be drained by the hypervisor,
+* if the primary channel is revoked.
 */
-   while (!vmbus_chan_tx_empty(sc->hn_prichan))
+   while (!vmbus_chan_tx_empty(sc->hn_prichan) &&
+   !vmbus_chan_is_revoked(sc->hn_prichan))
pause("waittx", 1);
/*
 * Linger long enough for NVS to disconnect RXBUF.
@@ -387,8 +392,13 @@ hn_nvs_disconn_chim(struct hn_softc *sc)
 
/*
 * Wait for the hypervisor to receive this NVS request.
+*
+* NOTE:
+* The TX bufring will not be drained by the hypervisor,
+* if the primary channel is revoked.
 */
-   while (!vmbus_chan_tx_empty(sc->hn_prichan))
+   while (!vmbus_chan_tx_empty(sc->hn_prichan) &&
+   !vmbus_chan_is_revoked(sc->hn_prichan))
pause("waittx", 1);
/*
 * Linger long enough for NVS to disconnect chimney

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==
--- head/sys/dev/hyperv/netvsc/if_hn.c  Thu Nov 24 06:43:11 2016
(r309084)
+++ head/sys/dev/hyperv/netvsc/if_hn.c  Thu Nov 24 07:35:16 2016
(r309085)
@@ -303,7 +303,8 @@ static void hn_resume(struct hn_softc 
 static voidhn_resume_data(struct hn_softc *);
 static voidhn_resume_mgmt(struct hn_softc *);
 static voidhn_suspend_mgmt_taskfunc(void *, int);
-static voidhn_chan_drain(struct vmbus_channel *);
+static voidhn_chan_drain(struct hn_softc *,
+   struct vmbus_channel *);
 
 static voidhn_update_link_status(struct hn_softc *);
 static voidhn_change_network(struct hn_softc *);
@@ -327,6 +328,8 @@ static int  hn_create_tx_data(struct hn
 static voidhn_fixup_tx_data(struct hn_softc *);
 static voidhn_destroy_tx_data(struct hn_softc *);
 static voidhn_txdesc_dmamap_destroy(struct hn_txdesc *);
+static voidhn_txdesc_gc(struct hn_tx_ring *,
+   struct hn_txdesc *);
 static int hn_encap(struct ifnet *, struct hn_tx_ring *,
struct hn_txdesc *, struct mbuf **);
 static int hn_txpkt(struct ifnet *, struct hn_tx_ring *,
@@ -994,8 +997,25 @@ hn_attach(device_t dev)
 */
sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev),
HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0);
-   if (sc->hn_xact == NULL)
+   if (sc->hn_xact == NULL) {
+   error = ENXIO;
+   goto failed;
+   }
+
+   /*
+* Install orphan handler for the revocation of this device's
+* primary channel.
+*
+* NOTE:
+* The processing order is critical here:
+* Install the orphan handler, _before_ testing whether this
+* device's primary channel has been revoked or not.
+*/
+   vmbus_chan_set_orphan(sc->hn_prichan, sc->hn_xact);
+   if (vmbus_chan_is_revoked(sc->hn_prichan)) {
+   error = ENXIO;
goto failed;
+   }
 
/*
 * Attach the synthetic parts, i.e. NVS and RNDIS.
@@ -1170,6 +1190,14 @@ hn_detach(device_t dev)
struct hn_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->hn_ifp;
 
+   if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) {
+   /*
+* In 

svn commit: r309084 - head/sys/boot/fdt/dts/arm

2016-11-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 24 06:43:11 2016
New Revision: 309084
URL: https://svnweb.freebsd.org/changeset/base/309084

Log:
  Enable the SPI1 and SPI2 node for Olimex A20 SOM EVB.
  This was missed in r309079.

Modified:
  head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts

Modified: head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts
==
--- head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dtsThu Nov 24 06:01:29 
2016(r309083)
+++ head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dtsThu Nov 24 06:43:11 
2016(r309084)
@@ -62,12 +62,14 @@
pinctrl-names = "default";
pinctrl-0 = <_pins_a>,
<_cs0_pins_a>;
+   status = "okay";
 };
 
  {
pinctrl-names = "default";
pinctrl-0 = <_pins_a>,
<_cs0_pins_a>;
+   status = "okay";
 };
 
  {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Nov 24 06:01:29 2016
New Revision: 309083
URL: https://svnweb.freebsd.org/changeset/base/309083

Log:
  hyperv/vmbus: Fix the multi-channel revoking on vmbus side.
  
  - Reference count the sub-channel when channel offer message is
processed, so that immediate rescind message on the same channel
will not race sub-channel open on driver side.
  - Drop the above reference when sub-channel is closed, this closely
mimics the hypervisor's reaction when primary channel is closed
on the VM side.  No drivers use sub-channel after primary channel
is closed.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8546

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 Nov 24 05:52:28 2016
(r309082)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Nov 24 06:01:29 2016
(r309083)
@@ -65,6 +65,7 @@ static void   vmbus_chan_cpu_default(str
 static int vmbus_chan_release(struct vmbus_channel *);
 static voidvmbus_chan_set_chmap(struct vmbus_channel *);
 static voidvmbus_chan_clear_chmap(struct vmbus_channel *);
+static voidvmbus_chan_detach(struct vmbus_channel *);
 
 static voidvmbus_chan_ins_prilist(struct vmbus_softc *,
struct vmbus_channel *);
@@ -628,6 +629,32 @@ vmbus_chan_gpadl_disconnect(struct vmbus
 }
 
 static void
+vmbus_chan_detach(struct vmbus_channel *chan)
+{
+   int refs;
+
+   KASSERT(chan->ch_refs > 0, ("chan%u: invalid refcnt %d",
+   chan->ch_id, chan->ch_refs));
+   refs = atomic_fetchadd_int(>ch_refs, -1);
+#ifdef INVARIANTS
+   if (VMBUS_CHAN_ISPRIMARY(chan)) {
+   KASSERT(refs == 1, ("chan%u: invalid refcnt %d for prichan",
+   chan->ch_id, refs + 1));
+   }
+#endif
+   if (refs == 1) {
+   /*
+* Detach the target channel.
+*/
+   if (bootverbose) {
+   vmbus_chan_printf(chan, "chan%u detached\n",
+   chan->ch_id);
+   }
+   taskqueue_enqueue(chan->ch_mgmt_tq, >ch_detach_task);
+   }
+}
+
+static void
 vmbus_chan_clrchmap_task(void *xchan, int pending __unused)
 {
struct vmbus_channel *chan = xchan;
@@ -752,8 +779,15 @@ vmbus_chan_close(struct vmbus_channel *c
int i;
 
subchan = vmbus_subchan_get(chan, subchan_cnt);
-   for (i = 0; i < subchan_cnt; ++i)
+   for (i = 0; i < subchan_cnt; ++i) {
vmbus_chan_close_internal(subchan[i]);
+   /*
+* This sub-channel is referenced, when it is
+* linked to the primary channel; drop that
+* reference now.
+*/
+   vmbus_chan_detach(subchan[i]);
+   }
vmbus_subchan_rel(subchan, subchan_cnt);
}
 
@@ -1114,6 +1148,7 @@ vmbus_chan_alloc(struct vmbus_softc *sc)
return NULL;
}
 
+   chan->ch_refs = 1;
chan->ch_vmbus = sc;
mtx_init(>ch_subchan_lock, "vmbus subchan", NULL, MTX_DEF);
sx_init(>ch_orphan_lock, "vmbus chorphan");
@@ -1137,6 +1172,8 @@ vmbus_chan_free(struct vmbus_channel *ch
 VMBUS_CHAN_ST_ONLIST)) == 0, ("free busy channel"));
KASSERT(chan->ch_orphan_xact == NULL,
("still has orphan xact installed"));
+   KASSERT(chan->ch_refs == 0, ("chan%u: invalid refcnt %d",
+   chan->ch_id, chan->ch_refs));
 
hyperv_dmamem_free(>ch_monprm_dma, chan->ch_monprm);
mtx_destroy(>ch_subchan_lock);
@@ -1213,6 +1250,14 @@ vmbus_chan_add(struct vmbus_channel *new
("new channel is not sub-channel"));
KASSERT(prichan != NULL, ("no primary channel"));
 
+   /*
+* Reference count this sub-channel; it will be dereferenced
+* when this sub-channel is closed.
+*/
+   KASSERT(newchan->ch_refs == 1, ("chan%u: invalid refcnt %d",
+   newchan->ch_id, newchan->ch_refs));
+   atomic_add_int(>ch_refs, 1);
+
newchan->ch_prichan = prichan;
newchan->ch_dev = prichan->ch_dev;
 
@@ -1359,6 +1404,7 @@ vmbus_chan_msgproc_choffer(struct vmbus_
if (error) {
device_printf(sc->vmbus_dev, "add chan%u failed: %d\n",
chan->ch_id, error);
+   atomic_subtract_int(>ch_refs, 1);
vmbus_chan_free(chan);
return;
}
@@ -1426,9 +1472,7 @@ vmbus_chan_msgproc_chrescind(struct vmbu
 
if 

svn commit: r309082 - in head: . share/man/man4

2016-11-23 Thread Dexuan Cui
Author: dexuan
Date: Thu Nov 24 05:52:28 2016
New Revision: 309082
URL: https://svnweb.freebsd.org/changeset/base/309082

Log:
  share/man/man4/Makefile: Only install Hyper-V man pages on amd64 and i386
  
  We shouldn't install them on the architectures not supported by Hyper-V.
  
  And, hv_ata_pci_disengage.4.gz should be removed from all architectures:
  1) It should have only applied to Hyper-V;
  2) For Hyper-V platforms (amd64 and i386), the related driver was removed by
  r306426 | sephe | 2016-09-29 09:41:52 +0800 (Thu, 29 Sep 2016),
  because now we have a better mechanism to disble the ata driver for hard
  disks when the VM runs on Hyper-V.
  
  Reviewed by:  sephe, andrew, jhb
  Approved by:  sephe (mentor)
  MFC after:3 days
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8572

Modified:
  head/ObsoleteFiles.inc
  head/share/man/man4/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Nov 24 05:18:45 2016(r309081)
+++ head/ObsoleteFiles.inc  Thu Nov 24 05:52:28 2016(r309082)
@@ -38,6 +38,17 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20161121: Hyper-V manuals only apply to amd64 and i386.
+.if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "i386"
+OLD_FILES+=usr/share/man/man4/hv_kvp.4.gz
+OLD_FILES+=usr/share/man/man4/hv_netvsc.4.gz
+OLD_FILES+=usr/share/man/man4/hv_storvsc.4.gz
+OLD_FILES+=usr/share/man/man4/hv_utils.4.gz
+OLD_FILES+=usr/share/man/man4/hv_vmbus.4.gz
+OLD_FILES+=usr/share/man/man4/hv_vss.4.gz
+.endif
+# 20161118: Remove hv_ata_pci_disengage(4)
+OLD_FILES+=usr/share/man/man4/hv_ata_pci_disengage.4.gz
 # 20161017: urtwn(4) was merged into rtwn(4)
 OLD_FILES+=usr/share/man/man4/urtwn.4.gz
 OLD_FILES+=usr/share/man/man4/urtwnfw.4.gz

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Nov 24 05:18:45 2016
(r309081)
+++ head/share/man/man4/MakefileThu Nov 24 05:52:28 2016
(r309082)
@@ -189,12 +189,12 @@ MAN=  aac.4 \
${_hptmv.4} \
${_hptnr.4} \
${_hptrr.4} \
-   hv_kvp.4 \
-   hv_netvsc.4 \
-   hv_storvsc.4 \
-   hv_utils.4 \
-   hv_vmbus.4 \
-   hv_vss.4 \
+   ${_hv_kvp.4} \
+   ${_hv_netvsc.4} \
+   ${_hv_storvsc.4} \
+   ${_hv_utils.4} \
+   ${_hv_vmbus.4} \
+   ${_hv_vss.4} \
hwpmc.4 \
ichsmb.4 \
${_ichwd.4} \
@@ -784,6 +784,12 @@ _hptiop.4= hptiop.4
 _hptmv.4=  hptmv.4
 _hptnr.4=  hptnr.4
 _hptrr.4=  hptrr.4
+_hv_kvp.4= hv_kvp.4
+_hv_netvsc.4=  hv_netvsc.4
+_hv_storvsc.4= hv_storvsc.4
+_hv_utils.4=   hv_utils.4
+_hv_vmbus.4=   hv_vmbus.4
+_hv_vss.4= hv_vss.4
 _i8254.4=  i8254.4
 _ichwd.4=  ichwd.4
 _if_bxe.4= if_bxe.4
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Nov 24 05:18:45 2016
New Revision: 309081
URL: https://svnweb.freebsd.org/changeset/base/309081

Log:
  hyperv/vmbus: Fix the primary channel revoking on vmbus side.
  
  Drivers can now use vmbus_chan_{is_revoked,set_orphan,unset_orphan}() and
  vmbus_xact_ctx_orphan() to fix their attach/detach DEVMETHODs for revoked
  primary channels.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8545

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

Modified: head/sys/dev/hyperv/include/vmbus.h
==
--- head/sys/dev/hyperv/include/vmbus.h Thu Nov 24 04:58:13 2016
(r309080)
+++ head/sys/dev/hyperv/include/vmbus.h Thu Nov 24 05:18:45 2016
(r309081)
@@ -116,6 +116,7 @@ struct vmbus_chan_br {
 };
 
 struct vmbus_channel;
+struct vmbus_xact_ctx;
 struct hyperv_guid;
 struct task;
 struct taskqueue;
@@ -138,6 +139,9 @@ voidvmbus_chan_close(struct vmbus_chan
 void   vmbus_chan_intr_drain(struct vmbus_channel *chan);
 void   vmbus_chan_run_task(struct vmbus_channel *chan,
struct task *task);
+void   vmbus_chan_set_orphan(struct vmbus_channel *chan,
+   struct vmbus_xact_ctx *);
+void   vmbus_chan_unset_orphan(struct vmbus_channel *chan);
 
 intvmbus_chan_gpadl_connect(struct vmbus_channel *chan,
bus_addr_t paddr, int size, uint32_t *gpadl);

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Nov 24 04:58:13 2016
(r309080)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c  Thu Nov 24 05:18:45 2016
(r309081)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1115,6 +1116,7 @@ vmbus_chan_alloc(struct vmbus_softc *sc)
 
chan->ch_vmbus = sc;
mtx_init(>ch_subchan_lock, "vmbus subchan", NULL, MTX_DEF);
+   sx_init(>ch_orphan_lock, "vmbus chorphan");
TAILQ_INIT(>ch_subchans);
vmbus_rxbr_init(>ch_rxbr);
vmbus_txbr_init(>ch_txbr);
@@ -1133,8 +1135,12 @@ vmbus_chan_free(struct vmbus_channel *ch
 VMBUS_CHAN_ST_ONPRIL |
 VMBUS_CHAN_ST_ONSUBL |
 VMBUS_CHAN_ST_ONLIST)) == 0, ("free busy channel"));
+   KASSERT(chan->ch_orphan_xact == NULL,
+   ("still has orphan xact installed"));
+
hyperv_dmamem_free(>ch_monprm_dma, chan->ch_monprm);
mtx_destroy(>ch_subchan_lock);
+   sx_destroy(>ch_orphan_lock);
vmbus_rxbr_deinit(>ch_rxbr);
vmbus_txbr_deinit(>ch_txbr);
free(chan, M_DEVBUF);
@@ -1403,10 +1409,21 @@ vmbus_chan_msgproc_chrescind(struct vmbu
mtx_unlock(>vmbus_prichan_lock);
}
 
+   /*
+* NOTE:
+* The following processing order is critical:
+* Set the REVOKED state flag before orphaning the installed xact.
+*/
+
if (atomic_testandset_int(>ch_stflags,
VMBUS_CHAN_ST_REVOKED_SHIFT))
panic("channel has already been revoked");
 
+   sx_xlock(>ch_orphan_lock);
+   if (chan->ch_orphan_xact != NULL)
+   vmbus_xact_ctx_orphan(chan->ch_orphan_xact);
+   sx_xunlock(>ch_orphan_lock);
+
if (bootverbose)
vmbus_chan_printf(chan, "chan%u revoked\n", note->chm_chanid);
 
@@ -1708,3 +1725,21 @@ vmbus_chan_is_revoked(const struct vmbus
return (true);
return (false);
 }
+
+void
+vmbus_chan_set_orphan(struct vmbus_channel *chan, struct vmbus_xact_ctx *xact)
+{
+
+   sx_xlock(>ch_orphan_lock);
+   chan->ch_orphan_xact = xact;
+   sx_xunlock(>ch_orphan_lock);
+}
+
+void
+vmbus_chan_unset_orphan(struct vmbus_channel *chan)
+{
+
+   sx_xlock(>ch_orphan_lock);
+   chan->ch_orphan_xact = NULL;
+   sx_xunlock(>ch_orphan_lock);
+}

Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Nov 24 04:58:13 2016
(r309080)
+++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h   Thu Nov 24 05:18:45 2016
(r309081)
@@ -33,8 +33,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -138,6 +139,9 @@ struct vmbus_channel {
struct hyperv_guid  ch_guid_type;
struct hyperv_guid  ch_guid_inst;
 
+   struct sx   ch_orphan_lock;
+   struct vmbus_xact_ctx   *ch_orphan_xact;
+
struct sysctl_ctx_list  ch_sysctl_ctx;
 } __aligned(CACHE_LINE_SIZE);
 
___

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

2016-11-23 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Nov 24 04:58:13 2016
New Revision: 309080
URL: https://svnweb.freebsd.org/changeset/base/309080

Log:
  hyperv/vmbus: Implement orphan support for transaction API
  
  It will be used to fix the primary channel revocation support.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8525

Modified:
  head/sys/dev/hyperv/include/vmbus_xact.h
  head/sys/dev/hyperv/vmbus/vmbus_xact.c

Modified: head/sys/dev/hyperv/include/vmbus_xact.h
==
--- head/sys/dev/hyperv/include/vmbus_xact.hThu Nov 24 01:24:26 2016
(r309079)
+++ head/sys/dev/hyperv/include/vmbus_xact.hThu Nov 24 04:58:13 2016
(r309080)
@@ -39,6 +39,8 @@ struct vmbus_xact_ctx *vmbus_xact_ctx_cr
size_t req_size, size_t resp_size,
size_t priv_size);
 void   vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx);
+bool   vmbus_xact_ctx_orphan(struct vmbus_xact_ctx *ctx);
+
 struct vmbus_xact  *vmbus_xact_get(struct vmbus_xact_ctx *ctx,
size_t req_len);
 void   vmbus_xact_put(struct vmbus_xact *xact);

Modified: head/sys/dev/hyperv/vmbus/vmbus_xact.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_xact.c  Thu Nov 24 01:24:26 2016
(r309079)
+++ head/sys/dev/hyperv/vmbus/vmbus_xact.c  Thu Nov 24 04:58:13 2016
(r309080)
@@ -61,6 +61,7 @@ struct vmbus_xact_ctx {
uint32_txc_flags;   /* VMBUS_XACT_CTXF_ */
struct vmbus_xact   *xc_free;
struct vmbus_xact   *xc_active;
+   struct vmbus_xact   *xc_orphan;
 };
 
 #define VMBUS_XACT_CTXF_DESTROY0x0001
@@ -72,6 +73,9 @@ static struct vmbus_xact  *vmbus_xact_get
uint32_t);
 const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *,
bool);
+static voidvmbus_xact_save_resp(struct vmbus_xact *,
+   const void *, size_t);
+static voidvmbus_xact_ctx_free(struct vmbus_xact_ctx *);
 
 static struct vmbus_xact *
 vmbus_xact_alloc(struct vmbus_xact_ctx *ctx, bus_dma_tag_t parent_dtag)
@@ -136,6 +140,9 @@ vmbus_xact_ctx_create(bus_dma_tag_t dtag
 {
struct vmbus_xact_ctx *ctx;
 
+   KASSERT(req_size > 0, ("request size is 0"));
+   KASSERT(resp_size > 0, ("response size is 0"));
+
ctx = malloc(sizeof(*ctx), M_DEVBUF, M_WAITOK | M_ZERO);
ctx->xc_req_size = req_size;
ctx->xc_resp_size = resp_size;
@@ -152,25 +159,46 @@ vmbus_xact_ctx_create(bus_dma_tag_t dtag
return (ctx);
 }
 
-void
-vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx)
+bool
+vmbus_xact_ctx_orphan(struct vmbus_xact_ctx *ctx)
 {
-   struct vmbus_xact *xact;
-
mtx_lock(>xc_lock);
+   if (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) {
+   mtx_unlock(>xc_lock);
+   return (false);
+   }
ctx->xc_flags |= VMBUS_XACT_CTXF_DESTROY;
mtx_unlock(>xc_lock);
+
wakeup(>xc_free);
+   wakeup(>xc_active);
 
-   xact = vmbus_xact_get1(ctx, 0);
-   if (xact == NULL)
+   ctx->xc_orphan = vmbus_xact_get1(ctx, 0);
+   if (ctx->xc_orphan == NULL)
panic("can't get xact");
+   return (true);
+}
+
+static void
+vmbus_xact_ctx_free(struct vmbus_xact_ctx *ctx)
+{
+   KASSERT(ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY,
+   ("xact ctx was not orphaned"));
+   KASSERT(ctx->xc_orphan != NULL, ("no orphaned xact"));
 
-   vmbus_xact_free(xact);
+   vmbus_xact_free(ctx->xc_orphan);
mtx_destroy(>xc_lock);
free(ctx, M_DEVBUF);
 }
 
+void
+vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx)
+{
+
+   vmbus_xact_ctx_orphan(ctx);
+   vmbus_xact_ctx_free(ctx);
+}
+
 struct vmbus_xact *
 vmbus_xact_get(struct vmbus_xact_ctx *ctx, size_t req_len)
 {
@@ -259,7 +287,8 @@ vmbus_xact_wait1(struct vmbus_xact *xact
mtx_lock(>xc_lock);
 
KASSERT(ctx->xc_active == xact, ("xact mismatch"));
-   while (xact->x_resp == NULL) {
+   while (xact->x_resp == NULL &&
+   (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) {
if (can_sleep) {
mtx_sleep(>xc_active, >xc_lock, 0,
"wxact", 0);
@@ -269,6 +298,20 @@ vmbus_xact_wait1(struct vmbus_xact *xact
mtx_lock(>xc_lock);
}
}
+   KASSERT(ctx->xc_active == xact, ("xact trashed"));
+
+   if ((ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) && xact->x_resp == NULL) {
+   uint8_t b = 0;
+
+   /*
+* Orphaned and no response was received 

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

2016-11-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 24 01:24:26 2016
New Revision: 309079
URL: https://svnweb.freebsd.org/changeset/base/309079

Log:
  Enable the SCL and SDA i2c line for DDC.
  This is an undocumented register that we need to set if we do not want to
  rely on u-boot or other bootloader.

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

Modified: head/sys/arm/allwinner/a10_hdmi.c
==
--- head/sys/arm/allwinner/a10_hdmi.c   Thu Nov 24 00:49:00 2016
(r309078)
+++ head/sys/arm/allwinner/a10_hdmi.c   Thu Nov 24 01:24:26 2016
(r309079)
@@ -189,6 +189,9 @@ __FBSDID("$FreeBSD$");
 #defineDDC_ADDR0x50
 #defineEDDC_ADDR   0x60
 #defineEDID_LENGTH 128
+#defineDDC_CTRL_LINE   0x540
+#defineDDC_LINE_SCL_ENABLE (1 << 8)
+#defineDDC_LINE_SDA_ENABLE (1 << 9)
 #defineHDMI_ENABLE_DELAY   5
 #defineDDC_READ_RETRY  4
 #defineEXT_TAG 0x00
@@ -494,6 +497,10 @@ a10hdmi_get_edid(device_t dev, uint8_t *
/* Configure DDC clock */
HDMI_WRITE(sc, DDC_CLOCK, DDC_CLOCK_M | DDC_CLOCK_N);
 
+   /* Enable SDA/SCL */
+   HDMI_WRITE(sc, DDC_CTRL_LINE,
+   DDC_LINE_SCL_ENABLE | DDC_LINE_SDA_ENABLE);
+
/* Read EDID block */
error = a10hdmi_ddc_read(sc, 0, sc->edid);
if (error == 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309078 - head/sys/dev/bnxt

2016-11-23 Thread Stephen Hurd
Author: shurd (ports committer)
Date: Thu Nov 24 00:49:00 2016
New Revision: 309078
URL: https://svnweb.freebsd.org/changeset/base/309078

Log:
  Add new device IDs
  
  Add device IDs for new hardware, sort the device IDs, add comment
  regarding fragice NPAR/VF detection.
  
  Approved by:  davidch
  MFC after:6 days
  Sponsored by: Broadcom Limited

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hThu Nov 24 00:46:34 2016(r309077)
+++ head/sys/dev/bnxt/bnxt.hThu Nov 24 00:49:00 2016(r309078)
@@ -52,16 +52,39 @@ __FBSDID("$FreeBSD$");
 #define BCM57301   0x16c8
 #define BCM57302   0x16c9
 #define BCM57304   0x16ca
+#define BCM57311   0x16ce
+#define BCM57312   0x16cf
+#define BCM57314   0x16df
 #define BCM57402   0x16d0
-#define BCM57404   0x16d1
-#define BCM57406   0x16d2
 #define BCM57402_NPAR  0x16d4
-#define BCM57407   0x16d5
+#define BCM57404   0x16d1
 #define BCM57404_NPAR  0x16e7
+#define BCM57406   0x16d2
 #define BCM57406_NPAR  0x16e8
+#define BCM57407   0x16d5
+#define BCM57407_NPAR  0x16ea
 #define BCM57407_SFP   0x16e9
-#define BCM57304_VF0x16cb
-#define BCM57404_VF0x16d3
+#define BCM57412   0x16d6
+#define BCM57412_NPAR1 0x16de
+#define BCM57412_NPAR2 0x16eb
+#define BCM57414   0x16d7
+#define BCM57414_NPAR1 0x16ec
+#define BCM57414_NPAR2 0x16ed
+#define BCM57416   0x16d8
+#define BCM57416_NPAR1 0x16ee
+#define BCM57416_NPAR2 0x16ef
+#define BCM57416_SFP   0x16e3
+#define BCM57417   0x16d9
+#define BCM57417_NPAR1 0x16c0
+#define BCM57417_NPAR2 0x16cc
+#define BCM57417_SFP   0x16e2
+#define BCM58700   0x16cd
+#define NETXTREME_C_VF10x16cb
+#define NETXTREME_C_VF20x16e1
+#define NETXTREME_C_VF30x16e5
+#define NETXTREME_E_VF10x16c1
+#define NETXTREME_E_VF20x16d3
+#define NETXTREME_E_VF30x16dc
 
 #define CSUM_OFFLOAD   (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \
 CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Thu Nov 24 00:46:34 2016(r309077)
+++ head/sys/dev/bnxt/if_bnxt.c Thu Nov 24 00:49:00 2016(r309078)
@@ -75,26 +75,72 @@ static pci_vendor_info_t bnxt_vendor_inf
"Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Controller"),
 PVID(BROADCOM_VENDOR_ID, BCM57304,
"Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet 
Controller"),
+PVID(BROADCOM_VENDOR_ID, BCM57311,
+   "Broadcom BCM57311 NetXtreme-C 10Gb Ethernet"),
+PVID(BROADCOM_VENDOR_ID, BCM57312,
+   "Broadcom BCM57312 NetXtreme-C 10Gb/25Gb Ethernet"),
+PVID(BROADCOM_VENDOR_ID, BCM57314,
+   "Broadcom BCM57314 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet"),
 PVID(BROADCOM_VENDOR_ID, BCM57402,
"Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller"),
-PVID(BROADCOM_VENDOR_ID, BCM57404,
-   "Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller"),
-PVID(BROADCOM_VENDOR_ID, BCM57406,
-   "Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller"),
 PVID(BROADCOM_VENDOR_ID, BCM57402_NPAR,
"Broadcom BCM57402 NetXtreme-E Partition"),
-PVID(BROADCOM_VENDOR_ID, BCM57407,
-   "Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller"),
+PVID(BROADCOM_VENDOR_ID, BCM57404,
+   "Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller"),
 PVID(BROADCOM_VENDOR_ID, BCM57404_NPAR,
"Broadcom BCM57404 NetXtreme-E Partition"),
+PVID(BROADCOM_VENDOR_ID, BCM57406,
+   "Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller"),
 PVID(BROADCOM_VENDOR_ID, BCM57406_NPAR,
"Broadcom BCM57406 NetXtreme-E Partition"),
+PVID(BROADCOM_VENDOR_ID, BCM57407,
+   "Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller"),
+PVID(BROADCOM_VENDOR_ID, BCM57407_NPAR,
+   "Broadcom BCM57407 NetXtreme-E Ethernet Partition"),
 PVID(BROADCOM_VENDOR_ID, BCM57407_SFP,
"Broadcom BCM57407 NetXtreme-E 25Gb Ethernet Controller"),
-PVID(BROADCOM_VENDOR_ID, BCM57304_VF,
-   "Broadcom BCM57304 NetXtreme-C Virtual Function"),
-PVID(BROADCOM_VENDOR_ID, BCM57404_VF,
-   "Broadcom BCM57404 NetXtreme-E Virtual Function"),
+PVID(BROADCOM_VENDOR_ID, BCM57412,
+   "Broadcom BCM57412 NetXtreme-E 10Gb Ethernet"),
+PVID(BROADCOM_VENDOR_ID, BCM57412_NPAR1,
+   "Broadcom BCM57412 NetXtreme-E Ethernet Partition"),
+PVID(BROADCOM_VENDOR_ID, BCM57412_NPAR2,
+   "Broadcom BCM57412 NetXtreme-E Ethernet Partition"),
+PVID(BROADCOM_VENDOR_ID, BCM57414,
+   "Broadcom BCM57414 NetXtreme-E 10Gb/25Gb Ethernet"),
+PVID(BROADCOM_VENDOR_ID, BCM57414_NPAR1,
+   "Broadcom 

svn commit: r309076 - head/sys/arm64/conf

2016-11-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Nov 24 00:45:52 2016
New Revision: 309076
URL: https://svnweb.freebsd.org/changeset/base/309076

Log:
  [rpi3] Move SOC_BRCM_BCM2837 from UP config to SMP one
  
  Now that BCM283x source are buildable with SMP option it cam be moved to
  GENERIC SMP config. SMP itself does not work on RPi3 yet due to lack of
  PSCI monitor which is work in progress at the moment

Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/arm64/conf/GENERIC-UP

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Thu Nov 24 00:45:00 2016(r309075)
+++ head/sys/arm64/conf/GENERIC Thu Nov 24 00:45:52 2016(r309076)
@@ -90,6 +90,7 @@ options   MALLOC_DEBUG_MAXZONES=8 # Separ
 optionsSOC_ALLWINNER_A64
 optionsSOC_CAVM_THUNDERX
 optionsSOC_HISI_HI6220
+optionsSOC_BRCM_BCM2837
 
 # Annapurna Alpine drivers
 device al_ccu  # Alpine Cache Coherency Unit

Modified: head/sys/arm64/conf/GENERIC-UP
==
--- head/sys/arm64/conf/GENERIC-UP  Thu Nov 24 00:45:00 2016
(r309075)
+++ head/sys/arm64/conf/GENERIC-UP  Thu Nov 24 00:45:52 2016
(r309076)
@@ -21,5 +21,3 @@
 includeGENERIC
 ident  GENERIC-UP
 nooptions  SMP
-
-optionsSOC_BRCM_BCM2837
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309074 - head/sys/arm/broadcom/bcm2835

2016-11-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Nov 24 00:39:17 2016
New Revision: 309074
URL: https://svnweb.freebsd.org/changeset/base/309074

Log:
  [rpi3] Fix SMP build for FreeBSD/arm64

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

Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2836.c Thu Nov 24 00:15:32 2016
(r309073)
+++ head/sys/arm/broadcom/bcm2835/bcm2836.c Thu Nov 24 00:39:17 2016
(r309074)
@@ -362,7 +362,11 @@ bcm_lintc_ipi_dispatch(struct bcm_lintc_
 * and make sure that it's observed by everybody.
 */
bcm_lintc_write_4(sc, BCM_LINTC_MBOX0_CLR_REG(cpu), 1 << ipi);
+#if defined(__aarch64__)
+   dsb(sy);
+#else
dsb();
+#endif
intr_ipi_dispatch(ipi, tf);
}
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309073 - head/sys/dev/bnxt

2016-11-23 Thread Stephen Hurd
Author: shurd (ports committer)
Date: Thu Nov 24 00:15:32 2016
New Revision: 309073
URL: https://svnweb.freebsd.org/changeset/base/309073

Log:
  Fix version string
  
  This is no longer on github, but in FreeBSD base.
  
  Approved by:  davidch
  MFC after:6 days
  Sponsored by: Broadcom Limited

Modified:
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Wed Nov 23 23:53:52 2016(r309072)
+++ head/sys/dev/bnxt/if_bnxt.c Thu Nov 24 00:15:32 2016(r309073)
@@ -227,7 +227,7 @@ static driver_t bnxt_iflib_driver = {
  * iflib shared context
  */
 
-char bnxt_driver_version[] = 
"https://github.com/Broadcom/freebsd-nxt/commits/bnxt-dev;;
+char bnxt_driver_version[] = "FreeBSD base";
 extern struct if_txrx bnxt_txrx;
 static struct if_shared_ctx bnxt_sctx_init = {
.isc_magic = IFLIB_MAGIC,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309070 - head/share/man/man4

2016-11-23 Thread Andriy Voskoboinyk
Author: avos
Date: Wed Nov 23 22:57:47 2016
New Revision: 309070
URL: https://svnweb.freebsd.org/changeset/base/309070

Log:
  rtwn.4: fix hostapd(8) man page section.

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

Modified: head/share/man/man4/rtwn.4
==
--- head/share/man/man4/rtwn.4  Wed Nov 23 22:50:20 2016(r309069)
+++ head/share/man/man4/rtwn.4  Wed Nov 23 22:57:47 2016(r309070)
@@ -198,7 +198,6 @@ The driver will reset the hardware.
 This should not happen.
 .El
 .Sh SEE ALSO
-.Xr hostapd 4 ,
 .Xr intro 4 ,
 .Xr netintro 4 ,
 .Xr rtwn_pci 4 ,
@@ -210,6 +209,7 @@ This should not happen.
 .Xr wlan_tkip 4 ,
 .Xr wlan_wep 4 ,
 .Xr wlan_xauth 4 ,
+.Xr hostapd 8 ,
 .Xr ifconfig 8 ,
 .Xr wpa_supplicant 8
 .Sh HISTORY
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309069 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace

2016-11-23 Thread George V. Neville-Neil
Author: gnn
Date: Wed Nov 23 22:50:20 2016
New Revision: 309069
URL: https://svnweb.freebsd.org/changeset/base/309069

Log:
  Add tunable to disable destructive dtrace
  
  Submitted by: Joerg Pernfuss 
  Reviewed by:  rstone, markj
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D8624

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/dev/dtrace/dtrace_load.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Nov 
23 20:21:53 2016(r309068)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Nov 
23 22:50:20 2016(r309069)
@@ -157,6 +157,10 @@
  * /etc/system.
  */
 intdtrace_destructive_disallow = 0;
+#ifndef illumos
+/* Positive logic version of dtrace_destructive_disallow for loader tunable */
+intdtrace_allow_destructive = 1;
+#endif
 dtrace_optval_tdtrace_nonroot_maxsize = (16 * 1024 * 1024);
 size_t dtrace_difo_maxsize = (256 * 1024);
 dtrace_optval_tdtrace_dof_maxsize = (8 * 1024 * 1024);

Modified: head/sys/cddl/dev/dtrace/dtrace_load.c
==
--- head/sys/cddl/dev/dtrace/dtrace_load.c  Wed Nov 23 20:21:53 2016
(r309068)
+++ head/sys/cddl/dev/dtrace/dtrace_load.c  Wed Nov 23 22:50:20 2016
(r309069)
@@ -52,6 +52,17 @@ dtrace_load(void *dummy)
int i;
 #endif
 
+#ifndef illumos
+   /*
+* DTrace uses negative logic for the destructive mode switch, so it
+* is required to translate from the sysctl which uses positive logic.
+*/ 
+   if (dtrace_allow_destructive)
+   dtrace_destructive_disallow = 0;
+   else
+   dtrace_destructive_disallow = 1;
+#endif
+
/* Hook into the trap handler. */
dtrace_trap_func = dtrace_trap;
 

Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c
==
--- head/sys/cddl/dev/dtrace/dtrace_sysctl.cWed Nov 23 20:21:53 2016
(r309068)
+++ head/sys/cddl/dev/dtrace/dtrace_sysctl.cWed Nov 23 22:50:20 2016
(r309069)
@@ -92,3 +92,6 @@ SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_
 
 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
 _helper_actions_max, 0, "maximum number of allowed helper actions");
+
+SYSCTL_INT(_security_bsd, OID_AUTO, allow_destructive_dtrace, CTLFLAG_RDTUN,
+_allow_destructive, 1, "Allow destructive mode DTrace scripts");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309068 - in head/libexec/rtld-elf: . mips

2016-11-23 Thread John Baldwin
Author: jhb
Date: Wed Nov 23 20:21:53 2016
New Revision: 309068
URL: https://svnweb.freebsd.org/changeset/base/309068

Log:
  Fix _mips_rtld_bind() to handle ELF filters.
  
  MIPS does not use the common _rtld_bind() to handle runtime binding.
  Instead, it uses a private _mips_rtld_bind().  Update _mips_rtld_bind()
  to include the changes made to _rtld_bind() in r216695 and r218476 to
  support upgrading the read-locked rtld_bind_lock to a write lock when
  an object with a filter is encountered.
  
  While here, add a 'where' variable to track the location of the fixup
  in the GOT to make the code flow more closely match _rtld_bind().
  
  Reviewed by:  kib
  Obtained from:CheriBSD
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D8625

Modified:
  head/libexec/rtld-elf/mips/reloc.c
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/mips/reloc.c
==
--- head/libexec/rtld-elf/mips/reloc.c  Wed Nov 23 19:50:12 2016
(r309067)
+++ head/libexec/rtld-elf/mips/reloc.c  Wed Nov 23 20:21:53 2016
(r309068)
@@ -240,10 +240,17 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size
 Elf_Addr *got = obj->pltgot;
 const Elf_Sym *def;
 const Obj_Entry *defobj;
+Elf_Addr *where;
 Elf_Addr target;
+RtldLockState lockstate;
 
+   rlock_acquire(rtld_bind_lock, );
+   if (sigsetjmp(lockstate.env, 0) != 0)
+   lock_upgrade(rtld_bind_lock, );
+
+   where = [obj->local_gotno + reloff - obj->gotsym];
 def = find_symdef(reloff, obj, , SYMLOOK_IN_PLT, NULL,
-   NULL);
+   );
 if (def == NULL)
rtld_die();
 
@@ -251,9 +258,9 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size
 dbg("bind now/fixup at %s sym # %jd in %s --> was=%p new=%p",
obj->path,
(intmax_t)reloff, defobj->strtab + def->st_name, 
-   (void *)got[obj->local_gotno + reloff - obj->gotsym],
-   (void *)target);
-got[obj->local_gotno + reloff - obj->gotsym] = target;
+   (void *)*where, (void *)target);
+   *where = target;
+   lock_release(rtld_bind_lock, );
return (Elf_Addr)target;
 }
 

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cWed Nov 23 19:50:12 2016
(r309067)
+++ head/libexec/rtld-elf/rtld.cWed Nov 23 20:21:53 2016
(r309068)
@@ -695,6 +695,10 @@ rtld_resolve_ifunc(const Obj_Entry *obj,
return ((void *)target);
 }
 
+/*
+ * NB: MIPS uses a private version of this function (_mips_rtld_bind).
+ * Changes to this function should be applied there as well.
+ */
 Elf_Addr
 _rtld_bind(Obj_Entry *obj, Elf_Size reloff)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Christian Brueffer
Author: brueffer
Date: Wed Nov 23 19:19:11 2016
New Revision: 309066
URL: https://svnweb.freebsd.org/changeset/base/309066

Log:
  Fix various mdoc issues reported by mandoc -Tlint.

Modified:
  head/share/man/man9/bus_map_resource.9
  head/share/man/man9/cnv.9
  head/share/man/man9/counter.9
  head/share/man/man9/osd.9
  head/share/man/man9/pmap_zero_page.9
  head/share/man/man9/rman.9
  head/share/man/man9/tcp_functions.9

Modified: head/share/man/man9/bus_map_resource.9
==
--- head/share/man/man9/bus_map_resource.9  Wed Nov 23 18:45:15 2016
(r309065)
+++ head/share/man/man9/bus_map_resource.9  Wed Nov 23 19:19:11 2016
(r309066)
@@ -135,6 +135,8 @@ By default memory mappings use the
 .Dv VM_MEMATTR_UNCACHEABLE
 attribute.
 .El
+.Sh RETURN VALUES
+Zero is returned on success, otherwise an error is returned.
 .Sh EXAMPLES
 This maps a PCI memory BAR with the write-combining memory attribute and
 reads the first 32-bit word:
@@ -153,9 +155,6 @@ reads the first 32-bit word:
bus_map_resource(dev, SYS_RES_MEMORY, r, , );
val = bus_read_4(, 0);
 .Ed
-.Pp
-.Sh RETURN VALUES
-Zero is returned on success, otherwise an error is returned.
 .Sh SEE ALSO
 .Xr bus_activate_resource 9 ,
 .Xr bus_alloc_resource 9 ,

Modified: head/share/man/man9/cnv.9
==
--- head/share/man/man9/cnv.9   Wed Nov 23 18:45:15 2016(r309065)
+++ head/share/man/man9/cnv.9   Wed Nov 23 19:19:11 2016(r309066)
@@ -80,7 +80,7 @@
 .Fn cnvlist_take_nvlist_array "void *cookiep" "size_t *nitemsp"
 .Ft int
 .Fn cnvlist_take_descriptor "void *cookiep"
-.Ft "const int *'
+.Ft "const int *"
 .Fn cnvlist_take_descriptor_array "void *cookiep" "size_t *nitemsp"
 .\"
 .Ft void
@@ -189,11 +189,11 @@ nvlist_destroy(nvl);
 return (0);
 .Ed
 .Sh SEE ALSO
-.Xr nv 9 ,
 .Xr close 2 ,
-.Xr free 3
+.Xr free 3 ,
+.Xr nv 9
 .Sh AUTHORS
-.An -nosplit
 The
 .Nm cnv
 API was created during the Google Summer Of Code 2016 by
+.An Adam Starak .

Modified: head/share/man/man9/counter.9
==
--- head/share/man/man9/counter.9   Wed Nov 23 18:45:15 2016
(r309065)
+++ head/share/man/man9/counter.9   Wed Nov 23 19:19:11 2016
(r309066)
@@ -224,7 +224,6 @@ static counter_u64_t array[MY_SIZE];
 SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW,
 [0], MY_SIZE, "Test counter array");
 .Ed
-.Pp
 .Sh SEE ALSO
 .Xr atomic 9 ,
 .Xr critical 9 ,

Modified: head/share/man/man9/osd.9
==
--- head/share/man/man9/osd.9   Wed Nov 23 18:45:15 2016(r309065)
+++ head/share/man/man9/osd.9   Wed Nov 23 19:19:11 2016(r309066)
@@ -412,7 +412,8 @@ return zero on success or ENOMEM if the 
 triggered an internal
 .Xr realloc 9
 which failed
-.Fn ( osd_set_reserved
+.Ns (
+.Fn osd_set_reserved
 will always succeed when
 .Fa rsv
 is non-NULL).

Modified: head/share/man/man9/pmap_zero_page.9
==
--- head/share/man/man9/pmap_zero_page.9Wed Nov 23 18:45:15 2016
(r309065)
+++ head/share/man/man9/pmap_zero_page.9Wed Nov 23 19:19:11 2016
(r309066)
@@ -49,7 +49,6 @@ The
 function is used to zero-fill an area of a page.
 The range specified must not cross a page boundary; it must be contained
 entirely within a single page.
-.Pp
 .Sh IMPLEMENTATION NOTES
 This function is required to be implemented for each architecture supported by
 .Fx .

Modified: head/share/man/man9/rman.9
==
--- head/share/man/man9/rman.9  Wed Nov 23 18:45:15 2016(r309065)
+++ head/share/man/man9/rman.9  Wed Nov 23 19:19:11 2016(r309066)
@@ -468,8 +468,8 @@ function returns a pointer to the device
 .Xr bus_alloc_resource 9 ,
 .Xr bus_map_resource 9 ,
 .Xr bus_release_resource 9 ,
-.Xr bus_space 9 ,
 .Xr bus_set_resource 9 ,
+.Xr bus_space 9 ,
 .Xr mutex 9
 .Sh AUTHORS
 This manual page was written by

Modified: head/share/man/man9/tcp_functions.9
==
--- head/share/man/man9/tcp_functions.9 Wed Nov 23 18:45:15 2016
(r309065)
+++ head/share/man/man9/tcp_functions.9 Wed Nov 23 19:19:11 2016
(r309066)
@@ -312,6 +312,7 @@ the current default function block.
 The
 .Fa blk
 argument references a function block that is not currently registered.
+.El
 .Sh SEE ALSO
 .Xr connect 2 ,
 .Xr listen 2 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308687 - head/libexec/rtld-elf

2016-11-23 Thread Bryan Drewery
On 11/15/2016 1:37 AM, Konstantin Belousov wrote:
> Author: kib
> Date: Tue Nov 15 09:37:35 2016
> New Revision: 308687
> URL: https://svnweb.freebsd.org/changeset/base/308687
> 
> Log:
>   Update hint to utilize user variable.
>   
>   Sponsored by:   The FreeBSD Foundation
>   MFC after:  1 week
> 
> Modified:
>   head/libexec/rtld-elf/Makefile
> 
> Modified: head/libexec/rtld-elf/Makefile
> ==
> --- head/libexec/rtld-elf/MakefileTue Nov 15 09:20:28 2016
> (r308686)
> +++ head/libexec/rtld-elf/MakefileTue Nov 15 09:37:35 2016
> (r308687)
> @@ -2,7 +2,7 @@
>  
>  # Use the following command to build local debug version of dynamic
>  # linker:
> -# make DEBUG_FLAGS=-g DEBUG=-DDEBUG MK_TESTS=no all
> +# make DEBUG_FLAGS=-g DEBUG=-DDEBUG WITHOUT_TESTS=yes all

What prompted this change? Passing MK_TESTS=no should work fine.

>  
>  .include 
>  PACKAGE= clibs
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r309065 - head/share/man/man4

2016-11-23 Thread Christian Brueffer
Author: brueffer
Date: Wed Nov 23 18:45:15 2016
New Revision: 309065
URL: https://svnweb.freebsd.org/changeset/base/309065

Log:
  Fix various mdoc issues reported by mandoc -Tlint.

Modified:
  head/share/man/man4/armv8crypto.4
  head/share/man/man4/bhnd.4
  head/share/man/man4/bhndb.4
  head/share/man/man4/chromebook_platform.4
  head/share/man/man4/hv_vss.4
  head/share/man/man4/mpr.4
  head/share/man/man4/mps.4
  head/share/man/man4/ng_checksum.4
  head/share/man/man4/ng_mppc.4
  head/share/man/man4/ntb_hw.4
  head/share/man/man4/rtwn.4
  head/share/man/man4/rtwn_pci.4
  head/share/man/man4/rtwn_usb.4

Modified: head/share/man/man4/armv8crypto.4
==
--- head/share/man/man4/armv8crypto.4   Wed Nov 23 18:31:34 2016
(r309064)
+++ head/share/man/man4/armv8crypto.4   Wed Nov 23 18:45:15 2016
(r309065)
@@ -50,7 +50,7 @@ armv8crypto_load="YES"
 .Ed
 .Sh DESCRIPTION
 Starting with the ARMv8 architecture ARM Limited has added optional
-cryptography instructions to accelerate AES, SHA-1, SHA-2, and 
+cryptography instructions to accelerate AES, SHA-1, SHA-2, and
 finite field arithmetic.
 .Pp
 The processor capability is reported as AES in the Instruction Set

Modified: head/share/man/man4/bhnd.4
==
--- head/share/man/man4/bhnd.4  Wed Nov 23 18:31:34 2016(r309064)
+++ head/share/man/man4/bhnd.4  Wed Nov 23 18:45:15 2016(r309065)
@@ -67,8 +67,8 @@ the
 .Xr bcma 4
 BHND driver.
 .Sh SEE ALSO
-.Xr bhndb 4 ,
 .Xr bcma 4 ,
+.Xr bhndb 4 ,
 .Xr siba 4
 .Sh HISTORY
 The

Modified: head/share/man/man4/bhndb.4
==
--- head/share/man/man4/bhndb.4 Wed Nov 23 18:31:34 2016(r309064)
+++ head/share/man/man4/bhndb.4 Wed Nov 23 18:45:15 2016(r309065)
@@ -53,7 +53,7 @@ driver supports
 host bridge cores such as those used by Broadcom HND PCI,
 PCMCIA, and SDIO network adapters.
 .Sh SEE ALSO
-.Xr bhnd 4
+.Xr bhnd 4 ,
 .Xr bwn 4
 .Sh HISTORY
 The

Modified: head/share/man/man4/chromebook_platform.4
==
--- head/share/man/man4/chromebook_platform.4   Wed Nov 23 18:31:34 2016
(r309064)
+++ head/share/man/man4/chromebook_platform.4   Wed Nov 23 18:45:15 2016
(r309065)
@@ -59,7 +59,7 @@ Those have to be compiled into the kerne
 .Sh SEE ALSO
 .Xr cyapa 4 ,
 .Xr iicbus 4 ,
-.Xr isl 4 ,
+.Xr isl 4
 .Sh AUTHORS
 .An -nosplit
 The

Modified: head/share/man/man4/hv_vss.4
==
--- head/share/man/man4/hv_vss.4Wed Nov 23 18:31:34 2016
(r309064)
+++ head/share/man/man4/hv_vss.4Wed Nov 23 18:45:15 2016
(r309065)
@@ -352,9 +352,10 @@ main(int argc, char* argv[]) {
}
return 0;
 }
+.Ed
 .Sh SEE ALSO
-.Xr hv_vss_daemon 8 ,
-.Xr hv_utils 4
+.Xr hv_utils 4 ,
+.Xr hv_vss_daemon 8
 .Sh HISTORY
 The daemon was introduced in October 2016 and developed by Microsoft Corp.
 .Sh AUTHORS

Modified: head/share/man/man4/mpr.4
==
--- head/share/man/man4/mpr.4   Wed Nov 23 18:31:34 2016(r309064)
+++ head/share/man/man4/mpr.4   Wed Nov 23 18:45:15 2016(r309065)
@@ -83,7 +83,6 @@ Broadcom Ltd./Avago Tech (LSI) SAS 3216 
 Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS)
 .El
 .Sh CONFIGURATION
-.Pp
 In all tunable descriptions below, X represents the adapter number.
 .Pp
 To disable MSI interrupts for all
@@ -156,7 +155,6 @@ 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

Modified: head/share/man/man4/mps.4
==
--- head/share/man/man4/mps.4   Wed Nov 23 18:31:34 2016(r309064)
+++ head/share/man/man4/mps.4   Wed Nov 23 18:45:15 2016(r309065)
@@ -95,7 +95,6 @@ Intel Integrated RAID Module RMS25KB040
 Intel Integrated RAID Module RMS25KB080
 .El
 .Sh CONFIGURATION
-.Pp
 In all tunable descriptions below, X represents the adapter number.
 .Pp
 To disable MSI interrupts for all
@@ -168,7 +167,6 @@ The current number of active I/O command
 dev.mps.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

Modified: head/share/man/man4/ng_checksum.4
==
--- head/share/man/man4/ng_checksum.4   Wed Nov 23 18:31:34 2016
(r309064)
+++ head/share/man/man4/ng_checksum.4   Wed Nov 23 18:45:15 2016
(r309065)
@@ -134,8 +134,8 @@ can calculate CSUM_IP_UDP|CSUM_IP_TCP.
 The
 .Nm
 node 

svn commit: r309064 - head/sys/boot/fdt/dts/arm

2016-11-23 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 23 18:31:34 2016
New Revision: 309064
URL: https://svnweb.freebsd.org/changeset/base/309064

Log:
  Enable UEXT related nodes for Olimex A20 SOM
  
  UEXT are Universal EXTension connector from Olimex. They embed i2c, spi
  and uart pins along power in one connector and are found on most,
  if not all, Olimex boards.
  The Olimex A20 SOM EVB have two UEXT connector so enable the nodes found on
  those two connectors.
  
  Patch has been applied upstream, in the meantime add the nodes to our custom
  DTS.

Modified:
  head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts

Modified: head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts
==
--- head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dtsWed Nov 23 18:07:44 
2016(r309063)
+++ head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dtsWed Nov 23 18:31:34 
2016(r309064)
@@ -45,3 +45,39 @@
  {
cpu-supply = <_dcdc2>;
 };
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>,
+   <_cs0_pins_a>;
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>,
+   <_cs0_pins_a>;
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_a>;
+   status = "okay";
+};
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 23 18:07:44 2016
New Revision: 309063
URL: https://svnweb.freebsd.org/changeset/base/309063

Log:
  Test that the emac device is enabled in probe function
  
  MFC after:3 days

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

Modified: head/sys/arm/allwinner/if_emac.c
==
--- head/sys/arm/allwinner/if_emac.cWed Nov 23 17:53:07 2016
(r309062)
+++ head/sys/arm/allwinner/if_emac.cWed Nov 23 18:07:44 2016
(r309063)
@@ -783,6 +783,9 @@ static int
 emac_probe(device_t dev)
 {
 
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-emac"))
return (ENXIO);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309062 - in head/sys: fs/ext2fs kern sys ufs/ffs vm

2016-11-23 Thread Mark Johnston
Author: markj
Date: Wed Nov 23 17:53:07 2016
New Revision: 309062
URL: https://svnweb.freebsd.org/changeset/base/309062

Log:
  Release laundered vnode pages to the head of the inactive queue.
  
  The swap pager enqueues laundered pages near the head of the inactive queue
  to avoid another trip through LRU before reclamation. This change adds
  support for this behaviour to the vnode pager and makes use of it in UFS and
  ext2fs. Some ioflag handling is consolidated into a common subroutine so
  that this support can be easily extended to other filesystems which make use
  of the buffer cache. No changes are needed for ZFS since its putpages
  routine always undirties the pages before returning, and the laundry
  thread requeues the pages appropriately in this case.
  
  Reviewed by:  alc, kib
  Differential Revision:https://reviews.freebsd.org/D8589

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/kern/vfs_bio.c
  head/sys/sys/buf.h
  head/sys/sys/vnode.h
  head/sys/ufs/ffs/ffs_vnops.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_pager.h
  head/sys/vm/vnode_pager.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==
--- head/sys/fs/ext2fs/ext2_vnops.c Wed Nov 23 17:48:43 2016
(r309061)
+++ head/sys/fs/ext2fs/ext2_vnops.c Wed Nov 23 17:53:07 2016
(r309062)
@@ -1701,15 +1701,6 @@ ext2_ind_read(struct vop_read_args *ap)
}
 
/*
-* If IO_DIRECT then set B_DIRECT for the buffer.  This
-* will cause us to attempt to release the buffer later on
-* and will cause the buffer cache to attempt to free the
-* underlying pages.
-*/
-   if (ioflag & IO_DIRECT)
-   bp->b_flags |= B_DIRECT;
-
-   /*
 * We should only get non-zero b_resid when an I/O error
 * has occurred, which should cause us to break above.
 * However, if the short read did not cause an error,
@@ -1726,25 +1717,7 @@ ext2_ind_read(struct vop_read_args *ap)
(int)xfersize, uio);
if (error)
break;
-
-   if (ioflag & (IO_VMIO|IO_DIRECT)) {
-   /*
-* If it's VMIO or direct I/O, then we don't
-* need the buf, mark it available for
-* freeing. If it's non-direct VMIO, the VM has
-* the data.
-*/
-   bp->b_flags |= B_RELBUF;
-   brelse(bp);
-   } else {
-   /*
-* Otherwise let whoever
-* made the request take care of
-* freeing it. We just queue
-* it onto another list.
-*/
-   bqrelse(bp);
-   }
+   vfs_bio_brelse(bp, ioflag);
}
 
/* 
@@ -1753,14 +1726,8 @@ ext2_ind_read(struct vop_read_args *ap)
 * and on normal completion has not set a new value into it.
 * so it must have come from a 'break' statement
 */
-   if (bp != NULL) {
-   if (ioflag & (IO_VMIO|IO_DIRECT)) {
-   bp->b_flags |= B_RELBUF;
-   brelse(bp);
-   } else {
-   bqrelse(bp);
-   }
-   }
+   if (bp != NULL)
+   vfs_bio_brelse(bp, ioflag);
 
if ((error == 0 || uio->uio_resid != orig_resid) &&
(vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0)
@@ -2018,9 +1985,8 @@ ext2_write(struct vop_write_args *ap)
if (error != 0 && (bp->b_flags & B_CACHE) == 0 &&
fs->e2fs_bsize == xfersize)
vfs_bio_clrbuf(bp);
-   if (ioflag & (IO_VMIO|IO_DIRECT)) {
-   bp->b_flags |= B_RELBUF;
-   }
+
+   vfs_bio_set_flags(bp, ioflag);
 
/*
 * If IO_SYNC each buffer is written synchronously.  Otherwise

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Nov 23 17:48:43 2016(r309061)
+++ head/sys/kern/vfs_bio.c Wed Nov 23 17:53:07 2016(r309062)
@@ -4414,6 +4414,45 @@ vfs_bio_bzero_buf(struct buf *bp, int ba
 }
 
 /*
+ * Update buffer flags based on I/O request parameters, optionally releasing 
the
+ * buffer.  If it's VMIO or direct I/O, the buffer pages are released to the 
VM,
+ * where they may be placed on a page queue (VMIO) or freed immediately (direct
+ * I/O).  Otherwise the buffer is released to the cache.
+ */
+static void
+b_io_dismiss(struct buf *bp, int ioflag, bool release)
+{
+
+   KASSERT((ioflag & 

svn commit: r309060 - head/tools/tools/nanobsd/Files/root

2016-11-23 Thread Christian Brueffer
Author: brueffer
Date: Wed Nov 23 16:54:27 2016
New Revision: 309060
URL: https://svnweb.freebsd.org/changeset/base/309060

Log:
  Fix comment typo.
  
  PR:   208484
  Submitted by: madpilot
  MFC after:1 week

Modified:
  head/tools/tools/nanobsd/Files/root/save_cfg

Modified: head/tools/tools/nanobsd/Files/root/save_cfg
==
--- head/tools/tools/nanobsd/Files/root/save_cfgWed Nov 23 14:15:51 
2016(r309059)
+++ head/tools/tools/nanobsd/Files/root/save_cfgWed Nov 23 16:54:27 
2016(r309060)
@@ -66,7 +66,7 @@ do
#   i) -> add file to ignore list (/cfg/.ignore 
hiereachy) and never save
# try to add this file to /cfg.
#
-   # touch is ised to add files to /cfg to keep the script 
flow straight and easy
+   # touch is used to add files to /cfg to keep the script 
flow straight and easy
#
read -p "New file /etc/$filename found. Add to /cfg 
(y/n/i)? " key
case "$key" in
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309059 - head/share/misc

2016-11-23 Thread Mikhail Pchelin
Author: misha (ports committer)
Date: Wed Nov 23 14:15:51 2016
New Revision: 309059
URL: https://svnweb.freebsd.org/changeset/base/309059

Log:
  - Add myself (misha) as a ports committer
  - Update mentor/mentee relationships
  
  Approved by:  jpaetzel (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Nov 23 13:45:25 2016
(r309058)
+++ head/share/misc/committers-ports.dotWed Nov 23 14:15:51 2016
(r309059)
@@ -166,6 +166,7 @@ matthew [label="Matthew Seaman\nmatthew@
 mezz [label="Jeremy Messenger\nm...@freebsd.org\n2004/04/30"]
 mharo [label="Michael Haro\nmh...@freebsd.org\n1999/04/13"]
 milki [label="Jonathan Chu\nmi...@freebsd.org\n2013/12/15"]
+misha [label="Mikhail Pchelin\nmi...@freebsd.org\n2016/11/15"]
 miwi [label="Martin Wilke\nm...@freebsd.org\n2006/06/04"]
 mm [label="Martin Matuska\n...@freebsd.org\n2007/04/04"]
 mnag [label="Marcus Alves Grando\nm...@freebsd.org\n2005/09/15"]
@@ -378,6 +379,7 @@ flz -> johans
 flz -> laszlof
 flz -> romain
 
+jpaetzel -> misha
 jpaetzel -> wg
 
 gabor -> lippe
@@ -617,6 +619,7 @@ wen -> pawel
 wg -> alexey
 wg -> danilo
 wg -> dvl
+wg -> misha
 wg -> nemysis
 
 will -> lioux
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309055 - head/sys/mips/conf

2016-11-23 Thread Ruslan Bukin
Author: br
Date: Wed Nov 23 11:56:22 2016
New Revision: 309055
URL: https://svnweb.freebsd.org/changeset/base/309055

Log:
  Split MALTA board config to big and little endian versions.
  
  This fixes compilation after r308807 ("Pass MACHINE_ARCH on
  command line for MIPS kernels.")
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/mips/conf/MALTA64EL
 - copied, changed from r309054, head/sys/mips/conf/MALTA64
  head/sys/mips/conf/MALTAEL
 - copied, changed from r309054, head/sys/mips/conf/MALTA
Modified:
  head/sys/mips/conf/MALTA
  head/sys/mips/conf/MALTA64

Modified: head/sys/mips/conf/MALTA
==
--- head/sys/mips/conf/MALTAWed Nov 23 11:32:57 2016(r309054)
+++ head/sys/mips/conf/MALTAWed Nov 23 11:56:22 2016(r309055)
@@ -1,4 +1,4 @@
-# MALTA -- Kernel config for MALTA boards
+# MALTA -- Kernel config for MALTA endian-big boards
 #
 # $FreeBSD$
  
@@ -6,6 +6,6 @@ ident   MALTA
 
 include"std.MALTA"
  
-machinemips mipsel # Malta supports both, so it isn't in 
std.malta
+machinemips mips
  
 makeoptionsKERNLOADADDR=0x8010

Modified: head/sys/mips/conf/MALTA64
==
--- head/sys/mips/conf/MALTA64  Wed Nov 23 11:32:57 2016(r309054)
+++ head/sys/mips/conf/MALTA64  Wed Nov 23 11:56:22 2016(r309055)
@@ -1,4 +1,4 @@
-# MALTA64 -- 64-bit kernel config for MALTA boards
+# MALTA64 -- 64-bit kernel config for MALTA endian-big boards
 #
 # $FreeBSD$
  
@@ -6,7 +6,7 @@ ident   MALTA64
 
 include"std.MALTA"
  
-machinemips mips64el   # Malta supports both, so it isn't in 
std.malta
+machinemips mips64
  
 makeoptionsARCH_FLAGS="-march=mips64 -mabi=64"
  

Copied and modified: head/sys/mips/conf/MALTA64EL (from r309054, 
head/sys/mips/conf/MALTA64)
==
--- head/sys/mips/conf/MALTA64  Wed Nov 23 11:32:57 2016(r309054, copy 
source)
+++ head/sys/mips/conf/MALTA64ELWed Nov 23 11:56:22 2016
(r309055)
@@ -1,4 +1,4 @@
-# MALTA64 -- 64-bit kernel config for MALTA boards
+# MALTA64 -- 64-bit kernel config for MALTA endian-little boards
 #
 # $FreeBSD$
  
@@ -6,7 +6,7 @@ ident   MALTA64
 
 include"std.MALTA"
  
-machinemips mips64el   # Malta supports both, so it isn't in 
std.malta
+machinemips mips64el
  
 makeoptionsARCH_FLAGS="-march=mips64 -mabi=64"
  

Copied and modified: head/sys/mips/conf/MALTAEL (from r309054, 
head/sys/mips/conf/MALTA)
==
--- head/sys/mips/conf/MALTAWed Nov 23 11:32:57 2016(r309054, copy 
source)
+++ head/sys/mips/conf/MALTAEL  Wed Nov 23 11:56:22 2016(r309055)
@@ -1,4 +1,4 @@
-# MALTA -- Kernel config for MALTA boards
+# MALTA -- Kernel config for MALTA endian-little boards
 #
 # $FreeBSD$
  
@@ -6,6 +6,6 @@ ident   MALTA
 
 include"std.MALTA"
  
-machinemips mipsel # Malta supports both, so it isn't in 
std.malta
+machinemips mipsel
  
 makeoptionsKERNLOADADDR=0x8010
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r309053 - head/sys/mips/include

2016-11-23 Thread Ruslan Bukin
Author: br
Date: Wed Nov 23 11:30:40 2016
New Revision: 309053
URL: https://svnweb.freebsd.org/changeset/base/309053

Log:
  Increase pcpu size to 512 so it become both denominator
  of PAGE_SIZE and aligned to CACHE_LINE_SIZE.
  
  This fixes CTASSERT.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/mips/include/pcpu.h

Modified: head/sys/mips/include/pcpu.h
==
--- head/sys/mips/include/pcpu.hWed Nov 23 11:03:23 2016
(r309052)
+++ head/sys/mips/include/pcpu.hWed Nov 23 11:30:40 2016
(r309053)
@@ -48,7 +48,7 @@
 #else
 #definePCPU_MD_MIPS32_FIELDS   
\
PCPU_MD_COMMON_FIELDS   \
-   char__pad[133]
+   char__pad[193]
 #endif
 
 #ifdef __mips_n64
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap

2016-11-23 Thread Olivier Cochard-Labbé
​Hi,

since this commit, my system panic when using netmap pkt-gen with a Chelsio
T540-CR NIC (I didn't reproduce it with Intel NIC).

- Latest known working system: FreeBSD 12.0-CURRENT #2 r307393
- Crash since: FreeBSD 12.0-CURRENT #1 r307396

On a fresh (r309034) system, here is he behavior:

[root@SM]~# pkt-gen -i vcxl0 -f rx -w 4
133.571714 main [2546] interface is vcxl0
133.572025 main [2670] running on 1 cpus (have 8)
133.572377 extract_ip_range [462] range is 10.0.0.1:1234 to 10.0.0.1:1234
133.572393 extract_ip_range [462] range is 10.1.0.1:1234 to 10.1.0.1:1234

​Fatal trap 12: page fault while in kernel mode
cpuid = 7; apic id = 0e
fault virtual address   = 0x0
fault code  = supervisor write data, page not present
instruction pointer = 0x20:0x80d5480e
stack pointer   = 0x28:0xfe0466ba61e0
frame pointer   = 0x28:0xfe0466ba61e0
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 1900 (pkt-gen)
trap number = 12
panic: page fault
cpuid = 7
KDB: stack backtrace:
#0 0x80971167 at kdb_backtrace+0x67
#1 0x80929b72 at vpanic+0x182
#2 0x809299e3 at panic+0x43
#3 0x80d56e84 at trap_fatal+0x324
#4 0x80d57083 at trap_pfault+0x1e3
#5 0x80d56683 at trap+0x273
#6 0x80d39261 at calltrap+0x8
#7 0x8047c664 at cxgbe_netmap_reg+0x2f4
#8 0x8063d48c at netmap_hw_reg+0x2c
#9 0x8063a93b at netmap_do_regif+0x2ab
#10 0x8063b564 at netmap_ioctl+0xba4
#11 0x8063f14e at freebsd_netmap_ioctl+0x3e
#12 0x8085e47c at devfs_ioctl+0xac
#13 0x80eee78d at VOP_IOCTL_APV+0x8d
#14 0x80a08901 at vn_ioctl+0x131
#15 0x8085ecdf at devfs_ioctl_f+0x1f
#16 0x8098ed7b at kern_ioctl+0x29b
#17 0x8098ea71 at sys_ioctl+0x171
Uptime: 4m41s
Dumping 1112 out of 16325 MB:..2%..11%..21%..31%..41%..
51%..61%..71%..81%..91%
Dump complete

(kgdb) backtrace
#0  doadump (textdump=) at pcpu.h:222
#1  0x809295f9 in kern_reboot (howto=260) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/kern_shutdown.c:366
#2  0x80929bab in vpanic (fmt=, ap=) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/kern_shutdown.c:759
#3  0x809299e3 in panic (fmt=0x0) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/kern_shutdown.c:690
#4  0x80d56e84 in trap_fatal (frame=0xfe0466ba6120, eva=0) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/trap.c:801
#5  0x80d57083 in trap_pfault (frame=0xfe0466ba6120,
usermode=0) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/trap.c:658
#6  0x80d56683 in trap (frame=0xfe0466ba6120) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/trap.c:421
#7  0x80d39261 in calltrap () at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/exception.S:236
#8  0x80d5480e in bzero () at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/support.S:53
#9  0x8047c664 in cxgbe_netmap_reg (na=,
on=) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/cxgbe/t4_netmap.c:102
#10 0x8063d48c in netmap_hw_reg (na=0xf800055ba400, onoff=1) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap.c:2788
#11 0x8063a93b in netmap_do_regif (priv=,
na=, ringid=, flags=)
at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap.c:2050
#12 0x8063b564 in netmap_ioctl (priv=,
cmd=, data=0xfe0466ba69b0 "vcxl0",
td=0xf8001509a500)
at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap.c:2257
#13 0x8063f14e in freebsd_netmap_ioctl (dev=,
cmd=3225184658, data=0xfe0466ba69b0 "vcxl0", ffla=,
td=0xf8001509a500) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap_freebsd.c:1389
#14 0x8085e47c in devfs_ioctl (ap=) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/fs/devfs/devfs_vnops.c:831
#15 0x80eee78d in VOP_IOCTL_APV (vop=,
a=) at vnode_if.c:1067
#16 0x80a08901 in vn_ioctl (fp=0xf80015191f00, com=, data=0xfe0466ba69b0, active_cred=0xf8019928bd00,
td=0x1) at vnode_if.h:448
#17 0x8085ecdf in devfs_ioctl_f (fp=0x0, com=131072, data=0x0,
cred=0x4000, td=0xf8001509a500)
at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/fs/devfs/devfs_vnops.c:789
#18 0x8098ed7b in kern_ioctl (td=, fd=, com=3225184658, data=0xfe0466ba69b0 "vcxl0") at
file.h:327
#19 0x8098ea71 in sys_ioctl (td=0xf8001509a500,
uap=0xfe0466ba6b10) at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/sys_generic.c:746
#20 0x80d57825 in amd64_syscall (td=,
traced=0) at subr_syscall.c:135
#21 0x80d3954b in Xfast_syscall () at
/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/exception.S:396
#22 0x00080100e5ca in ?? ()


​Regards,

Olivier​

svn commit: r309051 - head/lib/libfetch

2016-11-23 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Nov 23 10:52:19 2016
New Revision: 309051
URL: https://svnweb.freebsd.org/changeset/base/309051

Log:
  Remove debugging code.

Modified:
  head/lib/libfetch/common.c

Modified: head/lib/libfetch/common.c
==
--- head/lib/libfetch/common.c  Wed Nov 23 10:11:15 2016(r309050)
+++ head/lib/libfetch/common.c  Wed Nov 23 10:52:19 2016(r309051)
@@ -283,18 +283,14 @@ fetch_resolve(const char *addr, int port
}
 
/* resolve */
-   fetch_info("resolving host = %s service = %s af = %d",
-   host, service, af);
memset(, 0, sizeof(hints));
hints.ai_family = af;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG;
if ((err = getaddrinfo(host, service, , )) != 0) {
netdb_seterr(err);
-   fetch_info("getaddrinfo() failed: %s", gai_strerror(err));
return (NULL);
}
-   fetch_info("getaddrinfo() succeeded %p", res);
return (res);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Andrew Turner
Author: andrew
Date: Wed Nov 23 09:38:10 2016
New Revision: 309048
URL: https://svnweb.freebsd.org/changeset/base/309048

Log:
  Mark cpu_find_cpu0_fdt as FDT only. It's only called when this is set, and
  the kernel is using FDT.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Nov 23 09:37:02 2016
(r309047)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Nov 23 09:38:10 2016
(r309048)
@@ -511,6 +511,7 @@ cpu_mp_announce(void)
 {
 }
 
+#ifdef FDT
 static boolean_t
 cpu_find_cpu0_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
 {
@@ -531,6 +532,7 @@ cpu_find_cpu0_fdt(u_int id, phandle_t no
 
return (TRUE);
 }
+#endif
 
 void
 cpu_mp_setmaxid(void)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Andrew Turner
Author: andrew
Date: Wed Nov 23 09:33:47 2016
New Revision: 309046
URL: https://svnweb.freebsd.org/changeset/base/309046

Log:
  Remove the unneeded ofw_cpu_reg function signature, it's not used in this
  file.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Nov 23 09:25:51 2016
(r309045)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Nov 23 09:33:47 2016
(r309046)
@@ -87,8 +87,6 @@ static struct intr_ipi *intr_ipi_lookup(
 static void intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *,
 void *);
 
-boolean_t ofw_cpu_reg(phandle_t node, u_int, cell_t *);
-
 extern struct pcpu __pcpu[];
 
 static device_identify_t arm64_cpu_identify;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-11-23 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Nov 23 08:30:02 2016
New Revision: 309039
URL: https://svnweb.freebsd.org/changeset/base/309039

Log:
  hyperv/vmbus: Merge free/active locks.
  
  These functions are only used by management stuffs, so there are
  no needs to introduce extra complexity.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8524

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_xact.c

Modified: head/sys/dev/hyperv/vmbus/vmbus_xact.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_xact.c  Wed Nov 23 08:17:05 2016
(r309038)
+++ head/sys/dev/hyperv/vmbus/vmbus_xact.c  Wed Nov 23 08:30:02 2016
(r309039)
@@ -50,16 +50,17 @@ struct vmbus_xact {
 };
 
 struct vmbus_xact_ctx {
-   uint32_txc_flags;
size_t  xc_req_size;
size_t  xc_resp_size;
size_t  xc_priv_size;
 
+   struct mtx  xc_lock;
+   /*
+* Protected by xc_lock.
+*/
+   uint32_txc_flags;   /* VMBUS_XACT_CTXF_ */
struct vmbus_xact   *xc_free;
-   struct mtx  xc_free_lock;
-
struct vmbus_xact   *xc_active;
-   struct mtx  xc_active_lock;
 };
 
 #define VMBUS_XACT_CTXF_DESTROY0x0001
@@ -110,10 +111,10 @@ vmbus_xact_get1(struct vmbus_xact_ctx *c
 {
struct vmbus_xact *xact;
 
-   mtx_lock(>xc_free_lock);
+   mtx_lock(>xc_lock);
 
while ((ctx->xc_flags & dtor_flag) == 0 && ctx->xc_free == NULL)
-   mtx_sleep(>xc_free, >xc_free_lock, 0, "gxact", 0);
+   mtx_sleep(>xc_free, >xc_lock, 0, "gxact", 0);
if (ctx->xc_flags & dtor_flag) {
/* Being destroyed */
xact = NULL;
@@ -124,7 +125,7 @@ vmbus_xact_get1(struct vmbus_xact_ctx *c
ctx->xc_free = NULL;
}
 
-   mtx_unlock(>xc_free_lock);
+   mtx_unlock(>xc_lock);
 
return (xact);
 }
@@ -146,8 +147,7 @@ vmbus_xact_ctx_create(bus_dma_tag_t dtag
return (NULL);
}
 
-   mtx_init(>xc_free_lock, "vmbus xact free", NULL, MTX_DEF);
-   mtx_init(>xc_active_lock, "vmbus xact active", NULL, MTX_DEF);
+   mtx_init(>xc_lock, "vmbus xact", NULL, MTX_DEF);
 
return (ctx);
 }
@@ -157,9 +157,9 @@ vmbus_xact_ctx_destroy(struct vmbus_xact
 {
struct vmbus_xact *xact;
 
-   mtx_lock(>xc_free_lock);
+   mtx_lock(>xc_lock);
ctx->xc_flags |= VMBUS_XACT_CTXF_DESTROY;
-   mtx_unlock(>xc_free_lock);
+   mtx_unlock(>xc_lock);
wakeup(>xc_free);
 
xact = vmbus_xact_get1(ctx, 0);
@@ -167,8 +167,7 @@ vmbus_xact_ctx_destroy(struct vmbus_xact
panic("can't get xact");
 
vmbus_xact_free(xact);
-   mtx_destroy(>xc_free_lock);
-   mtx_destroy(>xc_active_lock);
+   mtx_destroy(>xc_lock);
free(ctx, M_DEVBUF);
 }
 
@@ -196,10 +195,10 @@ vmbus_xact_put(struct vmbus_xact *xact)
KASSERT(ctx->xc_active == NULL, ("pending active xact"));
xact->x_resp = NULL;
 
-   mtx_lock(>xc_free_lock);
+   mtx_lock(>xc_lock);
KASSERT(ctx->xc_free == NULL, ("has free xact"));
ctx->xc_free = xact;
-   mtx_unlock(>xc_free_lock);
+   mtx_unlock(>xc_lock);
wakeup(>xc_free);
 }
 
@@ -233,10 +232,10 @@ vmbus_xact_activate(struct vmbus_xact *x
 
KASSERT(xact->x_resp == NULL, ("xact has pending response"));
 
-   mtx_lock(>xc_active_lock);
+   mtx_lock(>xc_lock);
KASSERT(ctx->xc_active == NULL, ("pending active xact"));
ctx->xc_active = xact;
-   mtx_unlock(>xc_active_lock);
+   mtx_unlock(>xc_lock);
 }
 
 void
@@ -244,10 +243,10 @@ vmbus_xact_deactivate(struct vmbus_xact 
 {
struct vmbus_xact_ctx *ctx = xact->x_ctx;
 
-   mtx_lock(>xc_active_lock);
+   mtx_lock(>xc_lock);
KASSERT(ctx->xc_active == xact, ("xact mismatch"));
ctx->xc_active = NULL;
-   mtx_unlock(>xc_active_lock);
+   mtx_unlock(>xc_lock);
 }
 
 const void *
@@ -257,17 +256,17 @@ vmbus_xact_wait1(struct vmbus_xact *xact
struct vmbus_xact_ctx *ctx = xact->x_ctx;
const void *resp;
 
-   mtx_lock(>xc_active_lock);
+   mtx_lock(>xc_lock);
 
KASSERT(ctx->xc_active == xact, ("xact mismatch"));
while (xact->x_resp == NULL) {
if (can_sleep) {
-   mtx_sleep(>xc_active, >xc_active_lock, 0,
+   mtx_sleep(>xc_active, >xc_lock, 0,
"wxact", 0);
} else {
-   mtx_unlock(>xc_active_lock);
+   mtx_unlock(>xc_lock);
DELAY(1000);
-   mtx_lock(>xc_active_lock);
+