svn commit: r287277 - head/sys/netinet

2015-08-28 Thread Adrian Chadd
Author: adrian
Date: Sat Aug 29 06:58:30 2015
New Revision: 287277
URL: https://svnweb.freebsd.org/changeset/base/287277

Log:
  Rename rss_soft_m2cpuid() ->  rss_soft_m2cpuid_v4() in preparation for
  an IPv6 version to show up.
  
  Submitted by: Tiwei Bie 
  Differential Revision:https://reviews.freebsd.org/D3504

Modified:
  head/sys/netinet/in_rss.c
  head/sys/netinet/in_rss.h
  head/sys/netinet/ip_input.c

Modified: head/sys/netinet/in_rss.c
==
--- head/sys/netinet/in_rss.c   Sat Aug 29 06:52:14 2015(r287276)
+++ head/sys/netinet/in_rss.c   Sat Aug 29 06:58:30 2015(r287277)
@@ -332,7 +332,7 @@ rss_mbuf_software_hash_v4(const struct m
  * XXX TODO: definitely want statistics here!
  */
 struct mbuf *
-rss_soft_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid)
+rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid)
 {
uint32_t hash_val, hash_type;
int ret;

Modified: head/sys/netinet/in_rss.h
==
--- head/sys/netinet/in_rss.h   Sat Aug 29 06:52:14 2015(r287276)
+++ head/sys/netinet/in_rss.h   Sat Aug 29 06:58:30 2015(r287277)
@@ -51,7 +51,7 @@ int   rss_proto_software_hash_v4(struct i
struct in_addr dst, u_short src_port, u_short dst_port,
int proto, uint32_t *hashval,
uint32_t *hashtype);
-struct mbuf *  rss_soft_m2cpuid(struct mbuf *m, uintptr_t source,
+struct mbuf *  rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source,
u_int *cpuid);
 
 #endif /* !_NETINET_IN_RSS_H_ */

Modified: head/sys/netinet/ip_input.c
==
--- head/sys/netinet/ip_input.c Sat Aug 29 06:52:14 2015(r287276)
+++ head/sys/netinet/ip_input.c Sat Aug 29 06:58:30 2015(r287277)
@@ -140,7 +140,7 @@ static struct netisr_handler ip_nh = {
.nh_handler = ip_input,
.nh_proto = NETISR_IP,
 #ifdef RSS
-   .nh_m2cpuid = rss_soft_m2cpuid,
+   .nh_m2cpuid = rss_soft_m2cpuid_v4,
.nh_policy = NETISR_POLICY_CPU,
.nh_dispatch = NETISR_DISPATCH_HYBRID,
 #else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287276 - head/sys/powerpc/booke

2015-08-28 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 29 06:52:14 2015
New Revision: 287276
URL: https://svnweb.freebsd.org/changeset/base/287276

Log:
  The TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Sat Aug 29 06:28:48 2015
(r287275)
+++ head/sys/powerpc/booke/pmap.c   Sat Aug 29 06:52:14 2015
(r287276)
@@ -2817,7 +2817,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd
sz = 1 << (ilog2(size) & ~1);
if (va % sz != 0) {
do {
-   sz >>= 1;
+   sz >>= 2;
} while (va % sz != 0);
}
if (bootverbose)
___
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: r287275 - stable/8/sys/dev/usb

2015-08-28 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Aug 29 06:28:48 2015
New Revision: 287275
URL: https://svnweb.freebsd.org/changeset/base/287275

Log:
  MFC r286799:
  Fix race in USB PF which can happen if we stop tracing exactly when
  the kernel is tapping an USB transfer. This leads to a NULL pointer
  access. The solution is to only trace while the USB bus lock is
  locked.

Modified:
  stable/8/sys/dev/usb/usb_pf.c
  stable/8/sys/dev/usb/usb_transfer.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/usb/   (props changed)

Modified: stable/8/sys/dev/usb/usb_pf.c
==
--- stable/8/sys/dev/usb/usb_pf.c   Sat Aug 29 06:23:40 2015
(r287274)
+++ stable/8/sys/dev/usb/usb_pf.c   Sat Aug 29 06:28:48 2015
(r287275)
@@ -103,13 +103,16 @@ usbpf_detach(struct usb_bus *ubus)
 {
struct ifnet *ifp = ubus->ifp;
 
+   USB_BUS_LOCK(ubus);
+   ubus->ifp = NULL;
+   USB_BUS_UNLOCK(ubus);
+
if (ifp != NULL) {
bpfdetach(ifp);
if_down(ifp);
if_detach(ifp);
if_free(ifp);
}
-   ubus->ifp = NULL;
 }
 
 static uint32_t

Modified: stable/8/sys/dev/usb/usb_transfer.c
==
--- stable/8/sys/dev/usb/usb_transfer.c Sat Aug 29 06:23:40 2015
(r287274)
+++ stable/8/sys/dev/usb/usb_transfer.c Sat Aug 29 06:28:48 2015
(r287275)
@@ -2291,8 +2291,11 @@ usbd_callback_wrapper(struct usb_xfer_qu
}
 
 #if USB_HAVE_PF
-   if (xfer->usb_state != USB_ST_SETUP)
+   if (xfer->usb_state != USB_ST_SETUP) {
+   USB_BUS_LOCK(info->bus);
usbpf_xfertap(xfer, USBPF_XFERTAP_DONE);
+   USB_BUS_UNLOCK(info->bus);
+   }
 #endif
/* call processing routine */
(xfer->callback) (xfer, xfer->error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287274 - in stable/10/sys: boot/usb dev/usb dev/usb/controller

2015-08-28 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Aug 29 06:23:40 2015
New Revision: 287274
URL: https://svnweb.freebsd.org/changeset/base/287274

Log:
  MFC r286773:
  Improve the realtime properties of USB transfers for embedded systems
  like RPI-B and RPI-2.

Modified:
  stable/10/sys/boot/usb/bsd_kernel.h
  stable/10/sys/dev/usb/controller/usb_controller.c
  stable/10/sys/dev/usb/usb_bus.h
  stable/10/sys/dev/usb/usb_device.c
  stable/10/sys/dev/usb/usb_hub.c
  stable/10/sys/dev/usb/usb_process.h
  stable/10/sys/dev/usb/usb_transfer.c
  stable/10/sys/dev/usb/usbdi.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/boot/usb/bsd_kernel.h
==
--- stable/10/sys/boot/usb/bsd_kernel.h Sat Aug 29 06:17:39 2015
(r287273)
+++ stable/10/sys/boot/usb/bsd_kernel.h Sat Aug 29 06:23:40 2015
(r287274)
@@ -42,7 +42,8 @@
 #defineM_USBDEV 0
 #defineUSB_PROC_MAX 3
 #defineUSB_BUS_GIANT_PROC(bus) (usb_process + 2)
-#defineUSB_BUS_NON_GIANT_PROC(bus) (usb_process + 2)
+#defineUSB_BUS_NON_GIANT_BULK_PROC(bus) (usb_process + 2)
+#defineUSB_BUS_NON_GIANT_ISOC_PROC(bus) (usb_process + 2)
 #defineUSB_BUS_EXPLORE_PROC(bus) (usb_process + 0)
 #defineUSB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1)
 #defineSYSCTL_DECL(...)

Modified: stable/10/sys/dev/usb/controller/usb_controller.c
==
--- stable/10/sys/dev/usb/controller/usb_controller.c   Sat Aug 29 06:17:39 
2015(r287273)
+++ stable/10/sys/dev/usb/controller/usb_controller.c   Sat Aug 29 06:23:40 
2015(r287274)
@@ -233,7 +233,8 @@ usb_detach(device_t dev)
/* Get rid of USB callback processes */
 
usb_proc_free(USB_BUS_GIANT_PROC(bus));
-   usb_proc_free(USB_BUS_NON_GIANT_PROC(bus));
+   usb_proc_free(USB_BUS_NON_GIANT_ISOC_PROC(bus));
+   usb_proc_free(USB_BUS_NON_GIANT_BULK_PROC(bus));
 
/* Get rid of USB explore process */
 
@@ -397,7 +398,8 @@ usb_bus_explore(struct usb_proc_msg *pm)
 */
usb_proc_rewakeup(USB_BUS_CONTROL_XFER_PROC(bus));
usb_proc_rewakeup(USB_BUS_GIANT_PROC(bus));
-   usb_proc_rewakeup(USB_BUS_NON_GIANT_PROC(bus));
+   usb_proc_rewakeup(USB_BUS_NON_GIANT_ISOC_PROC(bus));
+   usb_proc_rewakeup(USB_BUS_NON_GIANT_BULK_PROC(bus));
 #endif
 
USB_BUS_UNLOCK(bus);
@@ -862,9 +864,13 @@ usb_attach_sub(device_t dev, struct usb_
&bus->bus_mtx, device_get_nameunit(dev), USB_PRI_MED)) {
device_printf(dev, "WARNING: Creation of USB Giant "
"callback process failed.\n");
-   } else if (usb_proc_create(USB_BUS_NON_GIANT_PROC(bus),
+   } else if (usb_proc_create(USB_BUS_NON_GIANT_ISOC_PROC(bus),
+   &bus->bus_mtx, device_get_nameunit(dev), USB_PRI_HIGHEST)) {
+   device_printf(dev, "WARNING: Creation of USB non-Giant ISOC "
+   "callback process failed.\n");
+   } else if (usb_proc_create(USB_BUS_NON_GIANT_BULK_PROC(bus),
&bus->bus_mtx, device_get_nameunit(dev), USB_PRI_HIGH)) {
-   device_printf(dev, "WARNING: Creation of USB non-Giant "
+   device_printf(dev, "WARNING: Creation of USB non-Giant BULK "
"callback process failed.\n");
} else if (usb_proc_create(USB_BUS_EXPLORE_PROC(bus),
&bus->bus_mtx, device_get_nameunit(dev), USB_PRI_MED)) {

Modified: stable/10/sys/dev/usb/usb_bus.h
==
--- stable/10/sys/dev/usb/usb_bus.h Sat Aug 29 06:17:39 2015
(r287273)
+++ stable/10/sys/dev/usb/usb_bus.h Sat Aug 29 06:23:40 2015
(r287274)
@@ -57,19 +57,26 @@ struct usb_bus {
struct root_hold_token *bus_roothold;
 #endif
 
+/* convenience macros */
+#defineUSB_BUS_TT_PROC(bus) USB_BUS_NON_GIANT_ISOC_PROC(bus)
+#defineUSB_BUS_CS_PROC(bus) USB_BUS_NON_GIANT_ISOC_PROC(bus)
+  
 #if USB_HAVE_PER_BUS_PROCESS
 #defineUSB_BUS_GIANT_PROC(bus) (&(bus)->giant_callback_proc)
-#defineUSB_BUS_NON_GIANT_PROC(bus) (&(bus)->non_giant_callback_proc)
+#defineUSB_BUS_NON_GIANT_ISOC_PROC(bus) 
(&(bus)->non_giant_isoc_callback_proc)
+#defineUSB_BUS_NON_GIANT_BULK_PROC(bus) 
(&(bus)->non_giant_bulk_callback_proc)
 #defineUSB_BUS_EXPLORE_PROC(bus) (&(bus)->explore_proc)
 #defineUSB_BUS_CONTROL_XFER_PROC(bus) (&(bus)->control_xfer_proc)
-
/*
-* There are two callback processes. One for Giant locked
-* callbacks. One for non-Giant locked callbacks. This should
-* avoid congestion and reduce response time in most cases.
+* There are three callback processes. One for Giant locked
+* callbacks. One for non-Giant locked non-periodic callback

svn commit: r287273 - stable/9/sys/dev/usb

2015-08-28 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Aug 29 06:17:39 2015
New Revision: 287273
URL: https://svnweb.freebsd.org/changeset/base/287273

Log:
  MFC r286799:
  Fix race in USB PF which can happen if we stop tracing exactly when
  the kernel is tapping an USB transfer. This leads to a NULL pointer
  access. The solution is to only trace while the USB bus lock is
  locked.

Modified:
  stable/9/sys/dev/usb/usb_pf.c
  stable/9/sys/dev/usb/usb_transfer.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/usb_pf.c
==
--- stable/9/sys/dev/usb/usb_pf.c   Sat Aug 29 06:11:50 2015
(r287272)
+++ stable/9/sys/dev/usb/usb_pf.c   Sat Aug 29 06:17:39 2015
(r287273)
@@ -103,13 +103,16 @@ usbpf_detach(struct usb_bus *ubus)
 {
struct ifnet *ifp = ubus->ifp;
 
+   USB_BUS_LOCK(ubus);
+   ubus->ifp = NULL;
+   USB_BUS_UNLOCK(ubus);
+
if (ifp != NULL) {
bpfdetach(ifp);
if_down(ifp);
if_detach(ifp);
if_free(ifp);
}
-   ubus->ifp = NULL;
 }
 
 static uint32_t

Modified: stable/9/sys/dev/usb/usb_transfer.c
==
--- stable/9/sys/dev/usb/usb_transfer.c Sat Aug 29 06:11:50 2015
(r287272)
+++ stable/9/sys/dev/usb/usb_transfer.c Sat Aug 29 06:17:39 2015
(r287273)
@@ -2292,8 +2292,11 @@ usbd_callback_wrapper(struct usb_xfer_qu
}
 
 #if USB_HAVE_PF
-   if (xfer->usb_state != USB_ST_SETUP)
+   if (xfer->usb_state != USB_ST_SETUP) {
+   USB_BUS_LOCK(info->bus);
usbpf_xfertap(xfer, USBPF_XFERTAP_DONE);
+   USB_BUS_UNLOCK(info->bus);
+   }
 #endif
/* call processing routine */
(xfer->callback) (xfer, xfer->error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287272 - stable/10/sys/dev/usb

2015-08-28 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Aug 29 06:11:50 2015
New Revision: 287272
URL: https://svnweb.freebsd.org/changeset/base/287272

Log:
  MFC r286799:
  Fix race in USB PF which can happen if we stop tracing exactly when
  the kernel is tapping an USB transfer. This leads to a NULL pointer
  access. The solution is to only trace while the USB bus lock is
  locked.

Modified:
  stable/10/sys/dev/usb/usb_pf.c
  stable/10/sys/dev/usb/usb_transfer.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/usb_pf.c
==
--- stable/10/sys/dev/usb/usb_pf.c  Sat Aug 29 06:07:55 2015
(r287271)
+++ stable/10/sys/dev/usb/usb_pf.c  Sat Aug 29 06:11:50 2015
(r287272)
@@ -220,7 +220,13 @@ usbpf_clone_destroy(struct if_clone *ifc
ubus = ifp->if_softc;
unit = ifp->if_dunit;
 
+   /*
+* Lock USB before clearing the "ifp" pointer, to avoid
+* clearing the pointer in the middle of a TAP operation:
+*/
+   USB_BUS_LOCK(ubus);
ubus->ifp = NULL;
+   USB_BUS_UNLOCK(ubus);
bpfdetach(ifp);
if_detach(ifp);
if_free(ifp);

Modified: stable/10/sys/dev/usb/usb_transfer.c
==
--- stable/10/sys/dev/usb/usb_transfer.cSat Aug 29 06:07:55 2015
(r287271)
+++ stable/10/sys/dev/usb/usb_transfer.cSat Aug 29 06:11:50 2015
(r287272)
@@ -2381,8 +2381,11 @@ usbd_callback_wrapper(struct usb_xfer_qu
}
 
 #if USB_HAVE_PF
-   if (xfer->usb_state != USB_ST_SETUP)
+   if (xfer->usb_state != USB_ST_SETUP) {
+   USB_BUS_LOCK(info->bus);
usbpf_xfertap(xfer, USBPF_XFERTAP_DONE);
+   USB_BUS_UNLOCK(info->bus);
+   }
 #endif
/* call processing routine */
(xfer->callback) (xfer, xfer->error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287271 - stable/10/sys/dev/usb/controller

2015-08-28 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Aug 29 06:07:55 2015
New Revision: 287271
URL: https://svnweb.freebsd.org/changeset/base/287271

Log:
  MFC r283067, r286118, r285638, r285935, r286778, r286780 and r286802:
  - Make the FIFO configuration a bit more flexible for the DWC OTG in
  device side mode.
  - Limit the number of times we loop inside the DWC OTG poll handler to
  avoid starving other fast interrupts. Fix a comment while at it.
  - Optimise the DWC OTG host mode driver's transmit path
  - Optimise the DWC OTG host mode driver's receive path
  - Minor code refactor to avoid duplicating code.
  - Handle NYET high speed tokens and predict NAK'ing is up next.
  - Fixes for HIGH speed ISOCHRONOUS traffic.

Modified:
  stable/10/sys/dev/usb/controller/dwc_otg.c
  stable/10/sys/dev/usb/controller/dwc_otg.h
  stable/10/sys/dev/usb/controller/dwc_otgreg.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/dwc_otg.c
==
--- stable/10/sys/dev/usb/controller/dwc_otg.c  Sat Aug 29 04:33:31 2015
(r287270)
+++ stable/10/sys/dev/usb/controller/dwc_otg.c  Sat Aug 29 06:07:55 2015
(r287271)
@@ -1,6 +1,7 @@
 /* $FreeBSD$ */
 /*-
- * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ * Copyright (c) 2015 Daisuke Aoyama. All rights reserved.
+ * Copyright (c) 2012-2015 Hans Petter Selasky. All rights reserved.
  * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -152,7 +153,6 @@ static void dwc_otg_do_poll(struct usb_b
 static void dwc_otg_standard_done(struct usb_xfer *);
 static void dwc_otg_root_intr(struct dwc_otg_softc *);
 static void dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *);
-static void dwc_otg_host_channel_disable(struct dwc_otg_softc *, uint8_t);
 
 /*
  * Here is a configuration that the chip supports.
@@ -225,7 +225,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc *
/* split equally for IN and OUT */
fifo_size /= 2;
 
-   /* align to 4 bytes boundary */
+   /* Align to 4 bytes boundary (refer to PGM) */
fifo_size &= ~3;
 
/* set global receive FIFO size */
@@ -238,13 +238,6 @@ dwc_otg_init_fifo(struct dwc_otg_softc *
return (EINVAL);
}
 
-   /* disable any leftover host channels */
-   for (x = 0; x != sc->sc_host_ch_max; x++) {
-   if (sc->sc_chan_state[x].wait_sof == 0)
-   continue;
-   dwc_otg_host_channel_disable(sc, x);
-   }
-
if (mode == DWC_MODE_HOST) {
 
/* reset active endpoints */
@@ -253,6 +246,8 @@ dwc_otg_init_fifo(struct dwc_otg_softc *
/* split equally for periodic and non-periodic */
fifo_size /= 2;
 
+   DPRINTF("PTX/NPTX FIFO=%u\n", fifo_size);
+
/* align to 4 bytes boundary */
fifo_size &= ~3;
 
@@ -263,7 +258,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc *
tx_start += fifo_size;
 
for (x = 0; x != sc->sc_host_ch_max; x++) {
-   /* disable all host interrupts */
+   /* enable all host interrupts */
DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x),
HCINT_DEFAULT_MASK);
}
@@ -275,13 +270,6 @@ dwc_otg_init_fifo(struct dwc_otg_softc *
/* reset host channel state */
memset(sc->sc_chan_state, 0, sizeof(sc->sc_chan_state));
 
-   /* reset FIFO TX levels */
-   sc->sc_tx_cur_p_level = 0;
-   sc->sc_tx_cur_np_level = 0;
-
-   /* store maximum periodic and non-periodic FIFO TX size */
-   sc->sc_tx_max_size = fifo_size;
-
/* enable all host channel interrupts */
DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK,
(1U << sc->sc_host_ch_max) - 1U);
@@ -314,32 +302,29 @@ dwc_otg_init_fifo(struct dwc_otg_softc *
if (x < sc->sc_dev_in_ep_max) {
uint32_t limit;
 
-   limit = (x == 1) ? DWC_OTG_MAX_TXN :
-   (DWC_OTG_MAX_TXN / 2);
+   limit = (x == 1) ? MIN(DWC_OTG_TX_MAX_FIFO_SIZE,
+   DWC_OTG_MAX_TXN) : MIN(DWC_OTG_MAX_TXN / 2,
+   DWC_OTG_TX_MAX_FIFO_SIZE);
 
-   if (fifo_size >= limit) {
-   DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x),
-   ((limit / 4) << 16) |
-   (tx_start / 4));
-   tx_start += limit;
-   fifo_size -= limit;
-   pf->usb.max_in_frame_size = 0x200;
-   pf->usb.support_in = 1;
+   /* see if there is e

svn commit: r287270 - head/sys/net

2015-08-28 Thread Adrian Chadd
Author: adrian
Date: Sat Aug 29 04:33:31 2015
New Revision: 287270
URL: https://svnweb.freebsd.org/changeset/base/287270

Log:
  Remove now unused (and #if 0'ed out) headers.

Modified:
  head/sys/net/rss_config.c

Modified: head/sys/net/rss_config.c
==
--- head/sys/net/rss_config.c   Sat Aug 29 02:41:59 2015(r287269)
+++ head/sys/net/rss_config.c   Sat Aug 29 04:33:31 2015(r287270)
@@ -53,18 +53,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if 0
-#include 
-#include 
-#include 
-#include 
-
-/* for software rss hash support */
-#include 
-#include 
-#include 
-#endif
-
 /*-
  * Operating system parts of receiver-side scaling (RSS), which allows
  * network cards to direct flows to particular receive queues based on hashes
___
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: r287269 - in stable/10/bin/pkill: . tests

2015-08-28 Thread Jamie Gritton
Author: jamie
Date: Sat Aug 29 02:41:59 2015
New Revision: 287269
URL: https://svnweb.freebsd.org/changeset/base/287269

Log:
  MFC r287012:
  
Make pkill/pgrep -j ARG take jname, not just jid.
  
  PR:   201588
  Submitted by: Daniel Shahaf 

Modified:
  stable/10/bin/pkill/Makefile
  stable/10/bin/pkill/pkill.1
  stable/10/bin/pkill/pkill.c
  stable/10/bin/pkill/tests/pgrep-j_test.sh
  stable/10/bin/pkill/tests/pkill-j_test.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/pkill/Makefile
==
--- stable/10/bin/pkill/MakefileSat Aug 29 00:05:39 2015
(r287268)
+++ stable/10/bin/pkill/MakefileSat Aug 29 02:41:59 2015
(r287269)
@@ -5,8 +5,8 @@
 
 PROG=  pkill
 
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+DPADD= ${LIBKVM} ${LIBJAIL}
+LDADD= -lkvm -ljail
 
 LINKS= ${BINDIR}/pkill ${BINDIR}/pgrep
 MLINKS=pkill.1 pgrep.1

Modified: stable/10/bin/pkill/pkill.1
==
--- stable/10/bin/pkill/pkill.1 Sat Aug 29 00:05:39 2015(r287268)
+++ stable/10/bin/pkill/pkill.1 Sat Aug 29 02:41:59 2015(r287269)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 9, 2013
+.Dd August 21, 2015
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@
 .Op Fl c Ar class
 .Op Fl d Ar delim
 .Op Fl g Ar pgrp
-.Op Fl j Ar jid
+.Op Fl j Ar jail
 .Op Fl s Ar sid
 .Op Fl t Ar tty
 .Op Fl u Ar euid
@@ -63,7 +63,7 @@
 .Op Fl U Ar uid
 .Op Fl c Ar class
 .Op Fl g Ar pgrp
-.Op Fl j Ar jid
+.Op Fl j Ar jail
 .Op Fl s Ar sid
 .Op Fl t Ar tty
 .Op Fl u Ar euid
@@ -149,16 +149,16 @@ or
 command.
 .It Fl i
 Ignore case distinctions in both the process table and the supplied pattern.
-.It Fl j Ar jid
-Restrict matches to processes inside jails with a jail ID in the 
comma-separated
-list
-.Ar jid .
-The value
+.It Fl j Ar jail
+Restrict matches to processes inside the specified jails.
+The argument
+.Ar jail
+may be
 .Dq Li any
-matches processes in any jail.
-The value
+to match processes in any jail,
 .Dq Li none
-matches processes not in jail.
+to match processes not in jail,
+or a comma-separated list of jail IDs or names.
 .It Fl l
 Long output.
 For

Modified: stable/10/bin/pkill/pkill.c
==
--- stable/10/bin/pkill/pkill.c Sat Aug 29 00:05:39 2015(r287268)
+++ stable/10/bin/pkill/pkill.c Sat Aug 29 02:41:59 2015(r287269)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #defineSTATUS_MATCH0
 #defineSTATUS_NOMATCH  1
@@ -78,7 +79,7 @@ enum listtype {
LT_GROUP,
LT_TTY,
LT_PGRP,
-   LT_JID,
+   LT_JAIL,
LT_SID,
LT_CLASS
 };
@@ -245,7 +246,7 @@ main(int argc, char **argv)
cflags |= REG_ICASE;
break;
case 'j':
-   makelist(&jidlist, LT_JID, optarg);
+   makelist(&jidlist, LT_JAIL, optarg);
criteria = 1;
break;
case 'l':
@@ -582,7 +583,7 @@ usage(void)
 
fprintf(stderr,
"usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n"
-   " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j 
jid]\n"
+   " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j 
jail]\n"
" [-s sid] [-t tty] [-u euid] pattern ...\n",
getprogname(), ustr);
 
@@ -697,7 +698,7 @@ makelist(struct listhead *head, enum lis
if (li->li_number == 0)
li->li_number = getsid(mypid);
break;
-   case LT_JID:
+   case LT_JAIL:
if (li->li_number < 0)
errx(STATUS_BADUSAGE,
 "Negative jail ID `%s'", sp);
@@ -763,15 +764,20 @@ foundtty: if ((st.st_mode & S_IFCHR) ==
 
li->li_number = st.st_rdev;
break;
-   case LT_JID:
+   case LT_JAIL: {
+   int jid;
+
if (strcmp(sp, "none") == 0)
li->li_number = 0;
else if (strcmp(sp, "any") == 0)
li->li_number = -1;
+   else if ((jid = jail_getid(sp)) != -1)
+   li->li_number = jid;
else if (*ep != '\0')
errx(STATUS_BADUSAGE,
-"Invalid jail ID `%s'", sp);
+

svn commit: r287268 - head/sys/dev/drm2/i915

2015-08-28 Thread Baptiste Daroussin
Author: bapt
Date: Sat Aug 29 00:05:39 2015
New Revision: 287268
URL: https://svnweb.freebsd.org/changeset/base/287268

Log:
  Mark ValleyView/Bay Trail as not supported

Modified:
  head/sys/dev/drm2/i915/i915_drv.c

Modified: head/sys/dev/drm2/i915/i915_drv.c
==
--- head/sys/dev/drm2/i915/i915_drv.c   Fri Aug 28 22:42:37 2015
(r287267)
+++ head/sys/dev/drm2/i915/i915_drv.c   Sat Aug 29 00:05:39 2015
(r287268)
@@ -193,6 +193,7 @@ static const struct intel_device_info in
.has_bsd_ring = 1,
.has_blt_ring = 1,
.is_valleyview = 1,
+   .not_supported = 1,
 };
 
 static const struct intel_device_info intel_valleyview_d_info = {
@@ -202,6 +203,7 @@ static const struct intel_device_info in
.has_bsd_ring = 1,
.has_blt_ring = 1,
.is_valleyview = 1,
+   .not_supported = 1,
 };
 
 static const struct intel_device_info intel_haswell_d_info = {
___
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: r287267 - stable/10/sys/fs/nfsserver

2015-08-28 Thread Rick Macklem
Author: rmacklem
Date: Fri Aug 28 22:42:37 2015
New Revision: 287267
URL: https://svnweb.freebsd.org/changeset/base/287267

Log:
  MFC: r286790
  For the case where an NFSv4.1 ExchangeID operation has the client identifier
  that already has a confirmed ClientID, the nfsrv_setclient() function would
  not fill in the clientidp being returned. As such, the value of ClientID
  returned would be whatever garbage was on the stack.
  This patch fixes the problem by filling in these fields.

Modified:
  stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Fri Aug 28 20:53:08 2015
(r287266)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Fri Aug 28 22:42:37 2015
(r287267)
@@ -406,9 +406,12 @@ nfsrv_setclient(struct nfsrv_descript *n
}
 
/* For NFSv4.1, mark that we found a confirmed clientid. */
-   if ((nd->nd_flag & ND_NFSV41) != 0)
+   if ((nd->nd_flag & ND_NFSV41) != 0) {
+   clientidp->lval[0] = clp->lc_clientid.lval[0];
+   clientidp->lval[1] = clp->lc_clientid.lval[1];
+   confirmp->lval[0] = 0;  /* Ignored by client */
confirmp->lval[1] = 1;
-   else {
+   } else {
/*
 * id and verifier match, so update the net address info
 * and get rid of any existing callback authentication
___
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: r287266 - stable/10/usr.bin/find

2015-08-28 Thread Jilles Tjoelker
Author: jilles
Date: Fri Aug 28 20:53:08 2015
New Revision: 287266
URL: https://svnweb.freebsd.org/changeset/base/287266

Log:
  MFC r286344: find: Fix segfault with very long path in -exec/-ok ... {} \;.
  
  If the resulting argument is longer than MAXPATHLEN, realloc() was called to
  extend the space, but the new pointer was not correctly stored.
  
  Different from what OpenBSD has done, rewrite brace_subst() to calculate the
  necessary space first and realloc() at most once.
  
  As before, the e_len fields are not updated in case of a realloc.
  Therefore, a following long argument will do another realloc.
  
  PR:   201750

Modified:
  stable/10/usr.bin/find/extern.h
  stable/10/usr.bin/find/misc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/find/extern.h
==
--- stable/10/usr.bin/find/extern.h Fri Aug 28 20:06:58 2015
(r287265)
+++ stable/10/usr.bin/find/extern.h Fri Aug 28 20:53:08 2015
(r287266)
@@ -32,7 +32,7 @@
 
 #include 
 
-voidbrace_subst(char *, char **, char *, int);
+voidbrace_subst(char *, char **, char *, size_t);
 PLAN   *find_create(char ***);
 int find_execute(PLAN *, char **);
 PLAN   *find_formplan(char **);

Modified: stable/10/usr.bin/find/misc.c
==
--- stable/10/usr.bin/find/misc.c   Fri Aug 28 20:06:58 2015
(r287265)
+++ stable/10/usr.bin/find/misc.c   Fri Aug 28 20:53:08 2015
(r287266)
@@ -57,23 +57,33 @@ __FBSDID("$FreeBSD$");
  * Replace occurrences of {} in s1 with s2 and return the result string.
  */
 void
-brace_subst(char *orig, char **store, char *path, int len)
+brace_subst(char *orig, char **store, char *path, size_t len)
 {
-   int plen;
-   char ch, *p;
+   const char *pastorigend, *p, *q;
+   char *dst;
+   size_t newlen, plen;
 
plen = strlen(path);
-   for (p = *store; (ch = *orig) != '\0'; ++orig)
-   if (ch == '{' && orig[1] == '}') {
-   while ((p - *store) + plen > len)
-   if (!(*store = realloc(*store, len *= 2)))
-   err(1, NULL);
-   memmove(p, path, plen);
-   p += plen;
-   ++orig;
-   } else
-   *p++ = ch;
-   *p = '\0';
+   newlen = strlen(orig) + 1;
+   pastorigend = orig + newlen;
+   for (p = orig; (q = strstr(p, "{}")) != NULL; p = q + 2) {
+   if (plen > 2 && newlen + plen - 2 < newlen)
+   errx(2, "brace_subst overflow");
+   newlen += plen - 2;
+   }
+   if (newlen > len) {
+   *store = reallocf(*store, newlen);
+   if (*store == NULL)
+   err(2, NULL);
+   }
+   dst = *store;
+   for (p = orig; (q = strstr(p, "{}")) != NULL; p = q + 2) {
+   memcpy(dst, p, q - p);
+   dst += q - p;
+   memcpy(dst, path, plen);
+   dst += plen;
+   }
+   memcpy(dst, p, pastorigend - p);
 }
 
 /*
___
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: r287236 - head/bin/df

2015-08-28 Thread John Baldwin
On Friday, August 28, 2015 07:05:06 AM Conrad Meyer wrote:
> On Fri, Aug 28, 2015 at 1:36 AM, Xin Li  wrote:
> > And then later assign a block of memory allocated from heap to it:
> >
> > p = malloc(size);
> >
> > Since p is in function scope, upon return, it's gone.  If there is no
> > other pointers that referenced the memory block referenced by p, the
> > memory block is _technically_ leaked.
> >
> > This does not matter in practice because exit() or returning from main
> > are both the points of termination, and the kernel would then reclaim
> > all memory pages that belongs to the process.  However, doing exit()
> > makes it more explicit that this is the point of no returns, actually,
> > it hints the compiler or a static analyzer to do the right thing without
> > needing to make main() a special case.
> 
> 
> So, a better commit log may have been:
> 
> "Use exit() instead of return in main() to work around a broken static 
> analyzer"
> 
> Any C static analyzer must understand main().

+1

C++ might be another case (if you want to avoid destructors for local objects
in main() for some reason, and that probably argues for preferring return over
exit in general since usually you do want to run destructors).

-- 
John Baldwin
___
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: r287265 - head/sys/kern

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 20:06:58 2015
New Revision: 287265
URL: https://svnweb.freebsd.org/changeset/base/287265

Log:
  Remove now obsolete comment.
  
  MFC After: 2 days

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Fri Aug 28 19:53:19 2015(r287264)
+++ head/sys/kern/init_main.c   Fri Aug 28 20:06:58 2015(r287265)
@@ -117,7 +117,6 @@ int bootverbose = BOOTVERBOSE;
 SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0,
"Control the output of verbose kernel messages");
 
-/* Want to avoid defining INVARIANTS if not already defined */
 #ifdef INVARIANTS
 FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance");
 #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: r287264 - head/sys/kern

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 19:53:19 2015
New Revision: 287264
URL: https://svnweb.freebsd.org/changeset/base/287264

Log:
  Per overwhelming sentiment in the code review, use FEATURE instead.
  
  Differential Revision: https://reviews.freebsd.org/D3488
  MFC After: 2 days

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Fri Aug 28 16:29:38 2015(r287263)
+++ head/sys/kern/init_main.c   Fri Aug 28 19:53:19 2015(r287264)
@@ -119,12 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, bootverbose
 
 /* Want to avoid defining INVARIANTS if not already defined */
 #ifdef INVARIANTS
-static int invariants = 1;
-#else
-static int invariants = 0;
+FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance");
 #endif
-SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, &invariants, 0,
-   "Kernel compiled with invariants");
 
 /*
  * This ensures that there is at least one entry so that the sysinit_set
___
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: r287236 - head/bin/df

2015-08-28 Thread Alexey Dokuchaev
On Fri, Aug 28, 2015 at 12:00:26PM -0400, Allan Jude wrote:
> On 2015-08-28 03:48, Garrett Cooper wrote:
> >> On Aug 28, 2015, at 00:24, O'Connor, Daniel  wrote:
> >>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
>  On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
> 
>  Probably because of libxo...
> >>>
> >>> I'm just wondering how hard is it to write sensible commit logs. :(
> >>
> >> To put it in a hopefully more helpful way..
> >> Please write why your change is doing something, not what it is doing.
> >>
> >> Saying what it is doing is OK if it's really hairy, but 99% of the time
> >> that isn't the case.
> >>
> >> Assuming this is a libxo thing the commit log should have been
> >> something like.. "Use exit out of main otherwise libxo will not flush
> >> properly" (or something similar)
> >>
> >> Although it would be surprising if libxo required you to use exit()..
> > 
> > Libxo (iirc) doesn't install atexit handlers, which means that you need
> > to use exit (or a reason facsimile) in order for it to flush its file
> > streams.
> > 
> > This is unintuitive though. I wish it did the right thing as part of
> > initializing the streams..
> 
> This has nothing to do with libxo. libxo has an optional atexit handler,
> but as long as you call xo_finish(), then everything is flushed and the
> xo handle is closed. xo_finish() is indeed called the line before this
> change.

Funny how much hypotheses/guesses/speculations it had caused.  Which just
proves the necessity of good commit logs.

But some of us had probably learned a few things about exit(), atexit
handlers, flushing the file streams, etc. so thanks for that guys. :)

./danfe
___
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: r287196 - head/sys/kern

2015-08-28 Thread Hans Petter Selasky

On 08/27/15 10:15, Julien Charbon wrote:

Author: jch
Date: Thu Aug 27 08:15:32 2015
New Revision: 287196
URL: https://svnweb.freebsd.org/changeset/base/287196

Log:
   In callout_stop(), if a callout is both pending and currently
   being serviced return 0 (fail) but it is applicable only
   mpsafe callouts.  Thanks to hselasky for finding this.

   Differential Revision:   https://reviews.freebsd.org/D3078 (Updated)
   Submitted by:hselasky
   Reviewed by: jch



Hi,

I suggest that this special case be made into a new function, named 
callout_drain_async() inspired from projects/hps_head and that r287196 
be backed out, so that callout_stop() works like before. See:


https://reviews.freebsd.org/D3521

And that the following patch be MFC'ed to -current from 
projects/hps_head after D3521.


https://svnweb.freebsd.org/changeset/base/287261

It should close the race in question.

--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: r287263 - head/sys/conf

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 16:29:38 2015
New Revision: 287263
URL: https://svnweb.freebsd.org/changeset/base/287263

Log:
  Comment out cleaning files, since it cleans too much.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Fri Aug 28 16:23:03 2015(r287262)
+++ head/sys/conf/kmod.mk   Fri Aug 28 16:29:38 2015(r287263)
@@ -361,7 +361,8 @@ _MPATH=${__MPATH:H:O:u}
 .endif
 .PATH.m: ${_MPATH}
 .for _i in ${SRCS:M*_if.[ch]}
-CLEANFILES+=   ${_i}
+#removes too much, comment out until it's more constrained.
+#CLEANFILES+=  ${_i}
 .endfor # _i
 .m.c:  ${SYSDIR}/tools/makeobjops.awk
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
___
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: r287262 - head/gnu/usr.bin/binutils

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 16:23:03 2015
New Revision: 287262
URL: https://svnweb.freebsd.org/changeset/base/287262

Log:
  Remove .WAIT hacks and put in specific dependencies.

Modified:
  head/gnu/usr.bin/binutils/Makefile

Modified: head/gnu/usr.bin/binutils/Makefile
==
--- head/gnu/usr.bin/binutils/Makefile  Fri Aug 28 16:09:29 2015
(r287261)
+++ head/gnu/usr.bin/binutils/Makefile  Fri Aug 28 16:23:03 2015
(r287262)
@@ -5,10 +5,8 @@
 SUBDIR=doc\
libiberty \
libbfd \
-   .WAIT \
libopcodes \
libbinutils \
-   .WAIT \
as \
ld \
${_objcopy} \
@@ -18,6 +16,11 @@ SUBDIR=  doc\
 _objcopy=  objcopy
 .endif
 
+SUBDIR_DEPEND_libbinutils=libbfd   # for bfdver.h
+SUBDIR_DEPEND_as=libbfd libiberty libopcodes
+SUBDIR_DEPEND_ld=libbfd libiberty
+SUBDIR_DEPEND_objcopy=libbfd libiberty libbinutils
+SUBDIR_DEPEND_objdump=libbfd libiberty libbinutils libopcodes
 
 .if !make(install)
 SUBDIR_PARALLEL=
___
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: r287236 - head/bin/df

2015-08-28 Thread Allan Jude
On 2015-08-28 03:48, Garrett Cooper wrote:
> 
>> On Aug 28, 2015, at 00:24, O'Connor, Daniel  wrote:
>>
>>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
 On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev  
> wrote:
>> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
>> New Revision: 287236
>> URL: https://svnweb.freebsd.org/changeset/base/287236
>>
>> Log:
>> Use exit() instead of return in main().
>
> Because?..

 Probably because of libxo...
>>>
>>> I'm just wondering how hard is it to write sensible commit logs. :(
>>
>> To put it in a hopefully more helpful way..
>> Please write why your change is doing something, not what it is doing.
>>
>> Saying what it is doing is OK if it's really hairy, but 99% of the time that 
>> isn't the case.
>>
>> Assuming this is a libxo thing the commit log should have been something 
>> like..
>> "Use exit out of main otherwise libxo will not flush properly"
>> (or something similar)
>>
>> Although it would be surprising if libxo required you to use exit()..
> 
> Libxo (iirc) doesn't install atexit handlers, which means that you need to 
> use exit (or a reason facsimile) in order for it to flush its file streams.
> 
> This is unintuitive though. I wish it did the right thing as part of 
> initializing the streams..
> 

This has nothing to do with libxo. libxo has an optional atexit handler,
but as long as you call xo_finish(), then everything is flushed and the
xo handle is closed. xo_finish() is indeed called the line before this
change.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r287260 - in head/sys: pc98/include x86/include

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 15:41:09 2015
New Revision: 287260
URL: https://svnweb.freebsd.org/changeset/base/287260

Log:
  Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
  This allows the owc module to compile on pc98 and seems preferable to
  adding another special case in the build system.

Added:
  head/sys/pc98/include/ofw_machdep.h   (contents, props changed)
Modified:
  head/sys/x86/include/ofw_machdep.h

Added: head/sys/pc98/include/ofw_machdep.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/pc98/include/ofw_machdep.h Fri Aug 28 15:41:09 2015
(r287260)
@@ -0,0 +1,6 @@
+/*-
+ * This file is in the public domain.
+ */
+/* $FreeBSD$ */
+
+#include 

Modified: head/sys/x86/include/ofw_machdep.h
==
--- head/sys/x86/include/ofw_machdep.h  Fri Aug 28 15:36:05 2015
(r287259)
+++ head/sys/x86/include/ofw_machdep.h  Fri Aug 28 15:41:09 2015
(r287260)
@@ -29,7 +29,7 @@
 #ifndef _MACHINE_OFW_MACHDEP_H_
 #define _MACHINE_OFW_MACHDEP_H_
 
-#include 
+#include 
 #include 
 
 typedefuint32_tcell_t;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r287259 - head/sys/sys

2015-08-28 Thread Pedro Giffuni



On 08/28/15 10:36, Pedro F. Giffuni wrote:

Author: pfg
Date: Fri Aug 28 15:36:05 2015
New Revision: 287259
URL: https://svnweb.freebsd.org/changeset/base/287259

Log:
   Add underscores to attributes when checking for __has_attribute.

   This is a good practice to avoid confusion with allowed macros.

   Suggested by:jilles



Really sorry .. this was Tijl !!

I hate it when my fingers betray me.
___
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: r287259 - head/sys/sys

2015-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug 28 15:36:05 2015
New Revision: 287259
URL: https://svnweb.freebsd.org/changeset/base/287259

Log:
  Add underscores to attributes when checking for __has_attribute.
  
  This is a good practice to avoid confusion with allowed macros.
  
  Suggested by: jilles

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 15:27:55 2015(r287258)
+++ head/sys/sys/cdefs.hFri Aug 28 15:36:05 2015(r287259)
@@ -237,12 +237,12 @@
 #define__aligned(x)__attribute__((__aligned__(x)))
 #define__section(x)__attribute__((__section__(x)))
 #endif
-#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
 #define__alloc_size(x) __attribute__((__alloc_size__(x)))
 #else
 #define__alloc_size(x)
 #endif
-#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align)
+#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
 #define__alloc_align(x)__attribute__((__alloc_align__(x)))
 #else
 #define__alloc_align(x)
@@ -535,7 +535,7 @@
  * well enough to use them in limited cases.
  */ 
 #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
-#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__)
 #define__gnu_inline__attribute__((__gnu_inline__, __artificial__))
 #else
 #define__gnu_inline__attribute__((__gnu_inline__))
@@ -787,8 +787,8 @@
  * properties that cannot be enforced by the C type system. 
  */
 
-#if __has_attribute(argument_with_type_tag) && \
-__has_attribute(type_tag_for_datatype) && !defined(lint)
+#if __has_attribute(__argument_with_type_tag__) && \
+__has_attribute(__type_tag_for_datatype__) && !defined(lint)
 #define__arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
__attribute__((__argument_with_type_tag__(arg_kind, arg_idx, 
type_tag_idx)))
 #define__datatype_type_tag(kind, type) \
___
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: r287254 - head/sys/sys

2015-08-28 Thread Pedro Giffuni



On 08/28/15 10:22, Tijl Coosemans wrote:

On Fri, 28 Aug 2015 14:06:29 + (UTC) "Pedro F. Giffuni"  
wrote:

Author: pfg
Date: Fri Aug 28 14:06:28 2015
New Revision: 287254
URL: https://svnweb.freebsd.org/changeset/base/287254

Log:
   Be more GCC-friendly with attributes

   Being clang the default compiler, we were always giving precedence to
   the __has_attribute check. Unfortunately clang generally doesn't support
   the new attributes (alloc_size was briefly supported and then reverted)
   so we were always doing both checks. Give the precedence to GCC as that is
   the working case now.

   Do the same for  __has_builtin() for consistency.

Modified:
   head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 13:57:30 2015(r287253)
+++ head/sys/sys/cdefs.hFri Aug 28 14:06:28 2015(r287254)
@@ -237,12 +237,12 @@
  #define   __aligned(x)__attribute__((__aligned__(x)))
  #define   __section(x)__attribute__((__section__(x)))
  #endif
-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)


I think you have to add underscores to the __has_attribute argument,
like __alloc_size__ here, because user code is allowed to use
alloc_size.



Hmm .. yes, it certainly won't hurt.

Thanks!

Pedro.
___
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: r287258 - head/sys/dev/mmc/host

2015-08-28 Thread Andrew Turner
Author: andrew
Date: Fri Aug 28 15:27:55 2015
New Revision: 287258
URL: https://svnweb.freebsd.org/changeset/base/287258

Log:
  Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
  subclass the dwmmc driver to allow SoC specific attachments.
  
  Sponsored by: ABT Systems Ltd

Added:
  head/sys/dev/mmc/host/dwmmc_reg.h
 - copied, changed from r287249, head/sys/dev/mmc/host/dwmmc.h
Deleted:
  head/sys/dev/mmc/host/dwmmc.h
Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 14:50:36 2015
(r287257)
+++ head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 15:27:55 2015
(r287258)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "mmcbr_if.h"
 

Copied and modified: head/sys/dev/mmc/host/dwmmc_reg.h (from r287249, 
head/sys/dev/mmc/host/dwmmc.h)
==
--- head/sys/dev/mmc/host/dwmmc.h   Fri Aug 28 09:38:18 2015
(r287249, copy source)
+++ head/sys/dev/mmc/host/dwmmc_reg.h   Fri Aug 28 15:27:55 2015
(r287258)
@@ -30,6 +30,9 @@
  * $FreeBSD$
  */
 
+#ifndef DEV_MMC_HOST_DWMMC_REG_H
+#define DEV_MMC_HOST_DWMMC_REG_H
+
 #defineSDMMC_CTRL  0x0 /* Control Register */
 #define SDMMC_CTRL_USE_IDMAC   (1 << 25)   /* Use Internal DMAC */
 #define SDMMC_CTRL_DMA_ENABLE  (1 << 5)/* */
@@ -150,3 +153,5 @@
 #define SDMMC_CLKSEL_SAMPLE_SHIFT  0
 #define SDMMC_CLKSEL_DRIVE_SHIFT   16
 #define SDMMC_CLKSEL_DIVIDER_SHIFT 24
+
+#endif /* DEV_MMC_HOST_DWMMC_REG_H */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r287254 - head/sys/sys

2015-08-28 Thread Tijl Coosemans
On Fri, 28 Aug 2015 14:06:29 + (UTC) "Pedro F. Giffuni"  
wrote:
> Author: pfg
> Date: Fri Aug 28 14:06:28 2015
> New Revision: 287254
> URL: https://svnweb.freebsd.org/changeset/base/287254
> 
> Log:
>   Be more GCC-friendly with attributes
>   
>   Being clang the default compiler, we were always giving precedence to
>   the __has_attribute check. Unfortunately clang generally doesn't support
>   the new attributes (alloc_size was briefly supported and then reverted)
>   so we were always doing both checks. Give the precedence to GCC as that is
>   the working case now.
>   
>   Do the same for  __has_builtin() for consistency.
> 
> Modified:
>   head/sys/sys/cdefs.h
> 
> Modified: head/sys/sys/cdefs.h
> ==
> --- head/sys/sys/cdefs.h  Fri Aug 28 13:57:30 2015(r287253)
> +++ head/sys/sys/cdefs.h  Fri Aug 28 14:06:28 2015(r287254)
> @@ -237,12 +237,12 @@
>  #define  __aligned(x)__attribute__((__aligned__(x)))
>  #define  __section(x)__attribute__((__section__(x)))
>  #endif
> -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
> +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)

I think you have to add underscores to the __has_attribute argument,
like __alloc_size__ here, because user code is allowed to use
alloc_size.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287257 - head/sys/boot/libstand32

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 14:50:36 2015
New Revision: 287257
URL: https://svnweb.freebsd.org/changeset/base/287257

Log:
  Add back missing -m32 for amd64 and powerpc64 that was lost
  in the move to bsd.stand.mk.

Modified:
  head/sys/boot/libstand32/Makefile

Modified: head/sys/boot/libstand32/Makefile
==
--- head/sys/boot/libstand32/Makefile   Fri Aug 28 14:26:11 2015
(r287256)
+++ head/sys/boot/libstand32/Makefile   Fri Aug 28 14:50:36 2015
(r287257)
@@ -19,6 +19,9 @@ LIB=  stand
 INTERNALLIB=
 MK_PROFILE=no
 NO_PIC=
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
+CFLAGS+=   -m32 -I.
+.endif
 
 WARNS?=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: r287217 - head/usr.sbin/syslogd

2015-08-28 Thread Joerg Sonnenberger
On Fri, Aug 28, 2015 at 10:17:56PM +1000, Bruce Evans wrote:
> >-static void die(int);
> >+static void die(int) __dead2;
> 
> Since the function is static, it is very easy for the compiler to see
> that it doesn't return.

But the compiler can't tell if it is the *intention* that the function
never returns. The warning behavior exists because that can easily
change with macros etc. 

> Even gcc-4.2.1 does this by default, since
> -O implies -funit-at-a-time for gcc-4.2.1.  For clang, there is no way
> to prevent this (except possibly -O0) since, since -fno-unit-at-a-time
> is broken in clang.

It is not broken. It is loadly ignored as unsupported. The very
existance of the option in GCC has always been a concession to broken
and badly written code, including of course GCC's own CRT.

Joerg
___
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: r287256 - head/sys/fs/nfs

2015-08-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug 28 14:26:11 2015
New Revision: 287256
URL: https://svnweb.freebsd.org/changeset/base/287256

Log:
  Fix an NFS server bug that manifested in "ls -al" displaying a plus
  sign on every directory exported via NFSv4 with NFSv4 ACLs enabled.
  
  Reviewed by:  rmacklem@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3502

Modified:
  head/sys/fs/nfs/nfs_commonacl.c

Modified: head/sys/fs/nfs/nfs_commonacl.c
==
--- head/sys/fs/nfs/nfs_commonacl.c Fri Aug 28 14:13:01 2015
(r287255)
+++ head/sys/fs/nfs/nfs_commonacl.c Fri Aug 28 14:26:11 2015
(r287256)
@@ -347,6 +347,8 @@ nfsrv_buildace(struct nfsrv_descript *nd
acemask |= NFSV4ACE_WRITEACL;
if (ace->ae_perm & ACL_WRITE_OWNER)
acemask |= NFSV4ACE_WRITEOWNER;
+   if (ace->ae_perm & ACL_SYNCHRONIZE)
+   acemask |= NFSV4ACE_SYNCHRONIZE;
} else {
if (ace->ae_perm & ACL_READ_DATA)
acemask |= NFSV4ACE_READDATA;
___
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: r287255 - head/sys/sys

2015-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug 28 14:13:01 2015
New Revision: 287255
URL: https://svnweb.freebsd.org/changeset/base/287255

Log:
  trailing space

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 14:06:28 2015(r287254)
+++ head/sys/sys/cdefs.hFri Aug 28 14:13:01 2015(r287255)
@@ -382,7 +382,7 @@
 #define__returns_twice
 #endif
 
-#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) 
+#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable)
 #define__unreachable() __builtin_unreachable()
 #else
 #define__unreachable() ((void)0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287254 - head/sys/sys

2015-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug 28 14:06:28 2015
New Revision: 287254
URL: https://svnweb.freebsd.org/changeset/base/287254

Log:
  Be more GCC-friendly with attributes
  
  Being clang the default compiler, we were always giving precedence to
  the __has_attribute check. Unfortunately clang generally doesn't support
  the new attributes (alloc_size was briefly supported and then reverted)
  so we were always doing both checks. Give the precedence to GCC as that is
  the working case now.
  
  Do the same for  __has_builtin() for consistency.

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 13:57:30 2015(r287253)
+++ head/sys/sys/cdefs.hFri Aug 28 14:06:28 2015(r287254)
@@ -237,12 +237,12 @@
 #define__aligned(x)__attribute__((__aligned__(x)))
 #define__section(x)__attribute__((__section__(x)))
 #endif
-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)
 #define__alloc_size(x) __attribute__((__alloc_size__(x)))
 #else
 #define__alloc_size(x)
 #endif
-#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9)
+#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align)
 #define__alloc_align(x)__attribute__((__alloc_align__(x)))
 #else
 #define__alloc_align(x)
@@ -382,7 +382,7 @@
 #define__returns_twice
 #endif
 
-#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6)
+#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) 
 #define__unreachable() __builtin_unreachable()
 #else
 #define__unreachable() ((void)0)
@@ -535,7 +535,7 @@
  * well enough to use them in limited cases.
  */ 
 #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
-#if __has_attribute(artificial) || __GNUC_PREREQ__(4, 3)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial)
 #define__gnu_inline__attribute__((__gnu_inline__, __artificial__))
 #else
 #define__gnu_inline__attribute__((__gnu_inline__))
___
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: r287236 - head/bin/df

2015-08-28 Thread Conrad Meyer
On Fri, Aug 28, 2015 at 1:36 AM, Xin Li  wrote:
>
>
> On 8/27/15 21:43, Alexey Dokuchaev wrote:
>> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
>>> New Revision: 287236
>>> URL: https://svnweb.freebsd.org/changeset/base/287236
>>>
>>> Log:
>>>   Use exit() instead of return in main().
>>
>> Because?..
>
> Because the explicit exit() have a subtle difference from returning from
> main(), and that could confuse static analyzers.  I thought it was
> obvious and too much for trivial changes like this.  Let me try again:
>
> C standard defines that when main() returns to the startup code, the
> latter is required by the standard to call exit() with main()'s return
> value, should main() be defined to return a type compatible with int.
> On FreeBSD, this is done by lib/csu/${ARCH}/crt1.c.
>
> Note, however, that return'ing from a C function means the stack
> contents, for example, variables defined in function scope, are
> discarded.  Therefore, if, let's say one defined a pointer in the
> function scope, like:
>
> void *p;
>
> And then later assign a block of memory allocated from heap to it:
>
> p = malloc(size);
>
> Since p is in function scope, upon return, it's gone.  If there is no
> other pointers that referenced the memory block referenced by p, the
> memory block is _technically_ leaked.
>
> This does not matter in practice because exit() or returning from main
> are both the points of termination, and the kernel would then reclaim
> all memory pages that belongs to the process.  However, doing exit()
> makes it more explicit that this is the point of no returns, actually,
> it hints the compiler or a static analyzer to do the right thing without
> needing to make main() a special case.


So, a better commit log may have been:

"Use exit() instead of return in main() to work around a broken static analyzer"

Any C static analyzer must understand main().

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


Re: svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs

2015-08-28 Thread Warner Losh
I'm testing a fix now. Not sure why I didn't see it until now.

Warner


On Fri, Aug 28, 2015 at 7:45 AM, Nikolai Lifanov 
wrote:

> On 08/27/15 19:46, Warner Losh wrote:
> > Author: imp
> > Date: Thu Aug 27 23:46:42 2015
> > New Revision: 287227
> > URL: https://svnweb.freebsd.org/changeset/base/287227
> >
> > Log:
> >   Use CFLAGS_NO_SIMD in preference to varying lists of -mno- flags.
> >   Go ahead and defined -D_STANDALONE for all targets (only strictly
> >   needed for some architecture, but harmless on those it isn't required
> >   for). Also add -msoft-float to all architectures uniformly rather
> >   that higgley piggley like it is today.
> >
> >   Differential Revision: https://reviews.freebsd.org/D3496
> >
> > Added:
> >   head/share/mk/bsd.stand.mk   (contents, props changed)
> > Modified:
> >   head/lib/libstand/Makefile
> >   head/sys/boot/efi/Makefile.inc
> >   head/sys/boot/ficl/Makefile
> >   head/sys/boot/i386/Makefile.inc
> >   head/sys/boot/libstand32/Makefile
> >   head/sys/boot/pc98/Makefile.inc
> >   head/sys/boot/userboot/ficl/Makefile
> >   head/sys/boot/userboot/libstand/Makefile
> >   head/sys/boot/zfs/Makefile
> >
>
> Hi! I get this on amd64 after this commit:
>
> --- sys.all__D ---
> ld: i386:x86-64 architecture of input file
>
> `/usr/obj/usr/src/sys/boot/i386/gptboot/../../libstand32/libstand.a(qdivrem.o)'
> is incompatible with i386 output
> *** [gptboot.out] Error code 1
>
> - Nikolai Lifanov
>
>
___
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: r287253 - head/sys/conf

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 13:57:30 2015
New Revision: 287253
URL: https://svnweb.freebsd.org/changeset/base/287253

Log:
  Fix cleaning of files generated from .m sources.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Fri Aug 28 12:02:40 2015(r287252)
+++ head/sys/conf/kmod.mk   Fri Aug 28 13:57:30 2015(r287253)
@@ -360,11 +360,9 @@ __MPATH!=find ${SYSDIR:tA}/ -name \*_if.
 _MPATH=${__MPATH:H:O:u}
 .endif
 .PATH.m: ${_MPATH}
-.for _s in ${SRCS:M*_if.[ch]}
-.if eixsts(${_s:R}.m})
-CLEANFILES+=   ${_s}
-.endif
-.endfor # _s
+.for _i in ${SRCS:M*_if.[ch]}
+CLEANFILES+=   ${_i}
+.endfor # _i
 .m.c:  ${SYSDIR}/tools/makeobjops.awk
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
 
___
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: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs

2015-08-28 Thread Nikolai Lifanov
On 08/27/15 19:46, Warner Losh wrote:
> Author: imp
> Date: Thu Aug 27 23:46:42 2015
> New Revision: 287227
> URL: https://svnweb.freebsd.org/changeset/base/287227
> 
> Log:
>   Use CFLAGS_NO_SIMD in preference to varying lists of -mno- flags.
>   Go ahead and defined -D_STANDALONE for all targets (only strictly
>   needed for some architecture, but harmless on those it isn't required
>   for). Also add -msoft-float to all architectures uniformly rather
>   that higgley piggley like it is today.
>   
>   Differential Revision: https://reviews.freebsd.org/D3496
> 
> Added:
>   head/share/mk/bsd.stand.mk   (contents, props changed)
> Modified:
>   head/lib/libstand/Makefile
>   head/sys/boot/efi/Makefile.inc
>   head/sys/boot/ficl/Makefile
>   head/sys/boot/i386/Makefile.inc
>   head/sys/boot/libstand32/Makefile
>   head/sys/boot/pc98/Makefile.inc
>   head/sys/boot/userboot/ficl/Makefile
>   head/sys/boot/userboot/libstand/Makefile
>   head/sys/boot/zfs/Makefile
> 

Hi! I get this on amd64 after this commit:

--- sys.all__D ---
ld: i386:x86-64 architecture of input file
`/usr/obj/usr/src/sys/boot/i386/gptboot/../../libstand32/libstand.a(qdivrem.o)'
is incompatible with i386 output
*** [gptboot.out] Error code 1

- Nikolai Lifanov

___
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: r287236 - head/bin/df

2015-08-28 Thread Warner Losh
On Fri, Aug 28, 2015 at 1:48 AM, Garrett Cooper 
wrote:

>
> Libxo (iirc) doesn't install atexit handlers, which means that you need to
> use exit (or a reason facsimile) in order for it to flush its file streams.
>
> This is unintuitive though. I wish it did the right thing as part of
> initializing the streams..
>

Ummm, stdio streams are flushed if you return from main() too. If it has
internal buffered data it
hasn't delivered to stdio yet and hasn't installed atexit handlers, how on
earth can it flush anything
when you call exit().

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: r287217 - head/usr.sbin/syslogd

2015-08-28 Thread Bruce Evans

On Thu, 27 Aug 2015, Xin LI wrote:


Log:
 die() would never return, mark it as so.


Why?  (Except to add a style bug.)


Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Thu Aug 27 17:16:18 2015
(r287216)
+++ head/usr.sbin/syslogd/syslogd.c Thu Aug 27 18:11:00 2015
(r287217)
@@ -324,7 +324,7 @@ static const char *cvthname(struct socka
static void deadq_enter(pid_t, const char *);
static int  deadq_remove(pid_t);
static int  decode(const char *, const CODE *);
-static voiddie(int);
+static voiddie(int) __dead2;


Since the function is static, it is very easy for the compiler to see
that it doesn't return.  Even gcc-4.2.1 does this by default, since
-O implies -funit-at-a-time for gcc-4.2.1.  For clang, there is no way
to prevent this (except possibly -O0) since, since -fno-unit-at-a-time
is broken in clang.

Several other functions in the same file are still missing this style
bug:

- usage().  The style bug is clearly documented for usage() by its
  absence in style(9) and in most files that have usage().  Howvever,
  about 30 declarations of usage() in /usr/src have the style bug.

- timedout().  This is a signal handler, so doesn't really need it.
  This is broken signal handler.  It carefully uses _exit() so as
  to not use stdio in a signal handler, but defeats this by also
  using errx().

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


svn commit: r287252 - stable/9/sys/dev/md

2015-08-28 Thread Andrey V. Elsukov
Author: ae
Date: Fri Aug 28 12:02:40 2015
New Revision: 287252
URL: https://svnweb.freebsd.org/changeset/base/287252

Log:
  MFC r286720:
Use g_conf_printf_escaped() to escape illegal symbols in file name.
  
PR: 202289

Modified:
  stable/9/sys/dev/md/md.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/md/md.c
==
--- stable/9/sys/dev/md/md.cFri Aug 28 11:56:20 2015(r287251)
+++ stable/9/sys/dev/md/md.cFri Aug 28 12:02:40 2015(r287252)
@@ -88,6 +88,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -1540,9 +1541,11 @@ g_md_dumpconf(struct sbuf *sb, const cha
indent, (uintmax_t) mp->mediasize);
sbuf_printf(sb, "%s%s\n", indent,
type);
-   if (mp->type == MD_VNODE && mp->vnode != NULL)
-   sbuf_printf(sb, "%s%s\n",
-   indent, mp->file);
+   if (mp->type == MD_VNODE && mp->vnode != NULL) {
+   sbuf_printf(sb, "%s", indent);
+   g_conf_printf_escaped(sb, "%s", mp->file);
+   sbuf_printf(sb, "\n");
+   }
}
}
 }
___
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: r287251 - stable/10/sys/dev/md

2015-08-28 Thread Andrey V. Elsukov
Author: ae
Date: Fri Aug 28 11:56:20 2015
New Revision: 287251
URL: https://svnweb.freebsd.org/changeset/base/287251

Log:
  MFC r286720:
Use g_conf_printf_escaped() to escape illegal symbols in file name.
  
PR: 202289

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

Modified: stable/10/sys/dev/md/md.c
==
--- stable/10/sys/dev/md/md.c   Fri Aug 28 10:34:37 2015(r287250)
+++ stable/10/sys/dev/md/md.c   Fri Aug 28 11:56:20 2015(r287251)
@@ -89,6 +89,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -1621,9 +1622,11 @@ g_md_dumpconf(struct sbuf *sb, const cha
"read-only");
sbuf_printf(sb, "%s%s\n", indent,
type);
-   if (mp->type == MD_VNODE && mp->vnode != NULL)
-   sbuf_printf(sb, "%s%s\n",
-   indent, mp->file);
+   if (mp->type == MD_VNODE && mp->vnode != NULL) {
+   sbuf_printf(sb, "%s", indent);
+   g_conf_printf_escaped(sb, "%s", mp->file);
+   sbuf_printf(sb, "\n");
+   }
}
}
 }
___
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: r287250 - head/sys/dev/mmc/host

2015-08-28 Thread Andrew Turner
Author: andrew
Date: Fri Aug 28 10:34:37 2015
New Revision: 287250
URL: https://svnweb.freebsd.org/changeset/base/287250

Log:
  Only check for the bus frequency if it has not already been set, for
  example through a driver running as a subclass of this.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 09:38:18 2015
(r287249)
+++ head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 10:34:37 2015
(r287250)
@@ -481,10 +481,12 @@ parse_fdt(struct dwmmc_softc *sc)
 * what the clock is supplied for our device.
 * For now rely on the value specified in FDT.
 */
-   if ((len = OF_getproplen(node, "bus-frequency")) <= 0)
-   return (ENXIO);
-   OF_getencprop(node, "bus-frequency", dts_value, len);
-   sc->bus_hz = dts_value[0];
+   if (sc->bus_hz == 0) {
+   if ((len = OF_getproplen(node, "bus-frequency")) <= 0)
+   return (ENXIO);
+   OF_getencprop(node, "bus-frequency", dts_value, len);
+   sc->bus_hz = dts_value[0];
+   }
 
/*
 * Platform-specific stuff
___
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: r287249 - head/sys/netinet6

2015-08-28 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Aug 28 09:38:18 2015
New Revision: 287249
URL: https://svnweb.freebsd.org/changeset/base/287249

Log:
  remove a left-over after r220463 empty #ifdef INET check.
  
  MFC after:1 week

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Fri Aug 28 07:31:19 2015
(r287248)
+++ head/sys/netinet6/udp6_usrreq.c Fri Aug 28 09:38:18 2015
(r287249)
@@ -1243,8 +1243,6 @@ udp6_send(struct socket *so, int flags, 
INP_HASH_WLOCK(pcbinfo);
error = udp6_output(inp, m, addr, control, td);
INP_HASH_WUNLOCK(pcbinfo);
-#ifdef INET
-#endif 
INP_WUNLOCK(inp);
return (error);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2015-08-28 Thread Julien Charbon

 Hi Konstantin,

On 27/08/15 19:19, Konstantin Belousov wrote:
> On Thu, Aug 27, 2015 at 06:28:03PM +0200, Julien Charbon wrote:
>> On 27/08/15 12:49, Konstantin Belousov wrote:
>>> On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote:
  As I said, I am not opposed to back out this change, callout(9) API in
 mpsafe mode is a already complex/subtle API, it won't change too much
 the current complexity.

  Let say that if nobody screams until Friday 8/28, I will put back
 r284245 and revert this change _and_ I will make this case clear in the
 man page.
>>>
>>> [Replying to a random message in the whole set of conversations]
>>>
>>> There is one more case, besides TCP timers, which is equially, of not
>>> more, critical and sensitive WRT to the callout_stop().  Look at the
>>> sys/kern/subr_sleepqueue.c:sleepq_check_timeout().  Stray return of
>>> the false result from callout_stop() causes creation of the non-killable
>>> processes:  the callout fired, we missed the wakeup and went to sleep
>>> by manually doing the context switch.  Such thread cannot be woken up.
>>>
>>> I suspect that your fix is a better approach than my attempt to look
>>> at something similar at PR 200992 (may be not).
>>
>>  This change (r286880) won't improve the PR 200992:
>>
>>  r286880 only addresses a case where callout_stop() returns 1 instead of
>> 0.  Thus the only thing that can do r286880 to PR 200992:
>>
>>  - Don't change anything the issues
>>  - Worsen the issue
>>
>>  Sorry to kill your hope of a simple and elegant fix for PR 200992.
> 
> Well, not that I am frustrated much.  Thank you for taking a look.
> Did you read the patch attached to the PR ?

 Right, I read it from here:

https://bugs.freebsd.org/bugzilla/attachment.cgi?id=157915&action=diff

 And I am not confident enough to say if it is the right way go.  I
became knowledgeable on callout calls from TCP timers (D2079 and D2763),
but that's it.

 I would propose rrs (as he introduced the 'not_on_a_list' logic) and
jhb for reviewing your patch.

 And unlike me (D3078), don't underestimate the callout complexity in
mpsafe mode. :)

--
Julien



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Xin Li


On 8/27/15 21:43, Alexey Dokuchaev wrote:
> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
>> New Revision: 287236
>> URL: https://svnweb.freebsd.org/changeset/base/287236
>>
>> Log:
>>   Use exit() instead of return in main().
> 
> Because?..

Because the explicit exit() have a subtle difference from returning from
main(), and that could confuse static analyzers.  I thought it was
obvious and too much for trivial changes like this.  Let me try again:

C standard defines that when main() returns to the startup code, the
latter is required by the standard to call exit() with main()'s return
value, should main() be defined to return a type compatible with int.
On FreeBSD, this is done by lib/csu/${ARCH}/crt1.c.

Note, however, that return'ing from a C function means the stack
contents, for example, variables defined in function scope, are
discarded.  Therefore, if, let's say one defined a pointer in the
function scope, like:

void *p;

And then later assign a block of memory allocated from heap to it:

p = malloc(size);

Since p is in function scope, upon return, it's gone.  If there is no
other pointers that referenced the memory block referenced by p, the
memory block is _technically_ leaked.

This does not matter in practice because exit() or returning from main
are both the points of termination, and the kernel would then reclaim
all memory pages that belongs to the process.  However, doing exit()
makes it more explicit that this is the point of no returns, actually,
it hints the compiler or a static analyzer to do the right thing without
needing to make main() a special case.

Cheers,



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Garrett Cooper

> On Aug 28, 2015, at 00:24, O'Connor, Daniel  wrote:
> 
>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
>>> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
 On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev  
 wrote:
> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
> New Revision: 287236
> URL: https://svnweb.freebsd.org/changeset/base/287236
> 
> Log:
> Use exit() instead of return in main().
 
 Because?..
>>> 
>>> Probably because of libxo...
>> 
>> I'm just wondering how hard is it to write sensible commit logs. :(
> 
> To put it in a hopefully more helpful way..
> Please write why your change is doing something, not what it is doing.
> 
> Saying what it is doing is OK if it's really hairy, but 99% of the time that 
> isn't the case.
> 
> Assuming this is a libxo thing the commit log should have been something 
> like..
> "Use exit out of main otherwise libxo will not flush properly"
> (or something similar)
> 
> Although it would be surprising if libxo required you to use exit()..

Libxo (iirc) doesn't install atexit handlers, which means that you need to use 
exit (or a reason facsimile) in order for it to flush its file streams.

This is unintuitive though. I wish it did the right thing as part of 
initializing the streams..
___
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: r287236 - head/bin/df

2015-08-28 Thread O'Connor, Daniel

> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
>> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev  wrote:
>>> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
 New Revision: 287236
 URL: https://svnweb.freebsd.org/changeset/base/287236
 
 Log:
  Use exit() instead of return in main().
>>> 
>>> Because?..
>> 
>> Probably because of libxo...
> 
> I'm just wondering how hard is it to write sensible commit logs. :(

To put it in a hopefully more helpful way..
Please write why your change is doing something, not what it is doing.

Saying what it is doing is OK if it's really hairy, but 99% of the time that 
isn't the case.

Assuming this is a libxo thing the commit log should have been something like..
"Use exit out of main otherwise libxo will not flush properly"
(or something similar)

Although it would be surprising if libxo required you to use exit()..

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

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