From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 01:14:44 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 681EC230; Sun, 12 Apr 2015 01:14:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 531DEBB; Sun, 12 Apr 2015 01:14:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C1EhUr051039; Sun, 12 Apr 2015 01:14:43 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C1EhfG051038; Sun, 12 Apr 2015 01:14:43 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201504120114.t3C1EhfG051038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Sun, 12 Apr 2015 01:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281446 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 01:14:44 -0000 Author: jpaetzel Date: Sun Apr 12 01:14:43 2015 New Revision: 281446 URL: https://svnweb.freebsd.org/changeset/base/281446 Log: MFC 281112, 281166 Bug fixes and feature adds - Remove extranious echo that breaks puppet - Handle restarts of multiple pflog devices correctly - Add the ability to perform actions on specific pflog devices. Typo Fix. PR: 199150 Modified: stable/10/etc/rc.d/pflog Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/pflog ============================================================================== --- stable/10/etc/rc.d/pflog Sun Apr 12 00:02:32 2015 (r281445) +++ stable/10/etc/rc.d/pflog Sun Apr 12 01:14:43 2015 (r281446) @@ -24,30 +24,30 @@ pflog_prestart() { load_kld pflog || return 1 + # create pflog_dev interface if needed + if ! ifconfig $pflog_dev > /dev/null 2>&1; then + if ! ifconfig $pflog_dev create; then + warn "could not create $pflog_dev." + return 1 + fi + fi + # set pflog_dev interface to up state if ! ifconfig $pflog_dev up; then warn "could not bring up $pflog_dev." return 1 fi + # -p flag requires stripping pidfile's leading /var/run and trailing .pid + pidfile=$(echo $pidfile | sed -e 's|/var/run/||' -e 's|.pid$||') + # prepare the command line for pflogd - rc_flags="-f $pflog_logfile -i $pflog_dev $rc_flags" + rc_flags="-p $pidfile -f $pflog_logfile -i $pflog_dev $rc_flags" # report we're ready to run pflogd return 0 } -pflog_poststart() { - # Allow child pflogd to settle - sleep 0.10 - # More elegant(?) method for getting a unique pid - if [ -f /var/run/pflogd.pid ]; then - mv /var/run/pflogd.pid $pidfile - else - warn "/var/run/pflogd.pid does not exist. Too fast." - fi -} - pflog_poststop() { if ! ifconfig $pflog_dev down; then @@ -70,29 +70,33 @@ pflog_resync() load_rc_config $name -# Check if spawning multiple pflogd -echo "Starting pflogd: $pflog_instances" -if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then - start_postcmd="pflog_poststart" +# Check if spawning multiple pflogd and told what to spawn +if [ -n "$2" ]; then + # Set required variables + eval pflog_dev=\$pflog_${2}_dev + eval pflog_logfile=\$pflog_${2}_logfile + eval pflog_flags=\$pflog_${2}_flags + # Check that required vars have non-zero length, warn if not. + if [ -z $pflog_dev ]; then + warn "pflog_dev not set" + continue + fi + if [ -z $pflog_logfile ]; then + warn "pflog_logfile not set" + continue + fi + + # Provide a unique pidfile name for pflogd -p flag + pidfile="/var/run/pflogd.$2.pid" + + # Override service name and execute command + name=$pflog_dev + run_rc_command "$1" +# Check if spawning multiple pflogd and not told what to spawn +elif [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then # Interate through requested instances. for i in $pflog_instances; do - # Set required variables - eval pflog_dev=\$pflog_${i}_dev - eval pflog_logfile=\$pflog_${i}_logfile - eval pflog_flags=\$pflog_${i}_flags - # Check that required vars have non-zero length, warn if not. - if [ -z $pflog_dev ]; then - warn "pflog_dev not set" - continue - fi - if [ -z $pflog_logfile ]; then - warn "pflog_logfile not set" - continue - fi - # pflogd sets a pidfile, but the name is hardcoded. Concoct a - # unique pidfile name. - pidfile="/var/run/pflogd.$i.pid" - run_rc_command "$1" + /etc/rc.d/pflog $1 $i done else # Typical case, spawn single instance only. From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 06:43:15 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD60BA2F; Sun, 12 Apr 2015 06:43:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B78192EA; Sun, 12 Apr 2015 06:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C6hFf7004873; Sun, 12 Apr 2015 06:43:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C6hEcX004866; Sun, 12 Apr 2015 06:43:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504120643.t3C6hEcX004866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Apr 2015 06:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281452 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 06:43:15 -0000 Author: kib Date: Sun Apr 12 06:43:13 2015 New Revision: 281452 URL: https://svnweb.freebsd.org/changeset/base/281452 Log: MFC r264346 (by alc): Pass MAP_ALIGNED_SUPER to allocate the whole dso region if its text is large enough for the superpage mapping. Modified: stable/10/libexec/rtld-elf/malloc.c stable/10/libexec/rtld-elf/map_object.c stable/10/libexec/rtld-elf/rtld.c stable/10/libexec/rtld-elf/rtld.h Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/malloc.c ============================================================================== --- stable/10/libexec/rtld-elf/malloc.c Sun Apr 12 06:21:58 2015 (r281451) +++ stable/10/libexec/rtld-elf/malloc.c Sun Apr 12 06:43:13 2015 (r281452) @@ -139,25 +139,14 @@ botch(s) /* Debugging stuff */ #define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) -extern int pagesize; - -static int -rtld_getpagesize(void) -{ - int mib[2]; - size_t size; - - if (pagesize != 0) - return (pagesize); - - mib[0] = CTL_HW; - mib[1] = HW_PAGESIZE; - size = sizeof(pagesize); - if (sysctl(mib, 2, &pagesize, &size, NULL, 0) == -1) - return (-1); - return (pagesize); - -} +/* + * The array of supported page sizes is provided by the user, i.e., the + * program that calls this storage allocator. That program must initialize + * the array before making its first call to allocate storage. The array + * must contain at least one page size. The page sizes must be stored in + * increasing order. + */ +extern size_t *pagesizes; void * malloc(nbytes) @@ -173,7 +162,7 @@ malloc(nbytes) * align break pointer so all data will be page aligned. */ if (pagesz == 0) { - pagesz = n = rtld_getpagesize(); + pagesz = n = pagesizes[0]; if (morepages(NPOOLPAGES) == 0) return NULL; op = (union overhead *)(pagepool_start); Modified: stable/10/libexec/rtld-elf/map_object.c ============================================================================== --- stable/10/libexec/rtld-elf/map_object.c Sun Apr 12 06:21:58 2015 (r281451) +++ stable/10/libexec/rtld-elf/map_object.c Sun Apr 12 06:43:13 2015 (r281452) @@ -68,6 +68,7 @@ map_object(int fd, const char *path, con Elf_Addr base_vaddr; Elf_Addr base_vlimit; caddr_t base_addr; + int base_flags; Elf_Off data_offset; Elf_Addr data_vaddr; Elf_Addr data_vlimit; @@ -176,9 +177,11 @@ map_object(int fd, const char *path, con base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; base_addr = (caddr_t) base_vaddr; + base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE; + if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1]) + base_flags |= MAP_ALIGNED_SUPER; - mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | - MAP_NOCORE, -1, 0); + mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); if (mapbase == (caddr_t) -1) { _rtld_error("%s: mmap of entire address space failed: %s", path, rtld_strerror(errno)); Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Sun Apr 12 06:21:58 2015 (r281451) +++ stable/10/libexec/rtld-elf/rtld.c Sun Apr 12 06:43:13 2015 (r281452) @@ -97,6 +97,7 @@ static void *fill_search_info(const char static char *find_library(const char *, const Obj_Entry *); static const char *gethints(bool); static void init_dag(Obj_Entry *); +static void init_pagesizes(Elf_Auxinfo **aux_info); static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *); @@ -206,7 +207,8 @@ extern Elf_Dyn _DYNAMIC; #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) #endif -int osreldate, pagesize; +int npagesizes, osreldate; +size_t *pagesizes; long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -1824,8 +1826,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * /* Now that non-local variables can be accesses, copy out obj_rtld. */ memcpy(&obj_rtld, &objtmp, sizeof(obj_rtld)); - if (aux_info[AT_PAGESZ] != NULL) - pagesize = aux_info[AT_PAGESZ]->a_un.a_val; + /* The page size is required by the dynamic memory allocator. */ + init_pagesizes(aux_info); + if (aux_info[AT_OSRELDATE] != NULL) osreldate = aux_info[AT_OSRELDATE]->a_un.a_val; @@ -1839,6 +1842,50 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * } /* + * Retrieve the array of supported page sizes. The kernel provides the page + * sizes in increasing order. + */ +static void +init_pagesizes(Elf_Auxinfo **aux_info) +{ + static size_t psa[MAXPAGESIZES]; + int mib[2]; + size_t len, size; + + if (aux_info[AT_PAGESIZES] != NULL && aux_info[AT_PAGESIZESLEN] != + NULL) { + size = aux_info[AT_PAGESIZESLEN]->a_un.a_val; + pagesizes = aux_info[AT_PAGESIZES]->a_un.a_ptr; + } else { + len = 2; + if (sysctlnametomib("hw.pagesizes", mib, &len) == 0) + size = sizeof(psa); + else { + /* As a fallback, retrieve the base page size. */ + size = sizeof(psa[0]); + if (aux_info[AT_PAGESZ] != NULL) { + psa[0] = aux_info[AT_PAGESZ]->a_un.a_val; + goto psa_filled; + } else { + mib[0] = CTL_HW; + mib[1] = HW_PAGESIZE; + len = 2; + } + } + if (sysctl(mib, len, psa, &size, NULL, 0) == -1) { + _rtld_error("sysctl for hw.pagesize(s) failed"); + die(); + } +psa_filled: + pagesizes = psa; + } + npagesizes = size / sizeof(pagesizes[0]); + /* Discard any invalid entries at the end of the array. */ + while (npagesizes > 0 && pagesizes[npagesizes - 1] == 0) + npagesizes--; +} + +/* * Add the init functions from a needed object list (and its recursive * needed objects) to "list". This is not used directly; it is a helper * function for initlist_add_objects(). The write lock must be held Modified: stable/10/libexec/rtld-elf/rtld.h ============================================================================== --- stable/10/libexec/rtld-elf/rtld.h Sun Apr 12 06:21:58 2015 (r281451) +++ stable/10/libexec/rtld-elf/rtld.h Sun Apr 12 06:43:13 2015 (r281452) @@ -71,6 +71,9 @@ extern size_t tls_static_space; extern int tls_dtv_generation; extern int tls_max_index; +extern int npagesizes; +extern size_t *pagesizes; + extern int main_argc; extern char **main_argv; extern char **environ; From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 06:45:45 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73C31B7B; Sun, 12 Apr 2015 06:45:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5479D2FF; Sun, 12 Apr 2015 06:45:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C6jjdX005293; Sun, 12 Apr 2015 06:45:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C6jero005266; Sun, 12 Apr 2015 06:45:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504120645.t3C6jero005266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Apr 2015 06:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281453 - in stable/10/libexec/rtld-elf: . amd64 i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 06:45:45 -0000 Author: kib Date: Sun Apr 12 06:45:40 2015 New Revision: 281453 URL: https://svnweb.freebsd.org/changeset/base/281453 Log: MFC r280816: Change default visibility for rtld to hidden, on x86. Modified: stable/10/libexec/rtld-elf/Makefile stable/10/libexec/rtld-elf/amd64/reloc.c stable/10/libexec/rtld-elf/amd64/rtld_machdep.h stable/10/libexec/rtld-elf/amd64/rtld_start.S stable/10/libexec/rtld-elf/i386/reloc.c stable/10/libexec/rtld-elf/i386/rtld_machdep.h stable/10/libexec/rtld-elf/i386/rtld_start.S stable/10/libexec/rtld-elf/rtld.c stable/10/libexec/rtld-elf/rtld.h stable/10/libexec/rtld-elf/rtld_lock.c stable/10/libexec/rtld-elf/rtld_lock.h stable/10/libexec/rtld-elf/rtld_tls.h Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/Makefile ============================================================================== --- stable/10/libexec/rtld-elf/Makefile Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/Makefile Sun Apr 12 06:45:40 2015 (r281453) @@ -42,6 +42,9 @@ CFLAGS+= -fPIC CFLAGS+= -fpic .endif CFLAGS+= -DPIC $(DEBUG) +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +CFLAGS+= -fvisibility=hidden +.endif LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic Modified: stable/10/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/10/libexec/rtld-elf/amd64/reloc.c Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/amd64/reloc.c Sun Apr 12 06:45:40 2015 (r281453) @@ -47,6 +47,7 @@ #include "debug.h" #include "rtld.h" +#include "rtld_tls.h" /* * Process the special R_X86_64_COPY relocations in the main program. These Modified: stable/10/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- stable/10/libexec/rtld-elf/amd64/rtld_machdep.h Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/amd64/rtld_machdep.h Sun Apr 12 06:45:40 2015 (r281453) @@ -74,7 +74,7 @@ typedef struct { unsigned long ti_offset; } tls_index; -extern void *__tls_get_addr(tls_index *ti); +void *__tls_get_addr(tls_index *ti) __exported; #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC Modified: stable/10/libexec/rtld-elf/amd64/rtld_start.S ============================================================================== --- stable/10/libexec/rtld-elf/amd64/rtld_start.S Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/amd64/rtld_start.S Sun Apr 12 06:45:40 2015 (r281453) @@ -36,7 +36,7 @@ movq %rsp,%rsi # save address of exit proc movq %rsp,%rdx # construct address of obj_main addq $8,%rdx - call _rtld@PLT # Call rtld(sp); returns entry point + call _rtld # Call rtld(sp); returns entry point popq %rsi # Get exit procedure address movq %r12,%rdi # *ap /* @@ -118,7 +118,7 @@ _rtld_bind_start: leaq (%rsi,%rsi,2),%rsi # multiply by 3 leaq (,%rsi,8),%rsi # now 8, for 24 (sizeof Elf_Rela) - call _rtld_bind@PLT # Transfer control to the binder + call _rtld_bind # Transfer control to the binder /* Now %rax contains the entry point of the function being called. */ movq %rax,0x60(%rsp) # Store target over reloff argument Modified: stable/10/libexec/rtld-elf/i386/reloc.c ============================================================================== --- stable/10/libexec/rtld-elf/i386/reloc.c Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/i386/reloc.c Sun Apr 12 06:45:40 2015 (r281453) @@ -48,6 +48,7 @@ #include "debug.h" #include "rtld.h" +#include "rtld_tls.h" /* * Process the special R_386_COPY relocations in the main program. These Modified: stable/10/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- stable/10/libexec/rtld-elf/i386/rtld_machdep.h Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/i386/rtld_machdep.h Sun Apr 12 06:45:40 2015 (r281453) @@ -74,8 +74,8 @@ typedef struct { unsigned long ti_offset; } tls_index; -extern void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))); -extern void *__tls_get_addr(tls_index *ti); +void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))) __exported; +void *__tls_get_addr(tls_index *ti) __exported; #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC Modified: stable/10/libexec/rtld-elf/i386/rtld_start.S ============================================================================== --- stable/10/libexec/rtld-elf/i386/rtld_start.S Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/i386/rtld_start.S Sun Apr 12 06:45:40 2015 (r281453) @@ -42,7 +42,7 @@ pushl %ecx # Pass address of obj_main pushl %ebx # Pass address of exit proc pushl %eax # Pass initial stack pointer to rtld - call _rtld@PLT # Call rtld(sp); returns entry point + call _rtld # Call rtld(sp); returns entry point addl $16,%esp # Remove arguments from stack popl %edx # Get exit procedure address movl %esi,%esp # Ignore obj_main @@ -78,7 +78,7 @@ _rtld_bind_start: pushl 20(%esp) # Copy reloff argument pushl 20(%esp) # Copy obj argument - call _rtld_bind@PLT # Transfer control to the binder + call _rtld_bind # Transfer control to the binder /* Now %eax contains the entry point of the function being called. */ addl $8,%esp # Discard binder arguments Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/rtld.c Sun Apr 12 06:45:40 2015 (r281453) @@ -161,14 +161,14 @@ static uint32_t gnu_hash(const char *); static bool matched_symbol(SymLook *, const Obj_Entry *, Sym_Match_Result *, const unsigned long); -void r_debug_state(struct r_debug *, struct link_map *) __noinline; -void _r_debug_postinit(struct link_map *) __noinline; +void r_debug_state(struct r_debug *, struct link_map *) __noinline __exported; +void _r_debug_postinit(struct link_map *) __noinline __exported; /* * Data declarations. */ static char *error_message; /* Message for dlerror(), or NULL */ -struct r_debug r_debug; /* for GDB; */ +struct r_debug r_debug __exported; /* for GDB; */ static bool libmap_disable; /* Disable libmap */ static bool ld_loadfltr; /* Immediate filters processing */ static char *libmap_override; /* Maps to use in addition to libmap.conf */ @@ -207,6 +207,23 @@ extern Elf_Dyn _DYNAMIC; #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) #endif +int dlclose(void *) __exported; +char *dlerror(void) __exported; +void *dlopen(const char *, int) __exported; +void *fdlopen(int, int) __exported; +void *dlsym(void *, const char *) __exported; +dlfunc_t dlfunc(void *, const char *) __exported; +void *dlvsym(void *, const char *, const char *) __exported; +int dladdr(const void *, Dl_info *) __exported; +void dllockinit(void *, void *(*)(void *), void (*)(void *), void (*)(void *), + void (*)(void *), void (*)(void *), void (*)(void *)) __exported; +int dlinfo(void *, int , void *) __exported; +int dl_iterate_phdr(__dl_iterate_hdr_callback, void *) __exported; +int _rtld_addr_phdr(const void *, struct dl_phdr_info *) __exported; +int _rtld_get_stack_prot(void) __exported; +int _rtld_is_dlopened(void *) __exported; +void _rtld_error(const char *, ...) __exported; + int npagesizes, osreldate; size_t *pagesizes; Modified: stable/10/libexec/rtld-elf/rtld.h ============================================================================== --- stable/10/libexec/rtld-elf/rtld.h Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/rtld.h Sun Apr 12 06:45:40 2015 (r281453) @@ -353,7 +353,7 @@ typedef struct Struct_SymLook { struct Struct_RtldLockState *lockstate; } SymLook; -void _rtld_error(const char *, ...) __printflike(1, 2); +void _rtld_error(const char *, ...) __printflike(1, 2) __exported; const char *rtld_strerror(int); Obj_Entry *map_object(int, const char *, const struct stat *); void *xcalloc(size_t, size_t); Modified: stable/10/libexec/rtld-elf/rtld_lock.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld_lock.c Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/rtld_lock.c Sun Apr 12 06:45:40 2015 (r281453) @@ -51,6 +51,10 @@ #include "rtld.h" #include "rtld_machdep.h" +void _rtld_thread_init(struct RtldLockInfo *) __exported; +void _rtld_atfork_pre(int *) __exported; +void _rtld_atfork_post(int *) __exported; + #define WAFLAG 0x1 /* A writer holds the lock */ #define RC_INCR 0x2 /* Adjusts count of readers desiring lock */ Modified: stable/10/libexec/rtld-elf/rtld_lock.h ============================================================================== --- stable/10/libexec/rtld-elf/rtld_lock.h Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/rtld_lock.h Sun Apr 12 06:45:40 2015 (r281453) @@ -44,9 +44,9 @@ struct RtldLockInfo void (*at_fork)(void); }; -extern void _rtld_thread_init(struct RtldLockInfo *); -extern void _rtld_atfork_pre(int *); -extern void _rtld_atfork_post(int *); +extern void _rtld_thread_init(struct RtldLockInfo *) __exported; +extern void _rtld_atfork_pre(int *) __exported; +extern void _rtld_atfork_post(int *) __exported; #ifdef IN_RTLD Modified: stable/10/libexec/rtld-elf/rtld_tls.h ============================================================================== --- stable/10/libexec/rtld-elf/rtld_tls.h Sun Apr 12 06:43:13 2015 (r281452) +++ stable/10/libexec/rtld-elf/rtld_tls.h Sun Apr 12 06:45:40 2015 (r281453) @@ -57,13 +57,14 @@ * The value returned from this function is suitable for installing * directly into the thread pointer register. */ -extern void *_rtld_allocate_tls(void* oldtls, size_t tcbsize, size_t tcbalign); +void *_rtld_allocate_tls(void* oldtls, size_t tcbsize, size_t tcbalign) + __exported; /* * Free a TLS block allocated using _rtld_allocate_tls(). The tcbsize * and tcbalign parameters must be the same as those used to allocate * the block. */ -extern void _rtld_free_tls(void *tcb, size_t tcbsize, size_t tcbalign); +void _rtld_free_tls(void *tcb, size_t tcbsize, size_t tcbalign) __exported; #endif From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 06:52:46 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA021DBF; Sun, 12 Apr 2015 06:52:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2A583D8; Sun, 12 Apr 2015 06:52:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C6qkDX009580; Sun, 12 Apr 2015 06:52:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C6qiYV009568; Sun, 12 Apr 2015 06:52:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504120652.t3C6qiYV009568@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Apr 2015 06:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281454 - in stable/10: lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 06:52:46 -0000 Author: kib Date: Sun Apr 12 06:52:43 2015 New Revision: 281454 URL: https://svnweb.freebsd.org/changeset/base/281454 Log: MFC r280818: Make kevent(2) a cancellation point. Added: stable/10/lib/libc/sys/kevent.c - copied unchanged from r280818, head/lib/libc/sys/kevent.c Modified: stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/sys/Makefile.inc stable/10/lib/libc/sys/interposing_table.c stable/10/lib/libc/sys/kqueue.2 stable/10/lib/libthr/thread/thr_syscalls.c stable/10/share/man/man3/pthread_testcancel.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Sun Apr 12 06:45:40 2015 (r281453) +++ stable/10/lib/libc/include/libc_private.h Sun Apr 12 06:52:43 2015 (r281454) @@ -221,6 +221,7 @@ enum { INTERPOS__pthread_mutex_init_calloc_cb, INTERPOS_spinlock, INTERPOS_spinunlock, + INTERPOS_kevent, INTERPOS_MAX }; @@ -293,6 +294,7 @@ void * __sys_freebsd6_mmap(void *, __siz struct aiocb; struct fd_set; struct iovec; +struct kevent; struct msghdr; struct pollfd; struct rusage; @@ -315,6 +317,8 @@ int __sys_fsync(int); __pid_t __sys_fork(void); int __sys_ftruncate(int, __off_t); int __sys_gettimeofday(struct timeval *, struct timezone *); +int __sys_kevent(int, const struct kevent *, int, struct kevent *, + int, const struct timespec *); __off_t __sys_lseek(int, __off_t, int); void *__sys_mmap(void *, __size_t, int, int, int, __off_t); int __sys_msync(void *, __size_t, int); Modified: stable/10/lib/libc/sys/Makefile.inc ============================================================================== --- stable/10/lib/libc/sys/Makefile.inc Sun Apr 12 06:45:40 2015 (r281453) +++ stable/10/lib/libc/sys/Makefile.inc Sun Apr 12 06:52:43 2015 (r281454) @@ -47,6 +47,7 @@ INTERPOSED = \ fcntl \ fsync \ fork \ + kevent \ msync \ nanosleep \ open \ Modified: stable/10/lib/libc/sys/interposing_table.c ============================================================================== --- stable/10/lib/libc/sys/interposing_table.c Sun Apr 12 06:45:40 2015 (r281453) +++ stable/10/lib/libc/sys/interposing_table.c Sun Apr 12 06:52:43 2015 (r281454) @@ -75,6 +75,7 @@ interpos_func_t __libc_interposing[INTER SLOT(_pthread_mutex_init_calloc_cb, _pthread_mutex_init_calloc_cb_stub), SLOT(spinlock, __libc_spinlock_stub), SLOT(spinunlock, __libc_spinunlock_stub), + SLOT(kevent, __sys_kevent), }; #undef SLOT Copied: stable/10/lib/libc/sys/kevent.c (from r280818, head/lib/libc/sys/kevent.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/sys/kevent.c Sun Apr 12 06:52:43 2015 (r281454, copy of r280818, head/lib/libc/sys/kevent.c) @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "libc_private.h" + +__weak_reference(__sys_kevent, __kevent); + +#pragma weak kevent +int +kevent(int kq, const struct kevent *changelist, int nchanges, + struct kevent *eventlist, int nevents, const struct timespec *timeout) +{ + + return (((int (*)(int, const struct kevent *, int, + struct kevent *, int, const struct timespec *)) + __libc_interposing[INTERPOS_kevent])(kq, changelist, nchanges, + eventlist, nevents, timeout)); +} Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Sun Apr 12 06:45:40 2015 (r281453) +++ stable/10/lib/libc/sys/kqueue.2 Sun Apr 12 06:52:43 2015 (r281454) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2014 +.Dd March 29, 2015 .Dt KQUEUE 2 .Os .Sh NAME @@ -41,7 +41,7 @@ .Fn kqueue "void" .Ft int .Fn kevent "int kq" "const struct kevent *changelist" "int nchanges" "struct kevent *eventlist" "int nevents" "const struct timespec *timeout" -.Fn EV_SET "&kev" ident filter flags fflags data udata +.Fn EV_SET "kev" ident filter flags fflags data udata .Sh DESCRIPTION The .Fn kqueue @@ -532,6 +532,16 @@ On return, .Va fflags contains the users defined flags in the lower 24 bits. .El +.Sh CANCELLATION BEHAVIOUR +If +.Fa nevents +is non-zero, i.e. the function is potentially blocking, the call +is a cancellation point. +Otherwise, i.e. if +.Fa nevents +is zero, the call is not cancellable. +Cancellation can only occur before any changes are made to the kqueue, +or when the call was blocked and no changes to the queue were requested. .Sh RETURN VALUES The .Fn kqueue @@ -595,6 +605,8 @@ The specified descriptor is invalid. .It Bq Er EINTR A signal was delivered before the timeout expired and before any events were placed on the kqueue for return. +.It Bq Er EINTR +A cancellation request was delivered to the thread, but not yet handled. .It Bq Er EINVAL The specified time limit or filter is invalid. .It Bq Er ENOENT @@ -609,6 +621,14 @@ sysctl. .It Bq Er ESRCH The specified process to attach to does not exist. .El +.Pp +When +.Fn kevent +call fails with +.Er EINTR +error, all changes in the +.Fa changelist +have been applied. .Sh SEE ALSO .Xr aio_error 2 , .Xr aio_read 2 , @@ -618,6 +638,7 @@ The specified process to attach to does .Xr select 2 , .Xr sigaction 2 , .Xr write 2 , +.Xr pthread_setcancelstate 3 , .Xr signal 3 .Sh HISTORY The Modified: stable/10/lib/libthr/thread/thr_syscalls.c ============================================================================== --- stable/10/lib/libthr/thread/thr_syscalls.c Sun Apr 12 06:45:40 2015 (r281453) +++ stable/10/lib/libthr/thread/thr_syscalls.c Sun Apr 12 06:52:43 2015 (r281454) @@ -341,6 +341,29 @@ __thr_pselect(int count, fd_set *rfds, f return (ret); } +static int +__thr_kevent(int kq, const struct kevent *changelist, int nchanges, + struct kevent *eventlist, int nevents, const struct timespec *timeout) +{ + struct pthread *curthread; + int ret; + + if (nevents == 0) { + /* + * No blocking, do not make the call cancellable. + */ + return (__sys_kevent(kq, changelist, nchanges, eventlist, + nevents, timeout)); + } + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_kevent(kq, changelist, nchanges, eventlist, nevents, + timeout); + _thr_cancel_leave(curthread, ret == -1 && nchanges == 0); + + return (ret); +} + /* * Cancellation behavior: * Thread may be canceled at start, but if the system call got some data, @@ -599,6 +622,7 @@ __thr_interpose_libc(void) SLOT(writev); SLOT(spinlock); SLOT(spinunlock); + SLOT(kevent); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = Modified: stable/10/share/man/man3/pthread_testcancel.3 ============================================================================== --- stable/10/share/man/man3/pthread_testcancel.3 Sun Apr 12 06:45:40 2015 (r281453) +++ stable/10/share/man/man3/pthread_testcancel.3 Sun Apr 12 06:52:43 2015 (r281454) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 11, 2013 +.Dd March 29, 2015 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -107,6 +107,7 @@ functions: .Fn close , .Fn creat , .Fn fsync , +.Fn kevent , .Fn mq_receive , .Fn mq_send , .Fn mq_timedreceive , @@ -147,12 +148,20 @@ functions: .Fn waitpid , .Fn write , .Fn writev . +.Pp The .Fn fcntl function is a cancellation point if .Fa cmd is .Dv F_SETLKW . +.Pp +The +.Fn kevent +function is a cancellation point if it is potentially blocking, +i.e. when the +.Fa nevents +argument is non-zero. .Sh RETURN VALUES If successful, the .Fn pthread_setcancelstate From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 06:54:54 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A458EFD; Sun, 12 Apr 2015 06:54:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54C813E5; Sun, 12 Apr 2015 06:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C6ssh0009882; Sun, 12 Apr 2015 06:54:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C6ssb8009881; Sun, 12 Apr 2015 06:54:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504120654.t3C6ssb8009881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Apr 2015 06:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281455 - stable/10/share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 06:54:54 -0000 Author: kib Date: Sun Apr 12 06:54:53 2015 New Revision: 281455 URL: https://svnweb.freebsd.org/changeset/base/281455 Log: MFC r280819: Formatting changes to the pthread_testcancel(3). Modified: stable/10/share/man/man3/pthread_testcancel.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man3/pthread_testcancel.3 ============================================================================== --- stable/10/share/man/man3/pthread_testcancel.3 Sun Apr 12 06:52:43 2015 (r281454) +++ stable/10/share/man/man3/pthread_testcancel.3 Sun Apr 12 06:54:53 2015 (r281455) @@ -100,77 +100,70 @@ type will be in effect. .Ss Cancellation Points Cancellation points will occur when a thread is executing the following functions: -.Fn accept , -.Fn accept4 , -.Fn aio_suspend , -.Fn connect , -.Fn close , -.Fn creat , -.Fn fsync , -.Fn kevent , -.Fn mq_receive , -.Fn mq_send , -.Fn mq_timedreceive , -.Fn mq_timedsend , -.Fn msync , -.Fn nanosleep , -.Fn open , -.Fn openat , -.Fn pause , -.Fn poll , -.Fn pselect , -.Fn pthread_cond_timedwait , -.Fn pthread_cond_wait , -.Fn pthread_join , -.Fn pthread_testcancel , -.Fn read , -.Fn readv , -.Fn recv , -.Fn recvfrom , -.Fn recvmsg , -.Fn select , -.Fn sem_timedwait , -.Fn sem_wait , -.Fn send , -.Fn sendmsg , -.Fn sendto , -.Fn sigsuspend , -.Fn sigtimedwait , -.Fn sigwaitinfo , -.Fn sigwait , -.Fn sleep , -.Fn system , -.Fn tcdrain , -.Fn usleep , -.Fn wait , -.Fn wait3 , -.Fn wait4 , -.Fn waitpid , -.Fn write , -.Fn writev . -.Pp +.Bl -tag -width "Fn pthread_cond_timedwait" -compact +.It Fn accept +.It Fn accept4 +.It Fn aio_suspend +.It Fn connect +.It Fn close +.It Fn creat +.It Fn fcntl The .Fn fcntl function is a cancellation point if .Fa cmd is .Dv F_SETLKW . -.Pp +.It Fn fsync +.It Fn kevent The .Fn kevent function is a cancellation point if it is potentially blocking, i.e. when the .Fa nevents argument is non-zero. -.Sh RETURN VALUES -If successful, the -.Fn pthread_setcancelstate -and -.Fn pthread_setcanceltype -functions will return zero. -Otherwise, an error number shall be returned to -indicate the error. -.Pp +.It Fn mq_receive +.It Fn mq_send +.It Fn mq_timedreceive +.It Fn mq_timedsend +.It Fn msync +.It Fn nanosleep +.It Fn open +.It Fn openat +.It Fn pause +.It Fn poll +.It Fn pselect +.It Fn pthread_cond_timedwait +.It Fn pthread_cond_wait +.It Fn pthread_join +.It Fn pthread_testcancel +.It Fn read +.It Fn readv +.It Fn recv +.It Fn recvfrom +.It Fn recvmsg +.It Fn select +.It Fn sem_timedwait +.It Fn sem_wait +.It Fn send +.It Fn sendmsg +.It Fn sendto +.It Fn sigsuspend +.It Fn sigtimedwait +.It Fn sigwaitinfo +.It Fn sigwait +.It Fn sleep +.It Fn system +.It Fn tcdrain +.It Fn usleep +.It Fn wait +.It Fn wait3 +.It Fn wait4 +.It Fn waitpid +.It Fn write +.It Fn writev +.El +.Sh NOTES The .Fn pthread_setcancelstate and @@ -212,6 +205,14 @@ entry to the object. .Pp Finally, only functions that are cancel-safe may be called from a thread that is asynchronously cancelable. +.Sh RETURN VALUES +If successful, the +.Fn pthread_setcancelstate +and +.Fn pthread_setcanceltype +functions will return zero. +Otherwise, an error number shall be returned to +indicate the error. .Sh ERRORS The function .Fn pthread_setcancelstate From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 07:03:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90A1A31B; Sun, 12 Apr 2015 07:03:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B53A6B8; Sun, 12 Apr 2015 07:03:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C73Run014615; Sun, 12 Apr 2015 07:03:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C73Rtg014614; Sun, 12 Apr 2015 07:03:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504120703.t3C73Rtg014614@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Apr 2015 07:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281456 - stable/10/sys/fs/msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 07:03:27 -0000 Author: kib Date: Sun Apr 12 07:03:26 2015 New Revision: 281456 URL: https://svnweb.freebsd.org/changeset/base/281456 Log: MFC r281120: Assert that an msdosfs mount is not read-only when FAT modifications are requested. Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_fat.c Sun Apr 12 06:54:53 2015 (r281455) +++ stable/10/sys/fs/msdosfs/msdosfs_fat.c Sun Apr 12 07:03:26 2015 (r281456) @@ -399,6 +399,8 @@ usemap_alloc(pmp, cn) MSDOSFS_ASSERT_MP_LOCKED(pmp); + KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, + ("usemap_alloc on ro msdosfs mount")); KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) == 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); @@ -415,6 +417,8 @@ usemap_free(pmp, cn) { MSDOSFS_ASSERT_MP_LOCKED(pmp); + KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, + ("usemap_free on ro msdosfs mount")); pmp->pm_freeclustercount++; pmp->pm_flags |= MSDOSFS_FSIMOD; KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) @@ -715,6 +719,8 @@ chainalloc(pmp, start, count, fillwith, u_long cl, n; MSDOSFS_ASSERT_MP_LOCKED(pmp); + KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, + ("chainalloc on ro msdosfs mount")); for (cl = start, n = count; n-- > 0;) usemap_alloc(pmp, cl++); From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 07:05:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 975E946A; Sun, 12 Apr 2015 07:05:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 827F26C9; Sun, 12 Apr 2015 07:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C75LaV014931; Sun, 12 Apr 2015 07:05:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C75LlF014930; Sun, 12 Apr 2015 07:05:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504120705.t3C75LlF014930@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Apr 2015 07:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281457 - stable/10/sys/fs/msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 07:05:21 -0000 Author: kib Date: Sun Apr 12 07:05:20 2015 New Revision: 281457 URL: https://svnweb.freebsd.org/changeset/base/281457 Log: MFC r281121: Do not call msdosfs_sync() on the read-only msdosfs mounts. PR: 199152 Modified: stable/10/sys/fs/msdosfs/msdosfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_vfsops.c Sun Apr 12 07:03:26 2015 (r281456) +++ stable/10/sys/fs/msdosfs/msdosfs_vfsops.c Sun Apr 12 07:05:20 2015 (r281457) @@ -796,17 +796,17 @@ msdosfs_unmount(struct mount *mp, int mn struct msdosfsmount *pmp; int error, flags; - flags = 0; - error = msdosfs_sync(mp, MNT_WAIT); - if ((mntflags & MNT_FORCE) != 0) { + error = flags = 0; + pmp = VFSTOMSDOSFS(mp); + if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) + error = msdosfs_sync(mp, MNT_WAIT); + if ((mntflags & MNT_FORCE) != 0) flags |= FORCECLOSE; - } else if (error != 0) { + else if (error != 0) return (error); - } error = vflush(mp, 0, flags, curthread); if (error != 0 && error != ENXIO) return (error); - pmp = VFSTOMSDOSFS(mp); if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); if (error && error != ENXIO) { From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 07:24:11 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15E467DA; Sun, 12 Apr 2015 07:24:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00D90904; Sun, 12 Apr 2015 07:24:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C7OA3X024127; Sun, 12 Apr 2015 07:24:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C7OAAO024126; Sun, 12 Apr 2015 07:24:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201504120724.t3C7OAAO024126@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 12 Apr 2015 07:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281458 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 07:24:11 -0000 Author: dchagin Date: Sun Apr 12 07:24:10 2015 New Revision: 281458 URL: https://svnweb.freebsd.org/changeset/base/281458 Log: MFC r281113: Fix wrong kassert msg in uma. PR: 199172 Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sun Apr 12 07:05:20 2015 (r281457) +++ stable/10/sys/vm/uma_core.c Sun Apr 12 07:24:10 2015 (r281458) @@ -3029,7 +3029,7 @@ uma_zone_set_fini(uma_zone_t zone, uma_f uma_keg_t keg; keg = zone_first_keg(zone); - KASSERT(keg != NULL, ("uma_zone_set_init: Invalid zone type")); + KASSERT(keg != NULL, ("uma_zone_set_fini: Invalid zone type")); KEG_LOCK(keg); KASSERT(keg->uk_pages == 0, ("uma_zone_set_fini on non-empty keg")); @@ -3069,7 +3069,7 @@ uma_zone_set_freef(uma_zone_t zone, uma_ uma_keg_t keg; keg = zone_first_keg(zone); - KASSERT(keg != NULL, ("uma_zone_set_init: Invalid zone type")); + KASSERT(keg != NULL, ("uma_zone_set_freef: Invalid zone type")); KEG_LOCK(keg); keg->uk_freef = freef; KEG_UNLOCK(keg); From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 21:28:56 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25BD0C20; Sun, 12 Apr 2015 21:28:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11020A5C; Sun, 12 Apr 2015 21:28:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CLStm3024114; Sun, 12 Apr 2015 21:28:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CLSttK024113; Sun, 12 Apr 2015 21:28:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504122128.t3CLSttK024113@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 12 Apr 2015 21:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281471 - stable/10/usr.sbin/arp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 21:28:56 -0000 Author: markj Date: Sun Apr 12 21:28:54 2015 New Revision: 281471 URL: https://svnweb.freebsd.org/changeset/base/281471 Log: MFC r280998: arp(8): add support for printing and deleting entries of type IFT_INFINIBAND, used in IPoIB. PR: 151594 Modified: stable/10/usr.sbin/arp/arp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/arp/arp.c ============================================================================== --- stable/10/usr.sbin/arp/arp.c Sun Apr 12 21:14:58 2015 (r281470) +++ stable/10/usr.sbin/arp/arp.c Sun Apr 12 21:28:54 2015 (r281471) @@ -282,6 +282,7 @@ valid_type(int type) switch (type) { case IFT_ETHER: case IFT_FDDI: + case IFT_INFINIBAND: case IFT_ISO88023: case IFT_ISO88024: case IFT_ISO88025: @@ -656,6 +657,9 @@ print_entry(struct sockaddr_dl *sdl, case IFT_BRIDGE: printf(" [bridge]"); break; + case IFT_INFINIBAND: + printf(" [infiniband]"); + break; default: break; } From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 21:35:14 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 450D5E7F; Sun, 12 Apr 2015 21:35:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB09B82; Sun, 12 Apr 2015 21:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CLZEAV028662; Sun, 12 Apr 2015 21:35:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CLZDD3028661; Sun, 12 Apr 2015 21:35:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504122135.t3CLZDD3028661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 12 Apr 2015 21:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281472 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 21:35:14 -0000 Author: markj Date: Sun Apr 12 21:35:13 2015 New Revision: 281472 URL: https://svnweb.freebsd.org/changeset/base/281472 Log: MFC r278114: libdtrace: Let the standard deviation of the empty set be 0. PR: 197260 Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Apr 12 21:28:54 2015 (r281471) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Apr 12 21:35:13 2015 (r281472) @@ -382,6 +382,9 @@ dt_stddev(uint64_t *data, uint64_t norma int64_t norm_avg; uint64_t diff[2]; + if (data[0] == 0) + return (0); + /* * The standard approximation for standard deviation is * sqrt(average(x**2) - average(x)**2), i.e. the square root From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 21:38:19 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 775E9FCE; Sun, 12 Apr 2015 21:38:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61F8AB9D; Sun, 12 Apr 2015 21:38:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CLcJi9029114; Sun, 12 Apr 2015 21:38:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CLcJhF029113; Sun, 12 Apr 2015 21:38:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504122138.t3CLcJhF029113@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 12 Apr 2015 21:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281473 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 21:38:19 -0000 Author: markj Date: Sun Apr 12 21:38:18 2015 New Revision: 281473 URL: https://svnweb.freebsd.org/changeset/base/281473 Log: MFC r280882: Fix a misparenthesization that could cause a crash if TERM is not set. Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Apr 12 21:35:13 2015 (r281472) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Apr 12 21:38:18 2015 (r281473) @@ -727,8 +727,8 @@ dt_print_packed(dtrace_hdl_t *dtp, FILE utf8 = B_TRUE; } else if ((term = getenv("TERM")) != NULL && (strcmp(term, "sun") == 0 || - strcmp(term, "sun-color") == 0) || - strcmp(term, "dumb") == 0) { + strcmp(term, "sun-color") == 0 || + strcmp(term, "dumb") == 0)) { utf8 = B_FALSE; } else { utf8 = B_TRUE; From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 12 21:45:35 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BCD52DC; Sun, 12 Apr 2015 21:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BE06C72; Sun, 12 Apr 2015 21:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CLjZGu033632; Sun, 12 Apr 2015 21:45:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CLjZdg033631; Sun, 12 Apr 2015 21:45:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504122145.t3CLjZdg033631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 12 Apr 2015 21:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281474 - stable/10/cddl/contrib/opensolaris/common/ctf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 21:45:35 -0000 Author: markj Date: Sun Apr 12 21:45:34 2015 New Revision: 281474 URL: https://svnweb.freebsd.org/changeset/base/281474 Log: MFC r279862: Fix a possible infinite loop in ctf_discard(). MFC r279864: Use CTF_TYPE_TO_INDEX when comparing type indices to the dynamic type threshold. MFC r279869: If the destination container contains only a forward declaration for the input type in ctf_add_type(), search its dynamic type list before adding a new type. Modified: stable/10/cddl/contrib/opensolaris/common/ctf/ctf_create.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/common/ctf/ctf_create.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/common/ctf/ctf_create.c Sun Apr 12 21:38:18 2015 (r281473) +++ stable/10/cddl/contrib/opensolaris/common/ctf/ctf_create.c Sun Apr 12 21:45:34 2015 (r281474) @@ -583,10 +583,10 @@ ctf_discard(ctf_file_t *fp) return (0); /* no update required */ for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { - if (dtd->dtd_type <= fp->ctf_dtoldid) + ntd = ctf_list_prev(dtd); + if (CTF_TYPE_TO_INDEX(dtd->dtd_type) <= fp->ctf_dtoldid) continue; /* skip types that have been committed */ - ntd = ctf_list_prev(dtd); ctf_dtd_delete(fp, dtd); } @@ -1313,10 +1313,13 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil * unless dst_type is a forward declaration and src_type is a struct, * union, or enum (i.e. the definition of the previous forward decl). */ - if (dst_type != CTF_ERR && dst_kind != kind && ( - dst_kind != CTF_K_FORWARD || (kind != CTF_K_ENUM && - kind != CTF_K_STRUCT && kind != CTF_K_UNION))) - return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + if (dst_type != CTF_ERR && dst_kind != kind) { + if (dst_kind != CTF_K_FORWARD || (kind != CTF_K_ENUM && + kind != CTF_K_STRUCT && kind != CTF_K_UNION)) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + else + dst_type = CTF_ERR; + } /* * If the non-empty name was not found in the appropriate hash, search @@ -1328,7 +1331,7 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil */ if (dst_type == CTF_ERR && name[0] != '\0') { for (dtd = ctf_list_prev(&dst_fp->ctf_dtdefs); dtd != NULL && - dtd->dtd_type > dst_fp->ctf_dtoldid; + CTF_TYPE_TO_INDEX(dtd->dtd_type) > dst_fp->ctf_dtoldid; dtd = ctf_list_prev(dtd)) { if (CTF_INFO_KIND(dtd->dtd_data.ctt_info) == kind && dtd->dtd_name != NULL && From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 01:01:18 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B399EE48; Mon, 13 Apr 2015 01:01:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D422D7; Mon, 13 Apr 2015 01:01:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D11IRo027989; Mon, 13 Apr 2015 01:01:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D11Hsh027987; Mon, 13 Apr 2015 01:01:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504130101.t3D11Hsh027987@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 13 Apr 2015 01:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281480 - in stable/10/sys: dev/iwn net80211 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 01:01:18 -0000 Author: eadler Date: Mon Apr 13 01:01:17 2015 New Revision: 281480 URL: https://svnweb.freebsd.org/changeset/base/281480 Log: MFC r281383: iwn, wlan: fix typos Fxi tow typos Modified: stable/10/sys/dev/iwn/if_iwn.c stable/10/sys/net80211/ieee80211_mesh.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/10/sys/dev/iwn/if_iwn.c Mon Apr 13 00:03:03 2015 (r281479) +++ stable/10/sys/dev/iwn/if_iwn.c Mon Apr 13 01:01:17 2015 (r281480) @@ -6813,7 +6813,7 @@ iwn_read_firmware_tlv(struct iwn_softc * case IWN_FW_TLV_WOWLAN_INST: case IWN_FW_TLV_WOWLAN_DATA: DPRINTF(sc, IWN_DEBUG_RESET, - "TLV type %d reconized but not handled\n", + "TLV type %d recognized but not handled\n", le16toh(tlv->type)); break; default: Modified: stable/10/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/10/sys/net80211/ieee80211_mesh.c Mon Apr 13 00:03:03 2015 (r281479) +++ stable/10/sys/net80211/ieee80211_mesh.c Mon Apr 13 01:01:17 2015 (r281480) @@ -125,7 +125,7 @@ static int ieee80211_mesh_backofftimeout SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, backofftimeout, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_mesh_backofftimeout, 0, ieee80211_sysctl_msecs_ticks, "I", "Backoff timeout (msec). This is to throutles peering forever when " - "not receving answer or is rejected by a neighbor"); + "not receiving answer or is rejected by a neighbor"); static int ieee80211_mesh_maxretries = 2; SYSCTL_INT(_net_wlan_mesh, OID_AUTO, maxretries, CTLFLAG_RW, &ieee80211_mesh_maxretries, 0, From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 01:19:23 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90A24C2; Mon, 13 Apr 2015 01:19:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ADB31DF; Mon, 13 Apr 2015 01:19:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D1JMcP034626; Mon, 13 Apr 2015 01:19:22 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D1JMgu034625; Mon, 13 Apr 2015 01:19:22 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504130119.t3D1JMgu034625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 13 Apr 2015 01:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281481 - stable/10/sys/dev/ichsmb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 01:19:23 -0000 Author: rpaulo Date: Mon Apr 13 01:19:22 2015 New Revision: 281481 URL: https://svnweb.freebsd.org/changeset/base/281481 Log: MFC r281136: ichsmb: add a device id for the Wildcat Point-LP. Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/10/sys/dev/ichsmb/ichsmb_pci.c Mon Apr 13 01:01:17 2015 (r281480) +++ stable/10/sys/dev/ichsmb/ichsmb_pci.c Mon Apr 13 01:19:22 2015 (r281481) @@ -86,9 +86,10 @@ __FBSDID("$FreeBSD$"); #define ID_CPT 0x1c228086 #define ID_PPT 0x1e228086 #define ID_AVOTON 0x1f3c8086 -#define ID_COLETOCRK 0x23B08086 +#define ID_COLETOCRK 0x23B08086 #define ID_LPT 0x8c228086 #define ID_WCPT 0x8ca28086 +#define ID_WCPTLP 0x9ca28086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -201,6 +202,9 @@ ichsmb_pci_probe(device_t dev) case ID_WCPT: device_set_desc(dev, "Intel Wildcat Point SMBus controller"); break; + case ID_WCPTLP: + device_set_desc(dev, "Intel Wildcat Point-LP SMBus controller"); + break; case ID_COLETOCRK: device_set_desc(dev, "Intel Coleto Creek SMBus controller"); break; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 01:42:26 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BAEA505; Mon, 13 Apr 2015 01:42:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5581165D; Mon, 13 Apr 2015 01:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D1gQ4v047670; Mon, 13 Apr 2015 01:42:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D1gPA0047667; Mon, 13 Apr 2015 01:42:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504130142.t3D1gPA0047667@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 Apr 2015 01:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281482 - in stable/10/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 01:42:26 -0000 Author: markj Date: Mon Apr 13 01:42:24 2015 New Revision: 281482 URL: https://svnweb.freebsd.org/changeset/base/281482 Log: MFC r280834: Bound the number of frames traversed when executing the ustackdepth action. Modified: stable/10/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/10/sys/cddl/dev/dtrace/i386/dtrace_isa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Mon Apr 13 01:19:22 2015 (r281481) +++ stable/10/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Mon Apr 13 01:42:24 2015 (r281482) @@ -49,6 +49,8 @@ uint16_t dtrace_fuword16_nocheck(void *) uint32_t dtrace_fuword32_nocheck(void *); uint64_t dtrace_fuword64_nocheck(void *); +int dtrace_ustackdepth_max = 2048; + void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) @@ -102,14 +104,25 @@ static int dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, uintptr_t sp) { + uintptr_t oldsp; volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; int ret = 0; ASSERT(pcstack == NULL || pcstack_limit > 0); + ASSERT(dtrace_ustackdepth_max > 0); while (pc != 0) { - ret++; + /* + * We limit the number of times we can go around this + * loop to account for a circular stack. + */ + if (ret++ >= dtrace_ustackdepth_max) { + *flags |= CPU_DTRACE_BADSTACK; + cpu_core[curcpu].cpuc_dtrace_illval = sp; + break; + } + if (pcstack != NULL) { *pcstack++ = (uint64_t)pc; pcstack_limit--; @@ -120,10 +133,18 @@ dtrace_getustack_common(uint64_t *pcstac if (sp == 0) break; + oldsp = sp; + pc = dtrace_fuword64((void *)(sp + offsetof(struct amd64_frame, f_retaddr))); sp = dtrace_fuword64((void *)sp); + if (sp == oldsp) { + *flags |= CPU_DTRACE_BADSTACK; + cpu_core[curcpu].cpuc_dtrace_illval = sp; + break; + } + /* * This is totally bogus: if we faulted, we're going to clear * the fault and break. This is to deal with the apparently Modified: stable/10/sys/cddl/dev/dtrace/i386/dtrace_isa.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/i386/dtrace_isa.c Mon Apr 13 01:19:22 2015 (r281481) +++ stable/10/sys/cddl/dev/dtrace/i386/dtrace_isa.c Mon Apr 13 01:42:24 2015 (r281482) @@ -55,6 +55,8 @@ uint16_t dtrace_fuword16_nocheck(void *) uint32_t dtrace_fuword32_nocheck(void *); uint64_t dtrace_fuword64_nocheck(void *); +int dtrace_ustackdepth_max = 2048; + void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) @@ -113,11 +115,13 @@ dtrace_getustack_common(uint64_t *pcstac uintptr_t oldcontext = lwp->lwp_oldcontext; /* XXX signal stack. */ size_t s1, s2; #endif + uintptr_t oldsp; volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; int ret = 0; ASSERT(pcstack == NULL || pcstack_limit > 0); + ASSERT(dtrace_ustackdepth_max > 0); #ifdef notyet /* XXX signal stack. */ if (p->p_model == DATAMODEL_NATIVE) { @@ -130,7 +134,16 @@ dtrace_getustack_common(uint64_t *pcstac #endif while (pc != 0) { - ret++; + /* + * We limit the number of times we can go around this + * loop to account for a circular stack. + */ + if (ret++ >= dtrace_ustackdepth_max) { + *flags |= CPU_DTRACE_BADSTACK; + cpu_core[curcpu].cpuc_dtrace_illval = sp; + break; + } + if (pcstack != NULL) { *pcstack++ = (uint64_t)pc; pcstack_limit--; @@ -141,6 +154,8 @@ dtrace_getustack_common(uint64_t *pcstac if (sp == 0) break; + oldsp = sp; + #ifdef notyet /* XXX signal stack. */ if (oldcontext == sp + s1 || oldcontext == sp + s2) { if (p->p_model == DATAMODEL_NATIVE) { @@ -179,6 +194,12 @@ dtrace_getustack_common(uint64_t *pcstac sp = dtrace_fuword32((void *)sp); #endif /* ! notyet */ + if (sp == oldsp) { + *flags |= CPU_DTRACE_BADSTACK; + cpu_core[curcpu].cpuc_dtrace_illval = sp; + break; + } + /* * This is totally bogus: if we faulted, we're going to clear * the fault and break. This is to deal with the apparently From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 08:35:05 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24BF4926; Mon, 13 Apr 2015 08:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C3E610; Mon, 13 Apr 2015 08:35:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D8Z4nw045381; Mon, 13 Apr 2015 08:35:04 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D8Z41j045375; Mon, 13 Apr 2015 08:35:04 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201504130835.t3D8Z41j045375@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Mon, 13 Apr 2015 08:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281486 - in stable/10/libexec/rtld-elf: . ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 08:35:05 -0000 Author: peter Date: Mon Apr 13 08:35:03 2015 New Revision: 281486 URL: https://svnweb.freebsd.org/changeset/base/281486 Log: MFC r268182: Initialize page sizes early for ia64. Modified: stable/10/libexec/rtld-elf/ia64/rtld_machdep.h stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/ia64/rtld_machdep.h ============================================================================== --- stable/10/libexec/rtld-elf/ia64/rtld_machdep.h Mon Apr 13 04:48:13 2015 (r281485) +++ stable/10/libexec/rtld-elf/ia64/rtld_machdep.h Mon Apr 13 08:35:03 2015 (r281486) @@ -69,4 +69,6 @@ extern void *__tls_get_addr(unsigned lon #define RTLD_DEFAULT_STACK_PF_EXEC 0 #define RTLD_DEFAULT_STACK_EXEC 0 +#define RTLD_INIT_PAGESIZES_EARLY 1 + #endif Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Mon Apr 13 04:48:13 2015 (r281485) +++ stable/10/libexec/rtld-elf/rtld.c Mon Apr 13 08:35:03 2015 (r281486) @@ -1807,6 +1807,11 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; +#ifdef RTLD_INIT_PAGESIZES_EARLY + /* The page size is required by the dynamic memory allocator. */ + init_pagesizes(aux_info); +#endif + /* * Conjure up an Obj_Entry structure for the dynamic linker. * @@ -1843,8 +1848,10 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * /* Now that non-local variables can be accesses, copy out obj_rtld. */ memcpy(&obj_rtld, &objtmp, sizeof(obj_rtld)); +#ifndef RTLD_INIT_PAGESIZES_EARLY /* The page size is required by the dynamic memory allocator. */ init_pagesizes(aux_info); +#endif if (aux_info[AT_OSRELDATE] != NULL) osreldate = aux_info[AT_OSRELDATE]->a_un.a_val; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 09:17:58 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1EC831F; Mon, 13 Apr 2015 09:17:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD379A42; Mon, 13 Apr 2015 09:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D9Hwre067849; Mon, 13 Apr 2015 09:17:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D9HwYA067848; Mon, 13 Apr 2015 09:17:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504130917.t3D9HwYA067848@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 13 Apr 2015 09:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281487 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 09:17:58 -0000 Author: mav Date: Mon Apr 13 09:17:57 2015 New Revision: 281487 URL: https://svnweb.freebsd.org/changeset/base/281487 Log: MFC r280850: Periodically wake up threads waiting for vmem(9) resources, so they could ask for resource reclamation again. This is kind of dirty hack, but as last resort this is better then stuck indefinitely because of KVA fragmentation, waiting until some random event free something sufficient. OpenSolaris also has this hack in its vmem(9). Modified: stable/10/sys/kern/subr_vmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Mon Apr 13 08:35:03 2015 (r281486) +++ stable/10/sys/kern/subr_vmem.c Mon Apr 13 09:17:57 2015 (r281487) @@ -746,6 +746,12 @@ vmem_periodic(void *unused, int pending) /* Grow in powers of two. Shrink less aggressively. */ if (desired >= current * 2 || desired * 4 <= current) vmem_rehash(vm, desired); + + /* + * Periodically wake up threads waiting for resources, + * so they could ask for reclamation again. + */ + VMEM_CONDVAR_BROADCAST(vm); } mtx_unlock(&vmem_list_lock); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 09:18:57 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EBFC460; Mon, 13 Apr 2015 09:18:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0A4A50; Mon, 13 Apr 2015 09:18:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D9IuMZ068104; Mon, 13 Apr 2015 09:18:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D9IunZ068103; Mon, 13 Apr 2015 09:18:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504130918.t3D9IunZ068103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 13 Apr 2015 09:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281488 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 09:18:57 -0000 Author: mav Date: Mon Apr 13 09:18:56 2015 New Revision: 281488 URL: https://svnweb.freebsd.org/changeset/base/281488 Log: MFC r281163: Make ctld to not exit on ECONNABORTED on accept(). That is not really an error for the main process. Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Mon Apr 13 09:17:57 2015 (r281487) +++ stable/10/usr.sbin/ctld/ctld.c Mon Apr 13 09:18:56 2015 (r281488) @@ -2382,8 +2382,11 @@ found: client_fd = accept(portal->p_socket, (struct sockaddr *)&client_sa, &client_salen); - if (client_fd < 0) + if (client_fd < 0) { + if (errno == ECONNABORTED) + continue; log_err(1, "accept"); + } assert(client_salen >= client_sa.ss_len); handle_connection(portal, client_fd, From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 22:22:33 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60583294; Mon, 13 Apr 2015 22:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3047A1D0; Mon, 13 Apr 2015 22:22:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DMMXIc054854; Mon, 13 Apr 2015 22:22:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DMMXJt054853; Mon, 13 Apr 2015 22:22:33 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201504132222.t3DMMXJt054853@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 13 Apr 2015 22:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281505 - in stable: 10/usr.sbin/acpi/acpidump 8/usr.sbin/acpi/acpidump 9/usr.sbin/acpi/acpidump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 22:22:33 -0000 Author: jkim Date: Mon Apr 13 22:22:32 2015 New Revision: 281505 URL: https://svnweb.freebsd.org/changeset/base/281505 Log: MFC: r281331 Do not crash when RSDT/XSDT contains an empty entry. Modified: stable/10/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.sbin/acpi/acpidump/acpi.c stable/9/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/8/usr.sbin/acpi/acpidump/ (props changed) stable/9/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/10/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/10/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 21:33:49 2015 (r281504) +++ stable/10/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 22:22:32 2015 (r281505) @@ -1084,17 +1084,10 @@ acpi_print_rsdt(ACPI_TABLE_HEADER *rsdp) for (i = 0; i < entries; i++) { if (i > 0) printf(", "); - switch (addr_size) { - case 4: + if (addr_size == 4) addr = le32toh(rsdt->TableOffsetEntry[i]); - break; - case 8: + else addr = le64toh(xsdt->TableOffsetEntry[i]); - break; - default: - addr = 0; - } - assert(addr != 0); printf("0x%08lx", addr); } printf(" }\n"); @@ -1341,17 +1334,12 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp xsdt = (ACPI_TABLE_XSDT *)rsdp; entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size; for (i = 0; i < entries; i++) { - switch (addr_size) { - case 4: + if (addr_size == 4) addr = le32toh(rsdt->TableOffsetEntry[i]); - break; - case 8: + else addr = le64toh(xsdt->TableOffsetEntry[i]); - break; - default: - assert((addr = 0)); - } - + if (addr == 0) + continue; sdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(addr); if (acpi_checksum(sdp, sdp->Length)) { warnx("RSDT entry %d (sig %.4s) is corrupt", i, @@ -1546,16 +1534,12 @@ sdt_from_rsdt(ACPI_TABLE_HEADER *rsdp, c xsdt = (ACPI_TABLE_XSDT *)rsdp; entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size; for (i = 0; i < entries; i++) { - switch (addr_size) { - case 4: + if (addr_size == 4) addr = le32toh(rsdt->TableOffsetEntry[i]); - break; - case 8: + else addr = le64toh(xsdt->TableOffsetEntry[i]); - break; - default: - assert((addr = 0)); - } + if (addr == 0) + continue; sdt = (ACPI_TABLE_HEADER *)acpi_map_sdt(addr); if (last != NULL) { if (sdt == last) From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 13 22:26:12 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5198782C; Mon, 13 Apr 2015 22:26:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34C4821E; Mon, 13 Apr 2015 22:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DMQCFs055610; Mon, 13 Apr 2015 22:26:12 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DMQCYp055609; Mon, 13 Apr 2015 22:26:12 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201504132226.t3DMQCYp055609@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 13 Apr 2015 22:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281506 - stable/10/usr.sbin/acpi/acpidump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 22:26:12 -0000 Author: jkim Date: Mon Apr 13 22:26:11 2015 New Revision: 281506 URL: https://svnweb.freebsd.org/changeset/base/281506 Log: MFC: r281335 Print 64-bit addresses clearly with leading zeros to avoid confusions. Modified: stable/10/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/10/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 22:22:32 2015 (r281505) +++ stable/10/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 22:26:11 2015 (r281506) @@ -168,12 +168,18 @@ acpi_print_gas(ACPI_GENERIC_ADDRESS *gas { switch(gas->SpaceId) { case ACPI_GAS_MEMORY: - printf("0x%08lx:%u[%u] (Memory)", (u_long)gas->Address, - gas->BitOffset, gas->BitWidth); + if (gas->BitWidth <= 32) + printf("0x%08x:%u[%u] (Memory)", + (u_int)gas->Address, gas->BitOffset, + gas->BitWidth); + else + printf("0x%016jx:%u[%u] (Memory)", + (uintmax_t)gas->Address, gas->BitOffset, + gas->BitWidth); break; case ACPI_GAS_IO: - printf("0x%02lx:%u[%u] (IO)", (u_long)gas->Address, - gas->BitOffset, gas->BitWidth); + printf("0x%02x:%u[%u] (IO)", (u_int)gas->Address, + gas->BitOffset, gas->BitWidth); break; case ACPI_GAS_PCI: printf("%x:%x+0x%x (PCI)", (uint16_t)(gas->Address >> 32), @@ -194,7 +200,7 @@ acpi_print_gas(ACPI_GENERIC_ADDRESS *gas case ACPI_GAS_DATATABLE: case ACPI_GAS_FIXED: default: - printf("0x%08lx (?)", (u_long)gas->Address); + printf("0x%016jx (?)", (uintmax_t)gas->Address); break; } } @@ -830,7 +836,7 @@ acpi_handle_dmar_drhd(ACPI_DMAR_HARDWARE #undef PRINTFLAG printf("\tSegment=%d\n", drhd->Segment); - printf("\tAddress=0x%0jx\n", (uintmax_t)drhd->Address); + printf("\tAddress=0x%016jx\n", (uintmax_t)drhd->Address); remaining = drhd->Header.Length - sizeof(ACPI_DMAR_HARDWARE_UNIT); if (remaining > 0) @@ -855,8 +861,8 @@ acpi_handle_dmar_rmrr(ACPI_DMAR_RESERVED printf("\tType=RMRR\n"); printf("\tLength=%d\n", rmrr->Header.Length); printf("\tSegment=%d\n", rmrr->Segment); - printf("\tBaseAddress=0x%0jx\n", (uintmax_t)rmrr->BaseAddress); - printf("\tLimitAddress=0x%0jx\n", (uintmax_t)rmrr->EndAddress); + printf("\tBaseAddress=0x%016jx\n", (uintmax_t)rmrr->BaseAddress); + printf("\tLimitAddress=0x%016jx\n", (uintmax_t)rmrr->EndAddress); remaining = rmrr->Header.Length - sizeof(ACPI_DMAR_RESERVED_MEMORY); if (remaining > 0) @@ -911,7 +917,7 @@ acpi_handle_dmar_rhsa(ACPI_DMAR_RHSA *rh printf("\n"); printf("\tType=RHSA\n"); printf("\tLength=%d\n", rhsa->Header.Length); - printf("\tBaseAddress=0x%0jx\n", (uintmax_t)rhsa->BaseAddress); + printf("\tBaseAddress=0x%016jx\n", (uintmax_t)rhsa->BaseAddress); printf("\tProximityDomain=0x%08x\n", rhsa->ProximityDomain); } @@ -1073,7 +1079,6 @@ acpi_print_rsdt(ACPI_TABLE_HEADER *rsdp) ACPI_TABLE_RSDT *rsdt; ACPI_TABLE_XSDT *xsdt; int i, entries; - u_long addr; rsdt = (ACPI_TABLE_RSDT *)rsdp; xsdt = (ACPI_TABLE_XSDT *)rsdp; @@ -1085,10 +1090,10 @@ acpi_print_rsdt(ACPI_TABLE_HEADER *rsdp) if (i > 0) printf(", "); if (addr_size == 4) - addr = le32toh(rsdt->TableOffsetEntry[i]); + printf("0x%08x", le32toh(rsdt->TableOffsetEntry[i])); else - addr = le64toh(xsdt->TableOffsetEntry[i]); - printf("0x%08lx", addr); + printf("0x%016jx", + (uintmax_t)le64toh(xsdt->TableOffsetEntry[i])); } printf(" }\n"); printf(END_COMMENT); @@ -1204,8 +1209,8 @@ acpi_print_fadt(ACPI_TABLE_HEADER *sdp) printf(", RESET_VALUE=%#x\n", fadt->ResetValue); } if (acpi_get_fadt_revision(fadt) > 1) { - printf("\tX_FACS=0x%08lx, ", (u_long)fadt->XFacs); - printf("X_DSDT=0x%08lx\n", (u_long)fadt->XDsdt); + printf("\tX_FACS=0x%016jx, ", (uintmax_t)fadt->XFacs); + printf("X_DSDT=0x%016jx\n", (uintmax_t)fadt->XDsdt); printf("\tX_PM1a_EVT_BLK="); acpi_print_gas(&fadt->XPm1aEventBlock); if (fadt->XPm1bEventBlock.Address != 0) { @@ -1260,10 +1265,9 @@ acpi_print_facs(ACPI_TABLE_FACS *facs) printf("S4BIOS"); printf("\n"); - if (facs->XFirmwareWakingVector != 0) { - printf("\tX_Firm_Wake_Vec=%08lx\n", - (u_long)facs->XFirmwareWakingVector); - } + if (facs->XFirmwareWakingVector != 0) + printf("\tX_Firm_Wake_Vec=%016jx\n", + (uintmax_t)facs->XFirmwareWakingVector); printf("\tVersion=%u\n", facs->Version); printf(END_COMMENT); @@ -1313,8 +1317,8 @@ acpi_print_rsd_ptr(ACPI_TABLE_RSDP *rp) printf("\tRSDT=0x%08x, cksum=%u\n", rp->RsdtPhysicalAddress, rp->Checksum); } else { - printf("\tXSDT=0x%08lx, length=%u, cksum=%u\n", - (u_long)rp->XsdtPhysicalAddress, rp->Length, + printf("\tXSDT=0x%016jx, length=%u, cksum=%u\n", + (uintmax_t)rp->XsdtPhysicalAddress, rp->Length, rp->ExtendedChecksum); } printf(END_COMMENT); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 14 00:27:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7156C64F; Tue, 14 Apr 2015 00:27:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42ECEB1; Tue, 14 Apr 2015 00:27:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3E0RsQT017748; Tue, 14 Apr 2015 00:27:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3E0RsfI017747; Tue, 14 Apr 2015 00:27:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504140027.t3E0RsfI017747@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 14 Apr 2015 00:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281512 - stable/10/sbin/md5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 00:27:55 -0000 Author: delphij Date: Tue Apr 14 00:27:54 2015 New Revision: 281512 URL: https://svnweb.freebsd.org/changeset/base/281512 Log: MFC r266417 (bjk): Assorted updates to md5.1 Note that the -c argument's parameter is compared against the digest of the file, not the file. [1] Update the "current time" parentheticals for notes about reversing and colliding the hash functions. [1] Some general mdoc updates. PR: docs/188043 [1] Submitted by: Jamie Landeg-Jones [1] Modified: stable/10/sbin/md5/md5.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/md5/md5.1 ============================================================================== --- stable/10/sbin/md5/md5.1 Tue Apr 14 00:02:39 2015 (r281511) +++ stable/10/sbin/md5/md5.1 Tue Apr 14 00:27:54 2015 (r281512) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 31, 2012 +.Dd May 17, 2014 .Dt MD5 1 .Os .Sh NAME @@ -63,12 +63,12 @@ concerned, and should not be relied upon This also means that .Tn MD5 should not be used as part of a cryptographic signature scheme. -At the current time (2009-01-06) there is no publicly known method to +At the current time (2014-05-17) there is no publicly known method to .Dq reverse MD5, i.e., to find an input given a hash value. .Pp .Tn SHA-1 -currently (2009-01-06) has no known collisions, but an attack has been +currently (2014-05-17) has no known collisions, but an attack has been found which is faster than a brute-force search, placing the security of .Tn SHA-1 in doubt. @@ -83,15 +83,15 @@ The hexadecimal checksum of each file li after the options are processed. .Bl -tag -width indent .It Fl c Ar string -Compare files to this md5 string. -(Note that this option is not yet useful if multiple files are specified.) +Compare the digest of the file against this string. +.Pq Note that this option is not yet useful if multiple files are specified. .It Fl s Ar string Print a checksum of the given .Ar string . .It Fl p Echo stdin to stdout and append the checksum to stdout. .It Fl q -Quiet mode - only the checksum is printed out. +Quiet mode \(em only the checksum is printed out. Overrides the .Fl r option. @@ -114,7 +114,9 @@ and .Nm rmd160 utilities exit 0 on success, 1 if at least one of the input files could not be read, -and 2 if at least one file does not have the same hash as the -c option. +and 2 if at least one file does not have the same hash as the +.Fl c +option. .Sh SEE ALSO .Xr cksum 1 , .Xr md5 3 , From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 14 00:32:04 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 695D77E4; Tue, 14 Apr 2015 00:32:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54BD5174; Tue, 14 Apr 2015 00:32:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3E0W4pe021853; Tue, 14 Apr 2015 00:32:04 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3E0W3II021851; Tue, 14 Apr 2015 00:32:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504140032.t3E0W3II021851@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 14 Apr 2015 00:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281513 - stable/10/sbin/md5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 00:32:04 -0000 Author: delphij Date: Tue Apr 14 00:32:03 2015 New Revision: 281513 URL: https://svnweb.freebsd.org/changeset/base/281513 Log: MFC r280716,280767,280914: - Correct type for checkAgainst. - Staticify flags that are not used outside the file scope. - Fix warnings. - Constify parameters. Modified: stable/10/sbin/md5/Makefile stable/10/sbin/md5/md5.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/md5/Makefile ============================================================================== --- stable/10/sbin/md5/Makefile Tue Apr 14 00:27:54 2015 (r281512) +++ stable/10/sbin/md5/Makefile Tue Apr 14 00:32:03 2015 (r281513) @@ -13,9 +13,6 @@ MLINKS= md5.1 rmd160.1 \ md5.1 sha256.1 \ md5.1 sha512.1 -NO_WMISSING_VARIABLE_DECLARATIONS= -WFORMAT?= 1 - DPADD= ${LIBMD} LDADD= -lmd Modified: stable/10/sbin/md5/md5.c ============================================================================== --- stable/10/sbin/md5/md5.c Tue Apr 14 00:27:54 2015 (r281512) +++ stable/10/sbin/md5/md5.c Tue Apr 14 00:32:03 2015 (r281513) @@ -42,11 +42,11 @@ __FBSDID("$FreeBSD$"); #define TEST_BLOCK_COUNT 100000 #define MDTESTCOUNT 8 -int qflag; -int rflag; -int sflag; -unsigned char* checkAgainst; -int checksFailed; +static int qflag; +static int rflag; +static int sflag; +static char* checkAgainst; +static int checksFailed; typedef void (DIGEST_Init)(void *); typedef void (DIGEST_Update)(void *, const unsigned char *, size_t); @@ -70,11 +70,11 @@ typedef struct Algorithm_t { } Algorithm_t; static void MD5_Update(MD5_CTX *, const unsigned char *, size_t); -static void MDString(Algorithm_t *, const char *); -static void MDTimeTrial(Algorithm_t *); -static void MDTestSuite(Algorithm_t *); -static void MDFilter(Algorithm_t *, int); -static void usage(Algorithm_t *); +static void MDString(const Algorithm_t *, const char *); +static void MDTimeTrial(const Algorithm_t *); +static void MDTestSuite(const Algorithm_t *); +static void MDFilter(const Algorithm_t *, int); +static void usage(const Algorithm_t *); typedef union { MD5_CTX md5; @@ -91,7 +91,7 @@ typedef union { /* algorithm function table */ -struct Algorithm_t Algorithm[] = { +static const struct Algorithm_t Algorithm[] = { { "md5", "MD5", &MD5TestOutput, (DIGEST_Init*)&MD5Init, (DIGEST_Update*)&MD5_Update, (DIGEST_End*)&MD5End, &MD5Data, &MD5File }, @@ -216,7 +216,7 @@ main(int argc, char *argv[]) * Digests a string and prints the result. */ static void -MDString(Algorithm_t *alg, const char *string) +MDString(const Algorithm_t *alg, const char *string) { size_t len = strlen(string); char buf[HEX_DIGEST_LENGTH]; @@ -240,7 +240,7 @@ MDString(Algorithm_t *alg, const char *s * Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte blocks. */ static void -MDTimeTrial(Algorithm_t *alg) +MDTimeTrial(const Algorithm_t *alg) { DIGEST_CTX context; struct rusage before, after; @@ -282,7 +282,7 @@ MDTimeTrial(Algorithm_t *alg) * Digests a reference suite of strings and prints the results. */ -const char *MDTestInput[MDTESTCOUNT] = { +static const char *MDTestInput[MDTESTCOUNT] = { "", "a", "abc", @@ -350,7 +350,7 @@ const char *RIPEMD160_TestOutput[MDTESTC }; static void -MDTestSuite(Algorithm_t *alg) +MDTestSuite(const Algorithm_t *alg) { int i; char buffer[HEX_DIGEST_LENGTH]; @@ -370,7 +370,7 @@ MDTestSuite(Algorithm_t *alg) * Digests the standard input and prints the result. */ static void -MDFilter(Algorithm_t *alg, int tee) +MDFilter(const Algorithm_t *alg, int tee) { DIGEST_CTX context; unsigned int len; @@ -387,7 +387,7 @@ MDFilter(Algorithm_t *alg, int tee) } static void -usage(Algorithm_t *alg) +usage(const Algorithm_t *alg) { fprintf(stderr, "usage: %s [-pqrtx] [-c string] [-s string] [files ...]\n", alg->progname); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 14 09:58:12 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2683509; Tue, 14 Apr 2015 09:58:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2D28638; Tue, 14 Apr 2015 09:58:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3E9wBHv081995; Tue, 14 Apr 2015 09:58:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3E9wAl8081988; Tue, 14 Apr 2015 09:58:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504140958.t3E9wAl8081988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Apr 2015 09:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281520 - in stable/10: sys/rpc usr.sbin/nfsd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 09:58:12 -0000 Author: mav Date: Tue Apr 14 09:58:10 2015 New Revision: 281520 URL: https://svnweb.freebsd.org/changeset/base/281520 Log: MFC r281199: Remove hard limits on number of accepting NFS connections. Limits of 5 connections set long ago creates problems for SPEC benchmark. Make the NFS follow system-wide maximum. Modified: stable/10/sys/rpc/svc_generic.c stable/10/sys/rpc/svc_vc.c stable/10/usr.sbin/nfsd/nfsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc_generic.c ============================================================================== --- stable/10/sys/rpc/svc_generic.c Tue Apr 14 07:25:57 2015 (r281519) +++ stable/10/sys/rpc/svc_generic.c Tue Apr 14 09:58:10 2015 (r281520) @@ -168,7 +168,7 @@ svc_tp_create( taddr = uaddr2taddr(nconf, uaddr); bind.addr = *taddr; free(taddr, M_RPC); - bind.qlen = SOMAXCONN; + bind.qlen = -1; xprt = svc_tli_create(pool, NULL, nconf, &bind, 0, 0); free(bind.addr.buf, M_RPC); } else { @@ -256,7 +256,7 @@ svc_tli_create( goto freedata; } } - solisten(so, SOMAXCONN, curthread); + solisten(so, -1, curthread); } else { if (bindresvport(so, (struct sockaddr *)bindaddr->addr.buf)) { Modified: stable/10/sys/rpc/svc_vc.c ============================================================================== --- stable/10/sys/rpc/svc_vc.c Tue Apr 14 07:25:57 2015 (r281519) +++ stable/10/sys/rpc/svc_vc.c Tue Apr 14 09:58:10 2015 (r281520) @@ -177,7 +177,7 @@ svc_vc_create(SVCPOOL *pool, struct sock xprt_register(xprt); - solisten(so, SOMAXCONN, curthread); + solisten(so, -1, curthread); SOCKBUF_LOCK(&so->so_rcv); xprt->xp_upcallset = 1; Modified: stable/10/usr.sbin/nfsd/nfsd.c ============================================================================== --- stable/10/usr.sbin/nfsd/nfsd.c Tue Apr 14 07:25:57 2015 (r281519) +++ stable/10/usr.sbin/nfsd/nfsd.c Tue Apr 14 09:58:10 2015 (r281520) @@ -626,7 +626,7 @@ main(int argc, char **argv) bindhost[i]); nfsd_exit(1); } - if (listen(tcpsock, 5) < 0) { + if (listen(tcpsock, -1) < 0) { syslog(LOG_ERR, "listen failed"); nfsd_exit(1); } @@ -701,7 +701,7 @@ main(int argc, char **argv) bindhost[i]); nfsd_exit(1); } - if (listen(tcp6sock, 5) < 0) { + if (listen(tcp6sock, -1) < 0) { syslog(LOG_ERR, "listen failed"); nfsd_exit(1); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 14 18:45:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2AA19F; Tue, 14 Apr 2015 18:45:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD967D6C; Tue, 14 Apr 2015 18:45:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EIjVbi034099; Tue, 14 Apr 2015 18:45:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EIjV9I034098; Tue, 14 Apr 2015 18:45:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504141845.t3EIjV9I034098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 14 Apr 2015 18:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281533 - stable/10/sbin/newfs_msdos X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 18:45:32 -0000 Author: pfg Date: Tue Apr 14 18:45:30 2015 New Revision: 281533 URL: https://svnweb.freebsd.org/changeset/base/281533 Log: MFC r281320: Update documented OEM string in newfs_msdos(8). This was updated in r203868 to better match the naming scheme in other OSs that use FAT. Modified: stable/10/sbin/newfs_msdos/newfs_msdos.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- stable/10/sbin/newfs_msdos/newfs_msdos.8 Tue Apr 14 18:13:55 2015 (r281532) +++ stable/10/sbin/newfs_msdos/newfs_msdos.8 Tue Apr 14 18:45:30 2015 (r281533) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd April 9, 2015 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -112,7 +112,7 @@ only those characters permitted in regul .It Fl O Ar OEM OEM string (up to 8 characters). The default is -.Qq Li "BSD 4.4" . +.Qq Li "BSD4.4 " . .It Fl S Ar sector-size Number of bytes per sector. Acceptable values are powers of 2 From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 14 18:57:53 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F6034F5; Tue, 14 Apr 2015 18:57:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20782E92; Tue, 14 Apr 2015 18:57:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EIvqiH039363; Tue, 14 Apr 2015 18:57:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EIvp4Z039359; Tue, 14 Apr 2015 18:57:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504141857.t3EIvp4Z039359@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 14 Apr 2015 18:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281535 - stable/10/usr.bin/sort X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 18:57:53 -0000 Author: pfg Date: Tue Apr 14 18:57:50 2015 New Revision: 281535 URL: https://svnweb.freebsd.org/changeset/base/281535 Log: MFC r281181, r281182; sort(1): Cleanups and a small memory leak. Remove custom getdelim(3) and fix a small memory leak. Obtained from: OpenBSD Modified: stable/10/usr.bin/sort/bwstring.c stable/10/usr.bin/sort/file.c stable/10/usr.bin/sort/file.h stable/10/usr.bin/sort/sort.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sort/bwstring.c ============================================================================== --- stable/10/usr.bin/sort/bwstring.c Tue Apr 14 18:46:42 2015 (r281534) +++ stable/10/usr.bin/sort/bwstring.c Tue Apr 14 18:57:50 2015 (r281535) @@ -65,18 +65,12 @@ initialise_months(void) for (int i = 0; i < 12; i++) { cmonths[i] = NULL; tmp = (unsigned char *) nl_langinfo(item[i]); - if (tmp == NULL) - continue; if (debug_sort) printf("month[%d]=%s\n", i, tmp); - len = strlen((char*)tmp); - if (len < 1) + if (*tmp == '\0') continue; - while (isblank(*tmp)) - ++tmp; - m = sort_malloc(len + 1); - memcpy(m, tmp, len + 1); - m[len] = '\0'; + m = sort_strdup(tmp); + len = strlen(tmp); for (unsigned int j = 0; j < len; j++) m[j] = toupper(m[j]); cmonths[i] = m; @@ -91,18 +85,17 @@ initialise_months(void) for (int i = 0; i < 12; i++) { wmonths[i] = NULL; tmp = (unsigned char *) nl_langinfo(item[i]); - if (tmp == NULL) - continue; if (debug_sort) printf("month[%d]=%s\n", i, tmp); - len = strlen((char*)tmp); - if (len < 1) + if (*tmp == '\0') continue; - while (isblank(*tmp)) - ++tmp; + len = strlen(tmp); m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, (char*)tmp, len) == ((size_t) -1)) + if (mbstowcs(m, (char*)tmp, len) == + ((size_t) - 1)) { + sort_free(m); continue; + } m[len] = L'\0'; for (unsigned int j = 0; j < len; j++) m[j] = towupper(m[j]); Modified: stable/10/usr.bin/sort/file.c ============================================================================== --- stable/10/usr.bin/sort/file.c Tue Apr 14 18:46:42 2015 (r281534) +++ stable/10/usr.bin/sort/file.c Tue Apr 14 18:57:50 2015 (r281535) @@ -188,42 +188,6 @@ file_is_tmp(const char* fn) } /* - * Read zero-terminated line from a file - */ -char * -read_file0_line(struct file0_reader *f0r) -{ - size_t pos = 0; - int c; - - if ((f0r->f == NULL) || feof(f0r->f)) - return (NULL); - - if (f0r->current_line && f0r->current_sz > 0) - f0r->current_line[0] = 0; - - while (!feof(f0r->f)) { - c = fgetc(f0r->f); - if (feof(f0r->f) || (c == -1)) - break; - if ((pos + 1) >= f0r->current_sz) { - size_t newsz = (f0r->current_sz + 2) * 2; - f0r->current_line = sort_realloc(f0r->current_line, - newsz); - f0r->current_sz = newsz; - } - f0r->current_line[pos] = (char)c; - if (c == 0) - break; - else - f0r->current_line[pos + 1] = 0; - ++pos; - } - - return f0r->current_line; -} - -/* * Generate new temporary file name */ char * Modified: stable/10/usr.bin/sort/file.h ============================================================================== --- stable/10/usr.bin/sort/file.h Tue Apr 14 18:46:42 2015 (r281534) +++ stable/10/usr.bin/sort/file.h Tue Apr 14 18:57:50 2015 (r281535) @@ -70,16 +70,6 @@ struct file_list bool tmp; }; -/* - * Structure for zero-separated file reading (for input files list) - */ -struct file0_reader -{ - char *current_line; - FILE *f; - size_t current_sz; -}; - /* memory */ /**/ @@ -110,8 +100,6 @@ struct file_reader *file_reader_init(con struct bwstring *file_reader_readline(struct file_reader *fr); void file_reader_free(struct file_reader *fr); -char *read_file0_line(struct file0_reader *f0r); - void init_tmp_files(void); void clear_tmp_files(void); char *new_tmp_file_name(void); Modified: stable/10/usr.bin/sort/sort.c ============================================================================== --- stable/10/usr.bin/sort/sort.c Tue Apr 14 18:46:42 2015 (r281534) +++ stable/10/usr.bin/sort/sort.c Tue Apr 14 18:57:50 2015 (r281535) @@ -229,34 +229,38 @@ usage(bool opt_err) static void read_fns_from_file0(const char *fn) { - if (fn) { - struct file0_reader f0r; - FILE *f; + FILE *f; + char *line = NULL; + size_t linesize = 0; + ssize_t linelen; - f = fopen(fn, "r"); - if (f == NULL) - err(2, NULL); - - memset(&f0r, 0, sizeof(f0r)); - f0r.f = f; - - while (!feof(f)) { - char *line = read_file0_line(&f0r); + if (fn == NULL) + return; - if (line && *line) { - if (argc_from_file0 == (size_t)-1) - argc_from_file0 = 0; - ++argc_from_file0; - argv_from_file0 = sort_realloc(argv_from_file0, - argc_from_file0 * sizeof(char *)); - if (argv_from_file0 == NULL) - err(2, NULL); - argv_from_file0[argc_from_file0 - 1] = - sort_strdup(line); - } + f = fopen(fn, "r"); + if (f == NULL) + err(2, "%s", fn); + + while ((linelen = getdelim(&line, &linesize, '\0', f)) != -1) { + if (*line != '\0') { + if (argc_from_file0 == (size_t) - 1) + argc_from_file0 = 0; + ++argc_from_file0; + argv_from_file0 = sort_realloc(argv_from_file0, + argc_from_file0 * sizeof(char *)); + if (argv_from_file0 == NULL) + err(2, NULL); + argv_from_file0[argc_from_file0 - 1] = line; + } else { + free(line); } - closefile(f, fn); + line = NULL; + linesize = 0; } + if (ferror(f)) + err(2, "%s: getdelim", fn); + + closefile(f, fn); } /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 14 20:05:29 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EEB6EE7; Tue, 14 Apr 2015 20:05:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3957B952; Tue, 14 Apr 2015 20:05:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EK5TId073977; Tue, 14 Apr 2015 20:05:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EK5RnA073966; Tue, 14 Apr 2015 20:05:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504142005.t3EK5RnA073966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 14 Apr 2015 20:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281538 - in stable: 10/sys/sys 9/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 20:05:29 -0000 Author: jhb Date: Tue Apr 14 20:05:26 2015 New Revision: 281538 URL: https://svnweb.freebsd.org/changeset/base/281538 Log: MFC 278474,278476,280279: Expand the bitcount*() API and use it to implement CPU_COUNT for cpusets. 278474: Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets and use this to implement CPU_COUNT() to count the number of CPUs in a cpuset. 278476: Use __builtin_popcountl() instead of __builtin_popcount(). 280279: Expand the bitcount* API to support 64-bit integers, plain ints and longs and create a "hidden" API that can be used in other system headers without adding namespace pollution. - If the POPCNT instruction is enabled at compile time, use __builtin_popcount*() to implement __bitcount*(), otherwise fall back to software implementations. - Use the existing bitcount16() and bitcount32() from to implement the non-POPCNT __bitcount16() and __bitcount32() in . - For the non-POPCNT __bitcount64(), use a similar SWAR method on 64-bit systems. For 32-bit systems, use two __bitcount32() operations on the two halves. - Use __bitcount32() to provide a __bitcount() that operates on plain ints. - Use either __bitcount32() or __bitcount64() to provide a __bitcountl() that operates on longs. - Add public bitcount*() wrappers for __bitcount*() for use in the kernel in . - Use __bitcountl() instead of __builtin_popcountl() in BIT_COUNT(). Modified: stable/10/sys/sys/bitset.h stable/10/sys/sys/cpuset.h stable/10/sys/sys/libkern.h stable/10/sys/sys/systm.h stable/10/sys/sys/types.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/sys/bitset.h stable/9/sys/sys/cpuset.h stable/9/sys/sys/libkern.h stable/9/sys/sys/systm.h stable/9/sys/sys/types.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/10/sys/sys/bitset.h ============================================================================== --- stable/10/sys/sys/bitset.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/10/sys/sys/bitset.h Tue Apr 14 20:05:26 2015 (r281538) @@ -176,4 +176,14 @@ __bit; \ }) +#define BIT_COUNT(_s, p) __extension__ ({ \ + __size_t __i; \ + int __count; \ + \ + __count = 0; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + __count += __bitcountl((p)->__bits[__i]); \ + __count; \ +}) + #endif /* !_SYS_BITSET_H_ */ Modified: stable/10/sys/sys/cpuset.h ============================================================================== --- stable/10/sys/sys/cpuset.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/10/sys/sys/cpuset.h Tue Apr 14 20:05:26 2015 (r281538) @@ -60,6 +60,7 @@ #define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) #define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) +#define CPU_COUNT(p) BIT_COUNT(CPU_SETSIZE, p) /* * Valid cpulevel_t values. Modified: stable/10/sys/sys/libkern.h ============================================================================== --- stable/10/sys/sys/libkern.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/10/sys/sys/libkern.h Tue Apr 14 20:05:26 2015 (r281538) @@ -97,6 +97,11 @@ int flsl(long); #ifndef HAVE_INLINE_FLSLL int flsll(long long); #endif +#define bitcount64(x) __bitcount64((uint64_t)(x)) +#define bitcount32(x) __bitcount32((uint32_t)(x)) +#define bitcount16(x) __bitcount16((uint16_t)(x)) +#define bitcountl(x) __bitcountl((u_long)(x)) +#define bitcount(x) __bitcount((u_int)(x)) int fnmatch(const char *, const char *, int); int locc(int, char *, u_int); Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/10/sys/sys/systm.h Tue Apr 14 20:05:26 2015 (r281538) @@ -424,33 +424,6 @@ int alloc_unr_specific(struct unrhdr *uh int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); -/* - * Population count algorithm using SWAR approach - * - "SIMD Within A Register". - */ -static __inline uint32_t -bitcount32(uint32_t x) -{ - - x = (x & 0x55555555) + ((x & 0xaaaaaaaa) >> 1); - x = (x & 0x33333333) + ((x & 0xcccccccc) >> 2); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = (x + (x >> 8)); - x = (x + (x >> 16)) & 0x000000ff; - return (x); -} - -static __inline uint16_t -bitcount16(uint32_t x) -{ - - x = (x & 0x5555) + ((x & 0xaaaa) >> 1); - x = (x & 0x3333) + ((x & 0xcccc) >> 2); - x = (x + (x >> 4)) & 0x0f0f; - x = (x + (x >> 8)) & 0x00ff; - return (x); -} - void intr_prof_stack_use(struct thread *td, struct trapframe *frame); #endif /* !_SYS_SYSTM_H_ */ Modified: stable/10/sys/sys/types.h ============================================================================== --- stable/10/sys/sys/types.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/10/sys/sys/types.h Tue Apr 14 20:05:26 2015 (r281538) @@ -289,6 +289,68 @@ typedef _Bool bool; #include +#ifdef __POPCNT__ +#define __bitcount64(x) __builtin_popcountll((__uint64_t)(x)) +#define __bitcount32(x) __builtin_popcount((__uint32_t)(x)) +#define __bitcount16(x) __builtin_popcount((__uint16_t)(x)) +#define __bitcountl(x) __builtin_popcountl((unsigned long)(x)) +#define __bitcount(x) __builtin_popcount((unsigned int)(x)) +#else +/* + * Population count algorithm using SWAR approach + * - "SIMD Within A Register". + */ +static __inline __uint16_t +__bitcount16(__uint16_t _x) +{ + + _x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1); + _x = (_x & 0x3333) + ((_x & 0xcccc) >> 2); + _x = (_x + (_x >> 4)) & 0x0f0f; + _x = (_x + (_x >> 8)) & 0x00ff; + return (_x); +} + +static __inline __uint32_t +__bitcount32(__uint32_t _x) +{ + + _x = (_x & 0x55555555) + ((_x & 0xaaaaaaaa) >> 1); + _x = (_x & 0x33333333) + ((_x & 0xcccccccc) >> 2); + _x = (_x + (_x >> 4)) & 0x0f0f0f0f; + _x = (_x + (_x >> 8)); + _x = (_x + (_x >> 16)) & 0x000000ff; + return (_x); +} + +#ifdef __LP64__ +static __inline __uint64_t +__bitcount64(__uint64_t _x) +{ + + _x = (_x & 0x5555555555555555) + ((_x & 0xaaaaaaaaaaaaaaaa) >> 1); + _x = (_x & 0x3333333333333333) + ((_x & 0xcccccccccccccccc) >> 2); + _x = (_x + (_x >> 4)) & 0x0f0f0f0f0f0f0f0f; + _x = (_x + (_x >> 8)); + _x = (_x + (_x >> 16)); + _x = (_x + (_x >> 32)) & 0x000000ff; + return (_x); +} + +#define __bitcountl(x) __bitcount64((unsigned long)(x)) +#else +static __inline __uint64_t +__bitcount64(__uint64_t _x) +{ + + return (__bitcount32(_x >> 32) + __bitcount32(_x)); +} + +#define __bitcountl(x) __bitcount32((unsigned long)(x)) +#endif +#define __bitcount(x) __bitcount32((unsigned int)(x)) +#endif + /* * minor() gives a cookie instead of an index since we don't want to * change the meanings of bits 0-15 or waste time and space shifting From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 05:13:42 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D03B64F; Wed, 15 Apr 2015 05:13:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67851C2F; Wed, 15 Apr 2015 05:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3F5Dgf5037331; Wed, 15 Apr 2015 05:13:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F5Dgwo037330; Wed, 15 Apr 2015 05:13:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201504150513.t3F5Dgwo037330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 15 Apr 2015 05:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281543 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 05:13:42 -0000 Author: dchagin Date: Wed Apr 15 05:13:41 2015 New Revision: 281543 URL: https://svnweb.freebsd.org/changeset/base/281543 Log: MFC r281162, r281451: Use flexible array for per cpu uma_cache to avoid allocating an extra struct uma_cache. PR: 199169 Modified: stable/10/sys/vm/uma_int.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_int.h ============================================================================== --- stable/10/sys/vm/uma_int.h Wed Apr 15 05:04:42 2015 (r281542) +++ stable/10/sys/vm/uma_int.h Wed Apr 15 05:13:41 2015 (r281543) @@ -311,7 +311,7 @@ struct uma_zone { * This HAS to be the last item because we adjust the zone size * based on NCPU and then allocate the space for the zones. */ - struct uma_cache uz_cpu[1]; /* Per cpu caches */ + struct uma_cache uz_cpu[]; /* Per cpu caches */ }; /* From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 06:56:53 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F7F965C; Wed, 15 Apr 2015 06:56:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501AE971; Wed, 15 Apr 2015 06:56:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3F6uqKO084658; Wed, 15 Apr 2015 06:56:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F6uqnJ084653; Wed, 15 Apr 2015 06:56:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504150656.t3F6uqnJ084653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Apr 2015 06:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281545 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 06:56:53 -0000 Author: kib Date: Wed Apr 15 06:56:51 2015 New Revision: 281545 URL: https://svnweb.freebsd.org/changeset/base/281545 Log: MFC r281254: Account for the offset of the page run when allocating the dmar_map_entry. Modified: stable/10/sys/x86/iommu/busdma_dmar.c stable/10/sys/x86/iommu/intel_dmar.h stable/10/sys/x86/iommu/intel_gas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/busdma_dmar.c ============================================================================== --- stable/10/sys/x86/iommu/busdma_dmar.c Wed Apr 15 05:24:39 2015 (r281544) +++ stable/10/sys/x86/iommu/busdma_dmar.c Wed Apr 15 06:56:51 2015 (r281545) @@ -459,6 +459,7 @@ dmar_bus_dmamap_load_something1(struct b bus_size_t buflen1; int error, idx, gas_flags, seg; + KASSERT(offset < DMAR_PAGE_SIZE, ("offset %d", offset)); if (segs == NULL) segs = tag->segments; ctx = tag->ctx; @@ -473,7 +474,6 @@ dmar_bus_dmamap_load_something1(struct b } buflen1 = buflen > tag->common.maxsegsz ? tag->common.maxsegsz : buflen; - buflen -= buflen1; size = round_page(offset + buflen1); /* @@ -484,7 +484,7 @@ dmar_bus_dmamap_load_something1(struct b if (seg + 1 < tag->common.nsegments) gas_flags |= DMAR_GM_CANSPLIT; - error = dmar_gas_map(ctx, &tag->common, size, + error = dmar_gas_map(ctx, &tag->common, size, offset, DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, gas_flags, ma + idx, &entry); if (error != 0) @@ -503,6 +503,10 @@ dmar_bus_dmamap_load_something1(struct b (uintmax_t)size, (uintmax_t)entry->start, (uintmax_t)entry->end)); } + if (offset + buflen1 > size) + buflen1 = size - offset; + if (buflen1 > tag->common.maxsegsz) + buflen1 = tag->common.maxsegsz; KASSERT(((entry->start + offset) & (tag->common.alignment - 1)) == 0, @@ -516,15 +520,16 @@ dmar_bus_dmamap_load_something1(struct b (uintmax_t)entry->start, (uintmax_t)entry->end, (uintmax_t)tag->common.lowaddr, (uintmax_t)tag->common.highaddr)); - KASSERT(dmar_test_boundary(entry->start, entry->end - - entry->start, tag->common.boundary), + KASSERT(dmar_test_boundary(entry->start + offset, buflen1, + tag->common.boundary), ("boundary failed: ctx %p start 0x%jx end 0x%jx " "boundary 0x%jx", ctx, (uintmax_t)entry->start, (uintmax_t)entry->end, (uintmax_t)tag->common.boundary)); KASSERT(buflen1 <= tag->common.maxsegsz, ("segment too large: ctx %p start 0x%jx end 0x%jx " - "maxsegsz 0x%jx", ctx, (uintmax_t)entry->start, - (uintmax_t)entry->end, (uintmax_t)tag->common.maxsegsz)); + "buflen1 0x%jx maxsegsz 0x%jx", ctx, + (uintmax_t)entry->start, (uintmax_t)entry->end, + (uintmax_t)buflen1, (uintmax_t)tag->common.maxsegsz)); DMAR_CTX_LOCK(ctx); TAILQ_INSERT_TAIL(&map->map_entries, entry, dmamap_link); @@ -538,6 +543,7 @@ dmar_bus_dmamap_load_something1(struct b idx += OFF_TO_IDX(trunc_page(offset + buflen1)); offset += buflen1; offset &= DMAR_PAGE_MASK; + buflen -= buflen1; } if (error == 0) *segp = seg; Modified: stable/10/sys/x86/iommu/intel_dmar.h ============================================================================== --- stable/10/sys/x86/iommu/intel_dmar.h Wed Apr 15 05:24:39 2015 (r281544) +++ stable/10/sys/x86/iommu/intel_dmar.h Wed Apr 15 06:56:51 2015 (r281545) @@ -289,7 +289,7 @@ struct dmar_map_entry *dmar_gas_alloc_en void dmar_gas_free_entry(struct dmar_ctx *ctx, struct dmar_map_entry *entry); void dmar_gas_free_space(struct dmar_ctx *ctx, struct dmar_map_entry *entry); int dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common, - dmar_gaddr_t size, u_int eflags, u_int flags, vm_page_t *ma, + dmar_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma, struct dmar_map_entry **res); void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry); int dmar_gas_map_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry, Modified: stable/10/sys/x86/iommu/intel_gas.c ============================================================================== --- stable/10/sys/x86/iommu/intel_gas.c Wed Apr 15 05:24:39 2015 (r281544) +++ stable/10/sys/x86/iommu/intel_gas.c Wed Apr 15 06:56:51 2015 (r281545) @@ -293,6 +293,7 @@ dmar_gas_fini_ctx(struct dmar_ctx *ctx) struct dmar_gas_match_args { struct dmar_ctx *ctx; dmar_gaddr_t size; + int offset; const struct bus_dma_tag_common *common; u_int gas_flags; struct dmar_map_entry *entry; @@ -309,25 +310,28 @@ dmar_gas_match_one(struct dmar_gas_match /* DMAR_PAGE_SIZE to create gap after new entry. */ if (a->entry->start < prev->end + DMAR_PAGE_SIZE || - a->entry->start + a->size + DMAR_PAGE_SIZE > prev->end + - prev->free_after) + a->entry->start + a->size + a->offset + DMAR_PAGE_SIZE > + prev->end + prev->free_after) return (false); /* No boundary crossing. */ - if (dmar_test_boundary(a->entry->start, a->size, a->common->boundary)) + if (dmar_test_boundary(a->entry->start + a->offset, a->size, + a->common->boundary)) return (true); /* - * The start to start + size region crosses the boundary. - * Check if there is enough space after the next boundary - * after the prev->end. + * The start + offset to start + offset + size region crosses + * the boundary. Check if there is enough space after the + * next boundary after the prev->end. */ - bs = (a->entry->start + a->common->boundary) & ~(a->common->boundary - - 1); + bs = (a->entry->start + a->offset + a->common->boundary) & + ~(a->common->boundary - 1); start = roundup2(bs, a->common->alignment); /* DMAR_PAGE_SIZE to create gap after new entry. */ - if (start + a->size + DMAR_PAGE_SIZE <= prev->end + prev->free_after && - start + a->size <= end && dmar_test_boundary(start, a->size, + if (start + a->offset + a->size + DMAR_PAGE_SIZE <= + prev->end + prev->free_after && + start + a->offset + a->size <= end && + dmar_test_boundary(start + a->offset, a->size, a->common->boundary)) { a->entry->start = start; return (true); @@ -409,7 +413,7 @@ dmar_gas_lowermatch(struct dmar_gas_matc return (0); } } - if (prev->free_down < a->size + DMAR_PAGE_SIZE) + if (prev->free_down < a->size + a->offset + DMAR_PAGE_SIZE) return (ENOMEM); l = RB_LEFT(prev, rb_entry); if (l != NULL) { @@ -465,7 +469,7 @@ dmar_gas_uppermatch(struct dmar_gas_matc static int dmar_gas_find_space(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common, dmar_gaddr_t size, - u_int flags, struct dmar_map_entry *entry) + int offset, u_int flags, struct dmar_map_entry *entry) { struct dmar_gas_match_args a; int error; @@ -476,6 +480,7 @@ dmar_gas_find_space(struct dmar_ctx *ctx a.ctx = ctx; a.size = size; + a.offset = offset; a.common = common; a.gas_flags = flags; a.entry = entry; @@ -617,7 +622,7 @@ dmar_gas_free_region(struct dmar_ctx *ct int dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common, - dmar_gaddr_t size, u_int eflags, u_int flags, vm_page_t *ma, + dmar_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma, struct dmar_map_entry **res) { struct dmar_map_entry *entry; @@ -631,7 +636,7 @@ dmar_gas_map(struct dmar_ctx *ctx, const if (entry == NULL) return (ENOMEM); DMAR_CTX_LOCK(ctx); - error = dmar_gas_find_space(ctx, common, size, flags, entry); + error = dmar_gas_find_space(ctx, common, size, offset, flags, entry); if (error == ENOMEM) { DMAR_CTX_UNLOCK(ctx); dmar_gas_free_entry(ctx, entry); From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 06:59:54 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23E8AA50; Wed, 15 Apr 2015 06:59:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E023992; Wed, 15 Apr 2015 06:59:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3F6xrEL085105; Wed, 15 Apr 2015 06:59:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F6xra4085103; Wed, 15 Apr 2015 06:59:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504150659.t3F6xra4085103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Apr 2015 06:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281547 - stable/10/sys/i386/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 06:59:54 -0000 Author: kib Date: Wed Apr 15 06:59:53 2015 New Revision: 281547 URL: https://svnweb.freebsd.org/changeset/base/281547 Log: MFC r281272: Explain that vm_page_array is mapped to describe the memory, not the memory itself. Provide the formula to calculate the number of required page tables. Correct the size of the struct vm_page for non-PAE case. Modified: stable/10/sys/i386/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/include/pmap.h ============================================================================== --- stable/10/sys/i386/include/pmap.h Wed Apr 15 06:57:47 2015 (r281546) +++ stable/10/sys/i386/include/pmap.h Wed Apr 15 06:59:53 2015 (r281547) @@ -122,13 +122,18 @@ */ #define VADDR(pdi, pti) ((vm_offset_t)(((pdi)< Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20E9E23F for ; Wed, 15 Apr 2015 12:50:14 +0000 (UTC) Received: from hermes.heuristicsystems.com.au (hermes.heuristicsystems.com.au [203.41.22.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hermes.heuristicsystems.com.au", Issuer "Heuristic Systems Type 4 Host CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8387694F for ; Wed, 15 Apr 2015 12:50:13 +0000 (UTC) Received: from [10.0.5.3] (ewsw01.hs [10.0.5.3]) (authenticated bits=0) by hermes.heuristicsystems.com.au (8.14.6/8.13.6) with ESMTP id t3FCmOpU008553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 15 Apr 2015 22:48:36 +1000 (EST) (envelope-from dewayne.geraghty@heuristicsystems.com.au) Message-ID: <552E5E3D.4040802@heuristicsystems.com.au> Date: Wed, 15 Apr 2015 22:49:01 +1000 From: Dewayne Geraghty User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: svn-src-stable-10@freebsd.org Subject: Re: svn commit: r281520 - in stable/10: sys/rpc usr.sbin/nfsd References: <201504140958.t3E9wAl8081988@svn.freebsd.org> In-Reply-To: <201504140958.t3E9wAl8081988@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 12:50:14 -0000 Alex, This is quite a significant change. Would it be prudent to provide a sysctl so that an admin can limit the number of connections (that they may have relied upon to avoid a DOS)? Kind regards, Dewayne. From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 16:52:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B1A3383; Wed, 15 Apr 2015 16:52:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF463CBD; Wed, 15 Apr 2015 16:52:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FGqZmQ071941; Wed, 15 Apr 2015 16:52:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FGqZjl071938; Wed, 15 Apr 2015 16:52:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504151652.t3FGqZjl071938@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 15 Apr 2015 16:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281560 - in stable/10/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 16:52:36 -0000 Author: jhb Date: Wed Apr 15 16:52:34 2015 New Revision: 281560 URL: https://svnweb.freebsd.org/changeset/base/281560 Log: MFC 278325,280866: Revert the IPI startup sequence to match what is described in the Intel Multiprocessor Specification v1.4. The Intel SDM claims that 278325: Revert the IPI startup sequence to match what is described in the Intel Multiprocessor Specification v1.4. The Intel SDM claims that the INIT IPIs here are invalid, but other systems follow the MP spec instead. While here, fix the IPI wait routine to accept a timeout in microseconds instead of a raw spin count, and don't spin forever during AP startup. Instead, panic if a STARTUP IPI is not delivered after 20 us. 280866: Wait 100 microseconds for a local APIC to dispatch each startup-related IPI rather than 20. The MP 1.4 specification states in Appendix B.2: "A period of 20 microseconds should be sufficient for IPI dispatch to complete under normal operating conditions". (Note that this appears to be separate from the 10 millisecond (INIT) and 200 microsecond (STARTUP) waits after the IPIs are dispatched.) The Intel SDM is silent on this issue as far as I can tell. At least some hardware requires 60 microseconds as noted in the PR, so bump this to 100 to be on the safe side. PR: 196542, 197756 Modified: stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/x86/x86/local_apic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Wed Apr 15 16:22:05 2015 (r281559) +++ stable/10/sys/amd64/amd64/mp_machdep.c Wed Apr 15 16:52:34 2015 (r281560) @@ -1067,14 +1067,27 @@ ipi_startup(int apic_id, int vector) { /* + * This attempts to follow the algorithm described in the + * Intel Multiprocessor Specification v1.4 in section B.4. + * For each IPI, we allow the local APIC ~20us to deliver the + * IPI. If that times out, we panic. + */ + + /* * first we do an INIT IPI: this INIT IPI might be run, resetting * and running the target CPU. OR this INIT IPI might be latched (P5 * bug), CPU waiting for STARTUP IPI. OR this INIT IPI might be * ignored. */ - lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_LEVEL | APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); - lapic_ipi_wait(-1); + lapic_ipi_wait(100); + + /* Explicitly deassert the INIT IPI. */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, + apic_id); + DELAY(10000); /* wait ~10mS */ /* @@ -1086,9 +1099,11 @@ ipi_startup(int apic_id, int vector) * will run. */ lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | - APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | vector, apic_id); - lapic_ipi_wait(-1); + if (!lapic_ipi_wait(100)) + panic("Failed to deliver first STARTUP IPI to APIC %d", + apic_id); DELAY(200); /* wait ~200uS */ /* @@ -1098,9 +1113,12 @@ ipi_startup(int apic_id, int vector) * recognized after hardware RESET or INIT IPI. */ lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | - APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | vector, apic_id); - lapic_ipi_wait(-1); + if (!lapic_ipi_wait(100)) + panic("Failed to deliver second STARTUP IPI to APIC %d", + apic_id); + DELAY(200); /* wait ~200uS */ } Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Wed Apr 15 16:22:05 2015 (r281559) +++ stable/10/sys/i386/i386/mp_machdep.c Wed Apr 15 16:52:34 2015 (r281560) @@ -1140,14 +1140,27 @@ ipi_startup(int apic_id, int vector) { /* + * This attempts to follow the algorithm described in the + * Intel Multiprocessor Specification v1.4 in section B.4. + * For each IPI, we allow the local APIC ~20us to deliver the + * IPI. If that times out, we panic. + */ + + /* * first we do an INIT IPI: this INIT IPI might be run, resetting * and running the target CPU. OR this INIT IPI might be latched (P5 * bug), CPU waiting for STARTUP IPI. OR this INIT IPI might be * ignored. */ - lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_LEVEL | APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); - lapic_ipi_wait(-1); + lapic_ipi_wait(100); + + /* Explicitly deassert the INIT IPI. */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, + apic_id); + DELAY(10000); /* wait ~10mS */ /* @@ -1159,9 +1172,11 @@ ipi_startup(int apic_id, int vector) * will run. */ lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | - APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | vector, apic_id); - lapic_ipi_wait(-1); + if (!lapic_ipi_wait(100)) + panic("Failed to deliver first STARTUP IPI to APIC %d", + apic_id); DELAY(200); /* wait ~200uS */ /* @@ -1171,9 +1186,12 @@ ipi_startup(int apic_id, int vector) * recognized after hardware RESET or INIT IPI. */ lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | - APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | vector, apic_id); - lapic_ipi_wait(-1); + if (!lapic_ipi_wait(100)) + panic("Failed to deliver second STARTUP IPI to APIC %d", + apic_id); + DELAY(200); /* wait ~200uS */ } Modified: stable/10/sys/x86/x86/local_apic.c ============================================================================== --- stable/10/sys/x86/x86/local_apic.c Wed Apr 15 16:22:05 2015 (r281559) +++ stable/10/sys/x86/x86/local_apic.c Wed Apr 15 16:52:34 2015 (r281560) @@ -1384,22 +1384,22 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O int lapic_ipi_wait(int delay) { - int x, incr; + int x; /* - * Wait delay loops for IPI to be sent. This is highly bogus - * since this is sensitive to CPU clock speed. If delay is + * Wait delay microseconds for IPI to be sent. If delay is * -1, we wait forever. */ if (delay == -1) { - incr = 0; - delay = 1; - } else - incr = 1; - for (x = 0; x < delay; x += incr) { + while ((lapic->icr_lo & APIC_DELSTAT_MASK) != APIC_DELSTAT_IDLE) + ia32_pause(); + return (1); + } + + for (x = 0; x < delay; x += 5) { if ((lapic->icr_lo & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - ia32_pause(); + DELAY(5); } return (0); } @@ -1433,9 +1433,9 @@ lapic_ipi_raw(register_t icrlo, u_int de intr_restore(saveintr); } -#define BEFORE_SPIN 1000000 +#define BEFORE_SPIN 50000 #ifdef DETECT_DEADLOCK -#define AFTER_SPIN 1000 +#define AFTER_SPIN 50 #endif void @@ -1446,7 +1446,7 @@ lapic_ipi_vectored(u_int vector, int des KASSERT((vector & ~APIC_VECTOR_MASK) == 0, ("%s: invalid vector %d", __func__, vector)); - icrlo = APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE; + icrlo = APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE | APIC_LEVEL_ASSERT; /* * IPI_STOP_HARD is just a "fake" vector used to send a NMI. @@ -1454,9 +1454,9 @@ lapic_ipi_vectored(u_int vector, int des * the vector. */ if (vector == IPI_STOP_HARD) - icrlo |= APIC_DELMODE_NMI | APIC_LEVEL_ASSERT; + icrlo |= APIC_DELMODE_NMI; else - icrlo |= vector | APIC_DELMODE_FIXED | APIC_LEVEL_DEASSERT; + icrlo |= vector | APIC_DELMODE_FIXED; destfield = 0; switch (dest) { case APIC_IPI_DEST_SELF: From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 21:47:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDA5878C; Wed, 15 Apr 2015 21:47:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D786F988; Wed, 15 Apr 2015 21:47:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FLlMke010224; Wed, 15 Apr 2015 21:47:22 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FLlF9t010192; Wed, 15 Apr 2015 21:47:15 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201504152147.t3FLlF9t010192@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Wed, 15 Apr 2015 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281564 - in stable/10/sys/dev/mps: . mpi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 21:47:23 -0000 Author: slm Date: Wed Apr 15 21:47:15 2015 New Revision: 281564 URL: https://svnweb.freebsd.org/changeset/base/281564 Log: MFI r257381: Adjust to handle either a 32-bit or 64-bit lun_id_t in printf. MFC r266615: Increase taskqueue thread priority from idle to PRIBIO. MFC r279253: - Copyright to Avago - SSU changes - SATA ID timeout handling (PR 191348) - reset handling changes - Bump version to 20.00.00.00-fbsd MFC r279695: Change that should have been done with r279253 Modified: stable/10/sys/dev/mps/mpi/mpi2.h stable/10/sys/dev/mps/mpi/mpi2_cnfg.h stable/10/sys/dev/mps/mpi/mpi2_hbd.h stable/10/sys/dev/mps/mpi/mpi2_history.txt stable/10/sys/dev/mps/mpi/mpi2_init.h stable/10/sys/dev/mps/mpi/mpi2_ioc.h stable/10/sys/dev/mps/mpi/mpi2_ra.h stable/10/sys/dev/mps/mpi/mpi2_raid.h stable/10/sys/dev/mps/mpi/mpi2_sas.h stable/10/sys/dev/mps/mpi/mpi2_targ.h stable/10/sys/dev/mps/mpi/mpi2_tool.h stable/10/sys/dev/mps/mpi/mpi2_type.h stable/10/sys/dev/mps/mps.c stable/10/sys/dev/mps/mps_config.c stable/10/sys/dev/mps/mps_ioctl.h stable/10/sys/dev/mps/mps_mapping.c stable/10/sys/dev/mps/mps_mapping.h stable/10/sys/dev/mps/mps_pci.c stable/10/sys/dev/mps/mps_sas.c stable/10/sys/dev/mps/mps_sas.h stable/10/sys/dev/mps/mps_sas_lsi.c stable/10/sys/dev/mps/mps_user.c stable/10/sys/dev/mps/mpsvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mps/mpi/mpi2.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2006-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2006-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2.h Modified: stable/10/sys/dev/mps/mpi/mpi2_cnfg.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_cnfg.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_cnfg.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2006-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2006-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_cnfg.h Modified: stable/10/sys/dev/mps/mpi/mpi2_hbd.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_hbd.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_hbd.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2009-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2009-2012 LSI Corporation. + * Copyright (c) 2009-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_hbd.h Modified: stable/10/sys/dev/mps/mpi/mpi2_history.txt ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_history.txt Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_history.txt Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2000-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ @@ -32,7 +33,8 @@ Fusion-MPT MPI 2.0 Header File Change History ============================== - Copyright (c) 2000-2012 LSI Corporation. + Copyright (c) 2000-2015 LSI Corporation. + Copyright (c) 2013-2015 Avago Technologies --------------------------------------- Header Set Release Version: 02.00.18 Modified: stable/10/sys/dev/mps/mpi/mpi2_init.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_init.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_init.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2006-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2006-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_init.h Modified: stable/10/sys/dev/mps/mpi/mpi2_ioc.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_ioc.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_ioc.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2006-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2006-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_ioc.h Modified: stable/10/sys/dev/mps/mpi/mpi2_ra.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_ra.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_ra.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2009-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2012 LSI Corporation. + * Copyright (c) 2009-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_ra.h Modified: stable/10/sys/dev/mps/mpi/mpi2_raid.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_raid.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_raid.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2007-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2007-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_raid.h Modified: stable/10/sys/dev/mps/mpi/mpi2_sas.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_sas.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_sas.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2007-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2007-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_sas.h Modified: stable/10/sys/dev/mps/mpi/mpi2_targ.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_targ.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_targ.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2006-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2006-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_targ.h Modified: stable/10/sys/dev/mps/mpi/mpi2_tool.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_tool.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_tool.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2007-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2007-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_tool.h Modified: stable/10/sys/dev/mps/mpi/mpi2_type.h ============================================================================== --- stable/10/sys/dev/mps/mpi/mpi2_type.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mpi/mpi2_type.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2006-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +24,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2012 LSI Corporation. + * Copyright (c) 2006-2015 LSI Corporation. + * Copyright (c) 2013-2015 Avago Technologies * * * Name: mpi2_type.h Modified: stable/10/sys/dev/mps/mps.c ============================================================================== --- stable/10/sys/dev/mps/mps.c Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps.c Wed Apr 15 21:47:15 2015 (r281564) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2009 Yahoo! Inc. - * Copyright (c) 2012 LSI Corp. + * Copyright (c) 2011-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ @@ -32,7 +33,7 @@ #include __FBSDID("$FreeBSD$"); -/* Communications core for LSI MPT2 */ +/* Communications core for Avago Technologies (LSI) MPT2 */ /* TODO Move headers to mpsvar */ #include @@ -1349,6 +1350,8 @@ mps_get_tunables(struct mps_softc *sc) sc->disable_msix = 0; sc->disable_msi = 0; sc->max_chains = MPS_CHAIN_FRAMES; + sc->enable_ssu = MPS_SSU_ENABLE_SSD_DISABLE_HDD; + sc->spinup_wait_time = DEFAULT_SPINUP_WAIT; /* * Grab the global variables. @@ -1357,6 +1360,8 @@ mps_get_tunables(struct mps_softc *sc) TUNABLE_INT_FETCH("hw.mps.disable_msix", &sc->disable_msix); TUNABLE_INT_FETCH("hw.mps.disable_msi", &sc->disable_msi); TUNABLE_INT_FETCH("hw.mps.max_chains", &sc->max_chains); + TUNABLE_INT_FETCH("hw.mps.enable_ssu", &sc->enable_ssu); + TUNABLE_INT_FETCH("hw.mps.spinup_wait_time", &sc->spinup_wait_time); /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.debug_level", @@ -1379,6 +1384,14 @@ mps_get_tunables(struct mps_softc *sc) snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.exclude_ids", device_get_unit(sc->mps_dev)); TUNABLE_STR_FETCH(tmpstr, sc->exclude_ids, sizeof(sc->exclude_ids)); + + snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.enable_ssu", + device_get_unit(sc->mps_dev)); + TUNABLE_INT_FETCH(tmpstr, &sc->enable_ssu); + + snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.spinup_wait_time", + device_get_unit(sc->mps_dev)); + TUNABLE_INT_FETCH(tmpstr, &sc->spinup_wait_time); } static void @@ -1451,11 +1464,20 @@ mps_setup_sysctl(struct mps_softc *sc) OID_AUTO, "max_chains", CTLFLAG_RD, &sc->max_chains, 0,"maximum chain frames that will be allocated"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "enable_ssu", CTLFLAG_RW, &sc->enable_ssu, 0, + "enable SSU to SATA SSD/HDD at shutdown"); + #if __FreeBSD_version >= 900030 SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "chain_alloc_fail", CTLFLAG_RD, &sc->chain_alloc_fail, "chain allocation failures"); #endif //FreeBSD_version >= 900030 + + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "spinup_wait_time", CTLFLAG_RD, + &sc->spinup_wait_time, DEFAULT_SPINUP_WAIT, "seconds to wait for " + "spinup after SATA ID error"); } int Modified: stable/10/sys/dev/mps/mps_config.c ============================================================================== --- stable/10/sys/dev/mps/mps_config.c Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps_config.c Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2011-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD */ #include Modified: stable/10/sys/dev/mps/mps_ioctl.h ============================================================================== --- stable/10/sys/dev/mps/mps_ioctl.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps_ioctl.h Wed Apr 15 21:47:15 2015 (r281564) @@ -27,12 +27,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD userland interface + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD userland interface * * $FreeBSD$ */ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2011-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +57,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ Modified: stable/10/sys/dev/mps/mps_mapping.c ============================================================================== --- stable/10/sys/dev/mps/mps_mapping.c Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps_mapping.c Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2011-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD */ #include @@ -889,14 +890,14 @@ _mapping_get_dev_info(struct mps_softc * u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); Mpi2ConfigReply_t mpi_reply; Mpi2SasDevicePage0_t sas_device_pg0; - u8 entry, enc_idx, phy_idx; + u8 entry, enc_idx, phy_idx, sata_end_device; u32 map_idx, index, device_info; struct _map_phy_change *phy_change, *tmp_phy_change; uint64_t sas_address; struct enc_mapping_table *et_entry; struct dev_mapping_table *mt_entry; u8 add_code = MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED; - int rc; + int rc = 1; for (entry = 0; entry < topo_change->num_entries; entry++) { phy_change = &topo_change->phy_details[entry]; @@ -910,42 +911,36 @@ _mapping_get_dev_info(struct mps_softc * continue; } + /* + * Always get SATA Identify information because this is used + * to determine if Start/Stop Unit should be sent to the drive + * when the system is shutdown. + */ device_info = le32toh(sas_device_pg0.DeviceInfo); - if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE) == - MPI2_IOCPAGE8_FLAGS_DEVICE_PERSISTENCE_MAPPING) { - if ((device_info & MPI2_SAS_DEVICE_INFO_END_DEVICE) && - (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE)) { - rc = mpssas_get_sas_address_for_sata_disk(sc, - &sas_address, phy_change->dev_handle, - device_info); - if (rc) { - printf("%s: failed to compute the " - "hashed SAS Address for SATA " - "device with handle 0x%04x\n", - __func__, phy_change->dev_handle); - sas_address = - sas_device_pg0.SASAddress.High; - sas_address = (sas_address << 32) | - sas_device_pg0.SASAddress.Low; - } - mps_dprint(sc, MPS_MAPPING, - "SAS Address for SATA device = %jx\n", - sas_address); + sas_address = sas_device_pg0.SASAddress.High; + sas_address = (sas_address << 32) | + sas_device_pg0.SASAddress.Low; + sata_end_device = 0; + if ((device_info & MPI2_SAS_DEVICE_INFO_END_DEVICE) && + (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE)) { + sata_end_device = 1; + rc = mpssas_get_sas_address_for_sata_disk(sc, + &sas_address, phy_change->dev_handle, device_info, + &phy_change->is_SATA_SSD); + if (rc) { + mps_dprint(sc, MPS_ERROR, "%s: failed to get " + "disk type (SSD or HDD) and SAS Address " + "for SATA device with handle 0x%04x\n", + __func__, phy_change->dev_handle); } else { - sas_address = - sas_device_pg0.SASAddress.High; - sas_address = (sas_address << 32) | - sas_device_pg0.SASAddress.Low; + mps_dprint(sc, MPS_INFO, "SAS Address for SATA " + "device = %jx\n", sas_address); } - } else { - sas_address = sas_device_pg0.SASAddress.High; - sas_address = (sas_address << 32) | - sas_device_pg0.SASAddress.Low; } + phy_change->physical_id = sas_address; phy_change->slot = le16toh(sas_device_pg0.Slot); - phy_change->device_info = - le32toh(sas_device_pg0.DeviceInfo); + phy_change->device_info = le32toh(sas_device_pg0.DeviceInfo); if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE) == MPI2_IOCPAGE8_FLAGS_ENCLOSURE_SLOT_MAPPING) { @@ -953,10 +948,10 @@ _mapping_get_dev_info(struct mps_softc * topo_change->enc_handle); if (enc_idx == MPS_ENCTABLE_BAD_IDX) { phy_change->is_processed = 1; - printf("%s: failed to add the device with " - "handle 0x%04x because the enclosure is " - "not in the mapping table\n", __func__, - phy_change->dev_handle); + mps_dprint(sc, MPS_MAPPING, "%s: failed to add " + "the device with handle 0x%04x because the " + "enclosure is not in the mapping table\n", + __func__, phy_change->dev_handle); continue; } if (!((phy_change->device_info & Modified: stable/10/sys/dev/mps/mps_mapping.h ============================================================================== --- stable/10/sys/dev/mps/mps_mapping.h Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps_mapping.h Wed Apr 15 21:47:15 2015 (r281564) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2011-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ @@ -38,6 +39,7 @@ * @dev_handle: device handle for the device pointed by this entry * @slot: slot ID * @is_processed: Flag to indicate whether this entry is processed or not + * @is_SATA_SSD: 1 if this is a SATA device AND an SSD, 0 otherwise */ struct _map_phy_change { uint64_t physical_id; @@ -46,6 +48,8 @@ struct _map_phy_change { uint16_t slot; uint8_t reason; uint8_t is_processed; + uint8_t is_SATA_SSD; + uint8_t reserved; }; /** @@ -66,6 +70,6 @@ struct _map_topology_change { extern int mpssas_get_sas_address_for_sata_disk(struct mps_softc *ioc, - u64 *sas_address, u16 handle, u32 device_info); + u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD); #endif Modified: stable/10/sys/dev/mps/mps_pci.c ============================================================================== --- stable/10/sys/dev/mps/mps_pci.c Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps_pci.c Wed Apr 15 21:47:15 2015 (r281564) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -/* PCI/PCI-X/PCIe bus interface for the LSI MPT2 controllers */ +/* PCI/PCI-X/PCIe bus interface for the Avago Tech (LSI) MPT2 controllers */ /* TODO Move headers to mpsvar */ #include @@ -98,33 +98,33 @@ struct mps_ident { const char *desc; } mps_identifiers[] = { { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2004, - 0xffff, 0xffff, 0, "LSI SAS2004" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2004" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2008, - 0xffff, 0xffff, 0, "LSI SAS2008" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2008" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2108_1, - 0xffff, 0xffff, 0, "LSI SAS2108" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2108" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2108_2, - 0xffff, 0xffff, 0, "LSI SAS2108" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2108" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2108_3, - 0xffff, 0xffff, 0, "LSI SAS2108" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2108" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2116_1, - 0xffff, 0xffff, 0, "LSI SAS2116" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2116" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2116_2, - 0xffff, 0xffff, 0, "LSI SAS2116" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2116" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_1, - 0xffff, 0xffff, 0, "LSI SAS2208" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_2, - 0xffff, 0xffff, 0, "LSI SAS2208" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_3, - 0xffff, 0xffff, 0, "LSI SAS2208" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_4, - 0xffff, 0xffff, 0, "LSI SAS2208" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_5, - 0xffff, 0xffff, 0, "LSI SAS2208" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_6, - 0xffff, 0xffff, 0, "LSI SAS2208" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_1, - 0xffff, 0xffff, 0, "LSI SAS2308" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" }, // Add Customer specific vender/subdevice id before generic // (0xffff) vender/subdevice id. { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, @@ -136,11 +136,11 @@ struct mps_ident { { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, 0x8086, 0x3519, 0, "Intel(R) Integrated RAID Module RMS25KB040" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, - 0xffff, 0xffff, 0, "LSI SAS2308" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_3, - 0xffff, 0xffff, 0, "LSI SAS2308" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SSS6200, - 0xffff, 0xffff, MPS_FLAGS_WD_AVAILABLE, "LSI SSS6200" }, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SSS6200" }, { 0, 0, 0, 0, 0, NULL } }; Modified: stable/10/sys/dev/mps/mps_sas.c ============================================================================== --- stable/10/sys/dev/mps/mps_sas.c Wed Apr 15 20:55:43 2015 (r281563) +++ stable/10/sys/dev/mps/mps_sas.c Wed Apr 15 21:47:15 2015 (r281564) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2009 Yahoo! Inc. - * Copyright (c) 2011, 2012 LSI Corp. + * Copyright (c) 2011-2015 LSI Corp. + * Copyright (c) 2013-2015 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * LSI MPT-Fusion Host Adapter FreeBSD + * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ @@ -32,7 +33,7 @@ #include __FBSDID("$FreeBSD$"); -/* Communications core for LSI MPT2 */ +/* Communications core for Avago Technologies (LSI) MPT2 */ /* TODO Move headers to mpsvar */ #include @@ -119,6 +120,8 @@ static void mpssas_remove_device(struct static void mpssas_remove_complete(struct mps_softc *, struct mps_command *); static void mpssas_action(struct cam_sim *sim, union ccb *ccb); static void mpssas_poll(struct cam_sim *sim); +static int mpssas_send_abort(struct mps_softc *sc, struct mps_command *tm, + struct mps_command *cm); static void mpssas_scsiio_timeout(void *data); static void mpssas_abort_complete(struct mps_softc *sc, struct mps_command *cm); static void mpssas_direct_drive_io(struct mpssas_softc *sassc, @@ -133,8 +136,6 @@ static void mpssas_send_smpcmd(struct mp static void mpssas_action_smpio(struct mpssas_softc *sassc, union ccb *ccb); #endif //FreeBSD_version >= 900026 static void mpssas_resetdev_complete(struct mps_softc *, struct mps_command *); -static int mpssas_send_abort(struct mps_softc *sc, struct mps_command *tm, struct mps_command *cm); -static int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint8_t type); static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg); #if (__FreeBSD_version < 901503) || \ @@ -224,7 +225,7 @@ mpssas_startup_decrement(struct mpssas_s } } -/* LSI's firmware requires us to stop sending commands when we're doing task +/* The firmware requires us to stop sending commands when we're doing task * management, so refcount the TMs and keep the simq frozen when any are in * use. */ @@ -233,37 +234,31 @@ mpssas_alloc_tm(struct mps_softc *sc) { struct mps_command *tm; - MPS_FUNCTRACE(sc); tm = mps_alloc_high_priority_command(sc); - if (tm != NULL) { - if (sc->sassc->tm_count++ == 0) { - mps_dprint(sc, MPS_RECOVERY, - "%s freezing simq\n", __func__); - xpt_freeze_simq(sc->sassc->sim, 1); - } - mps_dprint(sc, MPS_RECOVERY, "%s tm_count %u\n", __func__, - sc->sassc->tm_count); - } return tm; } void mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm) { - mps_dprint(sc, MPS_TRACE, "%s", __func__); if (tm == NULL) return; - /* if there are no TMs in use, we can release the simq. We use our - * own refcount so that it's easier for a diag reset to cleanup and - * release the simq. - */ - if (--sc->sassc->tm_count == 0) { - mps_dprint(sc, MPS_RECOVERY, "%s releasing simq\n", __func__); - xpt_release_simq(sc->sassc->sim, 1); + /* + * For TM's the devq is frozen for the device. Unfreeze it here and + * free the resources used for freezing the devq. Must clear the + * INRESET flag as well or scsi I/O will not work. + */ + if (tm->cm_targ != NULL) { + tm->cm_targ->flags &= ~MPSSAS_TARGET_INRESET; + } + if (tm->cm_ccb) { + mps_dprint(sc, MPS_INFO, "Unfreezing devq for target ID %d\n", + tm->cm_targ->tid); + xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE); + xpt_free_path(tm->cm_ccb->ccb_h.path); + xpt_free_ccb(tm->cm_ccb); } - mps_dprint(sc, MPS_RECOVERY, "%s tm_count %u\n", __func__, - sc->sassc->tm_count); mps_free_high_priority_command(sc, tm); } @@ -371,7 +366,8 @@ mpssas_remove_volume(struct mps_softc *s if (reply == NULL) { /* XXX retry the remove after the diag reset completes? */ mps_dprint(sc, MPS_FAULT, - "%s NULL reply reseting device 0x%04x\n", __func__, handle); + "%s NULL reply resetting device 0x%04x\n", __func__, + handle); mpssas_free_tm(sc, tm); return; } @@ -475,6 +471,11 @@ mpssas_prepare_volume_remove(struct mpss MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = mpssas_remove_volume; cm->cm_complete_data = (void *)(uintptr_t)handle; + + mps_dprint(sc, MPS_INFO, "%s: Sending reset for target ID %d\n", + __func__, targ->tid); + mpssas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); + mps_map_command(sc, cm); } @@ -533,6 +534,11 @@ mpssas_prepare_remove(struct mpssas_soft cm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = mpssas_remove_device; cm->cm_complete_data = (void *)(uintptr_t)handle; + + mps_dprint(sc, MPS_INFO, "%s: Sending reset for target ID %d\n", + __func__, targ->tid); + mpssas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); + mps_map_command(sc, cm); } @@ -758,9 +764,7 @@ mps_attach_sas(struct mps_softc *sc) TASK_INIT(&sassc->ev_task, 0, mpssas_firmware_event_work, sc); sassc->ev_tq = taskqueue_create("mps_taskq", M_NOWAIT | M_ZERO, taskqueue_thread_enqueue, &sassc->ev_tq); - - /* Run the task queue with lowest priority */ - taskqueue_start_threads(&sassc->ev_tq, 1, 255, "%s taskq", + taskqueue_start_threads(&sassc->ev_tq, 1, PRIBIO, "%s taskq", device_get_nameunit(sc->mps_dev)); mps_lock(sc); @@ -787,9 +791,6 @@ mps_attach_sas(struct mps_softc *sc) mpssas_startup_increment(sassc); callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); - sassc->discovery_timeouts = 0; - - sassc->tm_count = 0; /* * Register for async events so we can determine the EEDP @@ -940,7 +941,7 @@ mpssas_action(struct cam_sim *sim, union cpi->max_lun = 255; cpi->initiator_id = sassc->maxtargets - 1; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN); + strncpy(cpi->hba_vid, "Avago Tech (LSI)", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = cam_sim_bus(sim); @@ -1042,8 +1043,8 @@ mpssas_announce_reset(struct mps_softc * path_id_t path_id = cam_sim_path(sc->sassc->sim); struct cam_path *path; - mps_dprint(sc, MPS_XINFO, "%s code %x target %d lun %d\n", __func__, - ac_code, target_id, lun_id); + mps_dprint(sc, MPS_XINFO, "%s code %x target %d lun %jx\n", __func__, + ac_code, target_id, (uintmax_t)lun_id); if (xpt_create_path(&path, NULL, path_id, target_id, lun_id) != CAM_REQ_CMP) { @@ -1136,8 +1137,8 @@ mpssas_handle_reinit(struct mps_softc *s mpssas_complete_all_commands(sc); mps_dprint(sc, MPS_INIT, - "%s startup %u tm %u after command completion\n", - __func__, sc->sassc->startup_refcount, sc->sassc->tm_count); + "%s startup %u after command completion\n", __func__, + sc->sassc->startup_refcount); /* zero all the target handles, since they may change after the * reset, and we have to rediscover all the targets and use the new @@ -1200,7 +1201,6 @@ mpssas_logical_unit_reset_complete(struc "NULL reset reply for tm %p\n", tm); if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ - targ->flags &= ~MPSSAS_TARGET_INRESET; targ->tm = NULL; mpssas_free_tm(sc, tm); } @@ -1289,7 +1289,6 @@ mpssas_target_reset_complete(struct mps_ "NULL reset reply for tm %p\n", tm); if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ - targ->flags &= ~MPSSAS_TARGET_INRESET; targ->tm = NULL; mpssas_free_tm(sc, tm); } @@ -1305,8 +1304,6 @@ mpssas_target_reset_complete(struct mps_ le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), le32toh(reply->TerminationCount)); - targ->flags &= ~MPSSAS_TARGET_INRESET; - if (targ->outstanding == 0) { /* we've finished recovery for this target and all * of its logical units. @@ -1334,7 +1331,7 @@ mpssas_target_reset_complete(struct mps_ #define MPS_RESET_TIMEOUT 30 -static int +int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint8_t type) { MPI2_SCSI_TASK_MANAGE_REQUEST *req; @@ -1360,15 +1357,19 @@ mpssas_send_reset(struct mps_softc *sc, mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO, "sending logical unit reset\n"); tm->cm_complete = mpssas_logical_unit_reset_complete; + mpssas_prepare_for_tm(sc, tm, target, tm->cm_lun); } else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { - /* Target reset method = SAS Hard Link Reset / SATA Link Reset */ + /* + * Target reset method = + * SAS Hard Link Reset / SATA Link Reset + */ req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; tm->cm_targ->target_resets++; - tm->cm_targ->flags |= MPSSAS_TARGET_INRESET; mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO, "sending target reset\n"); tm->cm_complete = mpssas_target_reset_complete; + mpssas_prepare_for_tm(sc, tm, target, CAM_LUN_WILDCARD); } else { mps_dprint(sc, MPS_ERROR, "unexpected reset type 0x%x\n", type); @@ -1515,6 +1516,10 @@ mpssas_send_abort(struct mps_softc *sc, targ->aborts++; + mps_dprint(sc, MPS_INFO, "Sending reset from %s for target ID %d\n", + __func__, targ->tid); + mpssas_prepare_for_tm(sc, tm, targ, tm->cm_lun); + err = mps_map_command(sc, tm); if (err) mpssas_log_command(tm, MPS_RECOVERY, @@ -1523,7 +1528,6 @@ mpssas_send_abort(struct mps_softc *sc, return err; } - static void mpssas_scsiio_timeout(void *data) { @@ -1669,6 +1673,19 @@ mpssas_action_scsiio(struct mpssas_softc return; } + /* + * If target has a reset in progress, freeze the devq and return. The + * devq will be released when the TM reset is finished. + */ + if (targ->flags & MPSSAS_TARGET_INRESET) { + ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; + mps_dprint(sc, MPS_INFO, "%s: Freezing devq for target ID %d\n", + __func__, targ->tid); + xpt_freeze_devq(ccb->ccb_h.path, 1); + xpt_done(ccb); + return; + } + cm = mps_alloc_command(sc); if (cm == NULL || (sc->mps_flags & MPS_FLAGS_DIAGRESET)) { if (cm != NULL) { @@ -2058,6 +2075,8 @@ mpssas_scsiio_complete(struct mps_softc u8 *TLR_bits, TLR_on; int dir = 0, i; u16 alloc_len; + struct mpssas_target *target; + target_id_t target_id; MPS_FUNCTRACE(sc); mps_dprint(sc, MPS_TRACE, @@ -2071,6 +2090,7 @@ mpssas_scsiio_complete(struct mps_softc sassc = sc->sassc; ccb = cm->cm_complete_data; csio = &ccb->csio; + target_id = csio->ccb_h.target_id; rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply; /* * XXX KDM if the chain allocation fails, does it matter if we do @@ -2252,9 +2272,10 @@ mpssas_scsiio_complete(struct mps_softc * TLR_bits for the target. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 22:02:53 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBCEBDFC; Wed, 15 Apr 2015 22:02:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC75FB96; Wed, 15 Apr 2015 22:02:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FM2r57019395; Wed, 15 Apr 2015 22:02:53 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FM2rWB019394; Wed, 15 Apr 2015 22:02:53 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201504152202.t3FM2rWB019394@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Wed, 15 Apr 2015 22:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281566 - stable/10/usr.sbin/bluetooth/bthidd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 22:02:54 -0000 Author: rakuco (ports committer) Date: Wed Apr 15 22:02:52 2015 New Revision: 281566 URL: https://svnweb.freebsd.org/changeset/base/281566 Log: MFC r281116. bthidd: Consider usage ranges when dealing with array inputs. So far, we were always using HID_USAGE() to determine the Usage ID of a certain HID report input item. This does not work as intended if a field is an array and the allowed usages are specified with a usage range, as HID_USAGE() will return 0. We need to use the field value as an index in the usage range list in this case instead. This makes the volume keys in a Microsoft Bluetooth Mobile Keyboard 5000 be properly recognized. The relevant part of the HID report looks like this: 0xA1, 0x01, // Collection (Application) 0x85, 0x07, // Report ID (7) 0x05, 0x0C, // Usage Page (Consumer) 0x19, 0x00, // Usage Minimum (Unassigned) 0x2A, 0xFF, 0x03, // Usage Maximum (0x03FF) 0x95, 0x01, // Report Count (1) 0x75, 0x10, // Report Size (16) 0x15, 0x00, // Logical Minimum (0) 0x27, 0xFF, 0x03, 0x00, 0x00, // Logical Maximum (1023) 0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred // State,No Null Position) When a key such as "volume down" is pressed, the following data is transferred through Interrupt In: 0x07 0xEA 0x00 Differential Revision: https://reviews.freebsd.org/D2229 Modified: stable/10/usr.sbin/bluetooth/bthidd/hid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bluetooth/bthidd/hid.c ============================================================================== --- stable/10/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 21:48:06 2015 (r281565) +++ stable/10/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:02:52 2015 (r281566) @@ -165,9 +165,21 @@ hid_interrupt(bthid_session_p s, uint8_t continue; page = HID_PAGE(h.usage); - usage = HID_USAGE(h.usage); val = hid_get_data(data, &h); + /* + * When the input field is an array and the usage is specified + * with a range instead of an ID, we have to derive the actual + * usage by using the item value as an index in the usage range + * list. + */ + if ((h.flags & HIO_VARIABLE)) { + usage = HID_USAGE(h.usage); + } else { + const uint32_t usage_offset = val - h.logical_minimum; + usage = HID_USAGE(h.usage_minimum + usage_offset); + } + switch (page) { case HUP_GENERIC_DESKTOP: switch (usage) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 15 22:07:51 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4C801C9; Wed, 15 Apr 2015 22:07:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D053FBD7; Wed, 15 Apr 2015 22:07:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FM7pDS020148; Wed, 15 Apr 2015 22:07:51 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FM7ptY020147; Wed, 15 Apr 2015 22:07:51 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201504152207.t3FM7ptY020147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Wed, 15 Apr 2015 22:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281567 - stable/10/usr.sbin/bluetooth/bthidd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 22:07:52 -0000 Author: rakuco (ports committer) Date: Wed Apr 15 22:07:51 2015 New Revision: 281567 URL: https://svnweb.freebsd.org/changeset/base/281567 Log: MFC r281146. bthidd: Remove unused macros from hid.c. ASIZE() was never used, and min() stopped being used in r207812. Differential Revision: https://reviews.freebsd.org/D2230 Reviewed by: emax Approved by: emax Modified: stable/10/usr.sbin/bluetooth/bthidd/hid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bluetooth/bthidd/hid.c ============================================================================== --- stable/10/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:02:52 2015 (r281566) +++ stable/10/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:07:51 2015 (r281567) @@ -48,12 +48,6 @@ #include "bthidd.h" #include "kbd.h" -#undef min -#define min(x, y) (((x) < (y))? (x) : (y)) - -#undef ASIZE -#define ASIZE(a) (sizeof(a)/sizeof(a[0])) - /* * Process data from control channel */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:24:23 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43C445FE; Thu, 16 Apr 2015 00:24:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D64EC0B; Thu, 16 Apr 2015 00:24:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0OMGQ088821; Thu, 16 Apr 2015 00:24:22 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0OMu5088819; Thu, 16 Apr 2015 00:24:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160024.t3G0OMu5088819@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281570 - stable/10/lib/libc/string X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:24:23 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:24:21 2015 New Revision: 281570 URL: https://svnweb.freebsd.org/changeset/base/281570 Log: MFC: r266671, r266725: Merge strcspn.3 into strspn.3 and clarify the explaination Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Deleted: stable/10/lib/libc/string/strcspn.3 Modified: stable/10/lib/libc/string/Makefile.inc stable/10/lib/libc/string/strspn.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/string/Makefile.inc ============================================================================== --- stable/10/lib/libc/string/Makefile.inc Wed Apr 15 22:17:16 2015 (r281569) +++ stable/10/lib/libc/string/Makefile.inc Thu Apr 16 00:24:21 2015 (r281570) @@ -30,7 +30,7 @@ SYM_MAPS+= ${.CURDIR}/string/Symbol.map MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ - strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strdup.3 strerror.3 \ + strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \ string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \ strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \ wcswidth.3 wcsxfrm.3 wmemchr.3 @@ -60,6 +60,7 @@ MLINKS+=strerror.3 perror.3 \ strerror.3 sys_nerr.3 MLINKS+=strlcpy.3 strlcat.3 MLINKS+=strlen.3 strnlen.3 +MLINKS+=strspn.3 strcspn.3 MLINKS+=strstr.3 strcasestr.3 \ strstr.3 strnstr.3 \ strstr.3 strcasestr_l.3 Modified: stable/10/lib/libc/string/strspn.3 ============================================================================== --- stable/10/lib/libc/string/strspn.3 Wed Apr 15 22:17:16 2015 (r281569) +++ stable/10/lib/libc/string/strspn.3 Thu Apr 16 00:24:21 2015 (r281570) @@ -32,11 +32,12 @@ .\" @(#)strspn.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 24, 2014 .Dt STRSPN 3 .Os .Sh NAME -.Nm strspn +.Nm strspn , +.Nm strcspn .Nd span a string .Sh LIBRARY .Lb libc @@ -44,6 +45,8 @@ .In string.h .Ft size_t .Fn strspn "const char *s" "const char *charset" +.Ft size_t +.Fn strcspn "const char *s" "const char *charset" .Sh DESCRIPTION The .Fn strspn @@ -54,22 +57,44 @@ as long as the characters from .Fa s occur in the null-terminated string .Fa charset . -In other words, it computes the string array index in -.Fa s +In other words, it computes the string array index of the first character of .Fa s which is not in .Fa charset , else the index of the first null character. +.Pp +The +.Fn strcspn +function +spans the initial part of the null-terminated string +.Fa s +as long as the characters from +.Fa s +.Sy do not +occur in the null-terminated string +.Fa charset +.Po it spans the +.Sy complement +of +.Fa charset +.Pc . +In other words, it computes the string array index +of the first character of +.Fa s +which is also in +.Fa charset , +else the index of the first null character. .Sh RETURN VALUES The .Fn strspn -function -returns the number of characters spanned. +and +.Fn strcspn +functions +return the number of characters spanned. .Sh SEE ALSO .Xr memchr 3 , .Xr strchr 3 , -.Xr strcspn 3 , .Xr strpbrk 3 , .Xr strrchr 3 , .Xr strsep 3 , @@ -79,6 +104,8 @@ returns the number of characters spanned .Sh STANDARDS The .Fn strspn -function -conforms to +and +.Fn strcspn +functions +conform to .St -isoC . From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:27:54 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC3A1760; Thu, 16 Apr 2015 00:27:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6EACC29; Thu, 16 Apr 2015 00:27:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0RsrD089353; Thu, 16 Apr 2015 00:27:54 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0Rsri089352; Thu, 16 Apr 2015 00:27:54 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160027.t3G0Rsri089352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281571 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:27:54 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:27:53 2015 New Revision: 281571 URL: https://svnweb.freebsd.org/changeset/base/281571 Log: MFC: r280301: Fix grammar in epair(4) man page Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/share/man/man4/epair.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/epair.4 ============================================================================== --- stable/10/share/man/man4/epair.4 Thu Apr 16 00:24:21 2015 (r281570) +++ stable/10/share/man/man4/epair.4 Thu Apr 16 00:27:53 2015 (r281571) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2009 +.Dd March 18, 2015 .Dt EPAIR 4 .Os .Sh NAME @@ -89,14 +89,16 @@ that is only guaranteed to be unique wit To change the default addresses one may use the SIOCSIFADDR ioctl(2) or ifconfig(8) utility. .Pp -The basic intend is to provide connectivity between two virtual +The basic intent is to provide connectivity between two virtual network stack instances. -When connected to a -.Xr if_bridge 4 +When connected to an +.Xr if_bridge 4 , one end of the interface pair can also be part of another (virtual) LAN. -As with any other Ethernet interface one can configure +As with any other Ethernet interface, +.Nm epair +can have a .Xr vlan 4 -support on top of it. +configured on top of it. .Sh SEE ALSO .Xr ioctl 2 , .Xr altq 4 , From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:29:50 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27C678A9; Thu, 16 Apr 2015 00:29:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12235C3A; Thu, 16 Apr 2015 00:29:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0TnGD089665; Thu, 16 Apr 2015 00:29:49 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0TnDq089664; Thu, 16 Apr 2015 00:29:49 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160029.t3G0TnDq089664@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281572 - stable/10/games/fortune/datfiles X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:29:50 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:29:49 2015 New Revision: 281572 URL: https://svnweb.freebsd.org/changeset/base/281572 Log: MFC: r269089: Update the freebsd-tips example to use drill instead of dig since bind is no longer in base Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/games/fortune/datfiles/freebsd-tips Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/datfiles/freebsd-tips ============================================================================== --- stable/10/games/fortune/datfiles/freebsd-tips Thu Apr 16 00:27:53 2015 (r281571) +++ stable/10/games/fortune/datfiles/freebsd-tips Thu Apr 16 00:29:49 2015 (r281572) @@ -231,10 +231,10 @@ is running FreeBSD at the time) to quick To erase a line you've written at the command prompt, use "Ctrl-U". -- Dru % -To find out the hostname associated with an IP address, use +To find the hostname associated with an IP address, use - dig -x IP_address - -- Dru + drill -x IP_address + -- Allan Jude % To obtain a neat PostScript rendering of a manual page, use ``-t'' switch of the man(1) utility: ``man -t ''. For example: From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:31:52 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96A6EA0F; Thu, 16 Apr 2015 00:31:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80BC6CEB; Thu, 16 Apr 2015 00:31:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0VqFl093531; Thu, 16 Apr 2015 00:31:52 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0VqQC093530; Thu, 16 Apr 2015 00:31:52 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160031.t3G0VqQC093530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281573 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:31:52 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:31:51 2015 New Revision: 281573 URL: https://svnweb.freebsd.org/changeset/base/281573 Log: MFC: r266774: improve ifconfig(8) man page by describing special behaviour of -l ether MFC: r267141: Style cleanups on ifconfig.8 Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/sbin/ifconfig/ifconfig.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.8 Thu Apr 16 00:29:49 2015 (r281572) +++ stable/10/sbin/ifconfig/ifconfig.8 Thu Apr 16 00:31:51 2015 (r281573) @@ -141,13 +141,13 @@ The link-level .Pq Dq link address is specified as a series of colon-separated hex digits. -This can be used to -e.g.,\& set a new MAC address on an ethernet interface, though the -mechanism used is not ethernet-specific. +This can be used to, for example, +set a new MAC address on an Ethernet interface, though the +mechanism used is not Ethernet specific. If the interface is already up when this option is used, it will be briefly brought down and then brought back up again in order to ensure that the receive -filter in the underlying ethernet hardware is properly reprogrammed. +filter in the underlying Ethernet hardware is properly reprogrammed. .It Ar address_family Specify the address family @@ -174,6 +174,18 @@ and .Dq lladdr are synonyms for .Dq link . +When using the +.Fl l +flag, the +.Dq ether +address family has special meaning and is no longer synonymous with +.Dq link +or +.Dq lladdr . +Specifying +.Fl l Dq ether +will list only Ethernet interfaces, excluding all other interface types, +including the loopback interface. .It Ar dest_address Specify the address of the correspondent on the other end of a point to point link. @@ -700,7 +712,8 @@ Clear a flag .Cm defaultif . .It Cm ifdisabled Set a flag to disable all of IPv6 network communications on the -specified interface. Note that if there are already configured IPv6 +specified interface. +Note that if there are already configured IPv6 addresses on that interface, all of them are marked as .Dq tentative and DAD will be performed when this flag is cleared. @@ -1139,7 +1152,8 @@ specifies the number of beacon intervals and must be in the range 1 to 15. By default DTIM is 1 (i.e., DTIM occurs at each beacon). .It Cm quiet -Enable the use of quiet IE. Hostap will use this to silence other +Enable the use of quiet IE. +Hostap will use this to silence other stations to reduce interference for radar detection when operating on 5GHz frequency and doth support is enabled. Use @@ -1154,9 +1168,11 @@ scheduled quiet intervals defined by Qui Set the QUIET .Ar count to the number of TBTTs until the beacon interval during which the -next quiet interval shall start. A value of 1 indicates the quiet +next quiet interval shall start. +A value of 1 indicates the quiet interval will start during the beacon interval starting at the next -TBTT. A value 0 is reserved. +TBTT. +A value 0 is reserved. .It Cm quiet_offset Ar offset Set the QUIET .Ar offset @@ -2406,7 +2422,8 @@ Another name for the parameter. .It Cm accept_rev_ethip_ver Set a flag to accept both correct EtherIP packets and ones -with reversed version field. Enabled by default. +with reversed version field. +Enabled by default. This is for backward compatibility with .Fx 6.1 , 6.2, 6.3, 7.0, and 7.1. @@ -2415,7 +2432,8 @@ Clear a flag .Cm accept_rev_ethip_ver . .It Cm send_rev_ethip_ver Set a flag to send EtherIP packets with reversed version -field intentionally. Disabled by default. +field intentionally. +Disabled by default. This is for backward compatibility with .Fx 6.1 , 6.2, 6.3, 7.0, and 7.1. @@ -2498,7 +2516,7 @@ pseudo-interface. The .Xr vlan 4 interface is assigned a -copy of the parent interface's flags and the parent's ethernet address. +copy of the parent interface's flags and the parent's Ethernet address. The .Cm vlandev and @@ -2618,6 +2636,11 @@ The .Fl l flag may be used to list all available interfaces on the system, with no other additional information. +If an +.Ar address_family +is specified, only interfaces of that type will be listed. +.Fl l Dq ether +will list only Ethernet adapters, excluding the loopback interface. Use of this flag is mutually exclusive with all other flags and commands, except for .Fl d From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:34:43 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 618F0B58; Thu, 16 Apr 2015 00:34:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3174BCFD; Thu, 16 Apr 2015 00:34:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0YhkF093972; Thu, 16 Apr 2015 00:34:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0Ygq7093967; Thu, 16 Apr 2015 00:34:42 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160034.t3G0Ygq7093967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281574 - in stable/10/usr.bin: jot lam rs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:34:43 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:34:41 2015 New Revision: 281574 URL: https://svnweb.freebsd.org/changeset/base/281574 Log: MFC: r281209: Fix missing AUTHOR section for jot(1), rs(1), and lam(1) Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.bin/jot/jot.1 stable/10/usr.bin/lam/lam.1 stable/10/usr.bin/rs/rs.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/jot/jot.1 ============================================================================== --- stable/10/usr.bin/jot/jot.1 Thu Apr 16 00:31:51 2015 (r281573) +++ stable/10/usr.bin/jot/jot.1 Thu Apr 16 00:34:41 2015 (r281574) @@ -28,7 +28,7 @@ .\" @(#)jot.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 2, 2010 +.Dd April 7, 2015 .Dt JOT 1 .Os .Sh NAME @@ -324,3 +324,5 @@ The .Nm utility first appeared in .Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze Modified: stable/10/usr.bin/lam/lam.1 ============================================================================== --- stable/10/usr.bin/lam/lam.1 Thu Apr 16 00:31:51 2015 (r281573) +++ stable/10/usr.bin/lam/lam.1 Thu Apr 16 00:34:41 2015 (r281574) @@ -28,7 +28,7 @@ .\" @(#)lam.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 12, 2004 +.Dd April 7, 2015 .Dt LAM 1 .Os .Sh NAME @@ -136,6 +136,8 @@ The .Nm utility first appeared in .Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze .Sh BUGS The .Nm Modified: stable/10/usr.bin/rs/rs.1 ============================================================================== --- stable/10/usr.bin/rs/rs.1 Thu Apr 16 00:31:51 2015 (r281573) +++ stable/10/usr.bin/rs/rs.1 Thu Apr 16 00:34:41 2015 (r281574) @@ -28,7 +28,7 @@ .\" @(#)rs.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd February 25, 2011 +.Dd April 7, 2015 .Dt RS 1 .Os .Sh NAME @@ -222,6 +222,8 @@ The .Nm utility first appeared in .Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze .Sh BUGS .Bl -item .It From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:37:06 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 379EEC98; Thu, 16 Apr 2015 00:37:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22912D13; Thu, 16 Apr 2015 00:37:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0b6ne094369; Thu, 16 Apr 2015 00:37:06 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0b5QM094368; Thu, 16 Apr 2015 00:37:06 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160037.t3G0b5QM094368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281575 - stable/10/usr.bin/man X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:37:06 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:37:05 2015 New Revision: 281575 URL: https://svnweb.freebsd.org/changeset/base/281575 Log: MFC: r272135, r272174 Update man(1) to list the different sections of the manual Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.bin/man/man.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/man/man.1 ============================================================================== --- stable/10/usr.bin/man/man.1 Thu Apr 16 00:34:41 2015 (r281574) +++ stable/10/usr.bin/man/man.1 Thu Apr 16 00:37:05 2015 (r281575) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2011 +.Dd September 26, 2014 .Dt MAN 1 .Os .Sh NAME @@ -58,6 +58,28 @@ is provided, .Nm restricts the search to the specific section of the manual. .Pp +The sections of the manual are: +.Bl -enum -offset indent -compact +.It +.Fx General Commands Manual +.It +.Fx System Calls Manual +.It +.Fx Library Functions Manual +.It +.Fx Kernel Interfaces Manual +.It +.Fx File Formats Manual +.It +.Fx Games Manual +.It +.Fx Miscellaneous Information Manual +.It +.Fx System Manager's Manual +.It +.Fx Kernel Developer's Manual +.El +.Pp Options that .Nm understands: @@ -318,6 +340,14 @@ Local configuration files. .Sh SEE ALSO .Xr apropos 1 , .Xr intro 1 , +.Xr intro 2 , +.Xr intro 3 , +.Xr intro 4 , +.Xr intro 5 , +.Xr intro 6 , +.Xr intro 7 , +.Xr intro 8 , +.Xr intro 9 , .Xr locale 1 , .Xr manpath 1 , .Xr nroff 1 , From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:39:17 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49D5EEB8; Thu, 16 Apr 2015 00:39:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 340FAD20; Thu, 16 Apr 2015 00:39:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0dHY7094785; Thu, 16 Apr 2015 00:39:17 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0dH84094784; Thu, 16 Apr 2015 00:39:17 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160039.t3G0dH84094784@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281577 - stable/10/sbin/reboot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:39:17 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:39:16 2015 New Revision: 281577 URL: https://svnweb.freebsd.org/changeset/base/281577 Log: MFC: r280191: Document that nextboot(8) doesn't work as expected with ZFS Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/sbin/reboot/nextboot.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/reboot/nextboot.8 ============================================================================== --- stable/10/sbin/reboot/nextboot.8 Thu Apr 16 00:37:11 2015 (r281576) +++ stable/10/sbin/reboot/nextboot.8 Thu Apr 16 00:39:16 2015 (r281577) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2012 +.Dd March 17, 2015 .Dt NEXTBOOT 8 .Os .Sh NAME @@ -130,3 +130,9 @@ It is also my first attempt to write in Finally, it does some evil things like writing to the file system before it has been checked. If it scrambles your file system, do not blame me. +.Pp +.Xr loader 8 +is only able to read ZFS, not write to it. +.Pa nextboot.conf +will NOT be reset in case of a kernel boot failure. + From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 00:44:06 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CF65179; Thu, 16 Apr 2015 00:44:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 077F3DE1; Thu, 16 Apr 2015 00:44:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G0i5VS098963; Thu, 16 Apr 2015 00:44:05 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G0i51g098962; Thu, 16 Apr 2015 00:44:05 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504160044.t3G0i51g098962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 16 Apr 2015 00:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281579 - stable/10/contrib/ee X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 00:44:06 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 00:44:05 2015 New Revision: 281579 URL: https://svnweb.freebsd.org/changeset/base/281579 Log: MFC: r277328: Fix minor syntax and grammar errors in the markup of the ee(1) man page Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc. Modified: stable/10/contrib/ee/ee.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ee/ee.1 ============================================================================== --- stable/10/contrib/ee/ee.1 Thu Apr 16 00:39:20 2015 (r281578) +++ stable/10/contrib/ee/ee.1 Thu Apr 16 00:44:05 2015 (r281579) @@ -329,8 +329,8 @@ A window showing the keyboard operations displayed or not. .IP "\fBemacs keys\fR" Control keys may be given bindings similar to emacs, or not. -.IP "\f16 bit characters\fR" -Toggles whether sixteen bit characters are handled as one 16-bit quantities or +.IP "\fB16 bit characters\fR" +Toggles whether sixteen bit characters are handled as one 16-bit quantity or two 8-bit quantities. This works primarily with the Chinese Big 5 code set. .RE .PP @@ -461,7 +461,7 @@ Turns off display of eight bit character value inside angle brackets, e.g., "<220>"). .IP \fB16bit\fR Turns on handling of 16-bit characters. -.IP \fbno16bit\fR +.IP \fBno16bit\fR Turns off handling of 16-bit characters. .IP \fBemacs\fR Turns on emacs key bindings. From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 15:09:47 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F8C13D9; Thu, 16 Apr 2015 15:09:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ACC29A6; Thu, 16 Apr 2015 15:09:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GF9kWl008323; Thu, 16 Apr 2015 15:09:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GF9kcF008322; Thu, 16 Apr 2015 15:09:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504161509.t3GF9kcF008322@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 16 Apr 2015 15:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281603 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 15:09:47 -0000 Author: jhb Date: Thu Apr 16 15:09:46 2015 New Revision: 281603 URL: https://svnweb.freebsd.org/changeset/base/281603 Log: MFC 280222: Clear an mbuf's external storage flags in m_extaddref(). They are cleared in other places that set the external storage type (ext_type) such as m_cljset(), m_extadd(), mb_ctor_clust(), and vn_sendfile(). Modified: stable/10/sys/sys/mbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/mbuf.h ============================================================================== --- stable/10/sys/sys/mbuf.h Thu Apr 16 13:25:22 2015 (r281602) +++ stable/10/sys/sys/mbuf.h Thu Apr 16 15:09:46 2015 (r281603) @@ -564,6 +564,7 @@ m_extaddref(struct mbuf *m, caddr_t buf, m->m_ext.ext_arg1 = arg1; m->m_ext.ext_arg2 = arg2; m->m_ext.ext_type = EXT_EXTREF; + m->m_ext.ext_flags = 0; } static __inline uma_zone_t From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 19:04:39 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFD25B8B; Thu, 16 Apr 2015 19:04:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE23A16; Thu, 16 Apr 2015 19:04:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GJ4dvd023242; Thu, 16 Apr 2015 19:04:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GJ4dxQ023241; Thu, 16 Apr 2015 19:04:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504161904.t3GJ4dxQ023241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Apr 2015 19:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281608 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 19:04:39 -0000 Author: markj Date: Thu Apr 16 19:04:38 2015 New Revision: 281608 URL: https://svnweb.freebsd.org/changeset/base/281608 Log: MFC r281225: Add B_KVAALLOC and B_UNMAPPED to the buf flag name list. Modified: stable/10/sys/sys/buf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/buf.h ============================================================================== --- stable/10/sys/sys/buf.h Thu Apr 16 18:47:28 2015 (r281607) +++ stable/10/sys/sys/buf.h Thu Apr 16 19:04:38 2015 (r281608) @@ -226,8 +226,8 @@ struct buf { #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26dirty\25b20" \ "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ - "\15b12\14b11\13eintr\12done\11persist\10delwri\7validsuspwrt" \ - "\6cache\5deferred\4direct\3async\2needcommit\1age" + "\15kvaalloc\14unmapped\13eintr\12done\11persist\10delwri" \ + "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" /* * These flags are kept in b_xflags. From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 16 19:09:26 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 492EEFD7; Thu, 16 Apr 2015 19:09:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19AB1A62; Thu, 16 Apr 2015 19:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GJ9PIL024296; Thu, 16 Apr 2015 19:09:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GJ9PpR024293; Thu, 16 Apr 2015 19:09:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504161909.t3GJ9PpR024293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Apr 2015 19:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281609 - in stable/10: share/man/man4 sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 19:09:26 -0000 Author: markj Date: Thu Apr 16 19:09:25 2015 New Revision: 281609 URL: https://svnweb.freebsd.org/changeset/base/281609 Log: MFC r272378: Add net.inet.icmp.tstamprepl. PR: 193689 Modified: stable/10/share/man/man4/icmp.4 stable/10/sys/netinet/ip_icmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/icmp.4 ============================================================================== --- stable/10/share/man/man4/icmp.4 Thu Apr 16 19:04:38 2015 (r281608) +++ stable/10/share/man/man4/icmp.4 Thu Apr 16 19:09:25 2015 (r281609) @@ -32,7 +32,7 @@ .\" @(#)icmp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 9, 2007 +.Dd September 30, 2014 .Dt ICMP 4 .Os .Sh NAME @@ -220,6 +220,10 @@ instead of the possibly different return Number of bytes from original packet to quote in ICMP reply. This number is internally enforced to be at least 8 bytes (per RFC792) and at most the maximal space left in the ICMP reply mbuf. +.It Va tstamprepl +.Pq Vt boolean +Enable/disable replies to ICMP Timestamp packets. +Defaults to true. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: Modified: stable/10/sys/netinet/ip_icmp.c ============================================================================== --- stable/10/sys/netinet/ip_icmp.c Thu Apr 16 19:04:38 2015 (r281608) +++ stable/10/sys/netinet/ip_icmp.c Thu Apr 16 19:09:25 2015 (r281609) @@ -148,6 +148,10 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO &VNET_NAME(icmpbmcastecho), 0, ""); +static VNET_DEFINE(int, icmptstamprepl) = 1; +#define V_icmptstamprepl VNET(icmptstamprepl) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, + &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); #ifdef ICMPPRINTFS int icmpprintfs = 0; @@ -541,6 +545,8 @@ icmp_input(struct mbuf *m, int off) goto reflect; case ICMP_TSTAMP: + if (V_icmptstamprepl == 0) + break; if (!V_icmpbmcastecho && (m->m_flags & (M_MCAST | M_BCAST)) != 0) { ICMPSTAT_INC(icps_bmcasttstamp); From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 17 15:39:44 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D62B13B; Fri, 17 Apr 2015 15:39:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B302E5; Fri, 17 Apr 2015 15:39:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3HFdiGO032058; Fri, 17 Apr 2015 15:39:44 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HFdhIX032053; Fri, 17 Apr 2015 15:39:43 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201504171539.t3HFdhIX032053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 17 Apr 2015 15:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281657 - in stable/10/sys: kern netgraph/atm/sscop netgraph/atm/uni sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 15:39:44 -0000 Author: rrs Date: Fri Apr 17 15:39:42 2015 New Revision: 281657 URL: https://svnweb.freebsd.org/changeset/base/281657 Log: MFC of r280785, r280871, r280872, r281510, r218511 - callout fixes. Sponsored by: Netflix Inc. Modified: stable/10/sys/kern/kern_timeout.c stable/10/sys/netgraph/atm/sscop/ng_sscop_cust.h stable/10/sys/netgraph/atm/uni/ng_uni_cust.h stable/10/sys/sys/_callout.h stable/10/sys/sys/callout.h Modified: stable/10/sys/kern/kern_timeout.c ============================================================================== --- stable/10/sys/kern/kern_timeout.c Fri Apr 17 15:26:08 2015 (r281656) +++ stable/10/sys/kern/kern_timeout.c Fri Apr 17 15:39:42 2015 (r281657) @@ -150,9 +150,12 @@ struct callout_cpu { sbintime_t cc_lastscan; void *cc_cookie; u_int cc_bucket; + u_int cc_inited; char cc_ktr_event_name[20]; }; +#define callout_migrating(c) ((c)->c_iflags & CALLOUT_DFRMIGRATION) + #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr #define cc_exec_next(cc) cc->cc_next #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel @@ -253,6 +256,7 @@ callout_callwheel_init(void *dummy) * XXX: Clip callout to result of previous function of maxusers * maximum 384. This is still huge, but acceptable. */ + memset(cc_cpu, 0, sizeof(cc_cpu)); ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); @@ -288,6 +292,7 @@ callout_cpu_init(struct callout_cpu *cc, mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); + cc->cc_inited = 1; cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize, M_CALLOUT, M_WAITOK); for (i = 0; i < callwheelsize; i++) @@ -303,7 +308,7 @@ callout_cpu_init(struct callout_cpu *cc, for (i = 0; i < ncallout; i++) { c = &cc->cc_callout[i]; callout_init(c, 0); - c->c_flags = CALLOUT_LOCAL_ALLOC; + c->c_iflags = CALLOUT_LOCAL_ALLOC; SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle); } } @@ -440,7 +445,7 @@ callout_process(sbintime_t now) * Consumer told us the callout may be run * directly from hardware interrupt context. */ - if (tmp->c_flags & CALLOUT_DIRECT) { + if (tmp->c_iflags & CALLOUT_DIRECT) { #ifdef CALLOUT_PROFILING ++depth_dir; #endif @@ -460,7 +465,7 @@ callout_process(sbintime_t now) LIST_REMOVE(tmp, c_links.le); TAILQ_INSERT_TAIL(&cc->cc_expireq, tmp, c_links.tqe); - tmp->c_flags |= CALLOUT_PROCESSED; + tmp->c_iflags |= CALLOUT_PROCESSED; tmp = tmpn; } continue; @@ -546,8 +551,11 @@ callout_cc_add(struct callout *c, struct if (sbt < cc->cc_lastscan) sbt = cc->cc_lastscan; c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - c->c_flags &= ~CALLOUT_PROCESSED; + c->c_iflags |= CALLOUT_PENDING; + c->c_iflags &= ~CALLOUT_PROCESSED; + c->c_flags |= CALLOUT_ACTIVE; + if (flags & C_DIRECT_EXEC) + c->c_iflags |= CALLOUT_DIRECT; c->c_func = func; c->c_time = sbt; c->c_precision = precision; @@ -577,7 +585,7 @@ static void callout_cc_del(struct callout *c, struct callout_cpu *cc) { - if ((c->c_flags & CALLOUT_LOCAL_ALLOC) == 0) + if ((c->c_iflags & CALLOUT_LOCAL_ALLOC) == 0) return; c->c_func = NULL; SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle); @@ -596,7 +604,7 @@ softclock_call_cc(struct callout *c, str struct lock_class *class; struct lock_object *c_lock; uintptr_t lock_status; - int c_flags; + int c_iflags; #ifdef SMP struct callout_cpu *new_cc; void (*new_func)(void *); @@ -611,9 +619,10 @@ softclock_call_cc(struct callout *c, str static timeout_t *lastfunc; #endif - KASSERT((c->c_flags & (CALLOUT_PENDING | CALLOUT_ACTIVE)) == - (CALLOUT_PENDING | CALLOUT_ACTIVE), - ("softclock_call_cc: pend|act %p %x", c, c->c_flags)); + KASSERT((c->c_iflags & CALLOUT_PENDING) == CALLOUT_PENDING, + ("softclock_call_cc: pend %p %x", c, c->c_iflags)); + KASSERT((c->c_flags & CALLOUT_ACTIVE) == CALLOUT_ACTIVE, + ("softclock_call_cc: act %p %x", c, c->c_flags)); class = (c->c_lock != NULL) ? LOCK_CLASS(c->c_lock) : NULL; lock_status = 0; if (c->c_flags & CALLOUT_SHAREDLOCK) { @@ -625,11 +634,11 @@ softclock_call_cc(struct callout *c, str c_lock = c->c_lock; c_func = c->c_func; c_arg = c->c_arg; - c_flags = c->c_flags; - if (c->c_flags & CALLOUT_LOCAL_ALLOC) - c->c_flags = CALLOUT_LOCAL_ALLOC; + c_iflags = c->c_iflags; + if (c->c_iflags & CALLOUT_LOCAL_ALLOC) + c->c_iflags = CALLOUT_LOCAL_ALLOC; else - c->c_flags &= ~CALLOUT_PENDING; + c->c_iflags &= ~CALLOUT_PENDING; cc_exec_curr(cc, direct) = c; cc_exec_cancel(cc, direct) = false; @@ -692,7 +701,7 @@ softclock_call_cc(struct callout *c, str #endif KTR_STATE0(KTR_SCHED, "callout", cc->cc_ktr_event_name, "idle"); CTR1(KTR_CALLOUT, "callout %p finished", c); - if ((c_flags & CALLOUT_RETURNUNLOCKED) == 0) + if ((c_iflags & CALLOUT_RETURNUNLOCKED) == 0) class->lc_unlock(c_lock); skip: CC_LOCK(cc); @@ -712,14 +721,14 @@ skip: * It should be assert here that the callout is not * destroyed but that is not easy. */ - c->c_flags &= ~CALLOUT_DFRMIGRATION; + c->c_iflags &= ~CALLOUT_DFRMIGRATION; } cc_exec_waiting(cc, direct) = false; CC_UNLOCK(cc); wakeup(&cc_exec_waiting(cc, direct)); CC_LOCK(cc); } else if (cc_cce_migrating(cc, direct)) { - KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0, + KASSERT((c_iflags & CALLOUT_LOCAL_ALLOC) == 0, ("Migrating legacy callout %p", c)); #ifdef SMP /* @@ -746,7 +755,7 @@ skip: callout_cc_del(c, cc); return; } - c->c_flags &= ~CALLOUT_DFRMIGRATION; + c->c_iflags &= ~CALLOUT_DFRMIGRATION; new_cc = callout_cpu_switch(c, cc, new_cpu); flags = (direct) ? C_DIRECT_EXEC : 0; @@ -762,14 +771,14 @@ skip: * If the current callout is locally allocated (from * timeout(9)) then put it on the freelist. * - * Note: we need to check the cached copy of c_flags because + * Note: we need to check the cached copy of c_iflags because * if it was not local, then it's not safe to deref the * callout pointer. */ - KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0 || - c->c_flags == CALLOUT_LOCAL_ALLOC, + KASSERT((c_iflags & CALLOUT_LOCAL_ALLOC) == 0 || + c->c_iflags == CALLOUT_LOCAL_ALLOC, ("corrupted callout")); - if (c_flags & CALLOUT_LOCAL_ALLOC) + if (c_iflags & CALLOUT_LOCAL_ALLOC) callout_cc_del(c, cc); } @@ -912,8 +921,16 @@ callout_reset_sbt_on(struct callout *c, sbintime_t to_sbt, pr; struct callout_cpu *cc; int cancelled, direct; + int ignore_cpu=0; cancelled = 0; + if (cpu == -1) { + ignore_cpu = 1; + } else if ((cpu >= MAXCPU) || + (cc_cpu[cpu].cc_inited == 0)) { + /* Invalid CPU spec */ + panic("Invalid CPU in callout %d", cpu); + } if (flags & C_ABSOLUTE) { to_sbt = sbt; } else { @@ -955,24 +972,29 @@ callout_reset_sbt_on(struct callout *c, if (pr > precision) precision = pr; } - /* - * Don't allow migration of pre-allocated callouts lest they - * become unbalanced. - */ - if (c->c_flags & CALLOUT_LOCAL_ALLOC) - cpu = c->c_cpu; /* * This flag used to be added by callout_cc_add, but the * first time you call this we could end up with the * wrong direct flag if we don't do it before we add. */ if (flags & C_DIRECT_EXEC) { - c->c_flags |= CALLOUT_DIRECT; + direct = 1; + } else { + direct = 0; } - direct = (c->c_flags & CALLOUT_DIRECT) != 0; KASSERT(!direct || c->c_lock == NULL, ("%s: direct callout %p has lock", __func__, c)); cc = callout_lock(c); + /* + * Don't allow migration of pre-allocated callouts lest they + * become unbalanced or handle the case where the user does + * not care. + */ + if ((c->c_iflags & CALLOUT_LOCAL_ALLOC) || + ignore_cpu) { + cpu = c->c_cpu; + } + if (cc_exec_curr(cc, direct) == c) { /* * We're being asked to reschedule a callout which is @@ -1012,15 +1034,17 @@ callout_reset_sbt_on(struct callout *c, } #endif } - if (c->c_flags & CALLOUT_PENDING) { - if ((c->c_flags & CALLOUT_PROCESSED) == 0) { + if (c->c_iflags & CALLOUT_PENDING) { + if ((c->c_iflags & CALLOUT_PROCESSED) == 0) { if (cc_exec_next(cc) == c) cc_exec_next(cc) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); - } else + } else { TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); + } cancelled = 1; - c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_iflags &= ~ CALLOUT_PENDING; + c->c_flags &= ~ CALLOUT_ACTIVE; } #ifdef SMP @@ -1052,7 +1076,8 @@ callout_reset_sbt_on(struct callout *c, cc_migration_prec(cc, direct) = precision; cc_migration_func(cc, direct) = ftn; cc_migration_arg(cc, direct) = arg; - c->c_flags |= (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_iflags |= (CALLOUT_DFRMIGRATION | CALLOUT_PENDING); + c->c_flags |= CALLOUT_ACTIVE; CTR6(KTR_CALLOUT, "migration of %p func %p arg %p in %d.%08x to %u deferred", c, c->c_func, c->c_arg, (int)(to_sbt >> 32), @@ -1112,14 +1137,19 @@ _callout_stop_safe(c, safe) } } else use_lock = 0; - direct = (c->c_flags & CALLOUT_DIRECT) != 0; + if (c->c_iflags & CALLOUT_DIRECT) { + direct = 1; + } else { + direct = 0; + } sq_locked = 0; old_cc = NULL; again: cc = callout_lock(c); - if ((c->c_flags & (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING)) == - (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING)) { + if ((c->c_iflags & (CALLOUT_DFRMIGRATION | CALLOUT_PENDING)) == + (CALLOUT_DFRMIGRATION | CALLOUT_PENDING) && + ((c->c_flags & CALLOUT_ACTIVE) == CALLOUT_ACTIVE)) { /* * Special case where this slipped in while we * were migrating *as* the callout is about to @@ -1132,7 +1162,8 @@ again: * on one yet). When the callout wheel runs, * it will ignore this callout. */ - c->c_flags &= ~(CALLOUT_PENDING|CALLOUT_ACTIVE); + c->c_iflags &= ~CALLOUT_PENDING; + c->c_flags &= ~CALLOUT_ACTIVE; not_on_a_list = 1; } else { not_on_a_list = 0; @@ -1160,7 +1191,7 @@ again: * don't attempt to remove it from the queue. We can try to * stop it by other means however. */ - if (!(c->c_flags & CALLOUT_PENDING)) { + if (!(c->c_iflags & CALLOUT_PENDING)) { c->c_flags &= ~CALLOUT_ACTIVE; /* @@ -1248,6 +1279,16 @@ again: c, c->c_func, c->c_arg); KASSERT(!cc_cce_migrating(cc, direct), ("callout wrongly scheduled for migration")); + if (callout_migrating(c)) { + c->c_iflags &= ~CALLOUT_DFRMIGRATION; +#ifdef SMP + cc_migration_cpu(cc, direct) = CPUBLOCK; + cc_migration_time(cc, direct) = 0; + cc_migration_prec(cc, direct) = 0; + cc_migration_func(cc, direct) = NULL; + cc_migration_arg(cc, direct) = NULL; +#endif + } CC_UNLOCK(cc); KASSERT(!sq_locked, ("sleepqueue chain locked")); return (1); @@ -1260,7 +1301,7 @@ again: * but we can't stop the one thats running so * we return 0. */ - c->c_flags &= ~CALLOUT_DFRMIGRATION; + c->c_iflags &= ~CALLOUT_DFRMIGRATION; #ifdef SMP /* * We can't call cc_cce_cleanup here since @@ -1289,17 +1330,19 @@ again: if (sq_locked) sleepq_release(&cc_exec_waiting(cc, direct)); - c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_iflags &= ~CALLOUT_PENDING; + c->c_flags &= ~CALLOUT_ACTIVE; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); if (not_on_a_list == 0) { - if ((c->c_flags & CALLOUT_PROCESSED) == 0) { + if ((c->c_iflags & CALLOUT_PROCESSED) == 0) { if (cc_exec_next(cc) == c) cc_exec_next(cc) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); - } else + } else { TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); + } } callout_cc_del(c, cc); CC_UNLOCK(cc); @@ -1314,10 +1357,10 @@ callout_init(c, mpsafe) bzero(c, sizeof *c); if (mpsafe) { c->c_lock = NULL; - c->c_flags = CALLOUT_RETURNUNLOCKED; + c->c_iflags = CALLOUT_RETURNUNLOCKED; } else { c->c_lock = &Giant.lock_object; - c->c_flags = 0; + c->c_iflags = 0; } c->c_cpu = timeout_cpu; } @@ -1337,7 +1380,7 @@ _callout_init_lock(c, lock, flags) KASSERT(lock == NULL || !(LOCK_CLASS(lock)->lc_flags & (LC_SPINLOCK | LC_SLEEPABLE)), ("%s: invalid lock class", __func__)); - c->c_flags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); + c->c_iflags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); c->c_cpu = timeout_cpu; } Modified: stable/10/sys/netgraph/atm/sscop/ng_sscop_cust.h ============================================================================== --- stable/10/sys/netgraph/atm/sscop/ng_sscop_cust.h Fri Apr 17 15:26:08 2015 (r281656) +++ stable/10/sys/netgraph/atm/sscop/ng_sscop_cust.h Fri Apr 17 15:39:42 2015 (r281657) @@ -115,7 +115,7 @@ typedef struct callout sscop_timer_t; ng_callout(&(S)->t_##T, (S)->aarg, NULL, \ hz * (S)->timer##T / 1000, T##_func, (S), 0); \ } while (0) -#define TIMER_ISACT(S, T) ((S)->t_##T.c_flags & (CALLOUT_PENDING)) +#define TIMER_ISACT(S, T) (callout_pending(&(S)->t_##T)) /* * This assumes, that the user argument is the node pointer. Modified: stable/10/sys/netgraph/atm/uni/ng_uni_cust.h ============================================================================== --- stable/10/sys/netgraph/atm/uni/ng_uni_cust.h Fri Apr 17 15:26:08 2015 (r281656) +++ stable/10/sys/netgraph/atm/uni/ng_uni_cust.h Fri Apr 17 15:39:42 2015 (r281657) @@ -87,8 +87,8 @@ struct uni_timer { #define _TIMER_STOP(UNI,FIELD) do { \ ng_uncallout(&FIELD.c, (UNI)->arg); \ } while (0) -#define TIMER_ISACT(UNI,T) ((UNI)->T.c.c_flags & (CALLOUT_ACTIVE | \ - CALLOUT_PENDING)) +#define TIMER_ISACT(UNI,T) (callout_active(&(UNI)->T.c) || \ + callout_pending(&(UNI)->T.c)) #define _TIMER_START(UNI,ARG,FIELD,DUE,FUNC) do { \ _TIMER_STOP(UNI, FIELD); \ ng_callout(&FIELD.c, (UNI)->arg, NULL, \ Modified: stable/10/sys/sys/_callout.h ============================================================================== --- stable/10/sys/sys/_callout.h Fri Apr 17 15:26:08 2015 (r281656) +++ stable/10/sys/sys/_callout.h Fri Apr 17 15:39:42 2015 (r281657) @@ -57,7 +57,8 @@ struct callout { void *c_arg; /* function argument */ void (*c_func)(void *); /* function to call */ struct lock_object *c_lock; /* lock to handle */ - int c_flags; /* state of this entry */ + short c_flags; /* User State */ + short c_iflags; /* Internal State */ volatile int c_cpu; /* CPU we're scheduled on */ }; Modified: stable/10/sys/sys/callout.h ============================================================================== --- stable/10/sys/sys/callout.h Fri Apr 17 15:26:08 2015 (r281656) +++ stable/10/sys/sys/callout.h Fri Apr 17 15:39:42 2015 (r281657) @@ -63,8 +63,23 @@ struct callout_handle { }; #ifdef _KERNEL +/* + * Note the flags field is actually *two* fields. The c_flags + * field is the one that caller operations that may, or may not have + * a lock touches i.e. callout_deactivate(). The other, the c_iflags, + * is the internal flags that *must* be kept correct on which the + * callout system depend on e.g. callout_pending(). + * The c_iflag is used internally by the callout system to determine which + * list the callout is on and track internal state. Callers *should not* + * use the c_flags field directly but should use the macros provided. + * + * The c_iflags field holds internal flags that are protected by internal + * locks of the callout subsystem. The c_flags field holds external flags. + * The caller must hold its own lock while manipulating or reading external + * flags via callout_active(), callout_deactivate(), callout_reset*(), or + * callout_stop() to avoid races. + */ #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) -#define callout_migrating(c) ((c)->c_flags & CALLOUT_DFRMIGRATION) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) #define callout_drain(c) _callout_stop_safe(c, 1) void callout_init(struct callout *, int); @@ -78,11 +93,11 @@ void _callout_init_lock(struct callout * #define callout_init_rw(c, rw, flags) \ _callout_init_lock((c), ((rw) != NULL) ? &(rw)->lock_object : \ NULL, (flags)) -#define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) +#define callout_pending(c) ((c)->c_iflags & CALLOUT_PENDING) int callout_reset_sbt_on(struct callout *, sbintime_t, sbintime_t, void (*)(void *), void *, int, int); #define callout_reset_sbt(c, sbt, pr, fn, arg, flags) \ - callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), (c)->c_cpu, (flags)) + callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), -1, (flags)) #define callout_reset_sbt_curcpu(c, sbt, pr, fn, arg, flags) \ callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), PCPU_GET(cpuid),\ (flags)) @@ -90,14 +105,14 @@ int callout_reset_sbt_on(struct callout callout_reset_sbt_on((c), tick_sbt * (to_ticks), 0, (fn), (arg), \ (cpu), C_HARDCLOCK) #define callout_reset(c, on_tick, fn, arg) \ - callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu) + callout_reset_on((c), (on_tick), (fn), (arg), -1) #define callout_reset_curcpu(c, on_tick, fn, arg) \ callout_reset_on((c), (on_tick), (fn), (arg), PCPU_GET(cpuid)) #define callout_schedule_sbt_on(c, sbt, pr, cpu, flags) \ callout_reset_sbt_on((c), (sbt), (pr), (c)->c_func, (c)->c_arg, \ (cpu), (flags)) #define callout_schedule_sbt(c, sbt, pr, flags) \ - callout_schedule_sbt_on((c), (sbt), (pr), (c)->c_cpu, (flags)) + callout_schedule_sbt_on((c), (sbt), (pr), -1, (flags)) #define callout_schedule_sbt_curcpu(c, sbt, pr, flags) \ callout_schedule_sbt_on((c), (sbt), (pr), PCPU_GET(cpuid), (flags)) int callout_schedule(struct callout *, int); From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 17 18:34:01 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FA16CE; Fri, 17 Apr 2015 18:34:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4B87ACC; Fri, 17 Apr 2015 18:34:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3HIY0AZ016963; Fri, 17 Apr 2015 18:34:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HIXxbG016949; Fri, 17 Apr 2015 18:33:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504171833.t3HIXxbG016949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 17 Apr 2015 18:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281661 - stable/10/bin/pax X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 18:34:01 -0000 Author: eadler Date: Fri Apr 17 18:33:59 2015 New Revision: 281661 URL: https://svnweb.freebsd.org/changeset/base/281661 Log: MFC r280206: Implement pax -O option to permit limiting a PAX archive to a single volume. -O Force the archive to be one volume. If a volume ends prematurely, pax will not prompt for a new volume. PR: 198481 Modified: stable/10/bin/pax/ar_io.c stable/10/bin/pax/extern.h stable/10/bin/pax/options.c stable/10/bin/pax/pax.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/pax/ar_io.c ============================================================================== --- stable/10/bin/pax/ar_io.c Fri Apr 17 16:38:59 2015 (r281660) +++ stable/10/bin/pax/ar_io.c Fri Apr 17 18:33:59 2015 (r281661) @@ -82,7 +82,7 @@ static int wr_trail = 1; /* trailer was static int can_unlnk = 0; /* do we unlink null archives? */ const char *arcname; /* printable name of archive */ const char *gzip_program; /* name of gzip program */ -static pid_t zpid = -1; /* pid of child process */ +static pid_t zpid = -1; /* pid of child process */ static int get_phys(void); static void ar_start_gzip(int, const char *, int); @@ -1123,7 +1123,7 @@ ar_next(void) if (sigprocmask(SIG_SETMASK, &o_mask, NULL) < 0) syswarn(0, errno, "Unable to restore signal mask"); - if (done || !wr_trail || strcmp(NM_TAR, argv0) == 0) + if (done || !wr_trail || Oflag || strcmp(NM_TAR, argv0) == 0) return(-1); tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0); Modified: stable/10/bin/pax/extern.h ============================================================================== --- stable/10/bin/pax/extern.h Fri Apr 17 16:38:59 2015 (r281660) +++ stable/10/bin/pax/extern.h Fri Apr 17 18:33:59 2015 (r281661) @@ -217,6 +217,7 @@ extern int vflag; extern int Dflag; extern int Hflag; extern int Lflag; +extern int Oflag; extern int Xflag; extern int Yflag; extern int Zflag; Modified: stable/10/bin/pax/options.c ============================================================================== --- stable/10/bin/pax/options.c Fri Apr 17 16:38:59 2015 (r281660) +++ stable/10/bin/pax/options.c Fri Apr 17 18:33:59 2015 (r281661) @@ -194,7 +194,7 @@ pax_options(int argc, char **argv) /* * process option flags */ - while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ")) + while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ")) != -1) { switch (c) { case 'a': @@ -447,6 +447,12 @@ pax_options(int argc, char **argv) Lflag = 1; flg |= CLF; break; + case 'O': + /* + * Force one volume. Non standard option. + */ + Oflag = 1; + break; case 'P': /* * do NOT follow symlinks (default) @@ -584,7 +590,7 @@ tar_options(int argc, char **argv) { int c; int fstdin = 0; - int Oflag = 0; + int tar_Oflag = 0; int nincfiles = 0; int incfiles_max = 0; struct incfile { @@ -664,7 +670,7 @@ tar_options(int argc, char **argv) if (opt_add("write_opt=nodir") < 0) tar_usage(); case 'O': - Oflag = 1; + tar_Oflag = 1; break; case 'p': /* @@ -820,8 +826,8 @@ tar_options(int argc, char **argv) * (unless -o specified) */ if (act == ARCHIVE || act == APPND) - frmt = &(fsub[Oflag ? F_OTAR : F_TAR]); - else if (Oflag) { + frmt = &(fsub[tar_Oflag ? F_OTAR : F_TAR]); + else if (tar_Oflag) { paxwarn(1, "The -O/-o options are only valid when writing an archive"); tar_usage(); /* only valid when writing */ } @@ -1524,25 +1530,25 @@ no_op(void) void pax_usage(void) { - (void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr); + (void)fputs("usage: pax [-cdnOvz] [-E limit] [-f archive] ", stderr); (void)fputs("[-s replstr] ... [-U user] ...", stderr); (void)fputs("\n [-G group] ... ", stderr); (void)fputs("[-T [from_date][,to_date]] ... ", stderr); (void)fputs("[pattern ...]\n", stderr); - (void)fputs(" pax -r [-cdiknuvzDYZ] [-E limit] ", stderr); + (void)fputs(" pax -r [-cdiknOuvzDYZ] [-E limit] ", stderr); (void)fputs("[-f archive] [-o options] ... \n", stderr); (void)fputs(" [-p string] ... [-s replstr] ... ", stderr); (void)fputs("[-U user] ... [-G group] ...\n ", stderr); (void)fputs("[-T [from_date][,to_date]] ... ", stderr); (void)fputs(" [pattern ...]\n", stderr); - (void)fputs(" pax -w [-dituvzHLPX] [-b blocksize] ", stderr); + (void)fputs(" pax -w [-dituvzHLOPX] [-b blocksize] ", stderr); (void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr); (void)fputs(" [-B bytes] [-s replstr] ... ", stderr); (void)fputs("[-o options] ... [-U user] ...", stderr); (void)fputs("\n [-G group] ... ", stderr); (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr); (void)fputs("[file ...]\n", stderr); - (void)fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr); + (void)fputs(" pax -r -w [-diklntuvDHLOPXYZ] ", stderr); (void)fputs("[-p string] ... [-s replstr] ...", stderr); (void)fputs("\n [-U user] ... [-G group] ... ", stderr); (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr); Modified: stable/10/bin/pax/pax.c ============================================================================== --- stable/10/bin/pax/pax.c Fri Apr 17 16:38:59 2015 (r281660) +++ stable/10/bin/pax/pax.c Fri Apr 17 18:33:59 2015 (r281661) @@ -85,6 +85,7 @@ int vflag; /* produce verbose output * int Dflag; /* same as uflag except inode change time */ int Hflag; /* follow command line symlinks (write only) */ int Lflag; /* follow symlinks when writing */ +int Oflag; /* limit to single volume */ int Xflag; /* archive files with same device id only */ int Yflag; /* same as Dflg except after name mode */ int Zflag; /* same as uflg except after name mode */ From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 18 08:01:16 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B839E5ED; Sat, 18 Apr 2015 08:01:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A20F6AD8; Sat, 18 Apr 2015 08:01:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I81GsG074693; Sat, 18 Apr 2015 08:01:16 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I81DNT074660; Sat, 18 Apr 2015 08:01:13 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201504180801.t3I81DNT074660@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 18 Apr 2015 08:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281687 - in stable/10/sys: contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/disassembler co... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 08:01:16 -0000 Author: jkim Date: Sat Apr 18 08:01:12 2015 New Revision: 281687 URL: https://svnweb.freebsd.org/changeset/base/281687 Log: MFC: r281396, r281475 Merge ACPICA 20150410. Relnotes: yes Modified: stable/10/sys/contrib/dev/acpica/acpica_prep.sh stable/10/sys/contrib/dev/acpica/changes.txt stable/10/sys/contrib/dev/acpica/common/adfile.c stable/10/sys/contrib/dev/acpica/common/adisasm.c stable/10/sys/contrib/dev/acpica/common/dmtable.c stable/10/sys/contrib/dev/acpica/common/dmtbdump.c stable/10/sys/contrib/dev/acpica/common/dmtbinfo.c stable/10/sys/contrib/dev/acpica/compiler/aslcodegen.c stable/10/sys/contrib/dev/acpica/compiler/aslcompile.c stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.h stable/10/sys/contrib/dev/acpica/compiler/asldefine.h stable/10/sys/contrib/dev/acpica/compiler/aslfold.c stable/10/sys/contrib/dev/acpica/compiler/asllisting.c stable/10/sys/contrib/dev/acpica/compiler/aslmain.c stable/10/sys/contrib/dev/acpica/compiler/aslmap.c stable/10/sys/contrib/dev/acpica/compiler/aslmapenter.c stable/10/sys/contrib/dev/acpica/compiler/asloptions.c stable/10/sys/contrib/dev/acpica/compiler/aslrules.y stable/10/sys/contrib/dev/acpica/compiler/aslstartup.c stable/10/sys/contrib/dev/acpica/compiler/asltree.c stable/10/sys/contrib/dev/acpica/compiler/asltypes.y stable/10/sys/contrib/dev/acpica/compiler/aslutils.c stable/10/sys/contrib/dev/acpica/compiler/aslwalks.c stable/10/sys/contrib/dev/acpica/compiler/dtcompile.c stable/10/sys/contrib/dev/acpica/compiler/dtcompiler.h stable/10/sys/contrib/dev/acpica/compiler/dtio.c stable/10/sys/contrib/dev/acpica/compiler/dttable.c stable/10/sys/contrib/dev/acpica/compiler/dttemplate.h stable/10/sys/contrib/dev/acpica/compiler/dtutils.c stable/10/sys/contrib/dev/acpica/components/debugger/dbmethod.c stable/10/sys/contrib/dev/acpica/components/debugger/dbxface.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmopcode.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmwalk.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsutils.c stable/10/sys/contrib/dev/acpica/components/events/evregion.c stable/10/sys/contrib/dev/acpica/components/events/evxfevnt.c stable/10/sys/contrib/dev/acpica/components/executer/exdump.c stable/10/sys/contrib/dev/acpica/components/executer/exfldio.c stable/10/sys/contrib/dev/acpica/components/executer/exoparg3.c stable/10/sys/contrib/dev/acpica/components/executer/exregion.c stable/10/sys/contrib/dev/acpica/components/hardware/hwgpe.c stable/10/sys/contrib/dev/acpica/components/hardware/hwvalid.c stable/10/sys/contrib/dev/acpica/components/namespace/nsdump.c stable/10/sys/contrib/dev/acpica/components/parser/psopcode.c stable/10/sys/contrib/dev/acpica/components/parser/psopinfo.c stable/10/sys/contrib/dev/acpica/components/resources/rsaddr.c stable/10/sys/contrib/dev/acpica/components/resources/rsdump.c stable/10/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c stable/10/sys/contrib/dev/acpica/components/resources/rsxface.c stable/10/sys/contrib/dev/acpica/components/tables/tbdata.c stable/10/sys/contrib/dev/acpica/components/tables/tbinstal.c stable/10/sys/contrib/dev/acpica/components/tables/tbprint.c stable/10/sys/contrib/dev/acpica/components/tables/tbxfroot.c stable/10/sys/contrib/dev/acpica/components/utilities/utaddress.c stable/10/sys/contrib/dev/acpica/components/utilities/utbuffer.c stable/10/sys/contrib/dev/acpica/components/utilities/utglobal.c stable/10/sys/contrib/dev/acpica/components/utilities/utmisc.c stable/10/sys/contrib/dev/acpica/components/utilities/utosi.c stable/10/sys/contrib/dev/acpica/components/utilities/utprint.c stable/10/sys/contrib/dev/acpica/components/utilities/utstate.c stable/10/sys/contrib/dev/acpica/components/utilities/utuuid.c stable/10/sys/contrib/dev/acpica/include/acdebug.h stable/10/sys/contrib/dev/acpica/include/acdisasm.h stable/10/sys/contrib/dev/acpica/include/acglobal.h stable/10/sys/contrib/dev/acpica/include/aclocal.h stable/10/sys/contrib/dev/acpica/include/acmacros.h stable/10/sys/contrib/dev/acpica/include/acopcode.h stable/10/sys/contrib/dev/acpica/include/acpixf.h stable/10/sys/contrib/dev/acpica/include/acresrc.h stable/10/sys/contrib/dev/acpica/include/acrestyp.h stable/10/sys/contrib/dev/acpica/include/acstruct.h stable/10/sys/contrib/dev/acpica/include/actables.h stable/10/sys/contrib/dev/acpica/include/actbl2.h stable/10/sys/contrib/dev/acpica/include/actypes.h stable/10/sys/contrib/dev/acpica/include/acutils.h stable/10/sys/contrib/dev/acpica/include/amlcode.h stable/10/sys/contrib/dev/acpica/include/platform/acenv.h stable/10/sys/dev/acpica/acpi_pcib_acpi.c stable/10/sys/dev/acpica/acpi_resource.c stable/10/sys/x86/acpica/OsdEnvironment.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- stable/10/sys/contrib/dev/acpica/acpica_prep.sh Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/acpica_prep.sh Sat Apr 18 08:01:12 2015 (r281687) @@ -18,11 +18,12 @@ fulldirs="common compiler components inc # files to remove stripdirs="generate libraries tests tools" -stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \ - aclinux.h aclinuxex.h acmacosx.h acmsvc.h acnetbsd.h acos2.h \ - acwin.h acwin64.h new_table.txt osefitbl.c osefixf.c \ - osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c \ - oswintbl.c oswinxf.c readme.txt utclib.c" +stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ + acefi.h achaiku.h acintel.h aclinux.h aclinuxex.h acmacosx.h \ + acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h new_table.txt \ + osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \ + osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \ + readme.txt utclib.c" # include files to canonify src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \ Modified: stable/10/sys/contrib/dev/acpica/changes.txt ============================================================================== --- stable/10/sys/contrib/dev/acpica/changes.txt Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/changes.txt Sat Apr 18 08:01:12 2015 (r281687) @@ -1,7 +1,84 @@ ---------------------------------------- -04 February 2015. Summary of changes for version 20150204: +10 April 2015. Summary of changes for version 20150410: -This release is available at https://acpica.org/downloads +Reverted a change introduced in version 20150408 that caused +a regression in the disassembler where incorrect operator +symbols could be emitted. + +---------------------------------------- +08 April 2015. Summary of changes for version 20150408: + + +1) ACPICA kernel-resident subsystem: + +Permanently set the return value for the _REV predefined name. It now +returns 2 (was 5). This matches other ACPI implementations. _REV will be +deprecated in the future, and is now defined to be 1 for ACPI 1.0, and 2 +for ACPI 2.0 and later. It should never be used to differentiate or +identify operating systems. + +Added the "Windows 2015" string to the _OSI support. ACPICA will now +return TRUE to a query with this string. + +Fixed several issues with the local version of the printf function. + +Added the C99 compiler option (-std=c99) to the Unix makefiles. + + Current Release: + Non-Debug Version: 99.9K Code, 27.4K Data, 127.3K Total + Debug Version: 195.2K Code, 80.7K Data, 275.9K Total + Previous Release: + Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total + Debug Version: 192.1K Code, 79.8K Data, 271.9K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented an enhancement to the constant folding feature to +transform the parse tree to a simple Store operation whenever possible: + Add (2, 3, X) ==> is converted to: Store (5, X) + X = 2 + 3 ==> is converted to: Store (5, X) + +Updated support for the SLIC table (Software Licensing Description Table) +in both the Data Table compiler and the disassembler. The SLIC table +support now conforms to "Microsoft Software Licensing Tables (SLIC and +MSDM). November 29, 2011. Copyright 2011 Microsoft". Note: Any SLIC data +following the ACPI header is now defined to be "Proprietary Data", and as +such, can only be entered or displayed as a hex data block. + +Implemented full support for the MSDM table as described in the document +above. Note: The format of MSDM is similar to SLIC. Any MSDM data +following the ACPI header is defined to be "Proprietary Data", and can +only be entered or displayed as a hex data block. + +Implemented the -Pn option for the iASL Table Compiler (was only +implemented for the ASL compiler). This option disables the iASL +preprocessor. + +Disassembler: For disassembly of Data Tables, added a comment field +around the Ascii equivalent data that is emitted as part of the "Raw +Table Data" block. This prevents the iASL Preprocessor from possible +confusion if/when the table is compiled. + +Disassembler: Added an option (-df) to force the disassembler to assume +that the table being disassembled contains valid AML. This feature is +useful for disassembling AML files that contain ACPI signatures other +than DSDT or SSDT (such as OEMx or other signatures). + +Changes for the EFI version of the tools: +1) Fixed a build error/issue +2) Fixed a cast warning + +iASL: Fixed a path issue with the __FILE__ operator by making the +directory prefix optional within the internal SplitInputFilename +function. + +Debugger: Removed some unused global variables. + +Tests: Updated the makefile for proper generation of the AAPITS suite. + +---------------------------------------- +04 February 2015. Summary of changes for version 20150204: ACPICA kernel-resident subsystem: @@ -14,24 +91,26 @@ Events: Introduce ACPI_GPE_DISPATCH_RAW_ A raw gpe handling mechanism was created to allow better handling of GPE storms that aren't easily managed by the normal handler. The raw handler allows disabling/renabling of the the GPE so that interrupt storms can be -avoided in cases where events cannot be timely serviced. In this scenario, -handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API -will leave the reference counts undisturbed, thereby preventing unintentional -clearing of the GPE when the intent in only to temporarily disable it. Raw -handlers allow enabling and disabling of a GPE by removing GPE register -locking. As such, raw handlers much provide their own locks while using -GPE API's to protect access to GPE data structures. +avoided in cases where events cannot be timely serviced. In this +scenario, handlers should use the AcpiSetGpe() API to disable/enable the +GPE. This API will leave the reference counts undisturbed, thereby +preventing unintentional clearing of the GPE when the intent in only to +temporarily disable it. Raw handlers allow enabling and disabling of a +GPE by removing GPE register locking. As such, raw handlers much provide +their own locks while using GPE API's to protect access to GPE data +structures. Lv Zheng Events: Always modify GPE registers under the GPE lock. Applies GPE lock around AcpiFinishGpe() to protect access to GPE register values. Reported as bug by joe.liu@apple.com. -Unix makefiles: Separate option to disable optimizations and _FORTIFY_SOURCE. -This change removes the _FORTIFY_SOURCE flag from the NOOPT disable option and -creates a separate flag (NOFORTIFY) for this purpose. Some toolchains may -define _FORTIFY_SOURCE which leads redefined errors when building ACPICA. This -allows disabling the option without also having to disable optimazations. +Unix makefiles: Separate option to disable optimizations and +_FORTIFY_SOURCE. This change removes the _FORTIFY_SOURCE flag from the +NOOPT disable option and creates a separate flag (NOFORTIFY) for this +purpose. Some toolchains may define _FORTIFY_SOURCE which leads redefined +errors when building ACPICA. This allows disabling the option without +also having to disable optimazations. David Box Current Release: Modified: stable/10/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/common/adfile.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/common/adfile.c Sat Apr 18 08:01:12 2015 (r281687) @@ -295,7 +295,10 @@ FlSplitInputPathname ( char *Filename; - *OutDirectoryPath = NULL; + if (OutDirectoryPath) + { + *OutDirectoryPath = NULL; + } if (!InputPath) { @@ -340,7 +343,10 @@ FlSplitInputPathname ( return (AE_NO_MEMORY); } - *OutDirectoryPath = DirectoryPath; + if (OutDirectoryPath) + { + *OutDirectoryPath = DirectoryPath; + } if (OutFilename) { Modified: stable/10/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/common/adisasm.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/common/adisasm.c Sat Apr 18 08:01:12 2015 (r281687) @@ -64,6 +64,11 @@ AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); +static ACPI_STATUS +AdStoreTable ( + ACPI_TABLE_HEADER *Table, + UINT32 *TableIndex); + /* Stubs for ASL compiler */ #ifndef ACPI_ASL_COMPILER @@ -298,7 +303,7 @@ AdAmlDisassemble ( return (Status); } - if (!AcpiGbl_DbOpt_disasm) + if (!AcpiGbl_DbOpt_Disasm) { return (AE_OK); } @@ -337,7 +342,6 @@ AdAmlDisassemble ( { fprintf (stderr, "Could not open output file %s\n", DisasmFilename); Status = AE_ERROR; - ACPI_FREE (DisasmFilename); goto Cleanup; } @@ -346,9 +350,11 @@ AdAmlDisassemble ( *OutFilename = DisasmFilename; - if (!AcpiUtIsAmlTable (Table)) + /* ForceAmlDisassembly means to assume the table contains valid AML */ + + if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table)) { - AdDisassemblerHeader (Filename); + AdDisassemblerHeader (Filename, ACPI_IS_DATA_TABLE); AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n", Table->Signature); AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] " @@ -486,7 +492,7 @@ AdAmlDisassemble ( /* Optional displays */ - if (AcpiGbl_DbOpt_disasm) + if (AcpiGbl_DbOpt_Disasm) { /* This is the real disassembly */ @@ -515,7 +521,7 @@ AdAmlDisassemble ( Cleanup: - if (Table && !AcpiUtIsAmlTable (Table)) + if (Table && !AcpiGbl_ForceAmlDisassembly &&!AcpiUtIsAmlTable (Table)) { ACPI_FREE (Table); } @@ -543,6 +549,7 @@ Cleanup: * FUNCTION: AdDisassemblerHeader * * PARAMETERS: Filename - Input file for the table + * TableType - Either AML or DataTable * * RETURN: None * @@ -553,7 +560,8 @@ Cleanup: void AdDisassemblerHeader ( - char *Filename) + char *Filename, + UINT8 TableType) { time_t Timer; @@ -565,17 +573,20 @@ AdDisassemblerHeader ( AcpiOsPrintf ("/*\n"); AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * ")); - if (AcpiGbl_CstyleDisassembly) + if (TableType == ACPI_IS_AML_TABLE) { - AcpiOsPrintf ( - " * Disassembling to symbolic ASL+ operators\n" - " *\n"); - } - else - { - AcpiOsPrintf ( - " * Disassembling to non-symbolic legacy ASL operators\n" - " *\n"); + if (AcpiGbl_CstyleDisassembly) + { + AcpiOsPrintf ( + " * Disassembling to symbolic ASL+ operators\n" + " *\n"); + } + else + { + AcpiOsPrintf ( + " * Disassembling to non-symbolic legacy ASL operators\n" + " *\n"); + } } AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer)); @@ -609,7 +620,7 @@ AdCreateTableHeader ( /* * Print file header and dump original table header */ - AdDisassemblerHeader (Filename); + AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE); AcpiOsPrintf (" * Original Table Header:\n"); AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature); @@ -717,7 +728,7 @@ AdDisplayTables ( return (AE_NOT_EXIST); } - if (!AcpiGbl_DbOpt_verbose) + if (!AcpiGbl_DbOpt_Verbose) { AdCreateTableHeader (Filename, Table); } @@ -725,7 +736,7 @@ AdDisplayTables ( AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX); MpEmitMappingInfo (); - if (AcpiGbl_DbOpt_verbose) + if (AcpiGbl_DbOpt_Verbose) { AcpiOsPrintf ("\n\nTable Header:\n"); AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER), @@ -740,6 +751,43 @@ AdDisplayTables ( } +/******************************************************************************* + * + * FUNCTION: AdStoreTable + * + * PARAMETERS: Table - Table header + * TableIndex - Where the table index is returned + * + * RETURN: Status and table index. + * + * DESCRIPTION: Add an ACPI table to the global table list + * + ******************************************************************************/ + +static ACPI_STATUS +AdStoreTable ( + ACPI_TABLE_HEADER *Table, + UINT32 *TableIndex) +{ + ACPI_STATUS Status; + ACPI_TABLE_DESC *TableDesc; + + + Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Initialize added table */ + + AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table), + ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table); + AcpiTbValidateTable (TableDesc); + return (AE_OK); +} + + /****************************************************************************** * * FUNCTION: AdGetLocalTables @@ -777,8 +825,7 @@ AdGetLocalTables ( /* Store DSDT in the Table Manager */ - Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, - 0, &TableIndex); + Status = AdStoreTable (NewTable, &TableIndex); if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not store DSDT\n"); @@ -871,9 +918,7 @@ AdParseTable ( if (LoadTable) { - Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table, - Table->Length, ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, - &TableIndex); + Status = AdStoreTable (Table, &TableIndex); if (ACPI_FAILURE (Status)) { return (Status); Modified: stable/10/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/common/dmtable.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/common/dmtable.c Sat Apr 18 08:01:12 2015 (r281687) @@ -241,13 +241,6 @@ static const char *AcpiDmPmttS "Unknown SubTable Type" /* Reserved */ }; -static const char *AcpiDmSlicSubnames[] = -{ - "Public Key Structure", - "Windows Marker Structure", - "Unknown SubTable Type" /* Reserved */ -}; - static const char *AcpiDmSratSubnames[] = { "Processor Local APIC/SAPIC Affinity", @@ -339,6 +332,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, + {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm, "Microsoft Data Management table"}, {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "Platform Communications Channel Table"}, {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"}, @@ -515,10 +509,20 @@ AcpiDmDumpDataTable ( } else { - AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n", + AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n", Table->Signature); - fprintf (stderr, "Unknown ACPI table signature [%4.4s], decoding header only\n", + + fprintf (stderr, "Unknown ACPI table signature [%4.4s], ", Table->Signature); + + if (!AcpiGbl_ForceAmlDisassembly) + { + fprintf (stderr, "decoding ACPI table header only\n"); + } + else + { + fprintf (stderr, "assuming table contains valid AML code\n"); + } } } else if (TableData->TableHandler) @@ -686,6 +690,7 @@ AcpiDmDumpTable ( UINT32 ByteLength; UINT8 Temp8; UINT16 Temp16; + UINT32 Temp32; UINT64 Value; ACPI_DMTABLE_DATA *TableData; const char *Name; @@ -715,7 +720,8 @@ AcpiDmDumpTable ( if ((CurrentOffset >= TableLength) || (SubtableLength && (Info->Offset >= SubtableLength))) { - AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n"); + AcpiOsPrintf ( + "**** ACPI table terminates in the middle of a data structure! (dump table)\n"); return (AE_BAD_DATA); } @@ -760,7 +766,6 @@ AcpiDmDumpTable ( case ACPI_DMT_UINT32: case ACPI_DMT_NAME4: case ACPI_DMT_SIG: - case ACPI_DMT_SLIC: case ACPI_DMT_LPIT: ByteLength = 4; @@ -805,6 +810,12 @@ AcpiDmDumpTable ( ByteLength = 128; break; + case ACPI_DMT_BUFFER: + case ACPI_DMT_RAW_BUFFER: + + ByteLength = SubtableLength; + break; + case ACPI_DMT_STRING: ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; @@ -838,7 +849,8 @@ AcpiDmDumpTable ( if (CurrentOffset + ByteLength > TableLength) { - AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n"); + AcpiOsPrintf ( + "**** ACPI table terminates in the middle of a data structure!\n"); return (AE_BAD_DATA); } @@ -1005,8 +1017,9 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%2.2X", *Target); Temp8 = AcpiDmGenerateChecksum (Table, - ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum); + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum); + if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum) { AcpiOsPrintf ( @@ -1032,7 +1045,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_GAS_WIDTH_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, Temp8, AcpiDmGasAccessWidth[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]); break; case ACPI_DMT_GAS: @@ -1069,7 +1082,8 @@ AcpiDmDumpTable ( Temp16 = ACPI_DMAR_TYPE_RESERVED; } - AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), + AcpiDmDmarSubnames[Temp16]); break; case ACPI_DMT_DMAR_SCOPE: @@ -1082,7 +1096,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmDmarScope[Temp8]); break; case ACPI_DMT_EINJACT: @@ -1095,7 +1110,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_EINJ_ACTION_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmEinjActions[Temp8]); break; case ACPI_DMT_EINJINST: @@ -1108,7 +1124,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmEinjInstructions[Temp8]); break; case ACPI_DMT_ERSTACT: @@ -1121,7 +1138,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_ERST_ACTION_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmErstActions[Temp8]); break; case ACPI_DMT_ERSTINST: @@ -1134,7 +1152,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_ERST_INSTRUCTION_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmErstInstructions[Temp8]); break; case ACPI_DMT_GTDT: @@ -1147,7 +1166,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_GTDT_TYPE_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmGtdtSubnames[Temp8]); break; case ACPI_DMT_HEST: @@ -1160,12 +1180,15 @@ AcpiDmDumpTable ( Temp16 = ACPI_HEST_TYPE_RESERVED; } - AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]); + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), + AcpiDmHestSubnames[Temp16]); break; case ACPI_DMT_HESTNTFY: - AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure"); + AcpiOsPrintf (STRING_FORMAT, + "Hardware Error Notification Structure"); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); AcpiOsPrintf ("\n"); @@ -1182,7 +1205,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_HEST_NOTIFY_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmHestNotifySubnames[Temp8]); break; case ACPI_DMT_MADT: @@ -1195,7 +1219,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_MADT_TYPE_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmMadtSubnames[Temp8]); break; case ACPI_DMT_PCCT: @@ -1208,7 +1233,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_PCCT_TYPE_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmPcctSubnames[Temp8]); break; case ACPI_DMT_PMTT: @@ -1221,20 +1247,20 @@ AcpiDmDumpTable ( Temp8 = ACPI_PMTT_TYPE_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmPmttSubnames[Temp8]); break; - case ACPI_DMT_SLIC: - - /* SLIC subtable types */ - - Temp8 = *Target; - if (Temp8 > ACPI_SLIC_TYPE_RESERVED) - { - Temp8 = ACPI_SLIC_TYPE_RESERVED; - } + case ACPI_DMT_RAW_BUFFER: + /* + * Currently only used for SLIC table + */ + AcpiOsPrintf ("/* Proprietary data structure */ "); - AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmSlicSubnames[Temp8]); + AcpiDmDumpBuffer (Table, sizeof (ACPI_TABLE_HEADER), + ByteLength, sizeof (ACPI_TABLE_HEADER), + "Licensing Data", TRUE); + AcpiOsPrintf ("\n"); break; case ACPI_DMT_SRAT: @@ -1247,7 +1273,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_SRAT_TYPE_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmSratSubnames[Temp8]); break; case ACPI_DMT_FADTPM: @@ -1260,7 +1287,8 @@ AcpiDmDumpTable ( Temp8 = ACPI_FADT_PM_RESERVED; } - AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmFadtProfiles[Temp8]); break; case ACPI_DMT_IVRS: @@ -1295,26 +1323,14 @@ AcpiDmDumpTable ( /* LPIT subtable types */ - Temp8 = *Target; - switch (Temp8) + Temp32 = ACPI_GET32 (Target); + if (Temp32 > ACPI_LPIT_TYPE_RESERVED) { - case ACPI_LPIT_TYPE_NATIVE_CSTATE: - - Name = AcpiDmLpitSubnames[0]; - break; - - case ACPI_LPIT_TYPE_SIMPLE_IO: - - Name = AcpiDmLpitSubnames[1]; - break; - - default: - - Name = AcpiDmLpitSubnames[2]; - break; + Temp32 = ACPI_LPIT_TYPE_RESERVED; } - AcpiOsPrintf (UINT32_FORMAT, *Target, Name); + AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target), + AcpiDmLpitSubnames[Temp32]); break; case ACPI_DMT_EXIT: @@ -1331,8 +1347,10 @@ AcpiDmDumpTable ( if (TableOffset && !SubtableLength) { - /* If this table is not the main table, subtable must have valid length */ - + /* + * If this table is not the main table, the subtable must have a + * valid length + */ AcpiOsPrintf ("Invalid zero length subtable\n"); return (AE_BAD_DATA); } Modified: stable/10/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/common/dmtbdump.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/common/dmtbdump.c Sat Apr 18 08:01:12 2015 (r281687) @@ -59,14 +59,6 @@ AcpiDmValidateFadtLength ( UINT32 Revision, UINT32 Length); -static void -AcpiDmDumpBuffer ( - void *Table, - UINT32 BufferOffset, - UINT32 Length, - UINT32 AbsoluteOffset, - char *Header); - /******************************************************************************* * @@ -78,6 +70,7 @@ AcpiDmDumpBuffer ( * AbsoluteOffset - Offset of buffer in the main ACPI table * Header - Name of the buffer field (printed on the * first line only.) + * MultiLine - TRUE if a large, multi-line buffer * * RETURN: None * @@ -86,13 +79,14 @@ AcpiDmDumpBuffer ( * ******************************************************************************/ -static void +void AcpiDmDumpBuffer ( void *Table, UINT32 BufferOffset, UINT32 Length, UINT32 AbsoluteOffset, - char *Header) + char *Header, + BOOLEAN MultiLine) { UINT8 *Buffer; UINT32 i; @@ -110,10 +104,19 @@ AcpiDmDumpBuffer ( { if (!(i % 16)) { - AcpiOsPrintf ("\n"); - AcpiDmLineHeader (AbsoluteOffset, - ((Length - i) > 16) ? 16 : (Length - i), Header); - Header = NULL; + if (MultiLine) + { + /* Insert a backslash - line continuation character */ + + AcpiOsPrintf ("\\\n "); + } + else + { + AcpiOsPrintf ("\n"); + AcpiDmLineHeader (AbsoluteOffset, + ((Length - i) > 16) ? 16 : (Length - i), Header); + Header = NULL; + } } AcpiOsPrintf ("%.02X ", *Buffer); @@ -526,7 +529,7 @@ AcpiDmDumpAsf ( DataOffset++; if (DataOffset > Table->Length) { - AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n"); + AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n"); return; } } @@ -692,7 +695,7 @@ AcpiDmDumpCsrt ( InfoLength = SubSubTable->Length - SubSubOffset; AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength, - Offset + SubOffset + SubSubOffset, "ResourceInfo"); + Offset + SubOffset + SubSubOffset, "ResourceInfo", FALSE); SubSubOffset += InfoLength; /* Point to next sub-subtable */ @@ -812,7 +815,7 @@ AcpiDmDumpDbg2 ( if (SubTable->OemDataOffset) { AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength, - Offset + SubTable->OemDataOffset, "OEM Data"); + Offset + SubTable->OemDataOffset, "OEM Data", FALSE); } /* Point to next subtable */ @@ -2535,67 +2538,8 @@ void AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table) { - ACPI_STATUS Status; - UINT32 Offset = sizeof (ACPI_TABLE_SLIC); - ACPI_SLIC_HEADER *SubTable; - ACPI_DMTABLE_INFO *InfoTable; - - - /* There is no main SLIC table, only subtables */ - - SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoSlicHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - switch (SubTable->Type) - { - case ACPI_SLIC_TYPE_PUBLIC_KEY: - - InfoTable = AcpiDmTableInfoSlic0; - break; - - case ACPI_SLIC_TYPE_WINDOWS_MARKER: - - InfoTable = AcpiDmTableInfoSlic1; - break; - - default: - - AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type); - - /* Attempt to continue */ - - if (!SubTable->Length) - { - AcpiOsPrintf ("Invalid zero length subtable\n"); - return; - } - goto NextSubTable; - } - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, - SubTable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - -NextSubTable: - /* Point to next subtable */ - - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length); - } + AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table, + Table->Length - sizeof (*Table), AcpiDmTableInfoSlic); } Modified: stable/10/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/common/dmtbinfo.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/common/dmtbinfo.c Sat Apr 18 08:01:12 2015 (r281687) @@ -200,9 +200,7 @@ #define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_HEADER,f) #define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) #define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) -#define ACPI_SLICH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_HEADER,f) -#define ACPI_SLIC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_KEY,f) -#define ACPI_SLIC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_MARKER,f) +#define ACPI_SLIC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIC,f) #define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) #define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) @@ -2043,42 +2041,16 @@ ACPI_DMTABLE_INFO AcpiDmTableI /******************************************************************************* * - * SLIC - Software Licensing Description Table. There is no common table, just - * the standard ACPI header and then subtables. + * SLIC - Software Licensing Description Table. This table contains the standard + * ACPI header followed by proprietary data structures * ******************************************************************************/ -/* Common Subtable header (one per Subtable) */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[] = -{ - {ACPI_DMT_SLIC, ACPI_SLICH_OFFSET (Type), "Subtable Type", 0}, - {ACPI_DMT_UINT32, ACPI_SLICH_OFFSET (Length), "Length", DT_LENGTH}, - ACPI_DMT_TERMINATOR -}; - -ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[] = -{ - {ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (KeyType), "Key Type", 0}, - {ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (Version), "Version", 0}, - {ACPI_DMT_UINT16, ACPI_SLIC0_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Algorithm), "Algorithm", 0}, - {ACPI_DMT_NAME4, ACPI_SLIC0_OFFSET (Magic), "Magic", 0}, - {ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (BitLength), "BitLength", 0}, - {ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Exponent), "Exponent", 0}, - {ACPI_DMT_BUF128, ACPI_SLIC0_OFFSET (Modulus[0]), "Modulus", 0}, - ACPI_DMT_TERMINATOR -}; +/* Single subtable, a proprietary format, so treat it as a buffer */ -ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] = +ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] = { - {ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (Version), "Version", 0}, - {ACPI_DMT_NAME6, ACPI_SLIC1_OFFSET (OemId[0]), "Oem ID", 0}, - {ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (OemTableId[0]), "Oem Table ID", 0}, - {ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (WindowsFlag[0]), "Windows Flag", 0}, - {ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (SlicVersion), "SLIC Version", 0}, - {ACPI_DMT_BUF16, ACPI_SLIC1_OFFSET (Reserved[0]), "Reserved", 0}, - {ACPI_DMT_BUF128, ACPI_SLIC1_OFFSET (Signature[0]), "Signature", 0}, + {ACPI_DMT_RAW_BUFFER, 0, "Software Licensing Structure", 0}, ACPI_DMT_TERMINATOR }; @@ -2091,7 +2063,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[] = { - {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0}, + {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0}, ACPI_DMT_TERMINATOR }; Modified: stable/10/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/compiler/aslcodegen.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/compiler/aslcodegen.c Sat Apr 18 08:01:12 2015 (r281687) @@ -460,7 +460,7 @@ CgWriteTableHeader ( /* Compiler version */ - TableHeader.AslCompilerRevision = ASL_REVISION; + TableHeader.AslCompilerRevision = ACPI_CA_VERSION; /* Table length. Checksum zero for now, will rewrite later */ Modified: stable/10/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- stable/10/sys/contrib/dev/acpica/compiler/aslcompile.c Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/compiler/aslcompile.c Sat Apr 18 08:01:12 2015 (r281687) @@ -195,8 +195,16 @@ CmDoCompile ( Event = UtBeginEvent ("Constant folding via AML interpreter"); DbgPrint (ASL_DEBUG_OUTPUT, "\nInterpreting compile-time constant expressions\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, - OpcAmlConstantWalk, NULL, NULL); + + if (Gbl_FoldConstants) + { + TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, + OpcAmlConstantWalk, NULL, NULL); + } + else + { + DbgPrint (ASL_PARSE_OUTPUT, " Optional folding disabled\n"); + } UtEndEvent (Event); /* Update AML opcodes if necessary, after constant folding */ Modified: stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.h Sat Apr 18 07:34:39 2015 (r281686) +++ stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.h Sat Apr 18 08:01:12 2015 (r281687) @@ -686,6 +686,10 @@ TrAllocateNode ( UINT32 ParseOpcode); void +TrPrintNodeCompileFlags ( + UINT32 Flags); + +void TrReleaseNode ( ACPI_PARSE_OBJECT *Op); @@ -705,6 +709,10 @@ TrCreateLeafNode ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * +TrCreateNullTarget ( + void); + +ACPI_PARSE_OBJECT * TrCreateAssignmentNode ( ACPI_PARSE_OBJECT *Target, ACPI_PARSE_OBJECT *Source); Modified: stable/10/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- stable/10/sys/contrib/dev/acpica/compiler/asldefine.h Sat Apr 18 07:34:39 2015 (r281686) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 18 21:22:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BE9DC8; Sat, 18 Apr 2015 21:22:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A3DC348; Sat, 18 Apr 2015 21:22:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILMRns080490; Sat, 18 Apr 2015 21:22:27 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILMRNK080489; Sat, 18 Apr 2015 21:22:27 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504182122.t3ILMRNK080489@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 18 Apr 2015 21:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281706 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:22:27 -0000 Author: rpaulo Date: Sat Apr 18 21:22:26 2015 New Revision: 281706 URL: https://svnweb.freebsd.org/changeset/base/281706 Log: MFC r281406: netmap: improve the netmap attach message on FreeBSD. Modified: stable/10/sys/dev/netmap/netmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/netmap/netmap.c ============================================================================== --- stable/10/sys/dev/netmap/netmap.c Sat Apr 18 21:00:36 2015 (r281705) +++ stable/10/sys/dev/netmap/netmap.c Sat Apr 18 21:22:26 2015 (r281706) @@ -2710,11 +2710,17 @@ netmap_attach(struct netmap_adapter *arg } #endif /* linux */ +#ifdef __FreeBSD__ + if_printf(ifp, "netmap queues/slots: TX %d/%d, RX %d/%d\n", + hwna->up.num_tx_rings, hwna->up.num_tx_desc, + hwna->up.num_rx_rings, hwna->up.num_rx_desc); +#else D("success for %s tx %d/%d rx %d/%d queues/slots", hwna->up.name, hwna->up.num_tx_rings, hwna->up.num_tx_desc, hwna->up.num_rx_rings, hwna->up.num_rx_desc ); +#endif return 0; fail: From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 18 21:24:47 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4711D380; Sat, 18 Apr 2015 21:24:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34B10371; Sat, 18 Apr 2015 21:24:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILOlxE081679; Sat, 18 Apr 2015 21:24:47 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILOkAD081674; Sat, 18 Apr 2015 21:24:46 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504182124.t3ILOkAD081674@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 18 Apr 2015 21:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281708 - in stable/10/sys: dev/atkbdc sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:24:47 -0000 Author: rpaulo Date: Sat Apr 18 21:24:46 2015 New Revision: 281708 URL: https://svnweb.freebsd.org/changeset/base/281708 Log: MFC r281440: Improve Synaptics support for newer touchpads. Enable two finger scrolling by default and disable the edge scrolling if the touchpad has no physical zone for it. Disable directional scrolling by default to avoid using extended buttons as scroll buttons. Add support for ClickPad. On Lenovo laptops, this is the button reported when one presses the touchpad. While there, fix a problem where the extended buttons were not reporting the button release event correctly: we need to save the state of the buttons and report it to sysmouse until we receive a packet from the touchpad indicating the button has been released. This makes it possible to use an extended button to resize a window. On Lenovo laptops, the major buttons are actually reported as extended buttons. Modified: stable/10/sys/dev/atkbdc/psm.c stable/10/sys/sys/mouse.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/atkbdc/psm.c ============================================================================== --- stable/10/sys/dev/atkbdc/psm.c Sat Apr 18 21:23:16 2015 (r281707) +++ stable/10/sys/dev/atkbdc/psm.c Sat Apr 18 21:24:46 2015 (r281708) @@ -198,6 +198,7 @@ typedef struct synapticsinfo { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; int directional_scrolls; + int two_finger_scroll; int min_pressure; int max_pressure; int max_width; @@ -336,6 +337,7 @@ struct psm_softc { /* Driver status inf int lasterr; int cmdcount; struct sigio *async; /* Processes waiting for SIGIO */ + int extended_buttons; }; static devclass_t psm_devclass; @@ -2742,7 +2744,13 @@ proc_synaptics(struct psm_softc *sc, pac if (pb->ipacket[5] & 0x02) touchpad_buttons |= MOUSE_BUTTON7DOWN; } else { - touchpad_buttons |= MOUSE_BUTTON2DOWN; + if (pb->ipacket[4] & 0x01) + touchpad_buttons |= MOUSE_BUTTON1DOWN; + if (pb->ipacket[5] & 0x01) + touchpad_buttons |= MOUSE_BUTTON3DOWN; + if (pb->ipacket[4] & 0x02) + touchpad_buttons |= MOUSE_BUTTON2DOWN; + sc->extended_buttons = touchpad_buttons; } /* @@ -2764,13 +2772,26 @@ proc_synaptics(struct psm_softc *sc, pac mask = (1 << maskedbits) - 1; pb->ipacket[4] &= ~(mask); pb->ipacket[5] &= ~(mask); + } else if (!sc->syninfo.directional_scrolls && + !sc->synaction.in_vscroll) { + /* + * Keep reporting MOUSE DOWN until we get a new packet + * indicating otherwise. + */ + touchpad_buttons |= sc->extended_buttons; } } + /* Handle ClickPad. */ + if (sc->synhw.capClickPad && + ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01)) + touchpad_buttons |= MOUSE_BUTTON1DOWN; ms->button = touchpad_buttons | guest_buttons; - /* Check pressure to detect a real wanted action on the - * touchpad. */ + /* + * Check pressure to detect a real wanted action on the + * touchpad. + */ if (*z >= sc->syninfo.min_pressure) { synapticsaction_t *synaction; int cursor, peer, window; @@ -2783,7 +2804,7 @@ proc_synaptics(struct psm_softc *sc, pac int weight_current, weight_previous, weight_len_squared; int div_min, div_max, div_len; int vscroll_hor_area, vscroll_ver_area; - + int two_finger_scroll; int len, weight_prev_x, weight_prev_y; int div_max_x, div_max_y, div_x, div_y; @@ -2810,6 +2831,7 @@ proc_synaptics(struct psm_softc *sc, pac div_len = sc->syninfo.div_len; vscroll_hor_area = sc->syninfo.vscroll_hor_area; vscroll_ver_area = sc->syninfo.vscroll_ver_area; + two_finger_scroll = sc->syninfo.two_finger_scroll; /* Palm detection. */ if (!( @@ -2969,33 +2991,57 @@ proc_synaptics(struct psm_softc *sc, pac if (timevalcmp(&sc->lastsoftintr, &sc->taptimeout, >) || dxp >= sc->syninfo.vscroll_min_delta || dyp >= sc->syninfo.vscroll_min_delta) { - /* Check for horizontal scrolling. */ - if ((vscroll_hor_area > 0 && - synaction->start_y <= vscroll_hor_area) || - (vscroll_hor_area < 0 && - synaction->start_y >= - 6143 + vscroll_hor_area)) - synaction->in_vscroll += 2; - - /* Check for vertical scrolling. */ - if ((vscroll_ver_area > 0 && - synaction->start_x <= vscroll_ver_area) || - (vscroll_ver_area < 0 && - synaction->start_x >= - 6143 + vscroll_ver_area)) - synaction->in_vscroll += 1; + /* + * Handle two finger scrolling. + * Note that we don't rely on fingers_nb + * as that keeps the maximum number of fingers. + */ + if (two_finger_scroll) { + if (w == 0) { + synaction->in_vscroll += + dyp ? 2 : 0; + synaction->in_vscroll += + dxp ? 1 : 0; + } + } else { + /* Check for horizontal scrolling. */ + if ((vscroll_hor_area > 0 && + synaction->start_y <= + vscroll_hor_area) || + (vscroll_hor_area < 0 && + synaction->start_y >= + 6143 + vscroll_hor_area)) + synaction->in_vscroll += 2; + + /* Check for vertical scrolling. */ + if ((vscroll_ver_area > 0 && + synaction->start_x <= + vscroll_ver_area) || + (vscroll_ver_area < 0 && + synaction->start_x >= + 6143 + vscroll_ver_area)) + synaction->in_vscroll += 1; + } /* Avoid conflicts if area overlaps. */ - if (synaction->in_vscroll == 3) + if (synaction->in_vscroll >= 3) synaction->in_vscroll = (dxp > dyp) ? 2 : 1; } - VLOG(5, (LOG_DEBUG, - "synaptics: virtual scrolling: %s " - "(direction=%d, dxp=%d, dyp=%d)\n", - synaction->in_vscroll ? "YES" : "NO", - synaction->in_vscroll, dxp, dyp)); } + /* + * Reset two finger scrolling when the number of fingers + * is different from two. + */ + if (two_finger_scroll && w != 0) + synaction->in_vscroll = 0; + + VLOG(5, (LOG_DEBUG, + "synaptics: virtual scrolling: %s " + "(direction=%d, dxp=%d, dyp=%d, fingers=%d)\n", + synaction->in_vscroll ? "YES" : "NO", + synaction->in_vscroll, dxp, dyp, + synaction->fingers_nb)); weight_prev_x = weight_prev_y = weight_previous; div_max_x = div_max_y = div_max; @@ -3237,6 +3283,7 @@ SYNAPTICS_END: * That's why the horizontal wheel is disabled by * default for now. */ + if (ms->button & MOUSE_BUTTON4DOWN) { *z = -1; ms->button &= ~MOUSE_BUTTON4DOWN; @@ -3450,7 +3497,7 @@ psmsoftintr(void *arg) c = ((x < 0) ? MOUSE_PS2_XNEG : 0) | ((y < 0) ? MOUSE_PS2_YNEG : 0); break; - + case MOUSE_MODEL_4D: /* * b7 b6 b5 b4 b3 b2 b1 b0 @@ -4098,13 +4145,29 @@ synaptics_sysctl_create_tree(struct psm_ 0, "Synaptics TouchPad"); /* hw.psm.synaptics.directional_scrolls. */ - sc->syninfo.directional_scrolls = 1; + sc->syninfo.directional_scrolls = 0; SYSCTL_ADD_INT(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, "directional_scrolls", CTLFLAG_RW|CTLFLAG_ANYBODY, &sc->syninfo.directional_scrolls, 0, "Enable hardware scrolling pad (if non-zero) or register it as " - "a middle-click (if 0)"); + "extended buttons (if 0)"); + + /* + * Turn off two finger scroll if we have a + * physical area reserved for scrolling or when + * there's no multi finger support. + */ + if (sc->synhw.verticalScroll || sc->synhw.capMultiFinger == 0) + sc->syninfo.two_finger_scroll = 0; + else + sc->syninfo.two_finger_scroll = 1; + /* hw.psm.synaptics.two_finger_scroll. */ + SYSCTL_ADD_INT(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "two_finger_scroll", CTLFLAG_RW|CTLFLAG_ANYBODY, + &sc->syninfo.two_finger_scroll, 0, + "Enable two finger scrolling"); /* hw.psm.synaptics.min_pressure. */ sc->syninfo.min_pressure = 16; @@ -4501,7 +4564,21 @@ enable_synaptics(KBDC kbdc, struct psm_s return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); + synhw.verticalScroll = (status[0] & 0x01) != 0; + synhw.horizontalScroll = (status[0] & 0x02) != 0; + synhw.verticalWheel = (status[0] & 0x08) != 0; synhw.nExtendedButtons = (status[1] & 0xf0) >> 4; + if (verbose >= 2) { + printf(" Extended model ID:\n"); + printf(" verticalScroll: %d\n", + synhw.verticalScroll); + printf(" horizontalScroll: %d\n", + synhw.horizontalScroll); + printf(" verticalWheel: %d\n", + synhw.verticalWheel); + printf(" nExtendedButtons: %d\n", + synhw.nExtendedButtons); + } /* * Add the number of extended buttons to the total * button support count, including the middle button @@ -4522,6 +4599,42 @@ enable_synaptics(KBDC kbdc, struct psm_s printf(" No extended capabilities\n"); } + /* Read the continued capabilities bits. */ + if (mouse_ext_command(kbdc, 0xc) != 0 && + get_mouse_status(kbdc, status, 0, 3) == 3) { + synhw.capClickPad = (status[1] & 0x01) << 1; + synhw.capClickPad |= (status[0] & 0x10) != 0; + synhw.capDeluxeLEDs = (status[1] & 0x02) != 0; + synhw.noAbsoluteFilter = (status[1] & 0x04) != 0; + synhw.capReportsV = (status[1] & 0x08) != 0; + synhw.capUniformClickPad = (status[1] & 0x10) != 0; + synhw.capReportsMin = (status[1] & 0x20) != 0; + synhw.capInterTouch = (status[1] & 0x40) != 0; + synhw.capReportsMax = (status[2] & 0x02) != 0; + synhw.capClearPad = (status[2] & 0x04) != 0; + synhw.capAdvancedGestures = (status[2] & 0x08) != 0; + synhw.capCoveredPad = (status[2] & 0x80) != 0; + + if (verbose >= 2) { + printf(" Continued capabilities:\n"); + printf(" capClickPad: %d\n", synhw.capClickPad); + printf(" capDeluxeLEDs: %d\n", synhw.capDeluxeLEDs); + printf(" noAbsoluteFilter: %d\n", + synhw.noAbsoluteFilter); + printf(" capReportsV: %d\n", synhw.capReportsV); + printf(" capUniformClickPad: %d\n", + synhw.capUniformClickPad); + printf(" capReportsMin: %d\n", synhw.capReportsMin); + printf(" capInterTouch: %d\n", synhw.capInterTouch); + printf(" capReportsMax: %d\n", synhw.capReportsMax); + printf(" capClearPad: %d\n", synhw.capClearPad); + printf(" capAdvancedGestures: %d\n", + synhw.capAdvancedGestures); + printf(" capCoveredPad: %d\n", synhw.capCoveredPad); + } + buttons += synhw.capClickPad; + } + /* * Add the default number of 3 buttons to the total * count of supported buttons reported above. Modified: stable/10/sys/sys/mouse.h ============================================================================== --- stable/10/sys/sys/mouse.h Sat Apr 18 21:23:16 2015 (r281707) +++ stable/10/sys/sys/mouse.h Sat Apr 18 21:24:46 2015 (r281708) @@ -86,7 +86,7 @@ typedef struct mousehw { int type; /* mouse/track ball/pad... */ int model; /* I/F dependent model ID: MOUSE_MODEL_XXX */ int hwid; /* I/F dependent hardware ID - * for the PS/2 mouse, it will be PSM_XXX_ID + * for the PS/2 mouse, it will be PSM_XXX_ID */ } mousehw_t; @@ -110,6 +110,21 @@ typedef struct synapticshw { int capMiddle; int nExtendedButtons; int nExtendedQueries; + int capClickPad; + int capDeluxeLEDs; + int noAbsoluteFilter; + int capReportsV; + int capUniformClickPad; + int capReportsMin; + int capInterTouch; + int capReportsMax; + int capClearPad; + int capAdvancedGestures; + int multiFingerMode; + int capCoveredPad; + int verticalScroll; + int horizontalScroll; + int verticalWheel; } synapticshw_t; /* iftype */ @@ -269,7 +284,7 @@ typedef struct mousevar { #define MOUSE_PS2_BUTTON2DOWN 0x04 /* middle */ #define MOUSE_PS2_BUTTON3DOWN 0x02 /* right */ #define MOUSE_PS2_TAP MOUSE_PS2_SYNC /* GlidePoint (PS/2) `tapping' - * Yes! this is the same bit + * Yes! this is the same bit * as SYNC! */ @@ -324,11 +339,11 @@ typedef struct mousevar { #define MOUSE_PS2VERSA_TAP 0x02 /* A4 Tech 4D Mouse (PS/2) data packet */ -#define MOUSE_4D_PACKETSIZE 3 +#define MOUSE_4D_PACKETSIZE 3 #define MOUSE_4D_WHEELBITS 0xf0 /* A4 Tech 4D+ Mouse (PS/2) data packet */ -#define MOUSE_4DPLUS_PACKETSIZE 3 +#define MOUSE_4DPLUS_PACKETSIZE 3 #define MOUSE_4DPLUS_ZNEG 0x04 /* sign bit */ #define MOUSE_4DPLUS_BUTTON4DOWN 0x08 @@ -340,7 +355,7 @@ typedef struct mousevar { * as at the level 0. There are additional three bytes which shows * `dz' and the states of additional buttons. `dz' is expressed as the * sum of the byte 5 and 6 which contain signed seven bit values. - * The states of the button 4 though 10 are in the bit 0 though 6 in + * The states of the button 4 though 10 are in the bit 0 though 6 in * the byte 7 respectively: 1 indicates the button is up. */ #define MOUSE_SYS_PACKETSIZE 8 From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 18 21:26:48 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 423C84C4; Sat, 18 Apr 2015 21:26:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2334237D; Sat, 18 Apr 2015 21:26:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILQmpf082839; Sat, 18 Apr 2015 21:26:48 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILQlCd082838; Sat, 18 Apr 2015 21:26:47 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504182126.t3ILQlCd082838@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 18 Apr 2015 21:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281709 - stable/10/sys/dev/atkbdc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:26:48 -0000 Author: rpaulo Date: Sat Apr 18 21:26:47 2015 New Revision: 281709 URL: https://svnweb.freebsd.org/changeset/base/281709 Log: MFC r281441: Add support for controlling the trackpoint when Synaptics is enabled. Modified: stable/10/sys/dev/atkbdc/psm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/atkbdc/psm.c ============================================================================== --- stable/10/sys/dev/atkbdc/psm.c Sat Apr 18 21:24:46 2015 (r281708) +++ stable/10/sys/dev/atkbdc/psm.c Sat Apr 18 21:26:47 2015 (r281709) @@ -191,7 +191,8 @@ enum { SYNAPTICS_SYSCTL_VSCROLL_VER_AREA, SYNAPTICS_SYSCTL_VSCROLL_MIN_DELTA, SYNAPTICS_SYSCTL_VSCROLL_DIV_MIN, - SYNAPTICS_SYSCTL_VSCROLL_DIV_MAX + SYNAPTICS_SYSCTL_VSCROLL_DIV_MAX, + SYNAPTICS_SYSCTL_TOUCHPAD_OFF }; typedef struct synapticsinfo { @@ -229,6 +230,7 @@ typedef struct synapticsinfo { int vscroll_min_delta; int vscroll_div_min; int vscroll_div_max; + int touchpad_off; } synapticsinfo_t; typedef struct synapticspacket { @@ -474,6 +476,10 @@ static probefunc_t enable_synaptics; static probefunc_t enable_trackpoint; static probefunc_t enable_versapad; +static void set_trackpoint_parameters(struct psm_softc *sc); +static void synaptics_passthrough_on(struct psm_softc *sc); +static void synaptics_passthrough_off(struct psm_softc *sc); + static struct { int model; u_char syncmask; @@ -881,6 +887,13 @@ doinitialize(struct psm_softc *sc, mouse set_mouse_resolution(kbdc, mode->resolution); set_mouse_scaling(kbdc, 1); set_mouse_mode(kbdc); + + /* + * Trackpoint settings are lost on resume. + * Restore them here. + */ + if (sc->tphw > 0) + set_trackpoint_parameters(sc); } /* Record sync on the next data packet we see. */ @@ -2715,6 +2728,12 @@ proc_synaptics(struct psm_softc *sc, pac goto SYNAPTICS_END; } + if (sc->syninfo.touchpad_off) { + *x = *y = *z = 0; + ms->button = ms->obutton; + goto SYNAPTICS_END; + } + /* Button presses */ touchpad_buttons = 0; if (pb->ipacket[0] & 0x01) @@ -4121,6 +4140,10 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) if (arg < -6143 || arg > 6143) return (EINVAL); break; + case SYNAPTICS_SYSCTL_TOUCHPAD_OFF: + if (arg < 0 || arg > 1) + return (EINVAL); + break; default: return (EINVAL); } @@ -4448,6 +4471,15 @@ synaptics_sysctl_create_tree(struct psm_ &sc->syninfo.vscroll_div_max, SYNAPTICS_SYSCTL_VSCROLL_DIV_MAX, synaptics_sysctl, "I", "Divisor for slow scrolling"); + + /* hw.psm.synaptics.touchpad_off. */ + sc->syninfo.touchpad_off = 0; + SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "touchpad_off", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + &sc->syninfo.touchpad_off, SYNAPTICS_SYSCTL_TOUCHPAD_OFF, + synaptics_sysctl, "I", + "Turn off touchpad"); } static int @@ -4671,25 +4703,75 @@ enable_synaptics(KBDC kbdc, struct psm_s VLOG(3, (LOG_DEBUG, "synaptics: END init (%d buttons)\n", buttons)); if (sc != NULL) { + if (trackpoint_support && synhw.capPassthrough) { + synaptics_passthrough_on(sc); + enable_trackpoint(kbdc, sc); + synaptics_passthrough_off(sc); + } /* Create sysctl tree. */ synaptics_sysctl_create_tree(sc); - sc->hw.buttons = buttons; } return (TRUE); } +static void +synaptics_passthrough_on(struct psm_softc *sc) +{ + int mode_byte; + + mode_byte = 0xc1 | (1 << 5); + VLOG(2, (LOG_NOTICE, "psm: setting pass-through mode. %d\n", + mode_byte)); + mouse_ext_command(sc->kbdc, mode_byte); + + /* "Commit" the Set Mode Byte command sent above. */ + set_mouse_sampling_rate(sc->kbdc, 20); +} + +static void +synaptics_passthrough_off(struct psm_softc *sc) +{ + int mode_byte; + + mode_byte = 0xc1; + VLOG(2, (LOG_NOTICE, "psm: turning pass-through mode off.\n")); + set_mouse_scaling(sc->kbdc, 2); + set_mouse_scaling(sc->kbdc, 1); + mouse_ext_command(sc->kbdc, mode_byte); + + /* "Commit" the Set Mode Byte command sent above. */ + set_mouse_sampling_rate(sc->kbdc, 20); +} + /* IBM/Lenovo TrackPoint */ static int -trackpoint_command(KBDC kbdc, int cmd, int loc, int val) +trackpoint_command(struct psm_softc *sc, int cmd, int loc, int val) { const int seq[] = { 0xe2, cmd, loc, val }; int i; - for (i = 0; i < nitems(seq); i++) - if (send_aux_command(kbdc, seq[i]) != PSM_ACK) + if (sc->synhw.capPassthrough) + synaptics_passthrough_on(sc); + + for (i = 0; i < nitems(seq); i++) { + if (sc->synhw.capPassthrough && + (seq[i] == 0xff || seq[i] == 0xe7)) + if (send_aux_command(sc->kbdc, 0xe7) != PSM_ACK) { + synaptics_passthrough_off(sc); + return (EIO); + } + if (send_aux_command(sc->kbdc, seq[i]) != PSM_ACK) { + if (sc->synhw.capPassthrough) + synaptics_passthrough_off(sc); return (EIO); + } + } + + if (sc->synhw.capPassthrough) + synaptics_passthrough_off(sc); + return (0); } @@ -4732,7 +4814,7 @@ trackpoint_sysctl(SYSCTL_HANDLER_ARGS) return (0); if (newval < 0 || newval > (tp[TPMASK] == 0 ? 255 : 1)) return (EINVAL); - error = trackpoint_command(sc->kbdc, tp[TPMASK] == 0 ? 0x81 : 0x47, + error = trackpoint_command(sc, tp[TPMASK] == 0 ? 0x81 : 0x47, tp[TPLOC], tp[TPMASK] == 0 ? newval : tp[TPMASK]); if (error != 0) return (error); @@ -4755,7 +4837,7 @@ trackpoint_sysctl_create_tree(struct psm 0, "IBM/Lenovo TrackPoint"); /* hw.psm.trackpoint.sensitivity */ - sc->tpinfo.sensitivity = 0x64; + sc->tpinfo.sensitivity = 0x80; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, "sensitivity", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, @@ -4863,6 +4945,25 @@ trackpoint_sysctl_create_tree(struct psm "Skip backups from drags"); } +static void +set_trackpoint_parameters(struct psm_softc *sc) +{ + trackpoint_command(sc, 0x81, 0x4a, sc->tpinfo.sensitivity); + trackpoint_command(sc, 0x81, 0x60, sc->tpinfo.uplateau); + trackpoint_command(sc, 0x81, 0x4d, sc->tpinfo.inertia); + trackpoint_command(sc, 0x81, 0x57, sc->tpinfo.reach); + trackpoint_command(sc, 0x81, 0x58, sc->tpinfo.draghys); + trackpoint_command(sc, 0x81, 0x59, sc->tpinfo.mindrag); + trackpoint_command(sc, 0x81, 0x5a, sc->tpinfo.upthresh); + trackpoint_command(sc, 0x81, 0x5c, sc->tpinfo.threshold); + trackpoint_command(sc, 0x81, 0x5d, sc->tpinfo.jenks); + trackpoint_command(sc, 0x81, 0x5e, sc->tpinfo.ztime); + if (sc->tpinfo.pts == 0x01) + trackpoint_command(sc, 0x47, 0x2c, 0x01); + if (sc->tpinfo.skipback == 0x01) + trackpoint_command(sc, 0x47, 0x2d, 0x08); +} + static int enable_trackpoint(KBDC kbdc, struct psm_softc *sc) { @@ -4883,23 +4984,14 @@ enable_trackpoint(KBDC kbdc, struct psm_ /* Create sysctl tree. */ trackpoint_sysctl_create_tree(sc); - trackpoint_command(kbdc, 0x81, 0x4a, sc->tpinfo.sensitivity); - trackpoint_command(kbdc, 0x81, 0x4d, sc->tpinfo.inertia); - trackpoint_command(kbdc, 0x81, 0x60, sc->tpinfo.uplateau); - trackpoint_command(kbdc, 0x81, 0x57, sc->tpinfo.reach); - trackpoint_command(kbdc, 0x81, 0x58, sc->tpinfo.draghys); - trackpoint_command(kbdc, 0x81, 0x59, sc->tpinfo.mindrag); - trackpoint_command(kbdc, 0x81, 0x5a, sc->tpinfo.upthresh); - trackpoint_command(kbdc, 0x81, 0x5c, sc->tpinfo.threshold); - trackpoint_command(kbdc, 0x81, 0x5d, sc->tpinfo.jenks); - trackpoint_command(kbdc, 0x81, 0x5e, sc->tpinfo.ztime); - if (sc->tpinfo.pts == 0x01) - trackpoint_command(kbdc, 0x47, 0x2c, 0x01); - if (sc->tpinfo.skipback == 0x01) - trackpoint_command(kbdc, 0x47, 0x2d, 0x08); - - sc->hw.hwid = id; - sc->hw.buttons = 3; + /* + * Don't overwrite hwid and buttons when we are + * a guest device. + */ + if (!sc->synhw.capPassthrough) { + sc->hw.hwid = id; + sc->hw.buttons = 3; + } } return (TRUE); From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 18 21:31:37 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 002CA7BA; Sat, 18 Apr 2015 21:31:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2542637; Sat, 18 Apr 2015 21:31:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILVasQ089162; Sat, 18 Apr 2015 21:31:36 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILVaLA089161; Sat, 18 Apr 2015 21:31:36 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201504182131.t3ILVaLA089161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 18 Apr 2015 21:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281711 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:31:37 -0000 Author: jilles Date: Sat Apr 18 21:31:36 2015 New Revision: 281711 URL: https://svnweb.freebsd.org/changeset/base/281711 Log: MFC r260571: fts: Stat things relative to the directory fd, if possible. As a result, the kernel needs to process shorter pathnames if fts is not changing directories (if fts follows symlinks (-L option to utilities), fts cannot open "." or FTS_NOCHDIR was specified). Side effect: If pathnames exceed PATH_MAX, [ENAMETOOLONG] is not hit at the stat stage but later (opendir or application fts_accpath) or not at all. Modified: stable/10/lib/libc/gen/fts.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/fts.c ============================================================================== --- stable/10/lib/libc/gen/fts.c Sat Apr 18 21:27:28 2015 (r281710) +++ stable/10/lib/libc/gen/fts.c Sat Apr 18 21:31:36 2015 (r281711) @@ -62,7 +62,7 @@ static size_t fts_maxarglen(char * cons static void fts_padjust(FTS *, FTSENT *); static int fts_palloc(FTS *, size_t); static FTSENT *fts_sort(FTS *, FTSENT *, size_t); -static int fts_stat(FTS *, FTSENT *, int); +static int fts_stat(FTS *, FTSENT *, int, int); static int fts_safe_changedir(FTS *, FTSENT *, int, char *); static int fts_ufslinks(FTS *, const FTSENT *); @@ -167,7 +167,7 @@ fts_open(argv, options, compar) p->fts_level = FTS_ROOTLEVEL; p->fts_parent = parent; p->fts_accpath = p->fts_name; - p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW)); + p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW), -1); /* Command-line "." and ".." are real directories. */ if (p->fts_info == FTS_DOT) @@ -322,7 +322,7 @@ fts_read(FTS *sp) /* Any type of file may be re-visited; re-stat and re-turn. */ if (instr == FTS_AGAIN) { - p->fts_info = fts_stat(sp, p, 0); + p->fts_info = fts_stat(sp, p, 0, -1); return (p); } @@ -334,7 +334,7 @@ fts_read(FTS *sp) */ if (instr == FTS_FOLLOW && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { - p->fts_info = fts_stat(sp, p, 1); + p->fts_info = fts_stat(sp, p, 1, -1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) { @@ -426,7 +426,7 @@ next: tmp = p; goto next; } if (p->fts_instr == FTS_FOLLOW) { - p->fts_info = fts_stat(sp, p, 1); + p->fts_info = fts_stat(sp, p, 1, -1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) { @@ -800,10 +800,11 @@ mem1: saved_errno = errno; if (ISSET(FTS_NOCHDIR)) { p->fts_accpath = p->fts_path; memmove(cp, p->fts_name, p->fts_namelen + 1); - } else + p->fts_info = fts_stat(sp, p, 0, _dirfd(dirp)); + } else { p->fts_accpath = p->fts_name; - /* Stat it. */ - p->fts_info = fts_stat(sp, p, 0); + p->fts_info = fts_stat(sp, p, 0, -1); + } /* Decrement link count if applicable. */ if (nlinks > 0 && (p->fts_info == FTS_D || @@ -868,13 +869,19 @@ mem1: saved_errno = errno; } static int -fts_stat(FTS *sp, FTSENT *p, int follow) +fts_stat(FTS *sp, FTSENT *p, int follow, int dfd) { FTSENT *t; dev_t dev; ino_t ino; struct stat *sbp, sb; int saved_errno; + const char *path; + + if (dfd == -1) + path = p->fts_accpath, dfd = AT_FDCWD; + else + path = p->fts_name; /* If user needs stat info, stat buffer already allocated. */ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp; @@ -896,16 +903,16 @@ fts_stat(FTS *sp, FTSENT *p, int follow) * fail, set the errno from the stat call. */ if (ISSET(FTS_LOGICAL) || follow) { - if (stat(p->fts_accpath, sbp)) { + if (fstatat(dfd, path, sbp, 0)) { saved_errno = errno; - if (!lstat(p->fts_accpath, sbp)) { + if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { errno = 0; return (FTS_SLNONE); } p->fts_errno = saved_errno; goto err; } - } else if (lstat(p->fts_accpath, sbp)) { + } else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { p->fts_errno = errno; err: memset(sbp, 0, sizeof(struct stat)); return (FTS_NS);