Re: svn commit: r233684 - head/sys/x86/include
On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote: > However, the arguments are not properly masked, which results in the > wrong value being calculated in some instances. For example, > bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0) > returns 0xfcdefc9a7c563412. Is sign extension considered in that place? Shifting any signed value to ">>" direction (char, short, int, etc.) replicates sign bit, so cast to corresponding unsigned value must be done first, which may take less instructions, than masking (I am not sure about this part, just guessing). Casting in that case applies to the argument (x) not to result (x >> YY). > > #define __bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8) > #define __bswap32_gen(x)\ > - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) > + (((__uint32_t)__bswap16((x) & 0x) << 16) | __bswap16((x) >> 16)) > #define __bswap64_gen(x)\ > - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) > + (((__uint64_t)__bswap32((x) & 0x) << 32) | __bswap32((x) >> 32)) > > #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P > #define __bswap16(x)\ -- http://ache.vniz.net/ ___ 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: r233692 - head/sys/dev/sound/pci/hda
Author: mav Date: Fri Mar 30 08:33:08 2012 New Revision: 233692 URL: http://svn.freebsd.org/changeset/base/233692 Log: Reenable unsolicited responses on CODEC if hdaa_sense_init() called again. This fixes jack connection events handling after suspend/resume. PR: kern/166382 MFC after:1 week Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c == --- head/sys/dev/sound/pci/hda/hdaa.c Fri Mar 30 05:49:32 2012 (r233691) +++ head/sys/dev/sound/pci/hda/hdaa.c Fri Mar 30 08:33:08 2012 (r233692) @@ -612,10 +612,11 @@ hdaa_sense_init(struct hdaa_devinfo *dev if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && - w->unsol < 0) { - w->unsol = HDAC_UNSOL_ALLOC( - device_get_parent(devinfo->dev), devinfo->dev, w->nid); + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { + if (w->unsol < 0) + w->unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), + devinfo->dev, w->nid); hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); ___ 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: r233693 - head/sys/kern
Author: davidxu Date: Fri Mar 30 09:03:53 2012 New Revision: 233693 URL: http://svn.freebsd.org/changeset/base/233693 Log: Fix COMPAT_FREEBSD32 build. Submitted by: Andreas Tobler < andreast at fgznet dot ch > Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c == --- head/sys/kern/kern_umtx.c Fri Mar 30 08:33:08 2012(r233692) +++ head/sys/kern/kern_umtx.c Fri Mar 30 09:03:53 2012(r233693) @@ -957,7 +957,7 @@ do_lock_umtx32(struct thread *td, uint32 umtxq_lock(&uq->uq_key); if (old == owner) error = umtxq_sleep(uq, "umtx", timeout == NULL ? - NULL : timo); + NULL : &timo); umtxq_remove(uq); umtxq_unlock(&uq->uq_key); umtx_key_release(&uq->uq_key); @@ -3372,7 +3372,7 @@ __umtx_op_rw_rdlock_compat32(struct thre (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); - error = do_rw_rdlock2(td, uap->obj, uap->val, &timeout); + error = do_rw_rdlock(td, uap->obj, uap->val, &timeout); } return (error); } @@ -3391,7 +3391,7 @@ __umtx_op_rw_wrlock_compat32(struct thre (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); - error = do_rw_wrlock2(td, uap->obj, &timeout); + error = do_rw_wrlock(td, uap->obj, &timeout); } return (error); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r233674 - head/libexec/rtld-elf
On Thu, Mar 29, 2012 at 09:11:25PM +0300, Konstantin Belousov wrote: > On Thu, Mar 29, 2012 at 05:50:01PM +, Konstantin Belousov wrote: > > Author: kib > > Date: Thu Mar 29 17:50:01 2012 > > New Revision: 233674 > > URL: http://svn.freebsd.org/changeset/base/233674 > > > > Log: > > Fix ia64 build after r233655. > > > > MFC after:1 week > > > > Modified: > > head/libexec/rtld-elf/rtld.c > > > > Modified: head/libexec/rtld-elf/rtld.c > > == > > --- head/libexec/rtld-elf/rtld.cThu Mar 29 17:39:18 2012 > > (r233673) > > +++ head/libexec/rtld-elf/rtld.cThu Mar 29 17:50:01 2012 > > (r233674) > > @@ -2618,7 +2618,9 @@ do_dlsym(void *handle, const char *name, > > const Elf_Sym *def; > > SymLook req; > > RtldLockState lockstate; > > +#ifndef __ia64__ > > tls_index ti; > > +#endif > > int res; > > > > def = NULL; > > @@ -2734,9 +2736,13 @@ do_dlsym(void *handle, const char *name, > > else if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) > > return (rtld_resolve_ifunc(defobj, def)); > > else if (ELF_ST_TYPE(def->st_info) == STT_TLS) { > > +#ifdef __ia64__ > > + return (__tls_get_addr(defobj->tlsindex, def->st_value)); > > +#else > > ti.ti_module = defobj->tlsindex; > > ti.ti_offset = def->st_value; > > return (__tls_get_addr(&ti)); > > +#endif > > } else > > return (defobj->relocbase + def->st_value); > > } > While this band-aid fixes the build, the change is obviously bad. > The reason to have this #ifdef is that ia64 is the only architecture > that declares __tls_get_addr() as > > void *__tls_get_addr(unsigned long module, unsigned long offset); > > while all other architectures do > > typedef struct { > unsigned long ti_module; > unsigned long ti_offset; > } tls_index; > void *__tls_get_addr(tls_index *ti); > > But e.g. on amd64 the ABI of both declarations is the same. From my > cursory look at ia64 ABI document, the same hold for ia64. Answering my own question, no, it is not the same ABI on amd64. It would be if __tls_get_addr() took tls_index, and not pointer to tls_index. This is the part which I missed. It is indeed the same ABI on ia64, but due to different calling conventions (pass by value on ia64 vs. pointer to structure on everything else) the patch below cannot work. Sorry for the noise. > > Can anybody with ia64 clue and test machine confirm that the following > works, i.e. ABI is not broken ? > > diff --git a/libexec/rtld-elf/ia64/reloc.c b/libexec/rtld-elf/ia64/reloc.c > index 01e20b8..31319f3 100644 > --- a/libexec/rtld-elf/ia64/reloc.c > +++ b/libexec/rtld-elf/ia64/reloc.c > @@ -650,9 +650,9 @@ allocate_initial_tls(Obj_Entry *list) > __asm __volatile("mov r13 = %0" :: "r"(tpval)); > } > > -void *__tls_get_addr(unsigned long module, unsigned long offset) > +void *__tls_get_addr(tls_index *ti) > { > register Elf_Addr** tp __asm__("r13"); > > -return tls_get_addr_common(tp, module, offset); > +return tls_get_addr_common(tp, ti->ti_module, ti->ti_offset); > } > diff --git a/libexec/rtld-elf/ia64/rtld_machdep.h > b/libexec/rtld-elf/ia64/rtld_machdep.h > index 4a68ff7..df877f2 100644 > --- a/libexec/rtld-elf/ia64/rtld_machdep.h > +++ b/libexec/rtld-elf/ia64/rtld_machdep.h > @@ -64,7 +64,12 @@ void call_init_pointer(const struct Struct_Obj_Entry *, > Elf_Addr); > round(prev_offset + prev_size, align) > #define calculate_tls_end(off, size) ((off) + (size)) > > -extern void *__tls_get_addr(unsigned long module, unsigned long offset); > +typedef struct { > +unsigned long ti_module; > +unsigned long ti_offset; > +} tls_index; > + > +extern void *__tls_get_addr(tls_index *ti); > > #define RTLD_DEFAULT_STACK_PF_EXEC 0 > #define RTLD_DEFAULT_STACK_EXEC 0 > diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > index d3ce3c6..828b8b4 100644 > --- a/libexec/rtld-elf/rtld.c > +++ b/libexec/rtld-elf/rtld.c > @@ -2618,9 +2618,7 @@ do_dlsym(void *handle, const char *name, void *retaddr, > const Ver_Entry *ve, > const Elf_Sym *def; > SymLook req; > RtldLockState lockstate; > -#ifndef __ia64__ > tls_index ti; > -#endif > int res; > > def = NULL; > @@ -2736,13 +2734,9 @@ do_dlsym(void *handle, const char *name, void > *retaddr, const Ver_Entry *ve, > else if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) > return (rtld_resolve_ifunc(defobj, def)); > else if (ELF_ST_TYPE(def->st_info) == STT_TLS) { > -#ifdef __ia64__ > - return (__tls_get_addr(defobj->tlsindex, def->st_value)); > -#else > ti.ti_module = defobj->tlsindex; > ti.ti_offset = def->st_value; > return (__tls_get_addr(&ti)); > -#endif > } else > return (defobj->relocbase + def->st_value); > } pgptbVMcWalHG.pgp Description: PGP sig
Re: svn commit: r233683 - head/sys/x86/include
On Thu, 29 Mar 2012, Dimitry Andric wrote: Log: Revert sys/x86/include/endian.h to what it was before r233419, as that revision has two problems: - It can produce worse code with both clang and gcc. - It doesn't fix the actual issue introduced in r232721, which will be fixed in the next commit. Submitted by: bde, tijl and jh Pointy hat to: dim Thanks. I didn't know that there was an actualy bug to be fixed... Modified: head/sys/x86/include/endian.h Modified: head/sys/x86/include/endian.h == --- head/sys/x86/include/endian.h Thu Mar 29 21:54:19 2012 (r233682) +++ head/sys/x86/include/endian.h Thu Mar 29 23:30:17 2012 (r233683) @@ -63,11 +63,11 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#define__bswap16_gen(x)((__uint16_t)((x) << 8 | (x) >> 8)) +#define__bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8) #define __bswap32_gen(x)\ - (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16)) + (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) #define __bswap64_gen(x)\ - (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32)) + (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P #define __bswap16(x)\ ... it seems that there was no bug. After looking at the next commit, the bug backed out here is now clear, and I don't like the next commit either (more details on that in a reply to it). Using the non-generic versions ensured that there were no extra bits. In the `const' case, this is implemented using casts. But the generic versions don't have these casts. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r233684 - head/sys/x86/include
On 2012-03-30 10:25, Andrey Chernov wrote: On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote: However, the arguments are not properly masked, which results in the wrong value being calculated in some instances. For example, bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0) returns 0xfcdefc9a7c563412. Is sign extension considered in that place? Shifting any signed value to ">>" direction (char, short, int, etc.) replicates sign bit, so cast to corresponding unsigned value must be done first, which may take less instructions, than masking (I am not sure about this part, just guessing). Casting in that case applies to the argument (x) not to result (x>> YY). Yes, the arguments are all converted to unsigned types where necessary. The __bswapXX_gen() macros are only used internally by the __bswapXX() macros and the __bswapXX_var() inline functions. In case of the __bswapXX() macros, you can see that the argument to __bswapXX_gen() is first explicitly cast to an unsigned type, for example with __bswap32(): #define __bswap32(x)\ (__builtin_constant_p(x) ? \ __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) Therefore, right shifting will not give any problems. For the call to __bswap32_var(), such casting is not needed, since the argument will be implicitly converted to __uint32_t. As Bruce has mentioned, you could add more explicit casts and additional parentheses, but those would be superfluous. ___ 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: r233684 - head/sys/x86/include
On Thu, 29 Mar 2012, Dimitry Andric wrote: Log: Fix an issue introduced in sys/x86/include/endian.h with r232721. In that revision, the bswapXX_const() macros were renamed to bswapXX_gen(). Also, bswap64_gen() was implemented as two calls to bswap32(), and similarly, bswap32_gen() as two calls to bswap16(). This mainly helps our base gcc to produce more efficient assembly. However, the arguments are not properly masked, which results in the wrong value being calculated in some instances. For example, bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0) returns 0xfcdefc9a7c563412. No, bswap32() and bswap64() were properly masked in r232721, and not only that, they were cast to the correct type, as required to prevent related problems when they are used. It was the next commit, rmumble, that broke this, by using uncast expressions sub-expressions for bswap32_gen() and bswap64_gen(). Fix this by appropriately masking the arguments to bswap16() in bswap32_gen(), and to bswap32() in bswap64_gen(). This should also silence warnings from clang. Sorry, this is inappropriate. It has no effect except to silence the warnings from clang in a confusing way. Submitted by: jh Modified: head/sys/x86/include/endian.h Modified: head/sys/x86/include/endian.h == --- head/sys/x86/include/endian.h Thu Mar 29 23:30:17 2012 (r233683) +++ head/sys/x86/include/endian.h Thu Mar 29 23:31:48 2012 (r233684) @@ -65,9 +65,9 @@ #define __bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8) #define __bswap32_gen(x)\ - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) + (((__uint32_t)__bswap16((x) & 0x) << 16) | __bswap16((x) >> 16)) #define __bswap64_gen(x)\ - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) + (((__uint64_t)__bswap32((x) & 0x) << 32) | __bswap32((x) >> 32)) This has no effect except to make it clear to clang (but not to humans) that the implicit conversions do the right thing. It would have worked around the bug in a previous version and accidentally fixed the warning in the same way as this version. For example, consider bswap32(0x12345678). This becomes __bswap32_gen( 0x12345678) after a null cast of the arg to __uint32_t. (We don't cast the result of __bswap32_gen(), and depend on minor magic (mainly on 32-bit ints) for this to be unnecessary.). The next reduction, for the correct version which has the above expression without the 0xfff mask, is: (((__uint32_t)__bswap16(0x12345678) << 16) | __bswap16(0x12345678 >> 16)) The __bswap16() macros work unsurprisingly (except for the conditional operator in them!) and give constants of type uint16_t which I denote by a US suffix. The result of evaluating them is: (((__uint32_t)0x7856US << 16) | 0x3412US) and the result is the unsurprising 0x78563412. Note that for the 'gen' part, everything is explicitly cast, as required for the result to be correct, and there is no reason for clang to warn, and it doesn't. However, for the `var' part, clang warns spuriously. This is a bug in clang, since the `var' part is not even used. 0x12345678 >> 16 is 0x1234 which is representable by __uint16_t, so there is no warning for it. However, __bswap16(0x12345678) expands to essentially: 1 ? __bswap16_gen(0x12345678) : __bswap16_var(0x12345678) Here __bswap16_var() takes a __uint16_t arg, so an implicit value-losing cast is required to call it. clang warns about this although __bswap16_var() is not actually called. Masking with 0x fixes this accidentally by converting 0x12345678 to 0x5678. Now it is representable as a __uint16_t, so clang doesn't warn about downcasting it when not-calling __bswap16_var() on it. A previous version broke the result by changing __bswap16() to __bswap16_gen(). In the critical expression: (((__uint32_t)__bswap16_gen(0x12345678) << 16) | __bswap16_gen(0x12345678 >> 16)), 0x12345678 >> 16 has only 16 bits, so there are no problems with it. But in __bswap16_gen(0x12345678), the value has extra bits which the macro is intentionally designed not to handle (callers are required to pass it only 16 bits. Its result is (0x12345678 << 8) | (0x12345678 >> 8) cast to __uint16_t. Compilers should warn about the overflow in this. If they just shift the bits out, the result is 0x34567800 | 0x00123456 = 0x34567c56 cast down = 0x7c56. It's surprising that this has only 1 bit incorrect. Masking with 0x fixes this by discarding the extra bits, which gives the same value although a different type than the unbroken version (the unbroken version casts the arg to __uint16_t before invoking __bswap16_gen() although not before invoking __bswap16_var() since it knows that the prototype will do an implicit cast for the latter and it doesn't want to know about the clang bug. #ifdef __GNUCL
Re: svn commit: r233684 - head/sys/x86/include
On Fri, Mar 30, 2012 at 02:11:21PM +0200, Dimitry Andric wrote: > In case of the __bswapXX() macros, you can see that the argument to > __bswapXX_gen() is first explicitly cast to an unsigned type, for > example with __bswap32(): > > #define __bswap32(x)\ > (__builtin_constant_p(x) ? \ > __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) > > Therefore, right shifting will not give any problems. For the call to > __bswap32_var(), such casting is not needed, since the argument will be > implicitly converted to __uint32_t. > > As Bruce has mentioned, you could add more explicit casts and additional > parentheses, but those would be superfluous. I mention right shift just as potential problem. I really want to target casting vs. masking problem (masking provide more instructions). bde@ already suggest the same thing I generally mean in more details in his recent answer with the patch: % + __bswap16_gen((__uint16_t)(x)) : __bswap16_var((__uint16_t)(x -- http://ache.vniz.net/ ___ 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: r233684 - head/sys/x86/include
On Fri, 30 Mar 2012, Andrey Chernov wrote: On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote: However, the arguments are not properly masked, which results in the wrong value being calculated in some instances. For example, bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0) returns 0xfcdefc9a7c563412. Is sign extension considered in that place? Shifting any signed value to ">>" direction (char, short, int, etc.) replicates sign bit, so cast to corresponding unsigned value must be done first, which may take less instructions, than masking (I am not sure about this part, just guessing). Casting in that case applies to the argument (x) not to result (x >> YY). There are lots of casts to uint* which are supposed to be sufficent, although some shortcuts are taken, especially in the 'gen' macros. The main thing to watch out for is C90's broken sign "value-preserving" promotion rule turning unsigned types into signed ones, so that sign extension bugs may occur later. #define__bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8) For example, this macro is private, and callers are required to know that its arg needs to be uint16_t or possibly smaller, and to not forget to cast to that if necessary. Then there are no problems evaluating ((x) << 8 | (x) >> 8), but it has type plain int. But we want the result to have type uint16_t and cast to that (this cast should probably be in callers too). So the plain int doesn't escape, but whenever the uint16_t is used, it gets promoted to plain int and its users should be careful with this. #define__bswap32_gen(x)\ - (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) + (((__uint32_t)__bswap16((x) & 0x) << 16) | __bswap16((x) >> 16)) Here the cast to uint32_t is because the caller _is_ being careful with this. If the expression were plain __bswap16((x) << 16, then when __bswap16() returns 0x8000, the shift gives (plain int)0x8000 = -0x7fff - 1 with 32-bit ints. This would work in practice on normal 2's complement machines, but is unportable. Note that the result of the whole expression is not cast to uint32_t. We depend on ints being precisely 32 bits, so that the the result of the expression, which is either plain int or unsigned int (provided that ints have at least 32 bits with no padding bits), is in fact precisely uint32_t. This is another reason why casting the result of the gen macros belongs in callers. (We mostly don't cast, but use one to cast down the result of the conditional expression in the 16-bit case after the default promotions cast up to plain int. Omitting the corresponding cast for the other widths again depends on ints being 32 bits.) #define__bswap64_gen(x)\ - (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) + (((__uint64_t)__bswap32((x) & 0x) << 32) | __bswap32((x) >> 32)) Now we must cast up for the completely different reason that __bswap32() returns only uint32_t ints, and with 32 bit ints the implicit upwards conversion is null, but we need to shift to 64 bits, so we must start with at least 64 bits. #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P #define__bswap16(x)\ Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r233698 - head/lib/libutil
Author: joel (doc committer) Date: Fri Mar 30 12:34:34 2012 New Revision: 233698 URL: http://svn.freebsd.org/changeset/base/233698 Log: mdoc: terminate quoted strings. Modified: head/lib/libutil/login.conf.5 Modified: head/lib/libutil/login.conf.5 == --- head/lib/libutil/login.conf.5 Fri Mar 30 09:38:35 2012 (r233697) +++ head/lib/libutil/login.conf.5 Fri Mar 30 12:34:34 2012 (r233698) @@ -226,64 +226,64 @@ See for details. .It "label string Default MAC policy; see" .Xr maclabel 7 . -.It "lang string Set $LANG environment variable to the specified value. -.It "manpath pathDefault search path for manpages. -.It "nocheckmail boolfalse Display mail status at login. -.It "nologin fileIf the file exists it will be displayed and +.It "lang string Set $LANG environment variable to the specified value." +.It "manpath pathDefault search path for manpages." +.It "nocheckmail boolfalse Display mail status at login." +.It "nologin fileIf the file exists it will be displayed and" the login session will be terminated. -.It "path path/bin /usr/bin Default search path. -.It "priority number Initial priority (nice) level. -.It "requirehome boolfalse Require a valid home directory to login. -.It "setenvlistA comma-separated list of environment variables and +.It "path path/bin /usr/bin Default search path." +.It "priority number Initial priority (nice) level." +.It "requirehome boolfalse Require a valid home directory to login." +.It "setenvlistA comma-separated list of environment variables and" values to which they are to be set. -.It "shell progSession shell to execute rather than the +.It "shell progSession shell to execute rather than the" shell specified in the passwd file. The SHELL environment variable will contain the shell specified in the password file. -.It "term string Default terminal type if not able to determine +.It "term string Default terminal type if not able to determine" from other means. -.It "timezone string Default value of $TZ environment variable. -.It "umask number 022 Initial umask. Should always have a leading 0 to +.It "timezone string Default value of $TZ environment variable." +.It "umask number 022 Initial umask. Should always have a leading 0 to" ensure octal interpretation. -.It "welcome file/etc/motd File containing welcome message. +.It "welcome file/etc/motd File containing welcome message." .El .Sh AUTHENTICATION .Bl -column passwd_prompt indent indent -.It Sy "Name TypeNotes Description +.It Sy "Name TypeNotes Description" .\" .It "approve program Program to approve login. -.It "copyright fileFile containing additional copyright information -.It "host.allowlistList of remote host wildcards from which users in +.It "copyright fileFile containing additional copyright information" +.It "host.allowlistList of remote host wildcards from which users in" the class may access. -.It "host.deny listList of remote host wildcards from which users +.It "host.deny listList of remote host wildcards from which users" in the class may not access. -.It "login_prompt string The login prompt given by +.It "login_prompt string The login prompt given by" .Xr login 1 -.It "login-backoff number 3 The number of login attempts +.It "login-backoff number 3 The number of login attempts" allowed before the backoff delay is inserted after each subsequent attempt. The backoff delay is the number of tries above .Em login-backoff multiplied by 5 seconds. -.It "login-retries number 10 The number of login attempts +.It "login-retries number 10 The number of login attempts" allowed before the login fails. -.It "passwd_format string md5 The encryption format that new or +.It "passwd_format string md5 The encryption format that new or" changed passwords will use. Valid values include "des", "md5" and "blf". NIS clients using a .No non- Ns Fx NIS server should probably use "des". -.It "passwd_prompt string The password prompt presented by +.It "passwd_prompt string The password prompt presented by" .Xr login 1 -.It "times.allow listList of time periods during which +.It "times.allow listList of time periods during which" logins are allowed. -.It "times.denylistList of time periods during which logins are +.It "times.denylistList of time
svn commit: r233699 - head/contrib/libstdc++/libsupc++
Author: theraven Date: Fri Mar 30 12:48:36 2012 New Revision: 233699 URL: http://svn.freebsd.org/changeset/base/233699 Log: Undo the earlier revert of the ABI change in libsupc++. On further discussion, posting an errata notice with 9.1 is the less painful solution. Approved by: dim (mentor) Modified: head/contrib/libstdc++/libsupc++/typeinfo Modified: head/contrib/libstdc++/libsupc++/typeinfo == --- head/contrib/libstdc++/libsupc++/typeinfo Fri Mar 30 12:34:34 2012 (r233698) +++ head/contrib/libstdc++/libsupc++/typeinfo Fri Mar 30 12:48:36 2012 (r233699) @@ -100,6 +100,12 @@ namespace std bool operator!=(const type_info& __arg) const { return !operator==(__arg); } +// Return true if this is a pointer type of some kind +virtual bool __is_pointer_p() const; + +// Return true if this is a function type +virtual bool __is_function_p() const; + // Try and catch a thrown type. Store an adjusted pointer to the // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then // THR_OBJ points to the thrown object. If THR_TYPE is a pointer @@ -113,12 +119,6 @@ namespace std virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; -// Return true if this is a pointer type of some kind -virtual bool __is_pointer_p() const; - -// Return true if this is a function type -virtual bool __is_function_p() const; - protected: const char *__name; ___ 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: r233700 - head/sys/kern
Author: davidxu Date: Fri Mar 30 12:57:14 2012 New Revision: 233700 URL: http://svn.freebsd.org/changeset/base/233700 Log: Remove trailing semicolon, it is a typo. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c == --- head/sys/kern/kern_umtx.c Fri Mar 30 12:48:36 2012(r233699) +++ head/sys/kern/kern_umtx.c Fri Mar 30 12:57:14 2012(r233700) @@ -2346,7 +2346,7 @@ do_cv_wait(struct thread *td, struct uco error = do_unlock_umutex(td, m); - if (timeout != NULL); + if (timeout != NULL) abs_timeout_init(&timo, clockid, ((wflags & CVWAIT_ABSTIME) != 0), timeout); ___ 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: r233700 - head/sys/kern
Hi, here are a few similar cases. Stefan Index: tools/regression/lib/libc/nss/test-gethostby.c === --- tools/regression/lib/libc/nss/test-gethostby.c (revision 233700) +++ tools/regression/lib/libc/nss/test-gethostby.c (working copy) @@ -109,7 +109,7 @@ else { error = 0; he = getipnodebyname(name, af, ipnode_flags, &error); - if (he == NULL); + if (he == NULL) errno = error; } Index: cddl/compat/opensolaris/misc/deviceid.c === --- cddl/compat/opensolaris/misc/deviceid.c (revision 233700) +++ cddl/compat/opensolaris/misc/deviceid.c (working copy) @@ -45,7 +45,7 @@ return (EINVAL); } *retminor_name = strdup(""); - if (*retminor_name == NULL); + if (*retminor_name == NULL) return (ENOMEM); return (0); } Index: sys/sparc64/pci/fire.c === --- sys/sparc64/pci/fire.c (revision 233700) +++ sys/sparc64/pci/fire.c (working copy) @@ -446,7 +446,7 @@ FO_PCI_TLU_CTRL_CFG_MASK) >> FO_PCI_TLU_CTRL_CFG_SHFT; i = sizeof(fire_freq_nak_tmr_thrs) / sizeof(*fire_freq_nak_tmr_thrs); - if (mps >= i); + if (mps >= i) mps = i - 1; FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS, (fire_freq_nak_tmr_thrs[mps][lw] << Index: sys/contrib/rdma/rdma_addr.c === --- sys/contrib/rdma/rdma_addr.c (revision 233700) +++ sys/contrib/rdma/rdma_addr.c (working copy) @@ -172,7 +172,7 @@ *dst = *dst_in; rtalloc(&iproute); - if (iproute.ro_rt == NULL); + if (iproute.ro_rt == NULL) return; arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, Index: sys/dev/gpio/gpioc.c === --- sys/dev/gpio/gpioc.c (revision 233700) +++ sys/dev/gpio/gpioc.c (working copy) @@ -102,7 +102,7 @@ struct gpioc_softc *sc = device_get_softc(dev); int err; - if (sc->sc_ctl_dev); + if (sc->sc_ctl_dev) destroy_dev(sc->sc_ctl_dev); if ((err = bus_generic_detach(dev)) != 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: r233701 - head/sys/sparc64/pci
Author: marius Date: Fri Mar 30 15:08:09 2012 New Revision: 233701 URL: http://svn.freebsd.org/changeset/base/233701 Log: - Remove erroneous trailing semicolon. [1] - Correctly determine the maximum payload size for setting the TX link frequent NACK latency and replay timer thresholds. Submitted by: stefanf [1] MFC after:3 days Modified: head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/firereg.h Modified: head/sys/sparc64/pci/fire.c == --- head/sys/sparc64/pci/fire.c Fri Mar 30 12:57:14 2012(r233700) +++ head/sys/sparc64/pci/fire.c Fri Mar 30 15:08:09 2012(r233701) @@ -443,10 +443,11 @@ fire_attach(device_t dev) lw = 0; } mps = (FIRE_PCI_READ_8(sc, FO_PCI_TLU_CTRL) & - FO_PCI_TLU_CTRL_CFG_MASK) >> FO_PCI_TLU_CTRL_CFG_SHFT; + FO_PCI_TLU_CTRL_CFG_MPS_MASK) >> + FO_PCI_TLU_CTRL_CFG_MPS_SHFT; i = sizeof(fire_freq_nak_tmr_thrs) / sizeof(*fire_freq_nak_tmr_thrs); - if (mps >= i); + if (mps >= i) mps = i - 1; FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS, (fire_freq_nak_tmr_thrs[mps][lw] << Modified: head/sys/sparc64/pci/firereg.h == --- head/sys/sparc64/pci/firereg.h Fri Mar 30 12:57:14 2012 (r233700) +++ head/sys/sparc64/pci/firereg.h Fri Mar 30 15:08:09 2012 (r233701) @@ -345,6 +345,13 @@ #defineFO_PCI_TLU_CTRL_CFG_MASK0xULL #defineFO_PCI_TLU_CTRL_CFG_SHFT0 #defineFO_PCI_TLU_CTRL_CFG_REMAIN_DETECT_QUIET 0x0100ULL +#defineFO_PCI_TLU_CTRL_CFG_PAD_LOOPBACK_EN 0x0080ULL +#defineFO_PCI_TLU_CTRL_CFG_EWRAP_LOOPBACK_EN 0x0040ULL +#defineFO_PCI_TLU_CTRL_CFG_DIGITAL_LOOPBACK_EN 0x0020ULL +#defineFO_PCI_TLU_CTRL_CFG_MPS_MASK0x001cULL +#defineFO_PCI_TLU_CTRL_CFG_MPS_SHFT2 +#defineFO_PCI_TLU_CTRL_CFG_COMMON_CLK_CFG 0x0002ULL +#defineFO_PCI_TLU_CTRL_CFG_PORT0x0001ULL /* * PCI TLU other event interrupt enable, interrupt status and status clear ___ 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: r233702 - head/sys/amd64/amd64
Author: jkim Date: Fri Mar 30 16:32:41 2012 New Revision: 233702 URL: http://svn.freebsd.org/changeset/base/233702 Log: Work around Erratum 721 for AMD Family 10h and 12h processors. "Under a highly specific and detailed set of internal timing conditions, the processor may incorrectly update the stack pointer after a long series of push and/or near-call instructions, or a long series of pop and/or near-return instructions. The processor must be in 64-bit mode for this erratum to occur." MFC after:3 days Modified: head/sys/amd64/amd64/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c == --- head/sys/amd64/amd64/initcpu.c Fri Mar 30 15:08:09 2012 (r233701) +++ head/sys/amd64/amd64/initcpu.c Fri Mar 30 16:32:41 2012 (r233702) @@ -79,6 +79,27 @@ SYSCTL_UINT(_hw, OID_AUTO, via_feature_r SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, &via_feature_xcrypt, 0, "VIA xcrypt feature available in CPU"); +static void +init_amd(void) +{ + + /* +* Work around Erratum 721 for Family 10h and 12h processors. +* These processors may incorrectly update the stack pointer +* after a long series of push and/or near-call instructions, +* or a long series of pop and/or near-return instructions. +* +* http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf +* http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf +*/ + switch (CPUID_TO_FAMILY(cpu_id)) { + case 0x10: + case 0x12: + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + break; + } +} + /* * Initialize special VIA features */ @@ -135,8 +156,14 @@ initializecpu(void) wrmsr(MSR_EFER, msr); pg_nx = PG_NX; } - if (cpu_vendor_id == CPU_VENDOR_CENTAUR) + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + init_amd(); + break; + case CPU_VENDOR_CENTAUR: init_via(); + break; + } } void ___ 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: r233704 - in head/sys/amd64: acpica amd64
Author: jkim Date: Fri Mar 30 17:03:06 2012 New Revision: 233704 URL: http://svn.freebsd.org/changeset/base/233704 Log: Re-initialize model-specific MSRs when we resume CPUs. MFC after:1 week Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/acpica/acpi_wakeup.c == --- head/sys/amd64/acpica/acpi_wakeup.c Fri Mar 30 16:54:21 2012 (r233703) +++ head/sys/amd64/acpica/acpi_wakeup.c Fri Mar 30 17:03:06 2012 (r233704) @@ -284,6 +284,7 @@ acpi_sleep_machdep(struct acpi_softc *sc } else { pmap_init_pat(); load_cr3(susppcbs[0]->pcb_cr3); + initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); #ifdef SMP Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 30 16:54:21 2012 (r233703) +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 30 17:03:06 2012 (r233704) @@ -1425,6 +1425,7 @@ cpususpend_handler(void) } else { pmap_init_pat(); load_cr3(susppcbs[cpu]->pcb_cr3); + initializecpu(); 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: r233707 - in head/sys: amd64/amd64 amd64/include conf i386/i386 i386/include i386/xbox pc98/include x86/include x86/pci x86/x86
Author: jhb Date: Fri Mar 30 19:10:14 2012 New Revision: 233707 URL: http://svn.freebsd.org/changeset/base/233707 Log: Move the legacy(4) driver to x86. Added: head/sys/x86/include/legacyvar.h - copied, changed from r233702, head/sys/amd64/include/legacyvar.h head/sys/x86/x86/legacy.c - copied, changed from r233702, head/sys/i386/i386/legacy.c Deleted: head/sys/amd64/amd64/legacy.c head/sys/amd64/include/legacyvar.h head/sys/i386/i386/legacy.c head/sys/i386/include/legacyvar.h head/sys/pc98/include/legacyvar.h Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/xbox/xboxfb.c head/sys/x86/pci/pci_bus.c head/sys/x86/x86/mptable_pci.c Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Fri Mar 30 17:38:57 2012(r233706) +++ head/sys/conf/files.amd64 Fri Mar 30 19:10:14 2012(r233707) @@ -113,7 +113,6 @@ amd64/amd64/identcpu.c standard amd64/amd64/in_cksum.c optionalinet | inet6 amd64/amd64/initcpu.c standard amd64/amd64/io.c optionalio -amd64/amd64/legacy.c standard amd64/amd64/locore.S standardno-obj amd64/amd64/machdep.c standard amd64/amd64/mem.c optionalmem @@ -477,6 +476,7 @@ x86/x86/busdma_machdep.cstandard x86/x86/dump_machdep.c standard x86/x86/intr_machdep.c standard x86/x86/io_apic.c standard +x86/x86/legacy.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard x86/x86/mptable.c optionalmptable Modified: head/sys/conf/files.i386 == --- head/sys/conf/files.i386Fri Mar 30 17:38:57 2012(r233706) +++ head/sys/conf/files.i386Fri Mar 30 19:10:14 2012(r233707) @@ -408,7 +408,6 @@ i386/i386/in_cksum.coptional inet | in i386/i386/initcpu.cstandard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem -i386/i386/legacy.c optional native i386/i386/locore.s optional native no-obj i386/xen/locore.s optional xenno-obj i386/i386/longrun.coptional cpu_enable_longrun @@ -529,6 +528,7 @@ x86/x86/busdma_machdep.cstandard x86/x86/dump_machdep.c standard x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic +x86/x86/legacy.c optional native x86/x86/local_apic.c optional apic x86/x86/mca.c standard x86/x86/mptable.c optional apic native Modified: head/sys/conf/files.pc98 == --- head/sys/conf/files.pc98Fri Mar 30 17:38:57 2012(r233706) +++ head/sys/conf/files.pc98Fri Mar 30 19:10:14 2012(r233707) @@ -147,7 +147,6 @@ i386/i386/in_cksum.coptional inet | in i386/i386/initcpu.cstandard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem -i386/i386/legacy.c standard i386/i386/locore.s standardno-obj i386/i386/mem.coptional mem i386/i386/minidump_machdep.c standard @@ -252,6 +251,7 @@ x86/x86/busdma_machdep.cstandard x86/x86/dump_machdep.c standard x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic +x86/x86/legacy.c standard x86/x86/local_apic.c optional apic x86/x86/mca.c standard x86/x86/mptable.c optional apic Modified: head/sys/i386/xbox/xboxfb.c == --- head/sys/i386/xbox/xboxfb.c Fri Mar 30 17:38:57 2012(r233706) +++ head/sys/i386/xbox/xboxfb.c Fri Mar 30 19:10:14 2012(r233707) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Copied and modified: head/sys/x86/include/legacyvar.h (from r233702, head/sys/amd64/include/legacyvar.h) == --- head/sys/amd64/include/legacyvar.h Fri Mar 30 16:32:41 2012 (r233702, copy source) +++ head/sys/x86/include/legacyvar.hFri Mar 30 19:10:14 2012 (r233707) @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LEGACYVAR_H_ -#define_MACHINE_LEGACYVAR_H_ +#ifndef _X86_LEGACYVAR_H_ +#define_X86_LEGACYVAR_H_ enum legacy_device_ivars { LEGACY_IVAR_PCIDOMAIN, @@ -60,4 +60,4 @@ struct resource *legacy_pcib_alloc_resou intlegacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); -#endif /*
Re: svn commit: r233700 - head/sys/kern
On 2012-03-30 15:30, Stefan Farfeleder wrote: here are a few similar cases. Hm, what about this one that clang warns about: sys/dev/asr/asr.c:2420:57: warning: for loop has empty body [-Wempty-body] for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next)); ^ sys/dev/asr/asr.c:2420:57: note: put the semicolon on a separate line to silence this warning [-Wempty-body] I'm not sure about it though, the code looks like this: static int asr_attach(device_t dev) { [...] Asr_softc_t *sc, **ha; [...] LIST_INIT(&(sc->ha_ccb)); /* Link us into the HA list */ for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next)); *(ha) = sc; It seems the for loop walks the list until the end, then tacks 'sc' onto it. So to 'fix' the warning, and make the meaning more explicit, we should probably rewrite that fragment as: LIST_INIT(&(sc->ha_ccb)); /* Link us into the HA list */ for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next)) ; *(ha) = sc; Is this OK? ___ 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: r233708 - head/sys/dev/e1000
Author: jhb Date: Fri Mar 30 19:54:48 2012 New Revision: 233708 URL: http://svn.freebsd.org/changeset/base/233708 Log: Fix a few issues with transmit handling in em(4) and igb(4): - Do not define the foo_start() methods or set if_start in the ifnet if multiq transmit is enabled. Also, set if_transmit and if_qflush before ether_ifattach rather than after when multiq transmit is enabled. This helps to ensure that the drivers never try to mix different transmit methods. - Properly restart transmit during resume. igb(4) was not restarting it at all, and em(4) was restarting even if the link was down and was calling the wrong method if multiq transmit was enabled. - Remove all the 'more' handling for transmit completions. Transmit completion processing does not have a processing limit, so it always runs to completion and never has more work to do when it returns. Instead, the previous code was returning 'true' anytime there were packets in the queue that weren't still in the process of being transmitted. The effect was that the driver would continuously reschedule a task to process TX completions in effect running at 100% CPU polling the hardware until it finished transmitting all of the packets in the ring. Now it will just wait for the next TX completion interrupt. - Restart packet transmission when the link becomes active. - Fix the MSI-X queue interrupt handlers to restart packet transmission if there are pending packets in the relevant software queue (IFQ or buf_ring) after processing TX completions. This is the root cause for the OACTIVE hangs as if the MSI-X queue handler drained all the pending packets from the TX ring, nothing would ever restart it. As such, remove some previously-added workarounds to reschedule a task to poll the TX ring anytime OACTIVE was set. Tested by:sbruno Reviewed by: jfv MFC after:1 week Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Fri Mar 30 19:10:14 2012(r233707) +++ head/sys/dev/e1000/if_em.c Fri Mar 30 19:54:48 2012(r233708) @@ -193,13 +193,14 @@ static intem_detach(device_t); static int em_shutdown(device_t); static int em_suspend(device_t); static int em_resume(device_t); -static voidem_start(struct ifnet *); -static voidem_start_locked(struct ifnet *, struct tx_ring *); #ifdef EM_MULTIQUEUE static int em_mq_start(struct ifnet *, struct mbuf *); static int em_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static voidem_qflush(struct ifnet *); +#else +static voidem_start(struct ifnet *); +static voidem_start_locked(struct ifnet *, struct tx_ring *); #endif static int em_ioctl(struct ifnet *, u_long, caddr_t); static voidem_init(void *); @@ -234,7 +235,7 @@ static void em_enable_intr(struct adapte static voidem_disable_intr(struct adapter *); static voidem_update_stats_counters(struct adapter *); static voidem_add_hw_stats(struct adapter *adapter); -static boolem_txeof(struct tx_ring *); +static voidem_txeof(struct tx_ring *); static boolem_rxeof(struct rx_ring *, int, int *); #ifndef __NO_STRICT_ALIGNMENT static int em_fixup_rx(struct rx_ring *); @@ -847,6 +848,7 @@ static int em_resume(device_t dev) { struct adapter *adapter = device_get_softc(dev); + struct tx_ring *txr = adapter->tx_rings; struct ifnet *ifp = adapter->ifp; EM_CORE_LOCK(adapter); @@ -854,8 +856,22 @@ em_resume(device_t dev) e1000_resume_workarounds_pchlan(&adapter->hw); em_init_locked(adapter); em_init_manageability(adapter); + + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { + for (int i = 0; i < adapter->num_queues; i++, txr++) { + EM_TX_LOCK(txr); +#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) + em_mq_start_locked(ifp, txr, NULL); +#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + em_start_locked(ifp, txr); +#endif + EM_TX_UNLOCK(txr); + } + } EM_CORE_UNLOCK(adapter); - em_start(ifp); return bus_generic_resume(dev); } @@ -959,7 +975,7 @@ em_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* EM_MULTIQUEUE */ +#else /* !EM_MULTIQUEUE */ static void em_start_locked(struct ifnet *ifp, struct tx_ring *txr) @@ -1020,14 +1036,9 @@ em_start(struct ifnet *ifp) em_start_locked(ifp, txr); EM_TX_UNLOCK(txr); } - /* - ** If we went inactive schedule
svn commit: r233709 - head/sys/x86/x86
Author: jhb Date: Fri Mar 30 20:17:39 2012 New Revision: 233709 URL: http://svn.freebsd.org/changeset/base/233709 Log: Attempt to make machine check handling a bit more robust: - Don't malloc() new MCA records for machine checks logged due to a CMCI or MC# exception. Instead, use a pre-allocated pool of records. When a CMCI or MC# exception fires, schedule a swi to refill the pool. The pool is sized to hold at least one record per available machine bank, and one record per CPU. This should handle the case of all CPUs triggering a single bank at once as well as the case a single CPU triggering all of its banks. The periodic scans still use malloc() since they are run from a safe context. - Since we have to create an swi to handle refills, make the periodic scan a second swi for the same thread instead of having a separate taskqueue thread for the scans. Suggested by: mdf (avoiding malloc()) MFC after:2 weeks Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c == --- head/sys/x86/x86/mca.c Fri Mar 30 19:54:48 2012(r233708) +++ head/sys/x86/x86/mca.c Fri Mar 30 20:17:39 2012(r233709) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -85,6 +84,7 @@ struct mca_internal { static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); static int mca_count; /* Number of records stored. */ +static int mca_banks; /* Number of per-CPU register banks. */ static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture"); @@ -103,16 +103,16 @@ int workaround_erratum383; SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?"); +static STAILQ_HEAD(, mca_internal) mca_freelist; +static int mca_freecount; static STAILQ_HEAD(, mca_internal) mca_records; static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ -static struct taskqueue *mca_tq; -static struct task mca_task; static struct mtx mca_lock; +static void *mca_refill_swi, *mca_scan_swi; #ifdef DEV_APIC static struct cmc_state **cmc_state; /* Indexed by cpuid, bank */ -static int cmc_banks; static int cmc_throttle = 60; /* Time in seconds to throttle CMCI. */ #endif @@ -416,21 +416,60 @@ mca_check_status(int bank, struct mca_re return (1); } -static void __nonnull(1) -mca_record_entry(const struct mca_record *record) +static void +mca_fill_freelist(void) { struct mca_internal *rec; + int desired; - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - mca_log(record); - return; + /* +* Ensure we have at least one record for each bank and one +* record per CPU. +*/ + desired = imax(mp_ncpus, mca_banks); + mtx_lock_spin(&mca_lock); + while (mca_freecount < desired) { + mtx_unlock_spin(&mca_lock); + rec = malloc(sizeof(*rec), M_MCA, M_WAITOK); + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_freelist, rec, link); + mca_freecount++; + } + mtx_unlock_spin(&mca_lock); +} + +static void +mca_refill(void *arg) +{ + + mca_fill_freelist(); +} + +static void __nonnull(2) +mca_record_entry(enum scan_mode mode, const struct mca_record *record) +{ + struct mca_internal *rec; + + if (mode == POLLED) { + rec = malloc(sizeof(*rec), M_MCA, M_WAITOK); + mtx_lock_spin(&mca_lock); + } else { + mtx_lock_spin(&mca_lock); + rec = STAILQ_FIRST(&mca_freelist); + if (rec == NULL) { + mtx_unlock_spin(&mca_lock); + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + STAILQ_REMOVE_HEAD(&mca_freelist, link); + mca_freecount--; + if (mca_refill_swi != NULL) + swi_sched(mca_refill_swi, 0); } rec->rec = *record; rec->logged = 0; - mtx_lock_spin(&mca_lock); STAILQ_INSERT_TAIL(&mca_records, rec, link); mca_count++; mtx_unlock_spin(&mca_lock); @@ -552,7 +591,7 @@ mca_scan(enum scan_mode mode) recoverable = 0; mca_log(&rec); } - mca_record_entry(&rec); + mca_record_entry(mode, &rec); } #ifdef DEV_APIC @@ -564,6 +603,8 @@ mca_scan(enum scan_mode mode)
Re: svn commit: r233294 - in head: . contrib/com_err crypto/heimdal crypto/heimdal/admin crypto/heimdal/appl crypto/heimdal/appl/afsutil crypto/heimdal/appl/ftp crypto/heimdal/appl/ftp/common crypto/h
On 3/29/2012 4:16 AM, David Chisnall wrote: > On 29 Mar 2012, at 04:36, Doug Barton wrote: > >> All of the stuff that pkgng relies on (including the tool itself) >> are going to be in the ports collection, where they belong. We >> should have moved pkg_* there years ago, but this change is at >> least a step in the right direction. > > Wait... what? Why should pkgng be in ports (other than now, while > it's under development)? I'd like to see it used for managing some > of the optional parts of the base system and probably eventually > replacing freebsd-update, not have it as another bolt-on that is not > part of the core system. Not to mention the bootstrapping problem if > every user who wants to use binary packages needs to use ports to > build pkgng. The bootstrapping problem has been discussed in detail on -ports@, #bsdports, etc.; and the solutions are well known, and quite simple. A) the installer needs to be modified to install certain packages by default, and B) we need a tiny binary in the base (something like pkg_bootstrap, but hopefully with a better name) to bring the ports/package tools up to date. And optionally, C) a button on whatever post-install configurator we end up with to do the same task. Someone else already gave part of the picture as to why this change needs to be made, but to add a bit more detail ... We currently have (at minimum) a 5 year cycle of introducing new features to the pkg_* tools specifically, and often to the ports generally. No, that's not a typo. That's how long it takes to introduce something to the newest FreeBSD version, and then have that change percolate over time to all of the supported FreeBSD versions. We can't continue to operate like that. If FreeBSD is going to survive as a project it has to be able to innovate. In order to do that we have to take the best parts of the "FreeBSD is a complete system" model and at the same time be willing to be honest with ourselves about where and how that model is holding us back. The whole concept of "If it's important, it must be in the base" is one example. The flip side of that, "If it's not in the base, it's not important" is even more dangerous/destructive. We absolutely have to move to a model where "The Base" is a smaller version of what we're shipping now, and more of the 3rd party stuff is moved out to ports only. I'm not talking about a Linux distro model where everything is a package, but we have to stop thinking that just because something is done in Linux means that we can never consider adopting the best parts of the concepts for FreeBSD. We need to see the ports as part of the "The FreeBSD System." Doug ___ 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: r233710 - head/sys/dev/isci
Author: dim Date: Fri Mar 30 22:52:08 2012 New Revision: 233710 URL: http://svn.freebsd.org/changeset/base/233710 Log: Fix the following compilation warning with clang trunk in isci(4): sys/dev/isci/isci_task_request.c:198:7: error: case value not in enumerated type 'SCI_TASK_STATUS' (aka 'enum _SCI_TASK_STATUS') [-Werror,-Wswitch] case SCI_FAILURE_TIMEOUT: ^ This is because the switch is done on a SCI_TASK_STATUS enum type, but the SCI_FAILURE_TIMEOUT value belongs to SCI_STATUS instead. Because the list of SCI_TASK_STATUS values cannot be modified at this time, use the simplest way to get rid of this warning, which is to cast the switch argument to int. No functional change. Reviewed by: jimharris MFC after:3 days Modified: head/sys/dev/isci/isci_task_request.c Modified: head/sys/dev/isci/isci_task_request.c == --- head/sys/dev/isci/isci_task_request.c Fri Mar 30 20:17:39 2012 (r233709) +++ head/sys/dev/isci/isci_task_request.c Fri Mar 30 22:52:08 2012 (r233710) @@ -188,7 +188,7 @@ isci_task_request_complete(SCI_CONTROLLE isci_remote_device->is_resetting = FALSE; - switch (completion_status) { + switch ((int)completion_status) { case SCI_TASK_SUCCESS: case SCI_TASK_FAILURE_RESPONSE_VALID: break; ___ 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: r233711 - in head/sys: conf dev/mfi modules/mfi
Author: ambrisko Date: Fri Mar 30 23:05:48 2012 New Revision: 233711 URL: http://svn.freebsd.org/changeset/base/233711 Log: MFhead_mfi r227068 First cut of new HW support from LSI and merge into FreeBSD. Supports Drake Skinny and ThunderBolt cards. MFhead_mfi r227574 Style MFhead_mfi r227579 Use bus_addr_t instead of uintXX_t. MFhead_mfi r227580 MSI support MFhead_mfi r227612 More bus_addr_t and remove "#ifdef __amd64__". MFhead_mfi r227905 Improved timeout support from Scott. MFhead_mfi r228108 Make file. MFhead_mfi r228208 Fixed botched merge of Skinny support and enhanced handling in call back routine. MFhead_mfi r228279 Remove superfluous !TAILQ_EMPTY() checks before TAILQ_FOREACH(). MFhead_mfi r228310 Move mfi_decode_evt() to taskqueue. MFhead_mfi r228320 Implement MFI_DEBUG for 64bit S/G lists. MFhead_mfi r231988 Restore structure layout by reverting the array header to use [0] instead of [1]. MFhead_mfi r232412 Put wildcard pattern later in the match table. MFhead_mfi r232413 Use lower case for hexadecimal numbers to match surrounding style. MFhead_mfi r232414 Add more Thunderbolt variants. MFhead_mfi r232888 Don't act on events prior to boot or when shutting down. Add hw.mfi.detect_jbod_change to enable or disable acting on JBOD type of disks being added on insert and removed on removing. Switch hw.mfi.msi to 1 by default since it works better on newer cards. MFhead_mfi r233016 Release driver lock before taking Giant when deleting children. Use TAILQ_FOREACH_SAFE when items can be deleted. Make code a little simplier to follow. Fix a couple more style issues. MFhead_mfi r233620 Update mfi_spare/mfi_array with the actual number of elements for array_ref and pd. Change these max. #define names to avoid name space collisions. This will require an update to mfiutil It avoids mfiutil having to do a magic calculation. Add a note and #define to state that a "SYSTEM" disk is really what the firmware calls a "JBOD" drive. Thanks to the many that helped, LSI for the initial code drop, mav, delphij, jhb, sbruno that all helped with code and testing. Added: head/sys/dev/mfi/mfi_syspd.c (contents, props changed) - copied, changed from r227068, projects/head_mfi/sys/dev/mfi/mfi_syspd.c head/sys/dev/mfi/mfi_tbolt.c (contents, props changed) - copied, changed from r227068, projects/head_mfi/sys/dev/mfi/mfi_tbolt.c Modified: head/sys/conf/files head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mfi/mfi_debug.c head/sys/dev/mfi/mfi_disk.c head/sys/dev/mfi/mfi_ioctl.h head/sys/dev/mfi/mfi_linux.c head/sys/dev/mfi/mfi_pci.c head/sys/dev/mfi/mfireg.h head/sys/dev/mfi/mfivar.h head/sys/modules/mfi/Makefile Directory Properties: head/sys/ (props changed) head/sys/conf/ (props changed) Modified: head/sys/conf/files == --- head/sys/conf/files Fri Mar 30 22:52:08 2012(r233710) +++ head/sys/conf/files Fri Mar 30 23:05:48 2012(r233711) @@ -1558,6 +1558,8 @@ dev/mfi/mfi.c optional mfi dev/mfi/mfi_debug.coptional mfi dev/mfi/mfi_pci.c optional mfi pci dev/mfi/mfi_disk.c optional mfi +dev/mfi/mfi_syspd.coptional mfi +dev/mfi/mfi_tbolt.coptional mfi dev/mfi/mfi_linux.coptional mfi compat_linux dev/mfi/mfi_cam.c optional mfip scbus dev/mii/acphy.coptional miibus | acphy Modified: head/sys/dev/mfi/mfi.c == --- head/sys/dev/mfi/mfi.c Fri Mar 30 22:52:08 2012(r233710) +++ head/sys/dev/mfi/mfi.c Fri Mar 30 23:05:48 2012(r233711) @@ -53,6 +53,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_mfi.h" #include @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -79,10 +81,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static int mfi_alloc_commands(struct mfi_softc *); static int mfi_comms_init(struct mfi_softc *); -static int mfi_wait_command(struct mfi_softc *, struct mfi_command *); static int mfi_get_controller_info(struct mfi_softc *); static int mfi_get_log_state(struct mfi_softc *, struct mfi_evt_log_state **); @@ -93,29 +96,39 @@ static void mfi_data_cb(void *, bus_dma_ static voidmfi_startup(void *arg); static voidmfi_intr(void *arg); static voidmfi_ldprobe(struct mfi_softc *sc); +static voidmfi_syspdprobe(struct mfi_softc *sc); +static void
svn commit: r233713 - head/usr.sbin/mfiutil
Author: ambrisko Date: Fri Mar 30 23:39:39 2012 New Revision: 233713 URL: http://svn.freebsd.org/changeset/base/233713 Log: MFhead_mfi r233621 Remove the magic mfi_array is 288 bytes and just use the sizeof the array since it is not 288 bytes. Change reporting of a "SYSTEM" disk to "JBOD" to match LSI MegaCli and firmware reporting. This means that fiutil command to "create jbod" is now a little confusing since a RAID per drive is not really what LSI defines JBOD to be. This should be fixed in the future and support added to really create LSI JBOD and enable that feature on cards that support it. Modified: head/usr.sbin/mfiutil/mfi_config.c head/usr.sbin/mfiutil/mfi_drive.c Directory Properties: head/ (props changed) Modified: head/usr.sbin/mfiutil/mfi_config.c == --- head/usr.sbin/mfiutil/mfi_config.c Fri Mar 30 23:24:44 2012 (r233712) +++ head/usr.sbin/mfiutil/mfi_config.c Fri Mar 30 23:39:39 2012 (r233713) @@ -211,9 +211,8 @@ clear_config(int ac, char **av) } MFI_COMMAND(top, clear, clear_config); -#defineMFI_ARRAY_SIZE 288 -#defineMAX_DRIVES_PER_ARRAY \ - ((MFI_ARRAY_SIZE - sizeof(struct mfi_array)) / 8) +#define MAX_DRIVES_PER_ARRAY MFI_MAX_ROW_SIZE +#define MFI_ARRAY_SIZE sizeof(struct mfi_array) #defineRT_RAID00 #defineRT_RAID11 @@ -305,7 +304,7 @@ parse_array(int fd, int raid_type, char /* Validate the number of drives for this array. */ if (count >= MAX_DRIVES_PER_ARRAY) { - warnx("Too many drives for a single array: max is %zu", + warnx("Too many drives for a single array: max is %d", MAX_DRIVES_PER_ARRAY); return (EINVAL); } Modified: head/usr.sbin/mfiutil/mfi_drive.c == --- head/usr.sbin/mfiutil/mfi_drive.c Fri Mar 30 23:24:44 2012 (r233712) +++ head/usr.sbin/mfiutil/mfi_drive.c Fri Mar 30 23:39:39 2012 (r233713) @@ -149,7 +149,7 @@ mfi_pdstate(enum mfi_pd_state state) case MFI_PD_STATE_COPYBACK: return ("COPYBACK"); case MFI_PD_STATE_SYSTEM: - return ("SYSTEM"); + return ("JBOD"); default: sprintf(buf, "PSTATE 0x%04x", state); return (buf); ___ 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: r233729 - head/sys/kern
Author: davidxu Date: Sat Mar 31 06:48:41 2012 New Revision: 233729 URL: http://svn.freebsd.org/changeset/base/233729 Log: Remove stale comments. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c == --- head/sys/kern/kern_umtx.c Sat Mar 31 06:44:48 2012(r233728) +++ head/sys/kern/kern_umtx.c Sat Mar 31 06:48:41 2012(r233729) @@ -1216,9 +1216,6 @@ do_lock_normal(struct thread *td, struct } /* - * Lock PTHREAD_PRIO_NONE protocol POSIX mutex. - */ -/* * Unlock PTHREAD_PRIO_NONE protocol POSIX mutex. */ static int ___ 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"