svn commit: r270993 - head/sys/kern
Author: mjg Date: Wed Sep 3 06:25:34 2014 New Revision: 270993 URL: http://svnweb.freebsd.org/changeset/base/270993 Log: Fix up proc_realparent to always return correct process. Prior to the change it would always return initproc for non-traced processes. This fixes ps apparently always returning 1 as ppid. Pointy hat: mjg Reported by: many MFC after:1 week Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Wed Sep 3 05:14:50 2014(r270992) +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014(r270993) @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) sx_assert(proctree_lock, SX_LOCKED); if ((child-p_treeflag P_TREE_ORPHANED) == 0) { - return (child-p_pptr-p_pid == child-p_oppid ? - child-p_pptr : initproc); + if (child-p_oppid == 0 || + child-p_pptr-p_pid == child-p_oppid) + parent = child-p_pptr; + else + parent = initproc; + return (parent); } for (p = child; (p-p_treeflag P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ ___ 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: r270994 - head/sys/sys
Author: ed Date: Wed Sep 3 06:34:16 2014 New Revision: 270994 URL: http://svnweb.freebsd.org/changeset/base/270994 Log: Partially revert r270964. Don't test for C++11 to define _Thread_local. In addition to Clang 3.3, it turns out that GCC 4.7 in Ports also does not support the _Thread_local keyword. Let's document this in a bit more detail. Reported by: antoine@ Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hWed Sep 3 06:25:34 2014(r270993) +++ head/sys/sys/cdefs.hWed Sep 3 06:34:16 2014(r270994) @@ -298,7 +298,12 @@ #endif #if !__has_extension(c_thread_local) -#if (defined(__cplusplus) __cplusplus = 201103L) || \ +/* + * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode + * without actually supporting the thread_local keyword. Don't check for + * the presence of C++11 when defining _Thread_local. + */ +#if /* (defined(__cplusplus) __cplusplus = 201103L) || */ \ __has_extension(cxx_thread_local) #define_Thread_local thread_local #else ___ 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: r270964 - head/sys/sys
On 3 September 2014 07:44, Antoine Brodin anto...@freebsd.org wrote: This change may break the lang/gcc port on head: http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p367138_s270990/logs/errors/gcc-4.7.4.log Good catch! Fixed in r270994. -- Ed Schouten e...@80386.nl ___ 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: r270993 - head/sys/kern
On Wed, Sep 03, 2014 at 06:25:35AM +, Mateusz Guzik wrote: Author: mjg Date: Wed Sep 3 06:25:34 2014 New Revision: 270993 URL: http://svnweb.freebsd.org/changeset/base/270993 Log: Fix up proc_realparent to always return correct process. Prior to the change it would always return initproc for non-traced processes. This fixes ps apparently always returning 1 as ppid. Pointy hat: mjg No, this is my bug. Thank you for fixing it. It is a consequence of the last minute 'safety' change I did. Reported by:many MFC after: 1 week I suggest to merge in 3 days. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Wed Sep 3 05:14:50 2014(r270992) +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014(r270993) @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) sx_assert(proctree_lock, SX_LOCKED); if ((child-p_treeflag P_TREE_ORPHANED) == 0) { - return (child-p_pptr-p_pid == child-p_oppid ? - child-p_pptr : initproc); + if (child-p_oppid == 0 || + child-p_pptr-p_pid == child-p_oppid) + parent = child-p_pptr; + else + parent = initproc; + return (parent); } for (p = child; (p-p_treeflag P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ pgpDznV1X8nbi.pgp Description: PGP signature
Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
- Original Message - From: Andriy Gapon a...@freebsd.org on 02/09/2014 20:43 Steven Hartland said the following: - Original Message - From: Andriy Gapon a...@freebsd.org And the newly added kmem_foo() functions probably do not belong in cddl/compat/opensolaris as Solaris / illumos does not have those functions. They could be moved but their current location keeps all the kmem related functions neatly in one place. Spreading them around IMO would just make things hard to find. BTW, here is some of my old WIP that completely removed the pre-existing kmem_* functions and made the related code much closer to that in illumos. Unfortunately, I will now have hard time merging my changes with your change. https://github.com/avg-I/freebsd/compare/wip/hc/kmem_size-memguard-fix (esp.commits e0cf2f7 and becf087) Looking good, I'm all for eliminating the differences between the two code bases as that will make things easier to maintain in the future, so something we should definitely try to get in for 11. Regards Steve ___ 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: r271012 - in head: include sys/sys
Author: ed Date: Wed Sep 3 09:35:38 2014 New Revision: 271012 URL: http://svnweb.freebsd.org/changeset/base/271012 Log: Leave the C11 keywords alone when we have a recent version of GCC. As GCC also gained support for the C11 keywords over time, we can patch up sys/cdefs.h to not define these anymore. This has the advantage that error messages for static assertions are printed natively and that _Alignas() will work with even a type outside of C11 mode. All C11 keywords are supported with GCC 4.7 and higher, with the exception of _Thread_local and _Generic. These are only supported as of GCC 4.9. Modified: head/include/tgmath.h head/sys/sys/cdefs.h Modified: head/include/tgmath.h == --- head/include/tgmath.h Wed Sep 3 09:05:37 2014(r271011) +++ head/include/tgmath.h Wed Sep 3 09:35:38 2014(r271012) @@ -61,7 +61,7 @@ */ #if (defined(__STDC_VERSION__) __STDC_VERSION__ = 201112L) || \ -__has_extension(c_generic_selections) +__has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9) #define__tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ _Generic(x, \ long double _Complex: cfnl, \ Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hWed Sep 3 09:05:37 2014(r271011) +++ head/sys/sys/cdefs.hWed Sep 3 09:35:38 2014(r271012) @@ -254,7 +254,7 @@ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ 201112L -#if !__has_extension(c_alignas) +#if !__has_extension(c_alignas) !__GNUC_PREREQ__(4, 7) #if (defined(__cplusplus) __cplusplus = 201103L) || \ __has_extension(cxx_alignas) #define_Alignas(x) alignas(x) @@ -264,11 +264,13 @@ #endif #endif +#if !__GNUC_PREREQ__(4, 7) #if defined(__cplusplus) __cplusplus = 201103L #define_Alignof(x) alignof(x) #else #define_Alignof(x) __alignof(x) #endif +#endif #if !__has_extension(c_atomic) !__has_extension(cxx_atomic) /* @@ -278,13 +280,15 @@ #define_Atomic(T) struct { T volatile __val; } #endif +#if !__GNUC_PREREQ__(4, 7) #if defined(__cplusplus) __cplusplus = 201103L #define_Noreturn [[noreturn]] #else #define_Noreturn __dead2 #endif +#endif -#if !__has_extension(c_static_assert) +#if !__has_extension(c_static_assert) !__GNUC_PREREQ__(4, 7) #if (defined(__cplusplus) __cplusplus = 201103L) || \ __has_extension(cxx_static_assert) #define_Static_assert(x, y)static_assert(x, y) @@ -297,7 +301,7 @@ #endif #endif -#if !__has_extension(c_thread_local) +#if !__has_extension(c_thread_local) !__GNUC_PREREQ__(4, 9) /* * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode * without actually supporting the thread_local keyword. Don't check for @@ -322,7 +326,8 @@ * distinguish multiple cases. */ -#if defined(__STDC_VERSION__) __STDC_VERSION__ = 201112L +#if (defined(__STDC_VERSION__) __STDC_VERSION__ = 201112L) || \ +__has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9) #define__generic(expr, t, yes, no) \ _Generic(expr, t: yes, default: no) #elif __GNUC_PREREQ__(3, 1) !defined(__cplusplus) ___ 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: r270999 - head/sys/kern
Mateusz, Kostik, On Wed, Sep 03, 2014 at 10:55:23AM +0200, Mateusz Guzik wrote: M Modified: head/sys/kern/kern_proc.c M == M --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) M +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) M @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str M kp-ki_xstat = p-p_xstat; M kp-ki_acflag = p-p_acflag; M kp-ki_lock = p-p_lock; M - if (p-p_pptr) M + if (p-p_pptr) { M kp-ki_ppid = proc_realparent(p)-p_pid; M - if (p-p_flag P_TRACED) M - kp-ki_tracer = p-p_pptr-p_pid; M + if (p-p_flag P_TRACED) M + kp-ki_tracer = p-p_pptr-p_pid; M + } M } M M /* M M M p_pptr must be non-NULL if P_TRACED is set. If there is no way to M annotate it for coverity, this change deserves a comment in the code M (and in retrospect previous code should have had appropriate comment as M well). Thanks for explanation. I'd suggest to leave the change in, since now it is a micro-micro-optimization :) -- 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
svn commit: r271013 - head/sys/dev/drm
Author: glebius Date: Wed Sep 3 09:58:59 2014 New Revision: 271013 URL: http://svnweb.freebsd.org/changeset/base/271013 Log: Remove always false comparison. Sponsored by: Nginx, Inc. Modified: head/sys/dev/drm/drm_sysctl.c Modified: head/sys/dev/drm/drm_sysctl.c == --- head/sys/dev/drm/drm_sysctl.c Wed Sep 3 09:35:38 2014 (r271012) +++ head/sys/dev/drm/drm_sysctl.c Wed Sep 3 09:58:59 2014 (r271013) @@ -193,7 +193,7 @@ static int drm_vm_info DRM_SYSCTL_HANDLE for (i = 0; i mapcount; i++) { map = tempmaps[i]; - if (map-type 0 || map-type 4) + if (map-type 4) type = ??; else type = types[map-type]; ___ 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: r271014 - head/sbin/ifconfig
Author: melifaro Date: Wed Sep 3 11:07:49 2014 New Revision: 271014 URL: http://svnweb.freebsd.org/changeset/base/271014 Log: * Unconditionally turn on SIOCGI2C probing for all interfaces on ifconfig -v. I've seen no measurable timing difference for doing additional SIOCGI2C call for system with 4k vlans. * Determine appropriate handler (SFP/QSFP) by reading identification byte (which is the same for both SFF-8472 and SFF-8436) instead of checking driver name. MFC with: r270064 Sponsored by: Yandex LLC Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c == --- head/sbin/ifconfig/sfp.cWed Sep 3 09:58:59 2014(r271013) +++ head/sbin/ifconfig/sfp.cWed Sep 3 11:07:49 2014(r271014) @@ -753,25 +753,31 @@ void sfp_status(int s, struct ifreq *ifr, int verbose) { struct i2c_info ii; + uint8_t id_byte; memset(ii, 0, sizeof(ii)); /* Prepare necessary into to pass to NIC handler */ ii.s = s; ii.ifr = ifr; + ii.f = read_i2c_generic; /* -* Check if we have i2c support for particular driver. -* TODO: Determine driver by original name. +* Try to read byte 0 from i2c: +* Both SFF-8472 and SFF-8436 use it as +* 'identification byte' */ - if (strncmp(ifr-ifr_name, ix, 2) == 0) { - ii.f = read_i2c_generic; - print_sfp_status(ii, verbose); - } else if (strncmp(ifr-ifr_name, cxl, 3) == 0) { - ii.port_id = atoi(ifr-ifr_name[3]); - ii.f = read_i2c_generic; - ii.cfd = -1; - print_qsfp_status(ii, verbose); - } else + id_byte = 0; + ii.f(ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)id_byte); + if (ii.error != 0) return; + + switch (id_byte) { + case SFF_8024_ID_QSFP: + case SFF_8024_ID_QSFPPLUS: + print_qsfp_status(ii, verbose); + break; + default: + print_sfp_status(ii, 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
svn commit: r271017 - in head/sys/dev/usb: . quirk
Author: hselasky Date: Wed Sep 3 11:46:43 2014 New Revision: 271017 URL: http://svnweb.freebsd.org/changeset/base/271017 Log: Add new quirk. PR: 193279 MFC after:1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c == --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 11:17:27 2014 (r271016) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 11:46:43 2014 (r271017) @@ -130,6 +130,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x, 0x, UQ_MS_LEADING_BYTE), /* Quirk for Corsair Vengeance K60 keyboard */ USB_QUIRK(CORSAIR, K60, 0x, 0x, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair Vengeance K60 keyboard */ + USB_QUIRK(CORSAIR, K70, 0x, 0x, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsWed Sep 3 11:17:27 2014(r271016) +++ head/sys/dev/usb/usbdevsWed Sep 3 11:46:43 2014(r271017) @@ -1486,6 +1486,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEt /* Corsair products */ product CORSAIR K600x0a60 Corsair Vengeance K60 keyboard +product CORSAIR K700x1b09 Corsair Vengeance K70 keyboard /* Creative products */ product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
on 03/09/2014 11:09 Steven Hartland said the following: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I think that your changes went in a bit prematurely (little review), so perhaps MFC would be premature as well. I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve -- Andriy Gapon ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
- Original Message - From: Andriy Gapon a...@freebsd.org on 03/09/2014 11:09 Steven Hartland said the following: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I think that your changes went in a bit prematurely (little review), so perhaps MFC would be premature as well. Its a change which really needs to make it into 10.1 IMO due to its impact on users so I don't really want to hold off too long. If anyone has any substantiated reason to then off course I'll hold off. Regards Steve ___ 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: r270993 - head/sys/kern
On Wed, Sep 03, 2014 at 10:16:29AM +0300, Konstantin Belousov wrote: On Wed, Sep 03, 2014 at 06:25:35AM +, Mateusz Guzik wrote: Author: mjg Date: Wed Sep 3 06:25:34 2014 New Revision: 270993 URL: http://svnweb.freebsd.org/changeset/base/270993 Log: Fix up proc_realparent to always return correct process. Prior to the change it would always return initproc for non-traced processes. This fixes ps apparently always returning 1 as ppid. Pointy hat: mjg No, this is my bug. Thank you for fixing it. It is a consequence of the last minute 'safety' change I did. I used it without veryfing it returns correct results. I'm happy to share the blame. : Reported by: many MFC after:1 week I suggest to merge in 3 days. Ok. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Wed Sep 3 05:14:50 2014 (r270992) +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014 (r270993) @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) sx_assert(proctree_lock, SX_LOCKED); if ((child-p_treeflag P_TREE_ORPHANED) == 0) { - return (child-p_pptr-p_pid == child-p_oppid ? - child-p_pptr : initproc); + if (child-p_oppid == 0 || + child-p_pptr-p_pid == child-p_oppid) + parent = child-p_pptr; + else + parent = initproc; + return (parent); } for (p = child; (p-p_treeflag P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ -- Mateusz Guzik mjguzik gmail.com ___ 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: r271018 - head/sys/dev/usb/quirk
Author: hselasky Date: Wed Sep 3 13:15:16 2014 New Revision: 271018 URL: http://svnweb.freebsd.org/changeset/base/271018 Log: Fix spelling. PR: 193279 MFC after:1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c == --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 11:46:43 2014 (r271017) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 13:15:16 2014 (r271018) @@ -130,7 +130,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x, 0x, UQ_MS_LEADING_BYTE), /* Quirk for Corsair Vengeance K60 keyboard */ USB_QUIRK(CORSAIR, K60, 0x, 0x, UQ_KBD_BOOTPROTO), - /* Quirk for Corsair Vengeance K60 keyboard */ + /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x, 0x, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), ___ 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: r271025 - head/contrib/llvm/lib/Target/ARM
Author: sbruno Date: Wed Sep 3 14:16:50 2014 New Revision: 271025 URL: http://svnweb.freebsd.org/changeset/base/271025 Log: MFV: Only emit movw on ARMv6T2 Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS in base doesn't understand this instruction for this target. One would need to use --integrated-as to get this to build if desired. http://llvm.org/viewvc/llvm-project?view=revisionrevision=216989 Submitted by: ian Reviewed by: dim Obtained from:llvm.org MFC after:2 days Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td == --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.tdWed Sep 3 14:06:12 2014(r271024) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.tdWed Sep 3 14:16:50 2014(r271025) @@ -3248,7 +3248,8 @@ def : ARMPat(ARMaddc GPR:$src, imm0_655 def : ARMPat(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm); def : ARMPat(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), - (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))); + (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))), + Requires[IsARM, HasV6T2]; // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function ___ 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: r271026 - head/lib/libnv
Author: pjd Date: Wed Sep 3 14:44:23 2014 New Revision: 271026 URL: http://svnweb.freebsd.org/changeset/base/271026 Log: Fix descriptors leak in case of nvlist_xunpack() failure. Submitted by: Mariusz Zaborski osho...@freebsd.org Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c == --- head/lib/libnv/nvlist.c Wed Sep 3 14:16:50 2014(r271025) +++ head/lib/libnv/nvlist.c Wed Sep 3 14:44:23 2014(r271026) @@ -760,8 +760,11 @@ nvlist_recv(int sock) } nvl = nvlist_xunpack(buf, size, fds, nfds); - if (nvl == NULL) + if (nvl == NULL) { + for (i = 0; i nfds; i++) + close(fds[i]); goto out; + } ret = nvl; out: ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
on 03/09/2014 15:17 Steven Hartland said the following: - Original Message - From: Andriy Gapon a...@freebsd.org on 03/09/2014 11:09 Steven Hartland said the following: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I think that your changes went in a bit prematurely (little review), so perhaps MFC would be premature as well. Its a change which really needs to make it into 10.1 IMO I think that this is the arguable point. As I've mentioned before I have not noticed, perhaps through the fault of my own, any reports that users need this change after Alan's pagedaemon fix(es). Also, there is no confirmation yet that after this change ARC does not give up its buffers too easily. due to its impact on users so I don't really want to hold off too long. If anyone has any substantiated reason to then off course I'll hold off. -- Andriy Gapon ___ 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: r271000 - head/sys/kern
On 9/3/2014 3:18 AM, Konstantin Belousov wrote: Author: kib Date: Wed Sep 3 08:18:07 2014 New Revision: 271000 URL: http://svnweb.freebsd.org/changeset/base/271000 Log: Right now, thread_single(SINGLE_EXIT) returns after the p_numthreads reaches 1. The p_numthreads counter is decremented in thread_exit() by a call to thread_unlink(). This means that the exiting threads may still execute on other CPUs when thread_single(SINGLE_EXIT) returns. As result, vmspace could be destroyed while paging structures are still used on other CPUs by exiting threads. Delay the return from thread_single(SINGLE_EXIT) until all threads are really destroyed by thread_stash() after the last switch out. The p_exitthreads counter already provides the required mechanism, move the wait from the thread_wait() (which is called from wait(2) code) into thread_single(). Reported by:many (as panic: pmap active addr) Reviewed by:alc, jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c == --- head/sys/kern/kern_thread.c Wed Sep 3 08:14:07 2014 (r270999) +++ head/sys/kern/kern_thread.c Wed Sep 3 08:18:07 2014 (r271000) @@ -432,6 +432,7 @@ thread_exit(void) */ if (p-p_flag P_HADTHREADS) { if (p-p_numthreads 1) { + atomic_add_int(td-td_proc-p_exitthreads, 1); thread_unlink(td); td2 = FIRST_THREAD_IN_PROC(p); sched_exit_thread(td2, td); @@ -452,7 +453,6 @@ thread_exit(void) } } - atomic_add_int(td-td_proc-p_exitthreads, 1); PCPU_SET(deadthread, td); } else { /* @@ -507,14 +507,12 @@ thread_wait(struct proc *p) struct thread *td; mtx_assert(Giant, MA_NOTOWNED); - KASSERT((p-p_numthreads == 1), (Multiple threads in wait1())); + KASSERT((p-p_numthreads == 1), (multiple threads in thread_wait())); + KASSERT((p-p_exitthreads == 0), (p_exitthreads leaking)); td = FIRST_THREAD_IN_PROC(p); /* Lock the last thread so we spin until it exits cpu_throw(). */ thread_lock(td); thread_unlock(td); - /* Wait for any remaining threads to exit cpu_throw(). */ - while (p-p_exitthreads) - sched_relinquish(curthread); lock_profile_thread_exit(td); cpuset_rel(td-td_cpuset); td-td_cpuset = NULL; @@ -722,6 +720,17 @@ stopme: p-p_singlethread = NULL; p-p_flag = ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); thread_unthread(td); + + /* + * Wait for any remaining threads to exit cpu_throw(). + */ + while (p-p_exitthreads != 0) { + PROC_SUNLOCK(p); + PROC_UNLOCK(p); + sched_relinquish(td); + PROC_LOCK(p); + PROC_SLOCK(p); + } } PROC_SUNLOCK(p); return (0); Thanks! -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r271028 - head/lib/libnv
Author: pjd Date: Wed Sep 3 15:08:33 2014 New Revision: 271028 URL: http://svnweb.freebsd.org/changeset/base/271028 Log: Use better type for i. Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c == --- head/lib/libnv/nvlist.c Wed Sep 3 15:06:47 2014(r271027) +++ head/lib/libnv/nvlist.c Wed Sep 3 15:08:33 2014(r271028) @@ -727,8 +727,8 @@ nvlist_recv(int sock) struct nvlist_header nvlhdr; nvlist_t *nvl, *ret; unsigned char *buf; - size_t nfds, size; - int serrno, i, *fds; + size_t nfds, size, i; + int serrno, *fds; if (buf_recv(sock, nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); ___ 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: r271027 - head/lib/libnv
Author: pjd Date: Wed Sep 3 15:06:47 2014 New Revision: 271027 URL: http://svnweb.freebsd.org/changeset/base/271027 Log: Declare i. Reported by: sbruno Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c == --- head/lib/libnv/nvlist.c Wed Sep 3 14:44:23 2014(r271026) +++ head/lib/libnv/nvlist.c Wed Sep 3 15:06:47 2014(r271027) @@ -728,7 +728,7 @@ nvlist_recv(int sock) nvlist_t *nvl, *ret; unsigned char *buf; size_t nfds, size; - int serrno, *fds; + int serrno, i, *fds; if (buf_recv(sock, nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
On 09/03/14 04:09, Steven Hartland wrote: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve I have no technical input, but this change improves ARC usefulness for me quite a bit. I would like to see the improvement in 10-STABLE. - Nikolai Lifanov ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
on 03/09/2014 17:58 Andriy Gapon said the following: on 03/09/2014 15:17 Steven Hartland said the following: - Original Message - From: Andriy Gapon a...@freebsd.org on 03/09/2014 11:09 Steven Hartland said the following: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I think that your changes went in a bit prematurely (little review), so perhaps MFC would be premature as well. Its a change which really needs to make it into 10.1 IMO I think that this is the arguable point. As I've mentioned before I have not noticed, perhaps through the fault of my own, any reports that users need this change after Alan's pagedaemon fix(es). Also, there is no confirmation yet that after this change ARC does not give up its buffers too easily. due to its impact on users so I don't really want to hold off too long. If anyone has any substantiated reason to then off course I'll hold off. Based on our parallel conversation I feel a need to clarify my position. The commit in question has multiple changes in it: 1. removal of KVA check, which was later correctly restored for i386 2. addition of DTrace probes 3. zfs_arc_free_target check and all the support code for it So, #1 plus later fixes is obviously correct. #2 is useful and I like it. #3 is what I have great doubts about. All of what I said in the previous emails applies to #3 exclusively. -- Andriy Gapon ___ 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: r271029 - in head/contrib/llvm: lib/Target/ARM patches
Author: sbruno Date: Wed Sep 3 15:32:38 2014 New Revision: 271029 URL: http://svnweb.freebsd.org/changeset/base/271029 Log: Do not direct commit to contrib/llvm. Make the change a patch file instead. Reverts 271025 but still functionally patches it. Original intent is still the same. Pointed out by rdivacky. MFV: Only emit movw on ARMv6T2 Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS in base doesn't understand this instruction for this target. One would need to use --integrated-as to get this to build if desired. http://llvm.org/viewvc/llvm-project?view=revisionrevision=216989 Submitted by: ian Reviewed by: dim Obtained from:llvm.org MFC after:2 days Relnotes: yes Added: head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td == --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.tdWed Sep 3 15:08:33 2014(r271028) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.tdWed Sep 3 15:32:38 2014(r271029) @@ -3248,8 +3248,7 @@ def : ARMPat(ARMaddc GPR:$src, imm0_655 def : ARMPat(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm); def : ARMPat(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), - (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))), - Requires[IsARM, HasV6T2]; + (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))); // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function Added: head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff Wed Sep 3 15:32:38 2014(r271029) @@ -0,0 +1,14 @@ +Index: lib/Target/ARM/ARMInstrInfo.td +=== +--- lib/Target/ARM/ARMInstrInfo.td (revision 271024) lib/Target/ARM/ARMInstrInfo.td (revision 271026) +@@ -3248,7 +3248,8 @@ + def : ARMPat(ARMadde GPR:$src, so_imm_not:$imm, CPSR), + (SBCri GPR:$src, so_imm_not:$imm); + def : ARMPat(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), +- (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))); ++ (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))), ++ Requires[IsARM, HasV6T2]; + + // Note: These are implemented in C++ code, because they have to generate + // ADD/SUBrs instructions, which use a complex pattern that a xform function ___ 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: r271030 - head/contrib/llvm/lib/Target/ARM
Author: sbruno Date: Wed Sep 3 15:48:07 2014 New Revision: 271030 URL: http://svnweb.freebsd.org/changeset/base/271030 Log: Apparently, the patch commited in svn r271029 doesn't actually do anyting, so we still need to modify the code in place. Pointed out by emaste. MFC after:2 days Relnotes: yes Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td == --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.tdWed Sep 3 15:32:38 2014(r271029) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.tdWed Sep 3 15:48:07 2014(r271030) @@ -3248,7 +3248,8 @@ def : ARMPat(ARMaddc GPR:$src, imm0_655 def : ARMPat(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm); def : ARMPat(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), - (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))); + (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm))), + Requires[IsARM, HasV6T2]; // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function ___ 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: r269814 - head/sys/dev/xen/blkfront
El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: El 28/08/14 a les 20.58, Alexander Motin ha escrit: On 28.08.2014 21:45, John-Mark Gurney wrote: Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: Hi, Roger. It looks to me like this commit does not work as it should. I got problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. Somehow newfs does not produce valid filesystem. Problem is reliably repeatable and reverting this commit fixes it. I found at least one possible cause there: If original data buffer is unmapped, misaligned and not physically contiguous, then present x86 bus_dmamap_load_bio() implementation will process each physically contiguous segment separately. Due to the misalignment first and last physical segments may have size not multiple to 512 bytes. Since each segment processed separately, they are not joined together, and xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to convert them to exact number of sectors in the driver cause data corruption. Are you sure this isn't a problem w/ the tag not properly specifying the correct alignement? I don't know how to specify it stronger then this: error = bus_dma_tag_create( bus_get_dma_tag(sc-xbd_dev), /* parent */ 512, PAGE_SIZE, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sc-xbd_max_request_size, sc-xbd_max_request_segments, PAGE_SIZE, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ sc-xbd_io_lock, /* lockarg */ sc-xbd_io_dmat); Also, I don't think there is a way for busdma to say that you MUST have a segment be a multiple of 512, though you could use a 512 boundary, but that would force all segments to only be 512 bytes... As I understand, that is mandatory requirement for this hardware. Alike 4K alignment requirement also exist at least for SDHCI, and IIRC UHCI/OHCI hardware. Even AHCI requires both segment addresses and lengths to be even. I may be wrong, but I think it is quite likely that hardware that requires segment address alignment quite likely will have the same requirements for segments length. Hello, I have the following fix, which makes sure the total length and the size of each segment is aligned. I'm not very knowledgeable of the busdma code, so someone has to review it. I feel that this alignment should only be enforced via a new option on the tag... I don't see how alignment and segment size should be conflated... I could totally see a device that requires an alignement of 8 bytes, but has a segment size of 16, or vice versa, and requiring them to be the same means we will bounce unnecesarily... cc'd scottl since he knows this code better than I... and cperciva as he touched it for similar reasons.. Oh, I just found PR 152818, where cperciva did a similar fix to bounce_bus_dmamap_load_buffer for the exact same reason... It was committed in r216194... Since Xen blkfront seems to be the only driver to have such segment size requirements, it might be best to just fix blkfront to always roundup segment size to 512, like the following: diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c index 26b8f09..2d284d9 100644 --- a/sys/dev/xen/blkfront/blkfront.c +++ b/sys/dev/xen/blkfront/blkfront.c @@ -209,7 +209,8 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) buffer_ma = segs-ds_addr; fsect = (buffer_ma PAGE_MASK) XBD_SECTOR_SHFT; - lsect = fsect + (segs-ds_len XBD_SECTOR_SHFT) - 1; + lsect = fsect + (roundup2(segs-ds_len, 512) +XBD_SECTOR_SHFT) - 1; KASSERT(lsect = 7, (XEN disk driver data cannot cross a page boundary)); --- diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index d1c75f8..688f559 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -620,6 +620,8 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, segs = dmat-segments; if ((dmat-bounce_flags BUS_DMA_COULD_BOUNCE) != 0) { +/* Make sure buflen is aligned */ +buflen = roundup2(buflen, dmat-common.alignment); _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map-pagesneeded != 0) {
Re: svn commit: r269814 - head/sys/dev/xen/blkfront
On 03.09.2014 18:48, Roger Pau Monné wrote: El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: El 28/08/14 a les 20.58, Alexander Motin ha escrit: On 28.08.2014 21:45, John-Mark Gurney wrote: Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: Hi, Roger. It looks to me like this commit does not work as it should. I got problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. Somehow newfs does not produce valid filesystem. Problem is reliably repeatable and reverting this commit fixes it. I found at least one possible cause there: If original data buffer is unmapped, misaligned and not physically contiguous, then present x86 bus_dmamap_load_bio() implementation will process each physically contiguous segment separately. Due to the misalignment first and last physical segments may have size not multiple to 512 bytes. Since each segment processed separately, they are not joined together, and xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to convert them to exact number of sectors in the driver cause data corruption. Are you sure this isn't a problem w/ the tag not properly specifying the correct alignement? I don't know how to specify it stronger then this: error = bus_dma_tag_create( bus_get_dma_tag(sc-xbd_dev), /* parent */ 512, PAGE_SIZE, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sc-xbd_max_request_size, sc-xbd_max_request_segments, PAGE_SIZE, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ sc-xbd_io_lock, /* lockarg */ sc-xbd_io_dmat); Also, I don't think there is a way for busdma to say that you MUST have a segment be a multiple of 512, though you could use a 512 boundary, but that would force all segments to only be 512 bytes... As I understand, that is mandatory requirement for this hardware. Alike 4K alignment requirement also exist at least for SDHCI, and IIRC UHCI/OHCI hardware. Even AHCI requires both segment addresses and lengths to be even. I may be wrong, but I think it is quite likely that hardware that requires segment address alignment quite likely will have the same requirements for segments length. Hello, I have the following fix, which makes sure the total length and the size of each segment is aligned. I'm not very knowledgeable of the busdma code, so someone has to review it. I feel that this alignment should only be enforced via a new option on the tag... I don't see how alignment and segment size should be conflated... I could totally see a device that requires an alignement of 8 bytes, but has a segment size of 16, or vice versa, and requiring them to be the same means we will bounce unnecesarily... cc'd scottl since he knows this code better than I... and cperciva as he touched it for similar reasons.. Oh, I just found PR 152818, where cperciva did a similar fix to bounce_bus_dmamap_load_buffer for the exact same reason... It was committed in r216194... Since Xen blkfront seems to be the only driver to have such segment size requirements, No, it is not. I've already posted other examples I can recall: SDHCI, UHCI/OHCI and AHCI. Their limitations are different and less strict, but still may need handling. For SDHCI, since it is quite slow and has many other bugs, I practically implemented custom buffer bouncing. AHCI I suppose works only because limitation is only for even addresses, and odd ones happen extremely rarely (does not happen). For USB I am not sure, but at least umass driver does not support unmapped I/O. it might be best to just fix blkfront to always roundup segment size to 512, like the following: I think some coffee is needed here. ;) Rounding addresses won't make data properly aligned. Some copy is unavoidable in such cases. It would be good if it was done properly by default buffer bouncer. diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c index 26b8f09..2d284d9 100644 --- a/sys/dev/xen/blkfront/blkfront.c +++ b/sys/dev/xen/blkfront/blkfront.c @@ -209,7 +209,8 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) buffer_ma = segs-ds_addr; fsect = (buffer_ma PAGE_MASK) XBD_SECTOR_SHFT; - lsect = fsect + (segs-ds_len XBD_SECTOR_SHFT) - 1; + lsect = fsect + (roundup2(segs-ds_len, 512) + XBD_SECTOR_SHFT)
Re: svn commit: r269814 - head/sys/dev/xen/blkfront
On Wed, 2014-09-03 at 19:03 +0300, Alexander Motin wrote: On 03.09.2014 18:48, Roger Pau Monné wrote: El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: El 28/08/14 a les 20.58, Alexander Motin ha escrit: On 28.08.2014 21:45, John-Mark Gurney wrote: Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: Hi, Roger. It looks to me like this commit does not work as it should. I got problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. Somehow newfs does not produce valid filesystem. Problem is reliably repeatable and reverting this commit fixes it. I found at least one possible cause there: If original data buffer is unmapped, misaligned and not physically contiguous, then present x86 bus_dmamap_load_bio() implementation will process each physically contiguous segment separately. Due to the misalignment first and last physical segments may have size not multiple to 512 bytes. Since each segment processed separately, they are not joined together, and xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to convert them to exact number of sectors in the driver cause data corruption. Are you sure this isn't a problem w/ the tag not properly specifying the correct alignement? I don't know how to specify it stronger then this: error = bus_dma_tag_create( bus_get_dma_tag(sc-xbd_dev), /* parent */ 512, PAGE_SIZE, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sc-xbd_max_request_size, sc-xbd_max_request_segments, PAGE_SIZE, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ sc-xbd_io_lock, /* lockarg */ sc-xbd_io_dmat); Also, I don't think there is a way for busdma to say that you MUST have a segment be a multiple of 512, though you could use a 512 boundary, but that would force all segments to only be 512 bytes... As I understand, that is mandatory requirement for this hardware. Alike 4K alignment requirement also exist at least for SDHCI, and IIRC UHCI/OHCI hardware. Even AHCI requires both segment addresses and lengths to be even. I may be wrong, but I think it is quite likely that hardware that requires segment address alignment quite likely will have the same requirements for segments length. Hello, I have the following fix, which makes sure the total length and the size of each segment is aligned. I'm not very knowledgeable of the busdma code, so someone has to review it. I feel that this alignment should only be enforced via a new option on the tag... I don't see how alignment and segment size should be conflated... I could totally see a device that requires an alignement of 8 bytes, but has a segment size of 16, or vice versa, and requiring them to be the same means we will bounce unnecesarily... cc'd scottl since he knows this code better than I... and cperciva as he touched it for similar reasons.. Oh, I just found PR 152818, where cperciva did a similar fix to bounce_bus_dmamap_load_buffer for the exact same reason... It was committed in r216194... Since Xen blkfront seems to be the only driver to have such segment size requirements, No, it is not. I've already posted other examples I can recall: SDHCI, UHCI/OHCI and AHCI. Their limitations are different and less strict, but still may need handling. For SDHCI, since it is quite slow and has many other bugs, I practically implemented custom buffer bouncing. AHCI I suppose works only because limitation is only for even addresses, and odd ones happen extremely rarely (does not happen). For USB I am not sure, but at least umass driver does not support unmapped I/O. it might be best to just fix blkfront to always roundup segment size to 512, like the following: I think some coffee is needed here. ;) Rounding addresses won't make data properly aligned. Some copy is unavoidable in such cases. It would be good if it was done properly by default buffer bouncer. And likewise I don't see how rounding up sizes can result in anything other than writing extra garbage to disk. If there is a 512 byte sector's worth of data not aligned to a 512 boundary and crossing a page boundary, the bounce code is going to have to cope with the fact that the second half of the data to be copied may not be physically contiguous, unless there's some rule in the phys bio world that g'tees it is. -- Ian diff
svn commit: r271043 - head/share/man/man5
Author: gjb Date: Wed Sep 3 17:15:12 2014 New Revision: 271043 URL: http://svnweb.freebsd.org/changeset/base/271043 Log: Update the autofs(5) manual to reflect it first appeared in FreeBSD 10.1-RELEASE. Submitted by: dhw MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/autofs.5 Modified: head/share/man/man5/autofs.5 == --- head/share/man/man5/autofs.5Wed Sep 3 16:48:33 2014 (r271042) +++ head/share/man/man5/autofs.5Wed Sep 3 17:15:12 2014 (r271043) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd July 14, 2014 +.Dd September 3, 2014 .Dt AUTOFS 5 .Os .Sh NAME @@ -90,7 +90,7 @@ filesystems specified in The .Nm driver first appeared in -.Fx 10.2 . +.Fx 10.1 . .Sh AUTHORS The .Nm ___ 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: r271044 - head/tools/tools/tscdrift
Author: jhb Date: Wed Sep 3 17:26:46 2014 New Revision: 271044 URL: http://svnweb.freebsd.org/changeset/base/271044 Log: Import a hackish tool I use to examine the skew of the TSC across CPUs in a system. The tool queries the kernel for its set of CPUs and compares TSC values on each of the additional CPUs to the first CPU in turn. It then outputs a table of simple statistics. Added: head/tools/tools/tscdrift/ head/tools/tools/tscdrift/Makefile (contents, props changed) head/tools/tools/tscdrift/tscdrift.c (contents, props changed) Added: head/tools/tools/tscdrift/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/tscdrift/Makefile Wed Sep 3 17:26:46 2014 (r271044) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG= tscdrift +MAN= +WARNS?=6 + +LDADD= -lpthread -lm +DPADD= ${LIBPTHREAD} ${LIBM} + +.include bsd.prog.mk Added: head/tools/tools/tscdrift/tscdrift.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/tscdrift/tscdrift.cWed Sep 3 17:26:46 2014 (r271044) @@ -0,0 +1,193 @@ +/*- + * Copyright (c) 2014 Advanced Computing Technologies LLC + * Written by: John H. Baldwin j...@freebsd.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: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + */ + + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/param.h +#include sys/cpuset.h +#include machine/atomic.h +#include machine/cpu.h +#include machine/cpufunc.h +#include assert.h +#include err.h +#include errno.h +#include math.h +#include pthread.h +#include stdint.h +#include stdlib.h +#include stdio.h + +#definebarrier() __asm __volatile( ::: memory) + +#defineTESTS 1024 + +static volatile int gate; +static volatile uint64_t thread_tsc; + +/* Bind the current thread to the specified CPU. */ +static void +bind_cpu(int cpu) +{ + cpuset_t set; + + CPU_ZERO(set); + CPU_SET(cpu, set); + if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, sizeof(set), + set) 0) + err(1, cpuset_setaffinity(%d), cpu); +} + +static void * +thread_main(void *arg) +{ + int cpu, i; + + cpu = (intptr_t)arg; + bind_cpu(cpu); + for (i = 0; i TESTS; i++) { + gate = 1; + while (gate == 1) + cpu_spinwait(); + barrier(); + + __asm __volatile(lfence); + thread_tsc = rdtsc(); + + barrier(); + gate = 3; + while (gate == 3) + cpu_spinwait(); + } + return (NULL); +} + +int +main(int ac __unused, char **av __unused) +{ + cpuset_t all_cpus; + int64_t **skew, *aveskew, *minskew, *maxskew; + float *stddev; + double sumsq; + pthread_t child; + uint64_t tsc; + int *cpus; + int error, i, j, ncpu; + + /* +* Find all the CPUs this program is eligible to run on and use +* this as our global set. This means you can use cpuset to +* restrict this program to only run on a subset of CPUs. +*/ + if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(all_cpus), all_cpus) 0) + err(1, cpuset_getaffinity); + for (ncpu = 0, i = 0; i CPU_SETSIZE; i++) { + if (CPU_ISSET(i, all_cpus)) + ncpu++; + } + if (ncpu 2) + errx(1, Only one available CPU); + cpus = calloc(ncpu, sizeof(*cpus)); +
svn commit: r271045 - head/sys/conf
Author: ian Date: Wed Sep 3 17:32:17 2014 New Revision: 271045 URL: http://svnweb.freebsd.org/changeset/base/271045 Log: Use sh -c '...' to launch the dtb build scripts with env stuff prepended, otherwise it tries to treat the env var stuff as a script file name. Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Wed Sep 3 17:26:46 2014(r271044) +++ head/sys/conf/files Wed Sep 3 17:32:17 2014(r271045) @@ -14,11 +14,11 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: platform.dts - platform.dtb # fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with sh MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR} \ + compile-with sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}' \ no-obj no-implicit-rule before-depend \ clean ${FDT_DTS_FILE:R}.dtb fdt_static_dtb.h optional fdt fdt_dtb_static \ - compile-with sh MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR} \ + compile-with sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}' \ dependency fdt_dtb_file \ no-obj no-implicit-rule before-depend \ clean fdt_static_dtb.h ___ 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: r271046 - in head/sys: arm/conf arm/xilinx dev/cadence
Author: ian Date: Wed Sep 3 17:51:03 2014 New Revision: 271046 URL: http://svnweb.freebsd.org/changeset/base/271046 Log: Fixes and enhancements for the if_cgem driver... - miibus fixes as suggested by Yonghyeon Pyun. - enable VLAN MTU support. - fix a few WITNESS complaints in cgem_attach(). - have cgem_attach() properly init the ifnet struct before calling mii_attach() to fix panic when using e1000phy. - fix ethernet address changing. - fix transmit queue overflow handling. - tweak receive queue handling to reduce receive overflows. - bring out MAC statistic counters to sysctls. - add e1000phy to config file. - implement receive hang work-around described in reference guide. - change device name from if_cgem to cgem to be consistent with other interfaces. Submitted by: Thomas Skibo thomassk...@sbcglobal.net Reviewed by: wkoszek, Yonghyeon PYUN pyu...@gmail.com Modified: head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/files.zynq7 head/sys/dev/cadence/if_cgem.c head/sys/dev/cadence/if_cgem_hw.h Modified: head/sys/arm/conf/ZEDBOARD == --- head/sys/arm/conf/ZEDBOARD Wed Sep 3 17:32:17 2014(r271045) +++ head/sys/arm/conf/ZEDBOARD Wed Sep 3 17:51:03 2014(r271046) @@ -72,8 +72,9 @@ options KDB device loop device random device ether -device if_cgem # Zynq-7000 gig ethernet device +device cgem# Zynq-7000 gig ethernet device device mii +device e1000phy device pty device uart device gpio Modified: head/sys/arm/xilinx/files.zynq7 == --- head/sys/arm/xilinx/files.zynq7 Wed Sep 3 17:32:17 2014 (r271045) +++ head/sys/arm/xilinx/files.zynq7 Wed Sep 3 17:51:03 2014 (r271046) @@ -23,7 +23,7 @@ arm/xilinx/zy7_slcr.c standard arm/xilinx/zy7_devcfg.cstandard arm/xilinx/zy7_mp.coptional smp -dev/cadence/if_cgem.c optional if_cgem +dev/cadence/if_cgem.c optional cgem dev/sdhci/sdhci_fdt.c optional sdhci arm/xilinx/zy7_ehci.c optional ehci arm/xilinx/uart_dev_cdnc.c optional uart Modified: head/sys/dev/cadence/if_cgem.c == --- head/sys/dev/cadence/if_cgem.c Wed Sep 3 17:32:17 2014 (r271045) +++ head/sys/dev/cadence/if_cgem.c Wed Sep 3 17:51:03 2014 (r271046) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2014 Thomas Skibo + * Copyright (c) 2012-2014 Thomas Skibo thomassk...@yahoo.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,17 +82,17 @@ __FBSDID($FreeBSD$); #define IF_CGEM_NAME cgem -#define CGEM_NUM_RX_DESCS 256 /* size of receive descriptor ring */ -#define CGEM_NUM_TX_DESCS 256 /* size of transmit descriptor ring */ +#define CGEM_NUM_RX_DESCS 512 /* size of receive descriptor ring */ +#define CGEM_NUM_TX_DESCS 512 /* size of transmit descriptor ring */ #define MAX_DESC_RING_SIZE (MAX(CGEM_NUM_RX_DESCS*sizeof(struct cgem_rx_desc),\ CGEM_NUM_TX_DESCS*sizeof(struct cgem_tx_desc))) /* Default for sysctl rxbufs. Must be CGEM_NUM_RX_DESCS of course. */ -#define DEFAULT_NUM_RX_BUFS64 /* number of receive bufs to queue. */ +#define DEFAULT_NUM_RX_BUFS256 /* number of receive bufs to queue. */ -#define TX_MAX_DMA_SEGS4 /* maximum segs in a tx mbuf dma */ +#define TX_MAX_DMA_SEGS8 /* maximum segs in a tx mbuf dma */ #define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \ CSUM_TCP_IPV6 | CSUM_UDP_IPV6) @@ -102,6 +102,7 @@ struct cgem_softc { struct mtx sc_mtx; device_tdev; device_tmiibus; + u_int mii_media_active; /* last active media */ int if_old_flags; struct resource *mem_res; struct resource *irq_res; @@ -124,7 +125,11 @@ struct cgem_softc { int rxring_queued; /* how many rcv bufs queued */ bus_dmamap_trxring_dma_map; int rxbufs; /* tunable number rcv bufs */ - int rxoverruns; /* rx ring overruns */ + int rxhangwar; /* rx hang work-around */ + u_int rxoverruns; /* rx overruns */ + u_int rxnobufs; /* rx buf ring empty events */ +
svn commit: r271047 - head/share/zoneinfo
Author: emaste Date: Wed Sep 3 18:51:33 2014 New Revision: 271047 URL: http://svnweb.freebsd.org/changeset/base/271047 Log: Avoid ./ in zoneinfo entries in METALOG Use of find . resulted in METALOG entries with an extra ./ -- e.g., ./usr/share/zoneinfo/./America/Toronto. Avoid this by using globbing via find * instead. Reviewed by: brooks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D719 Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile == --- head/share/zoneinfo/MakefileWed Sep 3 17:51:03 2014 (r271046) +++ head/share/zoneinfo/MakefileWed Sep 3 18:51:33 2014 (r271047) @@ -79,7 +79,7 @@ zoneinfo: yearistype ${TDATA} beforeinstall: cd ${TZBUILDDIR} \ - find . -type f -print -exec ${INSTALL} \ + find * -type f -print -exec ${INSTALL} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ___ 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: r271048 - head/lib/libc/gen
Author: jhb Date: Wed Sep 3 19:01:34 2014 New Revision: 271048 URL: http://svnweb.freebsd.org/changeset/base/271048 Log: Always seek back to the beginning of a regular directory, even if the previous seek location was 0. Without this, readdir() would see dd_loc of zero and call getdirentries() which would start reading entries at the current seek location of the directory ignoring the first batch of entries. Also, rewinddir() should always seek so that it reads the directory from the beginning to get updated entries. PR: 192935 Reported by: i...@mail.ua MFC after:3 days Modified: head/lib/libc/gen/rewinddir.c Modified: head/lib/libc/gen/rewinddir.c == --- head/lib/libc/gen/rewinddir.c Wed Sep 3 18:51:33 2014 (r271047) +++ head/lib/libc/gen/rewinddir.c Wed Sep 3 19:01:34 2014 (r271048) @@ -53,7 +53,7 @@ rewinddir(dirp) _pthread_mutex_lock(dirp-dd_lock); if (dirp-dd_flags __DTF_READALL) _filldir(dirp, false); - else if (dirp-dd_seek != 0) { + else { (void) lseek(dirp-dd_fd, 0, SEEK_SET); dirp-dd_seek = 0; } ___ 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: r271049 - head/share/man/man4
Author: obrien Date: Wed Sep 3 19:06:08 2014 New Revision: 271049 URL: http://svnweb.freebsd.org/changeset/base/271049 Log: Note that script(1) consumes filemon(4). Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 == --- head/share/man/man4/filemon.4 Wed Sep 3 19:01:34 2014 (r271048) +++ head/share/man/man4/filemon.4 Wed Sep 3 19:06:08 2014 (r271049) @@ -165,6 +165,7 @@ buffer contents to it. .Sh SEE ALSO .Xr dtrace 1 , .Xr ktrace 1 , +.Xr script 1 , .Xr truss 1 , .Xr ioctl 2 .Sh HISTORY ___ 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: r270999 - head/sys/kern
Gleb Smirnoff wrote this message on Wed, Sep 03, 2014 at 13:49 +0400: Mateusz, Kostik, On Wed, Sep 03, 2014 at 10:55:23AM +0200, Mateusz Guzik wrote: M Modified: head/sys/kern/kern_proc.c M == M --- head/sys/kern/kern_proc.cWed Sep 3 08:13:46 2014 (r270998) M +++ head/sys/kern/kern_proc.cWed Sep 3 08:14:07 2014 (r270999) M @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str M kp-ki_xstat = p-p_xstat; M kp-ki_acflag = p-p_acflag; M kp-ki_lock = p-p_lock; M -if (p-p_pptr) M +if (p-p_pptr) { M kp-ki_ppid = proc_realparent(p)-p_pid; M -if (p-p_flag P_TRACED) M -kp-ki_tracer = p-p_pptr-p_pid; M +if (p-p_flag P_TRACED) M +kp-ki_tracer = p-p_pptr-p_pid; M +} M } M M /* M M M p_pptr must be non-NULL if P_TRACED is set. If there is no way to M annotate it for coverity, this change deserves a comment in the code M (and in retrospect previous code should have had appropriate comment as M well). Thanks for explanation. I'd suggest to leave the change in, since now it is a micro-micro-optimization :) If you must leave it in, then at least compare the pointer against NULL, and collapse two if statements into one... We should never introduce new pointer checks that aren't against NULL... -- John-Mark Gurney Voice: +1 415 225 5579 All that I will do, has been done, All that I have, has not. ___ 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: r271050 - head/sys/arm/conf
Author: ian Date: Wed Sep 3 19:37:41 2014 New Revision: 271050 URL: http://svnweb.freebsd.org/changeset/base/271050 Log: Remove DIAGNOSTIC from the kernel config of low-end arm systems. Sanity checks such as vmem_check() can make a low-end system go completely unresponsive for as much as 3 seconds out of every 10. Modified: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 Modified: head/sys/arm/conf/DB-78XXX == --- head/sys/arm/conf/DB-78XXX Wed Sep 3 19:06:08 2014(r271049) +++ head/sys/arm/conf/DB-78XXX Wed Sep 3 19:37:41 2014(r271050) @@ -44,7 +44,7 @@ options NO_SWAPPING optionsALT_BREAK_TO_DEBUGGER optionsDDB #options DEADLKRES # Enable the deadlock resolver -optionsDIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS optionsKDB Modified: head/sys/arm/conf/DB-88F5XXX == --- head/sys/arm/conf/DB-88F5XXXWed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DB-88F5XXXWed Sep 3 19:37:41 2014 (r271050) @@ -43,7 +43,7 @@ options NO_SWAPPING optionsALT_BREAK_TO_DEBUGGER optionsDDB #options DEADLKRES # Enable the deadlock resolver -optionsDIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS optionsKDB Modified: head/sys/arm/conf/DB-88F6XXX == --- head/sys/arm/conf/DB-88F6XXXWed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DB-88F6XXXWed Sep 3 19:37:41 2014 (r271050) @@ -44,7 +44,7 @@ options NO_SWAPPING optionsALT_BREAK_TO_DEBUGGER optionsDDB #options DEADLKRES # Enable the deadlock resolver -optionsDIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS optionsKDB Modified: head/sys/arm/conf/DOCKSTAR == --- head/sys/arm/conf/DOCKSTAR Wed Sep 3 19:06:08 2014(r271049) +++ head/sys/arm/conf/DOCKSTAR Wed Sep 3 19:37:41 2014(r271050) @@ -145,7 +145,7 @@ options BREAK_TO_DEBUGGER optionsALT_BREAK_TO_DEBUGGER optionsDDB optionsKDB -optionsDIAGNOSTIC +#options DIAGNOSTIC optionsINVARIANTS # Enable calls of extra sanity checking optionsINVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/DREAMPLUG-1001 == --- head/sys/arm/conf/DREAMPLUG-1001Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DREAMPLUG-1001Wed Sep 3 19:37:41 2014 (r271050) @@ -153,7 +153,7 @@ options BREAK_TO_DEBUGGER optionsALT_BREAK_TO_DEBUGGER optionsDDB optionsKDB -optionsDIAGNOSTIC +#options DIAGNOSTIC optionsINVARIANTS # Enable calls of extra sanity checking optionsINVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/EA3250 == --- head/sys/arm/conf/EA3250Wed Sep 3 19:06:08 2014(r271049) +++ head/sys/arm/conf/EA3250Wed Sep 3 19:37:41 2014(r271050) @@ -44,7 +44,7 @@ options NO_SWAPPING optionsALT_BREAK_TO_DEBUGGER optionsDDB #options DEADLKRES # Enable the deadlock resolver -optionsDIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS optionsKDB ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe,
Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: On 09/03/14 04:09, Steven Hartland wrote: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve I have no technical input, but this change improves ARC usefulness for me quite a bit. I would like to see the improvement in 10-STABLE. Can you verify that the current 10-STABLE (as of today) with all the various pagedaemon fixes still has ARC issues for your workload? -- John Baldwin ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
On 09/03/14 15:22, John Baldwin wrote: On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: On 09/03/14 04:09, Steven Hartland wrote: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve I have no technical input, but this change improves ARC usefulness for me quite a bit. I would like to see the improvement in 10-STABLE. Can you verify that the current 10-STABLE (as of today) with all the various pagedaemon fixes still has ARC issues for your workload? It doesn't have any issues, but I noticed the improvement on CURRENT. I observed that just after this change, my package builder is much more likely to retain MFU and not evict useful things from there (the port tree) after large builds. However, I run a lot more 10.0-RELEASE than CURRENT and I would like to see this improvement release-bound. I would be happy to test this on 10-STABLE if you think that this is relevant. - Nikolai Lifanov ___ 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: r271053 - head/sys/i386/i386
Author: jhb Date: Wed Sep 3 21:17:09 2014 New Revision: 271053 URL: http://svnweb.freebsd.org/changeset/base/271053 Log: Actually save and restore FPU state on APs during suspend and resume. Committed from: Atom-based HP netbook after resuming in X Modified: head/sys/i386/i386/mp_machdep.c Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Wed Sep 3 20:53:11 2014 (r271052) +++ head/sys/i386/i386/mp_machdep.c Wed Sep 3 21:17:09 2014 (r271053) @@ -1522,15 +1522,11 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(susppcbs[cpu])) { -#ifdef DEV_NPX - npxsuspend(suspcbs[cpu]-pcb_fpususpend); -#endif + npxsuspend(susppcbs[cpu]-pcb_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, suspended_cpus); } else { -#ifdef DEV_NPX - npxresume(suspcbs[cpu]-pcb_fpususpend); -#endif + npxresume(susppcbs[cpu]-pcb_fpususpend); pmap_init_pat(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); ___ 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: r271054 - head/sys/boot/common
Author: ian Date: Wed Sep 3 21:25:36 2014 New Revision: 271054 URL: http://svnweb.freebsd.org/changeset/base/271054 Log: When built with FDT support, add /boot/dtb to the list of search directories. Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c == --- head/sys/boot/common/module.c Wed Sep 3 21:17:09 2014 (r271053) +++ head/sys/boot/common/module.c Wed Sep 3 21:25:36 2014 (r271054) @@ -66,7 +66,12 @@ static void moduledir_rebuild(void); /* load address should be tweaked by first module loaded (kernel) */ static vm_offset_t loadaddr = 0; +#if defined(LOADER_FDT_SUPPORT) +static const char *default_searchpath = +/boot/kernel;/boot/modules;/boot/dtb; +#else static const char *default_searchpath =/boot/kernel;/boot/modules; +#endif static STAILQ_HEAD(, moduledir) moduledir_list = STAILQ_HEAD_INITIALIZER(moduledir_list); ___ 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: r271055 - head/sys/arm/freescale/imx
Author: ian Date: Wed Sep 3 21:45:39 2014 New Revision: 271055 URL: http://svnweb.freebsd.org/changeset/base/271055 Log: Add a function to get the frequency of the AHB bus. Another stopgap function until we have full clock support for imx6. Modified: head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx_ccmvar.h Modified: head/sys/arm/freescale/imx/imx51_ccm.c == --- head/sys/arm/freescale/imx/imx51_ccm.c Wed Sep 3 21:25:36 2014 (r271054) +++ head/sys/arm/freescale/imx/imx51_ccm.c Wed Sep 3 21:45:39 2014 (r271055) @@ -580,3 +580,10 @@ imx_ccm_uart_hz(void) return (imx51_get_clock(IMX51CLK_UART_CLK_ROOT)); } + +uint32_t +imx_ccm_ahb_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_AHB_CLK_ROOT)); +} Modified: head/sys/arm/freescale/imx/imx6_ccm.c == --- head/sys/arm/freescale/imx/imx6_ccm.c Wed Sep 3 21:25:36 2014 (r271054) +++ head/sys/arm/freescale/imx/imx6_ccm.c Wed Sep 3 21:45:39 2014 (r271055) @@ -238,6 +238,12 @@ imx_ccm_uart_hz(void) return (8000); } +uint32_t +imx_ccm_ahb_hz(void) +{ + return (13200); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), Modified: head/sys/arm/freescale/imx/imx_ccmvar.h == --- head/sys/arm/freescale/imx/imx_ccmvar.h Wed Sep 3 21:25:36 2014 (r271054) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Wed Sep 3 21:45:39 2014 (r271055) @@ -47,6 +47,7 @@ uint32_t imx_ccm_ipg_hz(void); uint32_t imx_ccm_perclk_hz(void); uint32_t imx_ccm_sdhci_hz(void); uint32_t imx_ccm_uart_hz(void); +uint32_t imx_ccm_ahb_hz(void); void imx_ccm_usb_enable(device_t _usbdev); void imx_ccm_usbphy_enable(device_t _phydev); ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
on 03/09/2014 23:22 Nikolai Lifanov said the following: On 09/03/14 15:22, John Baldwin wrote: On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: On 09/03/14 04:09, Steven Hartland wrote: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve I have no technical input, but this change improves ARC usefulness for me quite a bit. I would like to see the improvement in 10-STABLE. Can you verify that the current 10-STABLE (as of today) with all the various pagedaemon fixes still has ARC issues for your workload? It doesn't have any issues, but I noticed the improvement on CURRENT. I observed that just after this change, my package builder is much more likely to retain MFU and not evict useful things from there (the port tree) after large builds. However, I run a lot more 10.0-RELEASE than CURRENT and I would like to see this improvement release-bound. I would be happy to test this on 10-STABLE if you think that this is relevant. As noted before, unfortunately, this commit (plus its fixups) contains at least two related but distinct changes. So, to separate the wheat from the chaff, could you please try to comment out the following block in sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c, function arc_reclaim_needed: if (kmem_free_count() zfs_arc_free_target) { DTRACE_PROBE2(arc__reclaim_freetarget, uint64_t, kmem_free_count(), uint64_t, zfs_arc_free_target); return (1); } Alternatively, I think that the same effect can be achieved by setting sysctl vfs.zfs.arc_free_target to the same value as vm.stats.vm.v_free_min. It's interesting to me whether you would still see the better performance or if that improvement would be undone. Thanks! -- Andriy Gapon ___ 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: r271057 - in head: etc/mtree share/man/man7
Author: imp Date: Wed Sep 3 21:59:07 2014 New Revision: 271057 URL: http://svnweb.freebsd.org/changeset/base/271057 Log: Create a /boot/dtb directory to house DTB blobs. The flattened device tree support includes a device tree source compiler dtc(8) which converts .dts files into .dtb files. /boot/loader will load dtb files from this directory by default, allowing for fewer differences between images for different SoCs. Compiled dts files will wind up here eventually as an alternative to embedding them into the kernel. Document this in hier(7), as well as add missing entries for /boot/firmware and /boot/zfs, though the latter two should only be considered place holders if someone wants to make them better. Modified: head/etc/mtree/BSD.root.dist head/share/man/man7/hier.7 Modified: head/etc/mtree/BSD.root.dist == --- head/etc/mtree/BSD.root.distWed Sep 3 21:57:06 2014 (r271056) +++ head/etc/mtree/BSD.root.distWed Sep 3 21:59:07 2014 (r271057) @@ -10,6 +10,8 @@ boot defaults .. +dtb +.. firmware .. kernel Modified: head/share/man/man7/hier.7 == --- head/share/man/man7/hier.7 Wed Sep 3 21:57:06 2014(r271056) +++ head/share/man/man7/hier.7 Wed Sep 3 21:59:07 2014(r271057) @@ -48,13 +48,25 @@ programs and configuration files used du .It Pa defaults/ default bootstrapping configuration files; see .Xr loader.conf 5 +.It Pa dtb/ +Compiled flattened device tree (FDT) files; see +.Xr fdt 4 +and +.Xr dtc 1 +.It Pa firmware/ +Loadable modules containing binary firmware for hardware that needs +firmware downloaded to it to function .It Pa kernel/ pure kernel executable (the operating system loaded into memory -at boot time). +at boot time) .It Pa modules/ third-party loadable kernel modules; see .Xr kldstat 8 +.It Pa zfs/ +Contains +.Xr zfs 8 +zpool cache files. .El .It Pa /cdrom/ default mount point for CD-ROM drives ___ 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: r271070 - head/sys/kern
Author: benno Date: Thu Sep 4 00:10:06 2014 New Revision: 271070 URL: http://svnweb.freebsd.org/changeset/base/271070 Log: Add KASSERTs to catch the case where a developer may have forgotten to set bo_bsize on a bufobj. This is a slight modification of the patch provided. PR: 193146 Submitted by: Conrad Meyer conrad.me...@isilon.com Sponsored by: EMC Isilon Storage Division Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Wed Sep 3 23:29:06 2014(r271069) +++ head/sys/kern/vfs_bio.c Thu Sep 4 00:10:06 2014(r271070) @@ -2971,6 +2971,7 @@ bp_unmapped_get_kva(struct buf *bp, dadd * if the buffer was mapped. */ bsize = vn_isdisk(bp-b_vp, NULL) ? DEV_BSIZE : bp-b_bufobj-bo_bsize; + KASSERT(bsize != 0, (bsize == 0, check bo-bo_bsize)); offset = blkno * bsize; maxsize = size + (offset PAGE_MASK); maxsize = imax(maxsize, bsize); @@ -3220,6 +3221,7 @@ loop: return NULL; bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo-bo_bsize; + KASSERT(bsize != 0, (bsize == 0, check bo-bo_bsize)); offset = blkno * bsize; vmio = vp-v_object != NULL; if (vmio) { ___ 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: r271073 - head/sys/dev/mii
Author: yongari Date: Thu Sep 4 01:04:37 2014 New Revision: 271073 URL: http://svnweb.freebsd.org/changeset/base/271073 Log: Do not blindly announce 1000baseT half-duplex capability in autonegotiation. Some controllers like cgem(4) do not support half-duplex at gigabit speeds. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c == --- head/sys/dev/mii/e1000phy.c Thu Sep 4 00:43:27 2014(r271072) +++ head/sys/dev/mii/e1000phy.c Thu Sep 4 01:04:37 2014(r271073) @@ -169,8 +169,12 @@ e1000phy_attach(device_t dev) PHY_RESET(sc); sc-mii_capabilities = PHY_READ(sc, MII_BMSR) sc-mii_capmask; - if (sc-mii_capabilities BMSR_EXTSTAT) + if (sc-mii_capabilities BMSR_EXTSTAT) { sc-mii_extcapabilities = PHY_READ(sc, MII_EXTSR); + if ((sc-mii_extcapabilities + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + sc-mii_flags |= MIIF_HAVE_GTCR; + } device_printf(dev, ); mii_phy_add_media(sc); printf(\n); @@ -319,8 +323,7 @@ e1000phy_service(struct mii_softc *sc, s speed = 0; switch (IFM_SUBTYPE(ife-ifm_media)) { case IFM_1000_T: - if ((sc-mii_extcapabilities - (EXTSR_1000TFDX | EXTSR_1000THDX)) == 0) + if ((sc-mii_flags MIIF_HAVE_GTCR) == 0) return (EINVAL); speed = E1000_CR_SPEED_1000; break; @@ -357,10 +360,9 @@ e1000phy_service(struct mii_softc *sc, s if (IFM_SUBTYPE(ife-ifm_media) == IFM_1000_T) { gig |= E1000_1GCR_MS_ENABLE; - if ((ife-ifm_media IFM_ETH_MASTER) != 0) + if ((ife-ifm_media IFM_ETH_MASTER) != 0) gig |= E1000_1GCR_MS_VALUE; - } else if ((sc-mii_extcapabilities - (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + } else if ((sc-mii_flags MIIF_HAVE_GTCR) != 0) gig = 0; PHY_WRITE(sc, E1000_1GCR, gig); PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); @@ -485,9 +487,14 @@ e1000phy_mii_phy_auto(struct mii_softc * PHY_WRITE(sc, E1000_AR, reg | E1000_AR_SELECTOR_FIELD); } else PHY_WRITE(sc, E1000_AR, E1000_FA_1000X_FD | E1000_FA_1000X); - if ((sc-mii_extcapabilities (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) - PHY_WRITE(sc, E1000_1GCR, - E1000_1GCR_1000T_FD | E1000_1GCR_1000T); + if ((sc-mii_flags MIIF_HAVE_GTCR) != 0) { + reg = 0; + if ((sc-mii_extcapabilities EXTSR_1000TFDX) != 0) + reg |= E1000_1GCR_1000T_FD; + if ((sc-mii_extcapabilities EXTSR_1000THDX) != 0) + reg |= E1000_1GCR_1000T; + PHY_WRITE(sc, E1000_1GCR, reg); + } PHY_WRITE(sc, E1000_CR, E1000_CR_AUTO_NEG_ENABLE | E1000_CR_RESTART_AUTO_NEG); ___ 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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
- Original Message - From: Andriy Gapon a...@freebsd.org on 03/09/2014 23:22 Nikolai Lifanov said the following: On 09/03/14 15:22, John Baldwin wrote: On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: On 09/03/14 04:09, Steven Hartland wrote: I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve I have no technical input, but this change improves ARC usefulness for me quite a bit. I would like to see the improvement in 10-STABLE. Can you verify that the current 10-STABLE (as of today) with all the various pagedaemon fixes still has ARC issues for your workload? It doesn't have any issues, but I noticed the improvement on CURRENT. I observed that just after this change, my package builder is much more likely to retain MFU and not evict useful things from there (the port tree) after large builds. However, I run a lot more 10.0-RELEASE than CURRENT and I would like to see this improvement release-bound. I would be happy to test this on 10-STABLE if you think that this is relevant. As noted before, unfortunately, this commit (plus its fixups) contains at least two related but distinct changes. So, to separate the wheat from the chaff, could you please try to comment out the following block in sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c, function arc_reclaim_needed: if (kmem_free_count() zfs_arc_free_target) { DTRACE_PROBE2(arc__reclaim_freetarget, uint64_t, kmem_free_count(), uint64_t, zfs_arc_free_target); return (1); } Alternatively, I think that the same effect can be achieved by setting sysctl vfs.zfs.arc_free_target to the same value as vm.stats.vm.v_free_min. Thats correct that would achieve the same thing. It's interesting to me whether you would still see the better performance or if that improvement would be undone. Indeed that would be interesting, but we might find that its quite memory size dependent given the scaling so confirming HW details would be nice too. I'd also be interested to know who wins the free race between the VM and ARC when using that value. For those following this thread but not the review, I've added some additional information there which you might be interested in: https://reviews.freebsd.org/D702 Regards Steve ___ 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: r271074 - head/sys/kern
Author: mjg Date: Thu Sep 4 01:21:33 2014 New Revision: 271074 URL: http://svnweb.freebsd.org/changeset/base/271074 Log: Plug a hypothetical use after free in sysctl kern.proc.groups. MFC after:1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c == --- head/sys/kern/kern_proc.c Thu Sep 4 01:04:37 2014(r271073) +++ head/sys/kern/kern_proc.c Thu Sep 4 01:21:33 2014(r271074) @@ -2508,6 +2508,7 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A return (EINVAL); if (*pidp == -1) { /* -1 means this process */ p = req-td-td_proc; + PROC_LOCK(p); } else { error = pget(*pidp, PGET_CANSEE, p); if (error != 0) @@ -2515,8 +2516,7 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A } cred = crhold(p-p_ucred); - if (*pidp != -1) - PROC_UNLOCK(p); + PROC_UNLOCK(p); error = SYSCTL_OUT(req, cred-cr_groups, cred-cr_ngroups * sizeof(gid_t)); ___ 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: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98
Author: jhb Date: Thu Sep 4 01:46:06 2014 New Revision: 271076 URL: http://svnweb.freebsd.org/changeset/base/271076 Log: - Move prototypes for various functions into out of C files and into machine/md_var.h. - Move some CPU-related variables out of i386/i386/identcpu.c to initcpu.c to match amd64. - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. - Remove a misleading comment from i386/i386/initcpu.c (locore zeros the BSS before it calls identify_cpu()) and remove explicit zero assignments to reduce the diff with amd64. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/include/md_var.h head/sys/i386/i386/identcpu.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/machdep.c head/sys/i386/i386/trap.c head/sys/i386/include/md_var.h head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/identcpu.c == --- head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) @@ -64,15 +64,8 @@ __FBSDID($FreeBSD$); #include amd64/vmm/intel/vmx_controls.h #include x86/isa/icu.h -/* XXX - should be in header file: */ -void printcpuinfo(void); -void identify_cpu(void); -void earlysetcpuclass(void); -void panicifcpuunsupported(void); - static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); -static void print_AMD_assoc(int i); static void print_via_padlock_info(void); static void print_vmx_info(void); Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/amd64/amd64/machdep.c Thu Sep 4 01:46:06 2014 (r271076) @@ -151,10 +151,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern u_int64_t hammer_time(u_int64_t, u_int64_t); -extern void printcpuinfo(void);/* XXX header file */ -extern void identify_cpu(void); -extern void panicifcpuunsupported(void); - #defineCS_SECURE(cs) (ISPL(cs) == SEL_UPL) #defineEFL_SECURE(ef, oef) ef) ^ (oef)) ~PSL_USERCHANGE) == 0) Modified: head/sys/amd64/include/md_var.h == --- head/sys/amd64/include/md_var.h Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/amd64/include/md_var.h Thu Sep 4 01:46:06 2014 (r271076) @@ -105,14 +105,17 @@ void fsbase_load_fault(void) __asm(__STR void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault)); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); +void identify_cpu(void); void initializecpu(void); void initializecpucache(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); intis_physical_memory(vm_paddr_t addr); intisa_nmi(int cd); +void panicifcpuunsupported(void); void pagecopy(void *from, void *to); void pagezero(void *addr); +void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); intuser_dbreg_trap(void); void minidumpsys(struct dumperinfo *); Modified: head/sys/i386/i386/identcpu.c == --- head/sys/i386/i386/identcpu.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) @@ -64,30 +64,16 @@ __FBSDID($FreeBSD$); #defineIDENTBLUE_IBMCPU1 #defineIDENTBLUE_CYRIXM2 2 -/* XXX - should be in header file: */ -void printcpuinfo(void); -void finishidentcpu(void); -void earlysetcpuclass(void); -#if defined(I586_CPU) defined(CPU_WT_ALLOC) -void enable_K5_wt_alloc(void); -void enable_K6_wt_alloc(void); -void enable_K6_2_wt_alloc(void); -#endif -void panicifcpuunsupported(void); - static void identifycyrix(void); static void init_exthigh(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); -static void print_AMD_assoc(int i); static void print_transmeta_info(void); static void print_via_padlock_info(void); intcpu_class; -u_int cpu_exthigh;/* Highest arg to extended CPUID */ -u_int cyrix_did; /* Device ID of Cyrix CPU */ char machine[] = MACHINE; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, Machine class); @@ -161,10 +147,6 @@ static struct { #endif }; -#if defined(I586_CPU) !defined(NO_F00F_HACK) -int has_f00f_bug = 0; /* Initialized so that it can be patched. */ -#endif - static void init_exthigh(void) { Modified: head/sys/i386/i386/initcpu.c
svn commit: r271077 - in head/sys: amd64/amd64 i386/i386
Author: jhb Date: Thu Sep 4 01:56:15 2014 New Revision: 271077 URL: http://svnweb.freebsd.org/changeset/base/271077 Log: Remove trailing whitespace. Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c == --- head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) +++ head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:56:15 2014 (r271077) @@ -97,11 +97,11 @@ SYSCTL_PROC(_hw, HW_MACHINE, machine, CT NULL, 0, sysctl_hw_machine, A, Machine class); static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, Machine model); static int hw_clockrate; -SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, +SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, hw_clockrate, 0, CPU instruction clock rate); static eventhandler_tag tsc_post_tag; @@ -686,15 +686,15 @@ print_AMD_info(void) printf(L2 unified cache: %d kbytes, regs[2] 16); printf(, %d bytes/line, regs[2] 0xff); printf(, %d lines/tag, (regs[2] 8) 0x0f); - print_AMD_l2_assoc((regs[2] 12) 0x0f); + print_AMD_l2_assoc((regs[2] 12) 0x0f); } /* -* Opteron Rev E shows a bug as in very rare occasions a read memory -* barrier is not performed as expected if it is followed by a -* non-atomic read-modify-write instruction. +* Opteron Rev E shows a bug as in very rare occasions a read memory +* barrier is not performed as expected if it is followed by a +* non-atomic read-modify-write instruction. * As long as that bug pops up very rarely (intensive machine usage -* on other operating systems generally generates one unexplainable +* on other operating systems generally generates one unexplainable * crash any 2 months) and as long as a model specific fix would be * impratical at this stage, print out a warning string if the broken * model and family are identified. @@ -910,7 +910,7 @@ print_vmx_info(void) \012single/* INVVPID single-context type */ \013all /* INVVPID all-context type */ /* INVVPID single-context-retaining-globals type */ - \014single-globals + \014single-globals ); } } Modified: head/sys/i386/i386/identcpu.c == --- head/sys/i386/i386/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 01:56:15 2014 (r271077) @@ -75,15 +75,15 @@ static void print_via_padlock_info(void) intcpu_class; char machine[] = MACHINE; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, Machine class); static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, Machine model); static int hw_clockrate; -SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, +SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, hw_clockrate, 0, CPU instruction clock rate); static eventhandler_tag tsc_post_tag; @@ -1270,7 +1270,7 @@ print_AMD_info(void) printf(L2 internal cache: %d kbytes, regs[2] 16); printf(, %d bytes/line, regs[2] 0xff); printf(, %d lines/tag, (regs[2] 8) 0x0f); - print_AMD_assoc((regs[2] 12) 0x0f); + print_AMD_assoc((regs[2] 12) 0x0f); } } if (((cpu_id 0xf00) == 0x500) ___ 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: r271078 - head/etc/rc.d
Author: gjb Date: Thu Sep 4 02:06:33 2014 New Revision: 271078 URL: http://svnweb.freebsd.org/changeset/base/271078 Log: Fix typo: s/_maske/_mask/ MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail == --- head/etc/rc.d/jail Thu Sep 4 01:56:15 2014(r271077) +++ head/etc/rc.d/jail Thu Sep 4 02:06:33 2014(r271078) @@ -319,7 +319,7 @@ jail_extract_address() _mask=${_mask:-/32} elif [ ${_type} = inet6 ]; then - # In case _maske is not set for IPv6, use /128. + # In case _mask is not set for IPv6, use /128. _mask=${_mask:-/128} warn $_type $_addr: an IPv6 address should always be \ specified with a prefix length. /128 is used. ___ 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: r271082 - in head/sys: i386/i386 x86/x86
Author: jhb Date: Thu Sep 4 02:25:59 2014 New Revision: 271082 URL: http://svnweb.freebsd.org/changeset/base/271082 Log: - Move blacklists of broken TSCs out of the printcpuinfo() function and into the TSC probe routine. - Initialize cpu_exthigh once in finishidentcpu() which is called before printcpuinfo() (and matches the behavior on amd64). Modified: head/sys/i386/i386/identcpu.c head/sys/x86/x86/tsc.c Modified: head/sys/i386/i386/identcpu.c == --- head/sys/i386/i386/identcpu.c Thu Sep 4 02:14:57 2014 (r271081) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 02:25:59 2014 (r271082) @@ -65,7 +65,6 @@ __FBSDID($FreeBSD$); #defineIDENTBLUE_CYRIXM2 2 static void identifycyrix(void); -static void init_exthigh(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); @@ -147,28 +146,6 @@ static struct { #endif }; -static void -init_exthigh(void) -{ - static int done = 0; - u_int regs[4]; - - if (done == 0) { - if (cpu_high 0 - (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD || - cpu_vendor_id == CPU_VENDOR_TRANSMETA || - cpu_vendor_id == CPU_VENDOR_CENTAUR || - cpu_vendor_id == CPU_VENDOR_NSC)) { - do_cpuid(0x8000, regs); - if (regs[0] = 0x8000) - cpu_exthigh = regs[0]; - } - - done = 1; - } -} - void printcpuinfo(void) { @@ -180,7 +157,6 @@ printcpuinfo(void) strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof (cpu_model)); /* Check for extended CPUID information and a processor name. */ - init_exthigh(); if (cpu_exthigh = 0x8004) { brand = cpu_brand; for (i = 0x8002; i 0x8005; i++) { @@ -354,7 +330,6 @@ printcpuinfo(void) break; case 0x500: strcat(cpu_model, K5 model 0); - tsc_freq = 0; break; case 0x510: strcat(cpu_model, K5 model 1); @@ -553,13 +528,6 @@ printcpuinfo(void) switch (cpu_id 0xff0) { case 0x540: strcpy(cpu_model, IDT WinChip C6); - /* -* http://www.centtech.com/c6_data_sheet.pdf -* -* I-12 RDTSC may return incoherent values in EDX:EAX -* I-13 RDTSC hangs when certain event counters are used -*/ - tsc_freq = 0; break; case 0x580: strcpy(cpu_model, IDT WinChip 2); @@ -599,8 +567,6 @@ printcpuinfo(void) case 0x540: strcpy(cpu_model, Geode SC1100); cpu = CPU_GEODE1100; - if ((cpu_id CPUID_STEPPING) == 0) - tsc_freq = 0; break; default: strcpy(cpu_model, Geode/NSC unknown); @@ -1110,10 +1076,20 @@ finishidentcpu(void) cpu_mon_max_size = regs[1] CPUID5_MON_MAX_SIZE; } + if (cpu_high 0 + (cpu_vendor_id == CPU_VENDOR_INTEL || +cpu_vendor_id == CPU_VENDOR_AMD || +cpu_vendor_id == CPU_VENDOR_TRANSMETA || +cpu_vendor_id == CPU_VENDOR_CENTAUR || +cpu_vendor_id == CPU_VENDOR_NSC)) { + do_cpuid(0x8000, regs); + if (regs[0] = 0x8000) + cpu_exthigh = regs[0]; + } + /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD) { - init_exthigh(); if (cpu_exthigh = 0x8001) { do_cpuid(0x8001, regs); amd_feature = regs[3] ~(cpu_feature 0x0183f3ff); @@ -1128,7 +1104,6 @@ finishidentcpu(void) cpu_procinfo2 = regs[2]; } } else if (cpu_vendor_id == CPU_VENDOR_CENTAUR) { - init_exthigh(); if (cpu_exthigh = 0x8001) { do_cpuid(0x8001, regs); amd_feature = regs[3] ~(cpu_feature 0x0183f3ff); Modified: head/sys/x86/x86/tsc.c == --- head/sys/x86/x86/tsc.c Thu Sep 4 02:14:57 2014(r271081) +++ head/sys/x86/x86/tsc.c Thu Sep 4 02:25:59 2014(r271082) @@ -324,6 +324,39 @@ init_TSC(void) if
svn commit: r271083 - head/sys/i386/i386
Author: jhb Date: Thu Sep 4 02:28:17 2014 New Revision: 271083 URL: http://svnweb.freebsd.org/changeset/base/271083 Log: Remove a stray blank line from the Intel cache and TLB info. Modified: head/sys/i386/i386/identcpu.c Modified: head/sys/i386/i386/identcpu.c == --- head/sys/i386/i386/identcpu.c Thu Sep 4 02:25:59 2014 (r271082) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 02:28:17 2014 (r271083) @@ -1327,11 +1327,9 @@ print_INTEL_info(void) nway = 1 (nwaycode / 2); else nway = 0; - printf(\nL2 cache: %u kbytes, %u-way associative, %u bytes/line, + printf(L2 cache: %u kbytes, %u-way associative, %u bytes/line\n, (regs[2] 16) 0x, nway, regs[2] 0xff); } - - printf(\n); } static void @@ -1343,160 +1341,160 @@ print_INTEL_TLB(u_int data) default: break; case 0x1: - printf(\nInstruction TLB: 4 KB pages, 4-way set associative, 32 entries); + printf(Instruction TLB: 4 KB pages, 4-way set associative, 32 entries\n); break; case 0x2: - printf(\nInstruction TLB: 4 MB pages, fully associative, 2 entries); + printf(Instruction TLB: 4 MB pages, fully associative, 2 entries\n); break; case 0x3: - printf(\nData TLB: 4 KB pages, 4-way set associative, 64 entries); + printf(Data TLB: 4 KB pages, 4-way set associative, 64 entries\n); break; case 0x4: - printf(\nData TLB: 4 MB Pages, 4-way set associative, 8 entries); + printf(Data TLB: 4 MB Pages, 4-way set associative, 8 entries\n); break; case 0x6: - printf(\n1st-level instruction cache: 8 KB, 4-way set associative, 32 byte line size); + printf(1st-level instruction cache: 8 KB, 4-way set associative, 32 byte line size\n); break; case 0x8: - printf(\n1st-level instruction cache: 16 KB, 4-way set associative, 32 byte line size); + printf(1st-level instruction cache: 16 KB, 4-way set associative, 32 byte line size\n); break; case 0xa: - printf(\n1st-level data cache: 8 KB, 2-way set associative, 32 byte line size); + printf(1st-level data cache: 8 KB, 2-way set associative, 32 byte line size\n); break; case 0xc: - printf(\n1st-level data cache: 16 KB, 4-way set associative, 32 byte line size); + printf(1st-level data cache: 16 KB, 4-way set associative, 32 byte line size\n); break; case 0x22: - printf(\n3rd-level cache: 512 KB, 4-way set associative, sectored cache, 64 byte line size); + printf(3rd-level cache: 512 KB, 4-way set associative, sectored cache, 64 byte line size\n); break; case 0x23: - printf(\n3rd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size); + printf(3rd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size\n); break; case 0x25: - printf(\n3rd-level cache: 2 MB, 8-way set associative, sectored cache, 64 byte line size); + printf(3rd-level cache: 2 MB, 8-way set associative, sectored cache, 64 byte line size\n); break; case 0x29: - printf(\n3rd-level cache: 4 MB, 8-way set associative, sectored cache, 64 byte line size); + printf(3rd-level cache: 4 MB, 8-way set associative, sectored cache, 64 byte line size\n); break; case 0x2c: - printf(\n1st-level data cache: 32 KB, 8-way set associative, 64 byte line size); + printf(1st-level data cache: 32 KB, 8-way set associative, 64 byte line size\n); break; case 0x30: - printf(\n1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size); + printf(1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size\n); break; case 0x39: - printf(\n2nd-level cache: 128 KB, 4-way set associative, sectored cache, 64 byte line size); + printf(2nd-level cache: 128 KB, 4-way set associative, sectored cache, 64 byte line size\n); break; case 0x3b: - printf(\n2nd-level cache: 128 KB, 2-way set associative, sectored cache, 64 byte line size); + printf(2nd-level cache: 128 KB, 2-way set associative, sectored cache, 64 byte line size\n); break; case 0x3c: - printf(\n2nd-level cache: 256 KB, 4-way set
Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98
On 4 Sep, John Baldwin wrote: Author: jhb Date: Thu Sep 4 01:46:06 2014 New Revision: 271076 URL: http://svnweb.freebsd.org/changeset/base/271076 Log: - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. That certainly brings back memories ... ___ 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: r271084 - head/sys/arm/freescale/imx
Author: ian Date: Thu Sep 4 03:04:37 2014 New Revision: 271084 URL: http://svnweb.freebsd.org/changeset/base/271084 Log: The imx5x and imx6 chips have an onboard IOMUX device which also contains a few general purpose registers whose values control chip behavior in ways that have nothing to do with IO pin mux control. Define a simple API that other soc-specific code can use to read and write the registers, and provide the imx51 implementation of them. Added: head/sys/arm/freescale/imx/imx_iomuxvar.h (contents, props changed) Modified: head/sys/arm/freescale/imx/imx51_iomux.c Modified: head/sys/arm/freescale/imx/imx51_iomux.c == --- head/sys/arm/freescale/imx/imx51_iomux.cThu Sep 4 02:28:17 2014 (r271083) +++ head/sys/arm/freescale/imx/imx51_iomux.cThu Sep 4 03:04:37 2014 (r271084) @@ -74,6 +74,7 @@ __FBSDID($FreeBSD$); #include dev/ofw/ofw_bus.h #include dev/ofw/ofw_bus_subr.h +#include arm/freescale/imx/imx_iomuxvar.h #include arm/freescale/imx/imx51_iomuxvar.h #include arm/freescale/imx/imx51_iomuxreg.h @@ -216,6 +217,41 @@ iomux_input_config(const struct iomux_in } #endif +uint32_t +imx_iomux_gpr_get(u_int regnum) +{ + + KASSERT(iomuxsc != NULL, (imx_iomux_gpr_get() called before attach)); + KASSERT(regnum = 0 renum = 1, + (imx_iomux_gpr_get bad regnum %u, regnum)); + return (IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum)); +} + +void +imx_iomux_gpr_set(u_int regnum, uint32_t val) +{ + + KASSERT(iomuxsc != NULL, (imx_iomux_gpr_set() called before attach)); + KASSERT(regnum = 0 renum = 1, + (imx_iomux_gpr_set bad regnum %u, regnum)); + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + +void +imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +{ + uint32_t val; + + KASSERT(iomuxsc != NULL, + (imx_iomux_gpr_set_masked called before attach)); + KASSERT(regnum = 0 renum = 1, + (imx_iomux_gpr_set_masked bad regnum %u, regnum)); + + val = IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum); + val = (val ~clrbits) | setbits; + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + static device_method_t imx_iomux_methods[] = { DEVMETHOD(device_probe, iomux_probe), DEVMETHOD(device_attach,iomux_attach), Added: head/sys/arm/freescale/imx/imx_iomuxvar.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_iomuxvar.h Thu Sep 4 03:04:37 2014 (r271084) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2014 Ian Lepore i...@freebsd.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: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndefIMX_IOMUXVAR_H +#defineIMX_IOMUXVAR_H + +/* + * The IOMUX Controller device has a small set of general purpose registers + * which control various aspects of SoC operation that really have nothing to do + * with IO pin assignments or pad control. These functions let other soc level + * code manipulate these values. + */ +uint32_t imx_iomux_gpr_get(u_int regnum); +void imx_iomux_gpr_set(u_int regnum, uint32_t val); +void imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits); + +#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: r271085 - head/lib/libgeom
Author: benno Date: Thu Sep 4 03:31:48 2014 New Revision: 271085 URL: http://svnweb.freebsd.org/changeset/base/271085 Log: Systems with lots of geom providers can end up with a kern.geom.confxml value too large for the buffer allocated. Work around this by retrying a few times with larger buffer sizes. Submitted by: Scott Ferris scott.fer...@isilon.com Reviewed by: mlaier, ngie Sponsored by: EMC Isilon Storage Division Modified: head/lib/libgeom/geom_getxml.c Modified: head/lib/libgeom/geom_getxml.c == --- head/lib/libgeom/geom_getxml.c Thu Sep 4 03:04:37 2014 (r271084) +++ head/lib/libgeom/geom_getxml.c Thu Sep 4 03:31:48 2014 (r271085) @@ -31,10 +31,23 @@ #include sys/types.h #include sys/sysctl.h +#include errno.h #include stdlib.h #include string.h #include libgeom.h +/* + * Amount of extra space we allocate to try and anticipate the size of + * confxml. + */ +#defineGEOM_GETXML_SLACK 4096 + +/* + * Number of times to retry in the face of the size of confxml exceeding + * that of our buffer. + */ +#defineGEOM_GETXML_RETRIES 4 + char * geom_getxml(void) { @@ -42,19 +55,33 @@ geom_getxml(void) size_t l = 0; int mib[3]; size_t sizep; + int retries; sizep = sizeof(mib) / sizeof(*mib); if (sysctlnametomib(kern.geom.confxml, mib, sizep) != 0) return (NULL); if (sysctl(mib, sizep, NULL, l, NULL, 0) != 0) return (NULL); - l += 4096; - p = malloc(l); - if (p == NULL) - return (NULL); - if (sysctl(mib, sizep, p, l, NULL, 0) != 0) { + l += GEOM_GETXML_SLACK; + + for (retries = 0; retries GEOM_GETXML_RETRIES; retries++) { + p = malloc(l); + if (p == NULL) + return (NULL); + if (sysctl(mib, sizep, p, l, NULL, 0) == 0) + return (reallocf(p, strlen(p) + 1)); + free(p); - return (NULL); + + if (errno != ENOMEM) + return (NULL); + + /* +* Our buffer wasn't big enough. Make it bigger and +* try again. +*/ + l *= 2; } - return (reallocf(p, strlen(p) + 1)); + + return (NULL); } ___ 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