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

2016-08-17 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Aug 18 05:52:03 2016
New Revision: 304330
URL: https://svnweb.freebsd.org/changeset/base/304330

Log:
  hyperv/hn: Get rid of the useless netvsc_packet
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7544

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

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:44:58 2016
(r304329)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:52:03 2016
(r304330)
@@ -66,7 +66,7 @@ static int  hv_nv_connect_to_vsp(struct 
 static void hv_nv_on_send_completion(netvsc_dev *net_dev,
 struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt);
 static void hv_nv_on_receive_completion(struct vmbus_channel *chan,
-uint64_t tid, uint32_t status);
+uint64_t tid);
 static void hv_nv_on_receive(netvsc_dev *net_dev,
 struct hn_rx_ring *rxr, struct vmbus_channel *chan,
 const struct vmbus_chanpkt_hdr *pkt);
@@ -844,11 +844,8 @@ hv_nv_on_receive(netvsc_dev *net_dev, st
 {
const struct vmbus_chanpkt_rxbuf *pkt;
const struct hn_nvs_hdr *nvs_hdr;
-   netvsc_packet vsc_pkt;
-   netvsc_packet *net_vsc_pkt = _pkt;
int count = 0;
int i = 0;
-   int status = HN_NVS_STATUS_OK;
 
/* Make sure that this is a RNDIS message. */
nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr);
@@ -870,16 +867,9 @@ hv_nv_on_receive(netvsc_dev *net_dev, st
 
/* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */
for (i = 0; i < count; i++) {
-   net_vsc_pkt->status = HN_NVS_STATUS_OK;
-   net_vsc_pkt->data = ((uint8_t *)net_dev->rx_buf +
-   pkt->cp_rxbuf[i].rb_ofs);
-   net_vsc_pkt->tot_data_buf_len = pkt->cp_rxbuf[i].rb_len;
-
-   hv_rf_on_receive(net_dev, rxr, net_vsc_pkt);
-
-   /* XXX pretty broken; whack it */
-   if (net_vsc_pkt->status != HN_NVS_STATUS_OK)
-   status = HN_NVS_STATUS_FAILED;
+   hv_rf_on_receive(net_dev, rxr,
+   (const uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs,
+   pkt->cp_rxbuf[i].rb_len);
}

/*
@@ -887,7 +877,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st
 * messages (not just data messages) will trigger a response
 * message back to the host.
 */
-   hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid, status);
+   hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid);
 }
 
 /*
@@ -896,15 +886,14 @@ hv_nv_on_receive(netvsc_dev *net_dev, st
  * Send a receive completion packet to RNDIS device (ie NetVsp)
  */
 static void
-hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid,
-uint32_t status)
+hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid)
 {
struct hn_nvs_rndis_ack ack;
int retries = 0;
int ret = 0;

ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK;
-   ack.nvs_status = status;
+   ack.nvs_status = HN_NVS_STATUS_OK;
 
 retry_send_cmplt:
/* Send the completion */

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:44:58 2016
(r304329)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:52:03 2016
(r304330)
@@ -274,12 +274,6 @@ typedef void (*pfn_on_send_rx_completion
 #define BITS_PER_LONG 32
 #endif
 
-typedef struct netvsc_packet_ {
-   uint32_tstatus;
-   uint32_ttot_data_buf_len;
-   void*data;
-} netvsc_packet;
-
 typedef struct {
uint8_t mac_addr[6];  /* Assumption unsigned long */
uint8_t link_state;

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Aug 18 05:44:58 
2016(r304329)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Aug 18 05:52:03 
2016(r304330)
@@ -1277,7 +1277,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb
  * Note:  This is no longer used as a callback
  */
 int
-netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet,
+netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen,
 const struct hn_recvinfo *info)
 {
struct ifnet *ifp = rxr->hn_ifp;
@@ -1291,17 +1291,16 @@ netvsc_recv(struct hn_rx_ring *rxr, netv
/*
 * Bail out if packet 

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

2016-08-17 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Aug 18 05:44:58 2016
New Revision: 304329
URL: https://svnweb.freebsd.org/changeset/base/304329

Log:
  hyperv/hn: Constify RNDIS messages on RX path.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7542

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

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cThu Aug 18 05:35:43 
2016(r304328)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cThu Aug 18 05:44:58 
2016(r304329)
@@ -67,10 +67,11 @@ __FBSDID("$FreeBSD$");
  */
 static int  hv_rf_send_request(rndis_device *device, rndis_request *request,
   uint32_t message_type);
-static void hv_rf_receive_response(rndis_device *device, rndis_msg *response);
+static void hv_rf_receive_response(rndis_device *device,
+const rndis_msg *response);
 static void hv_rf_receive_indicate_status(rndis_device *device,
- rndis_msg *response);
-static void hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message,
+const rndis_msg *response);
+static void hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg 
*message,
   netvsc_packet *pkt);
 static int  hv_rf_query_device(rndis_device *device, uint32_t oid,
   void *result, uint32_t *result_size);
@@ -295,7 +296,7 @@ sendit:
  * RNDIS filter receive response
  */
 static void 
-hv_rf_receive_response(rndis_device *device, rndis_msg *response)
+hv_rf_receive_response(rndis_device *device, const rndis_msg *response)
 {
rndis_request *request = NULL;
rndis_request *next_request;
@@ -417,9 +418,9 @@ cleanup:
  * RNDIS filter receive indicate status
  */
 static void 
-hv_rf_receive_indicate_status(rndis_device *device, rndis_msg *response)
+hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response)
 {
-   rndis_indicate_status *indicate = >msg.indicate_status;
+   const rndis_indicate_status *indicate = >msg.indicate_status;

switch(indicate->status) {
case RNDIS_STATUS_MEDIA_CONNECT:
@@ -518,10 +519,10 @@ skip:
  * RNDIS filter receive data
  */
 static void
-hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message,
+hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message,
 netvsc_packet *pkt)
 {
-   rndis_packet *rndis_pkt;
+   const rndis_packet *rndis_pkt;
uint32_t data_offset;
struct hn_recvinfo info;
 
@@ -563,7 +564,7 @@ hv_rf_on_receive(netvsc_dev *net_dev,
 struct hn_rx_ring *rxr, netvsc_packet *pkt)
 {
rndis_device *rndis_dev;
-   rndis_msg *rndis_hdr;
+   const rndis_msg *rndis_hdr;
 
/* Make sure the rndis device state is initialized */
if (net_dev->extension == NULL) {
___
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: r304327 - head/sys/dev/hyperv/netvsc

2016-08-17 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Aug 18 05:33:58 2016
New Revision: 304327
URL: https://svnweb.freebsd.org/changeset/base/304327

Log:
  hyperv/hn: Pass RX packet info to netvsc_recv.
  
  This paves to nuke netvsc_packet, which does not serves much
  purpose now.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7541

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

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:07:02 2016
(r304326)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:33:58 2016
(r304327)
@@ -275,7 +275,6 @@ typedef void (*pfn_on_send_rx_completion
 #endif
 
 typedef struct netvsc_packet_ {
-   uint16_tvlan_tci;
uint32_tstatus;
uint32_ttot_data_buf_len;
void*data;

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Aug 18 05:07:02 
2016(r304326)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Thu Aug 18 05:33:58 
2016(r304327)
@@ -1278,9 +1278,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb
  */
 int
 netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet,
-const rndis_tcp_ip_csum_info *csum_info,
-const struct rndis_hash_info *hash_info,
-const struct rndis_hash_value *hash_value)
+const struct hn_recvinfo *info)
 {
struct ifnet *ifp = rxr->hn_ifp;
struct mbuf *m_new;
@@ -1332,28 +1330,28 @@ netvsc_recv(struct hn_rx_ring *rxr, netv
do_csum = 0;
 
/* receive side checksum offload */
-   if (csum_info != NULL) {
+   if (info->csum_info != NULL) {
/* IP csum offload */
-   if (csum_info->receive.ip_csum_succeeded && do_csum) {
+   if (info->csum_info->receive.ip_csum_succeeded && do_csum) {
m_new->m_pkthdr.csum_flags |=
(CSUM_IP_CHECKED | CSUM_IP_VALID);
rxr->hn_csum_ip++;
}
 
/* TCP/UDP csum offload */
-   if ((csum_info->receive.tcp_csum_succeeded ||
-csum_info->receive.udp_csum_succeeded) && do_csum) {
+   if ((info->csum_info->receive.tcp_csum_succeeded ||
+info->csum_info->receive.udp_csum_succeeded) && do_csum) {
m_new->m_pkthdr.csum_flags |=
(CSUM_DATA_VALID | CSUM_PSEUDO_HDR);
m_new->m_pkthdr.csum_data = 0x;
-   if (csum_info->receive.tcp_csum_succeeded)
+   if (info->csum_info->receive.tcp_csum_succeeded)
rxr->hn_csum_tcp++;
else
rxr->hn_csum_udp++;
}
 
-   if (csum_info->receive.ip_csum_succeeded &&
-   csum_info->receive.tcp_csum_succeeded)
+   if (info->csum_info->receive.ip_csum_succeeded &&
+   info->csum_info->receive.tcp_csum_succeeded)
do_lro = 1;
} else {
const struct ether_header *eh;
@@ -1409,19 +1407,18 @@ netvsc_recv(struct hn_rx_ring *rxr, netv
}
}
 skip:
-   if ((packet->vlan_tci != 0) &&
-   (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) {
-   m_new->m_pkthdr.ether_vtag = packet->vlan_tci;
+   if (info->vlan_info != NULL) {
+   m_new->m_pkthdr.ether_vtag = info->vlan_info->u1.s1.vlan_id;
m_new->m_flags |= M_VLANTAG;
}
 
-   if (hash_info != NULL && hash_value != NULL) {
+   if (info->hash_info != NULL && info->hash_value != NULL) {
rxr->hn_rss_pkts++;
-   m_new->m_pkthdr.flowid = hash_value->hash_value;
-   if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) ==
+   m_new->m_pkthdr.flowid = info->hash_value->hash_value;
+   if ((info->hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) ==
NDIS_HASH_FUNCTION_TOEPLITZ) {
uint32_t type =
-   (hash_info->hash_info & NDIS_HASH_TYPE_MASK);
+   (info->hash_info->hash_info & NDIS_HASH_TYPE_MASK);
 
switch (type) {
case NDIS_HASH_IPV4:
@@ -1450,8 +1447,8 @@ skip:
}
}
} else {
-   if (hash_value != NULL) {
-   

svn commit: r304326 - head/sys/dev/usb/net

2016-08-17 Thread Pyun YongHyeon
Author: yongari
Date: Thu Aug 18 05:07:02 2016
New Revision: 304326
URL: https://svnweb.freebsd.org/changeset/base/304326

Log:
  Switch to TX header format rather than directly manipulating header
  structures.  This simplifies mbuf copy operation to USB buffers as
  well as improving readability.  The controller supports Microsoft
  LSOv1(aka TSO) but this change set does not include the support due
  to copying overhead to USB buffers and large amount of memory waste.
  
  Remove useless ZLP padding which seems to come from Linux.  Required
  bits the code tried to set was not copied into USB buffer so it had
  no effect.  Unlike Linux, FreeBSD USB stack automatically generates
  ZLP so no explicit padding is required in driver.[1]
  
  Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out
  of TX loop since updating counter is not cheap operation as it did
  long time ago and we already know how many number of packets were
  queued after exiting the loop.
  
  While here, fix a checksum offloading bug which will happen when
  upper stack computes checksum while H/W checksum offloading is
  active.  The controller should be notified to not recompute the
  checksum in this case.
  
  Reviewed by:  kevlo (initial version), hselasky
  Pointed out by:   hselasky [1]

Modified:
  head/sys/dev/usb/net/if_axge.c
  head/sys/dev/usb/net/if_axgereg.h

Modified: head/sys/dev/usb/net/if_axge.c
==
--- head/sys/dev/usb/net/if_axge.c  Thu Aug 18 04:25:17 2016
(r304325)
+++ head/sys/dev/usb/net/if_axge.c  Thu Aug 18 05:07:02 2016
(r304326)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -144,8 +145,8 @@ static const struct usb_config axge_conf
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
-   .frames = 16,
-   .bufsize = 16 * MCLBYTES,
+   .frames = AXGE_N_FRAMES,
+   .bufsize = AXGE_N_FRAMES * MCLBYTES,
.flags = {.pipe_bof = 1,.force_short_xfer = 1,},
.callback = axge_bulk_write_callback,
.timeout = 1,   /* 10 seconds */
@@ -630,7 +631,7 @@ axge_bulk_write_callback(struct usb_xfer
struct ifnet *ifp;
struct usb_page_cache *pc;
struct mbuf *m;
-   uint32_t txhdr;
+   struct axge_frame_txhdr txhdr;
int nframes, pos;
 
sc = usbd_xfer_softc(xfer);
@@ -651,36 +652,25 @@ tr_setup:
return;
}
 
-   for (nframes = 0; nframes < 16 &&
+   for (nframes = 0; nframes < AXGE_N_FRAMES &&
!IFQ_DRV_IS_EMPTY(>if_snd); nframes++) {
IFQ_DRV_DEQUEUE(>if_snd, m);
if (m == NULL)
break;
usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES,
-   nframes);
-   pos = 0;
+   nframes);
pc = usbd_xfer_get_frame(xfer, nframes);
-   txhdr = htole32(m->m_pkthdr.len);
-   usbd_copy_in(pc, 0, , sizeof(txhdr));
-   txhdr = 0;
-   txhdr = htole32(txhdr);
-   usbd_copy_in(pc, 4, , sizeof(txhdr));
-   pos += 8;
+   txhdr.mss = 0;
+   txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len));
+   if ((ifp->if_capenable & IFCAP_TXCSUM) != 0 &&
+   (m->m_pkthdr.csum_flags & AXGE_CSUM_FEATURES) == 0)
+   txhdr.len |= htole32(AXGE_CSUM_DISABLE);
+
+   pos = 0;
+   usbd_copy_in(pc, pos, , sizeof(txhdr));
+   pos += sizeof(txhdr);
usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len);
pos += m->m_pkthdr.len;
-   if ((pos % usbd_xfer_max_framelen(xfer)) == 0)
-   txhdr |= 0x80008000;
-
-   /*
-* XXX
-* Update TX packet counter here. This is not
-* correct way but it seems that there is no way
-* to know how many packets are sent at the end
-* of transfer because controller combines
-* multiple writes into single one if there is
-* room in TX buffer of controller.
-*/
-   if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
 
/*
 * if there's a BPF listener, bounce a copy
@@ -694,6 +684,16 @@ tr_setup:

svn commit: r304325 - head/sys/dev/usb/net

2016-08-17 Thread Pyun YongHyeon
Author: yongari
Date: Thu Aug 18 04:25:17 2016
New Revision: 304325
URL: https://svnweb.freebsd.org/changeset/base/304325

Log:
  Rename cryptic RX filter constants with more readable ones.
  No functional change.

Modified:
  head/sys/dev/usb/net/if_axge.c
  head/sys/dev/usb/net/if_axgereg.h

Modified: head/sys/dev/usb/net/if_axge.c
==
--- head/sys/dev/usb/net/if_axge.c  Thu Aug 18 02:14:39 2016
(r304324)
+++ head/sys/dev/usb/net/if_axge.c  Thu Aug 18 04:25:17 2016
(r304325)
@@ -743,11 +743,11 @@ axge_setmulti(struct usb_ether *ue)
 
rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR);
if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
-   rxmode |= RCR_AMALL;
+   rxmode |= RCR_ACPT_ALL_MCAST;
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
return;
}
-   rxmode &= ~RCR_AMALL;
+   rxmode &= ~RCR_ACPT_ALL_MCAST;
 
if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, >if_multiaddrs, ifma_link) {
@@ -775,9 +775,9 @@ axge_setpromisc(struct usb_ether *ue)
rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR);
 
if (ifp->if_flags & IFF_PROMISC)
-   rxmode |= RCR_PRO;
+   rxmode |= RCR_PROMISC;
else
-   rxmode &= ~RCR_PRO;
+   rxmode &= ~RCR_PROMISC;
 
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
axge_setmulti(ue);
@@ -828,16 +828,16 @@ axge_init(struct usb_ether *ue)
axge_csum_cfg(ue);
 
/* Configure RX settings. */
-   rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE);
+   rxmode = (RCR_ACPT_MCAST | RCR_START | RCR_DROP_CRCERR);
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
rxmode |= RCR_IPE;
 
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
-   rxmode |= RCR_PRO;
+   rxmode |= RCR_PROMISC;
 
if (ifp->if_flags & IFF_BROADCAST)
-   rxmode |= RCR_AB;
+   rxmode |= RCR_ACPT_BCAST;
 
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
 

Modified: head/sys/dev/usb/net/if_axgereg.h
==
--- head/sys/dev/usb/net/if_axgereg.h   Thu Aug 18 02:14:39 2016
(r304324)
+++ head/sys/dev/usb/net/if_axgereg.h   Thu Aug 18 04:25:17 2016
(r304325)
@@ -57,13 +57,14 @@
 /* Rx control register */
 #defineAXGE_RCR0x0b
 #defineRCR_STOP0x
-#defineRCR_PRO 0x0001
-#defineRCR_AMALL   0x0002
-#defineRCR_AB  0x0008
-#defineRCR_AM  0x0010
-#defineRCR_AP  0x0020
-#defineRCR_SO  0x0080
-#defineRCR_DROP_CRCE   0x0100
+#defineRCR_PROMISC 0x0001
+#defineRCR_ACPT_ALL_MCAST  0x0002
+#defineRCR_AUTOPAD_BNDRY   0x0004
+#defineRCR_ACPT_BCAST  0x0008
+#defineRCR_ACPT_MCAST  0x0010
+#defineRCR_ACPT_PHY_MCAST  0x0020
+#defineRCR_START   0x0080
+#defineRCR_DROP_CRCERR 0x0100
 #defineRCR_IPE 0x0200
 #defineRCR_TX_CRC_PAD  0x0400
 
___
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: r304324 - head/sys/dev/usb/net

2016-08-17 Thread Pyun YongHyeon
Author: yongari
Date: Thu Aug 18 02:14:39 2016
New Revision: 304324
URL: https://svnweb.freebsd.org/changeset/base/304324

Log:
  Don't explicitly call MIIBUS_STATCHG() method handler.  Link state
  change should be handled by PHY driver.  Some broken PHY H/Ws may
  need that workaround but it seems axge(4) don't use such PHYs.

Modified:
  head/sys/dev/usb/net/if_axge.c

Modified: head/sys/dev/usb/net/if_axge.c
==
--- head/sys/dev/usb/net/if_axge.c  Thu Aug 18 01:48:58 2016
(r304323)
+++ head/sys/dev/usb/net/if_axge.c  Thu Aug 18 02:14:39 2016
(r304324)
@@ -724,11 +724,6 @@ axge_tick(struct usb_ether *ue)
AXGE_LOCK_ASSERT(sc, MA_OWNED);
 
mii_tick(mii);
-   if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) {
-   axge_miibus_statchg(ue->ue_dev);
-   if ((sc->sc_flags & AXGE_FLAG_LINK) != 0)
-   axge_start(ue);
-   }
 }
 
 static void
___
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: r304323 - head/sys/dev/usb/net

2016-08-17 Thread Pyun YongHyeon
Author: yongari
Date: Thu Aug 18 01:48:58 2016
New Revision: 304323
URL: https://svnweb.freebsd.org/changeset/base/304323

Log:
  Pass PHY location information and remove PHY access hack.

Modified:
  head/sys/dev/usb/net/if_axge.c
  head/sys/dev/usb/net/if_axgereg.h

Modified: head/sys/dev/usb/net/if_axge.c
==
--- head/sys/dev/usb/net/if_axge.c  Thu Aug 18 01:25:12 2016
(r304322)
+++ head/sys/dev/usb/net/if_axge.c  Thu Aug 18 01:48:58 2016
(r304323)
@@ -303,8 +303,6 @@ axge_miibus_writereg(device_t dev, int p
int locked;
 
sc = device_get_softc(dev);
-   if (sc->sc_phyno != phy)
-   return (0);
locked = mtx_owned(>sc_mtx);
if (!locked)
AXGE_LOCK(sc);
@@ -434,7 +432,6 @@ axge_attach_post(struct usb_ether *ue)
struct axge_softc *sc;
 
sc = uether_getsc(ue);
-   sc->sc_phyno = 3;
 
/* Initialize controller and get station address. */
axge_chip_init(sc);
@@ -466,7 +463,7 @@ axge_attach_post_sub(struct usb_ether *u
mtx_lock();
error = mii_attach(ue->ue_dev, >ue_miibus, ifp,
uether_ifmedia_upd, ue->ue_methods->ue_mii_sts,
-   BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE);
+   BMSR_DEFCAPMASK, AXGE_PHY_ADDR, MII_OFFSET_ANY, MIIF_DOPAUSE);
mtx_unlock();
 
return (error);

Modified: head/sys/dev/usb/net/if_axgereg.h
==
--- head/sys/dev/usb/net/if_axgereg.h   Thu Aug 18 01:25:12 2016
(r304322)
+++ head/sys/dev/usb/net/if_axgereg.h   Thu Aug 18 01:48:58 2016
(r304323)
@@ -158,11 +158,12 @@ enum {
AXGE_N_TRANSFER,
 };
 
+#defineAXGE_PHY_ADDR   3
+
 struct axge_softc {
struct usb_ethersc_ue;
struct mtx  sc_mtx;
struct usb_xfer *sc_xfer[AXGE_N_TRANSFER];
-   int sc_phyno;
 
int sc_flags;
 #defineAXGE_FLAG_LINK  0x0001  /* got a link */
___
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: r304322 - head/sys/net80211

2016-08-17 Thread Adrian Chadd
Author: adrian
Date: Thu Aug 18 01:25:12 2016
New Revision: 304322
URL: https://svnweb.freebsd.org/changeset/base/304322

Log:
  [net80211] correctly lock the ifp before accessing the lladdr.
  
  Tested by: dhw

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==
--- head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 00:37:07 2016
(r304321)
+++ head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 01:25:12 2016
(r304322)
@@ -3394,10 +3394,12 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
 * Check if the MAC address was changed
 * via SIOCSIFLLADDR ioctl.
 */
+   if_addr_rlock(ifp);
if ((ifp->if_flags & IFF_UP) == 0 &&
!IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp)))
IEEE80211_ADDR_COPY(vap->iv_myaddr,
IF_LLADDR(ifp));
+   if_addr_runlock(ifp);
}
break;
case SIOCADDMULTI:
___
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: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf...

2016-08-17 Thread Toomas Soome
Author: tsoome
Date: Thu Aug 18 00:37:07 2016
New Revision: 304321
URL: https://svnweb.freebsd.org/changeset/base/304321

Log:
  Add SHA512, skein, large blocks support for loader zfs.
  
  Updated sha512 from illumos.
  Using skein from freebsd crypto tree.
  Since loader itself is using 64MB memory for heap, updated zfsboot to
  use same, and this also allows to support zfs large blocks.
  
  Note, adding additional features does increate zfsboot code, therefore
  this update does increase zfsboot code to 128k, also I have ported gptldr.S
  update to zfsldr.S to support 64k+ code.
  
  With this update, boot1.efi has almost reached the current limit of the size
  set for it, so one of the future patches for boot1.efi will need to
  increase the limit.
  
  Currently known missing zfs features in boot loader are edonr and gzip 
support.
  
  Reviewed by:  delphij, imp
  Approved by:  imp (mentor)
  Obtained from:sha256.c update and skein_zfs.c stub from illumos.
  Differential Revision:https://reviews.freebsd.org/D7418

Added:
  head/sys/cddl/boot/zfs/skein_zfs.c   (contents, props changed)
Modified:
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/loader/Makefile
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/i386/gptboot/Makefile
  head/sys/boot/i386/gptboot/gptldr.S
  head/sys/boot/i386/gptzfsboot/Makefile
  head/sys/boot/i386/zfsboot/Makefile
  head/sys/boot/i386/zfsboot/zfsboot.c
  head/sys/boot/i386/zfsboot/zfsldr.S
  head/sys/boot/userboot/ficl/Makefile
  head/sys/boot/userboot/userboot/Makefile
  head/sys/boot/userboot/zfs/Makefile
  head/sys/boot/zfs/Makefile
  head/sys/boot/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/fletcher.c
  head/sys/cddl/boot/zfs/sha256.c
  head/sys/cddl/boot/zfs/zfsimpl.h
  head/sys/cddl/boot/zfs/zfssubr.c

Modified: head/sys/boot/efi/boot1/Makefile
==
--- head/sys/boot/efi/boot1/MakefileWed Aug 17 22:13:39 2016
(r304320)
+++ head/sys/boot/efi/boot1/MakefileThu Aug 18 00:37:07 2016
(r304321)
@@ -19,12 +19,16 @@ CWARNFLAGS.zfs_module.c += -Wno-missing-
 CWARNFLAGS.zfs_module.c += -Wno-sign-compare
 CWARNFLAGS.zfs_module.c += -Wno-unused-parameter
 CWARNFLAGS.zfs_module.c += -Wno-unused-function
+CWARNFLAGS.skein.c += -Wno-cast-align
+CWARNFLAGS.skein.c += -Wno-missing-variable-declarations
 .endif
 
 # architecture-specific loader code
 SRCS=  boot1.c self_reloc.c start.S ufs_module.c
 .if ${MK_ZFS} != "no"
 SRCS+= zfs_module.c
+SRCS+= skein.c skein_block.c
+.PATH: ${.CURDIR}/../../../crypto/skein
 .endif
 
 CFLAGS+=   -I.
@@ -40,6 +44,7 @@ CFLAGS+=  -DEFI_DEBUG
 .if ${MK_ZFS} != "no"
 CFLAGS+=   -I${.CURDIR}/../../zfs/
 CFLAGS+=   -I${.CURDIR}/../../../cddl/boot/zfs/
+CFLAGS+=   -I${.CURDIR}/../../../crypto/skein
 CFLAGS+=   -DEFI_ZFS_BOOT
 .endif
 

Modified: head/sys/boot/efi/loader/Makefile
==
--- head/sys/boot/efi/loader/Makefile   Wed Aug 17 22:13:39 2016
(r304320)
+++ head/sys/boot/efi/loader/Makefile   Thu Aug 18 00:37:07 2016
(r304321)
@@ -24,6 +24,8 @@ SRCS= autoload.c \
 .if ${MK_ZFS} != "no"
 SRCS+= zfs.c
 .PATH: ${.CURDIR}/../../zfs
+SRCS+= skein.c skein_block.c
+.PATH: ${.CURDIR}/../../../crypto/skein
 
 # Disable warnings that are currently incompatible with the zfs boot code
 CWARNFLAGS.zfs.c+= -Wno-sign-compare
@@ -53,6 +55,7 @@ CFLAGS+=  -I${.CURDIR}/../../i386/libi386
 .if ${MK_ZFS} != "no"
 CFLAGS+=   -I${.CURDIR}/../../zfs
 CFLAGS+=   -I${.CURDIR}/../../../cddl/boot/zfs
+CFLAGS+=   -I${.CURDIR}/../../../crypto/skein
 CFLAGS+=   -DEFI_ZFS_BOOT
 .endif
 CFLAGS+=   -DNO_PCI -DEFI

Modified: head/sys/boot/i386/boot2/Makefile
==
--- head/sys/boot/i386/boot2/Makefile   Wed Aug 17 22:13:39 2016
(r304320)
+++ head/sys/boot/i386/boot2/Makefile   Thu Aug 18 00:37:07 2016
(r304321)
@@ -33,7 +33,7 @@ CFLAGS=   -fomit-frame-pointer \
-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
-I${.CURDIR}/../../common \
-I${.CURDIR}/../btx/lib -I. \
-   -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
+   -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
-Winline

Modified: head/sys/boot/i386/gptboot/Makefile
==
--- head/sys/boot/i386/gptboot/Makefile Wed Aug 17 22:13:39 2016
(r304320)
+++ head/sys/boot/i386/gptboot/Makefile Thu Aug 18 00:37:07 2016
(r304321)
@@ -32,10 +32,10 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \
-I${.CURDIR}/../btx/lib -I. \
-I${.CURDIR}/../boot2 \
  

svn commit: r304320 - head/secure/lib/libcrypto

2016-08-17 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 17 22:13:39 2016
New Revision: 304320
URL: https://svnweb.freebsd.org/changeset/base/304320

Log:
  Disable assembly sources when compiler/assembler cannot compile certain
  instructions.  For example, GCC 4.2.1 + binutils 2.17.50 does not support
  AVX instructions.
  
  Reported by:  bde
  MFC after:2 weeks

Added:
  head/secure/lib/libcrypto/opensslconf-aarch64.h.in
 - copied, changed from r304319, 
head/secure/lib/libcrypto/opensslconf-aarch64.h
  head/secure/lib/libcrypto/opensslconf-arm.h.in
 - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-arm.h
  head/secure/lib/libcrypto/opensslconf-mips.h.in
 - copied, changed from r304319, 
head/secure/lib/libcrypto/opensslconf-mips.h
  head/secure/lib/libcrypto/opensslconf-powerpc.h.in
 - copied, changed from r304319, 
head/secure/lib/libcrypto/opensslconf-powerpc.h
  head/secure/lib/libcrypto/opensslconf-riscv.h.in
 - copied, changed from r304319, 
head/secure/lib/libcrypto/opensslconf-riscv.h
  head/secure/lib/libcrypto/opensslconf-sparc64.h.in
 - copied, changed from r304319, 
head/secure/lib/libcrypto/opensslconf-sparc64.h
  head/secure/lib/libcrypto/opensslconf-x86.h.in
 - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-x86.h
Deleted:
  head/secure/lib/libcrypto/opensslconf-aarch64.h
  head/secure/lib/libcrypto/opensslconf-arm.h
  head/secure/lib/libcrypto/opensslconf-mips.h
  head/secure/lib/libcrypto/opensslconf-powerpc.h
  head/secure/lib/libcrypto/opensslconf-riscv.h
  head/secure/lib/libcrypto/opensslconf-sparc64.h
  head/secure/lib/libcrypto/opensslconf-x86.h
Modified:
  head/secure/lib/libcrypto/Makefile
  head/secure/lib/libcrypto/Makefile.asm
  head/secure/lib/libcrypto/Makefile.inc

Modified: head/secure/lib/libcrypto/Makefile
==
--- head/secure/lib/libcrypto/Makefile  Wed Aug 17 21:57:11 2016
(r304319)
+++ head/secure/lib/libcrypto/Makefile  Wed Aug 17 22:13:39 2016
(r304320)
@@ -22,9 +22,9 @@ MAN+= config.5 des_modes.7
 # base sources
 SRCS=  cpt_err.c cryptlib.c cversion.c ex_data.c mem.c mem_dbg.c o_dir.c \
o_fips.c o_init.c o_str.c o_time.c uid.c
-.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(ASM_amd64)
 SRCS+= x86_64cpuid.S
-.elif ${MACHINE_CPUARCH} == "i386"
+.elif defined(ASM_i386)
 SRCS+= x86cpuid.S
 .else
 SRCS+= mem_clr.c
@@ -33,10 +33,10 @@ INCS+=  crypto.h ebcdic.h opensslv.h ossl
 
 # aes
 SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c
-.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(ASM_amd64)
 SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \
aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S
-.elif ${MACHINE_CPUARCH} == "i386"
+.elif defined(ASM_i386)
 SRCS+= aes-586.S aesni-x86.S vpaes-x86.S
 .else
 SRCS+= aes_cbc.c aes_core.c
@@ -60,7 +60,7 @@ INCS+=asn1.h asn1_mac.h asn1t.h
 
 # bf
 SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c
-.if ${MACHINE_CPUARCH} == "i386"
+.if defined(ASM_i386)
 .if ${MACHINE_CPU:Mi686}
 SRCS+= bf-686.S
 .else
@@ -82,10 +82,10 @@ SRCS+=  bn_add.c bn_blind.c bn_const.c bn
bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c bn_lib.c bn_mod.c \
bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_prime.c bn_print.c bn_rand.c \
bn_recp.c bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c
-.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(ASM_amd64)
 SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \
x86_64-mont.S x86_64-mont5.S
-.elif ${MACHINE_CPUARCH} == "i386"
+.elif defined(ASM_i386)
 SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S
 .else
 SRCS+= bn_asm.c
@@ -98,9 +98,9 @@ INCS+=buffer.h
 
 # camellia
 SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_ofb.c cmll_utl.c
-.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(ASM_amd64)
 SRCS+= cmll_misc.c cmll-x86_64.S
-.elif ${MACHINE_CPUARCH} == "i386"
+.elif defined(ASM_i386)
 SRCS+= cmll-x86.S
 .else
 SRCS+= camellia.c cmll_cbc.c cmll_misc.c
@@ -135,7 +135,7 @@ SRCS+=  cbc_cksm.c cbc_enc.c cfb64ede.c c
des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c enc_read.c enc_writ.c \
fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \
rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c
-.if ${MACHINE_CPUARCH} == "i386"
+.if defined(ASM_i386)
 SRCS+= crypt586.S des-586.S
 .else
 SRCS+= des_enc.c fcrypt_b.c
@@ -161,7 +161,7 @@ SRCS+=  ec2_mult.c ec2_oct.c ec2_smpl.c e
ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c ec_mult.c ec_oct.c \
ec_pmeth.c ec_print.c eck_prn.c ecp_mont.c ecp_nist.c ecp_oct.c \
ecp_smpl.c
-.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(ASM_amd64)
 SRCS+= ecp_nistz256.c ecp_nistz256-x86_64.S
 .endif
 INCS+= ec.h
@@ -218,9 +218,9 @@ INCS+=  md4.h
 
 # md5
 SRCS+= md5_dgst.c md5_one.c
-.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(ASM_amd64)
 SRCS+= 

svn commit: r304319 - in head: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 21:57:11 2016
New Revision: 304319
URL: https://svnweb.freebsd.org/changeset/base/304319

Log:
  Pull in r262772 from upstream clang trunk (by Simon Pilgrim):
  
[X86] AMD Bobcat CPU (btver1) doesn't support XSAVE
  
btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
support XSAVE.
  
Differential Revision: http://reviews.llvm.org/D17682
  
  Pull in r262782 from upstream llvm trunk (by Simon Pilgrim):
  
[X86] AMD Bobcat CPU (btver1) doesn't support XSAVE
  
btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
support XSAVE.
  
Differential Revision: http://reviews.llvm.org/D17683
  
  This ensures clang does not emit AVX instructions for CPUTYPE=btver1.
  
  Reported by:  Michel Depeige 
  PR:   211864
  MFC after:3 days

Modified:
  head/contrib/llvm/lib/Target/X86/X86.td
  head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
  head/lib/clang/freebsd_cc_version.h

Modified: head/contrib/llvm/lib/Target/X86/X86.td
==
--- head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:44:02 2016
(r304318)
+++ head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:57:11 2016
(r304319)
@@ -576,7 +576,6 @@ def : Proc<"btver1", [
   FeaturePRFCHW,
   FeatureLZCNT,
   FeaturePOPCNT,
-  FeatureXSAVE,
   FeatureSlowSHLD,
   FeatureLAHFSAHF
 ]>;

Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
==
--- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:44:02 
2016(r304318)
+++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:57:11 
2016(r304319)
@@ -2731,7 +2731,6 @@ bool X86TargetInfo::initFeatureMap(
 setFeatureEnabledImpl(Features, "prfchw", true);
 setFeatureEnabledImpl(Features, "cx16", true);
 setFeatureEnabledImpl(Features, "fxsr", true);
-setFeatureEnabledImpl(Features, "xsave", true);
 break;
   case CK_BDVER4:
 setFeatureEnabledImpl(Features, "avx2", true);

Modified: head/lib/clang/freebsd_cc_version.h
==
--- head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:44:02 2016
(r304318)
+++ head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:57:11 2016
(r304319)
@@ -1,3 +1,3 @@
 /* $FreeBSD$ */
 
-#defineFREEBSD_CC_VERSION  120
+#defineFREEBSD_CC_VERSION  121
___
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: r304318 - in head/sys/arm/allwinner: . clk

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 21:44:02 2016
New Revision: 304318
URL: https://svnweb.freebsd.org/changeset/base/304318

Log:
  Rename allwinner_machdep.{c.h} to aw_machdep.{c.h}  as all allwinner source
  files are name aw_*

Added:
  head/sys/arm/allwinner/aw_machdep.c
 - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.c
  head/sys/arm/allwinner/aw_machdep.h
 - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.h
Deleted:
  head/sys/arm/allwinner/allwinner_machdep.c
  head/sys/arm/allwinner/allwinner_machdep.h
Modified:
  head/sys/arm/allwinner/a10_ehci.c
  head/sys/arm/allwinner/a10_gpio.c
  head/sys/arm/allwinner/a10_mmc.c
  head/sys/arm/allwinner/aw_if_dwc.c
  head/sys/arm/allwinner/aw_mp.c
  head/sys/arm/allwinner/aw_rtc.c
  head/sys/arm/allwinner/clk/aw_pll.c
  head/sys/arm/allwinner/files.allwinner
  head/sys/arm/allwinner/timer.c

Modified: head/sys/arm/allwinner/a10_ehci.c
==
--- head/sys/arm/allwinner/a10_ehci.c   Wed Aug 17 21:29:57 2016
(r304317)
+++ head/sys/arm/allwinner/a10_ehci.c   Wed Aug 17 21:44:02 2016
(r304318)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Wed Aug 17 21:29:57 2016
(r304317)
+++ head/sys/arm/allwinner/a10_gpio.c   Wed Aug 17 21:44:02 2016
(r304318)
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm/allwinner/a10_mmc.c
==
--- head/sys/arm/allwinner/a10_mmc.cWed Aug 17 21:29:57 2016
(r304317)
+++ head/sys/arm/allwinner/a10_mmc.cWed Aug 17 21:44:02 2016
(r304318)
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm/allwinner/aw_if_dwc.c
==
--- head/sys/arm/allwinner/aw_if_dwc.c  Wed Aug 17 21:29:57 2016
(r304317)
+++ head/sys/arm/allwinner/aw_if_dwc.c  Wed Aug 17 21:44:02 2016
(r304318)
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 

Copied and modified: head/sys/arm/allwinner/aw_machdep.c (from r304317, 
head/sys/arm/allwinner/allwinner_machdep.c)
==
--- head/sys/arm/allwinner/allwinner_machdep.c  Wed Aug 17 21:29:57 2016
(r304317, copy source)
+++ head/sys/arm/allwinner/aw_machdep.c Wed Aug 17 21:44:02 2016
(r304318)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2012 Ganbold Tsagaankhuu 
- * Copyright (c) 2015-2016 Emmanuel Vadot 
+ * Copyright (c) 2015-2016 Emmanuel Vadot 
  * All rights reserved.
  *
  * This code is derived from software written for Brini by Mark Brinicombe
@@ -26,6 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+
  * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c
  */
 
@@ -52,7 +53,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
 
 #include "platform_if.h"
 

Copied and modified: head/sys/arm/allwinner/aw_machdep.h (from r304317, 
head/sys/arm/allwinner/allwinner_machdep.h)
==
--- head/sys/arm/allwinner/allwinner_machdep.h  Wed Aug 17 21:29:57 2016
(r304317, copy source)
+++ head/sys/arm/allwinner/aw_machdep.h Wed Aug 17 21:44:02 2016
(r304318)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Emmanuel Vadot 
+ * Copyright (c) 2015 Emmanuel Vadot 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/arm/allwinner/aw_mp.c
==
--- head/sys/arm/allwinner/aw_mp.c  Wed Aug 17 21:29:57 2016
(r304317)
+++ head/sys/arm/allwinner/aw_mp.c  Wed Aug 17 21:44:02 2016
(r304318)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 
 /* Register for all dual-core SoC */
 #defineA20_CPUCFG_BASE 0x01c25c00

Modified: head/sys/arm/allwinner/aw_rtc.c
==
--- head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:29:57 2016
(r304317)
+++ head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:44:02 2016
(r304318)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 

svn commit: r304317 - head/sys/boot/efi/boot1

2016-08-17 Thread Toomas Soome
Author: tsoome
Date: Wed Aug 17 21:29:57 2016
New Revision: 304317
URL: https://svnweb.freebsd.org/changeset/base/304317

Log:
  boot1.efi Free() should check for NULL to provide consistent behavior
  with libstand Free().
  
  Reviewed by:  imp
  Approved by:  imp (mentor)
  Differential Revision:https://reviews.freebsd.org/D7497

Modified:
  head/sys/boot/efi/boot1/boot1.c

Modified: head/sys/boot/efi/boot1/boot1.c
==
--- head/sys/boot/efi/boot1/boot1.c Wed Aug 17 20:32:08 2016
(r304316)
+++ head/sys/boot/efi/boot1/boot1.c Wed Aug 17 21:29:57 2016
(r304317)
@@ -78,7 +78,8 @@ Malloc(size_t len, const char *file __un
 void
 Free(void *buf, const char *file __unused, int line __unused)
 {
-   (void)bs->FreePool(buf);
+   if (buf != NULL)
+   (void)bs->FreePool(buf);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304316 - in head/sys/arm: allwinner allwinner/a10 conf

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 20:32:08 2016
New Revision: 304316
URL: https://svnweb.freebsd.org/changeset/base/304316

Log:
  Rename kernel config A10 into ALLWINNER_UP as it is intend to work with all
  Allwinner Uniprocessor SoC.
  As of now it works with A10 and A13 (and possibly R8 as it is the same as the 
A13).
  Move files.a10 into a1o subdirectory as it should be.
  Rename std.a10 into std.allwinner_up

Added:
  head/sys/arm/allwinner/a10/files.a10   (contents, props changed)
 - copied, changed from r304315, head/sys/arm/allwinner/files.a10
  head/sys/arm/allwinner/files.allwinner_up   (contents, props changed)
  head/sys/arm/allwinner/std.allwinner_up   (contents, props changed)
 - copied, changed from r304315, head/sys/arm/allwinner/std.a10
  head/sys/arm/conf/ALLWINNER_UP   (contents, props changed)
 - copied, changed from r304315, head/sys/arm/conf/A10
Deleted:
  head/sys/arm/allwinner/files.a10
  head/sys/arm/allwinner/std.a10
  head/sys/arm/conf/A10

Copied and modified: head/sys/arm/allwinner/a10/files.a10 (from r304315, 
head/sys/arm/allwinner/files.a10)
==
--- head/sys/arm/allwinner/files.a10Wed Aug 17 20:27:04 2016
(r304315, copy source)
+++ head/sys/arm/allwinner/a10/files.a10Wed Aug 17 20:32:08 2016
(r304316)
@@ -2,4 +2,3 @@
 
 arm/allwinner/a10/a10_intc.c   standard
 arm/allwinner/a10_padconf.cstandard
-arm/allwinner/timer.c  standard

Added: head/sys/arm/allwinner/files.allwinner_up
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/allwinner/files.allwinner_up   Wed Aug 17 20:32:08 2016
(r304316)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+arm/allwinner/timer.c  standard

Copied and modified: head/sys/arm/allwinner/std.allwinner_up (from r304315, 
head/sys/arm/allwinner/std.a10)
==
--- head/sys/arm/allwinner/std.a10  Wed Aug 17 20:27:04 2016
(r304315, copy source)
+++ head/sys/arm/allwinner/std.allwinner_up Wed Aug 17 20:32:08 2016
(r304316)
@@ -1,4 +1,4 @@
-# Allwinner A10 common options
+# Allwinner Uniprocessor common options
 #$FreeBSD$
 
 cpuCPU_CORTEXA
@@ -8,6 +8,7 @@ makeoptions CONF_CFLAGS="-march=armv7a"
 makeoptionsKERNVIRTADDR=0xc020
 optionsKERNVIRTADDR=0xc020
 
+files  "../allwinner/files.allwinner_up"
 files  "../allwinner/files.allwinner"
-files  "../allwinner/files.a10"
+files  "../allwinner/a10/files.a10"
 files  "../allwinner/a13/files.a13"

Copied and modified: head/sys/arm/conf/ALLWINNER_UP (from r304315, 
head/sys/arm/conf/A10)
==
--- head/sys/arm/conf/A10   Wed Aug 17 20:27:04 2016(r304315, copy 
source)
+++ head/sys/arm/conf/ALLWINNER_UP  Wed Aug 17 20:32:08 2016
(r304316)
@@ -1,5 +1,5 @@
 #
-# A10 -- Custom configuration for the AllWinner A10 SoC
+# ALLWINNER_UP -- Custom configuration for the AllWinner Uniprocessor SoC
 #
 # For more information on this file, please read the config(5) manual page,
 # and/or the handbook section on Kernel Configuration Files:
@@ -18,10 +18,10 @@
 #
 # $FreeBSD$
 
-ident  A10
+ident  ALLWINNER_UP
 
 include"std.armv6"
-include"../allwinner/std.a10"
+include"../allwinner/std.allwinner_up"
 
 optionsINTRNG
 
___
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: r304315 - head/share/man/man4

2016-08-17 Thread Jilles Tjoelker
Author: jilles
Date: Wed Aug 17 20:27:04 2016
New Revision: 304315
URL: https://svnweb.freebsd.org/changeset/base/304315

Log:
  rights(4): CAP_FSYNC also permits fdatasync(2).

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

Modified: head/share/man/man4/rights.4
==
--- head/share/man/man4/rights.4Wed Aug 17 20:24:14 2016
(r304314)
+++ head/share/man/man4/rights.4Wed Aug 17 20:27:04 2016
(r304315)
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 27, 2015
+.Dd August 17, 2016
 .Dt RIGHTS 4
 .Os
 .Sh NAME
@@ -254,6 +254,7 @@ Permit
 .It Dv CAP_FSYNC
 Permit
 .Xr aio_fsync 2 ,
+.Xr fdatasync 2 ,
 .Xr fsync 2
 and
 .Xr openat 2
___
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: r304314 - in head/sys/mips: broadcom conf

2016-08-17 Thread Landon J. Fuller
Author: landonf
Date: Wed Aug 17 20:24:14 2016
New Revision: 304314
URL: https://svnweb.freebsd.org/changeset/base/304314

Log:
  mips/broadcom: Implement CFE-based EARLY_PRINTF support.
  
  This adds support for EARLY_PRINTF via the CFE console; the aim is to
  provide a fix for the otherwise cyclic dependency between PMU discovery
  and console printf/DELAY:
  
  - We need to parse the bhnd(4) core table to determine the address (and
type) of the PMU/PLL registers and calculate the CPU clock frequency.
  - The core table parsing code will emit a printf() if a parse error is
hit.
  - Safely calling printf() without EARLY_PRINTF requires a working
DELAY+cninit, which means we need the PMU.
  
  Errors in core table parsing shouldn't happen, but lack of EARLY_PRINTF
  makes debugging more difficult.
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D7498

Modified:
  head/sys/mips/broadcom/bcm_machdep.c
  head/sys/mips/conf/BCM
  head/sys/mips/conf/SENTRY5

Modified: head/sys/mips/broadcom/bcm_machdep.c
==
--- head/sys/mips/broadcom/bcm_machdep.cWed Aug 17 20:21:33 2016
(r304313)
+++ head/sys/mips/broadcom/bcm_machdep.cWed Aug 17 20:24:14 2016
(r304314)
@@ -198,6 +198,21 @@ platform_start(__register_t a0, __regist
/* Initialize pcpu stuff */
mips_pcpu0_init();
 
+#ifdef CFE
+   /*
+* Initialize CFE firmware trampolines. This must be done
+* before any CFE APIs are called, including writing
+* to the CFE console.
+*
+* CFE passes the following values in registers:
+* a0: firmware handle
+* a2: firmware entry point
+* a3: entry point seal
+*/
+   if (a3 == CFE_EPTSEAL)
+   cfe_init(a0, a2);
+#endif
+
 #if 0
/*
 * Probe the Broadcom on-chip PLL clock registers
@@ -234,23 +249,40 @@ platform_start(__register_t a0, __regist
 
mips_timer_early_init(platform_counter_freq);
 
-#ifdef CFE
-   /*
-* Initialize CFE firmware trampolines before
-* we initialize the low-level console.
-*
-* CFE passes the following values in registers:
-* a0: firmware handle
-* a2: firmware entry point
-* a3: entry point seal
-*/
-   if (a3 == CFE_EPTSEAL)
-   cfe_init(a0, a2);
-#endif
-
cninit();
 
mips_init();
 
mips_timer_init_params(platform_counter_freq, socinfo->double_count);
 }
+
+/*
+ * CFE-based EARLY_PRINTF support. To use, add the following to the kernel
+ * config:
+ * option EARLY_PRINTF
+ * option CFE
+ * device cfe
+ */
+#if defined(EARLY_PRINTF) && defined(CFE)
+static void
+bcm_cfe_eputc(int c)
+{
+   static int  fd = -1;
+   unsigned char   ch;
+
+   ch = (unsigned char) c;
+
+   if (fd == -1) {
+   if ((fd = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE)) < 0)
+   return;
+   }
+
+   if (ch == '\n')
+   early_putc('\r');
+
+   while ((cfe_write(fd, , 1)) == 0)
+   continue;
+}
+
+early_putc_t *early_putc = bcm_cfe_eputc;
+#endif /* EARLY_PRINTF */

Modified: head/sys/mips/conf/BCM
==
--- head/sys/mips/conf/BCM  Wed Aug 17 20:21:33 2016(r304313)
+++ head/sys/mips/conf/BCM  Wed Aug 17 20:24:14 2016(r304314)
@@ -52,6 +52,7 @@ options   INVARIANT_SUPPORT
 #options   BHND_LOGLEVEL=BHND_DEBUG_LEVEL
 #options   BUS_DEBUG
 #makeoptions   BUS_DEBUG
+optionsEARLY_PRINTF
 #options   VERBOSE_SYSINIT
 #makeoptions   VERBOSE_SYSINIT
 

Modified: head/sys/mips/conf/SENTRY5
==
--- head/sys/mips/conf/SENTRY5  Wed Aug 17 20:21:33 2016(r304313)
+++ head/sys/mips/conf/SENTRY5  Wed Aug 17 20:24:14 2016(r304314)
@@ -31,9 +31,8 @@ makeoptions   TRAMPLOADADDR=0x807963c0
 hints  "SENTRY5.hints"
 include"../broadcom/std.broadcom"
 
-# sentry5 normally ships with cfe firmware; use the console for now
+# sentry5 normally ships with cfe firmware
 optionsCFE
-optionsCFE_CONSOLE
 optionsALT_BREAK_TO_DEBUGGER
 device cfe
 
@@ -57,6 +56,7 @@ options   INVARIANT_SUPPORT
 
 #options   BUS_DEBUG
 #makeoptions   BUS_DEBUG
+optionsEARLY_PRINTF
 
 device bhnd
 device siba
___
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: r304313 - head/sys/net

2016-08-17 Thread Andrey V. Elsukov
Author: ae
Date: Wed Aug 17 20:21:33 2016
New Revision: 304313
URL: https://svnweb.freebsd.org/changeset/base/304313

Log:
  Teach netisr_get_cpuid() to limit a given value to supported by netisr.
  Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value
  returned by protocol to be sure that it is not greather than nws_count.
  
  PR:   211836
  Reviewed by:  adrian
  MFC after:3 days

Modified:
  head/sys/net/if_epair.c
  head/sys/net/netisr.c

Modified: head/sys/net/if_epair.c
==
--- head/sys/net/if_epair.c Wed Aug 17 19:43:45 2016(r304312)
+++ head/sys/net/if_epair.c Wed Aug 17 20:21:33 2016(r304313)
@@ -807,9 +807,9 @@ epair_clone_create(struct if_clone *ifc,
 * cache locality but we can at least allow parallelism.
 */
sca->cpuid =
-   netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount());
+   netisr_get_cpuid(sca->ifp->if_index);
scb->cpuid =
-   netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount());
+   netisr_get_cpuid(scb->ifp->if_index);
 
/* Initialise pseudo media types. */
ifmedia_init(>media, 0, epair_media_change, epair_media_status);

Modified: head/sys/net/netisr.c
==
--- head/sys/net/netisr.c   Wed Aug 17 19:43:45 2016(r304312)
+++ head/sys/net/netisr.c   Wed Aug 17 20:21:33 2016(r304313)
@@ -272,10 +272,7 @@ u_int
 netisr_get_cpuid(u_int cpunumber)
 {
 
-   KASSERT(cpunumber < nws_count, ("%s: %u > %u", __func__, cpunumber,
-   nws_count));
-
-   return (nws_array[cpunumber]);
+   return (nws_array[cpunumber % nws_count]);
 }
 
 /*
@@ -810,10 +807,12 @@ netisr_select_cpuid(struct netisr_proto 
 * dispatch.  In the queued case, fall back on the SOURCE
 * policy.
 */
-   if (*cpuidp != NETISR_CPUID_NONE)
+   if (*cpuidp != NETISR_CPUID_NONE) {
+   *cpuidp = netisr_get_cpuid(*cpuidp);
return (m);
+   }
if (dispatch_policy == NETISR_DISPATCH_HYBRID) {
-   *cpuidp = curcpu;
+   *cpuidp = netisr_get_cpuid(curcpu);
return (m);
}
policy = NETISR_POLICY_SOURCE;
___
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: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern

2016-08-17 Thread Jilles Tjoelker
On Mon, Aug 15, 2016 at 07:08:51PM +, Konstantin Belousov wrote:
> Author: kib
> Date: Mon Aug 15 19:08:51 2016
> New Revision: 304176
> URL: https://svnweb.freebsd.org/changeset/base/304176

> Log:
>   Add an implementation of fdatasync(2).

>   The syscall is a trivial wrapper around new VOP_FDATASYNC(), sharing
>   code with fsync(2).  For all filesystems, this commit provides the
>   implementation which delegates the work of VOP_FDATASYNC() to
>   VOP_FSYNC().  This is functionally correct but not efficient.

>   This is not yet POSIX-compliant implementation, because it does not
>   ensure that queued AIO requests are completed before returning.

>   Reviewed by:mckusick
>   Discussed with: avg (ZFS), jhb (AIO part)
>   Tested by:  pho
>   Sponsored by:   The FreeBSD Foundation
>   MFC after:  2 weeks
>   Differential revision:  https://reviews.freebsd.org/D7471

> Modified:
>   head/include/unistd.h
>   head/lib/libc/sys/Symbol.map
>   head/sys/compat/freebsd32/syscalls.master
>   head/sys/kern/syscalls.master
>   head/sys/kern/vfs_default.c
>   head/sys/kern/vfs_syscalls.c
>   head/sys/kern/vnode_if.src

> Modified: head/include/unistd.h
> ==
> --- head/include/unistd.h Mon Aug 15 19:05:41 2016(r304175)
> +++ head/include/unistd.h Mon Aug 15 19:08:51 2016(r304176)
> @@ -384,6 +384,7 @@ extern int optind, opterr, optopt;
>  /* ISO/IEC 9945-1: 1996 */
>  #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
>  int   fsync(int);
> +int   fdatasync(int);
>  
>  /*
>   * ftruncate() was in the POSIX Realtime Extension (it's used for shared

Apparently these functions were added closely enough in time that they
can stay together here :)

> [snip]
> Modified: head/sys/kern/vfs_syscalls.c
> ==
> --- head/sys/kern/vfs_syscalls.c  Mon Aug 15 19:05:41 2016
> (r304175)
> +++ head/sys/kern/vfs_syscalls.c  Mon Aug 15 19:08:51 2016
> (r304176)
> @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st
>  }
>  #endif
>  
> -/*
> - * Sync an open file.
> - */
> -#ifndef _SYS_SYSPROTO_H_
> -struct fsync_args {
> - int fd;
> -};
> -#endif
> -int
> -sys_fsync(td, uap)
> - struct thread *td;
> - struct fsync_args /* {
> - int fd;
> - } */ *uap;
> +static int
> +kern_fsync(struct thread *td, int fd, bool fullsync)
>  {
>   struct vnode *vp;
>   struct mount *mp;
> @@ -3375,11 +3363,15 @@ sys_fsync(td, uap)
>   cap_rights_t rights;
>   int error, lock_flags;
>  
> - AUDIT_ARG_FD(uap->fd);
> - error = getvnode(td, uap->fd, cap_rights_init(, CAP_FSYNC), );
> + AUDIT_ARG_FD(fd);
> + error = getvnode(td, fd, cap_rights_init(, CAP_FSYNC), );
>   if (error != 0)
>   return (error);
>   vp = fp->f_vnode;
> +#if 0
> + if (!fullsync)
> + /* XXXKIB: compete outstanding aio writes */;

Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O
requests is in fact required for fsync() as well. The fdatasync()
function is completely under the _POSIX_SYNCHRONIZED_IO option.

We do not implement this option, but keeping fdatasync()'s guarantees a
subset of fsync()'s guarantees seems sensible.

> +#endif
>   error = vn_start_write(vp, , V_WAIT | PCATCH);
>   if (error != 0)
>   goto drop;
> [snip]
> Modified: head/sys/kern/vnode_if.src
> ==
> --- head/sys/kern/vnode_if.srcMon Aug 15 19:05:41 2016
> (r304175)
> +++ head/sys/kern/vnode_if.srcMon Aug 15 19:08:51 2016
> (r304176)
> @@ -703,6 +703,14 @@ vop_add_writecount {
>   IN int inc;
>  };
>  
> +%% fdatasync vp  L L L
> +
> +vop_fdatasync {
> + IN struct vnode *vp;
> + IN struct thread *td;
> +};
> +
> +
>  # The VOPs below are spares at the end of the table to allow new VOPs to be
>  # added in stable branches without breaking the KBI.  New VOPs in HEAD should
>  # be added above these spares.  When merging a new VOP to a stable branch,

A waitfor parameter like in vop_fsync may be useful to implement
aio_fsync(O_DSYNC) later on.

-- 
Jilles Tjoelker
___
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: r304307 - vendor/lld/lld-release_39-r278877

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:37:27 2016
New Revision: 304307
URL: https://svnweb.freebsd.org/changeset/base/304307

Log:
  Tag lld release_39 branch r278877.

Added:
  vendor/lld/lld-release_39-r278877/
 - copied from r304306, vendor/lld/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304309 - vendor/lldb/lldb-release_39-r278877

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:38:11 2016
New Revision: 304309
URL: https://svnweb.freebsd.org/changeset/base/304309

Log:
  Tag lldb release_39 branch r278877.

Added:
  vendor/lldb/lldb-release_39-r278877/
 - copied from r304308, vendor/lldb/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304308 - in vendor/lldb/dist: include/lldb include/lldb/Host/android include/lldb/Host/linux include/lldb/Target scripts/Xcode source/Host/common source/Plugins/Instruction/MIPS source...

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:37:50 2016
New Revision: 304308
URL: https://svnweb.freebsd.org/changeset/base/304308

Log:
  Vendor import of lldb release_39 branch r278877:
  https://llvm.org/svn/llvm-project/lldb/branches/release_39@278877

Modified:
  vendor/lldb/dist/include/lldb/Host/android/Android.h
  vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h
  vendor/lldb/dist/include/lldb/Target/RegisterContext.h
  vendor/lldb/dist/include/lldb/lldb-private-types.h
  vendor/lldb/dist/scripts/Xcode/build-llvm.py
  vendor/lldb/dist/source/Host/common/File.cpp
  vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
  vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
  
vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
  vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
  vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
  
vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp
  
vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm64.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_i386.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_mips.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_mips64.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_powerpc.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_s390x.h
  vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
  
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
  vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  vendor/lldb/dist/source/Target/RegisterContext.cpp

Modified: vendor/lldb/dist/include/lldb/Host/android/Android.h
==
--- vendor/lldb/dist/include/lldb/Host/android/Android.hWed Aug 17 
19:37:27 2016(r304307)
+++ vendor/lldb/dist/include/lldb/Host/android/Android.hWed Aug 17 
19:37:50 2016(r304308)
@@ -14,9 +14,6 @@
 #include 
 #include 
 
-#define _isattyisatty
-#define SYS_tgkill __NR_tgkill
-
 namespace std
 {
template 

Modified: vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h
==
--- vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h   Wed Aug 17 19:37:27 
2016(r304307)
+++ vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h   Wed Aug 17 19:37:50 
2016(r304308)
@@ -14,33 +14,24 @@
 
 #include 
 
-#ifdef __ANDROID_NDK__
-#define PT_DETACH PTRACE_DETACH
+#ifndef __GLIBC__
 typedef int __ptrace_request;
 #endif
 
 #define DEBUG_PTRACE_MAXBYTES 20
 
 // Support ptrace extensions even when compiled without required kernel support
-#ifndef PT_GETREGS
-#ifndef PTRACE_GETREGS
-#define PTRACE_GETREGS 12
-#endif
-#endif
-#ifndef PT_SETREGS
-#ifndef PTRACE_SETREGS
-#define PTRACE_SETREGS 13
-#endif
-#endif
-#ifndef PT_GETFPREGS
-#ifndef PTRACE_GETFPREGS
-#define PTRACE_GETFPREGS 14
-#endif
-#endif
-#ifndef PT_SETFPREGS
-#ifndef PTRACE_SETFPREGS
-#define PTRACE_SETFPREGS 15
-#endif
+#ifndef PTRACE_GETREGS
+#define PTRACE_GETREGS 12
+#endif
+#ifndef PTRACE_SETREGS
+#define PTRACE_SETREGS 13
+#endif
+#ifndef PTRACE_GETFPREGS
+#define PTRACE_GETFPREGS 14
+#endif
+#ifndef PTRACE_SETFPREGS
+#define PTRACE_SETFPREGS 15
 #endif
 #ifndef PTRACE_GETREGSET
 #define PTRACE_GETREGSET 0x4204

Modified: vendor/lldb/dist/include/lldb/Target/RegisterContext.h
==
--- vendor/lldb/dist/include/lldb/Target/RegisterContext.h  Wed Aug 17 
19:37:27 2016(r304307)
+++ vendor/lldb/dist/include/lldb/Target/RegisterContext.h  Wed Aug 17 
19:37:50 2016(r304308)
@@ -46,6 +46,11 @@ public:
 virtual const RegisterInfo *
 GetRegisterInfoAtIndex (size_t reg) = 0;
 
+// Detect the register size dynamically.
+uint32_t
+UpdateDynamicRegisterSize (const lldb_private::ArchSpec ,

svn commit: r304304 - in vendor/libc++/dist: include test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time test/std/iterators/iterator.range test/std/numerics/complex.number/complex.tr...

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:36:25 2016
New Revision: 304304
URL: https://svnweb.freebsd.org/changeset/base/304304

Log:
  Vendor import of libc++ release_39 branch r278877:
  https://llvm.org/svn/llvm-project/libcxx/branches/release_39@278877

Added:
  vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.fail.cpp   
(contents, props changed)
Modified:
  vendor/libc++/dist/include/iterator
  
vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
  
vendor/libc++/dist/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp

Modified: vendor/libc++/dist/include/iterator
==
--- vendor/libc++/dist/include/iterator Wed Aug 17 19:36:01 2016
(r304303)
+++ vendor/libc++/dist/include/iterator Wed Aug 17 19:36:25 2016
(r304304)
@@ -1632,16 +1632,16 @@ reverse_iterator rend(initia
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cbegin(const _Cp& __c) -> decltype(begin(__c))
+auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c))
 {
-return begin(__c);
+return _VSTD::begin(__c);
 }
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cend(const _Cp& __c) -> decltype(end(__c))
+auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c))
 {
-return end(__c);
+return _VSTD::end(__c);
 }
 
 template 
@@ -1674,16 +1674,16 @@ auto rend(const _Cp& __c) -> decltype(__
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
-auto crbegin(const _Cp& __c) -> decltype(rbegin(__c))
+auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c))
 {
-return rbegin(__c);
+return _VSTD::rbegin(__c);
 }
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
-auto crend(const _Cp& __c) -> decltype(rend(__c))
+auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
 {
-return rend(__c);
+return _VSTD::rend(__c);
 }
 
 #endif

Modified: 
vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
==
--- 
vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
  Wed Aug 17 19:36:01 2016(r304303)
+++ 
vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
  Wed Aug 17 19:36:25 2016(r304304)
@@ -158,7 +158,8 @@ TEST_CASE(get_last_write_time_dynamic_en
 
 TEST_CHECK(ftime2 > ftime);
 TEST_CHECK(dtime2 > dtime);
-TEST_CHECK(LastAccessTime(file) == file_access_time);
+TEST_CHECK(LastAccessTime(file) == file_access_time ||
+   LastAccessTime(file) == Clock::to_time_t(ftime2));
 TEST_CHECK(LastAccessTime(dir) == dir_access_time);
 }
 

Added: vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.fail.cpp
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.fail.cpp 
Wed Aug 17 19:36:25 2016(r304304)
@@ -0,0 +1,51 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "test_macros.h"
+
+#if TEST_STD_VER < 11
+#error
+#else
+
+// 
+// template  auto begin(C& c) -> decltype(c.begin());
+// template  auto begin(const C& c) -> decltype(c.begin());
+// template  auto end(C& c) -> decltype(c.end());
+// template  auto end(const C& c) -> decltype(c.end());
+// template  reverse_iterator rbegin(initializer_list 
il);
+// template  reverse_iterator rend(initializer_list il);
+
+
+#include 
+#include 
+
+namespace Foo {
+   struct FakeContainer {};
+   typedef int FakeIter;
+
+   FakeIter begin(const FakeContainer &)   { return 1; }
+   FakeIter end  (const FakeContainer &)   { return 2; }
+   FakeIter rbegin(const FakeContainer &)  { return 3; }
+   FakeIter rend  (const FakeContainer &)  { return 4; }
+
+   FakeIter cbegin(const FakeContainer &)  { return 11; }
+   FakeIter cend  (const FakeContainer &)  { return 12; }
+   FakeIter crbegin(const FakeContainer &) { return 13; }
+   FakeIter crend  (const FakeContainer &) { return 14; }
+}
+   
+
+int main(){
+// Bug #28927 - shouldn't find these via ADL
+   (void) std::cbegin (Foo::FakeContainer());
+   (void) std::cend   (Foo::FakeContainer());
+   (void) std::crbegin(Foo::FakeContainer());
+   (void) std::crend  (Foo::FakeContainer());  
+}
+#endif

Modified: 

svn commit: r304306 - vendor/lld/dist/docs

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:36:59 2016
New Revision: 304306
URL: https://svnweb.freebsd.org/changeset/base/304306

Log:
  Vendor import of lld release_39 branch r278877:
  https://llvm.org/svn/llvm-project/lld/branches/release_39@278877

Modified:
  vendor/lld/dist/docs/ReleaseNotes.rst

Modified: vendor/lld/dist/docs/ReleaseNotes.rst
==
--- vendor/lld/dist/docs/ReleaseNotes.rst   Wed Aug 17 19:36:45 2016
(r304305)
+++ vendor/lld/dist/docs/ReleaseNotes.rst   Wed Aug 17 19:36:59 2016
(r304306)
@@ -24,6 +24,12 @@ ELF Improvements
 
 * Initial support for LTO.
 
+Changes to the MIPS Target
+~~
+
+* Added support for MIPS N64 ABI.
+* Added support for TLS relocations for both O32 and N64 MIPS ABIs.
+
 COFF Improvements
 -
 
___
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: r304305 - vendor/libc++/libc++-release_39-r278877

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:36:45 2016
New Revision: 304305
URL: https://svnweb.freebsd.org/changeset/base/304305

Log:
  Tag libc++ release_39 branch r278877.

Added:
  vendor/libc++/libc++-release_39-r278877/
 - copied from r304304, vendor/libc++/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304303 - vendor/compiler-rt/compiler-rt-release_39-r278877

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:36:01 2016
New Revision: 304303
URL: https://svnweb.freebsd.org/changeset/base/304303

Log:
  Tag compiler-rt release_39 branch r278877.

Added:
  vendor/compiler-rt/compiler-rt-release_39-r278877/
 - copied from r304302, vendor/compiler-rt/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304302 - in vendor/compiler-rt/dist: cmake cmake/Modules lib/builtins lib/sanitizer_common/tests test/asan/TestCases test/asan/TestCases/Darwin

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:35:22 2016
New Revision: 304302
URL: https://svnweb.freebsd.org/changeset/base/304302

Log:
  Vendor import of compiler-rt release_39 branch r278877:
  https://llvm.org/svn/llvm-project/compiler-rt/branches/release_39@278877

Deleted:
  vendor/compiler-rt/dist/test/asan/TestCases/Darwin/dead-strip.c
Modified:
  vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmake
  vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake
  vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt
  
vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc
  vendor/compiler-rt/dist/test/asan/TestCases/alloca_constant_size.cc

Modified: vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmake
==
--- vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmakeWed Aug 17 
19:35:05 2016(r304301)
+++ vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmakeWed Aug 17 
19:35:22 2016(r304302)
@@ -2,11 +2,15 @@
 # This function takes an OS and a list of architectures and identifies the
 # subset of the architectures list that the installed toolchain can target.
 function(try_compile_only output)
+  cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN})
+  if(NOT ARG_SOURCE)
+set(ARG_SOURCE "int foo(int x, int y) { return x + y; }\n")
+  endif()
   set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c)
-  file(WRITE ${SIMPLE_C} "int foo(int x, int y) { return x + y; }\n")
+  file(WRITE ${SIMPLE_C} "${ARG_SOURCE}\n")
   string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
  ${CMAKE_C_COMPILE_OBJECT})
-  string(REPLACE ";" " " extra_flags "${ARGN}")
+  string(REPLACE ";" " " extra_flags "${ARG_FLAGS}")
 
   set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}")
   foreach(substitution ${substitutions})
@@ -51,7 +55,20 @@ endfunction()
 function(builtin_check_c_compiler_flag flag output)
   if(NOT DEFINED ${output})
 message(STATUS "Performing Test ${output}")
-try_compile_only(result ${flag})
+try_compile_only(result FLAGS ${flag})
+set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}")
+if(${result})
+  message(STATUS "Performing Test ${output} - Success")
+else()
+  message(STATUS "Performing Test ${output} - Failed")
+endif()
+  endif()
+endfunction()
+
+function(builtin_check_c_compiler_source output source)
+  if(NOT DEFINED ${output})
+message(STATUS "Performing Test ${output}")
+try_compile_only(result SOURCE ${source})
 set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}")
 if(${result})
   message(STATUS "Performing Test ${output} - Success")

Modified: vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake
==
--- vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake   Wed Aug 17 
19:35:05 2016(r304301)
+++ vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake   Wed Aug 17 
19:35:22 2016(r304302)
@@ -1,4 +1,5 @@
 include(BuiltinTests)
+include(CheckCSourceCompiles)
 
 # Make all the tests only check the compiler
 set(TEST_COMPILE_ONLY On)
@@ -14,6 +15,15 @@ builtin_check_c_compiler_flag(-mfloat-ab
 builtin_check_c_compiler_flag(-mfloat-abi=hard  
COMPILER_RT_HAS_FLOAT_ABI_HARD_FLAG)
 builtin_check_c_compiler_flag(-static   
COMPILER_RT_HAS_STATIC_FLAG)
 
+builtin_check_c_compiler_source(COMPILER_RT_SUPPORTS_ATOMIC_KEYWORD
+"
+int foo(int x, int y) {
+ _Atomic int result = x * y;
+ return result;
+}
+")
+
+
 set(ARM64 aarch64)
 set(ARM32 arm armhf)
 set(X86 i386 i686)

Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt
==
--- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Wed Aug 17 19:35:05 
2016(r304301)
+++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Wed Aug 17 19:35:22 
2016(r304302)
@@ -38,8 +38,6 @@ set(GENERIC_SOURCES
   ashlti3.c
   ashrdi3.c
   ashrti3.c
-  # FIXME: atomic.c may only be compiled if host compiler understands _Atomic
-  # atomic.c
   clear_cache.c
   clzdi2.c
   clzsi2.c
@@ -162,6 +160,12 @@ set(GENERIC_SOURCES
   umodsi3.c
   umodti3.c)
 
+if(COMPILER_RT_SUPPORTS_ATOMIC_KEYWORD)
+  set(GENERIC_SOURCES
+${GENERIC_SOURCES}
+atomic.c)
+endif()
+
 set(MSVC_SOURCES
  divsc3.c
  divdc3.c

Modified: 
vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc
==
--- 
vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc 
Wed Aug 17 19:35:05 2016(r304301)
+++ 
vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc 
Wed Aug 17 19:35:22 2016(r304302)
@@ -62,7 +62,9 @@ TEST(Symbolizer, DemangleSwiftAndCXX) {
   EXPECT_STREQ("_TtSd", DemangleSwiftAndCXX("_TtSd"));
  

svn commit: r304300 - in vendor/clang/dist: docs include/clang/AST include/clang/Analysis/Analyses include/clang/Basic include/clang/Sema include/clang/Serialization include/clang/StaticAnalyzer/Co...

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:34:38 2016
New Revision: 304300
URL: https://svnweb.freebsd.org/changeset/base/304300

Log:
  Vendor import of clang release_39 branch r278877:
  https://llvm.org/svn/llvm-project/cfe/branches/release_39@278877

Added:
  vendor/clang/dist/test/CoverageMapping/system_macro.cpp   (contents, props 
changed)
  vendor/clang/dist/test/Modules/Inputs/PR28332/
  vendor/clang/dist/test/Modules/Inputs/PR28332/TextualInclude.h   (contents, 
props changed)
  vendor/clang/dist/test/Modules/Inputs/PR28332/a.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/PR28332/b.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/PR28332/c.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/PR28332/module.modulemap
  vendor/clang/dist/test/Modules/pr28332.cpp   (contents, props changed)
  vendor/clang/dist/test/PCH/Inputs/pragma-once.h   (contents, props changed)
  vendor/clang/dist/test/PCH/pragma-once.c   (contents, props changed)
Deleted:
  vendor/clang/dist/test/CodeGen/forwarding-blocks-if.c
  vendor/clang/dist/test/CoverageMapping/system_macro.c
  vendor/clang/dist/test/Parser/cxx1z-constexpr-lambdas.cpp
  vendor/clang/dist/test/SemaCXX/cxx1z-constexpr-lambdas.cpp
Modified:
  vendor/clang/dist/docs/AttributeReference.rst
  vendor/clang/dist/docs/ReleaseNotes.rst
  vendor/clang/dist/docs/UsersManual.rst
  vendor/clang/dist/include/clang/AST/ExternalASTSource.h
  vendor/clang/dist/include/clang/AST/StmtGraphTraits.h
  vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h
  vendor/clang/dist/include/clang/Basic/BuiltinsX86.def
  vendor/clang/dist/include/clang/Basic/DiagnosticASTKinds.td
  vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td
  vendor/clang/dist/include/clang/Sema/Sema.h
  vendor/clang/dist/include/clang/Serialization/ASTReader.h
  
vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
  vendor/clang/dist/lib/AST/ASTDiagnostic.cpp
  vendor/clang/dist/lib/AST/DeclCXX.cpp
  vendor/clang/dist/lib/AST/ExprConstant.cpp
  vendor/clang/dist/lib/Analysis/CFG.cpp
  vendor/clang/dist/lib/Basic/Targets.cpp
  vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
  vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
  vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
  vendor/clang/dist/lib/CodeGen/CGStmt.cpp
  vendor/clang/dist/lib/CodeGen/CoverageMappingGen.cpp
  vendor/clang/dist/lib/Driver/ToolChains.cpp
  vendor/clang/dist/lib/Driver/ToolChains.h
  vendor/clang/dist/lib/Driver/Tools.cpp
  vendor/clang/dist/lib/Headers/avx512fintrin.h
  vendor/clang/dist/lib/Headers/avxintrin.h
  vendor/clang/dist/lib/Headers/cpuid.h
  vendor/clang/dist/lib/Headers/emmintrin.h
  vendor/clang/dist/lib/Headers/xmmintrin.h
  vendor/clang/dist/lib/Lex/Pragma.cpp
  vendor/clang/dist/lib/Parse/ParseExpr.cpp
  vendor/clang/dist/lib/Parse/ParseExprCXX.cpp
  vendor/clang/dist/lib/Sema/SemaChecking.cpp
  vendor/clang/dist/lib/Sema/SemaExprCXX.cpp
  vendor/clang/dist/lib/Sema/SemaLambda.cpp
  vendor/clang/dist/lib/Sema/SemaOverload.cpp
  vendor/clang/dist/lib/Sema/TreeTransform.h
  vendor/clang/dist/lib/Serialization/ASTReader.cpp
  vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp
  vendor/clang/dist/lib/Serialization/ASTWriter.cpp
  vendor/clang/dist/test/CXX/special/class.copy/p11.0x.move.cpp
  vendor/clang/dist/test/CodeGen/avx-builtins.c
  vendor/clang/dist/test/CodeGen/builtins-x86.c
  vendor/clang/dist/test/CodeGen/sse-builtins.c
  vendor/clang/dist/test/CodeGen/sse2-builtins.c
  vendor/clang/dist/test/CodeGen/target-data.c
  vendor/clang/dist/test/CodeGenCXX/debug-info-cxx1y.cpp
  vendor/clang/dist/test/CodeGenCXX/switch-case-folding-2.cpp
  vendor/clang/dist/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
  vendor/clang/dist/test/CodeGenOpenCL/to_addr_builtin.cl
  vendor/clang/dist/test/Driver/cl-options.c
  vendor/clang/dist/test/Driver/cl-pch-errorhandling.cpp
  vendor/clang/dist/test/Driver/cl-pch-search.cpp
  vendor/clang/dist/test/Driver/cl-pch-showincludes.cpp
  vendor/clang/dist/test/Driver/cloudabi.c
  vendor/clang/dist/test/Driver/cloudabi.cpp
  vendor/clang/dist/test/Driver/frame-pointer-elim.c
  vendor/clang/dist/test/Misc/diag-template-diffing.cpp
  vendor/clang/dist/test/Sema/bitfield.c
  vendor/clang/dist/test/Sema/constant-conversion.c
  vendor/clang/dist/test/Sema/enable_if.c
  vendor/clang/dist/test/Sema/typo-correction.c
  vendor/clang/dist/test/SemaCXX/enable_if.cpp
  vendor/clang/dist/test/SemaCXX/lambda-expressions.cpp
  vendor/clang/dist/test/SemaCXX/return-stack-addr-2.cpp
  vendor/clang/dist/test/SemaCXX/warn-thread-safety-analysis.cpp
  vendor/clang/dist/test/SemaCXX/warn-unsequenced.cpp
  vendor/clang/dist/www/cxx_dr_status.html
  vendor/clang/dist/www/make_cxx_dr_status

Modified: vendor/clang/dist/docs/AttributeReference.rst
==
--- vendor/clang/dist/docs/AttributeReference.rst   Wed Aug 17 19:34:20 
2016(r304299)

svn commit: r304299 - vendor/llvm/llvm-release_39-r278877

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:34:20 2016
New Revision: 304299
URL: https://svnweb.freebsd.org/changeset/base/304299

Log:
  Tag llvm release_39 branch r278877.

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


svn commit: r304301 - vendor/clang/clang-release_39-r278877

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:35:05 2016
New Revision: 304301
URL: https://svnweb.freebsd.org/changeset/base/304301

Log:
  Tag clang release_39 branch r278877.

Added:
  vendor/clang/clang-release_39-r278877/
 - copied from r304300, vendor/clang/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304298 - in vendor/llvm/dist: . cmake/modules docs docs/CommandGuide docs/TableGen include/llvm-c include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/IR include/ll...

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 19:33:52 2016
New Revision: 304298
URL: https://svnweb.freebsd.org/changeset/base/304298

Log:
  Vendor import of llvm release_39 branch r278877:
  https://llvm.org/svn/llvm-project/llvm/branches/release_39@278877

Added:
  vendor/llvm/dist/lib/IR/AttributeSetNode.h   (contents, props changed)
  vendor/llvm/dist/test/CodeGen/AArch64/aarch64-vcvtfp2fxs-combine.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.fdiv.fast.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.groupstaticsize.ll
  vendor/llvm/dist/test/CodeGen/ARM/ssat-v4t.ll
  vendor/llvm/dist/test/CodeGen/ARM/usat-v4t.ll
  vendor/llvm/dist/test/CodeGen/Mips/jumptable_labels.ll
  vendor/llvm/dist/test/CodeGen/X86/pr28504.ll
  vendor/llvm/dist/test/CodeGen/X86/pr28824.ll
  vendor/llvm/dist/test/CodeGen/X86/tail-merge-after-mbp.ll
  vendor/llvm/dist/test/DebugInfo/COFF/pr28747.ll
  vendor/llvm/dist/test/Linker/Inputs/metadata-with-global-value-operand.ll
  vendor/llvm/dist/test/Linker/metadata-with-global-value-operand.ll
  vendor/llvm/dist/test/Transforms/IndVarSimplify/pr28935.ll
  vendor/llvm/dist/test/Transforms/Inline/inalloca-not-static.ll
  vendor/llvm/dist/test/Transforms/LCSSA/pr28424.ll
  vendor/llvm/dist/test/Transforms/LCSSA/pr28608.ll
  vendor/llvm/dist/test/Transforms/LoopSimplify/pr28272.ll
  vendor/llvm/dist/test/Transforms/LoopStrengthReduce/X86/pr28719.ll
  vendor/llvm/dist/test/Transforms/LoopVectorize/pr28541.ll
  vendor/llvm/dist/test/Transforms/SafeStack/coloring-ssp.ll
  vendor/llvm/dist/test/Transforms/SafeStack/layout-region-split.ll
Deleted:
  vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.groupstaticgroup.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/reciprocal.ll
Modified:
  vendor/llvm/dist/CMakeLists.txt
  vendor/llvm/dist/LICENSE.TXT
  vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake
  vendor/llvm/dist/docs/CodeGenerator.rst
  vendor/llvm/dist/docs/CommandGuide/FileCheck.rst
  vendor/llvm/dist/docs/CommandGuide/llvm-nm.rst
  vendor/llvm/dist/docs/CommandGuide/opt.rst
  vendor/llvm/dist/docs/ExceptionHandling.rst
  vendor/llvm/dist/docs/Extensions.rst
  vendor/llvm/dist/docs/GarbageCollection.rst
  vendor/llvm/dist/docs/GetElementPtr.rst
  vendor/llvm/dist/docs/HowToUseInstrMappings.rst
  vendor/llvm/dist/docs/InAlloca.rst
  vendor/llvm/dist/docs/LangRef.rst
  vendor/llvm/dist/docs/MIRLangRef.rst
  vendor/llvm/dist/docs/MarkedUpDisassembly.rst
  vendor/llvm/dist/docs/MergeFunctions.rst
  vendor/llvm/dist/docs/NVPTXUsage.rst
  vendor/llvm/dist/docs/ReleaseNotes.rst
  vendor/llvm/dist/docs/SegmentedStacks.rst
  vendor/llvm/dist/docs/SourceLevelDebugging.rst
  vendor/llvm/dist/docs/Statepoints.rst
  vendor/llvm/dist/docs/TableGen/LangIntro.rst
  vendor/llvm/dist/docs/TableGen/index.rst
  vendor/llvm/dist/docs/WritingAnLLVMBackend.rst
  vendor/llvm/dist/docs/WritingAnLLVMPass.rst
  vendor/llvm/dist/docs/index.rst
  vendor/llvm/dist/include/llvm-c/Core.h
  vendor/llvm/dist/include/llvm/ADT/GraphTraits.h
  vendor/llvm/dist/include/llvm/ADT/SCCIterator.h
  vendor/llvm/dist/include/llvm/ADT/STLExtras.h
  vendor/llvm/dist/include/llvm/ADT/Triple.h
  vendor/llvm/dist/include/llvm/ADT/iterator.h
  vendor/llvm/dist/include/llvm/Analysis/CallGraph.h
  vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h
  vendor/llvm/dist/include/llvm/IR/Attributes.h
  vendor/llvm/dist/include/llvm/IR/CFG.h
  vendor/llvm/dist/include/llvm/IR/IntrinsicsX86.td
  vendor/llvm/dist/include/llvm/Target/TargetLowering.h
  vendor/llvm/dist/lib/Analysis/BlockFrequencyInfoImpl.cpp
  vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp
  vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp
  vendor/llvm/dist/lib/Analysis/LoopUnrollAnalyzer.cpp
  vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp
  vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  vendor/llvm/dist/lib/CodeGen/BranchFolding.cpp
  vendor/llvm/dist/lib/CodeGen/SafeStack.cpp
  vendor/llvm/dist/lib/CodeGen/SafeStackColoring.cpp
  vendor/llvm/dist/lib/CodeGen/SafeStackLayout.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  vendor/llvm/dist/lib/CodeGen/TwoAddressInstructionPass.cpp
  vendor/llvm/dist/lib/IR/AttributeImpl.h
  vendor/llvm/dist/lib/IR/AutoUpgrade.cpp
  vendor/llvm/dist/lib/IR/Core.cpp
  vendor/llvm/dist/lib/IR/Metadata.cpp
  vendor/llvm/dist/lib/Support/Triple.cpp
  vendor/llvm/dist/lib/Target/AArch64/AArch64.td
  vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.h
  vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  

svn commit: r304297 - head/sys/modules/dtb/allwinner

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 17:59:09 2016
New Revision: 304297
URL: https://svnweb.freebsd.org/changeset/base/304297

Log:
  Add sun5i-a13-olinuxino to the build.

Modified:
  head/sys/modules/dtb/allwinner/Makefile

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:54:24 2016
(r304296)
+++ head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:59:09 2016
(r304297)
@@ -8,6 +8,7 @@ DTS=\
olimex-a20-som-evb.dts \
olinuxino-lime.dts \
pcduino3.dts \
-   sinovoip-bpi-m3.dts
+   sinovoip-bpi-m3.dts \
+   sun5i-a13-olinuxino.dts
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Nathan Whitehorn



On 08/17/16 10:56, Andriy Gapon wrote:

On 17/08/2016 19:36, Nathan Whitehorn wrote:

OK, so then what is the solution here? We have a number of tools that need to
know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to
have a consistent set of defaults -- for example, to use 4K across the board,
which I think is a good idea -- there should be a central place to set this that
does not involve hacking a variety of independent tools. Do you disagree?

I don't care how that happens. It happens that the way we currently encode this
is geom stripesize. If we feel like we can't get this right in drivers, then we
should provide a tunable to set a minimum default alignment. You could implement
this in lots of different ways. But having static values hardcoded in random
places that makes similar tools (sade, gpart) behave inconsistently cannot
possibly be the answer.

This is my point, from beginning to end. Is there any reason -- at all -- that
we should prefer per-tool one-off changes to fixing the central mechanism we
already have to give consistent results that we think are reliable?

It would be perfect to get a correct description of a disk and to do that in
central place.  But still I, as a user / administrator, want to be able to
_force_ the alignment that I want when I partition a disk, create a filesystem,
etc.  That is, even if the kernel reports the perfectly correct information and
the tools know how to automatically do what's best for me, I still want to eb
able to override.  And I think that installers and administrative tools should
provide a way to do that.  And many already do, e.g. 'gpart add -a X'.
So, I do not see how striving for the better disk detection (in a central place)
and having more knobs in the administration tools are mutually exclusive or
conflicting goals.

Just my two bits.
Agreed 100%. The issue here is that this kind of patch unconditionally 
overrides the kernel in an unsettable way. I think the right scheme is:

1. Try to get the real values as much as possible.
2. Provide a global hint to all tools that you want some value (e.g. 4K) 
unless the drivers are *sure* it's the wrong answer.

3. Have options in individual tools to force other values.

We have (1), though it can probably be improved, and (3) and just need (2).
-Nathan
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Andriy Gapon
On 17/08/2016 19:36, Nathan Whitehorn wrote:
> OK, so then what is the solution here? We have a number of tools that need to
> know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to
> have a consistent set of defaults -- for example, to use 4K across the board,
> which I think is a good idea -- there should be a central place to set this 
> that
> does not involve hacking a variety of independent tools. Do you disagree?
> 
> I don't care how that happens. It happens that the way we currently encode 
> this
> is geom stripesize. If we feel like we can't get this right in drivers, then 
> we
> should provide a tunable to set a minimum default alignment. You could 
> implement
> this in lots of different ways. But having static values hardcoded in random
> places that makes similar tools (sade, gpart) behave inconsistently cannot
> possibly be the answer.
> 
> This is my point, from beginning to end. Is there any reason -- at all -- that
> we should prefer per-tool one-off changes to fixing the central mechanism we
> already have to give consistent results that we think are reliable?

It would be perfect to get a correct description of a disk and to do that in
central place.  But still I, as a user / administrator, want to be able to
_force_ the alignment that I want when I partition a disk, create a filesystem,
etc.  That is, even if the kernel reports the perfectly correct information and
the tools know how to automatically do what's best for me, I still want to eb
able to override.  And I think that installers and administrative tools should
provide a way to do that.  And many already do, e.g. 'gpart add -a X'.
So, I do not see how striving for the better disk detection (in a central place)
and having more knobs in the administration tools are mutually exclusive or
conflicting goals.

Just my two bits.
-- 
Andriy Gapon
___
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: r304296 - stable/11

2016-08-17 Thread Li-Wen Hsu
Author: lwhsu (ports committer)
Date: Wed Aug 17 17:54:24 2016
New Revision: 304296
URL: https://svnweb.freebsd.org/changeset/base/304296

Log:
  MFC 303935
  
  Only remove empty directories before packaging.
  
  This preserves files are intentionally empty, most of them are in tests.txz
  
  Reviewed by:  bdrewery

Modified:
  stable/11/Makefile.inc1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/Makefile.inc1
==
--- stable/11/Makefile.inc1 Wed Aug 17 16:56:20 2016(r304295)
+++ stable/11/Makefile.inc1 Wed Aug 17 17:54:24 2016(r304296)
@@ -1011,7 +1011,7 @@ distributeworld installworld stageworld:
${IMAKEENV} rm -rf ${INSTALLTMP}
 .if make(distributeworld)
 .for dist in ${EXTRA_DISTRIBUTIONS}
-   find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete
+   find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
 .endfor
 .if defined(NO_ROOT)
 .for dist in base ${EXTRA_DISTRIBUTIONS}
___
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: r304295 - head/usr.bin/netstat

2016-08-17 Thread Michael Tuexen
Author: tuexen
Date: Wed Aug 17 16:56:20 2016
New Revision: 304295
URL: https://svnweb.freebsd.org/changeset/base/304295

Log:
  Fix the output for scope statistics.
  
  MFC after: 3 days

Modified:
  head/usr.bin/netstat/inet6.c

Modified: head/usr.bin/netstat/inet6.c
==
--- head/usr.bin/netstat/inet6.cWed Aug 17 15:50:56 2016
(r304294)
+++ head/usr.bin/netstat/inet6.cWed Aug 17 16:56:20 2016
(r304295)
@@ -488,8 +488,8 @@ ip6_stats(u_long off, const char *name, 
  "{N:/global%s}\n");\
break;\
default:\
-   xo_emit("\t\t{qke:name/%x}{:count/%ju} " \
-   "addresses scope=%x\n",\
+   xo_emit("\t\t{qke:name/%#x}{:count/%ju} " \
+   "{N:/addresses scope=%#x}\n",\
i, (uintmax_t)ip6stat.s, i);   \
}\
} while (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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Nathan Whitehorn



On 08/17/16 08:57, Warner Losh wrote:

On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn
 wrote:

Not true at all. All modern disks report their physical sector size, as
distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses
that.

You are correct that there are two fields in the ATA IDENTIFY. However,
you are incorrect in thinking that all modern disks report their actual
physical sector size instead of a 'compatibility' number. We have dozens
of quirks and are adding them at the rate of a couple a month to make the
current imperfect magic happen.


There is also a small quirks table for some older spinning disks and a
few SSDs that lie and mostly hasn't needed additions in quite some time.
camcontrol identify correctly reports 4096 for the physical sector size on 5
different random AF-512e disks I just checked (some of those are also,
redundantly, in the quirks table). Since this seems to have become the
standard, I can't imagine that the quirks table would need to grow much in
the future for this issue.

Any yet the table continues to grow. As someone who evaluates disks for a large
streaming media company, you cannot begin to imagine the number of things
that vendors get wrong... Life would be so much easier if you could actually
trust vendors to report things correctly in their ATA IDENTIFY command.
SCSI is better, but still not perfect.

You should really listen to people that have been on the front line here.
CAM does a decent job of getting things right. It isn't perfect and can never
be perfect. Expecting it to magically change to be perfect is unreasonable
and will literally never happen.

Warner



OK, so then what is the solution here? We have a number of tools that 
need to know this information: gpart, sade, bsdinstall, zfs, graid, etc. 
If we want to have a consistent set of defaults -- for example, to use 
4K across the board, which I think is a good idea -- there should be a 
central place to set this that does not involve hacking a variety of 
independent tools. Do you disagree?


I don't care how that happens. It happens that the way we currently 
encode this is geom stripesize. If we feel like we can't get this right 
in drivers, then we should provide a tunable to set a minimum default 
alignment. You could implement this in lots of different ways. But 
having static values hardcoded in random places that makes similar tools 
(sade, gpart) behave inconsistently cannot possibly be the answer.


This is my point, from beginning to end. Is there any reason -- at all 
-- that we should prefer per-tool one-off changes to fixing the central 
mechanism we already have to give consistent results that we think are 
reliable?

-Nathan

___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Nathan Whitehorn



On 08/17/16 08:45, Dag-Erling Smørgrav wrote:

Nathan Whitehorn  writes:

Dag-Erling Smørgrav  writes:

I have mentioned several examples to you, and even told you how to
confirm, by inspecting the source code, that most drivers do *not*
set the stripe size.

Most drivers? Yes, sure. Most drivers that people use? No.

Every.  Single.  Dell.  Server.

Probably every single HP server as well, I haven't checked.

VirtualBox gets it wrong.  Xen gets it wrong.  I believe KVM (including
RHEV) and VMWare get it wrong too, but haven't been able to verify.

I guess those aren't important to you?

DES


OK. In which configurations? My Dell servers, for instance, don't do 
this. How are they set up? What drivers are being used? Is this 
something that affects passthrough disks, RAIDs, disk images?


The point is that *if the reported stripe size is wrong*, more things 
than partition alignment in the installer will suffer for it. Fixing the 
installer with a bandaid in the run-up to a release is fine, but *we 
need to fix the underlying problem*.

-Nathan
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Warner Losh
On Wed, Aug 17, 2016 at 10:04 AM, Warner Losh  wrote:
> On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Smørgrav  wrote:
>> Nathan Whitehorn  writes:
>>> Dag-Erling Smørgrav  writes:
>>> > I have mentioned several examples to you, and even told you how to
>>> > confirm, by inspecting the source code, that most drivers do *not*
>>> > set the stripe size.
>>> Most drivers? Yes, sure. Most drivers that people use? No.
>>
>> Every.  Single.  Dell.  Server.
>>
>> Probably every single HP server as well, I haven't checked.
>>
>> VirtualBox gets it wrong.  Xen gets it wrong.  I believe KVM (including
>> RHEV) and VMWare get it wrong too, but haven't been able to verify.
>>
>> I guess those aren't important to you?
>
> Also, SD cards get it wrong. It is reported, true enough, but it is often
> wrong in the sense it can be suboptimal. Different SD cards report
> different things for the number of sectors to erase at a time. Some
> vendors do an excellent job of reporting the optimal amount. Others
> do not (often because

[stupid gmail]

often because they copy from last year's design. I've had to override
the reported size numerous times to get decent performance from
SD cards in the past. Almost all of the recent embedded boards
that FreeBSD supports use SD cards. While we provide images
to just boot off of, there are several designs that have both a SD
card and an embedded eMMC or similar card that we should be
able to run the installer on.

Warner
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Warner Losh
On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Smørgrav  wrote:
> Nathan Whitehorn  writes:
>> Dag-Erling Smørgrav  writes:
>> > I have mentioned several examples to you, and even told you how to
>> > confirm, by inspecting the source code, that most drivers do *not*
>> > set the stripe size.
>> Most drivers? Yes, sure. Most drivers that people use? No.
>
> Every.  Single.  Dell.  Server.
>
> Probably every single HP server as well, I haven't checked.
>
> VirtualBox gets it wrong.  Xen gets it wrong.  I believe KVM (including
> RHEV) and VMWare get it wrong too, but haven't been able to verify.
>
> I guess those aren't important to you?

Also, SD cards get it wrong. It is reported, true enough, but it is often
wrong in the sense it can be suboptimal. Different SD cards report
different things for the number of sectors to erase at a time. Some
vendors do an excellent job of reporting the optimal amount. Others
do not (often because the

Warner
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Warner Losh
On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn
 wrote:
> Not true at all. All modern disks report their physical sector size, as
> distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses
> that.

You are correct that there are two fields in the ATA IDENTIFY. However,
you are incorrect in thinking that all modern disks report their actual
physical sector size instead of a 'compatibility' number. We have dozens
of quirks and are adding them at the rate of a couple a month to make the
current imperfect magic happen.

> There is also a small quirks table for some older spinning disks and a
> few SSDs that lie and mostly hasn't needed additions in quite some time.
> camcontrol identify correctly reports 4096 for the physical sector size on 5
> different random AF-512e disks I just checked (some of those are also,
> redundantly, in the quirks table). Since this seems to have become the
> standard, I can't imagine that the quirks table would need to grow much in
> the future for this issue.

Any yet the table continues to grow. As someone who evaluates disks for a large
streaming media company, you cannot begin to imagine the number of things
that vendors get wrong... Life would be so much easier if you could actually
trust vendors to report things correctly in their ATA IDENTIFY command.
SCSI is better, but still not perfect.

You should really listen to people that have been on the front line here.
CAM does a decent job of getting things right. It isn't perfect and can never
be perfect. Expecting it to magically change to be perfect is unreasonable
and will literally never happen.

Warner
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Warner Losh
On Wed, Aug 17, 2016 at 8:36 AM, Nathan Whitehorn
 wrote:

> As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as
> I'm sure you know, and you will find all the code that handles this there.

There's at least a dozen disk drivers that aren't CAM.

The code in CAM that handles this is, at best, a set of heuristics
that can and does get it wrong.

These two facts alone severely undermine your argument.

Warner
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Dag-Erling Smørgrav
Nathan Whitehorn  writes:
> Dag-Erling Smørgrav  writes:
> > I have mentioned several examples to you, and even told you how to
> > confirm, by inspecting the source code, that most drivers do *not*
> > set the stripe size.
> Most drivers? Yes, sure. Most drivers that people use? No.

Every.  Single.  Dell.  Server.

Probably every single HP server as well, I haven't checked.

VirtualBox gets it wrong.  Xen gets it wrong.  I believe KVM (including
RHEV) and VMWare get it wrong too, but haven't been able to verify.

I guess those aren't important to you?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Dag-Erling Smørgrav
Hans Petter Selasky  writes:
> My intention is not to install FreeBSD on a 3K disk. My question is
> pure mathematical, if the bsdinstall will segfault, division by zero
> or anything like that, if one should try to install FreeBSD on a 3K
> disk, because you round up the size of the disk to be bigger than it
> actually is.

The code in question computes the offset and size of the largest block
of contiguous free space on a disk that already has a partition table.
If you even got this far, it would round the offset up to 4096 and the
size down by and equivalent amount and you'd get an error box saying "No
free space left on device".

Say you have a 3584-byte provider with 512-byte sectors formatted with
MBR, leaving 3072 bytes (6 sectors) free at offset 512 (1); stripe size
is unreported and is arbitrarily set to the smallest common multiple of
512 and 4096, which is 4096; misalignment is 512 % 4096 == 512 bytes;
adjustment is (4096 - 512) / 512 == 7 sectors; adjusted offset is 8
sectors, adjusted size is -1 sectors which the caller rejects (and yes,
the variables are unsigned and the check is for <= 0, not == 0, so
everything works as intended).

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Nathan Whitehorn



On 08/17/16 08:03, Dag-Erling Smørgrav wrote:

Nathan Whitehorn  writes:

Dag-Erling Smørgrav  writes:

[...]  And you keep refusing to address the fact that most drivers
don't report a stripe size, except by repeating your claim that they
do, with no evidence to back it up.  Feel free to 'grep -r
stripesize /usr/src/sys/dev'.  Go on, I'll wait.

And yet, if you look at the GEOM XML, it is reported and there. And,
look, it's even right for the AF 512e disks in my machine!

Yes, that is one of the few cases where we get it right, as previously
mentioned.  But it only works because it's known to us (listed in the
quirk table) and directly attached.  If you replace that drive with a
brand new one a year from now, you have no guarantee that the new drive
will be recognized as an AF drive.


Not true at all. All modern disks report their physical sector size, as 
distinct from the logical one, in their ATA IDENTIFY data and ata_da.c 
uses that. There is also a small quirks table for some older spinning 
disks and a few SSDs that lie and mostly hasn't needed additions in 
quite some time. camcontrol identify correctly reports 4096 for the 
physical sector size on 5 different random AF-512e disks I just checked 
(some of those are also, redundantly, in the quirks table). Since this 
seems to have become the standard, I can't imagine that the quirks table 
would need to grow much in the future for this issue.





I've literally never seen a case where we don't already do the right
thing here.

The I can only conclude that you have very little real-world experience.
I have mentioned several examples to you, and even told you how to
confirm, by inspecting the source code, that most drivers do *not* set
the stripe size.


Most drivers? Yes, sure. Most drivers that people use? No. And I am 
aware of how to use grep, thanks.





It's correct, as far as I can tell, 100% of the time on all possible
variants of AF disks.

You keep repeating this, as if it somehow proves me wrong.  It doesn't.


One could argue that calling this the "stripesize" is a hack, and I
would agree,

One could, but one would be wrong.

As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev,
as I'm sure you know, and you will find all the code that handles this
there.

Only for directly attached drives, and most drives do not report the
correct physical sector size, which is why we have quirk tables.


Which disks? Your original email said that VMware reports too-small 
values and that there is a bug in the LSI MegaRAID driver. I'm not sure 
which actual drivers those were (e.g. mfid or through CAM), or how they 
were set up (RAID or passthrough), but that's a small list and those 
issues can presumably be fixed. I would be happy to help make those 
changes if you can provide some more information.



We should just fix the driver for whatever weird disk you have in your
machine (what is it, by the way?).

Oh please.  Now you're just being an .


I somehow still don't know what problem, on what hardware, you are 
actually trying to fix. Instead, I get delightful personal invective.


The patch is fine for 11.0. I would like to know what bugs it was 
fixing, so we can fix them more broadly after the release. Is that so 
much to ask?

-Nathan


DES


___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Hans Petter Selasky

On 08/17/16 17:05, Dag-Erling Smørgrav wrote:

Hans Petter Selasky  writes:

Not sure if it is an issue, but what will happen if a magic disk has a
size less than 4K and uses a block size of 512bytes and the disk
alignment gets rounded up to 4K. Will any of logic in this patch fail
or hang?


What is a magic disk, and why would you want to install FreeBSD on a
drive with less than 4096 bytes available?



Hi,

My intention is not to install FreeBSD on a 3K disk. My question is pure 
mathematical, if the bsdinstall will segfault, division by zero or 
anything like that, if one should try to install FreeBSD on a 3K disk, 
because you round up the size of the disk to be bigger than it actually is.


Should there be a check for too small disks in there?

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

svn commit: r304293 - stable/10/sys/net

2016-08-17 Thread Kristof Provost
Author: kp
Date: Wed Aug 17 15:14:21 2016
New Revision: 304293
URL: https://svnweb.freebsd.org/changeset/base/304293

Log:
  MFC r289932, r289940:
  
  PF_ANEQ() macro will in most situations returns TRUE comparing two identical
  IPv4 packets (when it should return FALSE). It happens because PF_ANEQ() 
doesn't
  stop if first 32 bits of IPv4 packets are equal and starts to check next 3*32
  bits (like for IPv6 packet). Those bits containt some garbage and in result
  PF_ANEQ() wrongly returns TRUE.
  
  Fix: Check if packet is of AF_INET type and if it is then compare only first 
32
  bits of data.
  
  PR: 204005
  Submitted by:   Miłosz Kaniewski

Modified:
  stable/10/sys/net/pfvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/pfvar.h
==
--- stable/10/sys/net/pfvar.h   Wed Aug 17 14:44:47 2016(r304292)
+++ stable/10/sys/net/pfvar.h   Wed Aug 17 15:14:21 2016(r304293)
@@ -198,10 +198,11 @@ extern struct rwlock pf_rules_lock;
(a)->addr32[0] == (b)->addr32[0])) \
 
 #define PF_ANEQ(a, b, c) \
-   ((a)->addr32[0] != (b)->addr32[0] || \
+   ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \
+   (c == AF_INET6 && ((a)->addr32[0] != (b)->addr32[0] || \
(a)->addr32[1] != (b)->addr32[1] || \
(a)->addr32[2] != (b)->addr32[2] || \
-   (a)->addr32[3] != (b)->addr32[3]) \
+   (a)->addr32[3] != (b)->addr32[3]))) \
 
 #define PF_AZERO(a, c) \
((c == AF_INET && !(a)->addr32[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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Slawa Olhovchenkov
On Wed, Aug 17, 2016 at 05:00:16PM +0200, Hans Petter Selasky wrote:

> On 08/17/16 16:49, Slawa Olhovchenkov wrote:
> > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote:
> >
> 
> > In long term, prefered aligment is forsing 4k (or may be more):
> > install system on 512b [mirror] disk aligment now may be need required 
> > replace
> > disk to 4k aligment. For more flexsible in future now best chois is 4k
> > or more.
> 
> Hi,
> 
> Not sure if it is an issue, but what will happen if a magic disk has a 
> size less than 4K and uses a block size of 512bytes and the disk 
> alignment gets rounded up to 4K. Will any of logic in this patch fail or 
> hang?

I am not sure about understunding you.
Do you talk about disk total size of 1536 bytes and less?
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Dag-Erling Smørgrav
Hans Petter Selasky  writes:
> Not sure if it is an issue, but what will happen if a magic disk has a
> size less than 4K and uses a block size of 512bytes and the disk
> alignment gets rounded up to 4K. Will any of logic in this patch fail
> or hang?

What is a magic disk, and why would you want to install FreeBSD on a
drive with less than 4096 bytes available?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Nathan Whitehorn



On 08/17/16 07:49, Slawa Olhovchenkov wrote:

On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote:


Your contention that the installer does not make policy decisions is
equally spurious.  The installer makes many policy decisions, including
the disk layout, the size of the swap partition, the name of the pool,
the use of boot environments (which I dislike but am not allowed to
override), the number of filesets and their mountpoints (which I also
dislike and am not allowed to override either), etc.  The Unix
philosophy is to push such decisions up the stack, not down.  The
decision to align partitions on 4096-byte boundaries because we're not
sure of the correct number but know for a fact that using a smaller
number can have a huge impact on performance is the installer's to make.

Those are all things that the operating system does not have defaults
for: there are no tools like, say, gpart or newfs that layout disks in
any even vaguely automated way, and so no tools that would ever have
defaults for, say, the size of a swap partition except for the
installer. As such, the defaults are quite properly in the installer.
This is quite different: there are many tools that care about disk
alignment (say, gpart) and, by default, use the GEOM stripesize. The
installer is, after this patch, overriding what was meant to be a
system-wide default.

My concern is that pushing this into the installer means that newfs,
zfs, gpart, etc., which all look at the GEOM stripesize for preferred
alignment, will still have suboptimal behavior on systems affected by
your patch. If we identified which drivers are reporting the wrong
alignment, we could fix the whole system at a go by changing it there.
As it is, we now have inconsistent default behavior for partitions
between tools (the installer and sade will now use a different alignment
than gpart on whatever systems you were trying to fix here) and between
pre- and post-installation environments.

In long term, prefered aligment is forsing 4k (or may be more):
install system on 512b [mirror] disk aligment now may be need required replace
disk to 4k aligment. For more flexsible in future now best chois is 4k
or more.


For future-proofing in such circumstances, it might be worth expanding 
the vfs.zfs.min_auto_ashift tunable into some global thing that the disk 
drivers (or geom_disk) read to round up the physical sector sizes they 
would otherwise report. That would ensure that gpart, zfs, etc. all 
behave consistently in such cases.

-Nathan

___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Dag-Erling Smørgrav
Nathan Whitehorn  writes:
> Dag-Erling Smørgrav  writes:
> > [...]  And you keep refusing to address the fact that most drivers
> > don't report a stripe size, except by repeating your claim that they
> > do, with no evidence to back it up.  Feel free to 'grep -r
> > stripesize /usr/src/sys/dev'.  Go on, I'll wait.
> And yet, if you look at the GEOM XML, it is reported and there. And,
> look, it's even right for the AF 512e disks in my machine!

Yes, that is one of the few cases where we get it right, as previously
mentioned.  But it only works because it's known to us (listed in the
quirk table) and directly attached.  If you replace that drive with a
brand new one a year from now, you have no guarantee that the new drive
will be recognized as an AF drive.

> I've literally never seen a case where we don't already do the right
> thing here.

The I can only conclude that you have very little real-world experience.
I have mentioned several examples to you, and even told you how to
confirm, by inspecting the source code, that most drivers do *not* set
the stripe size.

> It's correct, as far as I can tell, 100% of the time on all possible
> variants of AF disks.

You keep repeating this, as if it somehow proves me wrong.  It doesn't.

> One could argue that calling this the "stripesize" is a hack, and I
> would agree,

One could, but one would be wrong.

> As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev,
> as I'm sure you know, and you will find all the code that handles this
> there.

Only for directly attached drives, and most drives do not report the
correct physical sector size, which is why we have quirk tables.

> We should just fix the driver for whatever weird disk you have in your
> machine (what is it, by the way?).

Oh please.  Now you're just being an .

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Hans Petter Selasky

On 08/17/16 16:49, Slawa Olhovchenkov wrote:

On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote:




In long term, prefered aligment is forsing 4k (or may be more):
install system on 512b [mirror] disk aligment now may be need required replace
disk to 4k aligment. For more flexsible in future now best chois is 4k
or more.


Hi,

Not sure if it is an issue, but what will happen if a magic disk has a 
size less than 4K and uses a block size of 512bytes and the disk 
alignment gets rounded up to 4K. Will any of logic in this patch fail or 
hang?


--HPS

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


Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Slawa Olhovchenkov
On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote:

> > Your contention that the installer does not make policy decisions is
> > equally spurious.  The installer makes many policy decisions, including
> > the disk layout, the size of the swap partition, the name of the pool,
> > the use of boot environments (which I dislike but am not allowed to
> > override), the number of filesets and their mountpoints (which I also
> > dislike and am not allowed to override either), etc.  The Unix
> > philosophy is to push such decisions up the stack, not down.  The
> > decision to align partitions on 4096-byte boundaries because we're not
> > sure of the correct number but know for a fact that using a smaller
> > number can have a huge impact on performance is the installer's to make.
> 
> Those are all things that the operating system does not have defaults 
> for: there are no tools like, say, gpart or newfs that layout disks in 
> any even vaguely automated way, and so no tools that would ever have 
> defaults for, say, the size of a swap partition except for the 
> installer. As such, the defaults are quite properly in the installer. 
> This is quite different: there are many tools that care about disk 
> alignment (say, gpart) and, by default, use the GEOM stripesize. The 
> installer is, after this patch, overriding what was meant to be a 
> system-wide default.
> 
> My concern is that pushing this into the installer means that newfs, 
> zfs, gpart, etc., which all look at the GEOM stripesize for preferred 
> alignment, will still have suboptimal behavior on systems affected by 
> your patch. If we identified which drivers are reporting the wrong 
> alignment, we could fix the whole system at a go by changing it there. 
> As it is, we now have inconsistent default behavior for partitions 
> between tools (the installer and sade will now use a different alignment 
> than gpart on whatever systems you were trying to fix here) and between 
> pre- and post-installation environments.

In long term, prefered aligment is forsing 4k (or may be more):
install system on 512b [mirror] disk aligment now may be need required replace
disk to 4k aligment. For more flexsible in future now best chois is 4k
or more.
___
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: r304292 - head/usr.bin/netstat

2016-08-17 Thread Michael Tuexen
Author: tuexen
Date: Wed Aug 17 14:44:47 2016
New Revision: 304292
URL: https://svnweb.freebsd.org/changeset/base/304292

Log:
  Use names for SCTP and UDPLite when reporting the input histogram.
  
  MFC after: 3 days

Modified:
  head/usr.bin/netstat/inet6.c

Modified: head/usr.bin/netstat/inet6.c
==
--- head/usr.bin/netstat/inet6.cWed Aug 17 13:19:28 2016
(r304291)
+++ head/usr.bin/netstat/inet6.cWed Aug 17 14:44:47 2016
(r304292)
@@ -207,11 +207,11 @@ staticconst char *ip6nh[] = {
"#129",
"#130",
"#131",
-   "#132",
+   "SCTP",
"#133",
"#134",
"#135",
-   "#136",
+   "UDPLite",
"#137",
"#138",
"#139",
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Nathan Whitehorn



On 08/17/16 03:07, Dag-Erling Smørgrav wrote:

Nathan Whitehorn  writes:

As a note for people who weren't paying attention to the bug, we need
to fix this in a better way outside of the constraints of getting 11.0
out the door. The system (gpart, the installer, ZFS, etc.) uses the
reported GEOM stripesize for partition alignment and IO block size
selection. If that is wrong, we should identify devices on which it is
wrong and fix them, and maybe also add some global tunable that sets a
floor on the numbers reported by GEOM_DISK. Hacking the installer like
this is triage, which is fine, but not viable as a permanent solution
to anything.

Modifying GEOM to report a bogus number when none is provided by the
lower layer(s) is absolutely not going to happen.  You have absolutely
no idea what your proposed change will break.  And you keep refusing to
address the fact that most drivers don't report a stripe size, except by
repeating your claim that they do, with no evidence to back it up.  Feel
free to 'grep -r stripesize /usr/src/sys/dev'.  Go on, I'll wait.


And yet, if you look at the GEOM XML, it is reported and there. And, 
look, it's even right for the AF 512e disks in my machine!


  512
  4096

I've literally never seen a case where we don't already do the right 
thing here. The GEOM stripesize is, whether you like it or not, the way 
we have long ago decided to communicate the information about optimal 
alignment from the disk drivers to userland. We do a good job of it, 
too. It's correct, as far as I can tell, 100% of the time on all 
possible variants of AF disks. One could argue that calling this the 
"stripesize" is a hack, and I would agree, but it's what the operating 
system does and has done for many years.


As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, 
as I'm sure you know, and you will find all the code that handles this 
there.



Your contention that the installer does not make policy decisions is
equally spurious.  The installer makes many policy decisions, including
the disk layout, the size of the swap partition, the name of the pool,
the use of boot environments (which I dislike but am not allowed to
override), the number of filesets and their mountpoints (which I also
dislike and am not allowed to override either), etc.  The Unix
philosophy is to push such decisions up the stack, not down.  The
decision to align partitions on 4096-byte boundaries because we're not
sure of the correct number but know for a fact that using a smaller
number can have a huge impact on performance is the installer's to make.


Those are all things that the operating system does not have defaults 
for: there are no tools like, say, gpart or newfs that layout disks in 
any even vaguely automated way, and so no tools that would ever have 
defaults for, say, the size of a swap partition except for the 
installer. As such, the defaults are quite properly in the installer. 
This is quite different: there are many tools that care about disk 
alignment (say, gpart) and, by default, use the GEOM stripesize. The 
installer is, after this patch, overriding what was meant to be a 
system-wide default.


My concern is that pushing this into the installer means that newfs, 
zfs, gpart, etc., which all look at the GEOM stripesize for preferred 
alignment, will still have suboptimal behavior on systems affected by 
your patch. If we identified which drivers are reporting the wrong 
alignment, we could fix the whole system at a go by changing it there. 
As it is, we now have inconsistent default behavior for partitions 
between tools (the installer and sade will now use a different alignment 
than gpart on whatever systems you were trying to fix here) and between 
pre- and post-installation environments.


You are papering over a bug in some unspecified driver with some 
unspecified disks by hacking the installer. This is fine as an expedient 
for 11.0, but is a ridiculous solution to the problem otherwise. We 
should just fix the driver for whatever weird disk you have in your 
machine (what is it, by the way?). Since making the reported "stripe 
size" match the physical sector size is what GEOM has done since at 
least 2009, I doubt very much that fixing any bugs in that reported 
value would have the weird unintended consequences you imply it might.

-Nathan



DES


___
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: r304291 - head/sys/boot/fdt/dts/arm

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 13:19:28 2016
New Revision: 304291
URL: https://svnweb.freebsd.org/changeset/base/304291

Log:
  Remove pullup settings for MMC pins, this is not needed since r304290
  
  MFC after:1 week

Modified:
  head/sys/boot/fdt/dts/arm/bananapi.dts

Modified: head/sys/boot/fdt/dts/arm/bananapi.dts
==
--- head/sys/boot/fdt/dts/arm/bananapi.dts  Wed Aug 17 13:09:31 2016
(r304290)
+++ head/sys/boot/fdt/dts/arm/bananapi.dts  Wed Aug 17 13:19:28 2016
(r304291)
@@ -41,7 +41,3 @@
};
};
 };
-
-_pins_a {
-   allwinner,pull = ;
-};
___
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: r304290 - head/sys/arm/allwinner

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 13:09:31 2016
New Revision: 304290
URL: https://svnweb.freebsd.org/changeset/base/304290

Log:
  Only set pud settings if this is a pullup or pulldown configuration.
  This removes the need to set the MMC pins with pullups in our DTS.
  Thanks to jmcneill@ for spotting this.
  
  Tested on Orange Pi One (Allwinner H3).
  
  MFC after:1 week

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

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Wed Aug 17 10:20:36 2016
(r304289)
+++ head/sys/arm/allwinner/a10_gpio.c   Wed Aug 17 13:09:31 2016
(r304290)
@@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #if defined(__aarch64__)
 #include "opt_soc.h"
 #endif
@@ -599,7 +601,9 @@ aw_fdt_configure_pins(device_t dev, phan
a10_gpio_set_function(sc, pin_num, pin_func);
if (a10_gpio_get_drv(sc, pin_num) != pin_drive)
a10_gpio_set_drv(sc, pin_num, pin_drive);
-   if (a10_gpio_get_pud(sc, pin_num) != pin_pull)
+   if (a10_gpio_get_pud(sc, pin_num) != pin_pull &&
+   (pin_pull == SUN4I_PINCTRL_PULL_UP ||
+   pin_pull == SUN4I_PINCTRL_PULL_DOWN))
a10_gpio_set_pud(sc, pin_num, pin_pull);
A10_GPIO_UNLOCK(sc);
}
___
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: r304180 - head/sys/ufs/ffs

2016-08-17 Thread Bruce Evans

On Wed, 17 Aug 2016, Konstantin Belousov wrote:


On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote:

Hmm, some people interpret POSIX differently than I do, but I think it
is clear that XBD 3.384 Synchronized I/O Data Integrity Completion
requires the indirect blocks to be written (because "all file system
information required to retrieve the data is successfully transferred").
The Linux man page matches this interpretation except that an fsync of
the parent directory may be required.


All related directories must be synced.  It is almost useless to sync
the data if the data cannot be found later using normal file system
operations.  Not quite useless if the file can be recovered by fsck
and saved in lost+found, but the metadata needed to guarantee that
that works probably requires a lot of writes anyway.


If the whole file is being considered, then any change to indirect
blocks is needed to access some data (because the file was extended, a
hole was filled or snapshotted data was overwritten). For other
overwrites, there is no change to indirect blocks and no conflict with
fdatasync's performance objectives.

Note that the same argument is applicable to the inode block:  the di_db
and di_ib pointers to the direct blocks and to root indirect blocks are
required to retrieve the written data.


I would never have guessed that you left out either.


...


Ideally, a changed i_size would also cause the inode to be written, but
I don't know how to determine that (there is no i_flag for it). Always
writing the inode would defeat the point of fdatasync.


My version does a bcmp() of the in-core copy with the disk copy to avoid
null changes.  This turned out to be not very useful.  It was intended
mainly to avoid writing null changes for timestamps.  By I already
avoid most timestamp changes by mounting with -noatime and not having
large data.  I use only seconds granularity for timestamps.  With
nanoseconds granularity, any change to a file is guaranteed to change
its in-core inode, so the bcmp() wouldn't work.  But timestamps are about
the only metadata that obviously doesn't need syncing.  Especially atimes.
POSIX doesn't allow turning off atimes, but it also doesn't require
syncing them before the system crashes except probably using FSYNC of
metadata.

There is an i_flag for critical metadata like i_size.  It is IN_MODIFIED.
This flag is often mismanaged.  Many places set only IN_CHANGE after making
a critical change.  ufs_chown() is one such place.  Ownerships are fairly
critical metadata.  They are not considered critical enough to sync
immediately, but they should be synced by FSYNC of metadata.  But the
implementation is to set only IN_CHANGE.  i_ctime is usually updated much
later and IN_MODIFIED is set then to say that the relatively unimportant
i_ctime has been modified.  This inhibits the optimization of syncing for
chown() but not syncing for ctime changes.


Which was my reasoning behind omitting the indirect block flushing.
There is no practical difference between inode block and indirect blocks
for metadata consistency.


Ugh.


Note that the affected case is only the async mounts (not sync mounts,
not any variants of softdeps).


I fixed the non-syncing of inodes for the async mount case ~15 years ago
in my version, and finally merged the changes to my version of -current
a few months OK.  It was stupid that ordinary fsync() synced the indirect
blocks but not the more important inode.  Directory metadata is still not
synced by fsync() in the async mount case.


I can restore indirect block flushing and wait for them for DATA_ONLY sync,
but then I should also add ffs_update() call.


Here are my ffs fixes for -current.  The are mostly to sprinkle missing
DOINGASYNC() checks and finally fix ffs_update():

X Index: ffs/ffs_balloc.c
X ===
X --- ffs/ffs_balloc.c  (revision 304069)
X +++ ffs/ffs_balloc.c  (working copy)
X @@ -155,4 +155,6 @@
X   if (flags & IO_SYNC)
X   bwrite(bp);
X + else if (DOINGASYNC(vp))
X + bdwrite(bp);
X   else
X   bawrite(bp);
X @@ -265,12 +267,10 @@
X   newb, 0, fs->fs_bsize, 0, bp);
X   bdwrite(bp);
X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) {
X + if (bp->b_bufsize == fs->fs_bsize)
X + bp->b_flags |= B_CLUSTEROK;
X + bdwrite(bp);

This restructures the code a little to fix the DOINGASYNC() check.  IO_SYNC
was not checked.

X   } else {
X - /*
X -  * Write synchronously so that indirect blocks
X -  * never point at garbage.
X -  */
X - if (DOINGASYNC(vp))
X - bdwrite(bp);
X -  

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

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 10:20:36 2016
New Revision: 304289
URL: https://svnweb.freebsd.org/changeset/base/304289

Log:
  a10_gpio_get_function now returns the whole function not only
  GPIO_INPUT/GPIO_OUTPUT.
  a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP.
  Add a10_gpio_get_drv to get the current drive strenght.
  During fdt pin configure, avoid setting function/drive/pud if it's already in
  the correct value.
  
  Tested on Allwinner H3 and A20
  
  MFC after:1 week

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

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Wed Aug 17 10:20:05 2016
(r304288)
+++ head/sys/arm/allwinner/a10_gpio.c   Wed Aug 17 10:20:36 2016
(r304289)
@@ -210,14 +210,8 @@ a10_gpio_get_function(struct a10_gpio_so
offset = ((pin & 0x07) << 2);
 
func = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3));
-   switch ((func >> offset) & 0x7) {
-   case A10_GPIO_INPUT:
-   return (GPIO_PIN_INPUT);
-   case A10_GPIO_OUTPUT:
-   return (GPIO_PIN_OUTPUT);
-   }
 
-   return (0);
+   return ((func >> offset) & 0x7);
 }
 
 static int
@@ -257,14 +251,8 @@ a10_gpio_get_pud(struct a10_gpio_softc *
offset = ((pin & 0x0f) << 1);
 
val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4));
-   switch ((val >> offset) & 0x3) {
-   case A10_GPIO_PULLDOWN:
-   return (GPIO_PIN_PULLDOWN);
-   case A10_GPIO_PULLUP:
-   return (GPIO_PIN_PULLUP);
-   }
 
-   return (0);
+   return ((val >> offset) & AW_GPIO_PUD_MASK);
 }
 
 static void
@@ -285,6 +273,23 @@ a10_gpio_set_pud(struct a10_gpio_softc *
A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pin >> 4), val);
 }
 
+static uint32_t
+a10_gpio_get_drv(struct a10_gpio_softc *sc, uint32_t pin)
+{
+   uint32_t bank, offset, val;
+
+   /* Must be called with lock held. */
+   A10_GPIO_LOCK_ASSERT(sc);
+
+   bank = sc->padconf->pins[pin].port;
+   pin = sc->padconf->pins[pin].pin;
+   offset = ((pin & 0x0f) << 1);
+
+   val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4));
+
+   return ((val >> offset) & AW_GPIO_DRV_MASK);
+}
+
 static void
 a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive)
 {
@@ -373,14 +378,39 @@ static int
 a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags)
 {
struct a10_gpio_softc *sc;
+   uint32_t func;
+   uint32_t pud;
 
sc = device_get_softc(dev);
if (pin >= sc->padconf->npins)
return (EINVAL);
 
A10_GPIO_LOCK(sc);
-   *flags = a10_gpio_get_function(sc, pin);
-   *flags |= a10_gpio_get_pud(sc, pin);
+   func = a10_gpio_get_function(sc, pin);
+   switch (func) {
+   case A10_GPIO_INPUT:
+   *flags = GPIO_PIN_INPUT;
+   break;
+   case A10_GPIO_OUTPUT:
+   *flags = GPIO_PIN_OUTPUT;
+   break;
+   default:
+   *flags = 0;
+   break;
+   }
+
+   pud = a10_gpio_get_pud(sc, pin);
+   switch (pud) {
+   case A10_GPIO_PULLDOWN:
+   *flags |= GPIO_PIN_PULLDOWN;
+   break;
+   case A10_GPIO_PULLUP:
+   *flags |= GPIO_PIN_PULLUP;
+   break;
+   default:
+   break;
+   }
+
A10_GPIO_UNLOCK(sc);
 
return (0);
@@ -564,9 +594,13 @@ aw_fdt_configure_pins(device_t dev, phan
}
 
A10_GPIO_LOCK(sc);
-   a10_gpio_set_function(sc, pin_num, pin_func);
-   a10_gpio_set_drv(sc, pin_num, pin_drive);
-   a10_gpio_set_pud(sc, pin_num, pin_pull);
+
+   if (a10_gpio_get_function(sc, pin_num) != pin_func)
+   a10_gpio_set_function(sc, pin_num, pin_func);
+   if (a10_gpio_get_drv(sc, pin_num) != pin_drive)
+   a10_gpio_set_drv(sc, pin_num, pin_drive);
+   if (a10_gpio_get_pud(sc, pin_num) != pin_pull)
+   a10_gpio_set_pud(sc, pin_num, pin_pull);
A10_GPIO_UNLOCK(sc);
}
 
___
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: r304288 - in head: lib/libc/sys sys/kern

2016-08-17 Thread Bryan Drewery
Author: bdrewery
Date: Wed Aug 17 10:20:05 2016
New Revision: 304288
URL: https://svnweb.freebsd.org/changeset/base/304288

Log:
  Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318.
  
  This has no real impact on the resulting libc.so file.
  
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/sys/Symbol.map
  head/sys/kern/capabilities.conf

Modified: head/lib/libc/sys/Symbol.map
==
--- head/lib/libc/sys/Symbol.mapWed Aug 17 10:16:42 2016
(r304287)
+++ head/lib/libc/sys/Symbol.mapWed Aug 17 10:20:05 2016
(r304288)
@@ -34,9 +34,7 @@ FBSD_1.0 {
__setugid;
__syscall;
__sysctl;
-   _umtx_lock;
_umtx_op;
-   _umtx_unlock;
abort2;
accept;
access;
@@ -459,12 +457,8 @@ FBSDprivate_1.0 {
__sys___syscall;
___sysctl;
__sys___sysctl;
-   __umtx_lock;
-   __sys__umtx_lock;
__umtx_op;
__sys__umtx_op;
-   __umtx_unlock;
-   __sys__umtx_unlock;
_abort2;
__sys_abort2;
_accept;

Modified: head/sys/kern/capabilities.conf
==
--- head/sys/kern/capabilities.conf Wed Aug 17 10:16:42 2016
(r304287)
+++ head/sys/kern/capabilities.conf Wed Aug 17 10:20:05 2016
(r304288)
@@ -64,9 +64,7 @@ __sysctl
 ##
 ## XXRW: Need to check this very carefully.
 ##
-_umtx_lock
 _umtx_op
-_umtx_unlock
 
 ##
 ## Allow process termination using abort2(2).
___
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: r304287 - head/lib/libc/sys

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 10:16:42 2016
New Revision: 304287
URL: https://svnweb.freebsd.org/changeset/base/304287

Log:
  Add fdatasync(2) man page, combined with fsync(2).
  
  Reviewed by:  emaste, rpokala, wblock
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D7522

Modified:
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/fsync.2

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Wed Aug 17 10:14:22 2016
(r304286)
+++ head/lib/libc/sys/Makefile.inc  Wed Aug 17 10:16:42 2016
(r304287)
@@ -366,6 +366,7 @@ MLINKS+=ffclock.2 ffclock_getcounter.2 \
ffclock.2 ffclock_getestimate.2 \
ffclock.2 ffclock_setestimate.2
 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
+MLINKS+=fsync.2 fdatasync.2
 MLINKS+=getdirentries.2 getdents.2
 MLINKS+=getfh.2 lgetfh.2
 MLINKS+=getgid.2 getegid.2

Modified: head/lib/libc/sys/fsync.2
==
--- head/lib/libc/sys/fsync.2   Wed Aug 17 10:14:22 2016(r304286)
+++ head/lib/libc/sys/fsync.2   Wed Aug 17 10:16:42 2016(r304287)
@@ -1,5 +1,11 @@
 .\" Copyright (c) 1983, 1993
 .\"The Regents of the University of California.  All rights reserved.
+.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Parts of this documentation were written by
+.\" Konstantin Belousov  under sponsorship
+.\" from the FreeBSD Foundation.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -28,40 +34,65 @@
 .\" @(#)fsync.28.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd August 17, 2016
 .Dt FSYNC 2
 .Os
 .Sh NAME
-.Nm fsync
+.Nm fdatasync, fsync
 .Nd "synchronise changes to a file"
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
 .In unistd.h
 .Ft int
+.Fn fdatasync "int fd"
+.Ft int
 .Fn fsync "int fd"
 .Sh DESCRIPTION
 The
 .Fn fsync
 system call
-causes all modified data and attributes of
+causes all modified data and attributes of the file referenced by
+the file descriptor
 .Fa fd
 to be moved to a permanent storage device.
 This normally results in all in-core modified copies
 of buffers for the associated file to be written to a disk.
 .Pp
 The
+.Fn fdatasync
+system call causes all modified data of
+.Fa fd
+to be moved to a permanent storage device.
+Unlike
+.Fn fsync ,
+the system call does not guarantee that file attributes or
+metadata necessary to access the file are committed to the permanent storage.
+.Pp
+The
 .Fn fsync
 system call
 should be used by programs that require a file to be
 in a known state, for example, in building a simple transaction
 facility.
+If the file metadata has already been committed, using
+.Fn fdatasync
+can be more efficient than
+.Fn fsync .
+.Pp
+Both
+.Fn fdatasync
+and
+.Fn fsync
+calls are cancellation points.
 .Sh RETURN VALUES
 .Rv -std fsync
 .Sh ERRORS
 The
 .Fn fsync
-fails if:
+and
+.Fn fdatasync
+calls fail if:
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
@@ -85,3 +116,15 @@ The
 .Fn fsync
 system call appeared in
 .Bx 4.2 .
+The
+.Fn fdatasync
+system call appeared in
+.Fx 12.0
+.Sh BUGS
+The
+.Fn fdatasync
+system call currently does not guarantee that enqueued
+.Xr aio 4
+requests for the file referenced by
+.Fa fd
+are completed before the syscall returns.
___
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: r304286 - head/sys/kern

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 10:14:22 2016
New Revision: 304286
URL: https://svnweb.freebsd.org/changeset/base/304286

Log:
  Remove duplicated code.
  
  aio_aqueue() calls aio_init_aioinfo() as the first action. There is no
  need to duplicate the code in kern_aio_fsync().
  
  Also fix indent for aio_aqueue() definition.
  
  Reviewed by:  jhb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D7523

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Wed Aug 17 09:52:09 2016(r304285)
+++ head/sys/kern/vfs_aio.c Wed Aug 17 10:14:22 2016(r304286)
@@ -1441,7 +1441,7 @@ static struct aiocb_ops aiocb_ops_osigev
  */
 int
 aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj,
-   int type, struct aiocb_ops *ops)
+int type, struct aiocb_ops *ops)
 {
struct proc *p = td->td_proc;
cap_rights_t rights;
@@ -2476,14 +2476,9 @@ static int
 kern_aio_fsync(struct thread *td, int op, struct aiocb *ujob,
 struct aiocb_ops *ops)
 {
-   struct proc *p = td->td_proc;
-   struct kaioinfo *ki;
 
if (op != O_SYNC) /* XXX lack of O_DSYNC */
return (EINVAL);
-   ki = p->p_aioinfo;
-   if (ki == NULL)
-   aio_init_aioinfo(p);
return (aio_aqueue(td, ujob, NULL, LIO_SYNC, ops));
 }
 
___
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: r304142 - head/usr.sbin/bsdinstall/partedit

2016-08-17 Thread Dag-Erling Smørgrav
Nathan Whitehorn  writes:
> As a note for people who weren't paying attention to the bug, we need
> to fix this in a better way outside of the constraints of getting 11.0
> out the door. The system (gpart, the installer, ZFS, etc.) uses the
> reported GEOM stripesize for partition alignment and IO block size
> selection. If that is wrong, we should identify devices on which it is
> wrong and fix them, and maybe also add some global tunable that sets a
> floor on the numbers reported by GEOM_DISK. Hacking the installer like
> this is triage, which is fine, but not viable as a permanent solution
> to anything.

Modifying GEOM to report a bogus number when none is provided by the
lower layer(s) is absolutely not going to happen.  You have absolutely
no idea what your proposed change will break.  And you keep refusing to
address the fact that most drivers don't report a stripe size, except by
repeating your claim that they do, with no evidence to back it up.  Feel
free to 'grep -r stripesize /usr/src/sys/dev'.  Go on, I'll wait.

Your contention that the installer does not make policy decisions is
equally spurious.  The installer makes many policy decisions, including
the disk layout, the size of the swap partition, the name of the pool,
the use of boot environments (which I dislike but am not allowed to
override), the number of filesets and their mountpoints (which I also
dislike and am not allowed to override either), etc.  The Unix
philosophy is to push such decisions up the stack, not down.  The
decision to align partitions on 4096-byte boundaries because we're not
sure of the correct number but know for a fact that using a smaller
number can have a huge impact on performance is the installer's to make.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r304285 - in head: lib/libc lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/sys lib/libc/x86 lib/libc/x86/sys sys/arm/arm sys/arm/include sys/arm64/a...

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 09:52:09 2016
New Revision: 304285
URL: https://svnweb.freebsd.org/changeset/base/304285

Log:
  Implement userspace gettimeofday(2) with HPET timecounter.
  
  Right now, userspace (fast) gettimeofday(2) on x86 only works for
  RDTSC.  For older machines, like Core2, where RDTSC is not C2/C3
  invariant, and which fall to HPET hardware, this means that the call
  has both the penalty of the syscall and of the uncached hw behind the
  QPI or PCIe connection to the sought bridge.  Nothing can me done
  against the access latency, but the syscall overhead can be removed.
  System already provides mappable /dev/hpetX devices, which gives
  straight access to the HPET registers page.
  
  Add yet another algorithm to the x86 'vdso' timehands. Libc is updated
  to handle both RDTSC and HPET.  For HPET, the index of the hpet device
  to mmap is passed from kernel to userspace, index might be changed and
  libc invalidates its mapping as needed.
  
  Remove cpu_fill_vdso_timehands() KPI, instead require that
  timecounters which can be used from userspace, to provide
  tc_fill_vdso_timehands{,32}() methods.  Merge i386 and amd64
  libc//sys/__vdso_gettc.c into one source file in the new
  libc/x86/sys location.  __vdso_gettc() internal interface is changed
  to move timecounter algorithm detection into the MD code.
  
  Measurements show that RDTSC even with the syscall overhead is faster
  than userspace HPET access.  But still, userspace HPET is three-four
  times faster than syscall HPET on several Core2 and SandyBridge
  machines.
  
  Tested by:Howard Su 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month
  Differential revision:https://reviews.freebsd.org/D7473

Added:
  head/lib/libc/x86/
  head/lib/libc/x86/sys/
  head/lib/libc/x86/sys/Makefile.inc   (contents, props changed)
  head/lib/libc/x86/sys/__vdso_gettc.c
 - copied, changed from r304281, head/lib/libc/i386/sys/__vdso_gettc.c
Deleted:
  head/lib/libc/amd64/sys/__vdso_gettc.c
  head/lib/libc/i386/sys/__vdso_gettc.c
Modified:
  head/lib/libc/Makefile
  head/lib/libc/aarch64/sys/__vdso_gettc.c
  head/lib/libc/amd64/sys/Makefile.inc
  head/lib/libc/arm/sys/__vdso_gettc.c
  head/lib/libc/i386/sys/Makefile.inc
  head/lib/libc/sys/__vdso_gettimeofday.c
  head/lib/libc/sys/trivial-vdso_tc.c
  head/sys/arm/arm/generic_timer.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/include/md_var.h
  head/sys/arm/include/vdso.h
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/include/md_var.h
  head/sys/arm64/include/vdso.h
  head/sys/dev/acpica/acpi_hpet.c
  head/sys/dev/acpica/acpi_hpet.h
  head/sys/kern/kern_tc.c
  head/sys/sys/timetc.h
  head/sys/sys/vdso.h
  head/sys/x86/include/vdso.h
  head/sys/x86/x86/tsc.c

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Wed Aug 17 09:34:56 2016(r304284)
+++ head/lib/libc/Makefile  Wed Aug 17 09:52:09 2016(r304285)
@@ -110,6 +110,9 @@ NOASM=
  ${LIBC_ARCH} == "mips"
 .include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
 .endif
+.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
+.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc"
+.endif
 .if ${MK_NIS} != "no"
 CFLAGS+= -DYP
 .include "${LIBC_SRCTOP}/yp/Makefile.inc"

Modified: head/lib/libc/aarch64/sys/__vdso_gettc.c
==
--- head/lib/libc/aarch64/sys/__vdso_gettc.cWed Aug 17 09:34:56 2016
(r304284)
+++ head/lib/libc/aarch64/sys/__vdso_gettc.cWed Aug 17 09:52:09 2016
(r304285)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include "libc_private.h"
 
 static inline uint64_t
@@ -55,14 +56,15 @@ cp15_cntpct_get(void)
 }
 
 #pragma weak __vdso_gettc
-u_int
-__vdso_gettc(const struct vdso_timehands *th)
+int
+__vdso_gettc(const struct vdso_timehands *th, u_int *tc)
 {
-   uint64_t val;
 
+   if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM)
+   return (ENOSYS);
__asm __volatile("isb" : : : "memory");
-   val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
-   return (val);
+   *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
+   return (0);
 }
 
 #pragma weak __vdso_gettimekeep

Modified: head/lib/libc/amd64/sys/Makefile.inc
==
--- head/lib/libc/amd64/sys/Makefile.incWed Aug 17 09:34:56 2016
(r304284)
+++ head/lib/libc/amd64/sys/Makefile.incWed Aug 17 09:52:09 2016
(r304285)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \
-   amd64_set_gsbase.c __vdso_gettc.c
+   amd64_set_gsbase.c
 
 MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \
sbrk.S setlogin.S sigreturn.S

Modified: 

svn commit: r304284 - stable/11/lib/libc/gen

2016-08-17 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug 17 09:34:56 2016
New Revision: 304284
URL: https://svnweb.freebsd.org/changeset/base/304284

Log:
  MFC r302943,r302944,r303004,r303010,r303011,r303013,r303014,r303074,
  r303088,r303142,r303208,r303210,r303530,r303536,r303564,r303565,
  r303706
  
  In short:
  
  1) All situations with glob(3) error return codes are well defined by
  POSIX, so rewrite old sporadic errors processing to match those
  definitions.
  
  Including subcases:
  
  Both C99 and POSIX directly prohibits any standard function to set errno
  to 0. Breaking this rule in 2001 NetBSD hack was imported which attempts
  to workaround very limited glob(3) return codes amount.
  Use POSIX-compatible workaround now with E2BIG which can't comes from
  other functions used instead of prohibited 0.
  
  Process errors happpens in (*readdirfunc)() too, as POSIX requires.
  
  Per POSIX GLOB_NOCHECK should return original pattern,
  unmodified, if no matches found. But our code strips all '\'
  returning it. Rewrite the code to allow to return original pattern.
  
  GLOB_ERR and gl_errfunc are supposed to work only for real directories
  per POSIX, so don't act on missing or plain files for ENOENT or ENOTDIR
  (as TODO in the code suggested).
  Remove the hack in the manpage describing how to skip ENOENT and ENOTDIR
  in gl_errfunc, it is unneeded now.
  
  Per POSIX GLOB_ERR must be considered even if gl_errfunc is not set,
  old code skips it in that case.
  
  2) For near MAXPATHLEN long pathes old glob(3) code can operate on
  truncated results, prevent it in several places.
  
  3) Results was not sorted according to collate as POSIX requires.
  
  4) globtilde() forget to convert expanded user home dir from multibyte to
  wide chars. Moreover, those chars are addded as not protected, so
  can be treated as special chars.
  
  5) Backward hack for EILSEQ in g_Ctoc() was not implemented, so all
  pathes with illegal byte sequences are skipped as result, implement it now.
  
  6) GLOB_BRACE was somehow broken. First it repeatedly calls glob0() in
  globexp1() recursive calls, but glob0() was not supposed to be called
  repeatedly in the original code. It finalize results by possible adding
  original pattern for no match case, may return GLOB_NOMATCH error and
  by sorting all things. Original pattern adding or GLOB_NOMATCH error
  can happens each time glob0() called repeatedly, and sorting happens
  for one item only, all things are never sorted. Second, f.e. "a{a"
  pattern does not match "a{a" file but match "a" file instead.
  Third, some errors (f.e. for limits or overflow) can be ignored
  by GLOB_BRACE code because it forces return (0).
  
  Add non-finalizing flag to glob0() and make globexp0() wrapper around
  recursively called globexp1() to finalize things like glob0() does.
  Reorganize braces code to work correctly.
  
  7) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING
  (ARG_MAX) limit, use final string length, not malloced space for it.

Modified:
  stable/11/lib/libc/gen/glob.3
  stable/11/lib/libc/gen/glob.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/gen/glob.3
==
--- stable/11/lib/libc/gen/glob.3   Wed Aug 17 09:24:46 2016
(r304283)
+++ stable/11/lib/libc/gen/glob.3   Wed Aug 17 09:34:56 2016
(r304284)
@@ -275,24 +275,10 @@ is
 .Pf non- Dv NULL ,
 .Fn glob
 calls
-.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) .
-This may be unintuitive: a pattern like
-.Ql */Makefile
-will try to
-.Xr stat 2
-.Ql foo/Makefile
-even if
-.Ql foo
-is not a directory, resulting in a
-call to
-.Fa errfunc .
-The error routine can suppress this action by testing for
-.Er ENOENT
-and
-.Er ENOTDIR ;
+.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) ,
 however, the
 .Dv GLOB_ERR
-flag will still cause an immediate
+flag will cause an immediate
 return when this happens.
 .Pp
 If
@@ -377,7 +363,7 @@ file
 .It Dv GLOB_NOSPACE
 An attempt to allocate memory failed, or if
 .Fa errno
-was 0
+was E2BIG,
 .Dv GLOB_LIMIT
 was specified in the flags and
 .Fa pglob\->gl_matchc

Modified: stable/11/lib/libc/gen/glob.c
==
--- stable/11/lib/libc/gen/glob.c   Wed Aug 17 09:24:46 2016
(r304283)
+++ stable/11/lib/libc/gen/glob.c   Wed Aug 17 09:34:56 2016
(r304284)
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
  * 1. Patterns with illegal byte sequences match nothing - even if
  *GLOB_NOCHECK is specified.
  * 2. Illegal byte sequences in filenames are handled by treating them as
- *single-byte characters with a value of the first byte of the sequence
+ *single-byte characters with a values of such bytes of the sequence
  *cast to wchar_t.
  * 3. State-dependent encodings are not currently supported.
  */
@@ -113,25 +113,20 @@ struct glob_limit {
size_t  

svn commit: r304283 - stable/10/sys/netpfil/pf

2016-08-17 Thread Kristof Provost
Author: kp
Date: Wed Aug 17 09:24:46 2016
New Revision: 304283
URL: https://svnweb.freebsd.org/changeset/base/304283

Log:
  MFC r302497:
  
  pf: Map hook returns onto the correct error values
  
  pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers
  expect to get E error codes.
  Map the returns values. A pass is 0 (everything is OK), anything else means
  pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP
  error message.
  
  PR: 207598

Modified:
  stable/10/sys/netpfil/pf/pf_ioctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netpfil/pf/pf_ioctl.c
==
--- stable/10/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:23:40 2016
(r304282)
+++ stable/10/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:24:46 2016
(r304283)
@@ -3554,7 +3554,9 @@ pf_check_in(void *arg, struct mbuf **m, 
*m = NULL;
}
 
-   return (chk);
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 
 static int
@@ -3569,7 +3571,9 @@ pf_check_out(void *arg, struct mbuf **m,
*m = NULL;
}
 
-   return (chk);
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 #endif
 
@@ -3592,7 +3596,9 @@ pf_check6_in(void *arg, struct mbuf **m,
m_freem(*m);
*m = NULL;
}
-   return chk;
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 
 static int
@@ -3608,7 +3614,9 @@ pf_check6_out(void *arg, struct mbuf **m
m_freem(*m);
*m = NULL;
}
-   return chk;
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 #endif /* INET6 */
 
___
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: r304282 - stable/11/sys/netpfil/pf

2016-08-17 Thread Kristof Provost
Author: kp
Date: Wed Aug 17 09:23:40 2016
New Revision: 304282
URL: https://svnweb.freebsd.org/changeset/base/304282

Log:
  MFC r302497:
  
  pf: Map hook returns onto the correct error values
  
  pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers
  expect to get E error codes.
  Map the returns values. A pass is 0 (everything is OK), anything else means
  pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP
  error message.
  
  PR: 207598

Modified:
  stable/11/sys/netpfil/pf/pf_ioctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/pf/pf_ioctl.c
==
--- stable/11/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:21:55 2016
(r304281)
+++ stable/11/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:23:40 2016
(r304282)
@@ -3563,7 +3563,9 @@ pf_check_in(void *arg, struct mbuf **m, 
*m = NULL;
}
 
-   return (chk);
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 
 static int
@@ -3578,7 +3580,9 @@ pf_check_out(void *arg, struct mbuf **m,
*m = NULL;
}
 
-   return (chk);
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 #endif
 
@@ -3601,7 +3605,9 @@ pf_check6_in(void *arg, struct mbuf **m,
m_freem(*m);
*m = NULL;
}
-   return chk;
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 
 static int
@@ -3617,7 +3623,9 @@ pf_check6_out(void *arg, struct mbuf **m
m_freem(*m);
*m = NULL;
}
-   return chk;
+   if (chk != PF_PASS)
+   return (EACCES);
+   return (0);
 }
 #endif /* INET6 */
 
___
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: r304281 - stable/10/sbin/pfctl

2016-08-17 Thread Kristof Provost
Author: kp
Date: Wed Aug 17 09:21:55 2016
New Revision: 304281
URL: https://svnweb.freebsd.org/changeset/base/304281

Log:
  MFC r303663:
  
  pfctl: Allow TOS bits to be cleared
  
  TOS value 0 is valid, so use 256 as an invalid value rather than zero.
  This allows users to enforce TOS == 0 with pf.
  
  Reported by:Radek Krejča 

Modified:
  stable/10/sbin/pfctl/parse.y
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/pfctl/parse.y
==
--- stable/10/sbin/pfctl/parse.yWed Aug 17 09:20:35 2016
(r304280)
+++ stable/10/sbin/pfctl/parse.yWed Aug 17 09:21:55 2016
(r304281)
@@ -3517,8 +3517,8 @@ tos   : STRING{
else if ($1[0] == '0' && $1[1] == 'x')
$$ = strtoul($1, NULL, 16);
else
-   $$ = 0; /* flag bad argument */
-   if (!$$ || $$ > 255) {
+   $$ = 256;   /* flag bad argument */
+   if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
free($1);
YYERROR;
@@ -3527,7 +3527,7 @@ tos   : STRING{
}
| NUMBER{
$$ = $1;
-   if (!$$ || $$ > 255) {
+   if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
YYERROR;
}
___
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: r304280 - stable/11/sbin/pfctl

2016-08-17 Thread Kristof Provost
Author: kp
Date: Wed Aug 17 09:20:35 2016
New Revision: 304280
URL: https://svnweb.freebsd.org/changeset/base/304280

Log:
  MFC r303663:
  
  pfctl: Allow TOS bits to be cleared
  
  TOS value 0 is valid, so use 256 as an invalid value rather than zero.
  This allows users to enforce TOS == 0 with pf.
  
  Reported by:Radek Krejča 

Modified:
  stable/11/sbin/pfctl/parse.y
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/pfctl/parse.y
==
--- stable/11/sbin/pfctl/parse.yWed Aug 17 09:20:04 2016
(r304279)
+++ stable/11/sbin/pfctl/parse.yWed Aug 17 09:20:35 2016
(r304280)
@@ -3593,8 +3593,8 @@ tos   : STRING{
else if ($1[0] == '0' && $1[1] == 'x')
$$ = strtoul($1, NULL, 16);
else
-   $$ = 0; /* flag bad argument */
-   if (!$$ || $$ > 255) {
+   $$ = 256;   /* flag bad argument */
+   if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
free($1);
YYERROR;
@@ -3603,7 +3603,7 @@ tos   : STRING{
}
| NUMBER{
$$ = $1;
-   if (!$$ || $$ > 255) {
+   if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
YYERROR;
}
___
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: r304279 - head/sys/dev/acpica

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 09:20:04 2016
New Revision: 304279
URL: https://svnweb.freebsd.org/changeset/base/304279

Log:
  By default, allow all to read the HPET registers pages.  At the same
  time, by, by default disallow writes to the mmaped HPET pages.
  
  Intent is to allow userspace to use HPET as fast (i.e. no-syscall)
  timecounter for gettimeofday(2).  Unfortunately, the permission model
  does not make it possible to safely unhide /dev/hpet in the jails even
  if default mode is set to 0444, because untrusted jailed root may
  change device permissions to writeable.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 weeks

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

Modified: head/sys/dev/acpica/acpi_hpet.c
==
--- head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:12:02 2016
(r304278)
+++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:20:04 2016
(r304279)
@@ -762,14 +762,14 @@ hpet_attach(device_t dev)
mda.mda_devsw = _cdevsw;
mda.mda_uid = UID_ROOT;
mda.mda_gid = GID_WHEEL;
-   mda.mda_mode = 0600;
+   mda.mda_mode = 0644;
mda.mda_si_drv1 = sc;
error = make_dev_s(, >pdev, "hpet%d", device_get_unit(dev));
if (error == 0) {
sc->mmap_allow = 1;
TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow",
>mmap_allow);
-   sc->mmap_allow_write = 1;
+   sc->mmap_allow_write = 0;
TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write",
>mmap_allow_write);
SYSCTL_ADD_INT(device_get_sysctl_ctx(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: r304278 - stable/11/usr.bin/tr

2016-08-17 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug 17 09:12:02 2016
New Revision: 304278
URL: https://svnweb.freebsd.org/changeset/base/304278

Log:
  MFC r302827
  
  Optimize [Cc]flag case: don't repeatedly add the last character of
  string2 to squeeze cset when string2 reach its EOS state.

Modified:
  stable/11/usr.bin/tr/tr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/tr/tr.c
==
--- stable/11/usr.bin/tr/tr.c   Wed Aug 17 09:10:22 2016(r304277)
+++ stable/11/usr.bin/tr/tr.c   Wed Aug 17 09:12:02 2016(r304278)
@@ -272,10 +272,11 @@ endloop:
if (Cflag && !iswrune(cnt))
continue;
if (cmap_lookup(map, cnt) == OOBCH) {
-   if (next())
+   if (next()) {
cmap_add(map, cnt, s2.lastch);
-   if (sflag)
-   cset_add(squeeze, s2.lastch);
+   if (sflag)
+   cset_add(squeeze, s2.lastch);
+   }
} else
cmap_add(map, cnt, cnt);
if ((s2.state == EOS || s2.state == INFINITE) &&
___
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: r304277 - stable/11/usr.bin/tr

2016-08-17 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug 17 09:10:22 2016
New Revision: 304277
URL: https://svnweb.freebsd.org/changeset/base/304277

Log:
  MFC r302826
  
  Document incomplete support of [=equiv=] and collation for ranges.

Modified:
  stable/11/usr.bin/tr/tr.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/tr/tr.1
==
--- stable/11/usr.bin/tr/tr.1   Wed Aug 17 09:07:43 2016(r304276)
+++ stable/11/usr.bin/tr/tr.1   Wed Aug 17 09:10:22 2016(r304277)
@@ -334,6 +334,10 @@ should be used instead of explicit chara
 and
 .Dq Li A-Z .
 .Pp
+.Dq Li [=equiv=]
+expression and collation for ranges
+are implemented for single byte locales only.
+.Pp
 System V has historically implemented character ranges using the syntax
 .Dq Li [c-c]
 instead of the
___
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: r304276 - stable/11/contrib/tcsh

2016-08-17 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug 17 09:07:43 2016
New Revision: 304276
URL: https://svnweb.freebsd.org/changeset/base/304276

Log:
  MFC r302831
  
  To mimic system glob, we definitely don't need manual upper/lower hack.
  The author clearly disagree in the comment, so this patch will be not
  submitted upstream.

Modified:
  stable/11/contrib/tcsh/glob.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/tcsh/glob.c
==
--- stable/11/contrib/tcsh/glob.c   Wed Aug 17 08:51:47 2016
(r304275)
+++ stable/11/contrib/tcsh/glob.c   Wed Aug 17 09:07:43 2016
(r304276)
@@ -142,12 +142,14 @@ globcharcoll(__Char c1, __Char c2, int c
c1 = towlower(c1);
c2 = towlower(c2);
 } else {
+#ifndef __FreeBSD__
/* This should not be here, but I'll rather leave it in than engage in
   a LC_COLLATE flamewar about a shell I don't use... */
if (iswlower(c1) && iswupper(c2))
return (1);
if (iswupper(c1) && iswlower(c2))
return (-1);
+#endif
 }
 s1[0] = c1;
 s2[0] = c2;
___
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: r304275 - in stable/11/lib/libc: gen locale regex stdio

2016-08-17 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug 17 08:51:47 2016
New Revision: 304275
URL: https://svnweb.freebsd.org/changeset/base/304275

Log:
  MFC r302824
  
  1) Eliminate possibility to call __*collate_range_cmp() with inclomplete
  locale (which cause core dump) by removing whole 'table' argument
  by which it passed.
  
  2) Restore __collate_range_cmp() in __sccl().
  
  3) Collating [a-z] range in regcomp() work only for single bytes locales
  (we can't do it now for other ones). In previous code only first 256
  wchars are considered and all others are just silently dropped from the
  range.

Modified:
  stable/11/lib/libc/gen/fnmatch.c
  stable/11/lib/libc/gen/glob.c
  stable/11/lib/libc/locale/collate.h
  stable/11/lib/libc/locale/collcmp.c
  stable/11/lib/libc/regex/regcomp.c
  stable/11/lib/libc/stdio/vfscanf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/gen/fnmatch.c
==
--- stable/11/lib/libc/gen/fnmatch.cWed Aug 17 08:51:41 2016
(r304274)
+++ stable/11/lib/libc/gen/fnmatch.cWed Aug 17 08:51:47 2016
(r304275)
@@ -296,8 +296,8 @@ rangematch(const char *pattern, wchar_t 
 
if (table->__collate_load_error ?
c <= test && test <= c2 :
-  __wcollate_range_cmp(table, c, test) <= 0
-   && __wcollate_range_cmp(table, test, c2) <= 0
+  __wcollate_range_cmp(c, test) <= 0
+   && __wcollate_range_cmp(test, c2) <= 0
   )
ok = 1;
} else if (c == test)

Modified: stable/11/lib/libc/gen/glob.c
==
--- stable/11/lib/libc/gen/glob.c   Wed Aug 17 08:51:41 2016
(r304274)
+++ stable/11/lib/libc/gen/glob.c   Wed Aug 17 08:51:47 2016
(r304275)
@@ -832,8 +832,8 @@ match(Char *name, Char *pat, Char *paten
if ((*pat & M_MASK) == M_RNG) {
if (table->__collate_load_error ?
CHAR(c) <= CHAR(k) && CHAR(k) <= 
CHAR(pat[1]) :
-  __wcollate_range_cmp(table, 
CHAR(c), CHAR(k)) <= 0
-   && __wcollate_range_cmp(table, 
CHAR(k), CHAR(pat[1])) <= 0
+  __wcollate_range_cmp(CHAR(c), 
CHAR(k)) <= 0
+   && __wcollate_range_cmp(CHAR(k), 
CHAR(pat[1])) <= 0
   )
ok = 1;
pat += 2;

Modified: stable/11/lib/libc/locale/collate.h
==
--- stable/11/lib/libc/locale/collate.h Wed Aug 17 08:51:41 2016
(r304274)
+++ stable/11/lib/libc/locale/collate.h Wed Aug 17 08:51:47 2016
(r304275)
@@ -128,8 +128,8 @@ int __collate_load_tables(const char *);
 int__collate_equiv_value(locale_t, const wchar_t *, size_t);
 void   _collate_lookup(struct xlocale_collate *,const wchar_t *, int *, int *,
int, const int **);
-int__collate_range_cmp(struct xlocale_collate *, char, char);
-int__wcollate_range_cmp(struct xlocale_collate *, wchar_t, wchar_t);
+int__collate_range_cmp(char, char);
+int__wcollate_range_cmp(wchar_t, wchar_t);
 size_t _collate_wxfrm(struct xlocale_collate *, const wchar_t *, wchar_t *,
size_t);
 size_t _collate_sxfrm(struct xlocale_collate *, const wchar_t *, char *,

Modified: stable/11/lib/libc/locale/collcmp.c
==
--- stable/11/lib/libc/locale/collcmp.c Wed Aug 17 08:51:41 2016
(r304274)
+++ stable/11/lib/libc/locale/collcmp.c Wed Aug 17 08:51:47 2016
(r304275)
@@ -34,14 +34,13 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include "collate.h"
 
 /*
  * Compare two characters using collate
  */
 
-int __collate_range_cmp(struct xlocale_collate *table, char c1, char c2)
+int __collate_range_cmp(char c1, char c2)
 {
char s1[2], s2[2];
 
@@ -49,12 +48,10 @@ int __collate_range_cmp(struct xlocale_c
s1[1] = '\0';
s2[0] = c2;
s2[1] = '\0';
-   struct _xlocale l = {{0}};
-   l.components[XLC_COLLATE] = (struct xlocale_component *)table;
-   return (strcoll_l(s1, s2, ));
+   return (strcoll(s1, s2));
 }
 
-int __wcollate_range_cmp(struct xlocale_collate *table, wchar_t c1, wchar_t c2)
+int __wcollate_range_cmp(wchar_t c1, wchar_t c2)
 {
wchar_t s1[2], s2[2];
 
@@ -62,7 +59,5 @@ int __wcollate_range_cmp(struct xlocale_
s1[1] = L'\0';
s2[0] = c2;
s2[1] = L'\0';
-   struct _xlocale l = {{0}};
- 

svn commit: r304273 - head/sys/dev/hyperv/utilities

2016-08-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Aug 17 08:38:49 2016
New Revision: 304273
URL: https://svnweb.freebsd.org/changeset/base/304273

Log:
  hyperv/util: Factor out helper for IC device_probe DEVMETHOD
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7530

Modified:
  head/sys/dev/hyperv/utilities/hv_heartbeat.c
  head/sys/dev/hyperv/utilities/hv_kvp.c
  head/sys/dev/hyperv/utilities/hv_shutdown.c
  head/sys/dev/hyperv/utilities/hv_timesync.c
  head/sys/dev/hyperv/utilities/hv_util.c
  head/sys/dev/hyperv/utilities/hv_util.h

Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c
==
--- head/sys/dev/hyperv/utilities/hv_heartbeat.cWed Aug 17 08:37:40 
2016(r304272)
+++ head/sys/dev/hyperv/utilities/hv_heartbeat.cWed Aug 17 08:38:49 
2016(r304273)
@@ -41,10 +41,15 @@
 #include "hv_util.h"
 #include "vmbus_if.h"
 
-/* Heartbeat Service */
-static const struct hyperv_guid service_guid = { .hv_guid =
-   {0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
-   0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} };
+static const struct vmbus_ic_desc vmbus_heartbeat_descs[] = {
+   {
+   .ic_guid = { .hv_guid = {
+   0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+   0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} },
+   .ic_desc = "Hyper-V Heartbeat"
+   },
+   VMBUS_IC_DESC_END
+};
 
 /**
  * Process heartbeat message
@@ -96,14 +101,8 @@ hv_heartbeat_cb(struct vmbus_channel *ch
 static int
 hv_heartbeat_probe(device_t dev)
 {
-   if (resource_disabled("hvheartbeat", 0))
-   return ENXIO;
 
-   if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, _guid) == 0) {
-   device_set_desc(dev, "Hyper-V Heartbeat Service");
-   return BUS_PROBE_DEFAULT;
-   }
-   return ENXIO;
+   return (vmbus_ic_probe(dev, vmbus_heartbeat_descs));
 }
 
 static int

Modified: head/sys/dev/hyperv/utilities/hv_kvp.c
==
--- head/sys/dev/hyperv/utilities/hv_kvp.c  Wed Aug 17 08:37:40 2016
(r304272)
+++ head/sys/dev/hyperv/utilities/hv_kvp.c  Wed Aug 17 08:38:49 2016
(r304273)
@@ -87,9 +87,15 @@ static int hv_kvp_log = 0;
log(LOG_INFO, "hv_kvp: " __VA_ARGS__);  \
 } while (0)
 
-static const struct hyperv_guid service_guid = { .hv_guid =
-   {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
-   0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3,  0xe6} };
+static const struct vmbus_ic_desc vmbus_kvp_descs[] = {
+   {
+   .ic_guid = { .hv_guid = {
+   0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+   0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3,  0xe6 } },
+   .ic_desc = "Hyper-V KVP"
+   },
+   VMBUS_IC_DESC_END
+};
 
 /* character device prototypes */
 static d_open_thv_kvp_dev_open;
@@ -867,14 +873,8 @@ hv_kvp_dev_daemon_poll(struct cdev *dev,
 static int
 hv_kvp_probe(device_t dev)
 {
-   if (resource_disabled("hvkvp", 0))
-   return ENXIO;
 
-   if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, _guid) == 0) {
-   device_set_desc(dev, "Hyper-V KVP Service");
-   return BUS_PROBE_DEFAULT;
-   }
-   return ENXIO;
+   return (vmbus_ic_probe(dev, vmbus_kvp_descs));
 }
 
 static int

Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c
==
--- head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:37:40 2016
(r304272)
+++ head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:38:49 2016
(r304273)
@@ -46,9 +46,15 @@
 #include "hv_util.h"
 #include "vmbus_if.h"
 
-static const struct hyperv_guid service_guid = { .hv_guid =
-   {0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
-   0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB} };
+static const struct vmbus_ic_desc vmbus_shutdown_descs[] = {
+   {
+   .ic_guid = { .hv_guid = {
+   0x31, 0x60, 0x0b, 0x0e, 0x13, 0x52, 0x34, 0x49,
+   0x81, 0x8b, 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb } },
+   .ic_desc = "Hyper-V Shutdown"
+   },
+   VMBUS_IC_DESC_END
+};
 
 /**
  * Shutdown
@@ -118,14 +124,8 @@ hv_shutdown_cb(struct vmbus_channel *cha
 static int
 hv_shutdown_probe(device_t dev)
 {
-   if (resource_disabled("hvshutdown", 0))
-   return ENXIO;
 
-   if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, _guid) == 0) {
-   device_set_desc(dev, "Hyper-V Shutdown Service");
-   return BUS_PROBE_DEFAULT;
-   }
-   return ENXIO;
+   return (vmbus_ic_probe(dev, vmbus_shutdown_descs));
 }
 
 static int

Modified: head/sys/dev/hyperv/utilities/hv_timesync.c

svn commit: r304272 - stable/11/usr.bin

2016-08-17 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug 17 08:37:40 2016
New Revision: 304272
URL: https://svnweb.freebsd.org/changeset/base/304272

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

Modified:
  stable/11/usr.bin/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/Makefile
==
--- stable/11/usr.bin/Makefile  Wed Aug 17 08:29:30 2016(r304271)
+++ stable/11/usr.bin/Makefile  Wed Aug 17 08:37:40 2016(r304272)
@@ -270,8 +270,9 @@ SUBDIR.${MK_TOOLCHAIN}+=ctags
 SUBDIR.${MK_TOOLCHAIN}+=   cxxfilt
 SUBDIR.${MK_TOOLCHAIN}+=   elfcopy
 SUBDIR.${MK_TOOLCHAIN}+=   file2c
-.if ${MACHINE_ARCH} != "aarch64" && \ # ARM64TODO gprof does not build
-${MACHINE_CPUARCH} != "riscv" # RISCVTODO gprof does not build
+# ARM64TODO gprof does not build
+# RISCVTODO gprof does not build
+.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
 SUBDIR.${MK_TOOLCHAIN}+=   gprof
 .endif
 SUBDIR.${MK_TOOLCHAIN}+=   indent
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304221 - head/sys/boot/efi/boot1

2016-08-17 Thread Emmanuel Vadot
On Tue, 16 Aug 2016 12:16:30 -0600
Warner Losh  wrote:

> On Tue, Aug 16, 2016 at 8:57 AM, Ed Schouten  wrote:
> > Hi Emmanuel,
> >
> > 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot :
> >> Author: manu
> >> Date: Tue Aug 16 14:23:35 2016
> >> New Revision: 304221
> >> URL: https://svnweb.freebsd.org/changeset/base/304221
> >>
> >> Log:
> >>   Use %ju modifier for u_int64_t and %jd modifier for off_t.
> >>   off_t is long long on arm32 and long on amd64
> >
> > I think both of these should be solved differently:
> >
> > - For uint64_t, you can use 's PRIu64 in the formatting
> > string. In kernel space, I suspect you need to use something like
> > .
> 
> cast it to intmax_t and use %jd. We've shunned PRIu64 in the tree.
> It's existing practice, but I'm sure bruce will voice mild distaste.
> 
> > - For off_t, it's all right to print it with %jd, but then be sure to
> > also add a cast to the argument itself. It may not necessarily be
> > equal to an intmax_t.
> 
> The cast is important.
> 
> Warner


 Thanks to all of you, I didn't know about PRI* (but I guess this was a
good thing to not know about them).

-- 
Emmanuel Vadot
___
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: r304271 - head/sys/boot/efi/boot1

2016-08-17 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug 17 08:29:30 2016
New Revision: 304271
URL: https://svnweb.freebsd.org/changeset/base/304271

Log:
  Correctly print and cast u_int64_t and off_t.
  
  Reported by:  ed, imp
  MFC after:1 week

Modified:
  head/sys/boot/efi/boot1/ufs_module.c
  head/sys/boot/efi/boot1/zfs_module.c

Modified: head/sys/boot/efi/boot1/ufs_module.c
==
--- head/sys/boot/efi/boot1/ufs_module.cWed Aug 17 08:26:08 2016
(r304270)
+++ head/sys/boot/efi/boot1/ufs_module.cWed Aug 17 08:29:30 2016
(r304271)
@@ -56,9 +56,9 @@ dskread(void *buf, u_int64_t lba, int nb
devinfo->dev->Media->MediaId, lba, size, buf);
 
if (status != EFI_SUCCESS) {
-   DPRINTF("dskread: failed dev: %p, id: %u, lba: %zu, size: %d, "
+   DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, "
"status: %lu\n", devinfo->dev,
-   devinfo->dev->Media->MediaId, lba, size,
+   devinfo->dev->Media->MediaId, (uintmax_t)lba, size,
EFI_ERROR_CODE(status));
return (-1);
}

Modified: head/sys/boot/efi/boot1/zfs_module.c
==
--- head/sys/boot/efi/boot1/zfs_module.cWed Aug 17 08:26:08 2016
(r304270)
+++ head/sys/boot/efi/boot1/zfs_module.cWed Aug 17 08:29:30 2016
(r304271)
@@ -54,9 +54,9 @@ vdev_read(vdev_t *vdev, void *priv, off_
devinfo->dev->Media->MediaId, lba, bytes, buf);
if (status != EFI_SUCCESS) {
DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: 
%zu,"
-" status: %lu\n", devinfo->dev,
-devinfo->dev->Media->MediaId, lba, bytes,
-EFI_ERROR_CODE(status));
+   " status: %lu\n", devinfo->dev,
+   devinfo->dev->Media->MediaId, (intmax_t)lba, bytes,
+   EFI_ERROR_CODE(status));
return (-1);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304270 - head/sys/dev/hyperv/utilities

2016-08-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Aug 17 08:26:08 2016
New Revision: 304270
URL: https://svnweb.freebsd.org/changeset/base/304270

Log:
  hyperv/util: Don't reference hn_softc in KVP
  
  hn_softc is private data struct.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7519

Modified:
  head/sys/dev/hyperv/utilities/hv_kvp.c

Modified: head/sys/dev/hyperv/utilities/hv_kvp.c
==
--- head/sys/dev/hyperv/utilities/hv_kvp.c  Wed Aug 17 07:30:23 2016
(r304269)
+++ head/sys/dev/hyperv/utilities/hv_kvp.c  Wed Aug 17 08:26:08 2016
(r304270)
@@ -54,17 +54,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
-#include 
-#include 
-#include 
-
 #include 
-#include 
 #include 
 
 #include "hv_util.h"
@@ -333,13 +329,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru
for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) {
/* XXX access other driver's softc?  are you kidding? */
device_t dev = devs[devcnt];
-   struct hn_softc *sc = device_get_softc(dev);
struct vmbus_channel *chan;
char buf[HYPERV_GUID_STRLEN];
 
/*
 * Trying to find GUID of Network Device
-* TODO: need vmbus interface.
 */
chan = vmbus_get_channel(dev);
hyperv_guid2str(vmbus_chan_guid_inst(chan),
@@ -348,7 +342,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru
if (strncmp(buf, (char 
*)umsg->body.kvp_ip_val.adapter_id,
HYPERV_GUID_STRLEN - 1) == 0) {
strlcpy((char 
*)umsg->body.kvp_ip_val.adapter_id,
-   sc->hn_ifp->if_xname, MAX_ADAPTER_ID_SIZE);
+   device_get_nameunit(dev), 
MAX_ADAPTER_ID_SIZE);
break;
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304180 - head/sys/ufs/ffs

2016-08-17 Thread Konstantin Belousov
On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote:
> Hmm, some people interpret POSIX differently than I do, but I think it
> is clear that XBD 3.384 Synchronized I/O Data Integrity Completion
> requires the indirect blocks to be written (because "all file system
> information required to retrieve the data is successfully transferred").
> The Linux man page matches this interpretation except that an fsync of
> the parent directory may be required.
> 
> If the whole file is being considered, then any change to indirect
> blocks is needed to access some data (because the file was extended, a
> hole was filled or snapshotted data was overwritten). For other
> overwrites, there is no change to indirect blocks and no conflict with
> fdatasync's performance objectives.
Note that the same argument is applicable to the inode block:  the di_db
and di_ib pointers to the direct blocks and to root indirect blocks are
required to retrieve the written data.
...

> Ideally, a changed i_size would also cause the inode to be written, but
> I don't know how to determine that (there is no i_flag for it). Always
> writing the inode would defeat the point of fdatasync.
Which was my reasoning behind omitting the indirect block flushing.
There is no practical difference between inode block and indirect blocks
for metadata consistency.

Note that the affected case is only the async mounts (not sync mounts,
not any variants of softdeps).

I can restore indirect block flushing and wait for them for DATA_ONLY sync,
but then I should also add ffs_update() call.
___
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: r304268 - head/lib/libc/gen

2016-08-17 Thread Kevin Lo
Author: kevlo
Date: Wed Aug 17 07:25:50 2016
New Revision: 304268
URL: https://svnweb.freebsd.org/changeset/base/304268

Log:
  - Add the 'restrict' type qualifier to match function prototype.
  - Use .Lb libc rather than libpthread.
  
  Reviewed by:  delphij

Modified:
  head/lib/libc/gen/sem_timedwait.3

Modified: head/lib/libc/gen/sem_timedwait.3
==
--- head/lib/libc/gen/sem_timedwait.3   Wed Aug 17 07:25:21 2016
(r304267)
+++ head/lib/libc/gen/sem_timedwait.3   Wed Aug 17 07:25:50 2016
(r304268)
@@ -34,18 +34,18 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 3, 2008
+.Dd August 17, 2016
 .Dt SEM_TIMEDWAIT 3
 .Os
 .Sh NAME
 .Nm sem_timedwait
 .Nd "lock a semaphore"
 .Sh LIBRARY
-.Lb libpthread
+.Lb libc
 .Sh SYNOPSIS
 .In semaphore.h
 .Ft int
-.Fn sem_timedwait "sem_t *sem" "const struct timespec *abs_timeout"
+.Fn sem_timedwait "sem_t * restrict sem" "const struct timespec * restrict 
abs_timeout"
 .Sh DESCRIPTION
 The
 .Fn sem_timedwait
___
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: r304266 - stable/10/sys/fs/tmpfs

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 07:17:16 2016
New Revision: 304266
URL: https://svnweb.freebsd.org/changeset/base/304266

Log:
  MFC r303916:
  Convert another tmpfs assert into runtime check.

Modified:
  stable/10/sys/fs/tmpfs/tmpfs_subr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c
==
--- stable/10/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:15:50 2016
(r304265)
+++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:17:16 2016
(r304266)
@@ -818,10 +818,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_nod
goto out;
}
 
-   MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie);
-   dekey.td_hash = cookie;
-   /* Recover if direntry for cookie was removed */
-   de = RB_NFIND(tmpfs_dir, dirhead, );
+   if ((cookie & TMPFS_DIRCOOKIE_MASK) != cookie) {
+   de = NULL;
+   } else {
+   dekey.td_hash = cookie;
+   /* Recover if direntry for cookie was removed */
+   de = RB_NFIND(tmpfs_dir, dirhead, );
+   }
dc->tdc_tree = de;
dc->tdc_current = de;
if (de != NULL && tmpfs_dirent_duphead(de)) {
___
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: r304265 - stable/11/sys/fs/tmpfs

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 07:15:50 2016
New Revision: 304265
URL: https://svnweb.freebsd.org/changeset/base/304265

Log:
  MFC r303916:
  Convert another tmpfs assert into runtime check.

Modified:
  stable/11/sys/fs/tmpfs/tmpfs_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c
==
--- stable/11/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:13:25 2016
(r304264)
+++ stable/11/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:15:50 2016
(r304265)
@@ -819,10 +819,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_nod
goto out;
}
 
-   MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie);
-   dekey.td_hash = cookie;
-   /* Recover if direntry for cookie was removed */
-   de = RB_NFIND(tmpfs_dir, dirhead, );
+   if ((cookie & TMPFS_DIRCOOKIE_MASK) != cookie) {
+   de = NULL;
+   } else {
+   dekey.td_hash = cookie;
+   /* Recover if direntry for cookie was removed */
+   de = RB_NFIND(tmpfs_dir, dirhead, );
+   }
dc->tdc_tree = de;
dc->tdc_current = de;
if (de != NULL && tmpfs_dirent_duphead(de)) {
___
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: r304264 - stable/10/sys/kern

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 07:13:25 2016
New Revision: 304264
URL: https://svnweb.freebsd.org/changeset/base/304264

Log:
  MFC r303914:
  Re-schedule signals after kthread exits.

Modified:
  stable/10/sys/kern/kern_kthread.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_kthread.c
==
--- stable/10/sys/kern/kern_kthread.c   Wed Aug 17 07:11:45 2016
(r304263)
+++ stable/10/sys/kern/kern_kthread.c   Wed Aug 17 07:13:25 2016
(r304264)
@@ -322,11 +322,13 @@ void
 kthread_exit(void)
 {
struct proc *p;
+   struct thread *td;
 
-   p = curthread->td_proc;
+   td = curthread;
+   p = td->td_proc;
 
/* A module may be waiting for us to exit. */
-   wakeup(curthread);
+   wakeup(td);
 
/*
 * The last exiting thread in a kernel process must tear down
@@ -339,9 +341,10 @@ kthread_exit(void)
rw_wunlock(_lock);
kproc_exit(0);
}
-   LIST_REMOVE(curthread, td_hash);
+   LIST_REMOVE(td, td_hash);
rw_wunlock(_lock);
-   umtx_thread_exit(curthread);
+   umtx_thread_exit(td);
+   tdsigcleanup(td);
PROC_SLOCK(p);
thread_exit();
 }
___
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: r304263 - stable/11/sys/kern

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 07:11:45 2016
New Revision: 304263
URL: https://svnweb.freebsd.org/changeset/base/304263

Log:
  MFC r303914:
  Re-schedule signals after kthread exits.

Modified:
  stable/11/sys/kern/kern_kthread.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_kthread.c
==
--- stable/11/sys/kern/kern_kthread.c   Wed Aug 17 07:09:22 2016
(r304262)
+++ stable/11/sys/kern/kern_kthread.c   Wed Aug 17 07:11:45 2016
(r304263)
@@ -320,11 +320,13 @@ void
 kthread_exit(void)
 {
struct proc *p;
+   struct thread *td;
 
-   p = curthread->td_proc;
+   td = curthread;
+   p = td->td_proc;
 
/* A module may be waiting for us to exit. */
-   wakeup(curthread);
+   wakeup(td);
 
/*
 * The last exiting thread in a kernel process must tear down
@@ -337,9 +339,10 @@ kthread_exit(void)
rw_wunlock(_lock);
kproc_exit(0);
}
-   LIST_REMOVE(curthread, td_hash);
+   LIST_REMOVE(td, td_hash);
rw_wunlock(_lock);
-   umtx_thread_exit(curthread);
+   umtx_thread_exit(td);
+   tdsigcleanup(td);
PROC_SLOCK(p);
thread_exit();
 }
___
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: r304262 - in stable/10/sys: amd64/amd64 i386/i386

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 07:09:22 2016
New Revision: 304262
URL: https://svnweb.freebsd.org/changeset/base/304262

Log:
  MFC r303913:
  Unconditionally perform checks that FPU region was entered, when #NM
  exception is caught in kernel mode.

Modified:
  stable/10/sys/amd64/amd64/trap.c
  stable/10/sys/i386/i386/trap.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/trap.c
==
--- stable/10/sys/amd64/amd64/trap.cWed Aug 17 07:07:29 2016
(r304261)
+++ stable/10/sys/amd64/amd64/trap.cWed Aug 17 07:09:22 2016
(r304262)
@@ -448,8 +448,8 @@ trap(struct trapframe *frame)
goto out;
 
case T_DNA:
-   KASSERT(!PCB_USER_FPU(td->td_pcb),
-   ("Unregistered use of FPU in kernel"));
+   if (PCB_USER_FPU(td->td_pcb))
+   panic("Unregistered use of FPU in kernel");
fpudna();
goto out;
 

Modified: stable/10/sys/i386/i386/trap.c
==
--- stable/10/sys/i386/i386/trap.c  Wed Aug 17 07:07:29 2016
(r304261)
+++ stable/10/sys/i386/i386/trap.c  Wed Aug 17 07:09:22 2016
(r304262)
@@ -534,8 +534,8 @@ trap(struct trapframe *frame)
 
case T_DNA:
 #ifdef DEV_NPX
-   KASSERT(!PCB_USER_FPU(td->td_pcb),
-   ("Unregistered use of FPU in kernel"));
+   if (PCB_USER_FPU(td->td_pcb))
+   panic("Unregistered use of FPU in kernel");
if (npxdna())
goto out;
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304261 - releng/11.0/lib/clang

2016-08-17 Thread Dimitry Andric
Author: dim
Date: Wed Aug 17 07:07:29 2016
New Revision: 304261
URL: https://svnweb.freebsd.org/changeset/base/304261

Log:
  Similar to r256297, disable assertions in llvm and clang for the
  releng/11.0 branch.  This reduces the size of the clang executable, and
  improves its performance.  Also bump FREEBSD_CC_VERSION.
  
  Approved by:  re (gjb)

Modified:
  releng/11.0/lib/clang/clang.build.mk
  releng/11.0/lib/clang/freebsd_cc_version.h
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/lib/clang/clang.build.mk
==
--- releng/11.0/lib/clang/clang.build.mkWed Aug 17 07:07:24 2016
(r304260)
+++ releng/11.0/lib/clang/clang.build.mkWed Aug 17 07:07:29 2016
(r304261)
@@ -8,7 +8,7 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLAN
-I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \
-I${LLVM_SRCS}/../../lib/clang/include \
-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
-   -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
+   -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG
 
 .if ${MK_CLANG_FULL} != "no"
 CFLAGS+=   -DCLANG_ENABLE_ARCMT \

Modified: releng/11.0/lib/clang/freebsd_cc_version.h
==
--- releng/11.0/lib/clang/freebsd_cc_version.h  Wed Aug 17 07:07:24 2016
(r304260)
+++ releng/11.0/lib/clang/freebsd_cc_version.h  Wed Aug 17 07:07:29 2016
(r304261)
@@ -1,3 +1,3 @@
 /* $FreeBSD$ */
 
-#defineFREEBSD_CC_VERSION  114
+#defineFREEBSD_CC_VERSION  115
___
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: r304260 - in stable/11/sys: amd64/amd64 i386/i386

2016-08-17 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 17 07:07:24 2016
New Revision: 304260
URL: https://svnweb.freebsd.org/changeset/base/304260

Log:
  MFC r303913:
  Unconditionally perform checks that FPU region was entered, when #NM
  exception is caught in kernel mode.

Modified:
  stable/11/sys/amd64/amd64/trap.c
  stable/11/sys/i386/i386/trap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/trap.c
==
--- stable/11/sys/amd64/amd64/trap.cWed Aug 17 06:58:43 2016
(r304259)
+++ stable/11/sys/amd64/amd64/trap.cWed Aug 17 07:07:24 2016
(r304260)
@@ -443,8 +443,8 @@ trap(struct trapframe *frame)
goto out;
 
case T_DNA:
-   KASSERT(!PCB_USER_FPU(td->td_pcb),
-   ("Unregistered use of FPU in kernel"));
+   if (PCB_USER_FPU(td->td_pcb))
+   panic("Unregistered use of FPU in kernel");
fpudna();
goto out;
 

Modified: stable/11/sys/i386/i386/trap.c
==
--- stable/11/sys/i386/i386/trap.c  Wed Aug 17 06:58:43 2016
(r304259)
+++ stable/11/sys/i386/i386/trap.c  Wed Aug 17 07:07:24 2016
(r304260)
@@ -540,8 +540,8 @@ trap(struct trapframe *frame)
 
case T_DNA:
 #ifdef DEV_NPX
-   KASSERT(!PCB_USER_FPU(td->td_pcb),
-   ("Unregistered use of FPU in kernel"));
+   if (PCB_USER_FPU(td->td_pcb))
+   panic("Unregistered use of FPU in kernel");
if (npxdna())
goto out;
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"