svn commit: r314381 - in stable/11/sys: cam/scsi dev/advansys dev/aha dev/ahci dev/arcmsr dev/ata dev/buslogic dev/hptmv dev/mvs dev/ncr dev/siis dev/sym dev/trm

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 06:46:41 2017
New Revision: 314381
URL: https://svnweb.freebsd.org/changeset/base/314381

Log:
  MFC r313949: Remove dead mentions of CAM target mode APIs from drivers.
  
  This makes grepping kernel for target mode implementation much easier.

Modified:
  stable/11/sys/cam/scsi/scsi_low.c
  stable/11/sys/dev/advansys/advansys.c
  stable/11/sys/dev/aha/aha.c
  stable/11/sys/dev/ahci/ahci.c
  stable/11/sys/dev/arcmsr/arcmsr.c
  stable/11/sys/dev/ata/ata-all.c
  stable/11/sys/dev/buslogic/bt.c
  stable/11/sys/dev/hptmv/entry.c
  stable/11/sys/dev/mvs/mvs.c
  stable/11/sys/dev/ncr/ncr.c
  stable/11/sys/dev/siis/siis.c
  stable/11/sys/dev/sym/sym_hipd.c
  stable/11/sys/dev/trm/trm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/scsi/scsi_low.c
==
--- stable/11/sys/cam/scsi/scsi_low.c   Tue Feb 28 06:32:01 2017
(r314380)
+++ stable/11/sys/cam/scsi/scsi_low.c   Tue Feb 28 06:46:41 2017
(r314381)
@@ -479,15 +479,6 @@ scsi_low_scsi_action_cam(sim, ccb)
 #endif /* SCSI_LOW_DEBUG */
break;
 
-   case XPT_EN_LUN:/* Enable LUN as a target */
-   case XPT_TARGET_IO: /* Execute target I/O request */
-   case XPT_ACCEPT_TARGET_IO:  /* Accept Host Target Mode CDB */
-   case XPT_CONT_TARGET_IO:/* Continue Host Target I/O Connection*/
-   /* XXX Implement */
-   ccb->ccb_h.status = CAM_REQ_INVALID;
-   xpt_done(ccb);
-   break;
-
case XPT_ABORT: /* Abort the specified CCB */
 #ifdef SCSI_LOW_DIAGNOSTIC
if (target == CAM_TARGET_WILDCARD || lun == CAM_LUN_WILDCARD)

Modified: stable/11/sys/dev/advansys/advansys.c
==
--- stable/11/sys/dev/advansys/advansys.c   Tue Feb 28 06:32:01 2017
(r314380)
+++ stable/11/sys/dev/advansys/advansys.c   Tue Feb 28 06:46:41 2017
(r314381)
@@ -233,10 +233,6 @@ adv_action(struct cam_sim *sim, union cc
break;
}
case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */
-   case XPT_TARGET_IO: /* Execute target I/O request */
-   case XPT_ACCEPT_TARGET_IO:  /* Accept Host Target Mode CDB */
-   case XPT_CONT_TARGET_IO:/* Continue Host Target I/O Connection*/
-   case XPT_EN_LUN:/* Enable LUN as a target */
case XPT_ABORT: /* Abort the specified CCB */
/* XXX Implement */
ccb->ccb_h.status = CAM_REQ_INVALID;

Modified: stable/11/sys/dev/aha/aha.c
==
--- stable/11/sys/dev/aha/aha.c Tue Feb 28 06:32:01 2017(r314380)
+++ stable/11/sys/dev/aha/aha.c Tue Feb 28 06:46:41 2017(r314381)
@@ -838,10 +838,6 @@ ahaaction(struct cam_sim *sim, union ccb
}
break;
}
-   case XPT_EN_LUN:/* Enable LUN as a target */
-   case XPT_TARGET_IO: /* Execute target I/O request */
-   case XPT_ACCEPT_TARGET_IO:  /* Accept Host Target Mode CDB */
-   case XPT_CONT_TARGET_IO:/* Continue Host Target I/O Connection*/
case XPT_ABORT: /* Abort the specified CCB */
/* XXX Implement */
ccb->ccb_h.status = CAM_REQ_INVALID;

Modified: stable/11/sys/dev/ahci/ahci.c
==
--- stable/11/sys/dev/ahci/ahci.c   Tue Feb 28 06:32:01 2017
(r314380)
+++ stable/11/sys/dev/ahci/ahci.c   Tue Feb 28 06:46:41 2017
(r314381)
@@ -2570,10 +2570,6 @@ ahciaction(struct cam_sim *sim, union cc
}
ahci_begin_transaction(ch, ccb);
return;
-   case XPT_EN_LUN:/* Enable LUN as a target */
-   case XPT_TARGET_IO: /* Execute target I/O request */
-   case XPT_ACCEPT_TARGET_IO:  /* Accept Host Target Mode CDB */
-   case XPT_CONT_TARGET_IO:/* Continue Host Target I/O Connection*/
case XPT_ABORT: /* Abort the specified CCB */
/* XXX Implement */
ccb->ccb_h.status = CAM_REQ_INVALID;

Modified: stable/11/sys/dev/arcmsr/arcmsr.c
==
--- stable/11/sys/dev/arcmsr/arcmsr.c   Tue Feb 28 06:32:01 2017
(r314380)
+++ stable/11/sys/dev/arcmsr/arcmsr.c   Tue Feb 28 06:46:41 2017
(r314381)
@@ -2883,12 +2883,6 @@ static void arcmsr_action(struct cam_sim
}
break;
}
-   case XPT_TARGET_IO: {
-   /* target mode not yet support vendor specific 
commands. */

svn commit: r314380 - stable/10/sys/cam/ctl

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 06:32:01 2017
New Revision: 314380
URL: https://svnweb.freebsd.org/changeset/base/314380

Log:
  MFC r313744: No need to erase sense_data when sense_len is set to zero.

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

Modified: stable/10/sys/cam/ctl/ctl_error.c
==
--- stable/10/sys/cam/ctl/ctl_error.c   Tue Feb 28 06:31:34 2017
(r314379)
+++ stable/10/sys/cam/ctl/ctl_error.c   Tue Feb 28 06:32:01 2017
(r314380)
@@ -920,10 +920,7 @@ ctl_set_data_phase_error(struct ctl_scsi
 void
 ctl_set_reservation_conflict(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SCSI_ERROR;
@@ -932,10 +929,7 @@ ctl_set_reservation_conflict(struct ctl_
 void
 ctl_set_queue_full(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_QUEUE_FULL;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SCSI_ERROR;
@@ -944,10 +938,7 @@ ctl_set_queue_full(struct ctl_scsiio *ct
 void
 ctl_set_busy(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_BUSY;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SCSI_ERROR;
@@ -956,10 +947,7 @@ ctl_set_busy(struct ctl_scsiio *ctsio)
 void
 ctl_set_task_aborted(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_CMD_ABORTED;
@@ -992,10 +980,7 @@ ctl_set_space_alloc_fail(struct ctl_scsi
 void
 ctl_set_success(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_OK;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SUCCESS;
___
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: r314379 - stable/11/sys/cam/ctl

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 06:31:34 2017
New Revision: 314379
URL: https://svnweb.freebsd.org/changeset/base/314379

Log:
  MFC r313744: No need to erase sense_data when sense_len is set to zero.

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

Modified: stable/11/sys/cam/ctl/ctl_error.c
==
--- stable/11/sys/cam/ctl/ctl_error.c   Tue Feb 28 06:30:42 2017
(r314378)
+++ stable/11/sys/cam/ctl/ctl_error.c   Tue Feb 28 06:31:34 2017
(r314379)
@@ -920,10 +920,7 @@ ctl_set_data_phase_error(struct ctl_scsi
 void
 ctl_set_reservation_conflict(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SCSI_ERROR;
@@ -932,10 +929,7 @@ ctl_set_reservation_conflict(struct ctl_
 void
 ctl_set_queue_full(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_QUEUE_FULL;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SCSI_ERROR;
@@ -944,10 +938,7 @@ ctl_set_queue_full(struct ctl_scsiio *ct
 void
 ctl_set_busy(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_BUSY;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SCSI_ERROR;
@@ -956,10 +947,7 @@ ctl_set_busy(struct ctl_scsiio *ctsio)
 void
 ctl_set_task_aborted(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_CMD_ABORTED;
@@ -992,10 +980,7 @@ ctl_set_space_alloc_fail(struct ctl_scsi
 void
 ctl_set_success(struct ctl_scsiio *ctsio)
 {
-   struct scsi_sense_data *sense;
 
-   sense = >sense_data;
-   memset(sense, 0, sizeof(*sense));
ctsio->scsi_status = SCSI_STATUS_OK;
ctsio->sense_len = 0;
ctsio->io_hdr.status = CTL_SUCCESS;
___
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: r314378 - stable/11/sys/dev/iscsi

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 06:30:42 2017
New Revision: 314378
URL: https://svnweb.freebsd.org/changeset/base/314378

Log:
  MFC r313739: Directly call m_gethdr() instead of m_getm2() for BHS.
  
  All this code is based on assumption that data will be stored in one piece,
  and since buffer size if known and fixed, it is easier to hardcode it.

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

Modified: stable/11/sys/dev/iscsi/icl_soft.c
==
--- stable/11/sys/dev/iscsi/icl_soft.c  Tue Feb 28 06:29:44 2017
(r314377)
+++ stable/11/sys/dev/iscsi/icl_soft.c  Tue Feb 28 06:30:42 2017
(r314378)
@@ -260,8 +260,8 @@ icl_soft_conn_new_pdu(struct icl_conn *i
if (ip == NULL)
return (NULL);
 
-   ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs),
-   flags, MT_DATA, M_PKTHDR);
+   CTASSERT(sizeof(struct iscsi_bhs) <= MHLEN);
+   ip->ip_bhs_mbuf = m_gethdr(flags, MT_DATA);
if (ip->ip_bhs_mbuf == NULL) {
ICL_WARN("failed to allocate BHS mbuf");
icl_pdu_free(ip);
___
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: r314377 - stable/11/sys/dev/iscsi

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 06:29:44 2017
New Revision: 314377
URL: https://svnweb.freebsd.org/changeset/base/314377

Log:
  MFC r313731: Do not rely on data alignment after m_pullup().
  
  In general case m_pullup() does not really guarantee any data alignment.
  Instead of depenting on side effects caused by data being always copied
  out of mbuf cluster (which is probably a bug by itself), always allocate
  aligned BHS buffer and read data there directly from socket.
  
  While there, reuse new icl_conn_receive_buf() function to read digests.
  The code could probably be even more optimized to aggregate those reads,
  but until that done, this is still easier then the way it was before.

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

Modified: stable/11/sys/dev/iscsi/icl_soft.c
==
--- stable/11/sys/dev/iscsi/icl_soft.c  Tue Feb 28 06:28:17 2017
(r314376)
+++ stable/11/sys/dev/iscsi/icl_soft.c  Tue Feb 28 06:29:44 2017
(r314377)
@@ -169,6 +169,40 @@ icl_conn_receive(struct icl_conn *ic, si
return (m);
 }
 
+static int
+icl_conn_receive_buf(struct icl_conn *ic, void *buf, size_t len)
+{
+   struct iovec iov[1];
+   struct uio uio;
+   struct socket *so;
+   int error, flags;
+
+   so = ic->ic_socket;
+
+   memset(, 0, sizeof(uio));
+   iov[0].iov_base = buf;
+   iov[0].iov_len = len;
+   uio.uio_iov = iov;
+   uio.uio_iovcnt = 1;
+   uio.uio_offset = 0;
+   uio.uio_resid = len;
+   uio.uio_segflg = UIO_SYSSPACE;
+   uio.uio_rw = UIO_READ;
+
+   flags = MSG_DONTWAIT;
+   error = soreceive(so, NULL, , NULL, NULL, );
+   if (error != 0) {
+   ICL_DEBUG("soreceive error %d", error);
+   return (-1);
+   }
+   if (uio.uio_resid != 0) {
+   ICL_DEBUG("short read");
+   return (-1);
+   }
+
+   return (0);
+}
+
 static struct icl_pdu *
 icl_pdu_new_empty(struct icl_conn *ic, int flags)
 {
@@ -229,7 +263,7 @@ icl_soft_conn_new_pdu(struct icl_conn *i
ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs),
flags, MT_DATA, M_PKTHDR);
if (ip->ip_bhs_mbuf == NULL) {
-   ICL_WARN("failed to allocate %zd bytes", sizeof(*ip));
+   ICL_WARN("failed to allocate BHS mbuf");
icl_pdu_free(ip);
return (NULL);
}
@@ -308,28 +342,13 @@ icl_pdu_size(const struct icl_pdu *respo
 static int
 icl_pdu_receive_bhs(struct icl_pdu *request, size_t *availablep)
 {
-   struct mbuf *m;
 
-   m = icl_conn_receive(request->ip_conn, sizeof(struct iscsi_bhs));
-   if (m == NULL) {
+   if (icl_conn_receive_buf(request->ip_conn,
+   request->ip_bhs, sizeof(struct iscsi_bhs))) {
ICL_DEBUG("failed to receive BHS");
return (-1);
}
 
-   request->ip_bhs_mbuf = m_pullup(m, sizeof(struct iscsi_bhs));
-   if (request->ip_bhs_mbuf == NULL) {
-   ICL_WARN("m_pullup failed");
-   return (-1);
-   }
-   request->ip_bhs = mtod(request->ip_bhs_mbuf, struct iscsi_bhs *);
-
-   /*
-* XXX: For architectures with strict alignment requirements
-*  we may need to allocate ip_bhs and copy the data into it.
-*  For some reason, though, not doing this doesn't seem
-*  to cause problems; tested on sparc64.
-*/
-
*availablep -= sizeof(struct iscsi_bhs);
return (0);
 }
@@ -371,22 +390,17 @@ icl_mbuf_to_crc32c(const struct mbuf *m0
 static int
 icl_pdu_check_header_digest(struct icl_pdu *request, size_t *availablep)
 {
-   struct mbuf *m;
uint32_t received_digest, valid_digest;
 
if (request->ip_conn->ic_header_crc32c == false)
return (0);
 
-   m = icl_conn_receive(request->ip_conn, ISCSI_HEADER_DIGEST_SIZE);
-   if (m == NULL) {
+   CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE);
+   if (icl_conn_receive_buf(request->ip_conn,
+   _digest, ISCSI_HEADER_DIGEST_SIZE)) {
ICL_DEBUG("failed to receive header digest");
return (-1);
}
-
-   CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE);
-   m_copydata(m, 0, ISCSI_HEADER_DIGEST_SIZE, (void *)_digest);
-   m_freem(m);
-
*availablep -= ISCSI_HEADER_DIGEST_SIZE;
 
/* Temporary attach AHS to BHS to calculate header digest. */
@@ -526,7 +540,6 @@ icl_pdu_receive_data_segment(struct icl_
 static int
 icl_pdu_check_data_digest(struct icl_pdu *request, size_t *availablep)
 {
-   struct mbuf *m;
uint32_t received_digest, valid_digest;
 
if (request->ip_conn->ic_data_crc32c == false)
@@ -535,16 +548,12 @@ icl_pdu_check_data_digest(struct icl_pdu
if (request->ip_data_len == 0)
return (0);
 
- 

svn commit: r314376 - stable/11/sys/dev/iscsi

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 06:28:17 2017
New Revision: 314376
URL: https://svnweb.freebsd.org/changeset/base/314376

Log:
  MFC r313738: Temporary attach AHS to BHS to calculate header digest.

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

Modified: stable/11/sys/dev/iscsi/icl_soft.c
==
--- stable/11/sys/dev/iscsi/icl_soft.c  Tue Feb 28 05:24:06 2017
(r314375)
+++ stable/11/sys/dev/iscsi/icl_soft.c  Tue Feb 28 06:28:17 2017
(r314376)
@@ -389,10 +389,10 @@ icl_pdu_check_header_digest(struct icl_p
 
*availablep -= ISCSI_HEADER_DIGEST_SIZE;
 
-   /*
-* XXX: Handle AHS.
-*/
+   /* Temporary attach AHS to BHS to calculate header digest. */
+   request->ip_bhs_mbuf->m_next = request->ip_ahs_mbuf;
valid_digest = icl_mbuf_to_crc32c(request->ip_bhs_mbuf);
+   request->ip_bhs_mbuf->m_next = NULL;
if (received_digest != valid_digest) {
ICL_WARN("header digest check failed; got 0x%x, "
"should be 0x%x", received_digest, valid_digest);
___
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: r314375 - head/sys/dev/firewire

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 05:24:06 2017
New Revision: 314375
URL: https://svnweb.freebsd.org/changeset/base/314375

Log:
  Remove some locking not needed for modern CAM.
  
  This driver is full of LORs.  This change allows to reduce deadlock chance
  from 100% to level that allows some tests to be done.
  
  MFC after:2 weeks

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

Modified: head/sys/dev/firewire/sbp_targ.c
==
--- head/sys/dev/firewire/sbp_targ.cTue Feb 28 05:17:50 2017
(r314374)
+++ head/sys/dev/firewire/sbp_targ.cTue Feb 28 05:24:06 2017
(r314375)
@@ -317,10 +317,8 @@ sbp_targ_post_busreset(void *arg)
unit = >unit;
 
if ((sc->flags & F_FREEZED) == 0) {
-   SBP_LOCK(sc);
sc->flags |= F_FREEZED;
xpt_freeze_simq(sc->sim, /*count*/1);
-   SBP_UNLOCK(sc);
} else {
printf("%s: already freezed\n", __func__);
}
@@ -367,10 +365,8 @@ sbp_targ_post_explore(void *arg)
struct sbp_targ_softc *sc;
 
sc = (struct sbp_targ_softc *)arg;
-   SBP_LOCK(sc);
sc->flags &= ~F_FREEZED;
xpt_release_simq(sc->sim, /*run queue*/TRUE);
-   SBP_UNLOCK(sc);
return;
 }
 
@@ -869,18 +865,14 @@ sbp_targ_cam_done(struct fw_xfer *xfer)
printf("%s: CAM_SEND_STATUS not set 
%0x\n", __func__, ccb->ccb_h.flags);
ccb->ccb_h.status = CAM_REQ_CMP;
}
-   SBP_LOCK(orbi->sc);
xpt_done(ccb);
-   SBP_UNLOCK(orbi->sc);
} else {
orbi->status.len = 1;
sbp_targ_status_FIFO(orbi,
orbi->login->fifo_hi, orbi->login->fifo_lo,
/*dequeue*/1);
ccb->ccb_h.status = CAM_REQ_ABORTED;
-   SBP_LOCK(orbi->sc);
xpt_done(ccb);
-   SBP_UNLOCK(orbi->sc);
}
}
 
@@ -1456,9 +1448,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe
sbp_targ_remove_orb_info(orbi->login, orbi);
free(orbi, M_SBP_TARG);
atio->ccb_h.status = CAM_REQ_ABORTED;
-   SBP_LOCK(orbi->sc);
xpt_done((union ccb*)atio);
-   SBP_UNLOCK(orbi->sc);
goto done0;
}
orbi->state = ORBI_STATUS_ATIO;
@@ -1530,9 +1520,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe
orbi->data_lo = orb[3];
orbi->orb4 = *orb4;
 
-   SBP_LOCK(orbi->sc);
xpt_done((union ccb*)atio);
-   SBP_UNLOCK(orbi->sc);
 done0:
fw_xfer_free(xfer);
return;
@@ -2023,8 +2011,8 @@ sbp_targ_detach(device_t dev)
SBP_LOCK(sc);
xpt_free_path(sc->path);
xpt_bus_deregister(cam_sim_path(sc->sim));
-   SBP_UNLOCK(sc);
cam_sim_free(sc->sim, /*free_devq*/TRUE);
+   SBP_UNLOCK(sc);
 
for (i = 0; i < MAX_LUN; i++) {
lstate = sc->lstate[i];
___
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: r314374 - head/sys/dev/firewire

2017-02-27 Thread Alexander Motin
Author: mav
Date: Tue Feb 28 05:17:50 2017
New Revision: 314374
URL: https://svnweb.freebsd.org/changeset/base/314374

Log:
  Add safety check against too long CDB.
  
  SBP-2 specification defined maximum CDB length as 12 bytes.  Newer SBP-3
  specification allows CDB of any size, but this driver is too old.  Proper
  solution would be to look on maximal ORB size supported by the target.
  
  MFC after:1 week

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

Modified: head/sys/dev/firewire/sbp.c
==
--- head/sys/dev/firewire/sbp.c Tue Feb 28 05:14:42 2017(r314373)
+++ head/sys/dev/firewire/sbp.c Tue Feb 28 05:17:50 2017(r314374)
@@ -2367,6 +2367,11 @@ END_DEBUG
xpt_done(ccb);
return;
}
+   if (csio->cdb_len > sizeof(ocb->orb) - 5 * sizeof(uint32_t)) {
+   ccb->ccb_h.status = CAM_REQ_INVALID;
+   xpt_done(ccb);
+   return;
+   }
 #if 0
/* if we are in probe stage, pass only probe commands */
if (sdev->status == SBP_DEV_PROBE) {
___
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: r314373 - in head: . etc/defaults etc/rc.d lib/libc/regex share/man/man4/man4.i386 share/man/man5 sys/amd64/conf sys/boot/forth sys/compat/svr4 sys/conf sys/dev/streams sys/i386/conf sy...

2017-02-27 Thread Gleb Smirnoff
Author: glebius
Date: Tue Feb 28 05:14:42 2017
New Revision: 314373
URL: https://svnweb.freebsd.org/changeset/base/314373

Log:
  Remove SVR4 (System V Release 4) binary compatibility support.
  
  UNIX System V Release 4 is operating system released in 1988. It ceased
  to exist in early 2000-s.

Deleted:
  head/share/man/man4/man4.i386/streams.4
  head/share/man/man4/man4.i386/svr4.4
  head/sys/compat/svr4/
  head/sys/dev/streams/
  head/sys/i386/svr4/
  head/sys/modules/streams/
  head/sys/modules/svr4/
Modified:
  head/ObsoleteFiles.inc
  head/etc/defaults/rc.conf
  head/etc/rc.d/abi
  head/lib/libc/regex/re_format.7
  head/share/man/man4/man4.i386/Makefile
  head/share/man/man5/rc.conf.5
  head/sys/amd64/conf/NOTES
  head/sys/boot/forth/loader.conf
  head/sys/conf/files
  head/sys/conf/files.i386
  head/sys/conf/options.amd64
  head/sys/conf/options.i386
  head/sys/i386/conf/NOTES
  head/sys/kern/makesyscalls.sh
  head/sys/modules/Makefile
  head/sys/net/if.c
  head/usr.sbin/bsdconfig/startup/include/messages.subr
  head/usr.sbin/bsdconfig/startup/misc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Feb 28 04:48:30 2017(r314372)
+++ head/ObsoleteFiles.inc  Tue Feb 28 05:14:42 2017(r314373)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170226: SVR4 compatibility removed
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/share/man/man4/streams.4
+OLD_FILES+=usr/share/man/man4/svr4.4
+.endif
 # 20170219: OpenPAM RADULA upgrade removed the libpam tests
 OLD_FILES+=usr/tests/lib/libpam/Kyuafile
 OLD_FILES+=usr/tests/lib/libpam/t_openpam_ctype

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Tue Feb 28 04:48:30 2017(r314372)
+++ head/etc/defaults/rc.conf   Tue Feb 28 05:14:42 2017(r314373)
@@ -630,7 +630,6 @@ firstboot_sentinel="/firstboot" # Script
 # Emulation/compatibility services provided by /etc/rc.d/abi
 sysvipc_enable="NO"# Load System V IPC primitives at startup (or NO).
 linux_enable="NO"  # Linux binary compatibility loaded at startup (or NO).
-svr4_enable="NO"   # SysVR4 emulation loaded at startup (or NO).
 clear_tmp_enable="NO"  # Clear /tmp at startup.
 clear_tmp_X="YES"  # Clear and recreate X11-related directories in /tmp
 ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks

Modified: head/etc/rc.d/abi
==
--- head/etc/rc.d/abi   Tue Feb 28 04:48:30 2017(r314372)
+++ head/etc/rc.d/abi   Tue Feb 28 05:14:42 2017(r314373)
@@ -43,25 +43,18 @@ linux_start()
fi
 }
 
-svr4_start()
-{
-   echo -n ' svr4'
-   load_kld -m svr4elf svr4
-}
-
 abi_start()
 {
local _echostop
 
_echostop=
-   if checkyesno sysvipc_enable || checkyesno linux_enable || checkyesno 
svr4_enable; then
+   if checkyesno sysvipc_enable || checkyesno linux_enable; then
echo -n 'Additional ABI support:'
_echostop=yes
fi
 
checkyesno sysvipc_enable && sysv_start
checkyesno linux_enable && linux_start
-   checkyesno svr4_enable && svr4_start
 
[ -n "${_echostop}" ] && echo '.'
 }

Modified: head/lib/libc/regex/re_format.7
==
--- head/lib/libc/regex/re_format.7 Tue Feb 28 04:48:30 2017
(r314372)
+++ head/lib/libc/regex/re_format.7 Tue Feb 28 05:14:42 2017
(r314373)
@@ -319,7 +319,7 @@ The additional word delimiters
 and
 .Ql \e>
 are provided to ease compatibility with traditional
-.Xr svr4 4
+SVR4
 systems but are not portable and should be avoided.
 .Pp
 In the event that an RE could match more than one substring of a given

Modified: head/share/man/man4/man4.i386/Makefile
==
--- head/share/man/man4/man4.i386/Makefile  Tue Feb 28 04:48:30 2017
(r314372)
+++ head/share/man/man4/man4.i386/Makefile  Tue Feb 28 05:14:42 2017
(r314373)
@@ -25,8 +25,6 @@ MAN=  aic.4 \
pnpbios.4 \
sbni.4 \
smapi.4 \
-   streams.4 \
-   svr4.4 \
vpd.4 \
vx.4
 

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Tue Feb 28 04:48:30 2017
(r314372)
+++ head/share/man/man5/rc.conf.5   Tue Feb 28 05:14:42 2017
(r314373)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 10, 2016
+.Dd February 26, 2017
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -3631,11 +3631,6 @@ Set to
 .Dq Li YES
 to enable Linux/ELF binary emulation at system initial
 boot time.
-.It Va svr4_enable
-.Pq Vt bool
-If 

svn commit: r314372 - head/sys/conf

2017-02-27 Thread Ngie Cooper
Author: ngie
Date: Tue Feb 28 04:48:30 2017
New Revision: 314372
URL: https://svnweb.freebsd.org/changeset/base/314372

Log:
  Use "build" instead of "all" when building ports modules
  
  "all" in ports currently means "stage the ports", which requires root today,
  and brings to light other potential issues, like ENAMETOOLONG with staged
  directories (bug 161481, etc).
  
  This fixes buildkernel for me when run as a non-root user, assuming all
  of the prerequisites have been installed beforehand and are up-to-date.
  
  MFC after:1 month
  Discussed with:   swills (IRC)
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Tue Feb 28 04:31:28 2017(r314371)
+++ head/sys/conf/kern.post.mk  Tue Feb 28 04:48:30 2017(r314372)
@@ -79,7 +79,7 @@ PORTSMODULESENV=\
 all:
 .for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (all)"
-   cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean 
all
+   cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean 
build
 .endfor
 
 .for __target in install reinstall clean
___
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: r314371 - head/sys/powerpc/powerpc

2017-02-27 Thread Justin Hibbits
Author: jhibbits
Date: Tue Feb 28 04:31:28 2017
New Revision: 314371
URL: https://svnweb.freebsd.org/changeset/base/314371

Log:
  Make kernel breakpoints work for book-e
  
  Add the necessary bits to enable kernel breakpoints for Book-E.  The 
entrypoint
  for program exception is very trivial, so rather than expand it to be similar 
to
  AIM, add it into the standard trap handler.
  
  This wasn't blocked out as Book-E specific because it is only a minor 
redundancy
  over AIM, which should have already called db_trap_glue() at this point.  If
  it's going to panic with a fatal trap anywya, it doesn't matter if it goes
  through this path again.

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Tue Feb 28 04:13:20 2017
(r314370)
+++ head/sys/powerpc/powerpc/trap.c Tue Feb 28 04:31:28 2017
(r314371)
@@ -97,6 +97,10 @@ static int   handle_user_slb_spill(pmap_t 
 extern int n_slbs;
 #endif
 
+#ifdef KDB
+int db_trap_glue(struct trapframe *);  /* Called from trap_subr.S */
+#endif
+
 struct powerpc_exception {
u_int   vector;
char*name;
@@ -338,9 +342,13 @@ trap(struct trapframe *frame)
KASSERT(cold || td->td_ucred != NULL,
("kernel trap doesn't have ucred"));
switch (type) {
-#ifdef KDTRACE_HOOKS
case EXC_PGM:
+#ifdef KDTRACE_HOOKS
+#ifdef AIM
if (frame->srr1 & EXC_PGM_TRAP) {
+#else
+   if (frame->cpu.booke.esr & ESR_PTR) {
+#endif
if (*(uint32_t *)frame->srr0 == EXC_DTRACE) {
if (dtrace_invop_jump_addr != NULL) {
dtrace_invop_jump_addr(frame);
@@ -348,8 +356,12 @@ trap(struct trapframe *frame)
}
}
}
-   break;
 #endif
+#ifdef KDB
+   if (db_trap_glue(frame))
+   return;
+#endif
+   break;
 #if defined(__powerpc64__) && defined(AIM)
case EXC_DSE:
if ((frame->dar & SEGMENT_MASK) == USER_ADDR) {
@@ -833,11 +845,10 @@ fix_unaligned(struct thread *td, struct 
 }
 
 #ifdef KDB
-int db_trap_glue(struct trapframe *);  /* Called from trap_subr.S */
-
 int
 db_trap_glue(struct trapframe *frame)
 {
+
if (!(frame->srr1 & PSL_PR)
&& (frame->exc == EXC_TRC || frame->exc == EXC_RUNMODETRC
 #ifdef AIM
@@ -845,6 +856,7 @@ db_trap_glue(struct trapframe *frame)
&& (frame->srr1 & EXC_PGM_TRAP))
 #else
|| (frame->exc == EXC_DEBUG)
+   || (frame->cpu.booke.esr & ESR_PTR)
 #endif
|| frame->exc == EXC_BPT
|| frame->exc == EXC_DSI)) {
@@ -856,7 +868,8 @@ db_trap_glue(struct trapframe *frame)
 #ifdef AIM
if (type == EXC_PGM && (frame->srr1 & EXC_PGM_TRAP)) {
 #else
-   if (frame->cpu.booke.esr & ESR_PTR) {
+   if (type == EXC_DEBUG ||
+   (frame->cpu.booke.esr & ESR_PTR)) {
 #endif
type = T_BREAKPOINT;
}
___
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: r314370 - head/sys/powerpc/include

2017-02-27 Thread Justin Hibbits
Author: jhibbits
Date: Tue Feb 28 04:13:20 2017
New Revision: 314370
URL: https://svnweb.freebsd.org/changeset/base/314370

Log:
  Unbreak kernel breakpoints, broken for ~4 years now
  
  When committing DTrace in 2012/2013 era I inadvertently broke breakpoints, by
  setting EXC_DTRACE to the same value as BKPT_INST.  Change EXC_DTRACE to a
  different, yet logically identical, trap (tw ,31,31).
  
  MFC after:2 weeks

Modified:
  head/sys/powerpc/include/trap.h

Modified: head/sys/powerpc/include/trap.h
==
--- head/sys/powerpc/include/trap.h Tue Feb 28 02:27:51 2017
(r314369)
+++ head/sys/powerpc/include/trap.h Tue Feb 28 04:13:20 2017
(r314370)
@@ -126,7 +126,7 @@
 #defineEXC_PGM_TRAP(1UL << 17)
 
 /* DTrace trap opcode. */
-#define EXC_DTRACE 0x7c810808
+#define EXC_DTRACE 0x7808
 
 /* Magic pointer to store TOC base and other info for trap handlers on ppc64 */
 #define TRAP_GENTRAP   0x1f0
___
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: r314369 - head/sys/dev/bnxt

2017-02-27 Thread Sepherosa Ziehau
On Tue, Feb 28, 2017 at 10:27 AM, Stephen Hurd  wrote:
> Modified: head/sys/dev/bnxt/bnxt_txrx.c
> ==
> --- head/sys/dev/bnxt/bnxt_txrx.c   Tue Feb 28 00:58:16 2017
> (r314368)
> +++ head/sys/dev/bnxt/bnxt_txrx.c   Tue Feb 28 02:27:51 2017
> (r314369)
> @@ -412,6 +412,37 @@ cmpl_invalid:
> return avail;
>  }
>
> +static void
> +bnxt_set_rsstype(if_rxd_info_t ri, uint8_t rss_hash_type)
> +{
> +   uint8_t rss_profile_id;
> +
> +   rss_profile_id = BNXT_GET_RSS_PROFILE_ID(rss_hash_type);
> +   switch (rss_profile_id) {
> +   default:
> +   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
> +   break;

Is it a hash value or just ring index?  If its a hash value, you
should set it to M_HASHTYPE_OPAQUE_HASH here.

Thanks,
sephe
___
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: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-02-27 Thread Bruce Evans

On Mon, 27 Feb 2017, Conrad Meyer wrote:


On Thu, Feb 2, 2017 at 12:29 PM, Bruce Evans  wrote:

I've almost finished fixing and optimizing this.  I didn't manage to fix
all the compiler pessimizations, but the result is within 5% of optimal
for buffers larger than a few K.


Did you ever get to a final patch that you are satisfied with?  It
would be good to get this improvement into the tree.


I'm happy with this version (attached and partly enclosed).  You need to
test it in the kernel and commit it (I on;y did simple correctness tests
in userland).

X Index: conf/files.amd64
X ===
X --- conf/files.amd64  (revision 314363)
X +++ conf/files.amd64  (working copy)
X @@ -545,6 +545,9 @@
X  isa/vga_isa.coptionalvga
X  kern/kern_clocksource.c  standard
X  kern/link_elf_obj.c  standard
X +libkern/x86/crc32_sse42.cstandard
X +libkern/memmove.cstandard
X +libkern/memset.c standard

Also fix some nearby disorder.

X ...
X Index: libkern/x86/crc32_sse42.c
X ===
X --- libkern/x86/crc32_sse42.c (revision 314363)
X +++ libkern/x86/crc32_sse42.c (working copy)
X @@ -31,15 +31,41 @@
X   */
X  #ifdef USERSPACE_TESTING
X  #include 
X +#include 
X  #else
X  #include 
X +#include 
X  #include 
X -#include 
X -#include 
X  #endif

Also fix minor #include errors.

X 
X -#include 

X +static __inline uint32_t
X +_mm_crc32_u8(uint32_t x, uint8_t y)
X +{
X + /*
X +  * clang (at least 3.9.[0-1]) pessimizes "rm" (y) and "m" (y)
X +  * significantly and "r" (y) a lot by copying y to a different
X +  * local variable (on the stack or in a register), so only use
X +  * the latter.  This costs a register and an instruction but
X +  * not a uop.
X +  */
X + __asm("crc32b %1,%0" : "+r" (x) : "r" (y));
X + return (x);
X +}

Using intrinsics avoids the silly copying via the stack, and allows more
unrolling.  Old gcc does more unrolling with just asms.  Unrolling is
almost useless (some details below).

X @@ -47,12 +73,14 @@
X   * Block sizes for three-way parallel crc computation.  LONG and SHORT must
X   * both be powers of two.
X   */
X -#define LONG 8192
X -#define SHORT256
X +#define LONG 128
X +#define SHORT64

These are aggressively low.

Note that small buffers aren't handled very well.  SHORT = 64 means that
a buffer of size 3 * 64 = 192 is handled entirely by the "SHORT" loop.
192 is not very small, but any smaller than that and overheads for
adjustment at the end of the loop are too large for the "SHORT" loop
to be worth doing.  Almost any value of LONG larger than 128 works OK
now, but if LONG is large then it gives too much work for the "SHORT"
loop, since normal buffer sizes are not a multiple of 3.  E.g., with
the old LONG and SHORT, a buffer of size 128 was decomposed as 5 * 24K
(done almost optimally by the "LONG" loop) + 10 * 768 (done a bit less
optimally by the "SHORT" loop) + 10 * 768 + 64 * 8 (done pessimally).

I didn't get around to ifdefing this for i386.  On i386, the loops take
twice as many crc32 instructions for a given byte count, so the timing
is satisfed by a byte count half as large, so SHORT and LONG can be
reduced by a factor of 2 to give faster handling for small buffers without
affecting the speed for large buffers significantly.

X 
X  /* Tables for hardware crc that shift a crc by LONG and SHORT zeros. */

X  static uint32_t crc32c_long[4][256];
X +static uint32_t crc32c_2long[4][256];
X  static uint32_t crc32c_short[4][256];
X +static uint32_t crc32c_2short[4][256];

I didn't get around to updating the comment.  2long shifts by 2*LONG zeros,
etc.

Shifts by 3N are done by adding shifts by 1N and 2N in parallel.  I couldn't
get the direct 3N shift to run any faster.

X @@ -190,7 +220,11 @@
X   const size_t align = 4;
X  #endif
X   const unsigned char *next, *end;
X - uint64_t crc0, crc1, crc2;  /* need to be 64 bits for crc32q */
X +#ifdef __amd64__
X + uint64_t crc0, crc1, crc2;
X +#else
X + uint32_t crc0, crc1, crc2;
X +#endif
X 
X  	next = buf;

X   crc0 = crc;

64 bits of course isn't needed for i386.  It isn't needed for amd64 either.
I think the crc32 instruction zeros the top 32 bits so they can be ignored.
However, when I modified the asm to return 32 bits to tell the compiler about
this (which the intrinsic wouldn't be able to do) and used 32 bits here,
this was just slightly slower.

For some intermediate crc calculations, only 32 bits are used, and the
compiler can see this.  clang on amd64 optimizes this better than gcc,
starting with all the intermediate crc variables declared as 64 bits.
gcc generates worst code when some of the intermediates are declared as
32 bits.  So keep using 64 bits on amd64 here.

X @@ -202,6 +236,7 @@
X   len--;
X   }
X 
X +#if LONG > 

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

2017-02-27 Thread Stephen Hurd
Author: shurd (ports committer)
Date: Tue Feb 28 02:27:51 2017
New Revision: 314369
URL: https://svnweb.freebsd.org/changeset/base/314369

Log:
  bnxt: propagate RSS hash type to the network stack.
  
  RSS hash type will be used to identify the CPU on to which, a receive packet
  will be queued.  This patch extracts the "RSS hash type" from the receive
  completion and sends it to the stack.
  
  Submitted by: Venkatkumar Duvvuru 
  Reviewed by:  shurd
  Approved by:  sbruno
  MFC after:1 week
  Sponsored by: Broadcom Limited
  Differential Revision:https://reviews.freebsd.org/D9685

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

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hTue Feb 28 00:58:16 2017(r314368)
+++ head/sys/dev/bnxt/bnxt.hTue Feb 28 02:27:51 2017(r314369)
@@ -92,6 +92,14 @@ __FBSDID("$FreeBSD$");
 
 #define BNXT_MAX_MTU   9000
 
+#define BNXT_RSS_HASH_TYPE_TCPV4   0
+#define BNXT_RSS_HASH_TYPE_UDPV4   1
+#define BNXT_RSS_HASH_TYPE_IPV42
+#define BNXT_RSS_HASH_TYPE_TCPV6   3
+#define BNXT_RSS_HASH_TYPE_UDPV6   4
+#define BNXT_RSS_HASH_TYPE_IPV65
+#define BNXT_GET_RSS_PROFILE_ID(rss_hash_type) ((rss_hash_type >> 1) & 0x1F)
+
 /* Completion related defines */
 #define CMP_VALID(cmp, v_bit) \
((!!(((struct cmpl_base *)(cmp))->info3_v & htole32(CMPL_BASE_V))) == 
!!(v_bit) )

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Tue Feb 28 00:58:16 2017
(r314368)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Tue Feb 28 02:27:51 2017
(r314369)
@@ -412,6 +412,37 @@ cmpl_invalid:
return avail;
 }
 
+static void
+bnxt_set_rsstype(if_rxd_info_t ri, uint8_t rss_hash_type)
+{
+   uint8_t rss_profile_id;
+
+   rss_profile_id = BNXT_GET_RSS_PROFILE_ID(rss_hash_type);
+   switch (rss_profile_id) {
+   case BNXT_RSS_HASH_TYPE_TCPV4:
+   ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4;
+   break;
+   case BNXT_RSS_HASH_TYPE_UDPV4:
+   ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV4;
+   break;
+   case BNXT_RSS_HASH_TYPE_IPV4:
+   ri->iri_rsstype = M_HASHTYPE_RSS_IPV4;
+   break;
+   case BNXT_RSS_HASH_TYPE_TCPV6:
+   ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6;
+   break;
+   case BNXT_RSS_HASH_TYPE_UDPV6:
+   ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV6;
+   break;
+   case BNXT_RSS_HASH_TYPE_IPV6:
+   ri->iri_rsstype = M_HASHTYPE_RSS_IPV6;
+   break;
+   default:
+   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   break;
+   }
+}
+
 static int
 bnxt_pkt_get_l2(struct bnxt_softc *softc, if_rxd_info_t ri,
 struct bnxt_cp_ring *cpr, uint16_t flags_type)
@@ -429,13 +460,7 @@ bnxt_pkt_get_l2(struct bnxt_softc *softc
/* Extract from the first 16-byte BD */
if (flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID) {
ri->iri_flowid = le32toh(rcp->rss_hash);
-   /*
-* TODO: Extract something useful from rcp->rss_hash_type
-* (undocumented)
-* May be documented in the "LSI ES"
-* also check the firmware code.
-*/
-   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   bnxt_set_rsstype(ri, rcp->rss_hash_type);
}
else {
ri->iri_rsstype = M_HASHTYPE_NONE;
@@ -515,13 +540,7 @@ bnxt_pkt_get_tpa(struct bnxt_softc *soft
/* Extract from the first 16-byte BD */
if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) {
ri->iri_flowid = le32toh(tpas->low.rss_hash);
-   /*
-* TODO: Extract something useful from tpas->low.rss_hash_type
-* (undocumented)
-* May be documented in the "LSI ES"
-* also check the firmware code.
-*/
-   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   bnxt_set_rsstype(ri, tpas->low.rss_hash_type);
}
else {
ri->iri_rsstype = M_HASHTYPE_NONE;
___
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: r314367 - stable/11/tools/build/mk

2017-02-27 Thread Ngie Cooper
Author: ngie
Date: Tue Feb 28 00:57:45 2017
New Revision: 314367
URL: https://svnweb.freebsd.org/changeset/base/314367

Log:
  MFC r314244:
  
  Remove MK_OBJC block
  
  It is no longer represented via src.conf(5)

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Tue Feb 28 00:56:33 
2017(r314366)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Tue Feb 28 00:57:45 
2017(r314367)
@@ -,10 +,6 @@ OLD_FILES+=usr/share/man/man8/ntpq.8.gz
 OLD_FILES+=usr/share/man/man8/ntptime.8.gz
 .endif
 
-#.if ${MK_OBJC} == no
-# to be filled in
-#.endif
-
 .if ${MK_OPENSSH} == no
 OLD_FILES+=etc/rc.d/sshd
 OLD_FILES+=etc/ssh/moduli
___
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: r314368 - stable/10/tools/build/mk

2017-02-27 Thread Ngie Cooper
Author: ngie
Date: Tue Feb 28 00:58:16 2017
New Revision: 314368
URL: https://svnweb.freebsd.org/changeset/base/314368

Log:
  MFC r314244:
  
  Remove MK_OBJC block
  
  It is no longer represented via src.conf(5)

Modified:
  stable/10/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/10/tools/build/mk/OptionalObsoleteFiles.inc  Tue Feb 28 00:57:45 
2017(r314367)
+++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc  Tue Feb 28 00:58:16 
2017(r314368)
@@ -4043,10 +4043,6 @@ OLD_FILES+=usr/share/man/man8/ntpq.8.gz
 OLD_FILES+=usr/share/man/man8/ntptime.8.gz
 .endif
 
-#.if ${MK_OBJC} == no
-# to be filled in
-#.endif
-
 .if ${MK_OPENSSH} == no
 OLD_FILES+=usr/bin/sftp
 OLD_FILES+=usr/bin/ssh
___
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: r314366 - in stable/10/lib/libnetbsd: . sys

2017-02-27 Thread Ngie Cooper
Author: ngie
Date: Tue Feb 28 00:56:33 2017
New Revision: 314366
URL: https://svnweb.freebsd.org/changeset/base/314366

Log:
  Note: this change reintroduces r314020 after r314327, r314330, and r314332
  
  MFC r313404:
  
  Improve libnetbsd compatibility with NetBSD
  
  This change is being made to diff reduce/reduce duplication in
  contrib/netbsd-tests and to facilitate further porting of software from
  NetBSD
  
  Add the following headers:
  - sys/event.h:
  -- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
  - sys/types.h:
  -- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
 Pull in sys/param.h to have parity with NetBSD.
  - sys/wait.h:
  -- Define wrusage as __wrusage for parity with NetBSD typedef.
  - glob.h
  -- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
  - pthread.h:
  -- Pull in pthread_np.h for _np functions defined separately on FreeBSD.
  
  Improve compatibility with NetBSD in the following headers:
  
  - sha1.h:
  -- define SHA1_CTX as SHA_CTX
  -- define SHA1Final as SHA1_Final
  - sha2.h:
  -- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
  - util.h:
  -- Add sys/types.h to util.h to pollute the header for types used in
 flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
 for the functions.

Added:
  stable/10/lib/libnetbsd/glob.h
 - copied unchanged from r313404, head/lib/libnetbsd/glob.h
  stable/10/lib/libnetbsd/pthread.h
 - copied unchanged from r313404, head/lib/libnetbsd/pthread.h
  stable/10/lib/libnetbsd/sys/event.h
 - copied unchanged from r313404, head/lib/libnetbsd/sys/event.h
  stable/10/lib/libnetbsd/sys/types.h
 - copied unchanged from r313404, head/lib/libnetbsd/sys/types.h
  stable/10/lib/libnetbsd/sys/wait.h
 - copied unchanged from r313404, head/lib/libnetbsd/sys/wait.h
Modified:
  stable/10/lib/libnetbsd/sha1.h
  stable/10/lib/libnetbsd/sha2.h
  stable/10/lib/libnetbsd/util.h
Directory Properties:
  stable/10/   (props changed)

Copied: stable/10/lib/libnetbsd/glob.h (from r313404, head/lib/libnetbsd/glob.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/lib/libnetbsd/glob.h  Tue Feb 28 00:56:33 2017
(r314366, copy of r313404, head/lib/libnetbsd/glob.h)
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LIBNETBSD_GLOB_H_
+#define _LIBNETBSD_GLOB_H_
+
+#include_next 
+
+#ifndef__gl_stat_t
+#define__gl_stat_t struct stat
+#endif
+
+#endif

Copied: stable/10/lib/libnetbsd/pthread.h (from r313404, 
head/lib/libnetbsd/pthread.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/lib/libnetbsd/pthread.h   Tue Feb 28 00:56:33 2017
(r314366, copy of r313404, head/lib/libnetbsd/pthread.h)
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS 

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

2017-02-27 Thread David C Somayajulu
Author: davidcs
Date: Mon Feb 27 23:38:51 2017
New Revision: 314365
URL: https://svnweb.freebsd.org/changeset/base/314365

Log:
  1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to sync 
threads during interface down or detach.
  2. add sysctl to set pause frame parameters
  3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32)
  4. add debug messages for PHY
  5. HW LRO support restricted to FreeBSD versions 8.x and above.
  
  Submitted by:vaishali.kulka...@cavium.com
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/bxe_elink.c
  head/sys/dev/bxe/bxe_stats.c
  head/sys/dev/bxe/bxe_stats.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Mon Feb 27 22:53:25 2017(r314364)
+++ head/sys/dev/bxe/bxe.c  Mon Feb 27 23:38:51 2017(r314365)
@@ -27,7 +27,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#define BXE_DRIVER_VERSION "1.78.89"
+#define BXE_DRIVER_VERSION "1.78.90"
 
 #include "bxe.h"
 #include "ecore_sp.h"
@@ -496,12 +496,19 @@ static const struct {
 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"},
 { STATS_OFFSET32(tx_queue_full_return),
 4, STATS_FLAGS_FUNC, "tx_queue_full_return"},
+{ STATS_OFFSET32(bxe_tx_mq_sc_state_failures),
+4, STATS_FLAGS_FUNC, "bxe_tx_mq_sc_state_failures"},
 { STATS_OFFSET32(tx_request_link_down_failures),
 4, STATS_FLAGS_FUNC, "tx_request_link_down_failures"},
 { STATS_OFFSET32(bd_avail_too_less_failures),
 4, STATS_FLAGS_FUNC, "bd_avail_too_less_failures"},
 { STATS_OFFSET32(tx_mq_not_empty),
-4, STATS_FLAGS_FUNC, "tx_mq_not_empty"}
+4, STATS_FLAGS_FUNC, "tx_mq_not_empty"},
+{ STATS_OFFSET32(nsegs_path1_errors),
+4, STATS_FLAGS_FUNC, "nsegs_path1_errors"},
+{ STATS_OFFSET32(nsegs_path2_errors),
+4, STATS_FLAGS_FUNC, "nsegs_path2_errors"}
+
 
 };
 
@@ -616,12 +623,19 @@ static const struct {
 4, "mbuf_alloc_tpa"},
 { Q_STATS_OFFSET32(tx_queue_full_return),
 4, "tx_queue_full_return"},
+{ Q_STATS_OFFSET32(bxe_tx_mq_sc_state_failures),
+4, "bxe_tx_mq_sc_state_failures"},
 { Q_STATS_OFFSET32(tx_request_link_down_failures),
 4, "tx_request_link_down_failures"},
 { Q_STATS_OFFSET32(bd_avail_too_less_failures),
 4, "bd_avail_too_less_failures"},
 { Q_STATS_OFFSET32(tx_mq_not_empty),
-4, "tx_mq_not_empty"}
+4, "tx_mq_not_empty"},
+{ Q_STATS_OFFSET32(nsegs_path1_errors),
+4, "nsegs_path1_errors"},
+{ Q_STATS_OFFSET32(nsegs_path2_errors),
+4, "nsegs_path2_errors"}
+
 
 };
 
@@ -692,6 +706,7 @@ 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);
+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);
 
@@ -5231,12 +5246,24 @@ bxe_tx_encap(struct bxe_fastpath *fp, st
 fp->eth_q_stats.tx_dma_mapping_failure++;
 /* No sense in trying to defrag/copy chain, drop it. :( */
 rc = error;
-}
-else {
-/* if the chain is still too long then drop it */
-if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) {
-bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map);
-rc = ENODEV;
+} else {
+   /* if the chain is still too long then drop it */
+if(m0->m_pkthdr.csum_flags & CSUM_TSO) {
+/*
+ * in case TSO is enabled nsegs should be checked against
+ * BXE_TSO_MAX_SEGMENTS
+ */
+if (__predict_false(nsegs > BXE_TSO_MAX_SEGMENTS)) {
+bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map);
+fp->eth_q_stats.nsegs_path1_errors++;
+rc = ENODEV;
+}
+} else {
+if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) {
+bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map);
+fp->eth_q_stats.nsegs_path2_errors++;
+rc = ENODEV;
+}
 }
 }
 }
@@ -5636,6 +5663,11 @@ bxe_tx_mq_start_locked(struct bxe_softc 
 
 BXE_FP_TX_LOCK_ASSERT(fp);
 
+if (sc->state != BXE_STATE_OPEN)  {
+fp->eth_q_stats.bxe_tx_mq_sc_state_failures++;
+return ENETDOWN;
+}
+
 if (!tx_br) {
 BLOGE(sc, "Multiqueue TX and no buf_ring!\n");
 return (EINVAL);
@@ -5757,6 +5789,11 @@ bxe_tx_mq_start(struct ifnet 

svn commit: r314364 - stable/11/sys/dev/sdhci

2017-02-27 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 27 22:53:25 2017
New Revision: 314364
URL: https://svnweb.freebsd.org/changeset/base/314364

Log:
  MFC r313712:
  
  [sdhci_acpi] Add support for Bay Trail SDHC SD card slot
  
  Add ACPI device 80860F14 with _UID 3 to the list of known devices. It
  make SD card available on NUCs and Minnowboard. Previously added _UID 1
  covered only eMMC devices.
  
  Reported by:  kib@

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

Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c
==
--- stable/11/sys/dev/sdhci/sdhci_acpi.cMon Feb 27 20:50:21 2017
(r314363)
+++ stable/11/sys/dev/sdhci/sdhci_acpi.cMon Feb 27 22:53:25 2017
(r314364)
@@ -60,9 +60,11 @@ static const struct sdhci_acpi_device {
const char  *desc;
u_int   quirks;
 } sdhci_acpi_devices[] = {
-   { "80860F14",   1,  "Intel Bay Trail eMMC 4.5 Controller",
+   { "80860F14",   1,  "Intel Bay Trail SD Host Controller",
SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
SDHCI_QUIRK_INTEL_POWER_UP_RESET },
+   { "80860F14",   3,  "Intel Bay Trail SD Host Controller",
+   SDHCI_QUIRK_INTEL_POWER_UP_RESET },
{ "80860F16",   0,  "Intel Bay Trail SD Host Controller",
0 },
{ NULL, 0, NULL, 0}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-02-27 Thread Conrad Meyer
On Thu, Feb 2, 2017 at 12:29 PM, Bruce Evans  wrote:
> I've almost finished fixing and optimizing this.  I didn't manage to fix
> all the compiler pessimizations, but the result is within 5% of optimal
> for buffers larger than a few K.

Hi Bruce,

Did you ever get to a final patch that you are satisfied with?  It
would be good to get this improvement into the tree.

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


Re: svn commit: r314335 - stable/10/sys/crypto/sha2

2017-02-27 Thread Ed Schouten
2017-02-27 22:07 GMT+01:00 Colin Percival :
> I tried this, and it was slower.  The larger array avoids write-after-read
> accesses and results in better code being emitted due to more flexible
> instruction scheduling.

Ah, makes sense. Thanks for testing this regardless!

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r314335 - stable/10/sys/crypto/sha2

2017-02-27 Thread Colin Percival
On 02/27/17 06:01, Ed Schouten wrote:
> Something interesting that I noticed some time ago when comparing the
> various SHA-{256,512} implementations: there is no need to store the
> entire extended message in W. During every iteration of this loop,
> RNDr() and MSCH() never go more than 16 elements back.
> 
> Say, if you were to modify MSCH() to something like this:
> 
>> +#define MSCH(W, ii) \
>> +   W[ii] += s1(W[(ii + 14) % 16]) + W[(ii + 9) % 16] + s0(W[(ii + 1)) % 
>> 16])
> 
> Then it will compute the next chunk of the extended message in-place.
> RNDr() must then be adjusted to use W[i] instead of W[i + ii], of
> course. W then only needs to hold 16 elements instead of 64 or 80.

I tried this, and it was slower.  The larger array avoids write-after-read
accesses and results in better code being emitted due to more flexible
instruction scheduling.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
___
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: r314363 - in stable/11/sys: conf dev/intel modules modules/intelspi

2017-02-27 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 27 20:50:21 2017
New Revision: 314363
URL: https://svnweb.freebsd.org/changeset/base/314363

Log:
  MFC r310645:
  
  [intelspi] Add SPI driver for Intel BayTrail SoC
  
  Add SPI mode (PIO-only) support for Intel Synchronous Serial Port that
  can be found in several Intel's products starting from PXA family.
  Most of implementations have slight differences in behavior and in
  addresses for registers subset. This driver covers only BayTrail SoC
  implementation for it's the only hardware I have to test it on.
  
  Driver attaches to ACPI bus only and does not have PCI or FDT support
  for now due to lack of hardware to test it on.
  
  "intelspi" is the best name I've managed to come up with. Linux driver
  name (spi-pxa2xx) does not make sense because current implementation
  does not support actual PXA2xx SoCs. And as far as I know there is no
  codename assigned to Intel SSP chip.
  
  Reviewed by:  br, manu
  Differential Revision:https://reviews.freebsd.org/D8896

Added:
  stable/11/sys/dev/intel/
 - copied from r310645, head/sys/dev/intel/
  stable/11/sys/modules/intelspi/
 - copied from r310645, head/sys/modules/intelspi/
Modified:
  stable/11/sys/conf/files.amd64
  stable/11/sys/conf/files.i386
  stable/11/sys/modules/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files.amd64
==
--- stable/11/sys/conf/files.amd64  Mon Feb 27 20:08:42 2017
(r314362)
+++ stable/11/sys/conf/files.amd64  Mon Feb 27 20:50:21 2017
(r314363)
@@ -227,6 +227,7 @@ dev/if_ndis/if_ndis.c   optionalndis
 dev/if_ndis/if_ndis_pccard.c   optionalndis pccard
 dev/if_ndis/if_ndis_pci.c  optionalndis cardbus | ndis pci
 dev/if_ndis/if_ndis_usb.c  optionalndis usb
+dev/intel/spi.coptionalintelspi
 dev/io/iodev.c optionalio
 dev/ioat/ioat.coptionalioat pci
 dev/ioat/ioat_test.c   optionalioat pci

Modified: stable/11/sys/conf/files.i386
==
--- stable/11/sys/conf/files.i386   Mon Feb 27 20:08:42 2017
(r314362)
+++ stable/11/sys/conf/files.i386   Mon Feb 27 20:50:21 2017
(r314363)
@@ -275,6 +275,7 @@ dev/if_ndis/if_ndis.c   optional ndis
 dev/if_ndis/if_ndis_pccard.c   optional ndis pccard
 dev/if_ndis/if_ndis_pci.c  optional ndis cardbus | ndis pci
 dev/if_ndis/if_ndis_usb.c  optional ndis usb
+dev/intel/spi.coptional intelspi
 dev/io/iodev.c optional io
 dev/ipmi/ipmi.coptional ipmi
 dev/ipmi/ipmi_acpi.c   optional ipmi acpi

Modified: stable/11/sys/modules/Makefile
==
--- stable/11/sys/modules/Makefile  Mon Feb 27 20:08:42 2017
(r314362)
+++ stable/11/sys/modules/Makefile  Mon Feb 27 20:50:21 2017
(r314363)
@@ -165,6 +165,7 @@ SUBDIR= \
${_igb} \
${_iir} \
imgact_binmisc \
+   ${_intelspi} \
${_io} \
${_ioat} \
 ${_ipoib} \
@@ -623,6 +624,7 @@ _hyperv=hyperv
 _ichwd=ichwd
 _ida=  ida
 _iir=  iir
+_intelspi= intelspi
 _ipmi= ipmi
 _ips=  ips
 _isci= isci
___
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: r314362 - in head/sys: arm/at91 arm/cavium/cns11xx arm/nvidia arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa dev/uart mips/adm5120 mips/alchemy mips/atheros mips/atheros/ar531x mips...

2017-02-27 Thread Ruslan Bukin
Author: br
Date: Mon Feb 27 20:08:42 2017
New Revision: 314362
URL: https://svnweb.freebsd.org/changeset/base/314362

Log:
  Allow setting access-width for UART registers.
  
  This is required for FDT's standard "reg-io-width" property
  (similar to "reg-shift" property) found in many DTS files.
  
  This fixes operation on Altera Arria 10 SOC Development Kit,
  where standard ns8250 uart allows 4-byte access only.
  
  Reviewed by:  kan, marcel
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9785

Modified:
  head/sys/arm/at91/uart_bus_at91usart.c
  head/sys/arm/cavium/cns11xx/uart_bus_ec.c
  head/sys/arm/nvidia/tegra_uart.c
  head/sys/arm/xscale/i8134x/uart_bus_i81342.c
  head/sys/arm/xscale/ixp425/uart_bus_ixp425.c
  head/sys/arm/xscale/pxa/uart_bus_pxa.c
  head/sys/dev/uart/uart.h
  head/sys/dev/uart/uart_bus.h
  head/sys/dev/uart/uart_bus_acpi.c
  head/sys/dev/uart/uart_bus_ebus.c
  head/sys/dev/uart/uart_bus_fdt.c
  head/sys/dev/uart/uart_bus_isa.c
  head/sys/dev/uart/uart_bus_pccard.c
  head/sys/dev/uart/uart_bus_pci.c
  head/sys/dev/uart/uart_bus_puc.c
  head/sys/dev/uart/uart_bus_scc.c
  head/sys/dev/uart/uart_core.c
  head/sys/dev/uart/uart_cpu.h
  head/sys/dev/uart/uart_cpu_arm64.c
  head/sys/dev/uart/uart_cpu_fdt.c
  head/sys/dev/uart/uart_cpu_fdt.h
  head/sys/dev/uart/uart_dev_snps.c
  head/sys/mips/adm5120/uart_bus_adm5120.c
  head/sys/mips/alchemy/uart_bus_alchemy.c
  head/sys/mips/atheros/ar531x/uart_bus_ar5315.c
  head/sys/mips/atheros/uart_bus_ar71xx.c
  head/sys/mips/atheros/uart_bus_ar933x.c
  head/sys/mips/broadcom/uart_bus_chipc.c
  head/sys/mips/cavium/uart_bus_octeonusart.c
  head/sys/mips/idt/uart_bus_rc32434.c
  head/sys/mips/ingenic/jz4780_uart.c
  head/sys/mips/malta/uart_bus_maltausart.c
  head/sys/mips/rmi/uart_bus_xlr_iodi.c
  head/sys/mips/rt305x/uart_bus_rt305x.c
  head/sys/powerpc/psim/uart_iobus.c
  head/sys/sparc64/pci/sbbc.c

Modified: head/sys/arm/at91/uart_bus_at91usart.c
==
--- head/sys/arm/at91/uart_bus_at91usart.c  Mon Feb 27 19:51:27 2017
(r314361)
+++ head/sys/arm/at91/uart_bus_at91usart.c  Mon Feb 27 20:08:42 2017
(r314362)
@@ -104,7 +104,7 @@ usart_at91_probe(device_t dev)
sc->sc_class = _usart_class;
if (sc->sc_class->uc_rclk == 0)
sc->sc_class->uc_rclk = at91_master_clock;
-   return (uart_bus_probe(dev, 0, 0, 0, device_get_unit(dev)));
+   return (uart_bus_probe(dev, 0, 0, 0, 0, device_get_unit(dev)));
 }
 
 

Modified: head/sys/arm/cavium/cns11xx/uart_bus_ec.c
==
--- head/sys/arm/cavium/cns11xx/uart_bus_ec.c   Mon Feb 27 19:51:27 2017
(r314361)
+++ head/sys/arm/cavium/cns11xx/uart_bus_ec.c   Mon Feb 27 20:08:42 2017
(r314362)
@@ -69,7 +69,7 @@ uart_ec_probe(device_t dev)
 
sc = device_get_softc(dev);
sc->sc_class = _ns8250_class;
-   status = uart_bus_probe(dev, EC_UART_REGSHIFT, EC_UART_CLOCK, 0, 0);
+   status = uart_bus_probe(dev, EC_UART_REGSHIFT, 0, EC_UART_CLOCK, 0, 0);
return (status);
 }
 

Modified: head/sys/arm/nvidia/tegra_uart.c
==
--- head/sys/arm/nvidia/tegra_uart.cMon Feb 27 19:51:27 2017
(r314361)
+++ head/sys/arm/nvidia/tegra_uart.cMon Feb 27 20:08:42 2017
(r314362)
@@ -216,7 +216,7 @@ tegra_uart_probe(device_t dev)
device_printf(dev, "Cannot enable UART clock: %d\n", rv);
return (ENXIO);
}
-   return (uart_bus_probe(dev, shift, (int)freq, 0, 0));
+   return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0));
 }
 
 static int

Modified: head/sys/arm/xscale/i8134x/uart_bus_i81342.c
==
--- head/sys/arm/xscale/i8134x/uart_bus_i81342.cMon Feb 27 19:51:27 
2017(r314361)
+++ head/sys/arm/xscale/i8134x/uart_bus_i81342.cMon Feb 27 20:08:42 
2017(r314362)
@@ -83,7 +83,7 @@ uart_i81342_probe(device_t dev)
0x40 | 0x10);
 bus_release_resource(dev, sc->sc_rtype, sc->sc_rrid, sc->sc_rres);
 
-   err = uart_bus_probe(dev, 2, 4000, 0, device_get_unit(dev));
+   err = uart_bus_probe(dev, 2, 0, 4000, 0, device_get_unit(dev));
sc->sc_rxfifosz = sc->sc_txfifosz = 1;
return (err);
 }

Modified: head/sys/arm/xscale/ixp425/uart_bus_ixp425.c
==
--- head/sys/arm/xscale/ixp425/uart_bus_ixp425.cMon Feb 27 19:51:27 
2017(r314361)
+++ head/sys/arm/xscale/ixp425/uart_bus_ixp425.cMon Feb 27 20:08:42 
2017(r314362)
@@ -78,5 +78,5 @@ uart_ixp425_probe(device_t dev)
if (bootverbose)
device_printf(dev, "rclk %u\n", rclk);
 
-   return 

svn commit: r314361 - stable/11/sys/dev/atkbdc

2017-02-27 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 27 19:51:27 2017
New Revision: 314361
URL: https://svnweb.freebsd.org/changeset/base/314361

Log:
  MFC r313757:
  
  [psm] Fix calculation for clickpad softbuttons at the top
  
  On laptops like the ThinkPad X240, ClickPad buttons are located at the
  top. The hw.psm.synaptics.softbuttons_y sysctl was supposed to allow this
  by setting the value to a negative one (e.g. -1700). However, the
  condition was wrong (double negative), and doing that placed the buttons
  in an unreachable area.
  
  PR:   216342
  Submitted by: Greg V 

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

Modified: stable/11/sys/dev/atkbdc/psm.c
==
--- stable/11/sys/dev/atkbdc/psm.c  Mon Feb 27 19:46:27 2017
(r314360)
+++ stable/11/sys/dev/atkbdc/psm.c  Mon Feb 27 19:51:27 2017
(r314361)
@@ -3194,7 +3194,7 @@ psmgestures(struct psm_softc *sc, finger
if (sc->synhw.capClickPad && ms->button & MOUSE_BUTTON1DOWN) {
y_ok = sc->syninfo.softbuttons_y >= 0 ?
start_y < sc->syninfo.softbuttons_y :
-   start_y > max_y - sc->syninfo.softbuttons_y;
+   start_y > max_y + sc->syninfo.softbuttons_y;
 
center_button = MOUSE_BUTTON2DOWN;
center_x = sc->syninfo.softbutton2_x;
___
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: r314360 - head/sys/dev/uart

2017-02-27 Thread Ruslan Bukin
Author: br
Date: Mon Feb 27 19:46:27 2017
New Revision: 314360
URL: https://svnweb.freebsd.org/changeset/base/314360

Log:
  Revert r314212 as it break Allwinner boards.
  
  Reported by:  manu

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

Modified: head/sys/dev/uart/uart_dev_snps.c
==
--- head/sys/dev/uart/uart_dev_snps.c   Mon Feb 27 17:54:01 2017
(r314359)
+++ head/sys/dev/uart/uart_dev_snps.c   Mon Feb 27 19:46:27 2017
(r314360)
@@ -104,7 +104,7 @@ static struct ofw_compat_data compat_dat
{ "snps,dw-apb-uart",   (uintptr_t)_snps_class },
{ NULL, (uintptr_t)NULL }
 };
-UART_FDT_CLASS_AND_DEVICE(compat_data);
+UART_FDT_CLASS(compat_data);
 
 #ifdef EXT_RESOURCES
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r314359 - in head: sbin/geom/class/part sys/geom/part

2017-02-27 Thread Mariusz Zaborski
On Mon, Feb 27, 2017 at 05:54:01PM +, Mariusz Zaborski wrote:
> Author: oshogbo
> Date: Mon Feb 27 17:54:01 2017
> New Revision: 314359
> URL: https://svnweb.freebsd.org/changeset/base/314359
> 
> Log:
>   Add sysctl to control auto resize of the GEOM metadata.
>   
>   Reviewed by:AllanJude
>   Differential Revision:  https://reviews.freebsd.org/D9603
Sorry, I think I should add:
Discussed with: ae

Sorry about that,
Mariusz Zaborski
> 
> Modified:
>   head/sbin/geom/class/part/gpart.8
>   head/sys/geom/part/g_part.c
> 
> Modified: head/sbin/geom/class/part/gpart.8
> ==
> --- head/sbin/geom/class/part/gpart.8 Mon Feb 27 17:50:38 2017
> (r314358)
> +++ head/sbin/geom/class/part/gpart.8 Mon Feb 27 17:54:01 2017
> (r314359)
> @@ -1146,6 +1146,18 @@ variables can be used to control the beh
>  GEOM class.
>  The default value is shown next to each variable.
>  .Bl -tag -width indent
> +.It Va kern.geom.part.auto_resize: No 1
> +This variable controls automatic resize behavior of
> +.Nm
> +GEOM class.
> +When this variable is enable and new size of provider is detected, the schema
> +metadata is resized but all changes are not saved to disk, until
> +.Cm gpart commit
> +is run to confirm changes.
> +This behavior is also reported with diagnostic message:
> +.Sy "GEOM_PART: (provider) was automatically resized."
> +.Sy "Use `gpart commit (provider)` to save changes or `gpart undo 
> (provider)`"
> +.Sy "to revert them."
>  .It Va kern.geom.part.check_integrity : No 1
>  This variable controls the behaviour of metadata integrity checks.
>  When integrity checks are enabled, the
> 
> Modified: head/sys/geom/part/g_part.c
> ==
> --- head/sys/geom/part/g_part.c   Mon Feb 27 17:50:38 2017
> (r314358)
> +++ head/sys/geom/part/g_part.c   Mon Feb 27 17:54:01 2017
> (r314359)
> @@ -135,6 +135,10 @@ static u_int check_integrity = 1;
>  SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity,
>  CTLFLAG_RWTUN, _integrity, 1,
>  "Enable integrity checking");
> +static u_int auto_resize = 1;
> +SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize,
> +CTLFLAG_RW, _resize, 1,
> +"Enable auto resize");
>  
>  /*
>   * The GEOM partitioning class.
> @@ -2095,6 +2099,9 @@ g_part_resize(struct g_consumer *cp)
>   G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->name));
>   g_topology_assert();
>  
> + if (auto_resize == 0)
> + return;
> +
>   table = cp->geom->softc;
>   if (table->gpt_opened == 0) {
>   if (g_access(cp, 1, 1, 1) != 0)
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


signature.asc
Description: PGP signature


svn commit: r314359 - in head: sbin/geom/class/part sys/geom/part

2017-02-27 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Feb 27 17:54:01 2017
New Revision: 314359
URL: https://svnweb.freebsd.org/changeset/base/314359

Log:
  Add sysctl to control auto resize of the GEOM metadata.
  
  Reviewed by:  AllanJude
  Differential Revision:https://reviews.freebsd.org/D9603

Modified:
  head/sbin/geom/class/part/gpart.8
  head/sys/geom/part/g_part.c

Modified: head/sbin/geom/class/part/gpart.8
==
--- head/sbin/geom/class/part/gpart.8   Mon Feb 27 17:50:38 2017
(r314358)
+++ head/sbin/geom/class/part/gpart.8   Mon Feb 27 17:54:01 2017
(r314359)
@@ -1146,6 +1146,18 @@ variables can be used to control the beh
 GEOM class.
 The default value is shown next to each variable.
 .Bl -tag -width indent
+.It Va kern.geom.part.auto_resize: No 1
+This variable controls automatic resize behavior of
+.Nm
+GEOM class.
+When this variable is enable and new size of provider is detected, the schema
+metadata is resized but all changes are not saved to disk, until
+.Cm gpart commit
+is run to confirm changes.
+This behavior is also reported with diagnostic message:
+.Sy "GEOM_PART: (provider) was automatically resized."
+.Sy "Use `gpart commit (provider)` to save changes or `gpart undo (provider)`"
+.Sy "to revert them."
 .It Va kern.geom.part.check_integrity : No 1
 This variable controls the behaviour of metadata integrity checks.
 When integrity checks are enabled, the

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Mon Feb 27 17:50:38 2017(r314358)
+++ head/sys/geom/part/g_part.c Mon Feb 27 17:54:01 2017(r314359)
@@ -135,6 +135,10 @@ static u_int check_integrity = 1;
 SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity,
 CTLFLAG_RWTUN, _integrity, 1,
 "Enable integrity checking");
+static u_int auto_resize = 1;
+SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize,
+CTLFLAG_RW, _resize, 1,
+"Enable auto resize");
 
 /*
  * The GEOM partitioning class.
@@ -2095,6 +2099,9 @@ g_part_resize(struct g_consumer *cp)
G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->name));
g_topology_assert();
 
+   if (auto_resize == 0)
+   return;
+
table = cp->geom->softc;
if (table->gpt_opened == 0) {
if (g_access(cp, 1, 1, 1) != 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: r314358 - head/sys/dev/firewire

2017-02-27 Thread Alexander Motin
Author: mav
Date: Mon Feb 27 17:50:38 2017
New Revision: 314358
URL: https://svnweb.freebsd.org/changeset/base/314358

Log:
  Announce that sbp_targ(4) does not support initiator mode.
  
  MFC after:1 week

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

Modified: head/sys/dev/firewire/sbp_targ.c
==
--- head/sys/dev/firewire/sbp_targ.cMon Feb 27 17:36:31 2017
(r314357)
+++ head/sys/dev/firewire/sbp_targ.cMon Feb 27 17:50:38 2017
(r314358)
@@ -1324,7 +1324,8 @@ sbp_targ_action1(struct cam_sim *sim, un
 | PIT_DISCONNECT
 | PIT_TERM_IO;
cpi->transport = XPORT_SPI; /* FIXME add XPORT_FW type to cam */
-   cpi->hba_misc = PIM_NOBUSRESET | PIM_NO_6_BYTE;
+   cpi->hba_misc = PIM_NOINITIATOR | PIM_NOBUSRESET |
+   PIM_NO_6_BYTE;
cpi->hba_eng_cnt = 0;
cpi->max_target = 7; /* XXX */
cpi->max_lun = MAX_LUN - 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: r314355 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:27:23 2017
New Revision: 314355
URL: https://svnweb.freebsd.org/changeset/base/314355

Log:
  MFC r314059: zfs: move zio_taskq_basedc under SYSDC

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c  Mon Feb 
27 17:25:56 2017(r314354)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c  Mon Feb 
27 17:27:23 2017(r314355)
@@ -167,8 +167,8 @@ id_tzio_taskq_psrset_bind = PS_NONE;
 #endif
 #ifdef SYSDC
 boolean_t  zio_taskq_sysdc = B_TRUE;   /* use SDC scheduling class */
-#endif
 uint_t zio_taskq_basedc = 80;  /* base duty cycle */
+#endif
 
 boolean_t  spa_create_process = B_TRUE;/* no process ==> no sysdc */
 extern int zfs_sync_pass_deferred_free;
___
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: r314356 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:27:42 2017
New Revision: 314356
URL: https://svnweb.freebsd.org/changeset/base/314356

Log:
  MFC r314059: zfs: move zio_taskq_basedc under SYSDC

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c  Mon Feb 
27 17:27:23 2017(r314355)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c  Mon Feb 
27 17:27:42 2017(r314356)
@@ -168,8 +168,8 @@ id_tzio_taskq_psrset_bind = PS_NONE;
 #endif
 #ifdef SYSDC
 boolean_t  zio_taskq_sysdc = B_TRUE;   /* use SDC scheduling class */
-#endif
 uint_t zio_taskq_basedc = 80;  /* base duty cycle */
+#endif
 
 boolean_t  spa_create_process = B_TRUE;/* no process ==> no sysdc */
 extern int zfs_sync_pass_deferred_free;
___
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: r314357 - head/sys/x86/x86

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:36:31 2017
New Revision: 314357
URL: https://svnweb.freebsd.org/changeset/base/314357

Log:
  fix lvt_mode: edge-triggered interrupt mode is set by clearing APIC_LVT_TM
  
  The fixed is used only to fix up buggy MPTable information and the
  trigger mode is probably ignored for the relevant interrupt types
  anyway.  Still, it's better to be standards compliant and have the code
  do what it says it does.
  
  Discussed with:   jhb
  MFC after:5 days

Modified:
  head/sys/x86/x86/local_apic.c

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Mon Feb 27 17:27:42 2017
(r314356)
+++ head/sys/x86/x86/local_apic.c   Mon Feb 27 17:36:31 2017
(r314357)
@@ -398,7 +398,7 @@ lvt_mode(struct lapic *la, u_int pin, ui
if (!lvt->lvt_edgetrigger && bootverbose) {
printf("lapic%u: Forcing LINT%u to edge trigger\n",
la->la_id, pin);
-   value |= APIC_LVT_TM;
+   value &= ~APIC_LVT_TM;
}
/* Use a vector of 0. */
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314351 - stable/10/sys/dev/jedec_ts

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:23:42 2017
New Revision: 314351
URL: https://svnweb.freebsd.org/changeset/base/314351

Log:
  MFC r314037: jedec_ts: fix slave address check

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

Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c
==
--- stable/10/sys/dev/jedec_ts/jedec_ts.c   Mon Feb 27 17:20:49 2017
(r314350)
+++ stable/10/sys/dev/jedec_ts/jedec_ts.c   Mon Feb 27 17:23:42 2017
(r314351)
@@ -104,7 +104,7 @@ ts_attach(device_t dev)
uint8_t addr;
 
addr = smbus_get_addr(dev);
-   if ((addr & 0x30) != 0x30) {
+   if ((addr & 0xf0) != 0x30) {
/* Up to 8 slave devices starting at 0x30. */
return (ENXIO);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314353 - stable/11/share/man/man4

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:25:52 2017
New Revision: 314353
URL: https://svnweb.freebsd.org/changeset/base/314353

Log:
  MFC r314183: add jedec_ts.4 to the list of manual pages

Modified:
  stable/11/share/man/man4/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/Makefile
==
--- stable/11/share/man/man4/Makefile   Mon Feb 27 17:24:01 2017
(r314352)
+++ stable/11/share/man/man4/Makefile   Mon Feb 27 17:25:52 2017
(r314353)
@@ -240,6 +240,7 @@ MAN=aac.4 \
ixgbe.4 \
ixl.4 \
ixlv.4 \
+   jedec_ts.4 \
jme.4 \
joy.4 \
kbdmux.4 \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314354 - stable/10/share/man/man4

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:25:56 2017
New Revision: 314354
URL: https://svnweb.freebsd.org/changeset/base/314354

Log:
  MFC r314183: add jedec_ts.4 to the list of manual pages

Modified:
  stable/10/share/man/man4/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/Makefile
==
--- stable/10/share/man/man4/Makefile   Mon Feb 27 17:25:52 2017
(r314353)
+++ stable/10/share/man/man4/Makefile   Mon Feb 27 17:25:56 2017
(r314354)
@@ -222,6 +222,7 @@ MAN=aac.4 \
ixgbe.4 \
ixl.4 \
ixlv.4 \
+   jedec_ts.4 \
jme.4 \
joy.4 \
kbdmux.4 \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314352 - stable/11/sys/dev/jedec_ts

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:24:01 2017
New Revision: 314352
URL: https://svnweb.freebsd.org/changeset/base/314352

Log:
  MFC r314037: jedec_ts: fix slave address check

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

Modified: stable/11/sys/dev/jedec_ts/jedec_ts.c
==
--- stable/11/sys/dev/jedec_ts/jedec_ts.c   Mon Feb 27 17:23:42 2017
(r314351)
+++ stable/11/sys/dev/jedec_ts/jedec_ts.c   Mon Feb 27 17:24:01 2017
(r314352)
@@ -104,7 +104,7 @@ ts_attach(device_t dev)
uint8_t addr;
 
addr = smbus_get_addr(dev);
-   if ((addr & 0x30) != 0x30) {
+   if ((addr & 0xf0) != 0x30) {
/* Up to 8 slave devices starting at 0x30. */
return (ENXIO);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314350 - stable/10/sys/x86/x86

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:20:49 2017
New Revision: 314350
URL: https://svnweb.freebsd.org/changeset/base/314350

Log:
  MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling

Modified:
  stable/10/sys/x86/x86/mca.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/x86/x86/mca.c
==
--- stable/10/sys/x86/x86/mca.c Mon Feb 27 17:20:44 2017(r314349)
+++ stable/10/sys/x86/x86/mca.c Mon Feb 27 17:20:49 2017(r314350)
@@ -73,7 +73,7 @@ enum scan_mode {
  */
 struct cmc_state {
int max_threshold;
-   int last_intr;
+   time_t  last_intr;
 };
 #endif
 
@@ -535,7 +535,7 @@ cmci_update(enum scan_mode mode, int ban
cc = _state[PCPU_GET(cpuid)][bank];
ctl = rdmsr(MSR_MC_CTL2(bank));
count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38;
-   delta = (u_int)(ticks - cc->last_intr);
+   delta = (u_int)(time_uptime - cc->last_intr);
 
/*
 * If an interrupt was received less than cmc_throttle seconds
@@ -552,7 +552,7 @@ cmci_update(enum scan_mode mode, int ban
ctl |= limit;
wrmsr(MSR_MC_CTL2(bank), limit);
}
-   cc->last_intr = ticks;
+   cc->last_intr = time_uptime;
return;
}
 
@@ -852,7 +852,7 @@ cmci_resume(int i)
return;
 
cc = _state[PCPU_GET(cpuid)][i];
-   cc->last_intr = -ticks;
+   cc->last_intr = 0;
ctl = rdmsr(MSR_MC_CTL2(i));
ctl &= ~MC_CTL2_THRESHOLD;
ctl |= MC_CTL2_CMCI_EN | 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: r314349 - stable/11/sys/x86/x86

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:20:44 2017
New Revision: 314349
URL: https://svnweb.freebsd.org/changeset/base/314349

Log:
  MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling

Modified:
  stable/11/sys/x86/x86/mca.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/x86/x86/mca.c
==
--- stable/11/sys/x86/x86/mca.c Mon Feb 27 17:18:07 2017(r314348)
+++ stable/11/sys/x86/x86/mca.c Mon Feb 27 17:20:44 2017(r314349)
@@ -73,7 +73,7 @@ enum scan_mode {
  */
 struct cmc_state {
int max_threshold;
-   int last_intr;
+   time_t  last_intr;
 };
 #endif
 
@@ -533,7 +533,7 @@ cmci_update(enum scan_mode mode, int ban
cc = _state[PCPU_GET(cpuid)][bank];
ctl = rdmsr(MSR_MC_CTL2(bank));
count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38;
-   delta = (u_int)(ticks - cc->last_intr);
+   delta = (u_int)(time_uptime - cc->last_intr);
 
/*
 * If an interrupt was received less than cmc_throttle seconds
@@ -550,7 +550,7 @@ cmci_update(enum scan_mode mode, int ban
ctl |= limit;
wrmsr(MSR_MC_CTL2(bank), limit);
}
-   cc->last_intr = ticks;
+   cc->last_intr = time_uptime;
return;
}
 
@@ -857,7 +857,7 @@ cmci_resume(int i)
return;
 
cc = _state[PCPU_GET(cpuid)][i];
-   cc->last_intr = -ticks;
+   cc->last_intr = 0;
ctl = rdmsr(MSR_MC_CTL2(i));
ctl &= ~MC_CTL2_THRESHOLD;
ctl |= MC_CTL2_CMCI_EN | 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: r314347 - in stable/11/sys: kern vm

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:18:05 2017
New Revision: 314347
URL: https://svnweb.freebsd.org/changeset/base/314347

Log:
  MFC r313730: try to fix RACCT_RSS accounting

Modified:
  stable/11/sys/kern/kern_racct.c
  stable/11/sys/vm/vm_pageout.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_racct.c
==
--- stable/11/sys/kern/kern_racct.c Mon Feb 27 17:12:17 2017
(r314346)
+++ stable/11/sys/kern/kern_racct.c Mon Feb 27 17:18:05 2017
(r314347)
@@ -1014,10 +1014,13 @@ racct_proc_exit(struct proc *p)
racct_set_locked(p, RACCT_CPU, runtime, 0);
racct_add_cred_locked(p->p_ucred, RACCT_PCTCPU, pct);
 
+   KASSERT(p->p_racct->r_resources[RACCT_RSS] == 0,
+   ("process reaped with %ju allocated for RSS\n",
+   p->p_racct->r_resources[RACCT_RSS]));
for (i = 0; i <= RACCT_MAX; i++) {
if (p->p_racct->r_resources[i] == 0)
continue;
-   if (!RACCT_IS_RECLAIMABLE(i))
+   if (!RACCT_IS_RECLAIMABLE(i))
continue;
racct_set_locked(p, i, 0, 0);
}

Modified: stable/11/sys/vm/vm_pageout.c
==
--- stable/11/sys/vm/vm_pageout.c   Mon Feb 27 17:12:17 2017
(r314346)
+++ stable/11/sys/vm/vm_pageout.c   Mon Feb 27 17:18:05 2017
(r314347)
@@ -1806,12 +1806,14 @@ again:
if (size >= limit) {
vm_pageout_map_deactivate_pages(
>vm_map, limit);
+   size = vmspace_resident_count(vm);
}
 #ifdef RACCT
if (racct_enable) {
rsize = IDX_TO_OFF(size);
PROC_LOCK(p);
-   racct_set(p, RACCT_RSS, rsize);
+   if (p->p_state == PRS_NORMAL)
+   racct_set(p, RACCT_RSS, rsize);
ravailable = racct_get_available(p, RACCT_RSS);
PROC_UNLOCK(p);
if (rsize > ravailable) {
@@ -1837,7 +1839,8 @@ again:
size = vmspace_resident_count(vm);
rsize = IDX_TO_OFF(size);
PROC_LOCK(p);
-   racct_set(p, RACCT_RSS, rsize);
+   if (p->p_state == PRS_NORMAL)
+   racct_set(p, RACCT_RSS, rsize);
PROC_UNLOCK(p);
if (rsize > ravailable)
tryagain = 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: r314348 - in stable/10/sys: kern vm

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 17:18:07 2017
New Revision: 314348
URL: https://svnweb.freebsd.org/changeset/base/314348

Log:
  MFC r313730: try to fix RACCT_RSS accounting

Modified:
  stable/10/sys/kern/kern_racct.c
  stable/10/sys/vm/vm_pageout.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_racct.c
==
--- stable/10/sys/kern/kern_racct.c Mon Feb 27 17:18:05 2017
(r314347)
+++ stable/10/sys/kern/kern_racct.c Mon Feb 27 17:18:07 2017
(r314348)
@@ -1008,10 +1008,13 @@ racct_proc_exit(struct proc *p)
racct_set_locked(p, RACCT_CPU, runtime);
racct_add_cred_locked(p->p_ucred, RACCT_PCTCPU, pct);
 
+   KASSERT(p->p_racct->r_resources[RACCT_RSS] == 0,
+   ("process reaped with %ju allocated for RSS\n",
+   p->p_racct->r_resources[RACCT_RSS]));
for (i = 0; i <= RACCT_MAX; i++) {
if (p->p_racct->r_resources[i] == 0)
continue;
-   if (!RACCT_IS_RECLAIMABLE(i))
+   if (!RACCT_IS_RECLAIMABLE(i))
continue;
racct_set_locked(p, i, 0);
}

Modified: stable/10/sys/vm/vm_pageout.c
==
--- stable/10/sys/vm/vm_pageout.c   Mon Feb 27 17:18:05 2017
(r314347)
+++ stable/10/sys/vm/vm_pageout.c   Mon Feb 27 17:18:07 2017
(r314348)
@@ -1981,12 +1981,14 @@ again:
if (size >= limit) {
vm_pageout_map_deactivate_pages(
>vm_map, limit);
+   size = vmspace_resident_count(vm);
}
 #ifdef RACCT
if (racct_enable) {
rsize = IDX_TO_OFF(size);
PROC_LOCK(p);
-   racct_set(p, RACCT_RSS, rsize);
+   if (p->p_state == PRS_NORMAL)
+   racct_set(p, RACCT_RSS, rsize);
ravailable = racct_get_available(p, RACCT_RSS);
PROC_UNLOCK(p);
if (rsize > ravailable) {
@@ -2012,7 +2014,8 @@ again:
size = vmspace_resident_count(vm);
rsize = IDX_TO_OFF(size);
PROC_LOCK(p);
-   racct_set(p, RACCT_RSS, rsize);
+   if (p->p_state == PRS_NORMAL)
+   racct_set(p, RACCT_RSS, rsize);
PROC_UNLOCK(p);
if (rsize > ravailable)
tryagain = 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: r314346 - head/sys/arm/allwinner/clkng

2017-02-27 Thread Emmanuel Vadot
Author: manu
Date: Mon Feb 27 17:12:17 2017
New Revision: 314346
URL: https://svnweb.freebsd.org/changeset/base/314346

Log:
  allwinner: Correct some clocks name for H3 CCU.

Modified:
  head/sys/arm/allwinner/clkng/ccu_h3.c

Modified: head/sys/arm/allwinner/clkng/ccu_h3.c
==
--- head/sys/arm/allwinner/clkng/ccu_h3.c   Mon Feb 27 17:04:35 2017
(r314345)
+++ head/sys/arm/allwinner/clkng/ccu_h3.c   Mon Feb 27 17:12:17 2017
(r314346)
@@ -147,9 +147,9 @@ static struct aw_ccung_gate h3_ccu_gates
CCU_GATE(H3_CLK_BUS_SPDIF, "bus-spdif", "apb1", 0x68, 1)
CCU_GATE(H3_CLK_BUS_PIO, "bus-pio", "apb1", 0x68, 5)
CCU_GATE(H3_CLK_BUS_THS, "bus-ths", "apb1", 0x68, 8)
-   CCU_GATE(H3_CLK_BUS_I2S0, "bus-i2c0", "apb1", 0x68, 12)
-   CCU_GATE(H3_CLK_BUS_I2S1, "bus-i2c1", "apb1", 0x68, 13)
-   CCU_GATE(H3_CLK_BUS_I2S2, "bus-i2c2", "apb1", 0x68, 14)
+   CCU_GATE(H3_CLK_BUS_I2S0, "bus-i2s0", "apb1", 0x68, 12)
+   CCU_GATE(H3_CLK_BUS_I2S1, "bus-i2s1", "apb1", 0x68, 13)
+   CCU_GATE(H3_CLK_BUS_I2S2, "bus-i2s2", "apb1", 0x68, 14)
 
CCU_GATE(H3_CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x6c, 0)
CCU_GATE(H3_CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x6c, 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: r314345 - head/sys/dev/usb/controller

2017-02-27 Thread Bruce M Simpson
Author: bms
Date: Mon Feb 27 17:04:35 2017
New Revision: 314345
URL: https://svnweb.freebsd.org/changeset/base/314345

Log:
  Add ID for NEC uPD720202 xHCI controller.
  
  MFC after:1 month

Modified:
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/xhci_pci.c
==
--- head/sys/dev/usb/controller/xhci_pci.c  Mon Feb 27 16:55:09 2017
(r314344)
+++ head/sys/dev/usb/controller/xhci_pci.c  Mon Feb 27 17:04:35 2017
(r314345)
@@ -100,6 +100,8 @@ xhci_pci_match(device_t self)
 
case 0x01941033:
return ("NEC uPD720200 USB 3.0 controller");
+   case 0x00151912:
+   return ("NEC uPD720202 USB 3.0 controller");
 
case 0x10001b73:
return ("Fresco Logic FL1000G USB 3.0 controller");
___
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: r314344 - head/sys/compat/linux

2017-02-27 Thread Dmitry Chagin
Author: dchagin
Date: Mon Feb 27 16:55:09 2017
New Revision: 314344
URL: https://svnweb.freebsd.org/changeset/base/314344

Log:
  Return EINVAL when an invalid file descriptor specified.
  
  MFC after:1 month

Modified:
  head/sys/compat/linux/linux_event.c

Modified: head/sys/compat/linux/linux_event.c
==
--- head/sys/compat/linux/linux_event.c Mon Feb 27 16:53:52 2017
(r314343)
+++ head/sys/compat/linux/linux_event.c Mon Feb 27 16:55:09 2017
(r314344)
@@ -729,7 +729,7 @@ eventfd_close(struct file *fp, struct th
 
efd = fp->f_data;
if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
-   return (EBADF);
+   return (EINVAL);
 
seldrain(>efd_sel);
knlist_destroy(>efd_sel.si_note);
@@ -751,7 +751,7 @@ eventfd_read(struct file *fp, struct uio
 
efd = fp->f_data;
if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
-   return (EBADF);
+   return (EINVAL);
 
if (uio->uio_resid < sizeof(eventfd_t))
return (EINVAL);
@@ -797,7 +797,7 @@ eventfd_write(struct file *fp, struct ui
 
efd = fp->f_data;
if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
-   return (EBADF);
+   return (EINVAL);
 
if (uio->uio_resid < sizeof(eventfd_t))
return (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: r314343 - head/sys/compat/linux

2017-02-27 Thread Dmitry Chagin
Author: dchagin
Date: Mon Feb 27 16:53:52 2017
New Revision: 314343
URL: https://svnweb.freebsd.org/changeset/base/314343

Log:
  Unify eventfd ioctl method and use it for other similar interfaces.
  
  MFC after:1 month

Modified:
  head/sys/compat/linux/linux_event.c

Modified: head/sys/compat/linux/linux_event.c
==
--- head/sys/compat/linux/linux_event.c Mon Feb 27 15:37:38 2017
(r314342)
+++ head/sys/compat/linux/linux_event.c Mon Feb 27 16:53:52 2017
(r314343)
@@ -177,7 +177,7 @@ static struct fileops timerfdops = {
.fo_read = timerfd_read,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,
-   .fo_ioctl = invfo_ioctl,
+   .fo_ioctl = eventfd_ioctl,
.fo_poll = timerfd_poll,
.fo_kqfilter = timerfd_kqfilter,
.fo_stat = timerfd_stat,
@@ -760,7 +760,7 @@ eventfd_read(struct file *fp, struct uio
mtx_lock(>efd_lock);
 retry:
if (efd->efd_count == 0) {
-   if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) {
+   if ((fp->f_flag & FNONBLOCK) != 0) {
mtx_unlock(>efd_lock);
return (EAGAIN);
}
@@ -811,7 +811,7 @@ eventfd_write(struct file *fp, struct ui
mtx_lock(>efd_lock);
 retry:
if (UINT64_MAX - efd->efd_count <= count) {
-   if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) {
+   if ((fp->f_flag & FNONBLOCK) != 0) {
mtx_unlock(>efd_lock);
/* Do not not return the number of bytes written */
uio->uio_resid += sizeof(eventfd_t);
@@ -927,19 +927,18 @@ static int
 eventfd_ioctl(struct file *fp, u_long cmd, void *data,
 struct ucred *active_cred, struct thread *td)
 {
-   struct eventfd *efd;
 
-   efd = fp->f_data;
-   if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
+   if (fp->f_data == NULL || (fp->f_type != DTYPE_LINUXEFD &&
+   fp->f_type != DTYPE_LINUXTFD))
return (EINVAL);
 
switch (cmd)
{
case FIONBIO:
-   if (*(int *)data)
-   efd->efd_flags |= LINUX_O_NONBLOCK;
+   if ((*(int *)data))
+   atomic_set_int(>f_flag, FNONBLOCK);
else
-   efd->efd_flags &= ~LINUX_O_NONBLOCK;
+   atomic_clear_int(>f_flag, FNONBLOCK);
case FIOASYNC:
return (0);
default:
___
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: r314341 - head/etc

2017-02-27 Thread Alan Somers
Author: asomers
Date: Mon Feb 27 15:32:56 2017
New Revision: 314341
URL: https://svnweb.freebsd.org/changeset/base/314341

Log:
  Update devd.conf for ports change 421360
  
  Ports change 421360 changed the name and UID of the postgres user
  
  Reviewed by:  trasz, imp, girgen
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D9746

Modified:
  head/etc/devd.conf

Modified: head/etc/devd.conf
==
--- head/etc/devd.conf  Mon Feb 27 15:31:15 2017(r314340)
+++ head/etc/devd.conf  Mon Feb 27 15:32:56 2017(r314341)
@@ -312,10 +312,10 @@ notify 10 {
 };
 
 # This example works around a memory leak in PostgreSQL, restarting
-# it when the "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered.
+# it when the "user:postgres:swap:devctl=1G" rctl(8) rule gets triggered.
 notify 0 {
match "system"  "RCTL";
-   match "rule""user:70:swap:.*";
+   match "rule""user:770:swap:.*";
action  "/usr/local/etc/rc.d/postgresql restart";
 };
 
___
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: r314342 - head/usr.sbin/bhyve

2017-02-27 Thread Roman Bogorodskiy
Author: novel (ports committer)
Date: Mon Feb 27 15:37:38 2017
New Revision: 314342
URL: https://svnweb.freebsd.org/changeset/base/314342

Log:
  bhyve: document virtio-console in the manpage
  
  Reviewed by:  bcr, wblock, jceel
  Approved by:  grehan
  Differential Revision:https://reviews.freebsd.org/D9564

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

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Mon Feb 27 15:32:56 2017(r314341)
+++ head/usr.sbin/bhyve/bhyve.8 Mon Feb 27 15:37:38 2017(r314342)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2016
+.Dd February 27, 2017
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -171,6 +171,10 @@ Virtio network interface.
 Virtio block storage interface.
 .It Li virtio-rnd
 Virtio RNG interface.
+.It Li virtio-console
+Virtio console interface, which exposes multiple ports
+to the guest in the form of simple char devices for simple IO
+between the guest and host userspaces.
 .It Li ahci
 AHCI controller attached to arbitrary devices.
 .It Li ahci-cd
@@ -270,6 +274,31 @@ The host device must have been reserved 
 .Va pptdev
 loader variable as described in
 .Xr vmm 4 .
+.Pp
+Virtio console devices:
+.Bl -tag -width 10n
+.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ...
+A maximum of 16 ports per device can be created.
+Every port is named and corresponds to a Unix domain socket created by
+.Nm .
+.Nm
+accepts at most one connection per port at a time.
+.Pp
+Limitations:
+.Bl -bullet -offset 2n
+.It
+Due to lack of destructors in
+.Nm ,
+sockets on the filesystem must be cleaned up manually after
+.Nm
+exits.
+.It
+There is no way to use the "console port" feature, nor the console port
+resize as of now.
+.It
+Emergency write is advertised, but no-op as of now.
+.El
+.El
 .El
 .It Fl S
 Wire guest memory.
___
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: r314340 - head/sys/dev/xen/gntdev

2017-02-27 Thread Roger Pau Monné
Author: royger
Date: Mon Feb 27 15:31:15 2017
New Revision: 314340
URL: https://svnweb.freebsd.org/changeset/base/314340

Log:
  xen/gntdev: prevent unsynchronized accesses to the map entry
  
  vm_map_lookup_done should only be called when the gntdev has finished poking 
at
  the entry.
  
  Reported by:  alc
  Reviewed by:  alc
  MFC after:1 week
  Sponsored by: Citrix Systems R

Modified:
  head/sys/dev/xen/gntdev/gntdev.c

Modified: head/sys/dev/xen/gntdev/gntdev.c
==
--- head/sys/dev/xen/gntdev/gntdev.cMon Feb 27 15:30:27 2017
(r314339)
+++ head/sys/dev/xen/gntdev/gntdev.cMon Feb 27 15:31:15 2017
(r314340)
@@ -743,26 +743,34 @@ gntdev_get_offset_for_vaddr(struct ioctl
vm_prot_t prot;
boolean_t wired;
struct gntdev_gmap *gmap;
+   int rc;
 
map = >td_proc->p_vmspace->vm_map;
error = vm_map_lookup(, arg->vaddr, VM_PROT_NONE, ,
, , , );
if (error != KERN_SUCCESS)
return (EINVAL);
-   vm_map_lookup_done(map, entry);
 
if ((mem->type != OBJT_MGTDEVICE) ||
-   (mem->un_pager.devp.ops != _gmap_pg_ops))
-   return (EINVAL);
+   (mem->un_pager.devp.ops != _gmap_pg_ops)) {
+   rc = EINVAL;
+   goto out;
+   }
 
gmap = mem->handle;
if (gmap == NULL ||
-   (entry->end - entry->start) != (gmap->count * PAGE_SIZE))
-   return (EINVAL);
+   (entry->end - entry->start) != (gmap->count * PAGE_SIZE)) {
+   rc = EINVAL;
+   goto out;
+   }
 
arg->count = gmap->count;
arg->offset = gmap->file_index;
-   return (0);
+   rc = 0;
+
+out:
+   vm_map_lookup_done(map, entry);
+   return (rc);
 }
 
 /* Grant Mapping Pager  
--*/
___
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: r314339 - head/sbin/setkey

2017-02-27 Thread Andrey V. Elsukov
Author: ae
Date: Mon Feb 27 15:30:27 2017
New Revision: 314339
URL: https://svnweb.freebsd.org/changeset/base/314339

Log:
  Document that the size of AH ICV for HMAC-SHA2-NNN should be half of
  NNN bits as described in RFC4868.
  
  PR:   215978

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Mon Feb 27 14:59:00 2017(r314338)
+++ head/sbin/setkey/setkey.8   Mon Feb 27 15:30:27 2017(r314339)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 6, 2017
+.Dd February 27, 2017
 .Dt SETKEY 8
 .Os
 .\"
@@ -593,12 +593,11 @@ keyed-md5 128 ah: 96bit ICV (no documen
 keyed-sha1 160 ah: 96bit ICV (no document)
160 ah-old: 128bit ICV (no document)
 null   0 to 2048   for debugging
-hmac-sha2-256  256 ah: 96bit ICV
-   (draft-ietf-ipsec-ciph-sha-256-00)
+hmac-sha2-256  256 ah: 128bit ICV (RFC4868)
256 ah-old: 128bit ICV (no document)
-hmac-sha2-384  384 ah: 96bit ICV (no document)
+hmac-sha2-384  384 ah: 192bit ICV (RFC4868)
384 ah-old: 128bit ICV (no document)
-hmac-sha2-512  512 ah: 96bit ICV (no document)
+hmac-sha2-512  512 ah: 256bit ICV (RFC4868)
512 ah-old: 128bit ICV (no document)
 hmac-ripemd160 160 ah: 96bit ICV (RFC2857)
ah-old: 128bit ICV (no document)
___
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: r314335 - stable/10/sys/crypto/sha2

2017-02-27 Thread Allan Jude
On February 27, 2017 6:01:41 AM PST, Ed Schouten  wrote:
>Hi Andriy,
>
>2017-02-27 14:05 GMT+01:00 Andriy Gapon :
>> +/* Message schedule computation */
>> +#define MSCH(W, ii, i) \
>> +   W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i
>+ ii + 1]) + W[i + ii]
>
>[snip]
>
>> uint32_t W[64];
>
>[snip]
>
>> +   for (i = 0; i < 64; i += 16) {
>> +   RNDr(S, W, 1, i);
>> +   RNDr(S, W, 2, i);
>> +   RNDr(S, W, 3, i);
>> +   RNDr(S, W, 4, i);
>> +   RNDr(S, W, 5, i);
>> +   RNDr(S, W, 6, i);
>> +   RNDr(S, W, 7, i);
>> +   RNDr(S, W, 8, i);
>> +   RNDr(S, W, 9, i);
>> +   RNDr(S, W, 10, i);
>> +   RNDr(S, W, 11, i);
>> +   RNDr(S, W, 12, i);
>> +   RNDr(S, W, 13, i);
>> +   RNDr(S, W, 14, i);
>> +   RNDr(S, W, 15, i);
>> +
>> +   if (i == 48)
>> +   break;
>> +   MSCH(W, 0, i);
>> +   MSCH(W, 1, i);
>> +   MSCH(W, 2, i);
>> +   MSCH(W, 3, i);
>> +   MSCH(W, 4, i);
>> +   MSCH(W, 5, i);
>> +   MSCH(W, 6, i);
>> +   MSCH(W, 7, i);
>> +   MSCH(W, 8, i);
>> +   MSCH(W, 9, i);
>> +   MSCH(W, 10, i);
>> +   MSCH(W, 11, i);
>> +   MSCH(W, 12, i);
>> +   MSCH(W, 13, i);
>> +   MSCH(W, 14, i);
>> +   MSCH(W, 15, i);
>> +   }
>
>Something interesting that I noticed some time ago when comparing the
>various SHA-{256,512} implementations: there is no need to store the
>entire extended message in W. During every iteration of this loop,
>RNDr() and MSCH() never go more than 16 elements back.
>
>Say, if you were to modify MSCH() to something like this:
>
>> +#define MSCH(W, ii) \
>> +   W[ii] += s1(W[(ii + 14) % 16]) + W[(ii + 9) % 16] + s0(W[(ii
>+ 1)) % 16])
>
>Then it will compute the next chunk of the extended message in-place.
>RNDr() must then be adjusted to use W[i] instead of W[i + ii], of
>course. W then only needs to hold 16 elements instead of 64 or 80.

Add Colin, author of the original code
-- 
Allan Jude
___
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: r314338 - head/sys/cam/ctl

2017-02-27 Thread Alexander Motin
Author: mav
Date: Mon Feb 27 14:59:00 2017
New Revision: 314338
URL: https://svnweb.freebsd.org/changeset/base/314338

Log:
  Polish handling of different reset flavours.
  
  The biggest change is that ctl_remove_initiator() now generates I_T NEXUS
  LOSS event, cleaning part of LUs state related to the initiator.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/ctl/ctl_tpc.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Mon Feb 27 14:38:17 2017(r314337)
+++ head/sys/cam/ctl/ctl.c  Mon Feb 27 14:59:00 2017(r314338)
@@ -478,15 +478,15 @@ static int ctl_scsiio_precheck(struct ct
   struct ctl_scsiio *ctsio);
 static int ctl_scsiio(struct ctl_scsiio *ctsio);
 
-static int ctl_bus_reset(struct ctl_softc *ctl_softc, union ctl_io *io);
-static int ctl_target_reset(struct ctl_softc *ctl_softc, union ctl_io *io,
-   ctl_ua_type ua_type);
-static int ctl_do_lun_reset(struct ctl_lun *lun, union ctl_io *io,
+static int ctl_target_reset(union ctl_io *io);
+static void ctl_do_lun_reset(struct ctl_lun *lun, uint32_t initidx,
 ctl_ua_type ua_type);
-static int ctl_lun_reset(struct ctl_softc *ctl_softc, union ctl_io *io);
+static int ctl_lun_reset(union ctl_io *io);
 static int ctl_abort_task(union ctl_io *io);
 static int ctl_abort_task_set(union ctl_io *io);
 static int ctl_query_task(union ctl_io *io, int task_set);
+static void ctl_i_t_nexus_loss(struct ctl_softc *softc, uint32_t initidx,
+ ctl_ua_type ua_type);
 static int ctl_i_t_nexus_reset(union ctl_io *io);
 static int ctl_query_async_event(union ctl_io *io);
 static void ctl_run_task(union ctl_io *io);
@@ -1288,6 +1288,9 @@ ctl_isc_iid_sync(struct ctl_softc *softc
return;
}
iid = msg->hdr.nexus.initid;
+   if (port->wwpn_iid[iid].in_use != 0 &&
+   msg->iid.in_use == 0)
+   ctl_i_t_nexus_loss(softc, iid, CTL_UA_POWERON);
port->wwpn_iid[iid].in_use = msg->iid.in_use;
port->wwpn_iid[iid].wwpn = msg->iid.wwpn;
free(port->wwpn_iid[iid].name, M_CTL);
@@ -2027,6 +2030,7 @@ int
 ctl_remove_initiator(struct ctl_port *port, int iid)
 {
struct ctl_softc *softc = port->ctl_softc;
+   int last;
 
mtx_assert(>ctl_lock, MA_NOTOWNED);
 
@@ -2037,9 +2041,11 @@ ctl_remove_initiator(struct ctl_port *po
}
 
mtx_lock(>ctl_lock);
-   port->wwpn_iid[iid].in_use--;
+   last = (--port->wwpn_iid[iid].in_use == 0);
port->wwpn_iid[iid].last_use = time_uptime;
mtx_unlock(>ctl_lock);
+   if (last)
+   ctl_i_t_nexus_loss(softc, iid, CTL_UA_POWERON);
ctl_isc_announce_iid(port, iid);
 
return (0);
@@ -2144,11 +2150,6 @@ ctl_add_initiator(struct ctl_port *port,
__func__, port->targ_port, iid, wwpn, name,
(uintmax_t)port->wwpn_iid[iid].wwpn,
port->wwpn_iid[iid].name);
-
-   /*
-* XXX KDM clear pending_sense and pending_ua on each LUN
-* for this initiator.
-*/
}
 take:
free(port->wwpn_iid[iid].name, M_CTL);
@@ -11603,50 +11604,42 @@ bailout:
return (retval);
 }
 
-/*
- * Since we only implement one target right now, a bus reset simply resets
- * our single target.
- */
 static int
-ctl_bus_reset(struct ctl_softc *softc, union ctl_io *io)
-{
-   return(ctl_target_reset(softc, io, CTL_UA_BUS_RESET));
-}
-
-static int
-ctl_target_reset(struct ctl_softc *softc, union ctl_io *io,
-ctl_ua_type ua_type)
+ctl_target_reset(union ctl_io *io)
 {
+   struct ctl_softc *softc = CTL_SOFTC(io);
struct ctl_port *port = CTL_PORT(io);
struct ctl_lun *lun;
-   int retval;
+   uint32_t initidx;
+   ctl_ua_type ua_type;
 
if (!(io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC)) {
union ctl_ha_msg msg_info;
 
msg_info.hdr.nexus = io->io_hdr.nexus;
-   if (ua_type==CTL_UA_TARG_RESET)
-   msg_info.task.task_action = CTL_TASK_TARGET_RESET;
-   else
-   msg_info.task.task_action = CTL_TASK_BUS_RESET;
+   msg_info.task.task_action = io->taskio.task_action;
msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS;
msg_info.hdr.original_sc = NULL;
msg_info.hdr.serializing_sc = NULL;
ctl_ha_msg_send(CTL_HA_CHAN_CTL, _info,
sizeof(msg_info.task), M_WAITOK);
}
-   retval = 0;
 
+   initidx = ctl_get_initindex(>io_hdr.nexus);
+   if (io->taskio.task_action == CTL_TASK_TARGET_RESET)
+   ua_type = CTL_UA_TARG_RESET;
+   else
+   ua_type = CTL_UA_BUS_RESET;

svn commit: r314337 - head/sys/compat/linuxkpi/common/include/linux

2017-02-27 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 27 14:38:17 2017
New Revision: 314337
URL: https://svnweb.freebsd.org/changeset/base/314337

Log:
  Implement more bit operation functions in the LinuxKPI.
  Some minor whitespace nits while at it.
  
  Obtained from:kmacy @
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/bitops.h

Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h  Mon Feb 27 
13:59:02 2017(r314336)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h  Mon Feb 27 
14:38:17 2017(r314337)
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #defineBIT(nr) (1UL << (nr))
 #defineBIT_ULL(nr) (1ULL << (nr))
@@ -43,6 +44,7 @@
 #else
 #defineBITS_PER_LONG   32
 #endif
+
 #defineBITMAP_FIRST_WORD_MASK(start)   (~0UL << ((start) % 
BITS_PER_LONG))
 #defineBITMAP_LAST_WORD_MASK(n)(~0UL >> (BITS_PER_LONG - (n)))
 #defineBITS_TO_LONGS(n)howmany((n), BITS_PER_LONG)
@@ -51,6 +53,12 @@
 #defineGENMASK(h, l)   (((~0UL) >> (BITS_PER_LONG - (h) - 1)) 
& ((~0UL) << (l)))
 #define BITS_PER_BYTE   8
 
+#definehweight8(x) bitcount((uint8_t)(x))
+#definehweight16(x)bitcount16(x)
+#definehweight32(x)bitcount32(x)
+#definehweight64(x)bitcount64(x)
+#definehweight_long(x) bitcountl(x)
+
 static inline int
 __ffs(int mask)
 {
@@ -75,10 +83,15 @@ __flsl(long mask)
return (flsl(mask) - 1);
 }
 
+static inline int
+fls64(uint64_t mask)
+{
+   return (flsll(mask));
+}
+
 static inline uint32_t
 ror32(uint32_t word, unsigned int shift)
 {
-
return ((word >> shift) | (word << (32 - shift)));
 }
 
@@ -542,4 +555,12 @@ bitmap_equal(const unsigned long *pa,
return (1);
 }
 
+static inline uint64_t
+sign_extend64(uint64_t value, int index)
+{
+   uint8_t shift = 63 - index;
+
+   return ((int64_t)(value << shift) >> shift);
+}
+
 #endif /* _LINUX_BITOPS_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r314335 - stable/10/sys/crypto/sha2

2017-02-27 Thread Ed Schouten
Hi Andriy,

2017-02-27 14:05 GMT+01:00 Andriy Gapon :
> +/* Message schedule computation */
> +#define MSCH(W, ii, i) \
> +   W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 
> 1]) + W[i + ii]

[snip]

> uint32_t W[64];

[snip]

> +   for (i = 0; i < 64; i += 16) {
> +   RNDr(S, W, 1, i);
> +   RNDr(S, W, 2, i);
> +   RNDr(S, W, 3, i);
> +   RNDr(S, W, 4, i);
> +   RNDr(S, W, 5, i);
> +   RNDr(S, W, 6, i);
> +   RNDr(S, W, 7, i);
> +   RNDr(S, W, 8, i);
> +   RNDr(S, W, 9, i);
> +   RNDr(S, W, 10, i);
> +   RNDr(S, W, 11, i);
> +   RNDr(S, W, 12, i);
> +   RNDr(S, W, 13, i);
> +   RNDr(S, W, 14, i);
> +   RNDr(S, W, 15, i);
> +
> +   if (i == 48)
> +   break;
> +   MSCH(W, 0, i);
> +   MSCH(W, 1, i);
> +   MSCH(W, 2, i);
> +   MSCH(W, 3, i);
> +   MSCH(W, 4, i);
> +   MSCH(W, 5, i);
> +   MSCH(W, 6, i);
> +   MSCH(W, 7, i);
> +   MSCH(W, 8, i);
> +   MSCH(W, 9, i);
> +   MSCH(W, 10, i);
> +   MSCH(W, 11, i);
> +   MSCH(W, 12, i);
> +   MSCH(W, 13, i);
> +   MSCH(W, 14, i);
> +   MSCH(W, 15, i);
> +   }

Something interesting that I noticed some time ago when comparing the
various SHA-{256,512} implementations: there is no need to store the
entire extended message in W. During every iteration of this loop,
RNDr() and MSCH() never go more than 16 elements back.

Say, if you were to modify MSCH() to something like this:

> +#define MSCH(W, ii) \
> +   W[ii] += s1(W[(ii + 14) % 16]) + W[(ii + 9) % 16] + s0(W[(ii + 1)) % 
> 16])

Then it will compute the next chunk of the extended message in-place.
RNDr() must then be adjusted to use W[i] instead of W[i + ii], of
course. W then only needs to hold 16 elements instead of 64 or 80.

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314336 - head/sys/compat/linuxkpi/common/include/linux

2017-02-27 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 27 13:59:02 2017
New Revision: 314336
URL: https://svnweb.freebsd.org/changeset/base/314336

Log:
  Define __sum16 type in the LinuxKPI.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/types.h

Modified: head/sys/compat/linuxkpi/common/include/linux/types.h
==
--- head/sys/compat/linuxkpi/common/include/linux/types.h   Mon Feb 27 
13:05:17 2017(r314335)
+++ head/sys/compat/linuxkpi/common/include/linux/types.h   Mon Feb 27 
13:59:02 2017(r314336)
@@ -57,6 +57,7 @@ typedef unsigned intuint;
 typedef unsigned gfp_t;
 typedef uint64_t loff_t;
 typedef vm_paddr_t resource_size_t;
+typedef uint16_t __bitwise__ __sum16;
 
 typedef u64 phys_addr_t;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314335 - stable/10/sys/crypto/sha2

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 13:05:17 2017
New Revision: 314335
URL: https://svnweb.freebsd.org/changeset/base/314335

Log:
  MFC r300966: Retune SHA2 code for improved performance on CPUs with more 
ILP...

Modified:
  stable/10/sys/crypto/sha2/sha256c.c
  stable/10/sys/crypto/sha2/sha512c.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/crypto/sha2/sha256c.c
==
--- stable/10/sys/crypto/sha2/sha256c.c Mon Feb 27 11:27:46 2017
(r314334)
+++ stable/10/sys/crypto/sha2/sha256c.c Mon Feb 27 13:05:17 2017
(r314335)
@@ -78,6 +78,26 @@ be32dec_vect(uint32_t *dst, const unsign
 
 #endif /* BYTE_ORDER != BIG_ENDIAN */
 
+/* SHA256 round constants. */
+static const uint32_t K[64] = {
+   0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
+   0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+   0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
+   0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+   0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
+   0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+   0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
+   0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+   0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
+   0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+   0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
+   0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+   0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
+   0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+   0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
+   0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+};
+
 /* Elementary functions used by SHA256 */
 #define Ch(x, y, z)((x & (y ^ z)) ^ z)
 #define Maj(x, y, z)   ((x & (y | z)) | (y & z))
@@ -90,18 +110,21 @@ be32dec_vect(uint32_t *dst, const unsign
 
 /* SHA256 round function */
 #define RND(a, b, c, d, e, f, g, h, k) \
-   t0 = h + S1(e) + Ch(e, f, g) + k;   \
-   t1 = S0(a) + Maj(a, b, c);  \
-   d += t0;\
-   h  = t0 + t1;
+   h += S1(e) + Ch(e, f, g) + k;   \
+   d += h; \
+   h += S0(a) + Maj(a, b, c);
 
 /* Adjusted round function for rotating state */
-#define RNDr(S, W, i, k)   \
+#define RNDr(S, W, i, ii)  \
RND(S[(64 - i) % 8], S[(65 - i) % 8],   \
S[(66 - i) % 8], S[(67 - i) % 8],   \
S[(68 - i) % 8], S[(69 - i) % 8],   \
S[(70 - i) % 8], S[(71 - i) % 8],   \
-   W[i] + k)
+   W[i + ii] + K[i + ii])
+
+/* Message schedule computation */
+#define MSCH(W, ii, i) \
+   W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) 
+ W[i + ii]
 
 /*
  * SHA256 block compression function.  The 256-bit state is transformed via
@@ -112,82 +135,52 @@ SHA256_Transform(uint32_t * state, const
 {
uint32_t W[64];
uint32_t S[8];
-   uint32_t t0, t1;
int i;
 
-   /* 1. Prepare message schedule W. */
+   /* 1. Prepare the first part of the message schedule W. */
be32dec_vect(W, block, 64);
-   for (i = 16; i < 64; i++)
-   W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];
 
/* 2. Initialize working variables. */
memcpy(S, state, 32);
 
/* 3. Mix. */
-   RNDr(S, W, 0, 0x428a2f98);
-   RNDr(S, W, 1, 0x71374491);
-   RNDr(S, W, 2, 0xb5c0fbcf);
-   RNDr(S, W, 3, 0xe9b5dba5);
-   RNDr(S, W, 4, 0x3956c25b);
-   RNDr(S, W, 5, 0x59f111f1);
-   RNDr(S, W, 6, 0x923f82a4);
-   RNDr(S, W, 7, 0xab1c5ed5);
-   RNDr(S, W, 8, 0xd807aa98);
-   RNDr(S, W, 9, 0x12835b01);
-   RNDr(S, W, 10, 0x243185be);
-   RNDr(S, W, 11, 0x550c7dc3);
-   RNDr(S, W, 12, 0x72be5d74);
-   RNDr(S, W, 13, 0x80deb1fe);
-   RNDr(S, W, 14, 0x9bdc06a7);
-   RNDr(S, W, 15, 0xc19bf174);
-   RNDr(S, W, 16, 0xe49b69c1);
-   RNDr(S, W, 17, 0xefbe4786);
-   RNDr(S, W, 18, 0x0fc19dc6);
-   RNDr(S, W, 19, 0x240ca1cc);
-   RNDr(S, W, 20, 0x2de92c6f);
-   RNDr(S, W, 21, 0x4a7484aa);
-   RNDr(S, W, 22, 0x5cb0a9dc);
-   RNDr(S, W, 23, 0x76f988da);
-   RNDr(S, W, 24, 0x983e5152);
-   RNDr(S, W, 25, 0xa831c66d);
-   RNDr(S, W, 26, 0xb00327c8);
-   RNDr(S, W, 27, 0xbf597fc7);
-   RNDr(S, W, 28, 0xc6e00bf3);
-   RNDr(S, W, 29, 0xd5a79147);
-   RNDr(S, W, 30, 0x06ca6351);
-   RNDr(S, W, 31, 0x14292967);
-   RNDr(S, W, 32, 0x27b70a85);
-   RNDr(S, W, 33, 0x2e1b2138);
-   RNDr(S, W, 34, 0x4d2c6dfc);
-   RNDr(S, W, 35, 0x53380d13);
-   RNDr(S, W, 36, 0x650a7354);
-   RNDr(S, W, 37, 0x766a0abb);
-   RNDr(S, W, 38, 0x81c2c92e);
-   RNDr(S, W, 39, 0x92722c85);
-   RNDr(S, W, 40, 0xa2bfe8a1);
- 

svn commit: r314334 - in stable/11/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys vm

2017-02-27 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 27 11:27:46 2017
New Revision: 314334
URL: https://svnweb.freebsd.org/changeset/base/314334

Log:
  MFC kern_mmap(9) and related helpers.
  
  MFC r302514 (by rwatson):
  Audit file-descriptor arguments to I/O system calls such as
  read(2), write(2), dup(2), and mmap(2).
  
  MFC r302524 (by rwatson):
  When mmap(2) is used with a vnode, capture vnode attributes in the
  audit trail.
  
  MFC r313352 (by trasz):
  Add kern_vm_mmap2(), kern_vm_mprotect(), kern_vm_msync(), kern_vm_munlock(),
  kern_vm_munmap(), and kern_vm_madvise().
  
  MFC r313655:
  Change type of the prot parameter for kern_vm_mmap() from vm_prot_t to int.
  
  MFC r313696:
  Rework r313352.

Modified:
  stable/11/sys/compat/cloudabi/cloudabi_mem.c
  stable/11/sys/compat/freebsd32/freebsd32_misc.c
  stable/11/sys/compat/linux/linux_misc.c
  stable/11/sys/compat/linux/linux_mmap.c
  stable/11/sys/kern/kern_descrip.c
  stable/11/sys/kern/sys_generic.c
  stable/11/sys/kern/vfs_aio.c
  stable/11/sys/sys/syscallsubr.h
  stable/11/sys/vm/vm_extern.h
  stable/11/sys/vm/vm_mmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/cloudabi/cloudabi_mem.c
==
--- stable/11/sys/compat/cloudabi/cloudabi_mem.cMon Feb 27 11:10:36 
2017(r314333)
+++ stable/11/sys/compat/cloudabi/cloudabi_mem.cMon Feb 27 11:27:46 
2017(r314334)
@@ -28,7 +28,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 #include 
 
@@ -62,137 +63,116 @@ int
 cloudabi_sys_mem_advise(struct thread *td,
 struct cloudabi_sys_mem_advise_args *uap)
 {
-   struct madvise_args madvise_args = {
-   .addr   = uap->addr,
-   .len= uap->len
-   };
+   int behav;
 
switch (uap->advice) {
case CLOUDABI_ADVICE_DONTNEED:
-   madvise_args.behav = MADV_DONTNEED;
+   behav = MADV_DONTNEED;
break;
case CLOUDABI_ADVICE_NORMAL:
-   madvise_args.behav = MADV_NORMAL;
+   behav = MADV_NORMAL;
break;
case CLOUDABI_ADVICE_RANDOM:
-   madvise_args.behav = MADV_RANDOM;
+   behav = MADV_RANDOM;
break;
case CLOUDABI_ADVICE_SEQUENTIAL:
-   madvise_args.behav = MADV_SEQUENTIAL;
+   behav = MADV_SEQUENTIAL;
break;
case CLOUDABI_ADVICE_WILLNEED:
-   madvise_args.behav = MADV_WILLNEED;
+   behav = MADV_WILLNEED;
break;
default:
return (EINVAL);
}
 
-   return (sys_madvise(td, _args));
+   return (kern_madvise(td, (uintptr_t)uap->addr, uap->len,
+   behav));
 }
 
 int
 cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args 
*uap)
 {
-   struct mlock_args mlock_args = {
-   .addr   = uap->addr,
-   .len= uap->len
-   };
 
-   return (sys_mlock(td, _args));
+   return (kern_mlock(td->td_proc, td->td_ucred,
+   __DECONST(uintptr_t, uap->addr), uap->len));
 }
 
 int
 cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap)
 {
-   struct mmap_args mmap_args = {
-   .addr   = uap->addr,
-   .len= uap->len,
-   .fd = uap->fd,
-   .pos= uap->off
-   };
-   int error;
+   int error, flags, prot;
 
/* Translate flags. */
+   flags = 0;
if (uap->flags & CLOUDABI_MAP_ANON)
-   mmap_args.flags |= MAP_ANON;
+   flags |= MAP_ANON;
if (uap->flags & CLOUDABI_MAP_FIXED)
-   mmap_args.flags |= MAP_FIXED;
+   flags |= MAP_FIXED;
if (uap->flags & CLOUDABI_MAP_PRIVATE)
-   mmap_args.flags |= MAP_PRIVATE;
+   flags |= MAP_PRIVATE;
if (uap->flags & CLOUDABI_MAP_SHARED)
-   mmap_args.flags |= MAP_SHARED;
+   flags |= MAP_SHARED;
 
/* Translate protection. */
-   error = convert_mprot(uap->prot, _args.prot);
+   error = convert_mprot(uap->prot, );
if (error != 0)
return (error);
 
-   return (sys_mmap(td, _args));
+   return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags,
+   uap->fd, uap->off));
 }
 
 int
 cloudabi_sys_mem_protect(struct thread *td,
 struct cloudabi_sys_mem_protect_args *uap)
 {
-   struct mprotect_args mprotect_args = {
-   .addr   = uap->addr,
-   .len= uap->len,
-   };
-   int error;
+   int error, prot;
 
/* Translate protection. */
-   error = convert_mprot(uap->prot, _args.prot);
+   error = convert_mprot(uap->prot, );
if (error != 0)
return (error);
 
-   return (sys_mprotect(td, _args));
+   return (kern_mprotect(td, 

svn commit: r314333 - head/sys/arm/allwinner/clkng

2017-02-27 Thread Emmanuel Vadot
Author: manu
Date: Mon Feb 27 11:10:36 2017
New Revision: 314333
URL: https://svnweb.freebsd.org/changeset/base/314333

Log:
  allwinner: Order clocks by offset rather than by type for H3 ccu.
  
  Also add a few more supported gates and add comments for which clocks
  are missing.

Modified:
  head/sys/arm/allwinner/clkng/aw_clk.h
  head/sys/arm/allwinner/clkng/ccu_h3.c
  head/sys/arm/allwinner/clkng/ccu_h3.h

Modified: head/sys/arm/allwinner/clkng/aw_clk.h
==
--- head/sys/arm/allwinner/clkng/aw_clk.h   Mon Feb 27 10:40:39 2017
(r314332)
+++ head/sys/arm/allwinner/clkng/aw_clk.h   Mon Feb 27 11:10:36 2017
(r314333)
@@ -179,7 +179,7 @@ aw_clk_factor_get_value(struct aw_clk_fa
.shift = s, \
},
 
-#define NKMP_CLK(_id, _name, _pnames,  \
+#define NKMP_CLK(_clkname, _id, _name, _pnames,\
   _offset, \
   _n_shift, _n_width, _n_value, _n_flags,  \
   _k_shift, _k_width, _k_value, _k_flags,  \
@@ -188,7 +188,7 @@ aw_clk_factor_get_value(struct aw_clk_fa
   _gate,   \
   _lock, _lock_retries,\
   _flags)  \
-   {   \
+   static struct aw_clk_nkmp_def _clkname = {  \
.clkdef = { \
.id = _id,  \
.name = _name,  \
@@ -216,16 +216,16 @@ aw_clk_factor_get_value(struct aw_clk_fa
.lock_shift = _lock,\
.lock_retries = _lock_retries,  \
.flags = _flags,\
-   },
+   }
 
-#define NM_CLK(_id, _name, _pnames,\
+#define NM_CLK(_clkname, _id, _name, _pnames,  \
  _offset,  \
  _nshift, _nwidth, _nvalue, _nflags,   \
  _mshift, _mwidth, _mvalue, _mflags,   \
 _mux_shift, _mux_width,\
 _gate_shift,   \
 _flags)\
-   {   \
+   static struct aw_clk_nm_def _clkname =  {   \
.clkdef = { \
.id = _id,  \
.name = _name,  \
@@ -244,15 +244,15 @@ aw_clk_factor_get_value(struct aw_clk_fa
.m.flags = _mflags, \
.mux_width = _mux_width,\
.flags = _flags,\
-   },
+   }
 
-#define NM_CLK_WITH_FRAC(_id, _name, _pnames,  \
+#define NM_CLK_WITH_FRAC(_clkname, _id, _name, _pnames,\
  _offset,  \
  _nshift, _nwidth, _nvalue, _nflags,   \
  _mshift, _mwidth, _mvalue, _mflags,   \
  _gate_shift, _lock_shift,_lock_retries,   \
 _flags, _freq0, _freq1, _mode_sel, _freq_sel)  \
-   {   \
+   static struct aw_clk_nm_def _clkname =  {   \
.clkdef = { \
.id = _id,  \
.name = _name,  \
@@ -276,15 +276,15 @@ aw_clk_factor_get_value(struct aw_clk_fa
.frac.freq1 = _freq1,   \
.frac.mode_sel = _mode_sel, \
.frac.freq_sel = _freq_sel, \
-   },
+   }
 
-#define PREDIV_CLK(_id, _name, _pnames,\
+#define PREDIV_CLK(_clkname, _id, _name, _pnames,  \
   _offset, \
   _mux_shift, _mux_width,  \
   _div_shift, _div_width, _div_value, _div_flags,  \
   _prediv_shift, _prediv_width, _prediv_value, _prediv_flags,  \
   _prediv_cond_shift, _prediv_cond_width, _prediv_cond_value)  \
-   {   \
+   static struct aw_clk_prediv_mux_def _clkname = {\
.clkdef = { \
.id = _id,  \
.name = _name,  \
@@ -305,11 +305,11 @@ aw_clk_factor_get_value(struct aw_clk_fa
.prediv.cond_shift = _prediv_cond_shift,\
.prediv.cond_width = _prediv_cond_width,\
.prediv.cond_value = _prediv_cond_value,\
-   },
+   }
 
-#define MUX_CLK(_id, _name, _pnames,   \
+#define MUX_CLK(_clkname, _id, _name, _pnames, 

svn commit: r314332 - in stable/10: lib/libcrypt lib/libmd sbin/md5 sys/crypto/sha2

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 10:40:39 2017
New Revision: 314332
URL: https://svnweb.freebsd.org/changeset/base/314332

Log:
  MFC r300903: Implement SHA-512 truncated (224 and 256 bits)

Added:
  stable/10/sys/crypto/sha2/sha512t.h
 - copied unchanged from r300903, head/sys/crypto/sha2/sha512t.h
Modified:
  stable/10/lib/libcrypt/Makefile
  stable/10/lib/libmd/Makefile
  stable/10/lib/libmd/sha512.3
  stable/10/lib/libmd/shadriver.c
  stable/10/sbin/md5/Makefile
  stable/10/sbin/md5/md5.1
  stable/10/sbin/md5/md5.c
  stable/10/sys/crypto/sha2/sha512c.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libcrypt/Makefile
==
--- stable/10/lib/libcrypt/Makefile Mon Feb 27 10:22:16 2017
(r314331)
+++ stable/10/lib/libcrypt/Makefile Mon Feb 27 10:40:39 2017
(r314332)
@@ -29,6 +29,8 @@ CFLAGS+=  -I${.CURDIR} -DHAS_DES -DHAS_BL
 .for sym in MD4Init MD4Final MD4Update MD4Pad \
MD5Init MD5Final MD5Update MD5Pad \
SHA256_Init SHA256_Final SHA256_Update \
+   SHA512_224_Init SHA512_224_Final SHA512_224_Update \
+   SHA512_256_Init SHA512_256_Final SHA512_256_Update \
SHA384_Init SHA384_Final SHA384_Update \
SHA512_Init SHA512_Final SHA512_Update
 CFLAGS+=   -D${sym}=__${sym}

Modified: stable/10/lib/libmd/Makefile
==
--- stable/10/lib/libmd/MakefileMon Feb 27 10:22:16 2017
(r314331)
+++ stable/10/lib/libmd/MakefileMon Feb 27 10:40:39 2017
(r314332)
@@ -8,8 +8,8 @@ SRCS=   md4c.c md5c.c md4hl.c md5hl.c \
sha0c.c sha0hl.c sha1c.c sha1hl.c \
sha256c.c sha256hl.c \
sha384hl.c \
-   sha512c.c sha512hl.c
-INCS=  md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h
+   sha512c.c sha512hl.c sha512thl.c
+INCS=  md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h sha512t.h
 
 WARNS?=0
 
@@ -42,11 +42,15 @@ MLINKS+=sha512.3 SHA512_Init.3  sha512.3
 MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3
 MLINKS+=sha512.3 SHA512_File.3  sha512.3 SHA512_FileChunk.3
 MLINKS+=sha512.3 SHA512_Data.3
+MLINKS+=sha512.3 SHA512_256_Init.3  sha512.3 SHA512_256_Update.3
+MLINKS+=sha512.3 SHA512_256_Final.3 sha512.3 SHA512_256_End.3
+MLINKS+=sha512.3 SHA512_256_File.3  sha512.3 SHA512_256_FileChunk.3
+MLINKS+=sha512.3 SHA512_256_Data.3
 CLEANFILES+=   md[245]hl.c md[245].ref md[245].3 mddriver \
rmd160.ref rmd160hl.c rmddriver \
sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \
sha256.ref sha256hl.c sha384hl.c sha384.ref \
-   sha512.ref sha512hl.c
+   sha512.ref sha512hl.c sha512t256.ref sha512thl.c
 
 # Define WEAK_REFS to provide weak aliases for libmd symbols
 #
@@ -106,6 +110,13 @@ sha512hl.c: mdXhl.c
-e  's/SHA512__/SHA512_/g' \
${.ALLSRC}) > ${.TARGET}
 
+sha512thl.c: mdXhl.c
+   (echo '#define LENGTH 32'; \
+   sed -e 's/mdX/sha512t/g' -e 's/MDX/SHA512_256_/g'   \
+   -e  's/SHA512_256__/SHA512_256_/g' \
+   -e 's/SHA512_256_CTX/SHA512_CTX/g' \
+   ${.ALLSRC}) > ${.TARGET}
+
 rmd160hl.c: mdXhl.c
(echo '#define LENGTH 20'; \
sed -e 's/mdX/ripemd/g' -e 's/MDX/RIPEMD160_/g' \
@@ -210,6 +221,21 @@ sha512.ref:
@echo 'SHA-512 
("12345678901234567890123456789012345678901234567890123456789012345678901234567890")
 =' \

'72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843'
 >> ${.TARGET}
 
+sha512t256.ref:
+   echo 'SHA-512256 test suite:' > ${.TARGET}
+   @echo 'SHA-512256 ("") =' \
+   
'c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a' >> ${.TARGET}
+   @echo 'SHA-512256 ("abc") =' \
+   
'53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23' >> ${.TARGET}
+   @echo 'SHA-512256 ("message digest") =' \
+   
'0cf471fd17ed69d990daf3433c89b16d63dec1bb9cb42a6094604ee5d7b4e9fb' >> ${.TARGET}
+   @echo 'SHA-512256 ("abcdefghijklmnopqrstuvwxyz") =' \
+   
'fc3189443f9c268f626aea08a756abe7b726b05f701cb08222312ccfd6710a26' >> ${.TARGET}
+   @echo 'SHA-512256 
("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \
+   
'cdf1cc0effe26ecc0c13758f7b4a48e000615df241284185c39eb05d355bb9c8' >> ${.TARGET}
+   @echo 'SHA-512256 
("12345678901234567890123456789012345678901234567890123456789012345678901234567890")
 =' \
+   
'2c9fdbc0c90bdd87612ee8455474f9044850241dc105b1e8b94b8ddf5fac9148' >> ${.TARGET}
+
 rmd160.ref:
echo 'RIPEMD160 test suite:' > ${.TARGET}
@echo 'RIPEMD160 ("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31' >> 
${.TARGET}
@@ -224,7 

svn commit: r314331 - stable/10/sys/modules/random

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 10:22:16 2017
New Revision: 314331
URL: https://svnweb.freebsd.org/changeset/base/314331

Log:
  fix up r314327 (MFC of r292782): sha2 -> sha512 in sys/modules/random

Modified:
  stable/10/sys/modules/random/Makefile

Modified: stable/10/sys/modules/random/Makefile
==
--- stable/10/sys/modules/random/Makefile   Mon Feb 27 10:10:45 2017
(r314330)
+++ stable/10/sys/modules/random/Makefile   Mon Feb 27 10:22:16 2017
(r314331)
@@ -12,7 +12,7 @@ SRCS+=ivy.c
 .endif
 SRCS+= randomdev_soft.c yarrow.c hash.c
 SRCS+= random_harvestq.c live_entropy_sources.c rwfile.c
-SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c
+SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha256c.c sha512c.c
 SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h opt_random.h
 
 CFLAGS+= -I${.CURDIR}/../..
___
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: r314330 - stable/10/lib/libmd

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 10:10:45 2017
New Revision: 314330
URL: https://svnweb.freebsd.org/changeset/base/314330

Log:
  MFC r285417: Add new include path for sha256.h

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

Modified: stable/10/lib/libmd/Makefile
==
--- stable/10/lib/libmd/MakefileMon Feb 27 08:58:27 2017
(r314329)
+++ stable/10/lib/libmd/MakefileMon Feb 27 10:10:45 2017
(r314330)
@@ -54,7 +54,8 @@ CLEANFILES+=  md[245]hl.c md[245].ref md[
 # in which case:
 #   * macros are used to rename symbols to libcrypt internal names
 #   * no weak aliases are generated
-CFLAGS+= -I${.CURDIR} -DWEAK_REFS
+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys/crypto/sha2
+CFLAGS+= -DWEAK_REFS
 .PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2
 
 .if exists(${MACHINE_ARCH}/sha.S)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314329 - head/sys/arm/allwinner/clkng

2017-02-27 Thread Emmanuel Vadot
Author: manu
Date: Mon Feb 27 08:58:27 2017
New Revision: 314329
URL: https://svnweb.freebsd.org/changeset/base/314329

Log:
  allwinner: Add support for lock and fractional mode on NM clock
  
  Some PLL have a fractional mode and a lock bit.
  Add support for it on the NM clock and export the clocks in the clkdom.

Modified:
  head/sys/arm/allwinner/clkng/aw_clk.h
  head/sys/arm/allwinner/clkng/aw_clk_nm.c
  head/sys/arm/allwinner/clkng/aw_clk_nm.h
  head/sys/arm/allwinner/clkng/ccu_h3.c

Modified: head/sys/arm/allwinner/clkng/aw_clk.h
==
--- head/sys/arm/allwinner/clkng/aw_clk.h   Mon Feb 27 08:36:51 2017
(r314328)
+++ head/sys/arm/allwinner/clkng/aw_clk.h   Mon Feb 27 08:58:27 2017
(r314329)
@@ -63,6 +63,7 @@ struct aw_clk_init {
 #defineAW_CLK_HAS_MUX  0x0004
 #defineAW_CLK_REPARENT 0x0008
 #defineAW_CLK_SCALE_CHANGE 0x0010
+#defineAW_CLK_HAS_FRAC 0x0020
 
 #defineAW_CLK_FACTOR_POWER_OF_TWO  0x0001
 #defineAW_CLK_FACTOR_ZERO_BASED0x0002
@@ -83,6 +84,13 @@ struct aw_clk_factor {
uint32_tflags;  /* Flags */
 };
 
+struct aw_clk_frac {
+   uint64_tfreq0;
+   uint64_tfreq1;
+   uint32_tmode_sel;
+   uint32_tfreq_sel;
+};
+
 static inline uint32_t
 aw_clk_get_factor(uint32_t val, struct aw_clk_factor *factor)
 {
@@ -238,6 +246,38 @@ aw_clk_factor_get_value(struct aw_clk_fa
.flags = _flags,\
},
 
+#define NM_CLK_WITH_FRAC(_id, _name, _pnames,  \
+ _offset,  \
+ _nshift, _nwidth, _nvalue, _nflags,   \
+ _mshift, _mwidth, _mvalue, _mflags,   \
+ _gate_shift, _lock_shift,_lock_retries,   \
+_flags, _freq0, _freq1, _mode_sel, _freq_sel)  \
+   {   \
+   .clkdef = { \
+   .id = _id,  \
+   .name = _name,  \
+   .parent_names = _pnames,\
+   .parent_cnt = nitems(_pnames),  \
+   },  \
+   .offset = _offset,  \
+   .n.shift = _nshift, \
+   .n.width = _nwidth, \
+   .n.value = _nvalue, \
+   .n.flags = _nflags, \
+   .m.shift = _mshift, \
+   .m.width = _mwidth, \
+   .m.value = _mvalue, \
+   .m.flags = _mflags, \
+   .gate_shift = _gate_shift,  \
+   .lock_shift = _lock_shift,  \
+   .lock_retries = _lock_retries,  \
+   .flags = _flags | AW_CLK_HAS_FRAC,  \
+   .frac.freq0 = _freq0,   \
+   .frac.freq1 = _freq1,   \
+   .frac.mode_sel = _mode_sel, \
+   .frac.freq_sel = _freq_sel, \
+   },
+
 #define PREDIV_CLK(_id, _name, _pnames,\
   _offset, \
   _mux_shift, _mux_width,  \

Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c
==
--- head/sys/arm/allwinner/clkng/aw_clk_nm.cMon Feb 27 08:36:51 2017
(r314328)
+++ head/sys/arm/allwinner/clkng/aw_clk_nm.cMon Feb 27 08:58:27 2017
(r314329)
@@ -52,10 +52,13 @@ struct aw_clk_nm_sc {
 
struct aw_clk_factorm;
struct aw_clk_factorn;
+   struct aw_clk_frac  frac;
 
uint32_tmux_shift;
uint32_tmux_mask;
uint32_tgate_shift;
+   uint32_tlock_shift;
+   uint32_tlock_retries;
 
uint32_tflags;
 };
@@ -178,13 +181,13 @@ aw_clk_nm_set_freq(struct clknode *clk, 
struct aw_clk_nm_sc *sc;
struct clknode *p_clk;
const char **p_names;
-   uint64_t cur, best;
+   uint64_t cur, best, best_frac;
uint32_t val, m, n, best_m, best_n;
-   int p_idx, best_parent;
+   int p_idx, best_parent, retry;
 
sc = clknode_get_softc(clk);
 
-   best = cur = 0;
+   best = best_frac = cur = 0;
best_parent = 0;
 
if ((sc->flags & AW_CLK_REPARENT) != 0) {
@@ -205,8 +208,15 @@ aw_clk_nm_set_freq(struct clknode *clk, 
p_idx = clknode_get_parent_idx(clk);
p_clk = clknode_get_parent(clk);
clknode_get_freq(p_clk, );
-   } else
-   best = aw_clk_nm_find_best(sc, fparent, fout, _n, _m);
+   } else {

svn commit: r314328 - head/sys/dev/acpica

2017-02-27 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 27 08:36:51 2017
New Revision: 314328
URL: https://svnweb.freebsd.org/changeset/base/314328

Log:
  Fix startup race initialising ACPI CM battery structures on MacBookPro.
  
  During acpi_cmbat_attach() the acpi_cmbat_init_battery() notification
  handler is registered. It has been observed this notification handler
  can be called instantly, before the attach routine has returned. In
  the notification handler there is a call to device_is_attached() which
  returns false. Because the softc is set we know an attach is in
  progress and the fix is simply to wait and try again in this case.
  
  Reviewed by:  avg @
  MFC after:1 week

Modified:
  head/sys/dev/acpica/acpi_cmbat.c

Modified: head/sys/dev/acpica/acpi_cmbat.c
==
--- head/sys/dev/acpica/acpi_cmbat.cMon Feb 27 08:27:38 2017
(r314327)
+++ head/sys/dev/acpica/acpi_cmbat.cMon Feb 27 08:36:51 2017
(r314328)
@@ -164,6 +164,16 @@ acpi_cmbat_detach(device_t dev)
 handle = acpi_get_handle(dev);
 AcpiRemoveNotifyHandler(handle, ACPI_ALL_NOTIFY, 
acpi_cmbat_notify_handler);
 acpi_battery_remove(dev);
+
+/*
+ * Force any pending notification handler calls to complete by
+ * requesting cmbat serialisation while freeing and clearing the
+ * softc pointer:
+ */
+ACPI_SERIAL_BEGIN(cmbat);
+device_set_softc(dev, NULL);
+ACPI_SERIAL_END(cmbat);
+
 return (0);
 }
 
@@ -436,7 +446,6 @@ acpi_cmbat_init_battery(void *arg)
 device_t   dev;
 
 dev = (device_t)arg;
-sc = device_get_softc(dev);
 ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization start\n");
 
@@ -446,18 +455,33 @@ acpi_cmbat_init_battery(void *arg)
  * to wait a while.
  */
 for (retry = 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(1)) 
{
-   /* batteries on DOCK can be ejected w/ DOCK during retrying */
-   if (!device_is_attached(dev))
+   /*
+* Batteries on DOCK can be ejected w/ DOCK during retrying.
+*
+* If there is a valid softc pointer the device may be in
+* attaching, attached or detaching state. If the state is
+* different from attached retry getting the device state
+* until it becomes stable. This solves a race if the ACPI
+* notification handler is called during attach, because
+* device_is_attached() doesn't return non-zero until after
+* the attach code has been executed.
+*/
+   ACPI_SERIAL_BEGIN(cmbat);
+   sc = device_get_softc(dev);
+   if (sc == NULL) {
+   ACPI_SERIAL_END(cmbat);
return;
+   }
 
-   if (!acpi_BatteryIsPresent(dev))
+   if (!acpi_BatteryIsPresent(dev) || !device_is_attached(dev)) {
+   ACPI_SERIAL_END(cmbat);
continue;
+   }
 
/*
 * Only query the battery if this is the first try or the specific
 * type of info is still invalid.
 */
-   ACPI_SERIAL_BEGIN(cmbat);
if (retry == 0 || !acpi_battery_bst_valid(>bst)) {
timespecclear(>bst_lastupdated);
acpi_cmbat_get_bst(dev);
___
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: r314327 - in stable/10: lib/libcrypt lib/libmd sbin/gbde sbin/geom/class/eli sbin/md5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/crypto/sha2 sys/dev/random sys/geom/bde...

2017-02-27 Thread Andriy Gapon
Author: avg
Date: Mon Feb 27 08:27:38 2017
New Revision: 314327
URL: https://svnweb.freebsd.org/changeset/base/314327

Log:
  MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
  
  cperciva's libmd implementation is 5-30% faster
  The same was done for SHA256 previously in r263218
  
  Approved by:  secteam

Added:
  stable/10/sys/crypto/sha2/sha384.h
 - copied unchanged from r292782, head/sys/crypto/sha2/sha384.h
  stable/10/sys/crypto/sha2/sha512.h
 - copied unchanged from r292782, head/sys/crypto/sha2/sha512.h
  stable/10/sys/crypto/sha2/sha512c.c
 - copied unchanged from r292782, head/sys/crypto/sha2/sha512c.c
Deleted:
  stable/10/lib/libmd/sha512.h
  stable/10/lib/libmd/sha512c.c
  stable/10/sys/crypto/sha2/sha2.c
  stable/10/sys/crypto/sha2/sha2.h
Modified:
  stable/10/lib/libcrypt/Makefile
  stable/10/lib/libmd/Makefile
  stable/10/lib/libmd/sha512.3
  stable/10/lib/libmd/shadriver.c
  stable/10/sbin/gbde/Makefile
  stable/10/sbin/gbde/gbde.c
  stable/10/sbin/geom/class/eli/Makefile
  stable/10/sbin/md5/Makefile
  stable/10/sbin/md5/md5.1
  stable/10/sbin/md5/md5.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c
  stable/10/sys/conf/files
  stable/10/sys/crypto/sha2/sha256.h
  stable/10/sys/dev/random/hash.c
  stable/10/sys/dev/random/yarrow.c
  stable/10/sys/geom/bde/g_bde.c
  stable/10/sys/geom/bde/g_bde_crypt.c
  stable/10/sys/geom/bde/g_bde_lock.c
  stable/10/sys/geom/bde/g_bde_work.c
  stable/10/sys/geom/eli/g_eli.h
  stable/10/sys/modules/crypto/Makefile
  stable/10/sys/modules/geom/geom_bde/Makefile
  stable/10/sys/modules/zfs/Makefile
  stable/10/sys/netinet/sctp_os_bsd.h
  stable/10/sys/opencrypto/xform.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libcrypt/Makefile
==
--- stable/10/lib/libcrypt/Makefile Mon Feb 27 08:20:28 2017
(r314326)
+++ stable/10/lib/libcrypt/Makefile Mon Feb 27 08:27:38 2017
(r314327)
@@ -29,6 +29,7 @@ CFLAGS+=  -I${.CURDIR} -DHAS_DES -DHAS_BL
 .for sym in MD4Init MD4Final MD4Update MD4Pad \
MD5Init MD5Final MD5Update MD5Pad \
SHA256_Init SHA256_Final SHA256_Update \
+   SHA384_Init SHA384_Final SHA384_Update \
SHA512_Init SHA512_Final SHA512_Update
 CFLAGS+=   -D${sym}=__${sym}
 .endfor

Modified: stable/10/lib/libmd/Makefile
==
--- stable/10/lib/libmd/MakefileMon Feb 27 08:20:28 2017
(r314326)
+++ stable/10/lib/libmd/MakefileMon Feb 27 08:27:38 2017
(r314327)
@@ -7,8 +7,9 @@ SRCS=   md4c.c md5c.c md4hl.c md5hl.c \
rmd160c.c rmd160hl.c \
sha0c.c sha0hl.c sha1c.c sha1hl.c \
sha256c.c sha256hl.c \
+   sha384hl.c \
sha512c.c sha512hl.c
-INCS=  md4.h md5.h ripemd.h sha.h sha256.h sha512.h
+INCS=  md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h
 
 WARNS?=0
 
@@ -33,6 +34,10 @@ MLINKS+=sha256.3 SHA256_Init.3  sha256.3
 MLINKS+=sha256.3 SHA256_Final.3 sha256.3 SHA256_End.3
 MLINKS+=sha256.3 SHA256_File.3  sha256.3 SHA256_FileChunk.3
 MLINKS+=sha256.3 SHA256_Data.3
+MLINKS+=sha512.3 SHA384_Init.3  sha512.3 SHA384_Update.3
+MLINKS+=sha512.3 SHA384_Final.3 sha512.3 SHA384_End.3
+MLINKS+=sha512.3 SHA384_File.3  sha512.3 SHA384_FileChunk.3
+MLINKS+=sha512.3 SHA384_Data.3  sha512.3 sha384.3
 MLINKS+=sha512.3 SHA512_Init.3  sha512.3 SHA512_Update.3
 MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3
 MLINKS+=sha512.3 SHA512_File.3  sha512.3 SHA512_FileChunk.3
@@ -40,7 +45,8 @@ MLINKS+=sha512.3 SHA512_Data.3
 CLEANFILES+=   md[245]hl.c md[245].ref md[245].3 mddriver \
rmd160.ref rmd160hl.c rmddriver \
sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \
-   sha256.ref sha256hl.c sha512.ref sha512hl.c
+   sha256.ref sha256hl.c sha384hl.c sha384.ref \
+   sha512.ref sha512hl.c
 
 # Define WEAK_REFS to provide weak aliases for libmd symbols
 #
@@ -87,6 +93,12 @@ sha256hl.c: mdXhl.c
-e  's/SHA256__/SHA256_/g' \
${.ALLSRC}) > ${.TARGET}
 
+sha384hl.c: mdXhl.c
+   (echo '#define LENGTH 48'; \
+   sed -e 's/mdX/sha384/g' -e 's/MDX/SHA384_/g'\
+   -e  's/SHA384__/SHA384_/g' \
+   ${.ALLSRC}) > ${.TARGET}
+
 sha512hl.c: mdXhl.c
(echo '#define LENGTH 64'; \
sed -e 's/mdX/sha512/g' -e 's/MDX/SHA512_/g'\
@@ -167,6 +179,21 @@ sha256.ref:
@echo 'SHA-256 
("12345678901234567890123456789012345678901234567890123456789012345678901234567890")
 =' \

'f371bc4a311f2b009eef952dd83ca80e2b60026c8e935592d0f9c308453c813e' >> ${.TARGET}
 
+sha384.ref:
+   echo 'SHA-384 test suite:' > ${.TARGET}
+   @echo 'SHA-384 ("") =' \
+   

svn commit: r314326 - head/sys/dev/isp

2017-02-27 Thread Alexander Motin
Author: mav
Date: Mon Feb 27 08:20:28 2017
New Revision: 314326
URL: https://svnweb.freebsd.org/changeset/base/314326

Log:
  Send TERMINATE to firmware when aborting active ATIO.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Mon Feb 27 04:08:08 2017(r314325)
+++ head/sys/dev/isp/isp.c  Mon Feb 27 08:20:28 2017(r314326)
@@ -7133,7 +7133,7 @@ static const uint32_t mbpfc[] = {
ISP_FC_OPMAP(0x00, 0x00),   /* 0x3f: */
ISP_FC_OPMAP(0x03, 0x01),   /* 0x40: MBOX_LOOP_PORT_BYPASS */
ISP_FC_OPMAP(0x03, 0x01),   /* 0x41: MBOX_LOOP_PORT_ENABLE */
-   ISP_FC_OPMAP_HALF(0x0, 0x01, 0x3, 0xcf),/* 0x42: 
MBOX_GET_RESOURCE_COUNT */
+   ISP_FC_OPMAP_HALF(0x0, 0x01, 0x1f, 0xcf),   /* 0x42: 
MBOX_GET_RESOURCE_COUNT */
ISP_FC_OPMAP(0x01, 0x01),   /* 0x43: MBOX_REQUEST_OFFLINE_MODE */
ISP_FC_OPMAP(0x00, 0x00),   /* 0x44: */
ISP_FC_OPMAP(0x00, 0x00),   /* 0x45: */

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Mon Feb 27 04:08:08 2017
(r314325)
+++ head/sys/dev/isp/isp_freebsd.c  Mon Feb 27 08:20:28 2017
(r314326)
@@ -1011,7 +1011,7 @@ isp_dump_atpd(ispsoftc_t *isp, int chan)
if (atp->state == ATPD_STATE_FREE)
continue;
isp_prt(isp, ISP_LOGALL, "Chan %d ATP [0x%x] origdlen %u 
bytes_xfrd %u lun %jx nphdl 0x%04x s_id 0x%06x d_id 0x%06x oxid 0x%04x state 
%s",
-   chan, atp->tag, atp->orig_datalen, atp->bytes_xfered, 
(uintmax_t)atp->lun, atp->nphdl, atp->sid, atp->portid, atp->oxid, 
states[atp->state & 0x7]);
+   chan, atp->tag, atp->orig_datalen, atp->bytes_xfered, 
(uintmax_t)atp->lun, atp->nphdl, atp->sid, atp->did, atp->oxid, 
states[atp->state & 0x7]);
}
 }
 
@@ -1344,8 +1344,8 @@ isp_target_start_ctio(ispsoftc_t *isp, u
ATPD_SET_SEQNO(cto, atp);
cto->ct_nphdl = atp->nphdl;
cto->ct_rxid = atp->tag;
-   cto->ct_iid_lo = atp->portid;
-   cto->ct_iid_hi = atp->portid >> 16;
+   cto->ct_iid_lo = atp->sid;
+   cto->ct_iid_hi = atp->sid >> 16;
cto->ct_oxid = atp->oxid;
cto->ct_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(ccb));
cto->ct_timeout = (XS_TIME(ccb) + 999) / 1000;
@@ -2088,7 +2088,8 @@ isp_handle_platform_atio7(ispsoftc_t *is
atp->bytes_xfered = 0;
atp->lun = lun;
atp->nphdl = nphdl;
-   atp->portid = sid;
+   atp->sid = sid;
+   atp->did = did;
atp->oxid = aep->at_hdr.ox_id;
atp->rxid = aep->at_hdr.rx_id;
atp->cdb0 = atiop->cdb_io.cdb_bytes[0];
@@ -3269,7 +3270,23 @@ isp_abort_atio(ispsoftc_t *isp, union cc
/* Search for the ATIO among running. */
atp = isp_find_atpd(isp, XS_CHANNEL(accb), accb->atio.tag_id);
if (atp != NULL) {
-   /* XXX Send TERMINATE to firmware here. */
+   /* Send TERMINATE to firmware. */
+   if (!atp->dead && IS_24XX(isp)) {
+   uint8_t storage[QENTRY_LEN];
+   ct7_entry_t *cto = (ct7_entry_t *) storage;
+
+   ISP_MEMZERO(cto, sizeof (ct7_entry_t));
+   cto->ct_header.rqs_entry_type = RQSTYPE_CTIO7;
+   cto->ct_header.rqs_entry_count = 1;
+   cto->ct_nphdl = atp->nphdl;
+   cto->ct_rxid = atp->tag;
+   cto->ct_iid_lo = atp->sid;
+   cto->ct_iid_hi = atp->sid >> 16;
+   cto->ct_oxid = atp->oxid;
+   cto->ct_vpidx = XS_CHANNEL(accb);
+   cto->ct_flags = CT7_NOACK|CT7_TERMINATE;
+   isp_target_put_entry(isp, cto);
+   }
isp_put_atpd(isp, XS_CHANNEL(accb), atp);
ccb->ccb_h.status = CAM_REQ_CMP;
} else {

Modified: head/sys/dev/isp/isp_freebsd.h
==
--- head/sys/dev/isp/isp_freebsd.h  Mon Feb 27 04:08:08 2017
(r314325)
+++ head/sys/dev/isp/isp_freebsd.h  Mon Feb 27 08:20:28 2017
(r314326)
@@ -103,7 +103,7 @@ typedef struct atio_private_data {
lun_id_tlun;
uint32_tnphdl;
uint32_tsid;
-   uint32_tportid;
+   uint32_tdid;
uint16_trxid;   /* wire rxid */
uint16_toxid;   /* wire oxid */
uint16_t