Re: svn commit: r302364 - head/usr.sbin/bhyve

2016-07-05 Thread Ed Schouten
2016-07-06 7:02 GMT+02:00 Garrett Cooper :
>   Add `WRAPPED_CTASSERT` macro by annotating CTASSERTs with __unused
>   to deal with -Wunused-local-typedefs warnings from gcc 4.8+.
>   All other compilers (clang, etc) use CTASSERT as-is. A more generic
>   solution for this issue will be proposed after ^/stable/11 is forked.

This problem shouldn't exist when using C11's _Static_assert(), right?

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
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: r302369 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 05:17:56 2016
New Revision: 302369
URL: https://svnweb.freebsd.org/changeset/base/302369

Log:
  Fix gcc warning
  
  Remove -Wunused-but-set-variable (`mopt`).
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  X-MFC with: r302332
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/usb_mouse.c

Modified: head/usr.sbin/bhyve/usb_mouse.c
==
--- head/usr.sbin/bhyve/usb_mouse.c Wed Jul  6 05:17:07 2016
(r302368)
+++ head/usr.sbin/bhyve/usb_mouse.c Wed Jul  6 05:17:56 2016
(r302369)
@@ -297,9 +297,6 @@ static void *
 umouse_init(struct usb_hci *hci, char *opt)
 {
struct umouse_softc *sc;
-   char *mopt;
-
-   mopt = opt;
 
sc = calloc(1, sizeof(struct umouse_softc));
sc->hci = hci;
___
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: r302368 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 05:17:07 2016
New Revision: 302368
URL: https://svnweb.freebsd.org/changeset/base/302368

Log:
  Fix gcc build errors with SSE 4.2 detection and gcc warnings
  
  - Remove -Wunused-but-set-variable's (`len`, etc).
  - Replace clang-specific tests in sse42_supported(..) with generic,
FreeBSD-supported CPU feature tests, using macros and functions
from machine/cpufunc.h and machine/specialreg.h . The previous method
for determining SSE4.2 availability was only compatible with clang.
  - Sort #includes per style(9).
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  X-MFC with: r302332
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/rfb.c

Modified: head/usr.sbin/bhyve/rfb.c
==
--- head/usr.sbin/bhyve/rfb.c   Wed Jul  6 05:11:39 2016(r302367)
+++ head/usr.sbin/bhyve/rfb.c   Wed Jul  6 05:17:07 2016(r302368)
@@ -28,12 +28,14 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
-#include 
 #include 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -46,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 
 #include "bhyvegc.h"
 #include "console.h"
@@ -177,7 +178,6 @@ rfb_send_server_init_msg(int cfd)
 {
struct bhyvegc_image *gc_image;
struct rfb_srvr_info sinfo;
-   int len;
 
gc_image = console_get_image();
 
@@ -194,8 +194,8 @@ rfb_send_server_init_msg(int cfd)
sinfo.pixfmt.green_shift = 8;
sinfo.pixfmt.blue_shift = 0;
sinfo.namelen = htonl(strlen("bhyve"));
-   len = stream_write(cfd, , sizeof(sinfo));
-   len = stream_write(cfd, "bhyve", strlen("bhyve"));
+   (void)stream_write(cfd, , sizeof(sinfo));
+   (void)stream_write(cfd, "bhyve", strlen("bhyve"));
 }
 
 static void
@@ -223,9 +223,8 @@ static void
 rfb_recv_set_pixfmt_msg(struct rfb_softc *rc, int cfd)
 {
struct rfb_pixfmt_msg pixfmt_msg;
-   int len;
 
-   len = stream_read(cfd, ((void *)_msg)+1, sizeof(pixfmt_msg)-1);
+   (void)stream_read(cfd, ((void *)_msg)+1, sizeof(pixfmt_msg)-1);
 }
 
 
@@ -233,14 +232,14 @@ static void
 rfb_recv_set_encodings_msg(struct rfb_softc *rc, int cfd)
 {
struct rfb_enc_msg enc_msg;
-   int len, i;
+   int i;
uint32_t encoding;
 
assert((sizeof(enc_msg) - 1) == 3);
-   len = stream_read(cfd, ((void *)_msg)+1, sizeof(enc_msg)-1);
+   (void)stream_read(cfd, ((void *)_msg)+1, sizeof(enc_msg)-1);
 
for (i = 0; i < htons(enc_msg.numencs); i++) {
-   len = stream_read(cfd, , sizeof(encoding));
+   (void)stream_read(cfd, , sizeof(encoding));
switch (htonl(encoding)) {
case RFB_ENCODING_RAW:
rc->enc_raw_ok = true;
@@ -256,27 +255,6 @@ rfb_recv_set_encodings_msg(struct rfb_so
}
 }
 
-static void
-rfb_resize_update(struct rfb_softc *rc, int fd)
-{
-   struct rfb_srvr_updt_msg supdt_msg;
-struct rfb_srvr_rect_hdr srect_hdr;
-
-   /* Number of rectangles: 1 */
-   supdt_msg.type = 0;
-   supdt_msg.pad = 0;
-   supdt_msg.numrects = htons(1);
-   stream_write(fd, _msg, sizeof(struct rfb_srvr_updt_msg));
-
-   /* Rectangle header */
-   srect_hdr.x = htons(0);
-   srect_hdr.y = htons(0);
-   srect_hdr.width = htons(rc->width);
-   srect_hdr.height = htons(rc->height);
-   srect_hdr.encoding = htonl(RFB_ENCODING_RESIZE);
-   stream_write(fd, _hdr, sizeof(struct rfb_srvr_rect_hdr));
-}
-
 /*
  * Calculate CRC32 using SSE4.2; Intel or AMD Bulldozer+ CPUs only
  */
@@ -636,9 +614,8 @@ rfb_recv_update_msg(struct rfb_softc *rc
 {
struct rfb_updt_msg updt_msg;
struct bhyvegc_image *gc_image;
-   int len;
 
-   len = stream_read(cfd, ((void *)_msg) + 1 , sizeof(updt_msg) - 1);
+   (void)stream_read(cfd, ((void *)_msg) + 1 , sizeof(updt_msg) - 1);
 
console_refresh();
gc_image = console_get_image();
@@ -666,9 +643,8 @@ static void
 rfb_recv_key_msg(struct rfb_softc *rc, int cfd)
 {
struct rfb_key_msg key_msg;
-   int len;
 
-   len = stream_read(cfd, ((void *)_msg) + 1, sizeof(key_msg) - 1);
+   (void)stream_read(cfd, ((void *)_msg) + 1, sizeof(key_msg) - 1);
 
console_key_event(key_msg.down, htonl(key_msg.code));
 }
@@ -677,9 +653,8 @@ static void
 rfb_recv_ptr_msg(struct rfb_softc *rc, int cfd)
 {
struct rfb_ptr_msg ptr_msg;
-   int len;
 
-   len = stream_read(cfd, ((void *)_msg) + 1, sizeof(ptr_msg) - 1);
+   (void)stream_read(cfd, ((void *)_msg) + 1, sizeof(ptr_msg) - 1);
 
console_ptr_event(ptr_msg.button, htons(ptr_msg.x), htons(ptr_msg.y));
 }
@@ -876,13 +851,15 @@ rfb_thr(void *arg)
 }
 
 static int

svn commit: r302367 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 05:11:39 2016
New Revision: 302367
URL: https://svnweb.freebsd.org/changeset/base/302367

Log:
  Fix gcc warnings
  
  Remove unused function (`fifo_available`)
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  X-MFC with: r302332
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/ps2kbd.c

Modified: head/usr.sbin/bhyve/ps2kbd.c
==
--- head/usr.sbin/bhyve/ps2kbd.cWed Jul  6 05:09:13 2016
(r302366)
+++ head/usr.sbin/bhyve/ps2kbd.cWed Jul  6 05:11:39 2016
(r302367)
@@ -93,15 +93,6 @@ fifo_reset(struct ps2kbd_softc *sc)
fifo->size = sizeof(((struct fifo *)0)->buf);
 }
 
-static int
-fifo_available(struct ps2kbd_softc *sc)
-{
-   struct fifo *fifo;
-
-   fifo = >fifo;
-   return (fifo->num < fifo->size);
-}
-
 static void
 fifo_put(struct ps2kbd_softc *sc, uint8_t val)
 {
___
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: r302366 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 05:09:13 2016
New Revision: 302366
URL: https://svnweb.freebsd.org/changeset/base/302366

Log:
  Fix gcc warnings
  
  - Put parentheses around bitwise OR'ed values in the `FIELD_COPY(..)` and
`FIELD_REPLACE(..)` macros to mute warning from gcc 4.2.1.
  - Remove -Wunused-but-set-variable's (`setup_addr`, `status_addr`).
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  X-MFC with: r302332
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/pci_xhci.c

Modified: head/usr.sbin/bhyve/pci_xhci.c
==
--- head/usr.sbin/bhyve/pci_xhci.c  Wed Jul  6 05:05:03 2016
(r302365)
+++ head/usr.sbin/bhyve/pci_xhci.c  Wed Jul  6 05:09:13 2016
(r302366)
@@ -143,10 +143,10 @@ static int xhci_debug = 0;
 #defineMASK_64_HI(x)   ((x) & ~0xULL)
 #defineMASK_64_LO(x)   ((x) & 0xULL)
 
-#defineFIELD_REPLACE(a,b,m,s)  ((a) & ~((m) << (s)) | \
-   ((b) & (m)) << (s))
-#defineFIELD_COPY(a,b,m,s) ((a) & ~((m) << (s)) | \
-   ((b) & ((m) << (s
+#defineFIELD_REPLACE(a,b,m,s)  (((a) & ~((m) << (s))) | \
+   (((b) & (m)) << (s)))
+#defineFIELD_COPY(a,b,m,s) (((a) & ~((m) << (s))) | \
+   (((b) & ((m) << (s)
 
 struct pci_xhci_trb_ring {
uint64_t ringaddr;  /* current dequeue guest address */
@@ -1700,7 +1700,7 @@ pci_xhci_handle_transfer(struct pci_xhci
struct xhci_trb *setup_trb;
struct usb_data_xfer *xfer;
struct usb_data_xfer_block *xfer_block;
-   uint64_tval, setup_addr, status_addr;
+   uint64_tval;
uint32_ttrbflags;
int do_intr, err;
int do_retry;
@@ -1718,8 +1718,6 @@ retry:
do_retry = 0;
do_intr = 0;
setup_trb = NULL;
-   setup_addr = 0;
-   status_addr = 0;
 
while (1) {
pci_xhci_dump_trb(trb);
@@ -1754,7 +1752,6 @@ retry:
goto errout;
}
setup_trb = trb;
-   setup_addr = addr;
 
val = trb->qwTrb0;
if (!xfer->ureq)
@@ -1786,7 +1783,6 @@ retry:
break;
 
case XHCI_TRB_TYPE_STATUS_STAGE:
-   status_addr = addr;
xfer_block = usb_data_xfer_append(xfer, NULL, 0,
  (void *)addr, ccs);
break;
@@ -1842,7 +1838,6 @@ retry:
err = USB_ERR_NOT_STARTED;
if (dev->dev_ue->ue_request != NULL)
err = dev->dev_ue->ue_request(dev->dev_sc, xfer);
-   status_addr = 0;
setup_trb = NULL;
} else {
/* handle data transfer */
___
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: r302365 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 05:05:03 2016
New Revision: 302365
URL: https://svnweb.freebsd.org/changeset/base/302365

Log:
  Fix gcc warnings
  
  Remove -Wunused-but-set-variable (`error`). Cast calls with
  `(void)` to note that the return value is explicitly ignored.
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/pci_passthru.c

Modified: head/usr.sbin/bhyve/pci_passthru.c
==
--- head/usr.sbin/bhyve/pci_passthru.c  Wed Jul  6 05:02:59 2016
(r302364)
+++ head/usr.sbin/bhyve/pci_passthru.c  Wed Jul  6 05:05:03 2016
(r302365)
@@ -361,7 +361,7 @@ msix_table_write(struct vmctx *ctx, int 
uint64_t *dest64;
size_t entry_offset;
uint32_t vector_control;
-   int error, index;
+   int index;
 
pi = sc->psc_pi;
if (offset >= pi->pi_msix.pba_offset &&
@@ -416,8 +416,8 @@ msix_table_write(struct vmctx *ctx, int 
/* If the entry is masked, don't set it up */
if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 ||
(vector_control & PCIM_MSIX_VCTRL_MASK) == 0) {
-   error = vm_setup_pptdev_msix(ctx, vcpu,
-   sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, 
+   (void)vm_setup_pptdev_msix(ctx, vcpu,
+   sc->psc_sel.pc_bus, sc->psc_sel.pc_dev,
sc->psc_sel.pc_func, index, entry->addr,
entry->msg_data, entry->vector_control);
}
___
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: r302364 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 05:02:59 2016
New Revision: 302364
URL: https://svnweb.freebsd.org/changeset/base/302364

Log:
  Fix gcc warnings
  
  Add `WRAPPED_CTASSERT` macro by annotating CTASSERTs with __unused
  to deal with -Wunused-local-typedefs warnings from gcc 4.8+.
  All other compilers (clang, etc) use CTASSERT as-is. A more generic
  solution for this issue will be proposed after ^/stable/11 is forked.
  
  Consolidate all CTASSERTs under one block instead of inlining them in
  functions.
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/pci_emul.c

Modified: head/usr.sbin/bhyve/pci_emul.c
==
--- head/usr.sbin/bhyve/pci_emul.c  Wed Jul  6 04:58:42 2016
(r302363)
+++ head/usr.sbin/bhyve/pci_emul.c  Wed Jul  6 05:02:59 2016
(r302364)
@@ -755,13 +755,21 @@ pci_emul_init(struct vmctx *ctx, struct 
return (err);
 }
 
+#ifdef __GNU_C__
+#defineWRAPPED_CTASSERT(x) CTASSERT(x) __unused
+#else
+#defineWRAPPED_CTASSERT(x) CTASSERT(x)
+#endif
+
+WRAPPED_CTASSERT(sizeof(struct msicap) == 14);
+WRAPPED_CTASSERT(sizeof(struct msixcap) == 12);
+WRAPPED_CTASSERT(sizeof(struct pciecap) == 60);
+
 void
 pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr)
 {
int mmc;
 
-   CTASSERT(sizeof(struct msicap) == 14);
-
/* Number of msi messages must be a power of 2 between 1 and 32 */
assert((msgnum & (msgnum - 1)) == 0 && msgnum >= 1 && msgnum <= 32);
mmc = ffs(msgnum) - 1;
@@ -786,7 +794,6 @@ static void
 pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum,
 uint32_t msix_tab_size)
 {
-   CTASSERT(sizeof(struct msixcap) == 12);
 
assert(msix_tab_size % 4096 == 0);
 
@@ -937,8 +944,6 @@ pci_emul_add_pciecap(struct pci_devinst 
int err;
struct pciecap pciecap;
 
-   CTASSERT(sizeof(struct pciecap) == 60);
-
if (type != PCIEM_TYPE_ROOT_PORT)
return (-1);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302363 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 04:58:42 2016
New Revision: 302363
URL: https://svnweb.freebsd.org/changeset/base/302363

Log:
  Fix gcc warnings
  
  Put cfl/prdt under AHCI_DEBUG #defines as they are only used in
  those cases.
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/pci_ahci.c

Modified: head/usr.sbin/bhyve/pci_ahci.c
==
--- head/usr.sbin/bhyve/pci_ahci.c  Wed Jul  6 04:56:45 2016
(r302362)
+++ head/usr.sbin/bhyve/pci_ahci.c  Wed Jul  6 04:58:42 2016
(r302363)
@@ -1717,19 +1717,25 @@ static void
 ahci_handle_slot(struct ahci_port *p, int slot)
 {
struct ahci_cmd_hdr *hdr;
+#ifdef AHCI_DEBUG
struct ahci_prdt_entry *prdt;
+#endif
struct pci_ahci_softc *sc;
uint8_t *cfis;
+#ifdef AHCI_DEBUG
int cfl;
+#endif
 
sc = p->pr_sc;
hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
+#ifdef AHCI_DEBUG
cfl = (hdr->flags & 0x1f) * 4;
+#endif
cfis = paddr_guest2host(ahci_ctx(sc), hdr->ctba,
0x80 + hdr->prdtl * sizeof(struct ahci_prdt_entry));
+#ifdef AHCI_DEBUG
prdt = (struct ahci_prdt_entry *)(cfis + 0x80);
 
-#ifdef AHCI_DEBUG
DPRINTF("\ncfis:");
for (i = 0; i < cfl; i++) {
if (i % 10 == 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: r302362 - head/usr.sbin/bhyve

2016-07-05 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 04:56:45 2016
New Revision: 302362
URL: https://svnweb.freebsd.org/changeset/base/302362

Log:
  Fix gcc warnings
  
  - Remove -Wunused-but-set-variable (newcpu)
  - Always return VMEXIT_CONTINUE as the code always set retval to that value.
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D7119
  MFC after: 1 week
  Reported by: Jenkins
  Reviewed by: grehan (maintainer)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Jul  6 03:23:07 2016
(r302361)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Jul  6 04:56:45 2016
(r302362)
@@ -388,13 +388,11 @@ vmexit_wrmsr(struct vmctx *ctx, struct v
 static int
 vmexit_spinup_ap(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu)
 {
-   int newcpu;
-   int retval = VMEXIT_CONTINUE;
 
-   newcpu = spinup_ap(ctx, *pvcpu,
-  vme->u.spinup_ap.vcpu, vme->u.spinup_ap.rip);
+   (void)spinup_ap(ctx, *pvcpu,
+   vme->u.spinup_ap.vcpu, vme->u.spinup_ap.rip);
 
-   return (retval);
+   return (VMEXIT_CONTINUE);
 }
 
 #defineDEBUG_EPT_MISCONFIG
___
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: r302361 - head/share/misc

2016-07-05 Thread Eric Badger
Author: badger
Date: Wed Jul  6 03:23:07 2016
New Revision: 302361
URL: https://svnweb.freebsd.org/changeset/base/302361

Log:
  Add myself to the src committers graph.
  
  Approved by:  re (gjb), kib (mentor)

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

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Jul  6 00:02:04 2016
(r302360)
+++ head/share/misc/committers-src.dot  Wed Jul  6 03:23:07 2016
(r302361)
@@ -120,6 +120,7 @@ arybchik [label="Andrew Rybchenko\narybc
 asomers [label="Alan Somers\nasom...@freebsd.org\n2013/04/24"]
 avg [label="Andriy Gapon\n...@freebsd.org\n2009/02/18"]
 avos [label="Andriy Voskoboinyk\na...@freebsd.org\n2015/09/24"]
+badger [label="Eric Badger\nbad...@freebsd.org\n2016/07/01"]
 bapt [label="Baptiste Daroussin\nb...@freebsd.org\n2011/12/23"]
 bdrewery [label="Bryan Drewery\nbdrew...@freebsd.org\n2013/12/14"]
 benl [label="Ben Laurie\nb...@freebsd.org\n2011/05/18"]
@@ -588,6 +589,7 @@ ken -> asomers
 ken -> slm
 
 kib -> ae
+kib -> badger
 kib -> dchagin
 kib -> gjb
 kib -> jah
@@ -767,6 +769,8 @@ ume -> jinmei
 ume -> suz
 ume -> tshiozak
 
+vangyzen -> badger
+
 wes -> scf
 
 wkoszek -> jceel
___
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: r302360 - svnadmin/conf

2016-07-05 Thread Glen Barber
Author: gjb
Date: Wed Jul  6 00:02:04 2016
New Revision: 302360
URL: https://svnweb.freebsd.org/changeset/base/302360

Log:
  Premptively add stable/11 and releng/11.0 entries to the
  approvers file.  Note, these are commented out for now.
  
  Approved by:  re (implicit)
  Sponsored by: The FreeBSD Foundation

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Tue Jul  5 23:03:57 2016(r302359)
+++ svnadmin/conf/approvers Wed Jul  6 00:02:04 2016(r302360)
@@ -17,8 +17,10 @@
 # $FreeBSD$
 #
 ^head/ re
+#^stable/11/   re
 #^stable/10/   re
 ^release/  re
+#^releng/11.0/ re
 ^releng/10.[0-3]/  (security-officer|so)
 ^releng/9.[0-3]/   (security-officer|so)
 ^releng/8.[0-4]/   (security-officer|so)
___
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: r302328 - in head/sys: kern sys

2016-07-05 Thread Ngie Cooper (yaneurabeya)

> On Jul 5, 2016, at 03:08, Bruce Evans  wrote:
> 
> On Sun, 3 Jul 2016, Konstantin Belousov wrote:
> 
> This is mostly a test reply (replying to src-committers has stopped
> working for newer commits).
> 
>> Log:
>> Provide helper macros to detect 'non-silent SBDRY' state and to
>> calculate appropriate return value for stops.  Simplify the code by
>> using them.
>> 
>> Fix typo in sig_suspend_threads().  The thread which sleep must be
>> aborted is td2. (*)
>> 
>> In issignal(), when handling stopping signal for thread in
>> TD_SBDRY_INTR state, do not stop, this is wrong and fires assert.
>> This is yet another place where execution should be forced out of
>> SBDRY-protected region.  For such case, return -1 from issignal() and
>> translate it to corresponding error code in sleepq_catch_signals().
>> Assert that other consumers of cursig() are not affected by the new
>> return value. (*)
>> 
>> Micro-optimize, mostly VFS and VOP methods, by avoiding calling the
>> functions when SIGDEFERSTOP_NOP non-change is requested. (**)
>> 
>> Reported and tested by:  pho (*)
>> Requested by:bde (**)
>> Sponsored by:The FreeBSD Foundation
>> MFC after:   2 weeks
>> Approved by: re (gjb)
> 
> Thanks, but this is still very slow (even slower than beore the
> micro-optimization).

Could you please bump __FreeBSD_version ? This change broke 
emulators/open-vm-tools from pkg.FreeBSD.org , so it needs to be rebuilt.
Thanks,
-Ngie

$ sudo service vmware-kmod start
Loading vmmemctl kernel module: already loaded.
Loading vmxnet kernel module: already loaded.
Loading vmblock kernel module: failed.
Cannot 'start' vmware_guest_vmhgfs. Set vmware_guest_vmhgfs_enable to YES in 
/etc/rc.conf or use 'onestart' instead of 'start'.
$ tail -n 3 /var/log/messages
Jul  5 15:59:03 fbsd11 fetch: gethostby*.getanswer: asked for 
"mirror.easthsia.com IN ", got type "A"
Jul  5 16:01:43 fbsd11 kernel: link_elf_obj: symbol sigdeferstop undefined
Jul  5 16:01:43 fbsd11 kernel: linker_load_file: Unsupported file type


signature.asc
Description: Message signed with OpenPGP using GPGMail


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

2016-07-05 Thread Glen Barber
Author: gjb
Date: Tue Jul  5 23:03:57 2016
New Revision: 302359
URL: https://svnweb.freebsd.org/changeset/base/302359

Log:
  Correct a manual page reference.
  
  Approved by:  re (kib)
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man4/capsicum.4
==
--- head/share/man/man4/capsicum.4  Tue Jul  5 22:30:29 2016
(r302358)
+++ head/share/man/man4/capsicum.4  Tue Jul  5 23:03:57 2016
(r302359)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2016
+.Dd July 5, 2016
 .Dt CAPSICUM 4
 .Os
 .Sh NAME
@@ -104,7 +104,7 @@ associated with file descriptors; descri
 .Xr shm_open 2 ,
 .Xr write 2 ,
 .Xr cap_rights_get 3 ,
-.Xr casper 3 ,
+.Xr libcasper 3 ,
 .Xr procdesc 4
 .Sh HISTORY
 .Nm
___
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: r302332 - head/usr.sbin/bhyve

2016-07-05 Thread Ngie Cooper (yaneurabeya)

> On Jul 5, 2016, at 15:52, Bryan Drewery  wrote:
> 
> On 7/3/2016 8:19 PM, Peter Grehan wrote:
>> Author: grehan
>> Date: Mon Jul  4 03:19:06 2016
>> New Revision: 302332
>> URL: https://svnweb.freebsd.org/changeset/base/302332
>> 
>> Log:
>>  Import bhyve_graphics into CURRENT. Thanks to all who tested
>>  this on the branch.
>> 
>>  Original commit message:
>>Initial bhyve native graphics support.
>> 
>>This adds emulations for a raw framebuffer device, PS2 keyboard/mouse,
>>XHCI USB controller and a USB tablet.
>> 
>>A simple VNC server is provided for keyboard/mouse input, and graphics
>>output.
>> 
>>A VGA emulation is included, but is currently disconnected until an
>>additional bhyve change to block out VGA memory is committed.
>> 
>>Credits:
>> - raw framebuffer, VNC server, XHCI controller, USB bus/device emulation
>>and UEFI f/w support by Leon Dang
>> - VGA, console/g, initial VNC server  by tychon@
>> - PS2 keyboard/mouse jointly done by tychon@ and Leon Dang
>> - hypervisor framebuffer mem support by neel@
>> 
>>Tested by: Michael Dexter, in a number of revisions of this code.
>> 
>>With the appropriate UEFI image, FreeBSD, Windows and Linux guests can
>>installed and run in graphics mode using the UEFI/GOP framebuffer.
> 
> This breaks the external GCC 5.2 build:
> 
> /builds/FreeBSD_HEAD_amd64_gcc/usr.sbin/bhyve/rfb.c: In function
> 'sse42_supported':
> /builds/FreeBSD_HEAD_amd64_gcc/usr.sbin/bhyve/rfb.c:885:17: error:
> 'bit_SSE42' undeclared (first use in this function)
>  return ((ecx & bit_SSE42) != 0);
> ^
> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1334/console

It breaks gcc compilation in general. Here’s my proposed fix in progress: 
https://reviews.freebsd.org/D7119 .
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r302332 - head/usr.sbin/bhyve

2016-07-05 Thread Peter Grehan

This breaks the external GCC 5.2 build:


 Fix being worked on in https://reviews.freebsd.org/D7119

later,

Peter.

___
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: r302332 - head/usr.sbin/bhyve

2016-07-05 Thread Bryan Drewery
On 7/3/2016 8:19 PM, Peter Grehan wrote:
> Author: grehan
> Date: Mon Jul  4 03:19:06 2016
> New Revision: 302332
> URL: https://svnweb.freebsd.org/changeset/base/302332
> 
> Log:
>   Import bhyve_graphics into CURRENT. Thanks to all who tested
>   this on the branch.
>   
>   Original commit message:
> Initial bhyve native graphics support.
>   
> This adds emulations for a raw framebuffer device, PS2 keyboard/mouse,
> XHCI USB controller and a USB tablet.
>   
> A simple VNC server is provided for keyboard/mouse input, and graphics
> output.
>   
> A VGA emulation is included, but is currently disconnected until an
> additional bhyve change to block out VGA memory is committed.
>   
> Credits:
>  - raw framebuffer, VNC server, XHCI controller, USB bus/device emulation
> and UEFI f/w support by Leon Dang
>  - VGA, console/g, initial VNC server  by tychon@
>  - PS2 keyboard/mouse jointly done by tychon@ and Leon Dang
>  - hypervisor framebuffer mem support by neel@
>   
> Tested by: Michael Dexter, in a number of revisions of this code.
>   
> With the appropriate UEFI image, FreeBSD, Windows and Linux guests can
> installed and run in graphics mode using the UEFI/GOP framebuffer.

This breaks the external GCC 5.2 build:

/builds/FreeBSD_HEAD_amd64_gcc/usr.sbin/bhyve/rfb.c: In function
'sse42_supported':
/builds/FreeBSD_HEAD_amd64_gcc/usr.sbin/bhyve/rfb.c:885:17: error:
'bit_SSE42' undeclared (first use in this function)
  return ((ecx & bit_SSE42) != 0);
 ^
https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1334/console

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r302358 - head/include

2016-07-05 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Jul  5 22:30:29 2016
New Revision: 302358
URL: https://svnweb.freebsd.org/changeset/base/302358

Log:
  Remove incorrect attributes from posix_memalign(3) declaration.
  
  Both __alloc_align and __alloc_size can't be used when the function
  returns a pointer to memory. This fixes breakage when building with
  clang 3.4:
  
  In file included from /usr/src/svn/usr.sbin/bhyve/atkbdc.c:40:
  /usr/include/stdlib.h:176:6: error: '__alloc_size__' attribute only
  applies to functions that return a pointer [-Werror,-Wignored-attributes]
  
  Pointed out by:   ngie, cem
  Approved by:  re (gjb)

Modified:
  head/include/stdlib.h

Modified: head/include/stdlib.h
==
--- head/include/stdlib.h   Tue Jul  5 22:07:41 2016(r302357)
+++ head/include/stdlib.h   Tue Jul  5 22:30:29 2016(r302358)
@@ -172,8 +172,7 @@ char*realpath(const char * __restrict, 
 int rand_r(unsigned *);/* (TSF) */
 #endif
 #if __POSIX_VISIBLE >= 200112
-int posix_memalign(void **, size_t, size_t) __nonnull(1) __alloc_align(2)
-   __alloc_size(3);/* (ADV) */
+int posix_memalign(void **, size_t, size_t) __nonnull(1); /* (ADV) */
 int setenv(const char *, const char *, int);
 int unsetenv(const char *);
 #endif
___
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: r302357 - head/release/doc/en_US.ISO8859-1/relnotes

2016-07-05 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Tue Jul  5 22:07:41 2016
New Revision: 302357
URL: https://svnweb.freebsd.org/changeset/base/302357

Log:
  Document r302221, file has been updated to version 5.28
  
  Approved by:  re (gjb, implicit, relnotes)

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
21:57:25 2016(r302356)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
22:07:41 2016(r302357)
@@ -574,8 +574,8 @@
has been updated to
version 4.0.2.
 
-  The  utility has been
-   updated to version 5.26.
+  The  utility has been
+   updated to version 5.28.
 
   The  utility has been updated
to the OpenBSD 5.8 version.
___
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: r302356 - head/release/doc/en_US.ISO8859-1/relnotes

2016-07-05 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Tue Jul  5 21:57:25 2016
New Revision: 302356
URL: https://svnweb.freebsd.org/changeset/base/302356

Log:
  Remove reference to casperd
  
  Reported by:  bapt
  Approved by:  re (gjb, implicit, relnotes)

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
20:56:52 2016(r302355)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
21:57:25 2016(r302356)
@@ -182,12 +182,6 @@
 
   Userland Application Changes
 
-  The  daemon has been
-   added, which provides access to functionality that is not
-   available in the capability mode
-   sandbox.
-
   When unable to load a kernel module with
, a message informing to view output of
 is now printed, opposed to the previous output
___
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: r302355 - head/release/doc/en_US.ISO8859-1/relnotes

2016-07-05 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Tue Jul  5 20:56:52 2016
New Revision: 302355
URL: https://svnweb.freebsd.org/changeset/base/302355

Log:
  Document 300207, Support for Shingled Magnetic Recording (SMR) drives.
  
  Approved by:  re (gjb, implicit, relnotes)

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
20:53:32 2016(r302354)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
20:56:52 2016(r302355)
@@ -1570,6 +1570,10 @@
 and the names of 
/dev/diskid/DISK-*
device nodes, among other things.
 
+  
+   Support for managing Shingled Magnetic Recording (SMR) drives
+   has been added.
+
 
 
 
___
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: r302354 - head/sys/dev/ioat

2016-07-05 Thread Conrad E. Meyer
Author: cem
Date: Tue Jul  5 20:53:32 2016
New Revision: 302354
URL: https://svnweb.freebsd.org/changeset/base/302354

Log:
  ioat(4): Block asynchronous work during HW reset
  
  Fix the race between ioat_reset_hw and ioat_process_events.
  
  HW reset isn't protected by a lock because it can sleep for a long time
  (40.1 ms).  This resulted in a race where we would process bogus parts
  of the descriptor ring as if it had completed.  This looked like
  duplicate completions on old events, if your ring had looped at least
  once.
  
  Block callout and interrupt work while reset runs so the completion end
  of things does not observe indeterminate state and process invalid parts
  of the ring.
  
  Start the channel with a manually implemented ioat_null() to keep other
  submitters quiesced while we wait for the channel to start (100 us).
  
  r295605 may have made the race between ioat_reset_hw and
  ioat_process_events wider, but I believe it already existed before that
  revision.  ioat_process_events can be invoked by two asynchronous
  sources: callout (softclock) and device interrupt.  Those could race
  each other, to the same effect.
  
  Reviewed by:  markj
  Approved by:  re
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D7097

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cTue Jul  5 20:52:35 2016(r302353)
+++ head/sys/dev/ioat/ioat.cTue Jul  5 20:53:32 2016(r302354)
@@ -376,12 +376,32 @@ ioat_teardown_intr(struct ioat_softc *io
 static int
 ioat_start_channel(struct ioat_softc *ioat)
 {
+   struct ioat_dma_hw_descriptor *hw_desc;
+   struct ioat_descriptor *desc;
+   struct bus_dmadesc *dmadesc;
uint64_t status;
uint32_t chanerr;
int i;
 
ioat_acquire(>dmaengine);
-   ioat_null(>dmaengine, NULL, NULL, 0);
+
+   /* Submit 'NULL' operation manually to avoid quiescing flag */
+   desc = ioat_get_ring_entry(ioat, ioat->head);
+   dmadesc = >bus_dmadesc;
+   hw_desc = desc->u.dma;
+
+   dmadesc->callback_fn = NULL;
+   dmadesc->callback_arg = NULL;
+
+   hw_desc->u.control_raw = 0;
+   hw_desc->u.control_generic.op = IOAT_OP_COPY;
+   hw_desc->u.control_generic.completion_update = 1;
+   hw_desc->size = 8;
+   hw_desc->src_addr = 0;
+   hw_desc->dest_addr = 0;
+   hw_desc->u.control.null = 1;
+
+   ioat_submit_single(ioat);
ioat_release(>dmaengine);
 
for (i = 0; i < 100; i++) {
@@ -496,6 +516,7 @@ ioat3_attach(device_t device)
ioat->head = ioat->hw_head = 0;
ioat->tail = 0;
ioat->last_seen = 0;
+   *ioat->comp_update = 0;
return (0);
 }
 
@@ -641,14 +662,24 @@ ioat_process_events(struct ioat_softc *i
boolean_t pending;
int error;
 
+   CTR0(KTR_IOAT, __func__);
+
mtx_lock(>cleanup_lock);
 
+   /*
+* Don't run while the hardware is being reset.  Reset is responsible
+* for blocking new work and draining & completing existing work, so
+* there is nothing to do until new work is queued after reset anyway.
+*/
+   if (ioat->resetting_cleanup) {
+   mtx_unlock(>cleanup_lock);
+   return;
+   }
+
completed = 0;
comp_update = *ioat->comp_update;
status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK;
 
-   CTR0(KTR_IOAT, __func__);
-
if (status == ioat->last_seen) {
/*
 * If we landed in process_events and nothing has been
@@ -1643,6 +1674,13 @@ ioat_shrink_timer_callback(void *arg)
 
/* Slowly scale the ring down if idle. */
mtx_lock(>submit_lock);
+
+   /* Don't run while the hardware is being reset. */
+   if (ioat->resetting) {
+   mtx_unlock(>submit_lock);
+   return;
+   }
+
order = ioat->ring_size_order;
if (ioat->is_resize_pending || order == IOAT_MIN_ORDER) {
mtx_unlock(>submit_lock);
@@ -1712,6 +1750,14 @@ ioat_reset_hw(struct ioat_softc *ioat)
ioat_drain_locked(ioat);
mtx_unlock(IOAT_REFLK);
 
+   /*
+* Suspend ioat_process_events while the hardware and softc are in an
+* indeterminate state.
+*/
+   mtx_lock(>cleanup_lock);
+   ioat->resetting_cleanup = TRUE;
+   mtx_unlock(>cleanup_lock);
+
status = ioat_get_chansts(ioat);
if (is_ioat_active(status) || is_ioat_idle(status))
ioat_suspend(ioat);
@@ -1793,6 +1839,7 @@ ioat_reset_hw(struct ioat_softc *ioat)
 */
ioat->tail = ioat->head = ioat->hw_head = 0;
ioat->last_seen = 0;
+   *ioat->comp_update = 0;
 
ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN);

svn commit: r302353 - head/sys/dev/ioat

2016-07-05 Thread Conrad E. Meyer
Author: cem
Date: Tue Jul  5 20:52:35 2016
New Revision: 302353
URL: https://svnweb.freebsd.org/changeset/base/302353

Log:
  ioat(4): Serialize ioat_reset_hw invocations
  
  Reviewed by:  markj
  Approved by:  re
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D7097

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cTue Jul  5 20:51:52 2016(r302352)
+++ head/sys/dev/ioat/ioat.cTue Jul  5 20:52:35 2016(r302353)
@@ -326,6 +326,7 @@ ioat_detach(device_t device)
ioat->quiescing = TRUE;
ioat->destroying = TRUE;
wakeup(>quiescing);
+   wakeup(>resetting);
 
ioat_channel[ioat->chan_idx] = NULL;
 
@@ -1699,6 +1700,14 @@ ioat_reset_hw(struct ioat_softc *ioat)
int error;
 
mtx_lock(IOAT_REFLK);
+   while (ioat->resetting && !ioat->destroying)
+   msleep(>resetting, IOAT_REFLK, 0, "IRH_drain", 0);
+   if (ioat->destroying) {
+   mtx_unlock(IOAT_REFLK);
+   return (ENXIO);
+   }
+   ioat->resetting = TRUE;
+
ioat->quiescing = TRUE;
ioat_drain_locked(ioat);
mtx_unlock(IOAT_REFLK);
@@ -1792,6 +1801,9 @@ ioat_reset_hw(struct ioat_softc *ioat)
 
 out:
mtx_lock(IOAT_REFLK);
+   ioat->resetting = FALSE;
+   wakeup(>resetting);
+
ioat->quiescing = FALSE;
wakeup(>quiescing);
mtx_unlock(IOAT_REFLK);
@@ -2172,6 +2184,7 @@ DB_SHOW_COMMAND(ioat, db_show_ioat)
db_printf(" is_reset_pending: %d\n", (int)sc->is_reset_pending);
db_printf(" is_channel_running: %d\n", (int)sc->is_channel_running);
db_printf(" intrdelay_supported: %d\n", (int)sc->intrdelay_supported);
+   db_printf(" resetting: %d\n", (int)sc->resetting);
 
db_printf(" head: %u\n", sc->head);
db_printf(" tail: %u\n", sc->tail);

Modified: head/sys/dev/ioat/ioat_internal.h
==
--- head/sys/dev/ioat/ioat_internal.h   Tue Jul  5 20:51:52 2016
(r302352)
+++ head/sys/dev/ioat/ioat_internal.h   Tue Jul  5 20:52:35 2016
(r302353)
@@ -491,6 +491,7 @@ struct ioat_softc {
boolean_t   is_reset_pending;
boolean_t   is_channel_running;
boolean_t   intrdelay_supported;
+   boolean_t   resetting;
 
uint32_thead;
uint32_ttail;
___
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: r302352 - head/sys/dev/ioat

2016-07-05 Thread Conrad E. Meyer
Author: cem
Date: Tue Jul  5 20:51:52 2016
New Revision: 302352
URL: https://svnweb.freebsd.org/changeset/base/302352

Log:
  ioat(4): Split timer into poll and shrink functions
  
  Poll should happen quickly, while shrink should happen infrequently.
  
  Protect is_completion_pending with submit_lock.
  
  Reviewed by:  markj
  Approved by:  re
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D7097

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_internal.h

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cTue Jul  5 20:48:59 2016(r302351)
+++ head/sys/dev/ioat/ioat.cTue Jul  5 20:51:52 2016(r302352)
@@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$");
 #ifndefBUS_SPACE_MAXADDR_40BIT
 #defineBUS_SPACE_MAXADDR_40BIT 0xFFULL
 #endif
-#defineIOAT_INTR_TIMO  (hz / 10)
 #defineIOAT_REFLK  (>submit_lock)
+#defineIOAT_SHRINK_PERIOD  (10 * hz)
 
 static int ioat_probe(device_t device);
 static int ioat_attach(device_t device);
@@ -96,7 +96,8 @@ static int ring_grow(struct ioat_softc *
 static int ring_shrink(struct ioat_softc *, uint32_t oldorder,
 struct ioat_descriptor **);
 static void ioat_halted_debug(struct ioat_softc *, uint32_t);
-static void ioat_timer_callback(void *arg);
+static void ioat_poll_timer_callback(void *arg);
+static void ioat_shrink_timer_callback(void *arg);
 static void dump_descriptor(void *hw_desc);
 static void ioat_submit_single(struct ioat_softc *ioat);
 static void ioat_comp_update_map(void *arg, bus_dma_segment_t *seg, int nseg,
@@ -332,7 +333,8 @@ ioat_detach(device_t device)
mtx_unlock(IOAT_REFLK);
 
ioat_teardown_intr(ioat);
-   callout_drain(>timer);
+   callout_drain(>poll_timer);
+   callout_drain(>shrink_timer);
 
pci_disable_busmaster(device);
 
@@ -428,7 +430,8 @@ ioat3_attach(device_t device)
 
mtx_init(>submit_lock, "ioat_submit", NULL, MTX_DEF);
mtx_init(>cleanup_lock, "ioat_cleanup", NULL, MTX_DEF);
-   callout_init(>timer, 1);
+   callout_init(>poll_timer, 1);
+   callout_init(>shrink_timer, 1);
TASK_INIT(>reset_task, 0, ioat_reset_hw_task, ioat);
 
/* Establish lock order for Witness */
@@ -634,6 +637,7 @@ ioat_process_events(struct ioat_softc *i
struct bus_dmadesc *dmadesc;
uint64_t comp_update, status;
uint32_t completed, chanerr;
+   boolean_t pending;
int error;
 
mtx_lock(>cleanup_lock);
@@ -668,19 +672,33 @@ ioat_process_events(struct ioat_softc *i
}
 
ioat->last_seen = desc->hw_desc_bus_addr;
-
-   if (ioat->head == ioat->tail) {
-   ioat->is_completion_pending = FALSE;
-   callout_reset(>timer, IOAT_INTR_TIMO,
-   ioat_timer_callback, ioat);
-   }
-
ioat->stats.descriptors_processed += completed;
 
 out:
ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN);
+
+   /* Perform a racy check first; only take the locks if it passes. */
+   pending = (ioat_get_active(ioat) != 0);
+   if (!pending && ioat->is_completion_pending) {
+   mtx_unlock(>cleanup_lock);
+   mtx_lock(>submit_lock);
+   mtx_lock(>cleanup_lock);
+
+   pending = (ioat_get_active(ioat) != 0);
+   if (!pending && ioat->is_completion_pending) {
+   ioat->is_completion_pending = FALSE;
+   callout_reset(>shrink_timer, IOAT_SHRINK_PERIOD,
+   ioat_shrink_timer_callback, ioat);
+   callout_stop(>poll_timer);
+   }
+   mtx_unlock(>submit_lock);
+   }
mtx_unlock(>cleanup_lock);
 
+   if (pending)
+   callout_reset(>poll_timer, 1, ioat_poll_timer_callback,
+   ioat);
+
if (completed != 0) {
ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF);
wakeup(>tail);
@@ -1602,7 +1620,18 @@ ioat_halted_debug(struct ioat_softc *ioa
 }
 
 static void
-ioat_timer_callback(void *arg)
+ioat_poll_timer_callback(void *arg)
+{
+   struct ioat_softc *ioat;
+
+   ioat = arg;
+   ioat_log_message(3, "%s\n", __func__);
+
+   ioat_process_events(ioat);
+}
+
+static void
+ioat_shrink_timer_callback(void *arg)
 {
struct ioat_descriptor **newring;
struct ioat_softc *ioat;
@@ -1611,11 +1640,6 @@ ioat_timer_callback(void *arg)
ioat = arg;
ioat_log_message(1, "%s\n", __func__);
 
-   if (ioat->is_completion_pending) {
-   ioat_process_events(ioat);
-   return;
-   }
-
/* Slowly scale the ring down if idle. */
mtx_lock(>submit_lock);
order = ioat->ring_size_order;
@@ -1641,8 +1665,8 @@ ioat_timer_callback(void *arg)
 
 out:
if 

svn commit: r302351 - head/release/doc/en_US.ISO8859-1/relnotes

2016-07-05 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Tue Jul  5 20:48:59 2016
New Revision: 302351
URL: https://svnweb.freebsd.org/changeset/base/302351

Log:
  Document 302332, Native graphics support has been added to bhyve
  
  Approved by:  re (gjb, implicit, relnotes)

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
18:47:17 2016(r302350)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  5 
20:48:59 2016(r302351)
@@ -1413,6 +1413,9 @@
updated to support DSM TRIM commands for
virtual AHCI disks.
 
+  Native graphics support has been added to
+   the  hypervisor.
+
   Support for the
QEMU virt system
has been added.
___
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-05 Thread Gleb Smirnoff
On Tue, Jul 05, 2016 at 11:48:56AM -0700, Ngie Cooper (yaneurabeya) wrote:
N> > Author: glebius
N> > Date: Tue Jul  5 18:47:17 2016
N> > New Revision: 302350
N> > URL: https://svnweb.freebsd.org/changeset/base/302350
N> > 
N> > Log:
N> >  The paradigm of a callout is that it has three consequent states:
N> >  not scheduled -> scheduled -> running -> not scheduled. The API and the
N> >  manual page assume that, some comments in the code assume that, and looks
N> >  like some contributors to the code also did. The problem is that this
N> >  paradigm isn't true. A callout can be scheduled and running at the same
N> >  time, which makes API description ambigouous. In such case callout_stop()
N> >  family of functions/macros should return 1 and 0 at the same time, since 
it
N> >  successfully unscheduled future callout but the current one is running.
N> >  Before this change we returned 1 in such a case, with an exception that
N> >  if running callout was migrating we returned 0, unless CS_MIGRBLOCK was
N> >  specified.
N> > 
N> >  With this change, we now return 0 in case if future callout was 
unscheduled,
N> >  but another one is still in action, indicating to API users that resources
N> >  are not yet safe to be freed.
N> > 
N> >  However, the sleepqueue code relies on getting 1 return code in that case,
N> >  and there already was CS_MIGRBLOCK flag, that covered one of the edge 
cases.
N> >  In the new return path we will also use this flag, to keep sleepqueue 
safe.
N> > 
N> >  Since the flag CS_MIGRBLOCK doesn't block migration and now isn't limited 
to
N> >  migration edge case, rename it to CS_EXECUTING.
N> > 
N> >  This change fixes panics on a high loaded TCP server.
N> > 
N> >  Reviewed by:  jch, hselasky, rrs, kib
N> >  Approved by:  re (gjb)
N> >  Differential Revision:https://reviews.freebsd.org/D7042
N> > 
N> > Modified:
N> >  head/share/man/man9/timeout.9
N> >  head/sys/kern/kern_timeout.c
N> >  head/sys/kern/subr_sleepqueue.c
N> >  head/sys/sys/callout.h
N> 
N> Should __FreeBSD_version be bumped for the change?

No. We consider the new behavior more matching the documentation rather than
old one.

-- 
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"


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

2016-07-05 Thread Ngie Cooper (yaneurabeya)

> On Jul 5, 2016, at 11:47, Gleb Smirnoff  wrote:
> 
> Author: glebius
> Date: Tue Jul  5 18:47:17 2016
> New Revision: 302350
> URL: https://svnweb.freebsd.org/changeset/base/302350
> 
> Log:
>  The paradigm of a callout is that it has three consequent states:
>  not scheduled -> scheduled -> running -> not scheduled. The API and the
>  manual page assume that, some comments in the code assume that, and looks
>  like some contributors to the code also did. The problem is that this
>  paradigm isn't true. A callout can be scheduled and running at the same
>  time, which makes API description ambigouous. In such case callout_stop()
>  family of functions/macros should return 1 and 0 at the same time, since it
>  successfully unscheduled future callout but the current one is running.
>  Before this change we returned 1 in such a case, with an exception that
>  if running callout was migrating we returned 0, unless CS_MIGRBLOCK was
>  specified.
> 
>  With this change, we now return 0 in case if future callout was unscheduled,
>  but another one is still in action, indicating to API users that resources
>  are not yet safe to be freed.
> 
>  However, the sleepqueue code relies on getting 1 return code in that case,
>  and there already was CS_MIGRBLOCK flag, that covered one of the edge cases.
>  In the new return path we will also use this flag, to keep sleepqueue safe.
> 
>  Since the flag CS_MIGRBLOCK doesn't block migration and now isn't limited to
>  migration edge case, rename it to CS_EXECUTING.
> 
>  This change fixes panics on a high loaded TCP server.
> 
>  Reviewed by: jch, hselasky, rrs, kib
>  Approved by: re (gjb)
>  Differential Revision:   https://reviews.freebsd.org/D7042
> 
> Modified:
>  head/share/man/man9/timeout.9
>  head/sys/kern/kern_timeout.c
>  head/sys/kern/subr_sleepqueue.c
>  head/sys/sys/callout.h

Should __FreeBSD_version be bumped for the change?
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


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

2016-07-05 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jul  5 18:47:17 2016
New Revision: 302350
URL: https://svnweb.freebsd.org/changeset/base/302350

Log:
  The paradigm of a callout is that it has three consequent states:
  not scheduled -> scheduled -> running -> not scheduled. The API and the
  manual page assume that, some comments in the code assume that, and looks
  like some contributors to the code also did. The problem is that this
  paradigm isn't true. A callout can be scheduled and running at the same
  time, which makes API description ambigouous. In such case callout_stop()
  family of functions/macros should return 1 and 0 at the same time, since it
  successfully unscheduled future callout but the current one is running.
  Before this change we returned 1 in such a case, with an exception that
  if running callout was migrating we returned 0, unless CS_MIGRBLOCK was
  specified.
  
  With this change, we now return 0 in case if future callout was unscheduled,
  but another one is still in action, indicating to API users that resources
  are not yet safe to be freed.
  
  However, the sleepqueue code relies on getting 1 return code in that case,
  and there already was CS_MIGRBLOCK flag, that covered one of the edge cases.
  In the new return path we will also use this flag, to keep sleepqueue safe.
  
  Since the flag CS_MIGRBLOCK doesn't block migration and now isn't limited to
  migration edge case, rename it to CS_EXECUTING.
  
  This change fixes panics on a high loaded TCP server.
  
  Reviewed by:  jch, hselasky, rrs, kib
  Approved by:  re (gjb)
  Differential Revision:https://reviews.freebsd.org/D7042

Modified:
  head/share/man/man9/timeout.9
  head/sys/kern/kern_timeout.c
  head/sys/kern/subr_sleepqueue.c
  head/sys/sys/callout.h

Modified: head/share/man/man9/timeout.9
==
--- head/share/man/man9/timeout.9   Tue Jul  5 18:34:34 2016
(r302349)
+++ head/share/man/man9/timeout.9   Tue Jul  5 18:47:17 2016
(r302350)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 14, 2015
+.Dd July 4, 2016
 .Dt TIMEOUT 9
 .Os
 .Sh NAME
@@ -247,6 +247,10 @@ has already been serviced, then
 negative one is returned.
 If the callout is currently being serviced and cannot be stopped,
 then zero will be returned.
+If the callout is currently being serviced and cannot be stopped, and at the
+same time a next invocation of the same callout is also scheduled, then
+.Fn callout_stop
+unschedules the next run and returns zero.
 If the callout has an associated lock,
 then that lock must be held when this function is called.
 .Pp
@@ -814,7 +818,7 @@ and
 .Fn callout_drain
 functions return a value of one if the callout was still pending when it was
 called, a zero if the callout could not be stopped and a negative one is it
-was either not running or haas already completed.
+was either not running or has already completed.
 The
 .Fn timeout
 function returns a

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cTue Jul  5 18:34:34 2016
(r302349)
+++ head/sys/kern/kern_timeout.cTue Jul  5 18:47:17 2016
(r302350)
@@ -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,
@@ -1236,28 +1236,14 @@ again:
}
 
/*
-* 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, 

svn commit: r302349 - in head/sys: kern sys

2016-07-05 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jul  5 18:34:34 2016
New Revision: 302349
URL: https://svnweb.freebsd.org/changeset/base/302349

Log:
  Compile in the kassert_panic() function with INVARIANT_SUPPORT
  option, not INVARIANTS.  The function is required if we want
  to load in a module that is compiled with INVARIANTS.
  
  Reviewed by:  jhb
  Approved by:  re (gjb)

Modified:
  head/sys/kern/kern_shutdown.c
  head/sys/sys/systm.h

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Tue Jul  5 18:02:17 2016
(r302348)
+++ head/sys/kern/kern_shutdown.c   Tue Jul  5 18:34:34 2016
(r302349)
@@ -556,7 +556,7 @@ shutdown_reset(void *junk, int howto)
/* NOTREACHED */ /* assuming reset worked */
 }
 
-#if defined(WITNESS) || defined(INVARIANTS)
+#if defined(WITNESS) || defined(INVARIANT_SUPPORT)
 static int kassert_warn_only = 0;
 #ifdef KDB
 static int kassert_do_kdb = 0;

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hTue Jul  5 18:02:17 2016(r302348)
+++ head/sys/sys/systm.hTue Jul  5 18:34:34 2016(r302349)
@@ -76,7 +76,7 @@ extern int vm_guest;  /* Running as virt
 enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV,
VM_GUEST_VMWARE, VM_LAST };
 
-#if defined(WITNESS) || defined(INVARIANTS)
+#if defined(WITNESS) || defined(INVARIANT_SUPPORT)
 void   kassert_panic(const char *fmt, ...)  __printflike(1, 2);
 #endif
 
___
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: r302348 - vendor/llvm-libunwind/libunwind-r272680

2016-07-05 Thread Ed Maste
Author: emaste
Date: Tue Jul  5 18:02:17 2016
New Revision: 302348
URL: https://svnweb.freebsd.org/changeset/base/302348

Log:
  Tag LLVM libunwind r272680

Added:
  vendor/llvm-libunwind/libunwind-r272680/
 - copied from r302347, vendor/llvm-libunwind/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302347 - in vendor/llvm-libunwind/dist: include src

2016-07-05 Thread Ed Maste
Author: emaste
Date: Tue Jul  5 18:00:23 2016
New Revision: 302347
URL: https://svnweb.freebsd.org/changeset/base/302347

Log:
  Import LLVM libunwind snapshot revision 272680
  
  Significant upstream revisions:
  
  260595: [AArch64] Fix libunwind build when using GNU assembler
  270692: Introduce a native-only unwinder build.
  270972: Disable cross-unwinding by default.
  271004: [libunwind] Improve unwinder stack usage - II
  272680: [libunwind] Improve unwinder stack usage - III
  
  Obtained from:https://llvm.org/svn/llvm-project/libunwind/trunk/

Modified:
  vendor/llvm-libunwind/dist/include/__libunwind_config.h
  vendor/llvm-libunwind/dist/include/libunwind.h
  vendor/llvm-libunwind/dist/src/AddressSpace.hpp
  vendor/llvm-libunwind/dist/src/CompactUnwinder.hpp
  vendor/llvm-libunwind/dist/src/Registers.hpp
  vendor/llvm-libunwind/dist/src/Unwind-EHABI.cpp
  vendor/llvm-libunwind/dist/src/UnwindCursor.hpp
  vendor/llvm-libunwind/dist/src/UnwindLevel1.c
  vendor/llvm-libunwind/dist/src/UnwindRegistersRestore.S
  vendor/llvm-libunwind/dist/src/UnwindRegistersSave.S
  vendor/llvm-libunwind/dist/src/config.h
  vendor/llvm-libunwind/dist/src/libunwind.cpp

Modified: vendor/llvm-libunwind/dist/include/__libunwind_config.h
==
--- vendor/llvm-libunwind/dist/include/__libunwind_config.h Tue Jul  5 
17:59:04 2016(r302346)
+++ vendor/llvm-libunwind/dist/include/__libunwind_config.h Tue Jul  5 
18:00:23 2016(r302347)
@@ -17,4 +17,43 @@
 #define _LIBUNWIND_ARM_EHABI 0
 #endif
 
+#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
+# if defined(__i386__)
+#  define _LIBUNWIND_TARGET_I386 1
+#  define _LIBUNWIND_CONTEXT_SIZE 8
+#  define _LIBUNWIND_CURSOR_SIZE 19
+# elif defined(__x86_64__)
+#  define _LIBUNWIND_TARGET_X86_64 1
+#  define _LIBUNWIND_CONTEXT_SIZE 21
+#  define _LIBUNWIND_CURSOR_SIZE 33
+# elif defined(__ppc__)
+#  define _LIBUNWIND_TARGET_PPC 1
+#  define _LIBUNWIND_CONTEXT_SIZE 117
+#  define _LIBUNWIND_CURSOR_SIZE 128
+# elif defined(__aarch64__)
+#  define _LIBUNWIND_TARGET_AARCH64 1
+#  define _LIBUNWIND_CONTEXT_SIZE 66
+#  define _LIBUNWIND_CURSOR_SIZE 78
+# elif defined(__arm__)
+#  define _LIBUNWIND_TARGET_ARM 1
+#  define _LIBUNWIND_CONTEXT_SIZE 60
+#  define _LIBUNWIND_CURSOR_SIZE 67
+# elif defined(__or1k__)
+#  define _LIBUNWIND_TARGET_OR1K 1
+#  define _LIBUNWIND_CONTEXT_SIZE 16
+#  define _LIBUNWIND_CURSOR_SIZE 28
+# else
+#  error "Unsupported architecture."
+# endif
+#else // !_LIBUNWIND_IS_NATIVE_ONLY
+# define _LIBUNWIND_TARGET_I386 1
+# define _LIBUNWIND_TARGET_X86_64 1
+# define _LIBUNWIND_TARGET_PPC 1
+# define _LIBUNWIND_TARGET_AARCH64 1
+# define _LIBUNWIND_TARGET_ARM 1
+# define _LIBUNWIND_TARGET_OR1K 1
+# define _LIBUNWIND_CONTEXT_SIZE 128
+# define _LIBUNWIND_CURSOR_SIZE 140
+#endif // _LIBUNWIND_IS_NATIVE_ONLY
+
 #endif // LIBUNWIND_CONFIG_H__

Modified: vendor/llvm-libunwind/dist/include/libunwind.h
==
--- vendor/llvm-libunwind/dist/include/libunwind.h  Tue Jul  5 17:59:04 
2016(r302346)
+++ vendor/llvm-libunwind/dist/include/libunwind.h  Tue Jul  5 18:00:23 
2016(r302347)
@@ -46,12 +46,12 @@ enum {
 };
 
 struct unw_context_t {
-  uint64_t data[128];
+  uint64_t data[_LIBUNWIND_CONTEXT_SIZE];
 };
 typedef struct unw_context_t unw_context_t;
 
 struct unw_cursor_t {
-  uint64_t data[140];
+  uint64_t data[_LIBUNWIND_CURSOR_SIZE];
 };
 typedef struct unw_cursor_t unw_cursor_t;
 

Modified: vendor/llvm-libunwind/dist/src/AddressSpace.hpp
==
--- vendor/llvm-libunwind/dist/src/AddressSpace.hpp Tue Jul  5 17:59:04 
2016(r302346)
+++ vendor/llvm-libunwind/dist/src/AddressSpace.hpp Tue Jul  5 18:00:23 
2016(r302347)
@@ -35,7 +35,7 @@ namespace libunwind {
 #include "Registers.hpp"
 
 #if _LIBUNWIND_ARM_EHABI
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 
 typedef void *_Unwind_Ptr;
 
@@ -61,7 +61,8 @@ extern EHTEntry __exidx_end;
 #endif // !defined(_LIBUNWIND_IS_BAREMETAL)
 #endif // _LIBUNWIND_ARM_EHABI
 
-#if defined(__CloudABI__) || defined(__FreeBSD__) || defined(__linux__)
+#if defined(__CloudABI__) || defined(__FreeBSD__) || defined(__linux__) || 
\
+defined(__NetBSD__)
 #if _LIBUNWIND_SUPPORT_DWARF_UNWIND && _LIBUNWIND_SUPPORT_DWARF_INDEX
 #include 
 // Macro for machine-independent access to the ELF program headers. This

Modified: vendor/llvm-libunwind/dist/src/CompactUnwinder.hpp
==
--- vendor/llvm-libunwind/dist/src/CompactUnwinder.hpp  Tue Jul  5 17:59:04 
2016(r302346)
+++ vendor/llvm-libunwind/dist/src/CompactUnwinder.hpp  Tue Jul  5 18:00:23 
2016(r302347)
@@ -27,6 +27,7 @@
 
 namespace libunwind {
 
+#if defined(_LIBUNWIND_TARGET_I386)
 

svn commit: r302346 - head/sys/kern

2016-07-05 Thread Mark Johnston
Author: markj
Date: Tue Jul  5 17:59:04 2016
New Revision: 302346
URL: https://svnweb.freebsd.org/changeset/base/302346

Log:
  Ensure that spinlock sections are balanced even after a panic.
  
  vpanic() uses spinlock_enter() to disable interrupts before dumping core.
  However, when the scheduler is stopped and INVARIANTS is not configured,
  thread_lock() does not acquire a spinlock section, while thread_unlock()
  releases one. This can result in interrupts staying enabled while the
  kernel dumps core, complicating post-mortem analysis of the crash.
  
  Approved by:  re (gjb)
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Tue Jul  5 16:37:01 2016(r302345)
+++ head/sys/kern/kern_mutex.c  Tue Jul  5 17:59:04 2016(r302346)
@@ -657,8 +657,15 @@ thread_lock_flags_(struct thread *td, in
i = 0;
tid = (uintptr_t)curthread;
 
-   if (SCHEDULER_STOPPED())
+   if (SCHEDULER_STOPPED()) {
+   /*
+* Ensure that spinlock sections are balanced even when the
+* scheduler is stopped, since we may otherwise inadvertently
+* re-enable interrupts while dumping core.
+*/
+   spinlock_enter();
return;
+   }
 
 #ifdef KDTRACE_HOOKS
spin_time -= lockstat_nsecs(>td_lock->lock_object);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302345 - head/sys/kern

2016-07-05 Thread Robert Watson
Author: rwatson
Date: Tue Jul  5 16:37:01 2016
New Revision: 302345
URL: https://svnweb.freebsd.org/changeset/base/302345

Log:
  Call audit hooks to capture vnode attributes for three file-descriptor
  method implementations: fstat(2), close(2), and poll(2).  This change
  synchronises auditing here with similar auditing for VFS-specific system
  calls such as stat(2) that audit more complete vnode information.
  
  Sponsored by: DARPA, AFRL
  Approved by:  re (kib)
  MFC after:1 week

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Tue Jul  5 14:46:06 2016(r302344)
+++ head/sys/kern/vfs_vnops.c   Tue Jul  5 16:37:01 2016(r302345)
@@ -440,6 +440,7 @@ vn_close(vp, flags, file_cred, td)
 
vn_start_write(vp, , V_WAIT);
vn_lock(vp, lock_flags | LK_RETRY);
+   AUDIT_ARG_VNODE1(vp);
if ((flags & (FWRITE | FOPENFAILED)) == FWRITE) {
VNASSERT(vp->v_writecount > 0, vp, 
("vn_close: negative writecount"));
@@ -1362,6 +1363,7 @@ vn_stat(vp, sb, active_cred, file_cred, 
int error;
u_short mode;
 
+   AUDIT_ARG_VNODE1(vp);
 #ifdef MAC
error = mac_vnode_check_stat(active_cred, file_cred, vp);
if (error)
@@ -1511,6 +1513,7 @@ vn_poll(fp, events, active_cred, td)
vp = fp->f_vnode;
 #ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   AUDIT_ARG_VNODE1(vp);
error = mac_vnode_check_poll(active_cred, fp->f_cred, vp);
VOP_UNLOCK(vp, 0);
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: r302344 - head/sys/kern

2016-07-05 Thread Ed Maste
Author: emaste
Date: Tue Jul  5 14:46:06 2016
New Revision: 302344
URL: https://svnweb.freebsd.org/changeset/base/302344

Log:
  add description for debug.elf{32,64}_legacy_coredump sysctl
  
  Approved by:  re (kib)
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Tue Jul  5 11:21:02 2016(r302343)
+++ head/sys/kern/imgact_elf.c  Tue Jul  5 14:46:06 2016(r302344)
@@ -113,7 +113,8 @@ SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WOR
 
 static int elf_legacy_coredump = 0;
 SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW, 
-_legacy_coredump, 0, "");
+_legacy_coredump, 0,
+"include all and only RW pages in core dumps");
 
 int __elfN(nxstack) =
 #if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \
___
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: r302343 - head/sys/vm

2016-07-05 Thread Konstantin Belousov
Author: kib
Date: Tue Jul  5 11:21:02 2016
New Revision: 302343
URL: https://svnweb.freebsd.org/changeset/base/302343

Log:
  Clarify the vnode_destroy_vobject() logic handling for already terminated
  objects.
  
  Assert that there is no new waiters for the already terminated objects.
  Old waiters should have been notified by the termination calling
  vnode_pager_dealloc() (old/new are with regard of the lock acquisition
  interval).
  
  Only clear the vp->v_object for the case of already terminated object,
  since other branches call vnode_pager_dealloc(), which should clear
  the pointer.  Assert this.
  
  Tested by:pho
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Approved by:  re (gjb)

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Tue Jul  5 07:01:42 2016(r302342)
+++ head/sys/vm/vnode_pager.c   Tue Jul  5 11:21:02 2016(r302343)
@@ -169,10 +169,21 @@ vnode_destroy_vobject(struct vnode *vp)
/*
 * don't double-terminate the object
 */
-   if ((obj->flags & OBJ_DEAD) == 0)
+   if ((obj->flags & OBJ_DEAD) == 0) {
vm_object_terminate(obj);
-   else
+   } else {
+   /*
+* Waiters were already handled during object
+* termination.  The exclusive vnode lock hopefully
+* prevented new waiters from referencing the dying
+* object.
+*/
+   KASSERT((obj->flags & OBJ_DISCONNECTWNT) == 0,
+   ("OBJ_DISCONNECTWNT set obj %p flags %x",
+   obj, obj->flags));
+   vp->v_object = NULL;
VM_OBJECT_WUNLOCK(obj);
+   }
} else {
/*
 * Woe to the process that tries to page now :-).
@@ -180,7 +191,7 @@ vnode_destroy_vobject(struct vnode *vp)
vm_pager_deallocate(obj);
VM_OBJECT_WUNLOCK(obj);
}
-   vp->v_object = NULL;
+   KASSERT(vp->v_object == NULL, ("vp %p obj %p", vp, vp->v_object));
 }
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-07-05 Thread Bruce Evans

On Mon, 4 Jul 2016, Adrian Chadd wrote:


On 4 July 2016 at 12:28, Ed Schouten  wrote:

2016-07-04 21:08 GMT+02:00 Adrian Chadd :

Does the specification / implementation also mandate that the padding
is zero'ed out or otherwise initialised?


Only QOI and POLA require it.


Well... That's tricky:

[URLs lost to fighting with spam filter]


Hmm, it's worse than that.  C11 adds the requirement that padding in
aggregates and unions is initialized to all-bits-zero.  This is
half-baked since it doesn't apply to pointers or arithmetic types,
though it seems to unintentionally apply to pointers and arithmetic
types within aggregates (since it says "any" bits).  The padding bits
in integers are explicitly unspecified elsewhere, except that ordinary
stores (and initializations?) must not set them to trap respresentations.
Since they are not explicitly specifued here, they are unspecified
throughout.

Thus, padding bits in at least integers can be set to a representation
of the user's password.  Low quality implementations do this accidentantly.
A perverse implementation would make plain int large enough to hold any
password; then whenever a positive value of N is stored to the value bits,
it would store the password for user N to the padding bits :-).


Right, so if we're not careful, we could leak bits of kernel memory,
and it can also screw up key cache comparisons.


This requires more than a reasonable amount of care for perverse
implementations.  It is necessary to find and zero all the padding
bits in most cases.  This is possible by copying to an array of bytes,
zeroing the bits there, and copying back.

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"


Re: svn commit: r302328 - in head/sys: kern sys

2016-07-05 Thread Bruce Evans

On Sun, 3 Jul 2016, Konstantin Belousov wrote:

This is mostly a test reply (replying to src-committers has stopped
working for newer commits).


Log:
 Provide helper macros to detect 'non-silent SBDRY' state and to
 calculate appropriate return value for stops.  Simplify the code by
 using them.

 Fix typo in sig_suspend_threads().  The thread which sleep must be
 aborted is td2. (*)

 In issignal(), when handling stopping signal for thread in
 TD_SBDRY_INTR state, do not stop, this is wrong and fires assert.
 This is yet another place where execution should be forced out of
 SBDRY-protected region.  For such case, return -1 from issignal() and
 translate it to corresponding error code in sleepq_catch_signals().
 Assert that other consumers of cursig() are not affected by the new
 return value. (*)

 Micro-optimize, mostly VFS and VOP methods, by avoiding calling the
 functions when SIGDEFERSTOP_NOP non-change is requested. (**)

 Reported and tested by:pho (*)
 Requested by:  bde (**)
 Sponsored by:  The FreeBSD Foundation
 MFC after: 2 weeks
 Approved by:   re (gjb)


Thanks, but this is still very slow (even slower than beore the
micro-optimization).

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"


Re: svn commit: r302337 - head/usr.sbin/ppp

2016-07-05 Thread Guido Falsi
On 07/04/16 23:18, Baptiste Daroussin wrote:
> Author: bapt
> Date: Mon Jul  4 21:18:57 2016
> New Revision: 302337
> URL: https://svnweb.freebsd.org/changeset/base/302337
> 
> Log:
>   Fix build of ppp when WITHOUT_PAM is set
>   
>   PR: 210658
>   Reported by:madpilot
>   Tested by:  madpilot
>   Approved by:re@ (kib)
> 

Thanks!

-- 
Guido Falsi 
___
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: r302342 - head/sbin/ping6

2016-07-05 Thread Ngie Cooper

> On Jul 5, 2016, at 00:01, Marcelo Araujo  wrote:
> 
> Author: araujo
> Date: Tue Jul  5 07:01:42 2016
> New Revision: 302342
> URL: https://svnweb.freebsd.org/changeset/base/302342
> 
> Log:
>  Fix a regression introduced on revision r271909, when using argument -g
>  or several hops we have segmentation fault because we overwrite the same
>  structure to store information for host and gateway.
> 
>  Submitted by:Maryse Levavasseur 
>  Reworked by:hrs
>  Approved by:re (hrs)
>  Differential Revision:https://reviews.freebsd.org/D6980

This should be mfced.
Thanks,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-07-05 Thread David Chisnall
On 4 Jul 2016, at 21:09, Adrian Chadd  wrote:
> 
> Right, so if we're not careful, we could leak bits of kernel memory,
> and it can also screw up key cache comparisons.
> 
> (I asked this question because I've been screwed by it recentlyish,
> and it looks like the latest C standard didn't fix it..)

It was discussed at the WG14 meeting in London in April, but I don’t think that 
there was a clear consensus.  It gets particularly tricky for _Atomic types, 
and I think that there’s now a clarification (or will be in C2x, if not) that 
any padding in _Atomic types is zeroed.

Generally, compilers will turn this into a bzero and then a set of the 
remaining fields, so you’re likely to end up with the right thing, but it’s not 
guaranteed by the standard.

David

___
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: r302342 - head/sbin/ping6

2016-07-05 Thread Marcelo Araujo
Author: araujo
Date: Tue Jul  5 07:01:42 2016
New Revision: 302342
URL: https://svnweb.freebsd.org/changeset/base/302342

Log:
  Fix a regression introduced on revision r271909, when using argument -g
  or several hops we have segmentation fault because we overwrite the same
  structure to store information for host and gateway.
  
  Submitted by: Maryse Levavasseur 
  Reworked by:  hrs
  Approved by:  re (hrs)
  Differential Revision:https://reviews.freebsd.org/D6980

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Tue Jul  5 06:16:42 2016(r302341)
+++ head/sbin/ping6/ping6.c Tue Jul  5 07:01:42 2016(r302342)
@@ -515,7 +515,6 @@ main(int argc, char *argv[])
memcpy(, res->ai_addr, res->ai_addrlen);
srclen = res->ai_addrlen;
freeaddrinfo(res);
-   res = NULL;
options |= F_SRCADDR;
break;
case 's':   /* size of packet to send */
@@ -631,7 +630,7 @@ main(int argc, char *argv[])
if (error)
errx(1, "%s", gai_strerror(error));
if (res->ai_canonname)
-   hostname = res->ai_canonname;
+   hostname = strdup(res->ai_canonname);
else
hostname = target;
 
@@ -643,6 +642,7 @@ main(int argc, char *argv[])
if ((s = socket(res->ai_family, res->ai_socktype,
res->ai_protocol)) < 0)
err(1, "socket");
+   freeaddrinfo(res);
 
/* set the source address if specified. */
if ((options & F_SRCADDR) != 0) {
@@ -1208,9 +1208,6 @@ main(int argc, char *argv[])
sigaction(SIGALRM, _sa, 0);
summary();
 
-   if (res != NULL)
-   freeaddrinfo(res);
-
 if(packet != NULL)
 free(packet);
 
___
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: r302341 - in head/sys: contrib/ncsw/inc contrib/ncsw/inc/integrations contrib/ncsw/inc/integrations/P2041 contrib/ncsw/inc/integrations/P3041 contrib/ncsw/inc/integrations/P5020 contrib...

2016-07-05 Thread Justin Hibbits
Author: jhibbits
Date: Tue Jul  5 06:16:42 2016
New Revision: 302341
URL: https://svnweb.freebsd.org/changeset/base/302341

Log:
  Remove SoC-specific integrations from dTSEC, to make it SoC agnostic.
  
  This will allow a single kernel to run on all SoCs supported by the dTSEC 
driver.
  
  Approved by:  re@(gjb)

Added:
  head/sys/contrib/ncsw/inc/integrations/dpaa_integration_ext.h   (contents, 
props changed)
  head/sys/contrib/ncsw/integrations/fman_ctrl_code/
 - copied from r302340, 
head/sys/contrib/ncsw/integrations/P3041/fman_ctrl_code/
Deleted:
  head/sys/contrib/ncsw/inc/integrations/P2041/
  head/sys/contrib/ncsw/inc/integrations/P3041/
  head/sys/contrib/ncsw/inc/integrations/P5020/
  head/sys/contrib/ncsw/integrations/P2041/
  head/sys/contrib/ncsw/integrations/P3041/
  head/sys/contrib/ncsw/integrations/P5020/
  head/sys/powerpc/conf/dpaa/config.p2041
  head/sys/powerpc/conf/dpaa/config.p3041
  head/sys/powerpc/conf/dpaa/config.p5020
  head/sys/powerpc/conf/dpaa/files.p2041
  head/sys/powerpc/conf/dpaa/files.p3041
  head/sys/powerpc/conf/dpaa/files.p5020
Modified:
  head/sys/contrib/ncsw/inc/error_ext.h
  head/sys/contrib/ncsw/inc/integrations/part_ext.h
  head/sys/contrib/ncsw/integrations/fman_ucode.h
  head/sys/powerpc/conf/dpaa/config.dpaa

Modified: head/sys/contrib/ncsw/inc/error_ext.h
==
--- head/sys/contrib/ncsw/inc/error_ext.h   Tue Jul  5 06:14:23 2016
(r302340)
+++ head/sys/contrib/ncsw/inc/error_ext.h   Tue Jul  5 06:16:42 2016
(r302341)
@@ -353,6 +353,7 @@ int ERROR_DYNAMIC_LEVEL = ERROR_GLOBAL_L
 
 #define PRINT_FORMAT"[CPU%02d, %s:%d %s]"
 #define PRINT_FMT_PARAMSCORE_GetId(), __FILE__, __LINE__, __FUNCTION__
+#define ERR_STRING(err) #err
 
 #if (!(defined(DEBUG_ERRORS)) || (DEBUG_ERRORS == 0))
 /* No debug/error/event messages at all */
@@ -398,7 +399,7 @@ extern const char *eventStrings[];
 if (REPORT_LEVEL_##_level <= DEBUG_DYNAMIC_LEVEL) { \
 XX_Print("> %s (%s) " PRINT_FORMAT ": ", \
  dbgLevelStrings[REPORT_LEVEL_##_level - 1], \
- moduleStrings[__ERR_MODULE__ >> 16], \
+ ERR_STRING(__ERR_MODULE__), \
  PRINT_FMT_PARAMS); \
 XX_Print _vmsg; \
 XX_Print("\r\n"); \
@@ -412,7 +413,7 @@ extern const char *eventStrings[];
 if (REPORT_LEVEL_##_level <= ERROR_DYNAMIC_LEVEL) { \
 XX_Print("! %s %s Error " PRINT_FORMAT ": %s; ", \
  dbgLevelStrings[REPORT_LEVEL_##_level - 1], \
- moduleStrings[__ERR_MODULE__ >> 16], \
+ ERR_STRING(__ERR_MODULE__), \
  PRINT_FMT_PARAMS, \
  errTypeStrings[(GET_ERROR_TYPE(_err) - E_OK - 1)]); \
 XX_Print _vmsg; \
@@ -435,7 +436,7 @@ extern const char *eventStrings[];
 if (_ev##_LEVEL <= EVENT_DYNAMIC_LEVEL) { \
 XX_Print("~ %s %s Event " PRINT_FORMAT ": %s (flags: 0x%04x); ", \
  dbgLevelStrings[_ev##_LEVEL - 1], \
- moduleStrings[__ERR_MODULE__ >> 16], \
+ ERR_STRING(__ERR_MODULE__), \
  PRINT_FMT_PARAMS, \
  eventStrings[((_ev) - EV_NO_EVENT - 1)], \
  (uint16_t)(_flg)); \

Added: head/sys/contrib/ncsw/inc/integrations/dpaa_integration_ext.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/contrib/ncsw/inc/integrations/dpaa_integration_ext.h   Tue Jul 
 5 06:16:42 2016(r302341)
@@ -0,0 +1,378 @@
+/**
+
+ � 1995-2003, 2004, 2005-2011 Freescale Semiconductor, Inc.
+ All rights reserved.
+
+ This is proprietary source code of Freescale Semiconductor Inc.,
+ and its use is subject to the NetComm Device Drivers EULA.
+ The copyright notice above does not evidence any actual or intended
+ publication of such source code.
+
+ ALTERNATIVELY, redistribution and use in source and binary forms, with
+ or without modification, are permitted provided that the following
+ conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * 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.
+ * Neither the name of Freescale Semiconductor nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ EXPRESS OR 

svn commit: r302340 - head/sys/powerpc/mpc85xx

2016-07-05 Thread Justin Hibbits
Author: jhibbits
Date: Tue Jul  5 06:14:23 2016
New Revision: 302340
URL: https://svnweb.freebsd.org/changeset/base/302340

Log:
  Unbreak the LBC driver, broken with the large RMan and 36-bit physical 
address changes.
  
  Remove the use of fdt_data_to_res(), and instead construct the resources
  manually.  Additionally, avoid the 32-bit size limitation of fdt_data_get(), 
by
  building physical addresses manually from the lbc ranges property.
  
  Approved by:  re@(gjb)

Modified:
  head/sys/powerpc/mpc85xx/lbc.c

Modified: head/sys/powerpc/mpc85xx/lbc.c
==
--- head/sys/powerpc/mpc85xx/lbc.c  Tue Jul  5 01:29:24 2016
(r302339)
+++ head/sys/powerpc/mpc85xx/lbc.c  Tue Jul  5 06:14:23 2016
(r302340)
@@ -362,17 +362,17 @@ static int
 fdt_lbc_reg_decode(phandle_t node, struct lbc_softc *sc,
 struct lbc_devinfo *di)
 {
-   u_long start, end, count;
+   rman_res_t start, end, count;
pcell_t *reg, *regptr;
pcell_t addr_cells, size_cells;
int tuple_size, tuples;
-   int i, rv, bank;
+   int i, j, rv, bank;
 
if (fdt_addrsize_cells(OF_parent(node), _cells, _cells) != 0)
return (ENXIO);
 
tuple_size = sizeof(pcell_t) * (addr_cells + size_cells);
-   tuples = OF_getprop_alloc(node, "reg", tuple_size, (void **));
+   tuples = OF_getencprop_alloc(node, "reg", tuple_size, (void **));
debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells);
debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size);
if (tuples <= 0)
@@ -387,11 +387,14 @@ fdt_lbc_reg_decode(phandle_t node, struc
reg += 1;
 
/* Get address/size. */
-   rv = fdt_data_to_res(reg, addr_cells - 1, size_cells, ,
-   );
-   if (rv != 0) {
-   resource_list_free(>di_res);
-   goto out;
+   start = count = 0;
+   for (j = 0; j < addr_cells; j++) {
+   start <<= 32;
+   start |= reg[j];
+   }
+   for (j = 0; j < size_cells; j++) {
+   count <<= 32;
+   count |= reg[addr_cells + j - 1];
}
reg += addr_cells - 1 + size_cells;
 
@@ -399,15 +402,14 @@ fdt_lbc_reg_decode(phandle_t node, struc
start = sc->sc_banks[bank].kva + start;
end = start + count - 1;
 
-   debugf("reg addr bank = %d, start = %lx, end = %lx, "
-   "count = %lx\n", bank, start, end, count);
+   debugf("reg addr bank = %d, start = %jx, end = %jx, "
+   "count = %jx\n", bank, start, end, count);
 
/* Use bank (CS) cell as rid. */
resource_list_add(>di_res, SYS_RES_MEMORY, bank, start,
end, count);
}
rv = 0;
-out:
OF_prop_free(regptr);
return (rv);
 }
@@ -442,13 +444,14 @@ lbc_attach(device_t dev)
struct lbc_softc *sc;
struct lbc_devinfo *di;
struct rman *rm;
-   u_long offset, start, size;
+   uintmax_t offset, size;
+   vm_paddr_t start;
device_t cdev;
phandle_t node, child;
pcell_t *ranges, *rangesptr;
int tuple_size, tuples;
int par_addr_cells;
-   int bank, error, i;
+   int bank, error, i, j;
 
sc = device_get_softc(dev);
sc->sc_dev = dev;
@@ -540,7 +543,7 @@ lbc_attach(device_t dev)
tuple_size = sizeof(pcell_t) * (sc->sc_addr_cells + par_addr_cells +
sc->sc_size_cells);
 
-   tuples = OF_getprop_alloc(node, "ranges", tuple_size,
+   tuples = OF_getencprop_alloc(node, "ranges", tuple_size,
(void **));
if (tuples < 0) {
device_printf(dev, "could not retrieve 'ranges' property\n");
@@ -558,7 +561,7 @@ lbc_attach(device_t dev)
for (i = 0; i < tuples; i++) {
 
/* The first cell is the bank (chip select) number. */
-   bank = fdt_data_get((void *)ranges, 1);
+   bank = fdt_data_get(ranges, 1);
if (bank < 0 || bank > LBC_DEV_MAX) {
device_printf(dev, "bank out of range: %d\n", bank);
error = ERANGE;
@@ -570,17 +573,25 @@ lbc_attach(device_t dev)
 * Remaining cells of the child address define offset into
 * this CS.
 */
-   offset = fdt_data_get((void *)ranges, sc->sc_addr_cells - 1);
-   ranges += sc->sc_addr_cells - 1;
+   offset = 0;
+   for (j = 0; j < sc->sc_addr_cells - 1; j++) {
+   offset <<= sizeof(pcell_t) * 8;
+   offset |= *ranges;
+   ranges++;
+   }
 
/* Parent bus start address of