svn commit: r296608 - in stable/9/contrib/bind9: . bin/named bin/rndc doc/arm lib/dns lib/isccc

2016-03-09 Thread Xin LI
Author: delphij
Date: Thu Mar 10 07:44:56 2016
New Revision: 296608
URL: https://svnweb.freebsd.org/changeset/base/296608

Log:
  MFV r296599: BIND 9.9.8-P4.
  
  Security: CVE-2016-1285
  Security: CVE-2016-1286
  Security: CVE-2016-2088
  Security: FreeBSD-SA-16:13.bind

Modified:
  stable/9/contrib/bind9/CHANGES
  stable/9/contrib/bind9/COPYRIGHT
  stable/9/contrib/bind9/README
  stable/9/contrib/bind9/bin/named/control.c
  stable/9/contrib/bind9/bin/named/controlconf.c
  stable/9/contrib/bind9/bin/named/query.c
  stable/9/contrib/bind9/bin/rndc/rndc.c
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.html
  stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf
  stable/9/contrib/bind9/doc/arm/man.arpaname.html
  stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html
  stable/9/contrib/bind9/doc/arm/man.dig.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html
  stable/9/contrib/bind9/doc/arm/man.dnssec-verify.html
  stable/9/contrib/bind9/doc/arm/man.genrandom.html
  stable/9/contrib/bind9/doc/arm/man.host.html
  stable/9/contrib/bind9/doc/arm/man.isc-hmac-fixup.html
  stable/9/contrib/bind9/doc/arm/man.named-checkconf.html
  stable/9/contrib/bind9/doc/arm/man.named-checkzone.html
  stable/9/contrib/bind9/doc/arm/man.named-journalprint.html
  stable/9/contrib/bind9/doc/arm/man.named.html
  stable/9/contrib/bind9/doc/arm/man.nsec3hash.html
  stable/9/contrib/bind9/doc/arm/man.nsupdate.html
  stable/9/contrib/bind9/doc/arm/man.rndc-confgen.html
  stable/9/contrib/bind9/doc/arm/man.rndc.conf.html
  stable/9/contrib/bind9/doc/arm/man.rndc.html
  stable/9/contrib/bind9/doc/arm/notes.html
  stable/9/contrib/bind9/doc/arm/notes.pdf
  stable/9/contrib/bind9/doc/arm/notes.xml
  stable/9/contrib/bind9/lib/dns/api
  stable/9/contrib/bind9/lib/dns/resolver.c
  stable/9/contrib/bind9/lib/isccc/cc.c
  stable/9/contrib/bind9/version
Directory Properties:
  stable/9/contrib/bind9/   (props changed)

Modified: stable/9/contrib/bind9/CHANGES
==
--- stable/9/contrib/bind9/CHANGES  Thu Mar 10 06:25:47 2016
(r296607)
+++ stable/9/contrib/bind9/CHANGES  Thu Mar 10 07:44:56 2016
(r296608)
@@ -1,3 +1,12 @@
+   --- 9.9.8-P4 released ---
+
+4319.  [security]  Fix resolver assertion failure due to improper
+   DNAME handling when parsing fetch reply messages.
+   (CVE-2016-1286) [RT #41753]
+
+4318.  [security]  Malformed control messages can trigger assertions
+   in named and rndc. (CVE-2016-1285) [RT #41666]
+
--- 9.9.8-P3 released ---
 
 4288.  [bug]   Fixed a regression in resolver.c:possibly_mark()

Modified: stable/9/contrib/bind9/COPYRIGHT
==
--- stable/9/contrib/bind9/COPYRIGHTThu Mar 10 06:25:47 2016
(r296607)
+++ stable/9/contrib/bind9/COPYRIGHTThu Mar 10 07:44:56 2016
(r296608)
@@ -1,4 +1,4 @@
-Copyright (C) 2004-2015  Internet Systems Consortium, Inc. ("ISC")
+Copyright (C) 2004-2016  Internet Systems Consortium, Inc. ("ISC")
 Copyright (C) 1996-2003  Internet Software Consortium.
 
 Permission to use, copy, modify, and/or distribute this software for any

Modified: stable/9/contrib/bind9/README
==
--- stable/9/contrib/bind9/README   Thu Mar 10 06:25:47 2016
(r296607)
+++ stable/9/contrib/bind9/README   Thu Mar 10 07:44:56 2016
(r296608)
@@ -51,6 +51,11 @@ BIND 9
For up-to-date release notes and errata, see
http://www.isc.org/software/bind9/releasenotes
 
+BIND 9.9.8-P4
+
+   BIND 9.9.8-P4 is a security release addressing the flaws
+   described in CVE-2016-1285 and CVE-2016-1286.
+
 BIND 9.9.8-P3
 
   BIND 9.9.8-P3 is a security release addressing the flaw described in


svn commit: r296606 - head/sys/geom/sched

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 06:25:39 2016
New Revision: 296606
URL: https://svnweb.freebsd.org/changeset/base/296606

Log:
  Don't assume that bio_cmd is a bit mask.
  
  Differential Revision: https://reviews.freebsd.org/D5592

Modified:
  head/sys/geom/sched/g_sched.c
  head/sys/geom/sched/gs_rr.c

Modified: head/sys/geom/sched/g_sched.c
==
--- head/sys/geom/sched/g_sched.c   Thu Mar 10 06:25:31 2016
(r296605)
+++ head/sys/geom/sched/g_sched.c   Thu Mar 10 06:25:39 2016
(r296606)
@@ -269,7 +269,7 @@ g_sched_update_stats(struct bio *bio)
me.gs_done++;
me.gs_in_flight--;
me.gs_bytes_in_flight -= bio->bio_length;
-   if (bio->bio_cmd & BIO_WRITE) {
+   if (bio->bio_cmd == BIO_WRITE) {
me.gs_writes_in_flight--;
me.gs_write_bytes_in_flight -= bio->bio_length;
}
@@ -754,9 +754,9 @@ static inline char
 g_sched_type(struct bio *bp)
 {
 
-   if (0 != (bp->bio_cmd & BIO_READ))
+   if (bp->bio_cmd == BIO_READ)
return ('R');
-   else if (0 != (bp->bio_cmd & BIO_WRITE))
+   else if (bp->bio_cmd == BIO_WRITE)
return ('W');
return ('U');
 }
@@ -829,7 +829,7 @@ g_sched_start(struct bio *bp)
KASSERT(cbp->bio_to != NULL, ("NULL provider"));
 
/* We only schedule reads and writes. */
-   if (0 == (bp->bio_cmd & (BIO_READ | BIO_WRITE)))
+   if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE)
goto bypass;
 
G_SCHED_LOGREQ(cbp, "Sending request.");
@@ -860,7 +860,7 @@ g_sched_start(struct bio *bp)
me.gs_in_flight++;
me.gs_requests++;
me.gs_bytes_in_flight += bp->bio_length;
-   if (bp->bio_cmd & BIO_WRITE) {
+   if (bp->bio_cmd == BIO_WRITE) {
me.gs_writes_in_flight++;
me.gs_write_bytes_in_flight += bp->bio_length;
}

Modified: head/sys/geom/sched/gs_rr.c
==
--- head/sys/geom/sched/gs_rr.c Thu Mar 10 06:25:31 2016(r296605)
+++ head/sys/geom/sched/gs_rr.c Thu Mar 10 06:25:39 2016(r296606)
@@ -375,7 +375,7 @@ g_rr_should_anticipate(struct g_rr_queue
 {
int wait = get_bounded(_ms, 2);
 
-   if (!me.w_anticipate && (bp->bio_cmd & BIO_WRITE))
+   if (!me.w_anticipate && (bp->bio_cmd == BIO_WRITE))
return (0);
 
if (g_savg_valid(>q_thinktime) &&
___
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: r296607 - head/sys/mips/cavium

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 06:25:47 2016
New Revision: 296607
URL: https://svnweb.freebsd.org/changeset/base/296607

Log:
  Don't assume that bio_cmd is a bitfield.
  
  Differential Revision: https://reviews.freebsd.org/D5591

Modified:
  head/sys/mips/cavium/octeon_ebt3000_cf.c

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cThu Mar 10 06:25:39 2016
(r296606)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cThu Mar 10 06:25:47 2016
(r296607)
@@ -215,37 +215,38 @@ static void cf_start (struct bio *bp)
* the bio struct.
*/
 
-   if(bp->bio_cmd & BIO_GETATTR) {
+   switch (bp->bio_cmd) {
+   case BIO_GETATTR:
if (g_handleattr_int(bp, "GEOM::fwsectors", 
cf_priv->drive_param.sec_track))
 return;
 if (g_handleattr_int(bp, "GEOM::fwheads", 
cf_priv->drive_param.heads))
 return;
 g_io_deliver(bp, ENOIOCTL);
 return;
-   }
-
-   if ((bp->bio_cmd & (BIO_READ | BIO_WRITE))) {
 
-   if (bp->bio_cmd & BIO_READ) {
-   error = cf_cmd_read(bp->bio_length / 
cf_priv->drive_param.sector_size,
-   bp->bio_offset / cf_priv->drive_param.sector_size, 
bp->bio_data);
-   } else if (bp->bio_cmd & BIO_WRITE) {
-   error = cf_cmd_write(bp->bio_length / 
cf_priv->drive_param.sector_size,
-   bp->bio_offset/cf_priv->drive_param.sector_size, 
bp->bio_data);
-   } else {
-   printf("%s: unrecognized bio_cmd %x.\n", __func__, 
bp->bio_cmd);
-   error = ENOTSUP;
-   }
+   case BIO_READ:
+   error = cf_cmd_read(bp->bio_length / 
cf_priv->drive_param.sector_size,
+   bp->bio_offset / cf_priv->drive_param.sector_size, 
bp->bio_data);
+   break;
+   case BIO_WRITE:
+   error = cf_cmd_write(bp->bio_length / 
cf_priv->drive_param.sector_size,
+   bp->bio_offset/cf_priv->drive_param.sector_size, 
bp->bio_data);
+   break;
 
-   if (error != 0) {
-   g_io_deliver(bp, error);
-   return;
-   }
+   default:
+   printf("%s: unrecognized bio_cmd %x.\n", __func__, bp->bio_cmd);
+   error = ENOTSUP;
+   break;
+   }
 
-   bp->bio_resid = 0;
-   bp->bio_completed = bp->bio_length;
-   g_io_deliver(bp, 0);
+   if (error != 0) {
+   g_io_deliver(bp, error);
+   return;
}
+
+   bp->bio_resid = 0;
+   bp->bio_completed = bp->bio_length;
+   g_io_deliver(bp, 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: r296605 - head/sys/geom

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 06:25:31 2016
New Revision: 296605
URL: https://svnweb.freebsd.org/changeset/base/296605

Log:
  Don't assume that bio_cmd is bit mask.
  
  Differential Revision: https://reviews.freebsd.org/D5593

Modified:
  head/sys/geom/geom_disk.c
  head/sys/geom/geom_io.c

Modified: head/sys/geom/geom_disk.c
==
--- head/sys/geom/geom_disk.c   Thu Mar 10 06:25:05 2016(r296604)
+++ head/sys/geom/geom_disk.c   Thu Mar 10 06:25:31 2016(r296605)
@@ -225,8 +225,16 @@ g_disk_done(struct bio *bp)
if (bp2->bio_error == 0)
bp2->bio_error = bp->bio_error;
bp2->bio_completed += bp->bio_completed;
-   if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0)
+   switch (bp->bio_cmd) {
+   case BIO_READ:
+   case BIO_WRITE:
+   case BIO_DELETE:
+   case BIO_FLUSH:
devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, );
+   break;
+   default:
+   break;
+   }
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
mtx_unlock(>done_mtx);

Modified: head/sys/geom/geom_io.c
==
--- head/sys/geom/geom_io.c Thu Mar 10 06:25:05 2016(r296604)
+++ head/sys/geom/geom_io.c Thu Mar 10 06:25:31 2016(r296605)
@@ -479,6 +479,7 @@ g_io_request(struct bio *bp, struct g_co
struct g_provider *pp;
struct mtx *mtxp;
int direct, error, first;
+   uint8_t cmd;
 
KASSERT(cp != NULL, ("NULL cp in g_io_request"));
KASSERT(bp != NULL, ("NULL bp in g_io_request"));
@@ -500,16 +501,17 @@ g_io_request(struct bio *bp, struct g_co
bp->_bio_cflags = bp->bio_cflags;
 #endif
 
-   if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_GETATTR)) {
+   cmd = bp->bio_cmd;
+   if (cmd == BIO_READ || cmd == BIO_WRITE || cmd == BIO_GETATTR) {
KASSERT(bp->bio_data != NULL,
("NULL bp->data in g_io_request(cmd=%hhu)", bp->bio_cmd));
}
-   if (bp->bio_cmd & (BIO_DELETE|BIO_FLUSH)) {
+   if (cmd == BIO_DELETE || cmd == BIO_FLUSH) {
KASSERT(bp->bio_data == NULL,
("non-NULL bp->data in g_io_request(cmd=%hhu)",
bp->bio_cmd));
}
-   if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) {
+   if (cmd == BIO_READ || cmd == BIO_WRITE || cmd == BIO_DELETE) {
KASSERT(bp->bio_offset % cp->provider->sectorsize == 0,
("wrong offset %jd for sectorsize %u",
bp->bio_offset, cp->provider->sectorsize));
___
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: r296604 - in head/sys: cam cam/ctl dev/isp

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 06:25:05 2016
New Revision: 296604
URL: https://svnweb.freebsd.org/changeset/base/296604

Log:
  Move to new value for XPT_GET_SIM_KNOB to avoid clash with XPT_ATA_IO.

Modified:
  head/sys/cam/cam_ccb.h
  head/sys/cam/cam_xpt.c
  head/sys/cam/ctl/scsi_ctl.c
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/cam/cam_ccb.h
==
--- head/sys/cam/cam_ccb.h  Thu Mar 10 06:15:31 2016(r296603)
+++ head/sys/cam/cam_ccb.h  Thu Mar 10 06:25:05 2016(r296604)
@@ -189,16 +189,18 @@ typedef enum {
XPT_ATA_IO  = 0x18 | XPT_FC_DEV_QUEUED,
/* Execute the requested ATA I/O operation */
 
-   XPT_GET_SIM_KNOB= 0x18,
-   /*
-* Get SIM specific knob values.
-*/
+   XPT_GET_SIM_KNOB_OLD= 0x18, /* Compat only */
 
XPT_SET_SIM_KNOB= 0x19,
/*
 * Set SIM specific knob values.
 */
 
+   XPT_GET_SIM_KNOB= 0x1a,
+   /*
+* Get SIM specific knob values.
+*/
+
XPT_SMP_IO  = 0x1b | XPT_FC_DEV_QUEUED,
/* Serial Management Protocol */
 

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Thu Mar 10 06:15:31 2016(r296603)
+++ head/sys/cam/cam_xpt.c  Thu Mar 10 06:25:05 2016(r296604)
@@ -2610,6 +2610,7 @@ xpt_action_default(union ccb *start_ccb)
case XPT_RESET_BUS:
case XPT_IMMEDIATE_NOTIFY:
case XPT_NOTIFY_ACKNOWLEDGE:
+   case XPT_GET_SIM_KNOB_OLD:
case XPT_GET_SIM_KNOB:
case XPT_SET_SIM_KNOB:
case XPT_GET_TRAN_SETTINGS:

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Thu Mar 10 06:15:31 2016(r296603)
+++ head/sys/cam/ctl/scsi_ctl.c Thu Mar 10 06:25:05 2016(r296604)
@@ -1557,6 +1557,7 @@ ctlfedone(struct cam_periph *periph, uni
break;
case XPT_SET_SIM_KNOB:
case XPT_GET_SIM_KNOB:
+   case XPT_GET_SIM_KNOB_OLD:
break;
default:
panic("%s: unexpected CCB type %#x", __func__,

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Thu Mar 10 06:15:31 2016
(r296603)
+++ head/sys/dev/isp/isp_freebsd.c  Thu Mar 10 06:25:05 2016
(r296604)
@@ -3944,6 +3944,7 @@ isp_action(struct cam_sim *sim, union cc
xpt_done(ccb);
break;
}
+   case XPT_GET_SIM_KNOB_OLD:  /* Get SIM knobs -- compat value */
case XPT_GET_SIM_KNOB:  /* Get SIM knobs */
{
struct ccb_sim_knob *kp = >knob;
___
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: r296603 - in head/sys/dev/cxgbe: . common

2016-03-09 Thread Navdeep Parhar
Author: np
Date: Thu Mar 10 06:15:31 2016
New Revision: 296603
URL: https://svnweb.freebsd.org/changeset/base/296603

Log:
  cxgbe(4): Add general purpose routines that offer safe access to the
  chip's memory windows.  Convert existing users of these windows to the
  new routines.

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Mar 10 05:45:24 2016
(r296602)
+++ head/sys/dev/cxgbe/adapter.hThu Mar 10 06:15:31 2016
(r296603)
@@ -438,6 +438,29 @@ struct hw_buf_info {
 };
 
 enum {
+   NUM_MEMWIN = 3,
+
+   MEMWIN0_APERTURE = 2048,
+   MEMWIN0_BASE = 0x1b800,
+
+   MEMWIN1_APERTURE = 32768,
+   MEMWIN1_BASE = 0x28000,
+
+   MEMWIN2_APERTURE_T4 = 65536,
+   MEMWIN2_BASE_T4 = 0x3,
+
+   MEMWIN2_APERTURE_T5 = 128 * 1024,
+   MEMWIN2_BASE_T5 = 0x6,
+};
+
+struct memwin {
+   struct rwlock mw_lock __aligned(CACHE_LINE_SIZE);
+   uint32_t mw_base;   /* constant after setup_memwin */
+   uint32_t mw_aperture;   /* ditto */
+   uint32_t mw_curpos; /* protected by mw_lock */
+};
+
+enum {
FL_STARVING = (1 << 0), /* on the adapter's list of starving fl's */
FL_DOOMED   = (1 << 1), /* about to be destroyed */
FL_BUF_PACKING  = (1 << 2), /* buffer packing enabled */
@@ -806,6 +829,8 @@ struct adapter {
 
struct mtx reg_lock;/* for indirect register access */
 
+   struct memwin memwin[NUM_MEMWIN];   /* memory windows */
+
an_handler_t an_handler __aligned(CACHE_LINE_SIZE);
fw_msg_handler_t fw_msg_handler[7]; /* NUM_FW6_TYPES */
cpl_handler_t cpl_handler[0xef];/* NUM_CPL_CMDS */

Modified: head/sys/dev/cxgbe/common/common.h
==
--- head/sys/dev/cxgbe/common/common.h  Thu Mar 10 05:45:24 2016
(r296602)
+++ head/sys/dev/cxgbe/common/common.h  Thu Mar 10 06:15:31 2016
(r296603)
@@ -52,20 +52,6 @@ enum {
 
 enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_MC0 = MEM_MC, MEM_MC1 };
 
-enum {
-   MEMWIN0_APERTURE = 2048,
-   MEMWIN0_BASE = 0x1b800,
-
-   MEMWIN1_APERTURE = 32768,
-   MEMWIN1_BASE = 0x28000,
-
-   MEMWIN2_APERTURE_T4 = 65536,
-   MEMWIN2_BASE_T4 = 0x3,
-
-   MEMWIN2_APERTURE_T5 = 128 * 1024,
-   MEMWIN2_BASE_T5 = 0x6,
-};
-
 enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST };
 
 enum dev_state { DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR };
@@ -76,11 +62,6 @@ enum {
PAUSE_AUTONEG = 1 << 2
 };
 
-struct memwin {
-   uint32_t base;
-   uint32_t aperture;
-};
-
 struct port_stats {
u64 tx_octets;/* total # of octets in good frames */
u64 tx_frames;/* all good frames */

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Mar 10 05:45:24 2016
(r296602)
+++ head/sys/dev/cxgbe/t4_main.cThu Mar 10 06:15:31 2016
(r296603)
@@ -399,12 +399,16 @@ struct filter_entry {
 static int map_bars_0_and_4(struct adapter *);
 static int map_bar_2(struct adapter *);
 static void setup_memwin(struct adapter *);
+static void position_memwin(struct adapter *, int, uint32_t);
+static int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, 
int);
+static inline int read_via_memwin(struct adapter *, int, uint32_t, uint32_t *,
+int);
+static inline int write_via_memwin(struct adapter *, int, uint32_t,
+const uint32_t *, int);
 static int validate_mem_range(struct adapter *, uint32_t, int);
 static int fwmtype_to_hwmtype(int);
 static int validate_mt_off_len(struct adapter *, int, uint32_t, int,
 uint32_t *);
-static void memwin_info(struct adapter *, int, uint32_t *, uint32_t *);
-static uint32_t position_memwin(struct adapter *, int, uint32_t);
 static int cfg_itype_and_nqueues(struct adapter *, int, int, int,
 struct intrs_and_queues *);
 static int prep_firmware(struct adapter *);
@@ -1164,6 +1168,13 @@ t4_detach(device_t dev)
if (mtx_initialized(>reg_lock))
mtx_destroy(>reg_lock);
 
+   for (i = 0; i < NUM_MEMWIN; i++) {
+   struct memwin *mw = >memwin[i];
+
+   if (rw_initialized(>mw_lock))
+   rw_destroy(>mw_lock);
+   }
+
bzero(sc, sizeof(*sc));
 
return (0);
@@ -1965,13 +1976,18 @@ map_bar_2(struct adapter *sc)
return (0);
 }
 
-static const struct memwin t4_memwin[] = {
+struct memwin_init {
+   uint32_t base;
+   uint32_t aperture;
+};
+
+static const struct memwin_init t4_memwin[NUM_MEMWIN] = {
{ MEMWIN0_BASE, MEMWIN0_APERTURE },
{ 

svn commit: r296602 - head/sys/dev/vnic

2016-03-09 Thread Zbigniew Bodek
Author: zbb
Date: Thu Mar 10 05:45:24 2016
New Revision: 296602
URL: https://svnweb.freebsd.org/changeset/base/296602

Log:
  Fix bug in VNIC causing phony number of available TX descriptors
  
  TSO packets will signal segments TX completion in the separate CQ
  descriptors. Each CQ descriptor for HW TSO will point to the same
  SQ entry.
  Do not invoke nicvf_put_sq_desc() for secondary segments to avoid
  free_cnt corruption and eventually integer overflow that will result
  in the negative free_cnt value and hence impossibility of further
  transmission.
  
  Reviewed by:   wma
  Obtained from: Semihalf
  Sponsored by:  Cavium
  Differential Revision: https://reviews.freebsd.org/D5535

Modified:
  head/sys/dev/vnic/nicvf_queues.c

Modified: head/sys/dev/vnic/nicvf_queues.c
==
--- head/sys/dev/vnic/nicvf_queues.cThu Mar 10 05:23:46 2016
(r296601)
+++ head/sys/dev/vnic/nicvf_queues.cThu Mar 10 05:45:24 2016
(r296602)
@@ -722,10 +722,10 @@ nicvf_snd_pkt_handler(struct nicvf *nic,
if (mbuf != NULL) {
m_freem(mbuf);
sq->snd_buff[cqe_tx->sqe_ptr].mbuf = NULL;
+   nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
}
 
nicvf_check_cqe_tx_errs(nic, cq, cqe_tx);
-   nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
 
NICVF_TX_UNLOCK(sq);
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r296601 - head/sys/dev/vnic

2016-03-09 Thread Zbigniew Bodek
Author: zbb
Date: Thu Mar 10 05:23:46 2016
New Revision: 296601
URL: https://svnweb.freebsd.org/changeset/base/296601

Log:
  Fix "received NULL mbuf" bug in VNIC
  
  Do not modify NIC_QSET_CQ_0_7_HEAD manually, especially
  in non-atomic context.
  It doesn't seem to be necessary to recreate CQ head after
  interrupt clearing too.
  
  Reviewed by:   wma
  Obtained from: Semihalf
  Sponsored by:  Cavium
  Differential Revision: https://reviews.freebsd.org/D5533

Modified:
  head/sys/dev/vnic/nicvf_queues.c

Modified: head/sys/dev/vnic/nicvf_queues.c
==
--- head/sys/dev/vnic/nicvf_queues.cThu Mar 10 04:21:00 2016
(r296600)
+++ head/sys/dev/vnic/nicvf_queues.cThu Mar 10 05:23:46 2016
(r296601)
@@ -889,7 +889,6 @@ nicvf_qs_err_task(void *arg, int pending
 static void
 nicvf_cmp_task(void *arg, int pending)
 {
-   uint64_t cq_head;
struct cmp_queue *cq;
struct nicvf *nic;
int cmp_err;
@@ -899,11 +898,6 @@ nicvf_cmp_task(void *arg, int pending)
 
/* Handle CQ descriptors */
cmp_err = nicvf_cq_intr_handler(nic, cq->idx);
-   /* Re-enable interrupts */
-   cq_head = nicvf_queue_reg_read(nic, NIC_QSET_CQ_0_7_HEAD, cq->idx);
-   nicvf_clear_intr(nic, NICVF_INTR_CQ, cq->idx);
-   nicvf_queue_reg_write(nic, NIC_QSET_CQ_0_7_HEAD, cq->idx, cq_head);
-
if (__predict_false(cmp_err != 0)) {
/*
 * Schedule another thread here since we did not
@@ -913,6 +907,7 @@ nicvf_cmp_task(void *arg, int pending)
 
}
 
+   nicvf_clear_intr(nic, NICVF_INTR_CQ, cq->idx);
/* Reenable interrupt (previously disabled in nicvf_intr_handler() */
nicvf_enable_intr(nic, NICVF_INTR_CQ, cq->idx);
 
___
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: r296600 - vendor/bind9/9.9.8-P4

2016-03-09 Thread Xin LI
Author: delphij
Date: Thu Mar 10 04:21:00 2016
New Revision: 296600
URL: https://svnweb.freebsd.org/changeset/base/296600

Log:
  Tag the BIND 9.9.8-P4 release.

Added:
  vendor/bind9/9.9.8-P4/
 - copied from r296599, vendor/bind9/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: r296599 - in vendor/bind9/dist: . bin/named bin/rndc doc/arm lib/dns lib/isccc

2016-03-09 Thread Xin LI
Author: delphij
Date: Thu Mar 10 04:17:58 2016
New Revision: 296599
URL: https://svnweb.freebsd.org/changeset/base/296599

Log:
  Vendor import of BIND 9.9.8-P4.

Modified:
  vendor/bind9/dist/CHANGES
  vendor/bind9/dist/COPYRIGHT
  vendor/bind9/dist/README
  vendor/bind9/dist/bin/named/control.c
  vendor/bind9/dist/bin/named/controlconf.c
  vendor/bind9/dist/bin/named/query.c
  vendor/bind9/dist/bin/rndc/rndc.c
  vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch11.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch12.html
  vendor/bind9/dist/doc/arm/Bv9ARM.ch13.html
  vendor/bind9/dist/doc/arm/Bv9ARM.html
  vendor/bind9/dist/doc/arm/Bv9ARM.pdf
  vendor/bind9/dist/doc/arm/man.arpaname.html
  vendor/bind9/dist/doc/arm/man.ddns-confgen.html
  vendor/bind9/dist/doc/arm/man.dig.html
  vendor/bind9/dist/doc/arm/man.dnssec-checkds.html
  vendor/bind9/dist/doc/arm/man.dnssec-coverage.html
  vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html
  vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html
  vendor/bind9/dist/doc/arm/man.dnssec-keygen.html
  vendor/bind9/dist/doc/arm/man.dnssec-revoke.html
  vendor/bind9/dist/doc/arm/man.dnssec-settime.html
  vendor/bind9/dist/doc/arm/man.dnssec-signzone.html
  vendor/bind9/dist/doc/arm/man.dnssec-verify.html
  vendor/bind9/dist/doc/arm/man.genrandom.html
  vendor/bind9/dist/doc/arm/man.host.html
  vendor/bind9/dist/doc/arm/man.isc-hmac-fixup.html
  vendor/bind9/dist/doc/arm/man.named-checkconf.html
  vendor/bind9/dist/doc/arm/man.named-checkzone.html
  vendor/bind9/dist/doc/arm/man.named-journalprint.html
  vendor/bind9/dist/doc/arm/man.named.html
  vendor/bind9/dist/doc/arm/man.nsec3hash.html
  vendor/bind9/dist/doc/arm/man.nsupdate.html
  vendor/bind9/dist/doc/arm/man.rndc-confgen.html
  vendor/bind9/dist/doc/arm/man.rndc.conf.html
  vendor/bind9/dist/doc/arm/man.rndc.html
  vendor/bind9/dist/doc/arm/notes.html
  vendor/bind9/dist/doc/arm/notes.pdf
  vendor/bind9/dist/doc/arm/notes.xml
  vendor/bind9/dist/lib/dns/api
  vendor/bind9/dist/lib/dns/resolver.c
  vendor/bind9/dist/lib/isccc/cc.c
  vendor/bind9/dist/version

Modified: vendor/bind9/dist/CHANGES
==
--- vendor/bind9/dist/CHANGES   Thu Mar 10 03:58:48 2016(r296598)
+++ vendor/bind9/dist/CHANGES   Thu Mar 10 04:17:58 2016(r296599)
@@ -1,3 +1,12 @@
+   --- 9.9.8-P4 released ---
+
+4319.  [security]  Fix resolver assertion failure due to improper
+   DNAME handling when parsing fetch reply messages.
+   (CVE-2016-1286) [RT #41753]
+
+4318.  [security]  Malformed control messages can trigger assertions
+   in named and rndc. (CVE-2016-1285) [RT #41666]
+
--- 9.9.8-P3 released ---
 
 4288.  [bug]   Fixed a regression in resolver.c:possibly_mark()

Modified: vendor/bind9/dist/COPYRIGHT
==
--- vendor/bind9/dist/COPYRIGHT Thu Mar 10 03:58:48 2016(r296598)
+++ vendor/bind9/dist/COPYRIGHT Thu Mar 10 04:17:58 2016(r296599)
@@ -1,4 +1,4 @@
-Copyright (C) 2004-2015  Internet Systems Consortium, Inc. ("ISC")
+Copyright (C) 2004-2016  Internet Systems Consortium, Inc. ("ISC")
 Copyright (C) 1996-2003  Internet Software Consortium.
 
 Permission to use, copy, modify, and/or distribute this software for any

Modified: vendor/bind9/dist/README
==
--- vendor/bind9/dist/READMEThu Mar 10 03:58:48 2016(r296598)
+++ vendor/bind9/dist/READMEThu Mar 10 04:17:58 2016(r296599)
@@ -51,6 +51,11 @@ BIND 9
For up-to-date release notes and errata, see
http://www.isc.org/software/bind9/releasenotes
 
+BIND 9.9.8-P4
+
+   BIND 9.9.8-P4 is a security release addressing the flaws
+   described in CVE-2016-1285 and CVE-2016-1286.
+
 BIND 9.9.8-P3
 
   BIND 9.9.8-P3 is a security release addressing the flaw described in

Modified: vendor/bind9/dist/bin/named/control.c
==
--- vendor/bind9/dist/bin/named/control.c   Thu Mar 10 03:58:48 2016
(r296598)
+++ vendor/bind9/dist/bin/named/control.c   Thu Mar 10 04:17:58 2016
(r296599)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007, 2009-2015  Internet Systems Consortium, Inc. 
("ISC")
+ * Copyright (C) 2004-2007, 2009-2016  Internet Systems Consortium, Inc. 
("ISC")
  * Copyright (C) 2001-2003  

svn commit: r296598 - stable/9/crypto/openssl/crypto/bn

2016-03-09 Thread Xin LI
Author: delphij
Date: Thu Mar 10 03:58:48 2016
New Revision: 296598
URL: https://svnweb.freebsd.org/changeset/base/296598

Log:
  Fix CR/LF's in bn_exp.c introduced in r207783.  No actual code change.

Modified:
  stable/9/crypto/openssl/crypto/bn/bn_exp.c

Modified: stable/9/crypto/openssl/crypto/bn/bn_exp.c
==
--- stable/9/crypto/openssl/crypto/bn/bn_exp.c  Thu Mar 10 03:57:37 2016
(r296597)
+++ stable/9/crypto/openssl/crypto/bn/bn_exp.c  Thu Mar 10 03:58:48 2016
(r296598)
@@ -107,13 +107,13 @@
  * (e...@cryptsoft.com).  This product includes software written by Tim
  * Hudson (t...@cryptsoft.com).
  *
- */
-
-#include "cryptlib.h"
-#include "constant_time_locl.h"
-#include "bn_lcl.h"
-
-/* maximum precomputation table size for *variable* sliding windows */
+ */
+
+#include "cryptlib.h"
+#include "constant_time_locl.h"
+#include "bn_lcl.h"
+
+/* maximum precomputation table size for *variable* sliding windows */
 #define TABLE_SIZE  32
 
 /* this one works - simple but works */
@@ -521,79 +521,79 @@ int BN_mod_exp_mont(BIGNUM *rr, const BI
  * pattern as far as cache lines are concerned.  The following functions are
  * used to transfer a BIGNUM from/to that table.
  */
-
-static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top,
-unsigned char *buf, int idx,
-int window)
-{
-int i, j;
-int width = 1 << window;
-BN_ULONG *table = (BN_ULONG *)buf;
-
-if (bn_wexpand(b, top) == NULL)
-return 0;
+
+static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top,
+unsigned char *buf, int idx,
+int window)
+{
+int i, j;
+int width = 1 << window;
+BN_ULONG *table = (BN_ULONG *)buf;
+
+if (bn_wexpand(b, top) == NULL)
+return 0;
 while (b->top < top) {
-b->d[b->top++] = 0;
-}
-
-for (i = 0, j = idx; i < top; i++, j += width) {
-table[j] = b->d[i];
-}
-
-bn_correct_top(b);
+b->d[b->top++] = 0;
+}
+
+for (i = 0, j = idx; i < top; i++, j += width) {
+table[j] = b->d[i];
+}
+
+bn_correct_top(b);
 return 1;
 }
-
-static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
-  unsigned char *buf, int idx,
-  int window)
-{
-int i, j;
-int width = 1 << window;
-volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
-
-if (bn_wexpand(b, top) == NULL)
-return 0;
-
-if (window <= 3) {
-for (i = 0; i < top; i++, table += width) {
-BN_ULONG acc = 0;
-
-for (j = 0; j < width; j++) {
-acc |= table[j] &
-   ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
-}
-
-b->d[i] = acc;
-}
-} else {
-int xstride = 1 << (window - 2);
-BN_ULONG y0, y1, y2, y3;
-
-i = idx >> (window - 2);/* equivalent of idx / xstride */
-idx &= xstride - 1; /* equivalent of idx % xstride */
-
-y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);
-y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1);
-y2 = (BN_ULONG)0 - (constant_time_eq_int(i,2)&1);
-y3 = (BN_ULONG)0 - (constant_time_eq_int(i,3)&1);
-
-for (i = 0; i < top; i++, table += width) {
-BN_ULONG acc = 0;
-
-for (j = 0; j < xstride; j++) {
-acc |= ( (table[j + 0 * xstride] & y0) |
- (table[j + 1 * xstride] & y1) |
- (table[j + 2 * xstride] & y2) |
- (table[j + 3 * xstride] & y3) )
-   & ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
-}
-
-b->d[i] = acc;
-}
-}
-
-b->top = top;
+
+static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
+  unsigned char *buf, int idx,
+  int window)
+{
+int i, j;
+int width = 1 << window;
+volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
+
+if (bn_wexpand(b, top) == NULL)
+return 0;
+
+if (window <= 3) {
+for (i = 0; i < top; i++, table += width) {
+BN_ULONG acc = 0;
+
+for (j = 0; j < width; j++) {
+acc |= table[j] &
+   ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
+}
+
+b->d[i] = acc;
+}
+} else {
+int xstride = 1 << (window - 2);
+BN_ULONG y0, y1, y2, y3;
+
+i = idx >> (window - 2);/* equivalent of idx / xstride */
+idx &= xstride - 1; /* equivalent of idx % xstride */
+
+y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);
+y1 = (BN_ULONG)0 - 

svn commit: r296597 - stable/9/crypto/openssl/crypto/bn

2016-03-09 Thread Xin LI
Author: delphij
Date: Thu Mar 10 03:57:37 2016
New Revision: 296597
URL: https://svnweb.freebsd.org/changeset/base/296597

Log:
  Fix a regression introduced in r296462 that causes out-of-bound access in
  the BN code and have slipped my review.
  
  PR:   207783
  Submitted by: dim

Modified:
  stable/9/crypto/openssl/crypto/bn/bn_exp.c

Modified: stable/9/crypto/openssl/crypto/bn/bn_exp.c
==
--- stable/9/crypto/openssl/crypto/bn/bn_exp.c  Thu Mar 10 02:43:10 2016
(r296596)
+++ stable/9/crypto/openssl/crypto/bn/bn_exp.c  Thu Mar 10 03:57:37 2016
(r296597)
@@ -758,7 +758,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr
  * Fetch the appropriate pre-computed value from the pre-buf
  */
 if (!MOD_EXP_CTIME_COPY_FROM_PREBUF
-(computeTemp, top, powerbuf, wvalue, numPowers))
+(computeTemp, top, powerbuf, wvalue, window))
 goto err;
 
 /* Multiply the result into the intermediate result */
___
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: r296596 - head/sys/dev/cxgbe

2016-03-09 Thread Navdeep Parhar
Author: np
Date: Thu Mar 10 02:43:10 2016
New Revision: 296596
URL: https://svnweb.freebsd.org/changeset/base/296596

Log:
  cxgbe(4): Allow the addr/len pair that is being validated in
  validate_mem_range to span multiple memory types.  Update
  validate_mt_off_len to use validate_mem_range.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Mar 10 02:37:47 2016
(r296595)
+++ head/sys/dev/cxgbe/t4_main.cThu Mar 10 02:43:10 2016
(r296596)
@@ -2016,52 +2016,135 @@ setup_memwin(struct adapter *sc)
t4_read_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, 2));
 }
 
+static int
+t4_range_cmp(const void *a, const void *b)
+{
+   return ((const struct t4_range *)a)->start -
+  ((const struct t4_range *)b)->start;
+}
+
 /*
- * Verify that the memory range specified by the addr/len pair is valid and 
lies
- * entirely within a single region (EDCx or MCx).
+ * Verify that the memory range specified by the addr/len pair is valid within
+ * the card's address space.
  */
 static int
 validate_mem_range(struct adapter *sc, uint32_t addr, int len)
 {
-   uint32_t em, addr_len, maddr, mlen;
+   struct t4_range mem_ranges[4], *r, *next;
+   uint32_t em, addr_len;
+   int i, n, remaining;
 
/* Memory can only be accessed in naturally aligned 4 byte units */
-   if (addr & 3 || len & 3 || len == 0)
+   if (addr & 3 || len & 3 || len <= 0)
return (EINVAL);
 
/* Enabled memories */
em = t4_read_reg(sc, A_MA_TARGET_MEM_ENABLE);
+
+   r = _ranges[0];
+   n = 0;
+   bzero(r, sizeof(mem_ranges));
if (em & F_EDRAM0_ENABLE) {
addr_len = t4_read_reg(sc, A_MA_EDRAM0_BAR);
-   maddr = G_EDRAM0_BASE(addr_len) << 20;
-   mlen = G_EDRAM0_SIZE(addr_len) << 20;
-   if (mlen > 0 && addr >= maddr && addr < maddr + mlen &&
-   addr + len <= maddr + mlen)
-   return (0);
+   r->size = G_EDRAM0_SIZE(addr_len) << 20;
+   if (r->size > 0) {
+   r->start = G_EDRAM0_BASE(addr_len) << 20;
+   if (addr >= r->start &&
+   addr + len <= r->start + r->size)
+   return (0);
+   r++;
+   n++;
+   }
}
if (em & F_EDRAM1_ENABLE) {
addr_len = t4_read_reg(sc, A_MA_EDRAM1_BAR);
-   maddr = G_EDRAM1_BASE(addr_len) << 20;
-   mlen = G_EDRAM1_SIZE(addr_len) << 20;
-   if (mlen > 0 && addr >= maddr && addr < maddr + mlen &&
-   addr + len <= maddr + mlen)
-   return (0);
+   r->size = G_EDRAM1_SIZE(addr_len) << 20;
+   if (r->size > 0) {
+   r->start = G_EDRAM1_BASE(addr_len) << 20;
+   if (addr >= r->start &&
+   addr + len <= r->start + r->size)
+   return (0);
+   r++;
+   n++;
+   }
}
if (em & F_EXT_MEM_ENABLE) {
addr_len = t4_read_reg(sc, A_MA_EXT_MEMORY_BAR);
-   maddr = G_EXT_MEM_BASE(addr_len) << 20;
-   mlen = G_EXT_MEM_SIZE(addr_len) << 20;
-   if (mlen > 0 && addr >= maddr && addr < maddr + mlen &&
-   addr + len <= maddr + mlen)
-   return (0);
+   r->size = G_EXT_MEM_SIZE(addr_len) << 20;
+   if (r->size > 0) {
+   r->start = G_EXT_MEM_BASE(addr_len) << 20;
+   if (addr >= r->start &&
+   addr + len <= r->start + r->size)
+   return (0);
+   r++;
+   n++;
+   }
}
-   if (!is_t4(sc) && em & F_EXT_MEM1_ENABLE) {
+   if (is_t5(sc) && em & F_EXT_MEM1_ENABLE) {
addr_len = t4_read_reg(sc, A_MA_EXT_MEMORY1_BAR);
-   maddr = G_EXT_MEM1_BASE(addr_len) << 20;
-   mlen = G_EXT_MEM1_SIZE(addr_len) << 20;
-   if (mlen > 0 && addr >= maddr && addr < maddr + mlen &&
-   addr + len <= maddr + mlen)
-   return (0);
+   r->size = G_EXT_MEM1_SIZE(addr_len) << 20;
+   if (r->size > 0) {
+   r->start = G_EXT_MEM1_BASE(addr_len) << 20;
+   if (addr >= r->start &&
+   addr + len <= r->start + r->size)
+   return (0);
+   r++;
+   n++;
+   }
+   }
+   MPASS(n <= nitems(mem_ranges));
+
+   if (n > 1) {
+   /* 

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

2016-03-09 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Mar 10 02:37:47 2016
New Revision: 296595
URL: https://svnweb.freebsd.org/changeset/base/296595

Log:
  hyperv/hn: Make the # of TX rings configurable.
  
  Rename the tunables to avoid confusion.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5578

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Mar 10 02:28:01 
2016(r296594)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Mar 10 02:37:47 
2016(r296595)
@@ -279,13 +279,14 @@ static int hn_use_if_start = 0;
 SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN,
 _use_if_start, 0, "Use if_start TX method");
 
-static int hn_ring_cnt = 1;
-SYSCTL_INT(_hw_hn, OID_AUTO, ring_cnt, CTLFLAG_RDTUN,
-_ring_cnt, 0, "# of TX/RX rings to used");
-
-static int hn_single_tx_ring = 1;
-SYSCTL_INT(_hw_hn, OID_AUTO, single_tx_ring, CTLFLAG_RDTUN,
-_single_tx_ring, 0, "Use one TX ring");
+static int hn_chan_cnt = 1;
+SYSCTL_INT(_hw_hn, OID_AUTO, chan_cnt, CTLFLAG_RDTUN,
+_chan_cnt, 0,
+"# of channels to use; each channel has one RX ring and one TX ring");
+
+static int hn_tx_ring_cnt = 1;
+SYSCTL_INT(_hw_hn, OID_AUTO, tx_ring_cnt, CTLFLAG_RDTUN,
+_tx_ring_cnt, 0, "# of TX rings to use");
 
 static u_int hn_cpu_index;
 
@@ -439,24 +440,33 @@ netvsc_attach(device_t dev)
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 
-   ring_cnt = hn_ring_cnt;
-   if (ring_cnt <= 0 || ring_cnt >= mp_ncpus)
+   /*
+* Figure out the # of RX rings (ring_cnt) and the # of TX rings
+* to use (tx_ring_cnt).
+*
+* NOTE:
+* The # of RX rings to use is same as the # of channels to use.
+*/
+   ring_cnt = hn_chan_cnt;
+   if (ring_cnt <= 0 || ring_cnt > mp_ncpus)
ring_cnt = mp_ncpus;
-   sc->hn_cpu = atomic_fetchadd_int(_cpu_index, ring_cnt) % mp_ncpus;
 
-   tx_ring_cnt = ring_cnt;
-   if (hn_single_tx_ring || hn_use_if_start) {
-   /*
-* - Explicitly asked to use single TX ring.
-* - ifnet.if_start is used; ifnet.if_start only needs
-*   one TX ring.
-*/
+   tx_ring_cnt = hn_tx_ring_cnt;
+   if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt)
+   tx_ring_cnt = ring_cnt;
+   if (hn_use_if_start) {
+   /* ifnet.if_start only needs one TX ring. */
tx_ring_cnt = 1;
}
+
+   /*
+* Set the leader CPU for channels.
+*/
+   sc->hn_cpu = atomic_fetchadd_int(_cpu_index, ring_cnt) % mp_ncpus;
+
error = hn_create_tx_data(sc, tx_ring_cnt);
if (error)
goto failed;
-
hn_create_rx_data(sc, ring_cnt);
 
/*
@@ -505,12 +515,13 @@ netvsc_attach(device_t dev)
error = hv_rf_on_device_add(device_ctx, _info, ring_cnt);
if (error)
goto failed;
-   KASSERT(sc->net_dev->num_channel <= ring_cnt,
+   KASSERT(sc->net_dev->num_channel > 0 &&
+   sc->net_dev->num_channel <= sc->hn_rx_ring_inuse,
("invalid channel count %u, should be less than %d",
-sc->net_dev->num_channel, ring_cnt));
+sc->net_dev->num_channel, sc->hn_rx_ring_inuse));
 
/*
-* Set # of TX/RX rings that could be used according to
+* Set the # of TX/RX rings that could be used according to
 * the # of channels that host offered.
 */
if (sc->hn_tx_ring_inuse > sc->net_dev->num_channel)
___
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: r296594 - head/sys/dev/hyperv/netvsc

2016-03-09 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Mar 10 02:28:01 2016
New Revision: 296594
URL: https://svnweb.freebsd.org/changeset/base/296594

Log:
  hyperv/hn: Factor out hn_channel_attach
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5577

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Mar 10 02:13:42 2016
(r296593)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Mar 10 02:28:01 2016
(r296594)
@@ -1167,12 +1167,15 @@ struct hn_rx_ring {
 
/* Rarely used stuffs */
struct sysctl_oid *hn_rx_sysctl_tree;
+   int hn_rx_flags;
 } __aligned(CACHE_LINE_SIZE);
 
 #define HN_TRUST_HCSUM_IP  0x0001
 #define HN_TRUST_HCSUM_TCP 0x0002
 #define HN_TRUST_HCSUM_UDP 0x0004
 
+#define HN_RX_FLAG_ATTACHED0x1
+
 struct hn_tx_ring {
 #ifndef HN_USE_TXDESC_BUFRING
struct mtx  hn_txlist_spin;
@@ -1214,8 +1217,11 @@ struct hn_tx_ring {
struct hn_txdesc *hn_txdesc;
bus_dma_tag_t   hn_tx_rndis_dtag;
struct sysctl_oid *hn_tx_sysctl_tree;
+   int hn_tx_flags;
 } __aligned(CACHE_LINE_SIZE);
 
+#define HN_TX_FLAG_ATTACHED0x1
+
 /*
  * Device-specific softc structure
  */

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Mar 10 02:13:42 
2016(r296593)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Mar 10 02:28:01 
2016(r296594)
@@ -323,6 +323,7 @@ static int hn_encap(struct hn_tx_ring *,
 static void hn_create_rx_data(struct hn_softc *sc, int);
 static void hn_destroy_rx_data(struct hn_softc *sc);
 static void hn_set_tx_chimney_size(struct hn_softc *, int);
+static void hn_channel_attach(struct hn_softc *, struct hv_vmbus_channel *);
 
 static int hn_transmit(struct ifnet *, struct mbuf *);
 static void hn_xmit_qflush(struct ifnet *);
@@ -462,10 +463,11 @@ netvsc_attach(device_t dev)
 * Associate the first TX/RX ring w/ the primary channel.
 */
chan = device_ctx->channel;
-   chan->hv_chan_rxr = >hn_rx_ring[0];
-   chan->hv_chan_txr = >hn_tx_ring[0];
-   sc->hn_tx_ring[0].hn_chan = chan;
-   vmbus_channel_cpu_set(chan, sc->hn_cpu);
+   KASSERT(HV_VMBUS_CHAN_ISPRIMARY(chan), ("not primary channel"));
+   KASSERT(chan->offer_msg.offer.sub_channel_index == 0,
+   ("primary channel subidx %u",
+chan->offer_msg.offer.sub_channel_index));
+   hn_channel_attach(sc, chan);
 
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = hn_ioctl;
@@ -2766,30 +2768,53 @@ hn_xmit_txeof_taskfunc(void *xtxr, int p
mtx_unlock(>hn_tx_lock);
 }
 
-void
-netvsc_subchan_callback(struct hn_softc *sc, struct hv_vmbus_channel *chan)
+static void
+hn_channel_attach(struct hn_softc *sc, struct hv_vmbus_channel *chan)
 {
+   struct hn_rx_ring *rxr;
int idx;
 
-   KASSERT(!HV_VMBUS_CHAN_ISPRIMARY(chan),
-   ("subchannel callback on primary channel"));
-
idx = chan->offer_msg.offer.sub_channel_index;
-   KASSERT(idx > 0 && idx < sc->hn_rx_ring_inuse,
+
+   KASSERT(idx >= 0 && idx < sc->hn_rx_ring_inuse,
("invalid channel index %d, should > 0 && < %d",
 idx, sc->hn_rx_ring_inuse));
-   vmbus_channel_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus);
+   rxr = >hn_rx_ring[idx];
+   KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED) == 0,
+   ("RX ring %d already attached", idx));
+   rxr->hn_rx_flags |= HN_RX_FLAG_ATTACHED;
 
-   chan->hv_chan_rxr = >hn_rx_ring[idx];
+   chan->hv_chan_rxr = rxr;
if_printf(sc->hn_ifp, "link RX ring %d to channel%u\n",
idx, chan->offer_msg.child_rel_id);
 
if (idx < sc->hn_tx_ring_inuse) {
-   chan->hv_chan_txr = >hn_tx_ring[idx];
-   sc->hn_tx_ring[idx].hn_chan = chan;
+   struct hn_tx_ring *txr = >hn_tx_ring[idx];
+
+   KASSERT((txr->hn_tx_flags & HN_TX_FLAG_ATTACHED) == 0,
+   ("TX ring %d already attached", idx));
+   txr->hn_tx_flags |= HN_TX_FLAG_ATTACHED;
+
+   chan->hv_chan_txr = txr;
+   txr->hn_chan = chan;
if_printf(sc->hn_ifp, "link TX ring %d to channel%u\n",
idx, chan->offer_msg.child_rel_id);
}
+
+   /* Bind channel to a proper CPU */
+   vmbus_channel_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus);
+}
+
+void
+netvsc_subchan_callback(struct hn_softc *sc, struct hv_vmbus_channel *chan)
+{
+
+   KASSERT(!HV_VMBUS_CHAN_ISPRIMARY(chan),
+   ("subchannel 

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

2016-03-09 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Mar 10 02:13:42 2016
New Revision: 296593
URL: https://svnweb.freebsd.org/changeset/base/296593

Log:
  hyperv/hn: Move if_initname to an earlier place
  
  So that functions shared w/ attach path could use if_printf().
  
  While I'm here, remove unnecessary if_dunit and if_dname assignment.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5576

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Mar 10 00:36:52 
2016(r296592)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Mar 10 02:13:42 
2016(r296593)
@@ -436,6 +436,7 @@ netvsc_attach(device_t dev)
 
ifp = sc->hn_ifp = if_alloc(IFT_ETHER);
ifp->if_softc = sc;
+   if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 
ring_cnt = hn_ring_cnt;
if (ring_cnt <= 0 || ring_cnt >= mp_ncpus)
@@ -466,10 +467,6 @@ netvsc_attach(device_t dev)
sc->hn_tx_ring[0].hn_chan = chan;
vmbus_channel_cpu_set(chan, sc->hn_cpu);
 
-   if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-   ifp->if_dunit = unit;
-   ifp->if_dname = NETVSC_DEVNAME;
-
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = hn_ioctl;
ifp->if_init = hn_ifinit;
___
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: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Conrad Meyer
On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd  wrote:
> Woo!
>
> Just so its' not lost - people in irc have found power consumption has
> jumped dramatically since this commit. :(

For the record, on X230 (Ivybridge) I actually see lower power
consumption with the new 3.8 kms:

(All at brightness 100)
Old kernel, no KMS:  11W
Old kernel, KMS:  13W
New kernel, no KMS:  11W
New kernel, KMS:  11W

With brightness down to minimum (5%):
New kernel, KMS:  8.9W

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


svn commit: r296590 - in head/sys: dev/fdc sys

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 00:36:38 2016
New Revision: 296590
URL: https://svnweb.freebsd.org/changeset/base/296590

Log:
  Add raw RX-50 support. These are 400k single sided disks with 80
  tracks and 10 sectors per track. More exotic RX-50 types not
  supported, nor is there support for de-interleaving the first two
  tracks where the physical sectors are 0 1 2 3 4 5 6 7 8 9, but they
  should be interpreted as 0 5 1 6 2 7 3 8 4 9. This is purely to read
  the media with dd. The FAT that's on these disks won't work with
  msdosfs anyway.

Modified:
  head/sys/dev/fdc/fdc.c
  head/sys/sys/fdcio.h

Modified: head/sys/dev/fdc/fdc.c
==
--- head/sys/dev/fdc/fdc.c  Thu Mar 10 00:33:06 2016(r296589)
+++ head/sys/dev/fdc/fdc.c  Thu Mar 10 00:36:38 2016(r296590)
@@ -155,6 +155,7 @@ static struct fd_type fd_searchlist_12m[
{ FDF_5_1230 | FL_AUTO },
 #else
{ FDF_5_1200 | FL_AUTO },
+   { FDF_5_400 | FL_AUTO },
{ FDF_5_360 | FL_2STEP | FL_AUTO},
 #endif
{ 0 }

Modified: head/sys/sys/fdcio.h
==
--- head/sys/sys/fdcio.hThu Mar 10 00:33:06 2016(r296589)
+++ head/sys/sys/fdcio.hThu Mar 10 00:36:38 2016(r296590)
@@ -209,6 +209,7 @@ enum fd_drivetype {
 #define FDF_5_800  10,2,0xFF,0x10,80,0,FDC_300KBPS,2,0x2e,1,0,FL_MFM
 #define FDF_5_720   9,2,0xFF,0x20,80,0,FDC_300KBPS,2,0x50,1,0,FL_MFM
 #define FDF_5_640   8,2,0xFF,0x2A,80,0,FDC_300KBPS,2,0x50,1,0,FL_MFM
+#define FDF_5_400  10,2,0xFF,0x10,80,0,FDC_300KBPS,1,0x2e,1,0,FL_MFM /* RX50 */
 #define FDF_5_360   9,2,0xFF,0x23,40,0,FDC_300KBPS,2,0x50,1,0,FL_MFM
 /* XXX:  0x2a ? */
 #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: r296592 - head/sys/dev/amr

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 00:36:52 2016
New Revision: 296592
URL: https://svnweb.freebsd.org/changeset/base/296592

Log:
  Don't assume that bio_cmd is a bitfield.
  
  Differential revision: https://reviews.freebsd.org/D5590

Modified:
  head/sys/dev/amr/amr.c

Modified: head/sys/dev/amr/amr.c
==
--- head/sys/dev/amr/amr.c  Thu Mar 10 00:36:45 2016(r296591)
+++ head/sys/dev/amr/amr.c  Thu Mar 10 00:36:52 2016(r296592)
@@ -1319,7 +1319,7 @@ amr_bio_command(struct amr_softc *sc, st
 blkcount = (bio->bio_bcount + AMR_BLKSIZE - 1) / AMR_BLKSIZE;
 
 ac->ac_mailbox.mb_command = cmd;
-if (bio->bio_cmd & (BIO_READ|BIO_WRITE)) {
+if (bio->bio_cmd == BIO_READ || bio->bio_cmd == BIO_WRITE) {
ac->ac_mailbox.mb_blkcount = blkcount;
ac->ac_mailbox.mb_lba = bio->bio_pblkno;
if ((bio->bio_pblkno + blkcount) > sc->amr_drive[driveno].al_size) {
___
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: r296591 - head/sys/dev/firewire

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 00:36:45 2016
New Revision: 296591
URL: https://svnweb.freebsd.org/changeset/base/296591

Log:
  Don't assume bio_cmd is a bit field.
  
  Differential Revision: https://reviews.freebsd.org/D5594

Modified:
  head/sys/dev/firewire/fwmem.c

Modified: head/sys/dev/firewire/fwmem.c
==
--- head/sys/dev/firewire/fwmem.c   Thu Mar 10 00:36:38 2016
(r296590)
+++ head/sys/dev/firewire/fwmem.c   Thu Mar 10 00:36:45 2016
(r296591)
@@ -364,7 +364,7 @@ fwmem_strategy(struct bio *bp)
}
 
iolen = MIN(bp->bio_bcount, MAXLEN);
-   if ((bp->bio_cmd & BIO_READ) == BIO_READ) {
+   if (bp->bio_cmd == BIO_READ) {
if (iolen == 4 && (bp->bio_offset & 3) == 0)
xfer = fwmem_read_quad(fwdev,
(void *)bp, fwmem_speed,
___
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: r296589 - head/sys/dev/fdc

2016-03-09 Thread Warner Losh
Author: imp
Date: Thu Mar 10 00:33:06 2016
New Revision: 296589
URL: https://svnweb.freebsd.org/changeset/base/296589

Log:
  Stop assuming that bio_cmd is a bit field.
  
  Differential Revision: https://reviews.freebsd.org/D5587

Modified:
  head/sys/dev/fdc/fdc.c

Modified: head/sys/dev/fdc/fdc.c
==
--- head/sys/dev/fdc/fdc.c  Thu Mar 10 00:27:10 2016(r296588)
+++ head/sys/dev/fdc/fdc.c  Thu Mar 10 00:33:06 2016(r296589)
@@ -941,7 +941,7 @@ fdc_worker(struct fdc_data *fdc)
/* Disable ISADMA if we bailed while it was active */
if (fd != NULL && (fd->flags & FD_ISADMA)) {
isa_dmadone(
-   bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE,
+   bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE,
fd->fd_ioptr, fd->fd_iosize, fdc->dmachan);
mtx_lock(>fdc_mtx);
fd->flags &= ~FD_ISADMA;
@@ -983,7 +983,7 @@ fdc_worker(struct fdc_data *fdc)
fd = fdc->fd = bp->bio_driver1;
fdc->retry = 0;
fd->fd_ioptr = bp->bio_data;
-   if (bp->bio_cmd & BIO_FMT) {
+   if (bp->bio_cmd == BIO_FMT) {
i = offsetof(struct fd_formb, fd_formb_cylno(0));
fd->fd_ioptr += i;
fd->fd_iosize = bp->bio_length - i;
@@ -1021,7 +1021,7 @@ fdc_worker(struct fdc_data *fdc)
fdctl_wr(fdc, fd->ft->trans);
 #endif
 
-   if (bp->bio_cmd & BIO_PROBE) {
+   if (bp->bio_cmd == BIO_PROBE) {
if ((!(device_get_flags(fd->dev) & FD_NO_CHLINE) &&
 #ifndef PC98
!(fdin_rd(fdc) & FDI_DCHG) &&
@@ -1059,7 +1059,7 @@ fdc_worker(struct fdc_data *fdc)
 #endif
 
/* Check if the floppy is write-protected */
-   if (bp->bio_cmd & (BIO_FMT | BIO_WRITE)) {
+   if (bp->bio_cmd == BIO_FMT || bp->bio_cmd == BIO_WRITE) {
retry_line = __LINE__;
if(fdc_sense_drive(fdc, ) != 0)
return (1);
@@ -1078,10 +1078,11 @@ fdc_worker(struct fdc_data *fdc)
sec = sec % fd->ft->sectrac + 1;
 
/* If everything is going swimmingly, use multisector xfer */
-   if (fdc->retry == 0 && bp->bio_cmd & (BIO_READ|BIO_WRITE)) {
+   if (fdc->retry == 0 &&
+   (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) {
fd->fd_iosize = imin(nsect * fd->sectorsize, bp->bio_resid);
nsect = fd->fd_iosize / fd->sectorsize;
-   } else if (bp->bio_cmd & (BIO_READ|BIO_WRITE)) {
+   } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) {
fd->fd_iosize = fd->sectorsize;
nsect = 1;
}
@@ -1141,10 +1142,12 @@ fdc_worker(struct fdc_data *fdc)
fd->fd_ioptr, fdc->retry);
 
/* Setup ISADMA if we need it and have it */
-   if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_FMT))
+   if ((bp->bio_cmd == BIO_READ ||
+   bp->bio_cmd == BIO_WRITE ||
+   bp->bio_cmd == BIO_FMT)
 && !(fdc->flags & FDC_NODMA)) {
isa_dmastart(
-   bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE,
+   bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE,
fd->fd_ioptr, fd->fd_iosize, fdc->dmachan);
mtx_lock(>fdc_mtx);
fd->flags |= FD_ISADMA;
@@ -1153,9 +1156,12 @@ fdc_worker(struct fdc_data *fdc)
 
/* Do PIO if we have to */
if (fdc->flags & FDC_NODMA) {
-   if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_FMT))
+   if (bp->bio_cmd == BIO_READ ||
+   bp->bio_cmd == BIO_WRITE ||
+   bp->bio_cmd == BIO_FMT)
fdbcdr_wr(fdc, 1, fd->fd_iosize);
-   if (bp->bio_cmd & (BIO_WRITE|BIO_FMT))
+   if (bp->bio_cmd == BIO_WRITE ||
+   bp->bio_cmd == BIO_FMT)
fdc_pio(fdc);
}
 
@@ -1218,13 +1224,13 @@ fdc_worker(struct fdc_data *fdc)
i = tsleep(fdc, PRIBIO, "fddata", hz);
 
/* PIO if the read looks good */
-   if (i == 0 && (fdc->flags & FDC_NODMA) && (bp->bio_cmd & BIO_READ))
+   if (i == 0 && (fdc->flags & FDC_NODMA) && (bp->bio_cmd == BIO_READ))
fdc_pio(fdc);
 
/* Finish DMA */
if (fd->flags & FD_ISADMA) {
isa_dmadone(
-   bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE,
+   bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE,
fd->fd_ioptr, fd->fd_iosize, fdc->dmachan);
mtx_lock(>fdc_mtx);
fd->flags &= ~FD_ISADMA;
@@ -1668,7 +1674,7 @@ fd_start(struct bio *bp)
fd = bp->bio_to->geom->softc;
fdc = fd->fdc;
bp->bio_driver1 = fd;
-   if (bp->bio_cmd & 

Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 9, 2016, at 20:10, Renato Botelho  wrote:
> 
>> On Mar 9, 2016, at 19:47, Jean-Sébastien Pédron  wrote:
>> 
>> On 09/03/2016 16:58, Renato Botelho wrote:
>>> After revert it to r296547 and manually apply ZFS fix I can
>>> successfully load i915kms during boot.
>> 
>> Yeah, I never test to load DRM drivers from /boot/loader.conf. I confirm
>> it doesn't work with Haswell at least. I have no idea how to debug this.
>> 
>> Is it sufficient for you to load the driver from /etc/rc.conf instead?
>> You can try the following line:
>>   kld_list="i915kms"
>> 
>> It achieves the same result, but it's faster to boot and works.
> 
> Didn’t know about it, I’ll start using it and will let you know. Thanks!

It works, thanks!

--
Renato Botelho



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r296588 - head/sys/netinet

2016-03-09 Thread Michael Tuexen
Author: tuexen
Date: Thu Mar 10 00:27:10 2016
New Revision: 296588
URL: https://svnweb.freebsd.org/changeset/base/296588

Log:
  Actually send a asconf chunk, not only queue one.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Wed Mar  9 22:46:01 2016
(r296587)
+++ head/sys/netinet/sctp_usrreq.c  Thu Mar 10 00:27:10 2016
(r296588)
@@ -5862,6 +5862,7 @@ sctp_setopt(struct socket *so, int optna
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
+   sctp_chunk_output(inp, stcb,  
SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
out_of_it:
SCTP_TCB_UNLOCK(stcb);
} else {
___
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: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 9, 2016, at 19:47, Jean-Sébastien Pédron  wrote:
> 
> On 09/03/2016 16:58, Renato Botelho wrote:
>> After revert it to r296547 and manually apply ZFS fix I can
>> successfully load i915kms during boot.
> 
> Yeah, I never test to load DRM drivers from /boot/loader.conf. I confirm
> it doesn't work with Haswell at least. I have no idea how to debug this.
> 
> Is it sufficient for you to load the driver from /etc/rc.conf instead?
> You can try the following line:
>kld_list="i915kms"
> 
> It achieves the same result, but it's faster to boot and works.

Didn’t know about it, I’ll start using it and will let you know. Thanks!

--
Renato Botelho



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r296587 - in head: bin/cat/tests bin/date/tests bin/dd/tests bin/expr/tests bin/ls/tests bin/mv/tests bin/pax/tests bin/pkill/tests bin/sh/tests bin/sh/tests/builtins bin/sh/tests/erro

2016-03-09 Thread Bryan Drewery
On 3/9/2016 2:49 PM, Bryan Drewery wrote:
> git svn dcommit really messed this up despite having diff.renames=false.

I think it was due to having diff.renameLimit=0 in my config as well.
Using dcommit -l1 should avoid this.

I don't think anyone really cares about the history on these files so I
will avoid more spam for fixing it.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r296587 - in head: bin/cat/tests bin/date/tests bin/dd/tests bin/expr/tests bin/ls/tests bin/mv/tests bin/pax/tests bin/pkill/tests bin/sh/tests bin/sh/tests/builtins bin/sh/tests/erro

2016-03-09 Thread Bryan Drewery
On 3/9/2016 2:46 PM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Wed Mar  9 22:46:01 2016
> New Revision: 296587
> URL: https://svnweb.freebsd.org/changeset/base/296587
> 
> Log:
>   DIRDEPS_BUILD: Connect MK_TESTS.
>   
>   Sponsored by:   EMC / Isilon Storage Division
> 
> Added:
>   head/bin/cat/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/date/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/dd/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/expr/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/ls/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/mv/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/pax/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/pkill/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/builtins/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/errors/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/execution/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/expansion/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/parameters/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/parser/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sh/tests/set-e/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/sleep/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/test/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/bin/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/lib/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/sbin/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.bin/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/begin/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/cg/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile.depend
>  - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
>   head/cddl/usr.sbin/dtrace/tests/common/decls/Makefile.depend
>  

Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Jean-Sébastien Pédron
On 09/03/2016 21:48, Adrian Chadd wrote:
> Woo!
> 
> Just so its' not lost - people in irc have found power consumption has
> jumped dramatically since this commit. :(

Ed Maste posted a message to freebsd-x11@ with measurements for those
interested.

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Jean-Sébastien Pédron
On 09/03/2016 16:58, Renato Botelho wrote:
> After revert it to r296547 and manually apply ZFS fix I can
> successfully load i915kms during boot.

Yeah, I never test to load DRM drivers from /boot/loader.conf. I confirm
it doesn't work with Haswell at least. I have no idea how to debug this.

Is it sufficient for you to load the driver from /etc/rc.conf instead?
You can try the following line:
kld_list="i915kms"

It achieves the same result, but it's faster to boot and works.

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


svn commit: r296587 - in head: bin/cat/tests bin/date/tests bin/dd/tests bin/expr/tests bin/ls/tests bin/mv/tests bin/pax/tests bin/pkill/tests bin/sh/tests bin/sh/tests/builtins bin/sh/tests/error...

2016-03-09 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar  9 22:46:01 2016
New Revision: 296587
URL: https://svnweb.freebsd.org/changeset/base/296587

Log:
  DIRDEPS_BUILD: Connect MK_TESTS.
  
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/bin/cat/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/date/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/dd/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/expr/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/ls/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/mv/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/pax/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/pkill/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/builtins/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/errors/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/execution/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/expansion/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/parameters/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/parser/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sh/tests/set-e/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/sleep/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/test/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/bin/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/lib/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/sbin/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.bin/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/begin/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/cg/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/decls/Makefile.depend
 - copied, changed from r296586, head/lib/libcrypt/tests/Makefile.depend
  head/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile.depend
 - copied, changed from r296586, 

svn commit: r296584 - head/share/mk

2016-03-09 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar  9 22:44:48 2016
New Revision: 296584
URL: https://svnweb.freebsd.org/changeset/base/296584

Log:
  DIRDEPS_BUILD: Let PROGS bootstrapping work.
  
  - Support (DP|LIB)ADD_${PROG}.
  - Support SRCS[._]${PROG}.
  - Don't bootstrap DIRDEPS while recursing.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.dirdeps.mk

Modified: head/share/mk/local.dirdeps.mk
==
--- head/share/mk/local.dirdeps.mk  Wed Mar  9 21:50:39 2016
(r296583)
+++ head/share/mk/local.dirdeps.mk  Wed Mar  9 22:44:48 2016
(r296584)
@@ -90,7 +90,8 @@ DIRDEPS += \
 # used will be added in and handled via [local.]gendirdeps.mk.  This is not
 # done for MACHINE=host builds.
 # XXX: Include this in local.autodep.mk as well for gendirdeps without filemon.
-.if ${RELDIR} == ${DEP_RELDIR} # Only do this for main build target
+# Only do this for main build target
+.if ${RELDIR} == ${DEP_RELDIR} && !defined(_RECURSING_PROGS)
 .for _depfile in ${.MAKE.DEPENDFILE_PREFERENCE:T}
 .if !defined(_have_depfile) && exists(${.CURDIR}/${_depfile})
 _have_depfile=
@@ -99,6 +100,35 @@ _have_depfile=
 .if !defined(_have_depfile)
 # KMOD does not use any stdlibs.
 .if !defined(KMOD)
+# Gather PROGS dependencies first
+.if !empty(PROGS)
+_PROGS_LIBADD=
+_PROGS_DPADD=
+_PROGS_SRCS=
+.for _prog in ${PROGS}
+.for s in . _
+.if !empty(LIBADD${s}${_prog})
+_PROGS_LIBADD+=${LIBADD${s}${_prog}}
+.endif
+.if !empty(DPADD${s}${_prog})
+_PROGS_DPADD+= ${DPADD${s}${_prog}}
+.endif
+.if !empty(SRCS${s}${_prog})
+_PROGS_SRCS+=  ${SRCS${s}${_prog}}
+.endif
+.endfor# .for s in . _
+# Add in assumed source (bsd.prog.mk)
+.if !target(${_prog})
+.if defined(PROG_CXX)
+_PROGS_SRCS+=  ${_prog}.cc
+.else
+_PROGS_SRCS+=  ${_prog}.c
+.endif
+.endif # !target(${_prog})
+.endfor# .for _prog in ${PROGS}
+.endif # !empty(PROGS)
+_SRCS= ${SRCS} ${_PROGS_SRCS}
+
 # Has C files. The C_DIRDEPS are shared with C++ files as well.
 C_DIRDEPS= \
gnu/lib/csu \
@@ -118,12 +148,12 @@ C_DIRDEPS= \
 C_DIRDEPS+=  include/gssapi
 .endif
 
-.if !empty(SRCS:M*.c)
+.if !empty(_SRCS:M*.c)
 DIRDEPS+= ${C_DIRDEPS}
 .endif
 # Has C++ files
-.if !empty(SRCS:M*.cc) || !empty(SRCS:M*.C) || !empty(SRCS:M*.cpp) || \
-!empty(SRCS:M*.cxx)
+.if !empty(_SRCS:M*.cc) || !empty(_SRCS:M*.C) || !empty(_SRCS:M*.cpp) || \
+!empty(_SRCS:M*.cxx)
 DIRDEPS+= ${C_DIRDEPS}
 .if ${MK_CLANG} == "yes"
 DIRDEPS+= lib/libc++ lib/libcxxrt
@@ -135,28 +165,15 @@ DIRDEPS+= lib/msun
 .endif # CXX
 .endif # !defined(KMOD)
 # Has yacc files.
-.if !empty(SRCS:M*.y)
+.if !empty(_SRCS:M*.y)
 DIRDEPS+=  usr.bin/yacc.host
 .endif
-# Gather PROGS dependencies
-.if !empty(PROGS)
-_PROGS_LIBADD=
-_PROGS_DPADD=
-.for _prog in ${PROGS}
-.if !empty(LIBADD.${_prog})
-_PROGS_LIBADD+=${LIBADD.${_prog}}
-.endif
-.if !empty(DPADD.${_prog})
-_PROGS_DPADD+= ${DPADD.${_prog}}
-.endif
-.endfor
-.endif # !empty(PROGS)
-.if !empty(DPADD)
+_DPADD= ${DPADD} ${_PROGS_DPADD}
+.if !empty(_DPADD)
 # Taken from meta.autodep.mk (where it only does something with
 # BUILD_AT_LEVEL0, which we don't use).
 # This only works for DPADD with full OBJ/SRC paths, which is mostly just
 # _INTERNALLIBS.
-_DPADD= ${DPADD} ${_PROGS_DPADD}
 _DP_DIRDEPS= \
${_DPADD:O:u:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \

${_DPADD:O:u:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
@@ -165,9 +182,9 @@ _DP_DIRDEPS= \
 DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,}
 .endif
 .endif # !empty(DPADD)
-.if !empty(LIBADD)
-# Also handle LIBADD for non-internal libraries.
 _ALL_LIBADD= ${LIBADD} ${_PROGS_LIBADD}
+.if !empty(_ALL_LIBADD)
+# Also handle LIBADD for non-internal libraries.
 .for _lib in ${_ALL_LIBADD:O:u}
 _lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,}
 .if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \
___
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: r296586 - in head: contrib/netbsd-tests/lib/libc/setjmp etc/mtree lib/libc/tests

2016-03-09 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar  9 22:45:04 2016
New Revision: 296586
URL: https://svnweb.freebsd.org/changeset/base/296586

Log:
  Fix and connect setjmp test.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
  head/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c
  head/etc/mtree/BSD.tests.dist
  head/lib/libc/tests/Makefile

Modified: head/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
==
--- head/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.cWed Mar  9 
22:45:00 2016(r296585)
+++ head/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.cWed Mar  9 
22:45:04 2016(r296586)
@@ -87,7 +87,7 @@ __RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/
 static int expectsignal;
 
 static void
-aborthandler(int signo)
+aborthandler(int signo __unused)
 {
ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded");
atf_tc_pass();

Modified: head/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c
==
--- head/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c Wed Mar  9 
22:45:00 2016(r296585)
+++ head/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c Wed Mar  9 
22:45:04 2016(r296586)
@@ -91,7 +91,7 @@ static pthread_t myself = NULL;
 static int expectsignal;
 
 static void
-aborthandler(int signo)
+aborthandler(int signo __unused)
 {
ATF_REQUIRE(myself == pthread_self());
ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded");

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Wed Mar  9 22:45:00 2016
(r296585)
+++ head/etc/mtree/BSD.tests.dist   Wed Mar  9 22:45:04 2016
(r296586)
@@ -283,6 +283,8 @@
 ..
 ssp
 ..
+setjmp
+..
 stdio
 ..
 stdlib

Modified: head/lib/libc/tests/Makefile
==
--- head/lib/libc/tests/MakefileWed Mar  9 22:45:00 2016
(r296585)
+++ head/lib/libc/tests/MakefileWed Mar  9 22:45:04 2016
(r296586)
@@ -14,6 +14,7 @@ TESTS_SUBDIRS+=   nss
 TESTS_SUBDIRS+=regex
 TESTS_SUBDIRS+=resolv
 TESTS_SUBDIRS+=rpc
+TESTS_SUBDIRS+=setjmp
 TESTS_SUBDIRS+=stdio
 TESTS_SUBDIRS+=stdlib
 TESTS_SUBDIRS+=string
___
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: r296585 - head/share/mk

2016-03-09 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar  9 22:45:00 2016
New Revision: 296585
URL: https://svnweb.freebsd.org/changeset/base/296585

Log:
  These group names may be used as a cookie, so replace any non-fs-safe 
characters.
  
  One example is in cddl/usr.sbin/dtrace/tests/common/aggs.  It could be
  fixed but other uses of this would break, especially in the
  DIRDEPS_BUILD which uses the group names for stage cookies.
  
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.confs.mk
  head/share/mk/bsd.files.mk
  head/share/mk/bsd.incs.mk

Modified: head/share/mk/bsd.confs.mk
==
--- head/share/mk/bsd.confs.mk  Wed Mar  9 22:44:48 2016(r296584)
+++ head/share/mk/bsd.confs.mk  Wed Mar  9 22:45:00 2016(r296585)
@@ -6,8 +6,10 @@
 
 CONFGROUPS?=   CONFS
 
+_CONFGROUPS=   ${CONFGROUPS:C,[/*],_,g}
+
 .if !target(buildconfig)
-.for group in ${CONFGROUPS}
+.for group in ${_CONFGROUPS}
 buildconfig: ${${group}}
 .endfor
 .endif
@@ -17,7 +19,7 @@ all: buildconfig
 .endif
 
 .if !target(installconfig)
-.for group in ${CONFGROUPS}
+.for group in ${_CONFGROUPS}
 .if defined(${group}) && !empty(${group})
 
 ${group}OWN?=  ${SHAREOWN}

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Wed Mar  9 22:44:48 2016(r296584)
+++ head/share/mk/bsd.files.mk  Wed Mar  9 22:45:00 2016(r296585)
@@ -9,7 +9,9 @@ :
 
 FILESGROUPS?=  FILES
 
-.for group in ${FILESGROUPS}
+_FILESGROUPS=  ${FILESGROUPS:C,[/*],_,g}
+
+.for group in ${_FILESGROUPS}
 # Add in foo.yes and remove duplicates from all the groups
 ${${group}}:= ${${group}} ${${group}.yes}
 ${${group}}:= ${${group}:O:u}
@@ -20,7 +22,7 @@ buildfiles: ${${group}}
 all: buildfiles
 .endif
 
-.for group in ${FILESGROUPS}
+.for group in ${_FILESGROUPS}
 .if defined(${group}) && !empty(${group})
 installfiles: installfiles-${group}
 

Modified: head/share/mk/bsd.incs.mk
==
--- head/share/mk/bsd.incs.mk   Wed Mar  9 22:44:48 2016(r296584)
+++ head/share/mk/bsd.incs.mk   Wed Mar  9 22:45:00 2016(r296585)
@@ -8,8 +8,10 @@
 
 INCSGROUPS?=   INCS
 
+_INCSGROUPS=   ${INCSGROUPS:C,[/*],_,g}
+
 .if !target(buildincludes)
-.for group in ${INCSGROUPS}
+.for group in ${_INCSGROUPS}
 buildincludes: ${${group}}
 .endfor
 .endif
@@ -19,7 +21,7 @@ all: buildincludes
 .endif
 
 .if !target(installincludes)
-.for group in ${INCSGROUPS}
+.for group in ${_INCSGROUPS}
 .if defined(${group}) && !empty(${group})
 
 ${group}OWN?=  ${BINOWN}
___
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: r296465 - in releng/9.3: . crypto/openssl crypto/openssl/apps crypto/openssl/bugs crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf cr

2016-03-09 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 03/ 9/16 04:31 PM, Dimitry Andric wrote:
> On 09 Mar 2016, at 21:39, Dimitry Andric  wrote:
>> 
>> On 09 Mar 2016, at 10:16, Xin Li  wrote:
>>> 
>>> FYI -- I can confirm that libcrypto is broken and have a 
>>> reliable way to trigger it.
>>> 
>>> So far I was able to narrow down this to this change and here 
>>> is a temporary workaround (which will reintroduce 
>>> CVE-2016-0702).
>>> 
>>> Cheers, 
>> 
>> FWIW, before the workaround I get this from valgrind:
>> 
>> ==10050== Invalid read of size 8 ==10050==at 0x6BA3438: 
>> MOD_EXP_CTIME_COPY_FROM_PREBUF (bn_exp.c:585) ==10050==by 
>> 0x6BA3438: BN_mod_exp_mont_consttime (bn_exp.c:760) ==10050== by
>>  0x6B84AB7: ??? (dh_key.c:156) ==10050==by 0x4E4550B: 
>> ssh_dh_gen_key (in /usr/lib/private/libssh.so.5) ==10050==by 
>> 0x42AEBF: kexgex_server (kexgexs.c:115) ==10050==by 
>> 0x4E545FE: ssh_kex_input_kexinit (in 
>> /usr/lib/private/libssh.so.5) ==10050==by 0x4E54BBE: 
>> ssh_dispatch_run (in /usr/lib/private/libssh.so.5) ==10050== by 
>> 0x41085C: do_ssh2_kex (sshd.c:2559) ==10050==by 0x41085C: 
>> main (sshd.c:2162) ==10050==  Address 0x2078f3580 is not
>> stack'd, malloc'd or (recently) free'd ==10050== ==10050==
>> ==10050== Process terminating with default action of signal 11
>> (SIGSEGV): dumping core ==10050==  Access not within mapped
>> region at address 0x2078F3580 ==10050==at 0x6BA3438: 
>> MOD_EXP_CTIME_COPY_FROM_PREBUF (bn_exp.c:585) ==10050==by 
>> 0x6BA3438: BN_mod_exp_mont_consttime (bn_exp.c:760) ==10050== by
>>  0x6B84AB7: ??? (dh_key.c:156) ==10050==by 0x4E4550B: 
>> ssh_dh_gen_key (in /usr/lib/private/libssh.so.5) ==10050==by 
>> 0x42AEBF: kexgex_server (kexgexs.c:115) ==10050==by 
>> 0x4E545FE: ssh_kex_input_kexinit (in 
>> /usr/lib/private/libssh.so.5) ==10050==by 0x4E54BBE: 
>> ssh_dispatch_run (in /usr/lib/private/libssh.so.5) ==10050== by 
>> 0x41085C: do_ssh2_kex (sshd.c:2559) ==10050==by 0x41085C: 
>> main (sshd.c:2162) ==10050==  If you believe this happened as a 
>> result of a stack ==10050==  overflow in your program's main 
>> thread (unlikely but ==10050==  possible), you can try to 
>> increase the size of the ==10050==  main thread stack using the 
>> --main-stacksize= flag. ==10050==  The main thread stack size 
>> used in this run was 16777216.
> 
> I think this is a possible fix (it works for me, at least):
> 
> Index: crypto/openssl/crypto/bn/bn_exp.c 
> ===
>
>
>
>
> 
- --- crypto/openssl/crypto/bn/bn_exp.c   (revision 296469)
> +++ crypto/openssl/crypto/bn/bn_exp.c   (working copy) @@ -758,7 
> +758,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BI * 
> Fetch the appropriate pre-computed value from the pre-buf */ if 
> (!MOD_EXP_CTIME_COPY_FROM_PREBUF -(computeTemp, top, 
> powerbuf, wvalue, numPowers)) +(computeTemp, top, 
> powerbuf, wvalue, window)) goto err;
> 
> /* Multiply the result into the intermediate result */
> 
> Can people experiencing this problem please apply the above diff to
> their openssl, rebuild secure/lib/libcrypto, install it, then 
> restart sshd and/or whatever daemon you have seen the crashes 
> with?

[My PC had multiple PSU failures and I just recovered from the
disaster.  I am very sorry for the late response.]

I haven't tested it but it looks correct.  I don't know how I missed
it in the first place. :-(

JK
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJW4KFSAAoJEHyflib82/FGGt8H/iaaxbks7copI9O4oCs229RG
UlLxx1XsrYkdStEqJHg4OXgXr6kIdkSpBBJjYs3DlOFKL5Vin0PTenfDV0i0a0/l
MbawMhWX6xhNaUKSHVguXJeGZUGT4pYQe6pZoZYT2ZrAq5eEavk/y0qlwPK4xV50
A/xXsfgLGwruMZjJ4JJ7N4CZMByyKu7jAhnveDFS3A87HOve48HEGpHY/UDmWvZ1
t1JX0e7ZCO+frHAwYdBkMG9w4ozQ26PjGTyJuL/852GORaxt+5kZ4Uj2/jLjxIIj
pnFJ1CrzjFKqX3+03QaOi+hFlBPyQ/CMyMg03fO5MQqTys3ehObujRmfE1mhCZs=
=KShP
-END PGP SIGNATURE-
___
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: r296465 - in releng/9.3: . crypto/openssl crypto/openssl/apps crypto/openssl/bugs crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf cr

2016-03-09 Thread Dimitry Andric
On 09 Mar 2016, at 10:16, Xin Li  wrote:
> 
> FYI -- I can confirm that libcrypto is broken and have a reliable way to
> trigger it.
> 
> So far I was able to narrow down this to this change and here is a
> temporary workaround (which will reintroduce CVE-2016-0702).
> 
> Cheers,
> 

FWIW, before the workaround I get this from valgrind:

==10050== Invalid read of size 8
==10050==at 0x6BA3438: MOD_EXP_CTIME_COPY_FROM_PREBUF (bn_exp.c:585)
==10050==by 0x6BA3438: BN_mod_exp_mont_consttime (bn_exp.c:760)
==10050==by 0x6B84AB7: ??? (dh_key.c:156)
==10050==by 0x4E4550B: ssh_dh_gen_key (in /usr/lib/private/libssh.so.5)
==10050==by 0x42AEBF: kexgex_server (kexgexs.c:115)
==10050==by 0x4E545FE: ssh_kex_input_kexinit (in 
/usr/lib/private/libssh.so.5)
==10050==by 0x4E54BBE: ssh_dispatch_run (in /usr/lib/private/libssh.so.5)
==10050==by 0x41085C: do_ssh2_kex (sshd.c:2559)
==10050==by 0x41085C: main (sshd.c:2162)
==10050==  Address 0x2078f3580 is not stack'd, malloc'd or (recently) free'd
==10050==
==10050==
==10050== Process terminating with default action of signal 11 (SIGSEGV): 
dumping core
==10050==  Access not within mapped region at address 0x2078F3580
==10050==at 0x6BA3438: MOD_EXP_CTIME_COPY_FROM_PREBUF (bn_exp.c:585)
==10050==by 0x6BA3438: BN_mod_exp_mont_consttime (bn_exp.c:760)
==10050==by 0x6B84AB7: ??? (dh_key.c:156)
==10050==by 0x4E4550B: ssh_dh_gen_key (in /usr/lib/private/libssh.so.5)
==10050==by 0x42AEBF: kexgex_server (kexgexs.c:115)
==10050==by 0x4E545FE: ssh_kex_input_kexinit (in 
/usr/lib/private/libssh.so.5)
==10050==by 0x4E54BBE: ssh_dispatch_run (in /usr/lib/private/libssh.so.5)
==10050==by 0x41085C: do_ssh2_kex (sshd.c:2559)
==10050==by 0x41085C: main (sshd.c:2162)
==10050==  If you believe this happened as a result of a stack
==10050==  overflow in your program's main thread (unlikely but
==10050==  possible), you can try to increase the size of the
==10050==  main thread stack using the --main-stacksize= flag.
==10050==  The main thread stack size used in this run was 16777216.

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r296465 - in releng/9.3: . crypto/openssl crypto/openssl/apps crypto/openssl/bugs crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf cr

2016-03-09 Thread Dimitry Andric
On 09 Mar 2016, at 21:39, Dimitry Andric  wrote:
> 
> On 09 Mar 2016, at 10:16, Xin Li  wrote:
>> 
>> FYI -- I can confirm that libcrypto is broken and have a reliable way to
>> trigger it.
>> 
>> So far I was able to narrow down this to this change and here is a
>> temporary workaround (which will reintroduce CVE-2016-0702).
>> 
>> Cheers,
>> 
> 
> FWIW, before the workaround I get this from valgrind:
> 
> ==10050== Invalid read of size 8
> ==10050==at 0x6BA3438: MOD_EXP_CTIME_COPY_FROM_PREBUF (bn_exp.c:585)
> ==10050==by 0x6BA3438: BN_mod_exp_mont_consttime (bn_exp.c:760)
> ==10050==by 0x6B84AB7: ??? (dh_key.c:156)
> ==10050==by 0x4E4550B: ssh_dh_gen_key (in /usr/lib/private/libssh.so.5)
> ==10050==by 0x42AEBF: kexgex_server (kexgexs.c:115)
> ==10050==by 0x4E545FE: ssh_kex_input_kexinit (in 
> /usr/lib/private/libssh.so.5)
> ==10050==by 0x4E54BBE: ssh_dispatch_run (in /usr/lib/private/libssh.so.5)
> ==10050==by 0x41085C: do_ssh2_kex (sshd.c:2559)
> ==10050==by 0x41085C: main (sshd.c:2162)
> ==10050==  Address 0x2078f3580 is not stack'd, malloc'd or (recently) free'd
> ==10050==
> ==10050==
> ==10050== Process terminating with default action of signal 11 (SIGSEGV): 
> dumping core
> ==10050==  Access not within mapped region at address 0x2078F3580
> ==10050==at 0x6BA3438: MOD_EXP_CTIME_COPY_FROM_PREBUF (bn_exp.c:585)
> ==10050==by 0x6BA3438: BN_mod_exp_mont_consttime (bn_exp.c:760)
> ==10050==by 0x6B84AB7: ??? (dh_key.c:156)
> ==10050==by 0x4E4550B: ssh_dh_gen_key (in /usr/lib/private/libssh.so.5)
> ==10050==by 0x42AEBF: kexgex_server (kexgexs.c:115)
> ==10050==by 0x4E545FE: ssh_kex_input_kexinit (in 
> /usr/lib/private/libssh.so.5)
> ==10050==by 0x4E54BBE: ssh_dispatch_run (in /usr/lib/private/libssh.so.5)
> ==10050==by 0x41085C: do_ssh2_kex (sshd.c:2559)
> ==10050==by 0x41085C: main (sshd.c:2162)
> ==10050==  If you believe this happened as a result of a stack
> ==10050==  overflow in your program's main thread (unlikely but
> ==10050==  possible), you can try to increase the size of the
> ==10050==  main thread stack using the --main-stacksize= flag.
> ==10050==  The main thread stack size used in this run was 16777216.

I think this is a possible fix (it works for me, at least):

Index: crypto/openssl/crypto/bn/bn_exp.c
===
--- crypto/openssl/crypto/bn/bn_exp.c   (revision 296469)
+++ crypto/openssl/crypto/bn/bn_exp.c   (working copy)
@@ -758,7 +758,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BI
  * Fetch the appropriate pre-computed value from the pre-buf
  */
 if (!MOD_EXP_CTIME_COPY_FROM_PREBUF
-(computeTemp, top, powerbuf, wvalue, numPowers))
+(computeTemp, top, powerbuf, wvalue, window))
 goto err;

 /* Multiply the result into the intermediate result */

Can people experiencing this problem please apply the above diff to
their openssl, rebuild secure/lib/libcrypto, install it, then restart
sshd and/or whatever daemon you have seen the crashes with?

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r296583 - in stable/7/sys: dev/bxe modules/bxe

2016-03-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Mar  9 21:50:39 2016
New Revision: 296583
URL: https://svnweb.freebsd.org/changeset/base/296583

Log:
  MFC r296071
  Upgrade the firmware carried in driver and loaded during hardware
  initialization (a.k.a STORM firmware) to version 7.13.1 (latest version)

Modified:
  stable/7/sys/dev/bxe/57710_init_values.c
  stable/7/sys/dev/bxe/57710_int_offsets.h
  stable/7/sys/dev/bxe/57711_init_values.c
  stable/7/sys/dev/bxe/57711_int_offsets.h
  stable/7/sys/dev/bxe/57712_init_values.c
  stable/7/sys/dev/bxe/57712_int_offsets.h
  stable/7/sys/dev/bxe/bxe.c
  stable/7/sys/dev/bxe/bxe.h
  stable/7/sys/dev/bxe/bxe_elink.c
  stable/7/sys/dev/bxe/bxe_elink.h
  stable/7/sys/dev/bxe/bxe_stats.c
  stable/7/sys/dev/bxe/ecore_fw_defs.h
  stable/7/sys/dev/bxe/ecore_hsi.h
  stable/7/sys/dev/bxe/ecore_init.h
  stable/7/sys/dev/bxe/ecore_init_ops.h
  stable/7/sys/dev/bxe/ecore_mfw_req.h
  stable/7/sys/dev/bxe/ecore_reg.h
  stable/7/sys/dev/bxe/ecore_sp.c
  stable/7/sys/dev/bxe/ecore_sp.h
  stable/7/sys/modules/bxe/Makefile
Directory Properties:
  stable/7/   (props changed)
  stable/7/sys/   (props changed)

Modified: stable/7/sys/dev/bxe/57710_init_values.c
==
--- stable/7/sys/dev/bxe/57710_init_values.cWed Mar  9 21:45:09 2016
(r296582)
+++ stable/7/sys/dev/bxe/57710_init_values.cWed Mar  9 21:50:39 2016
(r296583)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -11,7 +11,7 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
@@ -104,19 +104,19 @@ static const struct raw_op init_ops_e1[]
 /* #define CFC_COMMON_START88 */
{OP_ZR, 0x104c00, 0x100},
{OP_WR, 0x104028, 0x10},
-   {OP_WR, 0x104044, 0x3fff},
+   {OP_SW, 0x104040, 0x20469},
{OP_WR, 0x104058, 0x28},
{OP_WR, 0x104084, 0x84924a},
{OP_WR, 0x104058, 0x0},
 /* #define CFC_COMMON_END  89 */
 /* #define CSDM_COMMON_START110 */
-   {OP_SW, 0xc2008, 0x30469},
-   {OP_SW, 0xc201c, 0x4046c},
-   {OP_SW, 0xc2038, 0x110470},
+   {OP_SW, 0xc2008, 0x3046b},
+   {OP_SW, 0xc201c, 0x4046e},
+   {OP_SW, 0xc2038, 0x110472},
{OP_ZR, 0xc207c, 0x4f},
-   {OP_SW, 0xc21b8, 0x110481},
+   {OP_SW, 0xc21b8, 0x110483},
{OP_ZR, 0xc21fc, 0xf},
-   {OP_SW, 0xc2238, 0x40492},
+   {OP_SW, 0xc2238, 0x40494},
{OP_RD, 0xc2248, 0x0},
{OP_RD, 0xc224c, 0x0},
{OP_RD, 0xc2250, 0x0},
@@ -141,76 +141,76 @@ static const struct raw_op init_ops_e1[]
 /* #define CSDM_COMMON_END  111 */
 /* #define CSEM_COMMON_START132 */
{OP_FW, 0x200400, 0xe0},
-   {OP_WR_64, 0x200780, 0x100496},
+   {OP_WR_64, 0x200780, 0x100498},
{OP_ZR, 0x22, 0x1600},
{OP_ZR, 0x228000, 0x40},
{OP_ZR, 0x223bd0, 0x8},
{OP_ZR, 0x224800, 0x6},
-   {OP_SW, 0x224818, 0x40498},
+   {OP_SW, 0x224818, 0x4049a},
{OP_ZR, 0x224828, 0xc},
-   {OP_SW, 0x224858, 0x4049c},
+   {OP_SW, 0x224858, 0x4049e},
{OP_ZR, 0x224868, 0xc},
-   {OP_SW, 0x224898, 0x404a0},
+   {OP_SW, 0x224898, 0x404a2},
{OP_ZR, 0x2248a8, 0xc},
-   {OP_SW, 0x2248d8, 0x404a4},
+   {OP_SW, 0x2248d8, 0x404a6},
{OP_ZR, 0x2248e8, 0xc},
-   {OP_SW, 0x224918, 0x404a8},
+   {OP_SW, 0x224918, 0x404aa},
{OP_ZR, 0x224928, 0xc},
-   {OP_SW, 0x224958, 0x404ac},
+   {OP_SW, 0x224958, 0x404ae},
{OP_ZR, 0x224968, 0xc},
-   {OP_SW, 0x224998, 0x404b0},
+   {OP_SW, 0x224998, 0x404b2},
{OP_ZR, 0x2249a8, 0xc},
-   {OP_SW, 0x2249d8, 0x404b4},
+   {OP_SW, 0x2249d8, 0x404b6},
{OP_ZR, 0x2249e8, 0xc},
-   {OP_SW, 0x224a18, 0x404b8},
+   {OP_SW, 0x224a18, 0x404ba},
{OP_ZR, 0x224a28, 0xc},
-   {OP_SW, 0x224a58, 0x404bc},
+   {OP_SW, 0x224a58, 0x404be},
{OP_ZR, 0x224a68, 0xc},
-   {OP_SW, 0x224a98, 0x404c0},
+   {OP_SW, 0x224a98, 0x404c2},
{OP_ZR, 0x224aa8, 0xc},
-   {OP_SW, 0x224ad8, 0x404c4},
+   {OP_SW, 0x224ad8, 0x404c6},
{OP_ZR, 0x224ae8, 0xc},
-   {OP_SW, 0x224b18, 0x404c8},
+   {OP_SW, 0x224b18, 0x404ca},
{OP_ZR, 

svn commit: r296582 - in stable/8/sys: dev/bxe modules/bxe

2016-03-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Mar  9 21:45:09 2016
New Revision: 296582
URL: https://svnweb.freebsd.org/changeset/base/296582

Log:
  MFC r296071
  Upgrade the firmware carried in driver and loaded during hardware
  initialization (a.k.a STORM firmware) to version 7.13.1 (latest version)

Modified:
  stable/8/sys/dev/bxe/57710_init_values.c
  stable/8/sys/dev/bxe/57710_int_offsets.h
  stable/8/sys/dev/bxe/57711_init_values.c
  stable/8/sys/dev/bxe/57711_int_offsets.h
  stable/8/sys/dev/bxe/57712_init_values.c
  stable/8/sys/dev/bxe/57712_int_offsets.h
  stable/8/sys/dev/bxe/bxe.c
  stable/8/sys/dev/bxe/bxe.h
  stable/8/sys/dev/bxe/bxe_elink.c
  stable/8/sys/dev/bxe/bxe_elink.h
  stable/8/sys/dev/bxe/bxe_stats.c
  stable/8/sys/dev/bxe/ecore_fw_defs.h
  stable/8/sys/dev/bxe/ecore_hsi.h
  stable/8/sys/dev/bxe/ecore_init.h
  stable/8/sys/dev/bxe/ecore_init_ops.h
  stable/8/sys/dev/bxe/ecore_mfw_req.h
  stable/8/sys/dev/bxe/ecore_reg.h
  stable/8/sys/dev/bxe/ecore_sp.c
  stable/8/sys/dev/bxe/ecore_sp.h
  stable/8/sys/modules/bxe/Makefile
Directory Properties:
  stable/8/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/modules/   (props changed)

Modified: stable/8/sys/dev/bxe/57710_init_values.c
==
--- stable/8/sys/dev/bxe/57710_init_values.cWed Mar  9 21:40:00 2016
(r296581)
+++ stable/8/sys/dev/bxe/57710_init_values.cWed Mar  9 21:45:09 2016
(r296582)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -11,7 +11,7 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
@@ -104,19 +104,19 @@ static const struct raw_op init_ops_e1[]
 /* #define CFC_COMMON_START88 */
{OP_ZR, 0x104c00, 0x100},
{OP_WR, 0x104028, 0x10},
-   {OP_WR, 0x104044, 0x3fff},
+   {OP_SW, 0x104040, 0x20469},
{OP_WR, 0x104058, 0x28},
{OP_WR, 0x104084, 0x84924a},
{OP_WR, 0x104058, 0x0},
 /* #define CFC_COMMON_END  89 */
 /* #define CSDM_COMMON_START110 */
-   {OP_SW, 0xc2008, 0x30469},
-   {OP_SW, 0xc201c, 0x4046c},
-   {OP_SW, 0xc2038, 0x110470},
+   {OP_SW, 0xc2008, 0x3046b},
+   {OP_SW, 0xc201c, 0x4046e},
+   {OP_SW, 0xc2038, 0x110472},
{OP_ZR, 0xc207c, 0x4f},
-   {OP_SW, 0xc21b8, 0x110481},
+   {OP_SW, 0xc21b8, 0x110483},
{OP_ZR, 0xc21fc, 0xf},
-   {OP_SW, 0xc2238, 0x40492},
+   {OP_SW, 0xc2238, 0x40494},
{OP_RD, 0xc2248, 0x0},
{OP_RD, 0xc224c, 0x0},
{OP_RD, 0xc2250, 0x0},
@@ -141,76 +141,76 @@ static const struct raw_op init_ops_e1[]
 /* #define CSDM_COMMON_END  111 */
 /* #define CSEM_COMMON_START132 */
{OP_FW, 0x200400, 0xe0},
-   {OP_WR_64, 0x200780, 0x100496},
+   {OP_WR_64, 0x200780, 0x100498},
{OP_ZR, 0x22, 0x1600},
{OP_ZR, 0x228000, 0x40},
{OP_ZR, 0x223bd0, 0x8},
{OP_ZR, 0x224800, 0x6},
-   {OP_SW, 0x224818, 0x40498},
+   {OP_SW, 0x224818, 0x4049a},
{OP_ZR, 0x224828, 0xc},
-   {OP_SW, 0x224858, 0x4049c},
+   {OP_SW, 0x224858, 0x4049e},
{OP_ZR, 0x224868, 0xc},
-   {OP_SW, 0x224898, 0x404a0},
+   {OP_SW, 0x224898, 0x404a2},
{OP_ZR, 0x2248a8, 0xc},
-   {OP_SW, 0x2248d8, 0x404a4},
+   {OP_SW, 0x2248d8, 0x404a6},
{OP_ZR, 0x2248e8, 0xc},
-   {OP_SW, 0x224918, 0x404a8},
+   {OP_SW, 0x224918, 0x404aa},
{OP_ZR, 0x224928, 0xc},
-   {OP_SW, 0x224958, 0x404ac},
+   {OP_SW, 0x224958, 0x404ae},
{OP_ZR, 0x224968, 0xc},
-   {OP_SW, 0x224998, 0x404b0},
+   {OP_SW, 0x224998, 0x404b2},
{OP_ZR, 0x2249a8, 0xc},
-   {OP_SW, 0x2249d8, 0x404b4},
+   {OP_SW, 0x2249d8, 0x404b6},
{OP_ZR, 0x2249e8, 0xc},
-   {OP_SW, 0x224a18, 0x404b8},
+   {OP_SW, 0x224a18, 0x404ba},
{OP_ZR, 0x224a28, 0xc},
-   {OP_SW, 0x224a58, 0x404bc},
+   {OP_SW, 0x224a58, 0x404be},
{OP_ZR, 0x224a68, 0xc},
-   {OP_SW, 0x224a98, 0x404c0},
+   {OP_SW, 0x224a98, 0x404c2},
{OP_ZR, 0x224aa8, 0xc},
-   {OP_SW, 0x224ad8, 0x404c4},
+   {OP_SW, 0x224ad8, 0x404c6},
{OP_ZR, 0x224ae8, 0xc},
-   

svn commit: r296581 - in stable/9/sys: dev/bxe modules/bxe

2016-03-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Mar  9 21:40:00 2016
New Revision: 296581
URL: https://svnweb.freebsd.org/changeset/base/296581

Log:
  MFC r296071
Upgrade the firmware carried in driver and loaded during hardware
initialization (a.k.a STORM firmware) to version 7.13.1 (latest version)

Modified:
  stable/9/sys/dev/bxe/57710_init_values.c
  stable/9/sys/dev/bxe/57710_int_offsets.h
  stable/9/sys/dev/bxe/57711_init_values.c
  stable/9/sys/dev/bxe/57711_int_offsets.h
  stable/9/sys/dev/bxe/57712_init_values.c
  stable/9/sys/dev/bxe/57712_int_offsets.h
  stable/9/sys/dev/bxe/bxe.c
  stable/9/sys/dev/bxe/bxe.h
  stable/9/sys/dev/bxe/bxe_elink.c
  stable/9/sys/dev/bxe/bxe_elink.h
  stable/9/sys/dev/bxe/bxe_stats.c
  stable/9/sys/dev/bxe/ecore_fw_defs.h
  stable/9/sys/dev/bxe/ecore_hsi.h
  stable/9/sys/dev/bxe/ecore_init.h
  stable/9/sys/dev/bxe/ecore_init_ops.h
  stable/9/sys/dev/bxe/ecore_mfw_req.h
  stable/9/sys/dev/bxe/ecore_reg.h
  stable/9/sys/dev/bxe/ecore_sp.c
  stable/9/sys/dev/bxe/ecore_sp.h
  stable/9/sys/modules/bxe/Makefile
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/dev/bxe/57710_init_values.c
==
--- stable/9/sys/dev/bxe/57710_init_values.cWed Mar  9 21:30:21 2016
(r296580)
+++ stable/9/sys/dev/bxe/57710_init_values.cWed Mar  9 21:40:00 2016
(r296581)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -11,7 +11,7 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
@@ -104,19 +104,19 @@ static const struct raw_op init_ops_e1[]
 /* #define CFC_COMMON_START88 */
{OP_ZR, 0x104c00, 0x100},
{OP_WR, 0x104028, 0x10},
-   {OP_WR, 0x104044, 0x3fff},
+   {OP_SW, 0x104040, 0x20469},
{OP_WR, 0x104058, 0x28},
{OP_WR, 0x104084, 0x84924a},
{OP_WR, 0x104058, 0x0},
 /* #define CFC_COMMON_END  89 */
 /* #define CSDM_COMMON_START110 */
-   {OP_SW, 0xc2008, 0x30469},
-   {OP_SW, 0xc201c, 0x4046c},
-   {OP_SW, 0xc2038, 0x110470},
+   {OP_SW, 0xc2008, 0x3046b},
+   {OP_SW, 0xc201c, 0x4046e},
+   {OP_SW, 0xc2038, 0x110472},
{OP_ZR, 0xc207c, 0x4f},
-   {OP_SW, 0xc21b8, 0x110481},
+   {OP_SW, 0xc21b8, 0x110483},
{OP_ZR, 0xc21fc, 0xf},
-   {OP_SW, 0xc2238, 0x40492},
+   {OP_SW, 0xc2238, 0x40494},
{OP_RD, 0xc2248, 0x0},
{OP_RD, 0xc224c, 0x0},
{OP_RD, 0xc2250, 0x0},
@@ -141,76 +141,76 @@ static const struct raw_op init_ops_e1[]
 /* #define CSDM_COMMON_END  111 */
 /* #define CSEM_COMMON_START132 */
{OP_FW, 0x200400, 0xe0},
-   {OP_WR_64, 0x200780, 0x100496},
+   {OP_WR_64, 0x200780, 0x100498},
{OP_ZR, 0x22, 0x1600},
{OP_ZR, 0x228000, 0x40},
{OP_ZR, 0x223bd0, 0x8},
{OP_ZR, 0x224800, 0x6},
-   {OP_SW, 0x224818, 0x40498},
+   {OP_SW, 0x224818, 0x4049a},
{OP_ZR, 0x224828, 0xc},
-   {OP_SW, 0x224858, 0x4049c},
+   {OP_SW, 0x224858, 0x4049e},
{OP_ZR, 0x224868, 0xc},
-   {OP_SW, 0x224898, 0x404a0},
+   {OP_SW, 0x224898, 0x404a2},
{OP_ZR, 0x2248a8, 0xc},
-   {OP_SW, 0x2248d8, 0x404a4},
+   {OP_SW, 0x2248d8, 0x404a6},
{OP_ZR, 0x2248e8, 0xc},
-   {OP_SW, 0x224918, 0x404a8},
+   {OP_SW, 0x224918, 0x404aa},
{OP_ZR, 0x224928, 0xc},
-   {OP_SW, 0x224958, 0x404ac},
+   {OP_SW, 0x224958, 0x404ae},
{OP_ZR, 0x224968, 0xc},
-   {OP_SW, 0x224998, 0x404b0},
+   {OP_SW, 0x224998, 0x404b2},
{OP_ZR, 0x2249a8, 0xc},
-   {OP_SW, 0x2249d8, 0x404b4},
+   {OP_SW, 0x2249d8, 0x404b6},
{OP_ZR, 0x2249e8, 0xc},
-   {OP_SW, 0x224a18, 0x404b8},
+   {OP_SW, 0x224a18, 0x404ba},
{OP_ZR, 0x224a28, 0xc},
-   {OP_SW, 0x224a58, 0x404bc},
+   {OP_SW, 0x224a58, 0x404be},
{OP_ZR, 0x224a68, 0xc},
-   {OP_SW, 0x224a98, 0x404c0},
+   {OP_SW, 0x224a98, 0x404c2},
{OP_ZR, 0x224aa8, 0xc},
-   {OP_SW, 0x224ad8, 0x404c4},
+   {OP_SW, 0x224ad8, 0x404c6},
{OP_ZR, 0x224ae8, 0xc},
-   

svn commit: r296580 - in stable/10/sys: dev/bxe modules/bxe

2016-03-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Mar  9 21:30:21 2016
New Revision: 296580
URL: https://svnweb.freebsd.org/changeset/base/296580

Log:
  MFC r296071
  Upgrade the firmware carried in driver and loaded during hardware
  initialization (a.k.a STORM firmware) to version 7.13.1 (latest version)

Modified:
  stable/10/sys/dev/bxe/57710_init_values.c
  stable/10/sys/dev/bxe/57710_int_offsets.h
  stable/10/sys/dev/bxe/57711_init_values.c
  stable/10/sys/dev/bxe/57711_int_offsets.h
  stable/10/sys/dev/bxe/57712_init_values.c
  stable/10/sys/dev/bxe/57712_int_offsets.h
  stable/10/sys/dev/bxe/bxe.c
  stable/10/sys/dev/bxe/bxe.h
  stable/10/sys/dev/bxe/bxe_elink.c
  stable/10/sys/dev/bxe/bxe_elink.h
  stable/10/sys/dev/bxe/bxe_stats.c
  stable/10/sys/dev/bxe/ecore_fw_defs.h
  stable/10/sys/dev/bxe/ecore_hsi.h
  stable/10/sys/dev/bxe/ecore_init.h
  stable/10/sys/dev/bxe/ecore_init_ops.h
  stable/10/sys/dev/bxe/ecore_mfw_req.h
  stable/10/sys/dev/bxe/ecore_reg.h
  stable/10/sys/dev/bxe/ecore_sp.c
  stable/10/sys/dev/bxe/ecore_sp.h
  stable/10/sys/modules/bxe/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/bxe/57710_init_values.c
==
--- stable/10/sys/dev/bxe/57710_init_values.c   Wed Mar  9 21:12:26 2016
(r296579)
+++ stable/10/sys/dev/bxe/57710_init_values.c   Wed Mar  9 21:30:21 2016
(r296580)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -11,7 +11,7 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
@@ -104,19 +104,19 @@ static const struct raw_op init_ops_e1[]
 /* #define CFC_COMMON_START88 */
{OP_ZR, 0x104c00, 0x100},
{OP_WR, 0x104028, 0x10},
-   {OP_WR, 0x104044, 0x3fff},
+   {OP_SW, 0x104040, 0x20469},
{OP_WR, 0x104058, 0x28},
{OP_WR, 0x104084, 0x84924a},
{OP_WR, 0x104058, 0x0},
 /* #define CFC_COMMON_END  89 */
 /* #define CSDM_COMMON_START110 */
-   {OP_SW, 0xc2008, 0x30469},
-   {OP_SW, 0xc201c, 0x4046c},
-   {OP_SW, 0xc2038, 0x110470},
+   {OP_SW, 0xc2008, 0x3046b},
+   {OP_SW, 0xc201c, 0x4046e},
+   {OP_SW, 0xc2038, 0x110472},
{OP_ZR, 0xc207c, 0x4f},
-   {OP_SW, 0xc21b8, 0x110481},
+   {OP_SW, 0xc21b8, 0x110483},
{OP_ZR, 0xc21fc, 0xf},
-   {OP_SW, 0xc2238, 0x40492},
+   {OP_SW, 0xc2238, 0x40494},
{OP_RD, 0xc2248, 0x0},
{OP_RD, 0xc224c, 0x0},
{OP_RD, 0xc2250, 0x0},
@@ -141,76 +141,76 @@ static const struct raw_op init_ops_e1[]
 /* #define CSDM_COMMON_END  111 */
 /* #define CSEM_COMMON_START132 */
{OP_FW, 0x200400, 0xe0},
-   {OP_WR_64, 0x200780, 0x100496},
+   {OP_WR_64, 0x200780, 0x100498},
{OP_ZR, 0x22, 0x1600},
{OP_ZR, 0x228000, 0x40},
{OP_ZR, 0x223bd0, 0x8},
{OP_ZR, 0x224800, 0x6},
-   {OP_SW, 0x224818, 0x40498},
+   {OP_SW, 0x224818, 0x4049a},
{OP_ZR, 0x224828, 0xc},
-   {OP_SW, 0x224858, 0x4049c},
+   {OP_SW, 0x224858, 0x4049e},
{OP_ZR, 0x224868, 0xc},
-   {OP_SW, 0x224898, 0x404a0},
+   {OP_SW, 0x224898, 0x404a2},
{OP_ZR, 0x2248a8, 0xc},
-   {OP_SW, 0x2248d8, 0x404a4},
+   {OP_SW, 0x2248d8, 0x404a6},
{OP_ZR, 0x2248e8, 0xc},
-   {OP_SW, 0x224918, 0x404a8},
+   {OP_SW, 0x224918, 0x404aa},
{OP_ZR, 0x224928, 0xc},
-   {OP_SW, 0x224958, 0x404ac},
+   {OP_SW, 0x224958, 0x404ae},
{OP_ZR, 0x224968, 0xc},
-   {OP_SW, 0x224998, 0x404b0},
+   {OP_SW, 0x224998, 0x404b2},
{OP_ZR, 0x2249a8, 0xc},
-   {OP_SW, 0x2249d8, 0x404b4},
+   {OP_SW, 0x2249d8, 0x404b6},
{OP_ZR, 0x2249e8, 0xc},
-   {OP_SW, 0x224a18, 0x404b8},
+   {OP_SW, 0x224a18, 0x404ba},
{OP_ZR, 0x224a28, 0xc},
-   {OP_SW, 0x224a58, 0x404bc},
+   {OP_SW, 0x224a58, 0x404be},
{OP_ZR, 0x224a68, 0xc},
-   {OP_SW, 0x224a98, 0x404c0},
+   {OP_SW, 0x224a98, 0x404c2},
{OP_ZR, 0x224aa8, 0xc},
-   {OP_SW, 0x224ad8, 0x404c4},
+   {OP_SW, 0x224ad8, 0x404c6},
{OP_ZR, 0x224ae8, 0xc},
-   {OP_SW, 0x224b18, 0x404c8},
+   {OP_SW, 0x224b18, 0x404ca},
{OP_ZR, 0x224b28, 0xc},

svn commit: r296579 - head/sys/dev/bxe

2016-03-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Mar  9 21:12:26 2016
New Revision: 296579
URL: https://svnweb.freebsd.org/changeset/base/296579

Log:
  Fix code so that buf_ring allocation for Tx Queues and their mutexes
  is done during during bxe_attach() and freed during bxe_detach()
  
  MFC after: 5 days

Modified:
  head/sys/dev/bxe/bxe.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Mar  9 21:05:21 2016(r296578)
+++ head/sys/dev/bxe/bxe.c  Wed Mar  9 21:12:26 2016(r296579)
@@ -669,6 +669,8 @@ static void bxe_handle_fp_tq(void *conte
 static int bxe_add_cdev(struct bxe_softc *sc);
 static void bxe_del_cdev(struct bxe_softc *sc);
 static int bxe_grc_dump(struct bxe_softc *sc);
+static int bxe_alloc_buf_rings(struct bxe_softc *sc);
+static void bxe_free_buf_rings(struct bxe_softc *sc);
 
 /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */
 uint32_t
@@ -4193,9 +4195,20 @@ bxe_nic_unload(struct bxe_softc *sc,
 {
 uint8_t global = FALSE;
 uint32_t val;
+int i;
 
 BXE_CORE_LOCK_ASSERT(sc);
 
+if_setdrvflagbits(sc->ifp, 0, IFF_DRV_RUNNING);
+
+for (i = 0; i < sc->num_queues; i++) {
+struct bxe_fastpath *fp;
+
+fp = >fp[i];
+BXE_FP_TX_LOCK(fp);
+BXE_FP_TX_UNLOCK(fp);
+}
+
 BLOGD(sc, DBG_LOAD, "Starting NIC unload...\n");
 
 /* mark driver as unloaded in shmem2 */
@@ -5726,7 +5739,7 @@ bxe_tx_mq_start_locked(struct bxe_softc 
 }
 
 if (!sc->link_vars.link_up ||
-(ifp->if_drv_flags &
+(if_getdrvflags(ifp) &
 (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) {
 rc = drbr_enqueue_drv(ifp, tx_br, m);
 goto bxe_tx_mq_start_locked_exit;
@@ -6239,8 +6252,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc
 m_freem(m);
 BXE_FP_TX_UNLOCK(fp);
 }
-buf_ring_free(fp->tx_br, M_DEVBUF);
-fp->tx_br = NULL;
 }
 #endif
 
@@ -6270,14 +6281,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc
 }
 
 /* XXX verify all mbufs were reclaimed */
-
-if (mtx_initialized(>tx_mtx)) {
-mtx_destroy(>tx_mtx);
-}
-
-if (mtx_initialized(>rx_mtx)) {
-mtx_destroy(>rx_mtx);
-}
 }
 }
 
@@ -6499,15 +6502,6 @@ bxe_alloc_fp_buffers(struct bxe_softc *s
 for (i = 0; i < sc->num_queues; i++) {
 fp = >fp[i];
 
-#if __FreeBSD_version >= 80
-fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF,
-   M_NOWAIT, >tx_mtx);
-if (fp->tx_br == NULL) {
-BLOGE(sc, "buf_ring alloc fail for fp[%02d]\n", i);
-goto bxe_alloc_fp_buffers_error;
-}
-#endif
-
 ring_prod = cqe_ring_prod = 0;
 fp->rx_bd_cons = 0;
 fp->rx_cq_cons = 0;
@@ -9615,14 +9609,6 @@ bxe_init_eth_fp(struct bxe_softc *sc,
 fp->sc= sc;
 fp->index = idx;
 
-snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name),
- "bxe%d_fp%d_tx_lock", sc->unit, idx);
-mtx_init(>tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF);
-
-snprintf(fp->rx_mtx_name, sizeof(fp->rx_mtx_name),
- "bxe%d_fp%d_rx_lock", sc->unit, idx);
-mtx_init(>rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF);
-
 fp->igu_sb_id = (sc->igu_base_sb + idx + CNIC_SUPPORT(sc));
 fp->fw_sb_id = (sc->base_fw_ndsb + idx + CNIC_SUPPORT(sc));
 
@@ -15788,6 +15774,89 @@ bxe_add_sysctls(struct bxe_softc *sc)
 }
 }
 
+static int
+bxe_alloc_buf_rings(struct bxe_softc *sc)
+{
+#if __FreeBSD_version >= 80
+
+int i;
+struct bxe_fastpath *fp;
+
+for (i = 0; i < sc->num_queues; i++) {
+
+fp = >fp[i];
+
+fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF,
+   M_NOWAIT, >tx_mtx);
+if (fp->tx_br == NULL)
+return (-1);
+}
+#endif
+return (0);
+}
+
+static void
+bxe_free_buf_rings(struct bxe_softc *sc)
+{
+#if __FreeBSD_version >= 80
+
+int i;
+struct bxe_fastpath *fp;
+
+for (i = 0; i < sc->num_queues; i++) {
+
+fp = >fp[i];
+
+if (fp->tx_br) {
+buf_ring_free(fp->tx_br, M_DEVBUF);
+fp->tx_br = NULL;
+}
+}
+
+#endif
+}
+
+static void
+bxe_init_fp_mutexs(struct bxe_softc *sc)
+{
+int i;
+struct bxe_fastpath *fp;
+
+for (i = 0; i < sc->num_queues; i++) {
+
+fp = >fp[i];
+
+snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name),
+"bxe%d_fp%d_tx_lock", sc->unit, i);
+mtx_init(>tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF);
+
+snprintf(fp->rx_mtx_name, sizeof(fp->rx_mtx_name),
+"bxe%d_fp%d_rx_lock", sc->unit, i);
+mtx_init(>rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF);
+}
+}
+
+static void
+bxe_destroy_fp_mutexs(struct bxe_softc *sc)
+{
+int i;
+struct bxe_fastpath *fp;
+
+for (i = 0; i < sc->num_queues; i++) {
+

svn commit: r296578 - head/bin/sh/tests/builtins

2016-03-09 Thread Jilles Tjoelker
Author: jilles
Date: Wed Mar  9 21:05:21 2016
New Revision: 296578
URL: https://svnweb.freebsd.org/changeset/base/296578

Log:
  sh: Add test for 'set -o nolog'.
  
  The option does not do anything so check that the output of 'set +o' is
  different.

Added:
  head/bin/sh/tests/builtins/set3.0   (contents, props changed)
Modified:
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Wed Mar  9 21:00:57 2016
(r296577)
+++ head/bin/sh/tests/builtins/Makefile Wed Mar  9 21:05:21 2016
(r296578)
@@ -140,6 +140,7 @@ FILES+= return7.4
 FILES+=return8.0
 FILES+=set1.0
 FILES+=set2.0
+FILES+=set3.0
 FILES+=trap1.0
 FILES+=trap10.0
 FILES+=trap11.0

Added: head/bin/sh/tests/builtins/set3.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/set3.0   Wed Mar  9 21:05:21 2016
(r296578)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+settings1=$(set +o) && set -o nolog && settings2=$(set +o) &&
+[ "$settings1" != "$settings2" ]
___
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: r296577 - head/bin/sh

2016-03-09 Thread Jilles Tjoelker
Author: jilles
Date: Wed Mar  9 21:00:57 2016
New Revision: 296577
URL: https://svnweb.freebsd.org/changeset/base/296577

Log:
  sh: Avoid out-of-bounds access in setoptionbyindex() for 'set -o nolog'.
  
  Reported by:  hrs

Modified:
  head/bin/sh/options.c

Modified: head/bin/sh/options.c
==
--- head/bin/sh/options.c   Wed Mar  9 20:15:03 2016(r296576)
+++ head/bin/sh/options.c   Wed Mar  9 21:00:57 2016(r296577)
@@ -285,7 +285,7 @@ minus_o(char *name, int val)
 static void
 setoptionbyindex(int idx, int val)
 {
-   if (optletter[idx] == 'p' && !val && privileged) {
+   if ([idx] ==  && !val && privileged) {
if (setgid(getgid()) == -1)
error("setgid");
if (setuid(getuid()) == -1)
@@ -294,9 +294,9 @@ setoptionbyindex(int idx, int val)
optval[idx] = val;
if (val) {
/* #%$ hack for ksh semantics */
-   if (optletter[idx] == 'V')
+   if ([idx] == )
Eflag = 0;
-   else if (optletter[idx] == 'E')
+   else if ([idx] == )
Vflag = 0;
}
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Adrian Chadd
Woo!

Just so its' not lost - people in irc have found power consumption has
jumped dramatically since this commit. :(


-adrian
___
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: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 9, 2016, at 12:58, Renato Botelho  wrote:
> 
>> On Mar 9, 2016, at 12:33, Renato Botelho  wrote:
>> 
>>> On Mar 9, 2016, at 08:07, Jean-Sébastien Pédron  
>>> wrote:
>>> 
>>> On 09/03/2016 10:48, Renato Botelho wrote:
 
 I cannot boot anymore after moving to this revision. My laptop is a 
 ThinkPad T430 (IvyBridge).
>>> 
>>> Hi!
>>> 
>>> Could you please test the following things?
>>> 
>>> 1. Try to boot without loading i915kms from /boot/loader.conf, then
>>> kldload it manually and see what happens.
>> 
>> It works fine if I load it after boot.
>> 
>>> 2. Try to boot a kernel built with the parent commit
>> 
>> I’ll revert tree to parent commit, apply ZFS fix manually and rebuild then I 
>> will let you know
> 
> After revert it to r296547 and manually apply ZFS fix I can successfully load 
> i915kms during boot.
> 
> Just let me know what I can do to help from now to collect all the data you 
> need. I’ll move it to recent -current and load i915kms after boot.

Here is dmesg output on r296567, loading i915kms after boot and running startx:

Copyright (c) 1992-2016 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.0-CURRENT #6 r296567: Wed Mar  9 15:08:44 BRT 2016
root@:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 
3.8.0)
WARNING: WITNESS option enabled, expect reduced performance.
VT(efifb): resolution 640x480
CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz (2494.39-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x306a9  Family=0x6  Model=0x3a  Stepping=9
  
Features=0xbfebfbff
  
Features2=0x7fbae3bf
  AMD Features=0x28100800
  AMD Features2=0x1
  Structured Extended Features=0x281
  XSAVE Features=0x1
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
  TSC: P-state invariant, performance statistics
real memory  = 12884901888 (12288 MB)
avail memory = 12233527296 (11666 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: 
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 SMT threads
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
 cpu2 (AP): APIC ID:  2
 cpu3 (AP): APIC ID:  3
random: unblocking device.
ioapic0  irqs 0-23 on motherboard
random: entropy device external interface
kbd1 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0x80efff90, 0) error 19
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
cryptosoft0:  on motherboard
acpi0:  on motherboard
acpi_ec0:  port 0x62,0x66 on acpi0
acpi0: Power Button (fixed)
cpu0:  on acpi0
cpu1:  on acpi0
cpu2:  on acpi0
cpu3:  on acpi0
attimer0:  port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0:  iomem 0xfed0-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 550
Event timer "HPET1" frequency 14318180 Hz quality 440
Event timer "HPET2" frequency 14318180 Hz quality 440
Event timer "HPET3" frequency 14318180 Hz quality 440
Event timer "HPET4" frequency 14318180 Hz quality 440
atrtc0:  port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
acpi_lid0:  on acpi0
acpi_button0:  on acpi0
pcib0:  port 0xcf8-0xcff on acpi0
pci0:  on pcib0
vgapci0:  port 0x6000-0x603f mem 
0xf000-0xf03f,0xe000-0xefff at device 2.0 on pci0
agp0:  on vgapci0
agp0: aperture size is 256M, detected 65532k stolen memory
vgapci0: Boot video device
xhci0:  mem 0xf252-0xf252 at 
device 20.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Port routing mask set to 0x
usbus0 on xhci0
pci0:  at device 22.0 (no driver attached)
em0:  port 0x6080-0x609f mem 
0xf250-0xf251,0xf253b000-0xf253bfff at device 25.0 on pci0
em0: Using an MSI interrupt
em0: Ethernet address: 00:21:cc:ca:81:68
em0: netmap queues/slots: TX 1/1024, RX 1/1024
ehci0:  mem 0xf253a000-0xf253a3ff at 
device 26.0 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
hdac0:  mem 0xf253-0xf2533fff at device 
27.0 on pci0
pcib1:  at device 28.0 on pci0
pci1:  on pcib1
sdhci_pci0:  mem 0xf1d0-0xf1d000ff at device 0.0 on pci1
sdhci_pci0: 1 slot(s) allocated
pcib2:  at device 28.1 on pci0

svn commit: r296576 - head/tools/regression/filemon

2016-03-09 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar  9 20:15:03 2016
New Revision: 296576
URL: https://svnweb.freebsd.org/changeset/base/296576

Log:
  Remove these broken filemon tests.
  
  They were not very useful in their current state.  It only ran a fork bomb,
  confirmed headers/footers matched, hard-coded the number of expected entries
  (rather than ensuring each entry is present when expected), and was missing a
  sizeof_long.c file from r251368 which makes its intent for testing 32-bit
  binaries unclear.
  
  More extensive tests should be written with ATF now.

Deleted:
  head/tools/regression/filemon/
___
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: r296575 - in head: share/man/man4 sys/dev/filemon

2016-03-09 Thread Bryan Drewery
Author: bdrewery
Date: Wed Mar  9 19:50:35 2016
New Revision: 296575
URL: https://svnweb.freebsd.org/changeset/base/296575

Log:
  FILEMON_SET_FD: Disallow changing the fd.
  
  MFC after:1 week
  Suggested by: mjg
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/man/man4/filemon.4
  head/sys/dev/filemon/filemon.c

Modified: head/share/man/man4/filemon.4
==
--- head/share/man/man4/filemon.4   Wed Mar  9 19:36:25 2016
(r296574)
+++ head/share/man/man4/filemon.4   Wed Mar  9 19:50:35 2016
(r296575)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 28, 2016
+.Dd March 9, 2016
 .Dt FILEMON 4
 .Os
 .Sh NAME
@@ -125,6 +125,19 @@ function returns the value 0 if successf
 otherwise the value \-1 is returned and the global variable
 .Va errno
 is set to indicate the error.
+.Sh ERRORS
+The
+.Fn ioctl
+system call
+with
+.Dv FILEMON_SET_FD
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EEXIST
+The
+.Nm
+handle is already associated with a file descriptor.
+.El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/filemon"
 .It Pa /dev/filemon

Modified: head/sys/dev/filemon/filemon.c
==
--- head/sys/dev/filemon/filemon.c  Wed Mar  9 19:36:25 2016
(r296574)
+++ head/sys/dev/filemon/filemon.c  Wed Mar  9 19:50:35 2016
(r296575)
@@ -163,8 +163,10 @@ filemon_ioctl(struct cdev *dev, u_long c
switch (cmd) {
/* Set the output file descriptor. */
case FILEMON_SET_FD:
-   if (filemon->fp != NULL)
-   fdrop(filemon->fp, td);
+   if (filemon->fp != NULL) {
+   error = EEXIST;
+   break;
+   }
 
error = fget_write(td, *(int *)data,
cap_rights_init(, CAP_PWRITE),
___
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: r296574 - in head/sys: dev/md modules/md

2016-03-09 Thread Maxim Sobolev
Author: sobomax
Date: Wed Mar  9 19:36:25 2016
New Revision: 296574
URL: https://svnweb.freebsd.org/changeset/base/296574

Log:
  For the MD_ROOT option don't inject /dev/md0 as root dev when ROOTDEVNAME
  is defined explicitly. It's kinda pointless and results in extra step in
  boot sequence which is not really needed, i.e.:
  
  md0: Embedded image 1331200 bytes at 0x8038b7b4
  Trying to mount root from ufs:/dev/md0 []...
  Mounting from ufs:/dev/md0 failed with error 22.
  Trying to mount root from ufs:md0.uzip []...
  warning: no time-of-day clock registered, system time will not be set 
accurately
  start_init: trying /sbin/init

Modified:
  head/sys/dev/md/md.c
  head/sys/modules/md/Makefile

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cWed Mar  9 19:06:46 2016(r296573)
+++ head/sys/dev/md/md.cWed Mar  9 19:36:25 2016(r296574)
@@ -58,6 +58,7 @@
  * From: src/sys/dev/vn/vn.c,v 1.122 2000/12/16 16:06:03
  */
 
+#include "opt_rootdevname.h"
 #include "opt_geom.h"
 #include "opt_md.h"
 
@@ -1732,7 +1733,7 @@ md_preloaded(u_char *image, size_t lengt
sc->pl_ptr = image;
sc->pl_len = length;
sc->start = mdstart_preload;
-#ifdef MD_ROOT
+#if defined(MD_ROOT) && !defined(ROOTDEVNAME)
if (sc->unit == 0)
rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0";
 #endif

Modified: head/sys/modules/md/Makefile
==
--- head/sys/modules/md/MakefileWed Mar  9 19:06:46 2016
(r296573)
+++ head/sys/modules/md/MakefileWed Mar  9 19:36:25 2016
(r296574)
@@ -3,6 +3,6 @@
 .PATH: ${.CURDIR}/../../dev/md
 
 KMOD=  geom_md
-SRCS=  md.c opt_md.h opt_geom.h vnode_if.h
+SRCS=  md.c opt_md.h opt_geom.h opt_rootdevname.h vnode_if.h
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r296573 - in head/sys: compat/freebsd32 kern sys

2016-03-09 Thread John Baldwin
Author: jhb
Date: Wed Mar  9 19:06:46 2016
New Revision: 296573
URL: https://svnweb.freebsd.org/changeset/base/296573

Log:
  Regen.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar  9 19:05:11 2016
(r296572)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar  9 19:06:46 2016
(r296573)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 277610 
2015-01-23 21:07:08Z jilles 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 
2016-03-09 19:05:11Z jhb 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -285,25 +285,9 @@ struct freebsd32_aio_suspend_args {
char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)];
char timeout_l_[PADL_(const struct timespec32 *)]; const struct 
timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)];
 };
-struct freebsd32_aio_cancel_args {
-   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-   char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char 
aiocbp_r_[PADR_(struct aiocb32 *)];
-};
 struct freebsd32_aio_error_args {
char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char 
aiocbp_r_[PADR_(struct aiocb32 *)];
 };
-struct freebsd32_oaio_read_args {
-   char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; 
char aiocbp_r_[PADR_(struct oaiocb32 *)];
-};
-struct freebsd32_oaio_write_args {
-   char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; 
char aiocbp_r_[PADR_(struct oaiocb32 *)];
-};
-struct freebsd32_olio_listio_args {
-   char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
-   char acb_list_l_[PADL_(struct oaiocb32 *const *)]; struct oaiocb32 
*const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 *const *)];
-   char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)];
-   char sig_l_[PADL_(struct osigevent32 *)]; struct osigevent32 * sig; 
char sig_r_[PADR_(struct osigevent32 *)];
-};
 struct freebsd32_jail_args {
char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char 
jail_r_[PADR_(struct jail32 *)];
 };
@@ -755,11 +739,7 @@ intfreebsd32_modstat(struct thread *, s
 intfreebsd32_kldstat(struct thread *, struct freebsd32_kldstat_args *);
 intfreebsd32_aio_return(struct thread *, struct freebsd32_aio_return_args 
*);
 intfreebsd32_aio_suspend(struct thread *, struct 
freebsd32_aio_suspend_args *);
-intfreebsd32_aio_cancel(struct thread *, struct freebsd32_aio_cancel_args 
*);
 intfreebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *);
-intfreebsd32_oaio_read(struct thread *, struct freebsd32_oaio_read_args *);
-intfreebsd32_oaio_write(struct thread *, struct freebsd32_oaio_write_args 
*);
-intfreebsd32_olio_listio(struct thread *, struct 
freebsd32_olio_listio_args *);
 intfreebsd32_jail(struct thread *, struct freebsd32_jail_args *);
 intfreebsd32_sigtimedwait(struct thread *, struct 
freebsd32_sigtimedwait_args *);
 intfreebsd32_sigwaitinfo(struct thread *, struct 
freebsd32_sigwaitinfo_args *);
@@ -1043,6 +1023,18 @@ struct freebsd6_freebsd32_ftruncate_args
char length1_l_[PADL_(uint32_t)]; uint32_t length1; char 
length1_r_[PADR_(uint32_t)];
char length2_l_[PADL_(uint32_t)]; uint32_t length2; char 
length2_r_[PADR_(uint32_t)];
 };
+struct freebsd6_freebsd32_aio_read_args {
+   char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; 
char aiocbp_r_[PADR_(struct oaiocb32 *)];
+};
+struct freebsd6_freebsd32_aio_write_args {
+   char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; 
char aiocbp_r_[PADR_(struct oaiocb32 *)];
+};
+struct freebsd6_freebsd32_lio_listio_args {
+   char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
+   char acb_list_l_[PADL_(struct oaiocb32 *const *)]; struct oaiocb32 
*const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 *const *)];
+   char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)];
+   char sig_l_[PADL_(struct osigevent32 *)]; struct osigevent32 * sig; 
char sig_r_[PADR_(struct osigevent32 *)];
+};
 #ifdef PAD64_REQUIRED
 #else
 #endif
@@ -1061,6 +1053,9 @@ int   freebsd6_freebsd32_mmap(struct threa
 intfreebsd6_freebsd32_lseek(struct thread *, struct 
freebsd6_freebsd32_lseek_args *);
 int

svn commit: r296572 - in head/sys: compat/freebsd32 kern sys

2016-03-09 Thread John Baldwin
Author: jhb
Date: Wed Mar  9 19:05:11 2016
New Revision: 296572
URL: https://svnweb.freebsd.org/changeset/base/296572

Log:
  Simplify AIO initialization now that it is standard.
  
  - Mark AIO system calls as STD and remove the helpers to dynamically
register them.
  - Use COMPAT6 for the old system calls with the older sigevent instead of
an 'o' prefix.
  - Simplify the POSIX configuration to note that AIO is always available.
  - Handle AIO in the default VOP_PATHCONF instead of special casing it in
the pathconf() system call.  fpathconf() is still hackish.
  - Remove freebsd32_aio_cancel() as it just called the native one directly.
  
  Reviewed by:  kib
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D5589

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/kern_descrip.c
  head/sys/kern/posix4_mib.c
  head/sys/kern/syscalls.master
  head/sys/kern/vfs_aio.c
  head/sys/kern/vfs_default.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/signalvar.h
  head/sys/sys/unistd.h
  head/sys/sys/vnode.h

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Wed Mar  9 18:45:41 2016
(r296571)
+++ head/sys/compat/freebsd32/syscalls.master   Wed Mar  9 19:05:11 2016
(r296572)
@@ -477,11 +477,11 @@
u_int nfds, int timeout); }
 253AUE_ISSETUGID   NOPROTO { int issetugid(void); }
 254AUE_LCHOWN  NOPROTO { int lchown(char *path, int uid, int gid); }
-255AUE_NULLNOSTD   { int freebsd32_aio_read( \
+255AUE_NULLSTD { int freebsd32_aio_read( \
struct aiocb32 *aiocbp); }
-256AUE_NULLNOSTD   { int freebsd32_aio_write( \
+256AUE_NULLSTD { int freebsd32_aio_write( \
struct aiocb32 *aiocbp); }
-257AUE_NULLNOSTD   { int freebsd32_lio_listio(int mode, \
+257AUE_NULLSTD { int freebsd32_lio_listio(int mode, \
struct aiocb32 * const *acb_list, \
int nent, struct sigevent32 *sig); }
 258AUE_NULLUNIMPL  nosys
@@ -562,20 +562,20 @@
 312AUE_SETRESGID   NOPROTO { int setresgid(gid_t rgid, gid_t egid, \
gid_t sgid); }
 313AUE_NULLOBSOL   signanosleep
-314AUE_NULLNOSTD   { int freebsd32_aio_return( \
+314AUE_NULLSTD { int freebsd32_aio_return( \
struct aiocb32 *aiocbp); }
-315AUE_NULLNOSTD   { int freebsd32_aio_suspend( \
+315AUE_NULLSTD { int freebsd32_aio_suspend( \
struct aiocb32 * const * aiocbp, int nent, \
const struct timespec32 *timeout); }
-316AUE_NULLNOSTD   { int freebsd32_aio_cancel(int fd, \
+316AUE_NULLNOPROTO { int aio_cancel(int fd, \
+   struct aiocb *aiocbp); }
+317AUE_NULLSTD { int freebsd32_aio_error( \
struct aiocb32 *aiocbp); }
-317AUE_NULLNOSTD   { int freebsd32_aio_error( \
-   struct aiocb32 *aiocbp); }
-318AUE_NULLNOSTD   { int freebsd32_oaio_read( \
+318AUE_NULLCOMPAT6 { int freebsd32_aio_read( \
struct oaiocb32 *aiocbp); }
-319AUE_NULLNOSTD   { int freebsd32_oaio_write( \
+319AUE_NULLCOMPAT6 { int freebsd32_aio_write( \
struct oaiocb32 *aiocbp); }
-320AUE_NULLNOSTD   { int freebsd32_olio_listio(int mode, \
+320AUE_NULLCOMPAT6 { int freebsd32_lio_listio(int mode, \
struct oaiocb32 * const *acb_list, \
int nent, struct osigevent32 *sig); }
 321AUE_NULLNOPROTO { int yield(void); }
@@ -653,7 +653,7 @@
 358AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \
const char *path, int attrnamespace, \
const char *attrname); }
-359AUE_NULLNOSTD   { int freebsd32_aio_waitcomplete( \
+359AUE_NULLSTD { int freebsd32_aio_waitcomplete( \
struct aiocb32 **aiocbp, \
struct timespec32 *timeout); }
 360AUE_GETRESUID   NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \
@@ -837,7 +837,7 @@
 462AUE_NULLNOPROTO|NOSTD   { int kmq_unlink(const char *path); }
 463AUE_NULLNOPROTO { int abort2(const char *why, int nargs, void 
**args); }
 464AUE_NULLNOPROTO { int thr_set_name(long id, const char *name); }
-465AUE_NULLNOSTD  

svn commit: r296571 - head/usr.bin/truss

2016-03-09 Thread John Baldwin
Author: jhb
Date: Wed Mar  9 18:45:41 2016
New Revision: 296571
URL: https://svnweb.freebsd.org/changeset/base/296571

Log:
  Use ptrace(2) LWP events to track threads reliably in truss.
  
  - truss can now log the system call invoked by a thread during a
voluntary process exit.  No return value is logged, but the value passed
to exit() is included in the trace output.  Arguments passed to thread
exit system calls such as thr_exit() are not logged as voluntary thread
exits cannot be distinguished from involuntary thread exits during a
system call.
  - New events are now reported for thread births and exits similar to the
recently added events for new child processes when following forks.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D5561

Modified:
  head/usr.bin/truss/setup.c
  head/usr.bin/truss/syscalls.c
  head/usr.bin/truss/truss.h

Modified: head/usr.bin/truss/setup.c
==
--- head/usr.bin/truss/setup.c  Wed Mar  9 18:38:30 2016(r296570)
+++ head/usr.bin/truss/setup.c  Wed Mar  9 18:45:41 2016(r296571)
@@ -61,7 +61,9 @@ SET_DECLARE(procabi, struct procabi);
 
 static sig_atomic_t detaching;
 
-static voidnew_proc(struct trussinfo *, pid_t);
+static voidenter_syscall(struct trussinfo *, struct threadinfo *,
+   struct ptrace_lwpinfo *);
+static voidnew_proc(struct trussinfo *, pid_t, lwpid_t);
 
 /*
  * setup_and_wait() is called to start a process.  All it really does
@@ -87,7 +89,7 @@ setup_and_wait(struct trussinfo *info, c
if (waitpid(pid, NULL, 0) < 0)
err(1, "unexpect stop in waitpid");
 
-   new_proc(info, pid);
+   new_proc(info, pid, 0);
 }
 
 /*
@@ -109,7 +111,7 @@ start_tracing(struct trussinfo *info, pi
if (waitpid(pid, NULL, 0) < 0)
err(1, "Unexpect stop in waitpid");
 
-   new_proc(info, pid);
+   new_proc(info, pid, 0);
 }
 
 /*
@@ -170,14 +172,71 @@ find_abi(pid_t pid)
return (NULL);
 }
 
+static struct threadinfo *
+new_thread(struct procinfo *p, lwpid_t lwpid)
+{
+   struct threadinfo *nt;
+
+   /*
+* If this happens it means there is a bug in truss.  Unfortunately
+* this will kill any processes truss is attached to.
+*/
+   LIST_FOREACH(nt, >threadlist, entries) {
+   if (nt->tid == lwpid)
+   errx(1, "Duplicate thread for LWP %ld", (long)lwpid);
+   }
+
+   nt = calloc(1, sizeof(struct threadinfo));
+   if (nt == NULL)
+   err(1, "calloc() failed");
+   nt->proc = p;
+   nt->tid = lwpid;
+   LIST_INSERT_HEAD(>threadlist, nt, entries);
+   return (nt);
+}
+
+static void
+free_thread(struct threadinfo *t)
+{
+
+   LIST_REMOVE(t, entries);
+   free(t);
+}
+
 static void
-new_proc(struct trussinfo *info, pid_t pid)
+add_threads(struct trussinfo *info, struct procinfo *p)
+{
+   struct ptrace_lwpinfo pl;
+   struct threadinfo *t;
+   lwpid_t *lwps;
+   int i, nlwps;
+
+   nlwps = ptrace(PT_GETNUMLWPS, p->pid, NULL, 0);
+   if (nlwps == -1)
+   err(1, "Unable to fetch number of LWPs");
+   assert(nlwps > 0);
+   lwps = calloc(nlwps, sizeof(*lwps));
+   nlwps = ptrace(PT_GETLWPLIST, p->pid, (caddr_t)lwps, nlwps);
+   if (nlwps == -1)
+   err(1, "Unable to fetch LWP list");
+   for (i = 0; i < nlwps; i++) {
+   t = new_thread(p, lwps[i]);
+   if (ptrace(PT_LWPINFO, lwps[i], (caddr_t), sizeof(pl)) == -1)
+   err(1, "ptrace(PT_LWPINFO)");
+   if (pl.pl_flags & PL_FLAG_SCE)
+   enter_syscall(info, t, );
+   }
+   free(lwps);
+}
+
+static void
+new_proc(struct trussinfo *info, pid_t pid, lwpid_t lwpid)
 {
struct procinfo *np;
 
/*
 * If this happens it means there is a bug in truss.  Unfortunately
-* this will kill any processes are attached to.
+* this will kill any processes truss is attached to.
 */
LIST_FOREACH(np, >proclist, entries) {
if (np->pid == pid)
@@ -187,11 +246,18 @@ new_proc(struct trussinfo *info, pid_t p
if (info->flags & FOLLOWFORKS)
if (ptrace(PT_FOLLOW_FORK, pid, NULL, 1) == -1)
err(1, "Unable to follow forks for pid %ld", (long)pid);
+   if (ptrace(PT_LWP_EVENTS, pid, NULL, 1) == -1)
+   err(1, "Unable to enable LWP events for pid %ld", (long)pid);
np = calloc(1, sizeof(struct procinfo));
np->pid = pid;
np->abi = find_abi(pid);
-   SLIST_INIT(>threadlist);
+   LIST_INIT(>threadlist);
LIST_INSERT_HEAD(>proclist, np, entries);
+
+   if (lwpid != 0)
+   new_thread(np, lwpid);
+   else
+   add_threads(info, np);
 }
 
 static void
@@ -199,7 +265,7 @@ 

svn commit: r296569 - head/sys/mips/rt305x

2016-03-09 Thread Maxim Sobolev
Author: sobomax
Date: Wed Mar  9 18:38:03 2016
New Revision: 296569
URL: https://svnweb.freebsd.org/changeset/base/296569

Log:
  Second argument of the mips_timer_init_params() is boolean, so
  pass in "1" for true consistently.

Modified:
  head/sys/mips/rt305x/rt305x_machdep.c

Modified: head/sys/mips/rt305x/rt305x_machdep.c
==
--- head/sys/mips/rt305x/rt305x_machdep.c   Wed Mar  9 17:40:33 2016
(r296568)
+++ head/sys/mips/rt305x/rt305x_machdep.c   Wed Mar  9 18:38:03 2016
(r296569)
@@ -203,5 +203,5 @@ platform_start(__register_t a0 __unused,
 
 
mips_init();
-   mips_timer_init_params(platform_counter_freq, 2);
+   mips_timer_init_params(platform_counter_freq, 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: r296570 - in head: sys/amd64/cloudabi64 sys/arm64/cloudabi64 usr.bin/kdump

2016-03-09 Thread John Baldwin
Author: jhb
Date: Wed Mar  9 18:38:30 2016
New Revision: 296570
URL: https://svnweb.freebsd.org/changeset/base/296570

Log:
  Fix reporting of the CloudABI ABI in kdump.
  
  - Advertise the word size for CloudABI ABIs via the SV_LP64 flag.  All of
the other ABIs include either SV_ILP32 or SV_LP64.
  - Fix kdump to not assume a 32-bit ABI if the ABI flags field is non-zero
but SV_LP64 isn't set.  Instead, only assume a 32-bit ABI if SV_ILP32 is
set and fallback to the unknown value of "00" if neither SV_LP64 nor
SV_ILP32 is set.
  
  Reviewed by:  kib, ed
  Differential Revision:https://reviews.freebsd.org/D5560

Modified:
  head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
  head/usr.bin/kdump/kdump.c

Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Wed Mar  9 18:38:03 
2016(r296569)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Wed Mar  9 18:38:30 
2016(r296570)
@@ -143,7 +143,7 @@ static struct sysentvec cloudabi64_elf_s
.sv_usrstack= USRSTACK,
.sv_stackprot   = VM_PROT_READ | VM_PROT_WRITE,
.sv_copyout_strings = cloudabi64_copyout_strings,
-   .sv_flags   = SV_ABI_CLOUDABI | SV_CAPSICUM,
+   .sv_flags   = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_LP64,
.sv_set_syscall_retval  = cloudabi64_set_syscall_retval,
.sv_fetch_syscall_args  = cloudabi64_fetch_syscall_args,
.sv_syscallnames= cloudabi64_syscallnames,

Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
==
--- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c   Wed Mar  9 18:38:03 
2016(r296569)
+++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c   Wed Mar  9 18:38:30 
2016(r296570)
@@ -144,7 +144,7 @@ static struct sysentvec cloudabi64_elf_s
.sv_usrstack= USRSTACK,
.sv_stackprot   = VM_PROT_READ | VM_PROT_WRITE,
.sv_copyout_strings = cloudabi64_copyout_strings,
-   .sv_flags   = SV_ABI_CLOUDABI | SV_CAPSICUM,
+   .sv_flags   = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_LP64,
.sv_set_syscall_retval  = cloudabi64_set_syscall_retval,
.sv_fetch_syscall_args  = cloudabi64_fetch_syscall_args,
.sv_syscallnames= cloudabi64_syscallnames,

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Wed Mar  9 18:38:03 2016(r296569)
+++ head/usr.bin/kdump/kdump.c  Wed Mar  9 18:38:30 2016(r296570)
@@ -529,12 +529,11 @@ abidump(struct ktr_header *kth)
break;
}
 
-   if (flags != 0) {
-   if (flags & SV_LP64)
-   arch = "64";
-   else
-   arch = "32";
-   } else
+   if (flags & SV_LP64)
+   arch = "64";
+   else if (flags & SV_ILP32)
+   arch = "32";
+   else
arch = "00";
 
printf("%s%s  ", abi, arch);
___
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: r296568 - stable/10/contrib/diff/src

2016-03-09 Thread Don Lewis
Author: truckman
Date: Wed Mar  9 17:40:33 2016
New Revision: 296568
URL: https://svnweb.freebsd.org/changeset/base/296568

Log:
  MFC r283869 (by araujo)
  
  Fix the wrong format, format specifies type 'int' but the argument has type
  'long', it was spotted by clang.

Modified:
  stable/10/contrib/diff/src/context.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/diff/src/context.c
==
--- stable/10/contrib/diff/src/context.cWed Mar  9 16:05:13 2016
(r296567)
+++ stable/10/contrib/diff/src/context.cWed Mar  9 17:40:33 2016
(r296568)
@@ -62,7 +62,7 @@ print_context_label (char const *mark,
{
  time_t sec = inf->stat.st_mtime;
  verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
- sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec);
+ sprintf (buf, "%jd.%.9ld", (intmax_t)sec, nsec);
}
   fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf);
 }
___
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: r296567 - head/cddl/contrib/opensolaris/lib/libzfs/common

2016-03-09 Thread Ed Maste
On 9 March 2016 at 11:05, Alexander Motin  wrote:
> Author: mav
> Date: Wed Mar  9 16:05:13 2016
> New Revision: 296567
> URL: https://svnweb.freebsd.org/changeset/base/296567
>
> Log:
>   Missed addition to r296563 to fix newer tools to work with older kernel.

Thanks!
___
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: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Adrian Chadd
Hm, I thought some of the drm code required interrupts to be up for
i2c transactions to complete?

Maybe it's gotten worse in the later linux kernel versions?



-adrian
___
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: r296567 - head/cddl/contrib/opensolaris/lib/libzfs/common

2016-03-09 Thread Alexander Motin
Author: mav
Date: Wed Mar  9 16:05:13 2016
New Revision: 296567
URL: https://svnweb.freebsd.org/changeset/base/296567

Log:
  Missed addition to r296563 to fix newer tools to work with older kernel.

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Wed Mar 
 9 14:47:05 2016(r296566)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Wed Mar 
 9 16:05:13 2016(r296567)
@@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_
 
if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) {
switch (zfs_ioctl_version) {
+   case ZFS_IOCVER_RESUME:
+   cflag = ZFS_CMD_COMPAT_RESUME;
+   break;
case ZFS_IOCVER_EDBP:
cflag = ZFS_CMD_COMPAT_EDBP;
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 9, 2016, at 12:33, Renato Botelho  wrote:
> 
>> On Mar 9, 2016, at 08:07, Jean-Sébastien Pédron  wrote:
>> 
>> On 09/03/2016 10:48, Renato Botelho wrote:
 Author: dumbbell
 Date: Tue Mar  8 20:33:02 2016
 New Revision: 296548
 URL: https://svnweb.freebsd.org/changeset/base/296548
 
 Log:
 drm/i915: Update to match Linux 3.8.13
>>> 
>>> I cannot boot anymore after moving to this revision. My laptop is a 
>>> ThinkPad T430 (IvyBridge).
>> 
>> Hi!
>> 
>> Could you please test the following things?
>> 
>> 1. Try to boot without loading i915kms from /boot/loader.conf, then
>>  kldload it manually and see what happens.
> 
> It works fine if I load it after boot.
> 
>> 2. Try to boot a kernel built with the parent commit
> 
> I’ll revert tree to parent commit, apply ZFS fix manually and rebuild then I 
> will let you know

After revert it to r296547 and manually apply ZFS fix I can successfully load 
i915kms during boot.

Just let me know what I can do to help from now to collect all the data you 
need. I’ll move it to recent -current and load i915kms after boot.
--
Renato Botelho



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Emmanuel Vadot
On Wed, 9 Mar 2016 06:48:31 -0300
Renato Botelho  wrote:

> > On Mar 8, 2016, at 17:33, Jean-Sébastien Pédron  
> > wrote:
> > 
> > Author: dumbbell
> > Date: Tue Mar  8 20:33:02 2016
> > New Revision: 296548
> > URL: https://svnweb.freebsd.org/changeset/base/296548
> > 
> > Log:
> >  drm/i915: Update to match Linux 3.8.13
> > 
> >  This update brings initial support for Haswell GPUs.
> > 
> >  Tested by: Many users of FreeBSD, PC-BSD and HardenedBSD
> >  Relnotes:  yes
> >  Sponsored by:  The FreeBSD Foundation
> >  Differential Revision: https://reviews.freebsd.org/D5554
> 
> I cannot boot anymore after moving to this revision. My laptop is a ThinkPad 
> T430 (IvyBridge).
> 
> I got some warnings like
> 
> info: [drm] MTRR allocation failed.  Graphics performance may suffer.
> 
> and in the end it just stops with these last 3 messages:
> 
> info: [drm] MSI enabled 1 message(s)
> info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
> info: [drm] Driver supports precise vblank timestamp query.
> 
> And never pass this point.
> 
> By default I?m using GENERIC-NODEBUG, I?ll boot with old kernel and rebuild 
> it using GENERIC to make sure I can collect more data.
> --
> Renato Botelho

 I think that I have the same problem (but with haswell)

 When I load manually i915kms I don't have any problem but there is still some 
error message printed :
info: [drm] Initialized drm 1.1.0 20060810
drmn0:  on vgapci0
info: [drm] Memory usable by graphics device = 2048M
info: [drm] MTRR allocation failed.  Graphics performance may suffer.
iicbus0: error: [drm:pid697:i915_write32] *ERROR* Unknown 
unclaimed register before writing to c5100
 on iicbb0 addr 0xff
iic0:  on iicbus0
iic1:  on iicbus1
iicbus2:  on iicbb1 addr 0x0
iic2:  on iicbus2
iic3:  on iicbus3
iicbus4:  on iicbb2 addr 0x0
iic4:  on iicbus4
iic5:  on iicbus5
iicbus6:  on iicbb3 addr 0x0
iic6:  on iicbus6
iic7:  on iicbus7
iicbus8:  on iicbb4 addr 0x0
iic8:  on iicbus8
iic9:  on iicbus9
iicbus10:  on iicbb5 addr 0x0
iic10:  on iicbus10
iic11:  on iicbus11
info: [drm] MSI enabled 1 message(s)
info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
info: [drm] Driver supports precise vblank timestamp query.
error: [drm:pid697:lpt_init_pch_refclk] *ERROR* FDI mPHY reset assert timeout
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: [drm:pid697:intel_sbi_write] *ERROR* timeout waiting for SBI to complete 
write transaction
error: [drm:pid697:intel_sbi_read] *ERROR* timeout waiting for SBI to complete 
read transaction
error: 

Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 9, 2016, at 08:07, Jean-Sébastien Pédron  wrote:
> 
> On 09/03/2016 10:48, Renato Botelho wrote:
>>> Author: dumbbell
>>> Date: Tue Mar  8 20:33:02 2016
>>> New Revision: 296548
>>> URL: https://svnweb.freebsd.org/changeset/base/296548
>>> 
>>> Log:
>>> drm/i915: Update to match Linux 3.8.13
>> 
>> I cannot boot anymore after moving to this revision. My laptop is a ThinkPad 
>> T430 (IvyBridge).
> 
> Hi!
> 
> Could you please test the following things?
> 
> 1. Try to boot without loading i915kms from /boot/loader.conf, then
>   kldload it manually and see what happens.

It works fine if I load it after boot.

> 2. Try to boot a kernel built with the parent commit

I’ll revert tree to parent commit, apply ZFS fix manually and rebuild then I 
will let you know

--
Renato Botelho



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r296566 - head/sbin/ipfw

2016-03-09 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar  9 14:47:05 2016
New Revision: 296566
URL: https://svnweb.freebsd.org/changeset/base/296566

Log:
  Set buffer to empty string to prevent duplicated output in some cases.
  
  PR:   193888

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Wed Mar  9 13:45:03 2016(r296565)
+++ head/sbin/ipfw/ipfw2.c  Wed Mar  9 14:47:05 2016(r296566)
@@ -424,6 +424,7 @@ bp_flush(struct buf_pr *b)
 
b->ptr = b->buf;
b->avail = b->size;
+   b->buf[0] = '\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: r296565 - head/lib/libc/sys

2016-03-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar  9 13:45:03 2016
New Revision: 296565
URL: https://svnweb.freebsd.org/changeset/base/296565

Log:
  Fix spelling of MAXNAMLEN.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/lib/libc/sys/getdirentries.2
==
--- head/lib/libc/sys/getdirentries.2   Wed Mar  9 11:45:48 2016
(r296564)
+++ head/lib/libc/sys/getdirentries.2   Wed Mar  9 13:45:03 2016
(r296565)
@@ -75,7 +75,7 @@ uint32_t d_fileno;
 uint16_t d_reclen;
 uint8_t  d_type;
 uint8_t  d_namlen;
-char   d_name[MAXNAMELEN + 1]; /* see below */
+char   d_name[MAXNAMLEN + 1];  /* see below */
 .Ed
 .Pp
 The
@@ -103,7 +103,7 @@ entry specifies the length of the file n
 Thus the actual size of
 .Fa d_name
 may vary from 1 to
-.Dv MAXNAMELEN
+.Dv MAXNAMLEN
 \&+ 1.
 .Pp
 Entries may be separated by extra space.
___
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: r296564 - in head/sys/boot/uboot: common lib

2016-03-09 Thread Stanislav Galabov
Author: sgalabov
Date: Wed Mar  9 11:45:48 2016
New Revision: 296564
URL: https://svnweb.freebsd.org/changeset/base/296564

Log:
  Improve U-Boot API detection
  
  Until now, ubldr has been trying to locate the U-Boot API using a hint
  address (U-Boot's current stack pointer), aligning it to 1MiB and going
  over a 3MiB (or 1MiB in case of MIPS) memory region searching for a
  valid API signature.
  
  This change introduces an alternative way of doing this, namely the
  following:
  - both U-Boot's bootelf and go commands actually pass argc and argv to
the entry point (e.g., ubldr's start function, but they should also
be passed over to main() transparently)
  - so, instead of trying to go and look for a valid API signature, we
look at the parameters passed to main()
  - if there's an option '-a' with argument, which is a valid hexadecimal
unsigned  long number (x), we try to verify whether we have a valid
API signature at address x. If so - we use it. If not - we fallback
to the original way of locating the API signature.
  
  The U-Boot change, which causes the API structure address to be
  exported as an environment variable, was committed to mainline U-Boot
  as commit 22aa61f707574dd569296f521fcfc46a05f51c48
  
  Reviewed by:  andrew, adrian
  Approved by:  adrian (mentor)
  Sponsored by: Smartcom - Bulgaria AD
  Differential Revision:https://reviews.freebsd.org/D5492

Modified:
  head/sys/boot/uboot/common/main.c
  head/sys/boot/uboot/lib/glue.c
  head/sys/boot/uboot/lib/glue.h

Modified: head/sys/boot/uboot/common/main.c
==
--- head/sys/boot/uboot/common/main.c   Wed Mar  9 11:16:15 2016
(r296563)
+++ head/sys/boot/uboot/common/main.c   Wed Mar  9 11:45:48 2016
(r296564)
@@ -387,7 +387,7 @@ probe_disks(int devidx, int load_type, i
 }
 
 int
-main(void)
+main(int argc, char **argv)
 {
struct api_signature *sig = NULL;
int load_type, load_unit, load_slice, load_partition;
@@ -395,12 +395,15 @@ main(void)
const char *ldev;
 
/*
+* We first check if a command line argument was passed to us containing
+* API's signature address. If it wasn't then we try to search for the
+* API signature via the usual hinted address.
 * If we can't find the magic signature and related info, exit with a
 * unique error code that U-Boot reports as "## Application terminated,
 * rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to
 * provide a clue. It's better than 0x anyway.
 */
-   if (!api_search_sig())
+   if (!api_parse_cmdline_sig(argc, argv, ) && !api_search_sig())
return (0x01badab1);
 
syscall_ptr = sig->syscall;

Modified: head/sys/boot/uboot/lib/glue.c
==
--- head/sys/boot/uboot/lib/glue.c  Wed Mar  9 11:16:15 2016
(r296563)
+++ head/sys/boot/uboot/lib/glue.c  Wed Mar  9 11:45:48 2016
(r296564)
@@ -68,6 +68,41 @@ valid_sig(struct api_signature *sig)
 }
 
 /*
+ * Checks to see if API signature's address was given to us as a command line
+ * argument by U-Boot.
+ *
+ * returns 1/0 depending on found/not found result
+ */
+int
+api_parse_cmdline_sig(int argc, char **argv, struct api_signature **sig)
+{
+   unsigned long api_address;
+   int c;
+
+   api_address = 0;
+   opterr = 0;
+   optreset = 1;
+   optind = 1;
+
+   while ((c = getopt (argc, argv, "a:")) != -1)
+   switch (c) {
+   case 'a':
+   api_address = strtoul(optarg, NULL, 16);
+   break;
+   default:
+   break;
+   }
+
+   if (api_address != 0) {
+   *sig = (struct api_signature *)api_address;
+   if (valid_sig(*sig))
+   return (1);
+   }
+
+   return (0);
+}
+
+/*
  * Searches for the U-Boot API signature
  *
  * returns 1/0 depending on found/not found result

Modified: head/sys/boot/uboot/lib/glue.h
==
--- head/sys/boot/uboot/lib/glue.h  Wed Mar  9 11:16:15 2016
(r296563)
+++ head/sys/boot/uboot/lib/glue.h  Wed Mar  9 11:45:48 2016
(r296564)
@@ -58,6 +58,7 @@
 int syscall(int, int *, ...);
 void *syscall_ptr;
 
+int api_parse_cmdline_sig(int argc, char **argv, struct api_signature **sig);
 int api_search_sig(struct api_signature **sig);
 
 #defineUB_MAX_MR   16  /* max mem regions number */
___
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: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Jean-Sébastien Pédron
On 09/03/2016 12:29, Renato Botelho wrote:
> Looks like something broke the system completely, I’m getting core 
> dumps on ZFS and cannot mount all my partitions. Maybe this could be
> > the cause of the problems with i915 too.

The ZFS issue is fixed in r296563.

See:
https://lists.freebsd.org/pipermail/freebsd-current/2016-March/060037.html

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 9, 2016, at 08:07, Jean-Sébastien Pédron  wrote:
> 
> On 09/03/2016 10:48, Renato Botelho wrote:
>>> Author: dumbbell
>>> Date: Tue Mar  8 20:33:02 2016
>>> New Revision: 296548
>>> URL: https://svnweb.freebsd.org/changeset/base/296548
>>> 
>>> Log:
>>> drm/i915: Update to match Linux 3.8.13
>> 
>> I cannot boot anymore after moving to this revision. My laptop is a ThinkPad 
>> T430 (IvyBridge).
> 
> Hi!
> 
> Could you please test the following things?
> 
> 1. Try to boot without loading i915kms from /boot/loader.conf, then
>   kldload it manually and see what happens.
> 2. Try to boot a kernel built with the parent commit

Looks like something broke the system completely, I’m getting core dumps on ZFS 
and cannot mount all my partitions. Maybe this could be the cause of the 
problems with i915 too.

I’ll work on recovering my system to a good state and then I will do a bisect 
to detect if this particular revision really broke it and will let you know.

Thanks
--
Renato Botelho



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r296563 - in head/sys/cddl/contrib/opensolaris: common/zfs uts/common/fs/zfs

2016-03-09 Thread Alexander Motin
Author: mav
Date: Wed Mar  9 11:16:15 2016
New Revision: 296563
URL: https://svnweb.freebsd.org/changeset/base/296563

Log:
  Add new IOCTL compat shims for ABI breakage caused by r296510:
  MFV r296505: 6531 Provide mechanism to artificially limit disk performance

Modified:
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
==
--- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Wed Mar 
 9 10:21:13 2016(r296562)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Wed Mar 
 9 11:16:15 2016(r296563)
@@ -54,8 +54,69 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_
zfs_cmd_deadman_t *zcdm_c;
zfs_cmd_zcmd_t *zcmd_c;
zfs_cmd_edbp_t *edbp_c;
+   zfs_cmd_resume_t *resume_c;
 
switch (cflag) {
+   case ZFS_CMD_COMPAT_RESUME:
+   resume_c = (void *)addr;
+   /* zc */
+   strlcpy(zc->zc_name, resume_c->zc_name, MAXPATHLEN);
+   strlcpy(zc->zc_value, resume_c->zc_value, MAXPATHLEN * 2);
+   strlcpy(zc->zc_string, resume_c->zc_string, MAXPATHLEN);
+
+#define FIELD_COPY(field) zc->field = resume_c->field
+   FIELD_COPY(zc_nvlist_src);
+   FIELD_COPY(zc_nvlist_src_size);
+   FIELD_COPY(zc_nvlist_dst);
+   FIELD_COPY(zc_nvlist_dst_size);
+   FIELD_COPY(zc_nvlist_dst_filled);
+   FIELD_COPY(zc_pad2);
+   FIELD_COPY(zc_history);
+   FIELD_COPY(zc_guid);
+   FIELD_COPY(zc_nvlist_conf);
+   FIELD_COPY(zc_nvlist_conf_size);
+   FIELD_COPY(zc_cookie);
+   FIELD_COPY(zc_objset_type);
+   FIELD_COPY(zc_perm_action);
+   FIELD_COPY(zc_history_len);
+   FIELD_COPY(zc_history_offset);
+   FIELD_COPY(zc_obj);
+   FIELD_COPY(zc_iflags);
+   FIELD_COPY(zc_share);
+   FIELD_COPY(zc_jailid);
+   FIELD_COPY(zc_objset_stats);
+   FIELD_COPY(zc_begin_record);
+   FIELD_COPY(zc_inject_record.zi_objset);
+   FIELD_COPY(zc_inject_record.zi_object);
+   FIELD_COPY(zc_inject_record.zi_start);
+   FIELD_COPY(zc_inject_record.zi_end);
+   FIELD_COPY(zc_inject_record.zi_guid);
+   FIELD_COPY(zc_inject_record.zi_level);
+   FIELD_COPY(zc_inject_record.zi_error);
+   FIELD_COPY(zc_inject_record.zi_type);
+   FIELD_COPY(zc_inject_record.zi_freq);
+   FIELD_COPY(zc_inject_record.zi_failfast);
+   strlcpy(zc->zc_inject_record.zi_func,
+   resume_c->zc_inject_record.zi_func, MAXNAMELEN);
+   FIELD_COPY(zc_inject_record.zi_iotype);
+   FIELD_COPY(zc_inject_record.zi_duration);
+   FIELD_COPY(zc_inject_record.zi_timer);
+   zc->zc_inject_record.zi_nlanes = 1;
+   FIELD_COPY(zc_inject_record.zi_cmd);
+   FIELD_COPY(zc_inject_record.zi_pad);
+   FIELD_COPY(zc_defer_destroy);
+   FIELD_COPY(zc_flags);
+   FIELD_COPY(zc_action_handle);
+   FIELD_COPY(zc_cleanup_fd);
+   FIELD_COPY(zc_simple);
+   FIELD_COPY(zc_resumable);
+   FIELD_COPY(zc_sendobj);
+   FIELD_COPY(zc_fromobj);
+   FIELD_COPY(zc_createtxg);
+   FIELD_COPY(zc_stat);
+#undef FIELD_COPY
+   break;
+
case ZFS_CMD_COMPAT_EDBP:
edbp_c = (void *)addr;
/* zc */
@@ -63,40 +124,57 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_
strlcpy(zc->zc_value, edbp_c->zc_value, MAXPATHLEN * 2);
strlcpy(zc->zc_string, edbp_c->zc_string, MAXPATHLEN);
 
-#define ZCMD_COPY(field) zc->field = edbp_c->field
-   ZCMD_COPY(zc_nvlist_src);
-   ZCMD_COPY(zc_nvlist_src_size);
-   ZCMD_COPY(zc_nvlist_dst);
-   ZCMD_COPY(zc_nvlist_dst_size);
-   ZCMD_COPY(zc_nvlist_dst_filled);
-   ZCMD_COPY(zc_pad2);
-   ZCMD_COPY(zc_history);
-   ZCMD_COPY(zc_guid);
-   ZCMD_COPY(zc_nvlist_conf);
-   ZCMD_COPY(zc_nvlist_conf_size);
-   ZCMD_COPY(zc_cookie);
-   ZCMD_COPY(zc_objset_type);
-   ZCMD_COPY(zc_perm_action);
-   ZCMD_COPY(zc_history_len);
-   ZCMD_COPY(zc_history_offset);
-   ZCMD_COPY(zc_obj);
-   ZCMD_COPY(zc_iflags);
-   ZCMD_COPY(zc_share);
-   ZCMD_COPY(zc_jailid);
-   

Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Jean-Sébastien Pédron
On 09/03/2016 10:48, Renato Botelho wrote:
>> Author: dumbbell
>> Date: Tue Mar  8 20:33:02 2016
>> New Revision: 296548
>> URL: https://svnweb.freebsd.org/changeset/base/296548
>>
>> Log:
>>  drm/i915: Update to match Linux 3.8.13
> 
> I cannot boot anymore after moving to this revision. My laptop is a ThinkPad 
> T430 (IvyBridge).

Hi!

Could you please test the following things?

1. Try to boot without loading i915kms from /boot/loader.conf, then
   kldload it manually and see what happens.
2. Try to boot a kernel built with the parent commit

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


svn commit: r296562 - stable/10/sys/amd64/amd64

2016-03-09 Thread Konstantin Belousov
Author: kib
Date: Wed Mar  9 10:21:13 2016
New Revision: 296562
URL: https://svnweb.freebsd.org/changeset/base/296562

Log:
  MFC r295966:
  Return dst as the result from memcpy(9) on amd64.
  
  PR:   207422

Modified:
  stable/10/sys/amd64/amd64/support.S
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/support.S
==
--- stable/10/sys/amd64/amd64/support.S Wed Mar  9 10:19:32 2016
(r296561)
+++ stable/10/sys/amd64/amd64/support.S Wed Mar  9 10:21:13 2016
(r296562)
@@ -152,6 +152,7 @@ END(bcopy)
  */
 ENTRY(memcpy)
PUSH_FRAME_POINTER
+   movq%rdi,%rax
movq%rdx,%rcx
shrq$3,%rcx /* copy by 64-bit words */
cld /* copy forwards */
___
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: r296561 - stable/10/sys/net

2016-03-09 Thread Konstantin Belousov
Author: kib
Date: Wed Mar  9 10:19:32 2016
New Revision: 296561
URL: https://svnweb.freebsd.org/changeset/base/296561

Log:
  MFC r296009:
  In bpf_getdltlist(), do not call copyout(9) while holding bpf lock.
  Copy the data into temprorary malloced buffer and drop the lock for
  copyout.

Modified:
  stable/10/sys/net/bpf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/bpf.c
==
--- stable/10/sys/net/bpf.c Wed Mar  9 10:14:53 2016(r296560)
+++ stable/10/sys/net/bpf.c Wed Mar  9 10:19:32 2016(r296561)
@@ -2616,26 +2616,44 @@ bpf_ifdetach(void *arg __unused, struct 
 static int
 bpf_getdltlist(struct bpf_d *d, struct bpf_dltlist *bfl)
 {
-   int n, error;
struct ifnet *ifp;
struct bpf_if *bp;
+   u_int *lst;
+   int error, n, n1;
 
BPF_LOCK_ASSERT();
 
ifp = d->bd_bif->bif_ifp;
+again:
+   n1 = 0;
+   LIST_FOREACH(bp, _iflist, bif_next) {
+   if (bp->bif_ifp == ifp)
+   n1++;
+   }
+   if (bfl->bfl_list == NULL) {
+   bfl->bfl_len = n1;
+   return (0);
+   }
+   if (n1 > bfl->bfl_len)
+   return (ENOMEM);
+   BPF_UNLOCK();
+   lst = malloc(n1 * sizeof(u_int), M_TEMP, M_WAITOK);
n = 0;
-   error = 0;
+   BPF_LOCK();
LIST_FOREACH(bp, _iflist, bif_next) {
if (bp->bif_ifp != ifp)
continue;
-   if (bfl->bfl_list != NULL) {
-   if (n >= bfl->bfl_len)
-   return (ENOMEM);
-   error = copyout(>bif_dlt,
-   bfl->bfl_list + n, sizeof(u_int));
+   if (n > n1) {
+   free(lst, M_TEMP);
+   goto again;
}
+   lst[n] = bp->bif_dlt;
n++;
}
+   BPF_UNLOCK();
+   error = copyout(lst, bfl->bfl_list, sizeof(u_int) * n);
+   free(lst, M_TEMP);
+   BPF_LOCK();
bfl->bfl_len = n;
return (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: r296560 - stable/9/sys/netipsec

2016-03-09 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar  9 10:14:53 2016
New Revision: 296560
URL: https://svnweb.freebsd.org/changeset/base/296560

Log:
  MFC r295967:
Fix useless check. m_pkthdr.len should be equal to orglen.

Modified:
  stable/9/sys/netipsec/key.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netipsec/key.c
==
--- stable/9/sys/netipsec/key.c Wed Mar  9 10:09:51 2016(r296559)
+++ stable/9/sys/netipsec/key.c Wed Mar  9 10:14:53 2016(r296560)
@@ -7338,8 +7338,7 @@ key_parse(m, so)
orglen = PFKEY_UNUNIT64(msg->sadb_msg_len);
target = KEY_SENDUP_ONE;
 
-   if ((m->m_flags & M_PKTHDR) == 0 ||
-   m->m_pkthdr.len != m->m_pkthdr.len) {
+   if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len != orglen) {
ipseclog((LOG_DEBUG, "%s: invalid message length.\n",__func__));
PFKEYSTAT_INC(out_invlen);
error = EINVAL;
___
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: r296559 - stable/10/share/man/man9

2016-03-09 Thread Konstantin Belousov
Author: kib
Date: Wed Mar  9 10:09:51 2016
New Revision: 296559
URL: https://svnweb.freebsd.org/changeset/base/296559

Log:
  MFC r295998:
  Remove references to Giant in the description of vrele(9).  Add notes
  about vnode lock and sleeping.
  
  MFC r296001:
  Fix year.

Modified:
  stable/10/share/man/man9/vrele.9
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man9/vrele.9
==
--- stable/10/share/man/man9/vrele.9Wed Mar  9 10:01:28 2016
(r296558)
+++ stable/10/share/man/man9/vrele.9Wed Mar  9 10:09:51 2016
(r296559)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 20, 2010
+.Dd February 24, 2016
 .Dt VRELE 9
 .Os
 .Sh NAME
@@ -81,9 +81,11 @@ If the
 .Va v_usecount
 field of the non-doomed vnode reaches zero, then it will be inactivated
 and placed on the free list.
-Since the functions might need to call VOPs for the vnode, the
-.Va Giant
-mutex should be conditionally locked around the call.
+.Pp
+The
+.Fn vrele
+function may lock the vnode.
+All three functions may sleep.
 .Pp
 The hold count for the vnode is always greater or equal to the usecount.
 Non-forced unmount fails when mount point owns a vnode that has non-zero
___
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: r296558 - stable/10/sys/netipsec

2016-03-09 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar  9 10:01:28 2016
New Revision: 296558
URL: https://svnweb.freebsd.org/changeset/base/296558

Log:
  MFC r295967:
Fix useless check. m_pkthdr.len should be equal to orglen.

Modified:
  stable/10/sys/netipsec/key.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netipsec/key.c
==
--- stable/10/sys/netipsec/key.cWed Mar  9 09:12:40 2016
(r296557)
+++ stable/10/sys/netipsec/key.cWed Mar  9 10:01:28 2016
(r296558)
@@ -7245,8 +7245,7 @@ key_parse(struct mbuf *m, struct socket 
orglen = PFKEY_UNUNIT64(msg->sadb_msg_len);
target = KEY_SENDUP_ONE;
 
-   if ((m->m_flags & M_PKTHDR) == 0 ||
-   m->m_pkthdr.len != m->m_pkthdr.len) {
+   if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len != orglen) {
ipseclog((LOG_DEBUG, "%s: invalid message length.\n",__func__));
PFKEYSTAT_INC(out_invlen);
error = EINVAL;
___
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: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-03-09 Thread Renato Botelho
> On Mar 8, 2016, at 17:33, Jean-Sébastien Pédron  wrote:
> 
> Author: dumbbell
> Date: Tue Mar  8 20:33:02 2016
> New Revision: 296548
> URL: https://svnweb.freebsd.org/changeset/base/296548
> 
> Log:
>  drm/i915: Update to match Linux 3.8.13
> 
>  This update brings initial support for Haswell GPUs.
> 
>  Tested by:   Many users of FreeBSD, PC-BSD and HardenedBSD
>  Relnotes:yes
>  Sponsored by:The FreeBSD Foundation
>  Differential Revision:   https://reviews.freebsd.org/D5554

I cannot boot anymore after moving to this revision. My laptop is a ThinkPad 
T430 (IvyBridge).

I got some warnings like

info: [drm] MTRR allocation failed.  Graphics performance may suffer.

and in the end it just stops with these last 3 messages:

info: [drm] MSI enabled 1 message(s)
info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
info: [drm] Driver supports precise vblank timestamp query.

And never pass this point.

By default I’m using GENERIC-NODEBUG, I’ll boot with old kernel and rebuild it 
using GENERIC to make sure I can collect more data.
--
Renato Botelho

___
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: r296465 - in releng/9.3: . crypto/openssl crypto/openssl/apps crypto/openssl/bugs crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf cr

2016-03-09 Thread Xin Li
FYI -- I can confirm that libcrypto is broken and have a reliable way to
trigger it.

So far I was able to narrow down this to this change and here is a
temporary workaround (which will reintroduce CVE-2016-0702).

Cheers,
Index: crypto/openssl/crypto/bn/bn.h
===
--- crypto/openssl/crypto/bn/bn.h   (revision 296556)
+++ crypto/openssl/crypto/bn/bn.h   (working copy)
@@ -69,13 +69,13 @@
  *
  */
 
-#ifndef HEADER_BN_H
-# define HEADER_BN_H
-
-# include 
-# include 
-# ifndef OPENSSL_NO_FP_API
-#  include /* FILE */
+#ifndef HEADER_BN_H
+# define HEADER_BN_H
+
+# include 
+# include 
+# ifndef OPENSSL_NO_FP_API
+#  include /* FILE */
 # endif
 # include 
 
@@ -702,23 +702,23 @@ const BIGNUM *BN_get0_nist_prime_224(void);
 const BIGNUM *BN_get0_nist_prime_256(void);
 const BIGNUM *BN_get0_nist_prime_384(void);
 const BIGNUM *BN_get0_nist_prime_521(void);
-
-/* library internal functions */
-
-# define bn_expand(a,bits) \
-( \
-bits > (INT_MAX - BN_BITS2 + 1) ? \
-NULL \
-: \
-(((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \
-(a) \
-: \
-bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \
-)
-
-# define bn_wexpand(a,words) (((words) <= 
(a)->dmax)?(a):bn_expand2((a),(words)))
-BIGNUM *bn_expand2(BIGNUM *a, int words);
-# ifndef OPENSSL_NO_DEPRECATED
+
+/* library internal functions */
+
+# define bn_expand(a,bits) \
+( \
+bits > (INT_MAX - BN_BITS2 + 1) ? \
+NULL \
+: \
+(((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \
+(a) \
+: \
+bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \
+)
+
+# define bn_wexpand(a,words) (((words) <= 
(a)->dmax)?(a):bn_expand2((a),(words)))
+BIGNUM *bn_expand2(BIGNUM *a, int words);
+# ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */
 # endif
 
Index: crypto/openssl/crypto/bn/bn_exp.c
===
--- crypto/openssl/crypto/bn/bn_exp.c   (revision 296556)
+++ crypto/openssl/crypto/bn/bn_exp.c   (working copy)
@@ -107,13 +107,12 @@
  * (e...@cryptsoft.com).  This product includes software written by Tim
  * Hudson (t...@cryptsoft.com).
  *
- */
-
-#include "cryptlib.h"
-#include "constant_time_locl.h"
-#include "bn_lcl.h"
-
-/* maximum precomputation table size for *variable* sliding windows */
+ */
+
+#include "cryptlib.h"
+#include "bn_lcl.h"
+
+/* maximum precomputation table size for *variable* sliding windows */
 #define TABLE_SIZE  32
 
 /* this one works - simple but works */
@@ -521,79 +520,41 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, c
  * pattern as far as cache lines are concerned.  The following functions are
  * used to transfer a BIGNUM from/to that table.
  */
-
-static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top,
-unsigned char *buf, int idx,
-int window)
-{
-int i, j;
-int width = 1 << window;
-BN_ULONG *table = (BN_ULONG *)buf;
-
-if (bn_wexpand(b, top) == NULL)
-return 0;
+
+static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top,
+unsigned char *buf, int idx,
+int width)
+{
+size_t i, j;
+
+if (bn_wexpand(b, top) == NULL)
+return 0;
 while (b->top < top) {
-b->d[b->top++] = 0;
-}
-
-for (i = 0, j = idx; i < top; i++, j += width) {
-table[j] = b->d[i];
-}
-
-bn_correct_top(b);
+b->d[b->top++] = 0;
+}
+
+for (i = 0, j = idx; i < top * sizeof b->d[0]; i++, j += width) {
+buf[j] = ((unsigned char *)b->d)[i];
+}
+
+bn_correct_top(b);
 return 1;
 }
-
-static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
-  unsigned char *buf, int idx,
-  int window)
-{
-int i, j;
-int width = 1 << window;
-volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
-
-if (bn_wexpand(b, top) == NULL)
-return 0;
-
-if (window <= 3) {
-for (i = 0; i < top; i++, table += width) {
-BN_ULONG acc = 0;
-
-for (j = 0; j < width; j++) {
-acc |= table[j] &
-   ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
-}
-
-b->d[i] = acc;
-}
-} else {
-int xstride = 1 << (window - 2);
-BN_ULONG y0, y1, y2, y3;
-
-i = idx >> (window - 2);/* equivalent of idx / xstride */
-idx &= xstride - 1; /* equivalent of idx % xstride */
-
-y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);
-y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1);
-y2 = (BN_ULONG)0 - 

Re: svn commit: r296465 - in releng/9.3: . crypto/openssl crypto/openssl/apps crypto/openssl/bugs crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf cr

2016-03-09 Thread Antoine Brodin
On Wed, Mar 9, 2016 at 12:47 AM, Xin LI  wrote:
> This may be related to the BN changes (CVE-2016-0797 and/or
> CVE-2016-0702).  Will reverting just that portion of r296462 (stable/9
> patch would apply on 9.3 as well) help?  This would help to narrow
> down the root cause.
>
> I can't really do any debugging right now but will take a look as soon as I 
> can.

fetch is also having Segmentation faults on some https sites after the
9.3-RELEASE-p37 update,  see for instance:
http://beefy2.nyi.freebsd.org/data/93amd64-default/410591/logs/errors/waifu2x-converter-cpp-1.0.0.410.log
http://beefy2.nyi.freebsd.org/data/93amd64-default/410591/logs/errors/narcissu2-1.1.log

Antoine

> On Tue, Mar 8, 2016 at 2:45 PM, Mathieu Arnold  wrote:
>>
>>
>> +--On 8 mars 2016 09:01:04 -0800 Bryan Drewery  wrote:
>> | On 3/8/2016 8:52 AM, Mathieu Arnold wrote:
>> |> +--On 8 mars 2016 08:48:27 -0800 Bryan Drewery 
>> |> wrote:
>> |> | On 3/8/2016 8:47 AM, Bryan Drewery wrote:
>> |> |> On 3/8/2016 8:35 AM, Mathieu Arnold wrote:
>> |> |>> +--On 8 mars 2016 08:29:41 -0800 Bryan Drewery 
>> |> |>> wrote:
>> |> |>> | On 3/8/2016 8:28 AM, Mathieu Arnold wrote:
>> |> |>> |> +--On 8 mars 2016 08:25:44 -0800 Bryan Drewery
>> |> |>> |>  wrote:
>> |> |>> |> | On 3/7/2016 4:29 PM, Mathieu Arnold wrote:
>> |> |>> |> |> +--On 7 mars 2016 16:22:12 + Xin LI 
>> |> |>> |> |> wrote:
>> |> |>> |> |> | Author: delphij
>> |> |>> |> |> | Date: Mon Mar  7 16:22:11 2016
>> |> |>> |> |> | New Revision: 296465
>> |> |>> |> |> | URL: https://svnweb.freebsd.org/changeset/base/296465
>> |> |>> |> |> |
>> |> |>> |> |> | Log:
>> |> |>> |> |> |   Fix multiple OpenSSL vulnerabilities.
>> |> |>> |> |> |
>> |> |>> |> |> |   Security:  FreeBSD-SA-16:12.openssl
>> |> |>> |> |> |   Approved by:   so
>> |> |>> |> |>
>> |> |>> |> |> After that, poudriere bulk fails with:
>> |> |>> |> |>
>> |> |>> |> |> [00:00:07] >> Creating pkgng repository
>> |> |>> |> |> Creating repository in /tmp/packages: 100%
>> |> |>> |> |> Packing files for repository:   0%Child process pid=50970
>> |> |>> |> |> terminated abnormally: Segmentation fault: 11
>> |> |>> |> |> [00:00:08] >> Cleaning up
>> |> |>> |> |> 9amd64-pkgng-default: removed
>> |> |>> |> |> 9amd64-pkgng-default-n: removed
>> |> |>> |> |>
>> |> |>> |> |> pkg-static is the one doing the segfault...
>> |> |>> |> |>
>> |> |>> |> |
>> |> |>> |> | Is QEMU involved here?
>> |> |>> |> |
>> |> |>> |> | Do you have PKG_REPO_FROM_HOST or PKG_REPO_SIGNING_KEY set? (Not
>> |> |>> |> | saying you should)
>> |> |>> |>
>> |> |>> |> No, it's a regular 9amd64 build on a 10.2 amd64 host.
>> |> |>> |>
>> |> |>> |
>> |> |>> | Can you please rebuild pkg with debug symbols and then run your 9.3
>> |> |>> | version against the repo in gdb?
>> |> |>>
>> |> |>> I could yes, but not today, tomorrow at the earliest.  How do I build
>> |> |>> the port with debug symbols ?
>> |> |>>
>> |> |>
>> |> |> WITH_DEBUG=yes make
>> |> |>
>> |> |
>> |> | You might need this too: DEBUG_FLAGS="-g -O0"
>> |>
>> |> Mmmm, ok, what commands do I need to run ?
>> |>
>> |
>> | (assuming devel/gdb installed)
>> | gdb710 --args /usr/local/sbin/pkg-static repo 
>> |# run
>> | 
>> |# bt full
>>
>> Ok, so, it's 9.3, so there's no gdb710, but:
>>
>>
>> the command ran is:
>>
>> root@pkg:/tmp/foo # pkg repo . ../repo.key
>> Creating repository in .: 100%
>> Packing files for repository:   0%Child process pid=16312 terminated
>> abnormally: Segmentation fault: 11
>> root@pkg:/tmp/foo # gdb /usr/local/sbin/pkg pkg.core
>> GNU gdb 6.1.1 [FreeBSD]
>> Copyright 2004 Free Software Foundation, Inc.
>> GDB is free software, covered by the GNU General Public License, and you are
>> welcome to change it and/or distribute copies of it under certain
>> conditions.
>> Type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB.  Type "show warranty" for details.
>> This GDB was configured as "amd64-marcel-freebsd"...
>> Core was generated by `pkg'.
>> Program terminated with signal 11, Segmentation fault.
>> Reading symbols from /usr/local/lib/libpkg.so.3...done.
>> Loaded symbols for /usr/local/lib/libpkg.so.3
>> Reading symbols from /lib/libutil.so.9...done.
>> Loaded symbols for /lib/libutil.so.9
>> Reading symbols from /usr/lib/libssl.so.6...done.
>> Loaded symbols for /usr/lib/libssl.so.6
>> Reading symbols from /lib/libcrypto.so.6...done.
>> Loaded symbols for /lib/libcrypto.so.6
>> Reading symbols from /lib/libm.so.5...done.
>> Loaded symbols for /lib/libm.so.5
>> Reading symbols from /usr/lib/libelf.so.1...done.
>> Loaded symbols for /usr/lib/libelf.so.1
>> Reading symbols from /lib/libjail.so.1...done.
>> Loaded symbols for /lib/libjail.so.1
>> Reading symbols from /usr/lib/libarchive.so.5...done.
>> Loaded symbols for /usr/lib/libarchive.so.5
>> Reading symbols from /lib/libz.so.6...done.
>> 

svn commit: r296557 - head/sys/compat/linux

2016-03-09 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar  9 09:12:40 2016
New Revision: 296557
URL: https://svnweb.freebsd.org/changeset/base/296557

Log:
  Add support for IPPROTO_IPV6 socket layer for getsockopt/setsockopt calls.
  Also add mapping for several options from RFC 3493 and 3542.
  
  Reviewed by:  dchagin
  Tested by:Joe Love 
  MFC after:2 weeks

Modified:
  head/sys/compat/linux/linux_socket.c
  head/sys/compat/linux/linux_socket.h

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cWed Mar  9 03:22:23 2016
(r296556)
+++ head/sys/compat/linux/linux_socket.cWed Mar  9 09:12:40 2016
(r296557)
@@ -289,6 +289,63 @@ linux_to_bsd_ip_sockopt(int opt)
 }
 
 static int
+linux_to_bsd_ip6_sockopt(int opt)
+{
+
+   switch (opt) {
+   case LINUX_IPV6_NEXTHOP:
+   return (IPV6_NEXTHOP);
+   case LINUX_IPV6_UNICAST_HOPS:
+   return (IPV6_UNICAST_HOPS);
+   case LINUX_IPV6_MULTICAST_IF:
+   return (IPV6_MULTICAST_IF);
+   case LINUX_IPV6_MULTICAST_HOPS:
+   return (IPV6_MULTICAST_HOPS);
+   case LINUX_IPV6_MULTICAST_LOOP:
+   return (IPV6_MULTICAST_LOOP);
+   case LINUX_IPV6_ADD_MEMBERSHIP:
+   return (IPV6_JOIN_GROUP);
+   case LINUX_IPV6_DROP_MEMBERSHIP:
+   return (IPV6_LEAVE_GROUP);
+   case LINUX_IPV6_V6ONLY:
+   return (IPV6_V6ONLY);
+   case LINUX_IPV6_DONTFRAG:
+   return (IPV6_DONTFRAG);
+#if 0
+   case LINUX_IPV6_CHECKSUM:
+   return (IPV6_CHECKSUM);
+   case LINUX_IPV6_RECVPKTINFO:
+   return (IPV6_RECVPKTINFO);
+   case LINUX_IPV6_PKTINFO:
+   return (IPV6_PKTINFO);
+   case LINUX_IPV6_RECVHOPLIMIT:
+   return (IPV6_RECVHOPLIMIT);
+   case LINUX_IPV6_HOPLIMIT:
+   return (IPV6_HOPLIMIT);
+   case LINUX_IPV6_RECVHOPOPTS:
+   return (IPV6_RECVHOPOPTS);
+   case LINUX_IPV6_HOPOPTS:
+   return (IPV6_HOPOPTS);
+   case LINUX_IPV6_RTHDRDSTOPTS:
+   return (IPV6_RTHDRDSTOPTS);
+   case LINUX_IPV6_RECVRTHDR:
+   return (IPV6_RECVRTHDR);
+   case LINUX_IPV6_RTHDR:
+   return (IPV6_RTHDR);
+   case LINUX_IPV6_RECVDSTOPTS:
+   return (IPV6_RECVDSTOPTS);
+   case LINUX_IPV6_DSTOPTS:
+   return (IPV6_DSTOPTS);
+   case LINUX_IPV6_RECVPATHMTU:
+   return (IPV6_RECVPATHMTU);
+   case LINUX_IPV6_PATHMTU:
+   return (IPV6_PATHMTU);
+#endif
+   }
+   return (-1);
+}
+
+static int
 linux_to_bsd_so_sockopt(int opt)
 {
 
@@ -1529,6 +1586,9 @@ linux_setsockopt(struct thread *td, stru
case IPPROTO_IP:
name = linux_to_bsd_ip_sockopt(args->optname);
break;
+   case IPPROTO_IPV6:
+   name = linux_to_bsd_ip6_sockopt(args->optname);
+   break;
case IPPROTO_TCP:
name = linux_to_bsd_tcp_sockopt(args->optname);
break;
@@ -1615,6 +1675,9 @@ linux_getsockopt(struct thread *td, stru
case IPPROTO_IP:
name = linux_to_bsd_ip_sockopt(args->optname);
break;
+   case IPPROTO_IPV6:
+   name = linux_to_bsd_ip6_sockopt(args->optname);
+   break;
case IPPROTO_TCP:
name = linux_to_bsd_tcp_sockopt(args->optname);
break;

Modified: head/sys/compat/linux/linux_socket.h
==
--- head/sys/compat/linux/linux_socket.hWed Mar  9 03:22:23 2016
(r296556)
+++ head/sys/compat/linux/linux_socket.hWed Mar  9 09:12:40 2016
(r296557)
@@ -302,6 +302,31 @@ int linux_getsockopt(struct thread *td, 
 #defineLINUX_IP_ADD_MEMBERSHIP 35
 #defineLINUX_IP_DROP_MEMBERSHIP36
 
+#defineLINUX_IPV6_CHECKSUM 7
+#defineLINUX_IPV6_NEXTHOP  9
+#defineLINUX_IPV6_UNICAST_HOPS 16
+#defineLINUX_IPV6_MULTICAST_IF 17
+#defineLINUX_IPV6_MULTICAST_HOPS   18
+#defineLINUX_IPV6_MULTICAST_LOOP   19
+#defineLINUX_IPV6_ADD_MEMBERSHIP   20
+#defineLINUX_IPV6_DROP_MEMBERSHIP  21
+#defineLINUX_IPV6_V6ONLY   26
+
+#defineLINUX_IPV6_RECVPKTINFO  49
+#defineLINUX_IPV6_PKTINFO  50
+#defineLINUX_IPV6_RECVHOPLIMIT 51
+#defineLINUX_IPV6_HOPLIMIT 52
+#defineLINUX_IPV6_RECVHOPOPTS  53
+#defineLINUX_IPV6_HOPOPTS  54
+#defineLINUX_IPV6_RTHDRDSTOPTS 55
+#defineLINUX_IPV6_RECVRTHDR56
+#defineLINUX_IPV6_RTHDR57
+#defineLINUX_IPV6_RECVDSTOPTS  

Re: svn commit: r296543 - head/sys/compat/linux

2016-03-09 Thread Bruce Evans

On Tue, 8 Mar 2016, Dmitry Chagin wrote:


Log:
 Put a commit message from r296502 about Linux alarm() system call
 behaviour to the source.
...
Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Tue Mar  8 19:08:55 2016
(r296542)
+++ head/sys/compat/linux/linux_misc.c  Tue Mar  8 19:20:57 2016
(r296543)
@@ -206,6 +206,11 @@ linux_alarm(struct thread *td, struct li
it.it_value.tv_usec = 0;
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 0;
+   /*
+* According to POSIX and Linux implementation
+* the alarm() system call is always successfull.
+* Ignore errors and return 0 as a Linux do.
+*/


Why does this need a comment referring to external sources?  FreeBSD's
own man page also says that there is no error return for alarm(3).
However, the man page and the implementation are quite broken.  The
implementation in libc does have an error return, but this is
undocumented.  The documentation says that that the maximum number of
seconds is 1 (100 million), but doesn't say what happens when
this limit is exceeded.  The implementation of this is broken too.
What actually happens for the libc version is:
- secs <= 100 million works in all kernel versions
- in old kernel versions, secs > 100 million fails to set the alarm;
  it sets errno to EINVAL and returns (u_int)-1 to misindicate the error
- in FreeBSD-~[6-9], secs > 100 million works with 64-bit time_t.  With
  32-bit time_t, secs > INT_MAX fails; secs between INT_MAX and about
  1000 million (= the time from now until overflow) causes undefined
  behaviour due to overflow, but this might simulate working; secs between
  about 1000 million and 100 million work.
- in FreeBSD-~[10-current], secs > INT32_MAX / 2 fail and other cases have
  a chance of working.  In the failing cases, the error is misindicated as
  in old versions except for the different threshold.


kern_setitimer(td, ITIMER_REAL, , _it);


Removing the error check broke this completely.


if (timevalisset(_it.it_value)) {
if (old_it.it_value.tv_usec != 0)


old_it is stack garbage when kern_setitimer() fails.  The value in
this stack garbage is now returned and errno is not set.  When the
error was checked, the consistent garbage value (u_int)-1 was returned,
and errno was not set.

This function worked almost correctly in FreeBSD-5, by duplicating
most of the internals of setitimer() including its limit of 100 million
which was not broken then.  This limit was to avoid overflow with 32-bit
time_t unless the current time is after year 2035.  It was broken in
2005.  It remained just broken with 32-bit time_t until FreeBSD-9.
Starting in FreeBSD-10, sbintime_t is used.  This reduces the brokenness
with 32-bit time_t but increases it with 64-bit time_t.  sbintime_t has
the same signed 32-bit limit for seconds as 32-bit time_t.  New ittimer
code using sbintime_t is more careful about overflow, but it cannot
support alarm() or large times in setitimer() even with 64-bit time_t.
It actually enforces a limit of INT32_MAX / 2 (~ 1000 million) and
doesn't documement this, where old code enforces a limit of 100 million
and does document this.  Man pages still document the old limit, but
no implmentations of alarm() except the old one for linux are aware
of this.

Complete description of bugs in this function:

X int
X linux_alarm(struct thread *td, struct linux_alarm_args *args)
X {
X   struct itimerval it, old_it;
X   u_int secs;
X 
X #ifdef DEBUG

X   if (ldebug(alarm))
X   printf(ARGS(alarm, "%u"), args->secs);
X #endif
X 
X 	secs = args->secs;

X

Style bug: extra blank line to separate related code.  Strict KNF doesn't
even allow blank lines to separate unrelated code.  The one after the
DEBUG ifdef is an example.  But bugs in indent(1) give extra blank lines
for ifdefs.

X   if (secs > INT_MAX)
X   secs = INT_MAX;

A bounds check is needed, but this one is very wrong.  We are going to
assign secs to tv_sec, and need to ensure that this doesn't overflow.
tv_sec used to have type long, so the correct limit for this was LONG_MAX.
POSIX broke this type, and FreeBSD was broken to conform in 2005.  Then
the correct limit became TIME_T_MAX, but this is unavailable under that
spelling.  INT_MAX accidentally works as well as possible for its intended
purpose it time_t is 32 bits and int is also 32 bits, but if time_t is
64-bits then it unnecessarily breaks alarm() in versions before sbintime_t.

However, the limit of INT_MAX doesn't work for the purpose of breaking
alarm() as little as possible.  It just ensured that kern_setitimer()
and thus this function always fails if kern_settimer() enforced its
documented limit of 100 million.  I think the change to use this limit
was made after setitimer()'s limit was broken.  Then this limit