svn commit: r261541 - in head/sys: conf dev/usb dev/usb/net modules/usb modules/usb/urndis
Author: hselasky Date: Thu Feb 6 08:47:14 2014 New Revision: 261541 URL: http://svnweb.freebsd.org/changeset/base/261541 Log: Import USB RNDIS driver to FreeBSD from OpenBSD. Useful for so-called USB tethering. - Imported code from OpenBSD - Adapted code to FreeBSD - Removed some unused functions - Fixed some buffer encoding and decoding issues - Optimised data transport path a bit, by sending multiple packets at a time - Increased receive buffer to 16K Obtained from:OpenBSD Requested by: eadler @ MFC after:2 weeks Added: head/sys/dev/usb/net/if_urndis.c (contents, props changed) head/sys/dev/usb/net/if_urndisreg.h (contents, props changed) head/sys/modules/usb/urndis/ head/sys/modules/usb/urndis/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/usb.h head/sys/modules/usb/Makefile Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Thu Feb 6 07:59:05 2014(r261540) +++ head/sys/conf/NOTES Thu Feb 6 08:47:14 2014(r261541) @@ -2746,6 +2746,8 @@ deviceupgt # Ralink Technology RT2500USB wireless driver device ural # +# RNDIS USB ethernet driver +device urndis # Realtek RTL8187B/L wireless driver device urtw # Modified: head/sys/conf/files == --- head/sys/conf/files Thu Feb 6 07:59:05 2014(r261540) +++ head/sys/conf/files Thu Feb 6 08:47:14 2014(r261541) @@ -2293,9 +2293,11 @@ dev/usb/net/if_rue.c optional rue dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie +dev/usb/net/if_urndis.coptional urndis dev/usb/net/ruephy.c optional rue dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ -mos | rue | smsc | udav | ipheth +mos | rue | smsc | udav | ipheth | \ +urndis dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Added: head/sys/dev/usb/net/if_urndis.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_urndis.cThu Feb 6 08:47:14 2014 (r261541) @@ -0,0 +1,1013 @@ +/* $OpenBSD: if_urndis.c,v 1.46 2013/12/09 15:45:29 pirofti Exp $ */ + +/* + * Copyright (c) 2010 Jonathan Armani arm...@openbsd.org + * Copyright (c) 2010 Fabien Romano fab...@openbsd.org + * Copyright (c) 2010 Michael Knudsen m...@openbsd.org + * Copyright (c) 2014 Hans Petter Selasky hsela...@freebsd.org + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/stdint.h +#include sys/stddef.h +#include sys/param.h +#include sys/queue.h +#include sys/types.h +#include sys/systm.h +#include sys/socket.h +#include sys/kernel.h +#include sys/bus.h +#include sys/module.h +#include sys/lock.h +#include sys/mutex.h +#include sys/condvar.h +#include sys/sysctl.h +#include sys/sx.h +#include sys/unistd.h +#include sys/callout.h +#include sys/malloc.h +#include sys/priv.h + +#include net/if.h +#include net/if_var.h + +#include dev/usb/usb.h +#include dev/usb/usbdi.h +#include dev/usb/usbdi_util.h +#include usbdevs.h + +#defineUSB_DEBUG_VAR urndis_debug +#include dev/usb/usb_debug.h +#include dev/usb/usb_process.h +#include usb_if.h + +#include dev/usb/net/usb_ethernet.h +#include dev/usb/net/if_urndisreg.h + +#include dev/usb/usb_cdc.h + +static device_probe_t urndis_probe; +static device_attach_t urndis_attach; +static device_detach_t urndis_detach; +static device_suspend_t urndis_suspend; +static device_resume_t urndis_resume; + +static usb_callback_t urndis_bulk_write_callback; +static usb_callback_t urndis_bulk_read_callback; +static usb_callback_t urndis_intr_read_callback; + +static uether_fn_t urndis_attach_post; +static uether_fn_t urndis_init; +static uether_fn_t urndis_stop; +static uether_fn_t urndis_start;
svn commit: r261542 - head/usr.sbin/pwd_mkdb
Author: des Date: Thu Feb 6 09:57:27 2014 New Revision: 261542 URL: http://svnweb.freebsd.org/changeset/base/261542 Log: Add -p to the example (why isn't this the default?) MFC after:1 week Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 == --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Feb 6 08:47:14 2014 (r261541) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Feb 6 09:57:27 2014 (r261542) @@ -147,7 +147,7 @@ A Version 7 format password file. Regenerate the password database after manually editing or replacing the password file: .Bd -literal -offset -indent -/usr/sbin/pwd_mkdb /etc/master.passwd +/usr/sbin/pwd_mkdb -p /etc/master.passwd .Ed .Sh COMPATIBILITY Previous versions of the system had a program similar to ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261543 - head/sys/dev/usb/net
Author: hselasky Date: Thu Feb 6 10:38:40 2014 New Revision: 261543 URL: http://svnweb.freebsd.org/changeset/base/261543 Log: Fix kernelbuild when full debugging features are enabled. Pointyhat:hselasky @ MFC after:2 weeks Modified: head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/net/if_urndisreg.h Modified: head/sys/dev/usb/net/if_urndis.c == --- head/sys/dev/usb/net/if_urndis.cThu Feb 6 09:57:27 2014 (r261542) +++ head/sys/dev/usb/net/if_urndis.cThu Feb 6 10:38:40 2014 (r261543) @@ -838,7 +838,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF(invalid dataoffset %u larger than %u\n, msg.rm_dataoffset + msg.rm_datalen + (uint32_t)__offsetof(struct urndis_packet_msg, - rm_dataoffset)); + rm_dataoffset), actlen); goto tr_setup; } else if (msg.rm_datalen (uint32_t)sizeof(struct ether_header)) { ifp-if_ierrors++; Modified: head/sys/dev/usb/net/if_urndisreg.h == --- head/sys/dev/usb/net/if_urndisreg.h Thu Feb 6 09:57:27 2014 (r261542) +++ head/sys/dev/usb/net/if_urndisreg.h Thu Feb 6 10:38:40 2014 (r261543) @@ -53,7 +53,7 @@ struct urndis_softc { #defineURNDIS_LOCK(sc) mtx_lock((sc)-sc_mtx) #defineURNDIS_UNLOCK(sc) mtx_unlock((sc)-sc_mtx) -#defineURNDIS_LOCK_ASSERT(sc, what) mtx_assert((sc)-sc_mtx, (x)) +#defineURNDIS_LOCK_ASSERT(sc, what) mtx_assert((sc)-sc_mtx, (what)) #defineRNDIS_STATUS_BUFFER_OVERFLOW0x8005L #defineRNDIS_STATUS_FAILURE0xC001L ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261544 - head/sys/dev/usb/net
Author: hselasky Date: Thu Feb 6 10:47:47 2014 New Revision: 261544 URL: http://svnweb.freebsd.org/changeset/base/261544 Log: Resolve probe conflict for now. MFC after:2 weeks Modified: head/sys/dev/usb/net/if_urndis.c Modified: head/sys/dev/usb/net/if_urndis.c == --- head/sys/dev/usb/net/if_urndis.cThu Feb 6 10:38:40 2014 (r261543) +++ head/sys/dev/usb/net/if_urndis.cThu Feb 6 10:47:47 2014 (r261544) @@ -170,8 +170,11 @@ static const struct usb_ether_methods ur }; static const STRUCT_USB_HOST_ID urndis_host_devs[] = { +#if 0 + /* XXX this entry has a conflict an entry the umodem driver XXX */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), USB_IFACE_PROTOCOL(0xff)}, +#endif {USB_IFACE_CLASS(UICLASS_WIRELESS), USB_IFACE_SUBCLASS(UISUBCLASS_RF), USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(UISUBCLASS_SYNC), ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261545 - stable/10/sys/netinet
Author: ae Date: Thu Feb 6 10:48:55 2014 New Revision: 261545 URL: http://svnweb.freebsd.org/changeset/base/261545 Log: MFC r260702 (by melifaro): Fix ipfw fwd for IPv4 traffic broken by r249894. Problem case: Original lookup returns route with GW set, so gw points to rte-rt_gateway. After that we're changing dst and performing lookup another time. Since fwd host is most probably directly reachable, resulting rte does not contain rt_gateway, so gw is not set. Finally, we end with packet transmitted to proper interface but wrong link-layer address. Modified: stable/10/sys/netinet/ip_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_output.c == --- stable/10/sys/netinet/ip_output.c Thu Feb 6 10:47:47 2014 (r261544) +++ stable/10/sys/netinet/ip_output.c Thu Feb 6 10:48:55 2014 (r261545) @@ -200,6 +200,13 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip-ip_hl 2; } + /* +* dst/gw handling: +* +* dst can be rewritten but always point to ro-ro_dst +* gw is readonly but can be pointed either to dst OR rt_gatewy +* therefore we need restore GW if we're re-doing lookup +*/ gw = dst = (struct sockaddr_in *)ro-ro_dst; again: ia = NULL; @@ -219,6 +226,7 @@ again: RO_RTFREE(ro); ro-ro_lle = NULL; rte = NULL; + gw = dst; } if (rte == NULL fwd_tag == NULL) { bzero(dst, sizeof(*dst)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261546 - head/etc/devd
Author: hselasky Date: Thu Feb 6 10:52:51 2014 New Revision: 261546 URL: http://svnweb.freebsd.org/changeset/base/261546 Log: Regenerate usb.conf MFC after:2 weeks Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf == --- head/etc/devd/usb.conf Thu Feb 6 10:48:55 2014(r261545) +++ head/etc/devd/usb.conf Thu Feb 6 10:52:51 2014(r261546) @@ -5313,6 +5313,24 @@ nomatch 32 { nomatch 32 { match bus uhub[0-9]+; match mode host; + match intclass 0xe0; + match intsubclass 0x01; + match intprotocol 0x03; + action kldload -n if_urndis; +}; + +nomatch 32 { + match bus uhub[0-9]+; + match mode host; + match intclass 0xef; + match intsubclass 0x01; + match intprotocol 0x01; + action kldload -n if_urndis; +}; + +nomatch 32 { + match bus uhub[0-9]+; + match mode host; match intclass 0xff; match intsubclass 0x5d; match intprotocol 0x01; @@ -5381,5 +5399,5 @@ nomatch 32 { action kldload -n umass; }; -# 2619 USB entries processed +# 2621 USB entries processed ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261547 - head/sys/teken
Author: ray Date: Thu Feb 6 11:38:39 2014 New Revision: 261547 URL: http://svnweb.freebsd.org/changeset/base/261547 Log: Fix crash on load of bigger font. It reduce width and height of terminal, but current cursor position stay bigger that terminal window size, so next input triggers assert. Reported by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c == --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014(r261546) +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014(r261547) @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) return (t-t_winsize); } +static void +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) +{ + const teken_pos_t *cur; + + cur = t-t_winsize; + + if (cur-tp_row new-tp_row || cur-tp_col new-tp_col) + return; + if (t-t_cursor.tp_row = new-tp_row) + t-t_cursor.tp_row = new-tp_row - 1; + if (t-t_cursor.tp_col = new-tp_col) + t-t_cursor.tp_col = new-tp_col - 1; +} + void teken_set_winsize(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_reset(t); } @@ -350,6 +366,7 @@ void teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_resize(t); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261547 - head/sys/teken
On Thu, 06 Feb 2014 12:38:40 +0100, Aleksandr Rybalko r...@freebsd.org wrote: Author: ray Date: Thu Feb 6 11:38:39 2014 New Revision: 261547 URL: http://svnweb.freebsd.org/changeset/base/261547 Log: Fix crash on load of bigger font. It reduce width and height of terminal, but current cursor position stay bigger that terminal window size, so next input triggers assert. Reported by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c == --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014(r261546) +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014(r261547) @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) return (t-t_winsize); } +static void +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) Was teken... already taken? Ronald. +{ + const teken_pos_t *cur; + + cur = t-t_winsize; + + if (cur-tp_row new-tp_row || cur-tp_col new-tp_col) + return; + if (t-t_cursor.tp_row = new-tp_row) + t-t_cursor.tp_row = new-tp_row - 1; + if (t-t_cursor.tp_col = new-tp_col) + t-t_cursor.tp_col = new-tp_col - 1; +} + void teken_set_winsize(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_reset(t); } @@ -350,6 +366,7 @@ void teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_resize(t); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261549 - head/share/man/man4
Author: brueffer Date: Thu Feb 6 12:43:06 2014 New Revision: 261549 URL: http://svnweb.freebsd.org/changeset/base/261549 Log: Add a manpage for the urndis driver. Obtained from:OpenBSD Added: head/share/man/man4/urndis.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileThu Feb 6 11:40:01 2014 (r261548) +++ head/share/man/man4/MakefileThu Feb 6 12:43:06 2014 (r261549) @@ -527,6 +527,7 @@ MAN=aac.4 \ uplcom.4 \ ural.4 \ urio.4 \ + urndis.4 \ ${_urtw.4} \ urtwn.4 \ urtwnfw.4 \ @@ -716,6 +717,7 @@ MLINKS+=uath.4 if_uath.4 MLINKS+=udav.4 if_udav.4 MLINKS+=upgt.4 if_upgt.4 MLINKS+=ural.4 if_ural.4 +MLINKS+=urndis.4 if_urndis.4 MLINKS+=${_urtw.4} ${_if_urtw.4} MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 Added: head/share/man/man4/urndis.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/urndis.4Thu Feb 6 12:43:06 2014 (r261549) @@ -0,0 +1,97 @@ +.\ Copyright (c) 2010 Michael Knudsen m...@openbsd.org +.\ All rights reserved. +.\ +.\ Redistribution and use in source and binary forms, with or without +.\ modification, are permitted provided that the following conditions +.\ are met: +.\ +.\- Redistributions of source code must retain the above copyright +.\ notice, this list of conditions and the following disclaimer. +.\- Redistributions in binary form must reproduce the above +.\ copyright notice, this list of conditions and the following +.\ disclaimer in the documentation and/or other materials provided +.\ with the distribution. +.\ +.\ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\ AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\ COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +.\ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\ POSSIBILITY OF SUCH DAMAGE. +.\ +.\ $OpenBSD: urndis.4,v 1.15 2013/07/16 16:05:49 schwarze Exp $ +.\ +.\ $FreeBSD$ +.\ +.Dd February 6, 2014 +.Dt URNDIS 4 +.Os +.Sh NAME +.Nm urndis +.Nd USB Remote NDIS Ethernet device +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd device ehci +.Cd device uhci +.Cd device ohci +.Cd device xhci +.Cd device usb +.Cd device urndis +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_urndis_load=YES +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides Ethernet access over Remote NDIS (RNDIS), +allowing mobile devices such as phones and tablets to provide network access. +It is often referred to as USB tethering, +and in most cases must be explicitly enabled on the device. +.Pp +.Nm +should work with any USB RNDIS devices, +such as those commonly found on Android devices. +It does not support different media types or options. +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr usb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Ox 4.7 . +The first +.Fx +release to include it was +.Fx 10.1 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Jonathan Armani Aq Mt arm...@openbsd.org , +.An Michael Knudsen Aq Mt m...@openbsd.org , +and +.An Fabien Romano Aq Mt fab...@openbsd.org . +It was ported to +.Fx +by +.An Hans Petter Selasky Aq Mt h...@freebsd.org . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261550 - head/tools/regression/sockets/unix_passfd
Author: glebius Date: Thu Feb 6 13:18:10 2014 New Revision: 261550 URL: http://svnweb.freebsd.org/changeset/base/261550 Log: Add test case for kern/181741. Right now test fails. PR: 181741 Sponsored by: Nginx, Inc. Modified: head/tools/regression/sockets/unix_passfd/unix_passfd.c Modified: head/tools/regression/sockets/unix_passfd/unix_passfd.c == --- head/tools/regression/sockets/unix_passfd/unix_passfd.c Thu Feb 6 12:43:06 2014(r261549) +++ head/tools/regression/sockets/unix_passfd/unix_passfd.c Thu Feb 6 13:18:10 2014(r261550) @@ -29,11 +29,14 @@ #include sys/types.h #include sys/socket.h #include sys/stat.h +#include sys/sysctl.h +#include sys/un.h #include err.h #include fcntl.h #include limits.h #include stdio.h +#include stdlib.h #include string.h #include unistd.h @@ -106,11 +109,10 @@ samefile(const char *test, struct stat * } static void -sendfd(const char *test, int sockfd, int sendfd) +sendfd_payload(const char *test, int sockfd, int sendfd, +void *payload, size_t paylen) { struct iovec iovec; - char ch; - char message[CMSG_SPACE(sizeof(int))]; struct cmsghdr *cmsghdr; struct msghdr msghdr; @@ -118,13 +120,12 @@ sendfd(const char *test, int sockfd, int bzero(msghdr, sizeof(msghdr)); bzero(message, sizeof(message)); - ch = 0; msghdr.msg_control = message; msghdr.msg_controllen = sizeof(message); - iovec.iov_base = ch; - iovec.iov_len = sizeof(ch); + iovec.iov_base = payload; + iovec.iov_len = paylen; msghdr.msg_iov = iovec; msghdr.msg_iovlen = 1; @@ -138,33 +139,35 @@ sendfd(const char *test, int sockfd, int len = sendmsg(sockfd, msghdr, 0); if (len 0) err(-1, %s: sendmsg, test); - if (len != sizeof(ch)) + if (len != paylen) errx(-1, %s: sendmsg: %zd bytes sent, test, len); } static void -recvfd(const char *test, int sockfd, int *recvfd) +sendfd(const char *test, int sockfd, int sendfd) +{ + char ch; + + return (sendfd_payload(test, sockfd, sendfd, ch, sizeof(ch))); +} + +static void +recvfd_payload(const char *test, int sockfd, int *recvfd, +void *buf, size_t buflen) { struct cmsghdr *cmsghdr; - char message[CMSG_SPACE(sizeof(int))]; + char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + sizeof(int)]; struct msghdr msghdr; struct iovec iovec; ssize_t len; - char ch; bzero(msghdr, sizeof(msghdr)); - ch = 0; msghdr.msg_control = message; msghdr.msg_controllen = sizeof(message); - iovec.iov_base = ch; - iovec.iov_len = sizeof(ch); - - msghdr.msg_iov = iovec; - msghdr.msg_iovlen = 1; - - iovec.iov_len = sizeof(ch); + iovec.iov_base = buf; + iovec.iov_len = buflen; msghdr.msg_iov = iovec; msghdr.msg_iovlen = 1; @@ -172,19 +175,33 @@ recvfd(const char *test, int sockfd, int len = recvmsg(sockfd, msghdr, 0); if (len 0) err(-1, %s: recvmsg, test); - if (len != sizeof(ch)) + if (len != buflen) errx(-1, %s: recvmsg: %zd bytes received, test, len); + cmsghdr = CMSG_FIRSTHDR(msghdr); if (cmsghdr == NULL) errx(-1, %s: recvmsg: did not receive control message, test); - if (cmsghdr-cmsg_len != CMSG_LEN(sizeof(int)) || - cmsghdr-cmsg_level != SOL_SOCKET || - cmsghdr-cmsg_type != SCM_RIGHTS) + *recvfd = -1; + for (; cmsghdr != NULL; cmsghdr = CMSG_NXTHDR(msghdr, cmsghdr)) { + if (cmsghdr-cmsg_level == SOL_SOCKET + cmsghdr-cmsg_type == SCM_RIGHTS + cmsghdr-cmsg_len == CMSG_LEN(sizeof(int))) { + *recvfd = *(int *)CMSG_DATA(cmsghdr); + if (*recvfd == -1) + errx(-1, %s: recvmsg: received fd -1, test); + } + } + if (*recvfd == -1) errx(-1, %s: recvmsg: did not receive single-fd message, test); - *recvfd = *(int *)CMSG_DATA(cmsghdr); - if (*recvfd == -1) - errx(-1, %s: recvmsg: received fd -1, test); +} + +static void +recvfd(const char *test, int sockfd, int *recvfd) +{ + char ch; + + return (recvfd_payload(test, sockfd, recvfd, ch, sizeof(ch))); } int @@ -330,6 +347,43 @@ main(int argc, char *argv[]) closesocketpair(fd); printf(%s passed\n, test); + + /* +* Test for PR 181741. Receiver sets LOCAL_CREDS, and kernel +* prepends a control message to the data. Sender sends large +* payload. Payload + SCM_RIGHTS + LOCAL_CREDS hit socket buffer +* limit, and receiver receives truncated data. +*/ + test =
svn commit: r261551 - head/sys/teken
Author: ray Date: Thu Feb 6 13:28:06 2014 New Revision: 261551 URL: http://svnweb.freebsd.org/changeset/base/261551 Log: Fix typo. Pointed by: Ronald Klop Pointy hat: ray Sponsored by: The FreeBSD Foundation Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c == --- head/sys/teken/teken.c Thu Feb 6 13:18:10 2014(r261550) +++ head/sys/teken/teken.c Thu Feb 6 13:28:06 2014(r261551) @@ -339,7 +339,7 @@ teken_get_winsize(teken_t *t) } static void -taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) +teken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) { const teken_pos_t *cur; @@ -357,7 +357,7 @@ void teken_set_winsize(teken_t *t, const teken_pos_t *p) { - taken_trim_cursor_pos(t, p); + teken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_reset(t); } @@ -366,7 +366,7 @@ void teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) { - taken_trim_cursor_pos(t, p); + teken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_resize(t); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261547 - head/sys/teken
On Thu, 06 Feb 2014 13:24:53 +0100 Ronald Klop ronald-li...@klop.ws wrote: On Thu, 06 Feb 2014 12:38:40 +0100, Aleksandr Rybalko r...@freebsd.org wrote: Author: ray Date: Thu Feb 6 11:38:39 2014 New Revision: 261547 URL: http://svnweb.freebsd.org/changeset/base/261547 Log: Fix crash on load of bigger font. It reduce width and height of terminal, but current cursor position stay bigger that terminal window size, so next input triggers assert. Reported by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c == --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014(r261546) +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014(r261547) @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) return (t-t_winsize); } +static void +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) Was teken... already taken? Oops. it is almost taken :) Fixed in r261551. Thanks Ronald! Ronald. +{ + const teken_pos_t *cur; + + cur = t-t_winsize; + + if (cur-tp_row new-tp_row || cur-tp_col new-tp_col) + return; + if (t-t_cursor.tp_row = new-tp_row) + t-t_cursor.tp_row = new-tp_row - 1; + if (t-t_cursor.tp_col = new-tp_col) + t-t_cursor.tp_col = new-tp_col - 1; +} + void teken_set_winsize(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_reset(t); } @@ -350,6 +366,7 @@ void teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t-t_winsize = *p; teken_subr_do_resize(t); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org WBW -- Aleksandr Rybalko r...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261552 - in head/sys/dev/vt: . hw/fb
Author: ray Date: Thu Feb 6 15:12:44 2014 New Revision: 261552 URL: http://svnweb.freebsd.org/changeset/base/261552 Log: Add two new vt(9) driver methods: vd_drawrect and vd_setpixel. Implement vd_drawrect and vd_setpixel for vt_fb driver. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/hw/fb/vt_fb.c == --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Feb 6 13:28:06 2014 (r261551) +++ head/sys/dev/vt/hw/fb/vt_fb.c Thu Feb 6 15:12:44 2014 (r261552) @@ -45,11 +45,16 @@ static int vt_fb_ioctl(struct vt_device struct thread *td); static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); +void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, +int fill, term_color_t color); +void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); static struct vt_driver vt_fb_driver = { .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, .vd_priority = VD_PRIORITY_GENERIC+10, .vd_fb_ioctl = vt_fb_ioctl, @@ -84,6 +89,56 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff } void +vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + struct fb_info *info; + uint32_t c; + u_int o; + + info = vd-vd_softc; + c = info-fb_cmap[color]; + o = info-fb_stride * y + x * FBTYPE_GET_BYTESPP(info); + + switch (FBTYPE_GET_BYTESPP(info)) { + case 1: + info-wr1(info, o, c); + break; + case 2: + info-wr2(info, o, c); + break; + case 3: + info-wr1(info, o, (c 16) 0xff); + info-wr1(info, o + 1, (c 8) 0xff); + info-wr1(info, o + 2, c 0xff); + break; + case 4: + info-wr4(info, o, c); + break; + default: + /* panic? */ + return; + } + +} + +void +vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, +term_color_t color) +{ + int x, y; + + for (y = y1; y = y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x = x2; x++) + vt_fb_setpixel(vd, x, y, color); + } else { + vt_fb_setpixel(vd, x1, y, color); + vt_fb_setpixel(vd, x2, y, color); + } + } +} + +void vt_fb_blank(struct vt_device *vd, term_color_t color) { struct fb_info *info; Modified: head/sys/dev/vt/vt.h == --- head/sys/dev/vt/vt.hThu Feb 6 13:28:06 2014(r261551) +++ head/sys/dev/vt/vt.hThu Feb 6 15:12:44 2014(r261552) @@ -287,6 +287,9 @@ typedef void vd_putchar_t(struct vt_devi typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); typedef int vd_fb_mmap_t(struct vt_device *, vm_ooffset_t, vm_paddr_t *, int, vm_memattr_t *); +typedef void vd_drawrect_t(struct vt_device *, int, int, int, int, int, +term_color_t); +typedef void vd_setpixel_t(struct vt_device *, int, int, term_color_t); struct vt_driver { /* Console attachment. */ @@ -295,6 +298,8 @@ struct vt_driver { /* Drawing. */ vd_blank_t *vd_blank; vd_bitbltchr_t *vd_bitbltchr; + vd_drawrect_t *vd_drawrect; + vd_setpixel_t *vd_setpixel; /* Framebuffer ioctls, if present. */ vd_fb_ioctl_t *vd_fb_ioctl; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261553 - head/sys/dev/vt
Author: ray Date: Thu Feb 6 15:16:38 2014 New Revision: 261553 URL: http://svnweb.freebsd.org/changeset/base/261553 Log: Add vt_set_border function to help to change border color. Use vt_set_border to reset color after font changed (different font size may change border sizes) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c == --- head/sys/dev/vt/vt_core.c Thu Feb 6 15:12:44 2014(r261552) +++ head/sys/dev/vt/vt_core.c Thu Feb 6 15:16:38 2014(r261553) @@ -1045,6 +1045,30 @@ vt_change_font(struct vt_window *vw, str } static int +vt_set_border(struct vt_window *vw, struct vt_font *vf, term_color_t c) +{ + struct vt_device *vd = vw-vw_device; + int l, r, t, b, w, h; + + if (vd-vd_driver-vd_drawrect == NULL) + return (ENOTSUP); + + w = vd-vd_width - 1; + h = vd-vd_height - 1; + l = vd-vd_offset.tp_col - 1; + r = w - l; + t = vd-vd_offset.tp_row - 1; + b = h - t; + + vd-vd_driver-vd_drawrect(vd, 0, 0, w, t, 1, c); /* Top bar. */ + vd-vd_driver-vd_drawrect(vd, 0, t, l, b, 1, c); /* Left bar. */ + vd-vd_driver-vd_drawrect(vd, r, t, w, b, 1, c); /* Right bar. */ + vd-vd_driver-vd_drawrect(vd, 0, b, w, h, 1, c); /* Bottom bar. */ + + return (0); +} + +static int vt_proc_alive(struct vt_window *vw) { struct proc *p; @@ -1562,6 +1586,10 @@ skip_thunk: return (error); error = vt_change_font(vw, vf); + if (error == 0) { + /* XXX: replace 0 with current bg color. */ + vt_set_border(vw, vf, 0); + } vtfont_unref(vf); return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261555 - head/usr.bin/units
Author: dwmalone Date: Thu Feb 6 15:55:29 2014 New Revision: 261555 URL: http://svnweb.freebsd.org/changeset/base/261555 Log: Let units deal with Gas Mark and Stufe. Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib == --- head/usr.bin/units/units.libThu Feb 6 15:46:33 2014 (r261554) +++ head/usr.bin/units/units.libThu Feb 6 15:55:29 2014 (r261555) @@ -679,6 +679,8 @@ degreesrankine 5|9 K degrankine degreesrankine degreerankine degreesrankine degreaumur 10|8+273.15 K +gasmark25|1250 degF +Stufe 25|1125 degC drachm 60 grain poncelet 100 kg m g / sec denier .05|450 gram / m ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261558 - head/sys/dev/cxgbe
Author: scottl Date: Thu Feb 6 18:40:38 2014 New Revision: 261558 URL: http://svnweb.freebsd.org/changeset/base/261558 Log: Add a new sysctl, dev.cxgbe.N.rsrv_noflow, and a companion tunable, hw.cxgbe.rsrv_noflow. When set, queue 0 of the port is reserved for TX packets without a flowid. The hash value of packets with a flowid is bumped up by 1. The intent is to provide a private queue for link-level packets like LACP that is unlikely to overflow or suffer deep queue latency. Reviewed by: np Obtained from:Netflix MFC after:3 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h == --- head/sys/dev/cxgbe/adapter.hThu Feb 6 17:57:23 2014 (r261557) +++ head/sys/dev/cxgbe/adapter.hThu Feb 6 18:40:38 2014 (r261558) @@ -215,6 +215,7 @@ struct port_info { /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ int first_txq; /* index of first tx queue */ + int rsrv_noflowq; /* Reserve queue 0 for non-flowid packets */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ #ifdef TCP_OFFLOAD Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Feb 6 17:57:23 2014 (r261557) +++ head/sys/dev/cxgbe/t4_main.cThu Feb 6 18:40:38 2014 (r261558) @@ -197,6 +197,9 @@ TUNABLE_INT(hw.cxgbe.ntxq1g, t4_ntxq1 static int t4_nrxq1g = -1; TUNABLE_INT(hw.cxgbe.nrxq1g, t4_nrxq1g); +static int t4_rsrv_noflowq = 0; +TUNABLE_INT(hw.cxgbe.rsrv_noflowq, t4_rsrv_noflowq); + #ifdef TCP_OFFLOAD #define NOFLDTXQ_10G 8 static int t4_nofldtxq10g = -1; @@ -299,6 +302,7 @@ struct intrs_and_queues { int nrxq10g;/* # of NIC rxq's for each 10G port */ int ntxq1g; /* # of NIC txq's for each 1G port */ int nrxq1g; /* # of NIC rxq's for each 1G port */ + int rsrv_noflowq; /* Flag whether to reserve queue 0 */ #ifdef TCP_OFFLOAD int nofldtxq10g;/* # of TOE txq's for each 10G port */ int nofldrxq10g;/* # of TOE rxq's for each 10G port */ @@ -375,6 +379,7 @@ static int cxgbe_sysctls(struct port_inf static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); +static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); @@ -783,6 +788,11 @@ t4_attach(device_t dev) pi-ntxq = iaq.ntxq1g; } + if (pi-ntxq 1) + pi-rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0; + else + pi-rsrv_noflowq = 0; + rqidx += pi-nrxq; tqidx += pi-ntxq; @@ -1283,7 +1293,8 @@ cxgbe_transmit(struct ifnet *ifp, struct } if (m-m_flags M_FLOWID) - txq += (m-m_pkthdr.flowid % pi-ntxq); + txq += ((m-m_pkthdr.flowid % (pi-ntxq - pi-rsrv_noflowq)) + + pi-rsrv_noflowq); br = txq-br; if (TXQ_TRYLOCK(txq) == 0) { @@ -1735,6 +1746,7 @@ cfg_itype_and_nqueues(struct adapter *sc iaq-ntxq1g = t4_ntxq1g; iaq-nrxq10g = nrxq10g = t4_nrxq10g; iaq-nrxq1g = nrxq1g = t4_nrxq1g; + iaq-rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq-nofldtxq10g = t4_nofldtxq10g; @@ -4548,6 +4560,9 @@ cxgbe_sysctls(struct port_info *pi) pi-first_rxq, 0, index of first rx queue); SYSCTL_ADD_INT(ctx, children, OID_AUTO, first_txq, CTLFLAG_RD, pi-first_txq, 0, index of first tx queue); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, rsrv_noflowq, CTLTYPE_INT | + CTLFLAG_RW, pi, 0, sysctl_noflowq, IU, + Reserve queue 0 for non-flowid packets); #ifdef TCP_OFFLOAD if (is_offload(sc)) { @@ -4802,6 +4817,25 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS) } static int +sysctl_noflowq(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + int rc, val; + + val = pi-rsrv_noflowq; + rc = sysctl_handle_int(oidp, val, 0, req); + if (rc != 0 || req-newptr == NULL) + return (rc); + + if ((val = 1) (pi-ntxq 1)) + pi-rsrv_noflowq = 1; + else + pi-rsrv_noflowq = 0; + + return (rc); +} + +static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; ___ svn-src-all@freebsd.org mailing list
Re: svn commit: r261216 - head/sys/dev/pccbb
On Wednesday, February 05, 2014 7:26:33 pm Gavin Atkinson wrote: On Tue, 4 Feb 2014, John Baldwin wrote: On Sunday, February 02, 2014 5:34:58 pm Gavin Atkinson wrote: On Mon, 27 Jan 2014, John Baldwin wrote: Author: jhb Date: Mon Jan 27 19:49:52 2014 New Revision: 261216 URL: http://svnweb.freebsd.org/changeset/base/261216 Log: Explicitly enable I/O and memory decoding in the bridge's command register when activating an I/O or memory window on the CardBus bridge. This fixes some, but not all of my machines. One in particular, a Toshiba M5 laptop, remains broken by r254263 even with this change. Specificaly, the laptop does not notice when a card is inserted. The attached minimal patch gets things working again, though I don't know if is the correct fix or if a more involved fix is required. dmesg before and after that patch: http://people.freebsd.org/~gavin/m5-dmesg-before.txt http://people.freebsd.org/~gavin/m5-dmesg-after.txt The only difference is the cbb register dump, the one bit that I am setting in the patch. Your patch effectively reverts r254263. It may be the correct thing to do, but the question is why. :) Can you provide 'pciconf -lbc' output for this device? (You can just do 'pciconf -lbc pccbb0' in HEAD now) Full pciconf -lbc output at http://people.freebsd.org/~gavin/m5-pciconf-lbc.txt It's the same both with and without my hack-patch. Humm, no I/O port BAR. I found a copy of the cardbus spec online and there is nothing special that says it requires I/O decoding to be enabled. I guess add it with an XXX comment of some sort to note that at least one chipset requires this. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261560 - in stable/10: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern
Author: kib Date: Thu Feb 6 19:47:17 2014 New Revision: 261560 URL: http://svnweb.freebsd.org/changeset/base/261560 Log: MFC r261080: The posix_fallocate(2) syscall should return error number on error, without modifying errno. MFC r261290: The posix_madvise(3) and posix_fadvise(2) should return error on failure, same as posix_fallocate(2). Modified: stable/10/lib/libc/gen/pmadvise.c stable/10/lib/libc/sys/madvise.2 stable/10/lib/libc/sys/posix_fadvise.2 stable/10/lib/libc/sys/posix_fallocate.2 stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/pmadvise.c == --- stable/10/lib/libc/gen/pmadvise.c Thu Feb 6 18:41:20 2014 (r261559) +++ stable/10/lib/libc/gen/pmadvise.c Thu Feb 6 19:47:17 2014 (r261560) @@ -8,9 +8,19 @@ __FBSDID($FreeBSD$); #include sys/mman.h +#include errno.h int posix_madvise(void *address, size_t size, int how) { - return madvise(address, size, how); + int ret, saved_errno; + + saved_errno = errno; + if (madvise(address, size, how) == -1) { + ret = errno; + errno = saved_errno; + } else { + ret = 0; + } + return (ret); } Modified: stable/10/lib/libc/sys/madvise.2 == --- stable/10/lib/libc/sys/madvise.2Thu Feb 6 18:41:20 2014 (r261559) +++ stable/10/lib/libc/sys/madvise.2Thu Feb 6 19:47:17 2014 (r261560) @@ -28,7 +28,7 @@ .\@(#)madvise.2 8.1 (Berkeley) 6/9/93 .\ $FreeBSD$ .\ -.Dd July 19, 1996 +.Dd January 30, 2014 .Dt MADVISE 2 .Os .Sh NAME @@ -50,7 +50,10 @@ allows a process that has knowledge of i to describe it to the system. The .Fn posix_madvise -interface is identical and is provided for standards conformance. +interface is identical, except it returns an error number on error and does +not modify +.Va errno , +and is provided for standards conformance. .Pp The known behaviors are: .Bl -tag -width MADV_SEQUENTIAL Modified: stable/10/lib/libc/sys/posix_fadvise.2 == --- stable/10/lib/libc/sys/posix_fadvise.2 Thu Feb 6 18:41:20 2014 (r261559) +++ stable/10/lib/libc/sys/posix_fadvise.2 Thu Feb 6 19:47:17 2014 (r261560) @@ -28,7 +28,7 @@ .\@(#)madvise.2 8.1 (Berkeley) 6/9/93 .\ $FreeBSD$ .\ -.Dd June 19, 2012 +.Dd January 30, 2014 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -93,7 +93,7 @@ Future access to this data may require a .Sh ERRORS The .Fn posix_fadvise -system call will fail if: +system call returns zero on success, and an error on failure: .Bl -tag -width Er .It Bq Er EBADF The Modified: stable/10/lib/libc/sys/posix_fallocate.2 == --- stable/10/lib/libc/sys/posix_fallocate.2Thu Feb 6 18:41:20 2014 (r261559) +++ stable/10/lib/libc/sys/posix_fallocate.2Thu Feb 6 19:47:17 2014 (r261560) @@ -83,9 +83,8 @@ that reduces the file size to a size sma If successful, .Fn posix_fallocate returns zero. -It returns -1 on failure, and sets -.Va errno -to indicate the error. +It returns an error on failure, without setting +.Va errno . .Sh ERRORS Possible failure conditions: .Bl -tag -width Er Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c == --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 6 18:41:20 2014(r261559) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 6 19:47:17 2014(r261560) @@ -2963,8 +2963,9 @@ freebsd32_posix_fallocate(struct thread struct freebsd32_posix_fallocate_args *uap) { - return (kern_posix_fallocate(td, uap-fd, - PAIR32TO64(off_t, uap-offset), PAIR32TO64(off_t, uap-len))); + td-td_retval[0] = kern_posix_fallocate(td, uap-fd, + PAIR32TO64(off_t, uap-offset), PAIR32TO64(off_t, uap-len)); + return (0); } int @@ -2972,8 +2973,10 @@ freebsd32_posix_fadvise(struct thread *t struct freebsd32_posix_fadvise_args *uap) { - return (kern_posix_fadvise(td, uap-fd, PAIR32TO64(off_t, uap-offset), - PAIR32TO64(off_t, uap-len), uap-advice)); + td-td_retval[0] = kern_posix_fadvise(td, uap-fd, + PAIR32TO64(off_t, uap-offset), PAIR32TO64(off_t, uap-len), + uap-advice); + return (0); } int Modified: stable/10/sys/kern/vfs_syscalls.c == --- stable/10/sys/kern/vfs_syscalls.c Thu Feb 6 18:41:20 2014 (r261559) +++ stable/10/sys/kern/vfs_syscalls.c Thu Feb 6 19:47:17 2014 (r261560)
svn commit: r261561 - in stable/9: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern
Author: kib Date: Thu Feb 6 19:47:50 2014 New Revision: 261561 URL: http://svnweb.freebsd.org/changeset/base/261561 Log: MFC r261080: The posix_fallocate(2) syscall should return error number on error, without modifying errno. MFC r261290: The posix_madvise(3) and posix_fadvise(2) should return error on failure, same as posix_fallocate(2). Modified: stable/9/lib/libc/gen/pmadvise.c stable/9/lib/libc/sys/madvise.2 stable/9/lib/libc/sys/posix_fadvise.2 stable/9/lib/libc/sys/posix_fallocate.2 stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/kern/vfs_syscalls.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libc/gen/pmadvise.c == --- stable/9/lib/libc/gen/pmadvise.cThu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/gen/pmadvise.cThu Feb 6 19:47:50 2014 (r261561) @@ -8,9 +8,19 @@ __FBSDID($FreeBSD$); #include sys/mman.h +#include errno.h int posix_madvise(void *address, size_t size, int how) { - return madvise(address, size, how); + int ret, saved_errno; + + saved_errno = errno; + if (madvise(address, size, how) == -1) { + ret = errno; + errno = saved_errno; + } else { + ret = 0; + } + return (ret); } Modified: stable/9/lib/libc/sys/madvise.2 == --- stable/9/lib/libc/sys/madvise.2 Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/sys/madvise.2 Thu Feb 6 19:47:50 2014 (r261561) @@ -28,7 +28,7 @@ .\@(#)madvise.2 8.1 (Berkeley) 6/9/93 .\ $FreeBSD$ .\ -.Dd July 19, 1996 +.Dd January 30, 2014 .Dt MADVISE 2 .Os .Sh NAME @@ -50,7 +50,10 @@ allows a process that has knowledge of i to describe it to the system. The .Fn posix_madvise -interface is identical and is provided for standards conformance. +interface is identical, except it returns an error number on error and does +not modify +.Va errno , +and is provided for standards conformance. .Pp The known behaviors are: .Bl -tag -width MADV_SEQUENTIAL Modified: stable/9/lib/libc/sys/posix_fadvise.2 == --- stable/9/lib/libc/sys/posix_fadvise.2 Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/sys/posix_fadvise.2 Thu Feb 6 19:47:50 2014 (r261561) @@ -28,7 +28,7 @@ .\@(#)madvise.2 8.1 (Berkeley) 6/9/93 .\ $FreeBSD$ .\ -.Dd June 19, 2012 +.Dd January 30, 2014 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -94,7 +94,7 @@ Future access to this data may require a .Sh ERRORS The .Fn posix_fadvise -system call will fail if: +system call returns zero on success, and an error on failure: .Bl -tag -width Er .It Bq Er EBADF The Modified: stable/9/lib/libc/sys/posix_fallocate.2 == --- stable/9/lib/libc/sys/posix_fallocate.2 Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/sys/posix_fallocate.2 Thu Feb 6 19:47:50 2014 (r261561) @@ -84,9 +84,8 @@ that reduces the file size to a size sma If successful, .Fn posix_fallocate returns zero. -It returns -1 on failure, and sets -.Va errno -to indicate the error. +It returns an error on failure, without setting +.Va errno . .Sh ERRORS Possible failure conditions: .Bl -tag -width Er Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c == --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 6 19:47:17 2014(r261560) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 6 19:47:50 2014(r261561) @@ -2953,8 +2953,9 @@ freebsd32_posix_fallocate(struct thread struct freebsd32_posix_fallocate_args *uap) { - return (kern_posix_fallocate(td, uap-fd, - PAIR32TO64(off_t, uap-offset), PAIR32TO64(off_t, uap-len))); + td-td_retval[0] = kern_posix_fallocate(td, uap-fd, + PAIR32TO64(off_t, uap-offset), PAIR32TO64(off_t, uap-len)); + return (0); } int @@ -2962,8 +2963,10 @@ freebsd32_posix_fadvise(struct thread *t struct freebsd32_posix_fadvise_args *uap) { - return (kern_posix_fadvise(td, uap-fd, PAIR32TO64(off_t, uap-offset), - PAIR32TO64(off_t, uap-len), uap-advice)); + td-td_retval[0] = kern_posix_fadvise(td, uap-fd, + PAIR32TO64(off_t, uap-offset), PAIR32TO64(off_t, uap-len), + uap-advice); + return (0); } int Modified: stable/9/sys/kern/vfs_syscalls.c == --- stable/9/sys/kern/vfs_syscalls.cThu Feb 6 19:47:17 2014 (r261560) +++
svn commit: r261562 - in head/sys/arm: arm include
Author: andrew Date: Thu Feb 6 20:17:58 2014 New Revision: 261562 URL: http://svnweb.freebsd.org/changeset/base/261562 Log: Pass the kernel physical address to initarm through the boot param struct. Modified: head/sys/arm/arm/locore.S head/sys/arm/include/cpu.h Modified: head/sys/arm/arm/locore.S == --- head/sys/arm/arm/locore.S Thu Feb 6 19:47:50 2014(r261561) +++ head/sys/arm/arm/locore.S Thu Feb 6 20:17:58 2014(r261562) @@ -216,7 +216,7 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #20 /* loader info size is 20 bytes also second arg */ + mov r1, #24 /* loader info size is 24 bytes also second arg */ subssp, sp, r1 /* allocate arm_boot_params struct on stack */ bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ @@ -225,6 +225,8 @@ virt_done: str r8, [r0, #8]/* Store r1 from boot loader */ str ip, [r0, #12] /* store r2 from boot loader */ str fp, [r0, #16] /* store r3 from boot loader */ + ldr r5, =KERNPHYSADDR /* load KERNPHYSADDR as the physical address */ + str r5, [r0, #20] /* store the physical address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ Modified: head/sys/arm/include/cpu.h == --- head/sys/arm/include/cpu.h Thu Feb 6 19:47:50 2014(r261561) +++ head/sys/arm/include/cpu.h Thu Feb 6 20:17:58 2014(r261562) @@ -41,6 +41,7 @@ struct arm_boot_params { register_t abp_r1; /* r1 from the boot loader */ register_t abp_r2; /* r2 from the boot loader */ register_t abp_r3; /* r3 from the boot loader */ + vm_offset_t abp_physaddr; /* The kernel physical address */ }; void arm_vector_init(vm_offset_t, int); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261563 - head/sys/arm/arm
Author: andrew Date: Thu Feb 6 20:23:35 2014 New Revision: 261563 URL: http://svnweb.freebsd.org/changeset/base/261563 Log: Make functions only used in this file static, and remove vfp_enable as it is unused. Modified: head/sys/arm/arm/vfp.c Modified: head/sys/arm/arm/vfp.c == --- head/sys/arm/arm/vfp.c Thu Feb 6 20:17:58 2014(r261562) +++ head/sys/arm/arm/vfp.c Thu Feb 6 20:23:35 2014(r261563) @@ -42,10 +42,9 @@ __FBSDID($FreeBSD$); /* function prototypes */ unsigned int get_coprocessorACR(void); -intvfp_bounce(u_int, u_int, struct trapframe *, int); +static int vfp_bounce(u_int, u_int, struct trapframe *, int); +static void vfp_restore(struct vfp_state *); void vfp_discard(void); -void vfp_enable(void); -void vfp_restore(struct vfp_state *); void vfp_store(struct vfp_state *); void set_coprocessorACR(u_int); @@ -134,7 +133,7 @@ SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, v /* start VFP unit, restore the vfp registers from the PCB and retry * the instruction */ -int +static int vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) { u_int fpexc; @@ -196,7 +195,7 @@ vfp_bounce(u_int addr, u_int insn, struc * Eventually we will use the information that this process was the last * to use the VFP hardware and bypass the restore, just turn on the hardware. */ -void +static void vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; @@ -280,17 +279,5 @@ vfp_discard() fmxr(VFPEXC, tmp); } -/* Enable the VFP hardware without restoring registers. - * Called when the registers are still in the VFP unit - */ -void -vfp_enable() -{ - u_int tmp = 0; - - tmp = fmrx(VFPEXC); - tmp |= VFPEXC_EN; - fmxr(VFPEXC, tmp); -} #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261564 - head/sys/arm/arm
Author: andrew Date: Thu Feb 6 20:26:36 2014 New Revision: 261564 URL: http://svnweb.freebsd.org/changeset/base/261564 Log: Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c == --- head/sys/arm/arm/vm_machdep.c Thu Feb 6 20:23:35 2014 (r261563) +++ head/sys/arm/arm/vm_machdep.c Thu Feb 6 20:26:36 2014 (r261564) @@ -298,15 +298,25 @@ cpu_set_syscall_retval(struct thread *td struct trapframe *frame; int fixup; #ifdef __ARMEB__ - uint32_t insn; + u_int call; #endif frame = td-td_frame; fixup = 0; #ifdef __ARMEB__ - insn = *(u_int32_t *)(frame-tf_pc - INSN_SIZE); - if ((insn 0x000f) == SYS___syscall) { + /* +* __syscall returns an off_t while most other syscalls return an +* int. As an off_t is 64-bits and an int is 32-bits we need to +* place the returned data into r1. As the lseek and frerebsd6_lseek +* syscalls also return an off_t they do not need this fixup. +*/ +#ifdef __ARM_EABI__ + call = frame-tf_r7; +#else + call = *(u_int32_t *)(frame-tf_pc - INSN_SIZE) 0x000f; +#endif + if (call == SYS___syscall) { register_t *ap = frame-tf_r0; register_t code = ap[_QUAD_LOWWORD]; if (td-td_proc-p_sysent-sv_mask) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261565 - in head/sys/arm: arm at91 econa include s3c2xx0 xscale/ixp425
Author: andrew Date: Thu Feb 6 20:35:33 2014 New Revision: 261565 URL: http://svnweb.freebsd.org/changeset/base/261565 Log: Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us remove the need to load the kernel at a fixed address. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/machdep.h head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c Modified: head/sys/arm/arm/machdep.c == --- head/sys/arm/arm/machdep.c Thu Feb 6 20:26:36 2014(r261564) +++ head/sys/arm/arm/machdep.c Thu Feb 6 20:35:33 2014(r261565) @@ -788,7 +788,7 @@ makectx(struct trapframe *tf, struct pcb * calling pmap_bootstrap. */ void -arm_dump_avail_init(vm_offset_t ramsize, size_t max) +arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) { #ifdef LINUX_BOOT_ABI /* @@ -814,8 +814,8 @@ arm_dump_avail_init(vm_offset_t ramsize, if (max 4) panic(dump_avail too small\n); - dump_avail[0] = round_page(PHYSADDR); - dump_avail[1] = trunc_page(PHYSADDR + ramsize); + dump_avail[0] = round_page(physaddr); + dump_avail[1] = trunc_page(physaddr + ramsize); dump_avail[2] = 0; dump_avail[3] = 0; } @@ -901,7 +901,7 @@ linux_parse_boot_param(struct arm_boot_p board_id = abp-abp_r1; walker = (struct arm_lbabi_tag *) - (abp-abp_r2 + KERNVIRTADDR - KERNPHYSADDR); + (abp-abp_r2 + KERNVIRTADDR - abp-abp_physaddr); /* xxx - Need to also look for binary device tree */ if (ATAG_TAG(walker) != ATAG_CORE) @@ -979,7 +979,7 @@ freebsd_parse_boot_param(struct arm_boot ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); #endif - preload_addr_relocate = KERNVIRTADDR - KERNPHYSADDR; + preload_addr_relocate = KERNVIRTADDR - abp-abp_physaddr; return lastaddr; } #endif @@ -1081,15 +1081,15 @@ print_kenv(void) } static void -physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz) +physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz, +vm_offset_t kernload) { int i, j, cnt; - vm_offset_t phys_kernelend, kernload; + vm_offset_t phys_kernelend; uint32_t s, e, sz; struct mem_region *mp, *mp1; - phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); - kernload = KERNPHYSADDR; + phys_kernelend = kernload + (virtual_avail - KERNVIRTADDR); /* * Remove kernel physical address range from avail @@ -1331,7 +1331,7 @@ initarm(struct arm_boot_params *abp) /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + (var).pv_pa = (var).pv_va + (abp-abp_physaddr - KERNVIRTADDR); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -1352,7 +1352,7 @@ initarm(struct arm_boot_params *abp) L2_TABLE_SIZE_REAL * (i - j); kernel_pt_table[i].pv_pa = kernel_pt_table[i].pv_va - KERNVIRTADDR + - KERNPHYSADDR; + abp-abp_physaddr; } } @@ -1397,7 +1397,7 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; /* Map kernel code and data */ - pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, + pmap_map_chunk(l1pagetable, KERNVIRTADDR, abp-abp_physaddr, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -1501,7 +1501,8 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp-abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); @@ -1510,7 +1511,7 @@ initarm(struct arm_boot_params *abp) /* * Prepare map of physical memory regions available to vm subsystem. */ - physmap_init(availmem_regions, availmem_regions_sz); + physmap_init(availmem_regions, availmem_regions_sz, abp-abp_physaddr); init_param2(physmem); kdb_init(); Modified: head/sys/arm/at91/at91_machdep.c
Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail
On Wed, 05 Feb 2014 14:05:29 -0500 John Baldwin j...@freebsd.org wrote: I think having a kmem flag for jails is a hack and not the right approach. It does make a jail useless security-wise, but by masquerading as a flag, it implies that it is only partially violating security which gives a false sense of security. I think we need to differentiate between security and safety here. The allow_kmem flag disables security (protections against a malicious program which was written specially to make use of kmem/io to do something nasty and requires much more knowledge to write) but does not allow all the other things for which we have flags (raw sockets, chflags, mount). The safety aspect comes into play when you have badly behaving programs (in the sense of bugs, stupid programmers or unwanted behavior in some parts of a program). In such a case you may want to allow kmem access, but not raw socket / ... access. Having it as a flag does not imply to me that is is only partly violating security, I think it is just a matter of wording. Either in the description of the flag, or additionally in the naming of the flag (maybe more in the sense of allow.open_backdoor?) A short term solution that would permit non-security jails without having to do the longer term work that Robert would like might be to add a new per-jail flag that in effect means no security at all. Personally I wouldn't object if we replace the kmem flag with a no security at all solution, I would keep the patch locally until the long term solution may or may not surface. Note: over the years I had several people which were interested in my patch. Not an overwhelming amount, but still, there are people interested in it. Bye, Alexander. -- http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261566 - in head: sbin/dhclient tools/regression/security/cap_test
Author: brueffer Date: Thu Feb 6 21:36:14 2014 New Revision: 261566 URL: http://svnweb.freebsd.org/changeset/base/261566 Log: Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT. PR: 185382 (based on) Submitted by: Loganaden Velvindron Reviewed by: pjd MFC after:1 week Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/tools/regression/security/cap_test/cap_test_capabilities.c Modified: head/sbin/dhclient/bpf.c == --- head/sbin/dhclient/bpf.cThu Feb 6 20:35:33 2014(r261565) +++ head/sbin/dhclient/bpf.cThu Feb 6 21:36:14 2014(r261566) @@ -269,7 +269,7 @@ if_register_receive(struct interface_inf if (ioctl(info-rfdesc, BIOCLOCK, NULL) 0) error(Cannot lock bpf); - cap_rights_init(rights, CAP_IOCTL, CAP_POLL_EVENT, CAP_READ); + cap_rights_init(rights, CAP_IOCTL, CAP_EVENT, CAP_READ); if (cap_rights_limit(info-rfdesc, rights) 0 errno != ENOSYS) error(Can't limit bpf descriptor: %m); if (cap_ioctls_limit(info-rfdesc, cmds, 2) 0 errno != ENOSYS) Modified: head/sbin/dhclient/dhclient.c == --- head/sbin/dhclient/dhclient.c Thu Feb 6 20:35:33 2014 (r261565) +++ head/sbin/dhclient/dhclient.c Thu Feb 6 21:36:14 2014 (r261566) @@ -494,7 +494,7 @@ main(int argc, char *argv[]) add_protocol(AF_ROUTE, routefd, routehandler, ifi); if (shutdown(routefd, SHUT_WR) 0) error(can't shutdown route socket: %m); - cap_rights_init(rights, CAP_POLL_EVENT, CAP_READ); + cap_rights_init(rights, CAP_EVENT, CAP_READ); if (cap_rights_limit(routefd, rights) 0 errno != ENOSYS) error(can't limit route socket: %m); Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c == --- head/tools/regression/security/cap_test/cap_test_capabilities.c Thu Feb 6 20:35:33 2014(r261565) +++ head/tools/regression/security/cap_test/cap_test_capabilities.c Thu Feb 6 21:36:14 2014(r261566) @@ -396,7 +396,7 @@ try_file_ops(int filefd, int dirfd, cap_ pollfd.revents = 0; ret = poll(pollfd, 1, 0); - if (rights CAP_POLL_EVENT) + if (rights CAP_EVENT) CHECK((pollfd.revents POLLNVAL) == 0); else CHECK((pollfd.revents POLLNVAL) != 0); @@ -546,7 +546,7 @@ test_capabilities(void) TRY(CAP_SEM_POST); TRY(CAP_SEM_WAIT); TRY(CAP_POST_EVENT); - TRY(CAP_POLL_EVENT); + TRY(CAP_EVENT); TRY(CAP_IOCTL); TRY(CAP_TTYHOOK); TRY(CAP_PDGETPID); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261567 - in head/sys/boot: . i386/efi i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot libstand32
Author: emaste Date: Thu Feb 6 21:54:21 2014 New Revision: 261567 URL: http://svnweb.freebsd.org/changeset/base/261567 Log: Build a 32-bit libstand under sys/boot/ A 32-bit libstand is needed on 64-bit platforms for use by various bootloaders. Previously only the 32-bit version was built, installed as /usr/lib/libstand.a. A new 64-bit libstand consumer will arrive in the near future, so move the bootloader-specific 32-bit version to sys/boot/libstand32/. Explicitly link against this version in the 32-bit loaders. Sponsored by: The FreeBSD Foundation Added: head/sys/boot/libstand32/ head/sys/boot/libstand32/Makefile (contents, props changed) Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 head/sys/boot/i386/efi/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/Makefile.amd64 == --- head/sys/boot/Makefile.amd64Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/Makefile.amd64Thu Feb 6 21:54:21 2014 (r261567) @@ -1,5 +1,6 @@ # $FreeBSD$ SUBDIR+= efi +SUBDIR+= libstand32 SUBDIR+= zfs SUBDIR+= userboot Modified: head/sys/boot/Makefile.i386 == --- head/sys/boot/Makefile.i386 Thu Feb 6 21:36:14 2014(r261566) +++ head/sys/boot/Makefile.i386 Thu Feb 6 21:54:21 2014(r261567) @@ -1,4 +1,5 @@ # $FreeBSD$ SUBDIR+= efi +SUBDIR+= libstand32 SUBDIR+= zfs Modified: head/sys/boot/i386/efi/Makefile == --- head/sys/boot/i386/efi/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/efi/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -60,6 +60,7 @@ loader.efi: loader.sym --target=efi-app-ia32 ${.ALLSRC} ${.TARGET} LIBEFI=${.OBJDIR}/../../efi/libefi/libefi.a +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../libi386 CFLAGS+= -I${.CURDIR}/../btx/lib Modified: head/sys/boot/i386/gptboot/Makefile == --- head/sys/boot/i386/gptboot/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/gptboot/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -41,6 +41,8 @@ CFLAGS.gcc+= --param max-inline-insns-si LD_FLAGS=-static -N --gc-sections +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # Pick up ../Makefile.inc early. .include bsd.init.mk Modified: head/sys/boot/i386/gptzfsboot/Makefile == --- head/sys/boot/i386/gptzfsboot/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -38,6 +38,8 @@ CFLAGS.gcc+= --param max-inline-insns-si LD_FLAGS=-static -N --gc-sections +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # Pick up ../Makefile.inc early. .include bsd.init.mk Modified: head/sys/boot/i386/loader/Makefile == --- head/sys/boot/i386/loader/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/loader/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -69,6 +69,8 @@ LDFLAGS= -static -Ttext 0x0 LIBI386= ${.OBJDIR}/../libi386/libi386.a CFLAGS+= -I${.CURDIR}/.. +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib Modified: head/sys/boot/i386/zfsboot/Makefile == --- head/sys/boot/i386/zfsboot/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/zfsboot/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -35,6 +35,8 @@ CFLAGS.gcc+= --param max-inline-insns-si LD_FLAGS=-static -N --gc-sections +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # Pick up ../Makefile.inc early. .include bsd.init.mk Added: head/sys/boot/libstand32/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/libstand32/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -0,0 +1,196 @@ +# $FreeBSD$ +# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ +# +# Notes: +# - We don't use the libc strerror/sys_errlist because the string table is +# quite large. +# + +NO_MAN= + +.include bsd.own.mk +MK_SSP=no + +S=
svn commit: r261568 - head/lib/libstand
Author: emaste Date: Thu Feb 6 21:57:27 2014 New Revision: 261568 URL: http://svnweb.freebsd.org/changeset/base/261568 Log: Build libstand as a 64-bit library on amd64 The 32-bit bootloaders now link against libstand.a in sys/boot/libstand32, so there is no need to force /usr/lib/libstand.a to be 32-bit. Sponsored by: The FreeBSD Foundation Modified: head/lib/libstand/Makefile head/lib/libstand/libstand.3 Modified: head/lib/libstand/Makefile == --- head/lib/libstand/Makefile Thu Feb 6 21:54:21 2014(r261567) +++ head/lib/libstand/Makefile Thu Feb 6 21:57:27 2014(r261568) @@ -21,16 +21,21 @@ CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} .if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif +.if ${MACHINE_CPUARCH} == i386 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif +.if ${MACHINE_CPUARCH} == amd64 +CFLAGS+= -fPIC +.endif .if ${MACHINE} == pc98 CFLAGS+= -Os .endif .if ${MACHINE_CPUARCH} == powerpc CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG .endif -.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == powerpc64 +.if ${MACHINE_ARCH} == powerpc64 CFLAGS+= -m32 -I. .endif .if ${MACHINE_CPUARCH} == arm @@ -103,9 +108,7 @@ SRCS+= syncicache.c SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp -.if ${MACHINE_CPUARCH} == amd64 -.PATH: ${.CURDIR}/i386 -.elif ${MACHINE_ARCH} == powerpc64 +.if ${MACHINE_ARCH} == powerpc64 .PATH: ${.CURDIR}/powerpc .else .PATH: ${.CURDIR}/${MACHINE_CPUARCH} @@ -179,12 +182,3 @@ SRCS+= nandfs.c .include bsd.lib.mk -.if ${MACHINE_CPUARCH} == amd64 -beforedepend ${OBJS}: machine -cleandepend: cleanmachine -cleanmachine: - rm -f machine - -machine: - ln -s ${.CURDIR}/../../sys/i386/include machine -.endif Modified: head/lib/libstand/libstand.3 == --- head/lib/libstand/libstand.3Thu Feb 6 21:54:21 2014 (r261567) +++ head/lib/libstand/libstand.3Thu Feb 6 21:57:27 2014 (r261568) @@ -675,6 +675,6 @@ the environment functions and this manpa .Sh BUGS The lack of detailed memory usage data is unhelpful. .Pp -On the amd64 and powerpc64 architectures +On the powerpc64 architecture .Nm is a 32-bit library. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail
On Thursday, February 06, 2014 3:53:00 pm Alexander Leidinger wrote: On Wed, 05 Feb 2014 14:05:29 -0500 John Baldwin j...@freebsd.org wrote: I think having a kmem flag for jails is a hack and not the right approach. It does make a jail useless security-wise, but by masquerading as a flag, it implies that it is only partially violating security which gives a false sense of security. I think we need to differentiate between security and safety here. The allow_kmem flag disables security (protections against a malicious program which was written specially to make use of kmem/io to do something nasty and requires much more knowledge to write) but does not allow all the other things for which we have flags (raw sockets, chflags, mount). The safety aspect comes into play when you have badly behaving programs (in the sense of bugs, stupid programmers or unwanted behavior in some parts of a program). In such a case you may want to allow kmem access, but not raw socket / ... access. If a programmer writing a program can't be trusted to use a raw socket, you really think they can be trusted with kmem access? If they are careful enough to be trusted with kmem access, they are careful enough to be trusted to only open a raw socket if they need it. The problem with kmem is that it subverts everything you could put into place including capsicum, etc. Put another way: if you think you can't trust the program to not open a raw socket, then you definitely shouldn't trust it with kmem access. Also, in terms of bugs, kmem access is actually far worse! Now if you get a simple buffer overflow you might end up trashing kmem. I'd much rather a buggy program open a raw socket than be able to open /dev/kmem. Having it as a flag does not imply to me that is is only partly violating security, I think it is just a matter of wording. Either in the description of the flag, or additionally in the naming of the flag (maybe more in the sense of allow.open_backdoor?) All the other flags poke small holes in the existing jail barrier. The kmem flag shreds the barrier, so it is not of the same class. Any new flag that removes all security needs to be very explicitly labelled as such so that it is clear to users what is actually occurring. A short term solution that would permit non-security jails without having to do the longer term work that Robert would like might be to add a new per-jail flag that in effect means no security at all. Personally I wouldn't object if we replace the kmem flag with a no security at all solution, I would keep the patch locally until the long term solution may or may not surface. Note: over the years I had several people which were interested in my patch. Not an overwhelming amount, but still, there are people interested in it. Interest in a patch doesn't mean it is correct. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk
On Thu, Jan 30, 2014 at 12:44 AM, Dimitry Andric d...@freebsd.org wrote: Author: dim Date: Thu Jan 30 07:44:22 2014 New Revision: 261283 URL: http://svnweb.freebsd.org/changeset/base/261283 Log: Import libc++ 3.4 release. This contains a lot of bugfixes, and some preliminary support for C++1y. MFC after:3 weeks Added: ... head/contrib/libc++/include/locale This broke the build when WITH_TESTS=yes is set. contrib/atf/atf-c++/detail/application.cpp fails to compile as shown below. All that file does is #include several standard headers, so I think the problem is strictly within libc++. Tinderbox probably didn't catch it because the base system includes so little C++, and WITH_TESTS is off by default. By inspection, I can't tell why locale compiled before this change; the offending LOC are identical. Can you please take a look? c++ -fpic -DPIC -O2 -pipe -DHAVE_CONFIG_H -DATF_ARCH='amd64' -DATF_BUILD_CC='cc ' -DATF_BUILD_CFLAGS='-O2 -pipe ' -DATF_BUILD_CPP='cpp ' -DATF_BUILD_CPPFLAGS='' -DATF_BUILD_CXX='c++ ' -DATF_BUILD_CXXFLAGS='-O2 -pipe' -DATF_CONFDIR='/etc/atf' -DATF_C_TESTS_BASE='/usr/tests/lib/atf/libatf-c' -DATF_INCLUDEDIR='/usr/include' -DATF_LIBDIR='/usr/lib' -DATF_LIBEXECDIR='/usr/libexec' -DATF_MACHINE='amd64' -DATF_M4='/usr/bin/m4' -DATF_PKGDATADIR='/usr/share/atf' -DATF_SHELL='/bin/sh' -DATF_WORKDIR='/tmp' -I/usr/home/alans/freebsd/head/contrib/atf -I/usr/home/alans/freebsd/head/lib/atf/libatf-c++/../libatf-c -I. -DHAVE_CONFIG_H -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-c++11-extensions -c /usr/home/alans/freebsd/head/contrib/atf/atf-c++/detail/application.cpp -o application.So In file included from /usr/home/alans/freebsd/head/contrib/atf/atf-c++/detail/application.cpp:42: In file included from /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/iostream:40: In file included from /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/istream:156: In file included from /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/ostream:133: /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/locale:1015:27: error: comparison of integers of different signs: 'long' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (__a_end - __a == __buf.size()) ~ ^ /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/locale:1065:27: error: comparison of integers of different signs: 'long' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (__a_end - __a == __buf.size()) ~ ^ /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/locale:1119:27: error: comparison of integers of different signs: 'long' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (__a_end - __a == __buf.size()) ~ ^ 3 errors generated. *** [application.So] Error code 1 bmake[4]: stopped in /usr/home/alans/freebsd/head/lib/atf/libatf-c++ 1 error -Alan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261567 - in head/sys/boot: . i386/efi i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot libstand32
On 02/06/14 15:54, Ed Maste wrote: Author: emaste Date: Thu Feb 6 21:54:21 2014 New Revision: 261567 URL: http://svnweb.freebsd.org/changeset/base/261567 Log: Build a 32-bit libstand under sys/boot/ A 32-bit libstand is needed on 64-bit platforms for use by various bootloaders. Previously only the 32-bit version was built, installed as /usr/lib/libstand.a. A new 64-bit libstand consumer will arrive in the near future, so move the bootloader-specific 32-bit version to sys/boot/libstand32/. Explicitly link against this version in the 32-bit loaders. Sponsored by: The FreeBSD Foundation Please also do this for the powerpc64 bootloader, which, like amd64, is 32-bit. -Nathan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261564 - head/sys/arm/arm
Nathan Whitehorn wrote this message on Thu, Feb 06, 2014 at 21:03 -0600: On 02/06/14 14:26, Andrew Turner wrote: Author: andrew Date: Thu Feb 6 20:26:36 2014 New Revision: 261564 URL: http://svnweb.freebsd.org/changeset/base/261564 Log: Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Does this mean armeb works again? It's getting closer... I have a pending fix for off_t that I need to resolve w/ bde, and then there is the wired mapping panic issue that I've posted about to -arm... I've gotten a bit busy the last couple weeks, so I haven't had time to work on it recently... -- John-Mark Gurney Voice: +1 415 225 5579 All that I will do, has been done, All that I have, has not. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261071 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc
Hi Jason, On 01/23/14 13:47, Jason Evans wrote: Author: jasone Date: Thu Jan 23 02:47:36 2014 New Revision: 261071 URL: http://svnweb.freebsd.org/changeset/base/261071 Log: Update jemalloc to version 3.5.0. I suspect that this commit is related to the assertion failures I've been seeing on recent head when I updated from r260427 to r261453. Here's two I noticed today: jemalloc: /usr/local/poudriere/jails/head-amd64/usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:7 76: Failed assertion: binind == actual_binind *** Signal 6 and jemalloc: /usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:776: Failed assertion: binind == actual_binind Abort trap I seem to be able to reproduce the first one readily when poudriere tries to build chromium so I can provide more info and help test ideas. Cheers, Lawrence ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261571 - stable/10/sys/rpc
Author: mav Date: Fri Feb 7 04:02:14 2014 New Revision: 261571 URL: http://svnweb.freebsd.org/changeset/base/261571 Log: MFC r261449: Fix lock acquisition in case no request space available, missed in r260097. Modified: stable/10/sys/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c == --- stable/10/sys/rpc/svc.c Fri Feb 7 03:30:16 2014(r261570) +++ stable/10/sys/rpc/svc.c Fri Feb 7 04:02:14 2014(r261571) @@ -1178,9 +1178,9 @@ svc_run_internal(SVCPOOL *pool, bool_t i */ xprt-xp_lastactive = time_uptime; do { - mtx_unlock(pool-sp_lock); if (!svc_request_space_available(pool)) break; + mtx_unlock(pool-sp_lock); rqstp = NULL; stat = svc_getreq(xprt, rqstp); if (rqstp) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261572 - head/sys/arm/conf
Author: ian Date: Fri Feb 7 04:05:08 2014 New Revision: 261572 URL: http://svnweb.freebsd.org/changeset/base/261572 Log: Add option USB_HOST_ALIGN=64 for all SoCs that have 64 byte cache lines. Modified: head/sys/arm/conf/ARNDALE head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/ARNDALE == --- head/sys/arm/conf/ARNDALE Fri Feb 7 04:02:14 2014(r261571) +++ head/sys/arm/conf/ARNDALE Fri Feb 7 04:05:08 2014(r261572) @@ -94,6 +94,7 @@ devicemd device gpio # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb optionsUSB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/CUBIEBOARD == --- head/sys/arm/conf/CUBIEBOARDFri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/CUBIEBOARDFri Feb 7 04:05:08 2014 (r261572) @@ -106,6 +106,7 @@ device da # Direct Access (disks) device pass # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb optionsUSB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/CUBIEBOARD2 == --- head/sys/arm/conf/CUBIEBOARD2 Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/CUBIEBOARD2 Fri Feb 7 04:05:08 2014 (r261572) @@ -106,6 +106,7 @@ device da # Direct Access (disks) device pass # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb optionsUSB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/DIGI-CCWMX53 == --- head/sys/arm/conf/DIGI-CCWMX53 Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/DIGI-CCWMX53 Fri Feb 7 04:05:08 2014 (r261572) @@ -134,6 +134,7 @@ device cd # CD device pass# Passthrough device (direct SCSI access) # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. optionsUSB_DEBUG # enable debug msgs device ehci# OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/EFIKA_MX == --- head/sys/arm/conf/EFIKA_MX Fri Feb 7 04:02:14 2014(r261571) +++ head/sys/arm/conf/EFIKA_MX Fri Feb 7 04:05:08 2014(r261572) @@ -130,6 +130,7 @@ device cd # CD device pass# Passthrough device (direct SCSI access) # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci# OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/IMX53-QSB == --- head/sys/arm/conf/IMX53-QSB Fri Feb 7 04:02:14 2014(r261571) +++ head/sys/arm/conf/IMX53-QSB Fri Feb 7 04:05:08 2014(r261572) @@ -133,6 +133,7 @@ device cd # CD device pass# Passthrough device (direct SCSI access) # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci# OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/PANDABOARD == --- head/sys/arm/conf/PANDABOARDFri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/PANDABOARDFri Feb 7 04:05:08 2014 (r261572) @@ -112,6 +112,7 @@ device md device random # Entropy device # USB support +optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb optionsUSB_DEBUG #options USB_REQ_DEBUG ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261573 - in stable/10/sys/boot: i386/libi386 pc98/libpc98
Author: mav Date: Fri Feb 7 04:09:15 2014 New Revision: 261573 URL: http://svnweb.freebsd.org/changeset/base/261573 Log: MFC r260949: Make comconsole options set before its activation to be remembered. Modified: stable/10/sys/boot/i386/libi386/comconsole.c stable/10/sys/boot/pc98/libpc98/comconsole.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/i386/libi386/comconsole.c == --- stable/10/sys/boot/i386/libi386/comconsole.cFri Feb 7 04:05:08 2014(r261572) +++ stable/10/sys/boot/i386/libi386/comconsole.cFri Feb 7 04:09:15 2014(r261573) @@ -181,8 +181,7 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_curspeed != speed) +if (comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -200,8 +199,7 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_port != port) +if (comc_port != port) comc_setup(comc_curspeed, port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -309,6 +307,8 @@ comc_setup(int speed, int port) unsetenv(hw.uart.console); comc_curspeed = speed; comc_port = port; +if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); outb(comc_port + com_dlbl, COMC_BPS(speed) 0xff); Modified: stable/10/sys/boot/pc98/libpc98/comconsole.c == --- stable/10/sys/boot/pc98/libpc98/comconsole.cFri Feb 7 04:05:08 2014(r261572) +++ stable/10/sys/boot/pc98/libpc98/comconsole.cFri Feb 7 04:09:15 2014(r261573) @@ -181,8 +181,7 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_curspeed != speed) +if (comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -200,8 +199,7 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_port != port) +if (comc_port != port) comc_setup(comc_curspeed, port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -309,6 +307,8 @@ comc_setup(int speed, int port) unsetenv(hw.uart.console); comc_curspeed = speed; comc_port = port; +if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); outb(comc_port + com_dlbl, COMC_BPS(speed) 0xff); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261574 - in stable/9/sys/boot: i386/libi386 pc98/libpc98
Author: mav Date: Fri Feb 7 04:10:30 2014 New Revision: 261574 URL: http://svnweb.freebsd.org/changeset/base/261574 Log: MFC r260949: Make comconsole options set before its activation to be remembered. Modified: stable/9/sys/boot/i386/libi386/comconsole.c stable/9/sys/boot/pc98/libpc98/comconsole.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/comconsole.c == --- stable/9/sys/boot/i386/libi386/comconsole.c Fri Feb 7 04:09:15 2014 (r261573) +++ stable/9/sys/boot/i386/libi386/comconsole.c Fri Feb 7 04:10:30 2014 (r261574) @@ -181,8 +181,7 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_curspeed != speed) +if (comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -200,8 +199,7 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_port != port) +if (comc_port != port) comc_setup(comc_curspeed, port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -309,6 +307,8 @@ comc_setup(int speed, int port) unsetenv(hw.uart.console); comc_curspeed = speed; comc_port = port; +if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); outb(comc_port + com_dlbl, COMC_BPS(speed) 0xff); Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c == --- stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Feb 7 04:09:15 2014 (r261573) +++ stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Feb 7 04:10:30 2014 (r261574) @@ -181,8 +181,7 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_curspeed != speed) +if (comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -200,8 +199,7 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } -if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) != 0 - comc_port != port) +if (comc_port != port) comc_setup(comc_curspeed, port); env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -309,6 +307,8 @@ comc_setup(int speed, int port) unsetenv(hw.uart.console); comc_curspeed = speed; comc_port = port; +if ((comconsole.c_flags (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); outb(comc_port + com_dlbl, COMC_BPS(speed) 0xff); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261575 - stable/10/sys/dev/e1000
Author: gnn Date: Fri Feb 7 04:34:04 2014 New Revision: 261575 URL: http://svnweb.freebsd.org/changeset/base/261575 Log: MFC: 261291 The timestamp bit is number 17, and not number 9, in the stat error field of the receive descriptor. Modified: stable/10/sys/dev/e1000/e1000_defines.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/e1000_defines.h == --- stable/10/sys/dev/e1000/e1000_defines.h Fri Feb 7 04:10:30 2014 (r261574) +++ stable/10/sys/dev/e1000/e1000_defines.h Fri Feb 7 04:34:04 2014 (r261575) @@ -131,7 +131,7 @@ #define E1000_RXD_ERR_RXE 0x80/* Rx Data Error */ #define E1000_RXD_SPC_VLAN_MASK0x0FFF /* VLAN ID is in lower 12 bits */ -#define E1000_RXDEXT_STATERR_TST 0x0100 /* Time Stamp taken */ +#define E1000_RXDEXT_STATERR_TST 0x0001 /* Time Stamp taken */ #define E1000_RXDEXT_STATERR_LB0x0004 #define E1000_RXDEXT_STATERR_CE0x0100 #define E1000_RXDEXT_STATERR_SE0x0200 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261576 - stable/9/sys/dev/e1000
Author: gnn Date: Fri Feb 7 04:35:20 2014 New Revision: 261576 URL: http://svnweb.freebsd.org/changeset/base/261576 Log: MFC: 261291 The timestamp bit is number 17, and not number 9, in the stat error field of the receive descriptor. Modified: stable/9/sys/dev/e1000/e1000_defines.h Directory Properties: stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Modified: stable/9/sys/dev/e1000/e1000_defines.h == --- stable/9/sys/dev/e1000/e1000_defines.h Fri Feb 7 04:34:04 2014 (r261575) +++ stable/9/sys/dev/e1000/e1000_defines.h Fri Feb 7 04:35:20 2014 (r261576) @@ -129,7 +129,7 @@ #define E1000_RXD_ERR_RXE 0x80/* Rx Data Error */ #define E1000_RXD_SPC_VLAN_MASK0x0FFF /* VLAN ID is in lower 12 bits */ -#define E1000_RXDEXT_STATERR_TST 0x0100 /* Time Stamp taken */ +#define E1000_RXDEXT_STATERR_TST 0x0001 /* Time Stamp taken */ #define E1000_RXDEXT_STATERR_LB0x0004 #define E1000_RXDEXT_STATERR_CE0x0100 #define E1000_RXDEXT_STATERR_SE0x0200 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261570 - head/sys/arm/conf
Author: ian Date: Fri Feb 7 03:30:16 2014 New Revision: 261570 URL: http://svnweb.freebsd.org/changeset/base/261570 Log: Revert r260440. I didn't realize that most of this change was already in effect due to r250753. That is sufficient for all SoCs with a 32 byte cache line size. Systems with 64 byte cache lines will need the option; that will be done in a separate commit. Thanks to loos@ for pointing out r250753. Modified: head/sys/arm/conf/AC100 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ARNDALE head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AC100 == --- head/sys/arm/conf/AC100 Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/AC100 Fri Feb 7 03:30:16 2014(r261570) @@ -66,7 +66,6 @@ deviceloop device md # USB -optionsUSB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs #deviceusb #deviceehci Modified: head/sys/arm/conf/ARMADAXP == --- head/sys/arm/conf/ARMADAXP Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/ARMADAXP Fri Feb 7 03:30:16 2014(r261570) @@ -67,7 +67,6 @@ deviceloop device md # USB -optionsUSB_HOST_ALIGN=32 # Align usb buffers to cache line size. optionsUSB_DEBUG # enable debug msgs device usb device ehci Modified: head/sys/arm/conf/ARNDALE == --- head/sys/arm/conf/ARNDALE Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/ARNDALE Fri Feb 7 03:30:16 2014(r261570) @@ -94,7 +94,6 @@ devicemd device gpio # USB support -optionsUSB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb optionsUSB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/ATMEL == --- head/sys/arm/conf/ATMEL Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/ATMEL Fri Feb 7 03:30:16 2014(r261570) @@ -156,7 +156,6 @@ device uart# Multi-uart driver optionsALT_BREAK_TO_DEBUGGER # USB support -optionsUSB_HOST_ALIGN=32 # Align usb buffers to cache line size. optionsUSB_DEBUG # enable debug msgs device ohci# OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/AVILA == --- head/sys/arm/conf/AVILA Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/AVILA Fri Feb 7 03:30:16 2014(r261570) @@ -143,7 +143,6 @@ device ath_ar9160 device ath_ar9280 device usb -optionsUSB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: head/sys/arm/conf/BWCT == --- head/sys/arm/conf/BWCT Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/BWCT Fri Feb 7 03:30:16 2014(r261570) @@ -104,7 +104,6 @@ device spibus device bpf # Berkeley packet filter #options USB_DEBUG -optionsUSB_HOST_ALIGN=32 # Align usb buffers to cache line size. #deviceohci #deviceusb #deviceumass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/CAMBRIA == --- head/sys/arm/conf/CAMBRIA Thu Feb 6 22:10:26 2014(r261569) +++ head/sys/arm/conf/CAMBRIA Fri Feb 7 03:30:16 2014(r261570) @@
Re: svn commit: r261564 - head/sys/arm/arm
On 02/06/14 14:26, Andrew Turner wrote: Author: andrew Date: Thu Feb 6 20:26:36 2014 New Revision: 261564 URL: http://svnweb.freebsd.org/changeset/base/261564 Log: Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Does this mean armeb works again? -Nathan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261071 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc
On Feb 6, 2014, at 8:01 PM, Lawrence Stewart lstew...@freebsd.org wrote: On 01/23/14 13:47, Jason Evans wrote: Author: jasone Date: Thu Jan 23 02:47:36 2014 New Revision: 261071 URL: http://svnweb.freebsd.org/changeset/base/261071 Log: Update jemalloc to version 3.5.0. I suspect that this commit is related to the assertion failures I've been seeing on recent head when I updated from r260427 to r261453. Here's two I noticed today: jemalloc: /usr/local/poudriere/jails/head-amd64/usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:7 76: Failed assertion: binind == actual_binind *** Signal 6 and jemalloc: /usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:776: Failed assertion: binind == actual_binind Abort trap I seem to be able to reproduce the first one readily when poudriere tries to build chromium so I can provide more info and help test ideas. Cheers, Lawrence Are the failures you saw happening only for the chromium build, or have you seen that same failure for other things as well? If it’s just the chromium build, is there any chance that this same failure would have occurred prior to the jemalloc 3.5.0 update? If this is an application bug, it’s probably due do a buffer overrun corrupting an adjacent page that contains page run metadata. If it’s a jemalloc bug, I’m going to need to reproduce it and dig in; it’s unlikely to be easy to diagnose. Thanks, Jason ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261577 - head/sys/dev/msk
Author: yongari Date: Fri Feb 7 05:08:59 2014 New Revision: 261577 URL: http://svnweb.freebsd.org/changeset/base/261577 Log: Revert r234666. Clearing TWSI IRQ seems to cause watchdog timeout on old Yukon II controllers. Tested by:bsam MFC after:2 weeks Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Fri Feb 7 04:35:20 2014(r261576) +++ head/sys/dev/msk/if_msk.c Fri Feb 7 05:08:59 2014(r261577) @@ -3750,9 +3750,6 @@ msk_intr(void *xsc) if ((status Y2_IS_STAT_BMU) != 0 domore == 0) CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); - /* Clear TWSI IRQ. */ - if ((status Y2_IS_TWSI_RDY) != 0) - CSR_WRITE_4(sc, B2_I2C_IRQ, 1); /* Reenable interrupts. */ CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261578 - stable/9/sys/rpc
Author: mav Date: Fri Feb 7 05:23:04 2014 New Revision: 261578 URL: http://svnweb.freebsd.org/changeset/base/261578 Log: MFC r261449: Fix lock acquisition in case no request space available, missed in r260097. Modified: stable/9/sys/rpc/svc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/svc.c == --- stable/9/sys/rpc/svc.c Fri Feb 7 05:08:59 2014(r261577) +++ stable/9/sys/rpc/svc.c Fri Feb 7 05:23:04 2014(r261578) @@ -1180,9 +1180,9 @@ svc_run_internal(SVCPOOL *pool, bool_t i */ xprt-xp_lastactive = time_uptime; do { - mtx_unlock(pool-sp_lock); if (!svc_request_space_available(pool)) break; + mtx_unlock(pool-sp_lock); rqstp = NULL; stat = svc_getreq(xprt, rqstp); if (rqstp) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261579 - stable/10/sys/dev/usb
Author: hselasky Date: Fri Feb 7 07:18:52 2014 New Revision: 261579 URL: http://svnweb.freebsd.org/changeset/base/261579 Log: MFC r261505: Fix a regression issue. Contiguous single segment allocations above PAGE_SIZE bytes should only use one USB page structure. Fixes a problem with some external drivers. Modified: stable/10/sys/dev/usb/usb_busdma.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_busdma.c == --- stable/10/sys/dev/usb/usb_busdma.c Fri Feb 7 05:23:04 2014 (r261578) +++ stable/10/sys/dev/usb/usb_busdma.c Fri Feb 7 07:18:52 2014 (r261579) @@ -454,7 +454,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ goto done; } #endif - while (1) { + while (pc-ismultiseg) { off += USB_PAGE_SIZE; if (off = (segs-ds_len + rem)) { /* page crossing */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261580 - stable/9/sys/dev/usb
Author: hselasky Date: Fri Feb 7 07:31:54 2014 New Revision: 261580 URL: http://svnweb.freebsd.org/changeset/base/261580 Log: MFC r244535, r245995, r261505 and r258961: - Use a boundary of zero, hence a PAGE_SIZE boundary is implied by all memory allocations. - Fix an external compiler warning about write-only assigned variable. Modified: stable/9/sys/dev/usb/usb_busdma.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_busdma.c == --- stable/9/sys/dev/usb/usb_busdma.c Fri Feb 7 07:18:52 2014 (r261579) +++ stable/9/sys/dev/usb/usb_busdma.c Fri Feb 7 07:31:54 2014 (r261580) @@ -211,9 +211,7 @@ usbd_m_copy_in(struct usb_page_cache *ca struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len) { struct usb_m_copy_in_arg arg = {cache, dst_offset}; - int error; - - error = m_apply(m, src_offset, src_len, usbd_m_copy_in_cb, arg); + (void) m_apply(m, src_offset, src_len, usbd_m_copy_in_cb, arg); } #endif @@ -358,8 +356,7 @@ usb_dma_tag_create(struct usb_dma_tag *u if (bus_dma_tag_create ( /* parent*/ udt-tag_parent-tag, /* alignment */ align, -/* boundary */ (align == 1) ? - USB_PAGE_SIZE : 0, +/* boundary */ 0, /* lowaddr */ (2ULL (udt-tag_parent-dma_bits - 1)) - 1, /* highaddr */ BUS_SPACE_MAXADDR, /* filter*/ NULL, @@ -418,6 +415,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ struct usb_page_cache *pc; struct usb_page *pg; usb_size_t rem; + bus_size_t off; uint8_t owned; pc = arg; @@ -433,12 +431,13 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ if (error) { goto done; } + + off = 0; pg = pc-page_start; pg-physaddr = segs-ds_addr ~(USB_PAGE_SIZE - 1); rem = segs-ds_addr (USB_PAGE_SIZE - 1); pc-page_offset_buf = rem; pc-page_offset_end += rem; - nseg--; #ifdef USB_DEBUG if (rem != (USB_P2U(pc-buffer) (USB_PAGE_SIZE - 1))) { /* @@ -449,11 +448,19 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ goto done; } #endif - while (nseg 0) { - nseg--; - segs++; + while (pc-ismultiseg) { + off += USB_PAGE_SIZE; + if (off = (segs-ds_len + rem)) { + /* page crossing */ + nseg--; + segs++; + off = 0; + rem = 0; + if (nseg == 0) + break; + } pg++; - pg-physaddr = segs-ds_addr ~(USB_PAGE_SIZE - 1); + pg-physaddr = (segs-ds_addr + off) ~(USB_PAGE_SIZE - 1); } done: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r261581 - stable/8/sys/dev/usb
Author: hselasky Date: Fri Feb 7 07:34:47 2014 New Revision: 261581 URL: http://svnweb.freebsd.org/changeset/base/261581 Log: MFC r244535, r245995, r261505 and r258961: - Use a boundary of zero, hence a PAGE_SIZE boundary is implied by all memory allocations. - Fix an external compiler warning about write-only assigned variable. Modified: stable/8/sys/dev/usb/usb_busdma.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_busdma.c == --- stable/8/sys/dev/usb/usb_busdma.c Fri Feb 7 07:31:54 2014 (r261580) +++ stable/8/sys/dev/usb/usb_busdma.c Fri Feb 7 07:34:47 2014 (r261581) @@ -211,9 +211,7 @@ usbd_m_copy_in(struct usb_page_cache *ca struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len) { struct usb_m_copy_in_arg arg = {cache, dst_offset}; - int error; - - error = m_apply(m, src_offset, src_len, usbd_m_copy_in_cb, arg); + (void) m_apply(m, src_offset, src_len, usbd_m_copy_in_cb, arg); } #endif @@ -358,8 +356,7 @@ usb_dma_tag_create(struct usb_dma_tag *u if (bus_dma_tag_create ( /* parent*/ udt-tag_parent-tag, /* alignment */ align, -/* boundary */ (align == 1) ? - USB_PAGE_SIZE : 0, +/* boundary */ 0, /* lowaddr */ (2ULL (udt-tag_parent-dma_bits - 1)) - 1, /* highaddr */ BUS_SPACE_MAXADDR, /* filter*/ NULL, @@ -418,6 +415,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ struct usb_page_cache *pc; struct usb_page *pg; usb_size_t rem; + bus_size_t off; uint8_t owned; pc = arg; @@ -433,12 +431,13 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ if (error) { goto done; } + + off = 0; pg = pc-page_start; pg-physaddr = segs-ds_addr ~(USB_PAGE_SIZE - 1); rem = segs-ds_addr (USB_PAGE_SIZE - 1); pc-page_offset_buf = rem; pc-page_offset_end += rem; - nseg--; #ifdef USB_DEBUG if (rem != (USB_P2U(pc-buffer) (USB_PAGE_SIZE - 1))) { /* @@ -449,11 +448,19 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ goto done; } #endif - while (nseg 0) { - nseg--; - segs++; + while (pc-ismultiseg) { + off += USB_PAGE_SIZE; + if (off = (segs-ds_len + rem)) { + /* page crossing */ + nseg--; + segs++; + off = 0; + rem = 0; + if (nseg == 0) + break; + } pg++; - pg-physaddr = segs-ds_addr ~(USB_PAGE_SIZE - 1); + pg-physaddr = (segs-ds_addr + off) ~(USB_PAGE_SIZE - 1); } done: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r261564 - head/sys/arm/arm
On 6 February 2014 19:41, John-Mark Gurney j...@funkthat.com wrote: Nathan Whitehorn wrote this message on Thu, Feb 06, 2014 at 21:03 -0600: On 02/06/14 14:26, Andrew Turner wrote: Author: andrew Date: Thu Feb 6 20:26:36 2014 New Revision: 261564 URL: http://svnweb.freebsd.org/changeset/base/261564 Log: Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Does this mean armeb works again? It's getting closer... I have a pending fix for off_t that I need to resolve w/ bde, and then there is the wired mapping panic issue that I've posted about to -arm... I've gotten a bit busy the last couple weeks, so I haven't had time to work on it recently... Thanks so much for championing this! -a ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org