svn commit: r236170 - in head: sbin/ifconfig sys/net sys/netinet sys/netinet6 sys/sys
Author: bz Date: Mon May 28 09:30:13 2012 New Revision: 236170 URL: http://svn.freebsd.org/changeset/base/236170 Log: It turns out that too many drivers are not only parsing the L2/3/4 headers for TSO but also for generic checksum offloading. Ideally we would only have one common function shared amongst all drivers, and perhaps when updating them for IPv6 we should introduce that. Eventually we should provide the meta information along with mbufs to avoid (re-)parsing entirely. To not break IPv6 (checksums and offload) and to be able to MFC the changes without risking to hurt 3rd party drivers, duplicate the v4 framework, as other OSes have done as well. Introduce interface capability flags for TX/RX checksum offload with IPv6, to allow independent toggling (where possible). Add CSUM_*_IPV6 flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6 fragmentation. Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and add an alias for CSUM_DATA_VALID_IPV6. This pretty much brings IPv6 handling in line with IPv4. TSO is still handled in a different way and not via if_hwassist. Update ifconfig to allow (un)setting of the new capability flags. Update loopback to announce the new capabilities and if_hwassist flags. Individual driver updates will have to follow, as will SCTP. Reported by: gallatin, dim, .. Reviewed by: gallatin (glanced at?) MFC after:3 days X-MFC with: r235961,235959,235958 Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sys/net/if.h head/sys/net/if_loop.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c head/sys/sys/mbuf.h Modified: head/sbin/ifconfig/ifconfig.8 == --- head/sbin/ifconfig/ifconfig.8 Mon May 28 09:23:12 2012 (r236169) +++ head/sbin/ifconfig/ifconfig.8 Mon May 28 09:30:13 2012 (r236170) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 19, 2012 +.Dd May 27, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -372,16 +372,32 @@ This is useful for devices which have mu .It Cm name Ar name Set the interface name to .Ar name . -.It Cm rxcsum , txcsum +.It Cm rxcsum , txcsum , rxcsum6 , txcsum6 If the driver supports user-configurable checksum offloading, enable receive (or transmit) checksum offloading on the interface. +The feature can be turned on selectively per protocol family. +Use +.Cm rxcsum6 , txcsum6 +for +.Xr ip6 4 +or +.Cm rxcsum , txcsum +otherwise. Some drivers may not be able to enable these flags independently of each other, so setting one may also set the other. The driver will offload as much checksum work as it can reliably support, the exact level of offloading varies between drivers. -.It Fl rxcsum , txcsum +.It Fl rxcsum , txcsum , rxcsum6 , txcsum6 If the driver supports user-configurable checksum offloading, disable receive (or transmit) checksum offloading on the interface. +The feature can be turned off selectively per protocol family. +Use +.Fl rxcsum6 , txcsum6 +for +.Xr ip6 4 +or +.Fl rxcsum , txcsum +otherwise. These settings may not always be independent of each other. .It Cm tso If the driver supports Modified: head/sbin/ifconfig/ifconfig.c == --- head/sbin/ifconfig/ifconfig.c Mon May 28 09:23:12 2012 (r236169) +++ head/sbin/ifconfig/ifconfig.c Mon May 28 09:30:13 2012 (r236170) @@ -916,7 +916,8 @@ unsetifdescr(const char *val, int value, #defineIFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" +"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ +"\26IFCAP_RXCSUM_IPV6\27IFCAP_TXCSUM_IPV6" /* * Print the status of the interface. If an address family was @@ -1193,6 +1194,10 @@ static struct cmd basic_cmds[] = { DEF_CMD("-monitor", -IFF_MONITOR, setifflags), DEF_CMD("staticarp",IFF_STATICARP, setifflags), DEF_CMD("-staticarp", -IFF_STATICARP, setifflags), + DEF_CMD("rxcsum6", IFCAP_RXCSUM_IPV6, setifcap), + DEF_CMD("-rxcsum6", -IFCAP_RXCSUM_IPV6, setifcap), + DEF_CMD("txcsum6", IFCAP_TXCSUM_IPV6, setifcap), + DEF_CMD("-txcsum6", -IFCAP_TXCSUM_IPV6, setifcap), DEF_CMD("rxcsum", IFCAP_RXCSUM, setifcap), DEF_CMD("-rxcsum", -IFCAP_RXCSUM, setifcap), DEF_CMD("txcsum", IFCAP_TXCSUM, setifcap), Modified: head/sys/ne
svn commit: r236176 - head/sbin/ifconfig
Author: bz Date: Mon May 28 10:45:51 2012 New Revision: 236176 URL: http://svn.freebsd.org/changeset/base/236176 Log: Removed the IFCAP_ prefix when printing the IPv6 checksum capabilities. Submitted by: dim MFC after:3 days Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c == --- head/sbin/ifconfig/ifconfig.c Mon May 28 10:22:46 2012 (r236175) +++ head/sbin/ifconfig/ifconfig.c Mon May 28 10:45:51 2012 (r236176) @@ -917,7 +917,7 @@ unsetifdescr(const char *val, int value, "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26IFCAP_RXCSUM_IPV6\27IFCAP_TXCSUM_IPV6" +"\26RXCSUM_IPV6\27TXCSUM_IPV6" /* * Print the status of the interface. If an address family was ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236177 - head/gnu/lib/libsupc++
Author: theraven Date: Mon May 28 12:11:00 2012 New Revision: 236177 URL: http://svn.freebsd.org/changeset/base/236177 Log: Correctly export operator new / delete for things linking against libsupc++ but not libstdc++. Unfortunately, it appears that libsupc++ / libstdc++ have a different idea of the type of size_t to the rest of the world, which may cause problems later on... Reported by: des MFC after:1 week Modified: head/gnu/lib/libsupc++/Version.map Modified: head/gnu/lib/libsupc++/Version.map == --- head/gnu/lib/libsupc++/Version.map Mon May 28 10:45:51 2012 (r236176) +++ head/gnu/lib/libsupc++/Version.map Mon May 28 12:11:00 2012 (r236177) @@ -126,6 +126,16 @@ CXXABI_1.3 { # __gnu_cxx::_verbose_terminate_handler() _ZN9__gnu_cxx27__verbose_terminate_handlerEv; +# new / delete operators +_Znaj; +_ZnajRKSt9nothrow_t; +_Znwj; +_ZnwjRKSt9nothrow_t; +_ZdaPv; +_ZdaPvRKSt9nothrow_t; +_ZdlPv; +_ZdlPvRKSt9nothrow_t; + local: *; }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236178 - in head: sbin/ifconfig sys/net
Author: rea (ports committer) Date: Mon May 28 12:13:04 2012 New Revision: 236178 URL: http://svn.freebsd.org/changeset/base/236178 Log: if_lagg: allow to invoke SIOCSLAGGPORT multiple times in a row Currently, 'ifconfig laggX down' does not remove members from this lagg(4) interface. So, 'service netif stop laggX' followed by 'service netif start laggX' will choke, because "stop" will leave interfaces attached to the laggX and ifconfig from the "start" will refuse to add already-existing interfaces. The real-world case is when I am bundling together my Ethernet and WiFi interfaces and using multiple profiles for accessing network in different places: system being booted up with one profile, but later this profile being exchanged to another one, followed by 'service netif restart' will not add WiFi interface back to the lagg: the "stop" action from 'service netif restart' will shut down my main WiFi interface, so wlan0 that exists in the lagg0 will be destroyed and purged from lagg0; the "start" action will try to re-add both interfaces, but since Ethernet one is already in lagg0, ifconfig will refuse to add the wlan0 from WiFi interface. Since adding the interface to the lagg(4) when it is already here should be an idempotent action: we're really not changing anything, so this fix doesn't change the semantics of interface addition. Approved by: thompsa Reviewed by: emaste MFC after: 1 week Modified: head/sbin/ifconfig/iflagg.c head/sys/net/if_lagg.c Modified: head/sbin/ifconfig/iflagg.c == --- head/sbin/ifconfig/iflagg.c Mon May 28 12:11:00 2012(r236177) +++ head/sbin/ifconfig/iflagg.c Mon May 28 12:13:04 2012(r236178) @@ -40,7 +40,8 @@ setlaggport(const char *val, int d, int strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname)); - if (ioctl(s, SIOCSLAGGPORT, &rp)) + /* Don't choke if the port is already in this lagg. */ + if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) err(1, "SIOCSLAGGPORT"); } Modified: head/sys/net/if_lagg.c == --- head/sys/net/if_lagg.c Mon May 28 12:11:00 2012(r236177) +++ head/sys/net/if_lagg.c Mon May 28 12:13:04 2012(r236178) @@ -516,8 +516,13 @@ lagg_port_create(struct lagg_softc *sc, return (ENOSPC); /* Check if port has already been associated to a lagg */ - if (ifp->if_lagg != NULL) + if (ifp->if_lagg != NULL) { + /* Port is already in the current lagg? */ + lp = (struct lagg_port *)ifp->if_lagg; + if (lp->lp_softc == sc) + return (EEXIST); return (EBUSY); + } /* XXX Disallow non-ethernet interfaces (this should be any of 802) */ if (ifp->if_type != IFT_ETHER) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r236178 - in head: sbin/ifconfig sys/net
On Mon, May 28, 2012 at 12:13:05PM +, Eygene Ryabinkin wrote: E> The real-world case is when I am bundling together my Ethernet and E> WiFi interfaces and using multiple profiles for accessing network in E> different places: system being booted up with one profile, but later E> this profile being exchanged to another one, followed by 'service E> netif restart' will not add WiFi interface back to the lagg: the E> "stop" action from 'service netif restart' will shut down my main WiFi E> interface, so wlan0 that exists in the lagg0 will be destroyed and E> purged from lagg0; the "start" action will try to re-add both E> interfaces, but since Ethernet one is already in lagg0, ifconfig will E> refuse to add the wlan0 from WiFi interface. Although the lagg(4) change is definetely a needed fix, the way of network roaming via stacking WiFi and Ethernet into lagg(4) always looked like a huge crutch to me. Isn't the problem solvable via a some kind of smarter dhclient? How other UNIX-like OS-es solve this? -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern
On Sun, May 27, 2012 at 07:49:36AM +1000, Bruce Evans wrote: > On Sat, 26 May 2012, Konstantin Belousov wrote: > > >On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: > >The 'low level' AKA magic happens in several *_fetch_syscall_args() > >functions. For both linux32 and freebsd32, the magic code automatically > >zero-extends the arguments into 64bit entities. Linux passes args in > >registers, while FreeBSD uses words on stack. > > Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from > 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how > this gives anything except garbage in the top bits. Is there magic in > the switch to 64-bit mode that sets the top bits? Anyway, sign extension > would give garbage for unsigned args, and zero-extension would give > garbage for negative signed args. Hardware zero-extends any register touched in the 32bit mode. In fact, please see r217991 for related bug. pgpS3viGKMIHx.pgp Description: PGP signature
Re: svn commit: r236178 - in head: sbin/ifconfig sys/net
Gleb, good day. Mon, May 28, 2012 at 05:14:22PM +0400, Gleb Smirnoff wrote: > the way of network roaming via stacking WiFi and Ethernet into > lagg(4) always looked like a huge crutch to me. Why? > Isn't the problem solvable via a some kind of smarter dhclient? It isn't always bound to DHCP: just now I am sitting at $WORK and travelling via the building with WiFi and Ethernet -- I have static IP and when I plug into wire -- I have wired setup, when I am unplugged -- WiFi works here. But the magic of switching is inside if_lagg, not in some external app that looks for events and does the plumbing. And I like this way of doing things. > How other UNIX-like OS-es solve this? Looks like OSX does have the smart client that polls for the interface events and configures network accordingly. I should dig it a bit more, since I hadn't touched this part of OSX yet. -- Eygene Ryabinkin,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] pgp4IumHasqI6.pgp Description: PGP signature
svn commit: r236182 - head/sys/dev/drm2/i915
Author: kib Date: Mon May 28 13:55:49 2012 New Revision: 236182 URL: http://svn.freebsd.org/changeset/base/236182 Log: Fix calculation of the execution buffer end in the mapped pages when it is spilled into the next page. MFC after:1 month Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c == --- head/sys/dev/drm2/i915/i915_gem_execbuffer.cMon May 28 13:49:52 2012(r236181) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.cMon May 28 13:55:49 2012(r236182) @@ -1069,7 +1069,8 @@ i915_gem_fix_mi_batchbuffer_end(struct d po_r -= 4; mkva = pmap_mapdev_attr(trunc_page(po_r), 2 * PAGE_SIZE, PAT_WRITE_COMBINING); - cmd = *(uint32_t *)(mkva + (po_r & PAGE_MASK)); + po_r &= PAGE_MASK; + cmd = *(uint32_t *)(mkva + po_r); if (cmd != MI_BATCH_BUFFER_END) { /* @@ -1083,8 +1084,7 @@ i915_gem_fix_mi_batchbuffer_end(struct d po_w = po_r; DRM_DEBUG("batchbuffer does not end by MI_BATCH_BUFFER_END, overwriting last bo cmd !\n"); } - - *(uint32_t *)(mkva + (po_w & PAGE_MASK)) = MI_BATCH_BUFFER_END; + *(uint32_t *)(mkva + po_w) = MI_BATCH_BUFFER_END; } pmap_unmapdev((vm_offset_t)mkva, 2 * PAGE_SIZE); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236183 - head/sys/dev/drm2/i915
Author: kib Date: Mon May 28 13:58:08 2012 New Revision: 236183 URL: http://svn.freebsd.org/changeset/base/236183 Log: Disable end of buffer fixup by default. New DDX does not need this, and since batch_len is unused by Linux driver, it seems that it is sometimes gets passed wrong. This causes command buffer corruption and GPU hung. Old GEMified DDX drivers that needs this workaround are not supported. MFC after:1 month Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c == --- head/sys/dev/drm2/i915/i915_gem_execbuffer.cMon May 28 13:55:49 2012(r236182) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.cMon May 28 13:58:08 2012(r236183) @@ -1090,7 +1090,7 @@ DRM_DEBUG("batchbuffer does not end by M pmap_unmapdev((vm_offset_t)mkva, 2 * PAGE_SIZE); } -int i915_fix_mi_batchbuffer_end = 1; +int i915_fix_mi_batchbuffer_end = 0; static int i915_reset_gen7_sol_offsets(struct drm_device *dev, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern
On Mon, 28 May 2012, Konstantin Belousov wrote: On Sun, May 27, 2012 at 07:49:36AM +1000, Bruce Evans wrote: On Sat, 26 May 2012, Konstantin Belousov wrote: On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: The 'low level' AKA magic happens in several *_fetch_syscall_args() functions. For both linux32 and freebsd32, the magic code automatically zero-extends the arguments into 64bit entities. Linux passes args in registers, while FreeBSD uses words on stack. Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how this gives anything except garbage in the top bits. Is there magic in the switch to 64-bit mode that sets the top bits? Anyway, sign extension would give garbage for unsigned args, and zero-extension would give garbage for negative signed args. Hardware zero-extends any register touched in the 32bit mode. So they have garbage extension when not touched? Or maybe the kernel extends them. In fact, please see r217991 for related bug. That seems to be the kernel extending them. I tested on a kernel built on 3 Mar 2012. It is much later than that, and shows nonzero extensions (about half of the wrong cases sign extensions). Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236184 - head/sys/dev/ata
Author: mav Date: Mon May 28 14:33:15 2012 New Revision: 236184 URL: http://svn.freebsd.org/changeset/base/236184 Log: Make legacy ATA to not call device_add_child() with unit number but without driver name. This fixed legacy ATA breakage by r235978. MFC after:1 week Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c == --- head/sys/dev/ata/ata-all.c Mon May 28 13:58:08 2012(r236183) +++ head/sys/dev/ata/ata-all.c Mon May 28 14:33:15 2012(r236184) @@ -887,7 +887,7 @@ ata_add_child(device_t parent, struct at { device_t child; -if ((child = device_add_child(parent, NULL, unit))) { +if ((child = device_add_child(parent, (unit < 0) ? NULL : "ad", unit))) { device_set_softc(child, atadev); device_quiet(child); atadev->dev = child; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236185 - head/lib/libkiconv
Author: gabor Date: Mon May 28 14:45:12 2012 New Revision: 236185 URL: http://svn.freebsd.org/changeset/base/236185 Log: - Include forgotten bsd.own.mk and fix condition Reported by: Jan Beich Modified: head/lib/libkiconv/Makefile Modified: head/lib/libkiconv/Makefile == --- head/lib/libkiconv/Makefile Mon May 28 14:33:15 2012(r236184) +++ head/lib/libkiconv/Makefile Mon May 28 14:45:12 2012(r236185) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= kiconv SHLIBDIR?= /lib SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c @@ -17,7 +19,7 @@ CFLAGS+= -I${.CURDIR}/../../sys WARNS?=1 -.if !defined(MK_ICONV) +.if ${MK_ICONV} == "no" CFLAGS+= -DICONV_DLOPEN .endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236188 - head/sys/fs/nandfs
Author: marcel Date: Mon May 28 16:33:58 2012 New Revision: 236188 URL: http://svn.freebsd.org/changeset/base/236188 Log: Catch a corner case where ssegs could be 0 and thus i would be 0 and we index suinfo out of bounds (i.e. -1). Approved by: gber Modified: head/sys/fs/nandfs/nandfs_cleaner.c Modified: head/sys/fs/nandfs/nandfs_cleaner.c == --- head/sys/fs/nandfs/nandfs_cleaner.c Mon May 28 15:34:55 2012 (r236187) +++ head/sys/fs/nandfs/nandfs_cleaner.c Mon May 28 16:33:58 2012 (r236188) @@ -310,23 +310,22 @@ retry: nandfs_error("%s:%d", __FILE__, __LINE__); goto out; } - if (ssegs == 0 && *rseg != 0) { *rseg = 0; goto retry; } + if (ssegs > 0) { + print_suinfo(suinfo, ssegs); - print_suinfo(suinfo, ssegs); - - for (i = 0; i < ssegs; i++) { - (**segpp) = suinfo[i].nsi_num; - (*segpp)++; + for (i = 0; i < ssegs; i++) { + (**segpp) = suinfo[i].nsi_num; + (*segpp)++; + } + *rseg = suinfo[i - 1].nsi_num + 1; } - *rseg = suinfo[i - 1].nsi_num + 1; out: free(suinfo, M_NANDFSTEMP); - return (error); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern
On 28 May 2012, at 09:36, Konstantin Belousov wrote: > On Sun, May 27, 2012 at 07:49:36AM +1000, Bruce Evans wrote: >> On Sat, 26 May 2012, Konstantin Belousov wrote: >> >>> On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: >>> The 'low level' AKA magic happens in several *_fetch_syscall_args() >>> functions. For both linux32 and freebsd32, the magic code automatically >>> zero-extends the arguments into 64bit entities. Linux passes args in >>> registers, while FreeBSD uses words on stack. >> >> Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from >> 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how >> this gives anything except garbage in the top bits. Is there magic in >> the switch to 64-bit mode that sets the top bits? Anyway, sign extension >> would give garbage for unsigned args, and zero-extension would give >> garbage for negative signed args. > Hardware zero-extends any register touched in the 32bit mode. > > In fact, please see r217991 for related bug. This may well be true on Intel, but is not true of MIPS -- which we probably don't care about currently for the purposes of Linux emulation, but maybe someday we will. On MIPS, 32-bit values are sign-extended rather than zero-extended. I see a somewhat complex thread here, but am not sure I quite understand the import for Capsicum. Is the 64-bit rights mask as part of system call arguments not working properly in compat32 scenarios? Or are there issues outside of the compat environment? Right now compat32 is not well-supported with Capsicum, but fixing that is quite important to productionising Capsicum. Robert___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236190 - head/sys/i386/i386
Author: alc Date: Mon May 28 17:35:23 2012 New Revision: 236190 URL: http://svn.freebsd.org/changeset/base/236190 Log: Update a comment in get_pv_entry() to reflect the changes to the synchronization of pv_vafree in r236158. Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Mon May 28 16:37:42 2012(r236189) +++ head/sys/i386/i386/pmap.c Mon May 28 17:35:23 2012(r236190) @@ -2428,8 +2428,8 @@ retry: } } /* -* Access to the ptelist "pv_vafree" is synchronized by the page -* queues lock. If "pv_vafree" is currently non-empty, it will +* Access to the ptelist "pv_vafree" is synchronized by the pvh +* global lock. If "pv_vafree" is currently non-empty, it will * remain non-empty until pmap_ptelist_alloc() completes. */ if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236191 - head/sys/arm/conf
Author: marius Date: Mon May 28 17:58:10 2012 New Revision: 236191 URL: http://svn.freebsd.org/changeset/base/236191 Log: - Correct the comments regarding the sizes of some partitions in the DataFlash. - Add a mapping for the Nut/OS configuration DataFlash partition according to the board manual (but not known to either Linux or U-Boot (patches). Modified: head/sys/arm/conf/ETHERNUT5.hints Modified: head/sys/arm/conf/ETHERNUT5.hints == --- head/sys/arm/conf/ETHERNUT5.hints Mon May 28 17:35:23 2012 (r236190) +++ head/sys/arm/conf/ETHERNUT5.hints Mon May 28 17:58:10 2012 (r236191) @@ -27,18 +27,24 @@ hint.map.3.start=0x000c6000 hint.map.3.end=0x00359fff hint.map.3.name="kernel" #hint.map.3.readonly=1 -# nutos 3432 kbytes +# nutos 528 kbytes hint.map.4.at="flash/spi0" hint.map.4.start=0x0035a000 hint.map.4.end=0x003ddfff hint.map.4.name="nutos" hint.map.4.readonly=1 -# env 3960 kbytes +# env 132 kbytes hint.map.5.at="flash/spi0" hint.map.5.start=0x003de000 hint.map.5.end=0x003fefff hint.map.5.name="env" hint.map.5.readonly=1 +# env 132 kbytes +hint.map.6.at="flash/spi0" +hint.map.6.start=0x003ff000 +hint.map.6.end=0x0041 +hint.map.6.name="nutoscfg" +hint.map.6.readonly=1 # NXP PCF8563 clock/calendar hint.pcf8563_rtc.0.at="iicbus0" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r236137 - head/contrib/gcc/config/i386
On Sun, May 27, 2012 at 05:27:48AM +, Konstantin Belousov wrote: > Author: kib > Date: Sun May 27 05:27:47 2012 > New Revision: 236137 > URL: http://svn.freebsd.org/changeset/base/236137 > > Log: > Enable gnu hash generation for dynamic ELF binaries on x86. > As far as I remember from your commit adding GNU hash support to rtld(1), there's nothing left to be done for the other architectures apart from testing, correct? Marius ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236193 - head/lib/libfetch
Author: jilles Date: Mon May 28 19:22:23 2012 New Revision: 236193 URL: http://svn.freebsd.org/changeset/base/236193 Log: libfetch: Avoid SIGPIPE on network connections. To avoid unexpected process termination from SIGPIPE when writing to a closed network connection, enable SO_NOSIGPIPE on all network connections. The POSIX standard MSG_NOSIGNAL is not used since it requires modifying all send calls to add this flag. This is particularly nasty for SSL connections. Reviewed by: des Tested by:bapt MFC after:5 days Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Mon May 28 19:13:21 2012(r236192) +++ head/lib/libfetch/common.c Mon May 28 19:22:23 2012(r236193) @@ -209,11 +209,13 @@ conn_t * fetch_reopen(int sd) { conn_t *conn; + int opt = 1; /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); fcntl(sd, F_SETFD, FD_CLOEXEC); + setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof opt); conn->sd = sd; ++conn->ref; return (conn); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r236137 - head/contrib/gcc/config/i386
On 2012-05-27 22:31, Roman Divacky wrote: > Fwiw, to enable the same thing in clang you want this simple patch: > > === > --- Tools.cpp (revision 157545) > +++ Tools.cpp (working copy) > @@ -4794,6 +4794,7 @@ >if (Args.hasArg(options::OPT_static)) { > CmdArgs.push_back("-Bstatic"); >} else { > +CmdArgs.push_back("--hash-style=both"); > if (Args.hasArg(options::OPT_rdynamic)) >CmdArgs.push_back("-export-dynamic"); > CmdArgs.push_back("--eh-frame-hdr"); > > > > I cant commit this upstream as this option doesn't work with ld 2.15. What > should be done here? Commit this to local FreeBSD version? Commit it upstream > making it not work with old ld? Leave it out completely? I think this can be committed locally in our version, especially if it is better for performance. We already have a few local modifications, this one isn't very shocking. :) For upstream, you should really add a configure check for gnu hash support in ld, and then surround the above addition with conditionals, e.g. #ifdef HAVE_LINK_GNU_HASH or something. On the other hand, it's really platform-dependent: I've checked several Linux distributions, and it is fairly unpredictable whether their gcc passes --hash-style to the linker, or if they do, which option they use. For example, Debian stable uses --hash-style=both, while Ubuntu 12.04 uses --hash-style=gnu. So the correct mechanism for this is tricky. It should be discussed on the clang mailing list, not here. Lastly, my personal preference would be to adjust these defaults in the linker itself, depending on platform, but apparently nobody does that... ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r235859 - in head/sys: i386/conf modules
On 25 May 2012 03:32, Konstantin Belousov wrote: > On Fri, May 25, 2012 at 10:32:12AM +0200, Niclas Zeising wrote: >> Hi! >> Would it be possible to bump the FreeBSD version to reflect this commit? >> It would be helpful when working with the xorg ports, amongst other things. >> Thanks! >> Regards! >> -- > There is absolutely no use for version bump. Port builds (libdrm, mesa > and ddx) do not depend on any base system headers or libraries. They > come with private copies of the ABI headers. there is a use. the ports can check to see if they are being built/installed on the right version of FreeBSD. Having a check that says if OSVERSION < x IGNORE= upgrade endif is helpful -- Eitan Adler Source & Ports committer X11, Bugbusting teams ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236196 - in head: contrib/bind9 contrib/bind9/bin/named contrib/bind9/bin/named/unix contrib/bind9/lib/bind9 contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns contrib/bind9/lib/d...
Author: dougb Date: Mon May 28 19:47:56 2012 New Revision: 236196 URL: http://svn.freebsd.org/changeset/base/236196 Log: Upgrade to BIND version 9.8.3, the latest from ISC. Feature Change * BIND now recognizes the TLSA resource record type, created to support IETF DANE (DNS-based Authentication of Named Entities) Bug Fix * The locking strategy around the handling of iterative queries has been tuned to reduce unnecessary contention in a multi- threaded environment. Other critical bug fixes are included. All BIND users are encouraged to upgrade. Added: head/contrib/bind9/lib/dns/rdata/generic/tlsa_52.c - copied unchanged from r236173, vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.c head/contrib/bind9/lib/dns/rdata/generic/tlsa_52.h - copied unchanged from r236173, vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.h Modified: head/contrib/bind9/CHANGES head/contrib/bind9/README head/contrib/bind9/bin/named/builtin.c head/contrib/bind9/bin/named/query.c head/contrib/bind9/bin/named/server.c head/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c head/contrib/bind9/lib/bind9/api head/contrib/bind9/lib/bind9/check.c head/contrib/bind9/lib/dns/api head/contrib/bind9/lib/dns/dnssec.c head/contrib/bind9/lib/dns/include/dns/ecdb.h head/contrib/bind9/lib/dns/include/dns/rpz.h head/contrib/bind9/lib/dns/include/dns/sdb.h head/contrib/bind9/lib/dns/include/dns/stats.h head/contrib/bind9/lib/dns/include/dns/tsec.h head/contrib/bind9/lib/dns/include/dns/view.h head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/lib/dns/resolver.c head/contrib/bind9/lib/dns/sdb.c head/contrib/bind9/lib/dns/tkey.c head/contrib/bind9/lib/dns/zone.c head/contrib/bind9/lib/isc/pthreads/mutex.c head/contrib/bind9/lib/isccfg/api head/contrib/bind9/lib/isccfg/parser.c head/contrib/bind9/version head/lib/bind/dns/code.h head/lib/bind/dns/dns/enumtype.h head/lib/bind/dns/dns/rdatastruct.h Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES == --- head/contrib/bind9/CHANGES Mon May 28 19:44:35 2012(r236195) +++ head/contrib/bind9/CHANGES Mon May 28 19:47:56 2012(r236196) @@ -1,3 +1,56 @@ + --- 9.8.3 released --- + +3318. [tuning]Reduce the amount of work performed while holding a + bucket lock when finshed with a fetch context. + [RT #29239] + +3314. [bug] The masters list could be updated while refesh_callback + and stub_callback were using it. [RT #26732] + +3313. [protocol] Add TLSA record type. [RT #28989] + +3312. [bug] named-checkconf didn't detect a bad dns64 clients acl. + [RT #27631] + +3311. [bug] Abort the zone dump if zone->db is NULL in + zone.c:zone_gotwritehandle. [RT #29028] + +3310. [test] Increase table size for mutex profiling. [RT #28809] + +3309. [bug] resolver.c:fctx_finddone() was not threadsafe. + [RT #27995] + +3307. [bug] Add missing ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS. + [RT #28956] + +3306. [bug] Improve DNS64 reverse zone performance. [RT #28563] + +3305. [func] Add wire format lookup method to sdb. [RT #28563] + +3304. [bug] Use hmctx, not mctx when freeing rbtdb->heaps. + [RT #28571] + +3302. [bug] dns_dnssec_findmatchingkeys could fail to find + keys if the zone name contained character that + required special mappings. [RT #28600] + +3301. [contrib] Update queryperf to build on darwin. Add -R flag + for non-recursive queries. [RT #28565] + +3300. [bug] Named could die if gssapi was enabled in named.conf + but was not compiled in. [RT #28338] + +3299. [bug] Make SDB handle errors from database drivers better. + [RT #28534] + +3232. [bug] Zero zone->curmaster before return in + dns_zone_setmasterswithkeys(). [RT #26732] + +3183. [bug] Added RTLD_GLOBAL flag to dlopen call. [RT #26301] + +3197. [bug] Don't try to log the filename and line number when + the config parser can't open a file. [RT #22263] + --- 9.8.2 released --- 3298. [bug] Named could dereference a NULL pointer in @@ -58,9 +111,9 @@ 3274. [bug] Log when a zone is not reusable. Only set loadtime on successful loads. [RT #27650] -3273. [bug] responses could be returned in the additional -section even when filter--on-v4 was in use. -[RT #27292] +3273.
Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern
On Mon, 28 May 2012, Robert N. M. Watson wrote: On 28 May 2012, at 09:36, Konstantin Belousov wrote: On Sun, May 27, 2012 at 07:49:36AM +1000, Bruce Evans wrote: On Sat, 26 May 2012, Konstantin Belousov wrote: On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: The 'low level' AKA magic happens in several *_fetch_syscall_args() functions. For both linux32 and freebsd32, the magic code automatically zero-extends the arguments into 64bit entities. Linux passes args in registers, while FreeBSD uses words on stack. Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how this gives anything except garbage in the top bits. Is there magic in the switch to 64-bit mode that sets the top bits? Anyway, sign extension would give garbage for unsigned args, and zero-extension would give garbage for negative signed args. Hardware zero-extends any register touched in the 32bit mode. In fact, please see r217991 for related bug. This may well be true on Intel, but is not true of MIPS -- which we probably don't care about currently for the purposes of Linux emulation, but maybe someday we will. On MIPS, 32-bit values are sign-extended rather than zero-extended. Please use the unix newline character in mail. The translation is MD so "this" (not the newline) isn't a problem. I see a somewhat complex thread here, but am not sure I quite understand the import for Capsicum. Is the 64-bit rights mask as part of system call arguments not working properly in compat32 scenarios? Or are there issues outside of the compat environment? Right now compat32 is not well-supported with Capsicum, but fixing that is quite important to productionising Capsicum. 64-bit args need special translation, and the rights mask doesn't have any. At best, the low 32 bits of it might work accidentally. 64-bit args in ia32 start as 2 32-bit ones. These get turned into 2 64-bit ones (zero extended). These must be combined (in non-automatically generated code) into a 32-bit one. The automatically-generated args struct promotes the 32-bit args to 64 bits so that it can be passed directly to native syscalls. This doesn't work if there are any specially specially-translated args. Then the whole args struct must be translated (by simple copying for 32-bit args) lseek() shows how this should be done: % #ifdef COMPAT_43 % int % ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap) % { % struct lseek_args nuap; % % nuap.fd = uap->fd; % nuap.offset = uap->offset; % nuap.whence = uap->whence; % return (sys_lseek(td, &nuap)); % } % #endif This one seems to be to work around olseek() being broken in kern/syscalls.master. Its offset arg is only 32 bits, so it should be possible to call olseek() directly, but the bug makes the args structs incompatible, so the above does a simple translation by copying args and calls the full native lseek. olseek() uses the same copying code, but never worked since it starts with a wrong args struct. Apparently no one uses olseek(), but this compat lseek() is used a bit so the bug was noticed. The args stucts are: % struct ofreebsd32_lseek_args { % char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; % char offset_l_[PADL_(int)]; int offset; char offset_r_[PADR_(int)]; % char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; % }; The padding is to 64 bits. All the types are correct, although the type of `offset' is confusing. Its type is that of the pre-4.4BSD off_t, which was long, which was 32 bits on ia32 back then. This is now spelled as int, so that we can't easily see either of the 4 layers of translation in it (off_t = long -> int32_t back then (type pun) -> int32_t now (type pun) = int now. % struct olseek_args { % char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; % char offset_l_[PADL_(long)]; long offset; char offset_r_[PADR_(long)]; % char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; % }; The type of `offset' is broken. It needs to be 32 bits since that is what it was on ia32 before 4.4BSD, as above. amd64 shouldn't support pre-4.4BSD, and making an olseek() call is close to impossible on it. However, on amd64 with ia32 support, you have to enable COMPAT_43 for the ofreebsd32_lseek() to be compiled, and this gives olseek() too, so you might as well use it after fixing it. If a native olseek() call is somehow made on amd64, then it would start with a 32-bit offset and this might be extended correctly in userland, and then the wrong `long offset' in the above would work. But there is no need to risk this. By declaring the offset as signed 32 bits, it will be extended correctly when it is loaded from the args struct. Note that the above translation `nuap.offset = uap->offset;' does a critical non-null currect extension and this requires the olseek() being declared
Re: svn commit: r236137 - head/contrib/gcc/config/i386
On 28 May 2012, at 20:33, Dimitry Andric wrote: > On the other hand, it's really platform-dependent: I've checked several > Linux distributions, and it is fairly unpredictable whether their gcc > passes --hash-style to the linker, or if they do, which option they use. Can we make it dependent on the triple? i.e. if the triple is arch-whatever-freebsd9 or greater, make it pass the flag, otherwise don't bother? Or is it not worth caring about older FreeBSD? There's no real disadvantage in passing it unconditionally (marginally longer link times) and potentially a big benefit. I don't see a problem with committing it upstream, but it would be nice to pull that change in locally before 9.1 and not have to wait for LLVM 3.2 before we got to make use of it. Misleading and poorly designed benchmarks on Phoronix are at stake! David___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236198 - head/usr.sbin/jail
Author: jamie Date: Mon May 28 20:44:11 2012 New Revision: 236198 URL: http://svn.freebsd.org/changeset/base/236198 Log: When writing the jid via the -i flag, do it right when the jail is created, before any commands run. /etc/rc.d/jail depends on this. Modified: head/usr.sbin/jail/command.c head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h Modified: head/usr.sbin/jail/command.c == --- head/usr.sbin/jail/command.cMon May 28 19:48:37 2012 (r236197) +++ head/usr.sbin/jail/command.cMon May 28 20:44:11 2012 (r236198) @@ -246,7 +246,7 @@ next_proc(int nonblock) /* * Run a single command for a jail, possible inside the jail. */ -int +static int run_command(struct cfjail *j) { const struct passwd *pwd; @@ -290,6 +290,8 @@ run_command(struct cfjail *j) } else { if (create_jail(j) < 0) return -1; + if (iflag) + printf("%d\n", j->jid); if (verbose >= 0 && (j->name || verbose > 0)) jail_note(j, "created\n"); dep_done(j, DF_LIGHT); Modified: head/usr.sbin/jail/jail.c == --- head/usr.sbin/jail/jail.c Mon May 28 19:48:37 2012(r236197) +++ head/usr.sbin/jail/jail.c Mon May 28 20:44:11 2012(r236198) @@ -55,6 +55,7 @@ struct permspec { }; const char *cfname; +int iflag; int note_remove; int verbose; @@ -129,7 +130,7 @@ main(int argc, char **argv) size_t sysvallen; unsigned op, pi; int ch, docf, error, i, oldcl, sysval; - int dflag, iflag, Rflag; + int dflag, Rflag; char enforce_statfs[4]; #if defined(INET) || defined(INET6) char *cs, *ncs; @@ -139,7 +140,7 @@ main(int argc, char **argv) #endif op = 0; - dflag = iflag = Rflag = 0; + dflag = Rflag = 0; docf = 1; cfname = CONF_FILE; JidFile = NULL; @@ -415,8 +416,6 @@ main(int argc, char **argv) continue; jail_create_done: clear_persist(j); - if (iflag) - printf("%d\n", j->jid); if (jfp != NULL) print_jail(jfp, j, oldcl); dep_done(j, 0); Modified: head/usr.sbin/jail/jailp.h == --- head/usr.sbin/jail/jailp.h Mon May 28 19:48:37 2012(r236197) +++ head/usr.sbin/jail/jailp.h Mon May 28 20:44:11 2012(r236198) @@ -227,6 +227,7 @@ extern struct cfjails cfjails; extern struct cfjails ready; extern struct cfjails depend; extern const char *cfname; +extern int iflag; extern int note_remove; extern int paralimit; extern int verbose; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r235859 - in head/sys: i386/conf modules
On Mon, May 28, 2012 at 12:38:19PM -0700, Eitan Adler wrote: > On 25 May 2012 03:32, Konstantin Belousov wrote: > > On Fri, May 25, 2012 at 10:32:12AM +0200, Niclas Zeising wrote: > >> Hi! > >> Would it be possible to bump the FreeBSD version to reflect this commit? > >> It would be helpful when working with the xorg ports, amongst other > >> things. > >> Thanks! > >> Regards! > >> -- > > There is absolutely no use for version bump. Port builds (libdrm, mesa > > and ddx) do not depend on any base system headers or libraries. They > > come with private copies of the ABI headers. > > there is a use. the ports can check to see if they are being > built/installed on the right version of FreeBSD. Having a check that > says > if OSVERSION < x > IGNORE= upgrade > endif > is helpful No, it is not. You do not understand the difference between build- and run- time. These ports build fine on whatever version of the system, but require some specific feature to run. The ddx driver already contains the correct check for required features, which is much more involved then simply check some version. It does check the presense of runtime features and either accurately degrades the performance or declines to run. pgpChyCtGpHgU.pgp Description: PGP signature
Re: svn commit: r236137 - head/contrib/gcc/config/i386
On Mon, May 28, 2012 at 09:03:55PM +0200, Marius Strobl wrote: > On Sun, May 27, 2012 at 05:27:48AM +, Konstantin Belousov wrote: > > Author: kib > > Date: Sun May 27 05:27:47 2012 > > New Revision: 236137 > > URL: http://svn.freebsd.org/changeset/base/236137 > > > > Log: > > Enable gnu hash generation for dynamic ELF binaries on x86. > > > > As far as I remember from your commit adding GNU hash support to > rtld(1), there's nothing left to be done for the other architectures > apart from testing, correct? Yes, you are correct. I am not aware of any non-implemented MD parts, but I was unable to test on !x86, and got no feedback from arch maintainers. pgp3ggijfPMUc.pgp Description: PGP signature
Re: svn commit: r236137 - head/contrib/gcc/config/i386
On Mon, May 28, 2012 at 09:17:23PM +0100, David Chisnall wrote: > On 28 May 2012, at 20:33, Dimitry Andric wrote: > > > On the other hand, it's really platform-dependent: I've checked several > > Linux distributions, and it is fairly unpredictable whether their gcc > > passes --hash-style to the linker, or if they do, which option they use. > > Can we make it dependent on the triple? i.e. if the triple is > arch-whatever-freebsd9 or greater, make it pass the flag, otherwise > don't bother? Or is it not worth caring about older FreeBSD? There's > no real disadvantage in passing it unconditionally (marginally longer > link times) and potentially a big benefit. I don't see a problem with > committing it upstream, but it would be nice to pull that change in > locally before 9.1 and not have to wait for LLVM 3.2 before we got to > make use of it. Having unused hash in the image causes on-disk bloat. Since hashes are merged into text segments (they are needed by rtld and so are mapped), this also causes memory use bloat. It is definitely not huge, at least not for normal binaries with reasonably sized symbol table. Also, it is more work for the linker to generate both tables. > > Misleading and poorly designed benchmarks on Phoronix are at stake! > > David pgpd7Nb5miiVO.pgp Description: PGP signature
Re: svn commit: r236137 - head/contrib/gcc/config/i386
On 2012-05-28 22:17, David Chisnall wrote: > On 28 May 2012, at 20:33, Dimitry Andric wrote: >> On the other hand, it's really platform-dependent: I've checked several >> Linux distributions, and it is fairly unpredictable whether their gcc >> passes --hash-style to the linker, or if they do, which option they use. > > Can we make it dependent on the triple? i.e. if the triple is > arch-whatever-freebsd9 or greater, make it pass the flag, otherwise don't > bother? Or is it not worth caring about older FreeBSD? There's no real > disadvantage in passing it unconditionally (marginally longer link times) and > potentially a big benefit. We only ship clang in FreeBSD 9 or later, so in our own copy it can be unconditional. FreeBSD 8 and earlier still use ld 2.15, which doesn't support --hash-style. But to not inconvenience users of the clang port, it would be nice to pass it only for freebsd9 and later. > I don't see a problem with committing it upstream, but it would be nice to > pull that change in locally before 9.1 and not have to wait for LLVM 3.2 > before we got to make use of it. > > Misleading and poorly designed benchmarks on Phoronix are at stake! Sure, I'll commit this now, and merge it to stable/9 later. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236199 - head/sys/dev/drm2/i915
Author: alc Date: Mon May 28 21:15:54 2012 New Revision: 236199 URL: http://svn.freebsd.org/changeset/base/236199 Log: A small simplification to i915_gem_pager_fault(). Reviewed by: kib Modified: head/sys/dev/drm2/i915/i915_gem.c Modified: head/sys/dev/drm2/i915/i915_gem.c == --- head/sys/dev/drm2/i915/i915_gem.c Mon May 28 20:44:11 2012 (r236198) +++ head/sys/dev/drm2/i915/i915_gem.c Mon May 28 21:15:54 2012 (r236199) @@ -1421,7 +1421,7 @@ unlocked_vmobj: if ((m->flags & VPO_BUSY) != 0) { DRM_UNLOCK(dev); - vm_page_sleep_if_busy(m, false, "915pbs"); + vm_page_sleep(m, "915pbs"); goto retry; } m->valid = VM_PAGE_BITS_ALL; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236213 - in head: sbin/fsck_msdosfs sbin/restore sys/boot/i386/libi386 sys/compat/ndis sys/i386/i386 usr.bin/chat usr.sbin/pkg_install/lib
Author: kevlo Date: Tue May 29 01:48:06 2012 New Revision: 236213 URL: http://svn.freebsd.org/changeset/base/236213 Log: Make sure that each va_start has one and only one matching va_end, especially in error cases. Modified: head/sbin/fsck_msdosfs/main.c head/sbin/restore/utilities.c head/sys/boot/i386/libi386/biospnp.c head/sys/compat/ndis/subr_ntoskrnl.c head/sys/i386/i386/bios.c head/usr.bin/chat/chat.c head/usr.sbin/pkg_install/lib/exec.c head/usr.sbin/pkg_install/lib/msg.c Modified: head/sbin/fsck_msdosfs/main.c == --- head/sbin/fsck_msdosfs/main.c Tue May 29 00:53:51 2012 (r236212) +++ head/sbin/fsck_msdosfs/main.c Tue May 29 01:48:06 2012 (r236213) @@ -138,6 +138,7 @@ ask(int def, const char *fmt, ...) va_start(ap, fmt); vsnprintf(prompt, sizeof(prompt), fmt, ap); + va_end(ap); if (alwaysyes || rdonly) { printf("%s? %s\n", prompt, rdonly ? "no" : "yes"); return !rdonly; Modified: head/sbin/restore/utilities.c == --- head/sbin/restore/utilities.c Tue May 29 00:53:51 2012 (r236212) +++ head/sbin/restore/utilities.c Tue May 29 01:48:06 2012 (r236213) @@ -411,6 +411,7 @@ panic(const char *fmt, ...) va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); + va_end(ap); if (yflag) return; if (reply("abort") == GOOD) { Modified: head/sys/boot/i386/libi386/biospnp.c == --- head/sys/boot/i386/libi386/biospnp.cTue May 29 00:53:51 2012 (r236212) +++ head/sys/boot/i386/libi386/biospnp.cTue May 29 01:48:06 2012 (r236213) @@ -276,6 +276,7 @@ biospnp_call(int func, const char *fmt, break; } } +va_end(ap); /* BIOS segment last */ *(u_int16_t *)argp = pnp_Icheck->pnp_rmds; Modified: head/sys/compat/ndis/subr_ntoskrnl.c == --- head/sys/compat/ndis/subr_ntoskrnl.cTue May 29 00:53:51 2012 (r236212) +++ head/sys/compat/ndis/subr_ntoskrnl.cTue May 29 01:48:06 2012 (r236213) @@ -3591,6 +3591,7 @@ DbgPrint(char *fmt, ...) if (bootverbose) { va_start(ap, fmt); vprintf(fmt, ap); + va_end(ap); } return (STATUS_SUCCESS); Modified: head/sys/i386/i386/bios.c == --- head/sys/i386/i386/bios.c Tue May 29 00:53:51 2012(r236212) +++ head/sys/i386/i386/bios.c Tue May 29 01:48:06 2012(r236213) @@ -372,9 +372,11 @@ bios16(struct bios_args *args, char *fmt break; default: + va_end(ap); return (EINVAL); } } +va_end(ap); if (flags & BIOSARGS_FLAG) { if (arg_end - arg_start > ctob(16)) @@ -448,9 +450,11 @@ bios16(struct bios_args *args, char *fmt break; default: + va_end(ap); return (EINVAL); } } +va_end(ap); set_bios_selectors(&args->seg, flags); bioscall_vector.vec16.offset = (u_short)args->entry; Modified: head/usr.bin/chat/chat.c == --- head/usr.bin/chat/chat.cTue May 29 00:53:51 2012(r236212) +++ head/usr.bin/chat/chat.cTue May 29 01:48:06 2012(r236213) @@ -408,6 +408,7 @@ chat_logf(const char *fmt, ...) va_start(args, fmt); vfmtmsg(line, sizeof(line), fmt, args); +va_end(args); if (to_log) syslog(LOG_INFO, "%s", line); if (to_stderr) @@ -425,6 +426,7 @@ fatal(int code, const char *fmt, ...) va_start(args, fmt); vfmtmsg(line, sizeof(line), fmt, args); +va_end(args); if (to_log) syslog(LOG_ERR, "%s", line); if (to_stderr) Modified: head/usr.sbin/pkg_install/lib/exec.c == --- head/usr.sbin/pkg_install/lib/exec.cTue May 29 00:53:51 2012 (r236212) +++ head/usr.sbin/pkg_install/lib/exec.cTue May 29 01:48:06 2012 (r236213) @@ -47,6 +47,7 @@ vsystem(const char *fmt, ...) va_start(args, fmt); if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) { warnx("vsystem args are too long"); + va_end(args); return 1; } #ifdef DEBUG @@ -82,6 +83,7 @@ vpipe(const char *fmt, ...) va_start(args, fmt); if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) { warnx("vsystem args are too long"); + va_end(args); return NULL; } #ifdef DEBUG Modified: head/usr.sbin/pkg_install/lib/msg.c =
svn commit: r236214 - in head/sys/sparc64: include sparc64
Author: alc Date: Tue May 29 01:52:38 2012 New Revision: 236214 URL: http://svn.freebsd.org/changeset/base/236214 Log: Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap.c. This new r/w lock is used primarily to synchronize access to the TTE lists. However, it will be used in a somewhat unconventional way. As finer-grained TTE list locking is added to each of the pmap functions that acquire this r/w lock, its acquisition will be changed from write to read, enabling concurrent execution of the pmap functions with finer-grained locking. Reviewed by: attilio Tested by:flo MFC after:10 days Modified: head/sys/sparc64/include/pmap.h head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tsb.c Modified: head/sys/sparc64/include/pmap.h == --- head/sys/sparc64/include/pmap.h Tue May 29 01:48:06 2012 (r236213) +++ head/sys/sparc64/include/pmap.h Tue May 29 01:52:38 2012 (r236214) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,7 @@ voidpmap_set_kctx(void); extern struct pmap kernel_pmap_store; #definekernel_pmap (&kernel_pmap_store) +extern struct rwlock tte_list_global_lock; extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: head/sys/sparc64/sparc64/pmap.c == --- head/sys/sparc64/sparc64/pmap.c Tue May 29 01:48:06 2012 (r236213) +++ head/sys/sparc64/sparc64/pmap.c Tue May 29 01:52:38 2012 (r236214) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,11 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; /* + * Global tte list lock + */ +struct rwlock tte_list_global_lock; + +/* * Allocate physical memory for use in pmap_bootstrap. */ static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); @@ -666,6 +672,11 @@ pmap_bootstrap(u_int cpu_impl) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); + /* +* Initialize the global tte list lock. +*/ + rw_init(&tte_list_global_lock, "tte list global"); + /* * Flush all non-locked TLB entries possibly left over by the * firmware. @@ -876,7 +887,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ struct tte *tp; int color; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_cache_enter: fake page")); PMAP_STATS_INC(pmap_ncache_enter); @@ -951,7 +962,7 @@ pmap_cache_remove(vm_page_t m, vm_offset struct tte *tp; int color; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); CTR3(KTR_PMAP, "pmap_cache_remove: m=%p va=%#lx c=%d", m, va, m->md.colors[DCACHE_COLOR(va)]); KASSERT((m->flags & PG_FICTITIOUS) == 0, @@ -1026,7 +1037,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) vm_page_t om; u_long data; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); PMAP_STATS_INC(pmap_nkenter); tp = tsb_kvtotte(va); CTR4(KTR_PMAP, "pmap_kenter: va=%#lx pa=%#lx tp=%p data=%#lx", @@ -1088,7 +1099,7 @@ pmap_kremove(vm_offset_t va) struct tte *tp; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); PMAP_STATS_INC(pmap_nkremove); tp = tsb_kvtotte(va); CTR3(KTR_PMAP, "pmap_kremove: va=%#lx tp=%p data=%#lx", va, tp, @@ -1139,19 +1150,16 @@ void pmap_qenter(vm_offset_t sva, vm_page_t *m, int count) { vm_offset_t va; - int locked; PMAP_STATS_INC(pmap_nqenter); va = sva; - if (!(locked = mtx_owned(&vm_page_queue_mtx))) - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); while (count-- > 0) { pmap_kenter(va, *m); va += PAGE_SIZE; m++; } - if (!locked) - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); tlb_range_demap(kernel_pmap, sva, va); } @@ -1163,18 +1171,15 @@ void pmap_qremove(vm_offset_t sva, int count) { vm_offset_t va; - int locked; PMAP_STATS_INC(pmap_nqremove); va = sva; - if (!(locked = mtx_owned(&vm_page_queue_mtx))) - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); while (count-- > 0) { pmap_kremove(va); va += PAGE_SIZE; } - if (!locked) -
svn commit: r236215 - head/sys/arm/at91
Author: imp Date: Tue May 29 03:23:18 2012 New Revision: 236215 URL: http://svn.freebsd.org/changeset/base/236215 Log: Compute the master clock frequency, so we no longer need to have it compiled into the kernel. This allows us to boot the same kernel on machines with different master clock frequencies, so long as we can determine the main clock frequency accurately. Cleanup the pmc clock init function so it can be called in early boot so we can use the serial port just after we call cninit. # We have two calls to at91_pmc_clock_init for reasons unknown, that will # be fixed later -- it is harmless for now. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91rm92reg.h head/sys/arm/at91/at91sam9260reg.h head/sys/arm/at91/at91sam9g20reg.h head/sys/arm/at91/at91var.h head/sys/arm/at91/std.ethernut5 head/sys/arm/at91/std.hl200 head/sys/arm/at91/std.hl201 head/sys/arm/at91/std.kb920x head/sys/arm/at91/std.qila9g20 head/sys/arm/at91/std.sam9g20ek Modified: head/sys/arm/at91/at91.c == --- head/sys/arm/at91/at91.cTue May 29 01:52:38 2012(r236214) +++ head/sys/arm/at91/at91.cTue May 29 03:23:18 2012(r236215) @@ -56,11 +56,7 @@ extern const struct pmap_devmap at91_dev uint32_t at91_chip_id; -#ifdef AT91C_MASTER_CLOCK -uint32_t at91_master_clock = AT91C_MASTER_CLOCK; -#else uint32_t at91_master_clock; -#endif static int at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, Modified: head/sys/arm/at91/at91_machdep.c == --- head/sys/arm/at91/at91_machdep.cTue May 29 01:52:38 2012 (r236214) +++ head/sys/arm/at91/at91_machdep.cTue May 29 03:23:18 2012 (r236215) @@ -363,6 +363,7 @@ initarm(void *arg, void *arg2) cninit(); +at91_pmc_init_clock(); /* Get chip id so device drivers know about differences */ at91_chip_id = *(volatile uint32_t *) (AT91_BASE + AT91_DBGU_BASE + DBGU_C1R); Modified: head/sys/arm/at91/at91_pmc.c == --- head/sys/arm/at91/at91_pmc.cTue May 29 01:52:38 2012 (r236214) +++ head/sys/arm/at91/at91_pmc.cTue May 29 03:23:18 2012 (r236215) @@ -55,12 +55,15 @@ static struct at91_pmc_softc { bus_space_handle_t sc_sh; struct resource *mem_res; /* Memory resource */ device_tdev; - uint32_tpllb_init; } *pmc_softc; +static uint32_t pllb_init; + MALLOC_DECLARE(M_PMC); MALLOC_DEFINE(M_PMC, "at91_pmc_clocks", "AT91 PMC Clock descriptors"); +#define AT91_PMC_BASE 0xc00 + static void at91_pmc_set_pllb_mode(struct at91_pmc_clock *, int); static void at91_pmc_set_sys_mode(struct at91_pmc_clock *, int); static void at91_pmc_set_periph_mode(struct at91_pmc_clock *, int); @@ -150,6 +153,11 @@ static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { + if (sc == NULL) { + uint32_t *p = (uint32_t *)(AT91_BASE + AT91_PMC_BASE + off); + + return *p; + } return (bus_read_4(sc->mem_res, off)); } @@ -157,7 +165,12 @@ static inline void WR4(struct at91_pmc_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + if (sc == NULL) { + uint32_t *p = (uint32_t *)(AT91_BASE + AT91_PMC_BASE + off); + + *p = val; + } else + bus_write_4(sc->mem_res, off, val); } void @@ -168,7 +181,7 @@ at91_pmc_set_pllb_mode(struct at91_pmc_c if (on) { on = PMC_IER_LOCKB; - value = sc->pllb_init; + value = pllb_init; } else value = 0; @@ -398,15 +411,17 @@ static const unsigned int at91_main_cloc 1600, 17344700, 18432000, 2000 }; #defineMAIN_CLOCK_TBL_LEN (sizeof(at91_main_clock_tbl) / sizeof(*at91_main_clock_tbl)) +#endif static unsigned int -at91_pmc_sense_main_clock(struct at91_pmc_softc *sc) +at91_pmc_sense_main_clock(void) { +#if !defined(AT91C_MAIN_CLOCK) unsigned int ckgr_val; unsigned int diff, matchdiff, freq; int i; - ckgr_val = (RD4(sc, CKGR_MCFR) & CKGR_MCFR_MAINF_MASK) << 11; + ckgr_val = (RD4(NULL, CKGR_MCFR) & CKGR_MCFR_MAINF_MASK) << 11; /* * Clocks up to 50MHz can be connected to some models. If @@ -432,21 +447,20 @@ at91_pmc_sense_main_clock(struct at91_pm } } return (freq); -} +#else + return (AT91C_MAIN_CLOCK); #endif +} -static void -at91_pmc_init_clock(struct at91_pmc_softc *sc) +void +at91_pmc_init_clock(void) { + struct at91_pmc_softc *sc = NULL; unsigned int main_clock;
svn commit: r236220 - head/sys/dev/acpica
Author: iwasaki Date: Tue May 29 05:09:40 2012 New Revision: 236220 URL: http://svn.freebsd.org/changeset/base/236220 Log: Fix the problem acpi_sleep_force() hang. Suspending from callout cause the freeze in DEVICE_SUSPEND(). Suspend from acpi_task thread in stead. MFC after:3 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c == --- head/sys/dev/acpica/acpi.c Tue May 29 04:53:46 2012(r236219) +++ head/sys/dev/acpica/acpi.c Tue May 29 05:09:40 2012(r236220) @@ -2449,15 +2449,29 @@ acpi_SetSleepState(struct acpi_softc *sc #if defined(__amd64__) || defined(__i386__) static void +acpi_sleep_force_task(void *context) +{ +struct acpi_softc *sc = (struct acpi_softc *)context; + +if (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) + device_printf(sc->acpi_dev, "force sleep state S%d failed\n", + sc->acpi_next_sstate); +} + +static void acpi_sleep_force(void *arg) { struct acpi_softc *sc = (struct acpi_softc *)arg; device_printf(sc->acpi_dev, "suspend request timed out, forcing sleep now\n"); -if (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) - device_printf(sc->acpi_dev, "force sleep state S%d failed\n", - sc->acpi_next_sstate); +/* + * XXX Suspending from callout cause the freeze in DEVICE_SUSPEND(). + * Suspend from acpi_task thread in stead. + */ +if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER, + acpi_sleep_force_task, sc))) + device_printf(sc->acpi_dev, "AcpiOsExecute() for sleeping failed\n"); } #endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236221 - head/sys/dev/acpica
Author: iwasaki Date: Tue May 29 05:28:34 2012 New Revision: 236221 URL: http://svn.freebsd.org/changeset/base/236221 Log: Reorder resume procedures. DEVICE_RESUME() should be done before AcpiLeaveSleepState() because PCI config space evaluation can be occurred during control method executions. This should fix one of the hang up problems on resuming. MFC after:3 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c == --- head/sys/dev/acpica/acpi.c Tue May 29 05:09:40 2012(r236220) +++ head/sys/dev/acpica/acpi.c Tue May 29 05:28:34 2012(r236221) @@ -2773,12 +2773,12 @@ backout: acpi_wake_prep_walk(state); sc->acpi_sstate = ACPI_STATE_S0; } +if (slp_state >= ACPI_SS_DEV_SUSPEND) + DEVICE_RESUME(root_bus); if (slp_state >= ACPI_SS_SLP_PREP) { AcpiLeaveSleepStatePrep(state, acpi_sleep_flags); AcpiLeaveSleepState(state); } -if (slp_state >= ACPI_SS_DEV_SUSPEND) - DEVICE_RESUME(root_bus); if (slp_state >= ACPI_SS_SLEPT) { acpi_resync_clock(sc); acpi_enable_fixed_events(sc); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"