From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 00:02:33 2015 Return-Path: Delivered-To: svn-src-all@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 D2CE856A; Sun, 12 Apr 2015 00:02: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 A64DFA4D; Sun, 12 Apr 2015 00:02: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 t3C02XDU017175; Sun, 12 Apr 2015 00:02:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C02X4C017174; Sun, 12 Apr 2015 00:02:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201504120002.t3C02X4C017174@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 12 Apr 2015 00:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281445 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 00:02:33 -0000 Author: adrian Date: Sun Apr 12 00:02:32 2015 New Revision: 281445 URL: https://svnweb.freebsd.org/changeset/base/281445 Log: Start enabling the available GPIO pins on the Carambola 2. The carambola2 exposes all the gpio pins, but some are reserved for core functions (eg usb, ethernet, etc.) Others are configured by default to be available as normal GPIO pins to do interesting things with. GPIO 18->23 is the I2S, SLIC and SPDIF device pins, but none of those are currently used. So, just allow those to show up. Tested: * AR9344, Carambola 2 * (.. bitbang SPI to an Adafruit LCD via libgpio, because FreeBSD could do with more shiny output devices that aren't network interfaces.) TODO: There are some other pins aren't currently included here, but should be. The LED pins are for the internal switch inside the AR9344. * GPIO 0+1 are "LED0 + LED1", but they're tied to high for bootstrapping. * GPIO 13-17 are "LED2..7", but they're tied (H, L, L, L, H) for bootstrapping. * GPIO 11 and 12 are UART RTS/CTS or I2S; but GPIO 12 is tied L for bootstrap. Modified: head/sys/mips/conf/CARAMBOLA2.hints Modified: head/sys/mips/conf/CARAMBOLA2.hints ============================================================================== --- head/sys/mips/conf/CARAMBOLA2.hints Sat Apr 11 22:57:13 2015 (r281444) +++ head/sys/mips/conf/CARAMBOLA2.hints Sun Apr 12 00:02:32 2015 (r281445) @@ -98,19 +98,4 @@ hint.gpio.0.function_set=0x00000000 hint.gpio.0.function_clear=0x00000000 # These are the GPIO LEDs and buttons which can be software controlled. -#hint.gpio.0.pinmask=0x001c02ae -hint.gpio.0.pinmask=0x00001803 - -# gpio0 - WLAN LED -# gpio1 - USB LED -# gpio11 - Jumpstart button -# gpio12 - Reset button - -# LEDs are configured separately and driven by the LED device -hint.gpioled.0.at="gpiobus0" -hint.gpioled.0.name="wlan" -hint.gpioled.0.pins=0x0001 - -hint.gpioled.1.at="gpiobus0" -hint.gpioled.1.name="usb" -hint.gpioled.1.pins=0x0002 +hint.gpio.0.pinmask=0x00fc1803 From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 01:14:44 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 06:21:59 2015 Return-Path: Delivered-To: svn-src-all@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 B17FA651; Sun, 12 Apr 2015 06:21:59 +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 9D233D9; Sun, 12 Apr 2015 06:21:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3C6Lx4g095212; Sun, 12 Apr 2015 06:21:59 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C6LxAV095209; Sun, 12 Apr 2015 06:21:59 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201504120621.t3C6LxAV095209@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 06:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281451 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 06:21:59 -0000 Author: dchagin Date: Sun Apr 12 06:21:58 2015 New Revision: 281451 URL: https://svnweb.freebsd.org/changeset/base/281451 Log: Rework r281162. Indeed, the flexible array member is preferable here. Suggested by: Justin T. Gibbs MFC after: 3 days Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Apr 12 06:18:24 2015 (r281450) +++ head/sys/vm/uma_core.c Sun Apr 12 06:21:58 2015 (r281451) @@ -1822,7 +1822,7 @@ uma_startup(void *bootmem, int boot_page #endif args.name = "UMA Zones"; args.size = sizeof(struct uma_zone) + - (sizeof(struct uma_cache) * (mp_maxid)); + (sizeof(struct uma_cache) * (mp_maxid + 1)); args.ctor = zone_ctor; args.dtor = zone_dtor; args.uminit = zero_init; Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sun Apr 12 06:18:24 2015 (r281450) +++ head/sys/vm/uma_int.h Sun Apr 12 06:21:58 2015 (r281451) @@ -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-all@FreeBSD.ORG Sun Apr 12 06:43:15 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 06:45:45 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 06:52:46 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 06:52:47 -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-all@FreeBSD.ORG Sun Apr 12 06:54:54 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 07:03:27 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 07:05:21 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 07:24:11 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 08:10:19 2015 Return-Path: Delivered-To: svn-src-all@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 5D17025C; Sun, 12 Apr 2015 08:10: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 498F2D65; Sun, 12 Apr 2015 08:10: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 t3C8AJAB043885; Sun, 12 Apr 2015 08:10:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C8AJP1043884; Sun, 12 Apr 2015 08:10:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504120810.t3C8AJP1043884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 12 Apr 2015 08:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281459 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 08:10:19 -0000 Author: andrew Date: Sun Apr 12 08:10:18 2015 New Revision: 281459 URL: https://svnweb.freebsd.org/changeset/base/281459 Log: Switch to the new v6 pmap code to increase its testing. It will now be built as part of universe. Modified: head/sys/arm/conf/VIRT Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Sun Apr 12 07:24:10 2015 (r281458) +++ head/sys/arm/conf/VIRT Sun Apr 12 08:10:18 2015 (r281459) @@ -57,6 +57,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 09:36:53 2015 Return-Path: Delivered-To: svn-src-all@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 E84837CC; Sun, 12 Apr 2015 09:36: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 D309686B; Sun, 12 Apr 2015 09:36: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 t3C9aqdS086268; Sun, 12 Apr 2015 09:36:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3C9apjo086264; Sun, 12 Apr 2015 09:36:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201504120936.t3C9apjo086264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 12 Apr 2015 09:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281461 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 09:36:53 -0000 Author: trasz Date: Sun Apr 12 09:36:50 2015 New Revision: 281461 URL: https://svnweb.freebsd.org/changeset/base/281461 Log: Add libxo(3) support to iscsictl(8). PR: 198396 Submitted by: Marie Helene Kvello-Aune MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/Makefile head/usr.bin/iscsictl/iscsictl.c head/usr.bin/iscsictl/parse.y head/usr.bin/iscsictl/periphs.c Modified: head/usr.bin/iscsictl/Makefile ============================================================================== --- head/usr.bin/iscsictl/Makefile Sun Apr 12 08:19:04 2015 (r281460) +++ head/usr.bin/iscsictl/Makefile Sun Apr 12 09:36:50 2015 (r281461) @@ -6,6 +6,8 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/../../sys/dev/iscsi MAN= iscsi.conf.5 iscsictl.8 +LIBADD= xo + YFLAGS+= -v LFLAGS+= -i CLEANFILES= y.tab.c y.tab.h y.output Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Sun Apr 12 08:19:04 2015 (r281460) +++ head/usr.bin/iscsictl/iscsictl.c Sun Apr 12 09:36:50 2015 (r281461) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -44,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "iscsictl.h" @@ -55,7 +55,7 @@ conf_new(void) conf = calloc(1, sizeof(*conf)); if (conf == NULL) - err(1, "calloc"); + xo_err(1, "calloc"); TAILQ_INIT(&conf->conf_targets); @@ -83,7 +83,7 @@ target_new(struct conf *conf) targ = calloc(1, sizeof(*targ)); if (targ == NULL) - err(1, "calloc"); + xo_err(1, "calloc"); targ->t_conf = conf; TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); @@ -110,12 +110,12 @@ default_initiator_name(void) name = calloc(1, namelen + 1); if (name == NULL) - err(1, "calloc"); + xo_err(1, "calloc"); strcpy(name, DEFAULT_IQN); error = gethostname(name + strlen(DEFAULT_IQN), namelen - strlen(DEFAULT_IQN)); if (error != 0) - err(1, "gethostname"); + xo_err(1, "gethostname"); return (name); } @@ -158,7 +158,7 @@ valid_iscsi_name(const char *name) int i; if (strlen(name) >= MAX_NAME_LEN) { - warnx("overlong name for \"%s\"; max length allowed " + xo_warnx("overlong name for \"%s\"; max length allowed " "by iSCSI specification is %d characters", name, MAX_NAME_LEN); return (false); @@ -178,7 +178,7 @@ valid_iscsi_name(const char *name) continue; if (name[i] == '-' || name[i] == '.' || name[i] == ':') continue; - warnx("invalid character \"%c\" in iSCSI name " + xo_warnx("invalid character \"%c\" in iSCSI name " "\"%s\"; allowed characters are letters, digits, " "'-', '.', and ':'", name[i], name); break; @@ -188,12 +188,12 @@ valid_iscsi_name(const char *name) */ } else if (strncasecmp(name, "eui.", strlen("eui.")) == 0) { if (strlen(name) != strlen("eui.") + 16) - warnx("invalid iSCSI name \"%s\"; the \"eui.\" " + xo_warnx("invalid iSCSI name \"%s\"; the \"eui.\" " "should be followed by exactly 16 hexadecimal " "digits", name); for (i = strlen("eui."); name[i] != '\0'; i++) { if (!valid_hex(name[i])) { - warnx("invalid character \"%c\" in iSCSI " + xo_warnx("invalid character \"%c\" in iSCSI " "name \"%s\"; allowed characters are 1-9 " "and A-F", name[i], name); break; @@ -201,19 +201,19 @@ valid_iscsi_name(const char *name) } } else if (strncasecmp(name, "naa.", strlen("naa.")) == 0) { if (strlen(name) > strlen("naa.") + 32) - warnx("invalid iSCSI name \"%s\"; the \"naa.\" " + xo_warnx("invalid iSCSI name \"%s\"; the \"naa.\" " "should be followed by at most 32 hexadecimal " "digits", name); for (i = strlen("naa."); name[i] != '\0'; i++) { if (!valid_hex(name[i])) { - warnx("invalid character \"%c\" in ISCSI " + xo_warnx("invalid character \"%c\" in ISCSI " "name \"%s\"; allowed characters are 1-9 " "and A-F", name[i], name); break; } } } else { - warnx("invalid iSCSI name \"%s\"; should start with " + xo_warnx("invalid iSCSI name \"%s\"; should start with " "either \".iqn\", \"eui.\", or \"naa.\"", name); } @@ -231,26 +231,26 @@ conf_verify(struct conf *conf) targ->t_session_type = SESSION_TYPE_NORMAL; if (targ->t_session_type == SESSION_TYPE_NORMAL && targ->t_name == NULL) - errx(1, "missing TargetName for target \"%s\"", + xo_errx(1, "missing TargetName for target \"%s\"", targ->t_nickname); if (targ->t_session_type == SESSION_TYPE_DISCOVERY && targ->t_name != NULL) - errx(1, "cannot specify TargetName for discovery " + xo_errx(1, "cannot specify TargetName for discovery " "sessions for target \"%s\"", targ->t_nickname); if (targ->t_name != NULL) { if (valid_iscsi_name(targ->t_name) == false) - errx(1, "invalid target name \"%s\"", + xo_errx(1, "invalid target name \"%s\"", targ->t_name); } if (targ->t_protocol == PROTOCOL_UNSPECIFIED) targ->t_protocol = PROTOCOL_ISCSI; if (targ->t_address == NULL) - errx(1, "missing TargetAddress for target \"%s\"", + xo_errx(1, "missing TargetAddress for target \"%s\"", targ->t_nickname); if (targ->t_initiator_name == NULL) targ->t_initiator_name = default_initiator_name(); if (valid_iscsi_name(targ->t_initiator_name) == false) - errx(1, "invalid initiator name \"%s\"", + xo_errx(1, "invalid initiator name \"%s\"", targ->t_initiator_name); if (targ->t_header_digest == DIGEST_UNSPECIFIED) targ->t_header_digest = DIGEST_NONE; @@ -268,19 +268,19 @@ conf_verify(struct conf *conf) } if (targ->t_auth_method == AUTH_METHOD_CHAP) { if (targ->t_user == NULL) { - errx(1, "missing chapIName for target \"%s\"", + xo_errx(1, "missing chapIName for target \"%s\"", targ->t_nickname); } if (targ->t_secret == NULL) - errx(1, "missing chapSecret for target \"%s\"", + xo_errx(1, "missing chapSecret for target \"%s\"", targ->t_nickname); if (targ->t_mutual_user != NULL || targ->t_mutual_secret != NULL) { if (targ->t_mutual_user == NULL) - errx(1, "missing tgtChapName for " + xo_errx(1, "missing tgtChapName for " "target \"%s\"", targ->t_nickname); if (targ->t_mutual_secret == NULL) - errx(1, "missing tgtChapSecret for " + xo_errx(1, "missing tgtChapSecret for " "target \"%s\"", targ->t_nickname); } } @@ -350,7 +350,7 @@ kernel_add(int iscsi_fd, const struct ta conf_from_target(&isa.isa_conf, targ); error = ioctl(iscsi_fd, ISCSISADD, &isa); if (error != 0) - warn("ISCSISADD"); + xo_warn("ISCSISADD"); return (error); } @@ -365,7 +365,7 @@ kernel_modify(int iscsi_fd, unsigned int conf_from_target(&ism.ism_conf, targ); error = ioctl(iscsi_fd, ISCSISMODIFY, &ism); if (error != 0) - warn("ISCSISMODIFY"); + xo_warn("ISCSISMODIFY"); return (error); } @@ -385,7 +385,7 @@ kernel_modify_some(int iscsi_fd, unsigne states = realloc(states, nentries * sizeof(struct iscsi_session_state)); if (states == NULL) - err(1, "realloc"); + xo_err(1, "realloc"); memset(&isl, 0, sizeof(isl)); isl.isl_nentries = nentries; @@ -399,7 +399,7 @@ kernel_modify_some(int iscsi_fd, unsigne break; } if (error != 0) - errx(1, "ISCSISLIST"); + xo_errx(1, "ISCSISLIST"); for (i = 0; i < isl.isl_nentries; i++) { state = &states[i]; @@ -408,7 +408,7 @@ kernel_modify_some(int iscsi_fd, unsigne break; } if (i == isl.isl_nentries) - errx(1, "session-id %u not found", session_id); + xo_errx(1, "session-id %u not found", session_id); conf = &state->iss_conf; @@ -427,7 +427,7 @@ kernel_modify_some(int iscsi_fd, unsigne memcpy(&ism.ism_conf, conf, sizeof(ism.ism_conf)); error = ioctl(iscsi_fd, ISCSISMODIFY, &ism); if (error != 0) - warn("ISCSISMODIFY"); + xo_warn("ISCSISMODIFY"); } static int @@ -440,7 +440,7 @@ kernel_remove(int iscsi_fd, const struct conf_from_target(&isr.isr_conf, targ); error = ioctl(iscsi_fd, ISCSISREMOVE, &isr); if (error != 0) - warn("ISCSISREMOVE"); + xo_warn("ISCSISREMOVE"); return (error); } @@ -462,7 +462,7 @@ kernel_list(int iscsi_fd, const struct t states = realloc(states, nentries * sizeof(struct iscsi_session_state)); if (states == NULL) - err(1, "realloc"); + xo_err(1, "realloc"); memset(&isl, 0, sizeof(isl)); isl.isl_nentries = nentries; @@ -476,79 +476,117 @@ kernel_list(int iscsi_fd, const struct t break; } if (error != 0) { - warn("ISCSISLIST"); + xo_warn("ISCSISLIST"); return (error); } if (verbose != 0) { + xo_open_list("session"); for (i = 0; i < isl.isl_nentries; i++) { state = &states[i]; conf = &state->iss_conf; - printf("Session ID: %u\n", state->iss_id); - printf("Initiator name: %s\n", conf->isc_initiator); - printf("Initiator portal: %s\n", - conf->isc_initiator_addr); - printf("Initiator alias: %s\n", - conf->isc_initiator_alias); - printf("Target name: %s\n", conf->isc_target); - printf("Target portal: %s\n", - conf->isc_target_addr); - printf("Target alias: %s\n", - state->iss_target_alias); - printf("User: %s\n", conf->isc_user); - printf("Secret: %s\n", conf->isc_secret); - printf("Mutual user: %s\n", - conf->isc_mutual_user); - printf("Mutual secret: %s\n", - conf->isc_mutual_secret); - printf("Session type: %s\n", + xo_open_instance("session"); + + /* + * Display-only modifier as this information + * is also present within the 'session' container + */ + xo_emit("{L:/%-18s}{V:sessionId/%u}\n", + "Session ID:", state->iss_id); + + xo_open_container("initiator"); + xo_emit("{L:/%-18s}{V:name/%s}\n", + "Initiator name:", conf->isc_initiator); + xo_emit("{L:/%-18s}{V:portal/%s}\n", + "Initiator portal:", conf->isc_initiator_addr); + xo_emit("{L:/%-18s}{V:alias/%s}\n", + "Initiator alias:", conf->isc_initiator_alias); + xo_close_container("initiator"); + + xo_open_container("target"); + xo_emit("{L:/%-18s}{V:name/%s}\n", + "Target name:", conf->isc_target); + xo_emit("{L:/%-18s}{V:portal/%s}\n", + "Target portal:", conf->isc_target_addr); + xo_emit("{L:/%-18s}{V:alias/%s}\n", + "Target alias:", state->iss_target_alias); + xo_close_container("target"); + + xo_open_container("auth"); + xo_emit("{L:/%-18s}{V:user/%s}\n", + "User:", conf->isc_user); + xo_emit("{L:/%-18s}{V:secret/%s}\n", + "Secret:", conf->isc_secret); + xo_emit("{L:/%-18s}{V:mutualUser/%s}\n", + "Mutual user:", conf->isc_mutual_user); + xo_emit("{L:/%-18s}{V:mutualSecret/%s}\n", + "Mutual secret:", conf->isc_mutual_secret); + xo_close_container("auth"); + + xo_emit("{L:/%-18s}{V:type/%s}\n", + "Session type:", conf->isc_discovery ? "Discovery" : "Normal"); - printf("Session state: %s\n", - state->iss_connected ? - "Connected" : "Disconnected"); - printf("Failure reason: %s\n", state->iss_reason); - printf("Header digest: %s\n", + xo_emit("{L:/%-18s}{V:state/%s}\n", + "Session state:", + state->iss_connected ? "Connected" : "Disconnected"); + xo_emit("{L:/%-18s}{V:failureReason/%s}\n", + "Failure reason:", state->iss_reason); + xo_emit("{L:/%-18s}{V:headerDigest/%s}\n", + "Header digest:", state->iss_header_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - printf("Data digest: %s\n", + xo_emit("{L:/%-18s}{V:dataDigest/%s}\n", + "Data digest:", state->iss_data_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - printf("DataSegmentLen: %d\n", - state->iss_max_data_segment_length); - printf("ImmediateData: %s\n", - state->iss_immediate_data ? "Yes" : "No"); - printf("iSER (RDMA): %s\n", - conf->isc_iser ? "Yes" : "No"); - printf("Offload driver: %s\n", state->iss_offload); - printf("Device nodes: "); + xo_emit("{L:/%-18s}{V:dataSegmentLen/%d}\n", + "DataSegmentLen:", state->iss_max_data_segment_length); + xo_emit("{L:/%-18s}{V:immediateData/%s}\n", + "ImmediateData:", state->iss_immediate_data ? "Yes" : "No"); + xo_emit("{L:/%-18s}{V:iSER/%s}\n", + "iSER (RDMA):", conf->isc_iser ? "Yes" : "No"); + xo_emit("{L:/%-18s}{V:offloadDriver/%s}\n", + "Offload driver:", state->iss_offload); + xo_emit("{L:/%-18s}", + "Device nodes:"); print_periphs(state->iss_id); - printf("\n\n"); + xo_emit("\n\n"); + xo_close_instance("session"); } + xo_close_list("session"); } else { - printf("%-36s %-16s %s\n", + xo_emit("{T:/%-36s} {T:/%-16s} {T:/%s}\n", "Target name", "Target portal", "State"); + + if (isl.isl_nentries != 0) + xo_open_list("session"); for (i = 0; i < isl.isl_nentries; i++) { + state = &states[i]; conf = &state->iss_conf; - printf("%-36s %-16s ", + xo_open_instance("session"); + xo_emit("{V:name/%-36s/%s} {V:portal/%-16s/%s} ", conf->isc_target, conf->isc_target_addr); if (state->iss_reason[0] != '\0') { - printf("%s\n", state->iss_reason); + xo_emit("{V:state/%s}\n", state->iss_reason); } else { if (conf->isc_discovery) { - printf("Discovery\n"); + xo_emit("{V:state}\n", "Discovery"); } else if (state->iss_connected) { - printf("Connected: "); + xo_emit("{V:state}: ", "Connected"); print_periphs(state->iss_id); - printf("\n"); + xo_emit("\n"); } else { - printf("Disconnected\n"); + xo_emit("{V:state}\n", "Disconnected"); } } + xo_close_instance("session"); } + if (isl.isl_nentries != 0) + xo_close_list("session"); } return (0); @@ -582,7 +620,7 @@ checked_strdup(const char *s) c = strdup(s); if (c == NULL) - err(1, "strdup"); + xo_err(1, "strdup"); return (c); } @@ -600,6 +638,9 @@ main(int argc, char **argv) struct conf *conf; struct target *targ; + argc = xo_parse_args(argc, argv); + xo_open_container("iscsictl"); + while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:v")) != -1) { switch (ch) { case 'A': @@ -626,11 +667,11 @@ main(int argc, char **argv) case 'i': session_id = strtol(optarg, &end, 10); if ((size_t)(end - optarg) != strlen(optarg)) - errx(1, "trailing characters after session-id"); + xo_errx(1, "trailing characters after session-id"); if (session_id < 0) - errx(1, "session-id cannot be negative"); + xo_errx(1, "session-id cannot be negative"); if (session_id > UINT_MAX) - errx(1, "session-id cannot be greater than %u", + xo_errx(1, "session-id cannot be greater than %u", UINT_MAX); break; case 'n': @@ -663,7 +704,7 @@ main(int argc, char **argv) if (Aflag + Mflag + Rflag + Lflag == 0) Lflag = 1; if (Aflag + Mflag + Rflag + Lflag > 1) - errx(1, "at most one of -A, -M, -R, or -L may be specified"); + xo_errx(1, "at most one of -A, -M, -R, or -L may be specified"); /* * Note that we ignore unneccessary/inapplicable "-c" flag; so that @@ -673,122 +714,122 @@ main(int argc, char **argv) if (Aflag != 0) { if (aflag != 0) { if (portal != NULL) - errx(1, "-a and -p and mutually exclusive"); + xo_errx(1, "-a and -p and mutually exclusive"); if (target != NULL) - errx(1, "-a and -t and mutually exclusive"); + xo_errx(1, "-a and -t and mutually exclusive"); if (user != NULL) - errx(1, "-a and -u and mutually exclusive"); + xo_errx(1, "-a and -u and mutually exclusive"); if (secret != NULL) - errx(1, "-a and -s and mutually exclusive"); + xo_errx(1, "-a and -s and mutually exclusive"); if (nickname != NULL) - errx(1, "-a and -n and mutually exclusive"); + xo_errx(1, "-a and -n and mutually exclusive"); if (discovery_host != NULL) - errx(1, "-a and -d and mutually exclusive"); + xo_errx(1, "-a and -d and mutually exclusive"); } else if (nickname != NULL) { if (portal != NULL) - errx(1, "-n and -p and mutually exclusive"); + xo_errx(1, "-n and -p and mutually exclusive"); if (target != NULL) - errx(1, "-n and -t and mutually exclusive"); + xo_errx(1, "-n and -t and mutually exclusive"); if (user != NULL) - errx(1, "-n and -u and mutually exclusive"); + xo_errx(1, "-n and -u and mutually exclusive"); if (secret != NULL) - errx(1, "-n and -s and mutually exclusive"); + xo_errx(1, "-n and -s and mutually exclusive"); if (discovery_host != NULL) - errx(1, "-n and -d and mutually exclusive"); + xo_errx(1, "-n and -d and mutually exclusive"); } else if (discovery_host != NULL) { if (portal != NULL) - errx(1, "-d and -p and mutually exclusive"); + xo_errx(1, "-d and -p and mutually exclusive"); if (target != NULL) - errx(1, "-d and -t and mutually exclusive"); + xo_errx(1, "-d and -t and mutually exclusive"); } else { if (target == NULL && portal == NULL) - errx(1, "must specify -a, -n or -t/-p"); + xo_errx(1, "must specify -a, -n or -t/-p"); if (target != NULL && portal == NULL) - errx(1, "-t must always be used with -p"); + xo_errx(1, "-t must always be used with -p"); if (portal != NULL && target == NULL) - errx(1, "-p must always be used with -t"); + xo_errx(1, "-p must always be used with -t"); } if (user != NULL && secret == NULL) - errx(1, "-u must always be used with -s"); + xo_errx(1, "-u must always be used with -s"); if (secret != NULL && user == NULL) - errx(1, "-s must always be used with -u"); + xo_errx(1, "-s must always be used with -u"); if (session_id != -1) - errx(1, "-i cannot be used with -A"); + xo_errx(1, "-i cannot be used with -A"); if (vflag != 0) - errx(1, "-v cannot be used with -A"); + xo_errx(1, "-v cannot be used with -A"); } else if (Mflag != 0) { if (session_id == -1) - errx(1, "-M requires -i"); + xo_errx(1, "-M requires -i"); if (discovery_host != NULL) - errx(1, "-M and -d are mutually exclusive"); + xo_errx(1, "-M and -d are mutually exclusive"); if (aflag != 0) - errx(1, "-M and -a are mutually exclusive"); + xo_errx(1, "-M and -a are mutually exclusive"); if (nickname != NULL) { if (portal != NULL) - errx(1, "-n and -p and mutually exclusive"); + xo_errx(1, "-n and -p and mutually exclusive"); if (target != NULL) - errx(1, "-n and -t and mutually exclusive"); + xo_errx(1, "-n and -t and mutually exclusive"); if (user != NULL) - errx(1, "-n and -u and mutually exclusive"); + xo_errx(1, "-n and -u and mutually exclusive"); if (secret != NULL) - errx(1, "-n and -s and mutually exclusive"); + xo_errx(1, "-n and -s and mutually exclusive"); } if (vflag != 0) - errx(1, "-v cannot be used with -M"); + xo_errx(1, "-v cannot be used with -M"); } else if (Rflag != 0) { if (user != NULL) - errx(1, "-R and -u are mutually exclusive"); + xo_errx(1, "-R and -u are mutually exclusive"); if (secret != NULL) - errx(1, "-R and -s are mutually exclusive"); + xo_errx(1, "-R and -s are mutually exclusive"); if (discovery_host != NULL) - errx(1, "-R and -d are mutually exclusive"); + xo_errx(1, "-R and -d are mutually exclusive"); if (aflag != 0) { if (portal != NULL) - errx(1, "-a and -p and mutually exclusive"); + xo_errx(1, "-a and -p and mutually exclusive"); if (target != NULL) - errx(1, "-a and -t and mutually exclusive"); + xo_errx(1, "-a and -t and mutually exclusive"); if (nickname != NULL) - errx(1, "-a and -n and mutually exclusive"); + xo_errx(1, "-a and -n and mutually exclusive"); } else if (nickname != NULL) { if (portal != NULL) - errx(1, "-n and -p and mutually exclusive"); + xo_errx(1, "-n and -p and mutually exclusive"); if (target != NULL) - errx(1, "-n and -t and mutually exclusive"); + xo_errx(1, "-n and -t and mutually exclusive"); } else if (target == NULL && portal == NULL) { - errx(1, "must specify either -a, -n, -t, or -p"); + xo_errx(1, "must specify either -a, -n, -t, or -p"); } if (session_id != -1) - errx(1, "-i cannot be used with -R"); + xo_errx(1, "-i cannot be used with -R"); if (vflag != 0) - errx(1, "-v cannot be used with -R"); + xo_errx(1, "-v cannot be used with -R"); } else { assert(Lflag != 0); if (portal != NULL) - errx(1, "-L and -p and mutually exclusive"); + xo_errx(1, "-L and -p and mutually exclusive"); if (target != NULL) - errx(1, "-L and -t and mutually exclusive"); + xo_errx(1, "-L and -t and mutually exclusive"); if (user != NULL) - errx(1, "-L and -u and mutually exclusive"); + xo_errx(1, "-L and -u and mutually exclusive"); if (secret != NULL) - errx(1, "-L and -s and mutually exclusive"); + xo_errx(1, "-L and -s and mutually exclusive"); if (nickname != NULL) - errx(1, "-L and -n and mutually exclusive"); + xo_errx(1, "-L and -n and mutually exclusive"); if (discovery_host != NULL) - errx(1, "-L and -d and mutually exclusive"); + xo_errx(1, "-L and -d and mutually exclusive"); if (session_id != -1) - errx(1, "-i cannot be used with -L"); + xo_errx(1, "-i cannot be used with -L"); } iscsi_fd = open(ISCSI_PATH, O_RDWR); @@ -801,7 +842,7 @@ main(int argc, char **argv) errno = saved_errno; } if (iscsi_fd < 0) - err(1, "failed to open %s", ISCSI_PATH); + xo_err(1, "failed to open %s", ISCSI_PATH); if (Aflag != 0 && aflag != 0) { conf = conf_new_from_file(conf_path); @@ -812,7 +853,7 @@ main(int argc, char **argv) conf = conf_new_from_file(conf_path); targ = target_find(conf, nickname); if (targ == NULL) - errx(1, "target %s not found in %s", + xo_errx(1, "target %s not found in %s", nickname, conf_path); if (Aflag != 0) @@ -829,7 +870,7 @@ main(int argc, char **argv) } else { if (Aflag != 0 && target != NULL) { if (valid_iscsi_name(target) == false) - errx(1, "invalid target name \"%s\"", target); + xo_errx(1, "invalid target name \"%s\"", target); } conf = conf_new(); targ = target_new(conf); @@ -857,9 +898,12 @@ main(int argc, char **argv) error = close(iscsi_fd); if (error != 0) - err(1, "close"); + xo_err(1, "close"); if (failed > 0) return (1); + + xo_close_container("iscsictl"); + xo_finish(); return (0); } Modified: head/usr.bin/iscsictl/parse.y ============================================================================== --- head/usr.bin/iscsictl/parse.y Sun Apr 12 08:19:04 2015 (r281460) +++ head/usr.bin/iscsictl/parse.y Sun Apr 12 09:36:50 2015 (r281461) @@ -34,12 +34,13 @@ #include #include #include -#include #include #include #include #include +#include + #include "iscsictl.h" extern FILE *yyin; @@ -77,7 +78,7 @@ targets: target: STR OPENING_BRACKET target_entries CLOSING_BRACKET { if (target_find(conf, $1) != NULL) - errx(1, "duplicated target %s", $1); + xo_errx(1, "duplicated target %s", $1); target->t_nickname = $1; target = target_new(conf); } @@ -127,7 +128,7 @@ target_entry: target_name: TARGET_NAME EQUALS STR { if (target->t_name != NULL) - errx(1, "duplicated TargetName at line %d", lineno); + xo_errx(1, "duplicated TargetName at line %d", lineno); target->t_name = $3; } ; @@ -135,7 +136,7 @@ target_name: TARGET_NAME EQUALS STR target_address: TARGET_ADDRESS EQUALS STR { if (target->t_address != NULL) - errx(1, "duplicated TargetAddress at line %d", lineno); + xo_errx(1, "duplicated TargetAddress at line %d", lineno); target->t_address = $3; } ; @@ -143,7 +144,7 @@ target_address: TARGET_ADDRESS EQUALS ST initiator_name: INITIATOR_NAME EQUALS STR { if (target->t_initiator_name != NULL) - errx(1, "duplicated InitiatorName at line %d", lineno); + xo_errx(1, "duplicated InitiatorName at line %d", lineno); target->t_initiator_name = $3; } ; @@ -151,7 +152,7 @@ initiator_name: INITIATOR_NAME EQUALS ST initiator_address: INITIATOR_ADDRESS EQUALS STR { if (target->t_initiator_address != NULL) - errx(1, "duplicated InitiatorAddress at line %d", lineno); + xo_errx(1, "duplicated InitiatorAddress at line %d", lineno); target->t_initiator_address = $3; } ; @@ -159,7 +160,7 @@ initiator_address: INITIATOR_ADDRESS EQU initiator_alias: INITIATOR_ALIAS EQUALS STR { if (target->t_initiator_alias != NULL) - errx(1, "duplicated InitiatorAlias at line %d", lineno); + xo_errx(1, "duplicated InitiatorAlias at line %d", lineno); target->t_initiator_alias = $3; } ; @@ -167,7 +168,7 @@ initiator_alias: INITIATOR_ALIAS EQUALS user: USER EQUALS STR { if (target->t_user != NULL) - errx(1, "duplicated chapIName at line %d", lineno); + xo_errx(1, "duplicated chapIName at line %d", lineno); target->t_user = $3; } ; @@ -175,7 +176,7 @@ user: USER EQUALS STR secret: SECRET EQUALS STR { if (target->t_secret != NULL) - errx(1, "duplicated chapSecret at line %d", lineno); + xo_errx(1, "duplicated chapSecret at line %d", lineno); target->t_secret = $3; } ; @@ -183,7 +184,7 @@ secret: SECRET EQUALS STR mutual_user: MUTUAL_USER EQUALS STR { if (target->t_mutual_user != NULL) - errx(1, "duplicated tgtChapName at line %d", lineno); + xo_errx(1, "duplicated tgtChapName at line %d", lineno); target->t_mutual_user = $3; } ; @@ -191,7 +192,7 @@ mutual_user: MUTUAL_USER EQUALS STR mutual_secret: MUTUAL_SECRET EQUALS STR { if (target->t_mutual_secret != NULL) - errx(1, "duplicated tgtChapSecret at line %d", lineno); + xo_errx(1, "duplicated tgtChapSecret at line %d", lineno); target->t_mutual_secret = $3; } ; @@ -199,13 +200,13 @@ mutual_secret: MUTUAL_SECRET EQUALS STR auth_method: AUTH_METHOD EQUALS STR { if (target->t_auth_method != AUTH_METHOD_UNSPECIFIED) - errx(1, "duplicated AuthMethod at line %d", lineno); + xo_errx(1, "duplicated AuthMethod at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_auth_method = AUTH_METHOD_NONE; else if (strcasecmp($3, "chap") == 0) target->t_auth_method = AUTH_METHOD_CHAP; else - errx(1, "invalid AuthMethod at line %d; " + xo_errx(1, "invalid AuthMethod at line %d; " "must be either \"none\" or \"CHAP\"", lineno); } ; @@ -213,13 +214,13 @@ auth_method: AUTH_METHOD EQUALS STR header_digest: HEADER_DIGEST EQUALS STR { if (target->t_header_digest != DIGEST_UNSPECIFIED) - errx(1, "duplicated HeaderDigest at line %d", lineno); + xo_errx(1, "duplicated HeaderDigest at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_header_digest = DIGEST_NONE; else if (strcasecmp($3, "CRC32C") == 0) target->t_header_digest = DIGEST_CRC32C; else - errx(1, "invalid HeaderDigest at line %d; " + xo_errx(1, "invalid HeaderDigest at line %d; " "must be either \"none\" or \"CRC32C\"", lineno); } ; @@ -227,13 +228,13 @@ header_digest: HEADER_DIGEST EQUALS STR data_digest: DATA_DIGEST EQUALS STR { if (target->t_data_digest != DIGEST_UNSPECIFIED) - errx(1, "duplicated DataDigest at line %d", lineno); + xo_errx(1, "duplicated DataDigest at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_data_digest = DIGEST_NONE; else if (strcasecmp($3, "CRC32C") == 0) target->t_data_digest = DIGEST_CRC32C; else - errx(1, "invalid DataDigest at line %d; " + xo_errx(1, "invalid DataDigest at line %d; " "must be either \"none\" or \"CRC32C\"", lineno); } ; @@ -241,13 +242,13 @@ data_digest: DATA_DIGEST EQUALS STR session_type: SESSION_TYPE EQUALS STR { if (target->t_session_type != SESSION_TYPE_UNSPECIFIED) - errx(1, "duplicated SessionType at line %d", lineno); + xo_errx(1, "duplicated SessionType at line %d", lineno); if (strcasecmp($3, "normal") == 0) target->t_session_type = SESSION_TYPE_NORMAL; else if (strcasecmp($3, "discovery") == 0) target->t_session_type = SESSION_TYPE_DISCOVERY; else - errx(1, "invalid SessionType at line %d; " + xo_errx(1, "invalid SessionType at line %d; " "must be either \"normal\" or \"discovery\"", lineno); } ; @@ -255,7 +256,7 @@ session_type: SESSION_TYPE EQUALS STR offload: OFFLOAD EQUALS STR { if (target->t_offload != NULL) - errx(1, "duplicated offload at line %d", lineno); + xo_errx(1, "duplicated offload at line %d", lineno); target->t_offload = $3; } ; @@ -263,20 +264,20 @@ offload: OFFLOAD EQUALS STR protocol: PROTOCOL EQUALS STR { if (target->t_protocol != PROTOCOL_UNSPECIFIED) - errx(1, "duplicated protocol at line %d", lineno); + xo_errx(1, "duplicated protocol at line %d", lineno); if (strcasecmp($3, "iscsi") == 0) target->t_protocol = PROTOCOL_ISCSI; else if (strcasecmp($3, "iser") == 0) target->t_protocol = PROTOCOL_ISER; else - errx(1, "invalid protocol at line %d; " + xo_errx(1, "invalid protocol at line %d; " "must be either \"iscsi\" or \"iser\"", lineno); } ; ignored: IGNORED EQUALS STR { - warnx("obsolete statement ignored at line %d", lineno); + xo_warnx("obsolete statement ignored at line %d", lineno); } ; @@ -286,7 +287,7 @@ void yyerror(const char *str) { - errx(1, "error in configuration file at line %d near '%s': %s", + xo_errx(1, "error in configuration file at line %d near '%s': %s", lineno, yytext, str); } @@ -298,19 +299,19 @@ check_perms(const char *path) error = stat(path, &sb); if (error != 0) { - warn("stat"); + xo_warn("stat"); return; } if (sb.st_mode & S_IWOTH) { - warnx("%s is world-writable", path); + xo_warnx("%s is world-writable", path); } else if (sb.st_mode & S_IROTH) { - warnx("%s is world-readable", path); + xo_warnx("%s is world-readable", path); } else if (sb.st_mode & S_IXOTH) { /* * Ok, this one doesn't matter, but still do it, * just for consistency. */ - warnx("%s is world-executable", path); + xo_warnx("%s is world-executable", path); } /* @@ -328,7 +329,7 @@ conf_new_from_file(const char *path) yyin = fopen(path, "r"); if (yyin == NULL) - err(1, "unable to open configuration file %s", path); + xo_err(1, "unable to open configuration file %s", path); check_perms(path); lineno = 1; yyrestart(yyin); Modified: head/usr.bin/iscsictl/periphs.c ============================================================================== --- head/usr.bin/iscsictl/periphs.c Sun Apr 12 08:19:04 2015 (r281460) +++ head/usr.bin/iscsictl/periphs.c Sun Apr 12 09:36:50 2015 (r281461) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -58,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "iscsictl.h" @@ -67,10 +67,11 @@ print_periphs(int session_id) union ccb ccb; int bufsize, fd; unsigned int i; - int skip_bus, skip_device; + int have_path_id, skip_bus, skip_device; + path_id_t path_id; if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { - warn("couldn't open %s", XPT_DEVICE); + xo_warn("couldn't open %s", XPT_DEVICE); return; } @@ -89,7 +90,7 @@ print_periphs(int session_id) ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - warnx("can't malloc memory for matches"); + xo_warnx("can't malloc memory for matches"); close(fd); return; } @@ -102,23 +103,27 @@ print_periphs(int session_id) ccb.cdm.num_patterns = 0; ccb.cdm.pattern_buf_len = 0; + path_id = -1; /* Make GCC happy. */ + have_path_id = 0; skip_bus = 1; skip_device = 1; + xo_open_container("devices"); + xo_open_list("lun"); /* * We do the ioctl multiple times if necessary, in case there are * more than 100 nodes in the EDT. */ do { if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - warn("error sending CAMIOCOMMAND ioctl"); + xo_warn("error sending CAMIOCOMMAND ioctl"); break; } if ((ccb.ccb_h.status != CAM_REQ_CMP) || ((ccb.cdm.status != CAM_DEV_MATCH_LAST) && (ccb.cdm.status != CAM_DEV_MATCH_MORE))) { - warnx("got CAM error %#x, CDM error %d\n", + xo_warnx("got CAM error %#x, CDM error %d\n", ccb.ccb_h.status, ccb.cdm.status); break; } @@ -141,7 +146,6 @@ print_periphs(int session_id) //printf("wrong unit, %d != %d\n", bus_result->unit_number, session_id); continue; } - skip_bus = 0; } case DEV_MATCH_DEVICE: { @@ -151,7 +155,6 @@ print_periphs(int session_id) continue; skip_device = 0; - break; } case DEV_MATCH_PERIPH: { @@ -166,9 +169,17 @@ print_periphs(int session_id) if (strcmp(periph_result->periph_name, "pass") == 0) continue; - fprintf(stdout, "%s%d ", - periph_result->periph_name, - periph_result->unit_number); + xo_open_instance("lun"); + xo_emit("{e:lun/%d}", periph_result->target_lun); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 10:28:16 2015 Return-Path: Delivered-To: svn-src-all@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 CD7FF337; Sun, 12 Apr 2015 10:28: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 B9709D56; Sun, 12 Apr 2015 10:28: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 t3CASGrh010802; Sun, 12 Apr 2015 10:28:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CASGlZ010801; Sun, 12 Apr 2015 10:28:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504121028.t3CASGlZ010801@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 10:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281462 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 10:28:16 -0000 Author: kib Date: Sun Apr 12 10:28:15 2015 New Revision: 281462 URL: https://svnweb.freebsd.org/changeset/base/281462 Log: Define capabilities bits from the revision 007 of the document 302223 "Intelб╝ Processor Vendor-Specific ACPI Interface Specification", issied Dec 2014. Previous revision 005 was from Sep 2006. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sun Apr 12 09:36:50 2015 (r281461) +++ head/sys/dev/acpica/acpivar.h Sun Apr 12 10:28:15 2015 (r281462) @@ -185,7 +185,7 @@ extern struct mtx acpi_mutex; * Various features and capabilities for the acpi_get_features() method. * In particular, these are used for the ACPI 3.0 _PDC and _OSC methods. * See the Intel document titled "Intel Processor Vendor-Specific ACPI", - * number 302223-005. + * number 302223-007. */ #define ACPI_CAP_PERF_MSRS (1 << 0) /* Intel SpeedStep PERF_CTL MSRs */ #define ACPI_CAP_C1_IO_HALT (1 << 1) /* Intel C1 "IO then halt" sequence */ @@ -198,6 +198,9 @@ extern struct mtx acpi_mutex; #define ACPI_CAP_SMP_C1_NATIVE (1 << 8) /* MP C1 support other than halt */ #define ACPI_CAP_SMP_C3_NATIVE (1 << 9) /* MP C2 and C3 support */ #define ACPI_CAP_PX_HW_COORD (1 << 11) /* Intel P-state HW coordination */ +#define ACPI_CAP_INTR_CPPC (1 << 12) /* Native Interrupt Handling for + Collaborative Processor Performance Control notifications */ +#define ACPI_CAP_HW_DUTY_C (1 << 13) /* Hardware Duty Cycling */ /* * Quirk flags. From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 11:24:00 2015 Return-Path: Delivered-To: svn-src-all@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 35D4CF7A; Sun, 12 Apr 2015 11:24:00 +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 1FD0D327; Sun, 12 Apr 2015 11:24: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 t3CBNxij039289; Sun, 12 Apr 2015 11:23:59 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CBNxBV039288; Sun, 12 Apr 2015 11:23:59 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201504121123.t3CBNxBV039288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 12 Apr 2015 11:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281463 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 11:24:00 -0000 Author: markm Date: Sun Apr 12 11:23:59 2015 New Revision: 281463 URL: https://svnweb.freebsd.org/changeset/base/281463 Log: Fix a very minor typo. Modified: head/sys/sys/module.h Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Sun Apr 12 10:28:15 2015 (r281462) +++ head/sys/sys/module.h Sun Apr 12 11:23:59 2015 (r281463) @@ -71,7 +71,7 @@ typedef union modspecific { } modspecific_t; /* - * Module dependency declarartion + * Module dependency declaration */ struct mod_depend { int md_ver_minimum; From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 13:01:01 2015 Return-Path: Delivered-To: svn-src-all@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 34D9112B; Sun, 12 Apr 2015 13:01: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 1E4B9E96; Sun, 12 Apr 2015 13:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CD11Ko083893; Sun, 12 Apr 2015 13:01:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CD0xk7083878; Sun, 12 Apr 2015 13:00:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504121300.t3CD0xk7083878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 12 Apr 2015 13:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281466 - in head/sys: arm/conf conf dev/psci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 13:01:01 -0000 Author: andrew Date: Sun Apr 12 13:00:58 2015 New Revision: 281466 URL: https://svnweb.freebsd.org/changeset/base/281466 Log: Add a driver for the ARM Power State Coordination Interface (PSCI). This handles versions 0.1 and 0.2 of the standard on 32-bit ARM. With this driver we can shutdown in QEMU. Further work is needed to turn secondary cores on on boot and to support later revisions of the specification. Submitted by: Robin Randhawa Sponsored by: The FreeBSD Foundation Added: head/sys/dev/psci/ head/sys/dev/psci/psci.c (contents, props changed) head/sys/dev/psci/psci.h (contents, props changed) head/sys/dev/psci/psci_arm.S (contents, props changed) Modified: head/sys/arm/conf/VIRT head/sys/conf/files.arm Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Sun Apr 12 12:31:19 2015 (r281465) +++ head/sys/arm/conf/VIRT Sun Apr 12 13:00:58 2015 (r281466) @@ -82,6 +82,7 @@ device uart device pty device snp device pl011 +device psci device virtio device virtio_mmio Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sun Apr 12 12:31:19 2015 (r281465) +++ head/sys/conf/files.arm Sun Apr 12 13:00:58 2015 (r281466) @@ -85,6 +85,8 @@ dev/fdt/fdt_arm_platform.c optional plat dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 dev/kbd/kbd.c optional sc | vt +dev/psci/psci.c optional psci +dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc Added: head/sys/dev/psci/psci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/psci.c Sun Apr 12 13:00:58 2015 (r281466) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 2014 Robin Randhawa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * This implements support for ARM's Power State Co-ordination Interface + * [PSCI]. The implementation adheres to version 0.2 of the PSCI specification + * but also supports v0.1. PSCI standardizes operations such as system reset, CPU + * on/off/suspend. PSCI requires a compliant firmware implementation. + * + * The PSCI specification used for this implementation is available at: + * + * . + * + * TODO: + * - Add support for remaining PSCI calls [this implementation only + * supports get_version, system_reset and cpu_on]. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +struct psci_softc { + device_t dev; + + psci_callfn_t psci_call; + uint32_t psci_fnids[PSCI_FN_MAX]; +}; + +static int psci_v0_1_init(device_t dev); +static int psci_v0_2_init(device_t dev); + +struct psci_softc *psci_softc = NULL; + +static struct ofw_compat_data compat_data[] = { + {"arm,psci-0.2", (uintptr_t)psci_v0_2_init}, + {"arm,psci", (uintptr_t)psci_v0_1_init}, + {NULL, 0} +}; + +static int psci_probe(device_t dev); +static int psci_attach(device_t dev); +static void psci_shutdown(void *, int); + +static device_method_t psci_methods[] = { + DEVMETHOD(device_probe, psci_probe), + DEVMETHOD(device_attach, psci_attach), + + DEVMETHOD_END +}; + +static driver_t psci_driver = { + "psci", + psci_methods, + sizeof(struct psci_softc), +}; + +static devclass_t psci_devclass; + +EARLY_DRIVER_MODULE(psci, simplebus, psci_driver, psci_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); +EARLY_DRIVER_MODULE(psci, ofwbus, psci_driver, psci_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); + +static int +psci_probe(device_t dev) +{ + const struct ofw_compat_data *ocd; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + ocd = ofw_bus_search_compatible(dev, compat_data); + if (ocd->ocd_str == NULL) + return (ENXIO); + + device_set_desc(dev, "ARM Power State Co-ordination Interface Driver"); + + return (BUS_PROBE_SPECIFIC); +} + +static int +psci_attach(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + const struct ofw_compat_data *ocd; + psci_initfn_t psci_init; + phandle_t node; + char method[16]; + + if (psci_softc != NULL) + return (ENXIO); + + ocd = ofw_bus_search_compatible(dev, compat_data); + psci_init = (psci_initfn_t)ocd->ocd_data; + KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); + + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "method", method, sizeof(method))) > 0) { + if (strcmp(method, "hvc") == 0) + sc->psci_call = psci_hvc_despatch; + else if (strcmp(method, "smc") == 0) + sc->psci_call = psci_smc_despatch; + else { + device_printf(dev, + "psci_attach: PSCI conduit \"%s\" invalid\n", + method); + return (ENXIO); + } + } else { + device_printf(dev, + "psci_attach: PSCI conduit not supplied in the DT\n"); + return (ENXIO); + } + + if (psci_init(dev)) + return (ENXIO); + + psci_softc = sc; + + return (0); +} + +static int +psci_get_version(struct psci_softc *sc) +{ + uint32_t fnid; + + /* PSCI version wasn't supported in v0.1. */ + fnid = sc->psci_fnids[PSCI_FN_VERSION]; + if (fnid) + return (sc->psci_call(fnid, 0, 0, 0)); + + return (PSCI_RETVAL_NOT_SUPPORTED); +} + +int +psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) +{ + + /* PSCI v0.1 and v0.2 both support cpu_on. */ + return(psci_softc->psci_call(psci_softc->psci_fnids[PSCI_FN_CPU_ON], cpu, + entry, context_id)); +} + +static void +psci_shutdown(void *xsc, int howto) +{ + uint32_t fn = 0; + + /* PSCI system_off and system_reset werent't supported in v0.1. */ + if ((howto & RB_POWEROFF) != 0) + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_OFF]; + else if ((howto & RB_HALT) == 0) + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_RESET]; + + if (fn) + psci_softc->psci_call(fn, 0, 0, 0); + + /* System reset and off do not return. */ +} + +static int +psci_v0_1_init(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + int psci_fn; + uint32_t psci_fnid; + phandle_t node; + int len; + + + /* Zero out the function ID table - Is this needed ? */ + for (psci_fn = PSCI_FN_VERSION, psci_fnid = PSCI_FNID_VERSION; + psci_fn < PSCI_FN_MAX; psci_fn++, psci_fnid++) + sc->psci_fnids[psci_fn] = 0; + + /* PSCI v0.1 doesn't specify function IDs. Get them from DT */ + node = ofw_bus_get_node(dev); + + if ((len = OF_getproplen(node, "cpu_suspend")) > 0) { + OF_getencprop(node, "cpu_suspend", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_CPU_SUSPEND] = psci_fnid; + } + + if ((len = OF_getproplen(node, "cpu_on")) > 0) { + OF_getencprop(node, "cpu_on", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_CPU_ON] = psci_fnid; + } + + if ((len = OF_getproplen(node, "cpu_off")) > 0) { + OF_getencprop(node, "cpu_off", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_CPU_OFF] = psci_fnid; + } + + if ((len = OF_getproplen(node, "migrate")) > 0) { + OF_getencprop(node, "migrate", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_MIGRATE] = psci_fnid; + } + + if (bootverbose) + device_printf(dev, "PSCI version 0.1 available\n"); + + return(0); +} + +static int +psci_v0_2_init(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + int version; + + /* PSCI v0.2 specifies explicit function IDs. */ + sc->psci_fnids[PSCI_FN_VERSION] = PSCI_FNID_VERSION; + sc->psci_fnids[PSCI_FN_CPU_SUSPEND] = PSCI_FNID_CPU_SUSPEND; + sc->psci_fnids[PSCI_FN_CPU_OFF] = PSCI_FNID_CPU_OFF; + sc->psci_fnids[PSCI_FN_CPU_ON] = PSCI_FNID_CPU_ON; + sc->psci_fnids[PSCI_FN_AFFINITY_INFO] = PSCI_FNID_AFFINITY_INFO; + sc->psci_fnids[PSCI_FN_MIGRATE] = PSCI_FNID_MIGRATE; + sc->psci_fnids[PSCI_FN_MIGRATE_INFO_TYPE] = PSCI_FNID_MIGRATE_INFO_TYPE; + sc->psci_fnids[PSCI_FN_MIGRATE_INFO_UP_CPU] = PSCI_FNID_MIGRATE_INFO_UP_CPU; + sc->psci_fnids[PSCI_FN_SYSTEM_OFF] = PSCI_FNID_SYSTEM_OFF; + sc->psci_fnids[PSCI_FN_SYSTEM_RESET] = PSCI_FNID_SYSTEM_RESET; + + version = psci_get_version(sc); + + if (version == PSCI_RETVAL_NOT_SUPPORTED) + return (1); + + if ((PSCI_VER_MAJOR(version) != 0) && (PSCI_VER_MINOR(version) != 2)) { + device_printf(dev, "PSCI version number mismatched with DT\n"); + return (1); + } + + if (bootverbose) + device_printf(dev, "PSCI version 0.2 available\n"); + + /* + * We only register this for v0.2 since v0.1 doesn't support + * system_reset. + */ + EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, + SHUTDOWN_PRI_LAST); + + return (0); +} Added: head/sys/dev/psci/psci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/psci.h Sun Apr 12 13:00:58 2015 (r281466) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2013, 2014 Robin Randhawa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PSCI_H_ +#define _MACHINE_PSCI_H_ + +#include + +typedef int (*psci_initfn_t)(device_t dev); +typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t); + +extern int psci_present; + +void psci_system_reset(void); +int psci_cpu_on(unsigned long, unsigned long, unsigned long); +int psci_hvc_despatch(register_t, register_t, register_t, register_t); +int psci_smc_despatch(register_t, register_t, register_t, register_t); + + +/* + * PSCI return codes. + */ +#define PSCI_RETVAL_SUCCESS 0 +#define PSCI_RETVAL_NOT_SUPPORTED -1 +#define PSCI_RETVAL_INVALID_PARAMS -2 +#define PSCI_RETVAL_DENIED -3 +#define PSCI_RETVAL_ALREADY_ON -4 +#define PSCI_RETVAL_ON_PENDING -5 +#define PSCI_RETVAL_INTERNAL_FAILURE -6 +#define PSCI_RETVAL_NOT_PRESENT -7 +#define PSCI_RETVAL_DISABLED -8 + +/* + * PSCI function codes (as per PSCI v0.2). + */ +#ifdef __aarch64__ +#define PSCI_FNID_VERSION 0x84000000 +#define PSCI_FNID_CPU_SUSPEND 0xc4000001 +#define PSCI_FNID_CPU_OFF 0x84000002 +#define PSCI_FNID_CPU_ON 0xc4000003 +#define PSCI_FNID_AFFINITY_INFO 0xc4000004 +#define PSCI_FNID_MIGRATE 0xc4000005 +#define PSCI_FNID_MIGRATE_INFO_TYPE 0x84000006 +#define PSCI_FNID_MIGRATE_INFO_UP_CPU 0xc4000007 +#define PSCI_FNID_SYSTEM_OFF 0x84000008 +#define PSCI_FNID_SYSTEM_RESET 0x84000009 +#else +#define PSCI_FNID_VERSION 0x84000000 +#define PSCI_FNID_CPU_SUSPEND 0x84000001 +#define PSCI_FNID_CPU_OFF 0x84000002 +#define PSCI_FNID_CPU_ON 0x84000003 +#define PSCI_FNID_AFFINITY_INFO 0x84000004 +#define PSCI_FNID_MIGRATE 0x84000005 +#define PSCI_FNID_MIGRATE_INFO_TYPE 0x84000006 +#define PSCI_FNID_MIGRATE_INFO_UP_CPU 0x84000007 +#define PSCI_FNID_SYSTEM_OFF 0x84000008 +#define PSCI_FNID_SYSTEM_RESET 0x84000009 +#endif + +#define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) +#define PSCI_VER_MINOR(v) ((v) & 0xFF) + +enum psci_fn { + PSCI_FN_VERSION, + PSCI_FN_CPU_SUSPEND, + PSCI_FN_CPU_OFF, + PSCI_FN_CPU_ON, + PSCI_FN_AFFINITY_INFO, + PSCI_FN_MIGRATE, + PSCI_FN_MIGRATE_INFO_TYPE, + PSCI_FN_MIGRATE_INFO_UP_CPU, + PSCI_FN_SYSTEM_OFF, + PSCI_FN_SYSTEM_RESET, + PSCI_FN_MAX +}; + +#endif /* _MACHINE_PSCI_H_ */ Added: head/sys/dev/psci/psci_arm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/psci_arm.S Sun Apr 12 13:00:58 2015 (r281466) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +.arch_extension virt /* For hvc */ + +/* + * int psci_hvc_despatch(register_t psci_fnid, register_t...) + */ +ENTRY(psci_hvc_despatch) + hvc #0 + RET +END(psci_hvc_despatch) + +/* + * int psci_smc_despatch(register_t psci_fnid, register_t...) + */ +ENTRY(psci_smc_despatch) + smc #0 + RET +END(psci_hvc_despatch) From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 14:38:19 2015 Return-Path: Delivered-To: svn-src-all@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 A5CC6104; Sun, 12 Apr 2015 14: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 9026A9B8; Sun, 12 Apr 2015 14: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 t3CEcJQX029762; Sun, 12 Apr 2015 14:38:19 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CEcJGr029761; Sun, 12 Apr 2015 14:38:19 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504121438.t3CEcJGr029761@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sun, 12 Apr 2015 14:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281467 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 14:38:19 -0000 Author: takawata Date: Sun Apr 12 14:38:18 2015 New Revision: 281467 URL: https://svnweb.freebsd.org/changeset/base/281467 Log: Add HCI/LMP revision information. Modified: head/usr.sbin/bluetooth/hccontrol/util.c Modified: head/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/util.c Sun Apr 12 13:00:58 2015 (r281466) +++ head/usr.sbin/bluetooth/hccontrol/util.c Sun Apr 12 14:38:18 2015 (r281467) @@ -152,7 +152,12 @@ hci_ver2str(int ver) /* 0x00 */ "Bluetooth HCI Specification 1.0B", /* 0x01 */ "Bluetooth HCI Specification 1.1", /* 0x02 */ "Bluetooth HCI Specification 1.2", - /* 0x03 */ "Bluetooth HCI Specification 2.0" + /* 0x03 */ "Bluetooth HCI Specification 2.0", + /* 0x04 */ "Bluetooth HCI Specification 2.1", + /* 0x05 */ "Bluetooth HCI Specification 3.0", + /* 0x06 */ "Bluetooth HCI Specification 4.0", + /* 0x07 */ "Bluetooth HCI Specification 4.1", + /* 0x08 */ "Bluetooth HCI Specification 4.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -165,7 +170,12 @@ hci_lmpver2str(int ver) /* 0x00 */ "Bluetooth LMP 1.0", /* 0x01 */ "Bluetooth LMP 1.1", /* 0x02 */ "Bluetooth LMP 1.2", - /* 0x03 */ "Bluetooth LMP 2.0" + /* 0x03 */ "Bluetooth LMP 2.0", + /* 0x04 */ "Bluetooth LMP 2.1", + /* 0x04 */ "Bluetooth LMP 3.0", + /* 0x04 */ "Bluetooth LMP 4.0", + /* 0x04 */ "Bluetooth LMP 4.1", + /* 0x04 */ "Bluetooth LMP 4.2" }; return (ver >= SIZE(t)? "?" : t[ver]); From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 15:08:42 2015 Return-Path: Delivered-To: svn-src-all@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 AA1935FB; Sun, 12 Apr 2015 15:08: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 946CECC6; Sun, 12 Apr 2015 15:08: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 t3CF8gxp043919; Sun, 12 Apr 2015 15:08:42 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CF8gLH043918; Sun, 12 Apr 2015 15:08:42 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504121508.t3CF8gLH043918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sun, 12 Apr 2015 15:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281468 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 15:08:42 -0000 Author: takawata Date: Sun Apr 12 15:08:41 2015 New Revision: 281468 URL: https://svnweb.freebsd.org/changeset/base/281468 Log: Accept LE event on hccontrol socket. Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.c Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.c Sun Apr 12 14:38:18 2015 (r281467) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.c Sun Apr 12 15:08:41 2015 (r281468) @@ -144,6 +144,7 @@ socket_open(char const *node) bit_set(filter.event_mask, NG_HCI_EVENT_READ_CLOCK_OFFSET_COMPL - 1); bit_set(filter.event_mask, NG_HCI_EVENT_CON_PKT_TYPE_CHANGED - 1); bit_set(filter.event_mask, NG_HCI_EVENT_ROLE_CHANGE - 1); + bit_set(filter.event_mask, NG_HCI_EVENT_LE -1); if (setsockopt(s, SOL_HCI_RAW, SO_HCI_RAW_FILTER, (void * const) &filter, sizeof(filter)) < 0) From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 16:43:57 2015 Return-Path: Delivered-To: svn-src-all@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 183905C8; Sun, 12 Apr 2015 16:43: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 0352596A; Sun, 12 Apr 2015 16:43: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 t3CGhuYa091040; Sun, 12 Apr 2015 16:43:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CGhub1091039; Sun, 12 Apr 2015 16:43:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504121643.t3CGhub1091039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 12 Apr 2015 16:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281469 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 16:43:57 -0000 Author: pfg Date: Sun Apr 12 16:43:55 2015 New Revision: 281469 URL: https://svnweb.freebsd.org/changeset/base/281469 Log: Add definition for the gcc gnu_inline attribute. This uses a non-standard (who would guess that) inlining method that is useful for legacy GNU software. This attribute was added in GCC 4.1.3. Older versions of clang would just ignore the attribute but as lately it is supported also there. This is currently unused but it is required for the FORTIFY_SOURCE extension. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Apr 12 15:08:41 2015 (r281468) +++ head/sys/sys/cdefs.h Sun Apr 12 16:43:55 2015 (r281469) @@ -375,8 +375,10 @@ #endif #if __GNUC_PREREQ__(4, 1) +#define __gnu_inline __attribute__((__gnu_inline__)) #define __returns_twice __attribute__((__returns_twice__)) #else +#define __gnu_inline #define __returns_twice #endif From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 17:43:27 2015 Return-Path: Delivered-To: svn-src-all@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 04533209; Sun, 12 Apr 2015 17:43:27 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9165F8B; Sun, 12 Apr 2015 17:43:26 +0000 (UTC) Received: from cpe-74-71-192-171.nyc.res.rr.com ([74.71.192.171]:47093 helo=[172.16.33.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1YhLun-0001rN-9P; Sun, 12 Apr 2015 13:43:25 -0400 From: "George Neville-Neil" To: "Adrian Chadd" Subject: Re: svn commit: r281352 - head/sys/netinet Date: Sun, 12 Apr 2015 13:43:14 -0400 Message-ID: <88AE928F-3F65-4D22-90D1-3F7843B46CA1@neville-neil.com> In-Reply-To: References: <201504100655.t3A6tioW010182@svn.freebsd.org> <20150410071251.GI1394@zxy.spb.ru> <20150410073147.GD99375@FreeBSD.org> <20150410080613.GJ1394@zxy.spb.ru> MIME-Version: 1.0 X-Mailer: MailMate (1.9.1r5084) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" , Slawa Olhovchenkov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 17:43:27 -0000 On 10 Apr 2015, at 15:06, Adrian Chadd wrote: > I don't want to get this bikeshed going again, but: this is just > hashing on the ip src/ip_id, and only for fragments. For now i think > it's okay to leave as jenkins. > > Let's bikeshed it with more data about how it behaves when doing frag > assembly :) > Even I agree. For now this is fine, we can improve it with a new hash later. Best, George From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 21:14:59 2015 Return-Path: Delivered-To: svn-src-all@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 D25B89CF; Sun, 12 Apr 2015 21:14:59 +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 BDF32969; Sun, 12 Apr 2015 21:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CLEx2u018735; Sun, 12 Apr 2015 21:14:59 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CLExfA018734; Sun, 12 Apr 2015 21:14:59 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201504122114.t3CLExfA018734@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Sun, 12 Apr 2015 21:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281470 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 21:14:59 -0000 Author: pluknet Date: Sun Apr 12 21:14:58 2015 New Revision: 281470 URL: https://svnweb.freebsd.org/changeset/base/281470 Log: Remove obsolete bits about maximum number of file systems. NMOUNT has gone together with static mount table in 4.3BSD-Reno. MFC after: 1 week Modified: head/lib/libc/sys/mount.2 Modified: head/lib/libc/sys/mount.2 ============================================================================== --- head/lib/libc/sys/mount.2 Sun Apr 12 16:43:55 2015 (r281469) +++ head/lib/libc/sys/mount.2 Sun Apr 12 21:14:58 2015 (r281470) @@ -28,7 +28,7 @@ .\" @(#)mount.2 8.3 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd April 13, 2015 .Dt MOUNT 2 .Os .Sh NAME @@ -351,11 +351,6 @@ The argument points outside the process's allocated address space. .El -.Pp -A -.Em ufs -mount can also fail if the maximum number of file systems are currently -mounted. .Sh SEE ALSO .Xr lsvfs 1 , .Xr mksnap_ffs 8 , From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 21:28:56 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 21:35:14 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 21:38:19 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 21:45:35 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Apr 12 22:40:28 2015 Return-Path: Delivered-To: svn-src-all@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 C909DD2C; Sun, 12 Apr 2015 22:40:28 +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 B4477127; Sun, 12 Apr 2015 22:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3CMeSg6058493; Sun, 12 Apr 2015 22:40:28 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CMeS2l058492; Sun, 12 Apr 2015 22:40:28 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201504122240.t3CMeS2l058492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sun, 12 Apr 2015 22:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281475 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 22:40:28 -0000 Author: jkim Date: Sun Apr 12 22:40:27 2015 New Revision: 281475 URL: https://svnweb.freebsd.org/changeset/base/281475 Log: Fix build on i386. Reported by: bz Modified: head/sys/x86/acpica/OsdEnvironment.c Modified: head/sys/x86/acpica/OsdEnvironment.c ============================================================================== --- head/sys/x86/acpica/OsdEnvironment.c Sun Apr 12 21:45:34 2015 (r281474) +++ head/sys/x86/acpica/OsdEnvironment.c Sun Apr 12 22:40:27 2015 (r281475) @@ -68,7 +68,7 @@ acpi_get_root_from_loader(void) static u_long acpi_get_root_from_memory(void) { - ACPI_SIZE acpi_root; + ACPI_PHYSICAL_ADDRESS acpi_root; if (ACPI_SUCCESS(AcpiFindRootPointer(&acpi_root))) return (acpi_root); From owner-svn-src-all@FreeBSD.ORG Sun Apr 12 23:43:43 2015 Return-Path: Delivered-To: svn-src-all@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 381B14A5; Sun, 12 Apr 2015 23:43: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 23142985; Sun, 12 Apr 2015 23:43: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 t3CNhg7O090846; Sun, 12 Apr 2015 23:43:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3CNhgdZ090845; Sun, 12 Apr 2015 23:43:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504122343.t3CNhgdZ090845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 12 Apr 2015 23:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281478 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 23:43:43 -0000 Author: eadler Date: Sun Apr 12 23:43:41 2015 New Revision: 281478 URL: https://svnweb.freebsd.org/changeset/base/281478 Log: README: - the reference to 'ancient' LINT file was added in 2000 [r64047 | alex | 2000-07-31]. Remove the reference entirely now. - add the tests directory Modified: head/README Modified: head/README ============================================================================== --- head/README Sun Apr 12 22:54:04 2015 (r281477) +++ head/README Sun Apr 12 23:43:41 2015 (r281478) @@ -34,9 +34,7 @@ The sample kernel configuration files re sub-directory (assuming that you've installed the kernel sources), the file named GENERIC being the one used to build your initial installation kernel. The file NOTES contains entries and documentation for all possible -devices, not just those commonly used. It is the successor of the ancient -LINT file, but in contrast to LINT, it is not buildable as a kernel but a -pure reference and documentation file. +devices, not just those commonly used. Source Roadmap: @@ -77,6 +75,9 @@ share Shared resources. sys Kernel sources. +tests Regression tests which can be run by Kyua. See tests/README + for additional information. + tools Utilities for regression testing and miscellaneous tasks. usr.bin User commands. From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 00:03:04 2015 Return-Path: Delivered-To: svn-src-all@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 0713C6FF; Mon, 13 Apr 2015 00:03: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 CCA80B8A; Mon, 13 Apr 2015 00:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3D03378000949; Mon, 13 Apr 2015 00:03:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D033JU000948; Mon, 13 Apr 2015 00:03:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504130003.t3D033JU000948@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 00:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281479 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 00:03:04 -0000 Author: eadler Date: Mon Apr 13 00:03:03 2015 New Revision: 281479 URL: https://svnweb.freebsd.org/changeset/base/281479 Log: Add GNU global, ncscope, and cscope to the global ignore list for the root. Approved by: peter Modified: Directory Properties: head/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 01:01:18 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 01:19:23 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 01:42:26 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 01:55:43 2015 Return-Path: Delivered-To: svn-src-all@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 6B76270C; Mon, 13 Apr 2015 01:55: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 564A079B; Mon, 13 Apr 2015 01:55: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 t3D1thnE052697; Mon, 13 Apr 2015 01:55:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3D1thVR052696; Mon, 13 Apr 2015 01:55:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504130155.t3D1thVR052696@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:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281483 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 01:55:43 -0000 Author: markj Date: Mon Apr 13 01:55:42 2015 New Revision: 281483 URL: https://svnweb.freebsd.org/changeset/base/281483 Log: Fix a possible refcount leak in regen_tmpaddr(). public_ifa6 may be set to NULL after taking a reference to a previous address list element. Instead, only take the reference after leaving the loop but before releasing the address list lock. Differential Revision: https://reviews.freebsd.org/D2253 Reviewed by: ae MFC after: 2 weeks Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Apr 13 01:42:24 2015 (r281482) +++ head/sys/netinet6/nd6.c Mon Apr 13 01:55:42 2015 (r281483) @@ -765,11 +765,10 @@ regen_tmpaddr(struct in6_ifaddr *ia6) * address with the prefix. */ if (!IFA6_IS_DEPRECATED(it6)) - public_ifa6 = it6; - - if (public_ifa6 != NULL) - ifa_ref(&public_ifa6->ia_ifa); + public_ifa6 = it6; } + if (public_ifa6 != NULL) + ifa_ref(&public_ifa6->ia_ifa); IF_ADDR_RUNLOCK(ifp); if (public_ifa6 != NULL) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 08:35:05 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 09:17:58 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 09:18:57 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 10:49:47 2015 Return-Path: Delivered-To: svn-src-all@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 04502D32; Mon, 13 Apr 2015 10:49:47 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id C15B03E1; Mon, 13 Apr 2015 10:49:46 +0000 (UTC) Received: from bender (host86-166-43-191.range86-166.btcentralplus.com [86.166.43.191]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id A02E2D79EC; Mon, 13 Apr 2015 10:49:38 +0000 (UTC) Date: Mon, 13 Apr 2015 11:49:37 +0100 From: Andrew Turner To: Bruce Evans Subject: Re: svn commit: r281307 - head/sys/boot/efi/boot1 Message-ID: <20150413114937.469db8ce@bender> In-Reply-To: <20150409212938.T3716@besplex.bde.org> References: <201504091015.t39AFlkh016216@svn.freebsd.org> <20150409212938.T3716@besplex.bde.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 10:49:47 -0000 On Thu, 9 Apr 2015 21:38:02 +1000 (EST) Bruce Evans wrote: > On Thu, 9 Apr 2015, Andrew Turner wrote: > > > Log: > > Print error values with hex to make it easier to find the EFI > > error type. > > > > Modified: > > head/sys/boot/efi/boot1/boot1.c > > > > Modified: head/sys/boot/efi/boot1/boot1.c > > ============================================================================== > > --- head/sys/boot/efi/boot1/boot1.c Thu Apr 9 10:12:58 > > 2015 (r281306) +++ head/sys/boot/efi/boot1/boot1.c > > Thu Apr 9 10:15:47 2015 (r281307) @@ -330,18 +330,18 @@ > > load(const char *fname) status = > > systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, > > bufsize, &loaderhandle); if (EFI_ERROR(status)) > > - printf("LoadImage failed with error %d\n", status); > > + printf("LoadImage failed with error %lx\n", > > status); > > How would anyone guess that a number like "10" is in hex? > > Hex numbers should usually be printed using "%#..." format. If the > boot loader doesn't have that, then use an 0x prefix. > > This shouldn't compile. 'status' cannot have type int and type > unsigned long at the same time. clang warns even without -Wformat in > CFLAGS. It is either uint32_t on 32-bit architectures, or uint64_t on 64-bit architectures. I know it's wrong on 32-bit, however on both architectures we use this code a long is 32-bit. Andrew From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 13:07:46 2015 Return-Path: Delivered-To: svn-src-all@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 C2E3DBC5; Mon, 13 Apr 2015 13:07:46 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 83214782; Mon, 13 Apr 2015 13:07:46 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 33C531A4C74; Mon, 13 Apr 2015 23:07:36 +1000 (AEST) Date: Mon, 13 Apr 2015 23:07:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrew Turner Subject: Re: svn commit: r281307 - head/sys/boot/efi/boot1 In-Reply-To: <20150413114937.469db8ce@bender> Message-ID: <20150413221737.O2186@besplex.bde.org> References: <201504091015.t39AFlkh016216@svn.freebsd.org> <20150409212938.T3716@besplex.bde.org> <20150413114937.469db8ce@bender> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=L/MkHYj8 c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=DRGEgjlppHb5nJda_S0A:9 a=CjuIK1q_8ugA:10 Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 13:07:47 -0000 On Mon, 13 Apr 2015, Andrew Turner wrote: > On Thu, 9 Apr 2015 21:38:02 +1000 (EST) > Bruce Evans wrote: > >> On Thu, 9 Apr 2015, Andrew Turner wrote: >> >>> Log: >>> Print error values with hex to make it easier to find the EFI >>> error type. >>> >>> Modified: >>> head/sys/boot/efi/boot1/boot1.c >>> >>> Modified: head/sys/boot/efi/boot1/boot1.c >>> ============================================================================== >>> --- head/sys/boot/efi/boot1/boot1.c Thu Apr 9 10:12:58 >>> 2015 (r281306) +++ head/sys/boot/efi/boot1/boot1.c >>> Thu Apr 9 10:15:47 2015 (r281307) @@ -330,18 +330,18 @@ >>> load(const char *fname) status = >>> systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, >>> bufsize, &loaderhandle); if (EFI_ERROR(status)) >>> - printf("LoadImage failed with error %d\n", status); >>> + printf("LoadImage failed with error %lx\n", >>> status); >> >> How would anyone guess that a number like "10" is in hex? >> >> Hex numbers should usually be printed using "%#..." format. If the >> boot loader doesn't have that, then use an 0x prefix. >> >> This shouldn't compile. 'status' cannot have type int and type >> unsigned long at the same time. clang warns even without -Wformat in >> CFLAGS. > > It is either uint32_t on 32-bit architectures, or uint64_t on 64-bit > architectures. I know it's wrong on 32-bit, however on both > architectures we use this code a long is 32-bit. That allows it to run, but not to compile. It only compiles because format checking is broken. Format checking is broken because printf() is not declared as __printflike(). Normally, this doesn't matter, because the compiler knows that printf() is like itself. However, -ffreestanding makes printf() just another function so the compiler must not know anything special about it unless you tell it. The kernel is careful about this and declares printf() as __printflike() in sys/systm.h. Boot programs are not careful about this. Even is doesn't declare printf() as like itself. This works provided is not (ab)used for the -ffreestanding case. declares functions as __printflike() more or less iff they were not in C90. For example, it declares snprintf() as __printflike() since this was necessary before C99 standardized it and is still necessary to support -std=N where N is older than c99. Boot programs are also not careful about __restrict. is careful about this. It seems to be careful in the same way as for __printflike(), but that means using it for old functions like printf() too, since it was never automatic in C90. boot1.c actually gets its buggy declaration of printf() by having its own static function named printf() and not declaring this as __printflike(). Similarly for all of its other printflike functions. Similarly in many other boot programs. Grepping for ^printf finds 7 more instances of the bug in 7 different files. Most seem to be the result of using cut and paste to copy the bug from i386/boot2. There is not a single instance of __printflike() in the 8 files. There are 2 instances of in the whole boot hierarchy. Boot headers aren't so broken. uses __printflike() but hasn't caught up with 'restrict' yet. libstand has a reduced printf() but this is still too bloated to use in the small boot1 and boot2 programs. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 13:21:28 2015 Return-Path: Delivered-To: svn-src-all@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 7EED716E; Mon, 13 Apr 2015 13:21:28 +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 6A9098D3; Mon, 13 Apr 2015 13:21:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DDLSql091303; Mon, 13 Apr 2015 13:21:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DDLScR091302; Mon, 13 Apr 2015 13:21:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504131321.t3DDLScR091302@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 13 Apr 2015 13:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281493 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 13:21:28 -0000 Author: andrew Date: Mon Apr 13 13:21:27 2015 New Revision: 281493 URL: https://svnweb.freebsd.org/changeset/base/281493 Log: Update the arm devmap code to also work with arm64. There are a few differences between the two. On arm we need to provide a list of addresses we may be mapping before we have initialised the virtual memory subsystem, however on arm64 we allocate a small (2MiB for a 4k granule) range to be used for such purposes. Differential Revision: https://reviews.freebsd.org/D2249 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/devmap.c Modified: head/sys/arm/arm/devmap.c ============================================================================== --- head/sys/arm/arm/devmap.c Mon Apr 13 10:32:53 2015 (r281492) +++ head/sys/arm/arm/devmap.c Mon Apr 13 13:21:27 2015 (r281493) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); /* * Routines for mapping device memory. + * + * This is used on both arm and arm64. */ #include "opt_ddb.h" @@ -40,10 +42,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static const struct arm_devmap_entry *devmap_table; static boolean_t devmap_bootstrap_done = false; +#if defined(__aarch64__) +#define MAX_VADDR VM_MAX_KERNEL_ADDRESS +#define PTE_DEVICE VM_MEMATTR_DEVICE +#elif defined(__arm__) +#define MAX_VADDR ARM_VECTORS_HIGH +#endif + /* * The allocated-kva (akva) devmap table and metadata. Platforms can call * arm_devmap_add_entry() to add static device mappings to this table using @@ -53,7 +63,11 @@ static boolean_t devmap_bootstrap_done = #define AKVA_DEVMAP_MAX_ENTRIES 32 static struct arm_devmap_entry akva_devmap_entries[AKVA_DEVMAP_MAX_ENTRIES]; static u_int akva_devmap_idx; -static vm_offset_t akva_devmap_vaddr = ARM_VECTORS_HIGH; +static vm_offset_t akva_devmap_vaddr = MAX_VADDR; + +#ifdef __aarch64__ +extern int early_boot; +#endif /* * Print the contents of the static mapping table using the provided printf-like @@ -99,7 +113,7 @@ arm_devmap_lastaddr() if (akva_devmap_idx > 0) return (akva_devmap_vaddr); - lowaddr = ARM_VECTORS_HIGH; + lowaddr = MAX_VADDR; for (pd = devmap_table; pd != NULL && pd->pd_size != 0; ++pd) { if (lowaddr > pd->pd_va) lowaddr = pd->pd_va; @@ -136,9 +150,12 @@ arm_devmap_add_entry(vm_paddr_t pa, vm_s * align the virtual address to the next-lower 1MB boundary so that we * end up with a nice efficient section mapping. */ +#ifdef __arm__ if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { akva_devmap_vaddr = trunc_1mpage(akva_devmap_vaddr - sz); - } else { + } else +#endif + { akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - sz); } m = &akva_devmap_entries[akva_devmap_idx++]; @@ -186,8 +203,12 @@ arm_devmap_bootstrap(vm_offset_t l1pt, c return; for (pd = devmap_table; pd->pd_size != 0; ++pd) { +#if defined(__arm__) pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, pd->pd_prot,pd->pd_cache); +#elif defined(__aarch64__) + pmap_kenter_device(pd->pd_va, pd->pd_size, pd->pd_pa); +#endif } } @@ -252,17 +273,25 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si /* First look in the static mapping table. */ if ((rva = arm_devmap_ptov(pa, size)) != NULL) return (rva); - + offset = pa & PAGE_MASK; pa = trunc_page(pa); size = round_page(size + offset); - - va = kva_alloc(size); + +#ifdef __aarch64__ + if (early_boot) { + akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - size); + va = akva_devmap_vaddr; + KASSERT(va >= VM_MAX_KERNEL_ADDRESS - L2_SIZE, + ("Too many early devmap mappings")); + } else +#endif + va = kva_alloc(size); if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); pmap_kenter_device(va, size, pa); - + return ((void *)(va + offset)); } From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 14:43:14 2015 Return-Path: Delivered-To: svn-src-all@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 EF39ED06; Mon, 13 Apr 2015 14:43:13 +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 D703E3E0; Mon, 13 Apr 2015 14:43:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DEhDg3031207; Mon, 13 Apr 2015 14:43:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DEhAbi031191; Mon, 13 Apr 2015 14:43:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504131443.t3DEhAbi031191@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 13 Apr 2015 14:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281494 - in head/sys: arm64/arm64 arm64/conf arm64/include conf dev/fdt sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 14:43:14 -0000 Author: andrew Date: Mon Apr 13 14:43:10 2015 New Revision: 281494 URL: https://svnweb.freebsd.org/changeset/base/281494 Log: Bring in the start of the arm64 kernel. This is only the minimum set of files needed to boot in qemu. As such it is missing a few things. The bus_dma code is currently only stub functions with a full implementation from the development tree to follow. The gic driver has been copied as the interrupt framework is different. It is expected the two drivers will be merged by the arm intrng project, however this will need to be imported into the tree and support for arm64 would need to be added. This includes code developed by myself, SemiHalf, Ed Maste, and Robin Randhawa from ARM. This has been funded by the FreeBSD Foundation, with early development by myself in my spare time with assistance from Robin. Differential Revision: https://reviews.freebsd.org/D2199 Reviewed by: emaste, imp Relnotes: yes Sponsored by: The FreeBSD Foundation Added: head/sys/arm64/arm64/ head/sys/arm64/arm64/autoconf.c (contents, props changed) head/sys/arm64/arm64/bcopy.c (contents, props changed) head/sys/arm64/arm64/bus_machdep.c (contents, props changed) head/sys/arm64/arm64/bus_space_asm.S (contents, props changed) head/sys/arm64/arm64/busdma_machdep.c (contents, props changed) head/sys/arm64/arm64/clock.c (contents, props changed) head/sys/arm64/arm64/copyinout.S (contents, props changed) head/sys/arm64/arm64/copystr.c (contents, props changed) head/sys/arm64/arm64/cpufunc_asm.S (contents, props changed) head/sys/arm64/arm64/dump_machdep.c (contents, props changed) head/sys/arm64/arm64/elf_machdep.c (contents, props changed) head/sys/arm64/arm64/exception.S (contents, props changed) head/sys/arm64/arm64/genassym.c (contents, props changed) head/sys/arm64/arm64/gic.c (contents, props changed) head/sys/arm64/arm64/identcpu.c (contents, props changed) head/sys/arm64/arm64/in_cksum.c (contents, props changed) head/sys/arm64/arm64/intr_machdep.c (contents, props changed) head/sys/arm64/arm64/locore.S (contents, props changed) head/sys/arm64/arm64/machdep.c (contents, props changed) head/sys/arm64/arm64/mem.c (contents, props changed) head/sys/arm64/arm64/minidump_machdep.c (contents, props changed) head/sys/arm64/arm64/nexus.c (contents, props changed) head/sys/arm64/arm64/pic_if.m (contents, props changed) head/sys/arm64/arm64/pmap.c (contents, props changed) head/sys/arm64/arm64/stack_machdep.c (contents, props changed) head/sys/arm64/arm64/support.S (contents, props changed) head/sys/arm64/arm64/swtch.S (contents, props changed) head/sys/arm64/arm64/sys_machdep.c (contents, props changed) head/sys/arm64/arm64/trap.c (contents, props changed) head/sys/arm64/arm64/uio_machdep.c (contents, props changed) head/sys/arm64/arm64/vfp.c (contents, props changed) head/sys/arm64/arm64/vm_machdep.c (contents, props changed) head/sys/arm64/conf/ head/sys/arm64/conf/DEFAULTS (contents, props changed) head/sys/arm64/conf/GENERIC (contents, props changed) head/sys/arm64/include/_bus.h (contents, props changed) head/sys/arm64/include/armreg.h (contents, props changed) head/sys/arm64/include/bus.h (contents, props changed) head/sys/arm64/include/bus_dma.h (contents, props changed) head/sys/arm64/include/clock.h (contents, props changed) head/sys/arm64/include/counter.h (contents, props changed) head/sys/arm64/include/db_machdep.h (contents, props changed) head/sys/arm64/include/debug_monitor.h (contents, props changed) head/sys/arm64/include/devmap.h (contents, props changed) head/sys/arm64/include/dump.h (contents, props changed) head/sys/arm64/include/hypervisor.h (contents, props changed) head/sys/arm64/include/in_cksum.h (contents, props changed) head/sys/arm64/include/intr.h (contents, props changed) head/sys/arm64/include/kdb.h (contents, props changed) head/sys/arm64/include/machdep.h (contents, props changed) head/sys/arm64/include/md_var.h (contents, props changed) head/sys/arm64/include/memdev.h (contents, props changed) head/sys/arm64/include/metadata.h (contents, props changed) head/sys/arm64/include/ofw_machdep.h (contents, props changed) head/sys/arm64/include/resource.h (contents, props changed) head/sys/arm64/include/sf_buf.h (contents, props changed) head/sys/arm64/include/smp.h (contents, props changed) head/sys/arm64/include/stack.h (contents, props changed) head/sys/arm64/include/trap.h (contents, props changed) head/sys/arm64/include/vfp.h (contents, props changed) head/sys/conf/Makefile.arm64 (contents, props changed) head/sys/conf/files.arm64 (contents, props changed) head/sys/conf/ldscript.arm64 (contents, props changed) head/sys/conf/options.arm64 (contents, props changed) head/sys/dev/fdt/fdt_arm64.c (contents, props changed) Modified: head/sys/arm64/include/cpufunc.h head/sys/arm64/include/pmap.h head/sys/sys/kerneldump.h Added: head/sys/arm64/arm64/autoconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/autoconf.c Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner 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, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Setup the system to run on the current machine. + * + * Configure() is called at boot time and initializes the vba + * device tables and the memory controller monitoring. Available + * devices are determined (from possibilities mentioned in ioconf.c), + * and the drivers are initialized. + */ + +#include +#include +#include +#include +#include + +#include + +static void configure_first(void *); +static void configure(void *); +static void configure_final(void *); + +SYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL); +/* SI_ORDER_SECOND is hookable */ +SYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL); +/* SI_ORDER_MIDDLE is hookable */ +SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL); + +/* + * Determine i/o configuration for a machine. + */ +static void +configure_first(void *dummy) +{ + + /* nexus0 is the top of the device tree */ + device_add_child(root_bus, "nexus", 0); +} + +static void +configure(void *dummy) +{ + + /* initialize new bus architecture */ + root_bus_configure(); +} + +static void +configure_final(void *dummy) +{ + arm_enable_intr(); + cninit_finish(); + + if (bootverbose) + printf("Device configuration finished.\n"); + + cold = 0; +} Added: head/sys/arm64/arm64/bcopy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/bcopy.c Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * From: sys/powerpc/powerpc/bcopy.c + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/* + * sizeof(word) MUST BE A POWER OF TWO + * SO THAT wmask BELOW IS ALL ONES + */ +typedef long word; /* "word" used for optimal copy speed */ + +#define wsize sizeof(word) +#define wmask (wsize - 1) + +/* + * Copy a block of memory, handling overlap. + * This is the routine that actually implements + * (the portable versions of) bcopy, memcpy, and memmove. + */ +void * +memcpy(void *dst0, const void *src0, size_t length) +{ + char *dst; + const char *src; + size_t t; + + dst = dst0; + src = src0; + + if (length == 0 || dst == src) { /* nothing to do */ + goto done; + } + + /* + * Macros: loop-t-times; and loop-t-times, t>0 + */ +#define TLOOP(s) if (t) TLOOP1(s) +#define TLOOP1(s) do { s; } while (--t) + + if ((unsigned long)dst < (unsigned long)src) { + /* + * Copy forward. + */ + t = (size_t)src; /* only need low bits */ + + if ((t | (uintptr_t)dst) & wmask) { + /* + * Try to align operands. This cannot be done + * unless the low bits match. + */ + if ((t ^ (uintptr_t)dst) & wmask || length < wsize) { + t = length; + } else { + t = wsize - (t & wmask); + } + + length -= t; + TLOOP1(*dst++ = *src++); + } + /* + * Copy whole words, then mop up any trailing bytes. + */ + t = length / wsize; + TLOOP(*(word *)dst = *(const word *)src; src += wsize; + dst += wsize); + t = length & wmask; + TLOOP(*dst++ = *src++); + } else { + /* + * Copy backwards. Otherwise essentially the same. + * Alignment works as before, except that it takes + * (t&wmask) bytes to align, not wsize-(t&wmask). + */ + src += length; + dst += length; + t = (uintptr_t)src; + + if ((t | (uintptr_t)dst) & wmask) { + if ((t ^ (uintptr_t)dst) & wmask || length <= wsize) { + t = length; + } else { + t &= wmask; + } + + length -= t; + TLOOP1(*--dst = *--src); + } + t = length / wsize; + TLOOP(src -= wsize; dst -= wsize; + *(word *)dst = *(const word *)src); + t = length & wmask; + TLOOP(*--dst = *--src); + } +done: + return (dst0); +} + +void +bcopy(const void *src0, void *dst0, size_t length) +{ + + memcpy(dst0, src0, length); +} + Added: head/sys/arm64/arm64/bus_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/bus_machdep.c Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,204 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +uint8_t generic_bs_r_1(void *, bus_space_handle_t, bus_size_t); +uint16_t generic_bs_r_2(void *, bus_space_handle_t, bus_size_t); +uint32_t generic_bs_r_4(void *, bus_space_handle_t, bus_size_t); +uint64_t generic_bs_r_8(void *, bus_space_handle_t, bus_size_t); + +void generic_bs_rm_1(void *, bus_space_handle_t, bus_size_t, uint8_t *, + bus_size_t); +void generic_bs_rm_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, + bus_size_t); +void generic_bs_rm_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, + bus_size_t); +void generic_bs_rm_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, + bus_size_t); + +void generic_bs_w_1(void *, bus_space_handle_t, bus_size_t, uint8_t); +void generic_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t); +void generic_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t); +void generic_bs_w_8(void *, bus_space_handle_t, bus_size_t, uint64_t); + +void generic_bs_wm_1(void *, bus_space_handle_t, bus_size_t, const uint8_t *, + bus_size_t); +void generic_bs_wm_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, + bus_size_t); +void generic_bs_wm_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, + bus_size_t); +void generic_bs_wm_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, + bus_size_t); + +static int +generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, + bus_space_handle_t *bshp) +{ + void *va; + + va = pmap_mapdev(bpa, size); + if (va == NULL) + return (ENOMEM); + *bshp = (bus_space_handle_t)va; + return (0); +} + +static void +generic_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size) +{ + + pmap_unmapdev(bsh, size); +} + +static void +generic_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, + bus_size_t size, int flags) +{ +} + +static int +generic_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, + bus_size_t size, bus_space_handle_t *nbshp) +{ + + *nbshp = bsh + offset; + return (0); +} + +struct bus_space memmap_bus = { + /* cookie */ + .bs_cookie = NULL, + + /* mapping/unmapping */ + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, + + /* allocation/deallocation */ + .bs_alloc = NULL, + .bs_free = NULL, + + /* barrier */ + .bs_barrier = generic_bs_barrier, + + /* read single */ + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = generic_bs_r_8, + + /* read multiple */ + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = generic_bs_rm_8, + + /* write single */ + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = generic_bs_w_8, + + /* write multiple */ + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = generic_bs_wm_8, + + /* write region */ + .bs_wr_1 = NULL, + .bs_wr_2 = NULL, + .bs_wr_4 = NULL, + .bs_wr_8 = NULL, + + /* set multiple */ + .bs_sm_1 = NULL, + .bs_sm_2 = NULL, + .bs_sm_4 = NULL, + .bs_sm_8 = NULL, + + /* set region */ + .bs_sr_1 = NULL, + .bs_sr_2 = NULL, + .bs_sr_4 = NULL, + .bs_sr_8 = NULL, + + /* copy */ + .bs_c_1 = NULL, + .bs_c_2 = NULL, + .bs_c_4 = NULL, + .bs_c_8 = NULL, + + /* read single stream */ + .bs_r_1_s = NULL, + .bs_r_2_s = NULL, + .bs_r_4_s = NULL, + .bs_r_8_s = NULL, + + /* read multiple stream */ + .bs_rm_1_s = NULL, + .bs_rm_2_s = NULL, + .bs_rm_4_s = NULL, + .bs_rm_8_s = NULL, + + /* read region stream */ + .bs_rr_1_s = NULL, + .bs_rr_2_s = NULL, + .bs_rr_4_s = NULL, + .bs_rr_8_s = NULL, + + /* write single stream */ + .bs_w_1_s = NULL, + .bs_w_2_s = NULL, + .bs_w_4_s = NULL, + .bs_w_8_s = NULL, + + /* write multiple stream */ + .bs_wm_1_s = NULL, + .bs_wm_2_s = NULL, + .bs_wm_4_s = NULL, + .bs_wm_8_s = NULL, + + /* write region stream */ + .bs_wr_1_s = NULL, + .bs_wr_2_s = NULL, + .bs_wr_4_s = NULL, + .bs_wr_8_s = NULL, +}; + +#ifdef FDT +bus_space_tag_t fdtbus_bs_tag = &memmap_bus; +#endif Added: head/sys/arm64/arm64/bus_space_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/bus_space_asm.S Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,235 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include + +__FBSDID("$FreeBSD$"); + +ENTRY(generic_bs_r_1) + ldrb w0, [x1, x2] + ret +END(generic_bs_r_1) + +ENTRY(generic_bs_r_2) + ldrh w0, [x1, x2] + ret +END(generic_bs_r_2) + +ENTRY(generic_bs_r_4) + ldr w0, [x1, x2] + ret +END(generic_bs_r_4) + +ENTRY(generic_bs_r_8) + ldr x0, [x1, x2] + ret +END(generic_bs_r_8) + +ENTRY(generic_bs_rm_1) + /* If there is anything to read. */ + cbz x4, 2f + + /* Calculate the device address. */ + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Read the data. */ +1: ldrb w1, [x0] + strb w1, [x3], #2 + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_rm_1) + +ENTRY(generic_bs_rm_2) + /* If there is anything to read. */ + cbz x4, 2f + + /* Calculate the device address. */ + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Read the data. */ +1: ldrh w1, [x0] + strh w1, [x3], #2 + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_rm_2) + +ENTRY(generic_bs_rm_4) + /* If there is anything to read. */ + cbz x4, 2f + + /* Calculate the device address. */ + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Read the data. */ +1: ldr w1, [x0] + str w1, [x3], #2 + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_rm_4) + +ENTRY(generic_bs_rm_8) + /* If there is anything to read. */ + cbz x4, 2f + + /* Calculate the device address. */ + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Read the data. */ +1: ldr x1, [x0] + str x1, [x3], #2 + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_rm_8) + + +ENTRY(generic_bs_w_1) + strb w3, [x1, x2] + ret +END(generic_bs_w_1) + +ENTRY(generic_bs_w_2) + strh w3, [x1, x2] + ret +END(generic_bs_w_2) + +ENTRY(generic_bs_w_4) + str w3, [x1, x2] + ret +END(generic_bs_w_4) + +ENTRY(generic_bs_w_8) + str x3, [x1, x2] + ret +END(generic_bs_w_8) + +ENTRY(generic_bs_wm_1) + /* If there is anything to write. */ + cbz x4, 2f + + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Write the data */ +1: ldrb w1, [x3], #1 + strb w1, [x0] + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_wm_1) + +ENTRY(generic_bs_wm_2) + /* If there is anything to write. */ + cbz x4, 2f + + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Write the data */ +1: ldrh w1, [x3], #2 + strh w1, [x0] + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_wm_2) + +ENTRY(generic_bs_wm_4) + /* If there is anything to write. */ + cbz x4, 2f + + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Write the data */ +1: ldr w1, [x3], #4 + str w1, [x0] + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_wm_4) + +ENTRY(generic_bs_wm_8) + /* If there is anything to write. */ + cbz x4, 2f + + add x0, x1, x2 + /* + * x0 = The device address. + * x3 = The kernel address. + * x4 = Count + */ + + /* Write the data */ +1: ldr x1, [x3], #8 + str x1, [x0] + subs x4, x4, #1 + b.ne 1b + +2: ret +END(generic_bs_wm_8) Added: head/sys/arm64/arm64/busdma_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/busdma_machdep.c Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,68 @@ +/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +#include + +int +_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) +{ + + panic("_bus_dmamap_load_phys"); +} + +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, struct vm_page **ma, + bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs, + int *segp) +{ + + panic("_bus_dmamap_load_ma"); +} + +int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, + int *segp) +{ + + panic("_bus_dmamap_load_buffer"); +} + +void +__bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) +{ + + panic("__bus_dmamap_waitok"); +} + +bus_dma_segment_t * +_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) +{ + + panic("_bus_dmamap_complete"); +} + +void +_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + + panic("_bus_dmamap_unload"); +} + +void +_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +{ + + panic("_bus_dmamap_sync"); +} Added: head/sys/arm64/arm64/clock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/clock.c Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +void +cpu_initclocks(void) +{ + + cpu_initclocks_bsp(); +} Added: head/sys/arm64/arm64/copyinout.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/copyinout.S Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner 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, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "assym.s" + +/* + * Fault handler for the copy{in,out} functions below. + */ +ENTRY(copyio_fault) + SET_FAULT_HANDLER(xzr, x1) /* Clear the handler */ + mov x0, #EFAULT + ret +END(copyio_fault) + +/* + * Copies from a kernel to user address + * + * int copyout(const void *kaddr, void *udaddr, size_t len) + */ +ENTRY(copyout) + cbz x2, 2f /* If len == 0 then skip loop */ + + adr x6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + +1: ldrb w4, [x0], #1 /* Load from kaddr */ + strb w4, [x1], #1 /* Store in uaddr */ + sub x2, x2, #1 /* len-- */ + cbnz x2, 1b + + SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + +2: mov x0, xzr /* return 0 */ + ret +END(copyout) + +/* + * Copies from a user to kernel address + * + * int copyin(const void *uaddr, void *kdaddr, size_t len) + */ +ENTRY(copyin) + cbz x2, 2f /* If len == 0 then skip loop */ + + adr x6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + +1: ldrb w4, [x0], #1 /* Load from uaddr */ + strb w4, [x1], #1 /* Store in kaddr */ + sub x2, x2, #1 /* len-- */ + cbnz x2, 1b + + SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + +2: mov x0, xzr /* return 0 */ + ret +END(copyin) + +/* + * Copies a string from a user to kernel address + * + * int copyinstr(const void *udaddr, void *kaddr, size_t len, size_t *done) + */ +ENTRY(copyinstr) + mov x5, xzr /* count = 0 */ + cbz x2, 3f /* If len == 0 then skip loop */ + + adr x6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + +1: ldrb w4, [x0], #1 /* Load from uaddr */ + strb w4, [x1], #1 /* Store in kaddr */ + cbz w4, 2f /* If == 0 then break */ + sub x2, x2, #1 /* len-- */ + add x5, x5, #1 /* count++ */ + cbnz x2, 1b + +2: SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + +3: cbz x3, 4f /* Check if done != NULL */ + add x5, x5, #1 /* count++ */ + str x5, [x3] /* done = count */ + +4: mov x0, xzr /* return 0 */ + ret +END(copyinstr) Added: head/sys/arm64/arm64/copystr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/copystr.c Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int +copystr(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len, + size_t * __restrict lencopied) +{ + const char *src; + size_t pos; + char *dst; + int error; + + error = ENAMETOOLONG; + src = kfaddr; + dst = kdaddr; + for (pos = 0; pos < len; pos++) { + dst[pos] = src[pos]; + if (src[pos] == '\0') { + /* Increment pos to hold the number of bytes copied */ + pos++; + error = 0; + break; + } + } + + if (lencopied != NULL) + *lencopied = pos; + + return (0); +} + Added: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/cpufunc_asm.S Mon Apr 13 14:43:10 2015 (r281494) @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 2014 Robin Randhawa + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Andrew Turner + * 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, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 15:22:53 2015 Return-Path: Delivered-To: svn-src-all@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 F172851C; Mon, 13 Apr 2015 15:22: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 DB6DFA54; Mon, 13 Apr 2015 15:22: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 t3DFMq4Y050281; Mon, 13 Apr 2015 15:22:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DFMkiE050257; Mon, 13 Apr 2015 15:22:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504131522.t3DFMkiE050257@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Apr 2015 15:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281495 - in head/sys: conf i386/i386 i386/include x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 15:22:53 -0000 Author: kib Date: Mon Apr 13 15:22:45 2015 New Revision: 281495 URL: https://svnweb.freebsd.org/changeset/base/281495 Log: Add config option PAE_TABLES for the i386 kernel. It switches pmap to use PAE format for the page tables, but does not incur other consequences of the full PAE config. In particular, vm_paddr_t and bus_addr_t are left 32bit, and max supported memory is still limited by 4GB. The option allows to have nx permissions for memory mappings on i386 kernel, while keeping the usual i386 KBI and avoiding the kernel data sizing problems typical for the PAE config. Intel documented that the PAE format for page tables is available starting with the Pentium Pro, but it is possible that the plain Pentium CPUs have the required support (Appendix H). The goal is to enable the option and non-exec mappings on i386 for the GENERIC kernel. Anybody wanting a useful system on 486, have to reconfigure the modern i386 kernel anyway. Discussed with: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/conf/options.i386 head/sys/i386/i386/bios.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/mpboot.s head/sys/i386/i386/pmap.c head/sys/i386/i386/swtch.s head/sys/i386/i386/trap.c head/sys/i386/i386/vm86bios.s head/sys/i386/i386/vm_machdep.c head/sys/i386/include/param.h head/sys/i386/include/pmap.h head/sys/i386/include/vmparam.h head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/conf/options.i386 Mon Apr 13 15:22:45 2015 (r281495) @@ -36,6 +36,11 @@ KVA_PAGES opt_global.h # Physical address extensions and support for >4G ram. As above. PAE opt_global.h +# Use PAE page tables, but limit memory support to 4GB. +# This keeps the i386 non-PAE KBI, in particular, drivers see +# 32bit vm_paddr_t. +PAE_TABLES opt_global.h + TIMER_FREQ opt_clock.h CPU_ATHLON_SSE_HACK opt_cpu.h Modified: head/sys/i386/i386/bios.c ============================================================================== --- head/sys/i386/i386/bios.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/bios.c Mon Apr 13 15:22:45 2015 (r281495) @@ -389,7 +389,7 @@ bios16(struct bios_args *args, char *fmt args->seg.code32.limit = 0xffff; ptd = (pd_entry_t *)rcr3(); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if (ptd == IdlePDPT) #else if (ptd == IdlePTD) Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/initcpu.c Mon Apr 13 15:22:45 2015 (r281495) @@ -784,7 +784,7 @@ initializecpu(void) init_transmeta(); break; } -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((amd_feature & AMDID_NX) != 0) { uint64_t msr; Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/locore.s Mon Apr 13 15:22:45 2015 (r281495) @@ -99,7 +99,7 @@ physfree: .long 0 /* phys addr of next .globl IdlePTD IdlePTD: .long 0 /* phys addr of kernel PTD */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) .globl IdlePDPT IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif @@ -281,7 +281,7 @@ NON_GPROF_ENTRY(btext) 1: /* Now enable paging */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) movl R(IdlePDPT), %eax movl %eax, %cr3 movl %cr4, %eax @@ -722,7 +722,7 @@ no_kernend: movl %esi,R(KPTmap) /* Allocate Page Table Directory */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) /* XXX only need 32 bytes (easier for now) */ ALLOCPAGES(1) movl %esi,R(IdlePDPT) @@ -788,7 +788,7 @@ no_kernend: fillkptphys($PG_RW) /* Map page directory. */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) movl R(IdlePDPT), %eax movl $1, %ecx fillkptphys($PG_RW) @@ -890,7 +890,7 @@ done_pde: movl $NPGPTD,%ecx fillkpt(R(IdlePTD), $PG_RW) -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) movl R(IdlePTD), %eax xorl %ebx, %ebx movl $NPGPTD, %ecx Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/machdep.c Mon Apr 13 15:22:45 2015 (r281495) @@ -3098,7 +3098,7 @@ init386(first) dblfault_tss.tss_esp2 = (int)&dblfault_stack[sizeof(dblfault_stack)]; dblfault_tss.tss_ss = dblfault_tss.tss_ss0 = dblfault_tss.tss_ss1 = dblfault_tss.tss_ss2 = GSEL(GDATA_SEL, SEL_KPL); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) dblfault_tss.tss_cr3 = (int)IdlePDPT; #else dblfault_tss.tss_cr3 = (int)IdlePTD; @@ -3151,7 +3151,7 @@ init386(first) /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) thread0.td_pcb->pcb_cr3 = (int)IdlePDPT; #else thread0.td_pcb->pcb_cr3 = (int)IdlePTD; @@ -3402,7 +3402,7 @@ init386(first) dblfault_tss.tss_esp2 = (int)&dblfault_stack[sizeof(dblfault_stack)]; dblfault_tss.tss_ss = dblfault_tss.tss_ss0 = dblfault_tss.tss_ss1 = dblfault_tss.tss_ss2 = GSEL(GDATA_SEL, SEL_KPL); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) dblfault_tss.tss_cr3 = (int)IdlePDPT; #else dblfault_tss.tss_cr3 = (int)IdlePTD; @@ -3474,7 +3474,7 @@ init386(first) /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) thread0.td_pcb->pcb_cr3 = (int)IdlePDPT; #else thread0.td_pcb->pcb_cr3 = (int)IdlePTD; Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/minidump_machdep.c Mon Apr 13 15:22:45 2015 (r281495) @@ -265,7 +265,7 @@ minidumpsys(struct dumperinfo *di) mdhdr.bitmapsize = vm_page_dump_size; mdhdr.ptesize = ptesize; mdhdr.kernbase = KERNBASE; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) mdhdr.paemode = 1; #endif Modified: head/sys/i386/i386/mpboot.s ============================================================================== --- head/sys/i386/i386/mpboot.s Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/mpboot.s Mon Apr 13 15:22:45 2015 (r281495) @@ -99,7 +99,7 @@ NON_GPROF_ENTRY(MPentry) movl %eax,%cr4 /* Now enable paging mode */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) movl R(IdlePDPT), %eax movl %eax, %cr3 movl %cr4, %eax Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/pmap.c Mon Apr 13 15:22:45 2015 (r281495) @@ -214,7 +214,7 @@ vm_offset_t kernel_vm_end = KERNBASE + N extern u_int32_t KERNend; extern u_int32_t KPTphys; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) pt_entry_t pg_nx; static uma_zone_t pdptzone; #endif @@ -339,7 +339,7 @@ static void _pmap_unwire_ptp(pmap_t pmap static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offset_t va); static void pmap_pte_release(pt_entry_t *pte); static int pmap_unuse_pt(pmap_t, vm_offset_t, struct spglist *); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) static void *pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, uint8_t *flags, int wait); #endif @@ -400,7 +400,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) */ PMAP_LOCK_INIT(kernel_pmap); kernel_pmap->pm_pdir = (pd_entry_t *) (KERNBASE + (u_int)IdlePTD); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) kernel_pmap->pm_pdpt = (pdpt_entry_t *) (KERNBASE + (u_int)IdlePDPT); #endif CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ @@ -657,7 +657,7 @@ pmap_page_init(vm_page_t m) m->md.pat_mode = PAT_WRITE_BACK; } -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) static void * pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, uint8_t *flags, int wait) { @@ -670,7 +670,7 @@ pmap_pdpt_allocf(uma_zone_t zone, vm_siz #endif /* - * ABuse the pte nodes for unmapped kva to thread a kva freelist through. + * Abuse the pte nodes for unmapped kva to thread a kva freelist through. * Requirements: * - Must deal with pages in order to ensure that none of the PG_* bits * are ever set, PG_V in particular. @@ -809,7 +809,7 @@ pmap_init(void) if (pv_chunkbase == NULL) panic("pmap_init: not enough kvm for pv chunks"); pmap_ptelist_init(&pv_vafree, pv_chunkbase, pv_maxchunks); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) pdptzone = uma_zcreate("PDPT", NPGPTD * sizeof(pdpt_entry_t), NULL, NULL, NULL, NULL, (NPGPTD * sizeof(pdpt_entry_t)) - 1, UMA_ZONE_VM | UMA_ZONE_NOFREE); @@ -1744,7 +1744,7 @@ pmap_pinit0(pmap_t pmap) * not need to be inserted into that list. */ pmap->pm_pdir = (pd_entry_t *)(KERNBASE + (vm_offset_t)IdlePTD); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT); #endif pmap->pm_root.rt_root = 0; @@ -1773,7 +1773,7 @@ pmap_pinit(pmap_t pmap) pmap->pm_pdir = (pd_entry_t *)kva_alloc(NBPTD); if (pmap->pm_pdir == NULL) return (0); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) pmap->pm_pdpt = uma_zalloc(pdptzone, M_WAITOK | M_ZERO); KASSERT(((vm_offset_t)pmap->pm_pdpt & ((NPGPTD * sizeof(pdpt_entry_t)) - 1)) == 0, @@ -1815,7 +1815,7 @@ pmap_pinit(pmap_t pmap) for (i = 0; i < NPGPTD; i++) { pa = VM_PAGE_TO_PHYS(ptdpg[i]); pmap->pm_pdir[PTDPTDI + i] = pa | PG_V | PG_RW | PG_A | PG_M; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) pmap->pm_pdpt[i] = pa | PG_V; #endif } @@ -1974,7 +1974,7 @@ pmap_lazyfix(pmap_t pmap) lsb--; CPU_SETOF(lsb, &mask); mtx_lock_spin(&smp_ipi_mtx); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) lazyptd = vtophys(pmap->pm_pdpt); #else lazyptd = vtophys(pmap->pm_pdir); @@ -2058,7 +2058,7 @@ pmap_release(pmap_t pmap) for (i = 0; i < NPGPTD; i++) { m = ptdpg[i]; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) KASSERT(VM_PAGE_TO_PHYS(m) == (pmap->pm_pdpt[i] & PG_FRAME), ("pmap_release: got wrong ptd page")); #endif @@ -3150,7 +3150,7 @@ retry: } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) newpde |= pg_nx; #endif @@ -3183,7 +3183,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv return; } -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((prot & (VM_PROT_WRITE|VM_PROT_EXECUTE)) == (VM_PROT_WRITE|VM_PROT_EXECUTE)) return; @@ -3286,13 +3286,13 @@ retry: } pbits &= ~(PG_RW | PG_M); } -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) pbits |= pg_nx; #endif if (pbits != obits) { -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if (!atomic_cmpset_64(pte, obits, pbits)) goto retry; #else @@ -3606,7 +3606,7 @@ validate: if ((newpte & PG_MANAGED) != 0) vm_page_aflag_set(m, PGA_WRITEABLE); } -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; #endif @@ -3633,7 +3633,7 @@ validate: vm_page_aflag_set(om, PGA_REFERENCED); if (opa != VM_PAGE_TO_PHYS(m)) invlva = TRUE; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((origpte & PG_NX) == 0 && (newpte & PG_NX) != 0) invlva = TRUE; @@ -3704,7 +3704,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t return (FALSE); } } -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) newpde |= pg_nx; #endif @@ -3881,7 +3881,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ pmap->pm_stats.resident_count++; pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) pa |= pg_nx; #endif @@ -5461,7 +5461,7 @@ pmap_activate(struct thread *td) CPU_CLR(cpuid, &oldpmap->pm_active); CPU_SET(cpuid, &pmap->pm_active); #endif -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) cr3 = vtophys(pmap->pm_pdpt); #else cr3 = vtophys(pmap->pm_pdir); Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/swtch.s Mon Apr 13 15:22:45 2015 (r281495) @@ -174,7 +174,7 @@ ENTRY(cpu_switch) /* switch address space */ movl PCB_CR3(%edx),%eax -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) cmpl %eax,IdlePDPT /* Kernel address space? */ #else cmpl %eax,IdlePTD /* Kernel address space? */ Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/trap.c Mon Apr 13 15:22:45 2015 (r281495) @@ -881,7 +881,7 @@ trap_pfault(frame, usermode, eva) */ if (frame->tf_err & PGEX_W) ftype = VM_PROT_WRITE; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) else if ((frame->tf_err & PGEX_I) && pg_nx != 0) ftype = VM_PROT_EXECUTE; #endif Modified: head/sys/i386/i386/vm86bios.s ============================================================================== --- head/sys/i386/i386/vm86bios.s Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/vm86bios.s Mon Apr 13 15:22:45 2015 (r281495) @@ -120,7 +120,7 @@ ENTRY(vm86_bioscall) movl SCR_NEWPTD(%edx),%eax /* mapping for vm86 page table */ movl %eax,0(%ebx) /* ... install as PTD entry 0 */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) movl IdlePDPT,%ecx #endif movl %ecx,%cr3 /* new page tables */ Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/i386/vm_machdep.c Mon Apr 13 15:22:45 2015 (r281495) @@ -262,7 +262,7 @@ cpu_fork(td1, p2, td2, flags) * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdpt); #else pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdir); Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/include/param.h Mon Apr 13 15:22:45 2015 (r281495) @@ -90,7 +90,7 @@ #define PAGE_MASK (PAGE_SIZE-1) #define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) #define NPGPTD 4 #define PDRSHIFT 21 /* LOG2(NBPDR) */ #define NPGPTD_SHIFT 9 Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/include/pmap.h Mon Apr 13 15:22:45 2015 (r281495) @@ -63,7 +63,7 @@ #define PG_AVAIL2 0x400 /* < programmers use */ #define PG_AVAIL3 0x800 /* \ */ #define PG_PDE_PAT 0x1000 /* PAT PAT index */ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) #define PG_NX (1ull<<63) /* No-execute */ #endif @@ -71,7 +71,7 @@ /* Our various interpretations of the above */ #define PG_W PG_AVAIL1 /* "Wired" pseudoflag */ #define PG_MANAGED PG_AVAIL2 -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) #define PG_FRAME (0x000ffffffffff000ull) #define PG_PS_FRAME (0x000fffffffe00000ull) #else @@ -110,7 +110,7 @@ * is 1 Gigabyte. Double everything. It must be a multiple of 8 for PAE. */ #ifndef KVA_PAGES -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) #define KVA_PAGES 512 #else #define KVA_PAGES 256 @@ -128,11 +128,14 @@ * be calculated as follows: * max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR * PAE: max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages. + * PAE_TABLES: max_phys 4G, sizeof(vm_page) 68, NBPDR 2M, 36 page table pages. * Non-PAE: max_phys 4G, sizeof(vm_page) 68, NBPDR 4M, 18 page table pages. */ #ifndef NKPT -#ifdef PAE +#if defined(PAE) #define NKPT 240 +#elif defined(PAE_TABLES) +#define NKPT 60 #else #define NKPT 30 #endif @@ -166,7 +169,7 @@ #include -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) typedef uint64_t pdpt_entry_t; typedef uint64_t pd_entry_t; @@ -193,7 +196,7 @@ extern pt_entry_t PTmap[]; extern pd_entry_t PTD[]; extern pd_entry_t PTDpde[]; -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) extern pdpt_entry_t *IdlePDPT; #endif extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ @@ -331,7 +334,7 @@ pmap_kextract(vm_offset_t va) #define PT_UPDATES_FLUSH() #endif -#if defined(PAE) && !defined(XEN) +#if (defined(PAE) || defined(PAE_TABLES)) && !defined(XEN) #define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new) #define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) @@ -340,7 +343,7 @@ pmap_kextract(vm_offset_t va) extern pt_entry_t pg_nx; -#elif !defined(PAE) && !defined(XEN) +#elif !defined(PAE) && !defined(PAE_TABLES) && !defined(XEN) #define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new) #define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte) @@ -375,8 +378,8 @@ struct pmap { cpuset_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ -#ifdef PAE - pdpt_entry_t *pm_pdpt; /* KVA of page director pointer +#if defined(PAE) || defined(PAE_TABLES) + pdpt_entry_t *pm_pdpt; /* KVA of page directory pointer table */ #endif struct vm_radix pm_root; /* spare page table pages */ Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/i386/include/vmparam.h Mon Apr 13 15:22:45 2015 (r281495) @@ -120,11 +120,11 @@ #endif /* - * Level 0 reservations consist of 512 pages under PAE and 1024 pages - * otherwise. + * Level 0 reservations consist of 512 pages when PAE pagetables are + * used, and 1024 pages otherwise. */ #ifndef VM_LEVEL_0_ORDER -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) #define VM_LEVEL_0_ORDER 9 #else #define VM_LEVEL_0_ORDER 10 Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon Apr 13 14:43:10 2015 (r281494) +++ head/sys/x86/acpica/acpi_wakeup.c Mon Apr 13 15:22:45 2015 (r281495) @@ -379,7 +379,7 @@ acpi_install_wakeup_handler(struct acpi_ /* Save pointers to some global data. */ WAKECODE_FIXUP(wakeup_ret, void *, resumectx); #ifndef __amd64__ -#ifdef PAE +#if defined(PAE) || defined(PAE_TABLES) WAKECODE_FIXUP(wakeup_cr3, register_t, vtophys(kernel_pmap->pm_pdpt)); #else WAKECODE_FIXUP(wakeup_cr3, register_t, vtophys(kernel_pmap->pm_pdir)); From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 15:24:11 2015 Return-Path: Delivered-To: svn-src-all@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 B0390675; Mon, 13 Apr 2015 15:24:11 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54959A64; Mon, 13 Apr 2015 15:24:11 +0000 (UTC) Received: by widdi4 with SMTP id di4so77544682wid.0; Mon, 13 Apr 2015 08:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2ZZ1d/ecxlEhNdilBFRlbgtPHA2Z4um6meHoPPWAtHs=; b=zMae0p9AwINPYQRXb4Fh8o9mbSXE4l2q83HRdRYNoxfvC34Ed6KlSUxia4O4dBK/2u HCyLN6ZXXVdVAxAD7hmebj84Z6OgHjRN8iTAAIm01CBzn2vdMaNLi3YLg5zVBfAyq7aN 7afix48aZ+a/n3ntSQVQn+bRm8gz32QegSRd7sM4PuyrTlBYsxQqNs/2G4FRyLRt+EP1 bChf0KmGW36ECSH1wofJXZHezpKmOC3KDw2GJTyKz0vsWSr+zEVW9gw3h4wWBRlumWdR cE6f9Pz7C8iGFOmUC0vE9J5sBCxegMWDxk8ElxrnwwcCyw9jrnFyrZlpdB2RTg+0Ge0L K97w== MIME-Version: 1.0 X-Received: by 10.180.97.129 with SMTP id ea1mr23048875wib.24.1428938649706; Mon, 13 Apr 2015 08:24:09 -0700 (PDT) Received: by 10.27.77.201 with HTTP; Mon, 13 Apr 2015 08:24:09 -0700 (PDT) In-Reply-To: <201504131522.t3DFMkiE050257@svn.freebsd.org> References: <201504131522.t3DFMkiE050257@svn.freebsd.org> Date: Mon, 13 Apr 2015 11:24:09 -0400 Message-ID: Subject: Re: svn commit: r281495 - in head/sys: conf i386/i386 i386/include x86/acpica From: Benjamin Kaduk To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 15:24:11 -0000 On Mon, Apr 13, 2015 at 11:22 AM, Konstantin Belousov wrote: > Author: kib > Date: Mon Apr 13 15:22:45 2015 > New Revision: 281495 > URL: https://svnweb.freebsd.org/changeset/base/281495 > > Log: > Add config option PAE_TABLES for the i386 kernel. It switches pmap to > use PAE format for the page tables, but does not incur other > consequences of the full PAE config. In particular, vm_paddr_t and > bus_addr_t are left 32bit, and max supported memory is still limited > by 4GB. > > The option allows to have nx permissions for memory mappings on i386 > kernel, while keeping the usual i386 KBI and avoiding the kernel data > sizing problems typical for the PAE config. > > Intel documented that the PAE format for page tables is available > starting with the Pentium Pro, but it is possible that the plain > Pentium CPUs have the required support (Appendix H). The goal is to > enable the option and non-exec mappings on i386 for the GENERIC > kernel. Anybody wanting a useful system on 486, have to reconfigure > the modern i386 kernel anyway. > > Discussed with: alc, jhb > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > relnotes: yes? -Ben From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 15:43:28 2015 Return-Path: Delivered-To: svn-src-all@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 59398A2A; Mon, 13 Apr 2015 15:43:28 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC65BCAF; Mon, 13 Apr 2015 15:43:27 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t3DFhMA1062290 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 13 Apr 2015 18:43:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t3DFhMA1062290 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t3DFhLRh062289; Mon, 13 Apr 2015 18:43:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Apr 2015 18:43:21 +0300 From: Konstantin Belousov To: Benjamin Kaduk Subject: Re: svn commit: r281495 - in head/sys: conf i386/i386 i386/include x86/acpica Message-ID: <20150413154321.GW2390@kib.kiev.ua> References: <201504131522.t3DFMkiE050257@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 15:43:28 -0000 On Mon, Apr 13, 2015 at 11:24:09AM -0400, Benjamin Kaduk wrote: > On Mon, Apr 13, 2015 at 11:22 AM, Konstantin Belousov > wrote: > > > Author: kib > > Date: Mon Apr 13 15:22:45 2015 > > New Revision: 281495 > > URL: https://svnweb.freebsd.org/changeset/base/281495 > > > > Log: > > Add config option PAE_TABLES for the i386 kernel. It switches pmap to > > use PAE format for the page tables, but does not incur other > > consequences of the full PAE config. In particular, vm_paddr_t and > > bus_addr_t are left 32bit, and max supported memory is still limited > > by 4GB. > > > > The option allows to have nx permissions for memory mappings on i386 > > kernel, while keeping the usual i386 KBI and avoiding the kernel data > > sizing problems typical for the PAE config. > > > > Intel documented that the PAE format for page tables is available > > starting with the Pentium Pro, but it is possible that the plain > > Pentium CPUs have the required support (Appendix H). The goal is to > > enable the option and non-exec mappings on i386 for the GENERIC > > kernel. Anybody wanting a useful system on 486, have to reconfigure > > the modern i386 kernel anyway. > > > > Discussed with: alc, jhb > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > > > relnotes: yes? I do not see much use in the wide announcement. Right now, this is yet another kernel option. If the required benchmarking and some more old documentation spelunking is going to be done, so that the GENERIC is indeed switched to requiring PAE, then relnotes should indeed mention the change. Otherwise, I do not see why this could be interesting to a user who cannot read NOTES. From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 16:00:11 2015 Return-Path: Delivered-To: svn-src-all@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 5FFD8F4D; Mon, 13 Apr 2015 16:00: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 32A34E18; Mon, 13 Apr 2015 16:00: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 t3DG0AYR065363; Mon, 13 Apr 2015 16:00:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DG0ANi065361; Mon, 13 Apr 2015 16:00:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504131600.t3DG0ANi065361@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 13 Apr 2015 16:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281496 - in head/sys/boot/efi: boot1 loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 16:00:11 -0000 Author: andrew Date: Mon Apr 13 16:00:09 2015 New Revision: 281496 URL: https://svnweb.freebsd.org/changeset/base/281496 Log: Create the correct symlinks for the machine directory, and only create the x86 symlink on i386 and amd64. Before this incorrect symlinks were being created on armi and i386. Differential Revision: https://reviews.freebsd.org/D2283 Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Apr 13 15:22:45 2015 (r281495) +++ head/sys/boot/efi/boot1/Makefile Mon Apr 13 16:00:09 2015 (r281496) @@ -90,13 +90,16 @@ CLEANFILES= boot1.efi boot1.efifat .include -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -beforedepend ${OBJS}: machine x86 +beforedepend ${OBJS}: machine -CLEANFILES+= machine x86 +CLEANFILES+= machine machine: - ln -sf ${.CURDIR}/../../../amd64/include machine + ln -sf ${.CURDIR}/../../../${MACHINE}/include machine + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +beforedepend ${OBJS}: x86 +CLEANFILES+= x86 x86: ln -sf ${.CURDIR}/../../../x86/include x86 Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Apr 13 15:22:45 2015 (r281495) +++ head/sys/boot/efi/loader/Makefile Mon Apr 13 16:00:09 2015 (r281496) @@ -111,12 +111,17 @@ LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} $ .include -beforedepend ${OBJS}: machine x86 +beforedepend ${OBJS}: machine -CLEANFILES+= machine x86 +CLEANFILES+= machine machine: - ln -sf ${.CURDIR}/../../../amd64/include machine + ln -sf ${.CURDIR}/../../../${MACHINE}/include machine + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +beforedepend ${OBJS}: x86 +CLEANFILES+= x86 x86: ln -sf ${.CURDIR}/../../../x86/include x86 +.endif From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 16:35:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D7B8BB0; Mon, 13 Apr 2015 16:35:34 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 3BF2C1996; Mon, 13 Apr 2015 16:35:34 +0000 (UTC) Message-ID: <552BF055.9080709@FreeBSD.org> Date: Mon, 13 Apr 2015 12:35:33 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r281396 - in head/sys: contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/disassembler contrib... References: <201504110323.t3B3Ngep029970@svn.freebsd.org> <835FF75C-5740-4EF4-B6EE-5FB48E1523F4@FreeBSD.org> In-Reply-To: <835FF75C-5740-4EF4-B6EE-5FB48E1523F4@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 16:35:34 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 04/11/2015 17:16, Dimitry Andric wrote: > On 11 Apr 2015, at 05:23, Jung-uk Kim wrote: >> >> Author: jkim Date: Sat Apr 11 03:23:41 2015 New Revision: 281396 >> URL: https://svnweb.freebsd.org/changeset/base/281396 >> >> Log: Merge ACPICA 20150410. > > Shall we MFC this at some point? :) MFC after: 1 week Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVK/BQAAoJEHyflib82/FGAOwH/25zX6JC6uKNIIRmpt4KPmsC gbzW8ltkR+kD7gA/kTtJuInX2l7FWRTruPDkISGLf5eYzhI1pMh0OxtqPc+jg8oB wpHA9CxI3CEBaKejF1asupqZR9cNnvMEqhk4ItT65uWA5bzPbHF49jeClKbQ2JvK amMkZFFxwdjvAZ94cdu9sxMbWdfFn/wVg81gap0pOfgClQ7JHyKEVNDpNTgC8siT Z10f8wfbs3zMJ166WooTTdN+gb8cuOtxXBv3fnvhJcVzRSDKyd5ZyeejTVylCj1D i5ypQiKo51ddJWnBo2LCiHpsSBWZNu8UTik0FWOAF/lqxVZhH5t7H2TReXz9K6s= =ATsb -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 16:41:35 2015 Return-Path: Delivered-To: svn-src-all@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 8F41BDBD; Mon, 13 Apr 2015 16:41: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 7A52E3A1; Mon, 13 Apr 2015 16:41: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 t3DGfZlS087989; Mon, 13 Apr 2015 16:41:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DGfY3O087984; Mon, 13 Apr 2015 16:41:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504131641.t3DGfY3O087984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 13 Apr 2015 16:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281497 - in head/sys: arm64/conf conf dev/psci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 16:41:35 -0000 Author: andrew Date: Mon Apr 13 16:41:33 2015 New Revision: 281497 URL: https://svnweb.freebsd.org/changeset/base/281497 Log: Add psci for arm64. This is currently used when rebooting and powering off in qemu. Sponsored by: The FreeBSD Foundation Added: head/sys/dev/psci/psci_arm64.S (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Apr 13 16:00:09 2015 (r281496) +++ head/sys/arm64/conf/GENERIC Mon Apr 13 16:41:33 2015 (r281497) @@ -84,6 +84,7 @@ device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device psci # Support for ARM PSCI # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Apr 13 16:00:09 2015 (r281496) +++ head/sys/conf/files.arm64 Mon Apr 13 16:41:33 2015 (r281497) @@ -34,6 +34,8 @@ arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard dev/fdt/fdt_arm64.c optional fdt dev/ofw/ofw_cpu.c optional fdt +dev/psci/psci.c optional psci +dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_pl011.c optional uart pl011 kern/kern_clocksource.c standard Added: head/sys/dev/psci/psci_arm64.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/psci_arm64.S Mon Apr 13 16:41:33 2015 (r281497) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2013, 2014 Robin Randhawa + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner 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, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * uint64_t psci_hvc_despatch(uint64_t psci_fnid, uint64_t, uint64_t, uint64_t) + */ +ENTRY(psci_hvc_despatch) + hvc #0 + ret +END(psci_hvc_despatch) + +/* + * uint64_t psci_smc_despatch(uint64_t psci_fnid, uint64_t, uint64_t, uint64_t) + */ +ENTRY(psci_smc_despatch) + smc #0 + ret +END(psci_hvc_despatch) From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 17:36:54 2015 Return-Path: Delivered-To: svn-src-all@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 AA0A4218; Mon, 13 Apr 2015 17:36:54 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6DDBE8; Mon, 13 Apr 2015 17:36:53 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id t3DHaBcu017943; Mon, 13 Apr 2015 12:36:52 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 1tq6sm8ryv-3; Mon, 13 Apr 2015 12:36:51 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 2B732403E8; Mon, 13 Apr 2015 12:36:51 -0500 (CDT) Message-ID: <552BFEB2.8040407@rice.edu> Date: Mon, 13 Apr 2015 12:36:50 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: John Baldwin , Bruce Evans Subject: Re: svn commit: r280279 - head/sys/sys References: <201503201027.t2KAR6Ze053047@svn.freebsd.org> <550DA656.5060004@FreeBSD.org> <20150322080015.O955@besplex.bde.org> <17035816.lxyzYKiOWV@ralph.baldwin.cx> In-Reply-To: <17035816.lxyzYKiOWV@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1504130149 Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 17:36:54 -0000 On 03/30/2015 10:50, John Baldwin wrote: > On Sunday, March 22, 2015 09:41:53 AM Bruce Evans wrote: >> On Sat, 21 Mar 2015, John Baldwin wrote: >> >>> On 3/21/15 12:35 PM, Konstantin Belousov wrote: >>>> On Sat, Mar 21, 2015 at 12:04:41PM -0400, John Baldwin wrote: >>>>> On 3/20/15 9:02 AM, Konstantin Belousov wrote: >>>>>> On Fri, Mar 20, 2015 at 10:27:06AM +0000, John Baldwin wrote: >>>>>>> Author: jhb >>>>>>> Date: Fri Mar 20 10:27:06 2015 >>>>>>> New Revision: 280279 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/280279 >>>>>>> >>>>>>> Log: >>>>>>> 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 head= ers without >>>>>>> adding namespace pollution. >>>>>>> - If the POPCNT instruction is enabled at compile time, use >>>>>>> __builtin_popcount*() to implement __bitcount*(), otherwise f= all back >>>>>>> to software implementations. >>>>>> Are you aware of the Haswell errata HSD146 ? I see the described = behaviour >>>>>> on machines back to SandyBridge, but not on Nehalems. >>>>>> HSD146. POPCNT Instruction May Take Longer to Execute Than Expec= ted >>>>>> Problem: POPCNT instruction execution with a 32 or 64 bit operand = may be >>>>>> delayed until previous non-dependent instructions have executed. >>>>>> >>>>>> Jilles noted that gcc head and 4.9.2 already provides a workaround= by >>>>>> xoring the dst register. I have some patch for amd64 pmap, see th= e end >>>>>> of the message. >>>>> No, I was not aware, but I think it's hard to fix this anywhere but= the >>>>> compiler. I set CPUTYPE in src.conf on my Ivy Bridge desktop and c= lang >>>>> uses POPCOUNT for this function from ACPI-CA: >>>>> >>>>> static UINT8 >>>>> AcpiRsCountSetBits ( >>>>> UINT16 BitField) >>>>> { >>>>> UINT8 BitsSet; >>>>> >>>>> >>>>> ACPI_FUNCTION_ENTRY (); >>>>> >>>>> >>>>> for (BitsSet =3D 0; BitField; BitsSet++) >>>>> { >>>>> /* Zero the least significant bit that is set */ >>>>> >>>>> BitField &=3D (UINT16) (BitField - 1); >>>>> } >>>>> >>>>> return (BitsSet); >>>>> } >>>>> >>>>> (I ran into this accidentally because a kernel built on my system f= ailed >>>>> to boot in older qemu because the kernel paniced with an illegal in= struction >>>>> fault in this function.) >> Does it do the same for the similar home made popcount in pmap?: > Yes: > > ffffffff807658d4: f6 04 25 46 e2 d6 80 testb $0x80,0xffffffff= 80d6e246 > ffffffff807658db: 80=20 > ffffffff807658dc: 74 32 je ffffffff80765910= > ffffffff807658de: 48 89 4d b8 mov %rcx,-0x48(%rbp)= > ffffffff807658e2: f3 48 0f b8 4d b8 popcnt -0x48(%rbp),%rcx= > ffffffff807658e8: 48 8b 50 20 mov 0x20(%rax),%rdx > ffffffff807658ec: 48 89 55 b0 mov %rdx,-0x50(%rbp)= > ffffffff807658f0: f3 48 0f b8 55 b0 popcnt -0x50(%rbp),%rdx= > ffffffff807658f6: 01 ca add %ecx,%edx > ffffffff807658f8: 48 8b 48 28 mov 0x28(%rax),%rcx > ffffffff807658fc: 48 89 4d a8 mov %rcx,-0x58(%rbp)= > ffffffff80765900: f3 48 0f b8 4d a8 popcnt -0x58(%rbp),%rcx= > ffffffff80765906: eb 1b jmp ffffffff80765923= > ffffffff80765908: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)= > ffffffff8076590f: 00=20 > ffffffff80765910: f3 48 0f b8 c9 popcnt %rcx,%rcx > ffffffff80765915: f3 48 0f b8 50 20 popcnt 0x20(%rax),%rdx > ffffffff8076591b: 01 ca add %ecx,%edx > ffffffff8076591d: f3 48 0f b8 48 28 popcnt 0x28(%rax),%rcx > ffffffff80765923: 01 d1 add %edx,%ecx > > It also uses popcnt for this in blist_fill() and blist_meta_fill(): > > 742 /* Count the number of blocks we're about to allocate *= / > 743 bitmap =3D scan->u.bmu_bitmap & mask; > 744 for (nblks =3D 0; bitmap !=3D 0; nblks++) > 745 bitmap &=3D bitmap - 1; > >> Always using new API would lose the micro-optimizations given by the r= untime >> decision for default CFLAGS (used by distributions for portability). = To >> keep them, it seems best to keep the inline asm but replace >> popcnt_pc_map_elem(elem) by __bitcount64(elem). -mno-popcount can the= n >> be used to work around slowness in the software (that is actually >> hardware) case. > I'm not sure if bitcount64() is strictly better than the loop in this c= ase > even though it is O(1) given the claimed nature of the values in the co= mment. > I checked. Even with zeroes being more common than ones, bitcount64() is faster than the simple loop. Using bitcount64, reserve_pv_entries() takes on average 4265 cycles during "buildworld" on my test machine. In contrast, with the simple loop, it takes on average 4507 cycles. Even though bitcount64 is a lot larger than the simple loop, we do the 3 bit count operations many times in a loop, so the extra i-cache misses are being made up for by the repeated execution of the faster code. However, in the popcnt case, we are spilling the bit map to memory in order to popcnt it. That's rather silly: 3570: 48 8b 48 18 mov 0x18(%rax),%rcx 3574: f6 04 25 00 00 00 00 testb $0x80,0x0 357b: 80 357c: 74 42 je 35c0 357e: 48 89 4d b8 mov %rcx,-0x48(%rbp) 3582: 31 c9 xor %ecx,%ecx 3584: f3 48 0f b8 4d b8 popcnt -0x48(%rbp),%rcx 358a: 48 8b 50 20 mov 0x20(%rax),%rdx 358e: 48 89 55 b0 mov %rdx,-0x50(%rbp) 3592: 31 d2 xor %edx,%edx 3594: f3 48 0f b8 55 b0 popcnt -0x50(%rbp),%rdx 359a: 01 ca add %ecx,%edx 359c: 48 8b 48 28 mov 0x28(%rax),%rcx 35a0: 48 89 4d a8 mov %rcx,-0x58(%rbp) 35a4: 31 c9 xor %ecx,%ecx 35a6: f3 48 0f b8 4d a8 popcnt -0x58(%rbp),%rcx 35ac: 01 d1 add %edx,%ecx 35ae: e9 12 01 00 00 jmpq 36c5 Caveat: I'm still using clang 3.5. Maybe the newer clang doesn't spill? From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 17:51:06 2015 Return-Path: Delivered-To: svn-src-all@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 8B36F9BD; Mon, 13 Apr 2015 17:51:06 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEBEDD4D; Mon, 13 Apr 2015 17:51:05 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t3DHosQ3099428 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 13 Apr 2015 20:50:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t3DHosQ3099428 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t3DHosHv099427; Mon, 13 Apr 2015 20:50:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Apr 2015 20:50:54 +0300 From: Konstantin Belousov To: Alan Cox Subject: Re: svn commit: r280279 - head/sys/sys Message-ID: <20150413175054.GY2390@kib.kiev.ua> References: <201503201027.t2KAR6Ze053047@svn.freebsd.org> <550DA656.5060004@FreeBSD.org> <20150322080015.O955@besplex.bde.org> <17035816.lxyzYKiOWV@ralph.baldwin.cx> <552BFEB2.8040407@rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <552BFEB2.8040407@rice.edu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 17:51:06 -0000 On Mon, Apr 13, 2015 at 12:36:50PM -0500, Alan Cox wrote: > However, in the popcnt case, we are spilling the bit map to memory in > order to popcnt it. That's rather silly: > > 3570: 48 8b 48 18 mov 0x18(%rax),%rcx > 3574: f6 04 25 00 00 00 00 testb $0x80,0x0 > 357b: 80 > 357c: 74 42 je 35c0 > > 357e: 48 89 4d b8 mov %rcx,-0x48(%rbp) > 3582: 31 c9 xor %ecx,%ecx > 3584: f3 48 0f b8 4d b8 popcnt -0x48(%rbp),%rcx > 358a: 48 8b 50 20 mov 0x20(%rax),%rdx > 358e: 48 89 55 b0 mov %rdx,-0x50(%rbp) > 3592: 31 d2 xor %edx,%edx > 3594: f3 48 0f b8 55 b0 popcnt -0x50(%rbp),%rdx > 359a: 01 ca add %ecx,%edx > 359c: 48 8b 48 28 mov 0x28(%rax),%rcx > 35a0: 48 89 4d a8 mov %rcx,-0x58(%rbp) > 35a4: 31 c9 xor %ecx,%ecx > 35a6: f3 48 0f b8 4d a8 popcnt -0x58(%rbp),%rcx > 35ac: 01 d1 add %edx,%ecx > 35ae: e9 12 01 00 00 jmpq 36c5 > > > Caveat: I'm still using clang 3.5. Maybe the newer clang doesn't spill? 3.6.0 generates similar code. From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 19:06:47 2015 Return-Path: Delivered-To: svn-src-all@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 D56C5B69; Mon, 13 Apr 2015 19:06:47 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9590F80F; Mon, 13 Apr 2015 19:06:47 +0000 (UTC) Received: by iebmp1 with SMTP id mp1so73331826ieb.0; Mon, 13 Apr 2015 12:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=SqvHlCeNAZoZHEQkuduzUIXpAz+7GZTCXlvqKuXyjmk=; b=yEDxRinQjltKPNx7xHSgjylBeooWPn1YHr1pngnFb2wSEKc+9Wc4u7XKd+cjoNAExs i7VQweX8XCHztz2zdq1FIX2i5YaIeRx4AXLwM5mf7/xqjKg5q71bYRCAEQfbbs/IypH3 jeUWxbl0Mph/Y7lkVhiytsMfPMXCer0Mv1WHqm7o5lmvAPPzF+sXDCh36SwEGC0awhrI C40XEwnDnI7IabgrFsEg0EhZ9nRK2KfdZsfPCdTdme2pRKX+sNKkv5OAinRkVtcRNTl9 w+ulnVbLo6e7zv86t4r2GVx+6FsOathgDl9/wGQhzgDRXB5P2bHKnLaTUIaYr0pQ6CQT 9bCA== MIME-Version: 1.0 X-Received: by 10.43.163.129 with SMTP id mo1mr20686133icc.61.1428952006216; Mon, 13 Apr 2015 12:06:46 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Mon, 13 Apr 2015 12:06:46 -0700 (PDT) In-Reply-To: <552BFEB2.8040407@rice.edu> References: <201503201027.t2KAR6Ze053047@svn.freebsd.org> <550DA656.5060004@FreeBSD.org> <20150322080015.O955@besplex.bde.org> <17035816.lxyzYKiOWV@ralph.baldwin.cx> <552BFEB2.8040407@rice.edu> Date: Mon, 13 Apr 2015 12:06:46 -0700 X-Google-Sender-Auth: IKfXdRveN1SnY95Jw2NKmMKU1g0 Message-ID: Subject: Re: svn commit: r280279 - head/sys/sys From: Adrian Chadd To: Alan Cox Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , John Baldwin , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Bruce Evans , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 19:06:48 -0000 Hi, These CPUs are supposed to have loop unwinder / streaming hardware. Is it not unwinding/streaming this loop for us? -a On 13 April 2015 at 10:36, Alan Cox wrote: > On 03/30/2015 10:50, John Baldwin wrote: >> On Sunday, March 22, 2015 09:41:53 AM Bruce Evans wrote: >>> On Sat, 21 Mar 2015, John Baldwin wrote: >>> >>>> On 3/21/15 12:35 PM, Konstantin Belousov wrote: >>>>> On Sat, Mar 21, 2015 at 12:04:41PM -0400, John Baldwin wrote: >>>>>> On 3/20/15 9:02 AM, Konstantin Belousov wrote: >>>>>>> On Fri, Mar 20, 2015 at 10:27:06AM +0000, John Baldwin wrote: >>>>>>>> Author: jhb >>>>>>>> Date: Fri Mar 20 10:27:06 2015 >>>>>>>> New Revision: 280279 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/280279 >>>>>>>> >>>>>>>> Log: >>>>>>>> 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. >>>>>>> Are you aware of the Haswell errata HSD146 ? I see the described behaviour >>>>>>> on machines back to SandyBridge, but not on Nehalems. >>>>>>> HSD146. POPCNT Instruction May Take Longer to Execute Than Expected >>>>>>> Problem: POPCNT instruction execution with a 32 or 64 bit operand may be >>>>>>> delayed until previous non-dependent instructions have executed. >>>>>>> >>>>>>> Jilles noted that gcc head and 4.9.2 already provides a workaround by >>>>>>> xoring the dst register. I have some patch for amd64 pmap, see the end >>>>>>> of the message. >>>>>> No, I was not aware, but I think it's hard to fix this anywhere but the >>>>>> compiler. I set CPUTYPE in src.conf on my Ivy Bridge desktop and clang >>>>>> uses POPCOUNT for this function from ACPI-CA: >>>>>> >>>>>> static UINT8 >>>>>> AcpiRsCountSetBits ( >>>>>> UINT16 BitField) >>>>>> { >>>>>> UINT8 BitsSet; >>>>>> >>>>>> >>>>>> ACPI_FUNCTION_ENTRY (); >>>>>> >>>>>> >>>>>> for (BitsSet = 0; BitField; BitsSet++) >>>>>> { >>>>>> /* Zero the least significant bit that is set */ >>>>>> >>>>>> BitField &= (UINT16) (BitField - 1); >>>>>> } >>>>>> >>>>>> return (BitsSet); >>>>>> } >>>>>> >>>>>> (I ran into this accidentally because a kernel built on my system failed >>>>>> to boot in older qemu because the kernel paniced with an illegal instruction >>>>>> fault in this function.) >>> Does it do the same for the similar home made popcount in pmap?: >> Yes: >> >> ffffffff807658d4: f6 04 25 46 e2 d6 80 testb $0x80,0xffffffff80d6e246 >> ffffffff807658db: 80 >> ffffffff807658dc: 74 32 je ffffffff80765910 >> ffffffff807658de: 48 89 4d b8 mov %rcx,-0x48(%rbp) >> ffffffff807658e2: f3 48 0f b8 4d b8 popcnt -0x48(%rbp),%rcx >> ffffffff807658e8: 48 8b 50 20 mov 0x20(%rax),%rdx >> ffffffff807658ec: 48 89 55 b0 mov %rdx,-0x50(%rbp) >> ffffffff807658f0: f3 48 0f b8 55 b0 popcnt -0x50(%rbp),%rdx >> ffffffff807658f6: 01 ca add %ecx,%edx >> ffffffff807658f8: 48 8b 48 28 mov 0x28(%rax),%rcx >> ffffffff807658fc: 48 89 4d a8 mov %rcx,-0x58(%rbp) >> ffffffff80765900: f3 48 0f b8 4d a8 popcnt -0x58(%rbp),%rcx >> ffffffff80765906: eb 1b jmp ffffffff80765923 >> ffffffff80765908: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff8076590f: 00 >> ffffffff80765910: f3 48 0f b8 c9 popcnt %rcx,%rcx >> ffffffff80765915: f3 48 0f b8 50 20 popcnt 0x20(%rax),%rdx >> ffffffff8076591b: 01 ca add %ecx,%edx >> ffffffff8076591d: f3 48 0f b8 48 28 popcnt 0x28(%rax),%rcx >> ffffffff80765923: 01 d1 add %edx,%ecx >> >> It also uses popcnt for this in blist_fill() and blist_meta_fill(): >> >> 742 /* Count the number of blocks we're about to allocate */ >> 743 bitmap = scan->u.bmu_bitmap & mask; >> 744 for (nblks = 0; bitmap != 0; nblks++) >> 745 bitmap &= bitmap - 1; >> >>> Always using new API would lose the micro-optimizations given by the runtime >>> decision for default CFLAGS (used by distributions for portability). To >>> keep them, it seems best to keep the inline asm but replace >>> popcnt_pc_map_elem(elem) by __bitcount64(elem). -mno-popcount can then >>> be used to work around slowness in the software (that is actually >>> hardware) case. >> I'm not sure if bitcount64() is strictly better than the loop in this case >> even though it is O(1) given the claimed nature of the values in the comment. >> > > > I checked. Even with zeroes being more common than ones, bitcount64() > is faster than the simple loop. Using bitcount64, reserve_pv_entries() > takes on average 4265 cycles during "buildworld" on my test machine. In > contrast, with the simple loop, it takes on average 4507 cycles. Even > though bitcount64 is a lot larger than the simple loop, we do the 3 bit > count operations many times in a loop, so the extra i-cache misses are > being made up for by the repeated execution of the faster code. > > However, in the popcnt case, we are spilling the bit map to memory in > order to popcnt it. That's rather silly: > > 3570: 48 8b 48 18 mov 0x18(%rax),%rcx > 3574: f6 04 25 00 00 00 00 testb $0x80,0x0 > 357b: 80 > 357c: 74 42 je 35c0 > > 357e: 48 89 4d b8 mov %rcx,-0x48(%rbp) > 3582: 31 c9 xor %ecx,%ecx > 3584: f3 48 0f b8 4d b8 popcnt -0x48(%rbp),%rcx > 358a: 48 8b 50 20 mov 0x20(%rax),%rdx > 358e: 48 89 55 b0 mov %rdx,-0x50(%rbp) > 3592: 31 d2 xor %edx,%edx > 3594: f3 48 0f b8 55 b0 popcnt -0x50(%rbp),%rdx > 359a: 01 ca add %ecx,%edx > 359c: 48 8b 48 28 mov 0x28(%rax),%rcx > 35a0: 48 89 4d a8 mov %rcx,-0x58(%rbp) > 35a4: 31 c9 xor %ecx,%ecx > 35a6: f3 48 0f b8 4d a8 popcnt -0x58(%rbp),%rcx > 35ac: 01 d1 add %edx,%ecx > 35ae: e9 12 01 00 00 jmpq 36c5 > > > Caveat: I'm still using clang 3.5. Maybe the newer clang doesn't spill? > > > From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 19:13:53 2015 Return-Path: Delivered-To: svn-src-all@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 1C598EF6; Mon, 13 Apr 2015 19:13: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 E1C9B8FC; Mon, 13 Apr 2015 19:13: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 t3DJDq4d062313; Mon, 13 Apr 2015 19:13:52 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DJDqvx062305; Mon, 13 Apr 2015 19:13:52 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201504131913.t3DJDqvx062305@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Mon, 13 Apr 2015 19:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281499 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 19:13:53 -0000 Author: neel Date: Mon Apr 13 19:13:51 2015 New Revision: 281499 URL: https://svnweb.freebsd.org/changeset/base/281499 Log: Modify the return value of the uhci/ehci/xhci PCI probe routines to 'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership of the device and pass it through to the guest. In the common case where there are no competing drivers for USB controllers this change is a no-op. Reviewed by: hselasky MFC after: 2 weeks Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Apr 13 16:43:06 2015 (r281498) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Apr 13 19:13:51 2015 (r281499) @@ -220,7 +220,7 @@ ehci_pci_probe(device_t self) if (desc) { device_set_desc(self, desc); - return (0); + return (BUS_PROBE_DEFAULT); } else { return (ENXIO); } Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Mon Apr 13 16:43:06 2015 (r281498) +++ head/sys/dev/usb/controller/uhci_pci.c Mon Apr 13 19:13:51 2015 (r281499) @@ -244,7 +244,7 @@ uhci_pci_probe(device_t self) if (desc) { device_set_desc(self, desc); - return (0); + return (BUS_PROBE_DEFAULT); } else { return (ENXIO); } Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Mon Apr 13 16:43:06 2015 (r281498) +++ head/sys/dev/usb/controller/xhci_pci.c Mon Apr 13 19:13:51 2015 (r281499) @@ -131,7 +131,7 @@ xhci_pci_probe(device_t self) if (desc) { device_set_desc(self, desc); - return (0); + return (BUS_PROBE_DEFAULT); } else { return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 19:46:32 2015 Return-Path: Delivered-To: svn-src-all@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 17ED3329; Mon, 13 Apr 2015 19:46:32 +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 ED5E2D55; Mon, 13 Apr 2015 19:46: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 t3DJkVAX078286; Mon, 13 Apr 2015 19:46:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DJkVDN078284; Mon, 13 Apr 2015 19:46:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504131946.t3DJkVDN078284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Apr 2015 19:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281500 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 19:46:32 -0000 Author: delphij Date: Mon Apr 13 19:46:30 2015 New Revision: 281500 URL: https://svnweb.freebsd.org/changeset/base/281500 Log: Sync with NetBSD: - Mention xz(1) in gzip(1). - Strip away path from header name when decompressing. MFC after: 2 weeks Modified: head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.1 ============================================================================== --- head/usr.bin/gzip/gzip.1 Mon Apr 13 19:13:51 2015 (r281499) +++ head/usr.bin/gzip/gzip.1 Mon Apr 13 19:46:30 2015 (r281500) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.23 2014/03/18 18:20:45 riastradh Exp $ +.\" $NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd October 9, 2011 +.Dd April 6, 2015 .Dt GZIP 1 .Os .Sh NAME @@ -105,9 +105,10 @@ options are enabled. This version of .Nm is also capable of decompressing files compressed using -.Xr compress 1 +.Xr compress 1 , +.Xr bzip2 1 , or -.Xr bzip2 1 . +.Xr xz 1 . .Sh OPTIONS The following options are available: .Bl -tag -width XXrXXXrecursiveX Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Mon Apr 13 19:13:51 2015 (r281499) +++ head/usr.bin/gzip/gzip.c Mon Apr 13 19:46:30 2015 (r281500) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.106 2014/10/18 08:33:30 snj Exp $ */ +/* $NetBSD: gzip.c,v 1.107 2015/01/13 02:37:20 mrg Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -158,7 +158,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20141022"; +static const char gzip_version[] = "FreeBSD gzip 20150413"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -1354,7 +1354,7 @@ file_uncompress(char *file, char *outfil #ifndef SMALL ssize_t rv; time_t timestamp = 0; - unsigned char name[PATH_MAX + 1]; + char name[PATH_MAX + 1]; #endif /* gather the old name info */ @@ -1415,15 +1415,24 @@ file_uncompress(char *file, char *outfil goto lose; } if (name[0] != 0) { + char *dp, *nf; + + /* strip saved directory name */ + nf = strrchr(name, '/'); + if (nf == NULL) + nf = name; + else + nf++; + /* preserve original directory name */ - char *dp = strrchr(file, '/'); + dp = strrchr(file, '/'); if (dp == NULL) dp = file; else dp++; snprintf(outfile, outsize, "%.*s%.*s", (int) (dp - file), - file, (int) rbytes, name); + file, (int) rbytes, nf); } } } @@ -2110,7 +2119,7 @@ static void display_license(void) { - fprintf(stderr, "%s (based on NetBSD gzip 20141018)\n", gzip_version); + fprintf(stderr, "%s (based on NetBSD gzip 20150113)\n", gzip_version); fprintf(stderr, "%s\n", gzip_copyright); exit(0); } From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 19:58:13 2015 Return-Path: Delivered-To: svn-src-all@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 62F796F2; Mon, 13 Apr 2015 19:58:13 +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 4D2C1EAB; Mon, 13 Apr 2015 19:58:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DJwDkk083449; Mon, 13 Apr 2015 19:58:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DJwBte083441; Mon, 13 Apr 2015 19:58:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504131958.t3DJwBte083441@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 19:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281501 - head/usr.bin/ipcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 19:58:13 -0000 Author: eadler Date: Mon Apr 13 19:58:11 2015 New Revision: 281501 URL: https://svnweb.freebsd.org/changeset/base/281501 Log: ipcs: fix warnings (WARNS=1 -> WARNS=6) - fix shadow warnings - change type from off_t to size_t which is more correct and avoids signed/unsigned compare - use new initializer format to avoid "missing values" warning Reviewed by: jhb Modified: head/usr.bin/ipcs/Makefile head/usr.bin/ipcs/ipc.c head/usr.bin/ipcs/ipc.h head/usr.bin/ipcs/ipcs.c Modified: head/usr.bin/ipcs/Makefile ============================================================================== --- head/usr.bin/ipcs/Makefile Mon Apr 13 19:46:30 2015 (r281500) +++ head/usr.bin/ipcs/Makefile Mon Apr 13 19:58:11 2015 (r281501) @@ -4,6 +4,4 @@ PROG= ipcs SRCS= ipcs.c ipc.c LIBADD= kvm -WARNS?= 1 - .include Modified: head/usr.bin/ipcs/ipc.c ============================================================================== --- head/usr.bin/ipcs/ipc.c Mon Apr 13 19:46:30 2015 (r281500) +++ head/usr.bin/ipcs/ipc.c Mon Apr 13 19:58:11 2015 (r281501) @@ -58,13 +58,13 @@ struct shmid_kernel *shmsegs; void kget(int idx, void *addr, size_t size); struct nlist symbols[] = { - {"sema"}, - {"seminfo"}, - {"msginfo"}, - {"msqids"}, - {"shminfo"}, - {"shmsegs"}, - {NULL} + { .n_name = "sema" }, + { .n_name = "seminfo" }, + { .n_name = "msginfo" }, + { .n_name = "msqids" }, + { .n_name = "shminfo" }, + { .n_name = "shmsegs" }, + { .n_name = NULL } }; #define SHMINFO_XVEC X(shmmax, sizeof(u_long)) \ @@ -92,13 +92,13 @@ struct nlist symbols[] = { #define X(a, b) { "kern.ipc." #a, offsetof(TYPEC, a), (b) }, #define TYPEC struct shminfo -struct scgs_vector shminfo_scgsv[] = { SHMINFO_XVEC { NULL } }; +static struct scgs_vector shminfo_scgsv[] = { SHMINFO_XVEC { .sysctl=NULL } }; #undef TYPEC #define TYPEC struct seminfo -struct scgs_vector seminfo_scgsv[] = { SEMINFO_XVEC { NULL } }; +static struct scgs_vector seminfo_scgsv[] = { SEMINFO_XVEC { .sysctl=NULL } }; #undef TYPEC #define TYPEC struct msginfo -struct scgs_vector msginfo_scgsv[] = { MSGINFO_XVEC { NULL } }; +static struct scgs_vector msginfo_scgsv[] = { MSGINFO_XVEC { .sysctl=NULL } }; #undef TYPEC #undef X Modified: head/usr.bin/ipcs/ipc.h ============================================================================== --- head/usr.bin/ipcs/ipc.h Mon Apr 13 19:46:30 2015 (r281500) +++ head/usr.bin/ipcs/ipc.h Mon Apr 13 19:58:11 2015 (r281501) @@ -52,7 +52,7 @@ /* SysCtlGatherStruct structure. */ struct scgs_vector { const char *sysctl; - off_t offset; + size_t offset; size_t size; }; Modified: head/usr.bin/ipcs/ipcs.c ============================================================================== --- head/usr.bin/ipcs/ipcs.c Mon Apr 13 19:46:30 2015 (r281500) +++ head/usr.bin/ipcs/ipcs.c Mon Apr 13 19:58:11 2015 (r281501) @@ -112,6 +112,7 @@ main(int argc, char *argv[]) char *core = NULL, *user = NULL, *namelist = NULL; char kvmoferr[_POSIX2_LINE_MAX]; /* Error buf for kvm_openfiles. */ int i; + u_long shmidx; uid_t uid = 0; while ((i = getopt(argc, argv, "MmQqSsabC:cN:optTu:y")) != -1) @@ -247,13 +248,13 @@ main(int argc, char *argv[]) print_kshmheader(option); - for (i = 0; i < shminfo.shmmni; i += 1) { - if (kxshmids[i].u.shm_perm.mode & 0x0800) { + for (shmidx = 0; shmidx < shminfo.shmmni; shmidx += 1) { + if (kxshmids[shmidx].u.shm_perm.mode & 0x0800) { if (user && - uid != kxshmids[i].u.shm_perm.uid) + uid != kxshmids[shmidx].u.shm_perm.uid) continue; - print_kshmptr(i, option, &kxshmids[i]); + print_kshmptr(shmidx, option, &kxshmids[shmidx]); } } printf("\n"); @@ -309,22 +310,22 @@ main(int argc, char *argv[]) } void -print_kmsqtotal(struct msginfo msginfo) +print_kmsqtotal(struct msginfo local_msginfo) { printf("msginfo:\n"); printf("\tmsgmax: %12d\t(max characters in a message)\n", - msginfo.msgmax); + local_msginfo.msgmax); printf("\tmsgmni: %12d\t(# of message queues)\n", - msginfo.msgmni); + local_msginfo.msgmni); printf("\tmsgmnb: %12d\t(max characters in a message queue)\n", - msginfo.msgmnb); + local_msginfo.msgmnb); printf("\tmsgtql: %12d\t(max # of messages in system)\n", - msginfo.msgtql); + local_msginfo.msgtql); printf("\tmsgssz: %12d\t(size of a message segment)\n", - msginfo.msgssz); + local_msginfo.msgssz); printf("\tmsgseg: %12d\t(# of message segments in system)\n\n", - msginfo.msgseg); + local_msginfo.msgseg); } void print_kmsqheader(int option) @@ -390,20 +391,20 @@ print_kmsqptr(int i, int option, struct } void -print_kshmtotal(struct shminfo shminfo) +print_kshmtotal(struct shminfo local_shminfo) { printf("shminfo:\n"); printf("\tshmmax: %12lu\t(max shared memory segment size)\n", - shminfo.shmmax); + local_shminfo.shmmax); printf("\tshmmin: %12lu\t(min shared memory segment size)\n", - shminfo.shmmin); + local_shminfo.shmmin); printf("\tshmmni: %12lu\t(max number of shared memory identifiers)\n", - shminfo.shmmni); + local_shminfo.shmmni); printf("\tshmseg: %12lu\t(max shared memory segments per process)\n", - shminfo.shmseg); + local_shminfo.shmseg); printf("\tshmall: %12lu\t(max amount of shared memory in pages)\n\n", - shminfo.shmall); + local_shminfo.shmall); } void @@ -470,28 +471,28 @@ print_kshmptr(int i, int option, struct } void -print_ksemtotal(struct seminfo seminfo) +print_ksemtotal(struct seminfo local_seminfo) { printf("seminfo:\n"); printf("\tsemmni: %12d\t(# of semaphore identifiers)\n", - seminfo.semmni); + local_seminfo.semmni); printf("\tsemmns: %12d\t(# of semaphores in system)\n", - seminfo.semmns); + local_seminfo.semmns); printf("\tsemmnu: %12d\t(# of undo structures in system)\n", - seminfo.semmnu); + local_seminfo.semmnu); printf("\tsemmsl: %12d\t(max # of semaphores per id)\n", - seminfo.semmsl); + local_seminfo.semmsl); printf("\tsemopm: %12d\t(max # of operations per semop call)\n", - seminfo.semopm); + local_seminfo.semopm); printf("\tsemume: %12d\t(max # of undo entries per process)\n", - seminfo.semume); + local_seminfo.semume); printf("\tsemusz: %12d\t(size in bytes of undo structure)\n", - seminfo.semusz); + local_seminfo.semusz); printf("\tsemvmx: %12d\t(semaphore maximum value)\n", - seminfo.semvmx); + local_seminfo.semvmx); printf("\tsemaem: %12d\t(adjust on exit max value)\n\n", - seminfo.semaem); + local_seminfo.semaem); } void From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 20:04:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54593981; Mon, 13 Apr 2015 20:04:47 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 7D1CD250C; Mon, 13 Apr 2015 20:04:46 +0000 (UTC) Message-ID: <552C215D.8020107@FreeBSD.org> Date: Mon, 13 Apr 2015 16:04:45 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Alan Cox , John Baldwin , Bruce Evans Subject: Re: svn commit: r280279 - head/sys/sys References: <201503201027.t2KAR6Ze053047@svn.freebsd.org> <550DA656.5060004@FreeBSD.org> <20150322080015.O955@besplex.bde.org> <17035816.lxyzYKiOWV@ralph.baldwin.cx> <552BFEB2.8040407@rice.edu> In-Reply-To: <552BFEB2.8040407@rice.edu> Content-Type: multipart/mixed; boundary="------------050306010303090506010906" Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 20:04:47 -0000 This is a multi-part message in MIME format. --------------050306010303090506010906 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 04/13/2015 13:36, Alan Cox wrote: > On 03/30/2015 10:50, John Baldwin wrote: >> On Sunday, March 22, 2015 09:41:53 AM Bruce Evans wrote: >>> On Sat, 21 Mar 2015, John Baldwin wrote: >>> >>>> On 3/21/15 12:35 PM, Konstantin Belousov wrote: >>>>> On Sat, Mar 21, 2015 at 12:04:41PM -0400, John Baldwin >>>>> wrote: >>>>>> On 3/20/15 9:02 AM, Konstantin Belousov wrote: >>>>>>> On Fri, Mar 20, 2015 at 10:27:06AM +0000, John Baldwin >>>>>>> wrote: >>>>>>>> Author: jhb Date: Fri Mar 20 10:27:06 2015 New >>>>>>>> Revision: 280279 URL: >>>>>>>> https://svnweb.freebsd.org/changeset/base/280279 >>>>>>>> >>>>>>>> Log: 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. >>>>>>> Are you aware of the Haswell errata HSD146 ? I see the >>>>>>> described behaviour on machines back to SandyBridge, >>>>>>> but not on Nehalems. HSD146. POPCNT Instruction May >>>>>>> Take Longer to Execute Than Expected Problem: POPCNT >>>>>>> instruction execution with a 32 or 64 bit operand may >>>>>>> be delayed until previous non-dependent instructions >>>>>>> have executed. >>>>>>> >>>>>>> Jilles noted that gcc head and 4.9.2 already provides a >>>>>>> workaround by xoring the dst register. I have some >>>>>>> patch for amd64 pmap, see the end of the message. >>>>>> No, I was not aware, but I think it's hard to fix this >>>>>> anywhere but the compiler. I set CPUTYPE in src.conf on >>>>>> my Ivy Bridge desktop and clang uses POPCOUNT for this >>>>>> function from ACPI-CA: >>>>>> >>>>>> static UINT8 AcpiRsCountSetBits ( UINT16 >>>>>> BitField) { UINT8 BitsSet; >>>>>> >>>>>> >>>>>> ACPI_FUNCTION_ENTRY (); >>>>>> >>>>>> >>>>>> for (BitsSet = 0; BitField; BitsSet++) { /* Zero the >>>>>> least significant bit that is set */ >>>>>> >>>>>> BitField &= (UINT16) (BitField - 1); } >>>>>> >>>>>> return (BitsSet); } >>>>>> >>>>>> (I ran into this accidentally because a kernel built on >>>>>> my system failed to boot in older qemu because the kernel >>>>>> paniced with an illegal instruction fault in this >>>>>> function.) >>> Does it do the same for the similar home made popcount in >>> pmap?: >> Yes: >> >> ffffffff807658d4: f6 04 25 46 e2 d6 80 testb >> $0x80,0xffffffff80d6e246 ffffffff807658db: 80 >> ffffffff807658dc: 74 32 je >> ffffffff80765910 ffffffff807658de: >> 48 89 4d b8 mov %rcx,-0x48(%rbp) ffffffff807658e2: >> f3 48 0f b8 4d b8 popcnt -0x48(%rbp),%rcx ffffffff807658e8: >> 48 8b 50 20 mov 0x20(%rax),%rdx ffffffff807658ec: >> 48 89 55 b0 mov %rdx,-0x50(%rbp) ffffffff807658f0: >> f3 48 0f b8 55 b0 popcnt -0x50(%rbp),%rdx ffffffff807658f6: >> 01 ca add %ecx,%edx ffffffff807658f8: >> 48 8b 48 28 mov 0x28(%rax),%rcx ffffffff807658fc: >> 48 89 4d a8 mov %rcx,-0x58(%rbp) ffffffff80765900: >> f3 48 0f b8 4d a8 popcnt -0x58(%rbp),%rcx ffffffff80765906: >> eb 1b jmp ffffffff80765923 >> ffffffff80765908: 0f 1f 84 >> 00 00 00 00 nopl 0x0(%rax,%rax,1) ffffffff8076590f: 00 >> ffffffff80765910: f3 48 0f b8 c9 popcnt >> %rcx,%rcx ffffffff80765915: f3 48 0f b8 50 20 popcnt >> 0x20(%rax),%rdx ffffffff8076591b: 01 ca >> add %ecx,%edx ffffffff8076591d: f3 48 0f b8 48 28 >> popcnt 0x28(%rax),%rcx ffffffff80765923: 01 d1 >> add %edx,%ecx >> >> It also uses popcnt for this in blist_fill() and >> blist_meta_fill(): >> >> 742 /* Count the number of blocks we're about to >> allocate */ 743 bitmap = scan->u.bmu_bitmap & mask; >> 744 for (nblks = 0; bitmap != 0; nblks++) 745 >> bitmap &= bitmap - 1; >> >>> Always using new API would lose the micro-optimizations given >>> by the runtime decision for default CFLAGS (used by >>> distributions for portability). To keep them, it seems best to >>> keep the inline asm but replace popcnt_pc_map_elem(elem) by >>> __bitcount64(elem). -mno-popcount can then be used to work >>> around slowness in the software (that is actually hardware) >>> case. >> I'm not sure if bitcount64() is strictly better than the loop in >> this case even though it is O(1) given the claimed nature of the >> values in the comment. >> > > > I checked. Even with zeroes being more common than ones, > bitcount64() is faster than the simple loop. Using bitcount64, > reserve_pv_entries() takes on average 4265 cycles during > "buildworld" on my test machine. In contrast, with the simple > loop, it takes on average 4507 cycles. Even though bitcount64 is a > lot larger than the simple loop, we do the 3 bit count operations > many times in a loop, so the extra i-cache misses are being made up > for by the repeated execution of the faster code. > > However, in the popcnt case, we are spilling the bit map to memory > in order to popcnt it. That's rather silly: > > 3570: 48 8b 48 18 mov 0x18(%rax),%rcx 3574: > f6 04 25 00 00 00 00 testb $0x80,0x0 357b: 80 357c: > 74 42 je 35c0 > 357e: 48 89 4d b8 mov %rcx,-0x48(%rbp) 3582: > 31 c9 xor %ecx,%ecx 3584: f3 48 0f b8 4d > b8 popcnt -0x48(%rbp),%rcx 358a: 48 8b 50 20 > mov 0x20(%rax),%rdx 358e: 48 89 55 b0 mov > %rdx,-0x50(%rbp) 3592: 31 d2 xor > %edx,%edx 3594: f3 48 0f b8 55 b0 popcnt > -0x50(%rbp),%rdx 359a: 01 ca add > %ecx,%edx 359c: 48 8b 48 28 mov > 0x28(%rax),%rcx 35a0: 48 89 4d a8 mov > %rcx,-0x58(%rbp) 35a4: 31 c9 xor > %ecx,%ecx 35a6: f3 48 0f b8 4d a8 popcnt > -0x58(%rbp),%rcx 35ac: 01 d1 add > %edx,%ecx 35ae: e9 12 01 00 00 jmpq 36c5 > Please try the attached patch. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVLCFZAAoJEHyflib82/FGOp0H/1+Jr+cKUn/MnV5O5SghPw9f XzTM4+BV9BcWabLRjFe1LR065SfLDXqKLuU4h5lmVSlXQaxElAXxaMeyO3mrMzR4 Sb1xr0rf+ZfUARJeEJWI65Wpn+gEH+7XxXAIAetYGMwwclBOBgbZIoDXITnCaUFa /pi3zQIey8EzbvlzhQcffLDV8oF4f8HNEMoSxMRtOiZNNPu/8ECnyGeHZhOd++kh pwZNsSbcCw3RXMheuErTpKPrJSEXgMNmWG3G00aP7L8IjcObgOqMUQt+8eT8Ge8B tEv40kgm2G/OG2akONh4/6bX3hyodW3IHcb6AYhqZogiDIqd/eXD4jDup/kkVxU= =1Ca9 -----END PGP SIGNATURE----- --------------050306010303090506010906 Content-Type: text/x-patch; name="pmap.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pmap.diff" Index: sys/amd64/amd64/pmap.c =================================================================== --- sys/amd64/amd64/pmap.c (revision 281496) +++ sys/amd64/amd64/pmap.c (working copy) @@ -412,7 +412,7 @@ static caddr_t crashdumpmap; static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); -static int popcnt_pc_map_elem_pq(uint64_t elem); +static int popcnt_pc_map(uint64_t *pc_map); static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); static void reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp); @@ -2979,7 +2979,7 @@ retry: } /* - * Returns the number of one bits within the given PV chunk map element. + * Returns the number of one bits within the given PV chunk map. * * The erratas for Intel processors state that "POPCNT Instruction May * Take Longer to Execute Than Expected". It is believed that the @@ -2994,12 +2994,21 @@ retry: * 5th Gen Core: BDM85 */ static int -popcnt_pc_map_elem_pq(uint64_t elem) +popcnt_pc_map(uint64_t *pc_map) { - u_long result; + u_long count, result; + int field; - __asm __volatile("xorl %k0,%k0;popcntq %1,%0" - : "=&r" (result) : "rm" (elem)); + result = 0; + if ((cpu_feature2 & CPUID2_POPCNT) != 0) + for (field = 0; field < _NPCM; field++) { + __asm __volatile("xorl %k0, %k0; popcntq %1, %0" + : "=r" (count) : "m" (pc_map[field])); + result += count; + } + else + for (field = 0; field < _NPCM; field++) + result += bitcount64(pc_map[field]); return (result); } @@ -3031,15 +3040,7 @@ reserve_pv_entries(pmap_t pmap, int needed, struct retry: avail = 0; TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { - if ((cpu_feature2 & CPUID2_POPCNT) == 0) { - free = bitcount64(pc->pc_map[0]); - free += bitcount64(pc->pc_map[1]); - free += bitcount64(pc->pc_map[2]); - } else { - free = popcnt_pc_map_elem_pq(pc->pc_map[0]); - free += popcnt_pc_map_elem_pq(pc->pc_map[1]); - free += popcnt_pc_map_elem_pq(pc->pc_map[2]); - } + free = popcnt_pc_map(pc->pc_map); if (free == 0) break; avail += free; --------------050306010303090506010906-- From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 20:23:47 2015 Return-Path: Delivered-To: svn-src-all@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 70BADEC5; Mon, 13 Apr 2015 20:23: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 5B495206; Mon, 13 Apr 2015 20:23: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 t3DKNlWZ097617; Mon, 13 Apr 2015 20:23:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DKNlaI097616; Mon, 13 Apr 2015 20:23:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504132023.t3DKNlaI097616@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Apr 2015 20:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281502 - head/sys/contrib/x86emu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 20:23:47 -0000 Author: delphij Date: Mon Apr 13 20:23:46 2015 New Revision: 281502 URL: https://svnweb.freebsd.org/changeset/base/281502 Log: Sync with OpenBSD: Use volatile instead of __volatile__. MFC after: 2 weeks Modified: head/sys/contrib/x86emu/x86emu.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Mon Apr 13 19:58:11 2015 (r281501) +++ head/sys/contrib/x86emu/x86emu.c Mon Apr 13 20:23:46 2015 (r281502) @@ -1,4 +1,4 @@ -/* $OpenBSD: x86emu.c,v 1.5 2010/02/17 15:09:47 pirofti Exp $ */ +/* $OpenBSD: x86emu.c,v 1.9 2014/06/15 11:04:49 pirofti Exp $ */ /* $NetBSD: x86emu.c,v 1.7 2009/02/03 19:26:29 joerg Exp $ */ /* @@ -5250,7 +5250,7 @@ x86emuOp2_pop_FS(struct x86emu *emu) static void hw_cpuid(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) { - __asm__ __volatile__("cpuid" + __asm__ volatile("cpuid" : "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d) : "a" (*a), "c" (*c) From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 21:29:41 2015 Return-Path: Delivered-To: svn-src-all@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 6C6E0E92; Mon, 13 Apr 2015 21:29:41 +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 57C70B68; Mon, 13 Apr 2015 21:29:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DLTftm027111; Mon, 13 Apr 2015 21:29:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DLTfwq027110; Mon, 13 Apr 2015 21:29:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201504132129.t3DLTfwq027110@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 13 Apr 2015 21:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281503 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 21:29:41 -0000 Author: ngie Date: Mon Apr 13 21:29:40 2015 New Revision: 281503 URL: https://svnweb.freebsd.org/changeset/base/281503 Log: Revert r281055 as it breaks installing test scripts in the mixed PROGS/SCRIPT case Repro is as follows: % sudo pkg install -y kyua % sudo rm -Rf /usr/tests % sudo make hier % (cd lib/libthr/tests/; make obj; make depend; make all; sudo make install) % (cd /usr/tests/lib/libthr; kyua list) Failure seen in Jenkins build starting here: https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests2/927/ Pointyhat to: bapt Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Mon Apr 13 20:23:46 2015 (r281502) +++ head/share/mk/bsd.progs.mk Mon Apr 13 21:29:40 2015 (r281503) @@ -96,14 +96,14 @@ x.$p= PROG_CXX=$p $p ${p}_p: .PHONY .MAKE (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= SCRIPTS= PROG=$p \ + SUBDIR= PROG=$p \ DEPENDFILE=.depend.$p .MAKE.DEPENDFILE=.depend.$p \ ${x.$p}) .for t in ${PROGS_TARGETS:O:u} $p.$t: .PHONY .MAKE (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= SCRIPTS= PROG=$p \ + SUBDIR= PROG=$p \ DEPENDFILE=.depend.$p .MAKE.DEPENDFILE=.depend.$p \ ${x.$p} ${@:E}) .endfor From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 22:22:33 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 22:22:34 2015 Return-Path: Delivered-To: svn-src-all@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 2038D295; Mon, 13 Apr 2015 22:22:34 +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 E494B1D2; 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 t3DMMXmU054861; 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 t3DMMXvu054860; Mon, 13 Apr 2015 22:22:33 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201504132222.t3DMMXvu054860@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-8@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-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 22:22:34 -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/8/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/8/usr.sbin/acpi/acpidump/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/acpi/acpidump/acpi.c stable/9/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/10/ (props changed) stable/9/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/8/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/8/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 21:33:49 2015 (r281504) +++ stable/8/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 22:22:32 2015 (r281505) @@ -590,17 +590,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"); @@ -857,17 +850,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, @@ -1056,16 +1044,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-all@FreeBSD.ORG Mon Apr 13 22:22:35 2015 Return-Path: Delivered-To: svn-src-all@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 0AC212FE; Mon, 13 Apr 2015 22:22:34 +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 A8C011D3; Mon, 13 Apr 2015 22:22:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DMMYqR054874; Mon, 13 Apr 2015 22:22:34 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DMMYLH054873; Mon, 13 Apr 2015 22:22:34 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201504132222.t3DMMYLH054873@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:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@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-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 22:22:35 -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/9/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/9/usr.sbin/acpi/acpidump/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/acpi/acpidump/acpi.c stable/8/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/10/ (props changed) stable/8/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/9/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/9/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 21:33:49 2015 (r281504) +++ stable/9/usr.sbin/acpi/acpidump/acpi.c Mon Apr 13 22:22:32 2015 (r281505) @@ -818,17 +818,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"); @@ -1085,17 +1078,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, @@ -1288,16 +1276,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-all@FreeBSD.ORG Mon Apr 13 22:26:12 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Apr 13 22:50:28 2015 Return-Path: Delivered-To: svn-src-all@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 D3DC21A2; Mon, 13 Apr 2015 22:50:28 +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 A5AF879D; Mon, 13 Apr 2015 22:50:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DMoSvt065912; Mon, 13 Apr 2015 22:50:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DMoSIT065911; Mon, 13 Apr 2015 22:50:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504132250.t3DMoSIT065911@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Apr 2015 22:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r281507 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 22:50:28 -0000 Author: delphij Date: Mon Apr 13 22:50:27 2015 New Revision: 281507 URL: https://svnweb.freebsd.org/changeset/base/281507 Log: Sigh, add myself again. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Apr 13 22:26:11 2015 (r281506) +++ svnadmin/conf/sizelimit.conf Mon Apr 13 22:50:27 2015 (r281507) @@ -21,6 +21,7 @@ # adrian brooks # cy +delphij des dim ed From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 22:51:10 2015 Return-Path: Delivered-To: svn-src-all@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 676D63B2; Mon, 13 Apr 2015 22:51:10 +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 398787A9; Mon, 13 Apr 2015 22:51:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DMpAbq066092; Mon, 13 Apr 2015 22:51:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DMpA3J066091; Mon, 13 Apr 2015 22:51:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504132251.t3DMpA3J066091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Apr 2015 22:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r281509 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 22:51:10 -0000 Author: delphij Date: Mon Apr 13 22:51:09 2015 New Revision: 281509 URL: https://svnweb.freebsd.org/changeset/base/281509 Log: Remove myself again. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Apr 13 22:50:44 2015 (r281508) +++ svnadmin/conf/sizelimit.conf Mon Apr 13 22:51:09 2015 (r281509) @@ -21,7 +21,7 @@ # adrian brooks # cy -delphij +#delphij des dim ed From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 23:06:14 2015 Return-Path: Delivered-To: svn-src-all@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 E194279B; Mon, 13 Apr 2015 23:06: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 CD9818DB; Mon, 13 Apr 2015 23:06: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 t3DN6ENt075055; Mon, 13 Apr 2015 23:06:14 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DN6Ewx075054; Mon, 13 Apr 2015 23:06:14 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201504132306.t3DN6Ewx075054@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 13 Apr 2015 23:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281510 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 23:06:15 -0000 Author: rrs Date: Mon Apr 13 23:06:13 2015 New Revision: 281510 URL: https://svnweb.freebsd.org/changeset/base/281510 Log: Restore the two lines accidentally deleted that allow CALLOUT_DIRECT to be specifed in the flags. Thanks Mark Johnston for noticing this ;-o MFC after: 3 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Apr 13 22:51:09 2015 (r281509) +++ head/sys/kern/kern_timeout.c Mon Apr 13 23:06:13 2015 (r281510) @@ -591,6 +591,8 @@ callout_cc_add(struct callout *c, struct c->c_iflags |= CALLOUT_PENDING; c->c_iflags &= ~CALLOUT_PROCESSED; c->c_flags |= CALLOUT_ACTIVE; + if (flags & C_DIRECT_EXEC) + c->c_flags |= CALLOUT_DIRECT; c->c_func = func; c->c_time = sbt; c->c_precision = precision; From owner-svn-src-all@FreeBSD.ORG Mon Apr 13 23:27:49 2015 Return-Path: Delivered-To: svn-src-all@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 9C6F4CAA; Mon, 13 Apr 2015 23:27:49 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 747CCAD9; Mon, 13 Apr 2015 23:27:49 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 352F2B913; Mon, 13 Apr 2015 19:27:47 -0400 (EDT) From: John Baldwin To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281510 - head/sys/kern Date: Mon, 13 Apr 2015 19:23:48 -0400 Message-ID: <2133512.1QoiEKrNOe@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201504132306.t3DN6Ewx075054@svn.freebsd.org> References: <201504132306.t3DN6Ewx075054@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 13 Apr 2015 19:27:47 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 23:27:49 -0000 On Monday, April 13, 2015 11:06:14 PM Randall Stewart wrote: > Author: rrs > Date: Mon Apr 13 23:06:13 2015 > New Revision: 281510 > URL: https://svnweb.freebsd.org/changeset/base/281510 > > Log: > Restore the two lines accidentally deleted that allow CALLOUT_DIRECT to be > specifed in the flags. > > Thanks Mark Johnston for noticing this ;-o Shouldn't this be an internal flag? I think CALLOUT_ACTIVE should be the only non-internal flag, yes? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 00:00:42 2015 Return-Path: Delivered-To: svn-src-all@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 621CBFEA for ; Tue, 14 Apr 2015 00:00:42 +0000 (UTC) Received: from mail-pd0-x234.google.com (mail-pd0-x234.google.com [IPv6:2607:f8b0:400e:c02::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22C5AE5F for ; Tue, 14 Apr 2015 00:00:42 +0000 (UTC) Received: by pdbqa5 with SMTP id qa5so123841846pdb.1 for ; Mon, 13 Apr 2015 17:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=L8smnsECKa/N5Wu6ALYDwDZyKVgyczRCx/YTsCjoBdI=; b=Vv1m6fDyOz2CS0oZB85lSLcLYRQX1SpQIY25lhQi/9Imm1ZOudS/pnv+6WoNQ6rwkx 9q+4nffgcCXZNm2Dot40oM/iUQ+Yv2BLBl+O3CacYDDrloe51f2YUWkT4GyvuLSxsbwG Ej7glE3kiKEsIIiy9hg3uLUgQyfoCVoFXz5FI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=L8smnsECKa/N5Wu6ALYDwDZyKVgyczRCx/YTsCjoBdI=; b=MBe4q+eirrpHeU8QU32r9iwFEP9fudj1iKidjnt6GfPU55qf0VjHdPWE1Jc1pNI+vc szgsT7/kXhAQcDkZWmjRZEnWm9djzJzwFK2Byf60+5jp2T8hBDPrOz0r35JA//rD4oRY IETTddietXY9oiQTWDeQT2BNuino5BwDCUMVFzTkeJCqEGlNt95lWCxRCrDV8+WFF4L9 8I9kSKawEexqLrZEhIOIROSr9g+es1lwPqWmUZMvAaNdFl2kXTKSIFjwDF7LWFTzCkbk 0BWwosaApjll+x/zl/wxzB0rOI+4PxDFq3gukvDUfwV4oEX8UlnMIRc0sVOt3E6EmRJm KTpQ== X-Gm-Message-State: ALoCoQkvpf9VwMYNfZXj+NEYZpdBhqRGeCnyjibw5Du1gp5TJBZXWYVsb4CWVBi+rc0AiA/ij5Xy X-Received: by 10.66.232.134 with SMTP id to6mr30350188pac.96.1428969641543; Mon, 13 Apr 2015 17:00:41 -0700 (PDT) Received: from fmwl-ncassing.corp.netflix.com ([69.53.236.236]) by mx.google.com with ESMTPSA id q4sm8389124pdo.42.2015.04.13.17.00.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Apr 2015 17:00:40 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r281510 - head/sys/kern From: Randall Stewart In-Reply-To: <2133512.1QoiEKrNOe@ralph.baldwin.cx> Date: Mon, 13 Apr 2015 20:00:21 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201504132306.t3DN6Ewx075054@svn.freebsd.org> <2133512.1QoiEKrNOe@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 00:00:42 -0000 Crud Your right..=20 On Apr 13, 2015, at 7:23 PM, John Baldwin wrote: > On Monday, April 13, 2015 11:06:14 PM Randall Stewart wrote: >> Author: rrs >> Date: Mon Apr 13 23:06:13 2015 >> New Revision: 281510 >> URL: https://svnweb.freebsd.org/changeset/base/281510 >>=20 >> Log: >> Restore the two lines accidentally deleted that allow CALLOUT_DIRECT = to be >> specifed in the flags. >>=20 >> Thanks Mark Johnston for noticing this ;-o >=20 > Shouldn't this be an internal flag? I think CALLOUT_ACTIVE should be = the only > non-internal flag, yes? >=20 > --=20 > John Baldwin -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 00:02:40 2015 Return-Path: Delivered-To: svn-src-all@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 DC6392B2; Tue, 14 Apr 2015 00:02:40 +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 C86D6E82; Tue, 14 Apr 2015 00:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3E02eJR007223; Tue, 14 Apr 2015 00:02:40 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3E02eDs007222; Tue, 14 Apr 2015 00:02:40 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201504140002.t3E02eDs007222@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 14 Apr 2015 00:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281511 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 00:02:41 -0000 Author: rrs Date: Tue Apr 14 00:02:39 2015 New Revision: 281511 URL: https://svnweb.freebsd.org/changeset/base/281511 Log: Fix my stupid restoral of old code.. must be c_iflags now. Thanks jhb for catching my stupidity... MFC after: 3 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Apr 13 23:06:13 2015 (r281510) +++ head/sys/kern/kern_timeout.c Tue Apr 14 00:02:39 2015 (r281511) @@ -592,7 +592,7 @@ callout_cc_add(struct callout *c, struct c->c_iflags &= ~CALLOUT_PROCESSED; c->c_flags |= CALLOUT_ACTIVE; if (flags & C_DIRECT_EXEC) - c->c_flags |= CALLOUT_DIRECT; + c->c_iflags |= CALLOUT_DIRECT; c->c_func = func; c->c_time = sbt; c->c_precision = precision; From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 00:27:55 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Apr 14 00:32:04 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Apr 14 04:52:54 2015 Return-Path: Delivered-To: svn-src-all@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 328EC4C0; Tue, 14 Apr 2015 04:52: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 1DDF9F70; Tue, 14 Apr 2015 04:52: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 t3E4qrbs040035; Tue, 14 Apr 2015 04:52:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3E4qrae040029; Tue, 14 Apr 2015 04:52:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504140452.t3E4qrae040029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 14 Apr 2015 04:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281517 - head/usr.bin/ipcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 04:52:54 -0000 Author: eadler Date: Tue Apr 14 04:52:52 2015 New Revision: 281517 URL: https://svnweb.freebsd.org/changeset/base/281517 Log: ipcs: fix builds that use gcc gcc gets annoyed by duplicate declarations Reported by: sbruno Reviewed by: sbruno Modified: head/usr.bin/ipcs/ipc.c head/usr.bin/ipcs/ipc.h Modified: head/usr.bin/ipcs/ipc.c ============================================================================== --- head/usr.bin/ipcs/ipc.c Tue Apr 14 02:38:57 2015 (r281516) +++ head/usr.bin/ipcs/ipc.c Tue Apr 14 04:52:52 2015 (r281517) @@ -55,7 +55,6 @@ struct msginfo msginfo; struct msqid_kernel *msqids; struct shminfo shminfo; struct shmid_kernel *shmsegs; -void kget(int idx, void *addr, size_t size); struct nlist symbols[] = { { .n_name = "sema" }, Modified: head/usr.bin/ipcs/ipc.h ============================================================================== --- head/usr.bin/ipcs/ipc.h Tue Apr 14 02:38:57 2015 (r281516) +++ head/usr.bin/ipcs/ipc.h Tue Apr 14 04:52:52 2015 (r281517) @@ -64,8 +64,5 @@ extern struct nlist symbols[]; extern kvm_t *kd; extern struct semid_kernel *sema; -extern struct seminfo seminfo; -extern struct msginfo msginfo; extern struct msqid_kernel *msqids; -extern struct shminfo shminfo; extern struct shmid_kernel *shmsegs; From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 07:11:00 2015 Return-Path: Delivered-To: svn-src-all@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 2176DD40; Tue, 14 Apr 2015 07:11:00 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4E6F81; Tue, 14 Apr 2015 07:10:59 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id EEBB27815A9; Tue, 14 Apr 2015 16:46:44 +1000 (AEST) Date: Tue, 14 Apr 2015 16:46:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281517 - head/usr.bin/ipcs In-Reply-To: <201504140452.t3E4qrae040029@svn.freebsd.org> Message-ID: <20150414153545.U838@besplex.bde.org> References: <201504140452.t3E4qrae040029@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=L/MkHYj8 c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=k9hOBJIYsBljULasZeUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 07:11:00 -0000 On Tue, 14 Apr 2015, Eitan Adler wrote: > Log: > ipcs: fix builds that use gcc > gcc gets annoyed by duplicate declarations You mean "Fix builds that use a working compiler. Working compilers report redundant declarations when requested to do so by the -Wredundant-decls flag which I recently enabled by raising WARNS to 6." clang apparently silently ignores the request. gcc48 still has the following bugs in -Wredundant-decls: - it redundantly says that redundant declarations are redeclarations. Only a very magic type or variable could redundant if it is only declared once by the program (including in headers included by the program). Perhaps some predefined type or variable is magic enough. But then the warning should be different. E.g., main() and exit() are known to the compiler except in freestanding environments. gcc already has special handling for main(), to allow it to be declared as either "int main(void);" or "int main(int argc, char **argv);", as required to allow the program to use either of these. Declaring one of these in either or a compiler predeclaration would break use of the other one unless the first declaration is magic. I think gcc skips the warning for its builtin predeclaration but wouldn't skip if for a declaration in a header. I think standards don't allow main() to be declared in any standard header since they don't require compilers to have magic to support this. exit() is simpler since it has only 1 correct declaration in hosted environments. It should have a predeclaration in the compiler and another one in . The one in is redundant, but the compiler must not warn about it. The compiler should warn about it for any declaration of it outside of standard headers. The correct practice is to include to get the declaration. That gives at least a doubly-redundant declaration if the application declares it again, and no magic is needed to get the warning. If the application doesn't include , then the warning should change to one about improper practice when certain warnings are enabled. I think gcc only warns about inconsistent uses and the C standard only requires this. So you should be able to non-redundantly declare exit() iff you are careful to not include and use the same declaration as . - it incorrectly says that non-redundant non-redeclarations are redundant redeclarations. C allows building up types by supplying additional information in each step. E.g.: void myfunc(); void myfunc(int); gcc48 still warns that the second declaration is a redundant redeclaration when it is actually a non-redundant non-redeclaration. The first declaration is redundant in some cases (especially when there is nothing between the declarations. Nested incomplete function declarations allow arbitrarily long chains of non-redundant non-redeclarations to build up a single top-level declaration: typedef void ifv(); /* incomplete type for func returning void */ typedef void cfv(int); /* complete type for func returning void */ void myfunc(); void myfunc(ifv *, ifv *); /* parameters incomplete */ void myfunc(cfv *, ifv *); /* complete only first parameter */ void myfunc(ifv *, cfv *); /* complete only first parameter */ /* * All non-redundant so far. The type of myfunc is now complete in * Standard C although not in GNC C, so any further declarations of * all or parts of it are redundant. */ C also allows building up declarations by adding linkage info. This is even more confusing. GNUC also allows building up declarations by adding attribute info one or several but not all attributes at a time. This is less confusing, at least for the 1-at-a-time case. E.g.: void panic(const char *, ...); #ifdef __MUMBLE >= 99 void panic(const char * restrict, ...); /* add C99 feature */ #endif void panic(const char *, ...) __dead2; /* add old GNU feature */ void panic(const char *, ...) __printflike(1, 2); /* newer GNU feature */ void panic(const char *, ...) __nonnull(1); /* even newer GNU feature */ Building up types is very confusing so you should rarely do it, but the above is almost reasonable. Adding the restrict qualifier only for C99 and later is obfuscated in a different way using ifdefs for __restrict. The bugs in "gcc -Wredundant-decls" accidentally detect the style bug of using the building-up-types feature. This should be detected under a different warning. panic(9) is still missing both 'restrict' and __nonnull(1), though it needs __nonull() even more than printf([39]) because a null panicstr is magic (used for recursion detection). Bruce From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 09:58:12 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Apr 14 09:59:00 2015 Return-Path: Delivered-To: svn-src-all@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 90F8F645; Tue, 14 Apr 2015 09:59:00 +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 6190B644; Tue, 14 Apr 2015 09:59: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 t3E9x0IM082140; Tue, 14 Apr 2015 09:59:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3E9wxiF082130; Tue, 14 Apr 2015 09:58:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504140958.t3E9wxiF082130@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:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r281521 - in stable/9: sys/rpc usr.sbin/nfsd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 09:59:00 -0000 Author: mav Date: Tue Apr 14 09:58:58 2015 New Revision: 281521 URL: https://svnweb.freebsd.org/changeset/base/281521 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/9/sys/rpc/svc_generic.c stable/9/sys/rpc/svc_vc.c stable/9/usr.sbin/nfsd/nfsd.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/nfsd/ (props changed) Modified: stable/9/sys/rpc/svc_generic.c ============================================================================== --- stable/9/sys/rpc/svc_generic.c Tue Apr 14 09:58:10 2015 (r281520) +++ stable/9/sys/rpc/svc_generic.c Tue Apr 14 09:58:58 2015 (r281521) @@ -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/9/sys/rpc/svc_vc.c ============================================================================== --- stable/9/sys/rpc/svc_vc.c Tue Apr 14 09:58:10 2015 (r281520) +++ stable/9/sys/rpc/svc_vc.c Tue Apr 14 09:58:58 2015 (r281521) @@ -178,7 +178,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/9/usr.sbin/nfsd/nfsd.c ============================================================================== --- stable/9/usr.sbin/nfsd/nfsd.c Tue Apr 14 09:58:10 2015 (r281520) +++ stable/9/usr.sbin/nfsd/nfsd.c Tue Apr 14 09:58:58 2015 (r281521) @@ -605,7 +605,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); } @@ -680,7 +680,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-all@FreeBSD.ORG Tue Apr 14 10:15:59 2015 Return-Path: Delivered-To: svn-src-all@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 7B709CAC; Tue, 14 Apr 2015 10:15:59 +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 66E9E8E2; Tue, 14 Apr 2015 10:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EAFxMK091319; Tue, 14 Apr 2015 10:15:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EAFx8h091318; Tue, 14 Apr 2015 10:15:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504141015.t3EAFx8h091318@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Apr 2015 10:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281522 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 10:15:59 -0000 Author: andrew Date: Tue Apr 14 10:15:58 2015 New Revision: 281522 URL: https://svnweb.freebsd.org/changeset/base/281522 Log: Disable truss, gprof, and lint on arm64, they don't build. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Apr 14 09:58:58 2015 (r281521) +++ head/usr.bin/Makefile Tue Apr 14 10:15:58 2015 (r281522) @@ -284,8 +284,10 @@ SUBDIR+= iscsictl .if ${MK_KDUMP} != "no" SUBDIR+= kdump +.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO truss does not build SUBDIR+= truss .endif +.endif .if ${MK_KERBEROS_SUPPORT} != "no" SUBDIR+= compile_et @@ -382,13 +384,17 @@ SUBDIR+= c89 SUBDIR+= c99 SUBDIR+= ctags SUBDIR+= file2c +.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO gprof does not build SUBDIR+= gprof +.endif SUBDIR+= indent SUBDIR+= lex SUBDIR+= mkstr SUBDIR+= rpcgen SUBDIR+= unifdef +.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO xlint does not build SUBDIR+= xlint +.endif SUBDIR+= xstr SUBDIR+= yacc .endif From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 10:40:40 2015 Return-Path: Delivered-To: svn-src-all@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 12238454; Tue, 14 Apr 2015 10:40:40 +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 E74D8BC6; Tue, 14 Apr 2015 10:40: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 t3EAedD3004473; Tue, 14 Apr 2015 10:40:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EAec3Z004466; Tue, 14 Apr 2015 10:40:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504141040.t3EAec3Z004466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Apr 2015 10:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281524 - in head/sys/boot/efi: boot1 fdt libefi loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 10:40:40 -0000 Author: andrew Date: Tue Apr 14 10:40:37 2015 New Revision: 281524 URL: https://svnweb.freebsd.org/changeset/base/281524 Log: Use MACHINE in the efi loader when it is what we mean, it may not be the same as MACHINE_CPUARCH, it just happened to be the case the architectures this code currently supports. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Apr 14 10:20:02 2015 (r281523) +++ head/sys/boot/efi/boot1/Makefile Tue Apr 14 10:40:37 2015 (r281524) @@ -17,12 +17,12 @@ SRCS= boot1.c reloc.c start.S CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. # Always add MI sources and REGULAR efi loader bits -.PATH: ${.CURDIR}/../loader/arch/${MACHINE_CPUARCH} +.PATH: ${.CURDIR}/../loader/arch/${MACHINE} .PATH: ${.CURDIR}/../loader .PATH: ${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../common @@ -30,7 +30,7 @@ CFLAGS+= -I${.CURDIR}/../../common FILES= boot1.efi boot1.efifat FILESMODE_boot1.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" @@ -79,8 +79,8 @@ boot1.o: ${.CURDIR}/../../common/ufsread boot1.efifat: boot1.efi echo ${.OBJDIR} - uudecode ${.CURDIR}/fat-${MACHINE_CPUARCH}.tmpl.bz2.uu - mv fat-${MACHINE_CPUARCH}.tmpl.bz2 ${.TARGET}.bz2 + uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu + mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Tue Apr 14 10:20:02 2015 (r281523) +++ head/sys/boot/efi/fdt/Makefile Tue Apr 14 10:40:37 2015 (r281524) @@ -18,7 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # EFI library headers CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} # libfdt headers CFLAGS+= -I${.CURDIR}/../../fdt @@ -27,7 +27,7 @@ CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. machine: - ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine + ln -sf ${.CURDIR}/../../../${MACHINE}/include machine CLEANFILES+= machine Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Apr 14 10:20:02 2015 (r281523) +++ head/sys/boot/efi/libefi/Makefile Tue Apr 14 10:40:37 2015 (r281524) @@ -10,7 +10,7 @@ SRCS= delay.c efi_console.c efinet.c efi CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand # Pick up the bootstrap header for some interface items Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Apr 14 10:20:02 2015 (r281523) +++ head/sys/boot/efi/loader/Makefile Tue Apr 14 10:40:37 2015 (r281524) @@ -24,15 +24,15 @@ SRCS= autoload.c \ smbios.c \ vers.c -.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} +.PATH: ${.CURDIR}/arch/${MACHINE} # For smbios.c .PATH: ${.CURDIR}/../../i386/libi386 -.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" +.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc" CFLAGS+= -I${.CURDIR} -CFLAGS+= -I${.CURDIR}/arch/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 @@ -42,7 +42,7 @@ CFLAGS+= -DNO_PCI -DEFI BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE} LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif @@ -70,12 +70,12 @@ CFLAGS+= -I${.CURDIR}/../../common FILES= loader.efi FILESMODE_loader.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared CLEANFILES= vers.c loader.efi -NEWVERSWHAT= "EFI loader" ${MACHINE_CPUARCH} +NEWVERSWHAT= "EFI loader" ${MACHINE} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../efi/loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 10:41:58 2015 Return-Path: Delivered-To: svn-src-all@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 F28485A1; Tue, 14 Apr 2015 10:41: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 DE18BC6E; Tue, 14 Apr 2015 10:41: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 t3EAfvFS005306; Tue, 14 Apr 2015 10:41:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EAfveZ005305; Tue, 14 Apr 2015 10:41:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504141041.t3EAfveZ005305@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Apr 2015 10:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281525 - head/sys/boot/efi/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 10:41:58 -0000 Author: andrew Date: Tue Apr 14 10:41:57 2015 New Revision: 281525 URL: https://svnweb.freebsd.org/changeset/base/281525 Log: Fix the arm64 MACHINE_CPUARCH value in the efi fdt glue code. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/fdt/Makefile Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Tue Apr 14 10:40:37 2015 (r281524) +++ head/sys/boot/efi/fdt/Makefile Tue Apr 14 10:41:57 2015 (r281525) @@ -10,7 +10,7 @@ INTERNALLIB= SRCS= efi_fdt.c CFLAGS+= -ffreestanding -msoft-float -.if ${MACHINE_CPUARCH} == "arm64" +.if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only .endif From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 13:55:08 2015 Return-Path: Delivered-To: svn-src-all@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 1641EEF5; Tue, 14 Apr 2015 13:55:08 +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 F13563DA; Tue, 14 Apr 2015 13:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EDt7GV095004; Tue, 14 Apr 2015 13:55:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EDt2qP094973; Tue, 14 Apr 2015 13:55:02 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504141355.t3EDt2qP094973@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Apr 2015 13:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281526 - in head/sys: arm64/include boot boot/arm64 boot/arm64/libarm64 boot/common boot/efi boot/efi/boot1 boot/efi/include/arm64 boot/efi/loader boot/efi/loader/arch/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 13:55:08 -0000 Author: andrew Date: Tue Apr 14 13:55:01 2015 New Revision: 281526 URL: https://svnweb.freebsd.org/changeset/base/281526 Log: Add support for arm64 to loader.efi and boot1.efi Reviewed by: emaste Sponsored by: The FreeBSD Foundation Added: head/sys/arm64/include/psl.h (contents, props changed) head/sys/boot/Makefile.arm64 (contents, props changed) head/sys/boot/arm64/ head/sys/boot/arm64/Makefile (contents, props changed) head/sys/boot/arm64/libarm64/ head/sys/boot/arm64/libarm64/cache.c (contents, props changed) head/sys/boot/arm64/libarm64/cache.h (contents, props changed) head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu (contents, props changed) head/sys/boot/efi/include/arm64/ head/sys/boot/efi/include/arm64/efibind.h (contents, props changed) head/sys/boot/efi/loader/arch/arm64/ head/sys/boot/efi/loader/arch/arm64/Makefile.inc (contents, props changed) head/sys/boot/efi/loader/arch/arm64/exec.c (contents, props changed) head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 (contents, props changed) head/sys/boot/efi/loader/arch/arm64/start.S (contents, props changed) Modified: head/sys/boot/common/Makefile.inc head/sys/boot/efi/Makefile head/sys/boot/efi/boot1/generate-fat.sh head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/copy.c Added: head/sys/arm64/include/psl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/psl.h Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1 @@ +/* $FreeBSD$ */ Added: head/sys/boot/Makefile.arm64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.arm64 Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + +SUBDIR+= efi Added: head/sys/boot/arm64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/arm64/Makefile Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include Added: head/sys/boot/arm64/libarm64/cache.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/arm64/libarm64/cache.c Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of 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, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include +#include + +#include "cache.h" + +static unsigned int +get_dcache_line_size(void) +{ + uint64_t ctr; + unsigned int dcl_size; + + /* Accessible from all security levels */ + ctr = READ_SPECIALREG(ctr_el0); + + /* + * Relevant field [19:16] is LOG2 + * of the number of words in DCache line + */ + dcl_size = CTR_DLINE_SIZE(ctr); + + /* Size of word shifted by cache line size */ + return (sizeof(int) << dcl_size); +} + +void +cpu_flush_dcache(const void *ptr, size_t len) +{ + + uint64_t cl_size; + vm_offset_t addr, end; + + cl_size = get_dcache_line_size(); + + /* Calculate end address to clean */ + end = (vm_offset_t)(ptr + len); + /* Align start address to cache line */ + addr = (vm_offset_t)ptr; + addr = rounddown2(addr, cl_size); + + for (; addr < end; addr += cl_size) + __asm __volatile("dc civac, %0" : : "r" (addr) : "memory"); + /* Full system DSB */ + __asm __volatile("dsb sy" : : : "memory"); +} + +void +cpu_inval_icache(const void *ptr, size_t len) +{ + + /* NULL ptr or 0 len means all */ + if (ptr == NULL || len == 0) { + __asm __volatile( + "ic ialluis \n" + "dsb ish \n" + : : : "memory"); + return; + } + + /* TODO: Other cache ranges if necessary */ +} Added: head/sys/boot/arm64/libarm64/cache.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/arm64/libarm64/cache.h Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of 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, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CACHE_H_ +#define _CACHE_H_ + +/* cache.c */ +void cpu_flush_dcache(const void *, size_t); +void cpu_inval_icache(const void *, size_t); + +#endif /* _CACHE_H_ */ Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Tue Apr 14 10:41:57 2015 (r281525) +++ head/sys/boot/common/Makefile.inc Tue Apr 14 13:55:01 2015 (r281526) @@ -9,6 +9,8 @@ SRCS+= load_elf32.c load_elf32_obj.c rel SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE} == "pc98" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c +.elif ${MACHINE_CPUARCH} == "aarch64" +SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" Modified: head/sys/boot/efi/Makefile ============================================================================== --- head/sys/boot/efi/Makefile Tue Apr 14 10:41:57 2015 (r281525) +++ head/sys/boot/efi/Makefile Tue Apr 14 13:55:01 2015 (r281526) @@ -10,7 +10,9 @@ SUBDIR+= fdt .endif .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "arm" SUBDIR+= loader boot1 .endif Added: head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,26 @@ +FAT template boot filesystem created by generate-fat.sh +DO NOT EDIT +$FreeBSD$ +begin 644 fat-arm64.tmpl.bz2 +M0EIH.3%!62936:2BH:(`&T#_____ZZKJ[_^N_ZO_J_Z[OJ_NJ^JK^KZNKNNJ +MZNKNZOJ^P`+\```"``:`9,@T&F3$,@!B`,AIHP$#0-`T``,09--&31IH9#)D +M,(#$T&)B!A``-`,F0:#3)B&0`Q`&0TT8"!H&@:``&(,FFC)HTT,ADR&$!B:# +M$Q`P@`&@&3(-!IDQ#(`8@#(::,!`T#0-``#$&331DT::&0R9#"`Q-!B8@8"J +M*0GY$I&GH"-&AZ@T```T`:`!HT```&@&@-,C0`-`#U,(-`&)ZF(PGIJ>IO;U +M^=&QL3`-\E@Q+$(RTHB$7I"(B(-W:73$0@A#;S##$3$`A#FL\LAF,;&8;[CE +M&D=@ON\:9IWHO):QK7LL=LFN;1M6Y:%F>-1G^&O-A*(@0AQ,\#H*KRCJF>9Q +MFF_,RWU4X-,R6K5EJU:M6L"JMB5555555JVJU*U-JU:M6MUB*I555555;XHJ +ME555555YM='L;(N7+ERY_!^S^F[=KA#3YJ.S-)`!>O]K)`#-ZO +MU=9T,X(@!H',-+,1Q'-6'#ZNQORGURS=]_O%.6SF5G,PC`G#X_@7W$RC>2Q) +M9MW3P&G:AJFA?`^AKWXOV?R_QDL9F^`=5H>$UWWT9K&Q/HS.!KXB)U)9$6,) +M*/!EJ7>+W2L65_C\&LP69G$?'M$18.(LL.G:AZ;%>TUKYF.V+9/W9AMF[&^]HFB?J_AM6V;ANF2RG7,61I)?])L352^EX5C12BSAX@$(3`!EWEZ6P2R$9#_Q=R13A0D*2B +"H:(` +` +end Modified: head/sys/boot/efi/boot1/generate-fat.sh ============================================================================== --- head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 14 10:41:57 2015 (r281525) +++ head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 14 13:55:01 2015 (r281526) @@ -18,7 +18,7 @@ BOOT1_SIZE=128k # # Known filenames # amd64: BOOTx64.efi -# aarch64: BOOTaa64.efi +# arm64: BOOTaa64.efi # arm: BOOTarm.efi # i386: BOOTia32.efi # Added: head/sys/boot/efi/include/arm64/efibind.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/arm64/efibind.h Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,219 @@ +/* $FreeBSD$ */ +/*++ + +Copyright (c) 1999 - 2003 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + efefind.h + +Abstract: + + EFI to compile bindings + + + + +Revision History + +--*/ + +#pragma pack() + + +#ifdef __FreeBSD__ +#include +#else +// +// Basic int types of various widths +// + +#if (__STDC_VERSION__ < 199901L ) + + // No ANSI C 1999/2000 stdint.h integer width declarations + + #if _MSC_EXTENSIONS + + // Use Microsoft C compiler integer width declarations + + typedef unsigned __int64 uint64_t; + typedef __int64 int64_t; + typedef unsigned __int32 uint32_t; + typedef __int32 int32_t; + typedef unsigned __int16 uint16_t; + typedef __int16 int16_t; + typedef unsigned __int8 uint8_t; + typedef __int8 int8_t; + #else + #ifdef UNIX_LP64 + + // Use LP64 programming model from C_FLAGS for integer width declarations + + typedef unsigned long uint64_t; + typedef long int64_t; + typedef unsigned int uint32_t; + typedef int int32_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned char uint8_t; + typedef char int8_t; + #else + + // Assume P64 programming model from C_FLAGS for integer width declarations + + typedef unsigned long long uint64_t; + typedef long long int64_t; + typedef unsigned int uint32_t; + typedef int int32_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned char uint8_t; + typedef char int8_t; + #endif + #endif +#endif +#endif /* __FreeBSD__ */ + +// +// Basic EFI types of various widths +// + + +typedef uint64_t UINT64; +typedef int64_t INT64; +typedef uint32_t UINT32; +typedef int32_t INT32; +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint8_t UINT8; +typedef int8_t INT8; + + +#undef VOID +#define VOID void + + +typedef int64_t INTN; +typedef uint64_t UINTN; + +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// BugBug: Code to debug +// +#define BIT63 0x8000000000000000 + +#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63) +#define PORT_TO_MEMD(_Port) (PLATFORM_IOBASE_ADDRESS | ( ( ( (_Port) & 0xfffc) << 10 ) | ( (_Port) & 0x0fff) ) ) + +// +// Macro's with casts make this much easier to use and read. +// +#define PORT_TO_MEM8D(_Port) (*(UINT8 *)(PORT_TO_MEMD(_Port))) +#define POST_CODE(_Data) (PORT_TO_MEM8D(0x80) = (_Data)) +// +// BugBug: End Debug Code!!! +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +#define EFIERR(a) (0x8000000000000000 | a) +#define EFI_ERROR_MASK 0x8000000000000000 +#define EFIERR_OEM(a) (0xc000000000000000 | a) + +#define BAD_POINTER 0xFBFBFBFBFBFBFBFB +#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF + +#pragma intrinsic (__break) +#define BREAKPOINT() __break(0) + +// +// Pointers must be aligned to these address to function +// you will get an alignment fault if this value is less than 8 +// +#define MIN_ALIGNMENT_SIZE 8 + +#define ALIGN_VARIABLE(Value , Adjustment) \ + (UINTN) Adjustment = 0; \ + if((UINTN)Value % MIN_ALIGNMENT_SIZE) \ + (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \ + Value = (UINTN)Value + (UINTN)Adjustment + +// +// Define macros to create data structure signatures. +// + +#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8)) +#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16)) +#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32)) + +// +// EFIAPI - prototype calling convention for EFI function pointers +// BOOTSERVICE - prototype for implementation of a boot service interface +// RUNTIMESERVICE - prototype for implementation of a runtime service interface +// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service +// RUNTIME_CODE - pragma macro for declaring runtime code +// + +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options + #if _MSC_EXTENSIONS + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #else + #define EFIAPI // Substitute expresion to force C calling convention + #endif +#endif + +#define BOOTSERVICE +#define RUNTIMESERVICE +#define RUNTIMEFUNCTION + +#define RUNTIME_CODE(a) alloc_text("rtcode", a) +#define BEGIN_RUNTIME_DATA() data_seg("rtdata") +#define END_RUNTIME_DATA() data_seg() + +#define VOLATILE volatile + +// +// BugBug: Need to find out if this is portable accross compliers. +// +void __mfa (void); +#pragma intrinsic (__mfa) +#define MEMORY_FENCE() __mfa() + +#ifdef EFI_NO_INTERFACE_DECL + #define EFI_FORWARD_DECLARATION(x) + #define EFI_INTERFACE_DECL(x) +#else + #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x + #define EFI_INTERFACE_DECL(x) typedef struct x +#endif + +// +// When build similiar to FW, then link everything together as +// one big module. +// + +#define EFI_DRIVER_ENTRY_POINT(InitFunction) + +#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ + (_if)->LoadInternal(type, name, entry) +// entry(NULL, ST) + +#ifdef __FreeBSD__ +#define INTERFACE_DECL(x) struct x +#else +// +// Some compilers don't support the forward reference construct: +// typedef struct XXXXX +// +// The following macro provide a workaround for such cases. +// +#ifdef NO_INTERFACE_DECL +#define INTERFACE_DECL(x) +#else +#define INTERFACE_DECL(x) typedef struct x +#endif +#endif Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Apr 14 10:41:57 2015 (r281525) +++ head/sys/boot/efi/loader/Makefile Tue Apr 14 13:55:01 2015 (r281526) @@ -42,7 +42,7 @@ CFLAGS+= -DNO_PCI -DEFI BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE} +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif Added: head/sys/boot/efi/loader/arch/arm64/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LOADER_FDT_SUPPORT=yes +SRCS+= exec.c \ + start.S + +.PATH: ${.CURDIR}/../../arm64/libarm64 +CFLAGS+=-I${.CURDIR}/../../arm64/libarm64 +SRCS+= cache.c Added: head/sys/boot/efi/loader/arch/arm64/exec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/loader/arch/arm64/exec.c Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 2006 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR 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 +#include + +#include + +#include +#include + +#include "loader_efi.h" +#include "cache.h" + +static int elf64_exec(struct preloaded_file *amp); +static int elf64_obj_exec(struct preloaded_file *amp); + +int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); + +static struct file_format arm64_elf = { + elf64_loadfile, + elf64_exec +}; + +struct file_format *file_formats[] = { + &arm64_elf, + NULL +}; + +static int +elf64_exec(struct preloaded_file *fp) +{ + vm_offset_t modulep, kernendp; + vm_offset_t clean_addr; + size_t clean_size; + struct file_metadata *md; + EFI_STATUS status; + EFI_PHYSICAL_ADDRESS addr; + Elf_Ehdr *ehdr; + int err; + void (*entry)(vm_offset_t); + + if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) + return(EFTYPE); + + ehdr = (Elf_Ehdr *)&(md->md_data); + entry = efi_translate(ehdr->e_entry); + + err = bi_load(fp->f_args, &modulep, &kernendp); + if (err != 0) + return (err); + + status = BS->ExitBootServices(IH, efi_mapkey); + if (EFI_ERROR(status)) { + printf("%s: ExitBootServices() returned 0x%lx\n", __func__, + (long)status); + return (EINVAL); + } + + /* Clean D-cache under kernel area and invalidate whole I-cache */ + clean_addr = efi_translate(fp->f_addr); + clean_size = efi_translate(kernendp) - clean_addr; + + cpu_flush_dcache((void *)clean_addr, clean_size); + cpu_inval_icache(NULL, 0); + + (*entry)(modulep); + panic("exec returned"); +} + +static int +elf64_obj_exec(struct preloaded_file *fp) +{ + + printf("%s called for preloaded file %p (=%s):\n", __func__, fp, + fp->f_name); + return (ENOSYS); +} + Added: head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,80 @@ +/* $FreeBSD$ */ +/* +OUTPUT_FORMAT("elf64-aarch64-freebsd", "elf64-aarch64-freebsd", "elf64-aarch64-freebsd") +*/ +OUTPUT_ARCH(aarch64) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0; + ImageBase = .; + .text : { + *(.peheader) + *(.text .stub .text.* .gnu.linkonce.t.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.plt) + } =0x00300000010070000002000001000400 + . = ALIGN(16); + .data : { + *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.rodata1) + *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) + *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) + *(.opd) + *(.data .data.* .gnu.linkonce.d.*) + *(.data1) + *(.plabel) + + . = ALIGN(16); + __bss_start = .; + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + *(.dynbss) + *(.bss *.bss.*) + *(COMMON) + . = ALIGN(16); + __bss_end = .; + } + . = ALIGN(16); + set_Xcommand_set : { + __start_set_Xcommand_set = .; + *(set_Xcommand_set) + __stop_set_Xcommand_set = .; + } + . = ALIGN(16); + __gp = .; + .sdata : { + *(.got.plt .got) + *(.sdata .sdata.* .gnu.linkonce.s.*) + *(dynsbss) + *(.scommon) + } + . = ALIGN(16); + .dynamic : { *(.dynamic) } + . = ALIGN(16); + .rela.dyn : { + *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) + *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) + *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) + *(.rela.got) + *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) + *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) + *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) + *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) + *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) + *(.rela.plt) + *(.relset_*) + *(.rela.dyn .rela.dyn.*) + } + . = ALIGN(16); + .reloc : { *(.reloc) } + . = ALIGN(16); + .dynsym : { *(.dynsym) } + _edata = .; + + /* Unused sections */ + .dynstr : { *(.dynstr) } + .hash : { *(.hash) } +} Added: head/sys/boot/efi/loader/arch/arm64/start.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/loader/arch/arm64/start.S Tue Apr 14 13:55:01 2015 (r281526) @@ -0,0 +1,165 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * We need to be a PE32+ file for EFI. On some architectures we can use + * objcopy to create the correct file, however on arm64 we need to do + * it ourselves. + */ + +#define IMAGE_FILE_MACHINE_ARM64 0xaa64 + +#define IMAGE_SCN_CNT_CODE 0x00000020 +#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 +#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 +#define IMAGE_SCN_MEM_EXECUTE 0x20000000 +#define IMAGE_SCN_MEM_READ 0x40000000 + + .section .peheader +efi_start: + /* The MS-DOS Stub, only used to get the offset of the COFF header */ + .ascii "MZ" + .short 0 + .space 0x38 + .long pe_sig - efi_start + + /* The PE32 Signature. Needs to be 8-byte aligned */ + .align 3 +pe_sig: + .ascii "PE" + .short 0 +coff_head: + .short IMAGE_FILE_MACHINE_ARM64 /* AArch64 file */ + .short 2 /* 2 Sections */ + .long 0 /* Timestamp */ + .long 0 /* No symbol table */ + .long 0 /* No symbols */ + .short section_table - optional_header /* Optional header size */ + .short 0 /* Characteristics TODO: Fill in */ + +optional_header: + .short 0x020b /* PE32+ (64-bit addressing) */ + .byte 0 /* Major linker version */ + .byte 0 /* Minor linker version */ + .long _edata - _end_header /* Code size */ + .long 0 /* No initialized data */ + .long 0 /* No uninitialized data */ + .long _start - efi_start /* Entry point */ + .long _end_header - efi_start /* Start of code */ + +optional_windows_header: + .quad 0 /* Image base */ + .long 32 /* Section Alignment */ + .long 8 /* File alignment */ + .short 0 /* Major OS version */ + .short 0 /* Minor OS version */ + .short 0 /* Major image version */ + .short 0 /* Minor image version */ + .short 0 /* Major subsystem version */ + .short 0 /* Minor subsystem version */ + .long 0 /* Win32 version */ + .long _edata - efi_start /* Image size */ + .long _end_header - efi_start /* Header size */ + .long 0 /* Checksum */ + .short 0xa /* Subsystem (EFI app) */ + .short 0 /* DLL Characteristics */ + .quad 0 /* Stack reserve */ + .quad 0 /* Stack commit */ + .quad 0 /* Heap reserve */ + .quad 0 /* Heap commit */ + .long 0 /* Loader flags */ + .long 6 /* Number of RVAs */ + + /* RVAs: */ + .quad 0 + .quad 0 + .quad 0 + .quad 0 + .quad 0 + .quad 0 + +section_table: + /* We need a .reloc section for EFI */ + .ascii ".reloc" + .byte 0 + .byte 0 /* Pad to 8 bytes */ + .long 0 /* Virtual size */ + .long 0 /* Virtual address */ + .long 0 /* Size of raw data */ + .long 0 /* Pointer to raw data */ + .long 0 /* Pointer to relocations */ + .long 0 /* Pointer to line numbers */ + .short 0 /* Number of relocations */ + .short 0 /* Number of line numbers */ + .long (IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ | \ + IMAGE_SCN_MEM_DISCARDABLE) /* Characteristics */ + + /* The contents of the loader */ + .ascii ".text" + .byte 0 + .byte 0 + .byte 0 /* Pad to 8 bytes */ + .long _edata - _end_header /* Virtual size */ + .long _end_header - efi_start /* Virtual address */ + .long _edata - _end_header /* Size of raw data */ + .long _end_header - efi_start /* Pointer to raw data */ + .long 0 /* Pointer to relocations */ + .long 0 /* Pointer to line numbers */ + .short 0 /* Number of relocations */ + .short 0 /* Number of line numbers */ + .long (IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | \ + IMAGE_SCN_MEM_READ) /* Characteristics */ +_end_header: + + .text + .globl _start +_start: + /* Save the boot params to the stack */ + stp x0, x1, [sp, #-16]! + + adr x0, __bss_start + adr x1, __bss_end + + b 2f + +1: + stp xzr, xzr, [x0], #16 +2: + cmp x0, x1 + b.lo 1b + + adr x0, ImageBase + adr x1, _DYNAMIC + + bl _reloc + + ldp x0, x1, [sp], #16 + + bl efi_main + +1: b 1b Modified: head/sys/boot/efi/loader/copy.c ============================================================================== --- head/sys/boot/efi/loader/copy.c Tue Apr 14 10:41:57 2015 (r281525) +++ head/sys/boot/efi/loader/copy.c Tue Apr 14 13:55:01 2015 (r281526) @@ -61,8 +61,14 @@ efi_copy_init(void) } staging_end = staging + STAGE_PAGES * 4096; -#ifdef __arm__ - /* Round the kernel load address to a 2MiB value */ +#if defined(__aarch64__) || defined(__arm__) + /* + * Round the kernel load address to a 2MiB value. This is needed + * because the kernel builds a page table based on where it has + * been loaded in physical address space. As the kernel will use + * either a 1MiB or 2MiB page for this we need to make sure it + * is correctly aligned for both cases. + */ staging = roundup2(staging, 2 * 1024 * 1024); #endif From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 13:56:34 2015 Return-Path: Delivered-To: svn-src-all@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 AD621105; Tue, 14 Apr 2015 13:56:34 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 759B8400; Tue, 14 Apr 2015 13:56:34 +0000 (UTC) Received: from bender (bender.sec.cl.cam.ac.uk [IPv6:2001:630:212:2a8:4e72:b9ff:fe93:61bf]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 3A4DDD7A38; Tue, 14 Apr 2015 13:56:26 +0000 (UTC) Date: Tue, 14 Apr 2015 14:56:25 +0100 From: Andrew Turner To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281526 - in head/sys: arm64/include boot boot/arm64 boot/arm64/libarm64 boot/common boot/efi boot/efi/boot1 boot/efi/include/arm64 boot/efi/loader boot/efi/loader/arch/arm64 Message-ID: <20150414145625.0a1604d6@bender> In-Reply-To: <201504141355.t3EDt2qP094973@svn.freebsd.org> References: <201504141355.t3EDt2qP094973@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 13:56:34 -0000 On Tue, 14 Apr 2015 13:55:02 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Tue Apr 14 13:55:01 2015 > New Revision: 281526 > URL: https://svnweb.freebsd.org/changeset/base/281526 > > Log: > Add support for arm64 to loader.efi and boot1.efi > > Reviewed by: emaste > Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2288 Andrew From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 14:15:16 2015 Return-Path: Delivered-To: svn-src-all@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 E30694C1; Tue, 14 Apr 2015 14:15: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 CDADE849; Tue, 14 Apr 2015 14:15: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 t3EEFFH7004617; Tue, 14 Apr 2015 14:15:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EEFFT7004615; Tue, 14 Apr 2015 14:15:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504141415.t3EEFFT7004615@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Apr 2015 14:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281527 - in head/sys/boot: . efi/loader/arch/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 14:15:17 -0000 Author: andrew Date: Tue Apr 14 14:15:14 2015 New Revision: 281527 URL: https://svnweb.freebsd.org/changeset/base/281527 Log: * Remove the wfi when the efi loader returns, it's unneeded and is not available on older designs. * Enable the efi loader on arm Modified: head/sys/boot/Makefile.arm head/sys/boot/efi/loader/arch/arm/start.S Modified: head/sys/boot/Makefile.arm ============================================================================== --- head/sys/boot/Makefile.arm Tue Apr 14 13:55:01 2015 (r281526) +++ head/sys/boot/Makefile.arm Tue Apr 14 14:15:14 2015 (r281527) @@ -4,4 +4,4 @@ SUBDIR+= fdt .endif -SUBDIR+= uboot +SUBDIR+= efi uboot Modified: head/sys/boot/efi/loader/arch/arm/start.S ============================================================================== --- head/sys/boot/efi/loader/arch/arm/start.S Tue Apr 14 13:55:01 2015 (r281526) +++ head/sys/boot/efi/loader/arch/arm/start.S Tue Apr 14 14:15:14 2015 (r281527) @@ -169,8 +169,7 @@ _start: pop {r0, r1} bl _C_LABEL(efi_main) -1: WFI - b 1b +1: b 1b .Lbase: .word . From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 14:22:35 2015 Return-Path: Delivered-To: svn-src-all@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 8D74875E; Tue, 14 Apr 2015 14:22: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 78777959; Tue, 14 Apr 2015 14:22: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 t3EEMZYh008966; Tue, 14 Apr 2015 14:22:35 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EEMZRG008965; Tue, 14 Apr 2015 14:22:35 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201504141422.t3EEMZRG008965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 14 Apr 2015 14:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281528 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 14:22:35 -0000 Author: gnn Date: Tue Apr 14 14:22:34 2015 New Revision: 281528 URL: https://svnweb.freebsd.org/changeset/base/281528 Log: When a kernel has DEVICE_POLLING turned on but no drivers have the capability do not try to take the mutex at all. Replaces misbegotten attempt from reverted commit 281276 Pointed out by: glebius Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D2262 Modified: head/sys/kern/kern_poll.c Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Tue Apr 14 14:15:14 2015 (r281527) +++ head/sys/kern/kern_poll.c Tue Apr 14 14:22:34 2015 (r281528) @@ -367,6 +367,9 @@ netisr_pollmore() struct timeval t; int kern_load; + if (poll_handlers == 0) + return; + mtx_lock(&poll_mtx); if (!netisr_pollmore_scheduled) { mtx_unlock(&poll_mtx); @@ -424,6 +427,9 @@ netisr_poll(void) int i, cycles; enum poll_cmd arg = POLL_ONLY; + if (poll_handlers == 0) + return; + mtx_lock(&poll_mtx); if (!netisr_poll_scheduled) { mtx_unlock(&poll_mtx); From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 14:43:43 2015 Return-Path: Delivered-To: svn-src-all@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 3A4A4CC9; Tue, 14 Apr 2015 14:43: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 255CDC08; Tue, 14 Apr 2015 14:43: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 t3EEhh00018439; Tue, 14 Apr 2015 14:43:43 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EEhhUG018438; Tue, 14 Apr 2015 14:43:43 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201504141443.t3EEhhUG018438@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 14 Apr 2015 14:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281529 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 14:43:43 -0000 Author: gnn Date: Tue Apr 14 14:43:42 2015 New Revision: 281529 URL: https://svnweb.freebsd.org/changeset/base/281529 Log: I can find no reason to allow packets with both SYN and FIN bits set past this point in the code. The packet should be dropped and not massaged as it is here. Differential Revision: https://reviews.freebsd.org/D2266 Submitted by: eri Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Tue Apr 14 14:22:34 2015 (r281528) +++ head/sys/netpfil/pf/pf_norm.c Tue Apr 14 14:43:42 2015 (r281529) @@ -1643,7 +1643,7 @@ pf_normalize_tcp(int dir, struct pfi_kif goto tcp_drop; if (flags & TH_FIN) - flags &= ~TH_FIN; + goto tcp_drop; } else { /* Illegal packet */ if (!(flags & (TH_ACK|TH_RST))) From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 15:21:21 2015 Return-Path: Delivered-To: svn-src-all@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 5510A622; Tue, 14 Apr 2015 15:21: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 40452FCD; Tue, 14 Apr 2015 15:21: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 t3EFLLMD034170; Tue, 14 Apr 2015 15:21:21 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EFLLoF034159; Tue, 14 Apr 2015 15:21:21 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201504141521.t3EFLLoF034159@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 14 Apr 2015 15:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281530 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 15:21:21 -0000 Author: gnn Date: Tue Apr 14 15:21:20 2015 New Revision: 281530 URL: https://svnweb.freebsd.org/changeset/base/281530 Log: Document internal interface types which are specific to FreeBSD. Modified: head/sys/net/if_types.h Modified: head/sys/net/if_types.h ============================================================================== --- head/sys/net/if_types.h Tue Apr 14 14:43:42 2015 (r281529) +++ head/sys/net/if_types.h Tue Apr 14 15:21:20 2015 (r281530) @@ -243,10 +243,10 @@ #define IFT_STF 0xd7 /* 6to4 interface */ -/* not based on IANA assignments */ -#define IFT_GIF 0xf0 -#define IFT_PVC 0xf1 -#define IFT_ENC 0xf4 -#define IFT_PFLOG 0xf6 -#define IFT_PFSYNC 0xf7 +/* FreeBSD specific, not based on IANA assignments */ +#define IFT_GIF 0xf0 /* Generic tunnel interface */ +#define IFT_PVC 0xf1 /* Unused */ +#define IFT_ENC 0xf4 /* Encapsulating interface */ +#define IFT_PFLOG 0xf6 /* PF packet filter logging */ +#define IFT_PFSYNC 0xf7 /* PF packet filter synchronization */ #endif /* !_NET_IF_TYPES_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 16:33:34 2015 Return-Path: Delivered-To: svn-src-all@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 BC7D7578; Tue, 14 Apr 2015 16:33:34 +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 A79BDB91; Tue, 14 Apr 2015 16:33:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EGXYuu070175; Tue, 14 Apr 2015 16:33:34 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EGXYx6070174; Tue, 14 Apr 2015 16:33:34 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201504141633.t3EGXYx6070174@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 14 Apr 2015 16:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281531 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 16:33:34 -0000 Author: asomers Date: Tue Apr 14 16:33:33 2015 New Revision: 281531 URL: https://svnweb.freebsd.org/changeset/base/281531 Log: Initialize async_arg_ptr in xpt_async when called with async_code AC_ADVINFO_CHANGED. Without this change, newly inserted hard disks won't always have their physical path device nodes created. The problem reproduces most readily when attaching a large number of disks at once. Differential Revision: https://reviews.freebsd.org/D2290 Reviewed by: mav, imp MFC after: 2 weeks Sponsored by: Spectra Logic Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Apr 14 15:21:20 2015 (r281530) +++ head/sys/cam/cam_xpt.c Tue Apr 14 16:33:33 2015 (r281531) @@ -4264,8 +4264,10 @@ xpt_async(u_int32_t async_code, struct c } memcpy(ccb->casync.async_arg_ptr, async_arg, size); ccb->casync.async_arg_size = size; - } else if (size < 0) + } else if (size < 0) { + ccb->casync.async_arg_ptr = async_arg; ccb->casync.async_arg_size = size; + } if (path->device != NULL && path->device->lun_id != CAM_LUN_WILDCARD) xpt_freeze_devq(path, 1); else From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 18:13:59 2015 Return-Path: Delivered-To: svn-src-all@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 DA41B24C; Tue, 14 Apr 2015 18:13: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 C50F19DA; Tue, 14 Apr 2015 18:13: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 t3EIDwpW018431; Tue, 14 Apr 2015 18:13:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EIDu13018421; Tue, 14 Apr 2015 18:13:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504141813.t3EIDu13018421@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 18:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281532 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 18:13:59 -0000 Author: delphij Date: Tue Apr 14 18:13:55 2015 New Revision: 281532 URL: https://svnweb.freebsd.org/changeset/base/281532 Log: Eliminate unused headers. Modified: head/usr.sbin/ctld/discovery.c head/usr.sbin/ctld/isns.c head/usr.sbin/ctld/keys.c head/usr.sbin/ctld/login.c head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/pdu.c head/usr.sbin/ctld/token.l Modified: head/usr.sbin/ctld/discovery.c ============================================================================== --- head/usr.sbin/ctld/discovery.c Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/discovery.c Tue Apr 14 18:13:55 2015 (r281532) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/usr.sbin/ctld/isns.c ============================================================================== --- head/usr.sbin/ctld/isns.c Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/isns.c Tue Apr 14 18:13:55 2015 (r281532) @@ -35,14 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include -#include #include -#include -#include #include #include #include Modified: head/usr.sbin/ctld/keys.c ============================================================================== --- head/usr.sbin/ctld/keys.c Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/keys.c Tue Apr 14 18:13:55 2015 (r281532) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/login.c Tue Apr 14 18:13:55 2015 (r281532) @@ -33,8 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/parse.y Tue Apr 14 18:13:55 2015 (r281532) @@ -35,7 +35,6 @@ #include #include #include -#include #include #include Modified: head/usr.sbin/ctld/pdu.c ============================================================================== --- head/usr.sbin/ctld/pdu.c Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/pdu.c Tue Apr 14 18:13:55 2015 (r281532) @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Tue Apr 14 16:33:33 2015 (r281531) +++ head/usr.sbin/ctld/token.l Tue Apr 14 18:13:55 2015 (r281532) @@ -34,7 +34,6 @@ #include #include -#include "ctld.h" #include "y.tab.h" int lineno; From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 18:45:31 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Apr 14 18:46:43 2015 Return-Path: Delivered-To: svn-src-all@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 956D222D; Tue, 14 Apr 2015 18:46: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 80501D80; Tue, 14 Apr 2015 18:46: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 t3EIkhhT034329; Tue, 14 Apr 2015 18:46:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EIkhiO034328; Tue, 14 Apr 2015 18:46:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504141846.t3EIkhiO034328@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:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r281534 - stable/9/sbin/newfs_msdos X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 18:46:43 -0000 Author: pfg Date: Tue Apr 14 18:46:42 2015 New Revision: 281534 URL: https://svnweb.freebsd.org/changeset/base/281534 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/9/sbin/newfs_msdos/newfs_msdos.8 Directory Properties: stable/9/sbin/newfs_msdos/ (props changed) Modified: stable/9/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- stable/9/sbin/newfs_msdos/newfs_msdos.8 Tue Apr 14 18:45:30 2015 (r281533) +++ stable/9/sbin/newfs_msdos/newfs_msdos.8 Tue Apr 14 18:46:42 2015 (r281534) @@ -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-all@FreeBSD.ORG Tue Apr 14 18:57:53 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Apr 14 19:07:37 2015 Return-Path: Delivered-To: svn-src-all@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 D32A59EF; Tue, 14 Apr 2015 19:07:37 +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 BEE85FAA; Tue, 14 Apr 2015 19:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3EJ7bsV044697; Tue, 14 Apr 2015 19:07:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EJ7bZp044696; Tue, 14 Apr 2015 19:07:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201504141907.t3EJ7bZp044696@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 14 Apr 2015 19:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281536 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 19:07:37 -0000 Author: kp Date: Tue Apr 14 19:07:37 2015 New Revision: 281536 URL: https://svnweb.freebsd.org/changeset/base/281536 Log: pf: Fix forwarding detection If the direction is not PF_OUT we can never be forwarding. Some input packets have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound packets, causing panics. Equally, we need to ensure that packets were really received and not locally generated before trying to ip6_forward() them. Differential Revision: https://reviews.freebsd.org/D2286 Approved by: gnn(mentor) Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015 (r281535) +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015 (r281536) @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str M_ASSERTPKTHDR(m); - if (ifp != m->m_pkthdr.rcvif) + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) fwdir = PF_FWD; if (!V_pf_status.running) From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 19:18:35 2015 Return-Path: Delivered-To: svn-src-all@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 53419F1F; Tue, 14 Apr 2015 19:18: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 3E9E517D; Tue, 14 Apr 2015 19:18: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 t3EJIYYF049895; Tue, 14 Apr 2015 19:18:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EJIYQE049894; Tue, 14 Apr 2015 19:18:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504141918.t3EJIYQE049894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 14 Apr 2015 19:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281537 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 19:18:35 -0000 Author: emaste Date: Tue Apr 14 19:18:34 2015 New Revision: 281537 URL: https://svnweb.freebsd.org/changeset/base/281537 Log: Increase vt font limits to allow use of GNU Unifont PR: 199438 Submitted by: Ting-Wei Lan MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_font.c Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Tue Apr 14 19:07:37 2015 (r281536) +++ head/sys/dev/vt/vt_font.c Tue Apr 14 19:18:34 2015 (r281537) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ -#define VTFONT_MAXMAPPINGS 8192 -#define VTFONT_MAXGLYPHSIZE 1048576 +#define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 static uint16_t From owner-svn-src-all@FreeBSD.ORG Tue Apr 14 20:05:29 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Apr 14 20:05:31 2015 Return-Path: Delivered-To: svn-src-all@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 8B68CFC2; Tue, 14 Apr 2015 20:05: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 7636C95B; Tue, 14 Apr 2015 20:05: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 t3EK5VN8073993; Tue, 14 Apr 2015 20:05:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3EK5TYR073983; Tue, 14 Apr 2015 20:05:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504142005.t3EK5TYR073983@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:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r281538 - in stable: 10/sys/sys 9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 20:05:31 -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/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) Changes in other areas also in this revision: 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) Modified: stable/9/sys/sys/bitset.h ============================================================================== --- stable/9/sys/sys/bitset.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/9/sys/sys/bitset.h Tue Apr 14 20:05:26 2015 (r281538) @@ -165,4 +165,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/9/sys/sys/cpuset.h ============================================================================== --- stable/9/sys/sys/cpuset.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/9/sys/sys/cpuset.h Tue Apr 14 20:05:26 2015 (r281538) @@ -58,6 +58,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/9/sys/sys/libkern.h ============================================================================== --- stable/9/sys/sys/libkern.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/9/sys/sys/libkern.h Tue Apr 14 20:05:26 2015 (r281538) @@ -94,6 +94,12 @@ int fls(int); #ifndef HAVE_INLINE_FLSL int flsl(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); void *memchr(const void *s, int c, size_t n); Modified: stable/9/sys/sys/systm.h ============================================================================== --- stable/9/sys/sys/systm.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/9/sys/sys/systm.h Tue Apr 14 20:05:26 2015 (r281538) @@ -392,31 +392,4 @@ 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); -} - #endif /* !_SYS_SYSTM_H_ */ Modified: stable/9/sys/sys/types.h ============================================================================== --- stable/9/sys/sys/types.h Tue Apr 14 19:18:34 2015 (r281537) +++ stable/9/sys/sys/types.h Tue Apr 14 20:05:26 2015 (r281538) @@ -283,6 +283,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-all@FreeBSD.ORG Wed Apr 15 00:07:22 2015 Return-Path: Delivered-To: svn-src-all@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 A23D1BBA; Wed, 15 Apr 2015 00:07: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 8D602848; Wed, 15 Apr 2015 00:07: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 t3F07Mbs090731; Wed, 15 Apr 2015 00:07:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F07Mv6090730; Wed, 15 Apr 2015 00:07:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504150007.t3F07Mv6090730@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Apr 2015 00:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281540 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 00:07:22 -0000 Author: delphij Date: Wed Apr 15 00:07:21 2015 New Revision: 281540 URL: https://svnweb.freebsd.org/changeset/base/281540 Log: When reading in the original file name from gzip header, we read in PATH_MAX + 1 bytes from the file. In r281500, strrchr() is used to strip possible path portion of the file name to mitigate a possible attack. Unfortunately, strrchr() expects a buffer that is NUL-terminated, and since we are processing potentially untrusted data, we can not assert that be always true. Solve this by reading in one less byte (now PATH_MAX) and explicitly terminate the buffer after the read size with NUL. Reported by: Coverity CID: 1264915 X-MFC-with: 281500 MFC after: 13 days Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Tue Apr 14 20:08:37 2015 (r281539) +++ head/usr.bin/gzip/gzip.c Wed Apr 15 00:07:21 2015 (r281540) @@ -1409,14 +1409,17 @@ file_uncompress(char *file, char *outfil timestamp = ts[3] << 24 | ts[2] << 16 | ts[1] << 8 | ts[0]; if (header1[3] & ORIG_NAME) { - rbytes = pread(fd, name, sizeof name, GZIP_ORIGNAME); + rbytes = pread(fd, name, sizeof(name) - 1, GZIP_ORIGNAME); if (rbytes < 0) { maybe_warn("can't read %s", file); goto lose; } - if (name[0] != 0) { + if (name[0] != '\0') { char *dp, *nf; + /* Make sure that name is NUL-terminated */ + name[rbytes] = '\0'; + /* strip saved directory name */ nf = strrchr(name, '/'); if (nf == NULL) From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 00:57:22 2015 Return-Path: Delivered-To: svn-src-all@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 6E45F312; Wed, 15 Apr 2015 00:57: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 59FBCD05; Wed, 15 Apr 2015 00:57: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 t3F0vL2g014446; Wed, 15 Apr 2015 00:57:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F0vLNr014445; Wed, 15 Apr 2015 00:57:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201504150057.t3F0vLNr014445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 15 Apr 2015 00:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281541 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 00:57:22 -0000 Author: adrian Date: Wed Apr 15 00:57:21 2015 New Revision: 281541 URL: https://svnweb.freebsd.org/changeset/base/281541 Log: Fix RSS build - netisr input / NETISR_IP_DIRECT is used here. Modified: head/sys/netinet/ip_reass.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Wed Apr 15 00:07:21 2015 (r281540) +++ head/sys/netinet/ip_reass.c Wed Apr 15 00:57:21 2015 (r281541) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 05:04:43 2015 Return-Path: Delivered-To: svn-src-all@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 7EE90491; Wed, 15 Apr 2015 05:04: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 4FED5B3B; Wed, 15 Apr 2015 05:04: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 t3F54gQj032687; Wed, 15 Apr 2015 05:04:42 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F54gqb032686; Wed, 15 Apr 2015 05:04:42 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201504150504.t3F54gqb032686@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 15 Apr 2015 05:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281542 - head/usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 05:04:43 -0000 Author: neel Date: Wed Apr 15 05:04:42 2015 New Revision: 281542 URL: https://svnweb.freebsd.org/changeset/base/281542 Log: Initialize 'error' before use. Reported by: Coverity Scan CID: 1249748, 1249747, 1249751, 1249749 MFC after: 1 week Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Wed Apr 15 00:57:21 2015 (r281541) +++ head/usr.sbin/bhyvectl/bhyvectl.c Wed Apr 15 05:04:42 2015 (r281542) @@ -640,9 +640,9 @@ get_all_registers(struct vmctx *ctx, int uint64_t cr0, cr3, cr4, dr7, rsp, rip, rflags, efer; uint64_t rax, rbx, rcx, rdx, rsi, rdi, rbp; uint64_t r8, r9, r10, r11, r12, r13, r14, r15; - int error; + int error = 0; - if (get_efer || get_all) { + if (!error && (get_efer || get_all)) { error = vm_get_register(ctx, vcpu, VM_REG_GUEST_EFER, &efer); if (error == 0) printf("efer[%d]\t\t0x%016lx\n", vcpu, efer); @@ -787,10 +787,10 @@ get_all_registers(struct vmctx *ctx, int static int get_all_segments(struct vmctx *ctx, int vcpu) { - int error; uint64_t cs, ds, es, fs, gs, ss, tr, ldtr; + int error = 0; - if (get_desc_ds || get_all) { + if (!error && (get_desc_ds || get_all)) { error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_DS, &desc_base, &desc_limit, &desc_access); if (error == 0) { @@ -935,9 +935,9 @@ static int get_misc_vmcs(struct vmctx *ctx, int vcpu) { uint64_t ctl, cr0, cr3, cr4, rsp, rip, pat, addr, u64; - int error; - - if (get_cr0_mask || get_all) { + int error = 0; + + if (!error && (get_cr0_mask || get_all)) { uint64_t cr0mask; error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR0_MASK, &cr0mask); if (error == 0) @@ -1161,9 +1161,9 @@ static int get_misc_vmcb(struct vmctx *ctx, int vcpu) { uint64_t ctl, addr; - int error; + int error = 0; - if (get_vmcb_intercept || get_all) { + if (!error && (get_vmcb_intercept || get_all)) { error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_CR_INTERCEPT, 4, &ctl); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 05:13:42 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Apr 15 05:24:41 2015 Return-Path: Delivered-To: svn-src-all@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 7A802909; Wed, 15 Apr 2015 05:24:41 +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 5AD95D5F; Wed, 15 Apr 2015 05:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3F5OfUL042211; Wed, 15 Apr 2015 05:24:41 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F5Oep0042203; Wed, 15 Apr 2015 05:24:40 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504150524.t3F5Oep0042203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 15 Apr 2015 05:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281544 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 05:24:41 -0000 Author: rpaulo Date: Wed Apr 15 05:24:39 2015 New Revision: 281544 URL: https://svnweb.freebsd.org/changeset/base/281544 Log: snd_hda: add support for the Lenovo X1 20BS model. This requires a patch to redirect the output to a separate DAC when the headphones are used. While there, add device strings for Intel Broadwell HDA controllers and Realtek ALC292 codecs. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Apr 15 05:13:41 2015 (r281543) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Apr 15 05:24:39 2015 (r281544) @@ -401,6 +401,13 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC292 && + subid == LENOVO_X120BS_SUBVENDOR) { + switch (nid) { + case 21: + patch = "as=1 seq=15"; + break; + } } if (patch != NULL) Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Apr 15 05:13:41 2015 (r281543) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Apr 15 05:24:39 2015 (r281544) @@ -81,6 +81,8 @@ static const struct { { HDA_INTEL_HSW1, "Intel Haswell", 0, 0 }, { HDA_INTEL_HSW2, "Intel Haswell", 0, 0 }, { HDA_INTEL_HSW3, "Intel Haswell", 0, 0 }, + { HDA_INTEL_BDW1, "Intel Broadwell", 0, 0 }, + { HDA_INTEL_BDW2, "Intel Broadwell", 0, 0 }, { HDA_INTEL_CPT, "Intel Cougar Point", 0, 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0, 0 }, { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Apr 15 05:13:41 2015 (r281543) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Apr 15 05:24:39 2015 (r281544) @@ -46,6 +46,7 @@ #define HDA_INTEL_HSW1 HDA_MODEL_CONSTRUCT(INTEL, 0x0a0c) #define HDA_INTEL_HSW2 HDA_MODEL_CONSTRUCT(INTEL, 0x0c0c) #define HDA_INTEL_HSW3 HDA_MODEL_CONSTRUCT(INTEL, 0x0d0c) +#define HDA_INTEL_BDW1 HDA_MODEL_CONSTRUCT(INTEL, 0x160c) #define HDA_INTEL_CPT HDA_MODEL_CONSTRUCT(INTEL, 0x1c20) #define HDA_INTEL_PATSBURG HDA_MODEL_CONSTRUCT(INTEL, 0x1d20) #define HDA_INTEL_PPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x1e20) @@ -67,6 +68,7 @@ #define HDA_INTEL_WELLS2 HDA_MODEL_CONSTRUCT(INTEL, 0x8d21) #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) #define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) +#define HDA_INTEL_BDW2 HDA_MODEL_CONSTRUCT(INTEL, 0x9ca0) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ @@ -235,6 +237,7 @@ #define LENOVO_TCA55_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x1015) #define LENOVO_X1_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21e8) #define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9) +#define LENOVO_X120BS_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2227) #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da) #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) #define LENOVO_T400_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2) @@ -338,6 +341,7 @@ #define HDA_CODEC_ALC273 HDA_CODEC_CONSTRUCT(REALTEK, 0x0273) #define HDA_CODEC_ALC275 HDA_CODEC_CONSTRUCT(REALTEK, 0x0275) #define HDA_CODEC_ALC276 HDA_CODEC_CONSTRUCT(REALTEK, 0x0276) +#define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) @@ -622,6 +626,7 @@ #define HDA_CODEC_INTELCPT HDA_CODEC_CONSTRUCT(INTEL, 0x2805) #define HDA_CODEC_INTELPPT HDA_CODEC_CONSTRUCT(INTEL, 0x2806) #define HDA_CODEC_INTELHSW HDA_CODEC_CONSTRUCT(INTEL, 0x2807) +#define HDA_CODEC_INTELBDW HDA_CODEC_CONSTRUCT(INTEL, 0x2808) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Wed Apr 15 05:13:41 2015 (r281543) +++ head/sys/dev/sound/pci/hda/hdacc.c Wed Apr 15 05:24:39 2015 (r281544) @@ -87,6 +87,7 @@ static const struct { { HDA_CODEC_ALC273, 0, "Realtek ALC273" }, { HDA_CODEC_ALC275, 0, "Realtek ALC275" }, { HDA_CODEC_ALC276, 0, "Realtek ALC276" }, + { HDA_CODEC_ALC292, 0, "Realtek ALC292" }, { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" }, { HDA_CODEC_ALC662, 0x0002, "Realtek ALC662 rev2" }, { HDA_CODEC_ALC662, 0, "Realtek ALC662" }, @@ -319,6 +320,7 @@ static const struct { { HDA_CODEC_INTELCPT, 0, "Intel Cougar Point" }, { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, { HDA_CODEC_INTELHSW, 0, "Intel Haswell" }, + { HDA_CODEC_INTELBDW, 0, "Intel Broadwell" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 05:33:59 2015 Return-Path: Delivered-To: svn-src-all@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 08BBCB37 for ; Wed, 15 Apr 2015 05:33:59 +0000 (UTC) Received: from vfemail.net (ninezero.vfemail.net [96.30.253.190]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1D50E55 for ; Wed, 15 Apr 2015 05:33:58 +0000 (UTC) Received: (qmail 74543 invoked by uid 89); 15 Apr 2015 05:33:52 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 15 Apr 2015 05:33:52 -0000 Received: (qmail 74479 invoked by uid 89); 15 Apr 2015 05:33:35 -0000 Received: by simscan 1.3.1 ppid: 74472, pid: 74475, t: 0.1001s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 15 Apr 2015 05:33:35 -0000 Received: (qmail 5188 invoked by uid 89); 15 Apr 2015 05:33:35 -0000 Received: by simscan 1.4.0 ppid: 5163, pid: 5177, t: 0.9635s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 15 Apr 2015 05:33:34 -0000 From: Jan Beich To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281131 - head/etc References: <201504060153.t361rmhV099625@svn.freebsd.org> Date: Wed, 15 Apr 2015 07:33:24 +0200 Message-ID: <4moi-gdln-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 05:33:59 -0000 --=-=-= Content-Type: text/plain Baptiste Daroussin writes: > Log: > Enforce LC_COLLATE="C" until we do support proper UTF-8 collation [...] > - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ > + :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\ Did you mean to append value to :setenv instead of defining a separate capability? Index: etc/login.conf =================================================================== --- etc/login.conf (revision 281134) +++ etc/login.conf (working copy) @@ -26,7 +26,7 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\ + :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,LC_COLLATE=C:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJVLfgkXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bDggH/REz69WJIReJ5driDzY0+nSd 02vKhMFnGG+ZLf8Y1rOe3C9R6JNSzAvGzvgy32efart9T5+RXOH5aqGP8RZDXful El6uCwKSXzg5Ro9C3ZoREBPT059FC/LJOoMk0lRW7fqaKUCoYqB56AdWcTCAD5U6 BpCwGsgKBr3lRzvzkIVieUlXsRbTViCvVhqYwAr+kCcxocHXwCKzf/fdSBE04NFr YgQ7aeB6wpLzXt6QinqsSJjjfVdsGQtLPa1ISOVjDf9Jy7YsH+iSPPO+dfdZ5DQ1 tuGX4Uw57rSW+zbWyH6HZml6TW8Low/Sdr/q8dgtXnuLtlsHW+DyihEaLJ0UArQ= =Hc21 -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 06:56:53 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Apr 15 06:57:48 2015 Return-Path: Delivered-To: svn-src-all@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 A068579F; Wed, 15 Apr 2015 06:57: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 8BA8797C; Wed, 15 Apr 2015 06:57: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 t3F6vmUc084821; Wed, 15 Apr 2015 06:57:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F6vmqB084820; Wed, 15 Apr 2015 06:57:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201504150657.t3F6vmqB084820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 15 Apr 2015 06:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281546 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 06:57:48 -0000 Author: bapt Date: Wed Apr 15 06:57:47 2015 New Revision: 281546 URL: https://svnweb.freebsd.org/changeset/base/281546 Log: Correctly set LC_COLLATE into setenv Submitted by: jbeich Modified: head/etc/login.conf Modified: head/etc/login.conf ============================================================================== --- head/etc/login.conf Wed Apr 15 06:56:51 2015 (r281545) +++ head/etc/login.conf Wed Apr 15 06:57:47 2015 (r281546) @@ -26,7 +26,7 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\ + :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,LC_COLLATE=C:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 06:58:18 2015 Return-Path: Delivered-To: svn-src-all@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 726408E1; Wed, 15 Apr 2015 06:58:18 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3579983; Wed, 15 Apr 2015 06:58:17 +0000 (UTC) Received: by widdi4 with SMTP id di4so48452606wid.0; Tue, 14 Apr 2015 23:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=NAe9zHdY89oDg57YHIENTGk7pZroYlxVuCjKt/xDRnk=; b=DQ6iynZYZ3Xb5gb3T+jI/eurb0gOCD7ywO5RePFvc3/5FliZa3TX6VmiE7cUlN2L7m SzroHjBX5CqEgQVv5MxdsGoN5EYiccg34Oifm58bhzTUmDlv3Bt3HJShopw27BB7NzoD iaxVQWpemlj1TlHxmJZj7Lrx27vUEHhT7TkMegNasd7RMDkKpCvwmw23OHDh2tdFaFm2 nt+mV7D9vZPUX0KR1OB5xdHb0k3XXhrXIZU0VeXzo7AvinBlwKt9msVykHXFlzdZ3yw7 7xXgmIguxhgPT+zfcouDy8GdATNMJyD/odTE8J0fIC+LBVEmtkbQsk+HkreHxI6/QkUf gItg== X-Received: by 10.181.27.229 with SMTP id jj5mr39458265wid.87.1429081096452; Tue, 14 Apr 2015 23:58:16 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id n3sm4578723wja.36.2015.04.14.23.58.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 23:58:15 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 15 Apr 2015 08:58:13 +0200 From: Baptiste Daroussin To: Jan Beich Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r281131 - head/etc Message-ID: <20150415065810.GK39658@ivaldir.etoilebsd.net> References: <201504060153.t361rmhV099625@svn.freebsd.org> <4moi-gdln-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ibq+fG+Ci5ONsaof" Content-Disposition: inline In-Reply-To: <4moi-gdln-wny@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 06:58:18 -0000 --ibq+fG+Ci5ONsaof Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 15, 2015 at 07:33:24AM +0200, Jan Beich wrote: > Baptiste Daroussin writes: >=20 > > Log: > > Enforce LC_COLLATE=3D"C" until we do support proper UTF-8 collation > [...] > > - :setenv=3DMAIL=3D/var/mail/$,BLOCKSIZE=3DK:\ > > + :setenv=3DMAIL=3D/var/mail/$,BLOCKSIZE=3DK:LC_COLLATE=3DC:\ >=20 > Did you mean to append value to :setenv instead of defining > a separate capability? Oups fixed, thanks. Bapt --ibq+fG+Ci5ONsaof Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlUuDAIACgkQ8kTtMUmk6EyzHACdFgfhhM/3WL3WTgQFmyZtzrre ixEAnjEQUtqeKeSPhw/oUZr6R/iIbguM =luA1 -----END PGP SIGNATURE----- --ibq+fG+Ci5ONsaof-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 06:59:54 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@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 6015D842; Wed, 15 Apr 2015 08:13: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 4ADAB238; Wed, 15 Apr 2015 08:13: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 t3F8DtIi021649; Wed, 15 Apr 2015 08:13:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F8Drjj021644; Wed, 15 Apr 2015 08:13:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504150813.t3F8Drjj021644@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 08:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281548 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 08:13:55 -0000 Author: kib Date: Wed Apr 15 08:13:53 2015 New Revision: 281548 URL: https://svnweb.freebsd.org/changeset/base/281548 Log: Implement support for binary to requesting specific stack size for the initial thread. It is read by the ELF image activator as the virtual size of the PT_GNU_STACK program header entry, and can be specified by the linker option -z stack-size in newer binutils. The soft RLIMIT_STACK is auto-increased if possible, to satisfy the binary' request. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/kern/kern_resource.c head/sys/sys/imgact.h Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Apr 15 06:59:53 2015 (r281547) +++ head/sys/kern/imgact_elf.c Wed Apr 15 08:13:53 2015 (r281548) @@ -782,6 +782,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (__elfN(nxstack)) imgp->stack_prot = __elfN(trans_prot)(phdr[i].p_flags); + imgp->stack_sz = phdr[i].p_memsz; break; } } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Apr 15 06:59:53 2015 (r281547) +++ head/sys/kern/kern_exec.c Wed Apr 15 08:13:53 2015 (r281548) @@ -1009,6 +1009,7 @@ exec_new_vmspace(imgp, sv) struct proc *p = imgp->proc; struct vmspace *vmspace = p->p_vmspace; vm_object_t obj; + struct rlimit rlim_stack; vm_offset_t sv_minuser, stack_addr; vm_map_t map; u_long ssiz; @@ -1058,10 +1059,22 @@ exec_new_vmspace(imgp, sv) } /* Allocate a new stack */ - if (sv->sv_maxssiz != NULL) + if (imgp->stack_sz != 0) { + ssiz = imgp->stack_sz; + PROC_LOCK(p); + lim_rlimit(p, RLIMIT_STACK, &rlim_stack); + PROC_UNLOCK(p); + if (ssiz > rlim_stack.rlim_max) + ssiz = rlim_stack.rlim_max; + if (ssiz > rlim_stack.rlim_cur) { + rlim_stack.rlim_cur = ssiz; + kern_setrlimit(curthread, RLIMIT_STACK, &rlim_stack); + } + } else if (sv->sv_maxssiz != NULL) { ssiz = *sv->sv_maxssiz; - else + } else { ssiz = maxssiz; + } stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Wed Apr 15 06:59:53 2015 (r281547) +++ head/sys/kern/kern_resource.c Wed Apr 15 08:13:53 2015 (r281548) @@ -745,7 +745,12 @@ kern_proc_setrlimit(struct thread *td, s if (newlim != NULL) lim_free(oldlim); - if (which == RLIMIT_STACK) { + if (which == RLIMIT_STACK && + /* + * Skip calls from exec_new_vmspace(), done when stack is + * not mapped yet. + */ + (td != curthread || (p->p_flag & P_INEXEC) == 0)) { /* * Stack is allocated to the max at exec time with only * "rlim_cur" bytes accessible. If stack limit is going Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Wed Apr 15 06:59:53 2015 (r281547) +++ head/sys/sys/imgact.h Wed Apr 15 08:13:53 2015 (r281548) @@ -80,6 +80,7 @@ struct image_params { unsigned long pagesizes; int pagesizeslen; vm_prot_t stack_prot; + u_long stack_sz; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 08:16:36 2015 Return-Path: Delivered-To: svn-src-all@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 2C277A0A; Wed, 15 Apr 2015 08:16: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 16E92268; Wed, 15 Apr 2015 08:16: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 t3F8GZHg022055; Wed, 15 Apr 2015 08:16:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F8GZo6022053; Wed, 15 Apr 2015 08:16:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504150816.t3F8GZo6022053@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 08:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281549 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 08:16:36 -0000 Author: kib Date: Wed Apr 15 08:16:34 2015 New Revision: 281549 URL: https://svnweb.freebsd.org/changeset/base/281549 Log: Implement support -z global linker option. It marks the shared object as always participating in the global symbols namespace, regardless of the way the object was brought into the process address space. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Apr 15 08:13:53 2015 (r281548) +++ head/libexec/rtld-elf/rtld.c Wed Apr 15 08:16:34 2015 (r281549) @@ -1158,8 +1158,8 @@ digest_dynamic1(Obj_Entry *obj, int earl obj->z_noopen = true; if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) obj->z_origin = true; - /*if (dynp->d_un.d_val & DF_1_GLOBAL) - XXX ;*/ + if (dynp->d_un.d_val & DF_1_GLOBAL) + obj->z_global = true; if (dynp->d_un.d_val & DF_1_BIND_NOW) obj->bind_now = true; if (dynp->d_un.d_val & DF_1_NODELETE) @@ -1790,22 +1790,35 @@ init_dag(Obj_Entry *root) } static void -process_nodelete(Obj_Entry *root) +process_z(Obj_Entry *root) { const Objlist_Entry *elm; + Obj_Entry *obj; /* - * Walk over object DAG and process every dependent object that - * is marked as DF_1_NODELETE. They need to grow their own DAG, - * which then should have its reference upped separately. + * Walk over object DAG and process every dependent object + * that is marked as DF_1_NODELETE or DF_1_GLOBAL. They need + * to grow their own DAG. + * + * For DF_1_GLOBAL, DAG is required for symbol lookups in + * symlook_global() to work. + * + * For DF_1_NODELETE, the DAG should have its reference upped. */ STAILQ_FOREACH(elm, &root->dagmembers, link) { - if (elm->obj != NULL && elm->obj->z_nodelete && - !elm->obj->ref_nodel) { - dbg("obj %s nodelete", elm->obj->path); - init_dag(elm->obj); - ref_dag(elm->obj); - elm->obj->ref_nodel = true; + obj = elm->obj; + if (obj == NULL) + continue; + if (obj->z_nodelete && !obj->ref_nodel) { + dbg("obj %s -z nodelete", obj->path); + init_dag(obj); + ref_dag(obj); + obj->ref_nodel = true; + } + if (obj->z_global && objlist_find(&list_global, obj) == NULL) { + dbg("obj %s -z global", obj->path); + objlist_push_tail(&list_global, obj); + init_dag(obj); } } } @@ -3044,13 +3057,13 @@ dlopen_object(const char *name, int fd, initlist_add_objects(obj, &obj->next, &initlist); } /* - * Process all no_delete objects here, given them own - * DAGs to prevent their dependencies from being unloaded. - * This has to be done after we have loaded all of the - * dependencies, so that we do not miss any. + * Process all no_delete or global objects here, given + * them own DAGs to prevent their dependencies from being + * unloaded. This has to be done after we have loaded all + * of the dependencies, so that we do not miss any. */ if (obj != NULL) - process_nodelete(obj); + process_z(obj); } else { /* * Bump the reference counts for objects on this DAG. If Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Wed Apr 15 08:13:53 2015 (r281548) +++ head/libexec/rtld-elf/rtld.h Wed Apr 15 08:16:34 2015 (r281549) @@ -264,6 +264,7 @@ typedef struct Struct_Obj_Entry { bool z_loadfltr : 1; /* Immediately load filtees */ bool z_interpose : 1; /* Interpose all objects but main */ bool z_nodeflib : 1; /* Don't search default library path */ + bool z_global : 1; /* Make the object global */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ bool on_fini_list: 1; /* Object is already on fini list. */ From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 09:09:37 2015 Return-Path: Delivered-To: svn-src-all@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 38D47688; Wed, 15 Apr 2015 09:09:37 +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 20627A61; Wed, 15 Apr 2015 09:09:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3F99bY4048759; Wed, 15 Apr 2015 09:09:37 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F99LFB048690; Wed, 15 Apr 2015 09:09:21 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201504150909.t3F99LFB048690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Wed, 15 Apr 2015 09:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 09:09:37 -0000 Author: tijl Date: Wed Apr 15 09:09:20 2015 New Revision: 281550 URL: https://svnweb.freebsd.org/changeset/base/281550 Log: Remove the const qualifier from iconv(3) to comply with POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099 Exp-run by: antoine MFC after: 2 weeks Modified: head/UPDATING head/bin/csh/config.h head/contrib/smbfs/include/netsmb/smb_lib.h head/contrib/smbfs/lib/smb/nls.c head/contrib/smbfs/lib/smb/print.c head/contrib/smbfs/lib/smb/rq.c head/include/iconv.h head/lib/libarchive/Makefile head/lib/libc/iconv/__iconv.c head/lib/libc/iconv/bsd_iconv.c head/lib/libc/iconv/citrus_iconv.h head/lib/libc/iconv/citrus_iconv_local.h head/lib/libc/iconv/citrus_none.c head/lib/libc/iconv/citrus_stdenc.h head/lib/libc/iconv/citrus_stdenc_local.h head/lib/libc/iconv/citrus_stdenc_template.h head/lib/libc/iconv/iconv-internal.h head/lib/libc/iconv/iconv.3 head/lib/libc/iconv/iconv.c head/lib/libc/iconv/iconv_compat.c head/lib/libc/locale/cXXrtomb_iconv.h head/lib/libc/locale/mbrtocXX_iconv.h head/lib/libiconv_modules/BIG5/citrus_big5.c head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c head/lib/libiconv_modules/EUC/citrus_euc.c head/lib/libiconv_modules/EUCTW/citrus_euctw.c head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c head/lib/libiconv_modules/HZ/citrus_hz.c head/lib/libiconv_modules/ISO2022/citrus_iso2022.c head/lib/libiconv_modules/JOHAB/citrus_johab.c head/lib/libiconv_modules/MSKanji/citrus_mskanji.c head/lib/libiconv_modules/UES/citrus_ues.c head/lib/libiconv_modules/UTF1632/citrus_utf1632.c head/lib/libiconv_modules/UTF7/citrus_utf7.c head/lib/libiconv_modules/UTF8/citrus_utf8.c head/lib/libiconv_modules/VIQR/citrus_viqr.c head/lib/libiconv_modules/ZW/citrus_zw.c head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c head/lib/libkiconv/xlat16_iconv.c head/sys/sys/param.h head/usr.bin/iconv/iconv.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Apr 15 08:16:34 2015 (r281549) +++ head/UPDATING Wed Apr 15 09:09:20 2015 (r281550) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150415: + The const qualifier has been removed from iconv(3) to comply with + POSIX. The ports tree is aware of this from r384038 onwards. + 20150324: From legacy ata(4) driver was removed support for SATA controllers supported by more functional drivers ahci(4), siis(4) and mvs(4). Modified: head/bin/csh/config.h ============================================================================== --- head/bin/csh/config.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/bin/csh/config.h Wed Apr 15 09:09:20 2015 (r281550) @@ -198,7 +198,7 @@ #define HAVE_WCWIDTH 1 /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Support NLS. */ #define NLS 1 Modified: head/contrib/smbfs/include/netsmb/smb_lib.h ============================================================================== --- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015 (r281550) @@ -191,7 +191,7 @@ int smb_ctx_readrc(struct smb_ctx *); int smb_ctx_resolve(struct smb_ctx *); int smb_ctx_setflags(struct smb_ctx *, int, int, int); -int smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*); +int smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*); int smb_smb_close_print_file(struct smb_ctx *, smbfh); int smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *); @@ -204,8 +204,8 @@ int smb_rq_init(struct smb_ctx *, u_cha void smb_rq_done(struct smb_rq *); void smb_rq_wend(struct smb_rq *); int smb_rq_simple(struct smb_rq *); -int smb_rq_dmem(struct mbdata *, const char *, size_t); -int smb_rq_dstring(struct mbdata *, const char *); +int smb_rq_dmem(struct mbdata *, char *, size_t); +int smb_rq_dstring(struct mbdata *, char *); int smb_t2_request(struct smb_ctx *, int, int, const char *, int, void *, int, void *, int *, void *, int *, void *); @@ -246,10 +246,10 @@ extern u_char nls_lower[256], nls_upper[ int nls_setrecode(const char *, const char *); int nls_setlocale(const char *); -char* nls_str_toext(char *, const char *); -char* nls_str_toloc(char *, const char *); -void* nls_mem_toext(void *, const void *, int); -void* nls_mem_toloc(void *, const void *, int); +char* nls_str_toext(char *, char *); +char* nls_str_toloc(char *, char *); +void* nls_mem_toext(void *, void *, int); +void* nls_mem_toloc(void *, void *, int); char* nls_str_upper(char *, const char *); char* nls_str_lower(char *, const char *); Modified: head/contrib/smbfs/lib/smb/nls.c ============================================================================== --- head/contrib/smbfs/lib/smb/nls.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/contrib/smbfs/lib/smb/nls.c Wed Apr 15 09:09:20 2015 (r281550) @@ -102,7 +102,7 @@ nls_setrecode(const char *local, const c } char * -nls_str_toloc(char *dst, const char *src) +nls_str_toloc(char *dst, char *src) { #ifdef HAVE_ICONV char *p = dst; @@ -125,7 +125,7 @@ nls_str_toloc(char *dst, const char *src } char * -nls_str_toext(char *dst, const char *src) +nls_str_toext(char *dst, char *src) { #ifdef HAVE_ICONV char *p = dst; @@ -148,11 +148,11 @@ nls_str_toext(char *dst, const char *src } void * -nls_mem_toloc(void *dst, const void *src, int size) +nls_mem_toloc(void *dst, void *src, int size) { #ifdef HAVE_ICONV char *p = dst; - const char *s = src; + char *s = src; size_t inlen, outlen; if (size == 0) @@ -174,11 +174,11 @@ nls_mem_toloc(void *dst, const void *src } void * -nls_mem_toext(void *dst, const void *src, int size) +nls_mem_toext(void *dst, void *src, int size) { #ifdef HAVE_ICONV char *p = dst; - const char *s = src; + char *s = src; size_t inlen, outlen; if (size == 0) Modified: head/contrib/smbfs/lib/smb/print.c ============================================================================== --- head/contrib/smbfs/lib/smb/print.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/contrib/smbfs/lib/smb/print.c Wed Apr 15 09:09:20 2015 (r281550) @@ -54,7 +54,7 @@ int smb_smb_open_print_file(struct smb_ctx *ctx, int setuplen, int mode, - const char *ident, smbfh *fhp) + char *ident, smbfh *fhp) { struct smb_rq *rqp; struct mbdata *mbp; Modified: head/contrib/smbfs/lib/smb/rq.c ============================================================================== --- head/contrib/smbfs/lib/smb/rq.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/contrib/smbfs/lib/smb/rq.c Wed Apr 15 09:09:20 2015 (r281550) @@ -86,7 +86,7 @@ smb_rq_wend(struct smb_rq *rqp) } int -smb_rq_dmem(struct mbdata *mbp, const char *src, size_t size) +smb_rq_dmem(struct mbdata *mbp, char *src, size_t size) { struct mbuf *m; char * dst; @@ -118,7 +118,7 @@ smb_rq_dmem(struct mbdata *mbp, const ch } int -smb_rq_dstring(struct mbdata *mbp, const char *s) +smb_rq_dstring(struct mbdata *mbp, char *s) { return smb_rq_dmem(mbp, s, strlen(s) + 1); } Modified: head/include/iconv.h ============================================================================== --- head/include/iconv.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/include/iconv.h Wed Apr 15 09:09:20 2015 (r281550) @@ -53,7 +53,7 @@ typedef struct __tag_iconv_t *iconv_t; __BEGIN_DECLS iconv_t iconv_open(const char *, const char *); -size_t iconv(iconv_t, const char ** __restrict, +size_t iconv(iconv_t, char ** __restrict, size_t * __restrict, char ** __restrict, size_t * __restrict); int iconv_close(iconv_t); @@ -62,7 +62,7 @@ int iconv_close(iconv_t); */ int __iconv_get_list(char ***, size_t *, __iconv_bool); void __iconv_free_list(char **, size_t); -size_t __iconv(iconv_t, const char **, size_t *, char **, +size_t __iconv(iconv_t, char **, size_t *, char **, size_t *, __uint32_t, size_t *); #define __ICONV_F_HIDE_INVALID 0x0001 Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libarchive/Makefile Wed Apr 15 09:09:20 2015 (r281550) @@ -25,7 +25,7 @@ LIBADD+= md .if ${MK_ICONV} != "no" # TODO: This can be changed back to CFLAGS once iconv works correctly # with statically linked binaries. -SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const +SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST= .endif .if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \ Modified: head/lib/libc/iconv/__iconv.c ============================================================================== --- head/lib/libc/iconv/__iconv.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/__iconv.c Wed Apr 15 09:09:20 2015 (r281550) @@ -31,7 +31,7 @@ #include "iconv-internal.h" size_t -__iconv(iconv_t a, const char **b, size_t *c, char **d, +__iconv(iconv_t a, char **b, size_t *c, char **d, size_t *e, __uint32_t f, size_t *g) { return __bsd___iconv(a, b, c, d, e, f, g); Modified: head/lib/libc/iconv/bsd_iconv.c ============================================================================== --- head/lib/libc/iconv/bsd_iconv.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/bsd_iconv.c Wed Apr 15 09:09:20 2015 (r281550) @@ -120,7 +120,7 @@ __bsd_iconv_close(iconv_t handle) } size_t -__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) +__bsd_iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout) { size_t ret; int err; @@ -141,7 +141,7 @@ __bsd_iconv(iconv_t handle, const char * } size_t -__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out, +__bsd___iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout, uint32_t flags, size_t *invalids) { size_t ret; Modified: head/lib/libc/iconv/citrus_iconv.h ============================================================================== --- head/lib/libc/iconv/citrus_iconv.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/citrus_iconv.h Wed Apr 15 09:09:20 2015 (r281550) @@ -52,7 +52,7 @@ __END_DECLS */ static __inline int _citrus_iconv_convert(struct _citrus_iconv * __restrict cv, - const char * __restrict * __restrict in, size_t * __restrict inbytes, + char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags, size_t * __restrict nresults) { Modified: head/lib/libc/iconv/citrus_iconv_local.h ============================================================================== --- head/lib/libc/iconv/citrus_iconv_local.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/citrus_iconv_local.h Wed Apr 15 09:09:20 2015 (r281550) @@ -46,7 +46,7 @@ static void _citrus_##_m_##_iconv_unini (struct _citrus_iconv_shared *); \ static int _citrus_##_m_##_iconv_convert \ (struct _citrus_iconv * __restrict, \ - const char * __restrict * __restrict, \ + char * __restrict * __restrict, \ size_t * __restrict, \ char * __restrict * __restrict, \ size_t * __restrict outbytes, \ @@ -75,7 +75,7 @@ typedef void (*_citrus_iconv_uninit_shar (struct _citrus_iconv_shared *); typedef int (*_citrus_iconv_convert_t) (struct _citrus_iconv * __restrict, - const char *__restrict* __restrict, size_t * __restrict, + char *__restrict* __restrict, size_t * __restrict, char * __restrict * __restrict, size_t * __restrict, uint32_t, size_t * __restrict); typedef int (*_citrus_iconv_init_context_t)(struct _citrus_iconv *); Modified: head/lib/libc/iconv/citrus_none.c ============================================================================== --- head/lib/libc/iconv/citrus_none.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/citrus_none.c Wed Apr 15 09:09:20 2015 (r281550) @@ -83,7 +83,7 @@ _citrus_NONE_stdenc_init_state(struct _c static int _citrus_NONE_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce __unused, - _csid_t *csid, _index_t *idx, const char **s, size_t n, + _csid_t *csid, _index_t *idx, char **s, size_t n, void *ps __unused, size_t *nresult, struct iconv_hooks *hooks) { @@ -159,7 +159,7 @@ _citrus_NONE_stdenc_cstomb(struct _citru static int _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused, - _wc_t * __restrict pwc, const char ** __restrict s, size_t n, + _wc_t * __restrict pwc, char ** __restrict s, size_t n, void * __restrict pspriv __unused, size_t * __restrict nresult, struct iconv_hooks *hooks) { Modified: head/lib/libc/iconv/citrus_stdenc.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/citrus_stdenc.h Wed Apr 15 09:09:20 2015 (r281550) @@ -69,7 +69,7 @@ _citrus_stdenc_init_state(struct _citrus static __inline int _citrus_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce, _citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx, - const char ** __restrict s, size_t n, void * __restrict ps, + char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { Modified: head/lib/libc/iconv/citrus_stdenc_local.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc_local.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/citrus_stdenc_local.h Wed Apr 15 09:09:20 2015 (r281550) @@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtoc (struct _citrus_stdenc * __restrict, \ _citrus_csid_t * __restrict, \ _citrus_index_t * __restrict, \ - const char ** __restrict, size_t, \ + char ** __restrict, size_t, \ void * __restrict, size_t * __restrict, \ struct iconv_hooks *); \ static int _citrus_##_e_##_stdenc_cstomb \ @@ -66,7 +66,7 @@ static int _citrus_##_e_##_stdenc_cstom static int _citrus_##_e_##_stdenc_mbtowc \ (struct _citrus_stdenc * __restrict, \ _citrus_wc_t * __restrict, \ - const char ** __restrict, size_t, \ + char ** __restrict, size_t, \ void * __restrict, size_t * __restrict, \ struct iconv_hooks *); \ static int _citrus_##_e_##_stdenc_wctomb \ @@ -106,7 +106,7 @@ typedef int (*_citrus_stdenc_init_state_ typedef int (*_citrus_stdenc_mbtocs_t) (struct _citrus_stdenc * __restrict, _citrus_csid_t * __restrict, _citrus_index_t * __restrict, - const char ** __restrict, size_t, + char ** __restrict, size_t, void * __restrict, size_t * __restrict, struct iconv_hooks *); typedef int (*_citrus_stdenc_cstomb_t) @@ -116,7 +116,7 @@ typedef int (*_citrus_stdenc_cstomb_t) typedef int (*_citrus_stdenc_mbtowc_t) (struct _citrus_stdenc * __restrict, _citrus_wc_t * __restrict, - const char ** __restrict, size_t, + char ** __restrict, size_t, void * __restrict, size_t * __restrict, struct iconv_hooks *); typedef int (*_citrus_stdenc_wctomb_t) Modified: head/lib/libc/iconv/citrus_stdenc_template.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc_template.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/citrus_stdenc_template.h Wed Apr 15 09:09:20 2015 (r281550) @@ -112,7 +112,7 @@ _FUNCNAME(stdenc_init_state)(struct _cit static int _FUNCNAME(stdenc_mbtocs)(struct _citrus_stdenc * __restrict ce, _citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx, - const char ** __restrict s, size_t n, void * __restrict ps, + char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { wchar_t wc; @@ -151,7 +151,7 @@ _FUNCNAME(stdenc_cstomb)(struct _citrus_ static int _FUNCNAME(stdenc_mbtowc)(struct _citrus_stdenc * __restrict ce, - _citrus_wc_t * __restrict wc, const char ** __restrict s, size_t n, + _citrus_wc_t * __restrict wc, char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { Modified: head/lib/libc/iconv/iconv-internal.h ============================================================================== --- head/lib/libc/iconv/iconv-internal.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/iconv-internal.h Wed Apr 15 09:09:20 2015 (r281550) @@ -29,11 +29,11 @@ /* * Interal prototypes for our back-end functions. */ -size_t __bsd___iconv(iconv_t, const char **, size_t *, char **, +size_t __bsd___iconv(iconv_t, char **, size_t *, char **, size_t *, __uint32_t, size_t *); void __bsd___iconv_free_list(char **, size_t); int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool); -size_t __bsd_iconv(iconv_t, const char ** __restrict, +size_t __bsd_iconv(iconv_t, char ** __restrict, size_t * __restrict, char ** __restrict, size_t * __restrict); const char *__bsd_iconv_canonicalize(const char *); Modified: head/lib/libc/iconv/iconv.3 ============================================================================== --- head/lib/libc/iconv/iconv.3 Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/iconv.3 Wed Apr 15 09:09:20 2015 (r281550) @@ -48,7 +48,7 @@ .Ft size_t .Fn iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" .Ft size_t -.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" +.Fn __iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" .Sh DESCRIPTION The .Fn iconv_open Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/iconv.c Wed Apr 15 09:09:20 2015 (r281550) @@ -31,7 +31,7 @@ #include "iconv-internal.h" size_t -iconv(iconv_t a, const char ** __restrict b, +iconv(iconv_t a, char ** __restrict b, size_t * __restrict c, char ** __restrict d, size_t * __restrict e) { Modified: head/lib/libc/iconv/iconv_compat.c ============================================================================== --- head/lib/libc/iconv/iconv_compat.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/iconv/iconv_compat.c Wed Apr 15 09:09:20 2015 (r281550) @@ -37,7 +37,7 @@ #include "iconv-internal.h" size_t -__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d, +__iconv_compat(iconv_t a, char ** b, size_t * c, char ** d, size_t * e, __uint32_t f, size_t *g) { return __bsd___iconv(a, b, c, d, e, f, g); @@ -56,7 +56,7 @@ __iconv_get_list_compat(char ***a, size_ } size_t -iconv_compat(iconv_t a, const char ** __restrict b, +iconv_compat(iconv_t a, char ** __restrict b, size_t * __restrict c, char ** __restrict d, size_t * __restrict e) { Modified: head/lib/libc/locale/cXXrtomb_iconv.h ============================================================================== --- head/lib/libc/locale/cXXrtomb_iconv.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/locale/cXXrtomb_iconv.h Wed Apr 15 09:09:20 2015 (r281550) @@ -57,8 +57,7 @@ cXXrtomb_l(char * __restrict s, charXX_t { _ConversionState *cs; struct _citrus_iconv *handle; - const char *src; - char *dst; + char *src, *dst; size_t srcleft, dstleft, invlen; int err; Modified: head/lib/libc/locale/mbrtocXX_iconv.h ============================================================================== --- head/lib/libc/locale/mbrtocXX_iconv.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libc/locale/mbrtocXX_iconv.h Wed Apr 15 09:09:20 2015 (r281550) @@ -99,8 +99,7 @@ mbrtocXX_l(charXX_t * __restrict pc, con /* Convert as few characters to the dst buffer as possible. */ for (i = 0; ; i++) { - const char *src; - char *dst; + char *src, *dst; size_t srcleft, dstleft, invlen; int err; Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- head/lib/libiconv_modules/BIG5/citrus_big5.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/BIG5/citrus_big5.c Wed Apr 15 09:09:20 2015 (r281550) @@ -269,12 +269,12 @@ static int /*ARGSUSED*/ _citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei, wchar_t * __restrict pwc, - const char ** __restrict s, size_t n, + char ** __restrict s, size_t n, _BIG5State * __restrict psenc, size_t * __restrict nresult) { wchar_t wchar; - const char *s0; + char *s0; int c, chlenbak; s0 = *s; Modified: head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c ============================================================================== --- head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Wed Apr 15 09:09:20 2015 (r281550) @@ -165,10 +165,10 @@ is_94charset(int c) static int /*ARGSUSED*/ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _DECHanyuState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wc; int ch; Modified: head/lib/libiconv_modules/EUC/citrus_euc.c ============================================================================== --- head/lib/libiconv_modules/EUC/citrus_euc.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/EUC/citrus_euc.c Wed Apr 15 09:09:20 2015 (r281550) @@ -190,12 +190,12 @@ _citrus_EUC_unpack_state(_EUCEncodingInf #endif static int -_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s, +_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, char **s, size_t n, _EUCState *psenc, size_t *nresult) { wchar_t wchar; int c, chlenbak, cs, len; - const char *s0, *s1 = NULL; + char *s0, *s1 = NULL; s0 = *s; Modified: head/lib/libiconv_modules/EUCTW/citrus_euctw.c ============================================================================== --- head/lib/libiconv_modules/EUCTW/citrus_euctw.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/EUCTW/citrus_euctw.c Wed Apr 15 09:09:20 2015 (r281550) @@ -176,10 +176,10 @@ _citrus_EUCTW_encoding_module_uninit(_EU static int _citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _EUCTWState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wchar; int c, chlenbak, cs; Modified: head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c ============================================================================== --- head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Wed Apr 15 09:09:20 2015 (r281550) @@ -149,10 +149,10 @@ _mb_count(wchar_t v) static int _citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _GBK2KState * __restrict psenc, size_t * __restrict nresult) { - const char *s0, *s1; + char *s0, *s1; wchar_t wc; int chlenbak, len; Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Wed Apr 15 09:09:20 2015 (r281550) @@ -175,13 +175,13 @@ _citrus_HZ_unpack_state(_HZEncodingInfo static int _citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _HZState * __restrict psenc, size_t * __restrict nresult) { escape_t *candidate, *init; graphic_t *graphic; const range_t *range; - const char *s0; + char *s0; wchar_t wc; int bit, ch, head, len, tail; Modified: head/lib/libiconv_modules/ISO2022/citrus_iso2022.c ============================================================================== --- head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Wed Apr 15 09:09:20 2015 (r281550) @@ -574,7 +574,7 @@ terminate: static wchar_t _ISO2022_sgetwchar(_ISO2022EncodingInfo * __restrict ei __unused, - const char * __restrict string, size_t n, const char ** __restrict result, + char * __restrict string, size_t n, char ** __restrict result, _ISO2022State * __restrict psenc) { const struct seqtable *sp; @@ -842,10 +842,10 @@ asis: static int _citrus_ISO2022_mbrtowc_priv(_ISO2022EncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _ISO2022State * __restrict psenc, size_t * __restrict nresult) { - const char *p, *result, *s0; + char *p, *result, *s0; wchar_t wchar; int c, chlenbak; Modified: head/lib/libiconv_modules/JOHAB/citrus_johab.c ============================================================================== --- head/lib/libiconv_modules/JOHAB/citrus_johab.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/JOHAB/citrus_johab.c Wed Apr 15 09:09:20 2015 (r281550) @@ -145,10 +145,10 @@ ishanja(int l, int t) static int /*ARGSUSED*/ _citrus_JOHAB_mbrtowc_priv(_JOHABEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _JOHABState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; int l, t; if (*s == NULL) { Modified: head/lib/libiconv_modules/MSKanji/citrus_mskanji.c ============================================================================== --- head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Wed Apr 15 09:09:20 2015 (r281550) @@ -153,10 +153,10 @@ _citrus_MSKanji_unpack_state(_MSKanjiEnc static int /*ARGSUSED*/ _citrus_MSKanji_mbrtowc_priv(_MSKanjiEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _MSKanjiState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wchar; int chlenbak, len; Modified: head/lib/libiconv_modules/UES/citrus_ues.c ============================================================================== --- head/lib/libiconv_modules/UES/citrus_ues.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/UES/citrus_ues.c Wed Apr 15 09:09:20 2015 (r281550) @@ -185,10 +185,10 @@ is_basic(wchar_t wc) static int _citrus_UES_mbrtowc_priv(_UESEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _UESState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; int ch, head, num, tail; wchar_t hi, wc; Modified: head/lib/libiconv_modules/UTF1632/citrus_utf1632.c ============================================================================== --- head/lib/libiconv_modules/UTF1632/citrus_utf1632.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/UTF1632/citrus_utf1632.c Wed Apr 15 09:09:20 2015 (r281550) @@ -97,9 +97,9 @@ _citrus_UTF1632_init_state(_UTF1632Encod static int _citrus_UTF1632_mbrtowc_priv(_UTF1632EncodingInfo *ei, wchar_t *pwc, - const char **s, size_t n, _UTF1632State *psenc, size_t *nresult) + char **s, size_t n, _UTF1632State *psenc, size_t *nresult) { - const char *s0; + char *s0; size_t result; wchar_t wc = L'\0'; int chlenbak, endian, needlen; Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c ============================================================================== --- head/lib/libiconv_modules/UTF7/citrus_utf7.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/UTF7/citrus_utf7.c Wed Apr 15 09:09:20 2015 (r281550) @@ -151,11 +151,11 @@ static const char spaces[] = " \t\r\n"; static int _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei, - uint16_t * __restrict u16, const char ** __restrict s, size_t n, + uint16_t * __restrict u16, char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { _UTF7State sv; - const char *s0; + char *s0; int done, i, len; s0 = *s; @@ -244,7 +244,7 @@ ilseq: static int _citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { uint32_t u32; Modified: head/lib/libiconv_modules/UTF8/citrus_utf8.c ============================================================================== --- head/lib/libiconv_modules/UTF8/citrus_utf8.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/UTF8/citrus_utf8.c Wed Apr 15 09:09:20 2015 (r281550) @@ -177,10 +177,10 @@ _citrus_UTF8_unpack_state(_UTF8EncodingI #endif static int -_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s, +_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, char **s, size_t n, _UTF8State *psenc, size_t *nresult) { - const char *s0; + char *s0; wchar_t wchar; int i; uint8_t c; Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Wed Apr 15 09:09:20 2015 (r281550) @@ -252,11 +252,11 @@ _citrus_VIQR_unpack_state(_VIQREncodingI static int _citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _VIQRState * __restrict psenc, size_t * __restrict nresult) { mnemonic_t *m, *m0; - const char *s0; + char *s0; wchar_t wc; ssize_t i; int ch, escape; Modified: head/lib/libiconv_modules/ZW/citrus_zw.c ============================================================================== --- head/lib/libiconv_modules/ZW/citrus_zw.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/ZW/citrus_zw.c Wed Apr 15 09:09:20 2015 (r281550) @@ -107,10 +107,10 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo static int _citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char **__restrict s, size_t n, + wchar_t * __restrict pwc, char **__restrict s, size_t n, _ZWState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wc; int ch, len; Modified: head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c ============================================================================== --- head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Wed Apr 15 09:09:20 2015 (r281550) @@ -97,7 +97,7 @@ _citrus_iconv_none_iconv_uninit_context( static int /*ARGSUSED*/ _citrus_iconv_none_iconv_convert(struct _citrus_iconv * __restrict ci __unused, - const char * __restrict * __restrict in, size_t * __restrict inbytes, + char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags __unused, size_t * __restrict invalids) { Modified: head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c ============================================================================== --- head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Wed Apr 15 09:09:20 2015 (r281550) @@ -104,7 +104,7 @@ init_encoding_state(struct _citrus_iconv static __inline int mbtocsx(struct _citrus_iconv_std_encoding *se, - _csid_t *csid, _index_t *idx, const char **s, size_t n, size_t *nresult, + _csid_t *csid, _index_t *idx, char **s, size_t n, size_t *nresult, struct iconv_hooks *hooks) { @@ -461,7 +461,7 @@ _citrus_iconv_std_iconv_uninit_context(s static int _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv, - const char * __restrict * __restrict in, size_t * __restrict inbytes, + char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags, size_t * __restrict invalids) { @@ -469,7 +469,7 @@ _citrus_iconv_std_iconv_convert(struct _ struct _citrus_iconv_std_context *sc = cv->cv_closure; _csid_t csid; _index_t idx; - const char *tmpin; + char *tmpin; size_t inval, szrin, szrout; int ret, state = 0; Modified: head/lib/libkiconv/xlat16_iconv.c ============================================================================== --- head/lib/libkiconv/xlat16_iconv.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/lib/libkiconv/xlat16_iconv.c Wed Apr 15 09:09:20 2015 (r281550) @@ -62,7 +62,7 @@ static int chklocale(int, const char *); typedef void *iconv_t; static int my_iconv_init(void); static iconv_t (*my_iconv_open)(const char *, const char *); -static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); +static size_t (*my_iconv)(iconv_t, char **, size_t *, char **, size_t *); static int (*my_iconv_close)(iconv_t); #else #include @@ -71,7 +71,7 @@ static int (*my_iconv_close)(iconv_t); #define my_iconv iconv #define my_iconv_close iconv_close #endif -static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); +static size_t my_iconv_char(iconv_t, u_char **, size_t *, u_char **, size_t *); int kiconv_add_xlat16_cspair(const char *tocode, const char *fromcode, int flag) @@ -221,8 +221,8 @@ kiconv_xlat16_open(const char *tocode, c src[0] = (u_char)(c >> 8); src[1] = (u_char)c; - ret = my_iconv_char(cd, (const u_char **)&srcp, - &inbytesleft, &dstp, &outbytesleft); + ret = my_iconv_char(cd, &srcp, &inbytesleft, + &dstp, &outbytesleft); if (ret == -1) { table[us] = 0; continue; @@ -338,11 +338,10 @@ my_iconv_init(void) #endif static size_t -my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, +my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf, size_t * olen) { - const u_char *sp; - u_char *dp, ilocal[3], olocal[3]; + u_char *sp, *dp, ilocal[3], olocal[3]; u_char c1, c2; int ret; size_t ir, or; @@ -352,7 +351,7 @@ my_iconv_char(iconv_t cd, const u_char * ir = *ilen; bzero(*obuf, *olen); - ret = my_iconv(cd, (const char **)&sp, ilen, (char **)&dp, olen); + ret = my_iconv(cd, (char **)&sp, ilen, (char **)&dp, olen); c1 = (*obuf)[0]; c2 = (*obuf)[1]; @@ -375,7 +374,7 @@ my_iconv_char(iconv_t cd, const u_char * sp = ilocal; dp = olocal; - if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) { + if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) { if (olocal[0] != c1) return (ret); @@ -429,7 +428,7 @@ my_iconv_char(iconv_t cd, const u_char * sp = ilocal + 1; dp = olocal; - if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) { + if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) { if (olocal[0] == c2) /* * inbuf is a single byte char Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/sys/sys/param.h Wed Apr 15 09:09:20 2015 (r281550) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100068 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100069 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.bin/iconv/iconv.c ============================================================================== --- head/usr.bin/iconv/iconv.c Wed Apr 15 08:16:34 2015 (r281549) +++ head/usr.bin/iconv/iconv.c Wed Apr 15 09:09:20 2015 (r281550) @@ -71,9 +71,8 @@ do_conv(FILE *fp, const char *from, cons bool hide_invalid) { iconv_t cd; - char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *out; + char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *in, *out; unsigned long long invalids; - const char *in; size_t inbytes, outbytes, ret; if ((cd = iconv_open(to, from)) == (iconv_t)-1) From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 09:13:13 2015 Return-Path: Delivered-To: svn-src-all@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 64E12858; Wed, 15 Apr 2015 09:13:13 +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 4F6A2B4F; Wed, 15 Apr 2015 09:13:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3F9DDlE052822; Wed, 15 Apr 2015 09:13:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F9DBxe052815; Wed, 15 Apr 2015 09:13:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201504150913.t3F9DBxe052815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Apr 2015 09:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281551 - in head/sys: compat/freebsd32 compat/linprocfs kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 09:13:13 -0000 Author: trasz Date: Wed Apr 15 09:13:11 2015 New Revision: 281551 URL: https://svnweb.freebsd.org/changeset/base/281551 Log: Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This adds missing jail and MAC checks. Differential Revision: https://reviews.freebsd.org/D2193 Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linprocfs/linprocfs.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 15 09:09:20 2015 (r281550) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 15 09:13:11 2015 (r281551) @@ -253,9 +253,8 @@ freebsd4_freebsd32_getfsstat(struct thre count = uap->bufsize / sizeof(struct statfs32); size = count * sizeof(struct statfs); - error = kern_getfsstat(td, &buf, size, UIO_SYSSPACE, uap->flags); + error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags); if (size > 0) { - count = td->td_retval[0]; sp = buf; while (count > 0 && error == 0) { copy_statfs(sp, &stat32); @@ -266,6 +265,8 @@ freebsd4_freebsd32_getfsstat(struct thre } free(buf, M_TEMP); } + if (error == 0) + td->td_retval[0] = count; return (error); } #endif Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Apr 15 09:09:20 2015 (r281550) +++ head/sys/compat/linprocfs/linprocfs.c Wed Apr 15 09:13:11 2015 (r281551) @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include #include @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -326,11 +327,12 @@ static int linprocfs_domtab(PFS_FILL_ARGS) { struct nameidata nd; - struct mount *mp; const char *lep; char *dlep, *flep, *mntto, *mntfrom, *fstype; size_t lep_len; int error; + struct statfs *buf, *sp; + size_t count; /* resolve symlinks etc. in the emulation tree prefix */ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td); @@ -344,20 +346,26 @@ linprocfs_domtab(PFS_FILL_ARGS) } lep_len = strlen(lep); - mtx_lock(&mountlist_mtx); - error = 0; - TAILQ_FOREACH(mp, &mountlist, mnt_list) { + buf = NULL; + error = kern_getfsstat(td, &buf, SIZE_T_MAX, &count, + UIO_SYSSPACE, MNT_WAIT); + if (error != 0) { + free(buf, M_TEMP); + free(flep, M_TEMP); + return (error); + } + + for (sp = buf; count > 0; sp++, count--) { /* determine device name */ - mntfrom = mp->mnt_stat.f_mntfromname; + mntfrom = sp->f_mntfromname; /* determine mount point */ - mntto = mp->mnt_stat.f_mntonname; - if (strncmp(mntto, lep, lep_len) == 0 && - mntto[lep_len] == '/') + mntto = sp->f_mntonname; + if (strncmp(mntto, lep, lep_len) == 0 && mntto[lep_len] == '/') mntto += lep_len; /* determine fs type */ - fstype = mp->mnt_stat.f_fstypename; + fstype = sp->f_fstypename; if (strcmp(fstype, pn->pn_info->pi_name) == 0) mntfrom = fstype = "proc"; else if (strcmp(fstype, "procfs") == 0) @@ -365,16 +373,16 @@ linprocfs_domtab(PFS_FILL_ARGS) if (strcmp(fstype, "linsysfs") == 0) { sbuf_printf(sb, "/sys %s sysfs %s", mntto, - mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw"); + sp->f_flags & MNT_RDONLY ? "ro" : "rw"); } else { /* For Linux msdosfs is called vfat */ if (strcmp(fstype, "msdosfs") == 0) fstype = "vfat"; sbuf_printf(sb, "%s %s %s %s", mntfrom, mntto, fstype, - mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw"); + sp->f_flags & MNT_RDONLY ? "ro" : "rw"); } #define ADD_OPTION(opt, name) \ - if (mp->mnt_stat.f_flags & (opt)) sbuf_printf(sb, "," name); + if (sp->f_flags & (opt)) sbuf_printf(sb, "," name); ADD_OPTION(MNT_SYNCHRONOUS, "sync"); ADD_OPTION(MNT_NOEXEC, "noexec"); ADD_OPTION(MNT_NOSUID, "nosuid"); @@ -387,7 +395,8 @@ linprocfs_domtab(PFS_FILL_ARGS) /* a real Linux mtab will also show NFS options */ sbuf_printf(sb, " 0 0\n"); } - mtx_unlock(&mountlist_mtx); + + free(buf, M_TEMP); free(flep, M_TEMP); return (error); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Apr 15 09:09:20 2015 (r281550) +++ head/sys/kern/vfs_syscalls.c Wed Apr 15 09:13:11 2015 (r281551) @@ -434,9 +434,14 @@ sys_getfsstat(td, uap) int flags; } */ *uap; { + size_t count; + int error; - return (kern_getfsstat(td, &uap->buf, uap->bufsize, UIO_USERSPACE, - uap->flags)); + error = kern_getfsstat(td, &uap->buf, uap->bufsize, &count, + UIO_USERSPACE, uap->flags); + if (error == 0) + td->td_retval[0] = count; + return (error); } /* @@ -446,7 +451,7 @@ sys_getfsstat(td, uap) */ int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, - enum uio_seg bufseg, int flags) + size_t *countp, enum uio_seg bufseg, int flags) { struct mount *mp, *nmp; struct statfs *sfsp, *sp, sb; @@ -533,9 +538,9 @@ kern_getfsstat(struct thread *td, struct } mtx_unlock(&mountlist_mtx); if (sfsp && count > maxcount) - td->td_retval[0] = maxcount; + *countp = maxcount; else - td->td_retval[0] = count; + *countp = count; return (0); } @@ -624,9 +629,9 @@ freebsd4_getfsstat(td, uap) count = uap->bufsize / sizeof(struct ostatfs); size = count * sizeof(struct statfs); - error = kern_getfsstat(td, &buf, size, UIO_SYSSPACE, uap->flags); + error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, + uap->flags); if (size > 0) { - count = td->td_retval[0]; sp = buf; while (count > 0 && error == 0) { cvtstatfs(sp, &osb); @@ -637,6 +642,8 @@ freebsd4_getfsstat(td, uap) } free(buf, M_TEMP); } + if (error == 0) + td->td_retval[0] = count; return (error); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed Apr 15 09:09:20 2015 (r281550) +++ head/sys/sys/syscallsubr.h Wed Apr 15 09:13:11 2015 (r281551) @@ -104,7 +104,7 @@ int kern_futimens(struct thread *td, int int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, long *basep, ssize_t *residp, enum uio_seg bufseg); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, - enum uio_seg bufseg, int flags); + size_t *countp, enum uio_seg bufseg, int flags); int kern_getitimer(struct thread *, u_int, struct itimerval *); int kern_getppid(struct thread *); int kern_getpeername(struct thread *td, int fd, struct sockaddr **sa, From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 09:39:54 2015 Return-Path: Delivered-To: svn-src-all@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 271E8F37; Wed, 15 Apr 2015 09:39: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 12EA5E00; Wed, 15 Apr 2015 09:39: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 t3F9drVQ063222; Wed, 15 Apr 2015 09:39:53 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3F9drjI063221; Wed, 15 Apr 2015 09:39:53 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201504150939.t3F9drjI063221@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Wed, 15 Apr 2015 09:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281552 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 09:39:54 -0000 Author: tijl Date: Wed Apr 15 09:39:52 2015 New Revision: 281552 URL: https://svnweb.freebsd.org/changeset/base/281552 Log: Point to the right location where __FreeBSD_version numbers are documented. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Apr 15 09:13:11 2015 (r281551) +++ head/sys/sys/param.h Wed Apr 15 09:39:52 2015 (r281552) @@ -50,7 +50,7 @@ * there. * Currently this lives here in the doc/ repository: * - * head/en_US.ISO8859-1/books/porters-handbook/book.xml + * head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 12:52:37 2015 Return-Path: Delivered-To: svn-src-all@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 0D14E283; Wed, 15 Apr 2015 12:52:37 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 B897FA07; Wed, 15 Apr 2015 12:52:36 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YiMnr-0001cf-Hz; Wed, 15 Apr 2015 15:52:27 +0300 Date: Wed, 15 Apr 2015 15:52:27 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281548 - in head/sys: kern sys Message-ID: <20150415125227.GP1394@zxy.spb.ru> References: <201504150813.t3F8Drjj021644@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201504150813.t3F8Drjj021644@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 12:52:37 -0000 On Wed, Apr 15, 2015 at 08:13:53AM +0000, Konstantin Belousov wrote: > The soft RLIMIT_STACK is auto-increased if possible, to satisfy the > binary' request. Is this good way (self-modify limits)? From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 12:53:06 2015 Return-Path: Delivered-To: svn-src-all@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 07CCB3C9; Wed, 15 Apr 2015 12:53:06 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 83ACDA12; Wed, 15 Apr 2015 12:53:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t3FCr2I5029206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Apr 2015 15:53:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t3FCr2iG029205; Wed, 15 Apr 2015 15:53:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 15 Apr 2015 15:53:02 +0300 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281536 - head/sys/netpfil/pf Message-ID: <20150415125302.GB883@FreeBSD.org> References: <201504141907.t3EJ7bZp044696@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201504141907.t3EJ7bZp044696@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 12:53:06 -0000 On Tue, Apr 14, 2015 at 07:07:37PM +0000, Kristof Provost wrote: K> Author: kp K> Date: Tue Apr 14 19:07:37 2015 K> New Revision: 281536 K> URL: https://svnweb.freebsd.org/changeset/base/281536 K> K> Log: K> pf: Fix forwarding detection K> K> If the direction is not PF_OUT we can never be forwarding. Some input packets K> have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound K> packets, causing panics. K> K> Equally, we need to ensure that packets were really received and not locally K> generated before trying to ip6_forward() them. K> K> Differential Revision: https://reviews.freebsd.org/D2286 K> Approved by: gnn(mentor) K> K> Modified: K> head/sys/netpfil/pf/pf.c K> K> Modified: head/sys/netpfil/pf/pf.c K> ============================================================================== K> --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015 (r281535) K> +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015 (r281536) K> @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str K> K> M_ASSERTPKTHDR(m); K> K> - if (ifp != m->m_pkthdr.rcvif) K> + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) K> fwdir = PF_FWD; The ifp argument to pf_test6() is always not NULL, so the (m->m_pkthdr.rcvif) conjunct is extraneous. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 12:54:21 2015 Return-Path: Delivered-To: svn-src-all@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 302875AA; Wed, 15 Apr 2015 12:54:21 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AB381A2C; Wed, 15 Apr 2015 12:54:20 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t3FCsIVU029232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Apr 2015 15:54:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t3FCsIj0029231; Wed, 15 Apr 2015 15:54:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 15 Apr 2015 15:54:18 +0300 From: Gleb Smirnoff To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281541 - head/sys/netinet Message-ID: <20150415125418.GC883@FreeBSD.org> References: <201504150057.t3F0vLNr014445@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201504150057.t3F0vLNr014445@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 12:54:21 -0000 On Wed, Apr 15, 2015 at 12:57:21AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Wed Apr 15 00:57:21 2015 A> New Revision: 281541 A> URL: https://svnweb.freebsd.org/changeset/base/281541 A> A> Log: A> Fix RSS build - netisr input / NETISR_IP_DIRECT is used here. A> A> Modified: A> head/sys/netinet/ip_reass.c A> A> Modified: head/sys/netinet/ip_reass.c A> ============================================================================== A> --- head/sys/netinet/ip_reass.c Wed Apr 15 00:07:21 2015 (r281540) A> +++ head/sys/netinet/ip_reass.c Wed Apr 15 00:57:21 2015 (r281541) A> @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); A> #include A> A> #include A> +#include A> #include A> A> #include The include should go under #ifdef RSS then. Why do we actually have RSS a non default option? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 13:26:02 2015 Return-Path: Delivered-To: svn-src-all@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 214CD37C; Wed, 15 Apr 2015 13:26:02 +0000 (UTC) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4829E34; Wed, 15 Apr 2015 13:26:01 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id 423BA10DB5; Wed, 15 Apr 2015 15:25:56 +0200 (CEST) Received: by vega.codepro.be (Postfix, from userid 1001) id 35C3F8C4B9; Wed, 15 Apr 2015 15:25:56 +0200 (CEST) Date: Wed, 15 Apr 2015 15:25:56 +0200 From: Kristof Provost To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281536 - head/sys/netpfil/pf Message-ID: <20150415132556.GB2058@vega.codepro.be> References: <201504141907.t3EJ7bZp044696@svn.freebsd.org> <20150415125302.GB883@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150415125302.GB883@FreeBSD.org> X-Checked-By-NSA: Probably User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 13:26:02 -0000 On 2015-04-15 15:53:02 (+0300), Gleb Smirnoff wrote: > On Tue, Apr 14, 2015 at 07:07:37PM +0000, Kristof Provost wrote: > K> Author: kp > K> Date: Tue Apr 14 19:07:37 2015 > K> New Revision: 281536 > K> URL: https://svnweb.freebsd.org/changeset/base/281536 > K> > K> Log: > K> pf: Fix forwarding detection > K> > K> If the direction is not PF_OUT we can never be forwarding. Some input packets > K> have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound > K> packets, causing panics. > K> > K> Equally, we need to ensure that packets were really received and not locally > K> generated before trying to ip6_forward() them. > K> > K> Differential Revision: https://reviews.freebsd.org/D2286 > K> Approved by: gnn(mentor) > K> > K> Modified: > K> head/sys/netpfil/pf/pf.c > K> > K> Modified: head/sys/netpfil/pf/pf.c > K> ============================================================================== > K> --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015 (r281535) > K> +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015 (r281536) > K> @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str > K> > K> M_ASSERTPKTHDR(m); > K> > K> - if (ifp != m->m_pkthdr.rcvif) > K> + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) > K> fwdir = PF_FWD; > > The ifp argument to pf_test6() is always not NULL, so the (m->m_pkthdr.rcvif) > conjunct is extraneous. > m->pkthdr.rcvif can be NULL though (e.g. when this is a locally generated packet). In that case we don't want to forward, which we'd end up doing because, as you say, ifp won't be NULL. (In other words: If m->pkthdr.rcvif is NULL we don't forward, even if ifp != m->pkthdr.rcvif.) Regards, Kristof From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 14:18:26 2015 Return-Path: Delivered-To: svn-src-all@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 EABF029E; Wed, 15 Apr 2015 14:18: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 D51E76EB; Wed, 15 Apr 2015 14:18: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 t3FEIQic095984; Wed, 15 Apr 2015 14:18:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FEIQrs095983; Wed, 15 Apr 2015 14:18:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504151418.t3FEIQrs095983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Apr 2015 14:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281554 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 14:18:27 -0000 Author: andrew Date: Wed Apr 15 14:18:25 2015 New Revision: 281554 URL: https://svnweb.freebsd.org/changeset/base/281554 Log: Ensure the userland thread and floating-point state has been saved before copying the pcb. These values may have been changed just before the call to fork and without a call to cpu_switch, where they would have been saved. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/vm_machdep.c Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed Apr 15 11:48:41 2015 (r281553) +++ head/sys/arm64/arm64/vm_machdep.c Wed Apr 15 14:18:25 2015 (r281554) @@ -47,6 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef VFP +#include +#endif + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -61,6 +65,19 @@ cpu_fork(struct thread *td1, struct proc if ((flags & RFPROC) == 0) return; + if (td1 == curthread) { + /* + * Save the tpidr_el0 and the vfp state, these normally happen + * in cpu_switch, but if userland changes these then forks + * this may not have happened. + */ + td1->td_pcb->pcb_tpidr_el0 = READ_SPECIALREG(tpidr_el0); +#ifdef VFP + if ((td1->td_pcb->pcb_fpflags & PCB_FP_STARTED) != 0) + vfp_save_state(td1); +#endif + } + pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 14:20:13 2015 Return-Path: Delivered-To: svn-src-all@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 5EF124F4; Wed, 15 Apr 2015 14:20:13 +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 48961765; Wed, 15 Apr 2015 14:20:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FEKDtt096353; Wed, 15 Apr 2015 14:20:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FEKD1Z096352; Wed, 15 Apr 2015 14:20:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504151420.t3FEKD1Z096352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Apr 2015 14:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281556 - head/libexec/rtld-elf/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 14:20:13 -0000 Author: andrew Date: Wed Apr 15 14:20:12 2015 New Revision: 281556 URL: https://svnweb.freebsd.org/changeset/base/281556 Log: Use the correct value to get the offset of the objects tls data. Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/aarch64/reloc.c Modified: head/libexec/rtld-elf/aarch64/reloc.c ============================================================================== --- head/libexec/rtld-elf/aarch64/reloc.c Wed Apr 15 14:20:03 2015 (r281555) +++ head/libexec/rtld-elf/aarch64/reloc.c Wed Apr 15 14:20:12 2015 (r281556) @@ -161,7 +161,7 @@ rtld_tlsdesc_handle_locked(struct tls_da if (def == NULL) rtld_die(); - tlsdesc->index = defobj->tlsindex + def->st_value + rela->r_addend; + tlsdesc->index = defobj->tlsoffset + def->st_value + rela->r_addend; return (tlsdesc->index); } @@ -206,7 +206,7 @@ reloc_plt(Obj_Entry *obj) case R_AARCH64_TLSDESC: if (ELF_R_SYM(rela->r_info) == 0) { where[0] = (Elf_Addr)_rtld_tlsdesc; - where[1] = obj->tlsindex + rela->r_addend; + where[1] = obj->tlsoffset + rela->r_addend; } else { where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic; where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj, From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 14:30:08 2015 Return-Path: Delivered-To: svn-src-all@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 7238B919; Wed, 15 Apr 2015 14:30:08 +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 524DA8B0; Wed, 15 Apr 2015 14:30:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FEU8Vn001184; Wed, 15 Apr 2015 14:30:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FEU8Xk001183; Wed, 15 Apr 2015 14:30:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504151430.t3FEU8Xk001183@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Apr 2015 14:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281557 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 14:30:08 -0000 Author: andrew Date: Wed Apr 15 14:30:07 2015 New Revision: 281557 URL: https://svnweb.freebsd.org/changeset/base/281557 Log: Enter a critical section when storing the vfp registers, we don't want to be preempted here as this will enter back into this function, but the hardware could be in an inconsistant state, and the vfp unit will be off when switced back to this function. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/vfp.c Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Wed Apr 15 14:20:12 2015 (r281556) +++ head/sys/arm64/arm64/vfp.c Wed Apr 15 14:30:07 2015 (r281557) @@ -88,41 +88,42 @@ vfp_save_state(struct thread *td) uint64_t fpcr, fpsr; uint32_t cpacr; + critical_enter(); /* * Only store the registers if the VFP is enabled, * i.e. return if we are trapping on FP access. */ cpacr = READ_SPECIALREG(cpacr_el1); - if ((cpacr & CPACR_FPEN_MASK) != CPACR_FPEN_TRAP_NONE) - return; - - vfp_state = td->td_pcb->pcb_vfp; - __asm __volatile( - "mrs %0, fpcr \n" - "mrs %1, fpsr \n" - "stp q0, q1, [%2, #16 * 0]\n" - "stp q2, q3, [%2, #16 * 2]\n" - "stp q4, q5, [%2, #16 * 4]\n" - "stp q6, q7, [%2, #16 * 6]\n" - "stp q8, q9, [%2, #16 * 8]\n" - "stp q10, q11, [%2, #16 * 10]\n" - "stp q12, q13, [%2, #16 * 12]\n" - "stp q14, q15, [%2, #16 * 14]\n" - "stp q16, q17, [%2, #16 * 16]\n" - "stp q18, q19, [%2, #16 * 18]\n" - "stp q20, q21, [%2, #16 * 20]\n" - "stp q22, q23, [%2, #16 * 22]\n" - "stp q24, q25, [%2, #16 * 24]\n" - "stp q26, q27, [%2, #16 * 26]\n" - "stp q28, q29, [%2, #16 * 28]\n" - "stp q30, q31, [%2, #16 * 30]\n" - : "=&r"(fpcr), "=&r"(fpsr) : "r"(vfp_state)); + if ((cpacr & CPACR_FPEN_MASK) == CPACR_FPEN_TRAP_NONE) { + vfp_state = td->td_pcb->pcb_vfp; + __asm __volatile( + "mrs %0, fpcr \n" + "mrs %1, fpsr \n" + "stp q0, q1, [%2, #16 * 0]\n" + "stp q2, q3, [%2, #16 * 2]\n" + "stp q4, q5, [%2, #16 * 4]\n" + "stp q6, q7, [%2, #16 * 6]\n" + "stp q8, q9, [%2, #16 * 8]\n" + "stp q10, q11, [%2, #16 * 10]\n" + "stp q12, q13, [%2, #16 * 12]\n" + "stp q14, q15, [%2, #16 * 14]\n" + "stp q16, q17, [%2, #16 * 16]\n" + "stp q18, q19, [%2, #16 * 18]\n" + "stp q20, q21, [%2, #16 * 20]\n" + "stp q22, q23, [%2, #16 * 22]\n" + "stp q24, q25, [%2, #16 * 24]\n" + "stp q26, q27, [%2, #16 * 26]\n" + "stp q28, q29, [%2, #16 * 28]\n" + "stp q30, q31, [%2, #16 * 30]\n" + : "=&r"(fpcr), "=&r"(fpsr) : "r"(vfp_state)); - td->td_pcb->pcb_fpcr = fpcr; - td->td_pcb->pcb_fpsr = fpsr; + td->td_pcb->pcb_fpcr = fpcr; + td->td_pcb->pcb_fpsr = fpsr; - dsb(); - vfp_disable(); + dsb(); + vfp_disable(); + } + critical_exit(); } void From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 14:30:39 2015 Return-Path: Delivered-To: svn-src-all@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 4540AA7C; Wed, 15 Apr 2015 14:30:39 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A55AF949; Wed, 15 Apr 2015 14:30:38 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t3FEUaP0029768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Apr 2015 17:30:36 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t3FEUZbn029767; Wed, 15 Apr 2015 17:30:35 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 15 Apr 2015 17:30:35 +0300 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281536 - head/sys/netpfil/pf Message-ID: <20150415143035.GF883@FreeBSD.org> References: <201504141907.t3EJ7bZp044696@svn.freebsd.org> <20150415125302.GB883@FreeBSD.org> <20150415132556.GB2058@vega.codepro.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150415132556.GB2058@vega.codepro.be> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 14:30:39 -0000 On Wed, Apr 15, 2015 at 03:25:56PM +0200, Kristof Provost wrote: K> On 2015-04-15 15:53:02 (+0300), Gleb Smirnoff wrote: K> > On Tue, Apr 14, 2015 at 07:07:37PM +0000, Kristof Provost wrote: K> > K> Author: kp K> > K> Date: Tue Apr 14 19:07:37 2015 K> > K> New Revision: 281536 K> > K> URL: https://svnweb.freebsd.org/changeset/base/281536 K> > K> K> > K> Log: K> > K> pf: Fix forwarding detection K> > K> K> > K> If the direction is not PF_OUT we can never be forwarding. Some input packets K> > K> have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound K> > K> packets, causing panics. K> > K> K> > K> Equally, we need to ensure that packets were really received and not locally K> > K> generated before trying to ip6_forward() them. K> > K> K> > K> Differential Revision: https://reviews.freebsd.org/D2286 K> > K> Approved by: gnn(mentor) K> > K> K> > K> Modified: K> > K> head/sys/netpfil/pf/pf.c K> > K> K> > K> Modified: head/sys/netpfil/pf/pf.c K> > K> ============================================================================== K> > K> --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015 (r281535) K> > K> +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015 (r281536) K> > K> @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str K> > K> K> > K> M_ASSERTPKTHDR(m); K> > K> K> > K> - if (ifp != m->m_pkthdr.rcvif) K> > K> + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) K> > K> fwdir = PF_FWD; K> > K> > The ifp argument to pf_test6() is always not NULL, so the (m->m_pkthdr.rcvif) K> > conjunct is extraneous. K> > K> m->pkthdr.rcvif can be NULL though (e.g. when this is a locally K> generated packet). In that case we don't want to forward, which we'd end K> up doing because, as you say, ifp won't be NULL. K> K> (In other words: If m->pkthdr.rcvif is NULL we don't forward, even if K> ifp != m->pkthdr.rcvif.) I'm sorry! My braino. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 14:46:46 2015 Return-Path: Delivered-To: svn-src-all@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 39057F21; Wed, 15 Apr 2015 14:46: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 22B19AD2; Wed, 15 Apr 2015 14:46: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 t3FEkjt9010093; Wed, 15 Apr 2015 14:46:45 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FEkjHH010092; Wed, 15 Apr 2015 14:46:45 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201504151446.t3FEkjHH010092@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 15 Apr 2015 14:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281558 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 14:46:46 -0000 Author: gnn Date: Wed Apr 15 14:46:45 2015 New Revision: 281558 URL: https://svnweb.freebsd.org/changeset/base/281558 Log: Minor change to the macros to make sure that if an AF is passed that is neither AF_INET6 nor AF_INET that we don't touch random bits of memory. Differential Revision: https://reviews.freebsd.org/D2291 Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Wed Apr 15 14:30:07 2015 (r281557) +++ head/sys/net/pfvar.h Wed Apr 15 14:46:45 2015 (r281558) @@ -192,21 +192,20 @@ extern struct rwlock pf_rules_lock; #define PF_AEQ(a, b, c) \ ((c == AF_INET && (a)->addr32[0] == (b)->addr32[0]) || \ - ((a)->addr32[3] == (b)->addr32[3] && \ + (c == AF_INET6 && (a)->addr32[3] == (b)->addr32[3] && \ (a)->addr32[2] == (b)->addr32[2] && \ (a)->addr32[1] == (b)->addr32[1] && \ (a)->addr32[0] == (b)->addr32[0])) \ #define PF_ANEQ(a, b, c) \ - ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \ - ((a)->addr32[3] != (b)->addr32[3] || \ - (a)->addr32[2] != (b)->addr32[2] || \ + ((a)->addr32[0] != (b)->addr32[0] || \ (a)->addr32[1] != (b)->addr32[1] || \ - (a)->addr32[0] != (b)->addr32[0])) \ + (a)->addr32[2] != (b)->addr32[2] || \ + (a)->addr32[3] != (b)->addr32[3]) \ #define PF_AZERO(a, c) \ ((c == AF_INET && !(a)->addr32[0]) || \ - (!(a)->addr32[0] && !(a)->addr32[1] && \ + (c == AF_INET6 && !(a)->addr32[0] && !(a)->addr32[1] && \ !(a)->addr32[2] && !(a)->addr32[3] )) \ #define PF_MATCHA(n, a, m, b, f) \ From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 15:31:18 2015 Return-Path: Delivered-To: svn-src-all@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 5A7438DC for ; Wed, 15 Apr 2015 15:31:18 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 3678B81 for ; Wed, 15 Apr 2015 15:31:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FFVIXs093581 for ; Wed, 15 Apr 2015 15:31:18 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t3FFVIXd093577 for svn-src-all@FreeBSD.org; Wed, 15 Apr 2015 15:31:18 GMT (envelope-from bdrewery) Received: (qmail 58775 invoked from network); 15 Apr 2015 10:31:16 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 15 Apr 2015 10:31:16 -0500 Message-ID: <552E8447.3070404@FreeBSD.org> Date: Wed, 15 Apr 2015 10:31:19 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Don Lewis CC: alc@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, clusteradm@FreeBSD.org, portmgr@FreeBSD.org Subject: Re: svn commit: r280327 - in head/sys: kern vm References: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> In-Reply-To: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wuAMPJichrBdvDXGcX2sokUTko9QaJ5jd" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 15:31:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wuAMPJichrBdvDXGcX2sokUTko9QaJ5jd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/27/2015 9:41 PM, Don Lewis wrote: > I was not seeing this problem on my older package builder running > 10.1-STABLE. Since this problem has not shown up on the FreeBSD packag= e > building cluster, I got suspicious that the change was quite recent. >=20 > This old gcc bug report: > led me to suspec= t > mmap(). >=20 > The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple= > of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a > NULL first argument is used. The address that gets returned is stashed= > away and the region is unmapped. Then a later call in > mmap_gt_pch_use_address() passes this saved address to mmap() as a > hint. It expects the mapped region to get mapped to the same base > address. If this does not happen, the above error is the result. >=20 > If I go back to kernel source r280326, which immediately preceeds the > above commit, I am able to successfully build openjdk7. >=20 > I recommend that any machines in the ports cluster being used to build > packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this > issue is resolved. I have not observed any problems building packages > for FreeBSD 10 and 11. >=20 I've committed a change to openjdk7/8 to disable PCH for GCC. filezilla and aegisub apparently use PCH as well. I still need to test and fix them. --=20 Regards, Bryan Drewery --wuAMPJichrBdvDXGcX2sokUTko9QaJ5jd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVLoRHAAoJEDXXcbtuRpfPdpMIAJrwhmCVrItSPaB371AElswy PqTUpklG+b4NStqgRATWtw9HrmKDLcph/UCzPwCMI3YTAc81kVzxo282kKaxVHP/ pTfp6/LHdteJ7SmaTqKANRb6rqkrYTn9qcmg7agS70ZxpIAUTIHGdTarH2R3WvPP 1iVBJRPEi8yWfYXY6bmMjGnqPUCmWAYsXCYyK3errjXELgzHwO4YDwxsF2ISlF+o opBjVKjD5Kkbp27W67nPymLTE651ibb1/bbyGSGYzdFNtlKo3QaTyE38vEXNZ8Qu 0XrBRD6yKfW0Zsu7gJxvKFCwcVxnUfrHhmm9222MREN/siT5nsM1b52d5LoIR50= =OTAU -----END PGP SIGNATURE----- --wuAMPJichrBdvDXGcX2sokUTko9QaJ5jd-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 16:22:07 2015 Return-Path: Delivered-To: svn-src-all@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 1F214A3C; Wed, 15 Apr 2015 16:22:07 +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 E3A61968; Wed, 15 Apr 2015 16:22: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 t3FGM6pN057151; Wed, 15 Apr 2015 16:22:06 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FGM6ef057150; Wed, 15 Apr 2015 16:22:06 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201504151622.t3FGM6ef057150@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 15 Apr 2015 16:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281559 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 16:22:07 -0000 Author: neel Date: Wed Apr 15 16:22:05 2015 New Revision: 281559 URL: https://svnweb.freebsd.org/changeset/base/281559 Log: Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'. Device probe value of BUS_PROBE_NOWILDCARD should be treated specially only if the device has a fixed devclass. Otherwise it should be interpreted just as if the driver doesn't want to claim the device. Prior to this change a device that was not claimed explicitly by its driver would remain "attached" to the driver that returned BUS_PROBE_NOWILDCARD. This would bump up the reference on 'driver->refs' and its 'dev->ops' would point to the 'driver->ops'. When the driver is subsequently unloaded the 'dev->ops->cls' is left pointing to freed memory. This fixes an easily reproducible #GP fault caused by loading and unloading vmm.ko multiple times. Differential Revision: https://reviews.freebsd.org/D2294 Reviewed by: imp, jhb Discussed with: rstone Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 15 14:46:45 2015 (r281558) +++ head/sys/kern/subr_bus.c Wed Apr 15 16:22:05 2015 (r281559) @@ -2113,6 +2113,16 @@ device_probe_child(device_t dev, device_ } /* + * Probes that return BUS_PROBE_NOWILDCARD or lower + * only match on devices whose driver was explicitly + * specified. + */ + if (result <= BUS_PROBE_NOWILDCARD && + !(child->flags & DF_FIXEDCLASS)) { + result = ENXIO; + } + + /* * The driver returned an error so it * certainly doesn't match. */ @@ -2127,14 +2137,6 @@ device_probe_child(device_t dev, device_ * of pri for the first match. */ if (best == NULL || result > pri) { - /* - * Probes that return BUS_PROBE_NOWILDCARD - * or lower only match on devices whose - * driver was explicitly specified. - */ - if (result <= BUS_PROBE_NOWILDCARD && - !(child->flags & DF_FIXEDCLASS)) - continue; best = dl; pri = result; continue; From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 16:52:36 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Apr 15 18:29:20 2015 Return-Path: Delivered-To: svn-src-all@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 55B3AEDC; Wed, 15 Apr 2015 18:29:20 +0000 (UTC) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 113219BF; Wed, 15 Apr 2015 18:29:20 +0000 (UTC) Received: by oift201 with SMTP id t201so36019015oif.3; Wed, 15 Apr 2015 11:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DOM1hoBAsyYfIz0CWbHue7GfGZUq32e/549lJN8PKFI=; b=a6GJ+r7h42j0ajHLvQ8ZUO6SyKLzVi9kigKlyhu0Qttk5G1O0CrpTMC3YhNBVmOg2N kJ7vRrxYLk3yLgd3KbhMuDmKOFLkosICbrz4Am++hMJR1jqyS0wWdVu0+62qPPjldSRp 1q7twBRAXzX3gs+g1abxuHq2VgmOCgT9EO+/UI+ZO3gB2YUY46gxwElG494schAn6q6m FOS8ZsDbJPCnHoNuj4zi0rVXs8BXYi5wfW/acgT564CJxl4eHdruEQ4byL+fEQC4zX7j E2aWzC+g7z7z8h5xVdSHeWyktR2ltyGscT3aPDJ31zd37OrGNbKT1NP7U5sTks2yhWNg Kr3Q== MIME-Version: 1.0 X-Received: by 10.50.43.163 with SMTP id x3mr238479igl.6.1429122559385; Wed, 15 Apr 2015 11:29:19 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Wed, 15 Apr 2015 11:29:19 -0700 (PDT) In-Reply-To: <201504150909.t3F99LFB048690@svn.freebsd.org> References: <201504150909.t3F99LFB048690@svn.freebsd.org> Date: Wed, 15 Apr 2015 11:29:19 -0700 X-Google-Sender-Auth: fHgxz1SalZbz3DanoS6lT4QagdU Message-ID: Subject: Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH... From: Adrian Chadd To: Tijl Coosemans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 18:29:20 -0000 cc1: warnings being treated as errors /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c: In function 'iconv_catgets': /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599: warning: passing argument 2 of 'dl_iconv' from incompatible pointer type -adrian On 15 April 2015 at 02:09, Tijl Coosemans wrote: > Author: tijl > Date: Wed Apr 15 09:09:20 2015 > New Revision: 281550 > URL: https://svnweb.freebsd.org/changeset/base/281550 > > Log: > Remove the const qualifier from iconv(3) to comply with POSIX: > http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html > > Adjust all code that calls iconv. > > PR: 199099 > Exp-run by: antoine > MFC after: 2 weeks > > Modified: > head/UPDATING > head/bin/csh/config.h > head/contrib/smbfs/include/netsmb/smb_lib.h > head/contrib/smbfs/lib/smb/nls.c > head/contrib/smbfs/lib/smb/print.c > head/contrib/smbfs/lib/smb/rq.c > head/include/iconv.h > head/lib/libarchive/Makefile > head/lib/libc/iconv/__iconv.c > head/lib/libc/iconv/bsd_iconv.c > head/lib/libc/iconv/citrus_iconv.h > head/lib/libc/iconv/citrus_iconv_local.h > head/lib/libc/iconv/citrus_none.c > head/lib/libc/iconv/citrus_stdenc.h > head/lib/libc/iconv/citrus_stdenc_local.h > head/lib/libc/iconv/citrus_stdenc_template.h > head/lib/libc/iconv/iconv-internal.h > head/lib/libc/iconv/iconv.3 > head/lib/libc/iconv/iconv.c > head/lib/libc/iconv/iconv_compat.c > head/lib/libc/locale/cXXrtomb_iconv.h > head/lib/libc/locale/mbrtocXX_iconv.h > head/lib/libiconv_modules/BIG5/citrus_big5.c > head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c > head/lib/libiconv_modules/EUC/citrus_euc.c > head/lib/libiconv_modules/EUCTW/citrus_euctw.c > head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c > head/lib/libiconv_modules/HZ/citrus_hz.c > head/lib/libiconv_modules/ISO2022/citrus_iso2022.c > head/lib/libiconv_modules/JOHAB/citrus_johab.c > head/lib/libiconv_modules/MSKanji/citrus_mskanji.c > head/lib/libiconv_modules/UES/citrus_ues.c > head/lib/libiconv_modules/UTF1632/citrus_utf1632.c > head/lib/libiconv_modules/UTF7/citrus_utf7.c > head/lib/libiconv_modules/UTF8/citrus_utf8.c > head/lib/libiconv_modules/VIQR/citrus_viqr.c > head/lib/libiconv_modules/ZW/citrus_zw.c > head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c > head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c > head/lib/libkiconv/xlat16_iconv.c > head/sys/sys/param.h > head/usr.bin/iconv/iconv.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Wed Apr 15 08:16:34 2015 (r281549) > +++ head/UPDATING Wed Apr 15 09:09:20 2015 (r281550) > @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20150415: > + The const qualifier has been removed from iconv(3) to comply with > + POSIX. The ports tree is aware of this from r384038 onwards. > + > 20150324: > From legacy ata(4) driver was removed support for SATA controllers > supported by more functional drivers ahci(4), siis(4) and mvs(4). > > Modified: head/bin/csh/config.h > ============================================================================== > --- head/bin/csh/config.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/bin/csh/config.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -198,7 +198,7 @@ > #define HAVE_WCWIDTH 1 > > /* Define as const if the declaration of iconv() needs const. */ > -#define ICONV_CONST const > +#define ICONV_CONST > > /* Support NLS. */ > #define NLS 1 > > Modified: head/contrib/smbfs/include/netsmb/smb_lib.h > ============================================================================== > --- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -191,7 +191,7 @@ int smb_ctx_readrc(struct smb_ctx *); > int smb_ctx_resolve(struct smb_ctx *); > int smb_ctx_setflags(struct smb_ctx *, int, int, int); > > -int smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*); > +int smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*); > int smb_smb_close_print_file(struct smb_ctx *, smbfh); > > int smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *); > @@ -204,8 +204,8 @@ int smb_rq_init(struct smb_ctx *, u_cha > void smb_rq_done(struct smb_rq *); > void smb_rq_wend(struct smb_rq *); > int smb_rq_simple(struct smb_rq *); > -int smb_rq_dmem(struct mbdata *, const char *, size_t); > -int smb_rq_dstring(struct mbdata *, const char *); > +int smb_rq_dmem(struct mbdata *, char *, size_t); > +int smb_rq_dstring(struct mbdata *, char *); > > int smb_t2_request(struct smb_ctx *, int, int, const char *, > int, void *, int, void *, int *, void *, int *, void *); > @@ -246,10 +246,10 @@ extern u_char nls_lower[256], nls_upper[ > > int nls_setrecode(const char *, const char *); > int nls_setlocale(const char *); > -char* nls_str_toext(char *, const char *); > -char* nls_str_toloc(char *, const char *); > -void* nls_mem_toext(void *, const void *, int); > -void* nls_mem_toloc(void *, const void *, int); > +char* nls_str_toext(char *, char *); > +char* nls_str_toloc(char *, char *); > +void* nls_mem_toext(void *, void *, int); > +void* nls_mem_toloc(void *, void *, int); > char* nls_str_upper(char *, const char *); > char* nls_str_lower(char *, const char *); > > > Modified: head/contrib/smbfs/lib/smb/nls.c > ============================================================================== > --- head/contrib/smbfs/lib/smb/nls.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/contrib/smbfs/lib/smb/nls.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -102,7 +102,7 @@ nls_setrecode(const char *local, const c > } > > char * > -nls_str_toloc(char *dst, const char *src) > +nls_str_toloc(char *dst, char *src) > { > #ifdef HAVE_ICONV > char *p = dst; > @@ -125,7 +125,7 @@ nls_str_toloc(char *dst, const char *src > } > > char * > -nls_str_toext(char *dst, const char *src) > +nls_str_toext(char *dst, char *src) > { > #ifdef HAVE_ICONV > char *p = dst; > @@ -148,11 +148,11 @@ nls_str_toext(char *dst, const char *src > } > > void * > -nls_mem_toloc(void *dst, const void *src, int size) > +nls_mem_toloc(void *dst, void *src, int size) > { > #ifdef HAVE_ICONV > char *p = dst; > - const char *s = src; > + char *s = src; > size_t inlen, outlen; > > if (size == 0) > @@ -174,11 +174,11 @@ nls_mem_toloc(void *dst, const void *src > } > > void * > -nls_mem_toext(void *dst, const void *src, int size) > +nls_mem_toext(void *dst, void *src, int size) > { > #ifdef HAVE_ICONV > char *p = dst; > - const char *s = src; > + char *s = src; > size_t inlen, outlen; > > if (size == 0) > > Modified: head/contrib/smbfs/lib/smb/print.c > ============================================================================== > --- head/contrib/smbfs/lib/smb/print.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/contrib/smbfs/lib/smb/print.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -54,7 +54,7 @@ > > int > smb_smb_open_print_file(struct smb_ctx *ctx, int setuplen, int mode, > - const char *ident, smbfh *fhp) > + char *ident, smbfh *fhp) > { > struct smb_rq *rqp; > struct mbdata *mbp; > > Modified: head/contrib/smbfs/lib/smb/rq.c > ============================================================================== > --- head/contrib/smbfs/lib/smb/rq.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/contrib/smbfs/lib/smb/rq.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -86,7 +86,7 @@ smb_rq_wend(struct smb_rq *rqp) > } > > int > -smb_rq_dmem(struct mbdata *mbp, const char *src, size_t size) > +smb_rq_dmem(struct mbdata *mbp, char *src, size_t size) > { > struct mbuf *m; > char * dst; > @@ -118,7 +118,7 @@ smb_rq_dmem(struct mbdata *mbp, const ch > } > > int > -smb_rq_dstring(struct mbdata *mbp, const char *s) > +smb_rq_dstring(struct mbdata *mbp, char *s) > { > return smb_rq_dmem(mbp, s, strlen(s) + 1); > } > > Modified: head/include/iconv.h > ============================================================================== > --- head/include/iconv.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/include/iconv.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -53,7 +53,7 @@ typedef struct __tag_iconv_t *iconv_t; > > __BEGIN_DECLS > iconv_t iconv_open(const char *, const char *); > -size_t iconv(iconv_t, const char ** __restrict, > +size_t iconv(iconv_t, char ** __restrict, > size_t * __restrict, char ** __restrict, > size_t * __restrict); > int iconv_close(iconv_t); > @@ -62,7 +62,7 @@ int iconv_close(iconv_t); > */ > int __iconv_get_list(char ***, size_t *, __iconv_bool); > void __iconv_free_list(char **, size_t); > -size_t __iconv(iconv_t, const char **, size_t *, char **, > +size_t __iconv(iconv_t, char **, size_t *, char **, > size_t *, __uint32_t, size_t *); > #define __ICONV_F_HIDE_INVALID 0x0001 > > > Modified: head/lib/libarchive/Makefile > ============================================================================== > --- head/lib/libarchive/Makefile Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libarchive/Makefile Wed Apr 15 09:09:20 2015 (r281550) > @@ -25,7 +25,7 @@ LIBADD+= md > .if ${MK_ICONV} != "no" > # TODO: This can be changed back to CFLAGS once iconv works correctly > # with statically linked binaries. > -SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const > +SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST= > .endif > > .if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \ > > Modified: head/lib/libc/iconv/__iconv.c > ============================================================================== > --- head/lib/libc/iconv/__iconv.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/__iconv.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -31,7 +31,7 @@ > #include "iconv-internal.h" > > size_t > -__iconv(iconv_t a, const char **b, size_t *c, char **d, > +__iconv(iconv_t a, char **b, size_t *c, char **d, > size_t *e, __uint32_t f, size_t *g) > { > return __bsd___iconv(a, b, c, d, e, f, g); > > Modified: head/lib/libc/iconv/bsd_iconv.c > ============================================================================== > --- head/lib/libc/iconv/bsd_iconv.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/bsd_iconv.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -120,7 +120,7 @@ __bsd_iconv_close(iconv_t handle) > } > > size_t > -__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) > +__bsd_iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout) > { > size_t ret; > int err; > @@ -141,7 +141,7 @@ __bsd_iconv(iconv_t handle, const char * > } > > size_t > -__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out, > +__bsd___iconv(iconv_t handle, char **in, size_t *szin, char **out, > size_t *szout, uint32_t flags, size_t *invalids) > { > size_t ret; > > Modified: head/lib/libc/iconv/citrus_iconv.h > ============================================================================== > --- head/lib/libc/iconv/citrus_iconv.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/citrus_iconv.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -52,7 +52,7 @@ __END_DECLS > */ > static __inline int > _citrus_iconv_convert(struct _citrus_iconv * __restrict cv, > - const char * __restrict * __restrict in, size_t * __restrict inbytes, > + char * __restrict * __restrict in, size_t * __restrict inbytes, > char * __restrict * __restrict out, size_t * __restrict outbytes, > uint32_t flags, size_t * __restrict nresults) > { > > Modified: head/lib/libc/iconv/citrus_iconv_local.h > ============================================================================== > --- head/lib/libc/iconv/citrus_iconv_local.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/citrus_iconv_local.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -46,7 +46,7 @@ static void _citrus_##_m_##_iconv_unini > (struct _citrus_iconv_shared *); \ > static int _citrus_##_m_##_iconv_convert \ > (struct _citrus_iconv * __restrict, \ > - const char * __restrict * __restrict, \ > + char * __restrict * __restrict, \ > size_t * __restrict, \ > char * __restrict * __restrict, \ > size_t * __restrict outbytes, \ > @@ -75,7 +75,7 @@ typedef void (*_citrus_iconv_uninit_shar > (struct _citrus_iconv_shared *); > typedef int (*_citrus_iconv_convert_t) > (struct _citrus_iconv * __restrict, > - const char *__restrict* __restrict, size_t * __restrict, > + char *__restrict* __restrict, size_t * __restrict, > char * __restrict * __restrict, size_t * __restrict, uint32_t, > size_t * __restrict); > typedef int (*_citrus_iconv_init_context_t)(struct _citrus_iconv *); > > Modified: head/lib/libc/iconv/citrus_none.c > ============================================================================== > --- head/lib/libc/iconv/citrus_none.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/citrus_none.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -83,7 +83,7 @@ _citrus_NONE_stdenc_init_state(struct _c > > static int > _citrus_NONE_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce __unused, > - _csid_t *csid, _index_t *idx, const char **s, size_t n, > + _csid_t *csid, _index_t *idx, char **s, size_t n, > void *ps __unused, size_t *nresult, struct iconv_hooks *hooks) > { > > @@ -159,7 +159,7 @@ _citrus_NONE_stdenc_cstomb(struct _citru > > static int > _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused, > - _wc_t * __restrict pwc, const char ** __restrict s, size_t n, > + _wc_t * __restrict pwc, char ** __restrict s, size_t n, > void * __restrict pspriv __unused, size_t * __restrict nresult, > struct iconv_hooks *hooks) > { > > Modified: head/lib/libc/iconv/citrus_stdenc.h > ============================================================================== > --- head/lib/libc/iconv/citrus_stdenc.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/citrus_stdenc.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -69,7 +69,7 @@ _citrus_stdenc_init_state(struct _citrus > static __inline int > _citrus_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce, > _citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx, > - const char ** __restrict s, size_t n, void * __restrict ps, > + char ** __restrict s, size_t n, void * __restrict ps, > size_t * __restrict nresult, struct iconv_hooks *hooks) > { > > > Modified: head/lib/libc/iconv/citrus_stdenc_local.h > ============================================================================== > --- head/lib/libc/iconv/citrus_stdenc_local.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/citrus_stdenc_local.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtoc > (struct _citrus_stdenc * __restrict, \ > _citrus_csid_t * __restrict, \ > _citrus_index_t * __restrict, \ > - const char ** __restrict, size_t, \ > + char ** __restrict, size_t, \ > void * __restrict, size_t * __restrict, \ > struct iconv_hooks *); \ > static int _citrus_##_e_##_stdenc_cstomb \ > @@ -66,7 +66,7 @@ static int _citrus_##_e_##_stdenc_cstom > static int _citrus_##_e_##_stdenc_mbtowc \ > (struct _citrus_stdenc * __restrict, \ > _citrus_wc_t * __restrict, \ > - const char ** __restrict, size_t, \ > + char ** __restrict, size_t, \ > void * __restrict, size_t * __restrict, \ > struct iconv_hooks *); \ > static int _citrus_##_e_##_stdenc_wctomb \ > @@ -106,7 +106,7 @@ typedef int (*_citrus_stdenc_init_state_ > typedef int (*_citrus_stdenc_mbtocs_t) > (struct _citrus_stdenc * __restrict, > _citrus_csid_t * __restrict, _citrus_index_t * __restrict, > - const char ** __restrict, size_t, > + char ** __restrict, size_t, > void * __restrict, size_t * __restrict, > struct iconv_hooks *); > typedef int (*_citrus_stdenc_cstomb_t) > @@ -116,7 +116,7 @@ typedef int (*_citrus_stdenc_cstomb_t) > typedef int (*_citrus_stdenc_mbtowc_t) > (struct _citrus_stdenc * __restrict, > _citrus_wc_t * __restrict, > - const char ** __restrict, size_t, > + char ** __restrict, size_t, > void * __restrict, size_t * __restrict, > struct iconv_hooks *); > typedef int (*_citrus_stdenc_wctomb_t) > > Modified: head/lib/libc/iconv/citrus_stdenc_template.h > ============================================================================== > --- head/lib/libc/iconv/citrus_stdenc_template.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/citrus_stdenc_template.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -112,7 +112,7 @@ _FUNCNAME(stdenc_init_state)(struct _cit > static int > _FUNCNAME(stdenc_mbtocs)(struct _citrus_stdenc * __restrict ce, > _citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx, > - const char ** __restrict s, size_t n, void * __restrict ps, > + char ** __restrict s, size_t n, void * __restrict ps, > size_t * __restrict nresult, struct iconv_hooks *hooks) > { > wchar_t wc; > @@ -151,7 +151,7 @@ _FUNCNAME(stdenc_cstomb)(struct _citrus_ > > static int > _FUNCNAME(stdenc_mbtowc)(struct _citrus_stdenc * __restrict ce, > - _citrus_wc_t * __restrict wc, const char ** __restrict s, size_t n, > + _citrus_wc_t * __restrict wc, char ** __restrict s, size_t n, > void * __restrict ps, size_t * __restrict nresult, > struct iconv_hooks *hooks) > { > > Modified: head/lib/libc/iconv/iconv-internal.h > ============================================================================== > --- head/lib/libc/iconv/iconv-internal.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/iconv-internal.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -29,11 +29,11 @@ > /* > * Interal prototypes for our back-end functions. > */ > -size_t __bsd___iconv(iconv_t, const char **, size_t *, char **, > +size_t __bsd___iconv(iconv_t, char **, size_t *, char **, > size_t *, __uint32_t, size_t *); > void __bsd___iconv_free_list(char **, size_t); > int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool); > -size_t __bsd_iconv(iconv_t, const char ** __restrict, > +size_t __bsd_iconv(iconv_t, char ** __restrict, > size_t * __restrict, char ** __restrict, > size_t * __restrict); > const char *__bsd_iconv_canonicalize(const char *); > > Modified: head/lib/libc/iconv/iconv.3 > ============================================================================== > --- head/lib/libc/iconv/iconv.3 Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/iconv.3 Wed Apr 15 09:09:20 2015 (r281550) > @@ -48,7 +48,7 @@ > .Ft size_t > .Fn iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" > .Ft size_t > -.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" > +.Fn __iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" > .Sh DESCRIPTION > The > .Fn iconv_open > > Modified: head/lib/libc/iconv/iconv.c > ============================================================================== > --- head/lib/libc/iconv/iconv.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/iconv.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -31,7 +31,7 @@ > #include "iconv-internal.h" > > size_t > -iconv(iconv_t a, const char ** __restrict b, > +iconv(iconv_t a, char ** __restrict b, > size_t * __restrict c, char ** __restrict d, > size_t * __restrict e) > { > > Modified: head/lib/libc/iconv/iconv_compat.c > ============================================================================== > --- head/lib/libc/iconv/iconv_compat.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/iconv/iconv_compat.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -37,7 +37,7 @@ > #include "iconv-internal.h" > > size_t > -__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d, > +__iconv_compat(iconv_t a, char ** b, size_t * c, char ** d, > size_t * e, __uint32_t f, size_t *g) > { > return __bsd___iconv(a, b, c, d, e, f, g); > @@ -56,7 +56,7 @@ __iconv_get_list_compat(char ***a, size_ > } > > size_t > -iconv_compat(iconv_t a, const char ** __restrict b, > +iconv_compat(iconv_t a, char ** __restrict b, > size_t * __restrict c, char ** __restrict d, > size_t * __restrict e) > { > > Modified: head/lib/libc/locale/cXXrtomb_iconv.h > ============================================================================== > --- head/lib/libc/locale/cXXrtomb_iconv.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/locale/cXXrtomb_iconv.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -57,8 +57,7 @@ cXXrtomb_l(char * __restrict s, charXX_t > { > _ConversionState *cs; > struct _citrus_iconv *handle; > - const char *src; > - char *dst; > + char *src, *dst; > size_t srcleft, dstleft, invlen; > int err; > > > Modified: head/lib/libc/locale/mbrtocXX_iconv.h > ============================================================================== > --- head/lib/libc/locale/mbrtocXX_iconv.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libc/locale/mbrtocXX_iconv.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -99,8 +99,7 @@ mbrtocXX_l(charXX_t * __restrict pc, con > > /* Convert as few characters to the dst buffer as possible. */ > for (i = 0; ; i++) { > - const char *src; > - char *dst; > + char *src, *dst; > size_t srcleft, dstleft, invlen; > int err; > > > Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c > ============================================================================== > --- head/lib/libiconv_modules/BIG5/citrus_big5.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/BIG5/citrus_big5.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -269,12 +269,12 @@ static int > /*ARGSUSED*/ > _citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei, > wchar_t * __restrict pwc, > - const char ** __restrict s, size_t n, > + char ** __restrict s, size_t n, > _BIG5State * __restrict psenc, > size_t * __restrict nresult) > { > wchar_t wchar; > - const char *s0; > + char *s0; > int c, chlenbak; > > s0 = *s; > > Modified: head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c > ============================================================================== > --- head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -165,10 +165,10 @@ is_94charset(int c) > static int > /*ARGSUSED*/ > _citrus_DECHanyu_mbrtowc_priv(_DECHanyuEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _DECHanyuState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0; > + char *s0; > wchar_t wc; > int ch; > > > Modified: head/lib/libiconv_modules/EUC/citrus_euc.c > ============================================================================== > --- head/lib/libiconv_modules/EUC/citrus_euc.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/EUC/citrus_euc.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -190,12 +190,12 @@ _citrus_EUC_unpack_state(_EUCEncodingInf > #endif > > static int > -_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s, > +_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, char **s, > size_t n, _EUCState *psenc, size_t *nresult) > { > wchar_t wchar; > int c, chlenbak, cs, len; > - const char *s0, *s1 = NULL; > + char *s0, *s1 = NULL; > > s0 = *s; > > > Modified: head/lib/libiconv_modules/EUCTW/citrus_euctw.c > ============================================================================== > --- head/lib/libiconv_modules/EUCTW/citrus_euctw.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/EUCTW/citrus_euctw.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -176,10 +176,10 @@ _citrus_EUCTW_encoding_module_uninit(_EU > > static int > _citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, > + wchar_t * __restrict pwc, char ** __restrict s, > size_t n, _EUCTWState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0; > + char *s0; > wchar_t wchar; > int c, chlenbak, cs; > > > Modified: head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c > ============================================================================== > --- head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -149,10 +149,10 @@ _mb_count(wchar_t v) > > static int > _citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _GBK2KState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0, *s1; > + char *s0, *s1; > wchar_t wc; > int chlenbak, len; > > > Modified: head/lib/libiconv_modules/HZ/citrus_hz.c > ============================================================================== > --- head/lib/libiconv_modules/HZ/citrus_hz.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/HZ/citrus_hz.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -175,13 +175,13 @@ _citrus_HZ_unpack_state(_HZEncodingInfo > > static int > _citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _HZState * __restrict psenc, size_t * __restrict nresult) > { > escape_t *candidate, *init; > graphic_t *graphic; > const range_t *range; > - const char *s0; > + char *s0; > wchar_t wc; > int bit, ch, head, len, tail; > > > Modified: head/lib/libiconv_modules/ISO2022/citrus_iso2022.c > ============================================================================== > --- head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -574,7 +574,7 @@ terminate: > > static wchar_t > _ISO2022_sgetwchar(_ISO2022EncodingInfo * __restrict ei __unused, > - const char * __restrict string, size_t n, const char ** __restrict result, > + char * __restrict string, size_t n, char ** __restrict result, > _ISO2022State * __restrict psenc) > { > const struct seqtable *sp; > @@ -842,10 +842,10 @@ asis: > > static int > _citrus_ISO2022_mbrtowc_priv(_ISO2022EncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, > + wchar_t * __restrict pwc, char ** __restrict s, > size_t n, _ISO2022State * __restrict psenc, size_t * __restrict nresult) > { > - const char *p, *result, *s0; > + char *p, *result, *s0; > wchar_t wchar; > int c, chlenbak; > > > Modified: head/lib/libiconv_modules/JOHAB/citrus_johab.c > ============================================================================== > --- head/lib/libiconv_modules/JOHAB/citrus_johab.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/JOHAB/citrus_johab.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -145,10 +145,10 @@ ishanja(int l, int t) > static int > /*ARGSUSED*/ > _citrus_JOHAB_mbrtowc_priv(_JOHABEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _JOHABState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0; > + char *s0; > int l, t; > > if (*s == NULL) { > > Modified: head/lib/libiconv_modules/MSKanji/citrus_mskanji.c > ============================================================================== > --- head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -153,10 +153,10 @@ _citrus_MSKanji_unpack_state(_MSKanjiEnc > static int > /*ARGSUSED*/ > _citrus_MSKanji_mbrtowc_priv(_MSKanjiEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _MSKanjiState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0; > + char *s0; > wchar_t wchar; > int chlenbak, len; > > > Modified: head/lib/libiconv_modules/UES/citrus_ues.c > ============================================================================== > --- head/lib/libiconv_modules/UES/citrus_ues.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/UES/citrus_ues.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -185,10 +185,10 @@ is_basic(wchar_t wc) > > static int > _citrus_UES_mbrtowc_priv(_UESEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _UESState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0; > + char *s0; > int ch, head, num, tail; > wchar_t hi, wc; > > > Modified: head/lib/libiconv_modules/UTF1632/citrus_utf1632.c > ============================================================================== > --- head/lib/libiconv_modules/UTF1632/citrus_utf1632.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/UTF1632/citrus_utf1632.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -97,9 +97,9 @@ _citrus_UTF1632_init_state(_UTF1632Encod > > static int > _citrus_UTF1632_mbrtowc_priv(_UTF1632EncodingInfo *ei, wchar_t *pwc, > - const char **s, size_t n, _UTF1632State *psenc, size_t *nresult) > + char **s, size_t n, _UTF1632State *psenc, size_t *nresult) > { > - const char *s0; > + char *s0; > size_t result; > wchar_t wc = L'\0'; > int chlenbak, endian, needlen; > > Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c > ============================================================================== > --- head/lib/libiconv_modules/UTF7/citrus_utf7.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/UTF7/citrus_utf7.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -151,11 +151,11 @@ static const char spaces[] = " \t\r\n"; > > static int > _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei, > - uint16_t * __restrict u16, const char ** __restrict s, size_t n, > + uint16_t * __restrict u16, char ** __restrict s, size_t n, > _UTF7State * __restrict psenc, size_t * __restrict nresult) > { > _UTF7State sv; > - const char *s0; > + char *s0; > int done, i, len; > > s0 = *s; > @@ -244,7 +244,7 @@ ilseq: > > static int > _citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _UTF7State * __restrict psenc, size_t * __restrict nresult) > { > uint32_t u32; > > Modified: head/lib/libiconv_modules/UTF8/citrus_utf8.c > ============================================================================== > --- head/lib/libiconv_modules/UTF8/citrus_utf8.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/UTF8/citrus_utf8.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -177,10 +177,10 @@ _citrus_UTF8_unpack_state(_UTF8EncodingI > #endif > > static int > -_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s, > +_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, char **s, > size_t n, _UTF8State *psenc, size_t *nresult) > { > - const char *s0; > + char *s0; > wchar_t wchar; > int i; > uint8_t c; > > Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c > ============================================================================== > --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -252,11 +252,11 @@ _citrus_VIQR_unpack_state(_VIQREncodingI > > static int > _citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, > + wchar_t * __restrict pwc, char ** __restrict s, size_t n, > _VIQRState * __restrict psenc, size_t * __restrict nresult) > { > mnemonic_t *m, *m0; > - const char *s0; > + char *s0; > wchar_t wc; > ssize_t i; > int ch, escape; > > Modified: head/lib/libiconv_modules/ZW/citrus_zw.c > ============================================================================== > --- head/lib/libiconv_modules/ZW/citrus_zw.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/ZW/citrus_zw.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -107,10 +107,10 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo > > static int > _citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei, > - wchar_t * __restrict pwc, const char **__restrict s, size_t n, > + wchar_t * __restrict pwc, char **__restrict s, size_t n, > _ZWState * __restrict psenc, size_t * __restrict nresult) > { > - const char *s0; > + char *s0; > wchar_t wc; > int ch, len; > > > Modified: head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c > ============================================================================== > --- head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -97,7 +97,7 @@ _citrus_iconv_none_iconv_uninit_context( > static int > /*ARGSUSED*/ > _citrus_iconv_none_iconv_convert(struct _citrus_iconv * __restrict ci __unused, > - const char * __restrict * __restrict in, size_t * __restrict inbytes, > + char * __restrict * __restrict in, size_t * __restrict inbytes, > char * __restrict * __restrict out, size_t * __restrict outbytes, > uint32_t flags __unused, size_t * __restrict invalids) > { > > Modified: head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c > ============================================================================== > --- head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -104,7 +104,7 @@ init_encoding_state(struct _citrus_iconv > > static __inline int > mbtocsx(struct _citrus_iconv_std_encoding *se, > - _csid_t *csid, _index_t *idx, const char **s, size_t n, size_t *nresult, > + _csid_t *csid, _index_t *idx, char **s, size_t n, size_t *nresult, > struct iconv_hooks *hooks) > { > > @@ -461,7 +461,7 @@ _citrus_iconv_std_iconv_uninit_context(s > > static int > _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv, > - const char * __restrict * __restrict in, size_t * __restrict inbytes, > + char * __restrict * __restrict in, size_t * __restrict inbytes, > char * __restrict * __restrict out, size_t * __restrict outbytes, > uint32_t flags, size_t * __restrict invalids) > { > @@ -469,7 +469,7 @@ _citrus_iconv_std_iconv_convert(struct _ > struct _citrus_iconv_std_context *sc = cv->cv_closure; > _csid_t csid; > _index_t idx; > - const char *tmpin; > + char *tmpin; > size_t inval, szrin, szrout; > int ret, state = 0; > > > Modified: head/lib/libkiconv/xlat16_iconv.c > ============================================================================== > --- head/lib/libkiconv/xlat16_iconv.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/lib/libkiconv/xlat16_iconv.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -62,7 +62,7 @@ static int chklocale(int, const char *); > typedef void *iconv_t; > static int my_iconv_init(void); > static iconv_t (*my_iconv_open)(const char *, const char *); > -static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); > +static size_t (*my_iconv)(iconv_t, char **, size_t *, char **, size_t *); > static int (*my_iconv_close)(iconv_t); > #else > #include > @@ -71,7 +71,7 @@ static int (*my_iconv_close)(iconv_t); > #define my_iconv iconv > #define my_iconv_close iconv_close > #endif > -static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); > +static size_t my_iconv_char(iconv_t, u_char **, size_t *, u_char **, size_t *); > > int > kiconv_add_xlat16_cspair(const char *tocode, const char *fromcode, int flag) > @@ -221,8 +221,8 @@ kiconv_xlat16_open(const char *tocode, c > src[0] = (u_char)(c >> 8); > src[1] = (u_char)c; > > - ret = my_iconv_char(cd, (const u_char **)&srcp, > - &inbytesleft, &dstp, &outbytesleft); > + ret = my_iconv_char(cd, &srcp, &inbytesleft, > + &dstp, &outbytesleft); > if (ret == -1) { > table[us] = 0; > continue; > @@ -338,11 +338,10 @@ my_iconv_init(void) > #endif > > static size_t > -my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, > +my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf, > size_t * olen) > { > - const u_char *sp; > - u_char *dp, ilocal[3], olocal[3]; > + u_char *sp, *dp, ilocal[3], olocal[3]; > u_char c1, c2; > int ret; > size_t ir, or; > @@ -352,7 +351,7 @@ my_iconv_char(iconv_t cd, const u_char * > ir = *ilen; > > bzero(*obuf, *olen); > - ret = my_iconv(cd, (const char **)&sp, ilen, (char **)&dp, olen); > + ret = my_iconv(cd, (char **)&sp, ilen, (char **)&dp, olen); > c1 = (*obuf)[0]; > c2 = (*obuf)[1]; > > @@ -375,7 +374,7 @@ my_iconv_char(iconv_t cd, const u_char * > sp = ilocal; > dp = olocal; > > - if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) { > + if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) { > if (olocal[0] != c1) > return (ret); > > @@ -429,7 +428,7 @@ my_iconv_char(iconv_t cd, const u_char * > sp = ilocal + 1; > dp = olocal; > > - if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) { > + if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) { > if (olocal[0] == c2) > /* > * inbuf is a single byte char > > Modified: head/sys/sys/param.h > ============================================================================== > --- head/sys/sys/param.h Wed Apr 15 08:16:34 2015 (r281549) > +++ head/sys/sys/param.h Wed Apr 15 09:09:20 2015 (r281550) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1100068 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1100069 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > > Modified: head/usr.bin/iconv/iconv.c > ============================================================================== > --- head/usr.bin/iconv/iconv.c Wed Apr 15 08:16:34 2015 (r281549) > +++ head/usr.bin/iconv/iconv.c Wed Apr 15 09:09:20 2015 (r281550) > @@ -71,9 +71,8 @@ do_conv(FILE *fp, const char *from, cons > bool hide_invalid) > { > iconv_t cd; > - char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *out; > + char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *in, *out; > unsigned long long invalids; > - const char *in; > size_t inbytes, outbytes, ret; > > if ((cd = iconv_open(to, from)) == (iconv_t)-1) > From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 18:49:04 2015 Return-Path: Delivered-To: svn-src-all@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 B982D579; Wed, 15 Apr 2015 18:49: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 A4DF818D; Wed, 15 Apr 2015 18:49: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 t3FIn4DT024890; Wed, 15 Apr 2015 18:49:04 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FIn4bO024888; Wed, 15 Apr 2015 18:49:04 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201504151849.t3FIn4bO024888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Wed, 15 Apr 2015 18:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281561 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 18:49:04 -0000 Author: tychon Date: Wed Apr 15 18:49:03 2015 New Revision: 281561 URL: https://svnweb.freebsd.org/changeset/base/281561 Log: Prior to aborting due to an ioport error, it is always interesting to see what the guest's %rip is. Reviewed by: grehan Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Apr 15 16:52:34 2015 (r281560) +++ head/usr.sbin/bhyve/bhyverun.c Wed Apr 15 18:49:03 2015 (r281561) @@ -325,8 +325,10 @@ vmexit_inout(struct vmctx *ctx, struct v error = emulate_inout(ctx, vcpu, vme, strictio); if (error) { - fprintf(stderr, "Unhandled %s%c 0x%04x\n", in ? "in" : "out", - bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); + fprintf(stderr, "Unhandled %s%c 0x%04x at 0x%lx\n", + in ? "in" : "out", + bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), + port, vmexit->rip); return (VMEXIT_ABORT); } else { return (VMEXIT_CONTINUE); From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 18:52:30 2015 Return-Path: Delivered-To: svn-src-all@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 E7810706; Wed, 15 Apr 2015 18:52:29 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C212D26A; Wed, 15 Apr 2015 18:52:29 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 094FC2A3; Wed, 15 Apr 2015 11:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1429123949; bh=agG+2+kvoVb1OzWQ5SyahUxR/PLHaJqqQvsju541QTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NFXXNiKDxWwsx5RjTsa9AhMMwzeWk8pP12CMp7GR4xRuMNipRdF13XuQ7wyAz+8gs Gs9xcIyk7TiPuXeTmX6iVrP9qF85J7ildqcvMt8deZxntdzF/PBUOZTnYoUCXA9HBs wW2gqiEK0wv2bhMxClu/PQWZ7bMGYD2xjSgGhNtU= From: Peter Wemm To: svn-src-all@freebsd.org Cc: Adrian Chadd , Tijl Coosemans , "svn-src-head@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH... Date: Wed, 15 Apr 2015 11:52:23 -0700 Message-ID: <2920267.p4mEmZ8sTB@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201504150909.t3F99LFB048690@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2146302.DXk677FAmj"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 18:52:30 -0000 --nextPart2146302.DXk677FAmj Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Wednesday, April 15, 2015 11:29:19 AM Adrian Chadd wrote: > cc1: warnings being treated as errors > /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib= /tcsh/s > h.func.c: In function 'iconv_catgets': > /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib= /tcsh/s > h.func.c:2599: warning: passing argument 2 of 'dl_iconv' from incompa= tible > pointer type >=20 > -adrian >=20 > On 15 April 2015 at 02:09, Tijl Coosemans wrote: > > Author: tijl > > Date: Wed Apr 15 09:09:20 2015 > > New Revision: 281550 > > URL: https://svnweb.freebsd.org/changeset/base/281550 > >=20 > > Log: > > Remove the const qualifier from iconv(3) to comply with POSIX: > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.h= tml > > =20 > > Adjust all code that calls iconv. [Massive commit diff quote trimmed] This is one of those unfortunate things. A mistake was made during the= =20 standards process that wasn't caught untill too late. It was corrected= , but=20 not until the damage was done. The short version is that in the posix = spec,=20 the man page had the wrong type (and made no sense), but the actual cod= e=20 definition in the include file spec was correct. So, a bunch of OS's used the text description as the source of truth. =20= Ports/libiconv is one. Others requested a formal clarification and the posix committee specifi= cally=20 said the include file spec (which makes sense) is the correct one and u= pdated=20 the man page to match the include file. Linux glibc uses the correct f= orm. When I originally pulled the trigger I used the incorrect ports/libicon= v form=20 because I didn't know any better and regretted it since. I'm glad the mistake has been fixed. However, this is a gift that keep= s on=20 giving. There will be loose ends like the warning above turning up in = odd=20 places for some time. We'll just have to deal with it, a bit of whacka= mole=20 will be required. :( =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2146302.DXk677FAmj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVLrNnAAoJEDXWlwnsgJ4EllcH/icJbOA04IpeLKJr+KAjFcdc 4Y/uNRw1TcKcEGdkjq4yCiTmL5KYgYgz3M9HJp2QONMguyRNeK6U69ObHSe9tDpo zKAuxhnscw5seR5qr174qlEyjL8bbnJ2zYKO2nATu1XnYicbE3XLVEBPmKn0P5YI JkyQjRFt/i4R3myldq9JcX++P8PS61TguLcLjs9xdjig02rZlffDRHO3/w80otpH gffbXb6Ktc46Jq19M+aRdT5uahYqlnZv87tGEvwcfvH5JAy4qJ1z4oCzt+rATmX4 F6NW6vd4FZ4aTk5Sy2RkYBXI4R7SyW9KTZIathryjvqIDH9sJ/m/J+yLkUuxj3c= =wNgE -----END PGP SIGNATURE----- --nextPart2146302.DXk677FAmj-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 19:04:29 2015 Return-Path: Delivered-To: svn-src-all@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 17CF595F; Wed, 15 Apr 2015 19:04:29 +0000 (UTC) Received: from mailrelay102.isp.belgacom.be (mailrelay102.isp.belgacom.be [195.238.20.129]) by mx1.freebsd.org (Postfix) with ESMTP id 37E473A6; Wed, 15 Apr 2015 19:04:27 +0000 (UTC) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=+BsAzE94k0WpM8AtezFGaEXBVpw1lpSE4R7UN5Nfg4g= c=1 sm=2 a=6I5d2MoRAAAA:8 a=m_g2NoT2XDoVAkJkzFEA:9 a=CjuIK1q_8ugA:10 a=A0Z3edhQMQfFuqFnjtcA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BmBgD6tS5V/zOwsFtcgwyBIgzNUQKBO00BAQEBAQF+hCEBAQRWIxALGAkaCw8qHgYTiC4BxRoBAQEBAQEEAQEBAQEBHIsrhHwHhC0BBJMGiCeLYokYIoIDHBSBPjwxgkMBAQE Received: from 51.176-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.176.51]) by relay.skynet.be with ESMTP; 15 Apr 2015 21:04:25 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id t3FJ4OPU021906; Wed, 15 Apr 2015 21:04:24 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Wed, 15 Apr 2015 21:04:24 +0200 From: Tijl Coosemans To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH... Message-ID: <20150415210424.2fc38e39@kalimero.tijl.coosemans.org> In-Reply-To: References: <201504150909.t3F99LFB048690@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Jl84pmqTHGsHqD0th0oIFx=" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 19:04:29 -0000 --MP_/Jl84pmqTHGsHqD0th0oIFx= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd wrote: > cc1: warnings being treated as errors > /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c: > In function 'iconv_catgets': > /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599: > warning: passing argument 2 of 'dl_iconv' from incompatible pointer > type Does "embedded" mean that WITHOUT_ICONV is defined? Can you try the attached patch? --MP_/Jl84pmqTHGsHqD0th0oIFx= Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=iconv.patch Index: bin/csh/iconv_stub.h =================================================================== --- bin/csh/iconv_stub.h (revision 281561) +++ bin/csh/iconv_stub.h (working copy) @@ -30,7 +30,7 @@ #define _ICONV_H_ typedef void *iconv_t; -typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *); +typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *); typedef int dl_iconv_close_t(iconv_t); extern iconv_t dl_iconv_open(const char *, const char *); --MP_/Jl84pmqTHGsHqD0th0oIFx=-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 20:16:36 2015 Return-Path: Delivered-To: svn-src-all@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 B5ED3542; Wed, 15 Apr 2015 20:16: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 A05AFD11; Wed, 15 Apr 2015 20:16: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 t3FKGaoX067285; Wed, 15 Apr 2015 20:16:36 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FKGWVa067264; Wed, 15 Apr 2015 20:16:32 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201504152016.t3FKGWVa067264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 15 Apr 2015 20:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281562 - in head/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nfsserver fs/nullfs kern sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 20:16:36 -0000 Author: rmacklem Date: Wed Apr 15 20:16:31 2015 New Revision: 281562 URL: https://svnweb.freebsd.org/changeset/base/281562 Log: File systems that do not use the buffer cache (such as ZFS) must use VOP_FSYNC() to perform the NFS server's Commit operation. This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which is set by file systems that use the buffer cache. If this flag is not set, the NFS server always does a VOP_FSYNC(). This should be ok for old file system modules that do not set MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although it might not be optimal for file systems that use the buffer cache. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/nandfs/nandfs_vfsops.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nullfs/null_vfsops.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/ext2fs/ext2_vfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -675,7 +675,8 @@ ext2_mountfs(struct vnode *devvp, struct * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | + MNTK_USES_BCACHE; MNT_IUNLOCK(mp); return (0); out: Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/fuse/fuse_vfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -337,6 +337,7 @@ fuse_vfsop_mount(struct mount *mp) MNT_ILOCK(mp); mp->mnt_data = data; mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ mp->mnt_stat.f_iosize = PAGE_SIZE; Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -759,6 +759,7 @@ mountmsdosfs(struct vnode *devvp, struct mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); if (pmp->pm_flags & MSDOSFS_LARGEFS) Modified: head/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/nandfs/nandfs_vfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -1391,6 +1391,7 @@ nandfs_mountfs(struct vnode *devvp, stru nmp->nm_ronly = ronly; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); nmp->nm_nandfsdev = nandfsdev; /* Add our mountpoint */ Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -1198,7 +1198,8 @@ nfs_mount(struct mount *mp) out: if (!error) { MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF | + MNTK_USES_BCACHE; MNT_IUNLOCK(mp); } return (error); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Wed Apr 15 20:16:31 2015 (r281562) @@ -1270,8 +1270,11 @@ nfsvno_fsync(struct vnode *vp, u_int64_t * file is done. At this time VOP_FSYNC does not accept offset and * byte count parameters so call VOP_FSYNC the whole file for now. * The same is true for NFSv4: RFC 3530 Sec. 14.2.3. + * File systems that do not use the buffer cache (as indicated + * by MNTK_USES_BCACHE not being set) must use VOP_FSYNC(). */ - if (cnt == 0 || cnt > MAX_COMMIT_COUNT) { + if (cnt == 0 || cnt > MAX_COMMIT_COUNT || + (vp->v_mount->mnt_kern_flag & MNTK_USES_BCACHE) == 0) { /* * Give up and do the whole thing */ Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/fs/nullfs/null_vfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -199,7 +199,7 @@ nullfs_mount(struct mount *mp) } mp->mnt_kern_flag |= MNTK_LOOKUP_EXCL_DOTDOT; mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & - MNTK_SUSPENDABLE; + (MNTK_SUSPENDABLE | MNTK_USES_BCACHE); MNT_IUNLOCK(mp); mp->mnt_data = xmp; vfs_getnewfsid(mp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/kern/vfs_subr.c Wed Apr 15 20:16:31 2015 (r281562) @@ -3147,6 +3147,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_VGONE_WAITER); MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); MNT_KERN_FLAG(MNTK_MARKER); + MNT_KERN_FLAG(MNTK_USES_BCACHE); MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/sys/mount.h Wed Apr 15 20:16:31 2015 (r281562) @@ -355,6 +355,7 @@ void __mnt_vnode_markerfree_act #define MNTK_LOOKUP_EXCL_DOTDOT 0x00000800 #define MNTK_MARKER 0x00001000 #define MNTK_UNMAPPED_BUFS 0x00002000 +#define MNTK_USES_BCACHE 0x00004000 /* FS uses the buffer cache. */ #define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Apr 15 18:49:03 2015 (r281561) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Apr 15 20:16:31 2015 (r281562) @@ -1055,7 +1055,8 @@ ffs_mountfs(devvp, mp, td) */ MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | - MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS | MNTK_SUSPENDABLE; + MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS | MNTK_SUSPENDABLE | + MNTK_USES_BCACHE; MNT_IUNLOCK(mp); #ifdef UFS_EXTATTR #ifdef UFS_EXTATTR_AUTOSTART From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 20:55:44 2015 Return-Path: Delivered-To: svn-src-all@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 660CEE5D; Wed, 15 Apr 2015 20:55: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 522EA172; Wed, 15 Apr 2015 20:55: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 t3FKtijg086095; Wed, 15 Apr 2015 20:55:44 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FKtiDU086094; Wed, 15 Apr 2015 20:55:44 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504152055.t3FKtiDU086094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 15 Apr 2015 20:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281563 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 20:55:44 -0000 Author: allanjude (doc committer) Date: Wed Apr 15 20:55:43 2015 New Revision: 281563 URL: https://svnweb.freebsd.org/changeset/base/281563 Log: Fix syntax errors in conditions for new features in freebsd-update Differential Revision: https://reviews.freebsd.org/D1550 Submitted by: kmoore Approved by: delphij Obtained from: PCBSD MFC after: 1 week X-MFC-With: 279571 Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Apr 15 20:16:31 2015 (r281562) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Apr 15 20:55:43 2015 (r281563) @@ -690,7 +690,7 @@ fetch_check_params () { fi # Check that we have updates ready to install - if [ -f ${BDHASH}-install/kerneldone && $FORCEFETCH -eq 0 ]; then + if [ -f ${BDHASH}-install/kerneldone -a $FORCEFETCH -eq 0 ]; then echo "You have a partially completed upgrade pending" echo "Run '$0 install' first." echo "Run '$0 fetch -F' to proceed anyway." @@ -3220,7 +3220,7 @@ get_params () { # Fetch command. Make sure that we're being called # interactively, then run fetch_check_params and fetch_run cmd_fetch () { - if [ ! -t 0 && $NOTTYOK -eq 0 ]; then + if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then echo -n "`basename $0` fetch should not " echo "be run non-interactively." echo "Run `basename $0` cron instead." From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 21:47:22 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Apr 15 21:48:07 2015 Return-Path: Delivered-To: svn-src-all@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 45E8E8BF; Wed, 15 Apr 2015 21:48:07 +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 31C74991; Wed, 15 Apr 2015 21:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FLm76Y010380; Wed, 15 Apr 2015 21:48:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FLm7Hn010379; Wed, 15 Apr 2015 21:48:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504152148.t3FLm7Hn010379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Apr 2015 21:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281565 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 21:48:07 -0000 Author: delphij Date: Wed Apr 15 21:48:06 2015 New Revision: 281565 URL: https://svnweb.freebsd.org/changeset/base/281565 Log: Verify if the saved hostid is still the same and update if it was changed. Sponsored by: iXsystems, Inc. Obtained from: FreeNAS (trueos commit 0abb740) Modified: head/etc/rc.d/hostid_save Modified: head/etc/rc.d/hostid_save ============================================================================== --- head/etc/rc.d/hostid_save Wed Apr 15 21:47:15 2015 (r281564) +++ head/etc/rc.d/hostid_save Wed Apr 15 21:48:06 2015 (r281565) @@ -16,12 +16,19 @@ rcvar="hostid_enable" hostid_save() { - if [ ! -r ${hostid_file} ]; then - $SYSCTL_N kern.hostuuid > ${hostid_file} - if [ $? -ne 0 ]; then - warn "could not store hostuuid in ${hostid_file}." + current_hostid=`$SYSCTL_N kern.hostuuid` + + if [ -r ${hostid_file} ]; then + read saved_hostid < ${hostid_file} + if [ ${saved_hostid} = ${current_hostid} ]; then + exit 0 fi fi + + echo ${current_hostid} > ${hostid_file} + if [ $? -ne 0 ]; then + warn "could not store hostuuid in ${hostid_file}." + fi } load_rc_config $name From owner-svn-src-all@FreeBSD.ORG Wed Apr 15 22:02:53 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Apr 15 22:07:51 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Apr 15 22:15:25 2015 Return-Path: Delivered-To: svn-src-all@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 009433AF; Wed, 15 Apr 2015 22:15:24 +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 C6FEACCB; Wed, 15 Apr 2015 22:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3FMFO6R024658; Wed, 15 Apr 2015 22:15:24 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FMFOYu024657; Wed, 15 Apr 2015 22:15:24 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201504152215.t3FMFOYu024657@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:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r281568 - stable/9/usr.sbin/bluetooth/bthidd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 22:15:25 -0000 Author: rakuco (ports committer) Date: Wed Apr 15 22:15:23 2015 New Revision: 281568 URL: https://svnweb.freebsd.org/changeset/base/281568 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 Reviewed by: emax Approved by: emax Modified: stable/9/usr.sbin/bluetooth/bthidd/hid.c Directory Properties: stable/9/usr.sbin/bluetooth/bthidd/ (props changed) Modified: stable/9/usr.sbin/bluetooth/bthidd/hid.c ============================================================================== --- stable/9/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:07:51 2015 (r281567) +++ stable/9/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:15:23 2015 (r281568) @@ -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-all@FreeBSD.ORG Wed Apr 15 22:17:17 2015 Return-Path: Delivered-To: svn-src-all@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 92B18506; Wed, 15 Apr 2015 22:17: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 7D4EDCEA; Wed, 15 Apr 2015 22:17: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 t3FMHHDs025001; Wed, 15 Apr 2015 22:17:17 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3FMHHdk025000; Wed, 15 Apr 2015 22:17:17 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201504152217.t3FMHHdk025000@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:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r281569 - stable/9/usr.sbin/bluetooth/bthidd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2015 22:17:17 -0000 Author: rakuco (ports committer) Date: Wed Apr 15 22:17:16 2015 New Revision: 281569 URL: https://svnweb.freebsd.org/changeset/base/281569 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/9/usr.sbin/bluetooth/bthidd/hid.c Directory Properties: stable/9/usr.sbin/bluetooth/bthidd/ (props changed) Modified: stable/9/usr.sbin/bluetooth/bthidd/hid.c ============================================================================== --- stable/9/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:15:23 2015 (r281568) +++ stable/9/usr.sbin/bluetooth/bthidd/hid.c Wed Apr 15 22:17:16 2015 (r281569) @@ -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-all@FreeBSD.ORG Thu Apr 16 00:24:23 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:27:54 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:29:50 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:31:52 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:34:43 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:37:06 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:39:17 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 00:44:06 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 01:47:07 2015 Return-Path: Delivered-To: svn-src-all@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 0CD007EC; Thu, 16 Apr 2015 01:47:07 +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 EC55B3F4; Thu, 16 Apr 2015 01:47: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 t3G1l6X0027478; Thu, 16 Apr 2015 01:47:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G1l6WH027477; Thu, 16 Apr 2015 01:47:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504160147.t3G1l6WH027477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Apr 2015 01:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281581 - head/usr.sbin/vidcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 01:47:07 -0000 Author: emaste Date: Thu Apr 16 01:47:05 2015 New Revision: 281581 URL: https://svnweb.freebsd.org/changeset/base/281581 Log: vidcontrol: make size argument optional again for syscons r273544 changed the -f option allow no arguments in vt mode (used to reset the font back to the default), but broke the optionality of the size argument for syscons. Drop the required argument from syscons' optstring for -f so the optional argument handler works the same way for both syscons and vt. Reported by: bde Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Thu Apr 16 00:44:59 2015 (r281580) +++ head/usr.sbin/vidcontrol/vidcontrol.c Thu Apr 16 01:47:05 2015 (r281581) @@ -1343,7 +1343,7 @@ main(int argc, char **argv) if (vt4_mode) opts = "b:Cc:fg:h:Hi:M:m:pPr:S:s:T:t:x"; else - opts = "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x"; + opts = "b:Cc:dfg:h:Hi:l:LM:m:pPr:S:s:T:t:x"; while ((opt = getopt(argc, argv, opts)) != -1) switch(opt) { From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 02:24:41 2015 Return-Path: Delivered-To: svn-src-all@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 ED19A5B7; Thu, 16 Apr 2015 02:24:41 +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 D7ECE9E4; Thu, 16 Apr 2015 02:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G2OftF046403; Thu, 16 Apr 2015 02:24:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G2OfVt046402; Thu, 16 Apr 2015 02:24:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201504160224.t3G2OfVt046402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 16 Apr 2015 02:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281582 - head/usr.bin/lockf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 02:24:42 -0000 Author: bdrewery Date: Thu Apr 16 02:24:40 2015 New Revision: 281582 URL: https://svnweb.freebsd.org/changeset/base/281582 Log: Remove extra flags from r250462. MFC after: 1 week Modified: head/usr.bin/lockf/lockf.c Modified: head/usr.bin/lockf/lockf.c ============================================================================== --- head/usr.bin/lockf/lockf.c Thu Apr 16 01:47:05 2015 (r281581) +++ head/usr.bin/lockf/lockf.c Thu Apr 16 02:24:40 2015 (r281582) @@ -169,7 +169,7 @@ acquire_lock(const char *name, int flags { int fd; - if ((fd = open(name, flags|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { + if ((fd = open(name, O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); err(EX_CANTCREAT, "cannot open %s", name); From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 02:44:38 2015 Return-Path: Delivered-To: svn-src-all@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 B224E80D; Thu, 16 Apr 2015 02:44:38 +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 9CF94BA8; Thu, 16 Apr 2015 02:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G2ic7H056814; Thu, 16 Apr 2015 02:44:38 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G2icO1056813; Thu, 16 Apr 2015 02:44:38 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201504160244.t3G2icO1056813@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 16 Apr 2015 02:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281583 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 02:44:38 -0000 Author: araujo (ports committer) Date: Thu Apr 16 02:44:37 2015 New Revision: 281583 URL: https://svnweb.freebsd.org/changeset/base/281583 Log: Remove duplicate header entry. Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Apr 16 02:24:40 2015 (r281582) +++ head/sys/net/route.c Thu Apr 16 02:44:37 2015 (r281583) @@ -43,7 +43,6 @@ #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 03:35:49 2015 Return-Path: Delivered-To: svn-src-all@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 052F8EE4; Thu, 16 Apr 2015 03:35:49 +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 E41B6178; Thu, 16 Apr 2015 03:35: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 t3G3Zm1o082272; Thu, 16 Apr 2015 03:35:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G3ZmSM082269; Thu, 16 Apr 2015 03:35:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201504160335.t3G3ZmSM082269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 16 Apr 2015 03:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281584 - in head/contrib/pjdfstest/tests: open truncate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 03:35:49 -0000 Author: ngie Date: Thu Apr 16 03:35:47 2015 New Revision: 281584 URL: https://svnweb.freebsd.org/changeset/base/281584 Log: Fix race when testing for ETXTBSY writing to ${n0} (process image) by making sure the process has been started beforehand with pgrep pkill the process afterwards to make sure it's dead when the unlink is run (not strictly required, but I was being conservative) MFC after: 1 week Reviewed by: Darius O'Conner, mjohnston Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/pjdfstest/tests/open/20.t head/contrib/pjdfstest/tests/truncate/11.t Modified: head/contrib/pjdfstest/tests/open/20.t ============================================================================== --- head/contrib/pjdfstest/tests/open/20.t Thu Apr 16 02:44:37 2015 (r281583) +++ head/contrib/pjdfstest/tests/open/20.t Thu Apr 16 03:35:47 2015 (r281584) @@ -14,7 +14,11 @@ n0=`namegen` cp -pf `which sleep` ${n0} ./${n0} 3 & +while ! pkill -0 -f ./${n0}; do + sleep 0.1 +done expect ETXTBSY open ${n0} O_WRONLY expect ETXTBSY open ${n0} O_RDWR expect ETXTBSY open ${n0} O_RDONLY,O_TRUNC +pkill -9 -f ./${n0} expect 0 unlink ${n0} Modified: head/contrib/pjdfstest/tests/truncate/11.t ============================================================================== --- head/contrib/pjdfstest/tests/truncate/11.t Thu Apr 16 02:44:37 2015 (r281583) +++ head/contrib/pjdfstest/tests/truncate/11.t Thu Apr 16 03:35:47 2015 (r281584) @@ -14,5 +14,9 @@ n0=`namegen` cp -pf `which sleep` ${n0} ./${n0} 3 & +while ! pkill -0 -f ./${n0}; do + sleep 0.1 +done expect ETXTBSY truncate ${n0} 123 +pkill -9 -f ./${n0} expect 0 unlink ${n0} From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 03:52:12 2015 Return-Path: Delivered-To: svn-src-all@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 B5B5F2F9; Thu, 16 Apr 2015 03:52:12 +0000 (UTC) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76A1E34B; Thu, 16 Apr 2015 03:52:12 +0000 (UTC) Received: by igblo3 with SMTP id lo3so41587359igb.0; Wed, 15 Apr 2015 20:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=F9AjqdXnnRd8x6s+9QuDv8ouH6TRdGl9PW81S1H0mso=; b=FDweNx8y/1+S8b9c4qKH+RXDqniEeFCAGOT52dPCEPQgeYClsRF1mHQP9V56rN2gQX AO4Yt9TUkoLvZdZ4BbkQKwOJ4UGBSYQ5jQ2azvXMEowR2hWIIrVutfMVbEypRT/DK9Po mBwk8rwDH64ROySNdUBtWbuUJgRheL9AUpYB1JoD2RhCNvhz0JdA5pDb8ASn3XBJ58F4 f6QZjq/nz44Co6190mGYnJRTnXex2HmByj3i/mecnfOK5spdHbkPqpsMlgFQSYHo1UyD C/OfU6D83VVc/2zEAwNKGJcWVb4ntlSs5gVhKkThKzgWiGwTIx4LwvStcwmTK2lYf2vw z4Dw== MIME-Version: 1.0 X-Received: by 10.107.155.13 with SMTP id d13mr39620695ioe.29.1429156331886; Wed, 15 Apr 2015 20:52:11 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Wed, 15 Apr 2015 20:52:11 -0700 (PDT) In-Reply-To: <20150415210424.2fc38e39@kalimero.tijl.coosemans.org> References: <201504150909.t3F99LFB048690@svn.freebsd.org> <20150415210424.2fc38e39@kalimero.tijl.coosemans.org> Date: Wed, 15 Apr 2015 20:52:11 -0700 X-Google-Sender-Auth: KLeRUhWOBbQuEgTXAzm1NcZpLuk Message-ID: Subject: Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH... From: Adrian Chadd To: Tijl Coosemans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 03:52:12 -0000 adrian@adrian-hackbox:~/work/freebsd/embedded/head/src % cat ../root/make.conf.mips MALLOC_PRODUCTION= adrian@adrian-hackbox:~/work/freebsd/embedded/head/src % cat ../root/src.conf.mips WITHOUT_KERBEROS="YES" WITHOUT_KERBEROS_SUPPORT="YES" WITHOUT_NIS="YES" WITHOUT_NDIS="YES" WITHOUT_IPX="YES" WITHOUT_ATM="YES" WITHOUT_ICONV="YES" WITHOUT_CLANG_IS_CC="YES" WITHOUT_CASPER="YES" WITHOUT_CAPSICUM="YES" WITHOUT_TESTS="YES" On 15 April 2015 at 12:04, Tijl Coosemans wrote: > On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd wrote: >> cc1: warnings being treated as errors >> /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c: >> In function 'iconv_catgets': >> /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599: >> warning: passing argument 2 of 'dl_iconv' from incompatible pointer >> type > > Does "embedded" mean that WITHOUT_ICONV is defined? > Can you try the attached patch? From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 04:04:19 2015 Return-Path: Delivered-To: svn-src-all@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 849874F4; Thu, 16 Apr 2015 04:04:19 +0000 (UTC) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4575761A; Thu, 16 Apr 2015 04:04:19 +0000 (UTC) Received: by igblo3 with SMTP id lo3so103617307igb.1; Wed, 15 Apr 2015 21:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=SKNRwMLyXuscJ13fBiEgVg2fXIacml7Vr7lAMOLjiRM=; b=hqsGuxyZ8q+bBqoiDm3shvrJoWx/r+rwAA47ZyzEnE8ZyyNYRGcTF/hpMkKuRQTcza V7w5xA3i0NfHwlQ2sdW8ceabzU2xC16Rbcl9KbIpd+HnBUDr7vHFES7xRkn7C0pZRGGy H8Glfuba+wTeVEM/GJbjZUyuQuNNmMbt48LNMl0cKRiGdLaLyd9mwFAmMqWZCQSCcI0V FHU7pfr78x/xhCAFPKUzcGr7QML/tAFJJWP+4iO74+PlmvKc6Z1KKbYCgq7U8B0KtMKe 9nDFpAjZPLGq09YYxahpbM1coA5dXsWBOPwqUAaNUi0aWfeu3U84nz/fAoZvE/D6me21 SaXA== MIME-Version: 1.0 X-Received: by 10.107.155.13 with SMTP id d13mr39661332ioe.29.1429157057255; Wed, 15 Apr 2015 21:04:17 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Wed, 15 Apr 2015 21:04:17 -0700 (PDT) In-Reply-To: References: <201504150909.t3F99LFB048690@svn.freebsd.org> <20150415210424.2fc38e39@kalimero.tijl.coosemans.org> Date: Wed, 15 Apr 2015 21:04:17 -0700 X-Google-Sender-Auth: hFSQkaM5P2HbduUjDq8WDZwduDE Message-ID: Subject: Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH... From: Adrian Chadd To: Tijl Coosemans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 04:04:19 -0000 Yes, that patch does the job. -a From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 07:17:01 2015 Return-Path: Delivered-To: svn-src-all@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 97ADF71C; Thu, 16 Apr 2015 07:17: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 839BDA7D; Thu, 16 Apr 2015 07:17:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G7H1tk085416; Thu, 16 Apr 2015 07:17:01 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G7H1Gf085415; Thu, 16 Apr 2015 07:17:01 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201504160717.t3G7H1Gf085415@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 16 Apr 2015 07:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281591 - head/bin/csh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 07:17:01 -0000 Author: tijl Date: Thu Apr 16 07:17:00 2015 New Revision: 281591 URL: https://svnweb.freebsd.org/changeset/base/281591 Log: Fix build after r281550 when WITHOUT_ICONV is defined. Reported by: adrian MFC after: 2 weeks Modified: head/bin/csh/iconv_stub.h Modified: head/bin/csh/iconv_stub.h ============================================================================== --- head/bin/csh/iconv_stub.h Thu Apr 16 06:23:58 2015 (r281590) +++ head/bin/csh/iconv_stub.h Thu Apr 16 07:17:00 2015 (r281591) @@ -30,7 +30,7 @@ #define _ICONV_H_ typedef void *iconv_t; -typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *); +typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *); typedef int dl_iconv_close_t(iconv_t); extern iconv_t dl_iconv_open(const char *, const char *); From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 07:40:02 2015 Return-Path: Delivered-To: svn-src-all@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 9726FDEB; Thu, 16 Apr 2015 07:40:02 +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 83233CAA; Thu, 16 Apr 2015 07:40:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G7e27g095159; Thu, 16 Apr 2015 07:40:02 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3G7e2s7095158; Thu, 16 Apr 2015 07:40:02 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201504160740.t3G7e2s7095158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 16 Apr 2015 07:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281592 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 07:40:02 -0000 Author: kevlo Date: Thu Apr 16 07:40:01 2015 New Revision: 281592 URL: https://svnweb.freebsd.org/changeset/base/281592 Log: Enable LDO to 2.5V before efuse r/w action in order to prevent incorrect mac address read from efuse. Reported by: swills Tested by: rpaulo and myself on RPi Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 16 07:17:00 2015 (r281591) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 16 07:40:01 2015 (r281592) @@ -1195,7 +1195,7 @@ urtwn_efuse_read(struct urtwn_softc *sc) uint8_t *rom = (uint8_t *)&sc->rom; uint16_t addr = 0; uint32_t reg; - uint8_t off, msk; + uint8_t off, msk, vol; int i; urtwn_efuse_switch_power(sc); @@ -1228,10 +1228,15 @@ urtwn_efuse_read(struct urtwn_softc *sc) printf("\n"); } #endif + /* Disable LDO 2.5V. */ + vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); + urtwn_write_1(sc, R92C_EFUSE_TEST + 3, vol & ~(0x80)); + } static void urtwn_efuse_switch_power(struct urtwn_softc *sc) { + uint8_t vol; uint32_t reg; reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); @@ -1250,6 +1255,12 @@ urtwn_efuse_switch_power(struct urtwn_so urtwn_write_2(sc, R92C_SYS_CLKR, reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); } + + /* Enable LDO 2.5V. */ + vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); + vol &= 0x0f; + vol |= 0x30; + urtwn_write_1(sc, R92C_EFUSE_TEST + 3, (vol | 0x80)); } static int From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 10:00:08 2015 Return-Path: Delivered-To: svn-src-all@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 809AAFED; Thu, 16 Apr 2015 10:00:08 +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 6B140E5A; Thu, 16 Apr 2015 10:00:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GA08jk058971; Thu, 16 Apr 2015 10:00:08 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GA07VV058965; Thu, 16 Apr 2015 10:00:07 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201504161000.t3GA07VV058965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Thu, 16 Apr 2015 10:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281599 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 10:00:08 -0000 Author: jch Date: Thu Apr 16 10:00:06 2015 New Revision: 281599 URL: https://svnweb.freebsd.org/changeset/base/281599 Log: Fix an old and well-documented use-after-free race condition in TCP timers: - Add a reference from tcpcb to its inpcb - Defer tcpcb deletion until TCP timers have finished Differential Revision: https://reviews.freebsd.org/D2079 Submitted by: jch, Marc De La Gueronniere Reviewed by: imp, rrs, adrian, jhb, bz Approved by: jhb Sponsored by: Verisign, Inc. Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Apr 16 09:41:37 2015 (r281598) +++ head/sys/netinet/tcp_subr.c Thu Apr 16 10:00:06 2015 (r281599) @@ -230,6 +230,7 @@ static struct inpcb *tcp_notify(struct i static struct inpcb *tcp_mtudisc_notify(struct inpcb *, int); static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr); +static void tcp_timer_discard(struct tcpcb *, uint32_t); /* * Target size of TCP PCB hash tables. Must be a power of two. @@ -801,7 +802,13 @@ tcp_newtcpcb(struct inpcb *inp) if (V_tcp_do_sack) tp->t_flags |= TF_SACK_PERMIT; TAILQ_INIT(&tp->snd_holes); - tp->t_inpcb = inp; /* XXX */ + /* + * The tcpcb will hold a reference on its inpcb until tcp_discardcb() + * is called. + */ + in_pcbref(inp); /* Reference for tcpcb */ + tp->t_inpcb = inp; + /* * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no * rtt estimate. Set rttvar so that srtt + 4 * rttvar gives @@ -920,6 +927,7 @@ tcp_discardcb(struct tcpcb *tp) #ifdef INET6 int isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif /* INET6 */ + int released; INP_WLOCK_ASSERT(inp); @@ -927,22 +935,15 @@ tcp_discardcb(struct tcpcb *tp) * Make sure that all of our timers are stopped before we delete the * PCB. * - * XXXRW: Really, we would like to use callout_drain() here in order - * to avoid races experienced in tcp_timer.c where a timer is already - * executing at this point. However, we can't, both because we're - * running in a context where we can't sleep, and also because we - * hold locks required by the timers. What we instead need to do is - * test to see if callout_drain() is required, and if so, defer some - * portion of the remainder of tcp_discardcb() to an asynchronous - * context that can callout_drain() and then continue. Some care - * will be required to ensure that no further processing takes place - * on the tcpcb, even though it hasn't been freed (a flag?). - */ - callout_stop(&tp->t_timers->tt_rexmt); - callout_stop(&tp->t_timers->tt_persist); - callout_stop(&tp->t_timers->tt_keep); - callout_stop(&tp->t_timers->tt_2msl); - callout_stop(&tp->t_timers->tt_delack); + * If stopping a timer fails, we schedule a discard function in same + * callout, and the last discard function called will take care of + * deleting the tcpcb. + */ + tcp_timer_stop(tp, TT_REXMT); + tcp_timer_stop(tp, TT_PERSIST); + tcp_timer_stop(tp, TT_KEEP); + tcp_timer_stop(tp, TT_2MSL); + tcp_timer_stop(tp, TT_DELACK); /* * If we got enough samples through the srtt filter, @@ -1019,8 +1020,80 @@ tcp_discardcb(struct tcpcb *tp) CC_ALGO(tp) = NULL; inp->inp_ppcb = NULL; - tp->t_inpcb = NULL; - uma_zfree(V_tcpcb_zone, tp); + if ((tp->t_timers->tt_flags & TT_MASK) == 0) { + /* We own the last reference on tcpcb, let's free it. */ + tp->t_inpcb = NULL; + uma_zfree(V_tcpcb_zone, tp); + released = in_pcbrele_wlocked(inp); + KASSERT(!released, ("%s: inp %p should not have been released " + "here", __func__, inp)); + } +} + +void +tcp_timer_2msl_discard(void *xtp) +{ + + tcp_timer_discard((struct tcpcb *)xtp, TT_2MSL); +} + +void +tcp_timer_keep_discard(void *xtp) +{ + + tcp_timer_discard((struct tcpcb *)xtp, TT_KEEP); +} + +void +tcp_timer_persist_discard(void *xtp) +{ + + tcp_timer_discard((struct tcpcb *)xtp, TT_PERSIST); +} + +void +tcp_timer_rexmt_discard(void *xtp) +{ + + tcp_timer_discard((struct tcpcb *)xtp, TT_REXMT); +} + +void +tcp_timer_delack_discard(void *xtp) +{ + + tcp_timer_discard((struct tcpcb *)xtp, TT_DELACK); +} + +void +tcp_timer_discard(struct tcpcb *tp, uint32_t timer_type) +{ + struct inpcb *inp; + + CURVNET_SET(tp->t_vnet); + INP_INFO_WLOCK(&V_tcbinfo); + inp = tp->t_inpcb; + KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", + __func__, tp)); + INP_WLOCK(inp); + KASSERT((tp->t_timers->tt_flags & TT_STOPPED) != 0, + ("%s: tcpcb has to be stopped here", __func__)); + KASSERT((tp->t_timers->tt_flags & timer_type) != 0, + ("%s: discard callout should be running", __func__)); + tp->t_timers->tt_flags &= ~timer_type; + if ((tp->t_timers->tt_flags & TT_MASK) == 0) { + /* We own the last reference on this tcpcb, let's free it. */ + tp->t_inpcb = NULL; + uma_zfree(V_tcpcb_zone, tp); + if (in_pcbrele_wlocked(inp)) { + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } + } + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); } /* Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Apr 16 09:41:37 2015 (r281598) +++ head/sys/netinet/tcp_timer.c Thu Apr 16 10:00:06 2015 (r281599) @@ -258,10 +258,6 @@ int tcp_backoff[TCP_MAXRXTSHIFT + 1] = static int tcp_totbackoff = 2559; /* sum of tcp_backoff[] */ -static int tcp_timer_race; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, timer_race, CTLFLAG_RD, &tcp_timer_race, - 0, "Count of t_inpcb races on tcp_discardcb"); - /* * TCP timer processing. */ @@ -274,18 +270,7 @@ tcp_timer_delack(void *xtp) CURVNET_SET(tp->t_vnet); inp = tp->t_inpcb; - /* - * XXXRW: While this assert is in fact correct, bugs in the tcpcb - * tear-down mean we need it as a work-around for races between - * timers and tcp_discardcb(). - * - * KASSERT(inp != NULL, ("tcp_timer_delack: inp == NULL")); - */ - if (inp == NULL) { - tcp_timer_race++; - CURVNET_RESTORE(); - return; - } + KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_delack) || !callout_active(&tp->t_timers->tt_delack)) { @@ -299,6 +284,10 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); return; } + KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, + ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); + KASSERT((tp->t_timers->tt_flags & TT_DELACK) != 0, + ("%s: tp %p delack callout should be running", __func__, tp)); tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); @@ -318,24 +307,9 @@ tcp_timer_2msl(void *xtp) ostate = tp->t_state; #endif - /* - * XXXRW: Does this actually happen? - */ INP_INFO_WLOCK(&V_tcbinfo); inp = tp->t_inpcb; - /* - * XXXRW: While this assert is in fact correct, bugs in the tcpcb - * tear-down mean we need it as a work-around for races between - * timers and tcp_discardcb(). - * - * KASSERT(inp != NULL, ("tcp_timer_2msl: inp == NULL")); - */ - if (inp == NULL) { - tcp_timer_race++; - INP_INFO_WUNLOCK(&V_tcbinfo); - CURVNET_RESTORE(); - return; - } + KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); tcp_free_sackholes(tp); if (callout_pending(&tp->t_timers->tt_2msl) || @@ -352,6 +326,10 @@ tcp_timer_2msl(void *xtp) CURVNET_RESTORE(); return; } + KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, + ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); + KASSERT((tp->t_timers->tt_flags & TT_2MSL) != 0, + ("%s: tp %p 2msl callout should be running", __func__, tp)); /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle @@ -402,19 +380,7 @@ tcp_timer_keep(void *xtp) #endif INP_INFO_WLOCK(&V_tcbinfo); inp = tp->t_inpcb; - /* - * XXXRW: While this assert is in fact correct, bugs in the tcpcb - * tear-down mean we need it as a work-around for races between - * timers and tcp_discardcb(). - * - * KASSERT(inp != NULL, ("tcp_timer_keep: inp == NULL")); - */ - if (inp == NULL) { - tcp_timer_race++; - INP_INFO_WUNLOCK(&V_tcbinfo); - CURVNET_RESTORE(); - return; - } + KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_keep) || !callout_active(&tp->t_timers->tt_keep)) { @@ -430,6 +396,10 @@ tcp_timer_keep(void *xtp) CURVNET_RESTORE(); return; } + KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, + ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); + KASSERT((tp->t_timers->tt_flags & TT_KEEP) != 0, + ("%s: tp %p keep callout should be running", __func__, tp)); /* * Keep-alive timer went off; send something * or drop connection if idle for too long. @@ -505,19 +475,7 @@ tcp_timer_persist(void *xtp) #endif INP_INFO_WLOCK(&V_tcbinfo); inp = tp->t_inpcb; - /* - * XXXRW: While this assert is in fact correct, bugs in the tcpcb - * tear-down mean we need it as a work-around for races between - * timers and tcp_discardcb(). - * - * KASSERT(inp != NULL, ("tcp_timer_persist: inp == NULL")); - */ - if (inp == NULL) { - tcp_timer_race++; - INP_INFO_WUNLOCK(&V_tcbinfo); - CURVNET_RESTORE(); - return; - } + KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_persist) || !callout_active(&tp->t_timers->tt_persist)) { @@ -533,6 +491,10 @@ tcp_timer_persist(void *xtp) CURVNET_RESTORE(); return; } + KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, + ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); + KASSERT((tp->t_timers->tt_flags & TT_PERSIST) != 0, + ("%s: tp %p persist callout should be running", __func__, tp)); /* * Persistance timer into zero window. * Force a byte to be output, if possible. @@ -594,19 +556,7 @@ tcp_timer_rexmt(void * xtp) INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; - /* - * XXXRW: While this assert is in fact correct, bugs in the tcpcb - * tear-down mean we need it as a work-around for races between - * timers and tcp_discardcb(). - * - * KASSERT(inp != NULL, ("tcp_timer_rexmt: inp == NULL")); - */ - if (inp == NULL) { - tcp_timer_race++; - INP_INFO_RUNLOCK(&V_tcbinfo); - CURVNET_RESTORE(); - return; - } + KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_rexmt) || !callout_active(&tp->t_timers->tt_rexmt)) { @@ -622,6 +572,10 @@ tcp_timer_rexmt(void * xtp) CURVNET_RESTORE(); return; } + KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, + ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); + KASSERT((tp->t_timers->tt_flags & TT_REXMT) != 0, + ("%s: tp %p rexmt callout should be running", __func__, tp)); tcp_free_sackholes(tp); /* * Retransmission timer went off. Message has not @@ -850,7 +804,7 @@ out: } void -tcp_timer_activate(struct tcpcb *tp, int timer_type, u_int delta) +tcp_timer_activate(struct tcpcb *tp, uint32_t timer_type, u_int delta) { struct callout *t_callout; timeout_t *f_callout; @@ -862,6 +816,9 @@ tcp_timer_activate(struct tcpcb *tp, int return; #endif + if (tp->t_timers->tt_flags & TT_STOPPED) + return; + switch (timer_type) { case TT_DELACK: t_callout = &tp->t_timers->tt_delack; @@ -887,14 +844,23 @@ tcp_timer_activate(struct tcpcb *tp, int panic("tp %p bad timer_type %#x", tp, timer_type); } if (delta == 0) { - callout_stop(t_callout); + if ((tp->t_timers->tt_flags & timer_type) && + callout_stop(t_callout)) { + tp->t_timers->tt_flags &= ~timer_type; + } } else { - callout_reset_on(t_callout, delta, f_callout, tp, cpu); + if ((tp->t_timers->tt_flags & timer_type) == 0) { + tp->t_timers->tt_flags |= timer_type; + callout_reset_on(t_callout, delta, f_callout, tp, cpu); + } else { + /* Reset already running callout on the same CPU. */ + callout_reset(t_callout, delta, f_callout, tp); + } } } int -tcp_timer_active(struct tcpcb *tp, int timer_type) +tcp_timer_active(struct tcpcb *tp, uint32_t timer_type) { struct callout *t_callout; @@ -920,6 +886,58 @@ tcp_timer_active(struct tcpcb *tp, int t return callout_active(t_callout); } +void +tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type) +{ + struct callout *t_callout; + timeout_t *f_callout; + + tp->t_timers->tt_flags |= TT_STOPPED; + + switch (timer_type) { + case TT_DELACK: + t_callout = &tp->t_timers->tt_delack; + f_callout = tcp_timer_delack_discard; + break; + case TT_REXMT: + t_callout = &tp->t_timers->tt_rexmt; + f_callout = tcp_timer_rexmt_discard; + break; + case TT_PERSIST: + t_callout = &tp->t_timers->tt_persist; + f_callout = tcp_timer_persist_discard; + break; + case TT_KEEP: + t_callout = &tp->t_timers->tt_keep; + f_callout = tcp_timer_keep_discard; + break; + case TT_2MSL: + t_callout = &tp->t_timers->tt_2msl; + f_callout = tcp_timer_2msl_discard; + break; + default: + panic("tp %p bad timer_type %#x", tp, timer_type); + } + + if (tp->t_timers->tt_flags & timer_type) { + if (callout_stop(t_callout)) { + tp->t_timers->tt_flags &= ~timer_type; + } else { + /* + * Can't stop the callout, defer tcpcb actual deletion + * to the last tcp timer discard callout. + * The TT_STOPPED flag will ensure that no tcp timer + * callouts can be restarted on our behalf, and + * past this point currently running callouts waiting + * on inp lock will return right away after the + * classical check for callout reset/stop events: + * callout_pending() || !callout_active() + */ + callout_reset(t_callout, 1, f_callout, tp); + } + } +} + #define ticks_to_msecs(t) (1000*(t) / hz) void Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Thu Apr 16 09:41:37 2015 (r281598) +++ head/sys/netinet/tcp_timer.h Thu Apr 16 10:00:06 2015 (r281599) @@ -146,12 +146,21 @@ struct tcp_timer { struct callout tt_keep; /* keepalive */ struct callout tt_2msl; /* 2*msl TIME_WAIT timer */ struct callout tt_delack; /* delayed ACK timer */ + uint32_t tt_flags; /* Timers flags */ + uint32_t tt_spare; /* TDB */ }; -#define TT_DELACK 0x01 -#define TT_REXMT 0x02 -#define TT_PERSIST 0x04 -#define TT_KEEP 0x08 -#define TT_2MSL 0x10 + +/* + * Flags for the tt_flags field. + */ +#define TT_DELACK 0x0001 +#define TT_REXMT 0x0002 +#define TT_PERSIST 0x0004 +#define TT_KEEP 0x0008 +#define TT_2MSL 0x0010 +#define TT_MASK (TT_DELACK|TT_REXMT|TT_PERSIST|TT_KEEP|TT_2MSL) + +#define TT_STOPPED 0x00010000 #define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) #define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) @@ -183,6 +192,11 @@ void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); void tcp_timer_delack(void *xtp); +void tcp_timer_2msl_discard(void *xtp); +void tcp_timer_keep_discard(void *xtp); +void tcp_timer_persist_discard(void *xtp); +void tcp_timer_rexmt_discard(void *xtp); +void tcp_timer_delack_discard(void *xtp); void tcp_timer_to_xtimer(struct tcpcb *tp, struct tcp_timer *timer, struct xtcp_timer *xtimer); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Apr 16 09:41:37 2015 (r281598) +++ head/sys/netinet/tcp_var.h Thu Apr 16 10:00:06 2015 (r281599) @@ -708,8 +708,9 @@ void tcp_slowtimo(void); struct tcptemp * tcpip_maketemplate(struct inpcb *); void tcpip_fillheaders(struct inpcb *, void *, void *); -void tcp_timer_activate(struct tcpcb *, int, u_int); -int tcp_timer_active(struct tcpcb *, int); +void tcp_timer_activate(struct tcpcb *, uint32_t, u_int); +int tcp_timer_active(struct tcpcb *, uint32_t); +void tcp_timer_stop(struct tcpcb *, uint32_t); void tcp_trace(short, short, struct tcpcb *, void *, struct tcphdr *, int); /* * All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo) From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 12:54:29 2015 Return-Path: Delivered-To: svn-src-all@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 03A59A67; Thu, 16 Apr 2015 12:54: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 E34C37DF; Thu, 16 Apr 2015 12:54:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GCsSvV045037; Thu, 16 Apr 2015 12:54:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GCsSvH045036; Thu, 16 Apr 2015 12:54:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504161254.t3GCsSvH045036@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Apr 2015 12:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281600 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 12:54:29 -0000 Author: emaste Date: Thu Apr 16 12:54:28 2015 New Revision: 281600 URL: https://svnweb.freebsd.org/changeset/base/281600 Log: compiler_rt: add floatunsitf for arm64 It provides unsigned integer to quad-precision conversion. Sponsored by: The FreeBSD Foundation Modified: head/lib/libcompiler_rt/Makefile Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Thu Apr 16 10:00:06 2015 (r281599) +++ head/lib/libcompiler_rt/Makefile Thu Apr 16 12:54:28 2015 (r281600) @@ -144,6 +144,7 @@ SRCF+= addtf3 \ fixunstfdi \ fixunstfsi \ fixunstfti \ + floatunsitf \ multf3 \ subtf3 \ trunctfdf2 \ From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 12:58:51 2015 Return-Path: Delivered-To: svn-src-all@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 DC5DACDA; Thu, 16 Apr 2015 12:58: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 C8175827; Thu, 16 Apr 2015 12:58: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 t3GCwpvu045832; Thu, 16 Apr 2015 12:58:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GCwpjg045831; Thu, 16 Apr 2015 12:58:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504161258.t3GCwpjg045831@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 12:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281601 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 12:58:52 -0000 Author: jhb Date: Thu Apr 16 12:58:51 2015 New Revision: 281601 URL: https://svnweb.freebsd.org/changeset/base/281601 Log: Remove THRMISC_VERSION. The thrmisc structure doesn't include a version number, so this wasn't used (and can't easily be added). If at some point we want to extend thrmisc, we will probably need to just add a new note type and ensure that the new type includes a version number. Discussed with: kib MFC after: 2 weeks Modified: head/sys/sys/procfs.h Modified: head/sys/sys/procfs.h ============================================================================== --- head/sys/sys/procfs.h Thu Apr 16 12:54:28 2015 (r281600) +++ head/sys/sys/procfs.h Thu Apr 16 12:58:51 2015 (r281601) @@ -80,8 +80,6 @@ typedef struct prpsinfo { char pr_psargs[PRARGSZ+1]; /* Arguments, null terminated (1) */ } prpsinfo_t; -#define THRMISC_VERSION 1 /* Current version of thrmisc_t */ - typedef struct thrmisc { char pr_tname[MAXCOMLEN+1]; /* Thread name, null terminated (1) */ u_int _pad; /* Convenience pad, 0-filled (1) */ From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 13:25:23 2015 Return-Path: Delivered-To: svn-src-all@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 CF7F02F1; Thu, 16 Apr 2015 13:25: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 BBB76B67; Thu, 16 Apr 2015 13:25: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 t3GDPNLf059781; Thu, 16 Apr 2015 13:25:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GDPNAR059780; Thu, 16 Apr 2015 13:25:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504161325.t3GDPNAR059780@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 13:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r281602 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 13:25:23 -0000 Author: jhb Date: Thu Apr 16 13:25:22 2015 New Revision: 281602 URL: https://svnweb.freebsd.org/changeset/base/281602 Log: Release Julien Charbon (jch@) from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Apr 16 12:58:51 2015 (r281601) +++ svnadmin/conf/mentors Thu Apr 16 13:25:22 2015 (r281602) @@ -19,7 +19,6 @@ eri gnn Co-mentor: thompsa erj gnn Co-mentor: jfv jah kib jceel wkoszek Co-mentor: cognet -jch jhb jkh rwatson jonathan rwatson jwd rmacklem From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 15:09:47 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 15:34:23 2015 Return-Path: Delivered-To: svn-src-all@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 75838BC7; Thu, 16 Apr 2015 15:34: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 4712BCC7; Thu, 16 Apr 2015 15:34: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 t3GFYNSO022438; Thu, 16 Apr 2015 15:34:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GFYM05022436; Thu, 16 Apr 2015 15:34:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201504161534.t3GFYM05022436@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 16 Apr 2015 15:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281604 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 15:34:23 -0000 Author: brooks Date: Thu Apr 16 15:34:22 2015 New Revision: 281604 URL: https://svnweb.freebsd.org/changeset/base/281604 Log: Make it harder to specify invalid LIBADD by causing values without corresponding DPADD_ variables to produce a useful error message. Differential Revision: https://reviews.freebsd.org/D2295 Reviewed by: bapt Sponsored by: DARPA, AFRL Modified: head/UPDATING head/share/mk/src.libnames.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Apr 16 15:09:46 2015 (r281603) +++ head/UPDATING Thu Apr 16 15:34:22 2015 (r281604) @@ -35,6 +35,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 The const qualifier has been removed from iconv(3) to comply with POSIX. The ports tree is aware of this from r384038 onwards. +20150416: + Libraries specified by LIBADD in Makefiles must have a corresponding + DPADD_ variable to ensure correct dependencies. This is now + enforced in src.libnames.mk. + 20150324: From legacy ata(4) driver was removed support for SATA controllers supported by more functional drivers ahci(4), siis(4) and mvs(4). Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Thu Apr 16 15:09:46 2015 (r281603) +++ head/share/mk/src.libnames.mk Thu Apr 16 15:34:22 2015 (r281604) @@ -282,10 +282,14 @@ LDADD_gssapi_krb5+= ${LDADD_pthread} .if ${_PRIVATELIBS:M${_l}} USEPRIVATELIB+= ${_l} .endif -DPADD+= ${DPADD_${_l}} +DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}} LDADD+= ${LDADD_${_l}} .endfor +.if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} +.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". +.endif + .if defined(USEPRIVATELIB) LDFLAGS+= -rpath ${LIBPRIVATEDIR} .endif From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 15:35:18 2015 Return-Path: Delivered-To: svn-src-all@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 4F82BD20; Thu, 16 Apr 2015 15:35: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 3B95BCDC; Thu, 16 Apr 2015 15:35: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 t3GFZI1w022641; Thu, 16 Apr 2015 15:35:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GFZISH022640; Thu, 16 Apr 2015 15:35:18 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201504161535.t3GFZISH022640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 16 Apr 2015 15:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281605 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 15:35:18 -0000 Author: brooks Date: Thu Apr 16 15:35:17 2015 New Revision: 281605 URL: https://svnweb.freebsd.org/changeset/base/281605 Log: Fix a minor function definition inconsistancy. MFC after: 3 days Modified: head/share/man/man3/queue.3 Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Thu Apr 16 15:34:22 2015 (r281604) +++ head/share/man/man3/queue.3 Thu Apr 16 15:35:17 2015 (r281605) @@ -147,7 +147,7 @@ lists and tail queues .Fn STAILQ_INSERT_AFTER "STAILQ_HEAD *head" "TYPE *listelm" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_INSERT_HEAD "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" -.Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE" "STAILQ_ENTRY NAME" +.Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 17:42:54 2015 Return-Path: Delivered-To: svn-src-all@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 E5FC3B67; Thu, 16 Apr 2015 17:42: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 D0DAFE37; Thu, 16 Apr 2015 17:42: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 t3GHgrPm084333; Thu, 16 Apr 2015 17:42:53 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GHgrkG084329; Thu, 16 Apr 2015 17:42:53 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201504161742.t3GHgrkG084329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Thu, 16 Apr 2015 17:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281606 - head/sys/crypto/aesni X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 17:42:54 -0000 Author: rodrigc Date: Thu Apr 16 17:42:52 2015 New Revision: 281606 URL: https://svnweb.freebsd.org/changeset/base/281606 Log: In the version of gcc in the FreeBSD tree, this modification was made to the compiler in svn r242182: #if STDC_HOSTED #include #endif A similar change was done to clang in the FreeBSD tree in svn r218893: However, for external gcc toolchains, this patch is not in the compiler's header file. This patch to FreeBSD's aesni code allows compilation with an external gcc toolchain. Differential Revision: https://reviews.freebsd.org/D2285 Reviewed by: jmg, dim Approved by: dim Added: head/sys/crypto/aesni/aesni_os.h (contents, props changed) Modified: head/sys/crypto/aesni/aesencdec.h head/sys/crypto/aesni/aesni_ghash.c Modified: head/sys/crypto/aesni/aesencdec.h ============================================================================== --- head/sys/crypto/aesni/aesencdec.h Thu Apr 16 15:35:17 2015 (r281605) +++ head/sys/crypto/aesni/aesencdec.h Thu Apr 16 17:42:52 2015 (r281606) @@ -27,6 +27,8 @@ * */ +#include + #include static inline void Modified: head/sys/crypto/aesni/aesni_ghash.c ============================================================================== --- head/sys/crypto/aesni/aesni_ghash.c Thu Apr 16 15:35:17 2015 (r281605) +++ head/sys/crypto/aesni/aesni_ghash.c Thu Apr 16 17:42:52 2015 (r281606) @@ -67,6 +67,7 @@ #ifdef _KERNEL #include +#include #else #include #endif Added: head/sys/crypto/aesni/aesni_os.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/aesni/aesni_os.h Thu Apr 16 17:42:52 2015 (r281606) @@ -0,0 +1,33 @@ +/*- + * Copyright 2015 Craig Rodrigues + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#if defined(__GNUC__) && defined(_KERNEL) +/* Suppress inclusion of gcc's mm_malloc.h header */ +#define _MM_MALLOC_H_INCLUDED 1 +#endif From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 19:04:39 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 19:09:26 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Apr 16 19:23:08 2015 Return-Path: Delivered-To: svn-src-all@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 E8BB44E1; Thu, 16 Apr 2015 19:23:08 +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 D4241C82; Thu, 16 Apr 2015 19:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GJN80s033202; Thu, 16 Apr 2015 19:23:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GJN8bl033201; Thu, 16 Apr 2015 19:23:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504161923.t3GJN8bl033201@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Apr 2015 19:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281610 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 19:23:09 -0000 Author: emaste Date: Thu Apr 16 19:23:08 2015 New Revision: 281610 URL: https://svnweb.freebsd.org/changeset/base/281610 Log: Set MACHINE_ARCH to aarch64 for arm64 Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/conf/DEFAULTS Modified: head/sys/arm64/conf/DEFAULTS ============================================================================== --- head/sys/arm64/conf/DEFAULTS Thu Apr 16 19:09:25 2015 (r281609) +++ head/sys/arm64/conf/DEFAULTS Thu Apr 16 19:23:08 2015 (r281610) @@ -3,7 +3,7 @@ # # $FreeBSD$ -machine arm64 +machine arm64 aarch64 # Pseudo devices. device mem # Memory and kernel memory devices From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:11:50 2015 Return-Path: Delivered-To: svn-src-all@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 9A147D3; Thu, 16 Apr 2015 20:11: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 852E81106; Thu, 16 Apr 2015 20:11: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 t3GKBo8R057234; Thu, 16 Apr 2015 20:11:50 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GKBoRX057233; Thu, 16 Apr 2015 20:11:50 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201504162011.t3GKBoRX057233@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 16 Apr 2015 20:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281611 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:11:50 -0000 Author: neel Date: Thu Apr 16 20:11:49 2015 New Revision: 281611 URL: https://svnweb.freebsd.org/changeset/base/281611 Log: If the number of guest vcpus is less than '1' then flag it as an error. MFC after: 1 week Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/usr.sbin/bhyve/bhyverun.c Thu Apr 16 20:11:49 2015 (r281611) @@ -805,6 +805,11 @@ main(int argc, char *argv[]) exit(1); } + if (guest_ncpus < 1) { + fprintf(stderr, "Invalid guest vCPUs (%d)\n", guest_ncpus); + exit(1); + } + max_vcpus = num_vcpus_allowed(ctx); if (guest_ncpus > max_vcpus) { fprintf(stderr, "%d vCPUs requested but only %d available\n", From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:15:48 2015 Return-Path: Delivered-To: svn-src-all@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 8C5615E2; Thu, 16 Apr 2015 20:15: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 77AF111CC; Thu, 16 Apr 2015 20:15: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 t3GKFmAi059534; Thu, 16 Apr 2015 20:15:48 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GKFmJ5059533; Thu, 16 Apr 2015 20:15:48 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201504162015.t3GKFmJ5059533@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 16 Apr 2015 20:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281612 - head/sys/amd64/vmm/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:15:48 -0000 Author: neel Date: Thu Apr 16 20:15:47 2015 New Revision: 281612 URL: https://svnweb.freebsd.org/changeset/base/281612 Log: Prefer 'vcpu_should_yield()' over checking 'curthread->td_flags' directly. MFC after: 1 week Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Thu Apr 16 20:11:49 2015 (r281611) +++ head/sys/amd64/vmm/amd/svm.c Thu Apr 16 20:15:47 2015 (r281612) @@ -1917,7 +1917,7 @@ svm_vmrun(void *arg, int vcpu, register_ } /* We are asked to give the cpu by scheduler. */ - if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + if (vcpu_should_yield(vm, vcpu)) { enable_gintr(); vm_exit_astpending(vm, vcpu, state->rip); break; From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:22:50 2015 Return-Path: Delivered-To: svn-src-all@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 5562D8D1; Thu, 16 Apr 2015 20:22: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 3CD1012B5; Thu, 16 Apr 2015 20:22: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 t3GKMoc2063964; Thu, 16 Apr 2015 20:22:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GKMf9R063902; Thu, 16 Apr 2015 20:22:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504162022.t3GKMf9R063902@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 16 Apr 2015 20:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281613 - in head: . etc/mtree include sbin/pfctl sys/conf sys/contrib/altq/altq sys/net sys/net/altq sys/netpfil/pf sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:22:50 -0000 Author: glebius Date: Thu Apr 16 20:22:40 2015 New Revision: 281613 URL: https://svnweb.freebsd.org/changeset/base/281613 Log: Move ALTQ from contrib to net/altq. The ALTQ code is for many years discontinued by its initial authors. In FreeBSD the code was already slightly edited during the pf(4) SMP project. It is about to be edited more in the projects/ifnet. Moving out of contrib also allows to remove several hacks to the make glue. Reviewed by: net@ Added: head/sys/net/altq/ - copied from r281610, head/sys/contrib/altq/altq/ Deleted: head/sys/contrib/altq/altq/ Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.include.dist head/include/Makefile head/sbin/pfctl/parse.y head/sbin/pfctl/pfctl.c head/sbin/pfctl/pfctl_altq.c head/sbin/pfctl/pfctl_qstats.c head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/net/altq/altq.h head/sys/net/altq/altq_cbq.c head/sys/net/altq/altq_cbq.h head/sys/net/altq/altq_cdnr.c head/sys/net/altq/altq_cdnr.h head/sys/net/altq/altq_hfsc.c head/sys/net/altq/altq_hfsc.h head/sys/net/altq/altq_priq.c head/sys/net/altq/altq_priq.h head/sys/net/altq/altq_red.c head/sys/net/altq/altq_red.h head/sys/net/altq/altq_rio.c head/sys/net/altq/altq_rio.h head/sys/net/altq/altq_rmclass.c head/sys/net/altq/altq_rmclass.h head/sys/net/altq/altq_subr.c head/sys/net/altq/if_altq.h head/sys/net/if_var.h head/sys/net/ifq.h head/sys/netpfil/pf/pf_ioctl.c head/sys/sys/param.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Apr 16 20:15:47 2015 (r281612) +++ head/ObsoleteFiles.inc Thu Apr 16 20:22:40 2015 (r281613) @@ -38,6 +38,21 @@ # xargs -n1 | sort | uniq -d; # done +# 20150416: ALTQ moved to net/altq +OLD_FILES+=usr/include/altq/altq_rmclass_debug.h +OLD_FILES+=usr/include/altq/altq.h +OLD_FILES+=usr/include/altq/altq_cdnr.h +OLD_FILES+=usr/include/altq/altq_hfsc.h +OLD_FILES+=usr/include/altq/altq_priq.h +OLD_FILES+=usr/include/altq/altqconf.h +OLD_FILES+=usr/include/altq/altq_classq.h +OLD_FILES+=usr/include/altq/altq_red.h +OLD_FILES+=usr/include/altq/if_altq.h +OLD_FILES+=usr/include/altq/altq_var.h +OLD_FILES+=usr/include/altq/altq_rmclass.h +OLD_FILES+=usr/include/altq/altq_cbq.h +OLD_FILES+=usr/include/altq/altq_rio.h +OLD_DIRS+=usr/include/altq # 20150410 OLD_FILES+=usr/share/doc/usd/10.exref/paper.ascii.gz OLD_FILES+=usr/share/doc/usd/10.exref/summary.ascii.gz Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Apr 16 20:15:47 2015 (r281612) +++ head/etc/mtree/BSD.include.dist Thu Apr 16 20:22:40 2015 (r281613) @@ -5,8 +5,6 @@ /set type=dir uname=root gname=wheel mode=0755 . - altq - .. arpa .. atf-c @@ -254,6 +252,8 @@ .. .. net + altq + .. .. net80211 .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Thu Apr 16 20:15:47 2015 (r281612) +++ head/include/Makefile Thu Apr 16 20:22:40 2015 (r281613) @@ -50,6 +50,7 @@ LSUBDIRS= cam/ata cam/scsi \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ + net/altq \ netgraph/atm netgraph/netflow \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ @@ -144,7 +145,7 @@ compat: -p ${DESTDIR}${INCLUDEDIR} copies: -.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ +.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \ ${_MARCHS} .if exists(${DESTDIR}${INCLUDEDIR}/$i) cd ${DESTDIR}${INCLUDEDIR}/$i; \ @@ -179,9 +180,6 @@ copies: cd ${.CURDIR}/../sys/dev/pci; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ ${DESTDIR}${INCLUDEDIR}/dev/pci - cd ${.CURDIR}/../sys/contrib/altq/altq; \ - ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ - ${DESTDIR}${INCLUDEDIR}/altq cd ${.CURDIR}/../sys/fs/cd9660/; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/isofs/cd9660 @@ -279,11 +277,6 @@ symlinks: ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor - cd ${.CURDIR}/../sys/contrib/altq/altq; \ - for h in *.h; do \ - ln -fs ../../../sys/contrib/altq/altq/$$h \ - ${DESTDIR}${INCLUDEDIR}/altq; \ - done .if ${MK_IPFILTER} != "no" cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ for h in *.h; do \ Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Thu Apr 16 20:15:47 2015 (r281612) +++ head/sbin/pfctl/parse.y Thu Apr 16 20:22:40 2015 (r281613) @@ -44,10 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Thu Apr 16 20:15:47 2015 (r281612) +++ head/sbin/pfctl/pfctl.c Thu Apr 16 20:22:40 2015 (r281613) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Thu Apr 16 20:15:47 2015 (r281612) +++ head/sbin/pfctl/pfctl_altq.c Thu Apr 16 20:22:40 2015 (r281613) @@ -38,10 +38,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "pfctl_parser.h" #include "pfctl.h" Modified: head/sbin/pfctl/pfctl_qstats.c ============================================================================== --- head/sbin/pfctl/pfctl_qstats.c Thu Apr 16 20:15:47 2015 (r281612) +++ head/sbin/pfctl/pfctl_qstats.c Thu Apr 16 20:22:40 2015 (r281613) @@ -34,10 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "pfctl.h" #include "pfctl_parser.h" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/conf/files Thu Apr 16 20:22:40 2015 (r281613) @@ -247,14 +247,6 @@ compat/freebsd32/freebsd32_ioctl.c optio compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32 compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32 -contrib/altq/altq/altq_cbq.c optional altq -contrib/altq/altq/altq_cdnr.c optional altq -contrib/altq/altq/altq_hfsc.c optional altq -contrib/altq/altq/altq_priq.c optional altq -contrib/altq/altq/altq_red.c optional altq -contrib/altq/altq/altq_rio.c optional altq -contrib/altq/altq/altq_rmclass.c optional altq -contrib/altq/altq/altq_subr.c optional altq contrib/dev/acpica/common/ahids.c optional acpi acpi_debug contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug @@ -3272,6 +3264,14 @@ libkern/strtoul.c standard libkern/strtouq.c standard libkern/strvalid.c standard libkern/timingsafe_bcmp.c standard +net/altq/altq_cbq.c optional altq +net/altq/altq_cdnr.c optional altq +net/altq/altq_hfsc.c optional altq +net/altq/altq_priq.c optional altq +net/altq/altq_red.c optional altq +net/altq/altq_rio.c optional altq +net/altq/altq_rmclass.c optional altq +net/altq/altq_subr.c optional altq net/bpf.c standard net/bpf_buffer.c optional bpf net/bpf_jitter.c optional bpf_jitter Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/conf/kern.pre.mk Thu Apr 16 20:22:40 2015 (r281613) @@ -64,13 +64,10 @@ NOSTDINC= -nostdinc INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -# This hack lets us use the OpenBSD altq code without spamming a new -# include path into contrib'ed source files. -INCLUDES+= -I$S/contrib/altq - .if make(depend) || make(kernel-depend) -# ... and the same for ipfilter +# This hack lets us use the ipfilter code without spamming a new +# include path into contrib'ed source files. INCLUDES+= -I$S/contrib/ipfilter # ... and the same for ath Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/conf/kmod.mk Thu Apr 16 20:22:40 2015 (r281613) @@ -101,10 +101,6 @@ CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -i # set because there are no standard paths for non-headers. CFLAGS+= -I. -I${SYSDIR} -# Add -I path for altq headers as they are included via net/if_var.h -# for example. -CFLAGS+= -I${SYSDIR}/contrib/altq - CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= -fms-extensions CFLAGS.gcc+= --param inline-unit-growth=100 Modified: head/sys/net/altq/altq.h ============================================================================== --- head/sys/contrib/altq/altq/altq.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq.h Thu Apr 16 20:22:40 2015 (r281613) @@ -198,7 +198,7 @@ struct pktcntr { #endif /* ALTQ3_COMPAT */ #ifdef _KERNEL -#include +#include #endif #endif /* _ALTQ_ALTQ_H_ */ Modified: head/sys/net/altq/altq_cbq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cbq.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_cbq.c Thu Apr 16 20:22:40 2015 (r281613) @@ -60,10 +60,10 @@ #include #include #include -#include -#include +#include +#include #ifdef ALTQ3_COMPAT -#include +#include #endif #ifdef ALTQ3_COMPAT Modified: head/sys/net/altq/altq_cbq.h ============================================================================== --- head/sys/contrib/altq/altq/altq_cbq.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_cbq.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,6 +1,4 @@ -/* $KAME: altq_cbq.h,v 1.12 2003/10/03 05:05:15 kjc Exp $ */ - -/* +/*- * Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,15 +26,18 @@ * provided "as is" without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this software. + * + * $KAME: altq_cbq.h,v 1.12 2003/10/03 05:05:15 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_CBQ_H_ #define _ALTQ_ALTQ_CBQ_H_ -#include -#include -#include -#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { Modified: head/sys/net/altq/altq_cdnr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cdnr.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_cdnr.c Thu Apr 16 20:22:40 2015 (r281613) @@ -55,12 +55,12 @@ #include #endif -#include -#include +#include +#include #ifdef ALTQ3_COMPAT -#include +#include #endif -#include +#include #ifdef ALTQ3_COMPAT /* Modified: head/sys/net/altq/altq_cdnr.h ============================================================================== --- head/sys/contrib/altq/altq/altq_cdnr.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_cdnr.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,6 +1,4 @@ -/* $KAME: altq_cdnr.h,v 1.9 2003/07/10 12:07:48 kjc Exp $ */ - -/* +/*- * Copyright (C) 1999-2002 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -24,12 +22,15 @@ * 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. + * + * $KAME: altq_cdnr.h,v 1.9 2003/07/10 12:07:48 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_CDNR_H_ #define _ALTQ_ALTQ_CDNR_H_ -#include +#include /* * traffic conditioner element types Modified: head/sys/net/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_hfsc.c Thu Apr 16 20:22:40 2015 (r281613) @@ -72,10 +72,10 @@ #include #include #include -#include -#include +#include +#include #ifdef ALTQ3_COMPAT -#include +#include #endif /* Modified: head/sys/net/altq/altq_hfsc.h ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_hfsc.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,6 +1,4 @@ -/* $KAME: altq_hfsc.h,v 1.12 2003/12/05 05:40:46 kjc Exp $ */ - -/* +/*- * Copyright (c) 1997-1999 Carnegie Mellon University. All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and @@ -28,14 +26,17 @@ * software to return any improvements or extensions that they make, * and to grant Carnegie Mellon the rights to redistribute these * changes without encumbrance. + * + * $KAME: altq_hfsc.h,v 1.12 2003/12/05 05:40:46 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_HFSC_H_ #define _ALTQ_ALTQ_HFSC_H_ -#include -#include -#include -#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { Modified: head/sys/net/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_priq.c Thu Apr 16 20:22:40 2015 (r281613) @@ -57,11 +57,11 @@ #include #include #include -#include +#include #ifdef ALTQ3_COMPAT -#include +#include #endif -#include +#include /* * function prototypes Modified: head/sys/net/altq/altq_priq.h ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_priq.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,5 +1,4 @@ -/* $KAME: altq_priq.h,v 1.7 2003/10/03 05:05:15 kjc Exp $ */ -/* +/*- * Copyright (C) 2000-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -23,15 +22,18 @@ * 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. + * + * $KAME: altq_priq.h,v 1.7 2003/10/03 05:05:15 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_PRIQ_H_ #define _ALTQ_ALTQ_PRIQ_H_ -#include -#include -#include -#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { Modified: head/sys/net/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_red.c Thu Apr 16 20:22:40 2015 (r281613) @@ -98,12 +98,12 @@ #include #include #include -#include -#include +#include +#include #ifdef ALTQ3_COMPAT -#include +#include #ifdef ALTQ_FLOWVALVE -#include +#include #endif #endif Modified: head/sys/net/altq/altq_red.h ============================================================================== --- head/sys/contrib/altq/altq/altq_red.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_red.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,6 +1,4 @@ -/* $KAME: altq_red.h,v 1.8 2003/07/10 12:07:49 kjc Exp $ */ - -/* +/*- * Copyright (C) 1997-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -24,12 +22,15 @@ * 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. + * + * $KAME: altq_red.h,v 1.8 2003/07/10 12:07:49 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_RED_H_ #define _ALTQ_ALTQ_RED_H_ -#include +#include #ifdef ALTQ3_COMPAT struct red_interface { Modified: head/sys/net/altq/altq_rio.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_rio.c Thu Apr 16 20:22:40 2015 (r281613) @@ -92,12 +92,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #ifdef ALTQ3_COMPAT -#include +#include #endif /* Modified: head/sys/net/altq/altq_rio.h ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_rio.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,6 +1,4 @@ -/* $KAME: altq_rio.h,v 1.9 2003/07/10 12:07:49 kjc Exp $ */ - -/* +/*- * Copyright (C) 1998-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -24,12 +22,15 @@ * 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. + * + * $KAME: altq_rio.h,v 1.9 2003/07/10 12:07:49 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_RIO_H_ #define _ALTQ_ALTQ_RIO_H_ -#include +#include /* * RIO: RED with IN/OUT bit Modified: head/sys/net/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_rmclass.c Thu Apr 16 20:22:40 2015 (r281613) @@ -66,12 +66,12 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* * Local Macros Modified: head/sys/net/altq/altq_rmclass.h ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_rmclass.h Thu Apr 16 20:22:40 2015 (r281613) @@ -1,6 +1,4 @@ -/* $KAME: altq_rmclass.h,v 1.10 2003/08/20 23:30:23 itojun Exp $ */ - -/* +/*- * Copyright (c) 1991-1997 Regents of the University of California. * All rights reserved. * @@ -31,12 +29,15 @@ * 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. + * + * $KAME: altq_rmclass.h,v 1.10 2003/08/20 23:30:23 itojun Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_RMCLASS_H_ #define _ALTQ_ALTQ_RMCLASS_H_ -#include +#include /* #pragma ident "@(#)rm_class.h 1.20 97/10/23 SMI" */ Modified: head/sys/net/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/altq_subr.c Thu Apr 16 20:22:40 2015 (r281613) @@ -67,9 +67,9 @@ #include #include -#include +#include #ifdef ALTQ3_COMPAT -#include +#include #endif /* machine dependent clock related includes */ Modified: head/sys/net/altq/if_altq.h ============================================================================== --- head/sys/contrib/altq/altq/if_altq.h Thu Apr 16 19:23:08 2015 (r281610) +++ head/sys/net/altq/if_altq.h Thu Apr 16 20:22:40 2015 (r281613) @@ -36,7 +36,7 @@ #endif #ifdef _KERNEL_OPT -#include +#include #endif struct altq_pktattr; struct tb_regulator; struct top_cdnr; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/net/if_var.h Thu Apr 16 20:22:40 2015 (r281613) @@ -83,7 +83,7 @@ struct netmap_adapter; #define IF_DUNIT_NONE -1 -#include +#include TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ Modified: head/sys/net/ifq.h ============================================================================== --- head/sys/net/ifq.h Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/net/ifq.h Thu Apr 16 20:22:40 2015 (r281613) @@ -47,7 +47,7 @@ */ #define IF_DUNIT_NONE -1 -#include +#include /* * Structure defining a queue for a network interface. Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Apr 16 20:22:40 2015 (r281613) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #endif /* INET6 */ #ifdef ALTQ -#include +#include #endif static int pfattach(void); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Apr 16 20:15:47 2015 (r281612) +++ head/sys/sys/param.h Thu Apr 16 20:22:40 2015 (r281613) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100069 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100070 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:23:50 2015 Return-Path: Delivered-To: svn-src-all@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 D624BA16; Thu, 16 Apr 2015 20:23: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 A773B12C0; Thu, 16 Apr 2015 20:23: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 t3GKNo25064142; Thu, 16 Apr 2015 20:23:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GKNoGZ064141; Thu, 16 Apr 2015 20:23:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504162023.t3GKNoGZ064141@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 16 Apr 2015 20:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281614 - head/sys/contrib/altq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:23:50 -0000 Author: glebius Date: Thu Apr 16 20:23:50 2015 New Revision: 281614 URL: https://svnweb.freebsd.org/changeset/base/281614 Log: Remove empty now directory. Deleted: head/sys/contrib/altq/ From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:31:37 2015 Return-Path: Delivered-To: svn-src-all@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 4BB9BCFE; Thu, 16 Apr 2015 20:31:37 +0000 (UTC) Received: from mail-pd0-x230.google.com (mail-pd0-x230.google.com [IPv6:2607:f8b0:400e:c02::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FBA913AE; Thu, 16 Apr 2015 20:31:37 +0000 (UTC) Received: by pdea3 with SMTP id a3so103976095pde.3; Thu, 16 Apr 2015 13:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=96saI65z3dNjBla5rP2v4oayVA7CvBqp9qy7F4N0JNc=; b=p2qiUQIQBHniKDgCEhgksdXq5LmcxKG42cbjrba1ZSZviZIMxhG8xND2FmvGX9aQQu 76TVJ47uiWN2dlvk8bijuMeNzj4muX5ZpefLWnOGZzeRdds2XSvlt1UE76F9uB4wBVFx BqqN1llUxOwjAC4MUXVKGIQ+XIH9SE9KYp4yiQFfuK2PgYEN7OS1qESQb905Lmq05hZx hkDCGzr7+KsqkXyWChXiVRU15FBLC+Rsz/AdMAuYSdGhMF+VXZkKlAS1j20cn4/Kgkr0 JZjAlHvQ3uYNgjOL4RrOOkCVZG0kBPsub3qEKAfRmu7hqPBJTQ+TF7Jv4WmCzhNJ4oig iWfg== X-Received: by 10.70.45.16 with SMTP id i16mr59337157pdm.51.1429216296373; Thu, 16 Apr 2015 13:31:36 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:2491:fc7f:a87:5154? ([2601:8:ab80:7d6:2491:fc7f:a87:5154]) by mx.google.com with ESMTPSA id tr6sm8061403pab.4.2015.04.16.13.31.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Apr 2015 13:31:35 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_98AE274B-8B89-434C-973C-4AE57383E898"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r281613 - in head: . etc/mtree include sbin/pfctl sys/conf sys/contrib/altq/altq sys/net sys/net/altq sys/netpfil/pf sys/sys From: Garrett Cooper In-Reply-To: <201504162022.t3GKMf9R063902@svn.freebsd.org> Date: Thu, 16 Apr 2015 13:31:09 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201504162022.t3GKMf9R063902@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:31:37 -0000 --Apple-Mail=_98AE274B-8B89-434C-973C-4AE57383E898 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Apr 16, 2015, at 13:22, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Apr 16 20:22:40 2015 > New Revision: 281613 > URL: https://svnweb.freebsd.org/changeset/base/281613 >=20 > Log: > Move ALTQ from contrib to net/altq. The ALTQ code is for many years > discontinued by its initial authors. In FreeBSD the code was already > slightly edited during the pf(4) SMP project. It is about to be = edited > more in the projects/ifnet. Moving out of contrib also allows to = remove > several hacks to the make glue. >=20 > Reviewed by: net@ I suspect this needs an UPDATING entry and Relnotes as header include = paths were changed. Thanks! --Apple-Mail=_98AE274B-8B89-434C-973C-4AE57383E898 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJVMBwNAAoJEMZr5QU6S73eGW4IAKp/ordnxXcpTfWsmLCfFv0Z N1qVlxLEDTgCr4v2KYjUzCdqJotoHrKMLOhlFybwp5Ok3eWERlhBzNHydZhFJGDc pJyVTKHL5uYc1c1bmHDPW7i4xL5T51b/x4GZFQ65M8Xpe/ipiIZYdH8TN+ka3B4d 8J1dDiKpwE1YD+za25ccEodkVKcVCogI2bY/WOGxMufNI+WTIxHtKIdxWO23OIxB rPP49lxFwSlBYnT3KrdmmZ1xgjziT7hfehPwLVgQoCM2O4D3blWGiGoxpGcGz3RG adoPuftguWO1KIgKJaWaq1Uu79UEjiZA0KfWn8seQE7p9Npxt+Fg+uIP/pS0gj8= =tkHi -----END PGP SIGNATURE----- --Apple-Mail=_98AE274B-8B89-434C-973C-4AE57383E898-- From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:50:38 2015 Return-Path: Delivered-To: svn-src-all@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 7D9F715B; Thu, 16 Apr 2015 20:50:38 +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 68B5F1575; Thu, 16 Apr 2015 20:50:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GKocVo077570; Thu, 16 Apr 2015 20:50:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GKocC9077569; Thu, 16 Apr 2015 20:50:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201504162050.t3GKocC9077569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Apr 2015 20:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281615 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:50:38 -0000 Author: imp Date: Thu Apr 16 20:50:37 2015 New Revision: 281615 URL: https://svnweb.freebsd.org/changeset/base/281615 Log: People are still getting burned by the byacc upgraded, switch to always doing byacc until someone figures out the more nuanced version to switch off of. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 16 20:23:50 2015 (r281614) +++ head/Makefile.inc1 Thu Apr 16 20:50:37 2015 (r281615) @@ -1304,12 +1304,10 @@ _lex= usr.bin/lex _awk= usr.bin/awk .endif -.if ${BOOTSTRAPPING} < 1001506 _yacc= lib/liby \ usr.bin/yacc ${_bt}-usr.bin/yacc: ${_bt}-lib/liby -.endif .if ${MK_BSNMP} != "no" _gensnmptree= usr.sbin/bsnmpd/gensnmptree From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 20:53:16 2015 Return-Path: Delivered-To: svn-src-all@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 ED5AE2D3; Thu, 16 Apr 2015 20:53: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 D72A91639; Thu, 16 Apr 2015 20:53: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 t3GKrGBM078437; Thu, 16 Apr 2015 20:53:16 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GKrFhS078428; Thu, 16 Apr 2015 20:53:15 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201504162053.t3GKrFhS078428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 16 Apr 2015 20:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281616 - in head: sys/boot/forth sys/kern usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 20:53:17 -0000 Author: dteske Date: Thu Apr 16 20:53:15 2015 New Revision: 281616 URL: https://svnweb.freebsd.org/changeset/base/281616 Log: Add "GELI Passphrase:" prompt to boot loader. A new loader.conf(5) option of geom_eli_passphrase_prompt="YES" will now allow you to enter your geli(8) root-mount credentials prior to invoking the kernel. See check-password.4th(8) for details. Differential Revision: https://reviews.freebsd.org/D2105 Reviewed by: imp, kmoore Discussed on: -current MFC after: 3 days X-MFC-to: stable/10 Relnotes: yes Modified: head/sys/boot/forth/check-password.4th head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/loader.conf head/sys/kern/init_main.c head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Thu Apr 16 20:50:37 2015 (r281615) +++ head/sys/boot/forth/check-password.4th Thu Apr 16 20:53:15 2015 (r281616) @@ -146,6 +146,15 @@ only forth definitions also password-pro 2drop read-reset else drop then + \ Prompt for GEOM ELI (geli(8)) passphrase if enabled + s" geom_eli_passphrase_prompt" getenv dup -1 <> if + s" YES" compare-insensitive 0= if + s" GELI Passphrase: " read ( prompt -- ) + readval readlen @ s" kern.geom.eli.passphrase" setenv + read-reset + then + else drop then + \ Exit if a password was not set s" password" getenv -1 = if exit else drop then Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Thu Apr 16 20:50:37 2015 (r281615) +++ head/sys/boot/forth/check-password.4th.8 Thu Apr 16 20:53:15 2015 (r281616) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2012 Devin Teske +.\" Copyright (c) 2011-2015 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2012 +.Dd March 20, 2015 .Dt CHECK-PASSWORD.4TH 8 .Os .Sh NAME @@ -33,8 +33,12 @@ .Sh DESCRIPTION The file that goes by the name of .Nm -is a set of commands designed to either prevent booting or prevent modification -of boot options without an appropriately configured password. +is a set of commands designed to do one or more of the following: +.Pp +.Dl o Prevent booting without password +.Dl o Prevent modification of boot options without password +.Dl o Provide a password to mount geli(8) encrypted root disk(s) +.Pp The commands of .Nm by themselves are not enough for most uses. @@ -58,14 +62,23 @@ The commands provided by it are: .Pp .Bl -tag -width disable-module_module -compact -offset indent .It Ic check-password -Dual-purpose function that can either protect the interactive boot menu or -prevent boot without password (separately). +Multi-purpose function that can protect the interactive boot menu, +prevent boot without password, or prompt for geli(8) passphrase +.Pq depending on Xr loader.conf 5 settings . .Pp First checks .Va bootlock_password and if-set, the user cannot continue until the correct password is entered. .Pp -Next checks +Next, checks +.Va geom_eli_passphrase_prompt +and if set to +.Li YES +.Pq case-insensitive +prompts the user to enter their GELI password for later mounting of the root +device(s) during boot. +.Pp +Last, checks .Va password and if-set, tries to .Ic autoboot @@ -81,6 +94,11 @@ The environment variables that effect it Sets the bootlock password (up to 16 characters long) that is required by .Ic check-password to be entered before the system is allowed to boot. +.It Va geom_eli_passphrase_prompt +Selects whether loader(8) will prompt for GELI credentials, handing-off to the +kernel for later mounting of +.Xr geli 8 +encrypted root device(s). .It Va password Sets the password (up to 16 characters long) that is required by .Ic check-password @@ -122,6 +140,16 @@ to prevent booting without password: .Bd -literal -offset indent -compact bootlock_password="boot" .Ed +.Pp +Add the following to +.Xr loader.conf 5 +to generate a prompt at boot to collect GELI credentials for mounting +.Xr geli 8 +encrypted root device(s): +.Pp +.Bd -literal -offset indent -compact +geom_eli_passphrase_prompt="YES" +.Ed .Sh SEE ALSO .Xr loader.conf 5 , .Xr loader 8 , Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Thu Apr 16 20:50:37 2015 (r281615) +++ head/sys/boot/forth/loader.conf Thu Apr 16 20:53:15 2015 (r281616) @@ -62,6 +62,7 @@ entropy_cache_type="/boot/entropy" # "NO" to disable autobooting #password="" # Prevent changes to boot options #bootlock_password="" # Prevent booting (see check-password.4th(8)) +#geom_eli_passphrase_prompt="NO" # Prompt for geli(8) passphrase to mount root #beastie_disable="NO" # Turn the beastie boot menu on and off #kernels="kernel kernel.old" # Kernels to display in the boot menu #loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Apr 16 20:50:37 2015 (r281615) +++ head/sys/kern/init_main.c Thu Apr 16 20:53:15 2015 (r281616) @@ -710,6 +710,9 @@ start_init(void *dummy) vfs_mountroot(); + /* Wipe GELI passphrase from the environment. */ + kern_unsetenv("kern.geom.eli.passphrase"); + /* * Need just enough stack to hold the faked-up "execve()" arguments. */ Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Apr 16 20:50:37 2015 (r281615) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Apr 16 20:53:15 2015 (r281616) @@ -1346,6 +1346,9 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'geom_eli_passphrase_prompt=\"YES\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE for disk in $disks; do f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_load "$disk$targetpart YES" \ From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 21:44:36 2015 Return-Path: Delivered-To: svn-src-all@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 51F12C3B; Thu, 16 Apr 2015 21:44: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 3D5E91B21; Thu, 16 Apr 2015 21:44: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 t3GLia6V002249; Thu, 16 Apr 2015 21:44:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GLiati002248; Thu, 16 Apr 2015 21:44:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201504162144.t3GLiati002248@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 16 Apr 2015 21:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281617 - head/usr.bin/wc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 21:44:36 -0000 Author: bdrewery Date: Thu Apr 16 21:44:35 2015 New Revision: 281617 URL: https://svnweb.freebsd.org/changeset/base/281617 Log: Fix SIGINFO race causing final results to be lost to stderr. If a SIGINFO comes in after the file is read then the 'siginfo' flag is set to 1 and the next call to show_cnt() (at exit) would print the data to stderr rather than the expected stdout. This was found with spamming Poudriere with SIGINFO which caused a 'wc -l' execution to return no data rather than an expected number. MFC after: 2 weeks Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Thu Apr 16 20:53:15 2015 (r281616) +++ head/usr.bin/wc/wc.c Thu Apr 16 21:44:35 2015 (r281617) @@ -76,6 +76,14 @@ siginfo_handler(int sig __unused) siginfo = 1; } +static void +reset_siginfo(void) +{ + + signal(SIGINFO, SIG_DFL); + siginfo = 0; +} + int main(int argc, char *argv[]) { @@ -229,6 +237,7 @@ cnt(const char *file) } else tmpll++; } + reset_siginfo(); tlinect += linect; if (dochar) tcharct += charct; @@ -251,6 +260,7 @@ cnt(const char *file) return (1); } if (S_ISREG(sb.st_mode)) { + reset_siginfo(); charct = sb.st_size; show_cnt(file, linect, wordct, charct, llct); tcharct += charct; @@ -311,6 +321,7 @@ word: gotsp = 1; } } } + reset_siginfo(); if (domulti && MB_CUR_MAX > 1) if (mbrtowc(NULL, NULL, 0, &mbs) == (size_t)-1 && !warned) xo_warn("%s", file != NULL ? file : "stdin"); From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 21:45:08 2015 Return-Path: Delivered-To: svn-src-all@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 39CE0D80; Thu, 16 Apr 2015 21:45:08 +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 24D081B2C; Thu, 16 Apr 2015 21:45:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GLj80v002400; Thu, 16 Apr 2015 21:45:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GLj8hx002399; Thu, 16 Apr 2015 21:45:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201504162145.t3GLj8hx002399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 16 Apr 2015 21:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281618 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 21:45:08 -0000 Author: ngie Date: Thu Apr 16 21:45:07 2015 New Revision: 281618 URL: https://svnweb.freebsd.org/changeset/base/281618 Log: Defeat race with MK_KERBEROS == yes introduced with bootstrap-tools parallelization work done in r279197 - kerberos5/lib/libroken requires kerberos5/tools/make-roken to build - kerberos5/tools/asn1_compile, kerberos5/tools/slc, and usr.bin/compile_et require kerberos5/lib/libroken and kerberos5/lib/libvers This race is incredibly evident when cross-building sparc64 on ref10-amd64.freebsd.org MFC after: 1 week Pointyhat to: ngie Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 16 21:44:35 2015 (r281617) +++ head/Makefile.inc1 Thu Apr 16 21:45:07 2015 (r281618) @@ -1357,8 +1357,13 @@ _kerberos5_bootstrap_tools= \ kerberos5/tools/slc \ usr.bin/compile_et -${_bt}-kerberos5/tools/slc: ${_bt}-kerberos5/lib/libroken -${_bt}-kerberos5/tools/asn1_compile: ${_bt}-kerberos5/lib/libroken +${_bt}-kerberos5/lib/libroken: ${_bt}-kerberos5/tools/make-roken +${_bt}-kerberos5/tools/asn1_compile: \ + ${_bt}-kerberos5/lib/libroken ${_bt}-kerberos5/lib/libvers +${_bt}-kerberos5/tools/slc: \ + ${_bt}-kerberos5/lib/libroken ${_bt}-kerberos5/lib/libvers +${_bt}-usr.bin/compile_et: \ + ${_bt}-kerberos5/lib/libroken ${_bt}-kerberos5/lib/libvers .endif bootstrap-tools: .PHONY From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 22:09:39 2015 Return-Path: Delivered-To: svn-src-all@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 047FDBBE; Thu, 16 Apr 2015 22:09: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 D9C2B1D9F; Thu, 16 Apr 2015 22:09:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GM9cYM013919; Thu, 16 Apr 2015 22:09:38 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GM9cBT013917; Thu, 16 Apr 2015 22:09:38 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201504162209.t3GM9cBT013917@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 22:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281625 - head/usr.bin/w X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 22:09:39 -0000 Author: allanjude (doc committer) Date: Thu Apr 16 22:09:37 2015 New Revision: 281625 URL: https://svnweb.freebsd.org/changeset/base/281625 Log: Fix libxo output from uptime command the libxo output for uptime returned multiple 'uptime' keys, one each for number of days, hours, and minutes of uptime. This is invalid JSON. This patch makes the output the raw number of seconds, as well as adding keys for the individual unit values A string of the original output from the plain-text uptime command is also added Differential Revision: https://reviews.freebsd.org/D2063 Reviewed by: jmg Approved by: marcel Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/w/Makefile head/usr.bin/w/w.c Modified: head/usr.bin/w/Makefile ============================================================================== --- head/usr.bin/w/Makefile Thu Apr 16 22:06:48 2015 (r281624) +++ head/usr.bin/w/Makefile Thu Apr 16 22:09:37 2015 (r281625) @@ -4,7 +4,7 @@ PROG= w SRCS= fmt.c pr_time.c proc_compare.c w.c MAN= w.1 uptime.1 -LIBADD= kvm util xo +LIBADD= kvm sbuf util xo #BINGRP= kmem #BINMODE=2555 LINKS= ${BINDIR}/w ${BINDIR}/uptime Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Thu Apr 16 22:06:48 2015 (r281624) +++ head/usr.bin/w/w.c Thu Apr 16 22:09:37 2015 (r281625) @@ -54,8 +54,10 @@ static const char sccsid[] = "@(#)w.c 8. #include #include #include +#include #include #include +#include #include #include @@ -472,7 +474,9 @@ pr_header(time_t *nowp, int nusers) struct timespec tp; int days, hrs, i, mins, secs; char buf[256]; + struct sbuf *upbuf; + upbuf = sbuf_new_auto(); /* * Print time of day. */ @@ -493,21 +497,27 @@ pr_header(time_t *nowp, int nusers) mins = uptime / 60; secs = uptime % 60; xo_emit(" up"); - xo_attr("seconds", "%lu", (unsigned long) tp.tv_sec); + xo_emit("{e:uptime/%lu}", (unsigned long) tp.tv_sec); + xo_emit("{e:days/%d}{e:hours/%d}{e:minutes/%d}{e:seconds/%d}", days, hrs, mins, secs); + if (days > 0) - xo_emit(" {:uptime/%d day%s},", + sbuf_printf(upbuf, " %d day%s,", days, days > 1 ? "s" : ""); if (hrs > 0 && mins > 0) - xo_emit(" {:uptime/%2d:%02d},", hrs, mins); + sbuf_printf(upbuf, " %2d:%02d,", hrs, mins); else if (hrs > 0) - xo_emit(" {:uptime/%d hr%s},", + sbuf_printf(upbuf, " %d hr%s,", hrs, hrs > 1 ? "s" : ""); else if (mins > 0) - xo_emit(" {:uptime/%d min%s},", + sbuf_printf(upbuf, " %d min%s,", mins, mins > 1 ? "s" : ""); - else - xo_emit(" {:uptime/%d sec%s},", + else + sbuf_printf(upbuf, " %d sec%s,", secs, secs > 1 ? "s" : ""); + if (sbuf_finish(upbuf) != 0) + xo_err(1, "Could not generate output"); + xo_emit("{:uptime-human/%s}", sbuf_data(upbuf)); + sbuf_delete(upbuf); } /* Print number of users logged in to system */ From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 22:30:58 2015 Return-Path: Delivered-To: svn-src-all@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 4F1EE40D; Thu, 16 Apr 2015 22:30: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 39ABC8D; Thu, 16 Apr 2015 22:30: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 t3GMUwLS026609; Thu, 16 Apr 2015 22:30:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GMUwLW026608; Thu, 16 Apr 2015 22:30:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504162230.t3GMUwLW026608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 16 Apr 2015 22:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281626 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 22:30:58 -0000 Author: delphij Date: Thu Apr 16 22:30:57 2015 New Revision: 281626 URL: https://svnweb.freebsd.org/changeset/base/281626 Log: r281540 was upstreamed as NetBSD r1.108 of gzip.c, note it as merged. Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Thu Apr 16 22:09:37 2015 (r281625) +++ head/usr.bin/gzip/gzip.c Thu Apr 16 22:30:57 2015 (r281626) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.107 2015/01/13 02:37:20 mrg Exp $ */ +/* $NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 22:34:11 2015 Return-Path: Delivered-To: svn-src-all@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 E10955CD; Thu, 16 Apr 2015 22:34: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 B266AB4; Thu, 16 Apr 2015 22:34: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 t3GMYBFA027701; Thu, 16 Apr 2015 22:34:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GMYA2J027695; Thu, 16 Apr 2015 22:34:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504162234.t3GMYA2J027695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Apr 2015 22:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281627 - in head/sys: conf pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 22:34:12 -0000 Author: emaste Date: Thu Apr 16 22:34:10 2015 New Revision: 281627 URL: https://svnweb.freebsd.org/changeset/base/281627 Log: Fix kernel build ${MACHINE} path $M should be the kernel machine src directory, ${MACHINE}. In most cases ${MACHINE} and ${MACHINE_CPUARCH} are the same, but this is not true for pc98 and arm64. It appears we previously set M=${MACHINE_CPUARCH} as a workaround to accommodate pc98, where MACHINE_CPUARCH is pc98 but it uses sys/i386/i386/genassym.c. arm64 relies on this being set correctly, so update $M and add explicit workarounds for pc98. Differential Revision: https://reviews.freebsd.org/D2307 Reviewed by: andrew, imp Sponsored by: The FreeBSD Foundation Added: head/sys/pc98/pc98/genassym.c (contents, props changed) Modified: head/sys/conf/Makefile.pc98 head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/Makefile.pc98 ============================================================================== --- head/sys/conf/Makefile.pc98 Thu Apr 16 22:30:57 2015 (r281626) +++ head/sys/conf/Makefile.pc98 Thu Apr 16 22:34:10 2015 (r281627) @@ -28,6 +28,9 @@ S= ./@ S= ../../.. .endif .endif + +LDSCRIPT_NAME?= ldscript.${MACHINE_ARCH} + .include "$S/conf/kern.pre.mk" ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS34} Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Apr 16 22:30:57 2015 (r281626) +++ head/sys/conf/kern.pre.mk Thu Apr 16 22:34:10 2015 (r281627) @@ -26,7 +26,7 @@ KODIR?= /boot/${KERNEL} LDSCRIPT_NAME?= ldscript.$M LDSCRIPT?= $S/conf/${LDSCRIPT_NAME} -M= ${MACHINE_CPUARCH} +M= ${MACHINE} AWK?= awk CP?= cp Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Apr 16 22:30:57 2015 (r281626) +++ head/sys/conf/kmod.mk Thu Apr 16 22:34:10 2015 (r281627) @@ -425,10 +425,10 @@ genassym.o: opt_global.h .endif assym.s: ${SYSDIR}/kern/genassym.sh sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} -genassym.o: ${SYSDIR}/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c +genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c genassym.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-fno-common} \ - ${SYSDIR}/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c + ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c .endif lint: ${SRCS} Added: head/sys/pc98/pc98/genassym.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/pc98/pc98/genassym.c Thu Apr 16 22:34:10 2015 (r281627) @@ -0,0 +1,3 @@ +/* $FreeBSD$ */ + +#include "../../i386/i386/genassym.c" From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 22:35:17 2015 Return-Path: Delivered-To: svn-src-all@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 1B8CB710; Thu, 16 Apr 2015 22:35: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 05FC6BD; Thu, 16 Apr 2015 22:35: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 t3GMZGVe027908; Thu, 16 Apr 2015 22:35:16 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GMZGiP027904; Thu, 16 Apr 2015 22:35:16 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201504162235.t3GMZGiP027904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 16 Apr 2015 22:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281628 - in head/sys/fs: nfs nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 22:35:17 -0000 Author: rmacklem Date: Thu Apr 16 22:35:15 2015 New Revision: 281628 URL: https://svnweb.freebsd.org/changeset/base/281628 Log: mav@ has found that NFS servers exporting ZFS file systems can perform better when using a 128K read/write data size. This patch changes NFS_MAXDATA from 64K to 128K so that clients can use 128K for NFS mounts to allow this. The patch also renames NFS_MAXDATA to NFS_SRVMAXIO so that it is clear that it applies to the NFS server side only. It also avoids a name conflict with the NFS_MAXDATA defined in rpcsvc/nfs_prot.h, that is used for userland RPC. Tested by: mav Reviewed by: mav MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfsproto.h head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Thu Apr 16 22:34:10 2015 (r281627) +++ head/sys/fs/nfs/nfs.h Thu Apr 16 22:35:15 2015 (r281628) @@ -159,7 +159,7 @@ (t).tv_sec = time.tv_sec; (t).tv_nsec = 1000 * time.tv_usec; } while (0) #define NFS_SRVMAXDATA(n) \ (((n)->nd_flag & (ND_NFSV3 | ND_NFSV4)) ? \ - NFS_MAXDATA : NFS_V2MAXDATA) + NFS_SRVMAXIO : NFS_V2MAXDATA) #define NFS64BITSSET 0xffffffffffffffffull #define NFS64BITSMINUS1 0xfffffffffffffffeull Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Thu Apr 16 22:34:10 2015 (r281627) +++ head/sys/fs/nfs/nfs_commonport.c Thu Apr 16 22:35:15 2015 (r281628) @@ -281,11 +281,11 @@ nfsvno_getfs(struct nfsfsinfo *sip, int if (isdgram) pref = NFS_MAXDGRAMDATA; else - pref = NFS_MAXDATA; - sip->fs_rtmax = NFS_MAXDATA; + pref = NFS_SRVMAXIO; + sip->fs_rtmax = NFS_SRVMAXIO; sip->fs_rtpref = pref; sip->fs_rtmult = NFS_FABLKSIZE; - sip->fs_wtmax = NFS_MAXDATA; + sip->fs_wtmax = NFS_SRVMAXIO; sip->fs_wtpref = pref; sip->fs_wtmult = NFS_FABLKSIZE; sip->fs_dtpref = pref; Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Thu Apr 16 22:34:10 2015 (r281627) +++ head/sys/fs/nfs/nfsproto.h Thu Apr 16 22:35:15 2015 (r281628) @@ -54,11 +54,10 @@ #define NFS_VER4 4 #define NFS_V2MAXDATA 8192 #define NFS_MAXDGRAMDATA 16384 -#define NFS_MAXDATA NFS_MAXBSIZE #define NFS_MAXPATHLEN 1024 #define NFS_MAXNAMLEN 255 #define NFS_MAXPKTHDR 404 -#define NFS_MAXPACKET (NFS_MAXDATA + 2048) +#define NFS_MAXPACKET (NFS_SRVMAXIO + 2048) #define NFS_MINPACKET 20 #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ #define NFSV4_MINORVERSION 0 /* V4 Minor version */ @@ -67,6 +66,18 @@ #define NFSV41_CBVERS 4 /* V4.1 CB Version */ #define NFSV4_SMALLSTR 50 /* Strings small enough for stack */ +/* + * This value isn't a fixed value in the RFCs. + * It is the maximum data size supported by NFSv3 or NFSv4 over TCP for + * the server. It should be set to the I/O size preferred by ZFS or + * MAXBSIZE, whichever is greater. + * ZFS currently prefers 128K. + * It used to be called NFS_MAXDATA, but has been renamed to clarify that + * it refers to server side only and doesn't conflict with the NFS_MAXDATA + * defined in rpcsvc/nfs_prot.h for userland. + */ +#define NFS_SRVMAXIO (128 * 1024) + /* Stat numbers for rpc returns (version 2, 3 and 4) */ /* * These numbers are hard-wired in the RFCs, so they can't be changed. Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Apr 16 22:34:10 2015 (r281627) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Apr 16 22:35:15 2015 (r281628) @@ -881,7 +881,7 @@ nfsrvd_write(struct nfsrv_descript *nd, i = mbuf_len(mp); } - if (retlen > NFS_MAXDATA || retlen < 0) + if (retlen > NFS_SRVMAXIO || retlen < 0) nd->nd_repstat = EIO; if (vnode_vtype(vp) != VREG && !nd->nd_repstat) { if (nd->nd_flag & ND_NFSV3) From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 22:35:20 2015 Return-Path: Delivered-To: svn-src-all@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 9FC6E84B; Thu, 16 Apr 2015 22:35:20 +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 8C5BCBF; Thu, 16 Apr 2015 22:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3GMZKPf027963; Thu, 16 Apr 2015 22:35:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GMZKZI027962; Thu, 16 Apr 2015 22:35:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504162235.t3GMZKZI027962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Apr 2015 22:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281629 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 22:35:20 -0000 Author: emaste Date: Thu Apr 16 22:35:19 2015 New Revision: 281629 URL: https://svnweb.freebsd.org/changeset/base/281629 Log: Add arm64 to universe if binutils is available. arm64 relies on an external binutils port or package right now, because the in-tree linker from binutils 2.17.50 does not support arm64. Add arm64 to universe if the linker is available. If not output a message that arm64 is skipped. buildworld and buildkernel use the external binutils automatically, so it's sufficient to run 'pkg install aarch64-binutils' to build FreeBSD/arm64. Differential Revision: https://reviews.freebsd.org/D2302 Reviewed by: andrew, imp Sponsored by: The FreeBSD Foundation Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Thu Apr 16 22:35:15 2015 (r281628) +++ head/Makefile Thu Apr 16 22:35:19 2015 (r281629) @@ -374,6 +374,17 @@ kernel-toolchains: # .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) TARGETS?=amd64 arm i386 mips pc98 powerpc sparc64 +# XXX Add arm64 to universe only if we have an external binutils installed. +# It does not build with the in-tree linnker. +.if exists(/usr/local/aarch64-freebsd/bin/ld) +TARGETS+=arm64 +TARGET_ARCHES_arm64?= aarch64 +.else +universe: universe_arm64_skip +universe_epilogue: universe_arm64_skip +universe_arm64_skip: universe_prologue + @echo ">> arm64 skipped - install aarch64-binutils port or package to build" +.endif TARGET_ARCHES_arm?= arm armeb armv6 armv6hf TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 TARGET_ARCHES_powerpc?= powerpc powerpc64 From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 22:44:52 2015 Return-Path: Delivered-To: svn-src-all@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 75F9EA4B; Thu, 16 Apr 2015 22:44: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 6180920D; Thu, 16 Apr 2015 22:44: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 t3GMiqI8032562; Thu, 16 Apr 2015 22:44:52 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3GMiqOP032561; Thu, 16 Apr 2015 22:44:52 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201504162244.t3GMiqOP032561@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 16 Apr 2015 22:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281630 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 22:44:52 -0000 Author: neel Date: Thu Apr 16 22:44:51 2015 New Revision: 281630 URL: https://svnweb.freebsd.org/changeset/base/281630 Log: Relax the check on which vectors can be delivered through the APIC. According to the Intel SDM vectors 16 through 255 are allowed to be delivered via the local APIC. Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks Modified: head/sys/amd64/vmm/vmm_lapic.c Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Thu Apr 16 22:35:19 2015 (r281629) +++ head/sys/amd64/vmm/vmm_lapic.c Thu Apr 16 22:44:51 2015 (r281630) @@ -57,7 +57,11 @@ lapic_set_intr(struct vm *vm, int cpu, i if (cpu < 0 || cpu >= VM_MAXCPU) return (EINVAL); - if (vector < 32 || vector > 255) + /* + * According to section "Maskable Hardware Interrupts" in Intel SDM + * vectors 16 through 255 can be delivered through the local APIC. + */ + if (vector < 16 || vector > 255) return (EINVAL); vlapic = vm_lapic(vm, cpu); From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 03:56:51 2015 Return-Path: Delivered-To: svn-src-all@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 8F509C9F; Fri, 17 Apr 2015 03:56: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 7D6166A876; Fri, 17 Apr 2015 03:56: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 t3H3up4l099056; Fri, 17 Apr 2015 03:56:51 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H3upL5099055; Fri, 17 Apr 2015 03:56:51 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201504170356.t3H3upL5099055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 17 Apr 2015 03:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281639 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 03:56:51 -0000 Author: loos Date: Fri Apr 17 03:56:50 2015 New Revision: 281639 URL: https://svnweb.freebsd.org/changeset/base/281639 Log: Fix the 'wrong packet header' errors for if_emac. Do not strip the ethernet CRC until we read all data from FIFO, otherwise the CRC bytes would be left in FIFO causing the failure of next packet (wrong packet header). When this error happens the receiver has to be disabled and the RX FIFO flushed, discarding valid packets. With this fix if_emac behaves a lot better. Modified: head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Apr 17 01:51:05 2015 (r281638) +++ head/sys/arm/allwinner/if_emac.c Fri Apr 17 03:56:50 2015 (r281639) @@ -358,15 +358,13 @@ emac_rxeof(struct emac_softc *sc, int co return; m->m_len = m->m_pkthdr.len = MCLBYTES; - len -= ETHER_CRC_LEN; - /* Copy entire frame to mbuf first. */ bus_space_read_multi_4(sc->emac_tag, sc->emac_handle, EMAC_RX_IO_DATA, mtod(m, uint32_t *), roundup2(len, 4) / 4); m->m_pkthdr.rcvif = ifp; - m->m_len = m->m_pkthdr.len = len; + m->m_len = m->m_pkthdr.len = len - ETHER_CRC_LEN; /* * Emac controller needs strict aligment, so to avoid From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 06:38:35 2015 Return-Path: Delivered-To: svn-src-all@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 811A4922; Fri, 17 Apr 2015 06:38: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 6DC059FD; Fri, 17 Apr 2015 06:38: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 t3H6cZBJ075298; Fri, 17 Apr 2015 06:38:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H6cVex075281; Fri, 17 Apr 2015 06:38:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504170638.t3H6cVex075281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 17 Apr 2015 06:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281642 - head/sys/net/altq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 06:38:35 -0000 Author: glebius Date: Fri Apr 17 06:38:31 2015 New Revision: 281642 URL: https://svnweb.freebsd.org/changeset/base/281642 Log: - Format copyright notices, VCS ids. - Run through unifdef(1). Deleted: head/sys/net/altq/altqconf.h Modified: head/sys/net/altq/altq.h head/sys/net/altq/altq_cbq.c head/sys/net/altq/altq_cdnr.c head/sys/net/altq/altq_classq.h head/sys/net/altq/altq_hfsc.c head/sys/net/altq/altq_priq.c head/sys/net/altq/altq_red.c head/sys/net/altq/altq_rio.c head/sys/net/altq/altq_rmclass.c head/sys/net/altq/altq_rmclass_debug.h head/sys/net/altq/altq_subr.c head/sys/net/altq/altq_var.h head/sys/net/altq/if_altq.h Modified: head/sys/net/altq/altq.h ============================================================================== --- head/sys/net/altq/altq.h Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq.h Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq.h,v 1.10 2003/07/10 12:07:47 kjc Exp $ */ - -/* +/*- * Copyright (C) 1998-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -25,6 +22,9 @@ * 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. + * + * $KAME: altq.h,v 1.10 2003/07/10 12:07:47 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_H_ #define _ALTQ_ALTQ_H_ Modified: head/sys/net/altq/altq_cbq.c ============================================================================== --- head/sys/net/altq/altq_cbq.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_cbq.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_cbq.c,v 1.19 2003/09/17 14:23:25 kjc Exp $ */ - -/* +/*- * Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,15 +26,14 @@ * provided "as is" without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this software. + * + * $KAME: altq_cbq.c,v 1.19 2003/09/17 14:23:25 kjc Exp $ + * $FreeBSD$ */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */ #include @@ -251,11 +247,7 @@ cbq_pfattach(struct pf_altq *a) if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL) return (EINVAL); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif error = altq_attach(&ifp->if_snd, ALTQT_CBQ, a->altq_disc, cbq_enqueue, cbq_dequeue, cbq_request, NULL, NULL); splx(s); Modified: head/sys/net/altq/altq_cdnr.c ============================================================================== --- head/sys/net/altq/altq_cdnr.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_cdnr.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $ */ - -/* +/*- * Copyright (C) 1999-2002 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -25,15 +22,14 @@ * 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. + * + * $KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $ + * $FreeBSD$ */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #include #include @@ -1272,11 +1268,7 @@ cdnrioctl(dev, cmd, addr, flag, p) break; } -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif switch (cmd) { case CDNR_IF_ATTACH: Modified: head/sys/net/altq/altq_classq.h ============================================================================== --- head/sys/net/altq/altq_classq.h Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_classq.h Fri Apr 17 06:38:31 2015 (r281642) @@ -1,6 +1,4 @@ -/* $KAME: altq_classq.h,v 1.6 2003/01/07 07:33:38 kjc Exp $ */ - -/* +/*- * Copyright (c) 1991-1997 Regents of the University of California. * All rights reserved. * @@ -31,6 +29,9 @@ * 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. + * + * $KAME: altq_classq.h,v 1.6 2003/01/07 07:33:38 kjc Exp $ + * $FreeBSD$ */ /* * class queue definitions extracted from rm_class.h. Modified: head/sys/net/altq/altq_hfsc.c ============================================================================== --- head/sys/net/altq/altq_hfsc.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_hfsc.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_hfsc.c,v 1.24 2003/12/05 05:40:46 kjc Exp $ */ - -/* +/*- * Copyright (c) 1997-1999 Carnegie Mellon University. All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and @@ -29,6 +26,9 @@ * software to return any improvements or extensions that they make, * and to grant Carnegie Mellon the rights to redistribute these * changes without encumbrance. + * + * $KAME: altq_hfsc.c,v 1.24 2003/12/05 05:40:46 kjc Exp $ + * $FreeBSD$ */ /* * H-FSC is described in Proceedings of SIGCOMM'97, @@ -42,13 +42,9 @@ * a class whose fit-time exceeds the current time. */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_HFSC /* hfsc is enabled by ALTQ_HFSC option in opt_altq.h */ @@ -177,11 +173,7 @@ hfsc_pfattach(struct pf_altq *a) if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL) return (EINVAL); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif error = altq_attach(&ifp->if_snd, ALTQT_HFSC, a->altq_disc, hfsc_enqueue, hfsc_dequeue, hfsc_request, NULL, NULL); splx(s); @@ -483,11 +475,7 @@ hfsc_class_create(struct hfsc_if *hif, s cl->cl_hif = hif; cl->cl_parent = parent; -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(hif->hif_ifq); hif->hif_classes++; @@ -567,11 +555,7 @@ hfsc_class_destroy(struct hfsc_class *cl if (is_a_parent_class(cl)) return (EBUSY); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(cl->cl_hif->hif_ifq); #ifdef ALTQ3_COMPAT @@ -1771,11 +1755,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) } cur_time = read_machclk(); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(cl->cl_hif->hif_ifq); if (rsc != NULL) { Modified: head/sys/net/altq/altq_priq.c ============================================================================== --- head/sys/net/altq/altq_priq.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_priq.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_priq.c,v 1.11 2003/09/17 14:23:25 kjc Exp $ */ -/* +/*- * Copyright (C) 2000-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -24,18 +22,17 @@ * 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. + * + * $KAME: altq_priq.c,v 1.11 2003/09/17 14:23:25 kjc Exp $ + * $FreeBSD$ */ /* * priority queue */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_PRIQ /* priq is enabled by ALTQ_PRIQ option in opt_altq.h */ @@ -113,11 +110,7 @@ priq_pfattach(struct pf_altq *a) if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL) return (EINVAL); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif error = altq_attach(&ifp->if_snd, ALTQT_PRIQ, a->altq_disc, priq_enqueue, priq_dequeue, priq_request, NULL, NULL); splx(s); @@ -300,11 +293,7 @@ priq_class_create(struct priq_if *pif, i if ((cl = pif->pif_classes[pri]) != NULL) { /* modify the class instead of creating a new one */ -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(cl->cl_pif->pif_ifq); if (!qempty(cl->cl_q)) priq_purgeq(cl); @@ -407,11 +396,7 @@ priq_class_destroy(struct priq_class *cl struct priq_if *pif; int s, pri; -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(cl->cl_pif->pif_ifq); #ifdef ALTQ3_CLFIER_COMPAT Modified: head/sys/net/altq/altq_red.c ============================================================================== --- head/sys/net/altq/altq_red.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_red.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_red.c,v 1.18 2003/09/05 22:40:36 itojun Exp $ */ - -/* +/*- * Copyright (C) 1997-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -27,7 +24,7 @@ * SUCH DAMAGE. * */ -/* +/*- * Copyright (c) 1990-1994 Regents of the University of California. * All rights reserved. * @@ -58,15 +55,14 @@ * 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. + * + * $KAME: altq_red.c,v 1.18 2003/09/05 22:40:36 itojun Exp $ + * $FreeBSD$ */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_RED /* red is enabled by ALTQ_RED option in opt_altq.h */ #include @@ -944,11 +940,7 @@ redioctl(dev, cmd, addr, flag, p) break; } -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif red_purgeq(rqp); limit = fc->red_limit; if (limit < fc->red_thmax) Modified: head/sys/net/altq/altq_rio.c ============================================================================== --- head/sys/net/altq/altq_rio.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_rio.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_rio.c,v 1.17 2003/07/10 12:07:49 kjc Exp $ */ - -/* +/*- * Copyright (C) 1998-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -26,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* +/*- * Copyright (c) 1990-1994 Regents of the University of California. * All rights reserved. * @@ -57,15 +54,14 @@ * 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. + * + * $KAME: altq_rio.c,v 1.17 2003/07/10 12:07:49 kjc Exp $ + * $FreeBSD$ */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_RIO /* rio is enabled by ALTQ_RIO option in opt_altq.h */ #include @@ -684,11 +680,7 @@ rioioctl(dev, cmd, addr, flag, p) break; } -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif _flushq(rqp->rq_q); limit = fc->rio_limit; if (limit < fc->q_params[RIO_NDROPPREC-1].th_max) Modified: head/sys/net/altq/altq_rmclass.c ============================================================================== --- head/sys/net/altq/altq_rmclass.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_rmclass.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_rmclass.c,v 1.19 2005/04/13 03:44:25 suz Exp $ */ - -/* +/*- * Copyright (c) 1991-1997 Regents of the University of California. * All rights reserved. * @@ -37,14 +34,12 @@ * For questions and/or comments, please send mail to cbq@ee.lbl.gov * * @(#)rm_class.c 1.48 97/12/05 SMI + * $KAME: altq_rmclass.c,v 1.19 2005/04/13 03:44:25 suz Exp $ + * $FreeBSD$ */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */ #include @@ -306,11 +301,7 @@ rmc_newclass(int pri, struct rm_ifdat *i /* * put the class into the class tree */ -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(ifd->ifq_); if ((peer = ifd->active_[pri]) != NULL) { /* find the last class at this pri */ @@ -359,11 +350,7 @@ rmc_modclass(struct rm_class *cl, u_int ifd = cl->ifdat_; old_allotment = cl->allotment_; -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(ifd->ifq_); cl->allotment_ = RM_NS_PER_SEC / nsecPerByte; /* Bytes per sec */ cl->qthresh_ = 0; @@ -559,11 +546,7 @@ rmc_delete_class(struct rm_ifdat *ifd, s if (cl->sleeping_) CALLOUT_STOP(&cl->callout_); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(ifd->ifq_); /* * Free packets in the packet queue. @@ -1531,13 +1514,8 @@ rmc_delay_action(struct rm_class *cl, st * a 'backstop' to restart this class. */ if (delay > tick * 2) { -#ifdef __FreeBSD__ /* FreeBSD rounds up the tick */ t = hzto(&cl->undertime_); -#else - /* other BSDs round down the tick */ - t = hzto(&cl->undertime_) + 1; -#endif } else t = 2; CALLOUT_RESET(&cl->callout_, t, @@ -1568,11 +1546,7 @@ rmc_restart(struct rm_class *cl) struct rm_ifdat *ifd = cl->ifdat_; int s; -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_LOCK(ifd->ifq_); if (cl->sleeping_) { cl->sleeping_ = 0; Modified: head/sys/net/altq/altq_rmclass_debug.h ============================================================================== --- head/sys/net/altq/altq_rmclass_debug.h Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_rmclass_debug.h Fri Apr 17 06:38:31 2015 (r281642) @@ -1,6 +1,4 @@ -/* $KAME: altq_rmclass_debug.h,v 1.3 2002/11/29 04:36:24 kjc Exp $ */ - -/* +/*- * Copyright (c) Sun Microsystems, Inc. 1998 All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,6 +26,9 @@ * provided "as is" without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this software. + * + * $KAME: altq_rmclass_debug.h,v 1.3 2002/11/29 04:36:24 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_RMCLASS_DEBUG_H_ Modified: head/sys/net/altq/altq_subr.c ============================================================================== --- head/sys/net/altq/altq_subr.c Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_subr.c Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_subr.c,v 1.21 2003/11/06 06:32:53 kjc Exp $ */ - -/* +/*- * Copyright (C) 1997-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -25,15 +22,14 @@ * 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. + * + * $KAME: altq_subr.c,v 1.21 2003/11/06 06:32:53 kjc Exp $ + * $FreeBSD$ */ -#if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" -#ifdef __FreeBSD__ #include "opt_inet6.h" -#endif -#endif /* __FreeBSD__ || __NetBSD__ */ #include #include @@ -52,9 +48,7 @@ #include #include #include -#ifdef __FreeBSD__ #include -#endif #include #include @@ -73,20 +67,14 @@ #endif /* machine dependent clock related includes */ -#ifdef __FreeBSD__ #include #include #include #include -#endif #if defined(__amd64__) || defined(__i386__) #include /* for pentium tsc */ #include /* for CPUID_TSC */ -#ifdef __FreeBSD__ #include /* for cpu_feature */ -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#include /* for cpu_feature */ -#endif #endif /* __amd64 || __i386__ */ /* @@ -254,11 +242,7 @@ altq_enable(ifq) return 0; } -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_PURGE_NOLOCK(ifq); ASSERT(ifq->ifq_len == 0); ifq->ifq_drv_maxlen = 0; /* disable bulk dequeue */ @@ -283,11 +267,7 @@ altq_disable(ifq) return 0; } -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif IFQ_PURGE_NOLOCK(ifq); ASSERT(ifq->ifq_len == 0); ifq->altq_flags &= ~(ALTQF_ENABLED|ALTQF_CLASSIFY); @@ -444,24 +424,16 @@ static void tbr_timeout(arg) void *arg; { -#ifdef __FreeBSD__ VNET_ITERATOR_DECL(vnet_iter); -#endif struct ifnet *ifp; int active, s; active = 0; -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif -#ifdef __FreeBSD__ IFNET_RLOCK_NOSLEEP(); VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); -#endif for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { /* read from if_snd unlocked */ @@ -472,12 +444,10 @@ tbr_timeout(arg) ifp->if_start != NULL) (*ifp->if_start)(ifp); } -#ifdef __FreeBSD__ CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); IFNET_RUNLOCK_NOSLEEP(); -#endif splx(s); if (active > 0) CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0); @@ -563,11 +533,7 @@ altq_pfdetach(struct pf_altq *a) if (a->altq_disc == NULL || a->altq_disc != ifp->if_snd.altq_disc) return (0); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif /* read unlocked from if_snd, _disable and _detach take care */ if (ALTQ_IS_ENABLED(&ifp->if_snd)) error = altq_disable(&ifp->if_snd); @@ -926,12 +892,8 @@ init_machclk_setup(void) #endif #if defined(__amd64__) || defined(__i386__) /* check if TSC is available */ -#ifdef __FreeBSD__ if ((cpu_feature & CPUID_TSC) == 0 || atomic_load_acq_64(&tsc_freq) == 0) -#else - if ((cpu_feature & CPUID_TSC) == 0) -#endif machclk_usepcc = 0; #endif } @@ -962,13 +924,7 @@ init_machclk(void) * accessible, just use it. */ #if defined(__amd64__) || defined(__i386__) -#ifdef __FreeBSD__ machclk_freq = atomic_load_acq_64(&tsc_freq); -#elif defined(__NetBSD__) - machclk_freq = (u_int32_t)cpu_tsc_freq; -#elif defined(__OpenBSD__) && (defined(I586_CPU) || defined(I686_CPU)) - machclk_freq = pentium_mhz * 1000000; -#endif #endif /* @@ -1449,11 +1405,7 @@ acc_add_filter(classifier, filter, class * add this filter to the filter list. * filters are ordered from the highest rule number. */ -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif prev = NULL; LIST_FOREACH(tmp, &classifier->acc_filters[i], f_chain) { if (tmp->f_filter.ff_ruleno > afp->f_filter.ff_ruleno) @@ -1482,11 +1434,7 @@ acc_delete_filter(classifier, handle) if ((afp = filth_to_filtp(classifier, handle)) == NULL) return (EINVAL); -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif LIST_REMOVE(afp, f_chain); splx(s); @@ -1510,11 +1458,7 @@ acc_discard_filters(classifier, class, a struct acc_filter *afp; int i, s; -#ifdef __NetBSD__ s = splnet(); -#else - s = splimp(); -#endif for (i = 0; i < ACC_FILTER_TABLESIZE; i++) { do { LIST_FOREACH(afp, &classifier->acc_filters[i], f_chain) Modified: head/sys/net/altq/altq_var.h ============================================================================== --- head/sys/net/altq/altq_var.h Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/altq_var.h Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: altq_var.h,v 1.16 2003/10/03 05:05:15 kjc Exp $ */ - -/* +/*- * Copyright (C) 1998-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -25,6 +22,9 @@ * 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. + * + * $KAME: altq_var.h,v 1.16 2003/10/03 05:05:15 kjc Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_ALTQ_VAR_H_ #define _ALTQ_ALTQ_VAR_H_ @@ -161,7 +161,6 @@ typedef u_long ioctlcmd_t; #endif /* macro for timeout/untimeout */ -#if (__FreeBSD_version > 300000) || defined(__NetBSD__) /* use callout */ #include @@ -175,35 +174,6 @@ typedef u_long ioctlcmd_t; #if !defined(CALLOUT_INITIALIZER) && (__FreeBSD_version < 600000) #define CALLOUT_INITIALIZER { { { NULL } }, 0, NULL, NULL, 0 } #endif -#elif defined(__OpenBSD__) -#include -/* callout structure as a wrapper of struct timeout */ -struct callout { - struct timeout c_to; -}; -#define CALLOUT_INIT(c) do { bzero((c), sizeof(*(c))); } while (/*CONSTCOND*/ 0) -#define CALLOUT_RESET(c,t,f,a) do { if (!timeout_initialized(&(c)->c_to)) \ - timeout_set(&(c)->c_to, (f), (a)); \ - timeout_add(&(c)->c_to, (t)); } while (/*CONSTCOND*/ 0) -#define CALLOUT_STOP(c) timeout_del(&(c)->c_to) -#define CALLOUT_INITIALIZER { { { NULL }, NULL, NULL, 0, 0 } } -#else -/* use old-style timeout/untimeout */ -/* dummy callout structure */ -struct callout { - void *c_arg; /* function argument */ - void (*c_func)(void *); /* functiuon to call */ -}; -#define CALLOUT_INIT(c) do { bzero((c), sizeof(*(c))); } while (/*CONSTCOND*/ 0) -#define CALLOUT_RESET(c,t,f,a) do { (c)->c_arg = (a); \ - (c)->c_func = (f); \ - timeout((f),(a),(t)); } while (/*CONSTCOND*/ 0) -#define CALLOUT_STOP(c) untimeout((c)->c_func,(c)->c_arg) -#define CALLOUT_INITIALIZER { NULL, NULL } -#endif -#if !defined(__FreeBSD__) -typedef void (timeout_t)(void *); -#endif #define m_pktlen(m) ((m)->m_pkthdr.len) Modified: head/sys/net/altq/if_altq.h ============================================================================== --- head/sys/net/altq/if_altq.h Fri Apr 17 05:58:11 2015 (r281641) +++ head/sys/net/altq/if_altq.h Fri Apr 17 06:38:31 2015 (r281642) @@ -1,7 +1,4 @@ -/* $FreeBSD$ */ -/* $KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $ */ - -/* +/*- * Copyright (C) 1997-2003 * Sony Computer Science Laboratories Inc. All rights reserved. * @@ -25,19 +22,16 @@ * 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. + * + * $KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $ + * $FreeBSD$ */ #ifndef _ALTQ_IF_ALTQ_H_ #define _ALTQ_IF_ALTQ_H_ -#ifdef __FreeBSD__ #include /* XXX */ #include /* XXX */ #include /* XXX */ -#endif - -#ifdef _KERNEL_OPT -#include -#endif struct altq_pktattr; struct tb_regulator; struct top_cdnr; @@ -50,9 +44,7 @@ struct ifaltq { struct mbuf *ifq_tail; int ifq_len; int ifq_maxlen; -#ifdef __FreeBSD__ struct mtx ifq_mtx; -#endif /* driver owned queue (used for bulk dequeue and prepend) UNLOCKED */ struct mbuf *ifq_drv_head; From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 06:39:16 2015 Return-Path: Delivered-To: svn-src-all@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 6C044A64; Fri, 17 Apr 2015 06:39: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 59BDFA04; Fri, 17 Apr 2015 06:39: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 t3H6dGdr075430; Fri, 17 Apr 2015 06:39:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H6dGd7075429; Fri, 17 Apr 2015 06:39:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504170639.t3H6dGd7075429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 17 Apr 2015 06:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281643 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 06:39:16 -0000 Author: glebius Date: Fri Apr 17 06:39:15 2015 New Revision: 281643 URL: https://svnweb.freebsd.org/changeset/base/281643 Log: Bring in if_types.h from projects/ifnet, where types are defined in enum. Modified: head/sys/net/if_types.h Modified: head/sys/net/if_types.h ============================================================================== --- head/sys/net/if_types.h Fri Apr 17 06:38:31 2015 (r281642) +++ head/sys/net/if_types.h Fri Apr 17 06:39:15 2015 (r281643) @@ -42,211 +42,216 @@ * http://www.iana.org/assignments/smi-numbers */ -#define IFT_OTHER 0x1 /* none of the following */ -#define IFT_1822 0x2 /* old-style arpanet imp */ -#define IFT_HDH1822 0x3 /* HDH arpanet imp */ -#define IFT_X25DDN 0x4 /* x25 to imp */ -#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */ -#define IFT_ETHER 0x6 /* Ethernet CSMA/CD */ -#define IFT_ISO88023 0x7 /* CMSA/CD */ -#define IFT_ISO88024 0x8 /* Token Bus */ -#define IFT_ISO88025 0x9 /* Token Ring */ -#define IFT_ISO88026 0xa /* MAN */ -#define IFT_STARLAN 0xb -#define IFT_P10 0xc /* Proteon 10MBit ring */ -#define IFT_P80 0xd /* Proteon 80MBit ring */ -#define IFT_HY 0xe /* Hyperchannel */ -#define IFT_FDDI 0xf -#define IFT_LAPB 0x10 -#define IFT_SDLC 0x11 -#define IFT_T1 0x12 -#define IFT_CEPT 0x13 /* E1 - european T1 */ -#define IFT_ISDNBASIC 0x14 -#define IFT_ISDNPRIMARY 0x15 -#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */ -#define IFT_PPP 0x17 /* RFC 1331 */ -#define IFT_LOOP 0x18 /* loopback */ -#define IFT_EON 0x19 /* ISO over IP */ -#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */ -#define IFT_NSIP 0x1b /* XNS over IP */ -#define IFT_SLIP 0x1c /* IP over generic TTY */ -#define IFT_ULTRA 0x1d /* Ultra Technologies */ -#define IFT_DS3 0x1e /* Generic T3 */ -#define IFT_SIP 0x1f /* SMDS */ -#define IFT_FRELAY 0x20 /* Frame Relay DTE only */ -#define IFT_RS232 0x21 -#define IFT_PARA 0x22 /* parallel-port */ -#define IFT_ARCNET 0x23 -#define IFT_ARCNETPLUS 0x24 -#define IFT_ATM 0x25 /* ATM cells */ -#define IFT_MIOX25 0x26 -#define IFT_SONET 0x27 /* SONET or SDH */ -#define IFT_X25PLE 0x28 -#define IFT_ISO88022LLC 0x29 -#define IFT_LOCALTALK 0x2a -#define IFT_SMDSDXI 0x2b -#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */ -#define IFT_V35 0x2d -#define IFT_HSSI 0x2e -#define IFT_HIPPI 0x2f -#define IFT_MODEM 0x30 /* Generic Modem */ -#define IFT_AAL5 0x31 /* AAL5 over ATM */ -#define IFT_SONETPATH 0x32 -#define IFT_SONETVT 0x33 -#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */ -#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */ -#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */ -#define IFT_IEEE80212 0x37 /* 100BaseVG */ -#define IFT_FIBRECHANNEL 0x38 /* Fibre Channel */ -#define IFT_HIPPIINTERFACE 0x39 /* HIPPI interfaces */ -#define IFT_FRAMERELAYINTERCONNECT 0x3a /* Obsolete, use either 0x20 or 0x2c */ -#define IFT_AFLANE8023 0x3b /* ATM Emulated LAN for 802.3 */ -#define IFT_AFLANE8025 0x3c /* ATM Emulated LAN for 802.5 */ -#define IFT_CCTEMUL 0x3d /* ATM Emulated circuit */ -#define IFT_FASTETHER 0x3e /* Fast Ethernet (100BaseT) */ -#define IFT_ISDN 0x3f /* ISDN and X.25 */ -#define IFT_V11 0x40 /* CCITT V.11/X.21 */ -#define IFT_V36 0x41 /* CCITT V.36 */ -#define IFT_G703AT64K 0x42 /* CCITT G703 at 64Kbps */ -#define IFT_G703AT2MB 0x43 /* Obsolete see DS1-MIB */ -#define IFT_QLLC 0x44 /* SNA QLLC */ -#define IFT_FASTETHERFX 0x45 /* Fast Ethernet (100BaseFX) */ -#define IFT_CHANNEL 0x46 /* channel */ -#define IFT_IEEE80211 0x47 /* radio spread spectrum */ -#define IFT_IBM370PARCHAN 0x48 /* IBM System 360/370 OEMI Channel */ -#define IFT_ESCON 0x49 /* IBM Enterprise Systems Connection */ -#define IFT_DLSW 0x4a /* Data Link Switching */ -#define IFT_ISDNS 0x4b /* ISDN S/T interface */ -#define IFT_ISDNU 0x4c /* ISDN U interface */ -#define IFT_LAPD 0x4d /* Link Access Protocol D */ -#define IFT_IPSWITCH 0x4e /* IP Switching Objects */ -#define IFT_RSRB 0x4f /* Remote Source Route Bridging */ -#define IFT_ATMLOGICAL 0x50 /* ATM Logical Port */ -#define IFT_DS0 0x51 /* Digital Signal Level 0 */ -#define IFT_DS0BUNDLE 0x52 /* group of ds0s on the same ds1 */ -#define IFT_BSC 0x53 /* Bisynchronous Protocol */ -#define IFT_ASYNC 0x54 /* Asynchronous Protocol */ -#define IFT_CNR 0x55 /* Combat Net Radio */ -#define IFT_ISO88025DTR 0x56 /* ISO 802.5r DTR */ -#define IFT_EPLRS 0x57 /* Ext Pos Loc Report Sys */ -#define IFT_ARAP 0x58 /* Appletalk Remote Access Protocol */ -#define IFT_PROPCNLS 0x59 /* Proprietary Connectionless Protocol*/ -#define IFT_HOSTPAD 0x5a /* CCITT-ITU X.29 PAD Protocol */ -#define IFT_TERMPAD 0x5b /* CCITT-ITU X.3 PAD Facility */ -#define IFT_FRAMERELAYMPI 0x5c /* Multiproto Interconnect over FR */ -#define IFT_X213 0x5d /* CCITT-ITU X213 */ -#define IFT_ADSL 0x5e /* Asymmetric Digital Subscriber Loop */ -#define IFT_RADSL 0x5f /* Rate-Adapt. Digital Subscriber Loop*/ -#define IFT_SDSL 0x60 /* Symmetric Digital Subscriber Loop */ -#define IFT_VDSL 0x61 /* Very H-Speed Digital Subscrib. Loop*/ -#define IFT_ISO88025CRFPINT 0x62 /* ISO 802.5 CRFP */ -#define IFT_MYRINET 0x63 /* Myricom Myrinet */ -#define IFT_VOICEEM 0x64 /* voice recEive and transMit */ -#define IFT_VOICEFXO 0x65 /* voice Foreign Exchange Office */ -#define IFT_VOICEFXS 0x66 /* voice Foreign Exchange Station */ -#define IFT_VOICEENCAP 0x67 /* voice encapsulation */ -#define IFT_VOICEOVERIP 0x68 /* voice over IP encapsulation */ -#define IFT_ATMDXI 0x69 /* ATM DXI */ -#define IFT_ATMFUNI 0x6a /* ATM FUNI */ -#define IFT_ATMIMA 0x6b /* ATM IMA */ -#define IFT_PPPMULTILINKBUNDLE 0x6c /* PPP Multilink Bundle */ -#define IFT_IPOVERCDLC 0x6d /* IBM ipOverCdlc */ -#define IFT_IPOVERCLAW 0x6e /* IBM Common Link Access to Workstn */ -#define IFT_STACKTOSTACK 0x6f /* IBM stackToStack */ -#define IFT_VIRTUALIPADDRESS 0x70 /* IBM VIPA */ -#define IFT_MPC 0x71 /* IBM multi-protocol channel support */ -#define IFT_IPOVERATM 0x72 /* IBM ipOverAtm */ -#define IFT_ISO88025FIBER 0x73 /* ISO 802.5j Fiber Token Ring */ -#define IFT_TDLC 0x74 /* IBM twinaxial data link control */ -#define IFT_GIGABITETHERNET 0x75 /* Gigabit Ethernet */ -#define IFT_HDLC 0x76 /* HDLC */ -#define IFT_LAPF 0x77 /* LAP F */ -#define IFT_V37 0x78 /* V.37 */ -#define IFT_X25MLP 0x79 /* Multi-Link Protocol */ -#define IFT_X25HUNTGROUP 0x7a /* X25 Hunt Group */ -#define IFT_TRANSPHDLC 0x7b /* Transp HDLC */ -#define IFT_INTERLEAVE 0x7c /* Interleave channel */ -#define IFT_FAST 0x7d /* Fast channel */ -#define IFT_IP 0x7e /* IP (for APPN HPR in IP networks) */ -#define IFT_DOCSCABLEMACLAYER 0x7f /* CATV Mac Layer */ -#define IFT_DOCSCABLEDOWNSTREAM 0x80 /* CATV Downstream interface */ -#define IFT_DOCSCABLEUPSTREAM 0x81 /* CATV Upstream interface */ -#define IFT_A12MPPSWITCH 0x82 /* Avalon Parallel Processor */ -#define IFT_TUNNEL 0x83 /* Encapsulation interface */ -#define IFT_COFFEE 0x84 /* coffee pot */ -#define IFT_CES 0x85 /* Circiut Emulation Service */ -#define IFT_ATMSUBINTERFACE 0x86 /* (x) ATM Sub Interface */ -#define IFT_L2VLAN 0x87 /* Layer 2 Virtual LAN using 802.1Q */ -#define IFT_L3IPVLAN 0x88 /* Layer 3 Virtual LAN - IP Protocol */ -#define IFT_L3IPXVLAN 0x89 /* Layer 3 Virtual LAN - IPX Prot. */ -#define IFT_DIGITALPOWERLINE 0x8a /* IP over Power Lines */ -#define IFT_MEDIAMAILOVERIP 0x8b /* (xxx) Multimedia Mail over IP */ -#define IFT_DTM 0x8c /* Dynamic synchronous Transfer Mode */ -#define IFT_DCN 0x8d /* Data Communications Network */ -#define IFT_IPFORWARD 0x8e /* IP Forwarding Interface */ -#define IFT_MSDSL 0x8f /* Multi-rate Symmetric DSL */ -#define IFT_IEEE1394 0x90 /* IEEE1394 High Performance SerialBus*/ -#define IFT_IFGSN 0x91 /* HIPPI-6400 */ -#define IFT_DVBRCCMACLAYER 0x92 /* DVB-RCC MAC Layer */ -#define IFT_DVBRCCDOWNSTREAM 0x93 /* DVB-RCC Downstream Channel */ -#define IFT_DVBRCCUPSTREAM 0x94 /* DVB-RCC Upstream Channel */ -#define IFT_ATMVIRTUAL 0x95 /* ATM Virtual Interface */ -#define IFT_MPLSTUNNEL 0x96 /* MPLS Tunnel Virtual Interface */ -#define IFT_SRP 0x97 /* Spatial Reuse Protocol */ -#define IFT_VOICEOVERATM 0x98 /* Voice over ATM */ -#define IFT_VOICEOVERFRAMERELAY 0x99 /* Voice Over Frame Relay */ -#define IFT_IDSL 0x9a /* Digital Subscriber Loop over ISDN */ -#define IFT_COMPOSITELINK 0x9b /* Avici Composite Link Interface */ -#define IFT_SS7SIGLINK 0x9c /* SS7 Signaling Link */ -#define IFT_PROPWIRELESSP2P 0x9d /* Prop. P2P wireless interface */ -#define IFT_FRFORWARD 0x9e /* Frame forward Interface */ -#define IFT_RFC1483 0x9f /* Multiprotocol over ATM AAL5 */ -#define IFT_USB 0xa0 /* USB Interface */ -#define IFT_IEEE8023ADLAG 0xa1 /* IEEE 802.3ad Link Aggregate*/ -#define IFT_BGPPOLICYACCOUNTING 0xa2 /* BGP Policy Accounting */ -#define IFT_FRF16MFRBUNDLE 0xa3 /* FRF.16 Multilik Frame Relay*/ -#define IFT_H323GATEKEEPER 0xa4 /* H323 Gatekeeper */ -#define IFT_H323PROXY 0xa5 /* H323 Voice and Video Proxy */ -#define IFT_MPLS 0xa6 /* MPLS */ -#define IFT_MFSIGLINK 0xa7 /* Multi-frequency signaling link */ -#define IFT_HDSL2 0xa8 /* High Bit-Rate DSL, 2nd gen. */ -#define IFT_SHDSL 0xa9 /* Multirate HDSL2 */ -#define IFT_DS1FDL 0xaa /* Facility Data Link (4Kbps) on a DS1*/ -#define IFT_POS 0xab /* Packet over SONET/SDH Interface */ -#define IFT_DVBASILN 0xac /* DVB-ASI Input */ -#define IFT_DVBASIOUT 0xad /* DVB-ASI Output */ -#define IFT_PLC 0xae /* Power Line Communications */ -#define IFT_NFAS 0xaf /* Non-Facility Associated Signaling */ -#define IFT_TR008 0xb0 /* TROO8 */ -#define IFT_GR303RDT 0xb1 /* Remote Digital Terminal */ -#define IFT_GR303IDT 0xb2 /* Integrated Digital Terminal */ -#define IFT_ISUP 0xb3 /* ISUP */ -#define IFT_PROPDOCSWIRELESSMACLAYER 0xb4 /* prop/Wireless MAC Layer */ -#define IFT_PROPDOCSWIRELESSDOWNSTREAM 0xb5 /* prop/Wireless Downstream */ -#define IFT_PROPDOCSWIRELESSUPSTREAM 0xb6 /* prop/Wireless Upstream */ -#define IFT_HIPERLAN2 0xb7 /* HIPERLAN Type 2 Radio Interface */ -#define IFT_PROPBWAP2MP 0xb8 /* PropBroadbandWirelessAccess P2MP*/ -#define IFT_SONETOVERHEADCHANNEL 0xb9 /* SONET Overhead Channel */ -#define IFT_DIGITALWRAPPEROVERHEADCHANNEL 0xba /* Digital Wrapper Overhead */ -#define IFT_AAL2 0xbb /* ATM adaptation layer 2 */ -#define IFT_RADIOMAC 0xbc /* MAC layer over radio links */ -#define IFT_ATMRADIO 0xbd /* ATM over radio links */ -#define IFT_IMT 0xbe /* Inter-Machine Trunks */ -#define IFT_MVL 0xbf /* Multiple Virtual Lines DSL */ -#define IFT_REACHDSL 0xc0 /* Long Reach DSL */ -#define IFT_FRDLCIENDPT 0xc1 /* Frame Relay DLCI End Point */ -#define IFT_ATMVCIENDPT 0xc2 /* ATM VCI End Point */ -#define IFT_OPTICALCHANNEL 0xc3 /* Optical Channel */ -#define IFT_OPTICALTRANSPORT 0xc4 /* Optical Transport */ -#define IFT_INFINIBAND 0xc7 /* Infiniband */ -#define IFT_BRIDGE 0xd1 /* Transparent bridge interface */ +typedef enum { + IFT_OTHER = 0x1, /* none of the following */ + IFT_1822 = 0x2, /* old-style arpanet imp */ + IFT_HDH1822 = 0x3, /* HDH arpanet imp */ + IFT_X25DDN = 0x4, /* x25 to imp */ + IFT_X25 = 0x5, /* PDN X25 interface (RFC877) */ + IFT_ETHER = 0x6, /* Ethernet CSMA/CD */ + IFT_ISO88023 = 0x7, /* CMSA/CD */ + IFT_ISO88024 = 0x8, /* Token Bus */ + IFT_ISO88025 = 0x9, /* Token Ring */ + IFT_ISO88026 = 0xa, /* MAN */ + IFT_STARLAN = 0xb, + IFT_P10 = 0xc, /* Proteon 10MBit ring */ + IFT_P80 = 0xd, /* Proteon 80MBit ring */ + IFT_HY = 0xe, /* Hyperchannel */ + IFT_FDDI = 0xf, + IFT_LAPB = 0x10, + IFT_SDLC = 0x11, + IFT_T1 = 0x12, + IFT_CEPT = 0x13, /* E1 - european T1 */ + IFT_ISDNBASIC = 0x14, + IFT_ISDNPRIMARY = 0x15, + IFT_PTPSERIAL = 0x16, /* Proprietary PTP serial */ + IFT_PPP = 0x17, /* RFC 1331 */ + IFT_LOOP = 0x18, /* loopback */ + IFT_EON = 0x19, /* ISO over IP */ + IFT_XETHER = 0x1a, /* obsolete 3MB experimental ethernet */ + IFT_NSIP = 0x1b, /* XNS over IP */ + IFT_SLIP = 0x1c, /* IP over generic TTY */ + IFT_ULTRA = 0x1d, /* Ultra Technologies */ + IFT_DS3 = 0x1e, /* Generic T3 */ + IFT_SIP = 0x1f, /* SMDS */ + IFT_FRELAY = 0x20, /* Frame Relay DTE only */ + IFT_RS232 = 0x21, + IFT_PARA = 0x22, /* parallel-port */ + IFT_ARCNET = 0x23, + IFT_ARCNETPLUS = 0x24, + IFT_ATM = 0x25, /* ATM cells */ + IFT_MIOX25 = 0x26, + IFT_SONET = 0x27, /* SONET or SDH */ + IFT_X25PLE = 0x28, + IFT_ISO88022LLC = 0x29, + IFT_LOCALTALK = 0x2a, + IFT_SMDSDXI = 0x2b, + IFT_FRELAYDCE = 0x2c, /* Frame Relay DCE */ + IFT_V35 = 0x2d, + IFT_HSSI = 0x2e, + IFT_HIPPI = 0x2f, + IFT_MODEM = 0x30, /* Generic Modem */ + IFT_AAL5 = 0x31, /* AAL5 over ATM */ + IFT_SONETPATH = 0x32, + IFT_SONETVT = 0x33, + IFT_SMDSICIP = 0x34, /* SMDS InterCarrier Interface */ + IFT_PROPVIRTUAL = 0x35, /* Proprietary Virtual/internal */ + IFT_PROPMUX = 0x36, /* Proprietary Multiplexing */ + IFT_IEEE80212 = 0x37, /* 100BaseVG */ + IFT_FIBRECHANNEL = 0x38, /* Fibre Channel */ + IFT_HIPPIINTERFACE = 0x39, /* HIPPI interfaces */ + IFT_FRAMERELAYINTERCONNECT = 0x3a, /* Obsolete, use 0x20 either 0x2c */ + IFT_AFLANE8023 = 0x3b, /* ATM Emulated LAN for 802.3 */ + IFT_AFLANE8025 = 0x3c, /* ATM Emulated LAN for 802.5 */ + IFT_CCTEMUL = 0x3d, /* ATM Emulated circuit */ + IFT_FASTETHER = 0x3e, /* Fast Ethernet (100BaseT) */ + IFT_ISDN = 0x3f, /* ISDN and X.25 */ + IFT_V11 = 0x40, /* CCITT V.11/X.21 */ + IFT_V36 = 0x41, /* CCITT V.36 */ + IFT_G703AT64K = 0x42, /* CCITT G703 at 64Kbps */ + IFT_G703AT2MB = 0x43, /* Obsolete see DS1-MIB */ + IFT_QLLC = 0x44, /* SNA QLLC */ + IFT_FASTETHERFX = 0x45, /* Fast Ethernet (100BaseFX) */ + IFT_CHANNEL = 0x46, /* channel */ + IFT_IEEE80211 = 0x47, /* radio spread spectrum */ + IFT_IBM370PARCHAN = 0x48, /* IBM System 360/370 OEMI Channel */ + IFT_ESCON = 0x49, /* IBM Enterprise Systems Connection */ + IFT_DLSW = 0x4a, /* Data Link Switching */ + IFT_ISDNS = 0x4b, /* ISDN S/T interface */ + IFT_ISDNU = 0x4c, /* ISDN U interface */ + IFT_LAPD = 0x4d, /* Link Access Protocol D */ + IFT_IPSWITCH = 0x4e, /* IP Switching Objects */ + IFT_RSRB = 0x4f, /* Remote Source Route Bridging */ + IFT_ATMLOGICAL = 0x50, /* ATM Logical Port */ + IFT_DS0 = 0x51, /* Digital Signal Level 0 */ + IFT_DS0BUNDLE = 0x52, /* group of ds0s on the same ds1 */ + IFT_BSC = 0x53, /* Bisynchronous Protocol */ + IFT_ASYNC = 0x54, /* Asynchronous Protocol */ + IFT_CNR = 0x55, /* Combat Net Radio */ + IFT_ISO88025DTR = 0x56, /* ISO 802.5r DTR */ + IFT_EPLRS = 0x57, /* Ext Pos Loc Report Sys */ + IFT_ARAP = 0x58, /* Appletalk Remote Access Protocol */ + IFT_PROPCNLS = 0x59, /* Proprietary Connectionless Protocol*/ + IFT_HOSTPAD = 0x5a, /* CCITT-ITU X.29 PAD Protocol */ + IFT_TERMPAD = 0x5b, /* CCITT-ITU X.3 PAD Facility */ + IFT_FRAMERELAYMPI = 0x5c, /* Multiproto Interconnect over FR */ + IFT_X213 = 0x5d, /* CCITT-ITU X213 */ + IFT_ADSL = 0x5e, /* Asymmetric Digital Subscriber Loop */ + IFT_RADSL = 0x5f, /* Rate-Adapt. Digital Subscriber Loop*/ + IFT_SDSL = 0x60, /* Symmetric Digital Subscriber Loop */ + IFT_VDSL = 0x61, /* Very H-Speed Digital Subscrib. Loop*/ + IFT_ISO88025CRFPINT = 0x62, /* ISO 802.5 CRFP */ + IFT_MYRINET = 0x63, /* Myricom Myrinet */ + IFT_VOICEEM = 0x64, /* voice recEive and transMit */ + IFT_VOICEFXO = 0x65, /* voice Foreign Exchange Office */ + IFT_VOICEFXS = 0x66, /* voice Foreign Exchange Station */ + IFT_VOICEENCAP = 0x67, /* voice encapsulation */ + IFT_VOICEOVERIP = 0x68, /* voice over IP encapsulation */ + IFT_ATMDXI = 0x69, /* ATM DXI */ + IFT_ATMFUNI = 0x6a, /* ATM FUNI */ + IFT_ATMIMA = 0x6b, /* ATM IMA */ + IFT_PPPMULTILINKBUNDLE = 0x6c, /* PPP Multilink Bundle */ + IFT_IPOVERCDLC = 0x6d, /* IBM ipOverCdlc */ + IFT_IPOVERCLAW = 0x6e, /* IBM Common Link Access to Workstn */ + IFT_STACKTOSTACK = 0x6f, /* IBM stackToStack */ + IFT_VIRTUALIPADDRESS = 0x70, /* IBM VIPA */ + IFT_MPC = 0x71, /* IBM multi-protocol channel support */ + IFT_IPOVERATM = 0x72, /* IBM ipOverAtm */ + IFT_ISO88025FIBER = 0x73, /* ISO 802.5j Fiber Token Ring */ + IFT_TDLC = 0x74, /* IBM twinaxial data link control */ + IFT_GIGABITETHERNET = 0x75, /* Gigabit Ethernet */ + IFT_HDLC = 0x76, /* HDLC */ + IFT_LAPF = 0x77, /* LAP F */ + IFT_V37 = 0x78, /* V.37 */ + IFT_X25MLP = 0x79, /* Multi-Link Protocol */ + IFT_X25HUNTGROUP = 0x7a, /* X25 Hunt Group */ + IFT_TRANSPHDLC = 0x7b, /* Transp HDLC */ + IFT_INTERLEAVE = 0x7c, /* Interleave channel */ + IFT_FAST = 0x7d, /* Fast channel */ + IFT_IP = 0x7e, /* IP (for APPN HPR in IP networks) */ + IFT_DOCSCABLEMACLAYER = 0x7f, /* CATV Mac Layer */ + IFT_DOCSCABLEDOWNSTREAM = 0x80, /* CATV Downstream interface */ + IFT_DOCSCABLEUPSTREAM = 0x81, /* CATV Upstream interface */ + IFT_A12MPPSWITCH = 0x82, /* Avalon Parallel Processor */ + IFT_TUNNEL = 0x83, /* Encapsulation interface */ + IFT_COFFEE = 0x84, /* coffee pot */ + IFT_CES = 0x85, /* Circiut Emulation Service */ + IFT_ATMSUBINTERFACE = 0x86, /* (x) ATM Sub Interface */ + IFT_L2VLAN = 0x87, /* Layer 2 Virtual LAN using 802.1Q */ + IFT_L3IPVLAN = 0x88, /* Layer 3 Virtual LAN - IP Protocol */ + IFT_L3IPXVLAN = 0x89, /* Layer 3 Virtual LAN - IPX Prot. */ + IFT_DIGITALPOWERLINE = 0x8a, /* IP over Power Lines */ + IFT_MEDIAMAILOVERIP = 0x8b, /* (xxx) Multimedia Mail over IP */ + IFT_DTM = 0x8c, /* Dynamic synchronous Transfer Mode */ + IFT_DCN = 0x8d, /* Data Communications Network */ + IFT_IPFORWARD = 0x8e, /* IP Forwarding Interface */ + IFT_MSDSL = 0x8f, /* Multi-rate Symmetric DSL */ + IFT_IEEE1394 = 0x90, /* IEEE1394 High Performance SerialBus*/ + IFT_IFGSN = 0x91, /* HIPPI-6400 */ + IFT_DVBRCCMACLAYER = 0x92, /* DVB-RCC MAC Layer */ + IFT_DVBRCCDOWNSTREAM = 0x93, /* DVB-RCC Downstream Channel */ + IFT_DVBRCCUPSTREAM = 0x94, /* DVB-RCC Upstream Channel */ + IFT_ATMVIRTUAL = 0x95, /* ATM Virtual Interface */ + IFT_MPLSTUNNEL = 0x96, /* MPLS Tunnel Virtual Interface */ + IFT_SRP = 0x97, /* Spatial Reuse Protocol */ + IFT_VOICEOVERATM = 0x98, /* Voice over ATM */ + IFT_VOICEOVERFRAMERELAY = 0x99, /* Voice Over Frame Relay */ + IFT_IDSL = 0x9a, /* Digital Subscriber Loop over ISDN */ + IFT_COMPOSITELINK = 0x9b, /* Avici Composite Link Interface */ + IFT_SS7SIGLINK = 0x9c, /* SS7 Signaling Link */ + IFT_PROPWIRELESSP2P = 0x9d, /* Prop. P2P wireless interface */ + IFT_FRFORWARD = 0x9e, /* Frame forward Interface */ + IFT_RFC1483 = 0x9f, /* Multiprotocol over ATM AAL5 */ + IFT_USB = 0xa0, /* USB Interface */ + IFT_IEEE8023ADLAG = 0xa1, /* IEEE 802.3ad Link Aggregate*/ + IFT_BGPPOLICYACCOUNTING = 0xa2, /* BGP Policy Accounting */ + IFT_FRF16MFRBUNDLE = 0xa3, /* FRF.16 Multilik Frame Relay*/ + IFT_H323GATEKEEPER = 0xa4, /* H323 Gatekeeper */ + IFT_H323PROXY = 0xa5, /* H323 Voice and Video Proxy */ + IFT_MPLS = 0xa6, /* MPLS */ + IFT_MFSIGLINK = 0xa7, /* Multi-frequency signaling link */ + IFT_HDSL2 = 0xa8, /* High Bit-Rate DSL, 2nd gen. */ + IFT_SHDSL = 0xa9, /* Multirate HDSL2 */ + IFT_DS1FDL = 0xaa, /* Facility Data Link (4Kbps) on a DS1*/ + IFT_POS = 0xab, /* Packet over SONET/SDH Interface */ + IFT_DVBASILN = 0xac, /* DVB-ASI Input */ + IFT_DVBASIOUT = 0xad, /* DVB-ASI Output */ + IFT_PLC = 0xae, /* Power Line Communications */ + IFT_NFAS = 0xaf, /* Non-Facility Associated Signaling */ + IFT_TR008 = 0xb0, /* TROO8 */ + IFT_GR303RDT = 0xb1, /* Remote Digital Terminal */ + IFT_GR303IDT = 0xb2, /* Integrated Digital Terminal */ + IFT_ISUP = 0xb3, /* ISUP */ + IFT_PROPDOCSWIRELESSMACLAYER = 0xb4, /* prop/Wireless MAC Layer */ + IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5, /* prop/Wireless Downstream */ + IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6, /* prop/Wireless Upstream */ + IFT_HIPERLAN2 = 0xb7, /* HIPERLAN Type 2 Radio Interface */ + IFT_PROPBWAP2MP = 0xb8, /* PropBroadbandWirelessAccess P2MP*/ + IFT_SONETOVERHEADCHANNEL = 0xb9, /* SONET Overhead Channel */ + IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba, /* Digital Wrapper Overhead */ + IFT_AAL2 = 0xbb, /* ATM adaptation layer 2 */ + IFT_RADIOMAC = 0xbc, /* MAC layer over radio links */ + IFT_ATMRADIO = 0xbd, /* ATM over radio links */ + IFT_IMT = 0xbe, /* Inter-Machine Trunks */ + IFT_MVL = 0xbf, /* Multiple Virtual Lines DSL */ + IFT_REACHDSL = 0xc0, /* Long Reach DSL */ + IFT_FRDLCIENDPT = 0xc1, /* Frame Relay DLCI End Point */ + IFT_ATMVCIENDPT = 0xc2, /* ATM VCI End Point */ + IFT_OPTICALCHANNEL = 0xc3, /* Optical Channel */ + IFT_OPTICALTRANSPORT = 0xc4, /* Optical Transport */ + IFT_INFINIBAND = 0xc7, /* Infiniband */ + IFT_BRIDGE = 0xd1, /* Transparent bridge interface */ + IFT_STF = 0xd7, /* 6to4 interface */ -#define IFT_STF 0xd7 /* 6to4 interface */ - -/* FreeBSD specific, not based on IANA assignments */ -#define IFT_GIF 0xf0 /* Generic tunnel interface */ -#define IFT_PVC 0xf1 /* Unused */ -#define IFT_ENC 0xf4 /* Encapsulating interface */ -#define IFT_PFLOG 0xf6 /* PF packet filter logging */ -#define IFT_PFSYNC 0xf7 /* PF packet filter synchronization */ + /* + * Not based on IANA assignments. Conflicting with IANA assignments. + * We should make them negative probably. + * This requires changes to struct if_data. + */ + IFT_GIF = 0xf0, /* Generic tunnel interface */ + IFT_PVC = 0xf1, /* Unused */ + IFT_ENC = 0xf4, /* Encapsulating interface */ + IFT_PFLOG = 0xf6, /* PF packet filter logging */ + IFT_PFSYNC = 0xf7, /* PF packet filter synchronization */ +} ifType; #endif /* !_NET_IF_TYPES_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 07:07:07 2015 Return-Path: Delivered-To: svn-src-all@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 7D46FED9; Fri, 17 Apr 2015 07:07:07 +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 6B782CD9; Fri, 17 Apr 2015 07:07:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3H777mc089367; Fri, 17 Apr 2015 07:07:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H777HV089365; Fri, 17 Apr 2015 07:07:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201504170707.t3H777HV089365@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 17 Apr 2015 07:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281644 - head/sys/dev/usb/video X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 07:07:07 -0000 Author: hselasky Date: Fri Apr 17 07:07:06 2015 New Revision: 281644 URL: https://svnweb.freebsd.org/changeset/base/281644 Log: Buffers which can be memory mapped into userspace should never be freed. Recycle the buffers instead. This patch also fixes a panic at reboot issue when an UDL adapter is attached to the system. Modified: head/sys/dev/usb/video/udl.c head/sys/dev/usb/video/udl.h Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Fri Apr 17 06:39:15 2015 (r281643) +++ head/sys/dev/usb/video/udl.c Fri Apr 17 07:07:06 2015 (r281644) @@ -76,6 +76,11 @@ static int udl_fps = 25; SYSCTL_INT(_hw_usb_udl, OID_AUTO, fps, CTLFLAG_RWTUN, &udl_fps, 0, "Frames Per Second, 1-60"); +static struct mtx udl_buffer_mtx; +static struct udl_buffer_head udl_buffer_head; + +MALLOC_DEFINE(M_USB_DL, "USB", "USB DisplayLink"); + /* * Prototypes. */ @@ -175,6 +180,56 @@ static const STRUCT_USB_HOST_ID udl_devs {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)} }; +static void +udl_buffer_init(void *arg) +{ + mtx_init(&udl_buffer_mtx, "USB", "UDL", MTX_DEF); + TAILQ_INIT(&udl_buffer_head); +} +SYSINIT(udl_buffer_init, SI_SUB_LOCK, SI_ORDER_FIRST, udl_buffer_init, NULL); + +CTASSERT(sizeof(struct udl_buffer) < PAGE_SIZE); + +static void * +udl_buffer_alloc(uint32_t size) +{ + struct udl_buffer *buf; + mtx_lock(&udl_buffer_mtx); + TAILQ_FOREACH(buf, &udl_buffer_head, entry) { + if (buf->size == size) { + TAILQ_REMOVE(&udl_buffer_head, buf, entry); + break; + } + } + mtx_unlock(&udl_buffer_mtx); + if (buf != NULL) { + /* wipe and recycle buffer */ + memset(buf, 0, size); + return (buf); + } + /* allocate new buffer */ + return (malloc(size, M_USB_DL, M_WAITOK | M_ZERO)); +} + +static void +udl_buffer_free(void *_buf, uint32_t size) +{ + struct udl_buffer *buf; + + buf = (struct udl_buffer *)_buf; + if (buf == NULL) + return; + + /* + * Memory mapped buffers should never be freed. + * Put display buffer into a recycle list. + */ + mtx_lock(&udl_buffer_mtx); + buf->size = size; + TAILQ_INSERT_TAIL(&udl_buffer_head, buf, entry); + mtx_unlock(&udl_buffer_mtx); +} + static uint32_t udl_get_fb_size(struct udl_softc *sc) { @@ -403,11 +458,11 @@ udl_detach(device_t dev) mtx_destroy(&sc->sc_mtx); cv_destroy(&sc->sc_cv); - /* - * Free framebuffer memory, if any. - */ - free(sc->sc_fb_addr, M_DEVBUF); - free(sc->sc_fb_copy, M_DEVBUF); + /* put main framebuffer into a recycle list, if any */ + udl_buffer_free(sc->sc_fb_addr, sc->sc_fb_size); + + /* free shadow framebuffer memory, if any */ + free(sc->sc_fb_copy, M_USB_DL); return (0); } @@ -782,13 +837,15 @@ udl_fbmem_alloc(struct udl_softc *sc) size = udl_get_fb_size(sc); size = round_page(size); - + /* check for zero size */ + if (size == 0) + size = PAGE_SIZE; /* * It is assumed that allocations above PAGE_SIZE bytes will * be PAGE_SIZE aligned for use with mmap() */ - sc->sc_fb_addr = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); - sc->sc_fb_copy = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); + sc->sc_fb_addr = udl_buffer_alloc(size); + sc->sc_fb_copy = malloc(size, M_USB_DL, M_WAITOK | M_ZERO); sc->sc_fb_size = size; } Modified: head/sys/dev/usb/video/udl.h ============================================================================== --- head/sys/dev/usb/video/udl.h Fri Apr 17 06:39:15 2015 (r281643) +++ head/sys/dev/usb/video/udl.h Fri Apr 17 07:07:06 2015 (r281644) @@ -34,6 +34,15 @@ #define UDL_FONT_HEIGHT 16 /* pixels */ #define UDL_MAX_MODES 25 /* units */ +MALLOC_DECLARE(M_USB_DL); + +struct udl_buffer { + TAILQ_ENTRY(udl_buffer) entry; + uint32_t size; +}; + +TAILQ_HEAD(udl_buffer_head, udl_buffer); + struct udl_cmd_buf { TAILQ_ENTRY(udl_cmd_buf) entry; uint32_t off; From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 07:11:10 2015 Return-Path: Delivered-To: svn-src-all@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 E2185110; Fri, 17 Apr 2015 07:11:10 +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 D06EAD9B; Fri, 17 Apr 2015 07:11:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3H7BAeS092309; Fri, 17 Apr 2015 07:11:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H7BAjj092308; Fri, 17 Apr 2015 07:11:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201504170711.t3H7BAjj092308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 17 Apr 2015 07:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281645 - head/sys/modules/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 07:11:11 -0000 Author: hselasky Date: Fri Apr 17 07:11:10 2015 New Revision: 281645 URL: https://svnweb.freebsd.org/changeset/base/281645 Log: Build the USB DisplayLink driver by default. Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Fri Apr 17 07:07:06 2015 (r281644) +++ head/sys/modules/usb/Makefile Fri Apr 17 07:11:10 2015 (r281645) @@ -56,6 +56,7 @@ SUBDIR += ${_urtwn} ${_urtwnfw} SUBDIR += atp uhid ukbd ums udbp ufm uep wsp uled SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom +SUBDIR += udl SUBDIR += uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso ipheth SUBDIR += urndis SUBDIR += usfs umass urio From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 09:14:59 2015 Return-Path: Delivered-To: svn-src-all@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 CBECC246; Fri, 17 Apr 2015 09:14:59 +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 BA9C9E63; Fri, 17 Apr 2015 09:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3H9ExPu050861; Fri, 17 Apr 2015 09:14:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H9ExAp050860; Fri, 17 Apr 2015 09:14:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504170914.t3H9ExAp050860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 17 Apr 2015 09:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281647 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 09:14:59 -0000 Author: andrew Date: Fri Apr 17 09:14:58 2015 New Revision: 281647 URL: https://svnweb.freebsd.org/changeset/base/281647 Log: Use cp15_ifar_get to get the instruction fault address. When using Thumb-2 the instruction may be over two pages so the program counter could point to the wrong page. Modified: head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Fri Apr 17 08:21:04 2015 (r281646) +++ head/sys/arm/arm/trap-v6.c Fri Apr 17 09:14:58 2015 (r281647) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -287,7 +288,11 @@ abort_handler(struct trapframe *tf, int #endif td = curthread; fsr = (prefetch) ? cp15_ifsr_get(): cp15_dfsr_get(); +#if __ARM_ARCH >= 7 + far = (prefetch) ? cp15_ifar_get() : cp15_dfar_get(); +#else far = (prefetch) ? TRAPF_PC(tf) : cp15_dfar_get(); +#endif idx = FSR_TO_FAULT(fsr); usermode = TRAPF_USERMODE(tf); /* Abort came from user mode? */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 09:17:36 2015 Return-Path: Delivered-To: svn-src-all@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 5950D493; Fri, 17 Apr 2015 09:17: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 47FAEE83; Fri, 17 Apr 2015 09:17: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 t3H9HaHi051271; Fri, 17 Apr 2015 09:17:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3H9Haew051270; Fri, 17 Apr 2015 09:17:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504170917.t3H9Haew051270@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 17 Apr 2015 09:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281648 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 09:17:36 -0000 Author: andrew Date: Fri Apr 17 09:17:35 2015 New Revision: 281648 URL: https://svnweb.freebsd.org/changeset/base/281648 Log: Remove support for reading the syscall code in OABI. This is unneeded now we can only build for EABI. Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Fri Apr 17 09:14:58 2015 (r281647) +++ head/sys/arm/arm/vm_machdep.c Fri Apr 17 09:17:35 2015 (r281648) @@ -178,11 +178,7 @@ cpu_set_syscall_retval(struct thread *td * place the returned data into r1. As the lseek and frerebsd6_lseek * syscalls also return an off_t they do not need this fixup. */ -#ifdef __ARM_EABI__ call = frame->tf_r7; -#else - call = *(u_int32_t *)(frame->tf_pc - INSN_SIZE) & 0x000fffff; -#endif if (call == SYS___syscall) { register_t *ap = &frame->tf_r0; register_t code = ap[_QUAD_LOWWORD]; From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 11:57:08 2015 Return-Path: Delivered-To: svn-src-all@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 83C01947; Fri, 17 Apr 2015 11:57:08 +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 645843FA; Fri, 17 Apr 2015 11:57:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3HBv8AH027150; Fri, 17 Apr 2015 11:57:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HBv7rj027145; Fri, 17 Apr 2015 11:57:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504171157.t3HBv7rj027145@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 17 Apr 2015 11:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281649 - in head/sys: dev/cxgbe/tom netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 11:57:08 -0000 Author: glebius Date: Fri Apr 17 11:57:06 2015 New Revision: 281649 URL: https://svnweb.freebsd.org/changeset/base/281649 Log: Provide functions to determine presence of a given address configured on a given interface. Discussed with: np Sponsored by: Nginx, Inc. Modified: head/sys/dev/cxgbe/tom/t4_listen.c head/sys/netinet/in.c head/sys/netinet/in.h head/sys/netinet6/in6.c head/sys/netinet6/in6.h Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri Apr 17 09:17:35 2015 (r281648) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri Apr 17 11:57:06 2015 (r281649) @@ -1090,35 +1090,6 @@ pass_accept_req_to_protohdrs(const struc } } -static int -ifnet_has_ip6(struct ifnet *ifp, struct in6_addr *ip6) -{ - struct ifaddr *ifa; - struct sockaddr_in6 *sin6; - int found = 0; - struct in6_addr in6 = *ip6; - - /* Just as in ip6_input */ - if (in6_clearscope(&in6) || in6_clearscope(&in6)) - return (0); - in6_setscope(&in6, ifp, NULL); - - if_addr_rlock(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sin6 = (void *)ifa->ifa_addr; - if (sin6->sin6_family != AF_INET6) - continue; - - if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &in6)) { - found = 1; - break; - } - } - if_addr_runlock(ifp); - - return (found); -} - static struct l2t_entry * get_l2te_for_nexthop(struct port_info *pi, struct ifnet *ifp, struct in_conninfo *inc) @@ -1166,29 +1137,6 @@ get_l2te_for_nexthop(struct port_info *p return (e); } -static int -ifnet_has_ip(struct ifnet *ifp, struct in_addr in) -{ - struct ifaddr *ifa; - struct sockaddr_in *sin; - int found = 0; - - if_addr_rlock(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sin = (void *)ifa->ifa_addr; - if (sin->sin_family != AF_INET) - continue; - - if (sin->sin_addr.s_addr == in.s_addr) { - found = 1; - break; - } - } - if_addr_runlock(ifp); - - return (found); -} - #define REJECT_PASS_ACCEPT() do { \ reject_reason = __LINE__; \ goto reject; \ @@ -1281,7 +1229,7 @@ do_pass_accept_req(struct sge_iq *iq, co * SYN must be directed to an IP6 address on this ifnet. This * is more restrictive than in6_localip. */ - if (!ifnet_has_ip6(ifp, &inc.inc6_laddr)) + if (!in6_ifhasaddr(ifp, &inc.inc6_laddr)) REJECT_PASS_ACCEPT(); } else { @@ -1293,7 +1241,7 @@ do_pass_accept_req(struct sge_iq *iq, co * SYN must be directed to an IP address on this ifnet. This * is more restrictive than in_localip. */ - if (!ifnet_has_ip(ifp, inc.inc_laddr)) + if (!in_ifhasaddr(ifp, inc.inc_laddr)) REJECT_PASS_ACCEPT(); } Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Apr 17 09:17:35 2015 (r281648) +++ head/sys/netinet/in.c Fri Apr 17 11:57:06 2015 (r281649) @@ -128,6 +128,30 @@ in_localip(struct in_addr in) } /* + * Return 1 if an internet address is configured on an interface. + */ +int +in_ifhasaddr(struct ifnet *ifp, struct in_addr in) +{ + struct ifaddr *ifa; + struct in_ifaddr *ia; + + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + ia = (struct in_ifaddr *)ifa; + if (ia->ia_addr.sin_addr.s_addr == in.s_addr) { + IF_ADDR_RUNLOCK(ifp); + return (1); + } + } + IF_ADDR_RUNLOCK(ifp); + + return (0); +} + +/* * Return a reference to the interface address which is different to * the supplied one but with same IP address value. */ Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Fri Apr 17 09:17:35 2015 (r281648) +++ head/sys/netinet/in.h Fri Apr 17 11:57:06 2015 (r281649) @@ -642,6 +642,7 @@ int in_broadcast(struct in_addr, struct int in_canforward(struct in_addr); int in_localaddr(struct in_addr); int in_localip(struct in_addr); +int in_ifhasaddr(struct ifnet *, struct in_addr); int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa(struct in_addr); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Fri Apr 17 09:17:35 2015 (r281648) +++ head/sys/netinet6/in6.c Fri Apr 17 11:57:06 2015 (r281649) @@ -1684,6 +1684,36 @@ in6_localip(struct in6_addr *in6) IN6_IFADDR_RUNLOCK(); return (0); } + +/* + * Return 1 if an internet address is configured on an interface. + */ +int +in6_ifhasaddr(struct ifnet *ifp, struct in6_addr *addr) +{ + struct in6_addr in6; + struct ifaddr *ifa; + struct in6_ifaddr *ia6; + + in6 = *addr; + if (in6_clearscope(&in6) || in6_clearscope(&in6)) + return (0); + in6_setscope(&in6, ifp, NULL); + + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + ia6 = (struct in6_ifaddr *)ifa; + if (IN6_ARE_ADDR_EQUAL(&ia6->ia_addr.sin6_addr, &in6)) { + IF_ADDR_RUNLOCK(ifp); + return (1); + } + } + IF_ADDR_RUNLOCK(ifp); + + return (0); +} int in6_is_addr_deprecated(struct sockaddr_in6 *sa6) Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Fri Apr 17 09:17:35 2015 (r281648) +++ head/sys/netinet6/in6.h Fri Apr 17 11:57:06 2015 (r281649) @@ -650,6 +650,7 @@ int in6_cksum_partial(struct mbuf *, u_i u_int32_t); int in6_localaddr(struct in6_addr *); int in6_localip(struct in6_addr *); +int in6_ifhasaddr(struct ifnet *, struct in6_addr *); int in6_addrscope(const struct in6_addr *); char *ip6_sprintf(char *, const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 12:58:10 2015 Return-Path: Delivered-To: svn-src-all@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 36C68940; Fri, 17 Apr 2015 12:58:10 +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 2466FC98; Fri, 17 Apr 2015 12:58:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3HCwABv055908; Fri, 17 Apr 2015 12:58:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HCw9kt055907; Fri, 17 Apr 2015 12:58:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201504171258.t3HCw9kt055907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 17 Apr 2015 12:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281654 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 12:58:10 -0000 Author: andrew Date: Fri Apr 17 12:58:09 2015 New Revision: 281654 URL: https://svnweb.freebsd.org/changeset/base/281654 Log: Use the address of fsu_intr_fault, not the first two instructions in it as the address to check if we are handling a trap for fuswintr or suswintr. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Fri Apr 17 12:40:27 2015 (r281653) +++ head/sys/arm64/arm64/trap.c Fri Apr 17 12:58:09 2015 (r281654) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #endif -extern uintptr_t fsu_intr_fault; +extern register_t fsu_intr_fault; /* Called from exception.S */ void do_el1h_sync(struct trapframe *); @@ -154,7 +154,7 @@ data_abort(struct trapframe *frame, uint * Special case for fuswintr and suswintr. These can't sleep so * handle them early on in the trap handler. */ - if (__predict_false(pcb->pcb_onfault == fsu_intr_fault)) { + if (__predict_false(pcb->pcb_onfault == (vm_offset_t)&fsu_intr_fault)) { frame->tf_elr = pcb->pcb_onfault; return; } From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 12:59:02 2015 Return-Path: Delivered-To: svn-src-all@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 382D4CED; Fri, 17 Apr 2015 12:59:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E890ECC4; Fri, 17 Apr 2015 12:59:01 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5B491B93A; Fri, 17 Apr 2015 08:59:00 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281644 - head/sys/dev/usb/video Date: Fri, 17 Apr 2015 08:44:57 -0400 Message-ID: <2107439.xSp98Qc672@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201504170707.t3H777HV089365@svn.freebsd.org> References: <201504170707.t3H777HV089365@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 17 Apr 2015 08:59:00 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 12:59:02 -0000 On Friday, April 17, 2015 07:07:07 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Apr 17 07:07:06 2015 > New Revision: 281644 > URL: https://svnweb.freebsd.org/changeset/base/281644 > > Log: > Buffers which can be memory mapped into userspace should never be > freed. Recycle the buffers instead. This patch also fixes a panic at > reboot issue when an UDL adapter is attached to the system. You can free them safely if you don't use malloc() / free(). Instead, you could create an OBJT_PHYS object that you wire when you map into the kernel and export that to userland via d_mmap_single. In your driver you just need to unmap the kernel mapping to drop the reference count on the object. Once the userland processes exit or remove their mappings the pages would be freed. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 13:07:27 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0208C4; Fri, 17 Apr 2015 13:07:27 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id AC1D116C5; Fri, 17 Apr 2015 13:07:26 +0000 (UTC) Message-ID: <5531052F.10706@FreeBSD.org> Date: Fri, 17 Apr 2015 16:05:51 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281649 - in head/sys: dev/cxgbe/tom netinet netinet6 References: <201504171157.t3HBv7rj027145@svn.freebsd.org> In-Reply-To: <201504171157.t3HBv7rj027145@svn.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4fOFmAf355IAWSSO2X89tcs87NCqSlFXa" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 13:07:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4fOFmAf355IAWSSO2X89tcs87NCqSlFXa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 17.04.2015 14:57, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Apr 17 11:57:06 2015 > New Revision: 281649 > URL: https://svnweb.freebsd.org/changeset/base/281649 >=20 > Log: > Provide functions to determine presence of a given address > configured on a given interface. > =20 > +/* > + * Return 1 if an internet address is configured on an interface. > + */ > +int > +in6_ifhasaddr(struct ifnet *ifp, struct in6_addr *addr) > +{ > + struct in6_addr in6; > + struct ifaddr *ifa; > + struct in6_ifaddr *ia6; > + > + in6 =3D *addr; > + if (in6_clearscope(&in6) || in6_clearscope(&in6)) Why do you call in6_clearscope() twice? Just to be sure? :) --=20 WBR, Andrey V. Elsukov --4fOFmAf355IAWSSO2X89tcs87NCqSlFXa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVMQUvAAoJEAHF6gQQyKF6Z74H/1wM3wc+ml1Gn0zvrjazLPMU UZBNFwgbCMUC5UKfUYOPMoAwp8rQyxwWCyn8XnT3qV6nPZ+lR2qKi3Clst2q+jRE BcihUdWrYlC9piGTi6/Bm1YeCpGg30/n8IvftyW5WBIWzWl6mskLZ6hoLwIlhcbH ScHM+dvLVQry8ohuiJlK5wPGQ4s+n61GRv9JRwJNLuIeGQ+sICjYExmuDS6pvFmh i1VPuy4/wBxKLsfTd4YpepLJbjCM3XPtNFL+u4JSrSa3zX5rr6W5AYhLaBw/m7HC DpvYOhI+bwVsJfCiHOk4KjOG9tydPmvh2kL8kig3M9ivKc+aUi/2x2TRiqXxAWU= =BCBh -----END PGP SIGNATURE----- --4fOFmAf355IAWSSO2X89tcs87NCqSlFXa-- From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 15:18:56 2015 Return-Path: Delivered-To: svn-src-all@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 5D3C7901; Fri, 17 Apr 2015 15:18: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 31C5FFD7; Fri, 17 Apr 2015 15:18: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 t3HFIuPf022575; Fri, 17 Apr 2015 15:18:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HFIt8F022568; Fri, 17 Apr 2015 15:18:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504171518.t3HFIt8F022568@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 17 Apr 2015 15:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281655 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 15:18:56 -0000 Author: emaste Date: Fri Apr 17 15:18:54 2015 New Revision: 281655 URL: https://svnweb.freebsd.org/changeset/base/281655 Log: crunchide: remove unused a.out and non-functional ECOFF support Differential Revision: https://reviews.freebsd.org/D2311 Reviewed by: imp Sponsored by: The FreeBSD Foundation Deleted: head/usr.sbin/crunch/crunchide/exec_aout.c Modified: head/usr.sbin/crunch/crunchide/Makefile head/usr.sbin/crunch/crunchide/crunchide.c head/usr.sbin/crunch/crunchide/extern.h Modified: head/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- head/usr.sbin/crunch/crunchide/Makefile Fri Apr 17 12:58:09 2015 (r281654) +++ head/usr.sbin/crunch/crunchide/Makefile Fri Apr 17 15:18:54 2015 (r281655) @@ -5,11 +5,6 @@ SRCS= crunchide.c TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == i386 && ${MACHINE_ARCH} == i386 -CFLAGS+=-DNLIST_AOUT -SRCS+= exec_aout.c -.endif - .if ${TARGET_ARCH} == aarch64 || ${TARGET_ARCH} == amd64 || \ ${TARGET_ARCH} == powerpc64 || \ ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH:Mmips64*} Modified: head/usr.sbin/crunch/crunchide/crunchide.c ============================================================================== --- head/usr.sbin/crunch/crunchide/crunchide.c Fri Apr 17 12:58:09 2015 (r281654) +++ head/usr.sbin/crunch/crunchide/crunchide.c Fri Apr 17 15:18:54 2015 (r281655) @@ -212,12 +212,6 @@ struct { int (*check)(int, const char *); /* 1 if match, zero if not */ int (*hide)(int, const char *); /* non-zero if error */ } exec_formats[] = { -#ifdef NLIST_AOUT - { "a.out", check_aout, hide_aout, }, -#endif -#ifdef NLIST_ECOFF - { "ECOFF", check_elf64, hide_elf64, }, -#endif #ifdef NLIST_ELF32 { "ELF32", check_elf32, hide_elf32, }, #endif Modified: head/usr.sbin/crunch/crunchide/extern.h ============================================================================== --- head/usr.sbin/crunch/crunchide/extern.h Fri Apr 17 12:58:09 2015 (r281654) +++ head/usr.sbin/crunch/crunchide/extern.h Fri Apr 17 15:18:54 2015 (r281655) @@ -31,14 +31,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef NLIST_AOUT -int check_aout(int, const char *); -int hide_aout(int, const char *); -#endif -#ifdef NLIST_ECOFF -int check_ecoff(int, const char *); -int hide_ecoff(int, const char *); -#endif #ifdef NLIST_ELF32 int check_elf32(int, const char *); int hide_elf32(int, const char *); From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 15:25:09 2015 Return-Path: Delivered-To: svn-src-all@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 45DA6B63; Fri, 17 Apr 2015 15:25:09 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B26EC16F; Fri, 17 Apr 2015 15:25:07 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t3HFOwdW043124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 17 Apr 2015 18:24:58 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t3HFOwSU043123; Fri, 17 Apr 2015 18:24:58 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 17 Apr 2015 18:24:58 +0300 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281649 - in head/sys: dev/cxgbe/tom netinet netinet6 Message-ID: <20150417152458.GN883@FreeBSD.org> References: <201504171157.t3HBv7rj027145@svn.freebsd.org> <5531052F.10706@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5531052F.10706@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 15:25:09 -0000 On Fri, Apr 17, 2015 at 04:05:51PM +0300, Andrey V. Elsukov wrote: A> On 17.04.2015 14:57, Gleb Smirnoff wrote: A> > Author: glebius A> > Date: Fri Apr 17 11:57:06 2015 A> > New Revision: 281649 A> > URL: https://svnweb.freebsd.org/changeset/base/281649 A> > A> > Log: A> > Provide functions to determine presence of a given address A> > configured on a given interface. A> > A> > +/* A> > + * Return 1 if an internet address is configured on an interface. A> > + */ A> > +int A> > +in6_ifhasaddr(struct ifnet *ifp, struct in6_addr *addr) A> > +{ A> > + struct in6_addr in6; A> > + struct ifaddr *ifa; A> > + struct in6_ifaddr *ia6; A> > + A> > + in6 = *addr; A> > + if (in6_clearscope(&in6) || in6_clearscope(&in6)) A> A> Why do you call in6_clearscope() twice? Just to be sure? :) Heh :) Missed this when copying from cxgbe(4). -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 15:26:09 2015 Return-Path: Delivered-To: svn-src-all@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 B50E2CB0; Fri, 17 Apr 2015 15:26:09 +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 A371A17F; Fri, 17 Apr 2015 15:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3HFQ9b0026955; Fri, 17 Apr 2015 15:26:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HFQ9v9026954; Fri, 17 Apr 2015 15:26:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504171526.t3HFQ9v9026954@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 17 Apr 2015 15:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281656 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 15:26:09 -0000 Author: glebius Date: Fri Apr 17 15:26:08 2015 New Revision: 281656 URL: https://svnweb.freebsd.org/changeset/base/281656 Log: Fix r281649: don't call in6_clearscope() twice. Submitted by: ae Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Fri Apr 17 15:18:54 2015 (r281655) +++ head/sys/netinet6/in6.c Fri Apr 17 15:26:08 2015 (r281656) @@ -1696,7 +1696,7 @@ in6_ifhasaddr(struct ifnet *ifp, struct struct in6_ifaddr *ia6; in6 = *addr; - if (in6_clearscope(&in6) || in6_clearscope(&in6)) + if (in6_clearscope(&in6)) return (0); in6_setscope(&in6, ifp, NULL); From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 15:39:44 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Apr 17 15:55:13 2015 Return-Path: Delivered-To: svn-src-all@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 EF4E660B; Fri, 17 Apr 2015 15:55:13 +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 DE2F76D1; Fri, 17 Apr 2015 15:55:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3HFtDfC041111; Fri, 17 Apr 2015 15:55:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HFtDPh041110; Fri, 17 Apr 2015 15:55:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201504171555.t3HFtDPh041110@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Apr 2015 15:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281658 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 15:55:14 -0000 Author: imp Date: Fri Apr 17 15:55:13 2015 New Revision: 281658 URL: https://svnweb.freebsd.org/changeset/base/281658 Log: RELEASEDIR was removed in FreeBSD 9.x, at the same time /boot/loader stopped using kgzip in the release process. We no longer need to build kgzip as a cross tool, and tests for RELEASEDIR are obsolete, so remove both. Differential Revision: https://reviews.freebsd.org/D2313 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 17 15:39:42 2015 (r281657) +++ head/Makefile.inc1 Fri Apr 17 15:55:13 2015 (r281658) @@ -1469,12 +1469,9 @@ _btxld= usr.sbin/btxld .endif .endif .if ${TARGET_ARCH} != ${MACHINE_ARCH} -.if ${MK_RESCUE} != "no" || defined(RELEASEDIR) +.if ${MK_RESCUE} != "no" _crunchide= usr.sbin/crunch/crunchide .endif -.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR) -_kgzip= usr.sbin/kgzip -.endif .endif # If we're given an XAS, don't build binutils. @@ -1520,7 +1517,6 @@ cross-tools: .MAKE ${_cc} \ ${_btxld} \ ${_crunchide} \ - ${_kgzip} \ sys/boot/usb/tools ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool} && \ From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 16:02:50 2015 Return-Path: Delivered-To: svn-src-all@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 9EC79836; Fri, 17 Apr 2015 16:02: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 8D4FD830; Fri, 17 Apr 2015 16:02: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 t3HG2olB045639; Fri, 17 Apr 2015 16:02:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HG2omY045638; Fri, 17 Apr 2015 16:02:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504171602.t3HG2omY045638@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 17 Apr 2015 16:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281659 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 16:02:50 -0000 Author: emaste Date: Fri Apr 17 16:02:49 2015 New Revision: 281659 URL: https://svnweb.freebsd.org/changeset/base/281659 Log: Bump crunch BOOTSTRAPPING for ELF header offset fix in r277557 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 17 15:55:13 2015 (r281658) +++ head/Makefile.inc1 Fri Apr 17 16:02:49 2015 (r281659) @@ -1281,10 +1281,6 @@ _m4= lib/libohash \ ${_bt}-usr.bin/m4: ${_bt}-lib/libohash .endif -.if ${BOOTSTRAPPING} < 1000014 -_crunch= usr.sbin/crunch -.endif - .if ${BOOTSTRAPPING} < 1000026 _nmtree= lib/libnetbsd \ usr.sbin/nmtree @@ -1300,6 +1296,10 @@ _cat= bin/cat _lex= usr.bin/lex .endif +.if ${BOOTSTRAPPING} < 1001507 +_crunch= usr.sbin/crunch +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 16:39:00 2015 Return-Path: Delivered-To: svn-src-all@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 D6F10A7; Fri, 17 Apr 2015 16:39:00 +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 C5875BC4; Fri, 17 Apr 2015 16:39: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 t3HGd0SN060624; Fri, 17 Apr 2015 16:39:00 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HGd0vu060621; Fri, 17 Apr 2015 16:39:00 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504171639.t3HGd0vu060621@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Fri, 17 Apr 2015 16:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r281660 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 16:39:00 -0000 Author: rpaulo Date: Fri Apr 17 16:38:59 2015 New Revision: 281660 URL: https://svnweb.freebsd.org/changeset/base/281660 Log: Please join me in welcoming Chris Torek. Chris is a long time BSD guy and has been hacking on bhyve for a while. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Apr 17 16:02:49 2015 (r281659) +++ svnadmin/conf/access Fri Apr 17 16:38:59 2015 (r281660) @@ -213,6 +213,7 @@ theraven thomas thompsa tijl +torek trasz trhodes trociny Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Apr 17 16:02:49 2015 (r281659) +++ svnadmin/conf/mentors Fri Apr 17 16:38:59 2015 (r281660) @@ -31,6 +31,7 @@ peterj jhb Co-mentor: grog pkelsey jmallett slm ken Co-mentor: scottl, ambrisko snb dwmalone +torek rpaulo vangyzen kib venkat delphij Co-mentor: luigi, jhb versus gavin Co-mentor: fjoe From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 18:34:01 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Apr 17 20:20:56 2015 Return-Path: Delivered-To: svn-src-all@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 2A4FEFC9; Fri, 17 Apr 2015 20:20: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 17CC0852; Fri, 17 Apr 2015 20:20: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 t3HKKtqi067051; Fri, 17 Apr 2015 20:20:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HKKtNo067050; Fri, 17 Apr 2015 20:20:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504172020.t3HKKtNo067050@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Apr 2015 20:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281666 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 20:20:56 -0000 Author: mav Date: Fri Apr 17 20:20:55 2015 New Revision: 281666 URL: https://svnweb.freebsd.org/changeset/base/281666 Log: Make virtual AHCI more careful with I/O lengths. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Apr 17 19:54:46 2015 (r281665) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Apr 17 20:20:55 2015 (r281666) @@ -124,7 +124,7 @@ struct ahci_ioreq { uint32_t len; uint32_t done; int slot; - int prdtl; + int more; }; struct ahci_port { @@ -520,26 +520,77 @@ atapi_string(uint8_t *dest, const char * } } +/* + * Build up the iovec based on the PRDT, 'done' and 'len'. + */ static void -ahci_handle_dma(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done, - int seek) +ahci_build_iov(struct ahci_port *p, struct ahci_ioreq *aior, + struct ahci_prdt_entry *prdt, uint16_t prdtl) +{ + struct blockif_req *breq = &aior->io_req; + int i, j, skip, todo, left, extra; + uint32_t dbcsz; + + /* Copy part of PRDT between 'done' and 'len' bytes into the iov. */ + skip = aior->done; + left = aior->len - aior->done; + todo = 0; + for (i = 0, j = 0; i < prdtl && j < BLOCKIF_IOV_MAX && left > 0; + i++, prdt++) { + dbcsz = (prdt->dbc & DBCMASK) + 1; + /* Skip already done part of the PRDT */ + if (dbcsz <= skip) { + skip -= dbcsz; + continue; + } + dbcsz -= skip; + if (dbcsz > left) + dbcsz = left; + breq->br_iov[j].iov_base = paddr_guest2host(ahci_ctx(p->pr_sc), + prdt->dba + skip, dbcsz); + breq->br_iov[j].iov_len = dbcsz; + todo += dbcsz; + left -= dbcsz; + skip = 0; + j++; + } + + /* If we got limited by IOV length, round I/O down to sector size. */ + if (j == BLOCKIF_IOV_MAX) { + extra = todo % blockif_sectsz(p->bctx); + todo -= extra; + assert(todo > 0); + while (extra > 0) { + if (breq->br_iov[j - 1].iov_len > extra) { + breq->br_iov[j - 1].iov_len -= extra; + break; + } + extra -= breq->br_iov[j - 1].iov_len; + j--; + } + } + + breq->br_iovcnt = j; + aior->done += todo; + aior->more = (aior->done < aior->len && i < prdtl); +} + +static void +ahci_handle_rw(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done) { struct ahci_ioreq *aior; struct blockif_req *breq; - struct pci_ahci_softc *sc; struct ahci_prdt_entry *prdt; struct ahci_cmd_hdr *hdr; uint64_t lba; uint32_t len; - int i, err, iovcnt, ncq, readop; + int err, ncq, readop; - sc = p->pr_sc; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); ncq = 0; readop = 1; - prdt += seek; if (cfis[2] == ATA_WRITE || cfis[2] == ATA_WRITE48 || cfis[2] == ATA_WRITE_MUL || cfis[2] == ATA_WRITE_MUL48 || cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48 || @@ -580,49 +631,25 @@ ahci_handle_dma(struct ahci_port *p, int lba *= blockif_sectsz(p->bctx); len *= blockif_sectsz(p->bctx); - /* - * Pull request off free list - */ + /* Pull request off free list */ aior = STAILQ_FIRST(&p->iofhd); assert(aior != NULL); STAILQ_REMOVE_HEAD(&p->iofhd, io_flist); + aior->cfis = cfis; aior->slot = slot; aior->len = len; aior->done = done; breq = &aior->io_req; breq->br_offset = lba + done; - iovcnt = hdr->prdtl - seek; - if (iovcnt > BLOCKIF_IOV_MAX) { - aior->prdtl = iovcnt - BLOCKIF_IOV_MAX; - iovcnt = BLOCKIF_IOV_MAX; - } else - aior->prdtl = 0; - breq->br_iovcnt = iovcnt; + ahci_build_iov(p, aior, prdt, hdr->prdtl); - /* - * Mark this command in-flight. - */ + /* Mark this command in-flight. */ p->pending |= 1 << slot; - /* - * Stuff request onto busy list - */ + /* Stuff request onto busy list. */ TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); - /* - * Build up the iovec based on the prdt - */ - for (i = 0; i < iovcnt; i++) { - uint32_t dbcsz; - - dbcsz = (prdt->dbc & DBCMASK) + 1; - breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, dbcsz); - breq->br_iov[i].iov_len = dbcsz; - aior->done += dbcsz; - prdt++; - } if (readop) err = blockif_read(p->bctx, breq); else @@ -650,7 +677,7 @@ ahci_handle_flush(struct ahci_port *p, i aior->slot = slot; aior->len = 0; aior->done = 0; - aior->prdtl = 0; + aior->more = 0; breq = &aior->io_req; /* @@ -745,7 +772,7 @@ next: aior->slot = slot; aior->len = len; aior->done = done; - aior->prdtl = 0; + aior->more = (len != done); breq = &aior->io_req; breq->br_offset = elba * blockif_sectsz(p->bctx); @@ -1242,8 +1269,7 @@ atapi_report_luns(struct ahci_port *p, i } static void -atapi_read(struct ahci_port *p, int slot, uint8_t *cfis, - uint32_t done, int seek) +atapi_read(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done) { struct ahci_ioreq *aior; struct ahci_cmd_hdr *hdr; @@ -1253,14 +1279,13 @@ atapi_read(struct ahci_port *p, int slot uint8_t *acmd; uint64_t lba; uint32_t len; - int i, err, iovcnt; + int err; sc = p->pr_sc; acmd = cfis + 0x40; hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); prdt = (struct ahci_prdt_entry *)(cfis + 0x80); - prdt += seek; lba = be32dec(acmd + 2); if (acmd[0] == READ_10) len = be16dec(acmd + 7); @@ -1285,37 +1310,14 @@ atapi_read(struct ahci_port *p, int slot aior->done = done; breq = &aior->io_req; breq->br_offset = lba + done; - iovcnt = hdr->prdtl - seek; - if (iovcnt > BLOCKIF_IOV_MAX) { - aior->prdtl = iovcnt - BLOCKIF_IOV_MAX; - iovcnt = BLOCKIF_IOV_MAX; - } else - aior->prdtl = 0; - breq->br_iovcnt = iovcnt; + ahci_build_iov(p, aior, prdt, hdr->prdtl); - /* - * Mark this command in-flight. - */ + /* Mark this command in-flight. */ p->pending |= 1 << slot; - /* - * Stuff request onto busy list - */ + /* Stuff request onto busy list. */ TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); - /* - * Build up the iovec based on the prdt - */ - for (i = 0; i < iovcnt; i++) { - uint32_t dbcsz; - - dbcsz = (prdt->dbc & DBCMASK) + 1; - breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, dbcsz); - breq->br_iov[i].iov_len = dbcsz; - aior->done += dbcsz; - prdt++; - } err = blockif_read(p->bctx, breq); assert(err == 0); } @@ -1515,7 +1517,7 @@ handle_packet_cmd(struct ahci_port *p, i break; case READ_10: case READ_12: - atapi_read(p, slot, cfis, 0, 0); + atapi_read(p, slot, cfis, 0); break; case REQUEST_SENSE: atapi_request_sense(p, slot, cfis); @@ -1614,7 +1616,7 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_WRITE_DMA48: case ATA_READ_FPDMA_QUEUED: case ATA_WRITE_FPDMA_QUEUED: - ahci_handle_dma(p, slot, cfis, 0, 0); + ahci_handle_rw(p, slot, cfis, 0); break; case ATA_FLUSHCACHE: case ATA_FLUSHCACHE48: @@ -1755,7 +1757,7 @@ ata_ioreq_cb(struct blockif_req *br, int struct pci_ahci_softc *sc; uint32_t tfd; uint8_t *cfis; - int pending, slot, ncq, dsm; + int slot, ncq, dsm; DPRINTF("%s %d\n", __func__, err); @@ -1764,7 +1766,6 @@ ata_ioreq_cb(struct blockif_req *br, int p = aior->io_pr; cfis = aior->cfis; slot = aior->slot; - pending = aior->prdtl; sc = p->pr_sc; hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); @@ -1792,25 +1793,18 @@ ata_ioreq_cb(struct blockif_req *br, int if (!err) hdr->prdbc = aior->done; - if (dsm) { - if (aior->done != aior->len && !err) { + if (!err && aior->more) { + if (dsm) ahci_handle_dsm_trim(p, slot, cfis, aior->done); - goto out; - } - } else { - if (pending && !err) { - ahci_handle_dma(p, slot, cfis, aior->done, - hdr->prdtl - pending); - goto out; - } + else + ahci_handle_rw(p, slot, cfis, aior->done); + goto out; } - if (!err && aior->done == aior->len) { + if (!err) tfd = ATA_S_READY | ATA_S_DSC; - } else { + else tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - } - if (ncq) ahci_write_fis_sdb(p, slot, cfis, tfd); else @@ -1836,7 +1830,7 @@ atapi_ioreq_cb(struct blockif_req *br, i struct pci_ahci_softc *sc; uint8_t *cfis; uint32_t tfd; - int pending, slot; + int slot; DPRINTF("%s %d\n", __func__, err); @@ -1844,7 +1838,6 @@ atapi_ioreq_cb(struct blockif_req *br, i p = aior->io_pr; cfis = aior->cfis; slot = aior->slot; - pending = aior->prdtl; sc = p->pr_sc; hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + aior->slot * AHCI_CL_SIZE); @@ -1863,19 +1856,18 @@ atapi_ioreq_cb(struct blockif_req *br, i if (!err) hdr->prdbc = aior->done; - if (pending && !err) { - atapi_read(p, slot, cfis, aior->done, hdr->prdtl - pending); + if (!err && aior->more) { + atapi_read(p, slot, cfis, aior->done); goto out; } - if (!err && aior->done == aior->len) { + if (!err) { tfd = ATA_S_READY | ATA_S_DSC; } else { p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; p->asc = 0x21; tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; } - cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; ahci_write_fis_d2h(p, slot, cfis, tfd); From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 21:16:44 2015 Return-Path: Delivered-To: svn-src-all@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 E6E9429E; Fri, 17 Apr 2015 21:16:44 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 A8045EB2; Fri, 17 Apr 2015 21:16:44 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4FA1A1FE023; Fri, 17 Apr 2015 23:16:42 +0200 (CEST) Message-ID: <5531786A.1000900@selasky.org> Date: Fri, 17 Apr 2015 23:17:30 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281644 - head/sys/dev/usb/video References: <201504170707.t3H777HV089365@svn.freebsd.org> <2107439.xSp98Qc672@ralph.baldwin.cx> In-Reply-To: <2107439.xSp98Qc672@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 21:16:45 -0000 On 04/17/15 14:44, John Baldwin wrote: > On Friday, April 17, 2015 07:07:07 AM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Fri Apr 17 07:07:06 2015 >> New Revision: 281644 >> URL: https://svnweb.freebsd.org/changeset/base/281644 >> >> Log: >> Buffers which can be memory mapped into userspace should never be >> freed. Recycle the buffers instead. This patch also fixes a panic at >> reboot issue when an UDL adapter is attached to the system. > > You can free them safely if you don't use malloc() / free(). Instead, you > could create an OBJT_PHYS object that you wire when you map into the kernel > and export that to userland via d_mmap_single. In your driver you just > need to unmap the kernel mapping to drop the reference count on the object. > Once the userland processes exit or remove their mappings the pages would > be freed. > Hi, If you want to make a patch for UDL as a good example how to do this, please go ahead! I can test the driver is not broken afterwards. --HPS From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 21:21:12 2015 Return-Path: Delivered-To: svn-src-all@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 C933C43D; Fri, 17 Apr 2015 21:21: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 B6C2AF6A; Fri, 17 Apr 2015 21:21: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 t3HLLCs7097676; Fri, 17 Apr 2015 21:21:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HLLCjb097675; Fri, 17 Apr 2015 21:21:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504172121.t3HLLCjb097675@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 17 Apr 2015 21:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281667 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 21:21:12 -0000 Author: delphij Date: Fri Apr 17 21:21:11 2015 New Revision: 281667 URL: https://svnweb.freebsd.org/changeset/base/281667 Log: Remove vfs.zfs.snapshot_list_prefetch, the corresponding code was gone in r248571 already. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 17 20:20:55 2015 (r281666) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 17 21:21:11 2015 (r281667) @@ -195,11 +195,6 @@ CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX); -static int snapshot_list_prefetch; -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, snapshot_list_prefetch, CTLFLAG_RWTUN, - &snapshot_list_prefetch, 0, "Prefetch data when listing snapshots"); - static struct cdev *zfsdev; extern void zfs_init(void); From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 22:17:23 2015 Return-Path: Delivered-To: svn-src-all@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 81BBD156; Fri, 17 Apr 2015 22:17: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 6FAD2770; Fri, 17 Apr 2015 22:17: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 t3HMHNLY026493; Fri, 17 Apr 2015 22:17:23 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HMHNDS026492; Fri, 17 Apr 2015 22:17:23 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201504172217.t3HMHNDS026492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 17 Apr 2015 22:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281669 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 22:17:23 -0000 Author: loos Date: Fri Apr 17 22:17:22 2015 New Revision: 281669 URL: https://svnweb.freebsd.org/changeset/base/281669 Log: Remove unnecessary checks and fix an issue where the interrupt handler could return with lock held. Modified: head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Apr 17 22:16:35 2015 (r281668) +++ head/sys/arm/allwinner/if_emac.c Fri Apr 17 22:17:22 2015 (r281669) @@ -662,9 +662,6 @@ emac_intr(void *arg) sc = (struct emac_softc *)arg; EMAC_LOCK(sc); - ifp = sc->emac_ifp; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return; /* Disable all interrupts */ EMAC_WRITE_REG(sc, EMAC_INT_CTL, 0); @@ -678,18 +675,17 @@ emac_intr(void *arg) emac_rxeof(sc, sc->emac_rx_process_limit); /* Transmit Interrupt check */ - if (reg_val & EMAC_INT_STA_TX){ + if (reg_val & EMAC_INT_STA_TX) { emac_txeof(sc); + ifp = sc->emac_ifp; if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) emac_start_locked(ifp); } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - /* Re-enable interrupt mask */ - reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); - reg_val |= EMAC_INT_EN; - EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); - } + /* Re-enable interrupt mask */ + reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); + reg_val |= EMAC_INT_EN; + EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); EMAC_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 22:26:04 2015 Return-Path: Delivered-To: svn-src-all@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 1401F42A; Fri, 17 Apr 2015 22:26: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 0055684F; Fri, 17 Apr 2015 22:26: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 t3HMQ3gc031325; Fri, 17 Apr 2015 22:26:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HMQ2wL031313; Fri, 17 Apr 2015 22:26:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504172226.t3HMQ2wL031313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 17 Apr 2015 22:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281670 - in head/sys: fs/ext2fs modules/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 22:26:04 -0000 Author: pfg Date: Fri Apr 17 22:26:01 2015 New Revision: 281670 URL: https://svnweb.freebsd.org/changeset/base/281670 Log: Drop experimental dir_index support. The htree directory index is a highly desirable feature for research purposes and was meant to improve performance in our ext2/3 driver. Unfortunately our implementation has two problems: - It never really delivered any performance improvement. - It appears to corrupt the filesystem in undetermined circumstances. Strictly speaking dir_index is not required for read/write support in ext2/3 and our limited ext4 support still works fine without it. Regain stability in the ext2 driver by removing it. We may need it back (fixed) if we want to support encrypted ext4 support but thanks to the wonders of version control we can always revert this change and bring it back. PR: 191895 PR: 198731 PR: 199309 MFC after: 5 days Deleted: head/sys/fs/ext2fs/ext2_hash.c head/sys/fs/ext2fs/ext2_htree.c Modified: head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h head/sys/modules/ext2fs/Makefile Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Fri Apr 17 22:17:22 2015 (r281669) +++ head/sys/fs/ext2fs/ext2_dir.h Fri Apr 17 22:26:01 2015 (r281670) @@ -40,21 +40,6 @@ struct ext2fs_direct { uint16_t e2d_namlen; /* length of string in e2d_name */ char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ }; - -enum slotstatus { - NONE, - COMPACT, - FOUND -}; - -struct ext2fs_searchslot { - enum slotstatus slotstatus; - doff_t slotoffset; /* offset of area with free space */ - int slotsize; /* size of area at slotoffset */ - int slotfreespace; /* amount of space free in slot */ - int slotneeded; /* sizeof the entry we are seeking */ -}; - /* * The new version of the directory entry. Since EXT2 structures are * stored in intel byte order, and the name_len field could never be Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Fri Apr 17 22:17:22 2015 (r281669) +++ head/sys/fs/ext2fs/ext2_extern.h Fri Apr 17 22:26:01 2015 (r281670) @@ -40,15 +40,12 @@ #define _FS_EXT2FS_EXT2_EXTERN_H_ struct ext2fs_dinode; -struct ext2fs_direct_2; -struct ext2fs_searchslot; struct indir; struct inode; struct mount; struct vfsconf; struct vnode; -int ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *); int ext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int, struct ucred *, e4fs_daddr_t *); int ext2_balloc(struct inode *, @@ -86,18 +83,6 @@ int ext2_dirempty(struct inode *, ino_t, int ext2_checkpath(struct inode *, struct inode *, struct ucred *); int cg_has_sb(int i); int ext2_inactive(struct vop_inactive_args *); -int ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *, - struct componentname *); -int ext2_htree_create_index(struct vnode *, struct componentname *, - struct ext2fs_direct_2 *); -int ext2_htree_has_idx(struct inode *); -int ext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *, - uint32_t *); -int ext2_htree_lookup(struct inode *, const char *, int, struct buf **, - int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); -int ext2_search_dirblock(struct inode *, void *, int *, const char *, int, - int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); - /* Flags to low-level allocation routines. * The low 16-bits are reserved for IO_ flags from vnode.h. Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Fri Apr 17 22:17:22 2015 (r281669) +++ head/sys/fs/ext2fs/ext2_lookup.c Fri Apr 17 22:26:01 2015 (r281670) @@ -113,19 +113,9 @@ static u_char dt_to_ext2_ft[] = { static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, int entryoffsetinblock); -static int ext2_is_dot_entry(struct componentname *cnp); static int ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, ino_t *dd_ino); -static int -ext2_is_dot_entry(struct componentname *cnp) -{ - if (cnp->cn_namelen <= 2 && cnp->cn_nameptr[0] == '.' && - (cnp->cn_nameptr[1] == '.' || cnp->cn_nameptr[1] == '0')) - return (1); - return (0); -} - /* * Vnode op for reading directories. */ @@ -306,9 +296,13 @@ ext2_lookup_ino(struct vnode *vdp, struc struct buf *bp; /* a buffer of directory entries */ struct ext2fs_direct_2 *ep; /* the current directory entry */ int entryoffsetinblock; /* offset of ep in bp's buffer */ - struct ext2fs_searchslot ss; + enum {NONE, COMPACT, FOUND} slotstatus; + doff_t slotoffset; /* offset of area with free space */ doff_t i_diroff; /* cached i_diroff value */ doff_t i_offset; /* cached i_offset value */ + int slotsize; /* size of area at slotoffset */ + int slotfreespace; /* amount of space free in slot */ + int slotneeded; /* size of the entry we're seeking */ int numdirpasses; /* strategy for directory search */ doff_t endsearch; /* offset to end directory search */ doff_t prevoff; /* prev entry dp->i_offset */ @@ -316,13 +310,12 @@ ext2_lookup_ino(struct vnode *vdp, struc struct vnode *tdp; /* returned by VFS_VGET */ doff_t enduseful; /* pointer past last used dir slot */ u_long bmask; /* block offset mask */ - int error; + int namlen, error; struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; ino_t ino, ino1; int ltype; - int entry_found = 0; int DIRBLKSIZ = VTOI(vdp)->i_e2fs->e2fs_bsize; @@ -333,57 +326,31 @@ ext2_lookup_ino(struct vnode *vdp, struc bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; restart: bp = NULL; - ss.slotoffset = -1; + slotoffset = -1; /* * We now have a segment name to search for, and a directory to search. - * + */ + + /* * Suppress search for slots unless creating * file and at end of pathname, in which case * we watch for a place to put the new file in * case it doesn't already exist. */ i_diroff = dp->i_diroff; - ss.slotstatus = FOUND; - ss.slotfreespace = ss.slotsize = ss.slotneeded = 0; + slotstatus = FOUND; + slotfreespace = slotsize = slotneeded = 0; if ((nameiop == CREATE || nameiop == RENAME) && (flags & ISLASTCN)) { - ss.slotstatus = NONE; - ss.slotneeded = EXT2_DIR_REC_LEN(cnp->cn_namelen); + slotstatus = NONE; + slotneeded = EXT2_DIR_REC_LEN(cnp->cn_namelen); /* was - ss.slotneeded = (sizeof(struct direct) - MAXNAMLEN + + slotneeded = (sizeof(struct direct) - MAXNAMLEN + cnp->cn_namelen + 3) &~ 3; */ } /* - * Try to lookup dir entry using htree directory index. - * - * If we got an error or we want to find '.' or '..' entry, - * we will fall back to linear search. - */ - if (!ext2_is_dot_entry(cnp) && ext2_htree_has_idx(dp)) { - numdirpasses = 1; - entryoffsetinblock = 0; - switch (ext2_htree_lookup(dp, cnp->cn_nameptr, cnp->cn_namelen, - &bp, &entryoffsetinblock, &i_offset, &prevoff, - &enduseful, &ss)) { - case 0: - ep = (struct ext2fs_direct_2 *)((char *)bp->b_data + - (i_offset & bmask)); - goto foundentry; - case ENOENT: - i_offset = roundup2(dp->i_size, DIRBLKSIZ); - goto notfound; - default: - /* - * Something failed; just fallback to do a linear - * search. - */ - break; - } - } - - /* * If there is cached information on a previous search of * this directory, pick up where we last left off. * We cache only lookups as these are the most common @@ -417,38 +384,96 @@ searchloop: /* * If necessary, get the next directory block. */ - if (bp != NULL) - brelse(bp); - error = ext2_blkatoff(vdp, (off_t)i_offset, NULL, &bp); - if (error != 0) - return (error); - entryoffsetinblock = 0; + if ((i_offset & bmask) == 0) { + if (bp != NULL) + brelse(bp); + if ((error = + ext2_blkatoff(vdp, (off_t)i_offset, NULL, + &bp)) != 0) + return (error); + entryoffsetinblock = 0; + } /* * If still looking for a slot, and at a DIRBLKSIZE * boundary, have to start looking for free space again. */ - if (ss.slotstatus == NONE && + if (slotstatus == NONE && (entryoffsetinblock & (DIRBLKSIZ - 1)) == 0) { - ss.slotoffset = -1; - ss.slotfreespace = 0; + slotoffset = -1; + slotfreespace = 0; } - error = ext2_search_dirblock(dp, bp->b_data, &entry_found, - cnp->cn_nameptr, cnp->cn_namelen, - &entryoffsetinblock, &i_offset, &prevoff, - &enduseful, &ss); - if (error != 0) { - brelse(bp); - return (error); + /* + * Get pointer to next entry. + * Full validation checks are slow, so we only check + * enough to insure forward progress through the + * directory. Complete checks can be run by setting + * "vfs.e2fs.dirchk" to be true. + */ + ep = (struct ext2fs_direct_2 *) + ((char *)bp->b_data + entryoffsetinblock); + if (ep->e2d_reclen == 0 || + (dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock))) { + int i; + ext2_dirbad(dp, i_offset, "mangled entry"); + i = DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1)); + i_offset += i; + entryoffsetinblock += i; + continue; } - if (entry_found) { - ep = (struct ext2fs_direct_2 *)((char *)bp->b_data + - (entryoffsetinblock & bmask)); -foundentry: - ino = ep->e2d_ino; - goto found; + + /* + * If an appropriate sized slot has not yet been found, + * check to see if one is available. Also accumulate space + * in the current block so that we can determine if + * compaction is viable. + */ + if (slotstatus != FOUND) { + int size = ep->e2d_reclen; + + if (ep->e2d_ino != 0) + size -= EXT2_DIR_REC_LEN(ep->e2d_namlen); + if (size > 0) { + if (size >= slotneeded) { + slotstatus = FOUND; + slotoffset = i_offset; + slotsize = ep->e2d_reclen; + } else if (slotstatus == NONE) { + slotfreespace += size; + if (slotoffset == -1) + slotoffset = i_offset; + if (slotfreespace >= slotneeded) { + slotstatus = COMPACT; + slotsize = i_offset + + ep->e2d_reclen - slotoffset; + } + } + } } + + /* + * Check for a name match. + */ + if (ep->e2d_ino) { + namlen = ep->e2d_namlen; + if (namlen == cnp->cn_namelen && + !bcmp(cnp->cn_nameptr, ep->e2d_name, + (unsigned)namlen)) { + /* + * Save directory entry's inode number and + * reclen in ndp->ni_ufs area, and release + * directory buffer. + */ + ino = ep->e2d_ino; + goto found; + } + } + prevoff = i_offset; + i_offset += ep->e2d_reclen; + entryoffsetinblock += ep->e2d_reclen; + if (ep->e2d_ino) + enduseful = i_offset; } -notfound: +/* notfound: */ /* * If we started in the middle of the directory and failed * to find our target, we must check the beginning as well. @@ -483,15 +508,15 @@ notfound: * can be put in the range from dp->i_offset to * dp->i_offset + dp->i_count. */ - if (ss.slotstatus == NONE) { + if (slotstatus == NONE) { dp->i_offset = roundup2(dp->i_size, DIRBLKSIZ); dp->i_count = 0; enduseful = dp->i_offset; } else { - dp->i_offset = ss.slotoffset; - dp->i_count = ss.slotsize; - if (enduseful < ss.slotoffset + ss.slotsize) - enduseful = ss.slotoffset + ss.slotsize; + dp->i_offset = slotoffset; + dp->i_count = slotsize; + if (enduseful < slotoffset + slotsize) + enduseful = slotoffset + slotsize; } dp->i_endoff = roundup2(enduseful, DIRBLKSIZ); /* @@ -697,102 +722,6 @@ found: return (0); } -int -ext2_search_dirblock(struct inode *ip, void *data, int *foundp, - const char *name, int namelen, int *entryoffsetinblockp, - doff_t *offp, doff_t *prevoffp, doff_t *endusefulp, - struct ext2fs_searchslot *ssp) -{ - struct vnode *vdp; - struct ext2fs_direct_2 *ep, *top; - uint32_t bsize = ip->i_e2fs->e2fs_bsize; - int offset = *entryoffsetinblockp; - int namlen; - - vdp = ITOV(ip); - - ep = (struct ext2fs_direct_2 *)((char *)data + offset); - top = (struct ext2fs_direct_2 *)((char *)data + - bsize - EXT2_DIR_REC_LEN(0)); - - while (ep < top) { - /* - * Full validation checks are slow, so we only check - * enough to insure forward progress through the - * directory. Complete checks can be run by setting - * "vfs.e2fs.dirchk" to be true. - */ - if (ep->e2d_reclen == 0 || - (dirchk && ext2_dirbadentry(vdp, ep, offset))) { - int i; - ext2_dirbad(ip, *offp, "mangled entry"); - i = bsize - (offset & (bsize - 1)); - *offp += i; - offset += i; - continue; - } - - /* - * If an appropriate sized slot has not yet been found, - * check to see if one is available. Also accumulate space - * in the current block so that we can determine if - * compaction is viable. - */ - if (ssp->slotstatus != FOUND) { - int size = ep->e2d_reclen; - - if (ep->e2d_ino != 0) - size -= EXT2_DIR_REC_LEN(ep->e2d_namlen); - if (size > 0) { - if (size >= ssp->slotneeded) { - ssp->slotstatus = FOUND; - ssp->slotoffset = *offp; - ssp->slotsize = ep->e2d_reclen; - } else if (ssp->slotstatus == NONE) { - ssp->slotfreespace += size; - if (ssp->slotoffset == -1) - ssp->slotoffset = *offp; - if (ssp->slotfreespace >= ssp->slotneeded) { - ssp->slotstatus = COMPACT; - ssp->slotsize = *offp + - ep->e2d_reclen - - ssp->slotoffset; - } - } - } - } - - /* - * Check for a name match. - */ - if (ep->e2d_ino) { - namlen = ep->e2d_namlen; - if (namlen == namelen && - !bcmp(name, ep->e2d_name, (unsigned)namlen)) { - /* - * Save directory entry's inode number and - * reclen in ndp->ni_ufs area, and release - * directory buffer. - */ - *foundp = 1; - return (0); - } - } - *prevoffp = *offp; - *offp += ep->e2d_reclen; - offset += ep->e2d_reclen; - *entryoffsetinblockp = offset; - if (ep->e2d_ino) - *endusefulp = *offp; - /* - * Get pointer to the next entry. - */ - ep = (struct ext2fs_direct_2 *)((char *)data + offset); - } - - return (0); -} - void ext2_dirbad(struct inode *ip, doff_t offset, char *how) { @@ -862,12 +791,16 @@ ext2_dirbadentry(struct vnode *dp, struc int ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp) { + struct ext2fs_direct_2 *ep, *nep; struct inode *dp; + struct buf *bp; struct ext2fs_direct_2 newdir; struct iovec aiov; struct uio auio; - int error, newentrysize; - int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; + u_int dsize; + int error, loc, newentrysize, spacefree; + char *dirbuf; + int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; #ifdef INVARIANTS @@ -884,28 +817,6 @@ ext2_direnter(struct inode *ip, struct v newdir.e2d_type = EXT2_FT_UNKNOWN; bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1); newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen); - - if (ext2_htree_has_idx(dp)) { - error = ext2_htree_add_entry(dvp, &newdir, cnp); - if (error) { - dp->i_flag &= ~IN_E4INDEX; - dp->i_flag |= IN_CHANGE | IN_UPDATE; - } - return (error); - } - - if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) && - !ext2_htree_has_idx(dp)) { - if ((dp->i_size / DIRBLKSIZ) == 1 && - dp->i_offset == DIRBLKSIZ) { - /* - * Making indexed directory when one block is not - * enough to save all entries. - */ - return ext2_htree_create_index(dvp, cnp, &newdir); - } - } - if (dp->i_count == 0) { /* * If dp->i_count is 0, then namei could find no @@ -937,29 +848,6 @@ ext2_direnter(struct inode *ip, struct v return (error); } - error = ext2_add_entry(dvp, &newdir); - if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) - error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, - cnp->cn_cred, cnp->cn_thread); - return (error); -} - -/* - * Insert an entry into the directory block. - * Compact the contents. - */ -int -ext2_add_entry(struct vnode *dvp, struct ext2fs_direct_2 *entry) -{ - struct ext2fs_direct_2 *ep, *nep; - struct inode *dp; - struct buf *bp; - u_int dsize; - int error, loc, newentrysize, spacefree; - char *dirbuf; - - dp = VTOI(dvp); - /* * If dp->i_count is non-zero, then namei found space * for the new entry in the range dp->i_offset to @@ -991,7 +879,6 @@ ext2_add_entry(struct vnode *dvp, struct * dp->i_offset + dp->i_count would yield the * space. */ - newentrysize = EXT2_DIR_REC_LEN(entry->e2d_namlen); ep = (struct ext2fs_direct_2 *)dirbuf; dsize = EXT2_DIR_REC_LEN(ep->e2d_namlen); spacefree = ep->e2d_reclen - dsize; @@ -1017,15 +904,15 @@ ext2_add_entry(struct vnode *dvp, struct if (ep->e2d_ino == 0) { if (spacefree + dsize < newentrysize) panic("ext2_direnter: compact1"); - entry->e2d_reclen = spacefree + dsize; + newdir.e2d_reclen = spacefree + dsize; } else { if (spacefree < newentrysize) panic("ext2_direnter: compact2"); - entry->e2d_reclen = spacefree; + newdir.e2d_reclen = spacefree; ep->e2d_reclen = dsize; ep = (struct ext2fs_direct_2 *)((char *)ep + dsize); } - bcopy((caddr_t)entry, (caddr_t)ep, (u_int)newentrysize); + bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize); if (DOINGASYNC(dvp)) { bdwrite(bp); error = 0; @@ -1033,6 +920,9 @@ ext2_add_entry(struct vnode *dvp, struct error = bwrite(bp); } dp->i_flag |= IN_CHANGE | IN_UPDATE; + if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) + error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, + cnp->cn_cred, cnp->cn_thread); return (error); } Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Apr 17 22:17:22 2015 (r281669) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Apr 17 22:26:01 2015 (r281670) @@ -399,22 +399,8 @@ compute_sb_data(struct vnode *devvp, str if (es->e2fs_rev == E2FS_REV0 || !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE)) fs->e2fs_maxfilesize = 0x7fffffff; - else { - fs->e2fs_maxfilesize = 0xffffffffffff; - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE)) - fs->e2fs_maxfilesize = 0x7fffffffffffffff; - } - if (es->e4fs_flags & E2FS_UNSIGNED_HASH) { - fs->e2fs_uhash = 3; - } else if ((es->e4fs_flags & E2FS_SIGNED_HASH) == 0) { -#ifdef __CHAR_UNSIGNED__ - es->e4fs_flags |= E2FS_UNSIGNED_HASH; - fs->e2fs_uhash = 3; -#else - es->e4fs_flags |= E2FS_SIGNED_HASH; -#endif - } - + else + fs->e2fs_maxfilesize = 0x7fffffffffffffff; return (0); } Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Apr 17 22:17:22 2015 (r281669) +++ head/sys/fs/ext2fs/ext2fs.h Fri Apr 17 22:26:01 2015 (r281670) @@ -147,7 +147,6 @@ struct m_ext2fs { int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ - int32_t e2fs_uhash; /* 3 if hash should be signed, 0 if not */ }; /* cluster summary information */ @@ -212,7 +211,6 @@ struct csum { * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ -#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) @@ -242,12 +240,6 @@ struct csum { #define E2FS_ISCLEAN 0x0001 /* Unmounted cleanly */ #define E2FS_ERRORS 0x0002 /* Errors detected */ -/* - * Filesystem miscellaneous flags - */ -#define E2FS_SIGNED_HASH 0x0001 -#define E2FS_UNSIGNED_HASH 0x0002 - /* ext2 file system block group descriptor */ struct ext2_gd { Modified: head/sys/modules/ext2fs/Makefile ============================================================================== --- head/sys/modules/ext2fs/Makefile Fri Apr 17 22:17:22 2015 (r281669) +++ head/sys/modules/ext2fs/Makefile Fri Apr 17 22:26:01 2015 (r281670) @@ -3,8 +3,8 @@ .PATH: ${.CURDIR}/../../fs/ext2fs KMOD= ext2fs SRCS= opt_ddb.h opt_directio.h opt_quota.h opt_suiddir.h vnode_if.h \ - ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_extents.c ext2_hash.c \ - ext2_htree.c ext2_inode.c ext2_inode_cnv.c ext2_lookup.c ext2_subr.c \ + ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_extents.c \ + ext2_inode.c ext2_inode_cnv.c ext2_lookup.c ext2_subr.c \ ext2_vfsops.c ext2_vnops.c .include From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 23:49:44 2015 Return-Path: Delivered-To: svn-src-all@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 B7D1F288; Fri, 17 Apr 2015 23:49: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 A5D85FA9; Fri, 17 Apr 2015 23:49: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 t3HNniu2070268; Fri, 17 Apr 2015 23:49:44 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3HNnixW070265; Fri, 17 Apr 2015 23:49:44 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201504172349.t3HNnixW070265@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 17 Apr 2015 23:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281673 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 23:49:44 -0000 Author: loos Date: Fri Apr 17 23:49:43 2015 New Revision: 281673 URL: https://svnweb.freebsd.org/changeset/base/281673 Log: Add the necessary support to use both TX queues available on if_emac. Each TX queue can hold one packet (yes, if_emac can send only two(!) packets at a time). Even with this change the very limited FIFO buffer (3 KiB for TX and 13 KiB for RX) fill up too quick to sustain higher throughput. For the TCP case it turns out that TX isn't the limiting factor, but the RX side is (the FIFO fill up and starts to discard packets, so the sender has to slow down). Modified: head/sys/arm/allwinner/if_emac.c head/sys/arm/allwinner/if_emacreg.h Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Apr 17 22:44:44 2015 (r281672) +++ head/sys/arm/allwinner/if_emac.c Fri Apr 17 23:49:43 2015 (r281673) @@ -101,6 +101,7 @@ struct emac_softc { int emac_watchdog_timer; int emac_rx_process_limit; int emac_link; + uint32_t emac_fifo_mask; }; static int emac_probe(device_t); @@ -121,7 +122,7 @@ static void emac_intr(void *); static int emac_ioctl(struct ifnet *, u_long, caddr_t); static void emac_rxeof(struct emac_softc *, int); -static void emac_txeof(struct emac_softc *); +static void emac_txeof(struct emac_softc *, uint32_t); static int emac_miibus_readreg(device_t, int, int); static int emac_miibus_writereg(device_t, int, int, int); @@ -253,14 +254,19 @@ emac_reset(struct emac_softc *sc) } static void -emac_txeof(struct emac_softc *sc) +emac_txeof(struct emac_softc *sc, uint32_t status) { struct ifnet *ifp; EMAC_ASSERT_LOCKED(sc); ifp = sc->emac_ifp; - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + status &= (EMAC_TX_FIFO0 | EMAC_TX_FIFO1); + sc->emac_fifo_mask &= ~status; + if (status == (EMAC_TX_FIFO0 | EMAC_TX_FIFO1)) + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 2); + else + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Unarm watchdog timer if no TX */ @@ -580,11 +586,13 @@ emac_start_locked(struct ifnet *ifp) { struct emac_softc *sc; struct mbuf *m, *m0; - uint32_t reg_val; + uint32_t fifo, reg; sc = ifp->if_softc; if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; + if (sc->emac_fifo_mask == (EMAC_TX_FIFO0 | EMAC_TX_FIFO1)) + return; if (sc->emac_link == 0) return; IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -592,7 +600,14 @@ emac_start_locked(struct ifnet *ifp) return; /* Select channel */ - EMAC_WRITE_REG(sc, EMAC_TX_INS, 0); + if (sc->emac_fifo_mask & EMAC_TX_FIFO0) + fifo = 1; + else + fifo = 0; + sc->emac_fifo_mask |= (1 << fifo); + if (sc->emac_fifo_mask == (EMAC_TX_FIFO0 | EMAC_TX_FIFO1)) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + EMAC_WRITE_REG(sc, EMAC_TX_INS, fifo); /* * Emac controller wants 4 byte aligned TX buffers. @@ -613,17 +628,17 @@ emac_start_locked(struct ifnet *ifp) roundup2(m->m_len, 4) / 4); /* Send the data lengh. */ - EMAC_WRITE_REG(sc, EMAC_TX_PL0, m->m_len); + reg = (fifo == 0) ? EMAC_TX_PL0 : EMAC_TX_PL1; + EMAC_WRITE_REG(sc, reg, m->m_len); /* Start translate from fifo to phy. */ - reg_val = EMAC_READ_REG(sc, EMAC_TX_CTL0); - reg_val |= 1; - EMAC_WRITE_REG(sc, EMAC_TX_CTL0, reg_val); + reg = (fifo == 0) ? EMAC_TX_CTL0 : EMAC_TX_CTL1; + EMAC_WRITE_REG(sc, reg, EMAC_READ_REG(sc, reg) | 1); /* Set timeout */ sc->emac_watchdog_timer = 5; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + /* Data have been sent to hardware, it is okay to free the mbuf now. */ BPF_MTAP(ifp, m); m_freem(m); } @@ -676,7 +691,7 @@ emac_intr(void *arg) /* Transmit Interrupt check */ if (reg_val & EMAC_INT_STA_TX) { - emac_txeof(sc); + emac_txeof(sc, reg_val); ifp = sc->emac_ifp; if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) emac_start_locked(ifp); Modified: head/sys/arm/allwinner/if_emacreg.h ============================================================================== --- head/sys/arm/allwinner/if_emacreg.h Fri Apr 17 22:44:44 2015 (r281672) +++ head/sys/arm/allwinner/if_emacreg.h Fri Apr 17 23:49:43 2015 (r281673) @@ -51,6 +51,8 @@ #define EMAC_TX_TSVH0 0x30 #define EMAC_TX_TSVL1 0x34 #define EMAC_TX_TSVH1 0x38 +#define EMAC_TX_FIFO0 (1 << 0) +#define EMAC_TX_FIFO1 (1 << 1) #define EMAC_RX_CTL 0x3C #define EMAC_RX_HASH0 0x40 @@ -61,7 +63,7 @@ #define EMAC_INT_CTL 0x54 #define EMAC_INT_STA 0x58 -#define EMAC_INT_STA_TX (0x01 | 0x02) +#define EMAC_INT_STA_TX (EMAC_TX_FIFO0 | EMAC_TX_FIFO1) #define EMAC_INT_STA_RX 0x100 #define EMAC_INT_EN (0xf << 0) | (1 << 8) From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 00:30:37 2015 Return-Path: Delivered-To: svn-src-all@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 9A2FC980; Sat, 18 Apr 2015 00:30:37 +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 6E62064C; Sat, 18 Apr 2015 00:30:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I0Ub4l091135; Sat, 18 Apr 2015 00:30:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I0Ubde091133; Sat, 18 Apr 2015 00:30:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504180030.t3I0Ubde091133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 18 Apr 2015 00:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281674 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 00:30:37 -0000 Author: emaste Date: Sat Apr 18 00:30:36 2015 New Revision: 281674 URL: https://svnweb.freebsd.org/changeset/base/281674 Log: crunchide: always include both 32- and 64-bit ELF support This avoids the need to build a target-specific crunchide for cross- uilds. Differential Revision: https://reviews.freebsd.org/D2314 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/crunch/crunchide/Makefile head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- head/usr.sbin/crunch/crunchide/Makefile Fri Apr 17 23:49:43 2015 (r281673) +++ head/usr.sbin/crunch/crunchide/Makefile Sat Apr 18 00:30:36 2015 (r281674) @@ -1,19 +1,9 @@ # $FreeBSD$ PROG= crunchide -SRCS= crunchide.c +SRCS= crunchide.c exec_elf32.c exec_elf64.c -TARGET_ARCH?= ${MACHINE_ARCH} - -.if ${TARGET_ARCH} == aarch64 || ${TARGET_ARCH} == amd64 || \ - ${TARGET_ARCH} == powerpc64 || \ - ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH:Mmips64*} -CFLAGS+=-DNLIST_ELF64 -SRCS+= exec_elf64.c +CFLAGS+=-DNLIST_ELF32 -DNLIST_ELF64 exec_elf64.o: exec_elf32.c -.else -CFLAGS+=-DNLIST_ELF32 -SRCS+= exec_elf32.c -.endif .include Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Fri Apr 17 23:49:43 2015 (r281673) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sat Apr 18 00:30:36 2015 (r281674) @@ -79,6 +79,9 @@ __FBSDID("$FreeBSD$"); #define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) #define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#ifndef ELFCLASS +#define ELFCLASS CONCAT(ELFCLASS,ELFSIZE) +#endif #define xe16toh(x) ((data == ELFDATA2MSB) ? be16toh(x) : le16toh(x)) #define xe32toh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) @@ -167,7 +170,7 @@ ELFNAMEEND(check)(int fd, const char *fn if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; - if (IS_ELF(eh) == 0) + if (IS_ELF(eh) == 0 || eh.e_ident[EI_CLASS] != ELFCLASS) return 0; data = eh.e_ident[EI_DATA]; From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 00:35:01 2015 Return-Path: Delivered-To: svn-src-all@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 A72D7B0E; Sat, 18 Apr 2015 00:35: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 88C7775E; Sat, 18 Apr 2015 00:35:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I0Z1Ii094776; Sat, 18 Apr 2015 00:35:01 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I0Z1i1094769; Sat, 18 Apr 2015 00:35:01 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201504180035.t3I0Z1i1094769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 18 Apr 2015 00:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281675 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 00:35:01 -0000 Author: loos Date: Sat Apr 18 00:35:00 2015 New Revision: 281675 URL: https://svnweb.freebsd.org/changeset/base/281675 Log: Simplify the receiver code a bit. Drain the RX FIFO and continue on failure. Modified: head/sys/arm/allwinner/if_emac.c head/sys/arm/allwinner/if_emacreg.h Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Sat Apr 18 00:30:36 2015 (r281674) +++ head/sys/arm/allwinner/if_emac.c Sat Apr 18 00:35:00 2015 (r281675) @@ -254,6 +254,15 @@ emac_reset(struct emac_softc *sc) } static void +emac_drain_rxfifo(struct emac_softc *sc) +{ + uint32_t data; + + while (EMAC_READ_REG(sc, EMAC_RX_FBC) > 0) + data = EMAC_READ_REG(sc, EMAC_RX_IO_DATA); +} + +static void emac_txeof(struct emac_softc *sc, uint32_t status) { struct ifnet *ifp; @@ -281,7 +290,7 @@ emac_rxeof(struct emac_softc *sc, int co uint32_t reg_val, rxcount; int16_t len; uint16_t status; - int good_packet, i; + int i; ifp = sc->emac_ifp; for (; count > 0 && @@ -333,20 +342,19 @@ emac_rxeof(struct emac_softc *sc, int co return; } - good_packet = 1; - /* Get packet size and status */ reg_val = EMAC_READ_REG(sc, EMAC_RX_IO_DATA); len = reg_val & 0xffff; status = (reg_val >> 16) & 0xffff; - if (len < 64) { - good_packet = 0; + if (len < 64 || (status & EMAC_PKT_OK) == 0) { if (bootverbose) if_printf(ifp, "bad packet: len = %i status = %i\n", len, status); if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + emac_drain_rxfifo(sc); + continue; } #if 0 if (status & (EMAC_CRCERR | EMAC_LENERR)) { @@ -358,61 +366,58 @@ emac_rxeof(struct emac_softc *sc, int co if_printf(ifp, "length error\n"); } #endif - if (good_packet) { - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) - return; - m->m_len = m->m_pkthdr.len = MCLBYTES; + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) { + emac_drain_rxfifo(sc); + return; + } + m->m_len = m->m_pkthdr.len = MCLBYTES; - /* Copy entire frame to mbuf first. */ - bus_space_read_multi_4(sc->emac_tag, sc->emac_handle, - EMAC_RX_IO_DATA, mtod(m, uint32_t *), - roundup2(len, 4) / 4); - - m->m_pkthdr.rcvif = ifp; - m->m_len = m->m_pkthdr.len = len - ETHER_CRC_LEN; - - /* - * Emac controller needs strict aligment, so to avoid - * copying over an entire frame to align, we allocate - * a new mbuf and copy ethernet header + IP header to - * the new mbuf. The new mbuf is prepended into the - * existing mbuf chain. - */ - if (m->m_len <= (MHLEN - ETHER_HDR_LEN)) { - bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, - m->m_len); - m->m_data += ETHER_HDR_LEN; - } else if (m->m_len <= (MCLBYTES - ETHER_HDR_LEN) && - m->m_len > (MHLEN - ETHER_HDR_LEN)) { - MGETHDR(m0, M_NOWAIT, MT_DATA); - if (m0 != NULL) { - len = ETHER_HDR_LEN + - m->m_pkthdr.l2hlen; - bcopy(m->m_data, m0->m_data, len); - m->m_data += len; - m->m_len -= len; - m0->m_len = len; - M_MOVE_PKTHDR(m0, m); - m0->m_next = m; - m = m0; - } else { - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - m_freem(m); - m = NULL; - continue; - } - } else if (m->m_len > EMAC_MAC_MAXF) { + /* Copy entire frame to mbuf first. */ + bus_space_read_multi_4(sc->emac_tag, sc->emac_handle, + EMAC_RX_IO_DATA, mtod(m, uint32_t *), roundup2(len, 4) / 4); + + m->m_pkthdr.rcvif = ifp; + m->m_len = m->m_pkthdr.len = len - ETHER_CRC_LEN; + + /* + * Emac controller needs strict aligment, so to avoid + * copying over an entire frame to align, we allocate + * a new mbuf and copy ethernet header + IP header to + * the new mbuf. The new mbuf is prepended into the + * existing mbuf chain. + */ + if (m->m_len <= (MHLEN - ETHER_HDR_LEN)) { + bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, m->m_len); + m->m_data += ETHER_HDR_LEN; + } else if (m->m_len <= (MCLBYTES - ETHER_HDR_LEN) && + m->m_len > (MHLEN - ETHER_HDR_LEN)) { + MGETHDR(m0, M_NOWAIT, MT_DATA); + if (m0 != NULL) { + len = ETHER_HDR_LEN + m->m_pkthdr.l2hlen; + bcopy(m->m_data, m0->m_data, len); + m->m_data += len; + m->m_len -= len; + m0->m_len = len; + M_MOVE_PKTHDR(m0, m); + m0->m_next = m; + m = m0; + } else { if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); m = NULL; continue; } - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - EMAC_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - EMAC_LOCK(sc); + } else if (m->m_len > EMAC_MAC_MAXF) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + m = NULL; + continue; } + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + EMAC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + EMAC_LOCK(sc); } } Modified: head/sys/arm/allwinner/if_emacreg.h ============================================================================== --- head/sys/arm/allwinner/if_emacreg.h Sat Apr 18 00:30:36 2015 (r281674) +++ head/sys/arm/allwinner/if_emacreg.h Sat Apr 18 00:35:00 2015 (r281675) @@ -225,6 +225,7 @@ /* Receive status */ #define EMAC_CRCERR (1 << 4) #define EMAC_LENERR (3 << 5) +#define EMAC_PKT_OK (1 << 7) #define EMAC_RX_FLUSH_FIFO (1 << 3) #define EMAC_PHY_RESET (1 << 15) From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 00:59:04 2015 Return-Path: Delivered-To: svn-src-all@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 DD3F5C2; Sat, 18 Apr 2015 00:59: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 B1F68971; Sat, 18 Apr 2015 00:59: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 t3I0x4ka004987; Sat, 18 Apr 2015 00:59:04 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I0x4NT004986; Sat, 18 Apr 2015 00:59:04 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201504180059.t3I0x4NT004986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 18 Apr 2015 00:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281677 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 00:59:05 -0000 Author: mckusick Date: Sat Apr 18 00:59:03 2015 New Revision: 281677 URL: https://svnweb.freebsd.org/changeset/base/281677 Log: More accurately collect name-cache statistics in sysctl functions sysctl_debug_hashstat_nchash() and sysctl_debug_hashstat_rawnchash(). These changes are in preparation for allowing changes in the size of the vnode hash tables driven by increases and decreases in the maximum number of vnodes in the system. Reviewed by: kib@ Phabric: D2265 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Apr 18 00:53:52 2015 (r281676) +++ head/sys/kern/vfs_cache.c Sat Apr 18 00:59:03 2015 (r281677) @@ -323,29 +323,25 @@ static SYSCTL_NODE(_debug, OID_AUTO, has static int sysctl_debug_hashstat_rawnchash(SYSCTL_HANDLER_ARGS) { - int error; struct nchashhead *ncpp; struct namecache *ncp; - int n_nchash; - int count; + int i, error, n_nchash, *cntbuf; n_nchash = nchash + 1; /* nchash is max index, not count */ - if (!req->oldptr) + if (req->oldptr == NULL) return SYSCTL_OUT(req, 0, n_nchash * sizeof(int)); - - /* Scan hash tables for applicable entries */ - for (ncpp = nchashtbl; n_nchash > 0; n_nchash--, ncpp++) { - CACHE_RLOCK(); - count = 0; - LIST_FOREACH(ncp, ncpp, nc_hash) { - count++; - } - CACHE_RUNLOCK(); - error = SYSCTL_OUT(req, &count, sizeof(count)); - if (error) - return (error); - } - return (0); + cntbuf = malloc(n_nchash * sizeof(int), M_TEMP, M_ZERO | M_WAITOK); + CACHE_RLOCK(); + /* Scan hash tables counting entries */ + for (ncpp = nchashtbl, i = 0; i < n_nchash; ncpp++, i++) + LIST_FOREACH(ncp, ncpp, nc_hash) + cntbuf[i]++; + CACHE_RUNLOCK(); + for (error = 0, i = 0; i < n_nchash; i++) + if ((error = SYSCTL_OUT(req, &cntbuf[i], sizeof(int))) != 0) + break; + free(cntbuf, M_TEMP); + return (error); } SYSCTL_PROC(_debug_hashstat, OID_AUTO, rawnchash, CTLTYPE_INT|CTLFLAG_RD| CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_rawnchash, "S,int", @@ -363,6 +359,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND if (!req->oldptr) return SYSCTL_OUT(req, 0, 4 * sizeof(int)); + CACHE_RLOCK(); n_nchash = nchash + 1; /* nchash is max index, not count */ used = 0; maxlength = 0; @@ -370,17 +367,16 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND /* Scan hash tables for applicable entries */ for (ncpp = nchashtbl; n_nchash > 0; n_nchash--, ncpp++) { count = 0; - CACHE_RLOCK(); LIST_FOREACH(ncp, ncpp, nc_hash) { count++; } - CACHE_RUNLOCK(); if (count) used++; if (maxlength < count) maxlength = count; } n_nchash = nchash + 1; + CACHE_RUNLOCK(); pct = (used * 100) / (n_nchash / 100); error = SYSCTL_OUT(req, &n_nchash, sizeof(n_nchash)); if (error) From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 01:01:40 2015 Return-Path: Delivered-To: svn-src-all@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 A7BA93E8; Sat, 18 Apr 2015 01:01:40 +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 964FCA26; Sat, 18 Apr 2015 01:01:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I11elG006612; Sat, 18 Apr 2015 01:01:40 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I11e9G006611; Sat, 18 Apr 2015 01:01:40 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201504180101.t3I11e9G006611@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 18 Apr 2015 01:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281678 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 01:01:40 -0000 Author: loos Date: Sat Apr 18 01:01:39 2015 New Revision: 281678 URL: https://svnweb.freebsd.org/changeset/base/281678 Log: Fix the style(9) and adds two missing parentheses on the licence. Reduce the differences to bring in the MMC/SD driver. Approved by: ganbold (licence change) Modified: head/sys/arm/allwinner/a10_clk.h Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Sat Apr 18 00:59:03 2015 (r281677) +++ head/sys/arm/allwinner/a10_clk.h Sat Apr 18 01:01:39 2015 (r281678) @@ -17,98 +17,98 @@ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * 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 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ -#ifndef _A10_CLK_H_ -#define _A10_CLK_H_ +#ifndef _A10_CLK_H_ +#define _A10_CLK_H_ -#define CCMU_BASE 0xe1c20000 +#define CCMU_BASE 0xe1c20000 -#define CCM_PLL1_CFG 0x0000 -#define CCM_PLL1_TUN 0x0004 -#define CCM_PLL2_CFG 0x0008 -#define CCM_PLL2_TUN 0x000c -#define CCM_PLL3_CFG 0x0010 -#define CCM_PLL3_TUN 0x0014 -#define CCM_PLL4_CFG 0x0018 -#define CCM_PLL4_TUN 0x001c -#define CCM_PLL5_CFG 0x0020 -#define CCM_PLL5_TUN 0x0024 -#define CCM_PLL6_CFG 0x0028 -#define CCM_PLL6_TUN 0x002c -#define CCM_PLL7_CFG 0x0030 -#define CCM_PLL7_TUN 0x0034 -#define CCM_PLL1_TUN2 0x0038 -#define CCM_PLL5_TUN2 0x003c -#define CCM_PLL_LOCK_DBG 0x004c -#define CCM_OSC24M_CFG 0x0050 -#define CCM_CPU_AHB_APB0_CFG 0x0054 -#define CCM_APB1_CLK_DIV 0x0058 -#define CCM_AXI_GATING 0x005c -#define CCM_AHB_GATING0 0x0060 -#define CCM_AHB_GATING1 0x0064 -#define CCM_APB0_GATING 0x0068 -#define CCM_APB1_GATING 0x006c -#define CCM_NAND_SCLK_CFG 0x0080 -#define CCM_MS_SCLK_CFG 0x0084 -#define CCM_MMC0_SCLK_CFG 0x0088 -#define CCM_MMC1_SCLK_CFG 0x008c -#define CCM_MMC2_SCLK_CFG 0x0090 -#define CCM_MMC3_SCLK_CFG 0x0094 -#define CCM_TS_CLK 0x0098 -#define CCM_SS_CLK 0x009c -#define CCM_SPI0_CLK 0x00a0 -#define CCM_SPI1_CLK 0x00a4 -#define CCM_SPI2_CLK 0x00a8 -#define CCM_PATA_CLK 0x00ac -#define CCM_IR0_CLK 0x00b0 -#define CCM_IR1_CLK 0x00b4 -#define CCM_IIS_CLK 0x00b8 -#define CCM_AC97_CLK 0x00bc -#define CCM_SPDIF_CLK 0x00c0 -#define CCM_KEYPAD_CLK 0x00c4 -#define CCM_SATA_CLK 0x00c8 -#define CCM_USB_CLK 0x00cc -#define CCM_GPS_CLK 0x00d0 -#define CCM_SPI3_CLK 0x00d4 -#define CCM_DRAM_CLK 0x0100 -#define CCM_BE0_SCLK 0x0104 -#define CCM_BE1_SCLK 0x0108 -#define CCM_FE0_CLK 0x010c -#define CCM_FE1_CLK 0x0110 -#define CCM_MP_CLK 0x0114 -#define CCM_LCD0_CH0_CLK 0x0118 -#define CCM_LCD1_CH0_CLK 0x011c -#define CCM_CSI_ISP_CLK 0x0120 -#define CCM_TVD_CLK 0x0128 -#define CCM_LCD0_CH1_CLK 0x012c -#define CCM_LCD1_CH1_CLK 0x0130 -#define CCM_CS0_CLK 0x0134 -#define CCM_CS1_CLK 0x0138 -#define CCM_VE_CLK 0x013c -#define CCM_AUDIO_CODEC_CLK 0x0140 -#define CCM_AVS_CLK 0x0144 -#define CCM_ACE_CLK 0x0148 -#define CCM_LVDS_CLK 0x014c -#define CCM_HDMI_CLK 0x0150 -#define CCM_MALI400_CLK 0x0154 - -#define CCM_AHB_GATING_USB0 (1 << 0) -#define CCM_AHB_GATING_EHCI0 (1 << 1) -#define CCM_AHB_GATING_EHCI1 (1 << 3) -#define CCM_AHB_GATING_EMAC (1 << 17) - -#define CCM_USB_PHY (1 << 8) -#define CCM_USB0_RESET (1 << 0) -#define CCM_USB1_RESET (1 << 1) -#define CCM_USB2_RESET (1 << 2) +#define CCM_PLL1_CFG 0x0000 +#define CCM_PLL1_TUN 0x0004 +#define CCM_PLL2_CFG 0x0008 +#define CCM_PLL2_TUN 0x000c +#define CCM_PLL3_CFG 0x0010 +#define CCM_PLL3_TUN 0x0014 +#define CCM_PLL4_CFG 0x0018 +#define CCM_PLL4_TUN 0x001c +#define CCM_PLL5_CFG 0x0020 +#define CCM_PLL5_TUN 0x0024 +#define CCM_PLL6_CFG 0x0028 +#define CCM_PLL6_TUN 0x002c +#define CCM_PLL7_CFG 0x0030 +#define CCM_PLL7_TUN 0x0034 +#define CCM_PLL1_TUN2 0x0038 +#define CCM_PLL5_TUN2 0x003c +#define CCM_PLL_LOCK_DBG 0x004c +#define CCM_OSC24M_CFG 0x0050 +#define CCM_CPU_AHB_APB0_CFG 0x0054 +#define CCM_APB1_CLK_DIV 0x0058 +#define CCM_AXI_GATING 0x005c +#define CCM_AHB_GATING0 0x0060 +#define CCM_AHB_GATING1 0x0064 +#define CCM_APB0_GATING 0x0068 +#define CCM_APB1_GATING 0x006c +#define CCM_NAND_SCLK_CFG 0x0080 +#define CCM_MS_SCLK_CFG 0x0084 +#define CCM_MMC0_SCLK_CFG 0x0088 +#define CCM_MMC1_SCLK_CFG 0x008c +#define CCM_MMC2_SCLK_CFG 0x0090 +#define CCM_MMC3_SCLK_CFG 0x0094 +#define CCM_TS_CLK 0x0098 +#define CCM_SS_CLK 0x009c +#define CCM_SPI0_CLK 0x00a0 +#define CCM_SPI1_CLK 0x00a4 +#define CCM_SPI2_CLK 0x00a8 +#define CCM_PATA_CLK 0x00ac +#define CCM_IR0_CLK 0x00b0 +#define CCM_IR1_CLK 0x00b4 +#define CCM_IIS_CLK 0x00b8 +#define CCM_AC97_CLK 0x00bc +#define CCM_SPDIF_CLK 0x00c0 +#define CCM_KEYPAD_CLK 0x00c4 +#define CCM_SATA_CLK 0x00c8 +#define CCM_USB_CLK 0x00cc +#define CCM_GPS_CLK 0x00d0 +#define CCM_SPI3_CLK 0x00d4 +#define CCM_DRAM_CLK 0x0100 +#define CCM_BE0_SCLK 0x0104 +#define CCM_BE1_SCLK 0x0108 +#define CCM_FE0_CLK 0x010c +#define CCM_FE1_CLK 0x0110 +#define CCM_MP_CLK 0x0114 +#define CCM_LCD0_CH0_CLK 0x0118 +#define CCM_LCD1_CH0_CLK 0x011c +#define CCM_CSI_ISP_CLK 0x0120 +#define CCM_TVD_CLK 0x0128 +#define CCM_LCD0_CH1_CLK 0x012c +#define CCM_LCD1_CH1_CLK 0x0130 +#define CCM_CS0_CLK 0x0134 +#define CCM_CS1_CLK 0x0138 +#define CCM_VE_CLK 0x013c +#define CCM_AUDIO_CODEC_CLK 0x0140 +#define CCM_AVS_CLK 0x0144 +#define CCM_ACE_CLK 0x0148 +#define CCM_LVDS_CLK 0x014c +#define CCM_HDMI_CLK 0x0150 +#define CCM_MALI400_CLK 0x0154 + +#define CCM_AHB_GATING_USB0 (1 << 0) +#define CCM_AHB_GATING_EHCI0 (1 << 1) +#define CCM_AHB_GATING_EHCI1 (1 << 3) +#define CCM_AHB_GATING_EMAC (1 << 17) + +#define CCM_USB_PHY (1 << 8) +#define CCM_USB0_RESET (1 << 0) +#define CCM_USB1_RESET (1 << 1) +#define CCM_USB2_RESET (1 << 2) int a10_clk_usb_activate(void); int a10_clk_usb_deactivate(void); From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 03:07:04 2015 Return-Path: Delivered-To: svn-src-all@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 E1AFF739; Sat, 18 Apr 2015 03:07:03 +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 CF1CD8EF; Sat, 18 Apr 2015 03:07:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I373Rr097025; Sat, 18 Apr 2015 03:07:03 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I372dq097005; Sat, 18 Apr 2015 03:07:02 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201504180307.t3I372dq097005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 18 Apr 2015 03:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281679 - in head/sys/arm/allwinner: . a20 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 03:07:04 -0000 Author: loos Date: Sat Apr 18 03:07:01 2015 New Revision: 281679 URL: https://svnweb.freebsd.org/changeset/base/281679 Log: Move the items common to all SoCs to a single file. Added: head/sys/arm/allwinner/files.allwinner (contents, props changed) Modified: head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/a20/std.a20 head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/std.a10 Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Sat Apr 18 01:01:39 2015 (r281678) +++ head/sys/arm/allwinner/a20/files.a20 Sat Apr 18 03:07:01 2015 (r281679) @@ -1,19 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard -arm/arm/bus_space_asm_generic.S standard -arm/arm/bus_space_generic.c standard arm/arm/gic.c standard -arm/allwinner/a20/a20_cpu_cfg.c standard -arm/allwinner/a10_clk.c standard -arm/allwinner/a10_sramc.c standard -arm/allwinner/a10_gpio.c optional gpio -arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/if_emac.c optional emac -arm/allwinner/a10_wdog.c standard -arm/allwinner/timer.c standard -arm/arm/bus_space_base.c standard -arm/allwinner/a10_common.c standard -arm/allwinner/a10_machdep.c standard arm/allwinner/a20/a20_mp.c optional smp Modified: head/sys/arm/allwinner/a20/std.a20 ============================================================================== --- head/sys/arm/allwinner/a20/std.a20 Sat Apr 18 01:01:39 2015 (r281678) +++ head/sys/arm/allwinner/a20/std.a20 Sat Apr 18 03:07:01 2015 (r281679) @@ -22,4 +22,5 @@ options ARM_L2_PIPT options IPI_IRQ_START=0 options IPI_IRQ_END=15 +files "../allwinner/files.allwinner" files "../allwinner/a20/files.a20" Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Sat Apr 18 01:01:39 2015 (r281678) +++ head/sys/arm/allwinner/files.a10 Sat Apr 18 03:07:01 2015 (r281679) @@ -1,19 +1,3 @@ # $FreeBSD$ -kern/kern_clocksource.c standard -arm/arm/bus_space_asm_generic.S standard -arm/arm/bus_space_generic.c standard - -arm/allwinner/a10_clk.c standard -arm/allwinner/a10_common.c standard -arm/allwinner/a10_gpio.c optional gpio -arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/a10_machdep.c standard -arm/allwinner/a10_sramc.c standard -arm/allwinner/a10_wdog.c standard -arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/aintc.c standard -arm/allwinner/if_emac.c optional emac -arm/allwinner/timer.c standard -arm/arm/bus_space_base.c standard -#arm/allwinner/console.c standard Added: head/sys/arm/allwinner/files.allwinner ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/files.allwinner Sat Apr 18 03:07:01 2015 (r281679) @@ -0,0 +1,18 @@ +# $FreeBSD$ +kern/kern_clocksource.c standard + +arm/arm/bus_space_base.c standard +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard + +arm/allwinner/a10_clk.c standard +arm/allwinner/a10_common.c standard +arm/allwinner/a10_ehci.c optional ehci +arm/allwinner/a10_gpio.c optional gpio +arm/allwinner/a10_machdep.c standard +arm/allwinner/a10_sramc.c standard +arm/allwinner/a10_wdog.c standard +arm/allwinner/a20/a20_cpu_cfg.c standard +arm/allwinner/if_emac.c optional emac +arm/allwinner/timer.c standard +#arm/allwinner/console.c standard Modified: head/sys/arm/allwinner/std.a10 ============================================================================== --- head/sys/arm/allwinner/std.a10 Sat Apr 18 01:01:39 2015 (r281678) +++ head/sys/arm/allwinner/std.a10 Sat Apr 18 03:07:01 2015 (r281679) @@ -17,4 +17,5 @@ options KERNPHYSADDR=0x40200000 makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 +files "../allwinner/files.allwinner" files "../allwinner/files.a10" From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 04:53:19 2015 Return-Path: Delivered-To: svn-src-all@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 51AA079F; Sat, 18 Apr 2015 04:53: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 3E38B6B8; Sat, 18 Apr 2015 04:53: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 t3I4rJE4098774; Sat, 18 Apr 2015 04:53:19 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I4rHCs098757; Sat, 18 Apr 2015 04:53:17 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504180453.t3I4rHCs098757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sat, 18 Apr 2015 04:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281680 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 04:53:19 -0000 Author: takawata Date: Sat Apr 18 04:53:17 2015 New Revision: 281680 URL: https://svnweb.freebsd.org/changeset/base/281680 Log: Add LE related HCI control command to hccontrol(1). Added: head/usr.sbin/bluetooth/hccontrol/le.c (contents, props changed) Modified: head/usr.sbin/bluetooth/hccontrol/Makefile head/usr.sbin/bluetooth/hccontrol/hccontrol.c head/usr.sbin/bluetooth/hccontrol/hccontrol.h head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Modified: head/usr.sbin/bluetooth/hccontrol/Makefile ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/Makefile Sat Apr 18 03:07:01 2015 (r281679) +++ head/usr.sbin/bluetooth/hccontrol/Makefile Sat Apr 18 04:53:17 2015 (r281680) @@ -3,7 +3,7 @@ PROG= hccontrol MAN= hccontrol.8 -SRCS= send_recv.c link_policy.c link_control.c \ +SRCS= send_recv.c link_policy.c link_control.c le.c\ host_controller_baseband.c info.c status.c node.c hccontrol.c \ util.c WARNS?= 2 Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.c Sat Apr 18 03:07:01 2015 (r281679) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.c Sat Apr 18 04:53:17 2015 (r281680) @@ -183,6 +183,7 @@ do_hci_command(char const *node, int arg print_hci_command(host_controller_baseband_commands); print_hci_command(info_commands); print_hci_command(status_commands); + print_hci_command(le_commands); print_hci_command(node_commands); fprintf(stdout, "\nFor more information use " \ "'help command'\n"); @@ -214,6 +215,11 @@ do_hci_command(char const *node, int arg if (c != NULL) goto execute; + c = find_hci_command(cmd, le_commands); + if (c != NULL) + goto execute; + + c = find_hci_command(cmd, node_commands); if (c == NULL) { fprintf(stdout, "Unknown command: \"%s\"\n", cmd); Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.h Sat Apr 18 03:07:01 2015 (r281679) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.h Sat Apr 18 04:53:17 2015 (r281680) @@ -53,6 +53,7 @@ extern struct hci_command host_controll extern struct hci_command info_commands[]; extern struct hci_command status_commands[]; extern struct hci_command node_commands[]; +extern struct hci_command le_commands[]; int hci_request (int, int, char const *, int, char *, int *); int hci_simple_request (int, int, char *, int *); Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Sat Apr 18 03:07:01 2015 (r281679) +++ head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Sat Apr 18 04:53:17 2015 (r281680) @@ -1488,6 +1488,78 @@ hci_write_page_scan_mode(int s, int argc return (OK); } /* hci_write_page_scan_mode */ +static int +hci_read_le_host_supported_command(int s, int argc, char **argv) +{ + ng_hci_read_le_host_supported_rp rp; + int n; + n = sizeof(rp); + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, + NG_HCI_OCF_READ_LE_HOST_SUPPORTED), + (char *) &rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "LE Host support: %#02x\n", rp.le_supported_host); + fprintf(stdout, "Simulateneouse LE Host : %#02x\n", rp.simultaneous_le_host); + + return (OK); + +} +static int +hci_write_le_host_supported_command(int s, int argc, char **argv) +{ + ng_hci_write_le_host_supported_cp cp; + ng_hci_write_le_host_supported_rp rp; + + int n; + + cp.le_supported_host = 0; + cp.simultaneous_le_host = 0; + switch (argc) { + case 2: + if (sscanf(argv[1], "%d", &n) != 1 || (n != 0 && n != 1)){ + printf("ARGC2: %d\n", n); + return (USAGE); + } + cp.simultaneous_le_host = (n &1); + + case 1: + if (sscanf(argv[0], "%d", &n) != 1 || (n != 0 && n != 1)){ + printf("ARGC1: %d\n", n); + return (USAGE); + } + + cp.le_supported_host = (n &1); + break; + + default: + return (USAGE); + } + + + /* send command */ + n = sizeof(rp); + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, + NG_HCI_OCF_WRITE_LE_HOST_SUPPORTED), + (char const *) &cp, sizeof(cp), + (char *) &rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + struct hci_command host_controller_baseband_commands[] = { { "reset", @@ -1873,6 +1945,17 @@ struct hci_command host_controller_baseb "\t0x03 - Optional Page Scan Mode III", &hci_write_page_scan_mode }, +{ +"read_le_host_supported_command", \ +"Read if this host is in le supported mode and stimulatenouse le supported mode", +&hci_read_le_host_supported_command, +}, +{ +"write_le_host_supported_command", \ +"write_le_host_supported_command le_host[0|1] stimultajeous_le[0|1]", +&hci_write_le_host_supported_command, +}, + { NULL, } }; Added: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 04:53:17 2015 (r281680) @@ -0,0 +1,352 @@ +/* + * le.c + * + * Copyright (c) 2015 Takanori Watanabe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: hccontrol.c,v 1.5 2003/09/05 00:38:24 max Exp $ + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define L2CAP_SOCKET_CHECKED +#include +#include "hccontrol.h" +static int le_set_scan_param(int s, int argc, char *argv[]); +static int le_set_scan_enable(int s, int argc, char *argv[]); +static int parse_param(int argc, char *argv[], char *buf, int *len); +static int le_set_scan_response(int s, int argc, char *argv[]); +static int le_read_supported_status(int s, int argc, char *argv[]); +static int le_read_local_supported_features(int s, int argc ,char *argv[]); +static int set_le_event_mask(int s, uint64_t mask); +static int set_event_mask(int s, uint64_t mask); +static int le_enable(int s, int argc, char *argv[]); + +static int le_set_scan_param(int s, int argc, char *argv[]) +{ + int type; + int interval; + int window; + int adrtype; + int policy; + + ng_hci_le_set_scan_parameters_cp cp; + ng_hci_le_set_scan_parameters_rp rp; + int e,n; + + if(argc != 5){ + return USAGE; + } + + if(strcmp(argv[0], "active")==0){ + type = 1; + }else if (strcmp(argv[0], "passive") == 0){ + type = 0; + }else{ + return USAGE; + } + + interval = (int)(atof(argv[1])/0.625); + interval = (interval < 4)? 4: interval; + window = (int)(atof(argv[2])/0.625); + window = (window < 4) ? 4 : interval; + + if(strcmp(argv[3], "public")==0){ + adrtype = 0; + }else if (strcmp(argv[0], "random") == 0){ + adrtype = 1; + }else{ + return USAGE; + } + + if(strcmp(argv[4], "all")==0){ + policy = 0; + }else if (strcmp(argv[4], "whitelist") == 0){ + policy = 1; + }else{ + return USAGE; + } + + + cp.le_scan_type = type; + cp.le_scan_interval = interval; + cp.own_address_type = adrtype; + cp.le_scan_window = window; + cp.scanning_filter_policy = policy; + n = sizeof(rp); + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), + (void *)&cp, sizeof(cp), (void *)&rp, &n); + + + return 0; + +} + + +static int le_set_scan_enable(int s, int argc, char *argv[]) +{ + ng_hci_le_set_scan_enable_cp cp; + ng_hci_le_set_scan_enable_rp rp; + int e,n,enable = 0; + + if(argc != 1) + return USAGE; + + if(strcmp(argv[0], "enable") == 0){ + enable = 1; + }else if(strcmp(argv[0], "disable")!= 0){ + return USAGE; + } + n = sizeof(rp); + cp.le_scan_enable = enable; + cp.filter_duplicates = 0; + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_ENABLE), + (void *)&cp, sizeof(cp), (void *)&rp, &n); + + if(e != 0 || rp.status != 0){ + return ERROR; + } + return OK; + +} +static int parse_param(int argc, char *argv[], char *buf, int *len) +{ + char *buflast = buf + (*len); + char *curbuf = buf; + char *token,*lenpos; + int ch; + int datalen; + uint16_t value; + optreset = 1; + optind = 0; + while((ch = getopt(argc, argv , "n:f:u:")) != -1){ + switch(ch){ + case 'n': + datalen = strlen(optarg); + if( (curbuf + datalen + 2)>= buflast){ + goto done; + } + curbuf[0] = datalen + 1; + curbuf[1] = 8; + curbuf += 2; + memcpy(curbuf, optarg, datalen); + curbuf += datalen; + break; + case 'f': + if(curbuf+3 >buflast){ + goto done; + } + curbuf[0] = 2; + curbuf[1] = 1; + curbuf[2] = atoi(optarg); + curbuf += 3; + break; + case 'u': + lenpos = buf; + if((buf+2)>= buflast) + goto done; + + curbuf[1] = 2; + *lenpos = 1; + curbuf += 2; + while((token = strsep(&optarg, ",")) != NULL){ + value = strtol(token, NULL, 16); + if((curbuf+2)>= buflast) + break; + curbuf[0] = value &0xff; + curbuf[1] = (value>>8)&0xff; + curbuf += 2; + } + + } + } +done: + *len = curbuf - buf; + + return OK; +} + +static int le_set_scan_response(int s, int argc, char *argv[]) +{ + ng_hci_le_set_scan_response_data_cp cp; + ng_hci_le_set_scan_response_data_rp rp; + int n; + int e; + int len; + char buf[NG_HCI_ADVERTISING_DATA_SIZE]; + len = sizeof(buf); + parse_param(argc, argv, buf, &len); + memset(cp.scan_response_data, 0, sizeof(cp.scan_response_data)); + cp.scan_response_data_length = len; + memcpy(cp.scan_response_data, buf, len); + n = sizeof(rp); + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_RESPONSE_DATA), + (void *)&cp, sizeof(cp), (void *)&rp, &n); + + printf("SEt SCAN RESPONSE %d %d %d\n", e, rp.status, n); + + return OK; +} + +static int le_read_local_supported_features(int s, int argc ,char *argv[]) +{ + ng_hci_le_read_local_supported_features_rp rp; + int e; + int n = sizeof(rp); + e = hci_simple_request(s, + NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), + (void *)&rp, &n); + printf("LOCAL SUPPOREDED:%d %d %lu\n", e, rp.status, rp.le_features); + + return 0; + +} +static int le_read_supported_status(int s, int argc, char *argv[]) +{ + ng_hci_le_read_supported_status_rp rp; + int e; + int n = sizeof(rp); + e = hci_simple_request(s, + NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), + (void *)&rp, &n); + printf("LE_STATUS:%d %d %lx\n", e, rp.status, rp.le_status); + + return 0; + +} + + +static int set_le_event_mask(int s, uint64_t mask) +{ + ng_hci_le_set_event_mask_cp semc; + ng_hci_le_set_event_mask_rp rp; + int i, n ,e; + + n = sizeof(rp); + + for(i=0; i< NG_HCI_LE_EVENT_MASK_SIZE;i++){ + semc.event_mask[i] = mask&0xff; + mask>>= 8; + } + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_EVENT_MASK), (void *)&semc, sizeof(semc), (void *)&rp, &n); + + return 0; +} + + +static int set_event_mask(int s, uint64_t mask) +{ + ng_hci_set_event_mask_cp semc; + ng_hci_set_event_mask_rp rp; + int i,n,e; + + n = sizeof(rp); + + for(i=0; i< NG_HCI_EVENT_MASK_SIZE;i++){ + semc.event_mask[i] = mask&0xff; + mask>>= 8; + } + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, NG_HCI_OCF_SET_EVENT_MASK), (void *)&semc, sizeof(semc), (void *)&rp, &n); + + return 0; +} + + +static int le_enable(int s, int argc, char *argv[]) +{ + if(argc != 1){ + return USAGE; + } + + if(strcasecmp(argv[0], "enable")==0){ + set_event_mask(s,NG_HCI_EVENT_MASK_DEFAULT | + NG_HCI_EVENT_MASK_LE); + set_le_event_mask(s, NG_HCI_LE_EVENT_MASK_ALL); + }else if (strcasecmp(argv[0], "disble")==0){ + set_event_mask(s,NG_HCI_EVENT_MASK_DEFAULT); + }else{ + return USAGE; + } + + return OK; +} + +struct hci_command le_commands[] = { + { + "le_enable", + "le_enable [enable|disable] \n" + "Enable LE event ", + &le_enable, + }, + { + "le_read_local_supported_features", + "le_read_local_supported_features\n" + "read local supported features mask", + &le_read_local_supported_features, + }, + { + "le_read_supported_status", + "le_read_supported_status\n" + "read supported status" + , + &le_read_supported_status, + }, + { + "le_set_scan_response", + "le_set_scan_response -n $name -f $flag -u $uuid16,$uuid16 \n" + "set LE scan response data" + , + &le_set_scan_response, + }, + { + "le_set_scan_enable", + "le_set_scan_enable [enable|disable] \n" + "enable or disable LE device scan", + &le_set_scan_enable + }, + { + "le_set_scan_param", + "le_set_scan_param [active|passive] interval(ms) window(ms) [public|random] [all|whitelist] \n" + "set LE device scan parameter", + &le_set_scan_param + }, +}; From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 05:04:15 2015 Return-Path: Delivered-To: svn-src-all@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 BFA65A69; Sat, 18 Apr 2015 05:04: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 A90B1801; Sat, 18 Apr 2015 05:04: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 t3I54FCg009166; Sat, 18 Apr 2015 05:04:15 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I54Dee009139; Sat, 18 Apr 2015 05:04:13 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504180504.t3I54Dee009139@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 05:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r281681 - in vendor/wpa/dist: . hostapd hs20 hs20/client patches src src/ap src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_auth src/eapol_supp sr... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 05:04:15 -0000 Author: rpaulo Date: Sat Apr 18 05:04:12 2015 New Revision: 281681 URL: https://svnweb.freebsd.org/changeset/base/281681 Log: Vendor import of wpa_supplicant/hostapd 2.4. Major changes are: SAE, Suite B, RFC 7268, EAP-PKE, ACS, and tons of bug fixes. Added: vendor/wpa/dist/CONTRIBUTIONS vendor/wpa/dist/hostapd/hapd_module_tests.c (contents, props changed) vendor/wpa/dist/hostapd/wps-ap-nfc.py (contents, props changed) vendor/wpa/dist/hs20/ vendor/wpa/dist/hs20/client/ vendor/wpa/dist/hs20/client/Android.mk (contents, props changed) vendor/wpa/dist/hs20/client/Makefile (contents, props changed) vendor/wpa/dist/hs20/client/devdetail.xml (contents, props changed) vendor/wpa/dist/hs20/client/devinfo.xml (contents, props changed) vendor/wpa/dist/hs20/client/est.c (contents, props changed) vendor/wpa/dist/hs20/client/oma_dm_client.c (contents, props changed) vendor/wpa/dist/hs20/client/osu_client.c (contents, props changed) vendor/wpa/dist/hs20/client/osu_client.h (contents, props changed) vendor/wpa/dist/hs20/client/spp_client.c (contents, props changed) vendor/wpa/dist/patches/openssl-0.9.8za-tls-extensions.patch vendor/wpa/dist/src/ap/acs.c (contents, props changed) vendor/wpa/dist/src/ap/acs.h (contents, props changed) vendor/wpa/dist/src/ap/bss_load.c (contents, props changed) vendor/wpa/dist/src/ap/bss_load.h (contents, props changed) vendor/wpa/dist/src/ap/dfs.c (contents, props changed) vendor/wpa/dist/src/ap/dfs.h (contents, props changed) vendor/wpa/dist/src/ap/dhcp_snoop.c (contents, props changed) vendor/wpa/dist/src/ap/dhcp_snoop.h (contents, props changed) vendor/wpa/dist/src/ap/ndisc_snoop.c (contents, props changed) vendor/wpa/dist/src/ap/ndisc_snoop.h (contents, props changed) vendor/wpa/dist/src/ap/x_snoop.c (contents, props changed) vendor/wpa/dist/src/ap/x_snoop.h (contents, props changed) vendor/wpa/dist/src/common/common_module_tests.c (contents, props changed) vendor/wpa/dist/src/common/hw_features_common.c (contents, props changed) vendor/wpa/dist/src/common/hw_features_common.h (contents, props changed) vendor/wpa/dist/src/common/ieee802_1x_defs.h (contents, props changed) vendor/wpa/dist/src/common/qca-vendor-attr.h (contents, props changed) vendor/wpa/dist/src/common/qca-vendor.h (contents, props changed) vendor/wpa/dist/src/common/sae.c (contents, props changed) vendor/wpa/dist/src/common/sae.h (contents, props changed) vendor/wpa/dist/src/common/tnc.h (contents, props changed) vendor/wpa/dist/src/common/wpa_helpers.c (contents, props changed) vendor/wpa/dist/src/common/wpa_helpers.h (contents, props changed) vendor/wpa/dist/src/crypto/aes-siv.c (contents, props changed) vendor/wpa/dist/src/crypto/aes_siv.h (contents, props changed) vendor/wpa/dist/src/crypto/crypto_module_tests.c (contents, props changed) vendor/wpa/dist/src/crypto/sha256-kdf.c (contents, props changed) vendor/wpa/dist/src/crypto/sha384.h (contents, props changed) vendor/wpa/dist/src/drivers/driver_macsec_qca.c (contents, props changed) vendor/wpa/dist/src/drivers/driver_nl80211.h (contents, props changed) vendor/wpa/dist/src/drivers/driver_nl80211_android.c (contents, props changed) vendor/wpa/dist/src/drivers/driver_nl80211_capa.c (contents, props changed) vendor/wpa/dist/src/drivers/driver_nl80211_event.c (contents, props changed) vendor/wpa/dist/src/drivers/driver_nl80211_monitor.c (contents, props changed) vendor/wpa/dist/src/drivers/driver_nl80211_scan.c (contents, props changed) vendor/wpa/dist/src/drivers/driver_openbsd.c (contents, props changed) vendor/wpa/dist/src/drivers/linux_defines.h (contents, props changed) vendor/wpa/dist/src/eap_common/eap_eke_common.c (contents, props changed) vendor/wpa/dist/src/eap_common/eap_eke_common.h (contents, props changed) vendor/wpa/dist/src/eap_peer/eap_eke.c (contents, props changed) vendor/wpa/dist/src/eap_peer/eap_proxy.h (contents, props changed) vendor/wpa/dist/src/eap_peer/eap_proxy_dummy.c (contents, props changed) vendor/wpa/dist/src/eap_server/eap_server_eke.c (contents, props changed) vendor/wpa/dist/src/pae/ vendor/wpa/dist/src/pae/Makefile (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_cp.c (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_cp.h (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_kay.c (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_kay.h (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_kay_i.h (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_key.c (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_key.h (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_secy_ops.c (contents, props changed) vendor/wpa/dist/src/pae/ieee802_1x_secy_ops.h (contents, props changed) vendor/wpa/dist/src/utils/bitfield.c (contents, props changed) vendor/wpa/dist/src/utils/bitfield.h (contents, props changed) vendor/wpa/dist/src/utils/browser-android.c (contents, props changed) vendor/wpa/dist/src/utils/browser-system.c (contents, props changed) vendor/wpa/dist/src/utils/browser-wpadebug.c (contents, props changed) vendor/wpa/dist/src/utils/browser.c (contents, props changed) vendor/wpa/dist/src/utils/browser.h (contents, props changed) vendor/wpa/dist/src/utils/http-utils.h (contents, props changed) vendor/wpa/dist/src/utils/http_curl.c (contents, props changed) vendor/wpa/dist/src/utils/platform.h (contents, props changed) vendor/wpa/dist/src/utils/utils_module_tests.c (contents, props changed) vendor/wpa/dist/src/utils/xml-utils.c (contents, props changed) vendor/wpa/dist/src/utils/xml-utils.h (contents, props changed) vendor/wpa/dist/src/utils/xml_libxml2.c (contents, props changed) vendor/wpa/dist/src/wps/wps_module_tests.c (contents, props changed) vendor/wpa/dist/wpa_supplicant/doc/docbook/eapol_test.8 (contents, props changed) vendor/wpa/dist/wpa_supplicant/doc/docbook/eapol_test.sgml (contents, props changed) vendor/wpa/dist/wpa_supplicant/eap_proxy_dummy.mak vendor/wpa/dist/wpa_supplicant/eap_proxy_dummy.mk (contents, props changed) vendor/wpa/dist/wpa_supplicant/examples/p2p-nfc.py (contents, props changed) vendor/wpa/dist/wpa_supplicant/mesh.c (contents, props changed) vendor/wpa/dist/wpa_supplicant/mesh.h (contents, props changed) vendor/wpa/dist/wpa_supplicant/mesh_mpm.c (contents, props changed) vendor/wpa/dist/wpa_supplicant/mesh_mpm.h (contents, props changed) vendor/wpa/dist/wpa_supplicant/mesh_rsn.c (contents, props changed) vendor/wpa/dist/wpa_supplicant/mesh_rsn.h (contents, props changed) vendor/wpa/dist/wpa_supplicant/wmm_ac.c (contents, props changed) vendor/wpa/dist/wpa_supplicant/wmm_ac.h (contents, props changed) vendor/wpa/dist/wpa_supplicant/wpas_kay.c (contents, props changed) vendor/wpa/dist/wpa_supplicant/wpas_kay.h (contents, props changed) vendor/wpa/dist/wpa_supplicant/wpas_module_tests.c (contents, props changed) Deleted: vendor/wpa/dist/hostapd/dump_state.c vendor/wpa/dist/hostapd/dump_state.h vendor/wpa/dist/patches/openssl-0.9.8-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.8d-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.8e-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.8g-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.8h-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.8i-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.8x-tls-extensions.patch vendor/wpa/dist/patches/openssl-0.9.9-session-ticket.patch vendor/wpa/dist/src/crypto/crypto_nss.c vendor/wpa/dist/src/crypto/fips_prf_cryptoapi.c vendor/wpa/dist/src/crypto/fips_prf_gnutls.c vendor/wpa/dist/src/crypto/fips_prf_nss.c vendor/wpa/dist/src/crypto/tls_nss.c vendor/wpa/dist/src/drivers/driver_madwifi.c vendor/wpa/dist/src/drivers/driver_test.c vendor/wpa/dist/src/utils/eloop_none.c Modified: vendor/wpa/dist/COPYING vendor/wpa/dist/README vendor/wpa/dist/hostapd/ChangeLog vendor/wpa/dist/hostapd/Makefile vendor/wpa/dist/hostapd/README vendor/wpa/dist/hostapd/README-WPS vendor/wpa/dist/hostapd/config_file.c vendor/wpa/dist/hostapd/ctrl_iface.c vendor/wpa/dist/hostapd/defconfig vendor/wpa/dist/hostapd/eap_register.c vendor/wpa/dist/hostapd/hlr_auc_gw.c vendor/wpa/dist/hostapd/hostapd.8 vendor/wpa/dist/hostapd/hostapd.conf vendor/wpa/dist/hostapd/hostapd.eap_user vendor/wpa/dist/hostapd/hostapd.eap_user_sqlite vendor/wpa/dist/hostapd/hostapd_cli.c vendor/wpa/dist/hostapd/main.c vendor/wpa/dist/src/Makefile vendor/wpa/dist/src/ap/Makefile vendor/wpa/dist/src/ap/accounting.c vendor/wpa/dist/src/ap/ap_config.c vendor/wpa/dist/src/ap/ap_config.h vendor/wpa/dist/src/ap/ap_drv_ops.c vendor/wpa/dist/src/ap/ap_drv_ops.h vendor/wpa/dist/src/ap/ap_list.c vendor/wpa/dist/src/ap/ap_list.h vendor/wpa/dist/src/ap/ap_mlme.c vendor/wpa/dist/src/ap/authsrv.c vendor/wpa/dist/src/ap/beacon.c vendor/wpa/dist/src/ap/beacon.h vendor/wpa/dist/src/ap/ctrl_iface_ap.c vendor/wpa/dist/src/ap/ctrl_iface_ap.h vendor/wpa/dist/src/ap/drv_callbacks.c vendor/wpa/dist/src/ap/eap_user_db.c vendor/wpa/dist/src/ap/gas_serv.c vendor/wpa/dist/src/ap/gas_serv.h vendor/wpa/dist/src/ap/hostapd.c vendor/wpa/dist/src/ap/hostapd.h vendor/wpa/dist/src/ap/hs20.c vendor/wpa/dist/src/ap/hs20.h vendor/wpa/dist/src/ap/hw_features.c vendor/wpa/dist/src/ap/hw_features.h vendor/wpa/dist/src/ap/iapp.c vendor/wpa/dist/src/ap/ieee802_11.c vendor/wpa/dist/src/ap/ieee802_11.h vendor/wpa/dist/src/ap/ieee802_11_auth.c vendor/wpa/dist/src/ap/ieee802_11_ht.c vendor/wpa/dist/src/ap/ieee802_11_shared.c vendor/wpa/dist/src/ap/ieee802_11_vht.c vendor/wpa/dist/src/ap/ieee802_1x.c vendor/wpa/dist/src/ap/ieee802_1x.h vendor/wpa/dist/src/ap/p2p_hostapd.c vendor/wpa/dist/src/ap/peerkey_auth.c vendor/wpa/dist/src/ap/pmksa_cache_auth.c vendor/wpa/dist/src/ap/pmksa_cache_auth.h vendor/wpa/dist/src/ap/sta_info.c vendor/wpa/dist/src/ap/sta_info.h vendor/wpa/dist/src/ap/tkip_countermeasures.c vendor/wpa/dist/src/ap/vlan_init.c vendor/wpa/dist/src/ap/vlan_init.h vendor/wpa/dist/src/ap/wmm.c vendor/wpa/dist/src/ap/wmm.h vendor/wpa/dist/src/ap/wnm_ap.c vendor/wpa/dist/src/ap/wnm_ap.h vendor/wpa/dist/src/ap/wpa_auth.c vendor/wpa/dist/src/ap/wpa_auth.h vendor/wpa/dist/src/ap/wpa_auth_ft.c vendor/wpa/dist/src/ap/wpa_auth_glue.c vendor/wpa/dist/src/ap/wpa_auth_i.h vendor/wpa/dist/src/ap/wpa_auth_ie.c vendor/wpa/dist/src/ap/wpa_auth_ie.h vendor/wpa/dist/src/ap/wps_hostapd.c vendor/wpa/dist/src/ap/wps_hostapd.h vendor/wpa/dist/src/common/Makefile vendor/wpa/dist/src/common/defs.h vendor/wpa/dist/src/common/eapol_common.h vendor/wpa/dist/src/common/ieee802_11_common.c vendor/wpa/dist/src/common/ieee802_11_common.h vendor/wpa/dist/src/common/ieee802_11_defs.h vendor/wpa/dist/src/common/privsep_commands.h vendor/wpa/dist/src/common/version.h vendor/wpa/dist/src/common/wpa_common.c vendor/wpa/dist/src/common/wpa_common.h vendor/wpa/dist/src/common/wpa_ctrl.c vendor/wpa/dist/src/common/wpa_ctrl.h vendor/wpa/dist/src/crypto/Makefile vendor/wpa/dist/src/crypto/aes-ccm.c vendor/wpa/dist/src/crypto/aes-eax.c vendor/wpa/dist/src/crypto/aes-gcm.c vendor/wpa/dist/src/crypto/aes-omac1.c vendor/wpa/dist/src/crypto/aes-unwrap.c vendor/wpa/dist/src/crypto/aes-wrap.c vendor/wpa/dist/src/crypto/aes_wrap.h vendor/wpa/dist/src/crypto/crypto.h vendor/wpa/dist/src/crypto/crypto_internal-rsa.c vendor/wpa/dist/src/crypto/crypto_openssl.c vendor/wpa/dist/src/crypto/dh_groups.c vendor/wpa/dist/src/crypto/dh_groups.h vendor/wpa/dist/src/crypto/md5.c vendor/wpa/dist/src/crypto/milenage.c vendor/wpa/dist/src/crypto/ms_funcs.c vendor/wpa/dist/src/crypto/random.c vendor/wpa/dist/src/crypto/sha1-internal.c vendor/wpa/dist/src/crypto/sha1-prf.c vendor/wpa/dist/src/crypto/sha1.c vendor/wpa/dist/src/crypto/sha256-prf.c vendor/wpa/dist/src/crypto/sha256.h vendor/wpa/dist/src/crypto/tls.h vendor/wpa/dist/src/crypto/tls_gnutls.c vendor/wpa/dist/src/crypto/tls_internal.c vendor/wpa/dist/src/crypto/tls_none.c vendor/wpa/dist/src/crypto/tls_openssl.c vendor/wpa/dist/src/crypto/tls_schannel.c vendor/wpa/dist/src/drivers/Makefile vendor/wpa/dist/src/drivers/android_drv.h vendor/wpa/dist/src/drivers/driver.h vendor/wpa/dist/src/drivers/driver_atheros.c vendor/wpa/dist/src/drivers/driver_bsd.c vendor/wpa/dist/src/drivers/driver_common.c vendor/wpa/dist/src/drivers/driver_hostap.c vendor/wpa/dist/src/drivers/driver_ndis.c vendor/wpa/dist/src/drivers/driver_nl80211.c vendor/wpa/dist/src/drivers/driver_none.c vendor/wpa/dist/src/drivers/driver_privsep.c vendor/wpa/dist/src/drivers/driver_roboswitch.c vendor/wpa/dist/src/drivers/driver_wext.c vendor/wpa/dist/src/drivers/driver_wext.h vendor/wpa/dist/src/drivers/driver_wired.c vendor/wpa/dist/src/drivers/drivers.c vendor/wpa/dist/src/drivers/drivers.mak vendor/wpa/dist/src/drivers/drivers.mk vendor/wpa/dist/src/drivers/linux_ioctl.c vendor/wpa/dist/src/drivers/linux_wext.h vendor/wpa/dist/src/drivers/netlink.c vendor/wpa/dist/src/drivers/nl80211_copy.h vendor/wpa/dist/src/drivers/priv_netlink.h vendor/wpa/dist/src/eap_common/Makefile vendor/wpa/dist/src/eap_common/eap_common.c vendor/wpa/dist/src/eap_common/eap_common.h vendor/wpa/dist/src/eap_common/eap_defs.h vendor/wpa/dist/src/eap_common/eap_fast_common.c vendor/wpa/dist/src/eap_common/eap_fast_common.h vendor/wpa/dist/src/eap_common/eap_gpsk_common.c vendor/wpa/dist/src/eap_common/eap_gpsk_common.h vendor/wpa/dist/src/eap_common/eap_ikev2_common.c vendor/wpa/dist/src/eap_common/eap_ikev2_common.h vendor/wpa/dist/src/eap_common/eap_pax_common.c vendor/wpa/dist/src/eap_common/eap_pax_common.h vendor/wpa/dist/src/eap_common/eap_pwd_common.c vendor/wpa/dist/src/eap_common/eap_pwd_common.h vendor/wpa/dist/src/eap_common/eap_sim_common.c vendor/wpa/dist/src/eap_common/eap_sim_common.h vendor/wpa/dist/src/eap_common/ikev2_common.c vendor/wpa/dist/src/eap_common/ikev2_common.h vendor/wpa/dist/src/eap_peer/Makefile vendor/wpa/dist/src/eap_peer/eap.c vendor/wpa/dist/src/eap_peer/eap.h vendor/wpa/dist/src/eap_peer/eap_aka.c vendor/wpa/dist/src/eap_peer/eap_config.h vendor/wpa/dist/src/eap_peer/eap_fast.c vendor/wpa/dist/src/eap_peer/eap_fast_pac.c vendor/wpa/dist/src/eap_peer/eap_gpsk.c vendor/wpa/dist/src/eap_peer/eap_i.h vendor/wpa/dist/src/eap_peer/eap_ikev2.c vendor/wpa/dist/src/eap_peer/eap_leap.c vendor/wpa/dist/src/eap_peer/eap_methods.c vendor/wpa/dist/src/eap_peer/eap_methods.h vendor/wpa/dist/src/eap_peer/eap_mschapv2.c vendor/wpa/dist/src/eap_peer/eap_pax.c vendor/wpa/dist/src/eap_peer/eap_peap.c vendor/wpa/dist/src/eap_peer/eap_psk.c vendor/wpa/dist/src/eap_peer/eap_pwd.c vendor/wpa/dist/src/eap_peer/eap_sake.c vendor/wpa/dist/src/eap_peer/eap_sim.c vendor/wpa/dist/src/eap_peer/eap_tls.c vendor/wpa/dist/src/eap_peer/eap_tls_common.c vendor/wpa/dist/src/eap_peer/eap_tls_common.h vendor/wpa/dist/src/eap_peer/eap_tnc.c vendor/wpa/dist/src/eap_peer/eap_ttls.c vendor/wpa/dist/src/eap_peer/eap_vendor_test.c vendor/wpa/dist/src/eap_peer/eap_wsc.c vendor/wpa/dist/src/eap_peer/ikev2.c vendor/wpa/dist/src/eap_peer/mschapv2.c vendor/wpa/dist/src/eap_peer/tncc.c vendor/wpa/dist/src/eap_server/Makefile vendor/wpa/dist/src/eap_server/eap.h vendor/wpa/dist/src/eap_server/eap_i.h vendor/wpa/dist/src/eap_server/eap_methods.h vendor/wpa/dist/src/eap_server/eap_server.c vendor/wpa/dist/src/eap_server/eap_server_aka.c vendor/wpa/dist/src/eap_server/eap_server_fast.c vendor/wpa/dist/src/eap_server/eap_server_gpsk.c vendor/wpa/dist/src/eap_server/eap_server_gtc.c vendor/wpa/dist/src/eap_server/eap_server_identity.c vendor/wpa/dist/src/eap_server/eap_server_ikev2.c vendor/wpa/dist/src/eap_server/eap_server_md5.c vendor/wpa/dist/src/eap_server/eap_server_methods.c vendor/wpa/dist/src/eap_server/eap_server_mschapv2.c vendor/wpa/dist/src/eap_server/eap_server_pax.c vendor/wpa/dist/src/eap_server/eap_server_peap.c vendor/wpa/dist/src/eap_server/eap_server_psk.c vendor/wpa/dist/src/eap_server/eap_server_pwd.c vendor/wpa/dist/src/eap_server/eap_server_sake.c vendor/wpa/dist/src/eap_server/eap_server_sim.c vendor/wpa/dist/src/eap_server/eap_server_tls.c vendor/wpa/dist/src/eap_server/eap_server_tls_common.c vendor/wpa/dist/src/eap_server/eap_server_tnc.c vendor/wpa/dist/src/eap_server/eap_server_ttls.c vendor/wpa/dist/src/eap_server/eap_server_wsc.c vendor/wpa/dist/src/eap_server/eap_sim_db.c vendor/wpa/dist/src/eap_server/eap_tls_common.h vendor/wpa/dist/src/eap_server/ikev2.c vendor/wpa/dist/src/eap_server/tncs.c vendor/wpa/dist/src/eapol_auth/Makefile vendor/wpa/dist/src/eapol_auth/eapol_auth_dump.c vendor/wpa/dist/src/eapol_auth/eapol_auth_sm.c vendor/wpa/dist/src/eapol_auth/eapol_auth_sm.h vendor/wpa/dist/src/eapol_auth/eapol_auth_sm_i.h vendor/wpa/dist/src/eapol_supp/Makefile vendor/wpa/dist/src/eapol_supp/eapol_supp_sm.c vendor/wpa/dist/src/eapol_supp/eapol_supp_sm.h vendor/wpa/dist/src/l2_packet/Makefile vendor/wpa/dist/src/l2_packet/l2_packet.h vendor/wpa/dist/src/l2_packet/l2_packet_freebsd.c vendor/wpa/dist/src/l2_packet/l2_packet_linux.c vendor/wpa/dist/src/l2_packet/l2_packet_ndis.c vendor/wpa/dist/src/l2_packet/l2_packet_none.c vendor/wpa/dist/src/l2_packet/l2_packet_pcap.c vendor/wpa/dist/src/l2_packet/l2_packet_privsep.c vendor/wpa/dist/src/l2_packet/l2_packet_winpcap.c vendor/wpa/dist/src/lib.rules vendor/wpa/dist/src/p2p/Makefile vendor/wpa/dist/src/p2p/p2p.c vendor/wpa/dist/src/p2p/p2p.h vendor/wpa/dist/src/p2p/p2p_build.c vendor/wpa/dist/src/p2p/p2p_dev_disc.c vendor/wpa/dist/src/p2p/p2p_go_neg.c vendor/wpa/dist/src/p2p/p2p_group.c vendor/wpa/dist/src/p2p/p2p_i.h vendor/wpa/dist/src/p2p/p2p_invitation.c vendor/wpa/dist/src/p2p/p2p_parse.c vendor/wpa/dist/src/p2p/p2p_pd.c vendor/wpa/dist/src/p2p/p2p_sd.c vendor/wpa/dist/src/p2p/p2p_utils.c vendor/wpa/dist/src/radius/Makefile vendor/wpa/dist/src/radius/radius.c vendor/wpa/dist/src/radius/radius.h vendor/wpa/dist/src/radius/radius_client.c vendor/wpa/dist/src/radius/radius_das.c vendor/wpa/dist/src/radius/radius_das.h vendor/wpa/dist/src/radius/radius_server.c vendor/wpa/dist/src/radius/radius_server.h vendor/wpa/dist/src/rsn_supp/Makefile vendor/wpa/dist/src/rsn_supp/peerkey.c vendor/wpa/dist/src/rsn_supp/peerkey.h vendor/wpa/dist/src/rsn_supp/pmksa_cache.c vendor/wpa/dist/src/rsn_supp/pmksa_cache.h vendor/wpa/dist/src/rsn_supp/preauth.c vendor/wpa/dist/src/rsn_supp/preauth.h vendor/wpa/dist/src/rsn_supp/tdls.c vendor/wpa/dist/src/rsn_supp/wpa.c vendor/wpa/dist/src/rsn_supp/wpa.h vendor/wpa/dist/src/rsn_supp/wpa_ft.c vendor/wpa/dist/src/rsn_supp/wpa_i.h vendor/wpa/dist/src/rsn_supp/wpa_ie.c vendor/wpa/dist/src/rsn_supp/wpa_ie.h vendor/wpa/dist/src/tls/asn1.c vendor/wpa/dist/src/tls/asn1.h vendor/wpa/dist/src/tls/libtommath.c vendor/wpa/dist/src/tls/pkcs1.c vendor/wpa/dist/src/tls/pkcs1.h vendor/wpa/dist/src/tls/rsa.c vendor/wpa/dist/src/tls/rsa.h vendor/wpa/dist/src/tls/tlsv1_client.c vendor/wpa/dist/src/tls/tlsv1_client_read.c vendor/wpa/dist/src/tls/tlsv1_client_write.c vendor/wpa/dist/src/tls/tlsv1_common.c vendor/wpa/dist/src/tls/tlsv1_common.h vendor/wpa/dist/src/tls/tlsv1_record.c vendor/wpa/dist/src/tls/tlsv1_server.c vendor/wpa/dist/src/tls/tlsv1_server.h vendor/wpa/dist/src/tls/tlsv1_server_i.h vendor/wpa/dist/src/tls/tlsv1_server_read.c vendor/wpa/dist/src/tls/tlsv1_server_write.c vendor/wpa/dist/src/tls/x509v3.c vendor/wpa/dist/src/utils/Makefile vendor/wpa/dist/src/utils/base64.c vendor/wpa/dist/src/utils/build_config.h vendor/wpa/dist/src/utils/common.c vendor/wpa/dist/src/utils/common.h vendor/wpa/dist/src/utils/edit.c vendor/wpa/dist/src/utils/edit_readline.c vendor/wpa/dist/src/utils/edit_simple.c vendor/wpa/dist/src/utils/eloop.c vendor/wpa/dist/src/utils/eloop.h vendor/wpa/dist/src/utils/eloop_win.c vendor/wpa/dist/src/utils/ext_password_test.c vendor/wpa/dist/src/utils/ip_addr.c vendor/wpa/dist/src/utils/ip_addr.h vendor/wpa/dist/src/utils/list.h vendor/wpa/dist/src/utils/os.h vendor/wpa/dist/src/utils/os_internal.c vendor/wpa/dist/src/utils/os_none.c vendor/wpa/dist/src/utils/os_unix.c vendor/wpa/dist/src/utils/os_win32.c vendor/wpa/dist/src/utils/pcsc_funcs.c vendor/wpa/dist/src/utils/pcsc_funcs.h vendor/wpa/dist/src/utils/radiotap.c vendor/wpa/dist/src/utils/radiotap.h vendor/wpa/dist/src/utils/radiotap_iter.h vendor/wpa/dist/src/utils/trace.c vendor/wpa/dist/src/utils/trace.h vendor/wpa/dist/src/utils/uuid.c vendor/wpa/dist/src/utils/wpa_debug.c vendor/wpa/dist/src/utils/wpa_debug.h vendor/wpa/dist/src/utils/wpabuf.c vendor/wpa/dist/src/utils/wpabuf.h vendor/wpa/dist/src/wps/Makefile vendor/wpa/dist/src/wps/http_client.c vendor/wpa/dist/src/wps/http_server.c vendor/wpa/dist/src/wps/httpread.c vendor/wpa/dist/src/wps/ndef.c vendor/wpa/dist/src/wps/wps.c vendor/wpa/dist/src/wps/wps.h vendor/wpa/dist/src/wps/wps_attr_build.c vendor/wpa/dist/src/wps/wps_attr_parse.c vendor/wpa/dist/src/wps/wps_attr_parse.h vendor/wpa/dist/src/wps/wps_attr_process.c vendor/wpa/dist/src/wps/wps_common.c vendor/wpa/dist/src/wps/wps_defs.h vendor/wpa/dist/src/wps/wps_dev_attr.c vendor/wpa/dist/src/wps/wps_dev_attr.h vendor/wpa/dist/src/wps/wps_enrollee.c vendor/wpa/dist/src/wps/wps_er.c vendor/wpa/dist/src/wps/wps_er.h vendor/wpa/dist/src/wps/wps_er_ssdp.c vendor/wpa/dist/src/wps/wps_i.h vendor/wpa/dist/src/wps/wps_registrar.c vendor/wpa/dist/src/wps/wps_upnp.c vendor/wpa/dist/src/wps/wps_upnp_ap.c vendor/wpa/dist/src/wps/wps_upnp_i.h vendor/wpa/dist/src/wps/wps_upnp_ssdp.c vendor/wpa/dist/src/wps/wps_upnp_web.c vendor/wpa/dist/src/wps/wps_validate.c vendor/wpa/dist/wpa_supplicant/ChangeLog vendor/wpa/dist/wpa_supplicant/Makefile vendor/wpa/dist/wpa_supplicant/README vendor/wpa/dist/wpa_supplicant/README-HS20 vendor/wpa/dist/wpa_supplicant/README-P2P vendor/wpa/dist/wpa_supplicant/README-WPS vendor/wpa/dist/wpa_supplicant/ap.c vendor/wpa/dist/wpa_supplicant/ap.h vendor/wpa/dist/wpa_supplicant/bgscan.c vendor/wpa/dist/wpa_supplicant/bgscan.h vendor/wpa/dist/wpa_supplicant/bgscan_learn.c vendor/wpa/dist/wpa_supplicant/bgscan_simple.c vendor/wpa/dist/wpa_supplicant/bss.c vendor/wpa/dist/wpa_supplicant/bss.h vendor/wpa/dist/wpa_supplicant/config.c vendor/wpa/dist/wpa_supplicant/config.h vendor/wpa/dist/wpa_supplicant/config_file.c vendor/wpa/dist/wpa_supplicant/config_none.c vendor/wpa/dist/wpa_supplicant/config_ssid.h vendor/wpa/dist/wpa_supplicant/config_winreg.c vendor/wpa/dist/wpa_supplicant/ctrl_iface.c vendor/wpa/dist/wpa_supplicant/ctrl_iface.h vendor/wpa/dist/wpa_supplicant/ctrl_iface_named_pipe.c vendor/wpa/dist/wpa_supplicant/ctrl_iface_udp.c vendor/wpa/dist/wpa_supplicant/ctrl_iface_unix.c vendor/wpa/dist/wpa_supplicant/dbus/Makefile vendor/wpa/dist/wpa_supplicant/dbus/dbus_common.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_dict_helpers.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_dict_helpers.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_new.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_new.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers_p2p.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers_p2p.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers_wps.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_helpers.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_helpers.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_introspect.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_old.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_old.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers.c vendor/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers.h vendor/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers_wps.c vendor/wpa/dist/wpa_supplicant/defconfig vendor/wpa/dist/wpa_supplicant/doc/docbook/Makefile vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_background.8 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_background.sgml vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_cli.8 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_cli.sgml vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_gui.8 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_gui.sgml vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_passphrase.8 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_passphrase.sgml vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_priv.8 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_priv.sgml vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_supplicant.8 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 vendor/wpa/dist/wpa_supplicant/doc/docbook/wpa_supplicant.sgml vendor/wpa/dist/wpa_supplicant/driver_i.h vendor/wpa/dist/wpa_supplicant/eap_register.c vendor/wpa/dist/wpa_supplicant/eapol_test.c vendor/wpa/dist/wpa_supplicant/events.c vendor/wpa/dist/wpa_supplicant/examples/p2p-action.sh vendor/wpa/dist/wpa_supplicant/examples/wps-ap-cli vendor/wpa/dist/wpa_supplicant/examples/wps-nfc.py vendor/wpa/dist/wpa_supplicant/gas_query.c vendor/wpa/dist/wpa_supplicant/gas_query.h vendor/wpa/dist/wpa_supplicant/hs20_supplicant.c vendor/wpa/dist/wpa_supplicant/hs20_supplicant.h vendor/wpa/dist/wpa_supplicant/ibss_rsn.c vendor/wpa/dist/wpa_supplicant/ibss_rsn.h vendor/wpa/dist/wpa_supplicant/interworking.c vendor/wpa/dist/wpa_supplicant/interworking.h vendor/wpa/dist/wpa_supplicant/main.c vendor/wpa/dist/wpa_supplicant/main_none.c vendor/wpa/dist/wpa_supplicant/main_winmain.c vendor/wpa/dist/wpa_supplicant/main_winsvc.c vendor/wpa/dist/wpa_supplicant/notify.c vendor/wpa/dist/wpa_supplicant/notify.h vendor/wpa/dist/wpa_supplicant/offchannel.c vendor/wpa/dist/wpa_supplicant/p2p_supplicant.c vendor/wpa/dist/wpa_supplicant/p2p_supplicant.h vendor/wpa/dist/wpa_supplicant/preauth_test.c vendor/wpa/dist/wpa_supplicant/scan.c vendor/wpa/dist/wpa_supplicant/scan.h vendor/wpa/dist/wpa_supplicant/sme.c vendor/wpa/dist/wpa_supplicant/sme.h vendor/wpa/dist/wpa_supplicant/tests/test_wpa.c vendor/wpa/dist/wpa_supplicant/todo.txt vendor/wpa/dist/wpa_supplicant/wifi_display.c vendor/wpa/dist/wpa_supplicant/wifi_display.h vendor/wpa/dist/wpa_supplicant/wnm_sta.c vendor/wpa/dist/wpa_supplicant/wnm_sta.h vendor/wpa/dist/wpa_supplicant/wpa_cli.c vendor/wpa/dist/wpa_supplicant/wpa_priv.c vendor/wpa/dist/wpa_supplicant/wpa_supplicant.c vendor/wpa/dist/wpa_supplicant/wpa_supplicant.conf vendor/wpa/dist/wpa_supplicant/wpa_supplicant_i.h vendor/wpa/dist/wpa_supplicant/wpa_supplicant_template.conf vendor/wpa/dist/wpa_supplicant/wpas_glue.c vendor/wpa/dist/wpa_supplicant/wps_supplicant.c vendor/wpa/dist/wpa_supplicant/wps_supplicant.h Added: vendor/wpa/dist/CONTRIBUTIONS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/wpa/dist/CONTRIBUTIONS Sat Apr 18 05:04:12 2015 (r281681) @@ -0,0 +1,143 @@ +Contributions to hostap.git +--------------------------- + +This software is distributed under a permissive open source license to +allow it to be used in any projects, whether open source or proprietary. +Contributions to the project are welcome and it is important to maintain +clear record of contributions and terms under which they are licensed. +To help with this, following procedure is used to allow acceptance and +recording of the terms. + +All contributions are expected to be licensed under the modified BSD +license (see below). Acknowledgment of the terms is tracked through +inclusion of Signed-off-by tag in the contributions at the end of the +commit log message. This tag indicates that the contributor agrees with +the Developer Certificate of Origin (DCO) version 1.1 terms (see below; +also available from http://developercertificate.org/). + + +The current requirements for contributions to hostap.git +-------------------------------------------------------- + +To indicate your acceptance of Developer's Certificate of Origin 1.1 +terms, please add the following line to the end of the commit message +for each contribution you make to the project: + +Signed-off-by: Your Name + +using your real name. Pseudonyms or anonymous contributions cannot +unfortunately be accepted. + + +History of license and contributions terms +------------------------------------------ + +Until February 11, 2012, in case of most files in hostap.git, "under the +open source license indicated in the file" means that the contribution +is licensed both under GPL v2 and modified BSD license (see below) and +the choice between these licenses is given to anyone who redistributes +or uses the software. As such, the contribution has to be licensed under +both options to allow this choice. + +As of February 11, 2012, the project has chosen to use only the BSD +license option for future distribution. As such, the GPL v2 license +option is no longer used and the contributions are not required to be +licensed until GPL v2. In case of most files in hostap.git, "under the +open source license indicated in the file" means that the contribution +is licensed under the modified BSD license (see below). + +Until February 13, 2014, the project used an extended version of the DCO +that included the identical items (a) through (d) from DCO 1.1 and an +additional item (e): + +(e) The contribution can be licensed under the modified BSD license + as shown below even in case of files that are currently licensed + under other terms. + +This was used during the period when some of the files included the old +license terms. Acceptance of this extended DCO version was indicated +with a Signed-hostap tag in the commit message. This additional item (e) +was used to collect explicit approval to license the contribution with +only the modified BSD license (see below), i.e., without the GPL v2 +option. This was done to allow simpler licensing terms to be used in the +future. It should be noted that the modified BSD license is compatible +with GNU GPL and as such, this possible move to simpler licensing option +does not prevent use of this software in GPL projects. + + +===[ start quote from http://developercertificate.org/ ]======================= + +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +660 York Street, Suite 102, +San Francisco, CA 94110 USA + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +===[ end quote from http://developercertificate.org/ ]========================= + + +The license terms used for hostap.git files +------------------------------------------- + +Modified BSD license (no advertisement clause): + +Copyright (c) 2002-2015, Jouni Malinen and contributors +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Modified: vendor/wpa/dist/COPYING ============================================================================== --- vendor/wpa/dist/COPYING Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/COPYING Sat Apr 18 05:04:12 2015 (r281681) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2012, Jouni Malinen and contributors +Copyright (c) 2002-2015, Jouni Malinen and contributors All Rights Reserved. Modified: vendor/wpa/dist/README ============================================================================== --- vendor/wpa/dist/README Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/README Sat Apr 18 05:04:12 2015 (r281681) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2012, Jouni Malinen and contributors +Copyright (c) 2002-2015, Jouni Malinen and contributors All Rights Reserved. These programs are licensed under the BSD license (the one with Modified: vendor/wpa/dist/hostapd/ChangeLog ============================================================================== --- vendor/wpa/dist/hostapd/ChangeLog Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/hostapd/ChangeLog Sat Apr 18 05:04:12 2015 (r281681) @@ -1,5 +1,191 @@ ChangeLog for hostapd +2015-03-15 - v2.4 + * allow OpenSSL cipher configuration to be set for internal EAP server + (openssl_ciphers parameter) + * fixed number of small issues based on hwsim test case failures and + static analyzer reports + * fixed Accounting-Request to not include duplicated Acct-Session-Id + * add support for Acct-Multi-Session-Id in RADIUS Accounting messages + * add support for PMKSA caching with SAE + * add support for generating BSS Load element (bss_load_update_period) + * fixed channel switch from VHT to HT + * add INTERFACE-ENABLED and INTERFACE-DISABLED ctrl_iface events + * add support for learning STA IPv4/IPv6 addresses and configuring + ProxyARP support + * dropped support for the madwifi driver interface + * add support for Suite B (128-bit and 192-bit level) key management and + cipher suites + * fixed a regression with driver=wired + * extend EAPOL-Key msg 1/4 retry workaround for changing SNonce + * add BSS_TM_REQ ctrl_iface command to send BSS Transition Management + Request frames and BSS-TM-RESP event to indicate response to such + frame + * add support for EAP Re-Authentication Protocol (ERP) + * fixed AP IE in EAPOL-Key 3/4 when both WPA and FT was enabled + * fixed a regression in HT 20/40 coex Action frame parsing + * set stdout to be line-buffered + * add support for vendor specific VHT extension to enable 256 QAM rates + (VHT-MCS 8 and 9) on 2.4 GHz band + * RADIUS DAS: + - extend Disconnect-Request processing to allow matching of multiple + sessions + - support Acct-Multi-Session-Id as an identifier + - allow PMKSA cache entry to be removed without association + * expire hostapd STA entry if kernel does not have a matching entry + * allow chanlist to be used to specify a subset of channels for ACS + * improve ACS behavior on 2.4 GHz band and allow channel bias to be + configured with acs_chan_bias parameter + * do not reply to a Probe Request frame that includes DSS Parameter Set + element in which the channel does not match the current operating + channel + * add UPDATE_BEACON ctrl_iface command; this can be used to force Beacon + frame contents to be updated and to start beaconing on an interface + that used start_disabled=1 + * fixed some RADIUS server failover cases + +2014-10-09 - v2.3 + * fixed number of minor issues identified in static analyzer warnings + * fixed DFS and channel switch operation for multi-BSS cases + * started to use constant time comparison for various password and hash + values to reduce possibility of any externally measurable timing + differences + * extended explicit clearing of freed memory and expired keys to avoid + keeping private data in memory longer than necessary + * added support for number of new RADIUS attributes from RFC 7268 + (Mobility-Domain-Id, WLAN-HESSID, WLAN-Pairwise-Cipher, + WLAN-Group-Cipher, WLAN-AKM-Suite, WLAN-Group-Mgmt-Pairwise-Cipher) + * fixed GET_CONFIG wpa_pairwise_cipher value + * added code to clear bridge FDB entry on station disconnection + * fixed PMKSA cache timeout from Session-Timeout for WPA/WPA2 cases + * fixed OKC PMKSA cache entry fetch to avoid a possible infinite loop + in case the first entry does not match + * fixed hostapd_cli action script execution to use more robust mechanism + (CVE-2014-3686) + +2014-06-04 - v2.2 + * fixed SAE confirm-before-commit validation to avoid a potential + segmentation fault in an unexpected message sequence that could be + triggered remotely + * extended VHT support + - Operating Mode Notification + - Power Constraint element (local_pwr_constraint) + - Spectrum management capability (spectrum_mgmt_required=1) + - fix VHT80 segment picking in ACS + - fix vht_capab 'Maximum A-MPDU Length Exponent' handling + - fix VHT20 + * fixed HT40 co-ex scan for some pri/sec channel switches + * extended HT40 co-ex support to allow dynamic channel width changes + during the lifetime of the BSS + * fixed HT40 co-ex support to check for overlapping 20 MHz BSS + * fixed MSCHAP UTF-8 to UCS-2 conversion for three-byte encoding; + this fixes password with include UTF-8 characters that use + three-byte encoding EAP methods that use NtPasswordHash + * reverted TLS certificate validation step change in v2.1 that rejected + any AAA server certificate with id-kp-clientAuth even if + id-kp-serverAuth EKU was included + * fixed STA validation step for WPS ER commands to prevent a potential + crash if an ER sends an unexpected PutWLANResponse to a station that + is disassociated, but not fully removed + * enforce full EAP authentication after RADIUS Disconnect-Request by + removing the PMKSA cache entry + * added support for NAS-IP-Address, NAS-identifier, and NAS-IPv6-Address + in RADIUS Disconnect-Request + * added mechanism for removing addresses for MAC ACLs by prefixing an + entry with "-" + * Interworking/Hotspot 2.0 enhancements + - support Hotspot 2.0 Release 2 + * OSEN network for online signup connection + * subscription remediation (based on RADIUS server request or + control interface HS20_WNM_NOTIF for testing purposes) + * Hotspot 2.0 release number indication in WFA RADIUS VSA + * deauthentication request (based on RADIUS server request or + control interface WNM_DEAUTH_REQ for testing purposes) + * Session Info URL RADIUS AVP to trigger ESS Disassociation Imminent + * hs20_icon config parameter to configure icon files for OSU + * osu_* config parameters for OSU Providers list + - do not use Interworking filtering rules on Probe Request if + Interworking is disabled to avoid interop issues + * added/fixed nl80211 functionality + - AP interface teardown optimization + - support vendor specific driver command + (VENDOR []) + * fixed PMF protection of Deauthentication frame when this is triggered + by session timeout + * internal TLS implementation enhancements/fixes + - add SHA256-based cipher suites + - add DHE-RSA cipher suites + - fix X.509 validation of PKCS#1 signature to check for extra data + * RADIUS server functionality + - add minimal RADIUS accounting server support (hostapd-as-server); + this is mainly to enable testing coverage with hwsim scripts + - allow authentication log to be written into SQLite databse + - added option for TLS protocol testing of an EAP peer by simulating + various misbehaviors/known attacks + - MAC ACL support for testing purposes + * fixed PTK derivation for CCMP-256 and GCMP-256 + * extended WPS per-station PSK to support ER case + * added option to configure the management group cipher + (group_mgmt_cipher=AES-128-CMAC (default), BIP-GMAC-128, BIP-GMAC-256, + BIP-CMAC-256) + * fixed AP mode default TXOP Limit values for AC_VI and AC_VO (these + were rounded incorrectly) + * added support for postponing FT response in case PMK-R1 needs to be + pulled from R0KH + * added option to advertise 40 MHz intolerant HT capability with + ht_capab=[40-INTOLERANT] + * remove WPS 1.0 only support, i.e., WSC 2.0 support is now enabled + whenever CONFIG_WPS=y is set + * EAP-pwd fixes + - fix possible segmentation fault on EAP method deinit if an invalid + group is negotiated + * fixed RADIUS client retransmit/failover behavior + - there was a potential ctash due to freed memory being accessed + - failover to a backup server mechanism did not work properly + * fixed a possible crash on double DISABLE command when multiple BSSes + are enabled + * fixed a memory leak in SAE random number generation + * fixed GTK rekeying when the station uses FT protocol + * fixed off-by-one bounds checking in printf_encode() + - this could result in deinial of service in some EAP server cases + * various bug fixes + +2014-02-04 - v2.1 + * added support for simultaneous authentication of equals (SAE) for + stronger password-based authentication with WPA2-Personal + * added nl80211 functionality + - VHT configuration for nl80211 + - support split wiphy dump + - driver-based MAC ACL + - QoS Mapping configuration + * added fully automated regression testing with mac80211_hwsim + * allow ctrl_iface group to be specified on command line (-G) + * allow single hostapd process to control independent WPS interfaces + (wps_independent=1) instead of synchronized operations through all + configured interfaces within a process + * avoid processing received management frames multiple times when using + nl80211 with multiple BSSes + * added support for DFS (processing radar detection events, CAC, channel + re-selection) + * added EAP-EKE server + * added automatic channel selection (ACS) + * added option for using per-BSS (vif) configuration files with + -b: + * extended global control interface ADD/REMOVE commands to allow BSSes + of a radio to be removed individually without having to add/remove all + other BSSes of the radio at the same time + * added support for sending debug info to Linux tracing (-T on command + line) + * replace dump_file functionality with same information being available + through the hostapd control interface + * added support for using Protected Dual of Public Action frames for + GAS/ANQP exchanges when PMF is enabled + * added support for WPS+NFC updates + - improved protocol + - option to fetch and report alternative carrier records for external + NFC operations + * various bug fixes + 2013-01-12 - v2.0 * added AP-STA-DISCONNECTED ctrl_iface event * improved debug logging (human readable event names, interface name Modified: vendor/wpa/dist/hostapd/Makefile ============================================================================== --- vendor/wpa/dist/hostapd/Makefile Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/hostapd/Makefile Sat Apr 18 05:04:12 2015 (r281681) @@ -6,8 +6,11 @@ ifndef CFLAGS CFLAGS = -MMD -O2 -Wall -g endif -CFLAGS += -I../src -CFLAGS += -I../src/utils +CFLAGS += $(EXTRA_CFLAGS) +CFLAGS += -I$(abspath ../src) +CFLAGS += -I$(abspath ../src/utils) + +export BINDIR ?= /usr/local/bin/ # Uncomment following line and set the path to your kernel tree include # directory if your C library does not include all header files. @@ -15,6 +18,11 @@ CFLAGS += -I../src/utils -include .config +ifdef CONFIG_TESTING_OPTIONS +CFLAGS += -DCONFIG_TESTING_OPTIONS +CONFIG_WPS_TESTING=y +endif + ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS CONFIG_OS=win32 @@ -54,6 +62,7 @@ OBJS += ../src/ap/preauth_auth.o OBJS += ../src/ap/pmksa_cache_auth.o OBJS += ../src/ap/ieee802_11_shared.o OBJS += ../src/ap/beacon.o +OBJS += ../src/ap/bss_load.o OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o @@ -65,6 +74,11 @@ NEED_SHA1=y OBJS += ../src/drivers/drivers.o CFLAGS += -DHOSTAPD +ifdef CONFIG_MODULE_TESTS +CFLAGS += -DCONFIG_MODULE_TESTS +OBJS += hapd_module_tests.o +endif + ifdef CONFIG_WPA_TRACE CFLAGS += -DWPA_TRACE OBJS += ../src/utils/trace.o @@ -72,10 +86,10 @@ HOBJS += ../src/utils/trace.o LDFLAGS += -rdynamic CFLAGS += -funwind-tables ifdef CONFIG_WPA_TRACE_BFD -CFLAGS += -DWPA_TRACE_BFD -LIBS += -lbfd -LIBS_c += -lbfd -LIBS_h += -lbfd +CFLAGS += -DPACKAGE="hostapd" -DWPA_TRACE_BFD +LIBS += -lbfd -ldl -liberty -lz +LIBS_c += -lbfd -ldl -liberty -lz +LIBS_h += -lbfd -ldl -liberty -lz endif endif @@ -84,6 +98,15 @@ CONFIG_ELOOP=eloop endif OBJS += ../src/utils/$(CONFIG_ELOOP).o OBJS_c += ../src/utils/$(CONFIG_ELOOP).o + +ifeq ($(CONFIG_ELOOP), eloop) +# Using glibc < 2.17 requires -lrt for clock_gettime() +LIBS += -lrt +LIBS_c += -lrt +LIBS_h += -lrt +LIBS_n += -lrt +endif + OBJS += ../src/utils/common.o OBJS += ../src/utils/wpa_debug.o OBJS_c += ../src/utils/wpa_debug.o @@ -93,15 +116,24 @@ OBJS += ../src/utils/ip_addr.o OBJS += ../src/common/ieee802_11_common.o OBJS += ../src/common/wpa_common.o +OBJS += ../src/common/hw_features_common.o OBJS += ../src/eapol_auth/eapol_auth_sm.o +ifdef CONFIG_CODE_COVERAGE +CFLAGS += -O0 -fprofile-arcs -ftest-coverage +LIBS += -lgcov +LIBS_c += -lgcov +LIBS_h += -lgcov +LIBS_n += -lgcov +endif + ifndef CONFIG_NO_DUMP_STATE -# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to -# a file (undefine it, if you want to save in binary size) +# define HOSTAPD_DUMP_STATE to include support for dumping internal state +# through control interface commands (undefine it, if you want to save in +# binary size) CFLAGS += -DHOSTAPD_DUMP_STATE -OBJS += dump_state.o OBJS += ../src/eapol_auth/eapol_auth_dump.o endif @@ -139,8 +171,6 @@ OBJS += ctrl_iface.o OBJS += ../src/ap/ctrl_iface_ap.o endif -OBJS += ../src/crypto/md5.o - CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX ifdef CONFIG_IAPP @@ -158,6 +188,26 @@ CFLAGS += -DCONFIG_PEERKEY OBJS += ../src/ap/peerkey_auth.o endif +ifdef CONFIG_HS20 +NEED_AES_OMAC1=y +CONFIG_PROXYARP=y +endif + +ifdef CONFIG_PROXYARP +CONFIG_L2_PACKET=y +endif + +ifdef CONFIG_SUITEB +CFLAGS += -DCONFIG_SUITEB +NEED_SHA256=y +NEED_AES_OMAC1=y +endif + +ifdef CONFIG_SUITEB192 +CFLAGS += -DCONFIG_SUITEB192 +NEED_SHA384=y +endif + ifdef CONFIG_IEEE80211W CFLAGS += -DCONFIG_IEEE80211W NEED_SHA256=y @@ -174,6 +224,9 @@ endif ifdef CONFIG_SAE CFLAGS += -DCONFIG_SAE +OBJS += ../src/common/sae.o +NEED_ECC=y +NEED_DH_GROUPS=y endif ifdef CONFIG_WNM @@ -212,6 +265,12 @@ OBJS += ../src/l2_packet/l2_packet_none. endif +ifdef CONFIG_ERP +CFLAGS += -DCONFIG_ERP +NEED_SHA256=y +NEED_HMAC_SHA256_KDF=y +endif + ifdef CONFIG_EAP_MD5 CFLAGS += -DEAP_SERVER_MD5 OBJS += ../src/eap_server/eap_server_md5.o @@ -308,7 +367,7 @@ ifdef CONFIG_EAP_GPSK CFLAGS += -DEAP_SERVER_GPSK OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o ifdef CONFIG_EAP_GPSK_SHA256 -CFLAGS += -DEAP_SERVER_GPSK_SHA256 +CFLAGS += -DEAP_GPSK_SHA256 endif NEED_SHA256=y NEED_AES_OMAC1=y @@ -320,6 +379,13 @@ OBJS += ../src/eap_server/eap_server_pwd NEED_SHA256=y endif +ifdef CONFIG_EAP_EKE +CFLAGS += -DEAP_SERVER_EKE +OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o +NEED_DH_GROUPS=y +NEED_DH_GROUPS_ALL=y +endif + ifdef CONFIG_EAP_VENDOR_TEST CFLAGS += -DEAP_SERVER_VENDOR_TEST OBJS += ../src/eap_server/eap_server_vendor_test.o @@ -335,10 +401,6 @@ NEED_AES_UNWRAP=y endif ifdef CONFIG_WPS -ifdef CONFIG_WPS2 -CFLAGS += -DCONFIG_WPS2 -endif - CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC OBJS += ../src/utils/uuid.o OBJS += ../src/ap/wps_hostapd.o @@ -481,7 +543,8 @@ endif OBJS += ../src/crypto/crypto_gnutls.o HOBJS += ../src/crypto/crypto_gnutls.o ifdef NEED_FIPS186_2_PRF -OBJS += ../src/crypto/fips_prf_gnutls.o +OBJS += ../src/crypto/fips_prf_internal.o +SHA1OBJS += ../src/crypto/sha1-internal.o endif LIBS += -lgcrypt LIBS_h += -lgcrypt @@ -501,21 +564,6 @@ CONFIG_INTERNAL_RC4=y CONFIG_INTERNAL_DH_GROUP5=y endif -ifeq ($(CONFIG_TLS), nss) -ifdef TLS_FUNCS -OBJS += ../src/crypto/tls_nss.o -LIBS += -lssl3 -endif -OBJS += ../src/crypto/crypto_nss.o -ifdef NEED_FIPS186_2_PRF -OBJS += ../src/crypto/fips_prf_nss.o -endif -LIBS += -lnss3 -LIBS_h += -lnss3 -CONFIG_INTERNAL_MD4=y -CONFIG_INTERNAL_DH_GROUP5=y -endif - ifeq ($(CONFIG_TLS), internal) ifndef CONFIG_CRYPTO CONFIG_CRYPTO=internal @@ -622,7 +670,9 @@ ifdef CONFIG_INTERNAL_AES AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o endif +ifneq ($(CONFIG_TLS), openssl) AESOBJS += ../src/crypto/aes-wrap.o +endif ifdef NEED_AES_EAX AESOBJS += ../src/crypto/aes-eax.o NEED_AES_CTR=y @@ -637,9 +687,11 @@ ifdef NEED_AES_OMAC1 AESOBJS += ../src/crypto/aes-omac1.o endif ifdef NEED_AES_UNWRAP +ifneq ($(CONFIG_TLS), openssl) NEED_AES_DEC=y AESOBJS += ../src/crypto/aes-unwrap.o endif +endif ifdef NEED_AES_CBC NEED_AES_DEC=y AESOBJS += ../src/crypto/aes-cbc.o @@ -679,6 +731,10 @@ ifdef NEED_SHA1 OBJS += $(SHA1OBJS) endif +ifneq ($(CONFIG_TLS), openssl) +OBJS += ../src/crypto/md5.o +endif + ifdef NEED_MD5 ifdef CONFIG_INTERNAL_MD5 OBJS += ../src/crypto/md5-internal.o @@ -716,6 +772,12 @@ endif ifdef NEED_TLS_PRF_SHA256 OBJS += ../src/crypto/sha256-tlsprf.o endif +ifdef NEED_HMAC_SHA256_KDF +OBJS += ../src/crypto/sha256-kdf.o +endif +endif +ifdef NEED_SHA384 +CFLAGS += -DCONFIG_SHA384 endif ifdef NEED_DH_GROUPS @@ -730,6 +792,10 @@ OBJS += ../src/crypto/dh_group5.o endif endif +ifdef NEED_ECC +CFLAGS += -DCONFIG_ECC +endif + ifdef CONFIG_NO_RANDOM_POOL CFLAGS += -DCONFIG_NO_RANDOM_POOL else @@ -768,6 +834,7 @@ OBJS += ../src/ap/wmm.o OBJS += ../src/ap/ap_list.o OBJS += ../src/ap/ieee802_11.o OBJS += ../src/ap/hw_features.o +OBJS += ../src/ap/dfs.o CFLAGS += -DNEED_AP_MLME endif ifdef CONFIG_IEEE80211N @@ -795,6 +862,15 @@ OBJS += ../src/common/gas.o OBJS += ../src/ap/gas_serv.o endif +ifdef CONFIG_PROXYARP +CFLAGS += -DCONFIG_PROXYARP +OBJS += ../src/ap/x_snoop.o +OBJS += ../src/ap/dhcp_snoop.o +ifdef CONFIG_IPV6 +OBJS += ../src/ap/ndisc_snoop.o +endif +endif + OBJS += ../src/drivers/driver_common.o ifdef CONFIG_WPA_CLI_EDIT @@ -803,10 +879,20 @@ else OBJS_c += ../src/utils/edit_simple.o endif +ifdef CONFIG_ACS +CFLAGS += -DCONFIG_ACS +OBJS += ../src/ap/acs.o +LIBS += -lm +endif + ifdef CONFIG_NO_STDOUT_DEBUG CFLAGS += -DCONFIG_NO_STDOUT_DEBUG endif +ifdef CONFIG_DEBUG_LINUX_TRACING +CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING +endif + ifdef CONFIG_DEBUG_FILE CFLAGS += -DCONFIG_DEBUG_FILE endif @@ -827,10 +913,20 @@ ifeq ($(V), 1) Q= E=true endif +ifeq ($(QUIET), 1) +Q=@ +E=true +endif +ifdef CONFIG_CODE_COVERAGE +%.o: %.c + @$(E) " CC " $< + $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<) +else %.o: %.c $(Q)$(CC) -c -o $@ $(CFLAGS) $< @$(E) " CC " $< +endif verify_config: @if [ ! -r .config ]; then \ @@ -841,9 +937,10 @@ verify_config: exit 1; \ fi -install: all - mkdir -p $(DESTDIR)/usr/local/bin - for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/local/bin/$$i; done +$(DESTDIR)$(BINDIR)/%: % + install -D $(<) $(@) + +install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL)) ../src/drivers/build.hostapd: @if [ -f ../src/drivers/build.wpa_supplicant ]; then \ @@ -864,7 +961,8 @@ hostapd_cli: $(OBJS_c) $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) @$(E) " LD " $@ -NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/md5.o +NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) +NOBJS += ../src/utils/common.o ifdef NEED_RC4 ifdef CONFIG_INTERNAL_RC4 NOBJS += ../src/crypto/rc4.o @@ -899,9 +997,15 @@ hlr_auc_gw: $(HOBJS) $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h) @$(E) " LD " $@ +lcov-html: + lcov -c -d .. > lcov.info + genhtml lcov.info --output-directory lcov-html + clean: $(MAKE) -C ../src clean rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw - rm -f *.d + rm -f *.d *.gcno *.gcda *.gcov + rm -f lcov.info + rm -rf lcov-html -include $(OBJS:%.o=%.d) Modified: vendor/wpa/dist/hostapd/README ============================================================================== --- vendor/wpa/dist/hostapd/README Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/hostapd/README Sat Apr 18 05:04:12 2015 (r281681) @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and Authenticator and RADIUS authentication server ================================================================ -Copyright (c) 2002-2012, Jouni Malinen and contributors +Copyright (c) 2002-2015, Jouni Malinen and contributors All Rights Reserved. This program is licensed under the BSD license (the one with @@ -74,12 +74,6 @@ Current hardware/software requirements: Please note that station firmware version needs to be 1.7.0 or newer to work in WPA mode. - madwifi driver for cards based on Atheros chip set (ar521x) - (http://sourceforge.net/projects/madwifi/) - Please note that you will need to add the correct path for - madwifi driver root directory in .config (see defconfig file for - an example: CFLAGS += -I) - mac80211-based drivers that support AP mode (with driver=nl80211). This includes drivers for Atheros (ath9k) and Broadcom (b43) chipsets. Modified: vendor/wpa/dist/hostapd/README-WPS ============================================================================== --- vendor/wpa/dist/hostapd/README-WPS Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/hostapd/README-WPS Sat Apr 18 05:04:12 2015 (r281681) @@ -58,12 +58,10 @@ hostapd configuration WPS is an optional component that needs to be enabled in hostapd build configuration (.config). Here is an example configuration that -includes WPS support and uses madwifi driver interface: +includes WPS support and uses nl80211 driver interface: -CONFIG_DRIVER_MADWIFI=y -CFLAGS += -I/usr/src/madwifi-0.9.3 +CONFIG_DRIVER_NL80211=y CONFIG_WPS=y -CONFIG_WPS2=y CONFIG_WPS_UPNP=y Following parameter can be used to enable support for NFC config method: @@ -75,8 +73,8 @@ Following section shows an example runti (hostapd.conf) that enables WPS: # Configure the driver and network interface -driver=madwifi -interface=ath0 +driver=nl80211 +interface=wlan0 # WPA2-Personal configuration for the AP ssid=wps-test @@ -338,3 +336,17 @@ If the NFC tag contains a password token internal Registrar. This allows station Enrollee from which the password token was received to run through WPS protocol to provision the credential. + +"nfc_get_handover_sel " command can be used to build the +contents of a Handover Select Message for connection handover when this +does not depend on the contents of the Handover Request Message. The +first argument selects the format of the output data and the second +argument selects which type of connection handover is requested (WPS = +Wi-Fi handover as specified in WSC 2.0). + +"nfc_report_handover WPS +" is used to report completed NFC +connection handover. The first parameter indicates whether the local +device initiated or responded to the connection handover and the carrier +records are the selected carrier from the handover request and select +messages as a hexdump. Modified: vendor/wpa/dist/hostapd/config_file.c ============================================================================== --- vendor/wpa/dist/hostapd/config_file.c Sat Apr 18 04:53:17 2015 (r281680) +++ vendor/wpa/dist/hostapd/config_file.c Sat Apr 18 05:04:12 2015 (r281681) @@ -1,6 +1,6 @@ /* * hostapd / Configuration file parser - * Copyright (c) 2003-2012, Jouni Malinen + * Copyright (c) 2003-2015, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -22,7 +22,12 @@ #include "config_file.h" -extern struct wpa_driver_ops *wpa_drivers[]; +#ifndef CONFIG_NO_RADIUS +#ifdef EAP_SERVER +static struct hostapd_radius_attr * +hostapd_parse_radius_attr(const char *value); +#endif /* EAP_SERVER */ +#endif /* CONFIG_NO_RADIUS */ #ifndef CONFIG_NO_VLAN @@ -83,7 +88,7 @@ static int hostapd_config_read_vlan_file return -1; } - vlan = os_malloc(sizeof(*vlan)); + vlan = os_zalloc(sizeof(*vlan)); if (vlan == NULL) { wpa_printf(MSG_ERROR, "Out of memory while reading " "VLAN interfaces from '%s'", fname); @@ -91,14 +96,10 @@ static int hostapd_config_read_vlan_file return -1; } - os_memset(vlan, 0, sizeof(*vlan)); vlan->vlan_id = vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); - if (bss->vlan_tail) - bss->vlan_tail->next = vlan; - else - bss->vlan = vlan; - bss->vlan_tail = vlan; + vlan->next = bss->vlan; + bss->vlan = vlan; } fclose(f); @@ -136,6 +137,8 @@ static int hostapd_config_read_maclist(c } while (fgets(buf, sizeof(buf), f)) { + int i, rem = 0; + line++; if (buf[0] == '#') @@ -150,14 +153,32 @@ static int hostapd_config_read_maclist(c } if (buf[0] == '\0') continue; + pos = buf; + if (buf[0] == '-') { + rem = 1; + pos++; + } - if (hwaddr_aton(buf, addr)) { + if (hwaddr_aton(pos, addr)) { wpa_printf(MSG_ERROR, "Invalid MAC address '%s' at " - "line %d in '%s'", buf, line, fname); + "line %d in '%s'", pos, line, fname); fclose(f); return -1; } + if (rem) { + i = 0; + while (i < *num) { + if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == + 0) { + os_remove_in_array(*acl, *num, + sizeof(**acl), i); + (*num)--; + } else + i++; + } + continue; + } vlan_id = 0; pos = buf; while (*pos != '\0' && *pos != ' ' && *pos != '\t') @@ -195,7 +216,7 @@ static int hostapd_config_read_eap_user( FILE *f; char buf[512], *pos, *start, *pos2; int line = 0, ret = 0, num_methods; - struct hostapd_eap_user *user, *tail = NULL; + struct hostapd_eap_user *user = NULL, *tail = NULL, *new_user = NULL; if (!fname) return 0; @@ -229,6 +250,28 @@ static int hostapd_config_read_eap_user( if (buf[0] == '\0') continue; +#ifndef CONFIG_NO_RADIUS + if (user && os_strncmp(buf, "radius_accept_attr=", 19) == 0) { + struct hostapd_radius_attr *attr, *a; + attr = hostapd_parse_radius_attr(buf + 19); + if (attr == NULL) { + wpa_printf(MSG_ERROR, "Invalid radius_auth_req_attr: %s", + buf + 19); + user = NULL; /* already in the BSS list */ + goto failed; + } + if (user->accept_attr == NULL) { + user->accept_attr = attr; + } else { + a = user->accept_attr; + while (a->next) + a = a->next; + a->next = attr; + } + continue; + } +#endif /* CONFIG_NO_RADIUS */ + user = NULL; if (buf[0] != '"' && buf[0] != '*') { @@ -323,6 +366,10 @@ static int hostapd_config_read_eap_user( EAP_TTLS_AUTH_MSCHAPV2; goto skip_eap; } + if (os_strcmp(start, "MACACL") == 0) { + user->macacl = 1; + goto skip_eap; + } wpa_printf(MSG_ERROR, "Unsupported EAP type " "'%s' on line %d in '%s'", start, line, fname); @@ -337,7 +384,7 @@ static int hostapd_config_read_eap_user( break; start = pos3; } - if (num_methods == 0 && user->ttls_auth == 0) { + if (num_methods == 0 && user->ttls_auth == 0 && !user->macacl) { wpa_printf(MSG_ERROR, "No EAP types configured on " "line %d in '%s'", line, fname); goto failed; @@ -447,7 +494,7 @@ static int hostapd_config_read_eap_user( done: if (tail == NULL) { - tail = conf->eap_user = user; + tail = new_user = user; } else { tail->next = user; tail = user; @@ -455,17 +502,26 @@ static int hostapd_config_read_eap_user( continue; failed: - if (user) { - os_free(user->password); - os_free(user->identity); - os_free(user); - } + if (user) + hostapd_config_free_eap_user(user); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 05:05:39 2015 Return-Path: Delivered-To: svn-src-all@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 9A9F6B9E; Sat, 18 Apr 2015 05:05: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 6EFF780A; Sat, 18 Apr 2015 05:05: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 t3I55dIa010080; Sat, 18 Apr 2015 05:05:39 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I55dQQ010079; Sat, 18 Apr 2015 05:05:39 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504180505.t3I55dQQ010079@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 05:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r281682 - vendor/wpa/2.4 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 05:05:39 -0000 Author: rpaulo Date: Sat Apr 18 05:05:38 2015 New Revision: 281682 URL: https://svnweb.freebsd.org/changeset/base/281682 Log: Tag wpa_supplicant/hostapd 2.4. Added: vendor/wpa/2.4/ - copied from r281681, vendor/wpa/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 06:16:34 2015 Return-Path: Delivered-To: svn-src-all@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 05CD244B; Sat, 18 Apr 2015 06:16:34 +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 E7CFEE53; Sat, 18 Apr 2015 06:16: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 t3I6GXPF076117; Sat, 18 Apr 2015 06:16:33 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I6GXQ4076116; Sat, 18 Apr 2015 06:16:33 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504180616.t3I6GXQ4076116@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sat, 18 Apr 2015 06:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281683 - head/sys/netgraph/bluetooth/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 06:16:34 -0000 Author: takawata Date: Sat Apr 18 06:16:33 2015 New Revision: 281683 URL: https://svnweb.freebsd.org/changeset/base/281683 Log: Forgot to add default event mask definition. Modified: head/sys/netgraph/bluetooth/include/ng_hci.h Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Sat Apr 18 05:05:38 2015 (r281682) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Sat Apr 18 06:16:33 2015 (r281683) @@ -897,6 +897,8 @@ typedef struct { } __attribute__ ((packed)) ng_hci_set_event_mask_cp; typedef ng_hci_status_rp ng_hci_set_event_mask_rp; +#define NG_HCI_EVENT_MASK_DEFAULT 0x1fffffffffff +#define NG_HCI_EVENT_MASK_LE 0x2000000000000000 #define NG_HCI_OCF_RESET 0x0003 /* No command parameter(s) */ @@ -1454,6 +1456,7 @@ typedef struct { } __attribute__ ((packed)) ng_hci_le_set_event_mask_cp; typedef ng_hci_status_rp ng_hci_le_set_event_mask_rp; +#define NG_HCI_LE_EVENT_MASK_ALL 0x1f #define NG_HCI_OCF_LE_READ_BUFFER_SIZE 0x0002 /*No command parameter */ From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 06:48:05 2015 Return-Path: Delivered-To: svn-src-all@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 0436D843; Sat, 18 Apr 2015 06:48: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 D9791117; Sat, 18 Apr 2015 06:48: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 t3I6m46a007027; Sat, 18 Apr 2015 06:48:04 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I6m4L9007023; Sat, 18 Apr 2015 06:48:04 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201504180648.t3I6m4L9007023@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 18 Apr 2015 06:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281684 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 06:48:05 -0000 Author: araujo (ports committer) Date: Sat Apr 18 06:48:03 2015 New Revision: 281684 URL: https://svnweb.freebsd.org/changeset/base/281684 Log: Improve code style(9), no functional changes. Differential Revision: D2320 Reviewed by: takawata Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Sat Apr 18 06:16:33 2015 (r281683) +++ head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Sat Apr 18 06:48:03 2015 (r281684) @@ -1491,7 +1491,7 @@ hci_write_page_scan_mode(int s, int argc static int hci_read_le_host_supported_command(int s, int argc, char **argv) { - ng_hci_read_le_host_supported_rp rp; + ng_hci_read_le_host_supported_rp rp; int n; n = sizeof(rp); if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, @@ -1514,10 +1514,10 @@ hci_read_le_host_supported_command(int s static int hci_write_le_host_supported_command(int s, int argc, char **argv) { - ng_hci_write_le_host_supported_cp cp; - ng_hci_write_le_host_supported_rp rp; + ng_hci_write_le_host_supported_cp cp; + ng_hci_write_le_host_supported_rp rp; - int n; + int n; cp.le_supported_host = 0; cp.simultaneous_le_host = 0; Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 06:16:33 2015 (r281683) +++ head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 06:48:03 2015 (r281684) @@ -46,6 +46,7 @@ #define L2CAP_SOCKET_CHECKED #include #include "hccontrol.h" + static int le_set_scan_param(int s, int argc, char *argv[]); static int le_set_scan_enable(int s, int argc, char *argv[]); static int parse_param(int argc, char *argv[], char *buf, int *len); @@ -56,51 +57,47 @@ static int set_le_event_mask(int s, uint static int set_event_mask(int s, uint64_t mask); static int le_enable(int s, int argc, char *argv[]); -static int le_set_scan_param(int s, int argc, char *argv[]) +static int +le_set_scan_param(int s, int argc, char *argv[]) { int type; int interval; int window; int adrtype; - int policy; + int policy; + int e, n; ng_hci_le_set_scan_parameters_cp cp; ng_hci_le_set_scan_parameters_rp rp; - int e,n; - if(argc != 5){ + if (argc != 5) return USAGE; - } - if(strcmp(argv[0], "active")==0){ + if (strcmp(argv[0], "active") == 0) type = 1; - }else if (strcmp(argv[0], "passive") == 0){ + else if (strcmp(argv[0], "passive") == 0) type = 0; - }else{ + else return USAGE; - } interval = (int)(atof(argv[1])/0.625); interval = (interval < 4)? 4: interval; window = (int)(atof(argv[2])/0.625); window = (window < 4) ? 4 : interval; - if(strcmp(argv[3], "public")==0){ + if (strcmp(argv[3], "public") == 0) adrtype = 0; - }else if (strcmp(argv[0], "random") == 0){ + else if (strcmp(argv[0], "random") == 0) adrtype = 1; - }else{ + else return USAGE; - } - if(strcmp(argv[4], "all")==0){ + if (strcmp(argv[4], "all") == 0) policy = 0; - }else if (strcmp(argv[4], "whitelist") == 0){ + else if (strcmp(argv[4], "whitelist") == 0) policy = 1; - }else{ + else return USAGE; - } - cp.le_scan_type = type; cp.le_scan_interval = interval; @@ -109,43 +106,42 @@ static int le_set_scan_param(int s, int cp.scanning_filter_policy = policy; n = sizeof(rp); e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, - NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), - (void *)&cp, sizeof(cp), (void *)&rp, &n); - + NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), + (void *)&cp, sizeof(cp), (void *)&rp, &n); return 0; - } - -static int le_set_scan_enable(int s, int argc, char *argv[]) +static int +le_set_scan_enable(int s, int argc, char *argv[]) { ng_hci_le_set_scan_enable_cp cp; ng_hci_le_set_scan_enable_rp rp; - int e,n,enable = 0; + int e, n, enable = 0; - if(argc != 1) + if (argc != 1) return USAGE; - if(strcmp(argv[0], "enable") == 0){ + if (strcmp(argv[0], "enable") == 0) enable = 1; - }else if(strcmp(argv[0], "disable")!= 0){ + else if (strcmp(argv[0], "disable") != 0) return USAGE; - } + n = sizeof(rp); cp.le_scan_enable = enable; cp.filter_duplicates = 0; e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, - NG_HCI_OCF_LE_SET_SCAN_ENABLE), - (void *)&cp, sizeof(cp), (void *)&rp, &n); + NG_HCI_OCF_LE_SET_SCAN_ENABLE), + (void *)&cp, sizeof(cp), (void *)&rp, &n); - if(e != 0 || rp.status != 0){ + if (e != 0 || rp.status != 0) return ERROR; - } + return OK; - } -static int parse_param(int argc, char *argv[], char *buf, int *len) + +static int +parse_param(int argc, char *argv[], char *buf, int *len) { char *buflast = buf + (*len); char *curbuf = buf; @@ -155,13 +151,12 @@ static int parse_param(int argc, char *a uint16_t value; optreset = 1; optind = 0; - while((ch = getopt(argc, argv , "n:f:u:")) != -1){ + while ((ch = getopt(argc, argv , "n:f:u:")) != -1) { switch(ch){ case 'n': datalen = strlen(optarg); - if( (curbuf + datalen + 2)>= buflast){ + if ((curbuf + datalen + 2) >= buflast) goto done; - } curbuf[0] = datalen + 1; curbuf[1] = 8; curbuf += 2; @@ -169,9 +164,8 @@ static int parse_param(int argc, char *a curbuf += datalen; break; case 'f': - if(curbuf+3 >buflast){ + if (curbuf+3 > buflast) goto done; - } curbuf[0] = 2; curbuf[1] = 1; curbuf[2] = atoi(optarg); @@ -179,15 +173,14 @@ static int parse_param(int argc, char *a break; case 'u': lenpos = buf; - if((buf+2)>= buflast) + if ((buf+2) >= buflast) goto done; - curbuf[1] = 2; *lenpos = 1; curbuf += 2; - while((token = strsep(&optarg, ",")) != NULL){ + while ((token = strsep(&optarg, ",")) != NULL) { value = strtol(token, NULL, 16); - if((curbuf+2)>= buflast) + if ((curbuf+2) >= buflast) break; curbuf[0] = value &0xff; curbuf[1] = (value>>8)&0xff; @@ -202,7 +195,8 @@ done: return OK; } -static int le_set_scan_response(int s, int argc, char *argv[]) +static int +le_set_scan_response(int s, int argc, char *argv[]) { ng_hci_le_set_scan_response_data_cp cp; ng_hci_le_set_scan_response_data_rp rp; @@ -210,6 +204,7 @@ static int le_set_scan_response(int s, i int e; int len; char buf[NG_HCI_ADVERTISING_DATA_SIZE]; + len = sizeof(buf); parse_param(argc, argv, buf, &len); memset(cp.scan_response_data, 0, sizeof(cp.scan_response_data)); @@ -217,45 +212,51 @@ static int le_set_scan_response(int s, i memcpy(cp.scan_response_data, buf, len); n = sizeof(rp); e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, - NG_HCI_OCF_LE_SET_SCAN_RESPONSE_DATA), + NG_HCI_OCF_LE_SET_SCAN_RESPONSE_DATA), (void *)&cp, sizeof(cp), (void *)&rp, &n); - printf("SEt SCAN RESPONSE %d %d %d\n", e, rp.status, n); + printf("SET SCAN RESPONSE %d %d %d\n", e, rp.status, n); return OK; } -static int le_read_local_supported_features(int s, int argc ,char *argv[]) +static int +le_read_local_supported_features(int s, int argc ,char *argv[]) { ng_hci_le_read_local_supported_features_rp rp; int e; int n = sizeof(rp); + e = hci_simple_request(s, - NG_HCI_OPCODE(NG_HCI_OGF_LE, - NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), - (void *)&rp, &n); - printf("LOCAL SUPPOREDED:%d %d %lu\n", e, rp.status, rp.le_features); + NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), + (void *)&rp, &n); - return 0; + printf("LOCAL SUPPOREDED: %d %d %lu\n", e, rp.status, + rp.le_features); + return 0; } -static int le_read_supported_status(int s, int argc, char *argv[]) + +static int +le_read_supported_status(int s, int argc, char *argv[]) { ng_hci_le_read_supported_status_rp rp; int e; int n = sizeof(rp); - e = hci_simple_request(s, - NG_HCI_OPCODE(NG_HCI_OGF_LE, - NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), - (void *)&rp, &n); - printf("LE_STATUS:%d %d %lx\n", e, rp.status, rp.le_status); - return 0; + e = hci_simple_request(s, NG_HCI_OPCODE( + NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_SUPPORTED), + (void *)&rp, &n); -} + printf("LE_STATUS: %d %d %lx\n", e, rp.status, rp.le_status); + return 0; +} -static int set_le_event_mask(int s, uint64_t mask) +static int +set_le_event_mask(int s, uint64_t mask) { ng_hci_le_set_event_mask_cp semc; ng_hci_le_set_event_mask_rp rp; @@ -263,60 +264,62 @@ static int set_le_event_mask(int s, uint n = sizeof(rp); - for(i=0; i< NG_HCI_LE_EVENT_MASK_SIZE;i++){ + for (i=0; i < NG_HCI_LE_EVENT_MASK_SIZE; i++) { semc.event_mask[i] = mask&0xff; - mask>>= 8; + mask >>= 8; } - e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_EVENT_MASK), (void *)&semc, sizeof(semc), (void *)&rp, &n); + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_EVENT_MASK), + (void *)&semc, sizeof(semc), (void *)&rp, &n); return 0; } - -static int set_event_mask(int s, uint64_t mask) +static int +set_event_mask(int s, uint64_t mask) { ng_hci_set_event_mask_cp semc; ng_hci_set_event_mask_rp rp; - int i,n,e; + int i, n, e; n = sizeof(rp); - for(i=0; i< NG_HCI_EVENT_MASK_SIZE;i++){ + for (i=0; i < NG_HCI_EVENT_MASK_SIZE; i++) { semc.event_mask[i] = mask&0xff; - mask>>= 8; + mask >>= 8; } - e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, NG_HCI_OCF_SET_EVENT_MASK), (void *)&semc, sizeof(semc), (void *)&rp, &n); + e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, + NG_HCI_OCF_SET_EVENT_MASK), + (void *)&semc, sizeof(semc), (void *)&rp, &n); return 0; } - -static int le_enable(int s, int argc, char *argv[]) +static +int le_enable(int s, int argc, char *argv[]) { - if(argc != 1){ + if (argc != 1) return USAGE; - } - if(strcasecmp(argv[0], "enable")==0){ - set_event_mask(s,NG_HCI_EVENT_MASK_DEFAULT | + if (strcasecmp(argv[0], "enable") == 0) { + set_event_mask(s, NG_HCI_EVENT_MASK_DEFAULT | NG_HCI_EVENT_MASK_LE); set_le_event_mask(s, NG_HCI_LE_EVENT_MASK_ALL); - }else if (strcasecmp(argv[0], "disble")==0){ - set_event_mask(s,NG_HCI_EVENT_MASK_DEFAULT); - }else{ + } else if (strcasecmp(argv[0], "disble") == 0) + set_event_mask(s, NG_HCI_EVENT_MASK_DEFAULT); + else return USAGE; - } return OK; } -struct hci_command le_commands[] = { - { - "le_enable", - "le_enable [enable|disable] \n" - "Enable LE event ", - &le_enable, - }, +struct hci_command le_commands[] = { +{ + "le_enable", + "le_enable [enable|disable] \n" + "Enable LE event ", + &le_enable, +}, { "le_read_local_supported_features", "le_read_local_supported_features\n" From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 06:53:14 2015 Return-Path: Delivered-To: svn-src-all@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 D07FD9ED; Sat, 18 Apr 2015 06:53: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 BE4A0228; Sat, 18 Apr 2015 06:53: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 t3I6rExi012716; Sat, 18 Apr 2015 06:53:14 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I6rEL2012714; Sat, 18 Apr 2015 06:53:14 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201504180653.t3I6rEL2012714@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sat, 18 Apr 2015 06:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281685 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 06:53:14 -0000 Author: araujo (ports committer) Date: Sat Apr 18 06:53:13 2015 New Revision: 281685 URL: https://svnweb.freebsd.org/changeset/base/281685 Log: Fix misspelling. Modified: head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 06:48:03 2015 (r281684) +++ head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 06:53:13 2015 (r281685) @@ -232,7 +232,7 @@ le_read_local_supported_features(int s, NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), (void *)&rp, &n); - printf("LOCAL SUPPOREDED: %d %d %lu\n", e, rp.status, + printf("LOCAL SUPPORTED: %d %d %lu\n", e, rp.status, rp.le_features); return 0; From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 07:34:40 2015 Return-Path: Delivered-To: svn-src-all@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 651D8FB1; Sat, 18 Apr 2015 07:34:40 +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 524C681A; Sat, 18 Apr 2015 07:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I7Yer5050877; Sat, 18 Apr 2015 07:34:40 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I7Yel5050876; Sat, 18 Apr 2015 07:34:40 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504180734.t3I7Yel5050876@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 07:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281686 - head/sys/dev/etherswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 07:34:40 -0000 Author: rpaulo Date: Sat Apr 18 07:34:39 2015 New Revision: 281686 URL: https://svnweb.freebsd.org/changeset/base/281686 Log: Fix French typos in etherswitch. Modified: head/sys/dev/etherswitch/miiproxy.c Modified: head/sys/dev/etherswitch/miiproxy.c ============================================================================== --- head/sys/dev/etherswitch/miiproxy.c Sat Apr 18 06:53:13 2015 (r281685) +++ head/sys/dev/etherswitch/miiproxy.c Sat Apr 18 07:34:39 2015 (r281686) @@ -62,35 +62,35 @@ struct mdioproxy_softc { }; /* - * The rendevous data structures and functions allow two device endpoints to + * The rendezvous data structures and functions allow two device endpoints to * match up, so that the proxy endpoint can be associated with a target * endpoint. The proxy has to know the device name of the target that it - * wants to associate with, for example through a hint. The rendevous code + * wants to associate with, for example through a hint. The rendezvous code * makes no assumptions about the devices that want to meet. */ -struct rendevous_entry; +struct rendezvous_entry; -enum rendevous_op { - RENDEVOUS_ATTACH, - RENDEVOUS_DETACH +enum rendezvous_op { + RENDEZVOUS_ATTACH, + RENDEZVOUS_DETACH }; -typedef int (*rendevous_callback_t)(enum rendevous_op, - struct rendevous_entry *); +typedef int (*rendezvous_callback_t)(enum rendezvous_op, + struct rendezvous_entry *); -static SLIST_HEAD(rendevoushead, rendevous_entry) rendevoushead = - SLIST_HEAD_INITIALIZER(rendevoushead); +static SLIST_HEAD(rendezvoushead, rendezvous_entry) rendezvoushead = + SLIST_HEAD_INITIALIZER(rendezvoushead); -struct rendevous_endpoint { +struct rendezvous_endpoint { device_t device; const char *name; - rendevous_callback_t callback; + rendezvous_callback_t callback; }; -struct rendevous_entry { - SLIST_ENTRY(rendevous_entry) entries; - struct rendevous_endpoint proxy; - struct rendevous_endpoint target; +struct rendezvous_entry { + SLIST_ENTRY(rendezvous_entry) entries; + struct rendezvous_endpoint proxy; + struct rendezvous_endpoint target; }; /* @@ -98,15 +98,15 @@ struct rendevous_entry { * returns an error, undo the attachment. */ static int -rendevous_attach(struct rendevous_entry *e, struct rendevous_endpoint *ep) +rendezvous_attach(struct rendezvous_entry *e, struct rendezvous_endpoint *ep) { int error; - error = e->proxy.callback(RENDEVOUS_ATTACH, e); + error = e->proxy.callback(RENDEZVOUS_ATTACH, e); if (error == 0) { - error = e->target.callback(RENDEVOUS_ATTACH, e); + error = e->target.callback(RENDEZVOUS_ATTACH, e); if (error != 0) { - e->proxy.callback(RENDEVOUS_DETACH, e); + e->proxy.callback(RENDEZVOUS_DETACH, e); ep->device = NULL; ep->callback = NULL; } @@ -115,27 +115,27 @@ rendevous_attach(struct rendevous_entry } /* - * Create an entry for the proxy in the rendevous list. The name parameter + * Create an entry for the proxy in the rendezvous list. The name parameter * indicates the name of the device that is the target endpoint for this - * rendevous. The callback will be invoked as soon as the target is + * rendezvous. The callback will be invoked as soon as the target is * registered: either immediately if the target registered itself earlier, * or once the target registers. Returns ENXIO if the target has not yet * registered. */ static int -rendevous_register_proxy(device_t dev, const char *name, - rendevous_callback_t callback) +rendezvous_register_proxy(device_t dev, const char *name, + rendezvous_callback_t callback) { - struct rendevous_entry *e; + struct rendezvous_entry *e; KASSERT(callback != NULL, ("callback must be set")); - SLIST_FOREACH(e, &rendevoushead, entries) { + SLIST_FOREACH(e, &rendezvoushead, entries) { if (strcmp(name, e->target.name) == 0) { /* the target is already attached */ e->proxy.name = device_get_nameunit(dev); e->proxy.device = dev; e->proxy.callback = callback; - return (rendevous_attach(e, &e->proxy)); + return (rendezvous_attach(e, &e->proxy)); } } e = malloc(sizeof(*e), M_MIIPROXY, M_WAITOK | M_ZERO); @@ -143,34 +143,34 @@ rendevous_register_proxy(device_t dev, c e->proxy.device = dev; e->proxy.callback = callback; e->target.name = name; - SLIST_INSERT_HEAD(&rendevoushead, e, entries); + SLIST_INSERT_HEAD(&rendezvoushead, e, entries); return (ENXIO); } /* - * Create an entry in the rendevous list for the target. + * Create an entry in the rendezvous list for the target. * Returns ENXIO if the proxy has not yet registered. */ static int -rendevous_register_target(device_t dev, rendevous_callback_t callback) +rendezvous_register_target(device_t dev, rendezvous_callback_t callback) { - struct rendevous_entry *e; + struct rendezvous_entry *e; const char *name; - + KASSERT(callback != NULL, ("callback must be set")); name = device_get_nameunit(dev); - SLIST_FOREACH(e, &rendevoushead, entries) { + SLIST_FOREACH(e, &rendezvoushead, entries) { if (strcmp(name, e->target.name) == 0) { e->target.device = dev; e->target.callback = callback; - return (rendevous_attach(e, &e->target)); + return (rendezvous_attach(e, &e->target)); } } e = malloc(sizeof(*e), M_MIIPROXY, M_WAITOK | M_ZERO); e->target.name = name; e->target.device = dev; e->target.callback = callback; - SLIST_INSERT_HEAD(&rendevoushead, e, entries); + SLIST_INSERT_HEAD(&rendezvoushead, e, entries); return (ENXIO); } @@ -178,20 +178,20 @@ rendevous_register_target(device_t dev, * Remove the registration for the proxy. */ static int -rendevous_unregister_proxy(device_t dev) +rendezvous_unregister_proxy(device_t dev) { - struct rendevous_entry *e; + struct rendezvous_entry *e; int error = 0; - - SLIST_FOREACH(e, &rendevoushead, entries) { + + SLIST_FOREACH(e, &rendezvoushead, entries) { if (e->proxy.device == dev) { if (e->target.device == NULL) { - SLIST_REMOVE(&rendevoushead, e, rendevous_entry, entries); + SLIST_REMOVE(&rendezvoushead, e, rendezvous_entry, entries); free(e, M_MIIPROXY); return (0); } else { - e->proxy.callback(RENDEVOUS_DETACH, e); - e->target.callback(RENDEVOUS_DETACH, e); + e->proxy.callback(RENDEZVOUS_DETACH, e); + e->target.callback(RENDEZVOUS_DETACH, e); } e->proxy.device = NULL; e->proxy.callback = NULL; @@ -205,20 +205,20 @@ rendevous_unregister_proxy(device_t dev) * Remove the registration for the target. */ static int -rendevous_unregister_target(device_t dev) +rendezvous_unregister_target(device_t dev) { - struct rendevous_entry *e; + struct rendezvous_entry *e; int error = 0; - - SLIST_FOREACH(e, &rendevoushead, entries) { + + SLIST_FOREACH(e, &rendezvoushead, entries) { if (e->target.device == dev) { if (e->proxy.device == NULL) { - SLIST_REMOVE(&rendevoushead, e, rendevous_entry, entries); + SLIST_REMOVE(&rendezvoushead, e, rendezvous_entry, entries); free(e, M_MIIPROXY); return (0); } else { - e->proxy.callback(RENDEVOUS_DETACH, e); - e->target.callback(RENDEVOUS_DETACH, e); + e->proxy.callback(RENDEZVOUS_DETACH, e); + e->target.callback(RENDEZVOUS_DETACH, e); } e->target.device = NULL; e->target.callback = NULL; @@ -234,15 +234,15 @@ rendevous_unregister_target(device_t dev */ static int -miiproxy_rendevous_callback(enum rendevous_op op, struct rendevous_entry *rendevous) +miiproxy_rendezvous_callback(enum rendezvous_op op, struct rendezvous_entry *rendezvous) { - struct miiproxy_softc *sc = device_get_softc(rendevous->proxy.device); + struct miiproxy_softc *sc = device_get_softc(rendezvous->proxy.device); switch (op) { - case RENDEVOUS_ATTACH: - sc->mdio = device_get_parent(rendevous->target.device); + case RENDEZVOUS_ATTACH: + sc->mdio = device_get_parent(rendezvous->target.device); break; - case RENDEVOUS_DETACH: + case RENDEZVOUS_DETACH: sc->mdio = NULL; break; } @@ -263,7 +263,7 @@ miiproxy_attach(device_t dev) /* * The ethernet interface needs to call mii_attach_proxy() to pass - * the relevant parameters for rendevous with the MDIO target. + * the relevant parameters for rendezvous with the MDIO target. */ return (bus_generic_attach(dev)); } @@ -272,7 +272,7 @@ static int miiproxy_detach(device_t dev) { - rendevous_unregister_proxy(dev); + rendezvous_unregister_proxy(dev); bus_generic_detach(dev); return (0); } @@ -322,7 +322,7 @@ miiproxy_mediainit(device_t dev) * Functions for the MDIO target device driver. */ static int -mdioproxy_rendevous_callback(enum rendevous_op op, struct rendevous_entry *rendevous) +mdioproxy_rendezvous_callback(enum rendezvous_op op, struct rendezvous_entry *rendezvous) { return (0); } @@ -349,7 +349,7 @@ static int mdioproxy_attach(device_t dev) { - rendevous_register_target(dev, mdioproxy_rendevous_callback); + rendezvous_register_target(dev, mdioproxy_rendezvous_callback); return (bus_generic_attach(dev)); } @@ -357,7 +357,7 @@ static int mdioproxy_detach(device_t dev) { - rendevous_unregister_target(dev); + rendezvous_unregister_target(dev); bus_generic_detach(dev); return (0); } @@ -373,7 +373,7 @@ mii_attach_proxy(device_t dev) int error; const char *name; device_t miiproxy; - + if (resource_string_value(device_get_name(dev), device_get_unit(dev), "mdio", &name) != 0) { if (bootverbose) @@ -391,7 +391,7 @@ mii_attach_proxy(device_t dev) sc = device_get_softc(miiproxy); sc->parent = dev; sc->proxy = miiproxy; - if (rendevous_register_proxy(miiproxy, name, miiproxy_rendevous_callback) != 0) { + if (rendezvous_register_proxy(miiproxy, name, miiproxy_rendezvous_callback) != 0) { device_printf(dev, "can't attach proxy\n"); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 08:01:16 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Apr 18 09:08:48 2015 Return-Path: Delivered-To: svn-src-all@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 53BB96F9; Sat, 18 Apr 2015 09:08: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 41D26EF; Sat, 18 Apr 2015 09:08: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 t3I98mv1037313; Sat, 18 Apr 2015 09:08:48 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I98mt7037312; Sat, 18 Apr 2015 09:08:48 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504180908.t3I98mt7037312@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sat, 18 Apr 2015 09:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281688 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 09:08:48 -0000 Author: takawata Date: Sat Apr 18 09:08:47 2015 New Revision: 281688 URL: https://svnweb.freebsd.org/changeset/base/281688 Log: Fix Typo. Modified: head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 08:01:12 2015 (r281687) +++ head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 09:08:47 2015 (r281688) @@ -247,7 +247,7 @@ le_read_supported_status(int s, int argc e = hci_simple_request(s, NG_HCI_OPCODE( NG_HCI_OGF_LE, - NG_HCI_OCF_LE_READ_SUPPORTED), + NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), (void *)&rp, &n); printf("LE_STATUS: %d %d %lx\n", e, rp.status, rp.le_status); From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 09:49:10 2015 Return-Path: Delivered-To: svn-src-all@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 28B1B186; Sat, 18 Apr 2015 09:49:10 +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 F1438756; Sat, 18 Apr 2015 09:49:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3I9n9HB071149; Sat, 18 Apr 2015 09:49:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3I9n9W3071148; Sat, 18 Apr 2015 09:49:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201504180949.t3I9n9W3071148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 18 Apr 2015 09:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281689 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 09:49:10 -0000 Author: trasz Date: Sat Apr 18 09:49:09 2015 New Revision: 281689 URL: https://svnweb.freebsd.org/changeset/base/281689 Log: Remove unused code from linux_mount(), and make it possible to mount any kind of filesystem instead of harcoded three. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Apr 18 09:08:47 2015 (r281688) +++ head/sys/compat/linux/linux_file.c Sat Apr 18 09:49:09 2015 (r281689) @@ -55,10 +55,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include - #ifdef COMPAT_LINUX32 #include #include @@ -1078,12 +1074,10 @@ linux_pwrite(td, uap) int linux_mount(struct thread *td, struct linux_mount_args *args) { - struct ufs_args ufs; char fstypename[MFSNAMELEN]; char mntonname[MNAMELEN], mntfromname[MNAMELEN]; int error; int fsflags; - void *fsdata; error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1, NULL); @@ -1104,20 +1098,10 @@ linux_mount(struct thread *td, struct li if (strcmp(fstypename, "ext2") == 0) { strcpy(fstypename, "ext2fs"); - fsdata = &ufs; - ufs.fspec = mntfromname; -#define DEFAULT_ROOTID -2 - ufs.export.ex_root = DEFAULT_ROOTID; - ufs.export.ex_flags = - args->rwflag & LINUX_MS_RDONLY ? MNT_EXRDONLY : 0; } else if (strcmp(fstypename, "proc") == 0) { strcpy(fstypename, "linprocfs"); - fsdata = NULL; } else if (strcmp(fstypename, "vfat") == 0) { strcpy(fstypename, "msdosfs"); - fsdata = NULL; - } else { - return (ENODEV); } fsflags = 0; @@ -1137,19 +1121,11 @@ linux_mount(struct thread *td, struct li fsflags |= MNT_UPDATE; } - if (strcmp(fstypename, "linprocfs") == 0) { - error = kernel_vmount(fsflags, - "fstype", fstypename, - "fspath", mntonname, - NULL); - } else if (strcmp(fstypename, "msdosfs") == 0) { - error = kernel_vmount(fsflags, - "fstype", fstypename, - "fspath", mntonname, - "from", mntfromname, - NULL); - } else - error = EOPNOTSUPP; + error = kernel_vmount(fsflags, + "fstype", fstypename, + "fspath", mntonname, + "from", mntfromname, + NULL); return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 16:04:33 2015 Return-Path: Delivered-To: svn-src-all@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 566BE3C6; Sat, 18 Apr 2015 16:04: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 445FFEE3; Sat, 18 Apr 2015 16:04: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 t3IG4XeR010233; Sat, 18 Apr 2015 16:04:33 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IG4Xgd010232; Sat, 18 Apr 2015 16:04:33 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504181604.t3IG4Xgd010232@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sat, 18 Apr 2015 16:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281690 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:04:33 -0000 Author: takawata Date: Sat Apr 18 16:04:32 2015 New Revision: 281690 URL: https://svnweb.freebsd.org/changeset/base/281690 Log: Change printf formatting to unbroke i386 arch. Submitted by:david@catwhisker.org Modified: head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 09:49:09 2015 (r281689) +++ head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 16:04:32 2015 (r281690) @@ -232,7 +232,7 @@ le_read_local_supported_features(int s, NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), (void *)&rp, &n); - printf("LOCAL SUPPORTED: %d %d %lu\n", e, rp.status, + printf("LOCAL SUPPORTED: %d %d %jx\n", e, rp.status, rp.le_features); return 0; @@ -250,7 +250,7 @@ le_read_supported_status(int s, int argc NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), (void *)&rp, &n); - printf("LE_STATUS: %d %d %lx\n", e, rp.status, rp.le_status); + printf("LE_STATUS: %d %d %jx\n", e, rp.status, rp.le_status); return 0; } From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 16:08:10 2015 Return-Path: Delivered-To: svn-src-all@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 51F3B53D; Sat, 18 Apr 2015 16:08:10 +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 3DA79F05; Sat, 18 Apr 2015 16:08:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IG8AfV012110; Sat, 18 Apr 2015 16:08:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IG86FT012071; Sat, 18 Apr 2015 16:08:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201504181608.t3IG86FT012071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 18 Apr 2015 16:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281691 - in head: . etc/defaults etc/rc.d sbin/mount sbin/mount_nfs share/man/man5 sys/nfsclient usr.bin/nfsstat usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:08:10 -0000 Author: trasz Date: Sat Apr 18 16:08:06 2015 New Revision: 281691 URL: https://svnweb.freebsd.org/changeset/base/281691 Log: Remove some oldnfs remnants. Differential Revision: https://reviews.freebsd.org/D2287 Reviewed by: rmacklem@ Sponsored by: The FreeBSD Foundation Modified: head/ObsoleteFiles.inc head/etc/defaults/rc.conf head/etc/rc.d/mountd head/etc/rc.d/nfsd head/sbin/mount/mount.8 head/sbin/mount/mount.c head/sbin/mount_nfs/Makefile head/sbin/mount_nfs/mount_nfs.8 head/share/man/man5/rc.conf.5 head/sys/nfsclient/nfs.h head/usr.bin/nfsstat/nfsstat.c head/usr.sbin/nfsd/nfsd.8 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Apr 18 16:04:32 2015 (r281690) +++ head/ObsoleteFiles.inc Sat Apr 18 16:08:06 2015 (r281691) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20150418 +OLD_FILES+=sbin/mount_oldnfs +OLD_FILES+=usr/share/man/man8/mount_oldnfs.8.gz # 20150416: ALTQ moved to net/altq OLD_FILES+=usr/include/altq/altq_rmclass_debug.h OLD_FILES+=usr/include/altq/altq.h Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Apr 18 16:04:32 2015 (r281690) +++ head/etc/defaults/rc.conf Sat Apr 18 16:08:06 2015 (r281691) @@ -88,7 +88,7 @@ fsck_y_enable="NO" # Set to YES to do fs fsck_y_flags="" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. -netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB" # Net filesystems. +netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. extra_netfs_types="NO" # List of network extra filesystem types for delayed # mount at startup (or NO). @@ -324,7 +324,6 @@ autounmountd_flags="" # Flags to autoun nfs_client_enable="NO" # This host is an NFS client (or NO). nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). -oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). nfs_server_flags="-u -t" # Flags to nfsd (if enabled). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Sat Apr 18 16:04:32 2015 (r281690) +++ head/etc/rc.d/mountd Sat Apr 18 16:08:06 2015 (r281691) @@ -33,12 +33,6 @@ mountd_precmd() fi fi - # If oldnfs_server_enable is yes, force use of the old NFS server - # - if checkyesno oldnfs_server_enable; then - rc_flags="-o ${rc_flags}" - fi - if checkyesno zfs_enable; then rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" fi Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Sat Apr 18 16:04:32 2015 (r281690) +++ head/etc/rc.d/nfsd Sat Apr 18 16:08:06 2015 (r281691) @@ -19,40 +19,25 @@ sig_stop="USR1" nfsd_precmd() { - if checkyesno oldnfs_server_enable; then - rc_flags="-o ${nfs_server_flags}" + rc_flags="${nfs_server_flags}" - # Load the module now, so that the vfs.nfsrv sysctl - # oids are available. - load_kld nfsserver - - if checkyesno nfs_reserved_port_only; then - echo 'NFS on reserved port only=YES' - sysctl vfs.nfsrv.nfs_privport=1 > /dev/null - else - sysctl vfs.nfsrv.nfs_privport=0 > /dev/null - fi + # Load the modules now, so that the vfs.nfsd sysctl + # oids are available. + load_kld nfsd + + if checkyesno nfs_reserved_port_only; then + echo 'NFS on reserved port only=YES' + sysctl vfs.nfsd.nfs_privport=1 > /dev/null else - rc_flags="${nfs_server_flags}" + sysctl vfs.nfsd.nfs_privport=0 > /dev/null + fi - # Load the modules now, so that the vfs.nfsd sysctl - # oids are available. - load_kld nfsd - - if checkyesno nfs_reserved_port_only; then - echo 'NFS on reserved port only=YES' - sysctl vfs.nfsd.nfs_privport=1 > /dev/null - else - sysctl vfs.nfsd.nfs_privport=0 > /dev/null - fi - - if checkyesno nfsv4_server_enable; then - sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null - force_depend nfsuserd || err 1 "Cannot run nfsuserd" - else - echo 'NFSv4 is disabled' - sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null - fi + if checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null + force_depend nfsuserd || err 1 "Cannot run nfsuserd" + else + echo 'NFSv4 is disabled' + sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null fi force_depend rpcbind || return 1 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sat Apr 18 16:04:32 2015 (r281690) +++ head/sbin/mount/mount.8 Sat Apr 18 16:08:06 2015 (r281691) @@ -457,7 +457,6 @@ However, for the following file system t .Cm msdosfs , .Cm nfs , .Cm nullfs , -.Cm oldnfs , .Cm smbfs , .Cm udf , and Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sat Apr 18 16:04:32 2015 (r281690) +++ head/sbin/mount/mount.c Sat Apr 18 16:08:06 2015 (r281691) @@ -144,7 +144,7 @@ use_mountprog(const char *vfstype) unsigned int i; const char *fs[] = { "cd9660", "mfs", "msdosfs", "nfs", - "nullfs", "oldnfs", "smbfs", "udf", "unionfs", + "nullfs", "smbfs", "udf", "unionfs", NULL }; Modified: head/sbin/mount_nfs/Makefile ============================================================================== --- head/sbin/mount_nfs/Makefile Sat Apr 18 16:04:32 2015 (r281690) +++ head/sbin/mount_nfs/Makefile Sat Apr 18 16:08:06 2015 (r281691) @@ -5,14 +5,11 @@ PROG= mount_nfs SRCS= mount_nfs.c getmntopts.c mounttab.c MAN= mount_nfs.8 -MLINKS= mount_nfs.8 mount_oldnfs.8 MOUNT= ${.CURDIR}/../mount UMNTALL= ${.CURDIR}/../../usr.sbin/rpc.umntall CFLAGS+= -DNFS -I${MOUNT} -I${UMNTALL} -LINKS= ${BINDIR}/mount_nfs ${BINDIR}/mount_oldnfs - .PATH: ${MOUNT} ${UMNTALL} .include Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Sat Apr 18 16:04:32 2015 (r281690) +++ head/sbin/mount_nfs/mount_nfs.8 Sat Apr 18 16:08:06 2015 (r281691) @@ -63,12 +63,6 @@ It implements the mount protocol as desc .%T "NFS: Network File System Version 3 Protocol Specification" , Appendix I. .Pp -If the file system type is specified as ``oldnfs'', which implies this -command is run as ``mount_oldnfs'', then it forces use of the old NFS -client, which does not support the -.Cm nfsv4 -option. -.Pp By default, .Nm keeps retrying until the mount succeeds. Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Apr 18 16:04:32 2015 (r281690) +++ head/share/man/man5/rc.conf.5 Sat Apr 18 16:08:06 2015 (r281691) @@ -2294,14 +2294,6 @@ is set to these are the flags to pass to the .Xr nfscbd 8 daemon. -.It Va oldnfs_server_enable -.Pq Vt bool -If -.Va oldnfs_server_enable -is set to -.Dq Li YES , -force the NFS server daemons to run the old NFS server code -that does not support NFSv4. .It Va mountd_enable .Pq Vt bool If set to Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Sat Apr 18 16:04:32 2015 (r281690) +++ head/sys/nfsclient/nfs.h Sat Apr 18 16:08:06 2015 (r281691) @@ -114,10 +114,7 @@ #ifdef _KERNEL #ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_NFSREQ); MALLOC_DECLARE(M_NFSDIROFF); -MALLOC_DECLARE(M_NFSBIGFH); -MALLOC_DECLARE(M_NFSHASH); MALLOC_DECLARE(M_NFSDIRECTIO); #endif Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sat Apr 18 16:04:32 2015 (r281690) +++ head/usr.bin/nfsstat/nfsstat.c Sat Apr 18 16:08:06 2015 (r281691) @@ -245,13 +245,6 @@ readstats(struct nfsstats **stp, struct } else { if (zero) bzero(&zerostat, sizeof(zerostat)); - buflen = sizeof(struct nfsstats); - if (*stp != NULL && sysctlbyname("vfs.oldnfs.nfsstats", *stp, - &buflen, zero ? &zerostat : NULL, zero ? buflen : 0) < 0) { - if (errno != ENOENT) - err(1, "sysctl: vfs.oldnfs.nfsstats"); - *stp = NULL; - } buflen = sizeof(struct nfsrvstats); if (*srvstp != NULL && sysctlbyname("vfs.nfsrv.nfsrvstats", *srvstp, &buflen, zero ? &zerostat : NULL, Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Sat Apr 18 16:04:32 2015 (r281690) +++ head/usr.sbin/nfsd/nfsd.8 Sat Apr 18 16:08:06 2015 (r281691) @@ -112,11 +112,10 @@ Serve .Tn UDP NFS clients. .It Fl e -The new NFS server that includes NFSv4 support is now the default, so this -option is now a no-op and should be considered deprecated. +Enable NFSv4 support. +It is enabled by default; this option should be considered deprecated. .It Fl o -Forces the use of the old NFS server that does not include NFSv4 support -in it. +Disable NFSv4 support. .El .Pp For example, From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 16:38:47 2015 Return-Path: Delivered-To: svn-src-all@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 E6810DAC; Sat, 18 Apr 2015 16:38: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 C75CF2DD; Sat, 18 Apr 2015 16:38: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 t3IGckpD037494; Sat, 18 Apr 2015 16:38:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IGckQo037483; Sat, 18 Apr 2015 16:38:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201504181638.t3IGckQo037483@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 18 Apr 2015 16:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281692 - in head/sys: conf netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:38:47 -0000 Author: ae Date: Sat Apr 18 16:38:45 2015 New Revision: 281692 URL: https://svnweb.freebsd.org/changeset/base/281692 Log: Remove xform_ipip.c and code related to XF_IP4. The only thing is used from this code is ipip_output() function, that does IPIP encapsulation. Other parts of XF_IP4 code were removed in r275133. Also it isn't possible to configure the use of XF_IP4, nor from userland via setkey(8), nor from the kernel. Simplify the ipip_output() function and rename it to ipsec_encap(). * move IP_DF handling from ipsec4_process_packet() into ipsec_encap(); * since ipsec_encap() called from ipsec[64]_process_packet(), it is safe to assume that mbuf is contiguous at least to IP header for used IP version. Remove all unneeded m_pullup(), m_copydata and related checks. * use V_ip_defttl and V_ip6_defhlim for outer headers; * use V_ip4_ipsec_ecn and V_ip6_ipsec_ecn for outer headers; * move all diagnostic messages to the ipsec_encap() callers; * simplify handling of ipsec_encap() results: if it returns non zero value, print diagnostic message and free mbuf. * some style(9) fixes. Differential Revision: https://reviews.freebsd.org/D2303 Reviewed by: glebius Sponsored by: Yandex LLC Deleted: head/sys/netipsec/xform_ipip.c Modified: head/sys/conf/files head/sys/netipsec/ipsec_output.c head/sys/netipsec/xform.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Apr 18 16:08:06 2015 (r281691) +++ head/sys/conf/files Sat Apr 18 16:38:45 2015 (r281692) @@ -3565,7 +3565,6 @@ netipsec/keysock.c optional ipsec inet netipsec/xform_ah.c optional ipsec inet | ipsec inet6 netipsec/xform_esp.c optional ipsec inet | ipsec inet6 netipsec/xform_ipcomp.c optional ipsec inet | ipsec inet6 -netipsec/xform_ipip.c optional ipsec inet | ipsec inet6 netipsec/xform_tcp.c optional ipsec inet tcp_signature | \ ipsec inet6 tcp_signature netnatm/natm.c optional natm Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Sat Apr 18 16:08:06 2015 (r281691) +++ head/sys/netipsec/ipsec_output.c Sat Apr 18 16:38:45 2015 (r281692) @@ -61,6 +61,7 @@ #include #ifdef INET6 #include +#include #endif #include #ifdef INET6 @@ -419,6 +420,101 @@ bad: #undef IPSEC_OSTAT } +static int +ipsec_encap(struct mbuf **mp, struct secasindex *saidx) +{ +#ifdef INET6 + struct ip6_hdr *ip6; +#endif + struct ip *ip; + int setdf; + uint8_t itos, proto; + + ip = mtod(*mp, struct ip *); + switch (ip->ip_v) { +#ifdef INET + case IPVERSION: + proto = IPPROTO_IPIP; + /* + * Collect IP_DF state from the inner header + * and honor system-wide control of how to handle it. + */ + switch (V_ip4_ipsec_dfbit) { + case 0: /* clear in outer header */ + case 1: /* set in outer header */ + setdf = V_ip4_ipsec_dfbit; + break; + default:/* propagate to outer header */ + setdf = (ip->ip_off & ntohs(IP_DF)) != 0; + } + itos = ip->ip_tos; + break; +#endif +#ifdef INET6 + case (IPV6_VERSION >> 4): + proto = IPPROTO_IPV6; + ip6 = mtod(*mp, struct ip6_hdr *); + itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + setdf = V_ip4_ipsec_dfbit ? 1: 0; + /* scoped address handling */ + in6_clearscope(&ip6->ip6_src); + in6_clearscope(&ip6->ip6_dst); + break; +#endif + default: + return (EAFNOSUPPORT); + } + switch (saidx->dst.sa.sa_family) { +#ifdef INET + case AF_INET: + if (saidx->src.sa.sa_family != AF_INET || + saidx->src.sin.sin_addr.s_addr == INADDR_ANY || + saidx->dst.sin.sin_addr.s_addr == INADDR_ANY) + return (EINVAL); + M_PREPEND(*mp, sizeof(struct ip), M_NOWAIT); + if (*mp == NULL) + return (ENOBUFS); + ip = mtod(*mp, struct ip *); + ip->ip_v = IPVERSION; + ip->ip_hl = sizeof(struct ip) >> 2; + ip->ip_p = proto; + ip->ip_len = htons((*mp)->m_pkthdr.len); + ip->ip_ttl = V_ip_defttl; + ip->ip_sum = 0; + ip->ip_off = setdf ? htons(IP_DF): 0; + ip->ip_src = saidx->src.sin.sin_addr; + ip->ip_dst = saidx->dst.sin.sin_addr; + ip_ecn_ingress(V_ip4_ipsec_ecn, &ip->ip_tos, &itos); + ip_fillid(ip); + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + if (saidx->src.sa.sa_family != AF_INET6 || + IN6_IS_ADDR_UNSPECIFIED(&saidx->src.sin6.sin6_addr) || + IN6_IS_ADDR_UNSPECIFIED(&saidx->dst.sin6.sin6_addr)) + return (EINVAL); + M_PREPEND(*mp, sizeof(struct ip6_hdr), M_NOWAIT); + if (*mp == NULL) + return (ENOBUFS); + ip6 = mtod(*mp, struct ip6_hdr *); + ip6->ip6_flow = 0; + ip6->ip6_vfc = IPV6_VERSION; + ip6->ip6_hlim = V_ip6_defhlim; + ip6->ip6_nxt = proto; + ip6->ip6_dst = saidx->dst.sin6.sin6_addr; + ip6->ip6_src = saidx->src.sin6.sin6_addr; + ip6->ip6_plen = htons((*mp)->m_pkthdr.len - sizeof(*ip6)); + ip_ecn_ingress(V_ip6_ipsec_ecn, &proto, &itos); + ip6->ip6_flow |= htonl((uint32_t)proto << 20); + break; +#endif /* INET6 */ + default: + return (EAFNOSUPPORT); + } + return (0); +} + #ifdef INET /* * IPsec output logic for IPv4. @@ -430,7 +526,7 @@ ipsec4_process_packet(struct mbuf *m, st struct secasindex saidx; struct secasvar *sav; struct ip *ip; - int error, i, off, setdf; + int error, i, off; IPSEC_ASSERT(m != NULL, ("null mbuf")); IPSEC_ASSERT(isr != NULL, ("null isr")); @@ -465,53 +561,23 @@ ipsec4_process_packet(struct mbuf *m, st /* Do the appropriate encapsulation, if necessary */ if (isr->saidx.mode == IPSEC_MODE_TUNNEL || /* Tunnel requ'd */ dst->sa.sa_family != AF_INET || /* PF mismatch */ -#if 0 - (sav->flags & SADB_X_SAFLAGS_TUNNEL) || /* Tunnel requ'd */ - sav->tdb_xform->xf_type == XF_IP4 || /* ditto */ -#endif (dst->sa.sa_family == AF_INET && /* Proxy */ dst->sin.sin_addr.s_addr != INADDR_ANY && dst->sin.sin_addr.s_addr != ip->ip_dst.s_addr)) { - struct mbuf *mp; - /* Fix IPv4 header checksum and length */ ip->ip_len = htons(m->m_pkthdr.len); ip->ip_sum = 0; ip->ip_sum = in_cksum(m, ip->ip_hl << 2); - /* - * Collect IP_DF state from the outer header - * and honor system-wide control of how to handle it. - */ - switch (V_ip4_ipsec_dfbit) { - case 0: /* clear in outer header */ - case 1: /* set in outer header */ - setdf = V_ip4_ipsec_dfbit; - break; - default: /* propagate to outer header */ - setdf = ntohs(ip->ip_off & IP_DF); - } - /* Encapsulate the packet */ - error = ipip_output(m, isr, &mp, 0, 0); + error = ipsec_encap(&m, &sav->sah->saidx); if (error != 0) { - m = NULL; /* ipip_output() already freed it */ + DPRINTF(("%s: encapsulation for SA %s->%s " + "SPI 0x%08x failed with error %d\n", __func__, + ipsec_address(&sav->sah->saidx.src), + ipsec_address(&sav->sah->saidx.dst), + ntohl(sav->spi), error)); goto bad; } - m = mp; - /* - * ipip_output clears IP_DF in the new header. If - * we need to propagate IP_DF from the outer header, - * then we have to do it here. - * - * XXX shouldn't assume what ipip_output does. - */ - if (dst->sa.sa_family == AF_INET && setdf) { - ip = mtod(m, struct ip *); - ip->ip_off = ntohs(ip->ip_off); - ip->ip_off |= IP_DF; - ip->ip_off = htons(ip->ip_off); - } } - #ifdef DEV_ENC /* pass the mbuf to enc0 for bpf processing */ ipsec_bpf(m, sav, sav->sah->saidx.dst.sa.sa_family, ENC_OUT|ENC_AFTER); @@ -523,40 +589,33 @@ ipsec4_process_packet(struct mbuf *m, st /* * Dispatch to the appropriate IPsec transform logic. The * packet will be returned for transmission after crypto - * processing, etc. are completed. For encapsulation we - * bypass this call because of the explicit call done above - * (necessary to deal with IP_DF handling for IPv4). + * processing, etc. are completed. * * NB: m & sav are ``passed to caller'' who's reponsible for * for reclaiming their resources. */ - if (sav->tdb_xform->xf_type != XF_IP4) { - union sockaddr_union *dst = &sav->sah->saidx.dst; - switch(dst->sa.sa_family) { - case AF_INET: - ip = mtod(m, struct ip *); - i = ip->ip_hl << 2; - off = offsetof(struct ip, ip_p); - break; + switch(dst->sa.sa_family) { + case AF_INET: + ip = mtod(m, struct ip *); + i = ip->ip_hl << 2; + off = offsetof(struct ip, ip_p); + break; #ifdef INET6 - case AF_INET6: - i = sizeof(struct ip6_hdr); - off = offsetof(struct ip6_hdr, ip6_nxt); - break; + case AF_INET6: + i = sizeof(struct ip6_hdr); + off = offsetof(struct ip6_hdr, ip6_nxt); + break; #endif /* INET6 */ - default: + default: DPRINTF(("%s: unsupported protocol family %u\n", - __func__, dst->sa.sa_family)); - error = EPFNOSUPPORT; - IPSECSTAT_INC(ips_out_inval); - goto bad; - } - error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); - } else { - error = ipsec_process_done(m, isr); + __func__, dst->sa.sa_family)); + error = EPFNOSUPPORT; + IPSECSTAT_INC(ips_out_inval); + goto bad; } + error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); IPSECREQUEST_UNLOCK(isr); - return error; + return (error); bad: if (isr) IPSECREQUEST_UNLOCK(isr); @@ -606,7 +665,6 @@ ipsec6_process_packet( goto bad; return EJUSTRETURN; } - sav = isr->sav; dst = &sav->sah->saidx.dst; @@ -630,42 +688,20 @@ ipsec6_process_packet( (!IN6_IS_ADDR_UNSPECIFIED(&dst->sin6.sin6_addr)) && (!in6_sa_equal_addrwithscope(&dst->sin6, &ip6->ip6_dst)))) { - struct mbuf *mp; - - /* Fix IPv6 header payload length. */ - if (m->m_len < sizeof(struct ip6_hdr)) - if ((m = m_pullup(m,sizeof(struct ip6_hdr))) == NULL) { - error = ENOBUFS; - goto bad; - } - if (m->m_pkthdr.len - sizeof(*ip6) > IPV6_MAXPACKET) { /* No jumbogram support. */ error = ENXIO; /*XXX*/ goto bad; } - - /* Encapsulate the packet */ - error = ipip_output(m, isr, &mp, 0, 0); - if (mp == NULL && !error) { - /* Should never happen. */ - DPRINTF(("ipsec6_process_packet: ipip_output " - "returns no mbuf and no error!")); - error = EFAULT; - goto bad; - } - - if (error) { - if (mp) { - /* XXX: Should never happen! */ - m_freem(mp); - } - m = NULL; /* ipip_output() already freed it */ + error = ipsec_encap(&m, &sav->sah->saidx); + if (error != 0) { + DPRINTF(("%s: encapsulation for SA %s->%s " + "SPI 0x%08x failed with error %d\n", __func__, + ipsec_address(&sav->sah->saidx.src), + ipsec_address(&sav->sah->saidx.dst), + ntohl(sav->spi), error)); goto bad; } - - m = mp; - mp = NULL; } #ifdef DEV_ENC Modified: head/sys/netipsec/xform.h ============================================================================== --- head/sys/netipsec/xform.h Sat Apr 18 16:08:06 2015 (r281691) +++ head/sys/netipsec/xform.h Sat Apr 18 16:38:45 2015 (r281692) @@ -83,7 +83,7 @@ struct ipescrequest; struct xformsw { u_short xf_type; /* xform ID */ -#define XF_IP4 1 /* IP inside IP */ +#define XF_IP4 1 /* unused */ #define XF_AH 2 /* AH */ #define XF_ESP 3 /* ESP */ #define XF_TCPSIGNATURE 5 /* TCP MD5 Signature option, RFC 2358 */ @@ -108,10 +108,6 @@ extern int xform_init(struct secasvar *s struct cryptoini; -/* XF_IP4 */ -extern int ipip_output(struct mbuf *, struct ipsecrequest *, - struct mbuf **, int, int); - /* XF_AH */ extern int ah_init0(struct secasvar *, struct xformsw *, struct cryptoini *); extern int ah_zeroize(struct secasvar *sav); From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 16:46:32 2015 Return-Path: Delivered-To: svn-src-all@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 9D4B7CF; Sat, 18 Apr 2015 16:46:32 +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 8B62A3D7; Sat, 18 Apr 2015 16:46:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IGkWus044390; Sat, 18 Apr 2015 16:46:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IGkVLY044384; Sat, 18 Apr 2015 16:46:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201504181646.t3IGkVLY044384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 18 Apr 2015 16:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281693 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:46:32 -0000 Author: ae Date: Sat Apr 18 16:46:31 2015 New Revision: 281693 URL: https://svnweb.freebsd.org/changeset/base/281693 Log: Fix handling of scoped IPv6 addresses in IPSec code. * in ipsec_encap() embed scope zone ids into link-local addresses in the new IPv6 header, this helps ip6_output() disambiguate the scope; * teach key_ismyaddr6() use in6_localip(). in6_localip() is less strict than key_sockaddrcmp(). It doesn't compare all fileds of struct sockaddr_in6, but it is faster and it should be safe, because all SA's data was checked for correctness. Also, since IPv6 link-local addresses in the &V_in6_ifaddrhead are stored in kernel-internal form, we need to embed scope zone id from SA into the address before calling in6_localip. * in ipsec_common_input() take scope zone id embedded in the address and use it to initialize sin6_scope_id, then use this sockaddr structure to lookup SA, because we keep addresses in the SADB without embedded scope zone id. Differential Revision: https://reviews.freebsd.org/D2304 Reviewed by: gnn Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Sat Apr 18 16:38:45 2015 (r281692) +++ head/sys/netipsec/ipsec_input.c Sat Apr 18 16:46:31 2015 (r281693) @@ -195,6 +195,13 @@ ipsec_common_input(struct mbuf *m, int s m_copydata(m, offsetof(struct ip6_hdr, ip6_dst), sizeof(struct in6_addr), (caddr_t) &dst_address.sin6.sin6_addr); + /* We keep addresses in SADB without embedded scope id */ + if (IN6_IS_SCOPE_LINKLOCAL(&dst_address.sin6.sin6_addr)) { + /* XXX: sa6_recoverscope() */ + dst_address.sin6.sin6_scope_id = + ntohs(dst_address.sin6.sin6_addr.s6_addr16[1]); + dst_address.sin6.sin6_addr.s6_addr16[1] = 0; + } break; #endif /* INET6 */ default: Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Sat Apr 18 16:38:45 2015 (r281692) +++ head/sys/netipsec/ipsec_output.c Sat Apr 18 16:46:31 2015 (r281693) @@ -503,7 +503,14 @@ ipsec_encap(struct mbuf **mp, struct sec ip6->ip6_hlim = V_ip6_defhlim; ip6->ip6_nxt = proto; ip6->ip6_dst = saidx->dst.sin6.sin6_addr; + /* For link-local address embed scope zone id */ + if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) + ip6->ip6_dst.s6_addr16[1] = + htons(saidx->dst.sin6.sin6_scope_id & 0xffff); ip6->ip6_src = saidx->src.sin6.sin6_addr; + if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src)) + ip6->ip6_src.s6_addr16[1] = + htons(saidx->src.sin6.sin6_scope_id & 0xffff); ip6->ip6_plen = htons((*mp)->m_pkthdr.len - sizeof(*ip6)); ip_ecn_ingress(V_ip6_ipsec_ecn, &proto, &itos); ip6->ip6_flow |= htonl((uint32_t)proto << 20); Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sat Apr 18 16:38:45 2015 (r281692) +++ head/sys/netipsec/key.c Sat Apr 18 16:46:31 2015 (r281693) @@ -3856,48 +3856,19 @@ key_ismyaddr(struct sockaddr *sa) * compare my own address for IPv6. * 1: ours * 0: other - * NOTE: derived ip6_input() in KAME. This is necessary to modify more. */ -#include - static int key_ismyaddr6(struct sockaddr_in6 *sin6) { - struct in6_ifaddr *ia; -#if 0 - struct in6_multi *in6m; -#endif - - IN6_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - if (key_sockaddrcmp((struct sockaddr *)sin6, - (struct sockaddr *)&ia->ia_addr, 0) == 0) { - IN6_IFADDR_RUNLOCK(); - return 1; - } - -#if 0 - /* - * XXX Multicast - * XXX why do we care about multlicast here while we don't care - * about IPv4 multicast?? - * XXX scope - */ - in6m = NULL; - IN6_LOOKUP_MULTI(sin6->sin6_addr, ia->ia_ifp, in6m); - if (in6m) { - IN6_IFADDR_RUNLOCK(); - return 1; - } -#endif - } - IN6_IFADDR_RUNLOCK(); + struct in6_addr in6; - /* loopback, just for safety */ - if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) - return 1; + if (!IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) + return (in6_localip(&sin6->sin6_addr)); - return 0; + /* Convert address into kernel-internal form */ + in6 = sin6->sin6_addr; + in6.s6_addr16[1] = htons(sin6->sin6_scope_id & 0xffff); + return (in6_localip(&in6)); } #endif /*INET6*/ From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 16:51:25 2015 Return-Path: Delivered-To: svn-src-all@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 695134CA; Sat, 18 Apr 2015 16:51:25 +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 3DC34604; Sat, 18 Apr 2015 16:51:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IGpPJK049825; Sat, 18 Apr 2015 16:51:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IGpP0K049823; Sat, 18 Apr 2015 16:51:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201504181651.t3IGpP0K049823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 18 Apr 2015 16:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281694 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:51:25 -0000 Author: ae Date: Sat Apr 18 16:51:24 2015 New Revision: 281694 URL: https://svnweb.freebsd.org/changeset/base/281694 Log: Requeue mbuf via netisr when we use IPSec tunnel mode and IPv6. ipsec6_common_input_cb() uses partial copy of ip6_input() to parse headers. But this isn't correct, when we use tunnel mode IPSec. When we stripped outer IPv6 header from the decrypted packet, it can become IPv4 packet and should be handled by ip_input. Also when we use tunnel mode IPSec with IPv6 traffic, we should pass decrypted packet with inner IPv6 header to ip6_input, it will correctly handle it and also can decide to forward it. The "skip" variable points to offset where payload starts. In tunnel mode we reset it to zero after stripping the outer header. So, when it is zero, we should requeue mbuf via netisr. Differential Revision: https://reviews.freebsd.org/D2306 Reviewed by: adrian, gnn Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Sat Apr 18 16:46:31 2015 (r281693) +++ head/sys/netipsec/ipsec_input.c Sat Apr 18 16:51:24 2015 (r281694) @@ -627,7 +627,7 @@ ipsec6_common_input_cb(struct mbuf *m, s struct m_tag *mtag; struct tdb_ident *tdbi; struct secasindex *saidx; - int nxt; + int nxt, isr_prot; u_int8_t nxt8; int error, nest; #ifdef notyet @@ -803,6 +803,35 @@ ipsec6_common_input_cb(struct mbuf *m, s if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) return (error); #endif /* DEV_ENC */ + if (skip == 0) { + /* + * We stripped outer IPv6 header. + * Now we should requeue decrypted packet via netisr. + */ + switch (prot) { +#ifdef INET + case IPPROTO_IPIP: + isr_prot = NETISR_IP; + break; +#endif + case IPPROTO_IPV6: + isr_prot = NETISR_IPV6; + break; + default: + DPRINTF(("%s: cannot handle inner ip proto %d\n", + __func__, prot)); + IPSEC_ISTAT(sproto, nopf); + error = EPFNOSUPPORT; + goto bad; + } + error = netisr_queue_src(isr_prot, (uintptr_t)sav->spi, m); + if (error) { + IPSEC_ISTAT(sproto, qfull); + DPRINTF(("%s: queue full; proto %u packet dropped\n", + __func__, sproto)); + } + return (error); + } /* * See the end of ip6_input for this logic. * IPPROTO_IPV[46] case will be processed just like other ones From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 16:58:36 2015 Return-Path: Delivered-To: svn-src-all@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 5BB49677; Sat, 18 Apr 2015 16:58: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 48D046E2; Sat, 18 Apr 2015 16:58: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 t3IGwaFt053370; Sat, 18 Apr 2015 16:58:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IGwY8I053350; Sat, 18 Apr 2015 16:58:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201504181658.t3IGwY8I053350@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 18 Apr 2015 16:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281695 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 16:58:36 -0000 Author: ae Date: Sat Apr 18 16:58:33 2015 New Revision: 281695 URL: https://svnweb.freebsd.org/changeset/base/281695 Log: Change ipsec_address() and ipsec_logsastr() functions to take two additional arguments - buffer and size of this buffer. ipsec_address() is used to convert sockaddr structure to presentation format. The IPv6 part of this function returns pointer to the on-stack buffer and at the moment when it will be used by caller, it becames invalid. IPv4 version uses 4 static buffers and returns pointer to new buffer each time when it called. But anyway it is still possible to get corrupted data when several threads will use this function. ipsec_logsastr() is used to format string about SA entry. It also uses static buffer and has the same problem with concurrent threads. To fix these problems add the buffer pointer and size of this buffer to arguments. Now each caller will pass buffer and its size to these functions. Also convert all places where these functions are used (except disabled code). And now ipsec_address() uses inet_ntop() function from libkern. PR: 185996 Differential Revision: https://reviews.freebsd.org/D2321 Reviewed by: gnn Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/ipsec.c Sat Apr 18 16:58:33 2015 (r281695) @@ -1488,6 +1488,7 @@ ipsec_chkreplay(u_int32_t seq, struct se int ipsec_updatereplay(u_int32_t seq, struct secasvar *sav) { + char buf[128]; struct secreplay *replay; u_int32_t diff; int fr; @@ -1567,7 +1568,8 @@ ok: return (1); ipseclog((LOG_WARNING, "%s: replay counter made %d cycle. %s\n", - __func__, replay->overflow, ipsec_logsastr(sav))); + __func__, replay->overflow, + ipsec_logsastr(sav, buf, sizeof(buf)))); } replay->count++; @@ -1598,67 +1600,37 @@ vshiftl(unsigned char *bitmap, int nbit, } } -#ifdef INET -/* Return a printable string for the IPv4 address. */ -static char * -inet_ntoa4(struct in_addr ina) -{ - static char buf[4][4 * sizeof "123" + 4]; - unsigned char *ucp = (unsigned char *) &ina; - static int i = 3; - - /* XXX-BZ Returns static buffer. */ - i = (i + 1) % 4; - sprintf(buf[i], "%d.%d.%d.%d", ucp[0] & 0xff, ucp[1] & 0xff, - ucp[2] & 0xff, ucp[3] & 0xff); - return (buf[i]); -} -#endif - /* Return a printable string for the address. */ -char * -ipsec_address(union sockaddr_union* sa) +char* +ipsec_address(union sockaddr_union* sa, char *buf, socklen_t size) { -#ifdef INET6 - char ip6buf[INET6_ADDRSTRLEN]; -#endif switch (sa->sa.sa_family) { #ifdef INET case AF_INET: - return (inet_ntoa4(sa->sin.sin_addr)); + return (inet_ntop(AF_INET, &sa->sin.sin_addr, buf, size)); #endif /* INET */ #ifdef INET6 case AF_INET6: - return (ip6_sprintf(ip6buf, &sa->sin6.sin6_addr)); + return (inet_ntop(AF_INET6, &sa->sin6.sin6_addr, buf, size)); #endif /* INET6 */ default: return ("(unknown address family)"); } } -const char * -ipsec_logsastr(struct secasvar *sav) +char * +ipsec_logsastr(struct secasvar *sav, char *buf, size_t size) { - static char buf[256]; - char *p; - struct secasindex *saidx = &sav->sah->saidx; - - IPSEC_ASSERT(saidx->src.sa.sa_family == saidx->dst.sa.sa_family, - ("address family mismatch")); - - p = buf; - snprintf(buf, sizeof(buf), "SA(SPI=%u ", (u_int32_t)ntohl(sav->spi)); - while (p && *p) - p++; - /* NB: only use ipsec_address on one address at a time. */ - snprintf(p, sizeof (buf) - (p - buf), "src=%s ", - ipsec_address(&saidx->src)); - while (p && *p) - p++; - snprintf(p, sizeof (buf) - (p - buf), "dst=%s)", - ipsec_address(&saidx->dst)); + char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN]; + + IPSEC_ASSERT(sav->sah->saidx.src.sa.sa_family == + sav->sah->saidx.dst.sa.sa_family, ("address family mismatch")); + snprintf(buf, size, "SA(SPI=%08lx src=%s dst=%s)", + (u_long)ntohl(sav->spi), + ipsec_address(&sav->sah->saidx.src, sbuf, sizeof(sbuf)), + ipsec_address(&sav->sah->saidx.dst, dbuf, sizeof(dbuf))); return (buf); } Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/ipsec.h Sat Apr 18 16:58:33 2015 (r281695) @@ -327,8 +327,8 @@ extern size_t ipsec_hdrsiz(struct mbuf * extern size_t ipsec_hdrsiz_tcp(struct tcpcb *); union sockaddr_union; -extern char * ipsec_address(union sockaddr_union* sa); -extern const char *ipsec_logsastr(struct secasvar *); +extern char *ipsec_address(union sockaddr_union *, char *, socklen_t); +extern char *ipsec_logsastr(struct secasvar *, char *, size_t); extern void ipsec_dumpmbuf(struct mbuf *); Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/ipsec_input.c Sat Apr 18 16:58:33 2015 (r281695) @@ -121,6 +121,7 @@ static void ipsec4_common_ctlinput(int, static int ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) { + char buf[INET6_ADDRSTRLEN]; union sockaddr_union dst_address; struct secasvar *sav; u_int32_t spi; @@ -215,8 +216,8 @@ ipsec_common_input(struct mbuf *m, int s sav = KEY_ALLOCSA(&dst_address, sproto, spi); if (sav == NULL) { DPRINTF(("%s: no key association found for SA %s/%08lx/%u\n", - __func__, ipsec_address(&dst_address), - (u_long) ntohl(spi), sproto)); + __func__, ipsec_address(&dst_address, buf, sizeof(buf)), + (u_long) ntohl(spi), sproto)); IPSEC_ISTAT(sproto, notdb); m_freem(m); return ENOENT; @@ -224,8 +225,8 @@ ipsec_common_input(struct mbuf *m, int s if (sav->tdb_xform == NULL) { DPRINTF(("%s: attempted to use uninitialized SA %s/%08lx/%u\n", - __func__, ipsec_address(&dst_address), - (u_long) ntohl(spi), sproto)); + __func__, ipsec_address(&dst_address, buf, sizeof(buf)), + (u_long) ntohl(spi), sproto)); IPSEC_ISTAT(sproto, noxform); KEY_FREESAV(&sav); m_freem(m); @@ -327,6 +328,7 @@ int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { + char buf[INET6_ADDRSTRLEN]; int prot, af, sproto, isr_prot; struct ip *ip; struct m_tag *mtag; @@ -365,8 +367,8 @@ ipsec4_common_input_cb(struct mbuf *m, s */ if (m->m_len < skip && (m = m_pullup(m, skip)) == NULL) { DPRINTF(("%s: processing failed for SA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + __func__, ipsec_address(&sav->sah->saidx.dst, + buf, sizeof(buf)), (u_long) ntohl(sav->spi))); IPSEC_ISTAT(sproto, hdrops); error = ENOBUFS; goto bad; @@ -622,6 +624,7 @@ int ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { + char buf[INET6_ADDRSTRLEN]; int prot, af, sproto; struct ip6_hdr *ip6; struct m_tag *mtag; @@ -658,8 +661,8 @@ ipsec6_common_input_cb(struct mbuf *m, s (m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { DPRINTF(("%s: processing failed for SA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + __func__, ipsec_address(&sav->sah->saidx.dst, buf, + sizeof(buf)), (u_long) ntohl(sav->spi))); IPSEC_ISTAT(sproto, hdrops); error = EACCES; Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/ipsec_output.c Sat Apr 18 16:58:33 2015 (r281695) @@ -529,6 +529,7 @@ ipsec_encap(struct mbuf **mp, struct sec int ipsec4_process_packet(struct mbuf *m, struct ipsecrequest *isr) { + char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN]; union sockaddr_union *dst; struct secasindex saidx; struct secasvar *sav; @@ -579,9 +580,10 @@ ipsec4_process_packet(struct mbuf *m, st if (error != 0) { DPRINTF(("%s: encapsulation for SA %s->%s " "SPI 0x%08x failed with error %d\n", __func__, - ipsec_address(&sav->sah->saidx.src), - ipsec_address(&sav->sah->saidx.dst), - ntohl(sav->spi), error)); + ipsec_address(&sav->sah->saidx.src, sbuf, + sizeof(sbuf)), + ipsec_address(&sav->sah->saidx.dst, dbuf, + sizeof(dbuf)), ntohl(sav->spi), error)); goto bad; } } @@ -650,11 +652,9 @@ in6_sa_equal_addrwithscope(const struct * IPsec output logic for IPv6. */ int -ipsec6_process_packet( - struct mbuf *m, - struct ipsecrequest *isr - ) +ipsec6_process_packet(struct mbuf *m, struct ipsecrequest *isr) { + char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN]; struct secasindex saidx; struct secasvar *sav; struct ip6_hdr *ip6; @@ -704,9 +704,10 @@ ipsec6_process_packet( if (error != 0) { DPRINTF(("%s: encapsulation for SA %s->%s " "SPI 0x%08x failed with error %d\n", __func__, - ipsec_address(&sav->sah->saidx.src), - ipsec_address(&sav->sah->saidx.dst), - ntohl(sav->spi), error)); + ipsec_address(&sav->sah->saidx.src, sbuf, + sizeof(sbuf)), + ipsec_address(&sav->sah->saidx.dst, dbuf, + sizeof(dbuf)), ntohl(sav->spi), error)); goto bad; } } Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/xform_ah.c Sat Apr 18 16:58:33 2015 (r281695) @@ -567,6 +567,7 @@ ah_massage_headers(struct mbuf **m0, int static int ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { + char buf[128]; struct auth_hash *ahx; struct tdb_crypto *tc; struct newah *ah; @@ -596,7 +597,7 @@ ah_input(struct mbuf *m, struct secasvar if (sav->replay && !ipsec_chkreplay(ntohl(ah->ah_seq), sav)) { AHSTAT_INC(ahs_replay); DPRINTF(("%s: packet replay failure: %s\n", __func__, - ipsec_logsastr(sav))); + ipsec_logsastr(sav, buf, sizeof(buf)))); m_freem(m); return ENOBUFS; } @@ -607,10 +608,10 @@ ah_input(struct mbuf *m, struct secasvar authsize = AUTHSIZE(sav); if (hl != authsize + rplen - sizeof (struct ah)) { DPRINTF(("%s: bad authenticator length %u (expecting %lu)" - " for packet in SA %s/%08lx\n", __func__, - hl, (u_long) (authsize + rplen - sizeof (struct ah)), - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + " for packet in SA %s/%08lx\n", __func__, hl, + (u_long) (authsize + rplen - sizeof (struct ah)), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_badauthl); m_freem(m); return EACCES; @@ -695,6 +696,7 @@ ah_input(struct mbuf *m, struct secasvar static int ah_input_cb(struct cryptop *crp) { + char buf[INET6_ADDRSTRLEN]; int rplen, error, skip, protoff; unsigned char calc[AH_ALEN_MAX]; struct mbuf *m; @@ -764,7 +766,7 @@ ah_input_cb(struct cryptop *crp) if (bcmp(ptr + skip + rplen, calc, authsize)) { DPRINTF(("%s: authentication hash mismatch for packet " "in SA %s/%08lx\n", __func__, - ipsec_address(&saidx->dst), + ipsec_address(&saidx->dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_badauth); error = EACCES; @@ -803,8 +805,8 @@ ah_input_cb(struct cryptop *crp) error = m_striphdr(m, skip, rplen + authsize); if (error) { DPRINTF(("%s: mangled mbuf chain for SA %s/%08lx\n", __func__, - ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - + ipsec_address(&saidx->dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_hdrops); goto bad; } @@ -843,13 +845,10 @@ bad: * AH output routine, called by ipsec[46]_process_packet(). */ static int -ah_output( - struct mbuf *m, - struct ipsecrequest *isr, - struct mbuf **mp, - int skip, - int protoff) +ah_output(struct mbuf *m, struct ipsecrequest *isr, struct mbuf **mp, + int skip, int protoff) { + char buf[INET6_ADDRSTRLEN]; struct secasvar *sav; struct auth_hash *ahx; struct cryptodesc *crda; @@ -887,7 +886,7 @@ ah_output( DPRINTF(("%s: unknown/unsupported protocol family %u, " "SA %s/%08lx\n", __func__, sav->sah->saidx.dst.sa.sa_family, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_nopf); error = EPFNOSUPPORT; @@ -897,7 +896,7 @@ ah_output( if (rplen + authsize + m->m_pkthdr.len > maxpacketsize) { DPRINTF(("%s: packet in SA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi), rplen + authsize + m->m_pkthdr.len, maxpacketsize)); AHSTAT_INC(ahs_toobig); @@ -911,7 +910,7 @@ ah_output( m = m_unshare(m, M_NOWAIT); if (m == NULL) { DPRINTF(("%s: cannot clone mbuf chain, SA %s/%08lx\n", __func__, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_hdrops); error = ENOBUFS; @@ -924,7 +923,7 @@ ah_output( DPRINTF(("%s: failed to inject %u byte AH header for SA " "%s/%08lx\n", __func__, rplen + authsize, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_hdrops); /*XXX differs from openbsd */ error = ENOBUFS; @@ -951,9 +950,8 @@ ah_output( if (sav->replay->count == ~0 && (sav->flags & SADB_X_EXT_CYCSEQ) == 0) { DPRINTF(("%s: replay counter wrapped for SA %s/%08lx\n", - __func__, - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + __func__, ipsec_address(&sav->sah->saidx.dst, buf, + sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_wrap); error = EINVAL; goto bad; Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/xform_esp.c Sat Apr 18 16:58:33 2015 (r281695) @@ -268,6 +268,7 @@ esp_zeroize(struct secasvar *sav) static int esp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) { + char buf[128]; struct auth_hash *esph; struct enc_xform *espx; struct tdb_crypto *tc; @@ -326,9 +327,8 @@ esp_input(struct mbuf *m, struct secasva if ((plen & (espx->blocksize - 1)) || (plen <= 0)) { DPRINTF(("%s: payload of %d octets not a multiple of %d octets," " SA %s/%08lx\n", __func__, - plen, espx->blocksize, - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + plen, espx->blocksize, ipsec_address(&sav->sah->saidx.dst, + buf, sizeof(buf)), (u_long) ntohl(sav->spi))); ESPSTAT_INC(esps_badilen); m_freem(m); return EINVAL; @@ -340,7 +340,7 @@ esp_input(struct mbuf *m, struct secasva if (esph != NULL && sav->replay != NULL && !ipsec_chkreplay(ntohl(esp->esp_seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, - ipsec_logsastr(sav))); /*XXX*/ + ipsec_logsastr(sav, buf, sizeof(buf)))); /*XXX*/ ESPSTAT_INC(esps_replay); m_freem(m); return ENOBUFS; /*XXX*/ @@ -431,6 +431,7 @@ esp_input(struct mbuf *m, struct secasva static int esp_input_cb(struct cryptop *crp) { + char buf[128]; u_int8_t lastthree[3], aalg[AH_HMAC_MAXHASHLEN]; int hlen, skip, protoff, error, alen; struct mbuf *m; @@ -507,7 +508,7 @@ esp_input_cb(struct cryptop *crp) if (bcmp(ptr, aalg, alen) != 0) { DPRINTF(("%s: authentication hash mismatch for " "packet in SA %s/%08lx\n", __func__, - ipsec_address(&saidx->dst), + ipsec_address(&saidx->dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); ESPSTAT_INC(esps_badauth); error = EACCES; @@ -537,7 +538,7 @@ esp_input_cb(struct cryptop *crp) sizeof (seq), (caddr_t) &seq); if (ipsec_updatereplay(ntohl(seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, - ipsec_logsastr(sav))); + ipsec_logsastr(sav, buf, sizeof(buf)))); ESPSTAT_INC(esps_replay); error = ENOBUFS; goto bad; @@ -555,7 +556,7 @@ esp_input_cb(struct cryptop *crp) if (error) { ESPSTAT_INC(esps_hdrops); DPRINTF(("%s: bad mbuf chain, SA %s/%08lx\n", __func__, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); goto bad; } @@ -567,10 +568,10 @@ esp_input_cb(struct cryptop *crp) if (lastthree[1] + 2 > m->m_pkthdr.len - skip) { ESPSTAT_INC(esps_badilen); DPRINTF(("%s: invalid padding length %d for %u byte packet " - "in SA %s/%08lx\n", __func__, - lastthree[1], m->m_pkthdr.len - skip, - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + "in SA %s/%08lx\n", __func__, lastthree[1], + m->m_pkthdr.len - skip, + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); error = EINVAL; goto bad; } @@ -580,9 +581,9 @@ esp_input_cb(struct cryptop *crp) if (lastthree[1] != lastthree[0] && lastthree[1] != 0) { ESPSTAT_INC(esps_badenc); DPRINTF(("%s: decryption failed for packet in " - "SA %s/%08lx\n", __func__, - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + "SA %s/%08lx\n", __func__, ipsec_address( + &sav->sah->saidx.dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); error = EINVAL; goto bad; } @@ -628,14 +629,10 @@ bad: * ESP output routine, called by ipsec[46]_process_packet(). */ static int -esp_output( - struct mbuf *m, - struct ipsecrequest *isr, - struct mbuf **mp, - int skip, - int protoff -) +esp_output(struct mbuf *m, struct ipsecrequest *isr, struct mbuf **mp, + int skip, int protoff) { + char buf[INET6_ADDRSTRLEN]; struct enc_xform *espx; struct auth_hash *esph; int hlen, rlen, padding, blks, alen, i, roff; @@ -703,8 +700,8 @@ esp_output( default: DPRINTF(("%s: unknown/unsupported protocol " "family %d, SA %s/%08lx\n", __func__, - saidx->dst.sa.sa_family, ipsec_address(&saidx->dst), - (u_long) ntohl(sav->spi))); + saidx->dst.sa.sa_family, ipsec_address(&saidx->dst, + buf, sizeof(buf)), (u_long) ntohl(sav->spi))); ESPSTAT_INC(esps_nopf); error = EPFNOSUPPORT; goto bad; @@ -712,7 +709,8 @@ esp_output( if (skip + hlen + rlen + padding + alen > maxpacketsize) { DPRINTF(("%s: packet in SA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, - ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi), + ipsec_address(&saidx->dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi), skip + hlen + rlen + padding + alen, maxpacketsize)); ESPSTAT_INC(esps_toobig); error = EMSGSIZE; @@ -725,7 +723,8 @@ esp_output( m = m_unshare(m, M_NOWAIT); if (m == NULL) { DPRINTF(("%s: cannot clone mbuf chain, SA %s/%08lx\n", __func__, - ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); + ipsec_address(&saidx->dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); ESPSTAT_INC(esps_hdrops); error = ENOBUFS; goto bad; @@ -735,8 +734,8 @@ esp_output( mo = m_makespace(m, skip, hlen, &roff); if (mo == NULL) { DPRINTF(("%s: %u byte ESP hdr inject failed for SA %s/%08lx\n", - __func__, hlen, ipsec_address(&saidx->dst), - (u_long) ntohl(sav->spi))); + __func__, hlen, ipsec_address(&saidx->dst, buf, + sizeof(buf)), (u_long) ntohl(sav->spi))); ESPSTAT_INC(esps_hdrops); /* XXX diffs from openbsd */ error = ENOBUFS; goto bad; @@ -765,7 +764,8 @@ esp_output( pad = (u_char *) m_pad(m, padding + alen); if (pad == NULL) { DPRINTF(("%s: m_pad failed for SA %s/%08lx\n", __func__, - ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); + ipsec_address(&saidx->dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); m = NULL; /* NB: free'd by m_pad */ error = ENOBUFS; goto bad; @@ -876,6 +876,7 @@ bad: static int esp_output_cb(struct cryptop *crp) { + char buf[INET6_ADDRSTRLEN]; struct tdb_crypto *tc; struct ipsecrequest *isr; struct secasvar *sav; @@ -893,7 +894,7 @@ esp_output_cb(struct cryptop *crp) if (sav != isr->sav) { ESPSTAT_INC(esps_notdb); DPRINTF(("%s: SA gone during crypto (SA %s/%08lx proto %u)\n", - __func__, ipsec_address(&tc->tc_dst), + __func__, ipsec_address(&tc->tc_dst, buf, sizeof(buf)), (u_long) ntohl(tc->tc_spi), tc->tc_proto)); error = ENOBUFS; /*XXX*/ goto bad; Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sat Apr 18 16:51:24 2015 (r281694) +++ head/sys/netipsec/xform_ipcomp.c Sat Apr 18 16:58:33 2015 (r281695) @@ -224,6 +224,7 @@ ipcomp_input(struct mbuf *m, struct seca static int ipcomp_input_cb(struct cryptop *crp) { + char buf[INET6_ADDRSTRLEN]; struct cryptodesc *crd; struct tdb_crypto *tc; int skip, protoff; @@ -298,8 +299,8 @@ ipcomp_input_cb(struct cryptop *crp) if (error) { IPCOMPSTAT_INC(ipcomps_hdrops); DPRINTF(("%s: bad mbuf chain, IPCA %s/%08lx\n", __func__, - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), + (u_long) ntohl(sav->spi))); goto bad; } @@ -340,14 +341,10 @@ bad: * IPComp output routine, called by ipsec[46]_process_packet() */ static int -ipcomp_output( - struct mbuf *m, - struct ipsecrequest *isr, - struct mbuf **mp, - int skip, - int protoff -) +ipcomp_output(struct mbuf *m, struct ipsecrequest *isr, struct mbuf **mp, + int skip, int protoff) { + char buf[INET6_ADDRSTRLEN]; struct secasvar *sav; struct comp_algo *ipcompx; int error, ralen, maxpacketsize; @@ -391,7 +388,7 @@ ipcomp_output( DPRINTF(("%s: unknown/unsupported protocol family %d, " "IPCA %s/%08lx\n", __func__, sav->sah->saidx.dst.sa.sa_family, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); error = EPFNOSUPPORT; goto bad; @@ -400,7 +397,7 @@ ipcomp_output( IPCOMPSTAT_INC(ipcomps_toobig); DPRINTF(("%s: packet in IPCA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi), ralen + skip + IPCOMP_HLENGTH, maxpacketsize)); error = EMSGSIZE; @@ -414,8 +411,8 @@ ipcomp_output( if (m == NULL) { IPCOMPSTAT_INC(ipcomps_hdrops); DPRINTF(("%s: cannot clone mbuf chain, IPCA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + __func__, ipsec_address(&sav->sah->saidx.dst, buf, + sizeof(buf)), (u_long) ntohl(sav->spi))); error = ENOBUFS; goto bad; } @@ -482,6 +479,7 @@ bad: static int ipcomp_output_cb(struct cryptop *crp) { + char buf[INET6_ADDRSTRLEN]; struct tdb_crypto *tc; struct ipsecrequest *isr; struct secasvar *sav; @@ -539,8 +537,8 @@ ipcomp_output_cb(struct cryptop *crp) if (mo == NULL) { IPCOMPSTAT_INC(ipcomps_wrap); DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + __func__, ipsec_address(&sav->sah->saidx.dst, buf, + sizeof(buf)), (u_long) ntohl(sav->spi))); error = ENOBUFS; goto bad; } @@ -586,8 +584,8 @@ ipcomp_output_cb(struct cryptop *crp) DPRINTF(("%s: unknown/unsupported protocol " "family %d, IPCA %s/%08lx\n", __func__, sav->sah->saidx.dst.sa.sa_family, - ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); + ipsec_address(&sav->sah->saidx.dst, buf, + sizeof(buf)), (u_long) ntohl(sav->spi))); error = EPFNOSUPPORT; goto bad; } From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 17:21:13 2015 Return-Path: Delivered-To: svn-src-all@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 C4DF6B0C; Sat, 18 Apr 2015 17:21:13 +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 B3686930; Sat, 18 Apr 2015 17:21:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IHLDm8072991; Sat, 18 Apr 2015 17:21:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IHLDS4072990; Sat, 18 Apr 2015 17:21:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504181721.t3IHLDS4072990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 17:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281696 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 17:21:13 -0000 Author: kib Date: Sat Apr 18 17:21:12 2015 New Revision: 281696 URL: https://svnweb.freebsd.org/changeset/base/281696 Log: Initialize td_sel in the thread_init(). Struct thread is not zeroed on the initial allocation, but seltdinit() assumes that td_sel is NULL or a valid pointer. Note that thread_fini()/seltdfini() also relies on this, but correctly resets td_sel to NULL. Submitted by: luke.tw@gmail.com PR: 199518 MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Apr 18 16:58:33 2015 (r281695) +++ head/sys/kern/kern_thread.c Sat Apr 18 17:21:12 2015 (r281696) @@ -209,6 +209,7 @@ thread_init(void *mem, int size, int fla td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); td->td_kstack = 0; + td->td_sel = NULL; return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 17:41:10 2015 Return-Path: Delivered-To: svn-src-all@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 095E6162; Sat, 18 Apr 2015 17:41:10 +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 EBA00B0E; Sat, 18 Apr 2015 17:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IHf9aP089142; Sat, 18 Apr 2015 17:41:09 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IHf9tL089141; Sat, 18 Apr 2015 17:41:09 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201504181741.t3IHf9tL089141@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sat, 18 Apr 2015 17:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281697 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 17:41:10 -0000 Author: takawata Date: Sat Apr 18 17:41:09 2015 New Revision: 281697 URL: https://svnweb.freebsd.org/changeset/base/281697 Log: To ensure j formatting string valid, cast uint64_t values to uintmax_t. Modified: head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 17:21:12 2015 (r281696) +++ head/usr.sbin/bluetooth/hccontrol/le.c Sat Apr 18 17:41:09 2015 (r281697) @@ -43,6 +43,7 @@ #include #include #include +#include #define L2CAP_SOCKET_CHECKED #include #include "hccontrol.h" @@ -233,7 +234,7 @@ le_read_local_supported_features(int s, (void *)&rp, &n); printf("LOCAL SUPPORTED: %d %d %jx\n", e, rp.status, - rp.le_features); + (uintmax_t) rp.le_features); return 0; } @@ -250,7 +251,7 @@ le_read_supported_status(int s, int argc NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), (void *)&rp, &n); - printf("LE_STATUS: %d %d %jx\n", e, rp.status, rp.le_status); + printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status); return 0; } From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 19:37:37 2015 Return-Path: Delivered-To: svn-src-all@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 EDEE4538; Sat, 18 Apr 2015 19:37:37 +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 DCD368A0; Sat, 18 Apr 2015 19:37:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IJbbMF088911; Sat, 18 Apr 2015 19:37:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IJbbpx088910; Sat, 18 Apr 2015 19:37:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504181937.t3IJbbpx088910@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 18 Apr 2015 19:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281698 - head/sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 19:37:38 -0000 Author: mav Date: Sat Apr 18 19:37:37 2015 New Revision: 281698 URL: https://svnweb.freebsd.org/changeset/base/281698 Log: Do not report stripe size if it is equal to sector size. MFC after: 1 week Modified: head/sys/dev/virtio/block/virtio_blk.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Sat Apr 18 17:41:09 2015 (r281697) +++ head/sys/dev/virtio/block/virtio_blk.c Sat Apr 18 19:37:37 2015 (r281698) @@ -710,7 +710,8 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_fwheads = blkcfg->geometry.heads; } - if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY)) { + if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) && + blkcfg->topology.physical_block_exp > 0) { dp->d_stripesize = dp->d_sectorsize * (1 << blkcfg->topology.physical_block_exp); dp->d_stripeoffset = (dp->d_stripesize - From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 19:52:40 2015 Return-Path: Delivered-To: svn-src-all@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 BC2018BE; Sat, 18 Apr 2015 19:52:40 +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 AAE48A5D; Sat, 18 Apr 2015 19:52:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IJqeTS003839; Sat, 18 Apr 2015 19:52:40 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IJqe8A003838; Sat, 18 Apr 2015 19:52:40 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201504181952.t3IJqe8A003838@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 18 Apr 2015 19:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281699 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 19:52:40 -0000 Author: sjg Date: Sat Apr 18 19:52:39 2015 New Revision: 281699 URL: https://svnweb.freebsd.org/changeset/base/281699 Log: No need to delete export from filesystems which are not exported. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sat Apr 18 19:37:37 2015 (r281698) +++ head/usr.sbin/mountd/mountd.c Sat Apr 18 19:52:39 2015 (r281699) @@ -1732,6 +1732,12 @@ get_exportlist(void) } /* + * We do not need to delete "export" flag from + * filesystems that do not have it set. + */ + if (!(fsp->f_flags & MNT_EXPORTED)) + continue; + /* * Do not delete export for network filesystem by * passing "export" arg to nmount(). * It only makes sense to do this for local filesystems. From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 20:10:21 2015 Return-Path: Delivered-To: svn-src-all@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 6AABCB49; Sat, 18 Apr 2015 20:10: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 4BBEFB9C; Sat, 18 Apr 2015 20:10: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 t3IKAL2h016187; Sat, 18 Apr 2015 20:10:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IKAKgG016177; Sat, 18 Apr 2015 20:10:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504182010.t3IKAKgG016177@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 18 Apr 2015 20:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281700 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 20:10:21 -0000 Author: mav Date: Sat Apr 18 20:10:19 2015 New Revision: 281700 URL: https://svnweb.freebsd.org/changeset/base/281700 Log: Workaround bhyve virtual disks operation on top of GEOM providers. GEOM does not support scatter/gather lists in its I/Os. Such requests are cut in pieces by physio(), that may be problematic, if those pieces are not multiple of provider's sector size. If such case is detected, move the data through temporary sequential buffer. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/block_if.h head/usr.sbin/bhyve/pci_ahci.c head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Sat Apr 18 19:52:39 2015 (r281699) +++ head/usr.sbin/bhyve/block_if.c Sat Apr 18 20:10:19 2015 (r281700) @@ -85,6 +85,7 @@ struct blockif_ctxt { int bc_magic; int bc_fd; int bc_ischr; + int bc_isgeom; int bc_candelete; int bc_rdonly; off_t bc_size; @@ -198,27 +199,93 @@ blockif_complete(struct blockif_ctxt *bc } static void -blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be) +blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf) { struct blockif_req *br; off_t arg[2]; - int err; + ssize_t clen, len, off, boff, voff; + int i, err; br = be->be_req; + if (br->br_iovcnt <= 1) + buf = NULL; err = 0; - switch (be->be_op) { case BOP_READ: - if (preadv(bc->bc_fd, br->br_iov, br->br_iovcnt, - br->br_offset) < 0) - err = errno; + if (buf == NULL) { + if ((len = preadv(bc->bc_fd, br->br_iov, br->br_iovcnt, + br->br_offset)) < 0) + err = errno; + else + br->br_resid -= len; + break; + } + i = 0; + off = voff = 0; + while (br->br_resid > 0) { + len = MIN(br->br_resid, MAXPHYS); + if (pread(bc->bc_fd, buf, len, br->br_offset + + off) < 0) { + err = errno; + break; + } + boff = 0; + do { + clen = MIN(len - boff, br->br_iov[i].iov_len - + voff); + memcpy(br->br_iov[i].iov_base + voff, + buf + boff, clen); + if (clen < br->br_iov[i].iov_len - voff) + voff += clen; + else { + i++; + voff = 0; + } + boff += clen; + } while (boff < len); + off += len; + br->br_resid -= len; + } break; case BOP_WRITE: - if (bc->bc_rdonly) + if (bc->bc_rdonly) { err = EROFS; - else if (pwritev(bc->bc_fd, br->br_iov, br->br_iovcnt, - br->br_offset) < 0) - err = errno; + break; + } + if (buf == NULL) { + if ((len = pwritev(bc->bc_fd, br->br_iov, br->br_iovcnt, + br->br_offset)) < 0) + err = errno; + else + br->br_resid -= len; + break; + } + i = 0; + off = voff = 0; + while (br->br_resid > 0) { + len = MIN(br->br_resid, MAXPHYS); + boff = 0; + do { + clen = MIN(len - boff, br->br_iov[i].iov_len - + voff); + memcpy(buf + boff, + br->br_iov[i].iov_base + voff, clen); + if (clen < br->br_iov[i].iov_len - voff) + voff += clen; + else { + i++; + voff = 0; + } + boff += clen; + } while (boff < len); + if (pwrite(bc->bc_fd, buf, len, br->br_offset + + off) < 0) { + err = errno; + break; + } + off += len; + br->br_resid -= len; + } break; case BOP_FLUSH: if (bc->bc_ischr) { @@ -234,9 +301,11 @@ blockif_proc(struct blockif_ctxt *bc, st err = EROFS; else if (bc->bc_ischr) { arg[0] = br->br_offset; - arg[1] = br->br_iov[0].iov_len; + arg[1] = br->br_resid; if (ioctl(bc->bc_fd, DIOCGDELETE, arg)) err = errno; + else + br->br_resid = 0; } else err = EOPNOTSUPP; break; @@ -256,15 +325,20 @@ blockif_thr(void *arg) struct blockif_ctxt *bc; struct blockif_elem *be; pthread_t t; + uint8_t *buf; bc = arg; + if (bc->bc_isgeom) + buf = malloc(MAXPHYS); + else + buf = NULL; t = pthread_self(); pthread_mutex_lock(&bc->bc_mtx); for (;;) { while (blockif_dequeue(bc, t, &be)) { pthread_mutex_unlock(&bc->bc_mtx); - blockif_proc(bc, be); + blockif_proc(bc, be, buf); pthread_mutex_lock(&bc->bc_mtx); blockif_complete(bc, be); } @@ -275,6 +349,8 @@ blockif_thr(void *arg) } pthread_mutex_unlock(&bc->bc_mtx); + if (buf) + free(buf); pthread_exit(NULL); return (NULL); } @@ -315,13 +391,14 @@ struct blockif_ctxt * blockif_open(const char *optstr, const char *ident) { char tname[MAXCOMLEN + 1]; + char name[MAXPATHLEN]; char *nopt, *xopts; struct blockif_ctxt *bc; struct stat sbuf; struct diocgattr_arg arg; off_t size, psectsz, psectoff; int extra, fd, i, sectsz; - int nocache, sync, ro, candelete; + int nocache, sync, ro, candelete, geom; pthread_once(&blockif_once, blockif_init); @@ -375,7 +452,7 @@ blockif_open(const char *optstr, const c size = sbuf.st_size; sectsz = DEV_BSIZE; psectsz = psectoff = 0; - candelete = 0; + candelete = geom = 0; if (S_ISCHR(sbuf.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || ioctl(fd, DIOCGSECTORSIZE, §sz)) { @@ -391,6 +468,8 @@ blockif_open(const char *optstr, const c arg.len = sizeof(arg.value.i); if (ioctl(fd, DIOCGATTR, &arg) == 0) candelete = arg.value.i; + if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0) + geom = 1; } else psectsz = sbuf.st_blksize; @@ -403,6 +482,7 @@ blockif_open(const char *optstr, const c bc->bc_magic = BLOCKIF_SIG; bc->bc_fd = fd; bc->bc_ischr = S_ISCHR(sbuf.st_mode); + bc->bc_isgeom = geom; bc->bc_candelete = candelete; bc->bc_rdonly = ro; bc->bc_size = size; Modified: head/usr.sbin/bhyve/block_if.h ============================================================================== --- head/usr.sbin/bhyve/block_if.h Sat Apr 18 19:52:39 2015 (r281699) +++ head/usr.sbin/bhyve/block_if.h Sat Apr 18 20:10:19 2015 (r281700) @@ -45,6 +45,7 @@ struct blockif_req { struct iovec br_iov[BLOCKIF_IOV_MAX]; int br_iovcnt; off_t br_offset; + ssize_t br_resid; void (*br_callback)(struct blockif_req *req, int err); void *br_param; }; Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sat Apr 18 19:52:39 2015 (r281699) +++ head/usr.sbin/bhyve/pci_ahci.c Sat Apr 18 20:10:19 2015 (r281700) @@ -571,6 +571,7 @@ ahci_build_iov(struct ahci_port *p, stru } breq->br_iovcnt = j; + breq->br_resid = todo; aior->done += todo; aior->more = (aior->done < aior->len && i < prdtl); } @@ -776,8 +777,7 @@ next: breq = &aior->io_req; breq->br_offset = elba * blockif_sectsz(p->bctx); - breq->br_iovcnt = 1; - breq->br_iov[0].iov_len = elen * blockif_sectsz(p->bctx); + breq->br_resid = elen * blockif_sectsz(p->bctx); /* * Mark this command in-flight. Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Sat Apr 18 19:52:39 2015 (r281699) +++ head/usr.sbin/bhyve/pci_virtio_block.c Sat Apr 18 20:10:19 2015 (r281700) @@ -198,7 +198,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s struct pci_vtblk_ioreq *io; int i, n; int err; - int iolen; + ssize_t iolen; int writeop, type; off_t offset; struct iovec iov[BLOCKIF_IOV_MAX + 2]; @@ -246,8 +246,9 @@ pci_vtblk_proc(struct pci_vtblk_softc *s assert(((flags[i] & VRING_DESC_F_WRITE) == 0) == writeop); iolen += iov[i].iov_len; } + io->io_req.br_resid = iolen; - DPRINTF(("virtio-block: %s op, %d bytes, %d segs, offset %ld\n\r", + DPRINTF(("virtio-block: %s op, %zd bytes, %d segs, offset %ld\n\r", writeop ? "write" : "read/ident", iolen, i - 1, offset)); switch (type) { From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 20:31:59 2015 Return-Path: Delivered-To: svn-src-all@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 EF56EFA1; Sat, 18 Apr 2015 20:31:59 +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 C3771DFB; Sat, 18 Apr 2015 20:31:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IKVxLA037876; Sat, 18 Apr 2015 20:31:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IKVxtC037875; Sat, 18 Apr 2015 20:31:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504182031.t3IKVxtC037875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 18 Apr 2015 20:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281701 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 20:32:00 -0000 Author: markj Date: Sat Apr 18 20:31:59 2015 New Revision: 281701 URL: https://svnweb.freebsd.org/changeset/base/281701 Log: SDT(9): add a section on SDT providers, mentioning the "sdt" provider. Add examples demonstrating how one can list available providers and the DTrace probes provided by a provider. Differential Revision: https://reviews.freebsd.org/D2166 Reviewed by: rpaulo MFC after: 2 weeks Modified: head/share/man/man9/SDT.9 Modified: head/share/man/man9/SDT.9 ============================================================================== --- head/share/man/man9/SDT.9 Sat Apr 18 20:10:19 2015 (r281700) +++ head/share/man/man9/SDT.9 Sat Apr 18 20:31:59 2015 (r281701) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 8, 2015 +.Dd April 18, 2015 .Dt SDT 9 .Os .Sh NAME @@ -194,7 +194,37 @@ macros are used to create trace points. They are meant to be added to executable code and can be used to instrument the code in which they are called. +.Sh PROVIDERS +A number of kernel DTrace providers are available. +In general, these providers define stable interfaces and should be treated as +such: existing D scripts may be broken if a probe is renamed or its arguments +are modified. +However, it is often useful to define ad-hoc +.Nm +probes for debugging a subsystem or driver. +Similarly, a developer may wish to provide a group of +.Nm +probes without committing to their future stability. +Such probes should be added to the +.Ql sdt +provider instead of defining a new provider. .Sh EXAMPLES +The DTrace providers available on the current system can be listed with +.Bd -literal -offset indent +dtrace -l | sed 1d | awk '{print $2}' | sort -u +.Ed +.Pp +A detailed list of the probes offered by a given provider can be obtained by +specifying the provider using the +.Fl P +flag. +For example, to view the probes and argument types for the +.Ql sched +provider, run +.Bd -literal -offset indent +dtrace -lv -P sched +.Ed +.Pp The following probe definition will create a DTrace probe called .Ql icmp:::receive-unreachable , which would hypothetically be triggered when the kernel receives an ICMP packet From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 20:36:59 2015 Return-Path: Delivered-To: svn-src-all@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 72CEE288; Sat, 18 Apr 2015 20:36:59 +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 61716E23; Sat, 18 Apr 2015 20:36:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IKax2m040577; Sat, 18 Apr 2015 20:36:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IKax6s040576; Sat, 18 Apr 2015 20:36:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504182036.t3IKax6s040576@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 18 Apr 2015 20:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281702 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 20:36:59 -0000 Author: markj Date: Sat Apr 18 20:36:58 2015 New Revision: 281702 URL: https://svnweb.freebsd.org/changeset/base/281702 Log: Remove unimplemented sched provider probes. They were added for compatibility with the sched provider in Solaris and illumos, but our sched provider is already incompatible since it uses native types, so there isn't much point in keeping them around. Differential Revision: https://reviews.freebsd.org/D2167 Reviewed by: rpaulo Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sat Apr 18 20:31:59 2015 (r281701) +++ head/sys/kern/kern_synch.c Sat Apr 18 20:36:58 2015 (r281702) @@ -108,17 +108,6 @@ static void loadav(void *arg); SDT_PROVIDER_DECLARE(sched); SDT_PROBE_DEFINE(sched, , , preempt); -/* - * These probes reference Solaris features that are not implemented in FreeBSD. - * Create the probes anyway for compatibility with existing D scripts; they'll - * just never fire. - */ -SDT_PROBE_DEFINE(sched, , , cpucaps__sleep); -SDT_PROBE_DEFINE(sched, , , cpucaps__wakeup); -SDT_PROBE_DEFINE(sched, , , schedctl__nopreempt); -SDT_PROBE_DEFINE(sched, , , schedctl__preempt); -SDT_PROBE_DEFINE(sched, , , schedctl__yield); - static void sleepinit(void *unused) { From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 20:55:34 2015 Return-Path: Delivered-To: svn-src-all@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 108C3714; Sat, 18 Apr 2015 20:55:34 +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 F38AEFD7; Sat, 18 Apr 2015 20:55: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 t3IKtXLj057402; Sat, 18 Apr 2015 20:55:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IKtXJa057401; Sat, 18 Apr 2015 20:55:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182055.t3IKtXJa057401@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 20:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281703 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 20:55:34 -0000 Author: kib Date: Sat Apr 18 20:55:33 2015 New Revision: 281703 URL: https://svnweb.freebsd.org/changeset/base/281703 Log: Complete r281670, unlist removed files. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Apr 18 20:36:58 2015 (r281702) +++ head/sys/conf/files Sat Apr 18 20:55:33 2015 (r281703) @@ -2933,8 +2933,6 @@ fs/ext2fs/ext2_bmap.c optional ext2fs fs/ext2fs/ext2_extents.c optional ext2fs fs/ext2fs/ext2_inode.c optional ext2fs fs/ext2fs/ext2_inode_cnv.c optional ext2fs -fs/ext2fs/ext2_hash.c optional ext2fs -fs/ext2fs/ext2_htree.c optional ext2fs fs/ext2fs/ext2_lookup.c optional ext2fs fs/ext2fs/ext2_subr.c optional ext2fs fs/ext2fs/ext2_vfsops.c optional ext2fs From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 20:55:56 2015 Return-Path: Delivered-To: svn-src-all@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 C6C0E870; Sat, 18 Apr 2015 20:55: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 B5B74FDD; Sat, 18 Apr 2015 20:55: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 t3IKtuha057645; Sat, 18 Apr 2015 20:55:56 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IKtuRx057644; Sat, 18 Apr 2015 20:55:56 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504182055.t3IKtuRx057644@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 20:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281704 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 20:55:56 -0000 Author: rpaulo Date: Sat Apr 18 20:55:55 2015 New Revision: 281704 URL: https://svnweb.freebsd.org/changeset/base/281704 Log: Synaptics: don't report the middle button when clickPad is used. On trackpads that had support for both, we were sending two button events when the trackpad was pressed. Tested by: Jakob Alvermark MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Apr 18 20:55:33 2015 (r281703) +++ head/sys/dev/atkbdc/psm.c Sat Apr 18 20:55:55 2015 (r281704) @@ -2756,7 +2756,8 @@ proc_synaptics(struct psm_softc *sc, pac touchpad_buttons |= MOUSE_BUTTON4DOWN; if ((pb->ipacket[3] ^ pb->ipacket[0]) & 0x02) touchpad_buttons |= MOUSE_BUTTON5DOWN; - } else if (sc->synhw.capExtended && sc->synhw.capMiddle) { + } else if (sc->synhw.capExtended && sc->synhw.capMiddle && + !sc->synhw.capClickPad) { /* Middle Button */ if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01) touchpad_buttons |= MOUSE_BUTTON2DOWN; From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:00:38 2015 Return-Path: Delivered-To: svn-src-all@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 86649A00; Sat, 18 Apr 2015 21:00:38 +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 7244FF4; Sat, 18 Apr 2015 21:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IL0cdr062032; Sat, 18 Apr 2015 21:00:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IL0aPM062013; Sat, 18 Apr 2015 21:00:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201504182100.t3IL0aPM062013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 18 Apr 2015 21:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281705 - in head: cddl/contrib/opensolaris/cmd/dtrace share/man/man4 share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:00:38 -0000 Author: markj Date: Sat Apr 18 21:00:36 2015 New Revision: 281705 URL: https://svnweb.freebsd.org/changeset/base/281705 Log: Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers. The format of these pages is somewhat experimental, so they may be subject to further tweaking. Differential Revision: https://reviews.freebsd.org/D2170 Reviewed by: bcr, rpaulo MFC after: 2 weeks Added: head/share/man/man4/dtrace-io.4 (contents, props changed) head/share/man/man4/dtrace-ip.4 (contents, props changed) head/share/man/man4/dtrace-proc.4 (contents, props changed) head/share/man/man4/dtrace-sched.4 (contents, props changed) head/share/man/man4/dtrace-tcp.4 (contents, props changed) head/share/man/man4/dtrace-udp.4 (contents, props changed) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 head/share/man/man4/Makefile head/share/man/man9/SDT.9 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sat Apr 18 20:55:55 2015 (r281704) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sat Apr 18 21:00:36 2015 (r281705) @@ -21,7 +21,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2013 +.Dd April 18, 2015 .Dt DTRACE 1 .Os .Sh NAME @@ -670,7 +670,8 @@ Invalid command line options or argument .Sh SEE ALSO .Xr cpp 1 , .Xr dtruss 1 , -.Xr elf 5 +.Xr elf 5 , +.Xr SDT 9 .Rs .%T Solaris Dynamic Tracing Guide .Re Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Apr 18 20:55:55 2015 (r281704) +++ head/share/man/man4/Makefile Sat Apr 18 21:00:36 2015 (r281705) @@ -121,6 +121,12 @@ MAN= aac.4 \ dpt.4 \ ds1307.4 \ ds3231.4 \ + ${_dtrace_io.4} \ + ${_dtrace_ip.4} \ + ${_dtrace_proc.4} \ + ${_dtrace_sched.4} \ + ${_dtrace_tcp.4} \ + ${_dtrace_udp.4} \ dummynet.4 \ ed.4 \ edsc.4 \ @@ -812,6 +818,15 @@ SUBDIR= man4.${MACHINE_CPUARCH} _ccd.4= ccd.4 .endif +.if ${MK_CDDL} != "no" +_dtrace_io.4= dtrace-io.4 +_dtrace_ip.4= dtrace-ip.4 +_dtrace_proc.4= dtrace-proc.4 +_dtrace_sched.4= dtrace-sched.4 +_dtrace_tcp.4= dtrace-tcp.4 +_dtrace_udp.4= dtrace-udp.4 +.endif + .if ${MK_ISCSI} != "no" MAN+= iscsi.4 MAN+= iscsi_initiator.4 Added: head/share/man/man4/dtrace-io.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace-io.4 Sat Apr 18 21:00:36 2015 (r281705) @@ -0,0 +1,123 @@ +.\" Copyright (c) 2015 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 18, 2015 +.Dt DTRACE-IO 4 +.Os +.Sh NAME +.Nm dtrace-io +.Nd a DTrace provider for tracing events related to disk I/O +.Sh SYNOPSIS +.Fn io:::start "struct bio *" "struct devstat *" +.Fn io:::done "struct bio *" "struct devstat *" +.Sh DESCRIPTION +The +.Nm io +provider allows the tracing of disk I/O events. +The +.Fn io:::start +probe fires when a I/O request is about to be sent to the backing driver of a +.Xr disk 9 +object. +This occurs after all +.Xr GEOM 4 +transformations have been performed on the request. +The +.Fn io:::done +probe fires when a I/O request is completed. +Both probes take a +.Vt "struct bio *" +representing the I/O request as their first argument. +The second argument is a +.Vt "struct devstat *" +for the underlying +.Xr disk 9 +object. +.Sh ARGUMENTS +The fields of +.Vt "struct bio" +are described in the +.Xr g_bio 9 +manual page, and the fields of +.Vt "struct devstat" +are described in the +.Xr devstat 9 +manual page. +Translators for the +.Vt bufinfo_t +and +.Vt devinfo_t +D types are defined in +.Pa /usr/lib/dtrace/io.d . +.Sh FILES +.Bl -tag -width "/usr/lib/dtrace/io.d" -compact +.It Pa /usr/lib/dtrace/io.d +DTrace type and translator definitions for the +.Nm io +provider. +.El +.Sh EXAMPLES +The following script shows a per-process breakdown of total I/O by disk device: +.Bd -literal -offset indent +#pragma D option quiet + +io:::start +{ + @[args[1]->device_name, execname, pid] = sum(args[0]->bio_bcount); +} + +END +{ + printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES"); + printa("%10s %20s %10d %15@d\n", @); +} +.Ed +.Sh COMPATIBILITY +This provider is not compatible with the +.Nm io +provider found in Solaris, as its probes use native +.Fx +argument types. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr devstat 9 , +.Xr SDT 9 +.Sh HISTORY +The +.Nm io +provider first appeared in +.Fx +9.2 and 10.0. +.Sh AUTHORS +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . +.Sh BUGS +The +.Fn io:::wait-start +and +.Fn io:::wait-done +probes are not currently implemented on +.Fx . Added: head/share/man/man4/dtrace-ip.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace-ip.4 Sat Apr 18 21:00:36 2015 (r281705) @@ -0,0 +1,285 @@ +.\" Copyright (c) 2015 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 18, 2015 +.Dt DTRACE-IP 4 +.Os +.Sh NAME +.Nm dtrace-ip +.Nd a DTrace provider for tracing events related to the IPv4 and IPv6 protocols +.Sh SYNOPSIS +.Fn ip:::receive "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "ifinfo_t *" \ + "ipv4info_t *" "ipv6info_t *" +.Fn ip:::send "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "ifinfo_t *" \ + "ipv4info_t *" "ipv6info_t *" +.Sh DESCRIPTION +The DTrace +.Nm ip +provider allows users to trace events in the +.Xr ip 4 +and +.Xr ip6 4 +protocol implementations. +The +.Fn ip:::send +probe fires whenever the kernel prepares to transmit an IP packet, and the +.Fn ip:::receive +probe fires whenever the kernel receives an IP packet. +The arguments to these probes can be used to obtain detailed information about +the IP headers of the corresponding packet, as well as the network interface on +which the packet was sent or received. +Unlike the +.Xr dtrace-tcp 4 +and +.Xr dtrace-udp 4 +providers, +.Nm ip +provider probes are triggered by forwarded packets. +That is, the probes will fire on packets that are not destined to the local +host. +.Sh ARGUMENTS +The +.Vt pktinfo_t +argument is currently unimplemented and is included for compatibility with other +implementations of this provider. +Its fields are: +.Bl -tag -width "uintptr_t pkt_addr" -offset indent +.It Vt uintptr_t pkt_addr +Always set to 0. +.El +.Pp +The +.Vt csinfo_t +argument is currently unimplemented and is included for compatibility with other +implementations of this provider. +Its fields are: +.Bl -tag -width "uintptr_t cs_addr" -offset indent +.It Vt uintptr_t cs_addr +Always set to 0. +.It Vt uint64_t cs_cid +A pointer to the +.Vt struct inpcb +for this packet, or +.Dv NULL . +.It Vt pid_t cs_pid +Always set to 0. +.El +.Pp +The +.Vt ipinfo_t +argument contains IP fields common to both IPv4 and IPv6 packets. +Its fields are: +.Bl -tag -width "uint32_t ip_plength" -offset indent +.It Vt uint8_t ip_ver +IP version of the packet, 4 for IPv4 packets and 6 for IPv6 packets. +.It Vt uint32_t ip_plength +IP payload size. +This does not include the size of the IP header or IPv6 option headers. +.It Vt string ip_saddr +IP source address. +.It Vt string ip_daddr +IP destination address. +.El +.Pp +The +.Vt ifinfo_t +argument describes the outgoing and incoming interfaces for the packet in the +.Fn ip:::send +and +.Fn ip:::receive +probes respectively. +Its fields are: +.Bl -tag -width "uintptr_t if_addr" -offset indent +.It Vt string if_name +The interface name. +.It Vt int8_t if_local +A boolean value indicating whether or not the interface is a loopback interface. +.It Vt uintptr_t if_addr +A pointer to the +.Vt struct ifnet +which describes the interface. +See the +.Xr ifnet 9 +manual page. +.El +.Pp +The +.Vt ipv4info_t +argument contains the fields of the IP header for IPv4 packets. +This argument is +.Dv NULL +for IPv6 packets. +DTrace scripts should use the +.Fn ip_ver +field in the +.Vt ipinfo_t +argument to determine whether to use this argument. +Its fields are: +.Bl -tag -width "uint16_t ipv4_checksum" -offset indent +.It Vt uint8_t ipv4_ver +IP version. +This will always be 4 for IPv4 packets. +.It Vt uint8_t ipv4_ihl +The IP header length, including options, in 32-bit words. +.It Vt uint8_t ipv4_tos +IP type of service field. +.It Vt uint16_t ipv4_length +The total packet length, including the header, in bytes. +.It Vt uint16_t ipv4_ident +Identification field. +.It Vt uint8_t ipv4_flags +The IP flags. +.It Vt uint16_t ipv4_offset +The fragment offset of the packet. +.It Vt uint8_t ipv4_ttl +Time to live field. +.It Vt uint8_t ipv4_protocol +Next-level protocol ID. +.It Vt string ipv4_protostr +A string containing the name of the encapsulated protocol. +The protocol strings are defined in the +.Va protocol +array in +.Pa /usr/lib/dtrace/ip.d +.It Vt uint16_t ipv4_checksum +The IP checksum. +.It Vt ipaddr_t ipv4_src +IPv4 source address. +.It Vt ipaddr_t ipv4_dst +IPv4 destination address. +.It Vt string ipv4_saddr +A string representation of the source address. +.It Vt string ipv4_daddr +A string representation of the destination address. +.It Vt ipha_t *ipv4_hdr +A pointer to the raw IPv4 header. +.El +.Pp +The +.Vt ipv6info_t +argument contains the fields of the IP header for IPv6 packets. +Its fields are not set for IPv4 packets; as with the +.Vt ipv4info_t +argument, the +.Fn ip_ver +field should be used to determine whether this argument is valid. +Its fields are: +.Bl -tag -width "uint16_t ipv4_checksum" -offset indent +.It Vt uint8_t ipv6_ver +IP version. +This will always be 6 for IPv6 packets. +.It Vt uint8_t ipv6_tclass +The traffic class, used to set the differentiated services codepoint and +extended congestion notification flags. +.It Vt uint32_t ipv6_flow +The flow label of the packet. +.It Vt uint16_t ipv6_plen +The IP payload size, including extension headers, in bytes. +.It Vt uint8_t ipv6_nexthdr +An identifier for the type of the next header. +.It Vt string ipv6_nextstr +A string representation of the type of the next header. +.It Vt uint8_t ipv6_hlim +The hop limit. +.It Vt ip6_addr_t *ipv6_src +IPv6 source address. +.It Vt ip6_addr_t *ipv6_dst +IPv6 destination address. +.It Vt string ipv6_saddr +A string representation of the source address. +.It Vt string ipv6_daddr +A string representation of the destination address. +.It Vt ip6_t *ipv6_hdr +A pointer to the raw IPv6 header. +.El +.Sh FILES +.Bl -tag -width "/usr/lib/dtrace/ip.d" -compact +.It Pa /usr/lib/dtrace/ip.d +DTrace type and translator definitions for the +.Nm ip +provider. +.El +.Sh EXAMPLES +The following script counts received packets by remote host address. +.Bd -literal -offset indent +ip:::receive +{ + @num[args[2]->ip_saddr] = count(); +} +.Ed +.Pp +This script will print some details of each IP packet as it is sent or received +by the kernel: +.Bd -literal -offset indent +#pragma D option quiet +#pramga D option switchrate=10Hz + +dtrace:::BEGIN +{ + printf(" %10s %30s %-30s %8s %6s\n", "DELTA(us)", "SOURCE", + "DEST", "INT", "BYTES"); + last = timestamp; +} + +ip:::send +{ + this->elapsed = (timestamp - last) / 1000; + printf(" %10d %30s -> %-30s %8s %6d\n", this->elapsed, + args[2]->ip_saddr, args[2]->ip_daddr, args[3]->if_name, + args[2]->ip_plength); + last = timestamp; +} + +ip:::receive +{ + this->elapsed = (timestamp - last) / 1000; + printf(" %10d %30s <- %-30s %8s %6d\n", this->elapsed, + args[2]->ip_daddr, args[2]->ip_saddr, args[3]->if_name, + args[2]->ip_plength); + last = timestamp; +} +.Ed +.Sh COMPATIBILITY +This provider is compatible with the +.Nm ip +providers found in Solaris and Darwin. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr dtrace-tcp 4 , +.Xr dtrace-udp 4 , +.Xr ip 4 , +.Xr ip6 4 , +.Xr ifnet 9 , +.Xr SDT 9 +.Sh HISTORY +The +.Nm ip +provider first appeared in +.Fx +10.0. +.Sh AUTHORS +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . Added: head/share/man/man4/dtrace-proc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace-proc.4 Sat Apr 18 21:00:36 2015 (r281705) @@ -0,0 +1,264 @@ +.\" Copyright (c) 2015 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 18, 2015 +.Dt DTRACE-PROC 4 +.Os +.Sh NAME +.Nm dtrace-proc +.Nd a DTrace provider for tracing events related to user processes +.Sh SYNOPSIS +.Fn proc:::create "struct proc *" "struct proc *" "int" +.Fn proc:::exec "char *" +.Fn proc:::exec-failure "int" +.Fn proc:::exec-success "char *" +.Fn proc:::exit "int" +.Fn proc:::signal-clear "int" "ksiginfo_t *" +.Fn proc:::signal-discard "struct thread *" "struct proc *" "int" +.Fn proc:::signal-send "struct thread *" "struct proc *" "int" +.Sh DESCRIPTION +The DTrace +.Nm proc +provider provides insight into events related to user processes: process and +thread creation and termination events, and process signalling. +.Pp +The +.Fn proc:::create +probe fires when a user process is created via the +.Xr fork 2 , +.Xr vfork 2 , +.Xr pdfork 2 , +or +.Xr rfork 2 +system calls. +In particular, kernel processes created with the +.Xr kproc 9 +KPI will not trigger this probe. +The +.Fn proc:::create +probe's first two arguments are the parent process and new child process, +respectively. +The third argument is a mask of +.Xr rfork 2 +flags indicating which process resources are to be shared between the parent and +child processes. +.Pp +The +.Fn proc:::exec +probe fires when a process attempts to execute a file. +Its argument is the specified filename for the file. +If the attempt fails because of an error, the +.Fn proc:::exec-failure +probe will subsequently fire, providing the corresponding +.Xr errno 2 +value in its first argument. +Otherwise, the +.Fn proc:::exec-success +probe will fire. +.Pp +The +.Fn proc:::exit +probe fires when a process exits or is terminated. +Its argument is the corresponding +.Dv SIGCHLD +signal code; valid values are documented in the +.Xr siginfo 3 +manual page and defined in +.Pa signal.h . +For example, when a process exits normally, the value of +.Dv args[0] +will be +.Dv CLD_EXITED . +.Pp +The +.Fn proc:::signal-send +probe fires when a signal is about to be sent to a process. +The +.Fn proc:::signal-discard +probe fires when a signal is sent to a process that ignores it. +This probe will fire after the +.Fn proc:::signal-send +probe for the signal in question. +The arguments to these probes are the thread and process to which the signal +will be sent, and the signal number of the signal. +Valid signal numbers are defined in the +.Xr signal 3 +manual page. +The +.Fn proc:::signal-clear +probe fires when a pending signal has been cleared by one of the +.Xr sigwait 2 , +.Xr sigtimedwait 2 , +or +.Xr sigwaitinfo 2 +system calls. +Its arguments are the signal number of the cleared signal, and a pointer to +the corresponding signal information. +The +.Vt siginfo_t +for the signal can be obtained from +.Dv args[1]->ksi_info . +.Sh ARGUMENTS +Though the +.Nm proc +provider probes use native +.Fx +arguments types, standard D types for processes and threads are available. +These are +.Vt psinfo_t +and +.Vt lwpsinfo_t +respectively, and are defined in +.Pa /usr/lib/dtrace/psinfo.d . +This file also defines two global variables, +.Va curpsinfo +and +.Va curlwpsinfo , +which provide representations of the current process and thread using these +types. +.Pp +The fields of +.Vt psinfo_t +are: +.Bl -tag -width "uintptr_t pr_addr" -offset indent +.It Vt int pr_nlwp +Number of threads in the process. +.It Vt pid_t pr_pid +Process ID. +.It Vt pid_t pr_ppid +Process ID of the parent process, or 0 if the process does not have a parent. +.It Vt pid_t pr_pgid +Process ID of the process group leader. +.It Vt pid_t pr_sid +Session ID, or 0 if the process does not belong to a session. +.It Vt pid_t pr_uid +Real user ID. +.It Vt pid_t pr_euid +Effective user ID. +.It Vt pid_t pr_gid +Real group ID. +.It Vt pid_t pr_egid +Effective group ID. +.It Vt uintptr_t pr_addr +Pointer to the +.Vt struct proc +for the process. +.It Vt string pr_psargs +Process arguments. +.It Vt u_int pr_arglen +Length of the process argument string. +.It Vt u_int pr_jailid +Jail ID of the process. +.El +.Pp +The fields of +.Vt lwpsinfo_t +are: +.Bl -tag -width "uintptr_t pr_wchar" -offset indent +.It Vt id_t pr_lwpid +Thread ID. +.It Vt int pr_flag +Thread flags. +.It Vt int pr_pri +Real scheduling priority of the thread. +.It Vt char pr_state +Currently always 0. +.It Vt char pr_sname +Currently always +.Ql ? . +.It Vt short pr_syscall +Currently always 0. +.It Vt uintptr_t pr_addr +Pointer to the +.Vt struct thread +for the thread. +.It Vt uintptr_t pr_wchan +Current wait address on which the thread is sleeping. +.El +.Sh FILES +.Bl -tag -width "/usr/lib/dtrace/psinfo.d" -compact +.It Pa /usr/lib/dtrace/psinfo.d +DTrace type and translator definitions for the +.Nm proc +provider. +.El +.Sh EXAMPLES +The following script logs process execution events as they occur: +.Bd -literal -offset indent +#pragma D option quiet + +proc:::exec-success +{ + printf("%s", curpsinfo->pr_psargs); +} +.Ed +.Pp +Note that the +.Dv pr_psargs +field is subject to the limit defined by the +.Va kern.ps_arg_cache_limit +sysctl. +In particular, processes with an argument list longer than the value defined by +this sysctl cannot be logged in this way. +.Sh COMPATIBILITY +The +.Nm proc +provider in +.Fx +is not compatible with the +.Nm proc +provider in Solaris. +In particular, +.Fx +uses the native +.Vt "struct proc" +and +.Vt "struct thread" +types for probe arguments rather than translated types. +Additionally, a number of +.Nm proc +provider probes found in Solaris are not currently available on +.Fx . +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr errno 2 , +.Xr fork 2 , +.Xr pdfork 2 , +.Xr rfork 2 , +.Xr vfork 2 , +.Xr siginfo 3 , +.Xr signal 3 , +.Xr dtrace-sched 4 , +.Xr kproc 9 +.Sh HISTORY +The +.Nm proc +provider first appeared in +.Fx +7.1. +.Sh AUTHORS +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . Added: head/share/man/man4/dtrace-sched.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace-sched.4 Sat Apr 18 21:00:36 2015 (r281705) @@ -0,0 +1,227 @@ +.\" Copyright (c) 2015 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 18, 2015 +.Dt DTRACE-SCHED 4 +.Os +.Sh NAME +.Nm dtrace-sched +.Nd a DTrace provider for tracing CPU scheduling events +.Sh SYNOPSIS +.Fn sched:::change-pri "struct thread *" "struct proc *" "uint8_t" +.Fn sched:::dequeue "struct thread *" "struct proc *" "void *" +.Fn sched:::enqueue "struct thread *" "struct proc *" "void *" "int" +.Fn sched:::lend-pri "struct thread *" "struct proc *" "uint8_t" "struct thread *" +.Fn sched:::load-change "int" "int" +.Fn sched:::off-cpu "struct thread *" "struct proc *" +.Fn sched:::on-cpu +.Fn sched:::preempt +.Fn sched:::remain-cpu +.Fn sched:::surrender "struct thread *" "struct proc *" +.Fn sched:::sleep +.Fn sched:::tick "struct thread *" "struct proc *" +.Fn sched:::wakeup "struct thread *" "struct proc *" +.Sh DESCRIPTION +The DTrace +.Nm sched +provider allows the tracing of events related to CPU scheduling in the 4BSD and +ULE schedulers. +.Pp +The +.Fn sched:::change-pri +probe fires when a thread's active scheduling priority is about to be updated. +The first two arguments are the thread whose priority is about to be changed, +and the corresponding process. +The third argument is the new absolute priority for the thread, while the +current value is given by +.Dv args[0]->td_priority . +The +.Fn sched:::lend-pri +probe fires when the currently-running thread elevates the priority of another +thread via priority lending. +The first two arguments are the thread whose priority is about to be changed, +and the corresponding process. +The third argument is the new absolute priority for the thread. +The fourth argument is the currently-running thread. +.Pp +The +.Fn sched:::dequeue +probe fires immediately before a runnable thread is removed from a scheduler +run queue. +This may occur when the thread is about to begin execution on a CPU, or because +the thread is being migrated to a different run queue. +The latter event may occur in several circumstances: the scheduler may be +attempting to rebalance load between multiple CPUs, the thread's scheduling +priority may have changed, or the thread's CPU affinity settings may have +changed. +The first two arguments to +.Fn sched:::dequeue +are the thread and corresponding process. +The third argument is currently always +.Dv NULL . +The +.Fn sched:::enqueue +probe fires when a runnable thread is about to be added to a scheduler run +queue. +Its first two arguments are the thread and corresponding process. +The third argument is currently always +.Dv NULL . +The fourth argument is a boolean value that is non-zero if the thread is +enqueued at the beginning of its run queue slot, and zero if the thread is +instead enqueued at the end. +.Pp +The +.Fn sched:::load-change +probe fires after the load of a thread queue is adjusted. +The first argument is the cpuid for the CPU associated with the thread queue, +and the second argument is the adjusted load of the thread queue, i.e., the +number of elements in the queue. +.Pp +The +.Fn sched:::off-cpu +probe is triggered by the scheduler suspending execution of the +currently-running thread, and the +.Fn sched:::on-cpu +probe fires when the current thread has been selected to run on a CPU and is +about to begin or resume execution. +The arguments to +.Fn sched:::off-cpu +are the thread and corresponding process selected to run following the +currently-running thread. +If these two threads are the same, the +.Fn sched:::remain-cpu +probe will fire instead. +.Pp +The +.Fn sched:::surrender +probe fires when the scheduler is called upon to make a scheduling decision by +a thread running on a different CPU, via an interprocessor interrupt. +The arguments to this probe are the interrupted thread and its corresponding +process. +This probe currently always fires in the context of the interrupted thread. +.Pp +The +.Fn sched:::preempt +probe will fire immediately before the currently-running thread is preempted. +When this occurs, the scheduler will select a new thread to run, and one of the +.Fn sched:::off-cpu +or +.Fn sched:::remain-cpu +probes will subsequently fire, depending on whether or not the scheduler selects +the preempted thread. +.Pp +The +.Fn sched:::sleep +probe fires immediately before the currently-running thread is about to suspend +execution and begin waiting for a condition to be met. +The +.Fn sched:::wakeup +probe fires when a thread is set up to resume execution after having gone to +sleep. +Its arguments are the thread being awoken, and the corresponding process. +.Pp +The +.Fn sched:::tick +fires before each scheduler clock tick. +Its arguments are the currently-running thread and its corresponding process. +.Sh ARGUMENTS +The +.Nm sched +provider probes use the kernel types +.Vt "struct proc" +and +.Vt "struct thread" +to represent processes and threads, respectively. +These structures have many fields and are defined in +.Pa sys/proc.h . +In a probe body, the currently-running thread can always be obtained with the +.Va curthread +global variable, which has type +.Vt "struct thread *" . +For example, when a running thread is about to sleep, the +.Fn sched:::sleep +probe fires in the context of that thread, which can be accessed using +.Va curthread . +The +.Va curcpu +global variable contains the cpuid of the CPU on which the currently-running +thread is executing. +.Sh EXAMPLES +The following script gives a breakdown of CPU utilization by process name: +.Bd -literal -offset indent +sched:::on-cpu +{ + self->ts = timestamp; +} + +sched:::off-cpu +/self->ts != 0/ +{ + @[execname] = sum((timestamp - self->ts) / 1000); + self->ts = 0; +} +.Ed +.Pp +Here, DTrace stores a timestamp each time a thread is scheduled to run, and +computes the time elapsed in microseconds when it is descheduled. +The results are summed by process name. +.Sh COMPATIBILITY +This provider is not compatible with the +.Nm sched +provider found in Solaris. +In particular, the probe argument types are native +.Fx +types, and the +.Fn sched:::cpucaps-sleep , +.Fn sched:::cpucaps-wakeup , +.Fn sched:::schedctl-nopreempt , +.Fn sched:::schedctl-preempt , +and +.Fn sched:::schedctl-yield +probes are not available in +.Fx . +.Pp +The +.Fn sched:::lend-pri +and +.Fn sched:::load-change +probes are specific to +.Fx . +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , +.Xr SDT 9 , +.Xr sleepqueue 9 +.Sh HISTORY +The +.Nm sched +provider first appeared in +.Fx +8.4 and 9.1. +.Sh AUTHORS +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . Added: head/share/man/man4/dtrace-tcp.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace-tcp.4 Sat Apr 18 21:00:36 2015 (r281705) @@ -0,0 +1,400 @@ +.\" Copyright (c) 2015 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 18, 2015 +.Dt DTRACE-TCP 4 +.Os +.Sh NAME +.Nm dtrace-tcp +.Nd a DTrace provider for tracing events related to the +.Xr tcp 4 +protocol *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:13:31 2015 Return-Path: Delivered-To: svn-src-all@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 7442FD50 for ; Sat, 18 Apr 2015 21:13:31 +0000 (UTC) Received: from nm12-vm0.bullet.mail.bf1.yahoo.com (nm12-vm0.bullet.mail.bf1.yahoo.com [98.139.213.140]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24767252 for ; Sat, 18 Apr 2015 21:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1429391608; bh=Ht8gjh9TU0/gCy8xHk+6sZoDz1yp9Dbj9E4j3u7KO3g=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=ZYZx3jl5SjJyN49/+Il0fhc69kVqbsVGm/JbLANEz3DGeJJY30ivuPoZQDwphG4UAxr/MPkItWD27VzCjXKewDbabiCMSlWLEN2EBxclU+9/w/c2yCxOWSN0jFS6EVSan21Sqsqr3yqNA1WEAnw9N50HwtVIdvMTTcq1+19zaZ9YodeYNr8ZYy9mHpVWkiEf4Ju49MiEDsOXdRY/dvORAvovUVlrQFZi6c/I8wD654+iwMjumov1nJlALwDwAW5NV6kJ2VPc3eldV1kUXPKbW+5RQ7+QjTDRTKtzxramsKH02GwhhBxr7wSvP180mdbroo1R+NbIQG0QabKiULYzqQ== Received: from [66.196.81.170] by nm12.bullet.mail.bf1.yahoo.com with NNFMP; 18 Apr 2015 21:13:28 -0000 Received: from [68.142.230.76] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 18 Apr 2015 21:13:28 -0000 Received: from [127.0.0.1] by smtp233.mail.bf1.yahoo.com with NNFMP; 18 Apr 2015 21:13:28 -0000 X-Yahoo-Newman-Id: 893643.72861.bm@smtp233.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 4BERFcgVM1lQWJFqOcFOcdsFNEpFEFMvd.II0gcnxw5qegQ Oso4NezZdIo0K0bVgWbcpf3zMo6gumlKilnPPkQLEpIWvqXseNtAwgkwWqdS IKlhXytQtWbXSybd3dgGbomNpvqXt7qIp_Pa0G1zDUaGIFvGGVmr2ZKy924D 1Wvm_PNokIhZYyCbeQ40G158pxHpoPcO1dePcmV5wpUA4w7o0dQVsnZna6q4 hh8SbmPzrv7FHnN9yupfcerlqRtuvRbsThsZeSdbMv1xjLLP2XvKX_NbJdMr J6bTTYzrx6ZUkcNSbQllM0jnxX0U.AC5RCmtOLR6jX1GZH7Ilrz8dbM0yiSp oZ_qVRYaIpWWlhGd_4poHO78AS9PfgzOAMS7b2J9_3xB7qxspIb0mW0E9Vm8 y6GVYe1b3xLL0zEAuhPE5HIJIoy4.zqhwBcpZZbMbuHNOTqs61MEWBuZkvZh bM3NUeI.Zgo0OdkXsWWAG1ayCLLFzbCauJ0RDjTegvhmjNXUzA6PoCTzWvXt eqiettiRhCP1JBDLhcWL9VFGV8Ao4wRkB X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <5532C905.6060403@FreeBSD.org> Date: Sat, 18 Apr 2015 16:13:41 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281703 - head/sys/conf References: <201504182055.t3IKtXJa057401@svn.freebsd.org> In-Reply-To: <201504182055.t3IKtXJa057401@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:13:31 -0000 Oops .. thanks! Pedro. On 04/18/15 15:55, Konstantin Belousov wrote: > Author: kib > Date: Sat Apr 18 20:55:33 2015 > New Revision: 281703 > URL: https://svnweb.freebsd.org/changeset/base/281703 > > Log: > Complete r281670, unlist removed files. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/conf/files > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Sat Apr 18 20:36:58 2015 (r281702) > +++ head/sys/conf/files Sat Apr 18 20:55:33 2015 (r281703) > @@ -2933,8 +2933,6 @@ fs/ext2fs/ext2_bmap.c optional ext2fs > fs/ext2fs/ext2_extents.c optional ext2fs > fs/ext2fs/ext2_inode.c optional ext2fs > fs/ext2fs/ext2_inode_cnv.c optional ext2fs > -fs/ext2fs/ext2_hash.c optional ext2fs > -fs/ext2fs/ext2_htree.c optional ext2fs > fs/ext2fs/ext2_lookup.c optional ext2fs > fs/ext2fs/ext2_subr.c optional ext2fs > fs/ext2fs/ext2_vfsops.c optional ext2fs > From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:19:08 2015 Return-Path: Delivered-To: svn-src-all@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 9A4BCEC1 for ; Sat, 18 Apr 2015 21:19:08 +0000 (UTC) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F825272 for ; Sat, 18 Apr 2015 21:19:07 +0000 (UTC) Received: by wgso17 with SMTP id o17so143996193wgs.1 for ; Sat, 18 Apr 2015 14:19:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=0YXbxMSXaQiXTWYrrTXTNZ/YfA+kLe8mAOm+akHe80k=; b=eQQKppuRlYs16WHDSoKAWvywhvL7uAY5ZGsAHLklom2LnnkHEA8vcPQms5zzJXCTYr 7JhsaiaUnfTe2YhWy/BGHhY7IFncGo1Fib2XJph1jYVA1+FOkqbHI/DLarHFhKdKNXzS zI6uULHTSMEmbaXaEvHUKoTjbyBkCCimG2uEw7jLmX+Td9qHi1GoQHAdhTFLy8gMhj// 0zjM7obpjPQDtoSuSKp668H5F/FzDie9cuqtB9y4fouz2nc/FWxYzNPDT9OdQOaVJuaI ww3CMiAjm6sERc3v/J+nusbk7lfp8xxwbY/0fEal+xzBqNTsz3eLjQNCubn7mcT5DfR/ C+PA== X-Gm-Message-State: ALoCoQkmQmEkXYZs4sHSGhW9fo6CepRK2o/aTqvq65eXxhe7EjTItYVCpw+eebA0R67rRDGAC4Bl X-Received: by 10.180.7.134 with SMTP id j6mr12802843wia.9.1429391940112; Sat, 18 Apr 2015 14:19:00 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id nb9sm8438556wic.10.2015.04.18.14.18.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Apr 2015 14:18:59 -0700 (PDT) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <5532CA47.2030600@freebsd.org> Date: Sat, 18 Apr 2015 22:19:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281705 - in head: cddl/contrib/opensolaris/cmd/dtrace share/man/man4 share/man/man9 References: <201504182100.t3IL0aPM062013@svn.freebsd.org> In-Reply-To: <201504182100.t3IL0aPM062013@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:19:08 -0000 Thank you for doing this! On 18/04/2015 22:00, Mark Johnston wrote: > Author: markj > Date: Sat Apr 18 21:00:36 2015 > New Revision: 281705 > URL: https://svnweb.freebsd.org/changeset/base/281705 > > Log: > Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers. > The format of these pages is somewhat experimental, so they may be subject > to further tweaking. > > Differential Revision: https://reviews.freebsd.org/D2170 > Reviewed by: bcr, rpaulo > MFC after: 2 weeks > > Added: > head/share/man/man4/dtrace-io.4 (contents, props changed) > head/share/man/man4/dtrace-ip.4 (contents, props changed) > head/share/man/man4/dtrace-proc.4 (contents, props changed) > head/share/man/man4/dtrace-sched.4 (contents, props changed) > head/share/man/man4/dtrace-tcp.4 (contents, props changed) > head/share/man/man4/dtrace-udp.4 (contents, props changed) > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > head/share/man/man4/Makefile > head/share/man/man9/SDT.9 > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sat Apr 18 20:55:55 2015 (r281704) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sat Apr 18 21:00:36 2015 (r281705) > @@ -21,7 +21,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 5, 2013 > +.Dd April 18, 2015 > .Dt DTRACE 1 > .Os > .Sh NAME > @@ -670,7 +670,8 @@ Invalid command line options or argument > .Sh SEE ALSO > .Xr cpp 1 , > .Xr dtruss 1 , > -.Xr elf 5 > +.Xr elf 5 , > +.Xr SDT 9 > .Rs > .%T Solaris Dynamic Tracing Guide > .Re > > Modified: head/share/man/man4/Makefile > ============================================================================== > --- head/share/man/man4/Makefile Sat Apr 18 20:55:55 2015 (r281704) > +++ head/share/man/man4/Makefile Sat Apr 18 21:00:36 2015 (r281705) > @@ -121,6 +121,12 @@ MAN= aac.4 \ > dpt.4 \ > ds1307.4 \ > ds3231.4 \ > + ${_dtrace_io.4} \ > + ${_dtrace_ip.4} \ > + ${_dtrace_proc.4} \ > + ${_dtrace_sched.4} \ > + ${_dtrace_tcp.4} \ > + ${_dtrace_udp.4} \ > dummynet.4 \ > ed.4 \ > edsc.4 \ > @@ -812,6 +818,15 @@ SUBDIR= man4.${MACHINE_CPUARCH} > _ccd.4= ccd.4 > .endif > > +.if ${MK_CDDL} != "no" > +_dtrace_io.4= dtrace-io.4 > +_dtrace_ip.4= dtrace-ip.4 > +_dtrace_proc.4= dtrace-proc.4 > +_dtrace_sched.4= dtrace-sched.4 > +_dtrace_tcp.4= dtrace-tcp.4 > +_dtrace_udp.4= dtrace-udp.4 > +.endif > + > .if ${MK_ISCSI} != "no" > MAN+= iscsi.4 > MAN+= iscsi_initiator.4 > > Added: head/share/man/man4/dtrace-io.4 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/dtrace-io.4 Sat Apr 18 21:00:36 2015 (r281705) > @@ -0,0 +1,123 @@ > +.\" Copyright (c) 2015 Mark Johnston > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd April 18, 2015 > +.Dt DTRACE-IO 4 > +.Os > +.Sh NAME > +.Nm dtrace-io > +.Nd a DTrace provider for tracing events related to disk I/O > +.Sh SYNOPSIS > +.Fn io:::start "struct bio *" "struct devstat *" > +.Fn io:::done "struct bio *" "struct devstat *" > +.Sh DESCRIPTION > +The > +.Nm io > +provider allows the tracing of disk I/O events. > +The > +.Fn io:::start > +probe fires when a I/O request is about to be sent to the backing driver of a > +.Xr disk 9 > +object. > +This occurs after all > +.Xr GEOM 4 > +transformations have been performed on the request. > +The > +.Fn io:::done > +probe fires when a I/O request is completed. > +Both probes take a > +.Vt "struct bio *" > +representing the I/O request as their first argument. > +The second argument is a > +.Vt "struct devstat *" > +for the underlying > +.Xr disk 9 > +object. > +.Sh ARGUMENTS > +The fields of > +.Vt "struct bio" > +are described in the > +.Xr g_bio 9 > +manual page, and the fields of > +.Vt "struct devstat" > +are described in the > +.Xr devstat 9 > +manual page. > +Translators for the > +.Vt bufinfo_t > +and > +.Vt devinfo_t > +D types are defined in > +.Pa /usr/lib/dtrace/io.d . > +.Sh FILES > +.Bl -tag -width "/usr/lib/dtrace/io.d" -compact > +.It Pa /usr/lib/dtrace/io.d > +DTrace type and translator definitions for the > +.Nm io > +provider. > +.El > +.Sh EXAMPLES > +The following script shows a per-process breakdown of total I/O by disk device: > +.Bd -literal -offset indent > +#pragma D option quiet > + > +io:::start > +{ > + @[args[1]->device_name, execname, pid] = sum(args[0]->bio_bcount); > +} > + > +END > +{ > + printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES"); > + printa("%10s %20s %10d %15@d\n", @); > +} > +.Ed > +.Sh COMPATIBILITY > +This provider is not compatible with the > +.Nm io > +provider found in Solaris, as its probes use native > +.Fx > +argument types. > +.Sh SEE ALSO > +.Xr dtrace 1 , > +.Xr devstat 9 , > +.Xr SDT 9 > +.Sh HISTORY > +The > +.Nm io > +provider first appeared in > +.Fx > +9.2 and 10.0. > +.Sh AUTHORS > +This manual page was written by > +.An Mark Johnston Aq Mt markj@FreeBSD.org . > +.Sh BUGS > +The > +.Fn io:::wait-start > +and > +.Fn io:::wait-done > +probes are not currently implemented on > +.Fx . > > Added: head/share/man/man4/dtrace-ip.4 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/dtrace-ip.4 Sat Apr 18 21:00:36 2015 (r281705) > @@ -0,0 +1,285 @@ > +.\" Copyright (c) 2015 Mark Johnston > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd April 18, 2015 > +.Dt DTRACE-IP 4 > +.Os > +.Sh NAME > +.Nm dtrace-ip > +.Nd a DTrace provider for tracing events related to the IPv4 and IPv6 protocols > +.Sh SYNOPSIS > +.Fn ip:::receive "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "ifinfo_t *" \ > + "ipv4info_t *" "ipv6info_t *" > +.Fn ip:::send "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "ifinfo_t *" \ > + "ipv4info_t *" "ipv6info_t *" > +.Sh DESCRIPTION > +The DTrace > +.Nm ip > +provider allows users to trace events in the > +.Xr ip 4 > +and > +.Xr ip6 4 > +protocol implementations. > +The > +.Fn ip:::send > +probe fires whenever the kernel prepares to transmit an IP packet, and the > +.Fn ip:::receive > +probe fires whenever the kernel receives an IP packet. > +The arguments to these probes can be used to obtain detailed information about > +the IP headers of the corresponding packet, as well as the network interface on > +which the packet was sent or received. > +Unlike the > +.Xr dtrace-tcp 4 > +and > +.Xr dtrace-udp 4 > +providers, > +.Nm ip > +provider probes are triggered by forwarded packets. > +That is, the probes will fire on packets that are not destined to the local > +host. > +.Sh ARGUMENTS > +The > +.Vt pktinfo_t > +argument is currently unimplemented and is included for compatibility with other > +implementations of this provider. > +Its fields are: > +.Bl -tag -width "uintptr_t pkt_addr" -offset indent > +.It Vt uintptr_t pkt_addr > +Always set to 0. > +.El > +.Pp > +The > +.Vt csinfo_t > +argument is currently unimplemented and is included for compatibility with other > +implementations of this provider. > +Its fields are: > +.Bl -tag -width "uintptr_t cs_addr" -offset indent > +.It Vt uintptr_t cs_addr > +Always set to 0. > +.It Vt uint64_t cs_cid > +A pointer to the > +.Vt struct inpcb > +for this packet, or > +.Dv NULL . > +.It Vt pid_t cs_pid > +Always set to 0. > +.El > +.Pp > +The > +.Vt ipinfo_t > +argument contains IP fields common to both IPv4 and IPv6 packets. > +Its fields are: > +.Bl -tag -width "uint32_t ip_plength" -offset indent > +.It Vt uint8_t ip_ver > +IP version of the packet, 4 for IPv4 packets and 6 for IPv6 packets. > +.It Vt uint32_t ip_plength > +IP payload size. > +This does not include the size of the IP header or IPv6 option headers. > +.It Vt string ip_saddr > +IP source address. > +.It Vt string ip_daddr > +IP destination address. > +.El > +.Pp > +The > +.Vt ifinfo_t > +argument describes the outgoing and incoming interfaces for the packet in the > +.Fn ip:::send > +and > +.Fn ip:::receive > +probes respectively. > +Its fields are: > +.Bl -tag -width "uintptr_t if_addr" -offset indent > +.It Vt string if_name > +The interface name. > +.It Vt int8_t if_local > +A boolean value indicating whether or not the interface is a loopback interface. > +.It Vt uintptr_t if_addr > +A pointer to the > +.Vt struct ifnet > +which describes the interface. > +See the > +.Xr ifnet 9 > +manual page. > +.El > +.Pp > +The > +.Vt ipv4info_t > +argument contains the fields of the IP header for IPv4 packets. > +This argument is > +.Dv NULL > +for IPv6 packets. > +DTrace scripts should use the > +.Fn ip_ver > +field in the > +.Vt ipinfo_t > +argument to determine whether to use this argument. > +Its fields are: > +.Bl -tag -width "uint16_t ipv4_checksum" -offset indent > +.It Vt uint8_t ipv4_ver > +IP version. > +This will always be 4 for IPv4 packets. > +.It Vt uint8_t ipv4_ihl > +The IP header length, including options, in 32-bit words. > +.It Vt uint8_t ipv4_tos > +IP type of service field. > +.It Vt uint16_t ipv4_length > +The total packet length, including the header, in bytes. > +.It Vt uint16_t ipv4_ident > +Identification field. > +.It Vt uint8_t ipv4_flags > +The IP flags. > +.It Vt uint16_t ipv4_offset > +The fragment offset of the packet. > +.It Vt uint8_t ipv4_ttl > +Time to live field. > +.It Vt uint8_t ipv4_protocol > +Next-level protocol ID. > +.It Vt string ipv4_protostr > +A string containing the name of the encapsulated protocol. > +The protocol strings are defined in the > +.Va protocol > +array in > +.Pa /usr/lib/dtrace/ip.d > +.It Vt uint16_t ipv4_checksum > +The IP checksum. > +.It Vt ipaddr_t ipv4_src > +IPv4 source address. > +.It Vt ipaddr_t ipv4_dst > +IPv4 destination address. > +.It Vt string ipv4_saddr > +A string representation of the source address. > +.It Vt string ipv4_daddr > +A string representation of the destination address. > +.It Vt ipha_t *ipv4_hdr > +A pointer to the raw IPv4 header. > +.El > +.Pp > +The > +.Vt ipv6info_t > +argument contains the fields of the IP header for IPv6 packets. > +Its fields are not set for IPv4 packets; as with the > +.Vt ipv4info_t > +argument, the > +.Fn ip_ver > +field should be used to determine whether this argument is valid. > +Its fields are: > +.Bl -tag -width "uint16_t ipv4_checksum" -offset indent > +.It Vt uint8_t ipv6_ver > +IP version. > +This will always be 6 for IPv6 packets. > +.It Vt uint8_t ipv6_tclass > +The traffic class, used to set the differentiated services codepoint and > +extended congestion notification flags. > +.It Vt uint32_t ipv6_flow > +The flow label of the packet. > +.It Vt uint16_t ipv6_plen > +The IP payload size, including extension headers, in bytes. > +.It Vt uint8_t ipv6_nexthdr > +An identifier for the type of the next header. > +.It Vt string ipv6_nextstr > +A string representation of the type of the next header. > +.It Vt uint8_t ipv6_hlim > +The hop limit. > +.It Vt ip6_addr_t *ipv6_src > +IPv6 source address. > +.It Vt ip6_addr_t *ipv6_dst > +IPv6 destination address. > +.It Vt string ipv6_saddr > +A string representation of the source address. > +.It Vt string ipv6_daddr > +A string representation of the destination address. > +.It Vt ip6_t *ipv6_hdr > +A pointer to the raw IPv6 header. > +.El > +.Sh FILES > +.Bl -tag -width "/usr/lib/dtrace/ip.d" -compact > +.It Pa /usr/lib/dtrace/ip.d > +DTrace type and translator definitions for the > +.Nm ip > +provider. > +.El > +.Sh EXAMPLES > +The following script counts received packets by remote host address. > +.Bd -literal -offset indent > +ip:::receive > +{ > + @num[args[2]->ip_saddr] = count(); > +} > +.Ed > +.Pp > +This script will print some details of each IP packet as it is sent or received > +by the kernel: > +.Bd -literal -offset indent > +#pragma D option quiet > +#pramga D option switchrate=10Hz > + > +dtrace:::BEGIN > +{ > + printf(" %10s %30s %-30s %8s %6s\n", "DELTA(us)", "SOURCE", > + "DEST", "INT", "BYTES"); > + last = timestamp; > +} > + > +ip:::send > +{ > + this->elapsed = (timestamp - last) / 1000; > + printf(" %10d %30s -> %-30s %8s %6d\n", this->elapsed, > + args[2]->ip_saddr, args[2]->ip_daddr, args[3]->if_name, > + args[2]->ip_plength); > + last = timestamp; > +} > + > +ip:::receive > +{ > + this->elapsed = (timestamp - last) / 1000; > + printf(" %10d %30s <- %-30s %8s %6d\n", this->elapsed, > + args[2]->ip_daddr, args[2]->ip_saddr, args[3]->if_name, > + args[2]->ip_plength); > + last = timestamp; > +} > +.Ed > +.Sh COMPATIBILITY > +This provider is compatible with the > +.Nm ip > +providers found in Solaris and Darwin. > +.Sh SEE ALSO > +.Xr dtrace 1 , > +.Xr dtrace-tcp 4 , > +.Xr dtrace-udp 4 , > +.Xr ip 4 , > +.Xr ip6 4 , > +.Xr ifnet 9 , > +.Xr SDT 9 > +.Sh HISTORY > +The > +.Nm ip > +provider first appeared in > +.Fx > +10.0. > +.Sh AUTHORS > +This manual page was written by > +.An Mark Johnston Aq Mt markj@FreeBSD.org . > > Added: head/share/man/man4/dtrace-proc.4 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/dtrace-proc.4 Sat Apr 18 21:00:36 2015 (r281705) > @@ -0,0 +1,264 @@ > +.\" Copyright (c) 2015 Mark Johnston > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd April 18, 2015 > +.Dt DTRACE-PROC 4 > +.Os > +.Sh NAME > +.Nm dtrace-proc > +.Nd a DTrace provider for tracing events related to user processes > +.Sh SYNOPSIS > +.Fn proc:::create "struct proc *" "struct proc *" "int" > +.Fn proc:::exec "char *" > +.Fn proc:::exec-failure "int" > +.Fn proc:::exec-success "char *" > +.Fn proc:::exit "int" > +.Fn proc:::signal-clear "int" "ksiginfo_t *" > +.Fn proc:::signal-discard "struct thread *" "struct proc *" "int" > +.Fn proc:::signal-send "struct thread *" "struct proc *" "int" > +.Sh DESCRIPTION > +The DTrace > +.Nm proc > +provider provides insight into events related to user processes: process and > +thread creation and termination events, and process signalling. > +.Pp > +The > +.Fn proc:::create > +probe fires when a user process is created via the > +.Xr fork 2 , > +.Xr vfork 2 , > +.Xr pdfork 2 , > +or > +.Xr rfork 2 > +system calls. > +In particular, kernel processes created with the > +.Xr kproc 9 > +KPI will not trigger this probe. > +The > +.Fn proc:::create > +probe's first two arguments are the parent process and new child process, > +respectively. > +The third argument is a mask of > +.Xr rfork 2 > +flags indicating which process resources are to be shared between the parent and > +child processes. > +.Pp > +The > +.Fn proc:::exec > +probe fires when a process attempts to execute a file. > +Its argument is the specified filename for the file. > +If the attempt fails because of an error, the > +.Fn proc:::exec-failure > +probe will subsequently fire, providing the corresponding > +.Xr errno 2 > +value in its first argument. > +Otherwise, the > +.Fn proc:::exec-success > +probe will fire. > +.Pp > +The > +.Fn proc:::exit > +probe fires when a process exits or is terminated. > +Its argument is the corresponding > +.Dv SIGCHLD > +signal code; valid values are documented in the > +.Xr siginfo 3 > +manual page and defined in > +.Pa signal.h . > +For example, when a process exits normally, the value of > +.Dv args[0] > +will be > +.Dv CLD_EXITED . > +.Pp > +The > +.Fn proc:::signal-send > +probe fires when a signal is about to be sent to a process. > +The > +.Fn proc:::signal-discard > +probe fires when a signal is sent to a process that ignores it. > +This probe will fire after the > +.Fn proc:::signal-send > +probe for the signal in question. > +The arguments to these probes are the thread and process to which the signal > +will be sent, and the signal number of the signal. > +Valid signal numbers are defined in the > +.Xr signal 3 > +manual page. > +The > +.Fn proc:::signal-clear > +probe fires when a pending signal has been cleared by one of the > +.Xr sigwait 2 , > +.Xr sigtimedwait 2 , > +or > +.Xr sigwaitinfo 2 > +system calls. > +Its arguments are the signal number of the cleared signal, and a pointer to > +the corresponding signal information. > +The > +.Vt siginfo_t > +for the signal can be obtained from > +.Dv args[1]->ksi_info . > +.Sh ARGUMENTS > +Though the > +.Nm proc > +provider probes use native > +.Fx > +arguments types, standard D types for processes and threads are available. > +These are > +.Vt psinfo_t > +and > +.Vt lwpsinfo_t > +respectively, and are defined in > +.Pa /usr/lib/dtrace/psinfo.d . > +This file also defines two global variables, > +.Va curpsinfo > +and > +.Va curlwpsinfo , > +which provide representations of the current process and thread using these > +types. > +.Pp > +The fields of > +.Vt psinfo_t > +are: > +.Bl -tag -width "uintptr_t pr_addr" -offset indent > +.It Vt int pr_nlwp > +Number of threads in the process. > +.It Vt pid_t pr_pid > +Process ID. > +.It Vt pid_t pr_ppid > +Process ID of the parent process, or 0 if the process does not have a parent. > +.It Vt pid_t pr_pgid > +Process ID of the process group leader. > +.It Vt pid_t pr_sid > +Session ID, or 0 if the process does not belong to a session. > +.It Vt pid_t pr_uid > +Real user ID. > +.It Vt pid_t pr_euid > +Effective user ID. > +.It Vt pid_t pr_gid > +Real group ID. > +.It Vt pid_t pr_egid > +Effective group ID. > +.It Vt uintptr_t pr_addr > +Pointer to the > +.Vt struct proc > +for the process. > +.It Vt string pr_psargs > +Process arguments. > +.It Vt u_int pr_arglen > +Length of the process argument string. > +.It Vt u_int pr_jailid > +Jail ID of the process. > +.El > +.Pp > +The fields of > +.Vt lwpsinfo_t > +are: > +.Bl -tag -width "uintptr_t pr_wchar" -offset indent > +.It Vt id_t pr_lwpid > +Thread ID. > +.It Vt int pr_flag > +Thread flags. > +.It Vt int pr_pri > +Real scheduling priority of the thread. > +.It Vt char pr_state > +Currently always 0. > +.It Vt char pr_sname > +Currently always > +.Ql ? . > +.It Vt short pr_syscall > +Currently always 0. > +.It Vt uintptr_t pr_addr > +Pointer to the > +.Vt struct thread > +for the thread. > +.It Vt uintptr_t pr_wchan > +Current wait address on which the thread is sleeping. > +.El > +.Sh FILES > +.Bl -tag -width "/usr/lib/dtrace/psinfo.d" -compact > +.It Pa /usr/lib/dtrace/psinfo.d > +DTrace type and translator definitions for the > +.Nm proc > +provider. > +.El > +.Sh EXAMPLES > +The following script logs process execution events as they occur: > +.Bd -literal -offset indent > +#pragma D option quiet > + > +proc:::exec-success > +{ > + printf("%s", curpsinfo->pr_psargs); > +} > +.Ed > +.Pp > +Note that the > +.Dv pr_psargs > +field is subject to the limit defined by the > +.Va kern.ps_arg_cache_limit > +sysctl. > +In particular, processes with an argument list longer than the value defined by > +this sysctl cannot be logged in this way. > +.Sh COMPATIBILITY > +The > +.Nm proc > +provider in > +.Fx > +is not compatible with the > +.Nm proc > +provider in Solaris. > +In particular, > +.Fx > +uses the native > +.Vt "struct proc" > +and > +.Vt "struct thread" > +types for probe arguments rather than translated types. > +Additionally, a number of > +.Nm proc > +provider probes found in Solaris are not currently available on > +.Fx . > +.Sh SEE ALSO > +.Xr dtrace 1 , > +.Xr errno 2 , > +.Xr fork 2 , > +.Xr pdfork 2 , > +.Xr rfork 2 , > +.Xr vfork 2 , > +.Xr siginfo 3 , > +.Xr signal 3 , > +.Xr dtrace-sched 4 , > +.Xr kproc 9 > +.Sh HISTORY > +The > +.Nm proc > +provider first appeared in > +.Fx > +7.1. > +.Sh AUTHORS > +This manual page was written by > +.An Mark Johnston Aq Mt markj@FreeBSD.org . > > Added: head/share/man/man4/dtrace-sched.4 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/dtrace-sched.4 Sat Apr 18 21:00:36 2015 (r281705) > @@ -0,0 +1,227 @@ > +.\" Copyright (c) 2015 Mark Johnston > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd April 18, 2015 > +.Dt DTRACE-SCHED 4 > +.Os > +.Sh NAME > +.Nm dtrace-sched > +.Nd a DTrace provider for tracing CPU scheduling events > +.Sh SYNOPSIS > +.Fn sched:::change-pri "struct thread *" "struct proc *" "uint8_t" > +.Fn sched:::dequeue "struct thread *" "struct proc *" "void *" > +.Fn sched:::enqueue "struct thread *" "struct proc *" "void *" "int" > +.Fn sched:::lend-pri "struct thread *" "struct proc *" "uint8_t" "struct thread *" > +.Fn sched:::load-change "int" "int" > +.Fn sched:::off-cpu "struct thread *" "struct proc *" > +.Fn sched:::on-cpu > +.Fn sched:::preempt > +.Fn sched:::remain-cpu > +.Fn sched:::surrender "struct thread *" "struct proc *" > +.Fn sched:::sleep > +.Fn sched:::tick "struct thread *" "struct proc *" > +.Fn sched:::wakeup "struct thread *" "struct proc *" > +.Sh DESCRIPTION > +The DTrace > +.Nm sched > +provider allows the tracing of events related to CPU scheduling in the 4BSD and > +ULE schedulers. > +.Pp > +The > +.Fn sched:::change-pri > +probe fires when a thread's active scheduling priority is about to be updated. > +The first two arguments are the thread whose priority is about to be changed, > +and the corresponding process. > +The third argument is the new absolute priority for the thread, while the > +current value is given by > +.Dv args[0]->td_priority . > +The > +.Fn sched:::lend-pri > +probe fires when the currently-running thread elevates the priority of another > +thread via priority lending. > +The first two arguments are the thread whose priority is about to be changed, > +and the corresponding process. > +The third argument is the new absolute priority for the thread. > +The fourth argument is the currently-running thread. > +.Pp > +The > +.Fn sched:::dequeue > +probe fires immediately before a runnable thread is removed from a scheduler > +run queue. > +This may occur when the thread is about to begin execution on a CPU, or because > +the thread is being migrated to a different run queue. > +The latter event may occur in several circumstances: the scheduler may be > +attempting to rebalance load between multiple CPUs, the thread's scheduling > +priority may have changed, or the thread's CPU affinity settings may have > +changed. > +The first two arguments to > +.Fn sched:::dequeue > +are the thread and corresponding process. > +The third argument is currently always > +.Dv NULL . > +The > +.Fn sched:::enqueue > +probe fires when a runnable thread is about to be added to a scheduler run > +queue. > +Its first two arguments are the thread and corresponding process. > +The third argument is currently always > +.Dv NULL . > +The fourth argument is a boolean value that is non-zero if the thread is > +enqueued at the beginning of its run queue slot, and zero if the thread is > +instead enqueued at the end. > +.Pp > +The > +.Fn sched:::load-change > +probe fires after the load of a thread queue is adjusted. > +The first argument is the cpuid for the CPU associated with the thread queue, > +and the second argument is the adjusted load of the thread queue, i.e., the > +number of elements in the queue. > +.Pp > +The > +.Fn sched:::off-cpu > +probe is triggered by the scheduler suspending execution of the > +currently-running thread, and the > +.Fn sched:::on-cpu > +probe fires when the current thread has been selected to run on a CPU and is > +about to begin or resume execution. > +The arguments to > +.Fn sched:::off-cpu > +are the thread and corresponding process selected to run following the > +currently-running thread. > +If these two threads are the same, the > +.Fn sched:::remain-cpu > +probe will fire instead. > +.Pp > +The > +.Fn sched:::surrender > +probe fires when the scheduler is called upon to make a scheduling decision by > +a thread running on a different CPU, via an interprocessor interrupt. > +The arguments to this probe are the interrupted thread and its corresponding > +process. > +This probe currently always fires in the context of the interrupted thread. > +.Pp > +The > +.Fn sched:::preempt > +probe will fire immediately before the currently-running thread is preempted. > +When this occurs, the scheduler will select a new thread to run, and one of the > +.Fn sched:::off-cpu > +or > +.Fn sched:::remain-cpu > +probes will subsequently fire, depending on whether or not the scheduler selects > +the preempted thread. > +.Pp > +The > +.Fn sched:::sleep > +probe fires immediately before the currently-running thread is about to suspend > +execution and begin waiting for a condition to be met. > +The > +.Fn sched:::wakeup > +probe fires when a thread is set up to resume execution after having gone to > +sleep. > +Its arguments are the thread being awoken, and the corresponding process. > +.Pp > +The > +.Fn sched:::tick > +fires before each scheduler clock tick. > +Its arguments are the currently-running thread and its corresponding process. > +.Sh ARGUMENTS > +The > +.Nm sched > +provider probes use the kernel types > +.Vt "struct proc" > +and > +.Vt "struct thread" > +to represent processes and threads, respectively. > +These structures have many fields and are defined in > +.Pa sys/proc.h . > +In a probe body, the currently-running thread can always be obtained with the > +.Va curthread > +global variable, which has type > +.Vt "struct thread *" . > +For example, when a running thread is about to sleep, the > +.Fn sched:::sleep > +probe fires in the context of that thread, which can be accessed using > +.Va curthread . > +The > +.Va curcpu > +global variable contains the cpuid of the CPU on which the currently-running > +thread is executing. > +.Sh EXAMPLES > +The following script gives a breakdown of CPU utilization by process name: > +.Bd -literal -offset indent > +sched:::on-cpu > +{ > + self->ts = timestamp; > +} > + > +sched:::off-cpu > +/self->ts != 0/ > +{ > + @[execname] = sum((timestamp - self->ts) / 1000); > + self->ts = 0; > +} > +.Ed > +.Pp > +Here, DTrace stores a timestamp each time a thread is scheduled to run, and > +computes the time elapsed in microseconds when it is descheduled. > +The results are summed by process name. > +.Sh COMPATIBILITY > +This provider is not compatible with the > +.Nm sched > +provider found in Solaris. > +In particular, the probe argument types are native > +.Fx > +types, and the > +.Fn sched:::cpucaps-sleep , > +.Fn sched:::cpucaps-wakeup , > +.Fn sched:::schedctl-nopreempt , > +.Fn sched:::schedctl-preempt , > +and > +.Fn sched:::schedctl-yield > +probes are not available in > +.Fx . > +.Pp > +The > +.Fn sched:::lend-pri > +and > +.Fn sched:::load-change > +probes are specific to > +.Fx . > +.Sh SEE ALSO > +.Xr dtrace 1 , > +.Xr sched_4bsd 4 , > +.Xr sched_ule 4 , > +.Xr SDT 9 , > +.Xr sleepqueue 9 > +.Sh HISTORY > +The > +.Nm sched > +provider first appeared in > +.Fx > +8.4 and 9.1. > +.Sh AUTHORS > +This manual page was written by > +.An Mark Johnston Aq Mt markj@FreeBSD.org . > > Added: head/share/man/man4/dtrace-tcp.4 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/dtrace-tcp.4 Sat Apr 18 21:00:36 2015 (r281705) > @@ -0,0 +1,400 @@ > +.\" Copyright (c) 2015 Mark Johnston > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd April 18, 2015 > +.Dt DTRACE-TCP 4 > +.Os > +.Sh NAME > +.Nm dtrace-tcp > +.Nd a DTrace provider for tracing events related to the > +.Xr tcp 4 > +protocol > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:22:27 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Apr 18 21:23:20 2015 Return-Path: Delivered-To: svn-src-all@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 77152211; Sat, 18 Apr 2015 21:23:20 +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 63FA7351; Sat, 18 Apr 2015 21:23:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILNKeU080987; Sat, 18 Apr 2015 21:23:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILNHUk080941; Sat, 18 Apr 2015 21:23:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182123.t3ILNHUk080941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 21:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:23:20 -0000 Author: kib Date: Sat Apr 18 21:23:16 2015 New Revision: 281707 URL: https://svnweb.freebsd.org/changeset/base/281707 Log: Remove lazy pmap switch code from i386. Naive benchmark with md(4) shows no difference with the code removed. On both amd64 and i386, assert that a released pmap is not active. Proposed and reviewed by: alc Discussed with: Svatopluk Kraus , peter Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/apic_vector.s head/sys/i386/i386/db_trace.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/pmap.c head/sys/i386/i386/swtch.s head/sys/i386/include/smp.h head/sys/i386/xen/mp_machdep.c head/sys/i386/xen/pmap.c head/sys/x86/include/acpica_machdep.h head/sys/x86/xen/xen_apic.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/amd64/amd64/pmap.c Sat Apr 18 21:23:16 2015 (r281707) @@ -2532,6 +2532,8 @@ pmap_release(pmap_t pmap) pmap->pm_stats.resident_count)); KASSERT(vm_radix_is_empty(&pmap->pm_root), ("pmap_release: pmap has reserved page table page(s)")); + KASSERT(CPU_EMPTY(&pmap->pm_active), + ("releasing active pmap %p", pmap)); if (pmap_pcid_enabled) { /* Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/i386/apic_vector.s Sat Apr 18 21:23:16 2015 (r281707) @@ -320,19 +320,4 @@ IDTVEC(rendezvous) POP_FRAME iret -/* - * Clean up when we lose out on the lazy context switch optimization. - * ie: when we are about to release a PTD but a cpu is still borrowing it. - */ - SUPERALIGN_TEXT -IDTVEC(lazypmap) - PUSH_FRAME - SET_KERNEL_SREGS - cld - - call pmap_lazyfix_action - - call as_lapic_eoi - POP_FRAME - iret #endif /* SMP */ Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/i386/db_trace.c Sat Apr 18 21:23:16 2015 (r281707) @@ -316,8 +316,7 @@ db_nextframe(struct i386_frame **fp, db_ frame_type = TRAP_TIMERINT; else if (strcmp(name, "Xcpustop") == 0 || strcmp(name, "Xrendezvous") == 0 || - strcmp(name, "Xipi_intr_bitmap_handler") == 0 || - strcmp(name, "Xlazypmap") == 0) + strcmp(name, "Xipi_intr_bitmap_handler") == 0) frame_type = TRAP_INTERRUPT; } Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:23:16 2015 (r281707) @@ -163,7 +163,6 @@ u_long *ipi_invlrng_counts[MAXCPU]; u_long *ipi_invlpg_counts[MAXCPU]; u_long *ipi_invlcache_counts[MAXCPU]; u_long *ipi_rendezvous_counts[MAXCPU]; -u_long *ipi_lazypmap_counts[MAXCPU]; static u_long *ipi_hardclock_counts[MAXCPU]; #endif @@ -576,10 +575,6 @@ cpu_mp_start(void) setidt(IPI_INVLCACHE, IDTVEC(invlcache), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - /* Install an inter-CPU IPI for lazy pmap release */ - setidt(IPI_LAZYPMAP, IDTVEC(lazypmap), - SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - /* Install an inter-CPU IPI for all-CPU rendezvous */ setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); @@ -1672,8 +1667,6 @@ mp_ipi_intrcnt(void *dummy) intrcnt_add(buf, &ipi_ast_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:rendezvous", i); intrcnt_add(buf, &ipi_rendezvous_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d:lazypmap", i); - intrcnt_add(buf, &ipi_lazypmap_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); intrcnt_add(buf, &ipi_hardclock_counts[i]); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/i386/pmap.c Sat Apr 18 21:23:16 2015 (r281707) @@ -1248,18 +1248,14 @@ pmap_invalidate_cache_pages(vm_page_t *p } /* - * Are we current address space or kernel? N.B. We return FALSE when - * a pmap's page table is in use because a kernel thread is borrowing - * it. The borrowed page table can change spontaneously, making any - * dependence on its continued use subject to a race condition. + * Are we current address space or kernel? */ static __inline int pmap_is_current(pmap_t pmap) { - return (pmap == kernel_pmap || - (pmap == vmspace_pmap(curthread->td_proc->p_vmspace) && - (pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] & PG_FRAME))); + return (pmap == kernel_pmap || pmap == + vmspace_pmap(curthread->td_proc->p_vmspace)); } /* @@ -1923,108 +1919,6 @@ retry: * Pmap allocation/deallocation routines. ***************************************************/ -#ifdef SMP -/* - * Deal with a SMP shootdown of other users of the pmap that we are - * trying to dispose of. This can be a bit hairy. - */ -static cpuset_t *lazymask; -static u_int lazyptd; -static volatile u_int lazywait; - -void pmap_lazyfix_action(void); - -void -pmap_lazyfix_action(void) -{ - -#ifdef COUNT_IPIS - (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; -#endif - if (rcr3() == lazyptd) - load_cr3(curpcb->pcb_cr3); - CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); - atomic_store_rel_int(&lazywait, 1); -} - -static void -pmap_lazyfix_self(u_int cpuid) -{ - - if (rcr3() == lazyptd) - load_cr3(curpcb->pcb_cr3); - CPU_CLR_ATOMIC(cpuid, lazymask); -} - - -static void -pmap_lazyfix(pmap_t pmap) -{ - cpuset_t mymask, mask; - u_int cpuid, spins; - int lsb; - - mask = pmap->pm_active; - while (!CPU_EMPTY(&mask)) { - spins = 50000000; - - /* Find least significant set bit. */ - lsb = CPU_FFS(&mask); - MPASS(lsb != 0); - lsb--; - CPU_SETOF(lsb, &mask); - mtx_lock_spin(&smp_ipi_mtx); -#if defined(PAE) || defined(PAE_TABLES) - lazyptd = vtophys(pmap->pm_pdpt); -#else - lazyptd = vtophys(pmap->pm_pdir); -#endif - cpuid = PCPU_GET(cpuid); - - /* Use a cpuset just for having an easy check. */ - CPU_SETOF(cpuid, &mymask); - if (!CPU_CMP(&mask, &mymask)) { - lazymask = &pmap->pm_active; - pmap_lazyfix_self(cpuid); - } else { - atomic_store_rel_int((u_int *)&lazymask, - (u_int)&pmap->pm_active); - atomic_store_rel_int(&lazywait, 0); - ipi_selected(mask, IPI_LAZYPMAP); - while (lazywait == 0) { - ia32_pause(); - if (--spins == 0) - break; - } - } - mtx_unlock_spin(&smp_ipi_mtx); - if (spins == 0) - printf("pmap_lazyfix: spun for 50000000\n"); - mask = pmap->pm_active; - } -} - -#else /* SMP */ - -/* - * Cleaning up on uniprocessor is easy. For various reasons, we're - * unlikely to have to even execute this code, including the fact - * that the cleanup is deferred until the parent does a wait(2), which - * means that another userland process has run. - */ -static void -pmap_lazyfix(pmap_t pmap) -{ - u_int cr3; - - cr3 = vtophys(pmap->pm_pdir); - if (cr3 == rcr3()) { - load_cr3(curpcb->pcb_cr3); - CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); - } -} -#endif /* SMP */ - /* * Release any resources held by the given physical map. * Called when a pmap initialized by pmap_pinit is being released. @@ -2041,8 +1935,9 @@ pmap_release(pmap_t pmap) pmap->pm_stats.resident_count)); KASSERT(vm_radix_is_empty(&pmap->pm_root), ("pmap_release: pmap has reserved page table page(s)")); + KASSERT(CPU_EMPTY(&pmap->pm_active), + ("releasing active pmap %p", pmap)); - pmap_lazyfix(pmap); mtx_lock_spin(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); mtx_unlock_spin(&allpmaps_lock); Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/i386/swtch.s Sat Apr 18 21:23:16 2015 (r281707) @@ -174,12 +174,6 @@ ENTRY(cpu_switch) /* switch address space */ movl PCB_CR3(%edx),%eax -#if defined(PAE) || defined(PAE_TABLES) - cmpl %eax,IdlePDPT /* Kernel address space? */ -#else - cmpl %eax,IdlePTD /* Kernel address space? */ -#endif - je sw0 READ_CR3(%ebx) /* The same address space? */ cmpl %ebx,%eax je sw0 Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/include/smp.h Sat Apr 18 21:23:16 2015 (r281707) @@ -42,7 +42,6 @@ extern u_long *ipi_invlrng_counts[MAXCPU extern u_long *ipi_invlpg_counts[MAXCPU]; extern u_long *ipi_invlcache_counts[MAXCPU]; extern u_long *ipi_rendezvous_counts[MAXCPU]; -extern u_long *ipi_lazypmap_counts[MAXCPU]; #endif /* IPI handlers */ @@ -54,8 +53,7 @@ inthand_t IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ IDTVEC(cpustop), /* CPU stops & waits to be restarted */ IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ - IDTVEC(rendezvous), /* handle CPU rendezvous */ - IDTVEC(lazypmap); /* handle lazy pmap release */ + IDTVEC(rendezvous); /* handle CPU rendezvous */ /* functions in mp_machdep.c */ void cpu_add(u_int apic_id, char boot_cpu); Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/xen/mp_machdep.c Sat Apr 18 21:23:16 2015 (r281707) @@ -96,7 +96,6 @@ extern struct pcpu __pcpu[]; extern void Xhypervisor_callback(void); extern void failsafe_callback(void); -extern void pmap_lazyfix_action(void); /*--------------------------- Forward Declarations ---------------------------*/ static driver_filter_t smp_reschedule_interrupt; @@ -370,24 +369,16 @@ iv_invlcache(uintptr_t a, uintptr_t b) atomic_add_int(&smp_tlb_wait, 1); } -static void -iv_lazypmap(uintptr_t a, uintptr_t b) -{ - pmap_lazyfix_action(); - atomic_add_int(&smp_tlb_wait, 1); -} - /* * These start from "IPI offset" APIC_IPI_INTS */ -static call_data_func_t *ipi_vectors[6] = +static call_data_func_t *ipi_vectors[5] = { iv_rendezvous, iv_invltlb, iv_invlpg, iv_invlrng, iv_invlcache, - iv_lazypmap, }; /* Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/i386/xen/pmap.c Sat Apr 18 21:23:16 2015 (r281707) @@ -1652,107 +1652,6 @@ retry: * Pmap allocation/deallocation routines. ***************************************************/ -#ifdef SMP -/* - * Deal with a SMP shootdown of other users of the pmap that we are - * trying to dispose of. This can be a bit hairy. - */ -static cpuset_t *lazymask; -static u_int lazyptd; -static volatile u_int lazywait; - -void pmap_lazyfix_action(void); - -void -pmap_lazyfix_action(void) -{ - -#ifdef COUNT_IPIS - (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; -#endif - if (rcr3() == lazyptd) - load_cr3(PCPU_GET(curpcb)->pcb_cr3); - CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); - atomic_store_rel_int(&lazywait, 1); -} - -static void -pmap_lazyfix_self(u_int cpuid) -{ - - if (rcr3() == lazyptd) - load_cr3(PCPU_GET(curpcb)->pcb_cr3); - CPU_CLR_ATOMIC(cpuid, lazymask); -} - - -static void -pmap_lazyfix(pmap_t pmap) -{ - cpuset_t mymask, mask; - u_int cpuid, spins; - int lsb; - - mask = pmap->pm_active; - while (!CPU_EMPTY(&mask)) { - spins = 50000000; - - /* Find least significant set bit. */ - lsb = CPU_FFS(&mask); - MPASS(lsb != 0); - lsb--; - CPU_SETOF(lsb, &mask); - mtx_lock_spin(&smp_ipi_mtx); -#ifdef PAE - lazyptd = vtophys(pmap->pm_pdpt); -#else - lazyptd = vtophys(pmap->pm_pdir); -#endif - cpuid = PCPU_GET(cpuid); - - /* Use a cpuset just for having an easy check. */ - CPU_SETOF(cpuid, &mymask); - if (!CPU_CMP(&mask, &mymask)) { - lazymask = &pmap->pm_active; - pmap_lazyfix_self(cpuid); - } else { - atomic_store_rel_int((u_int *)&lazymask, - (u_int)&pmap->pm_active); - atomic_store_rel_int(&lazywait, 0); - ipi_selected(mask, IPI_LAZYPMAP); - while (lazywait == 0) { - ia32_pause(); - if (--spins == 0) - break; - } - } - mtx_unlock_spin(&smp_ipi_mtx); - if (spins == 0) - printf("pmap_lazyfix: spun for 50000000\n"); - mask = pmap->pm_active; - } -} - -#else /* SMP */ - -/* - * Cleaning up on uniprocessor is easy. For various reasons, we're - * unlikely to have to even execute this code, including the fact - * that the cleanup is deferred until the parent does a wait(2), which - * means that another userland process has run. - */ -static void -pmap_lazyfix(pmap_t pmap) -{ - u_int cr3; - - cr3 = vtophys(pmap->pm_pdir); - if (cr3 == rcr3()) { - load_cr3(PCPU_GET(curpcb)->pcb_cr3); - CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); - } -} -#endif /* SMP */ /* * Release any resources held by the given physical map. @@ -1780,7 +1679,8 @@ pmap_release(pmap_t pmap) mtx_lock(&createdelete_lock); #endif - pmap_lazyfix(pmap); + KASSERT(CPU_EMPTY(&pmap->pm_active), + ("releasing active pmap %p", pmap)); mtx_lock_spin(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); mtx_unlock_spin(&allpmaps_lock); Modified: head/sys/x86/include/acpica_machdep.h ============================================================================== --- head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:23:16 2015 (r281707) @@ -74,6 +74,7 @@ enum intr_polarity; void acpi_SetDefaultIntrModel(int model); void acpi_cpu_c1(void); +void acpi_cpu_idle_mwait(uint32_t mwait_hint); void *acpi_map_table(vm_paddr_t pa, const char *sig); void acpi_unmap_table(void *table); vm_paddr_t acpi_find_table(const char *sig); Modified: head/sys/x86/xen/xen_apic.c ============================================================================== --- head/sys/x86/xen/xen_apic.c Sat Apr 18 21:22:26 2015 (r281706) +++ head/sys/x86/xen/xen_apic.c Sat Apr 18 21:23:16 2015 (r281707) @@ -68,9 +68,6 @@ static driver_filter_t xen_invltlb; static driver_filter_t xen_invlpg; static driver_filter_t xen_invlrng; static driver_filter_t xen_invlcache; -#ifdef __i386__ -static driver_filter_t xen_lazypmap; -#endif static driver_filter_t xen_ipi_bitmap_handler; static driver_filter_t xen_cpustop_handler; static driver_filter_t xen_cpususpend_handler; @@ -79,9 +76,6 @@ static driver_filter_t xen_cpustophard_h /*---------------------------- Extern Declarations ---------------------------*/ /* Variables used by mp_machdep to perform the MMU related IPIs */ -#ifdef __i386__ -extern void pmap_lazyfix_action(void); -#endif #ifdef __amd64__ extern int pmap_pcid_enabled; #endif @@ -104,9 +98,6 @@ static struct xen_ipi_handler xen_ipis[] [IPI_TO_IDX(IPI_INVLPG)] = { xen_invlpg, "ipg" }, [IPI_TO_IDX(IPI_INVLRNG)] = { xen_invlrng, "irg" }, [IPI_TO_IDX(IPI_INVLCACHE)] = { xen_invlcache, "ic" }, -#ifdef __i386__ - [IPI_TO_IDX(IPI_LAZYPMAP)] = { xen_lazypmap, "lp" }, -#endif [IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, [IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, [IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, @@ -474,16 +465,6 @@ xen_invlcache(void *arg) return (FILTER_HANDLED); } -#ifdef __i386__ -static int -xen_lazypmap(void *arg) -{ - - pmap_lazyfix_action(); - return (FILTER_HANDLED); -} -#endif - static int xen_cpustop_handler(void *arg) { From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:24:47 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Apr 18 21:26:48 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Apr 18 21:27:29 2015 Return-Path: Delivered-To: svn-src-all@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 BAF08610; Sat, 18 Apr 2015 21:27: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 A9457388; Sat, 18 Apr 2015 21:27: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 t3ILRThW083277; Sat, 18 Apr 2015 21:27:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILRTZQ083276; Sat, 18 Apr 2015 21:27:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182127.t3ILRTZQ083276@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 21:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281710 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:27:29 -0000 Author: kib Date: Sat Apr 18 21:27:28 2015 New Revision: 281710 URL: https://svnweb.freebsd.org/changeset/base/281710 Log: Revert unrelated chunk from the r281707. MFC after: 2 weeks Modified: head/sys/x86/include/acpica_machdep.h Modified: head/sys/x86/include/acpica_machdep.h ============================================================================== --- head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:26:47 2015 (r281709) +++ head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:27:28 2015 (r281710) @@ -74,7 +74,6 @@ enum intr_polarity; void acpi_SetDefaultIntrModel(int model); void acpi_cpu_c1(void); -void acpi_cpu_idle_mwait(uint32_t mwait_hint); void *acpi_map_table(vm_paddr_t pa, const char *sig); void acpi_unmap_table(void *table); vm_paddr_t acpi_find_table(const char *sig); From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:31:37 2015 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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); From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:35:44 2015 Return-Path: Delivered-To: svn-src-all@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 784EA969; Sat, 18 Apr 2015 21:35: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 64DBA651; Sat, 18 Apr 2015 21:35: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 t3ILZiPg091390; Sat, 18 Apr 2015 21:35:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILZgqH091364; Sat, 18 Apr 2015 21:35:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182135.t3ILZgqH091364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 21:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281712 - in head: lib/libc/gen lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:35:44 -0000 Author: kib Date: Sat Apr 18 21:35:41 2015 New Revision: 281712 URL: https://svnweb.freebsd.org/changeset/base/281712 Log: Make wait6(2), waitid(3) and ppoll(2) cancellation points. The waitid() function is required to be cancellable by the standard. The wait6() and ppoll() follow the other syscalls in their groups. Reviewed by: jhb, jilles (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week Added: head/lib/libc/sys/ppoll.c (contents, props changed) head/lib/libc/sys/wait6.c (contents, props changed) Modified: head/lib/libc/gen/waitid.c head/lib/libc/include/libc_private.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/interposing_table.c head/lib/libthr/thread/thr_syscalls.c head/share/man/man3/pthread_testcancel.3 Modified: head/lib/libc/gen/waitid.c ============================================================================== --- head/lib/libc/gen/waitid.c Sat Apr 18 21:31:36 2015 (r281711) +++ head/lib/libc/gen/waitid.c Sat Apr 18 21:35:41 2015 (r281712) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" int __waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags) @@ -44,7 +45,9 @@ __waitid(idtype_t idtype, id_t id, sigin int status; pid_t ret; - ret = _wait6(idtype, id, &status, flags, NULL, info); + ret = ((pid_t (*)(idtype_t, id_t, int *, int, struct __wrusage *, + siginfo_t *))__libc_interposing[INTERPOS_wait6])(idtype, id, + &status, flags, NULL, info); /* * According to SUSv4, waitid() shall not return a PID when a Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sat Apr 18 21:31:36 2015 (r281711) +++ head/lib/libc/include/libc_private.h Sat Apr 18 21:35:41 2015 (r281712) @@ -222,6 +222,8 @@ enum { INTERPOS_spinlock, INTERPOS_spinunlock, INTERPOS_kevent, + INTERPOS_wait6, + INTERPOS_ppoll, INTERPOS_MAX }; @@ -305,6 +307,8 @@ struct timeval; struct timezone; struct __siginfo; struct __ucontext; +struct __wrusage; +enum idtype; int __sys_aio_suspend(const struct aiocb * const[], int, const struct timespec *); int __sys_accept(int, struct sockaddr *, __socklen_t *); @@ -329,6 +333,8 @@ int __sys_pselect(int, struct fd_set *, struct fd_set *, const struct timespec *, const __sigset_t *); int __sys_poll(struct pollfd *, unsigned, int); +int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *, + const __sigset_t *); __ssize_t __sys_pread(int, void *, __size_t, __off_t); __ssize_t __sys_pwrite(int, const void *, __size_t, __off_t); __ssize_t __sys_read(int, void *, __size_t); @@ -357,6 +363,8 @@ int __sys_thr_kill(long, int); int __sys_thr_self(long *); int __sys_truncate(const char *, __off_t); __pid_t __sys_wait4(__pid_t, int *, int, struct rusage *); +__pid_t __sys_wait6(enum idtype, __id_t, int *, int, + struct __wrusage *, struct __siginfo *); __ssize_t __sys_write(int, const void *, __size_t); __ssize_t __sys_writev(int, const struct iovec *, int); Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Sat Apr 18 21:31:36 2015 (r281711) +++ head/lib/libc/sys/Makefile.inc Sat Apr 18 21:35:41 2015 (r281712) @@ -57,6 +57,7 @@ INTERPOSED = \ open \ openat \ poll \ + ppoll \ pselect \ read \ readv \ @@ -73,6 +74,7 @@ INTERPOSED = \ sigwaitinfo \ swapcontext \ wait4 \ + wait6 \ write \ writev Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Sat Apr 18 21:31:36 2015 (r281711) +++ head/lib/libc/sys/interposing_table.c Sat Apr 18 21:35:41 2015 (r281712) @@ -76,6 +76,8 @@ interpos_func_t __libc_interposing[INTER SLOT(spinlock, __libc_spinlock_stub), SLOT(spinunlock, __libc_spinunlock_stub), SLOT(kevent, __sys_kevent), + SLOT(wait6, __sys_wait6), + SLOT(ppoll, __sys_ppoll), }; #undef SLOT Added: head/lib/libc/sys/ppoll.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/ppoll.c Sat Apr 18 21:35:41 2015 (r281712) @@ -0,0 +1,51 @@ +/* + * 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 "libc_private.h" + +__weak_reference(__sys_ppoll, __ppoll); + +#pragma weak ppoll +int +ppoll(struct pollfd pfd[], nfds_t nfds, const struct timespec *__restrict + timeout, const sigset_t *__restrict newsigmask) +{ + + return (((int (*)(struct pollfd *, nfds_t, const struct timespec *, + const sigset_t *)) __libc_interposing[INTERPOS_ppoll])(pfd, nfds, + timeout, newsigmask)); +} Added: head/lib/libc/sys/wait6.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/wait6.c Sat Apr 18 21:35:41 2015 (r281712) @@ -0,0 +1,52 @@ +/* + * 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_wait6, __wait6); + +#pragma weak wait6 +pid_t +wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *ru, + siginfo_t *infop) +{ + + return (((pid_t (*)(idtype_t, id_t, int *, int, struct __wrusage *, + siginfo_t *))__libc_interposing[INTERPOS_wait6])(idtype, id, + status, options, ru, infop)); +} Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Sat Apr 18 21:31:36 2015 (r281711) +++ head/lib/libthr/thread/thr_syscalls.c Sat Apr 18 21:35:41 2015 (r281712) @@ -327,6 +327,26 @@ __thr_poll(struct pollfd *fds, unsigned * the thread is not canceled. */ static int +__thr_ppoll(struct pollfd pfd[], nfds_t nfds, const struct timespec * + timeout, const sigset_t *newsigmask) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_ppoll(pfd, nfds, timeout, newsigmask); + _thr_cancel_leave(curthread, ret == -1); + + return (ret); +} + +/* + * Cancellation behavior: + * Thread may be canceled at start, but if the system call returns something, + * the thread is not canceled. + */ +static int __thr_pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds, const struct timespec *timo, const sigset_t *mask) { @@ -545,6 +565,25 @@ __thr_wait4(pid_t pid, int *status, int /* * Cancellation behavior: + * Thread may be canceled at start, but if the system call returns + * a child pid, the thread is not canceled. + */ +static pid_t +__thr_wait6(idtype_t idtype, id_t id, int *status, int options, + struct __wrusage *ru, siginfo_t *infop) +{ + struct pthread *curthread; + pid_t ret; + + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_wait6(idtype, id, status, options, ru, infop); + _thr_cancel_leave(curthread, ret <= 0); + return (ret); +} + +/* + * Cancellation behavior: * Thread may be canceled at start, but if the thread wrote some data, * it is not canceled. */ @@ -623,6 +662,8 @@ __thr_interpose_libc(void) SLOT(spinlock); SLOT(spinunlock); SLOT(kevent); + SLOT(wait6); + SLOT(ppoll); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = Modified: head/share/man/man3/pthread_testcancel.3 ============================================================================== --- head/share/man/man3/pthread_testcancel.3 Sat Apr 18 21:31:36 2015 (r281711) +++ head/share/man/man3/pthread_testcancel.3 Sat Apr 18 21:35:41 2015 (r281712) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd March 29, 2015 +.Dd April 16, 2015 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -132,6 +132,7 @@ argument is non-zero. .It Fn openat .It Fn pause .It Fn poll +.It Fn ppoll .It Fn pselect .It Fn pthread_cond_timedwait .It Fn pthread_cond_wait @@ -159,6 +160,8 @@ argument is non-zero. .It Fn wait .It Fn wait3 .It Fn wait4 +.It Fn wait6 +.It Fn waitid .It Fn waitpid .It Fn write .It Fn writev From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:39:20 2015 Return-Path: Delivered-To: svn-src-all@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 261C0B3C; Sat, 18 Apr 2015 21:39:20 +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 1253267E; Sat, 18 Apr 2015 21:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILdKdZ093391; Sat, 18 Apr 2015 21:39:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILdHjO093364; Sat, 18 Apr 2015 21:39:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201504182139.t3ILdHjO093364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 18 Apr 2015 21:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281713 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/modules/hwpmc sys/powerpc/booke sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:39:20 -0000 Author: jhibbits Date: Sat Apr 18 21:39:17 2015 New Revision: 281713 URL: https://svnweb.freebsd.org/changeset/base/281713 Log: Implement hwpmc(4) for Freescale e500 core. This supports e500v1, e500v2, and e500mc. Tested only on e500v2, but the performance counters are identical across all, with e500mc having some additional events. Relnotes: Yes Added: head/sys/dev/hwpmc/hwpmc_e500.c (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/sys/conf/files.powerpc head/sys/dev/hwpmc/hwpmc_mpc7xxx.c head/sys/dev/hwpmc/hwpmc_powerpc.c head/sys/dev/hwpmc/hwpmc_powerpc.h head/sys/dev/hwpmc/hwpmc_ppc970.c head/sys/dev/hwpmc/pmc_events.h head/sys/modules/hwpmc/Makefile head/sys/powerpc/booke/interrupt.c head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/pmc_mdep.h Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Sat Apr 18 21:35:41 2015 (r281712) +++ head/lib/libpmc/libpmc.c Sat Apr 18 21:39:17 2015 (r281713) @@ -164,6 +164,7 @@ PMC_CLASSDEP_TABLE(octeon, OCTEON); PMC_CLASSDEP_TABLE(ucf, UCF); PMC_CLASSDEP_TABLE(ppc7450, PPC7450); PMC_CLASSDEP_TABLE(ppc970, PPC970); +PMC_CLASSDEP_TABLE(e500, E500); static struct pmc_event_descr soft_event_table[PMC_EV_DYN_COUNT]; @@ -296,8 +297,9 @@ PMC_MDEP_TABLE(armv7, ARMV7, PMC_CLASS_S PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K); PMC_MDEP_TABLE(mips74k, MIPS74K, PMC_CLASS_SOFT, PMC_CLASS_MIPS74K); PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON); -PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450); -PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970); +PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450, PMC_CLASS_TSC); +PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970, PMC_CLASS_TSC); +PMC_MDEP_TABLE(e500, E500, PMC_CLASS_SOFT, PMC_CLASS_E500, PMC_CLASS_TSC); PMC_MDEP_TABLE(generic, SOFT, PMC_CLASS_SOFT); static const struct pmc_event_descr tsc_event_table[] = @@ -368,6 +370,7 @@ PMC_CLASS_TABLE_DESC(octeon, OCTEON, oct #if defined(__powerpc__) PMC_CLASS_TABLE_DESC(ppc7450, PPC7450, ppc7450, powerpc); PMC_CLASS_TABLE_DESC(ppc970, PPC970, ppc970, powerpc); +PMC_CLASS_TABLE_DESC(e500, E500, e500, powerpc); #endif static struct pmc_class_descr soft_class_table_descr = @@ -2494,6 +2497,12 @@ static struct pmc_event_alias ppc970_ali EV_ALIAS(NULL, NULL) }; +static struct pmc_event_alias e500_aliases[] = { + EV_ALIAS("instructions", "INSTR_COMPLETED"), + EV_ALIAS("cycles", "CYCLES"), + EV_ALIAS(NULL, NULL) +}; + #define POWERPC_KW_OS "os" #define POWERPC_KW_USR "usr" #define POWERPC_KW_ANYTHREAD "anythread" @@ -2949,6 +2958,10 @@ pmc_event_names_of_class(enum pmc_class ev = ppc970_event_table; count = PMC_EVENT_TABLE_SIZE(ppc970); break; + case PMC_CLASS_E500: + ev = e500_event_table; + count = PMC_EVENT_TABLE_SIZE(e500); + break; case PMC_CLASS_SOFT: ev = soft_event_table; count = soft_event_info.pm_nevent; @@ -3245,6 +3258,10 @@ pmc_init(void) PMC_MDEP_INIT(ppc970); pmc_class_table[n] = &ppc970_class_table_descr; break; + case PMC_CPU_PPC_E500: + PMC_MDEP_INIT(e500); + pmc_class_table[n] = &e500_class_table_descr; + break; #endif default: /* @@ -3444,6 +3461,9 @@ _pmc_name_of_event(enum pmc_event pe, en } else if (pe >= PMC_EV_PPC970_FIRST && pe <= PMC_EV_PPC970_LAST) { ev = ppc970_event_table; evfence = ppc970_event_table + PMC_EVENT_TABLE_SIZE(ppc970); + } else if (pe >= PMC_EV_E500_FIRST && pe <= PMC_EV_E500_LAST) { + ev = e500_event_table; + evfence = e500_event_table + PMC_EVENT_TABLE_SIZE(e500); } else if (pe == PMC_EV_TSC_TSC) { ev = tsc_event_table; evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc); Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Apr 18 21:35:41 2015 (r281712) +++ head/sys/conf/files.powerpc Sat Apr 18 21:39:17 2015 (r281713) @@ -31,8 +31,9 @@ dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt # ofwbus depends on simplebus. dev/fdt/simplebus.c optional aim | fdt -dev/hwpmc/hwpmc_powerpc.c optional hwpmc +dev/hwpmc/hwpmc_e500.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc +dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/hwpmc/hwpmc_ppc970.c optional hwpmc dev/iicbus/ad7417.c optional ad7417 powermac dev/iicbus/adm1030.c optional powermac windtunnel | adm1030 powermac Added: head/sys/dev/hwpmc/hwpmc_e500.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hwpmc/hwpmc_e500.c Sat Apr 18 21:39:17 2015 (r281713) @@ -0,0 +1,660 @@ +/*- + * Copyright (c) 2015 Justin Hibbits + * Copyright (c) 2005, Joseph Koshy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include + +#include "hwpmc_powerpc.h" + +#define POWERPC_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \ + PMC_CAP_SYSTEM | PMC_CAP_EDGE | \ + PMC_CAP_THRESHOLD | PMC_CAP_READ | \ + PMC_CAP_WRITE | PMC_CAP_INVERT | \ + PMC_CAP_QUALIFIER) + +#define E500_PMC_HAS_OVERFLOWED(x) (e500_pmcn_read(x) & (0x1 << 31)) + +struct e500_event_code_map { + enum pmc_event pe_ev; /* enum value */ + uint8_t pe_counter_mask; /* Which counter this can be counted in. */ + uint8_t pe_code; /* numeric code */ + uint8_t pe_cpu; /* e500 core (v1,v2,mc), mask */ +}; + +#define E500_MAX_PMCS 4 +#define PMC_PPC_MASK0 0 +#define PMC_PPC_MASK1 1 +#define PMC_PPC_MASK2 2 +#define PMC_PPC_MASK3 3 +#define PMC_PPC_MASK_ALL 0x0f +#define PMC_PPC_E500V1 1 +#define PMC_PPC_E500V2 2 +#define PMC_PPC_E500MC 4 +#define PMC_PPC_E500_ANY 7 +#define PMC_E500_EVENT(id, mask, number, core) \ + [PMC_EV_E500_##id - PMC_EV_E500_FIRST] = \ + { .pe_ev = PMC_EV_E500_##id, .pe_counter_mask = mask, \ + .pe_code = number, .pe_cpu = core } +#define PMC_E500MC_ONLY(id, number) \ + PMC_E500_EVENT(id, PMC_PPC_MASK_ALL, number, PMC_PPC_E500MC) +#define PMC_E500_COMMON(id, number) \ + PMC_E500_EVENT(id, PMC_PPC_MASK_ALL, number, PMC_PPC_E500_ANY) + +static struct e500_event_code_map e500_event_codes[] = { + PMC_E500_COMMON(CYCLES, 1), + PMC_E500_COMMON(INSTR_COMPLETED, 2), + PMC_E500_COMMON(UOPS_COMPLETED, 3), + PMC_E500_COMMON(INSTR_FETCHED, 4), + PMC_E500_COMMON(UOPS_DECODED, 5), + PMC_E500_COMMON(PM_EVENT_TRANSITIONS, 6), + PMC_E500_COMMON(PM_EVENT_CYCLES, 7), + PMC_E500_COMMON(BRANCH_INSTRS_COMPLETED, 8), + PMC_E500_COMMON(LOAD_UOPS_COMPLETED, 9), + PMC_E500_COMMON(STORE_UOPS_COMPLETED, 10), + PMC_E500_COMMON(CQ_REDIRECTS, 11), + PMC_E500_COMMON(BRANCHES_FINISHED, 12), + PMC_E500_COMMON(TAKEN_BRANCHES_FINISHED, 13), + PMC_E500_COMMON(FINISHED_UNCOND_BRANCHES_MISS_BTB, 14), + PMC_E500_COMMON(BRANCH_MISPRED, 15), + PMC_E500_COMMON(BTB_BRANCH_MISPRED_FROM_DIRECTION, 16), + PMC_E500_COMMON(BTB_HITS_PSEUDO_HITS, 17), + PMC_E500_COMMON(CYCLES_DECODE_STALLED, 18), + PMC_E500_COMMON(CYCLES_ISSUE_STALLED, 19), + PMC_E500_COMMON(CYCLES_BRANCH_ISSUE_STALLED, 20), + PMC_E500_COMMON(CYCLES_SU1_SCHED_STALLED, 21), + PMC_E500_COMMON(CYCLES_SU2_SCHED_STALLED, 22), + PMC_E500_COMMON(CYCLES_MU_SCHED_STALLED, 23), + PMC_E500_COMMON(CYCLES_LRU_SCHED_STALLED, 24), + PMC_E500_COMMON(CYCLES_BU_SCHED_STALLED, 25), + PMC_E500_COMMON(TOTAL_TRANSLATED, 26), + PMC_E500_COMMON(LOADS_TRANSLATED, 27), + PMC_E500_COMMON(STORES_TRANSLATED, 28), + PMC_E500_COMMON(TOUCHES_TRANSLATED, 29), + PMC_E500_COMMON(CACHEOPS_TRANSLATED, 30), + PMC_E500_COMMON(CACHE_INHIBITED_ACCESS_TRANSLATED, 31), + PMC_E500_COMMON(GUARDED_LOADS_TRANSLATED, 32), + PMC_E500_COMMON(WRITE_THROUGH_STORES_TRANSLATED, 33), + PMC_E500_COMMON(MISALIGNED_LOAD_STORE_ACCESS_TRANSLATED, 34), + PMC_E500_COMMON(TOTAL_ALLOCATED_TO_DLFB, 35), + PMC_E500_COMMON(LOADS_TRANSLATED_ALLOCATED_TO_DLFB, 36), + PMC_E500_COMMON(STORES_COMPLETED_ALLOCATED_TO_DLFB, 37), + PMC_E500_COMMON(TOUCHES_TRANSLATED_ALLOCATED_TO_DLFB, 38), + PMC_E500_COMMON(STORES_COMPLETED, 39), + PMC_E500_COMMON(DATA_L1_CACHE_LOCKS, 40), + PMC_E500_COMMON(DATA_L1_CACHE_RELOADS, 41), + PMC_E500_COMMON(DATA_L1_CACHE_CASTOUTS, 42), + PMC_E500_COMMON(LOAD_MISS_DLFB_FULL, 43), + PMC_E500_COMMON(LOAD_MISS_LDQ_FULL, 44), + PMC_E500_COMMON(LOAD_GUARDED_MISS, 45), + PMC_E500_COMMON(STORE_TRANSLATE_WHEN_QUEUE_FULL, 46), + PMC_E500_COMMON(ADDRESS_COLLISION, 47), + PMC_E500_COMMON(DATA_MMU_MISS, 48), + PMC_E500_COMMON(DATA_MMU_BUSY, 49), + PMC_E500_COMMON(PART2_MISALIGNED_CACHE_ACCESS, 50), + PMC_E500_COMMON(LOAD_MISS_DLFB_FULL_CYCLES, 51), + PMC_E500_COMMON(LOAD_MISS_LDQ_FULL_CYCLES, 52), + PMC_E500_COMMON(LOAD_GUARDED_MISS_CYCLES, 53), + PMC_E500_COMMON(STORE_TRANSLATE_WHEN_QUEUE_FULL_CYCLES, 54), + PMC_E500_COMMON(ADDRESS_COLLISION_CYCLES, 55), + PMC_E500_COMMON(DATA_MMU_MISS_CYCLES, 56), + PMC_E500_COMMON(DATA_MMU_BUSY_CYCLES, 57), + PMC_E500_COMMON(PART2_MISALIGNED_CACHE_ACCESS_CYCLES, 58), + PMC_E500_COMMON(INSTR_L1_CACHE_LOCKS, 59), + PMC_E500_COMMON(INSTR_L1_CACHE_RELOADS, 60), + PMC_E500_COMMON(INSTR_L1_CACHE_FETCHES, 61), + PMC_E500_COMMON(INSTR_MMU_TLB4K_RELOADS, 62), + PMC_E500_COMMON(INSTR_MMU_VSP_RELOADS, 63), + PMC_E500_COMMON(DATA_MMU_TLB4K_RELOADS, 64), + PMC_E500_COMMON(DATA_MMU_VSP_RELOADS, 65), + PMC_E500_COMMON(L2MMU_MISSES, 66), + PMC_E500_COMMON(BIU_MASTER_REQUESTS, 67), + PMC_E500_COMMON(BIU_MASTER_INSTR_SIDE_REQUESTS, 68), + PMC_E500_COMMON(BIU_MASTER_DATA_SIDE_REQUESTS, 69), + PMC_E500_COMMON(BIU_MASTER_DATA_SIDE_CASTOUT_REQUESTS, 70), + PMC_E500_COMMON(BIU_MASTER_RETRIES, 71), + PMC_E500_COMMON(SNOOP_REQUESTS, 72), + PMC_E500_COMMON(SNOOP_HITS, 73), + PMC_E500_COMMON(SNOOP_PUSHES, 74), + PMC_E500_COMMON(SNOOP_RETRIES, 75), + PMC_E500_EVENT(DLFB_LOAD_MISS_CYCLES, PMC_PPC_MASK0|PMC_PPC_MASK1, + 76, PMC_PPC_E500_ANY), + PMC_E500_EVENT(ILFB_FETCH_MISS_CYCLES, PMC_PPC_MASK0|PMC_PPC_MASK1, + 77, PMC_PPC_E500_ANY), + PMC_E500_EVENT(EXT_INPU_INTR_LATENCY_CYCLES, PMC_PPC_MASK0|PMC_PPC_MASK1, + 78, PMC_PPC_E500_ANY), + PMC_E500_EVENT(CRIT_INPUT_INTR_LATENCY_CYCLES, PMC_PPC_MASK0|PMC_PPC_MASK1, + 79, PMC_PPC_E500_ANY), + PMC_E500_EVENT(EXT_INPUT_INTR_PENDING_LATENCY_CYCLES, + PMC_PPC_MASK0|PMC_PPC_MASK1, 80, PMC_PPC_E500_ANY), + PMC_E500_EVENT(CRIT_INPUT_INTR_PENDING_LATENCY_CYCLES, + PMC_PPC_MASK0|PMC_PPC_MASK1, 81, PMC_PPC_E500_ANY), + PMC_E500_COMMON(PMC0_OVERFLOW, 82), + PMC_E500_COMMON(PMC1_OVERFLOW, 83), + PMC_E500_COMMON(PMC2_OVERFLOW, 84), + PMC_E500_COMMON(PMC3_OVERFLOW, 85), + PMC_E500_COMMON(INTERRUPTS_TAKEN, 86), + PMC_E500_COMMON(EXT_INPUT_INTR_TAKEN, 87), + PMC_E500_COMMON(CRIT_INPUT_INTR_TAKEN, 88), + PMC_E500_COMMON(SYSCALL_TRAP_INTR, 89), + PMC_E500_EVENT(TLB_BIT_TRANSITIONS, PMC_PPC_MASK_ALL, 90, + PMC_PPC_E500V2 | PMC_PPC_E500MC), + PMC_E500MC_ONLY(L2_LINEFILL_BUFFER, 91), + PMC_E500MC_ONLY(LV2_VS, 92), + PMC_E500MC_ONLY(CASTOUTS_RELEASED, 93), + PMC_E500MC_ONLY(INTV_ALLOCATIONS, 94), + PMC_E500MC_ONLY(DLFB_RETRIES_TO_MBAR, 95), + PMC_E500MC_ONLY(STORE_RETRIES, 96), + PMC_E500MC_ONLY(STASH_L1_HITS, 97), + PMC_E500MC_ONLY(STASH_L2_HITS, 98), + PMC_E500MC_ONLY(STASH_BUSY_1, 99), + PMC_E500MC_ONLY(STASH_BUSY_2, 100), + PMC_E500MC_ONLY(STASH_BUSY_3, 101), + PMC_E500MC_ONLY(STASH_HITS, 102), + PMC_E500MC_ONLY(STASH_HIT_DLFB, 103), + PMC_E500MC_ONLY(STASH_REQUESTS, 106), + PMC_E500MC_ONLY(STASH_REQUESTS_L1, 107), + PMC_E500MC_ONLY(STASH_REQUESTS_L2, 108), + PMC_E500MC_ONLY(STALLS_NO_CAQ_OR_COB, 109), + PMC_E500MC_ONLY(L2_CACHE_ACCESSES, 110), + PMC_E500MC_ONLY(L2_HIT_CACHE_ACCESSES, 111), + PMC_E500MC_ONLY(L2_CACHE_DATA_ACCESSES, 112), + PMC_E500MC_ONLY(L2_CACHE_DATA_HITS, 113), + PMC_E500MC_ONLY(L2_CACHE_INSTR_ACCESSES, 114), + PMC_E500MC_ONLY(L2_CACHE_INSTR_HITS, 115), + PMC_E500MC_ONLY(L2_CACHE_ALLOCATIONS, 116), + PMC_E500MC_ONLY(L2_CACHE_DATA_ALLOCATIONS, 117), + PMC_E500MC_ONLY(L2_CACHE_DIRTY_DATA_ALLOCATIONS, 118), + PMC_E500MC_ONLY(L2_CACHE_INSTR_ALLOCATIONS, 119), + PMC_E500MC_ONLY(L2_CACHE_UPDATES, 120), + PMC_E500MC_ONLY(L2_CACHE_CLEAN_UPDATES, 121), + PMC_E500MC_ONLY(L2_CACHE_DIRTY_UPDATES, 122), + PMC_E500MC_ONLY(L2_CACHE_CLEAN_REDUNDANT_UPDATES, 123), + PMC_E500MC_ONLY(L2_CACHE_DIRTY_REDUNDANT_UPDATES, 124), + PMC_E500MC_ONLY(L2_CACHE_LOCKS, 125), + PMC_E500MC_ONLY(L2_CACHE_CASTOUTS, 126), + PMC_E500MC_ONLY(L2_CACHE_DATA_DIRTY_HITS, 127), + PMC_E500MC_ONLY(INSTR_LFB_WENT_HIGH_PRIORITY, 128), + PMC_E500MC_ONLY(SNOOP_THROTTLING_TURNED_ON, 129), + PMC_E500MC_ONLY(L2_CLEAN_LINE_INVALIDATIONS, 130), + PMC_E500MC_ONLY(L2_INCOHERENT_LINE_INVALIDATIONS, 131), + PMC_E500MC_ONLY(L2_COHERENT_LINE_INVALIDATIONS, 132), + PMC_E500MC_ONLY(COHERENT_LOOKUP_MISS_DUE_TO_VALID_BUT_INCOHERENT_MATCHES, 133), + PMC_E500MC_ONLY(IAC1S_DETECTED, 140), + PMC_E500MC_ONLY(IAC2S_DETECTED, 141), + PMC_E500MC_ONLY(DAC1S_DTECTED, 144), + PMC_E500MC_ONLY(DAC2S_DTECTED, 145), + PMC_E500MC_ONLY(DVT0_DETECTED, 148), + PMC_E500MC_ONLY(DVT1_DETECTED, 149), + PMC_E500MC_ONLY(DVT2_DETECTED, 150), + PMC_E500MC_ONLY(DVT3_DETECTED, 151), + PMC_E500MC_ONLY(DVT4_DETECTED, 152), + PMC_E500MC_ONLY(DVT5_DETECTED, 153), + PMC_E500MC_ONLY(DVT6_DETECTED, 154), + PMC_E500MC_ONLY(DVT7_DETECTED, 155), + PMC_E500MC_ONLY(CYCLES_COMPLETION_STALLED_NEXUS_FIFO_FULL, 156), + PMC_E500MC_ONLY(FPU_DOUBLE_PUMP, 160), + PMC_E500MC_ONLY(FPU_FINISH, 161), + PMC_E500MC_ONLY(FPU_DIVIDE_CYCLES, 162), + PMC_E500MC_ONLY(FPU_DENORM_INPUT_CYCLES, 163), + PMC_E500MC_ONLY(FPU_RESULT_STALL_CYCLES, 164), + PMC_E500MC_ONLY(FPU_FPSCR_FULL_STALL, 165), + PMC_E500MC_ONLY(FPU_PIPE_SYNC_STALLS, 166), + PMC_E500MC_ONLY(FPU_INPUT_DATA_STALLS, 167), + PMC_E500MC_ONLY(DECORATED_LOADS, 176), + PMC_E500MC_ONLY(DECORATED_STORES, 177), + PMC_E500MC_ONLY(LOAD_RETRIES, 178), + PMC_E500MC_ONLY(STWCX_SUCCESSES, 179), + PMC_E500MC_ONLY(STWCX_FAILURES, 180), +}; + +const size_t e500_event_codes_size = + sizeof(e500_event_codes) / sizeof(e500_event_codes[0]); + +static pmc_value_t +e500_pmcn_read(unsigned int pmc) +{ + switch (pmc) { + case 0: + return mfpmr(PMR_PMC0); + break; + case 1: + return mfpmr(PMR_PMC1); + break; + case 2: + return mfpmr(PMR_PMC2); + break; + case 3: + return mfpmr(PMR_PMC3); + break; + default: + panic("Invalid PMC number: %d\n", pmc); + } +} + +static void +e500_pmcn_write(unsigned int pmc, uint32_t val) +{ + switch (pmc) { + case 0: + mtpmr(PMR_PMC0, val); + break; + case 1: + mtpmr(PMR_PMC1, val); + break; + case 2: + mtpmr(PMR_PMC2, val); + break; + case 3: + mtpmr(PMR_PMC3, val); + break; + default: + panic("Invalid PMC number: %d\n", pmc); + } +} + +static int +e500_read_pmc(int cpu, int ri, pmc_value_t *v) +{ + struct pmc *pm; + pmc_value_t tmp; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < E500_MAX_PMCS, + ("[powerpc,%d] illegal row index %d", __LINE__, ri)); + + pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; + KASSERT(pm, + ("[core,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, + ri)); + + tmp = e500_pmcn_read(ri); + PMCDBG(MDP,REA,2,"ppc-read id=%d -> %jd", ri, tmp); + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + *v = POWERPC_PERFCTR_VALUE_TO_RELOAD_COUNT(tmp); + else + *v = tmp; + + return 0; +} + +static int +e500_write_pmc(int cpu, int ri, pmc_value_t v) +{ + struct pmc *pm; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < E500_MAX_PMCS, + ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); + + pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; + + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + v = POWERPC_RELOAD_COUNT_TO_PERFCTR_VALUE(v); + + PMCDBG(MDP,WRI,1,"powerpc-write cpu=%d ri=%d v=%jx", cpu, ri, v); + + e500_pmcn_write(ri, v); + + return 0; +} + +static int +e500_config_pmc(int cpu, int ri, struct pmc *pm) +{ + struct pmc_hw *phw; + + PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < E500_MAX_PMCS, + ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + + KASSERT(pm == NULL || phw->phw_pmc == NULL, + ("[powerpc,%d] pm=%p phw->pm=%p hwpmc not unconfigured", + __LINE__, pm, phw->phw_pmc)); + + phw->phw_pmc = pm; + + return 0; +} + +static int +e500_start_pmc(int cpu, int ri) +{ + uint32_t config; + struct pmc *pm; + struct pmc_hw *phw; + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + pm = phw->phw_pmc; + config = pm->pm_md.pm_powerpc.pm_powerpc_evsel; + + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + config |= PMLCax_CE; + + /* Enable the PMC. */ + switch (ri) { + case 0: + mtpmr(PMR_PMLCa0, config); + break; + case 1: + mtpmr(PMR_PMLCa1, config); + break; + case 2: + mtpmr(PMR_PMLCa2, config); + break; + case 3: + mtpmr(PMR_PMLCa3, config); + break; + default: + break; + } + + return 0; +} + +static int +e500_stop_pmc(int cpu, int ri) +{ + struct pmc *pm; + struct pmc_hw *phw; + register_t pmc_pmlc; + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + pm = phw->phw_pmc; + + /* + * Disable the PMCs. + */ + switch (ri) { + case 0: + pmc_pmlc = mfpmr(PMR_PMLCa0); + pmc_pmlc |= PMLCax_FC; + mtpmr(PMR_PMLCa0, pmc_pmlc); + break; + case 1: + pmc_pmlc = mfpmr(PMR_PMLCa1); + pmc_pmlc |= PMLCax_FC; + mtpmr(PMR_PMLCa1, pmc_pmlc); + break; + case 2: + pmc_pmlc = mfpmr(PMR_PMLCa2); + pmc_pmlc |= PMLCax_FC; + mtpmr(PMR_PMLCa2, pmc_pmlc); + break; + case 3: + pmc_pmlc = mfpmr(PMR_PMLCa3); + pmc_pmlc |= PMLCax_FC; + mtpmr(PMR_PMLCa3, pmc_pmlc); + break; + default: + break; + } + return 0; +} + +static int +e500_pcpu_init(struct pmc_mdep *md, int cpu) +{ + int first_ri, i; + struct pmc_cpu *pc; + struct powerpc_cpu *pac; + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] wrong cpu number %d", __LINE__, cpu)); + PMCDBG(MDP,INI,1,"powerpc-init cpu=%d", cpu); + + /* Freeze all counters. */ + mtpmr(PMR_PMGC0, PMGC_FAC | PMGC_PMIE | PMGC_FCECE); + + powerpc_pcpu[cpu] = pac = malloc(sizeof(struct powerpc_cpu), M_PMC, + M_WAITOK|M_ZERO); + pac->pc_ppcpmcs = malloc(sizeof(struct pmc_hw) * E500_MAX_PMCS, + M_PMC, M_WAITOK|M_ZERO); + pac->pc_class = PMC_CLASS_E500; + pc = pmc_pcpu[cpu]; + first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_POWERPC].pcd_ri; + KASSERT(pc != NULL, ("[powerpc,%d] NULL per-cpu pointer", __LINE__)); + + for (i = 0, phw = pac->pc_ppcpmcs; i < E500_MAX_PMCS; i++, phw++) { + phw->phw_state = PMC_PHW_FLAG_IS_ENABLED | + PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(i); + phw->phw_pmc = NULL; + pc->pc_hwpmcs[i + first_ri] = phw; + + /* Initialize the PMC to stopped */ + e500_stop_pmc(cpu, i); + } + /* Unfreeze global register. */ + mtpmr(PMR_PMGC0, PMGC_PMIE | PMGC_FCECE); + + return 0; +} + +static int +e500_pcpu_fini(struct pmc_mdep *md, int cpu) +{ + uint32_t pmgc0 = mfpmr(PMR_PMGC0); + + pmgc0 |= PMGC_FAC; + mtpmr(PMR_PMGC0, pmgc0); + mtmsr(mfmsr() & ~PSL_PMM); + + free(powerpc_pcpu[cpu]->pc_ppcpmcs, M_PMC); + free(powerpc_pcpu[cpu], M_PMC); + + return 0; +} + +static int +e500_allocate_pmc(int cpu, int ri, struct pmc *pm, + const struct pmc_op_pmcallocate *a) +{ + enum pmc_event pe; + uint32_t caps, config, counter; + struct e500_event_code_map *ev; + uint16_t vers; + uint8_t pe_cpu_mask; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < E500_MAX_PMCS, + ("[powerpc,%d] illegal row index %d", __LINE__, ri)); + + caps = a->pm_caps; + + pe = a->pm_ev; + config = PMLCax_FCS | PMLCax_FCU | + PMLCax_FCM1 | PMLCax_FCM1; + if (pe < PMC_EV_E500_FIRST || pe > PMC_EV_E500_LAST) + return (EINVAL); + + ev = &e500_event_codes[pe-PMC_EV_E500_FIRST]; + if (ev->pe_code == 0) + return (EINVAL); + + vers = mfpvr() >> 16; + switch (vers) { + case FSL_E500v1: + pe_cpu_mask = ev->pe_code & PMC_PPC_E500V1; + break; + case FSL_E500v2: + pe_cpu_mask = ev->pe_code & PMC_PPC_E500V2; + break; + case FSL_E500mc: + pe_cpu_mask = ev->pe_code & PMC_PPC_E500MC; + break; + } + if (pe_cpu_mask == 0) + return (EINVAL); + + config |= PMLCax_EVENT(ev->pe_code); + counter = ev->pe_counter_mask; + if ((counter & (1 << ri)) == 0) + return (EINVAL); + + if (caps & PMC_CAP_SYSTEM) + config &= ~PMLCax_FCS; + if (caps & PMC_CAP_USER) + config &= ~PMLCax_FCU; + if ((caps & (PMC_CAP_USER | PMC_CAP_SYSTEM)) == 0) + config &= ~(PMLCax_FCS|PMLCax_FCU); + + pm->pm_md.pm_powerpc.pm_powerpc_evsel = config; + + PMCDBG(MDP,ALL,2,"powerpc-allocate ri=%d -> config=0x%x", ri, config); + + return 0; +} + +static int +e500_release_pmc(int cpu, int ri, struct pmc *pmc) +{ + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < E500_MAX_PMCS, + ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + KASSERT(phw->phw_pmc == NULL, + ("[powerpc,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); + + return 0; +} + +static int +e500_intr(int cpu, struct trapframe *tf) +{ + int i, error, retval; + uint32_t config; + struct pmc *pm; + struct powerpc_cpu *pac; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] out of range CPU %d", __LINE__, cpu)); + + PMCDBG(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf, + TRAPF_USERMODE(tf)); + + retval = 0; + + pac = powerpc_pcpu[cpu]; + + config = mfpmr(PMR_PMGC0) & ~PMGC_FAC; + + /* + * look for all PMCs that have interrupted: + * - look for a running, sampling PMC which has overflowed + * and which has a valid 'struct pmc' association + * + * If found, we call a helper to process the interrupt. + */ + + for (i = 0; i < E500_MAX_PMCS; i++) { + if ((pm = pac->pc_ppcpmcs[i].phw_pmc) == NULL || + !PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { + continue; + } + + if (!E500_PMC_HAS_OVERFLOWED(i)) + continue; + + retval = 1; /* Found an interrupting PMC. */ + + if (pm->pm_state != PMC_STATE_RUNNING) + continue; + + /* Stop the counter if logging fails. */ + error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, + TRAPF_USERMODE(tf)); + if (error != 0) + e500_stop_pmc(cpu, i); + + /* reload count. */ + e500_write_pmc(cpu, i, pm->pm_sc.pm_reloadcount); + } + + atomic_add_int(retval ? &pmc_stats.pm_intr_processed : + &pmc_stats.pm_intr_ignored, 1); + + /* Re-enable PERF exceptions. */ + if (retval) + mtpmr(PMR_PMGC0, config | PMGC_PMIE); + + return (retval); +} + +int +pmc_e500_initialize(struct pmc_mdep *pmc_mdep) +{ + struct pmc_classdep *pcd; + + pmc_mdep->pmd_cputype = PMC_CPU_PPC_E500; + + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_POWERPC]; + pcd->pcd_caps = POWERPC_PMC_CAPS; + pcd->pcd_class = PMC_CLASS_E500; + pcd->pcd_num = E500_MAX_PMCS; + pcd->pcd_ri = pmc_mdep->pmd_npmc; + pcd->pcd_width = 32; + + pcd->pcd_allocate_pmc = e500_allocate_pmc; + pcd->pcd_config_pmc = e500_config_pmc; + pcd->pcd_pcpu_fini = e500_pcpu_fini; + pcd->pcd_pcpu_init = e500_pcpu_init; + pcd->pcd_describe = powerpc_describe; + pcd->pcd_get_config = powerpc_get_config; + pcd->pcd_read_pmc = e500_read_pmc; + pcd->pcd_release_pmc = e500_release_pmc; + pcd->pcd_start_pmc = e500_start_pmc; + pcd->pcd_stop_pmc = e500_stop_pmc; + pcd->pcd_write_pmc = e500_write_pmc; + + pmc_mdep->pmd_npmc += E500_MAX_PMCS; + pmc_mdep->pmd_intr = e500_intr; + + return (0); +} Modified: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Sat Apr 18 21:35:41 2015 (r281712) +++ head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Sat Apr 18 21:39:17 2015 (r281713) @@ -567,7 +567,7 @@ mpc7xxx_pcpu_init(struct pmc_mdep *md, i M_PMC, M_WAITOK|M_ZERO); pac->pc_class = PMC_CLASS_PPC7450; pc = pmc_pcpu[cpu]; - first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC7450].pcd_ri; + first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_POWERPC].pcd_ri; KASSERT(pc != NULL, ("[powerpc,%d] NULL per-cpu pointer", __LINE__)); for (i = 0, phw = pac->pc_ppcpmcs; i < MPC7XXX_MAX_PMCS; i++, phw++) { @@ -729,7 +729,7 @@ pmc_mpc7xxx_initialize(struct pmc_mdep * pmc_mdep->pmd_cputype = PMC_CPU_PPC_7450; - pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC7450]; + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_POWERPC]; pcd->pcd_caps = POWERPC_PMC_CAPS; pcd->pcd_class = PMC_CLASS_PPC7450; pcd->pcd_num = MPC7XXX_MAX_PMCS; Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_powerpc.c Sat Apr 18 21:35:41 2015 (r281712) +++ head/sys/dev/hwpmc/hwpmc_powerpc.c Sat Apr 18 21:39:17 2015 (r281713) @@ -175,6 +175,11 @@ pmc_md_initialize() case IBM970MP: error = pmc_ppc970_initialize(pmc_mdep); break; + case FSL_E500v1: + case FSL_E500v2: + case FSL_E500mc: + error = pmc_e500_initialize(pmc_mdep); + break; default: error = -1; break; Modified: head/sys/dev/hwpmc/hwpmc_powerpc.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_powerpc.h Sat Apr 18 21:35:41 2015 (r281712) +++ head/sys/dev/hwpmc/hwpmc_powerpc.h Sat Apr 18 21:39:17 2015 (r281713) @@ -51,6 +51,7 @@ struct powerpc_cpu { extern struct powerpc_cpu **powerpc_pcpu; +extern int pmc_e500_initialize(struct pmc_mdep *pmc_mdep); extern int pmc_mpc7xxx_initialize(struct pmc_mdep *pmc_mdep); extern int pmc_ppc970_initialize(struct pmc_mdep *pmc_mdep); Modified: head/sys/dev/hwpmc/hwpmc_ppc970.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_ppc970.c Sat Apr 18 21:35:41 2015 (r281712) +++ head/sys/dev/hwpmc/hwpmc_ppc970.c Sat Apr 18 21:39:17 2015 (r281713) @@ -555,7 +555,7 @@ ppc970_pcpu_init(struct pmc_mdep *md, in pac->pc_class = PMC_CLASS_PPC970; pc = pmc_pcpu[cpu]; - first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC970].pcd_ri; + first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_POWERPC].pcd_ri; KASSERT(pc != NULL, ("[powerpc,%d] NULL per-cpu pointer", __LINE__)); for (i = 0, phw = pac->pc_ppcpmcs; i < PPC970_MAX_PMCS; i++, phw++) { @@ -661,7 +661,7 @@ pmc_ppc970_initialize(struct pmc_mdep *p pmc_mdep->pmd_cputype = PMC_CPU_PPC_970; - pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC970]; + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_POWERPC]; pcd->pcd_caps = POWERPC_PMC_CAPS; pcd->pcd_class = PMC_CLASS_PPC970; pcd->pcd_num = PPC970_MAX_PMCS; Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Sat Apr 18 21:35:41 2015 (r281712) +++ head/sys/dev/hwpmc/pmc_events.h Sat Apr 18 21:39:17 2015 (r281713) @@ -5379,6 +5379,168 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL #define PMC_EV_PPC970_FIRST PMC_EV_PPC970_INSTR_COMPLETED #define PMC_EV_PPC970_LAST PMC_EV_PPC970_ADDER + +#define __PMC_EV_E500() \ + __PMC_EV(E500, CYCLES) \ + __PMC_EV(E500, INSTR_COMPLETED) \ + __PMC_EV(E500, UOPS_COMPLETED) \ + __PMC_EV(E500, INSTR_FETCHED) \ + __PMC_EV(E500, UOPS_DECODED) \ + __PMC_EV(E500, PM_EVENT_TRANSITIONS) \ + __PMC_EV(E500, PM_EVENT_CYCLES) \ + __PMC_EV(E500, BRANCH_INSTRS_COMPLETED) \ + __PMC_EV(E500, LOAD_UOPS_COMPLETED) \ + __PMC_EV(E500, STORE_UOPS_COMPLETED) \ + __PMC_EV(E500, CQ_REDIRECTS) \ + __PMC_EV(E500, BRANCHES_FINISHED) \ + __PMC_EV(E500, TAKEN_BRANCHES_FINISHED) \ + __PMC_EV(E500, FINISHED_UNCOND_BRANCHES_MISS_BTB) \ + __PMC_EV(E500, BRANCH_MISPRED) \ + __PMC_EV(E500, BTB_BRANCH_MISPRED_FROM_DIRECTION) \ + __PMC_EV(E500, BTB_HITS_PSEUDO_HITS) \ + __PMC_EV(E500, CYCLES_DECODE_STALLED) \ + __PMC_EV(E500, CYCLES_ISSUE_STALLED) \ + __PMC_EV(E500, CYCLES_BRANCH_ISSUE_STALLED) \ + __PMC_EV(E500, CYCLES_SU1_SCHED_STALLED) \ + __PMC_EV(E500, CYCLES_SU2_SCHED_STALLED) \ + __PMC_EV(E500, CYCLES_MU_SCHED_STALLED) \ + __PMC_EV(E500, CYCLES_LRU_SCHED_STALLED) \ + __PMC_EV(E500, CYCLES_BU_SCHED_STALLED) \ + __PMC_EV(E500, TOTAL_TRANSLATED) \ + __PMC_EV(E500, LOADS_TRANSLATED) \ + __PMC_EV(E500, STORES_TRANSLATED) \ + __PMC_EV(E500, TOUCHES_TRANSLATED) \ + __PMC_EV(E500, CACHEOPS_TRANSLATED) \ + __PMC_EV(E500, CACHE_INHIBITED_ACCESS_TRANSLATED) \ + __PMC_EV(E500, GUARDED_LOADS_TRANSLATED) \ + __PMC_EV(E500, WRITE_THROUGH_STORES_TRANSLATED) \ + __PMC_EV(E500, MISALIGNED_LOAD_STORE_ACCESS_TRANSLATED) \ + __PMC_EV(E500, TOTAL_ALLOCATED_TO_DLFB) \ + __PMC_EV(E500, LOADS_TRANSLATED_ALLOCATED_TO_DLFB) \ + __PMC_EV(E500, STORES_COMPLETED_ALLOCATED_TO_DLFB) \ + __PMC_EV(E500, TOUCHES_TRANSLATED_ALLOCATED_TO_DLFB) \ + __PMC_EV(E500, STORES_COMPLETED) \ + __PMC_EV(E500, DATA_L1_CACHE_LOCKS) \ + __PMC_EV(E500, DATA_L1_CACHE_RELOADS) \ + __PMC_EV(E500, DATA_L1_CACHE_CASTOUTS) \ + __PMC_EV(E500, LOAD_MISS_DLFB_FULL) \ + __PMC_EV(E500, LOAD_MISS_LDQ_FULL) \ + __PMC_EV(E500, LOAD_GUARDED_MISS) \ + __PMC_EV(E500, STORE_TRANSLATE_WHEN_QUEUE_FULL) \ + __PMC_EV(E500, ADDRESS_COLLISION) \ + __PMC_EV(E500, DATA_MMU_MISS) \ + __PMC_EV(E500, DATA_MMU_BUSY) \ + __PMC_EV(E500, PART2_MISALIGNED_CACHE_ACCESS) \ + __PMC_EV(E500, LOAD_MISS_DLFB_FULL_CYCLES) \ + __PMC_EV(E500, LOAD_MISS_LDQ_FULL_CYCLES) \ + __PMC_EV(E500, LOAD_GUARDED_MISS_CYCLES) \ + __PMC_EV(E500, STORE_TRANSLATE_WHEN_QUEUE_FULL_CYCLES) \ + __PMC_EV(E500, ADDRESS_COLLISION_CYCLES) \ + __PMC_EV(E500, DATA_MMU_MISS_CYCLES) \ + __PMC_EV(E500, DATA_MMU_BUSY_CYCLES) \ + __PMC_EV(E500, PART2_MISALIGNED_CACHE_ACCESS_CYCLES) \ + __PMC_EV(E500, INSTR_L1_CACHE_LOCKS) \ + __PMC_EV(E500, INSTR_L1_CACHE_RELOADS) \ + __PMC_EV(E500, INSTR_L1_CACHE_FETCHES) \ + __PMC_EV(E500, INSTR_MMU_TLB4K_RELOADS) \ + __PMC_EV(E500, INSTR_MMU_VSP_RELOADS) \ + __PMC_EV(E500, DATA_MMU_TLB4K_RELOADS) \ + __PMC_EV(E500, DATA_MMU_VSP_RELOADS) \ + __PMC_EV(E500, L2MMU_MISSES) \ + __PMC_EV(E500, BIU_MASTER_REQUESTS) \ + __PMC_EV(E500, BIU_MASTER_INSTR_SIDE_REQUESTS) \ + __PMC_EV(E500, BIU_MASTER_DATA_SIDE_REQUESTS) \ + __PMC_EV(E500, BIU_MASTER_DATA_SIDE_CASTOUT_REQUESTS) \ + __PMC_EV(E500, BIU_MASTER_RETRIES) \ + __PMC_EV(E500, SNOOP_REQUESTS) \ + __PMC_EV(E500, SNOOP_HITS) \ + __PMC_EV(E500, SNOOP_PUSHES) \ + __PMC_EV(E500, SNOOP_RETRIES) \ + __PMC_EV(E500, DLFB_LOAD_MISS_CYCLES) \ + __PMC_EV(E500, ILFB_FETCH_MISS_CYCLES) \ + __PMC_EV(E500, EXT_INPU_INTR_LATENCY_CYCLES) \ + __PMC_EV(E500, CRIT_INPUT_INTR_LATENCY_CYCLES) \ + __PMC_EV(E500, EXT_INPUT_INTR_PENDING_LATENCY_CYCLES) \ + __PMC_EV(E500, CRIT_INPUT_INTR_PENDING_LATENCY_CYCLES) \ + __PMC_EV(E500, PMC0_OVERFLOW) \ + __PMC_EV(E500, PMC1_OVERFLOW) \ + __PMC_EV(E500, PMC2_OVERFLOW) \ + __PMC_EV(E500, PMC3_OVERFLOW) \ + __PMC_EV(E500, INTERRUPTS_TAKEN) \ + __PMC_EV(E500, EXT_INPUT_INTR_TAKEN) \ + __PMC_EV(E500, CRIT_INPUT_INTR_TAKEN) \ + __PMC_EV(E500, SYSCALL_TRAP_INTR) \ + __PMC_EV(E500, TLB_BIT_TRANSITIONS) \ + __PMC_EV(E500, L2_LINEFILL_BUFFER) \ + __PMC_EV(E500, LV2_VS) \ + __PMC_EV(E500, CASTOUTS_RELEASED) \ + __PMC_EV(E500, INTV_ALLOCATIONS) \ + __PMC_EV(E500, DLFB_RETRIES_TO_MBAR) \ + __PMC_EV(E500, STORE_RETRIES) \ + __PMC_EV(E500, STASH_L1_HITS) \ + __PMC_EV(E500, STASH_L2_HITS) \ + __PMC_EV(E500, STASH_BUSY_1) \ + __PMC_EV(E500, STASH_BUSY_2) \ + __PMC_EV(E500, STASH_BUSY_3) \ + __PMC_EV(E500, STASH_HITS) \ + __PMC_EV(E500, STASH_HIT_DLFB) \ + __PMC_EV(E500, STASH_REQUESTS) \ + __PMC_EV(E500, STASH_REQUESTS_L1) \ + __PMC_EV(E500, STASH_REQUESTS_L2) \ + __PMC_EV(E500, STALLS_NO_CAQ_OR_COB) \ + __PMC_EV(E500, L2_CACHE_ACCESSES) \ + __PMC_EV(E500, L2_HIT_CACHE_ACCESSES) \ + __PMC_EV(E500, L2_CACHE_DATA_ACCESSES) \ + __PMC_EV(E500, L2_CACHE_DATA_HITS) \ + __PMC_EV(E500, L2_CACHE_INSTR_ACCESSES) \ + __PMC_EV(E500, L2_CACHE_INSTR_HITS) \ + __PMC_EV(E500, L2_CACHE_ALLOCATIONS) \ + __PMC_EV(E500, L2_CACHE_DATA_ALLOCATIONS) \ + __PMC_EV(E500, L2_CACHE_DIRTY_DATA_ALLOCATIONS) \ + __PMC_EV(E500, L2_CACHE_INSTR_ALLOCATIONS) \ + __PMC_EV(E500, L2_CACHE_UPDATES) \ + __PMC_EV(E500, L2_CACHE_CLEAN_UPDATES) \ + __PMC_EV(E500, L2_CACHE_DIRTY_UPDATES) \ + __PMC_EV(E500, L2_CACHE_CLEAN_REDUNDANT_UPDATES) \ + __PMC_EV(E500, L2_CACHE_DIRTY_REDUNDANT_UPDATES) \ + __PMC_EV(E500, L2_CACHE_LOCKS) \ + __PMC_EV(E500, L2_CACHE_CASTOUTS) \ + __PMC_EV(E500, L2_CACHE_DATA_DIRTY_HITS) \ + __PMC_EV(E500, INSTR_LFB_WENT_HIGH_PRIORITY) \ + __PMC_EV(E500, SNOOP_THROTTLING_TURNED_ON) \ + __PMC_EV(E500, L2_CLEAN_LINE_INVALIDATIONS) \ + __PMC_EV(E500, L2_INCOHERENT_LINE_INVALIDATIONS) \ + __PMC_EV(E500, L2_COHERENT_LINE_INVALIDATIONS) \ + __PMC_EV(E500, COHERENT_LOOKUP_MISS_DUE_TO_VALID_BUT_INCOHERENT_MATCHES) \ + __PMC_EV(E500, IAC1S_DETECTED) \ + __PMC_EV(E500, IAC2S_DETECTED) \ + __PMC_EV(E500, DAC1S_DTECTED) \ + __PMC_EV(E500, DAC2S_DTECTED) \ + __PMC_EV(E500, DVT0_DETECTED) \ + __PMC_EV(E500, DVT1_DETECTED) \ + __PMC_EV(E500, DVT2_DETECTED) \ + __PMC_EV(E500, DVT3_DETECTED) \ + __PMC_EV(E500, DVT4_DETECTED) \ + __PMC_EV(E500, DVT5_DETECTED) \ + __PMC_EV(E500, DVT6_DETECTED) \ + __PMC_EV(E500, DVT7_DETECTED) \ + __PMC_EV(E500, CYCLES_COMPLETION_STALLED_NEXUS_FIFO_FULL) \ + __PMC_EV(E500, FPU_DOUBLE_PUMP) \ + __PMC_EV(E500, FPU_FINISH) \ + __PMC_EV(E500, FPU_DIVIDE_CYCLES) \ + __PMC_EV(E500, FPU_DENORM_INPUT_CYCLES) \ + __PMC_EV(E500, FPU_RESULT_STALL_CYCLES) \ + __PMC_EV(E500, FPU_FPSCR_FULL_STALL) \ + __PMC_EV(E500, FPU_PIPE_SYNC_STALLS) \ + __PMC_EV(E500, FPU_INPUT_DATA_STALLS) \ + __PMC_EV(E500, DECORATED_LOADS) \ + __PMC_EV(E500, DECORATED_STORES) \ + __PMC_EV(E500, LOAD_RETRIES) \ + __PMC_EV(E500, STWCX_SUCCESSES) \ + __PMC_EV(E500, STWCX_FAILURES) \ + +#define PMC_EV_E500_FIRST PMC_EV_E500_CYCLES +#define PMC_EV_E500_LAST PMC_EV_E500_STWCX_FAILURES /* * All known PMC events. * @@ -5400,6 +5562,9 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL * 0x11300 0x00FF MIPS 24K events * 0x11400 0x00FF Octeon events * 0x11500 0x00FF MIPS 74K events + * 0x13000 0x00FF MPC7450 events + * 0x13100 0x00FF IBM PPC970 events + * 0x13300 0x00FF Freescale e500 events * 0x14000 0x0100 ARMv7 events * 0x20000 0x1000 Software events */ @@ -5436,6 +5601,8 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL __PMC_EV_PPC7450() \ __PMC_EV_BLOCK(PPC970, 0x13100) \ __PMC_EV_PPC970() \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:50:19 2015 Return-Path: Delivered-To: svn-src-all@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 EE0A5D1B; Sat, 18 Apr 2015 21:50: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 D90F97C2; Sat, 18 Apr 2015 21:50: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 t3ILoJhg003193; Sat, 18 Apr 2015 21:50:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILoE4O003128; Sat, 18 Apr 2015 21:50:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182150.t3ILoE4O003128@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 21:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281714 - in head: lib/libc lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/include lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/sparc64/sys lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:50:20 -0000 Author: kib Date: Sat Apr 18 21:50:13 2015 New Revision: 281714 URL: https://svnweb.freebsd.org/changeset/base/281714 Log: The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), and pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x kernels which required padding before the off_t parameter. The fcntl(2) contains compatibility code to handle kernels before the struct flock was changed during the 8.x CURRENT development. The shims were reasonable to allow easier revert to the older kernel at that time. Now, two or three major releases later, shims do not serve any purpose. Such old kernels cannot handle current libc, so revert the compatibility code. Make padded syscalls support conditional under the COMPAT6 config option. For COMPAT32, the syscalls were under COMPAT6 already. Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to (partially) disable the removed shims. Reviewed by: jhb, imp (previous versions) Discussed with: peter Sponsored by: The FreeBSD Foundation MFC after: 1 week Deleted: head/lib/libc/sys/ftruncate.c head/lib/libc/sys/lseek.c head/lib/libc/sys/mmap.c head/lib/libc/sys/pread.c head/lib/libc/sys/pwrite.c head/lib/libc/sys/truncate.c head/tools/build/options/WITHOUT_SYSCALL_COMPAT Modified: head/lib/libc/Makefile head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/include/compat.h head/lib/libc/include/libc_private.h head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libc/sys/fcntl.c head/lib/libc/sys/interposing_table.c head/lib/libthr/Makefile head/lib/libthr/thread/thr_syscalls.c head/share/mk/src.opts.mk head/sys/kern/sys_generic.c head/sys/kern/syscalls.master head/sys/kern/vfs_syscalls.c head/sys/vm/vm_mmap.c Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/Makefile Sat Apr 18 21:50:13 2015 (r281714) @@ -157,10 +157,6 @@ libkern.${LIBC_ARCH}:: ${KMSRCS} ${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} .endif -.if ${MK_SYSCALL_COMPAT} != "no" -CFLAGS+=-DSYSCALL_COMPAT -.endif - .include .include Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/amd64/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -11,6 +11,3 @@ MDASM= vfork.S brk.S cerror.S exect.S ge NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/arm/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -8,6 +8,3 @@ MDASM= Ovfork.S brk.S cerror.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/i386/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -15,9 +15,6 @@ MDASM= Ovfork.S brk.S cerror.S exect.S g NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2 MAN+= i386_set_watch.3 Modified: head/lib/libc/include/compat.h ============================================================================== --- head/lib/libc/include/compat.h Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/include/compat.h Sat Apr 18 21:50:13 2015 (r281714) @@ -47,9 +47,7 @@ __sym_compat(shmctl, freebsd7_shmctl, FB #define __weak_reference(sym,alias) \ .weak alias;.equ alias,sym -#ifndef SYSCALL_COMPAT __weak_reference(__sys_fcntl,__fcntl_compat) -#endif #undef __weak_reference Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/include/libc_private.h Sat Apr 18 21:50:13 2015 (r281714) @@ -278,21 +278,12 @@ extern void (*__cleanup)(void) __hidden; /* * Get kern.osreldate to detect ABI revisions. Explicitly - * ignores value of $OSVERSION and caches result. Prototypes - * for the wrapped "new" pad-less syscalls are here for now. + * ignores value of $OSVERSION and caches result. */ int __getosreldate(void); #include #include -/* With pad */ -__off_t __sys_freebsd6_lseek(int, int, __off_t, int); -int __sys_freebsd6_ftruncate(int, int, __off_t); -int __sys_freebsd6_truncate(const char *, int, __off_t); -__ssize_t __sys_freebsd6_pread(int, void *, __size_t, int, __off_t); -__ssize_t __sys_freebsd6_pwrite(int, const void *, __size_t, int, __off_t); -void * __sys_freebsd6_mmap(void *, __size_t, int, int, int, int, __off_t); - struct aiocb; struct fd_set; struct iovec; Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/mips/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -6,10 +6,6 @@ MDASM= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S ptrace.S sbrk.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o ftruncate.o getlogin.o lseek.o mmap.o \ - openbsd_poll.o pread.o pwrite.o sstk.o truncate.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/powerpc/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -6,6 +6,3 @@ MDASM+= brk.S cerror.S exect.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/powerpc64/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -6,6 +6,3 @@ MDASM+= brk.S cerror.S exect.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/sparc64/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -18,6 +18,3 @@ MDASM+= brk.S cerror.S exect.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o -.if ${MK_SYSCALL_COMPAT} != "no" -PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o -.endif Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/sys/Makefile.inc Sat Apr 18 21:50:13 2015 (r281714) @@ -26,18 +26,6 @@ SRCS+= \ __error.c \ interposing_table.c -.if ${MK_SYSCALL_COMPAT} != "no" -SYSCALL_COMPAT_SRCS= \ - ftruncate.c \ - lseek.c \ - mmap.c \ - pread.c \ - pwrite.c \ - truncate.c -SRCS+= ${SYSCALL_COMPAT_SRCS} -NOASM+= ${SYSCALL_COMPAT_SRCS:S/.c/.o/} -.endif - SRCS+= futimens.c utimensat.c NOASM+= futimens.o utimensat.o PSEUDO+= _futimens.o _utimensat.o Modified: head/lib/libc/sys/fcntl.c ============================================================================== --- head/lib/libc/sys/fcntl.c Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/sys/fcntl.c Sat Apr 18 21:50:13 2015 (r281714) @@ -3,6 +3,12 @@ * Authors: Doug Rabson * Developed with Red Inc: Alfred Perlstein * + * Copyright (c) 2014-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: @@ -48,59 +54,3 @@ fcntl(int fd, int cmd, ...) return (((int (*)(int, int, ...)) __libc_interposing[INTERPOS_fcntl])(fd, cmd, arg)); } - -#ifdef SYSCALL_COMPAT -__weak_reference(__fcntl_compat, __fcntl); - -int -__fcntl_compat(int fd, int cmd, ...) -{ - va_list args; - long arg; - struct __oflock ofl; - struct flock *flp; - int res; - - va_start(args, cmd); - arg = va_arg(args, long); - va_end(args); - - if (__getosreldate() >= 800028) { - return (__sys_fcntl(fd, cmd, arg)); - } else { - if (cmd == F_GETLK || cmd == F_SETLK || cmd == F_SETLKW) { - /* - * Convert new-style struct flock (which - * includes l_sysid) to old-style. - */ - flp = (struct flock *) (uintptr_t) arg; - ofl.l_start = flp->l_start; - ofl.l_len = flp->l_len; - ofl.l_pid = flp->l_pid; - ofl.l_type = flp->l_type; - ofl.l_whence = flp->l_whence; - - switch (cmd) { - case F_GETLK: - res = __sys_fcntl(fd, F_OGETLK, &ofl); - if (res >= 0) { - flp->l_start = ofl.l_start; - flp->l_len = ofl.l_len; - flp->l_pid = ofl.l_pid; - flp->l_type = ofl.l_type; - flp->l_whence = ofl.l_whence; - flp->l_sysid = 0; - } - return (res); - - case F_SETLK: - return (__sys_fcntl(fd, F_OSETLK, &ofl)); - - case F_SETLKW: - return (__sys_fcntl(fd, F_OSETLKW, &ofl)); - } - } - return (__sys_fcntl(fd, cmd, arg)); - } -} -#endif Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libc/sys/interposing_table.c Sat Apr 18 21:50:13 2015 (r281714) @@ -44,7 +44,7 @@ interpos_func_t __libc_interposing[INTER SLOT(aio_suspend, __sys_aio_suspend), SLOT(close, __sys_close), SLOT(connect, __sys_connect), - SLOT(fcntl, __fcntl_compat), + SLOT(fcntl, __sys_fcntl), SLOT(fsync, __sys_fsync), SLOT(fork, __sys_fork), SLOT(msync, __sys_msync), Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libthr/Makefile Sat Apr 18 21:50:13 2015 (r281714) @@ -61,10 +61,6 @@ SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthr SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a .endif -.if ${MK_SYSCALL_COMPAT} != "no" -CFLAGS+=-DSYSCALL_COMPAT -.endif - .include .include Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Sat Apr 18 21:39:17 2015 (r281713) +++ head/lib/libthr/thread/thr_syscalls.c Sat Apr 18 21:50:13 2015 (r281714) @@ -95,10 +95,6 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "thr_private.h" -#ifdef SYSCALL_COMPAT -extern int __fcntl_compat(int, int, ...); -#endif - static int __thr_accept(int s, struct sockaddr *addr, socklen_t *addrlen) { @@ -203,18 +199,10 @@ __thr_fcntl(int fd, int cmd, ...) va_start(ap, cmd); if (cmd == F_OSETLKW || cmd == F_SETLKW) { _thr_cancel_enter(curthread); -#ifdef SYSCALL_COMPAT - ret = __fcntl_compat(fd, cmd, va_arg(ap, void *)); -#else ret = __sys_fcntl(fd, cmd, va_arg(ap, void *)); -#endif _thr_cancel_leave(curthread, ret == -1); } else { -#ifdef SYSCALL_COMPAT - ret = __fcntl_compat(fd, cmd, va_arg(ap, void *)); -#else ret = __sys_fcntl(fd, cmd, va_arg(ap, void *)); -#endif } va_end(ap); Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Apr 18 21:39:17 2015 (r281713) +++ head/share/mk/src.opts.mk Sat Apr 18 21:50:13 2015 (r281714) @@ -154,7 +154,6 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS_HOST \ SOURCELESS_UCODE \ SVNLITE \ - SYSCALL_COMPAT \ SYSCONS \ SYSINSTALL \ TALK \ @@ -235,8 +234,6 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTST .endif .if ${__T} == "aarch64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GDB -# There was no support for arm64 prior to FreeBSD 11 -BROKEN_OPTIONS+=SYSCALL_COMPAT .endif .include Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sat Apr 18 21:39:17 2015 (r281713) +++ head/sys/kern/sys_generic.c Sat Apr 18 21:50:13 2015 (r281714) @@ -219,6 +219,7 @@ sys_pread(td, uap) return(error); } +#if defined(COMPAT_FREEBSD6) int freebsd6_pread(td, uap) struct thread *td; @@ -232,6 +233,7 @@ freebsd6_pread(td, uap) oargs.offset = uap->offset; return (sys_pread(td, &oargs)); } +#endif /* * Scatter read system call. @@ -430,6 +432,7 @@ sys_pwrite(td, uap) return(error); } +#if defined(COMPAT_FREEBSD6) int freebsd6_pwrite(td, uap) struct thread *td; @@ -443,6 +446,7 @@ freebsd6_pwrite(td, uap) oargs.offset = uap->offset; return (sys_pwrite(td, &oargs)); } +#endif /* * Gather write system call. Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Sat Apr 18 21:39:17 2015 (r281713) +++ head/sys/kern/syscalls.master Sat Apr 18 21:50:13 2015 (r281714) @@ -342,9 +342,9 @@ int a4); } ; XXX should be { int shmsys(int which, ...); } 172 AUE_NULL UNIMPL nosys -173 AUE_PREAD STD { ssize_t freebsd6_pread(int fd, void *buf, \ +173 AUE_PREAD COMPAT6 { ssize_t pread(int fd, void *buf, \ size_t nbyte, int pad, off_t offset); } -174 AUE_PWRITE STD { ssize_t freebsd6_pwrite(int fd, \ +174 AUE_PWRITE COMPAT6 { ssize_t pwrite(int fd, \ const void *buf, \ size_t nbyte, int pad, off_t offset); } 175 AUE_NULL STD { int setfib(int fibnum); } @@ -376,16 +376,16 @@ __setrlimit_args int 196 AUE_GETDIRENTRIES STD { int getdirentries(int fd, char *buf, \ u_int count, long *basep); } -197 AUE_MMAP STD { caddr_t freebsd6_mmap(caddr_t addr, \ +197 AUE_MMAP COMPAT6 { caddr_t mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ int pad, off_t pos); } 198 AUE_NULL NOPROTO { int nosys(void); } __syscall \ __syscall_args int -199 AUE_LSEEK STD { off_t freebsd6_lseek(int fd, int pad, \ +199 AUE_LSEEK COMPAT6 { off_t lseek(int fd, int pad, \ off_t offset, int whence); } -200 AUE_TRUNCATE STD { int freebsd6_truncate(char *path, int pad, \ +200 AUE_TRUNCATE COMPAT6 { int truncate(char *path, int pad, \ off_t length); } -201 AUE_FTRUNCATE STD { int freebsd6_ftruncate(int fd, int pad, \ +201 AUE_FTRUNCATE COMPAT6 { int ftruncate(int fd, int pad, \ off_t length); } 202 AUE_SYSCTL STD { int __sysctl(int *name, u_int namelen, \ void *old, size_t *oldlenp, void *new, \ Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Apr 18 21:39:17 2015 (r281713) +++ head/sys/kern/vfs_syscalls.c Sat Apr 18 21:50:13 2015 (r281714) @@ -1933,6 +1933,7 @@ olseek(td, uap) } #endif /* COMPAT_43 */ +#if defined(COMPAT_FREEBSD6) /* Version with the 'pad' argument */ int freebsd6_lseek(td, uap) @@ -1946,6 +1947,7 @@ freebsd6_lseek(td, uap) ouap.whence = uap->whence; return (sys_lseek(td, &ouap)); } +#endif /* * Check access permissions using passed credentials. @@ -3423,6 +3425,7 @@ otruncate(td, uap) } #endif /* COMPAT_43 */ +#if defined(COMPAT_FREEBSD6) /* Versions with the pad argument */ int freebsd6_truncate(struct thread *td, struct freebsd6_truncate_args *uap) @@ -3443,6 +3446,7 @@ freebsd6_ftruncate(struct thread *td, st ouap.length = uap->length; return (sys_ftruncate(td, &ouap)); } +#endif /* * Sync an open file. Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Apr 18 21:39:17 2015 (r281713) +++ head/sys/vm/vm_mmap.c Sat Apr 18 21:50:13 2015 (r281714) @@ -462,6 +462,7 @@ done: return (error); } +#if defined(COMPAT_FREEBSD6) int freebsd6_mmap(struct thread *td, struct freebsd6_mmap_args *uap) { @@ -475,6 +476,7 @@ freebsd6_mmap(struct thread *td, struct oargs.pos = uap->pos; return (sys_mmap(td, &oargs)); } +#endif #ifdef COMPAT_43 #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:50:56 2015 Return-Path: Delivered-To: svn-src-all@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 DB569E5E; Sat, 18 Apr 2015 21:50: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 C937A86F; Sat, 18 Apr 2015 21:50: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 t3ILot4e003566; Sat, 18 Apr 2015 21:50:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILosHq003547; Sat, 18 Apr 2015 21:50:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182150.t3ILosHq003547@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 21:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281715 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:50:56 -0000 Author: kib Date: Sat Apr 18 21:50:53 2015 New Revision: 281715 URL: https://svnweb.freebsd.org/changeset/base/281715 Log: Regen. Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sat Apr 18 21:50:13 2015 (r281714) +++ head/sys/kern/init_sysent.c Sat Apr 18 21:50:53 2015 (r281715) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 21:50:13Z kib */ #include "opt_compat.h" @@ -26,6 +26,12 @@ #define compat4(n, name) 0, (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD6 +#define compat6(n, name) n, (sy_call_t *)__CONCAT(freebsd6_,name) +#else +#define compat6(n, name) 0, (sy_call_t *)nosys +#endif + #ifdef COMPAT_FREEBSD7 #define compat7(n, name) n, (sy_call_t *)__CONCAT(freebsd7_,name) #else @@ -207,8 +213,8 @@ struct sysent sysent[] = { { AS(msgsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 170 = msgsys */ { AS(shmsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 171 = shmsys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 172 = nosys */ - { AS(freebsd6_pread_args), (sy_call_t *)freebsd6_pread, AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 173 = freebsd6_pread */ - { AS(freebsd6_pwrite_args), (sy_call_t *)freebsd6_pwrite, AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 174 = freebsd6_pwrite */ + { compat6(AS(freebsd6_pread_args),pread), AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 173 = freebsd6 pread */ + { compat6(AS(freebsd6_pwrite_args),pwrite), AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 174 = freebsd6 pwrite */ { AS(setfib_args), (sy_call_t *)sys_setfib, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = setfib */ { AS(ntp_adjtime_args), (sy_call_t *)sys_ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = ntp_adjtime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 177 = sfork */ @@ -231,11 +237,11 @@ struct sysent sysent[] = { { AS(__getrlimit_args), (sy_call_t *)sys_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 194 = getrlimit */ { AS(__setrlimit_args), (sy_call_t *)sys_setrlimit, AUE_SETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 195 = setrlimit */ { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 196 = getdirentries */ - { AS(freebsd6_mmap_args), (sy_call_t *)freebsd6_mmap, AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 197 = freebsd6_mmap */ + { compat6(AS(freebsd6_mmap_args),mmap), AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 197 = freebsd6 mmap */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 198 = __syscall */ - { AS(freebsd6_lseek_args), (sy_call_t *)freebsd6_lseek, AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 199 = freebsd6_lseek */ - { AS(freebsd6_truncate_args), (sy_call_t *)freebsd6_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = freebsd6_truncate */ - { AS(freebsd6_ftruncate_args), (sy_call_t *)freebsd6_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 201 = freebsd6_ftruncate */ + { compat6(AS(freebsd6_lseek_args),lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 199 = freebsd6 lseek */ + { compat6(AS(freebsd6_truncate_args),truncate), AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = freebsd6 truncate */ + { compat6(AS(freebsd6_ftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 201 = freebsd6 ftruncate */ { AS(sysctl_args), (sy_call_t *)sys___sysctl, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 202 = __sysctl */ { AS(mlock_args), (sy_call_t *)sys_mlock, AUE_MLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 203 = mlock */ { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 204 = munlock */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Sat Apr 18 21:50:13 2015 (r281714) +++ head/sys/kern/syscalls.c Sat Apr 18 21:50:53 2015 (r281715) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 21:50:13Z kib */ const char *syscallnames[] = { @@ -180,8 +180,8 @@ const char *syscallnames[] = { "msgsys", /* 170 = msgsys */ "shmsys", /* 171 = shmsys */ "#172", /* 172 = nosys */ - "freebsd6_pread", /* 173 = freebsd6_pread */ - "freebsd6_pwrite", /* 174 = freebsd6_pwrite */ + "compat6.pread", /* 173 = freebsd6 pread */ + "compat6.pwrite", /* 174 = freebsd6 pwrite */ "setfib", /* 175 = setfib */ "ntp_adjtime", /* 176 = ntp_adjtime */ "#177", /* 177 = sfork */ @@ -204,11 +204,11 @@ const char *syscallnames[] = { "getrlimit", /* 194 = getrlimit */ "setrlimit", /* 195 = setrlimit */ "getdirentries", /* 196 = getdirentries */ - "freebsd6_mmap", /* 197 = freebsd6_mmap */ + "compat6.mmap", /* 197 = freebsd6 mmap */ "__syscall", /* 198 = __syscall */ - "freebsd6_lseek", /* 199 = freebsd6_lseek */ - "freebsd6_truncate", /* 200 = freebsd6_truncate */ - "freebsd6_ftruncate", /* 201 = freebsd6_ftruncate */ + "compat6.lseek", /* 199 = freebsd6 lseek */ + "compat6.truncate", /* 200 = freebsd6 truncate */ + "compat6.ftruncate", /* 201 = freebsd6 ftruncate */ "__sysctl", /* 202 = __sysctl */ "mlock", /* 203 = mlock */ "munlock", /* 204 = munlock */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Sat Apr 18 21:50:13 2015 (r281714) +++ head/sys/kern/systrace_args.c Sat Apr 18 21:50:53 2015 (r281715) @@ -914,28 +914,6 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } - /* freebsd6_pread */ - case 173: { - struct freebsd6_pread_args *p = params; - iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->buf; /* void * */ - uarg[2] = p->nbyte; /* size_t */ - iarg[3] = p->pad; /* int */ - iarg[4] = p->offset; /* off_t */ - *n_args = 5; - break; - } - /* freebsd6_pwrite */ - case 174: { - struct freebsd6_pwrite_args *p = params; - iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->buf; /* const void * */ - uarg[2] = p->nbyte; /* size_t */ - iarg[3] = p->pad; /* int */ - iarg[4] = p->offset; /* off_t */ - *n_args = 5; - break; - } /* setfib */ case 175: { struct setfib_args *p = params; @@ -1037,52 +1015,11 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } - /* freebsd6_mmap */ - case 197: { - struct freebsd6_mmap_args *p = params; - uarg[0] = (intptr_t) p->addr; /* caddr_t */ - uarg[1] = p->len; /* size_t */ - iarg[2] = p->prot; /* int */ - iarg[3] = p->flags; /* int */ - iarg[4] = p->fd; /* int */ - iarg[5] = p->pad; /* int */ - iarg[6] = p->pos; /* off_t */ - *n_args = 7; - break; - } /* nosys */ case 198: { *n_args = 0; break; } - /* freebsd6_lseek */ - case 199: { - struct freebsd6_lseek_args *p = params; - iarg[0] = p->fd; /* int */ - iarg[1] = p->pad; /* int */ - iarg[2] = p->offset; /* off_t */ - iarg[3] = p->whence; /* int */ - *n_args = 4; - break; - } - /* freebsd6_truncate */ - case 200: { - struct freebsd6_truncate_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->pad; /* int */ - iarg[2] = p->length; /* off_t */ - *n_args = 3; - break; - } - /* freebsd6_ftruncate */ - case 201: { - struct freebsd6_ftruncate_args *p = params; - iarg[0] = p->fd; /* int */ - iarg[1] = p->pad; /* int */ - iarg[2] = p->length; /* off_t */ - *n_args = 3; - break; - } /* __sysctl */ case 202: { struct sysctl_args *p = params; @@ -4873,50 +4810,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* freebsd6_pread */ - case 173: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "void *"; - break; - case 2: - p = "size_t"; - break; - case 3: - p = "int"; - break; - case 4: - p = "off_t"; - break; - default: - break; - }; - break; - /* freebsd6_pwrite */ - case 174: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "const void *"; - break; - case 2: - p = "size_t"; - break; - case 3: - p = "int"; - break; - case 4: - p = "off_t"; - break; - default: - break; - }; - break; /* setfib */ case 175: switch(ndx) { @@ -5077,88 +4970,9 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* freebsd6_mmap */ - case 197: - switch(ndx) { - case 0: - p = "caddr_t"; - break; - case 1: - p = "size_t"; - break; - case 2: - p = "int"; - break; - case 3: - p = "int"; - break; - case 4: - p = "int"; - break; - case 5: - p = "int"; - break; - case 6: - p = "off_t"; - break; - default: - break; - }; - break; /* nosys */ case 198: break; - /* freebsd6_lseek */ - case 199: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "int"; - break; - case 2: - p = "off_t"; - break; - case 3: - p = "int"; - break; - default: - break; - }; - break; - /* freebsd6_truncate */ - case 200: - switch(ndx) { - case 0: - p = "char *"; - break; - case 1: - p = "int"; - break; - case 2: - p = "off_t"; - break; - default: - break; - }; - break; - /* freebsd6_ftruncate */ - case 201: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "int"; - break; - case 2: - p = "off_t"; - break; - default: - break; - }; - break; /* __sysctl */ case 202: switch(ndx) { @@ -9598,16 +9412,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd6_pread */ - case 173: - if (ndx == 0 || ndx == 1) - p = "ssize_t"; - break; - /* freebsd6_pwrite */ - case 174: - if (ndx == 0 || ndx == 1) - p = "ssize_t"; - break; /* setfib */ case 175: if (ndx == 0 || ndx == 1) @@ -9673,28 +9477,8 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd6_mmap */ - case 197: - if (ndx == 0 || ndx == 1) - p = "caddr_t"; - break; /* nosys */ case 198: - /* freebsd6_lseek */ - case 199: - if (ndx == 0 || ndx == 1) - p = "off_t"; - break; - /* freebsd6_truncate */ - case 200: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* freebsd6_ftruncate */ - case 201: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* __sysctl */ case 202: if (ndx == 0 || ndx == 1) Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Sat Apr 18 21:50:13 2015 (r281714) +++ head/sys/sys/syscall.h Sat Apr 18 21:50:53 2015 (r281715) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 21:50:13Z kib */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Sat Apr 18 21:50:13 2015 (r281714) +++ head/sys/sys/syscall.mk Sat Apr 18 21:50:53 2015 (r281715) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles +# created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 21:50:13Z kib MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Sat Apr 18 21:50:13 2015 (r281714) +++ head/sys/sys/sysproto.h Sat Apr 18 21:50:53 2015 (r281715) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 21:50:13Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -532,20 +532,6 @@ struct shmsys_args { char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; }; -struct freebsd6_pread_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; -}; -struct freebsd6_pwrite_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; -}; struct setfib_args { char fibnum_l_[PADL_(int)]; int fibnum; char fibnum_r_[PADR_(int)]; }; @@ -595,31 +581,6 @@ struct getdirentries_args { char count_l_[PADL_(u_int)]; u_int count; char count_r_[PADR_(u_int)]; char basep_l_[PADL_(long *)]; long * basep; char basep_r_[PADR_(long *)]; }; -struct freebsd6_mmap_args { - char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; - char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char pos_l_[PADL_(off_t)]; off_t pos; char pos_r_[PADR_(off_t)]; -}; -struct freebsd6_lseek_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; - char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; -}; -struct freebsd6_truncate_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)]; -}; -struct freebsd6_ftruncate_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)]; -}; struct sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; @@ -1941,8 +1902,6 @@ int sys_rtprio(struct thread *, struct r int sys_semsys(struct thread *, struct semsys_args *); int sys_msgsys(struct thread *, struct msgsys_args *); int sys_shmsys(struct thread *, struct shmsys_args *); -int freebsd6_pread(struct thread *, struct freebsd6_pread_args *); -int freebsd6_pwrite(struct thread *, struct freebsd6_pwrite_args *); int sys_setfib(struct thread *, struct setfib_args *); int sys_ntp_adjtime(struct thread *, struct ntp_adjtime_args *); int sys_setgid(struct thread *, struct setgid_args *); @@ -1956,10 +1915,6 @@ int sys_fpathconf(struct thread *, struc int sys_getrlimit(struct thread *, struct __getrlimit_args *); int sys_setrlimit(struct thread *, struct __setrlimit_args *); int sys_getdirentries(struct thread *, struct getdirentries_args *); -int freebsd6_mmap(struct thread *, struct freebsd6_mmap_args *); -int freebsd6_lseek(struct thread *, struct freebsd6_lseek_args *); -int freebsd6_truncate(struct thread *, struct freebsd6_truncate_args *); -int freebsd6_ftruncate(struct thread *, struct freebsd6_ftruncate_args *); int sys___sysctl(struct thread *, struct sysctl_args *); int sys_mlock(struct thread *, struct mlock_args *); int sys_munlock(struct thread *, struct munlock_args *); @@ -2459,6 +2414,51 @@ int freebsd4_sigreturn(struct thread *, #ifdef COMPAT_FREEBSD6 +struct freebsd6_pread_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; + char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; +}; +struct freebsd6_pwrite_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; + char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; +}; +struct freebsd6_mmap_args { + char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char pos_l_[PADL_(off_t)]; off_t pos; char pos_r_[PADR_(off_t)]; +}; +struct freebsd6_lseek_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; + char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; +}; +struct freebsd6_truncate_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)]; +}; +struct freebsd6_ftruncate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)]; +}; +int freebsd6_pread(struct thread *, struct freebsd6_pread_args *); +int freebsd6_pwrite(struct thread *, struct freebsd6_pwrite_args *); +int freebsd6_mmap(struct thread *, struct freebsd6_mmap_args *); +int freebsd6_lseek(struct thread *, struct freebsd6_lseek_args *); +int freebsd6_truncate(struct thread *, struct freebsd6_truncate_args *); +int freebsd6_ftruncate(struct thread *, struct freebsd6_ftruncate_args *); #endif /* COMPAT_FREEBSD6 */ From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 21:54:01 2015 Return-Path: Delivered-To: svn-src-all@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 8A19CFB4; Sat, 18 Apr 2015 21:54: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 7908287E; Sat, 18 Apr 2015 21:54:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3ILs1dk008215; Sat, 18 Apr 2015 21:54:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3ILs1Gv008214; Sat, 18 Apr 2015 21:54:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504182154.t3ILs1Gv008214@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 21:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281716 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:54:01 -0000 Author: kib Date: Sat Apr 18 21:54:00 2015 New Revision: 281716 URL: https://svnweb.freebsd.org/changeset/base/281716 Log: Regen. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Apr 18 21:50:53 2015 (r281715) +++ head/share/man/man5/src.conf.5 Sat Apr 18 21:54:00 2015 (r281716) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd April 3, 2015 +.Dd April 19, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1100,9 +1100,6 @@ and related programs. .It Va WITHOUT_SYMVER .\" from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen Set to disable symbol versioning when building shared libraries. -.It Va WITHOUT_SYSCALL_COMPAT -.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCALL_COMPAT 265826 2014-05-10 16:37:28Z imp -Do not include some compatible syscall wrappers in libc. .It Va WITHOUT_SYSCONS .\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru Set to not build From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 22:39:54 2015 Return-Path: Delivered-To: svn-src-all@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 1804A59B for ; Sat, 18 Apr 2015 22:39:54 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9D02C10 for ; Sat, 18 Apr 2015 22:39:53 +0000 (UTC) Received: by oiko83 with SMTP id o83so99552058oik.1 for ; Sat, 18 Apr 2015 15:39:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8Hu3+s77/dB3TJDh5cxU42VFl/U/1KCTIb4bxGzmqx4=; b=iRWtdgK1D/i3fb9wca5hU7rfKoEX6JNfH+WAuCD5uAGNnRexgisAu9kbAu/uALSpbP vo3c4+GbaopMi+1ZBsLeZ+iq3yxhC87YdjXr4suxK9tD39BTM5mGFLV0uUXvEV8TF7KW +q1u/a/CJAoCFu7Jaot+iuRZpNCdMlifvFgIUZ3FDFe3wEF2ctjVCKoTuvhhokwNx0oK /eb9pncxy8mhB7ZadEikq26GBjsKU+a2uLi7xc1Eheyvh/XWaw6wasCQzpl8gZ6GyrtK WdZP9IN0EmRX1PrWl3aZPlxo0OjRyk+hrlQN3jI+ROXjd4XavIfEwu0ykVxUfoCNeOiO yGfw== X-Gm-Message-State: ALoCoQmqlCJGQrUMG6lftReh2o3m2/mybnwBsbp6q6LlkgjOFHAq9SxW637an6J4vqKWVKF5XN5H MIME-Version: 1.0 X-Received: by 10.202.196.131 with SMTP id u125mr8089551oif.44.1429396787511; Sat, 18 Apr 2015 15:39:47 -0700 (PDT) Received: by 10.202.80.6 with HTTP; Sat, 18 Apr 2015 15:39:47 -0700 (PDT) In-Reply-To: <201504182123.t3ILNHUk080941@svn.freebsd.org> References: <201504182123.t3ILNHUk080941@svn.freebsd.org> Date: Sun, 19 Apr 2015 00:39:47 +0200 Message-ID: Subject: Re: svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen From: Oliver Pinter To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 22:39:54 -0000 On Sat, Apr 18, 2015 at 11:23 PM, Konstantin Belousov wrote: > Author: kib > Date: Sat Apr 18 21:23:16 2015 > New Revision: 281707 > URL: https://svnweb.freebsd.org/changeset/base/281707 > > Log: > Remove lazy pmap switch code from i386. Naive benchmark with md(4) > shows no difference with the code removed. > > On both amd64 and i386, assert that a released pmap is not active. > > Proposed and reviewed by: alc > Discussed with: Svatopluk Kraus , peter > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/i386/i386/apic_vector.s > head/sys/i386/i386/db_trace.c > head/sys/i386/i386/mp_machdep.c > head/sys/i386/i386/pmap.c > head/sys/i386/i386/swtch.s > head/sys/i386/include/smp.h > head/sys/i386/xen/mp_machdep.c > head/sys/i386/xen/pmap.c > head/sys/x86/include/acpica_machdep.h > head/sys/x86/xen/xen_apic.c > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/amd64/amd64/pmap.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -2532,6 +2532,8 @@ pmap_release(pmap_t pmap) > pmap->pm_stats.resident_count)); > KASSERT(vm_radix_is_empty(&pmap->pm_root), > ("pmap_release: pmap has reserved page table page(s)")); > + KASSERT(CPU_EMPTY(&pmap->pm_active), > + ("releasing active pmap %p", pmap)); > > if (pmap_pcid_enabled) { > /* > > Modified: head/sys/i386/i386/apic_vector.s > ============================================================================== > --- head/sys/i386/i386/apic_vector.s Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/i386/apic_vector.s Sat Apr 18 21:23:16 2015 (r281707) > @@ -320,19 +320,4 @@ IDTVEC(rendezvous) > POP_FRAME > iret > > -/* > - * Clean up when we lose out on the lazy context switch optimization. > - * ie: when we are about to release a PTD but a cpu is still borrowing it. > - */ > - SUPERALIGN_TEXT > -IDTVEC(lazypmap) > - PUSH_FRAME > - SET_KERNEL_SREGS > - cld > - > - call pmap_lazyfix_action > - > - call as_lapic_eoi > - POP_FRAME > - iret > #endif /* SMP */ > > Modified: head/sys/i386/i386/db_trace.c > ============================================================================== > --- head/sys/i386/i386/db_trace.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/i386/db_trace.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -316,8 +316,7 @@ db_nextframe(struct i386_frame **fp, db_ > frame_type = TRAP_TIMERINT; > else if (strcmp(name, "Xcpustop") == 0 || > strcmp(name, "Xrendezvous") == 0 || > - strcmp(name, "Xipi_intr_bitmap_handler") == 0 || > - strcmp(name, "Xlazypmap") == 0) > + strcmp(name, "Xipi_intr_bitmap_handler") == 0) > frame_type = TRAP_INTERRUPT; > } > > > Modified: head/sys/i386/i386/mp_machdep.c > ============================================================================== > --- head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -163,7 +163,6 @@ u_long *ipi_invlrng_counts[MAXCPU]; > u_long *ipi_invlpg_counts[MAXCPU]; > u_long *ipi_invlcache_counts[MAXCPU]; > u_long *ipi_rendezvous_counts[MAXCPU]; > -u_long *ipi_lazypmap_counts[MAXCPU]; > static u_long *ipi_hardclock_counts[MAXCPU]; > #endif > > @@ -576,10 +575,6 @@ cpu_mp_start(void) > setidt(IPI_INVLCACHE, IDTVEC(invlcache), > SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); > > - /* Install an inter-CPU IPI for lazy pmap release */ > - setidt(IPI_LAZYPMAP, IDTVEC(lazypmap), > - SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); > - > /* Install an inter-CPU IPI for all-CPU rendezvous */ > setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous), > SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); > @@ -1672,8 +1667,6 @@ mp_ipi_intrcnt(void *dummy) > intrcnt_add(buf, &ipi_ast_counts[i]); > snprintf(buf, sizeof(buf), "cpu%d:rendezvous", i); > intrcnt_add(buf, &ipi_rendezvous_counts[i]); > - snprintf(buf, sizeof(buf), "cpu%d:lazypmap", i); > - intrcnt_add(buf, &ipi_lazypmap_counts[i]); > snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); > intrcnt_add(buf, &ipi_hardclock_counts[i]); > } > > Modified: head/sys/i386/i386/pmap.c > ============================================================================== > --- head/sys/i386/i386/pmap.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/i386/pmap.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -1248,18 +1248,14 @@ pmap_invalidate_cache_pages(vm_page_t *p > } > > /* > - * Are we current address space or kernel? N.B. We return FALSE when > - * a pmap's page table is in use because a kernel thread is borrowing > - * it. The borrowed page table can change spontaneously, making any > - * dependence on its continued use subject to a race condition. > + * Are we current address space or kernel? > */ > static __inline int > pmap_is_current(pmap_t pmap) > { > > - return (pmap == kernel_pmap || > - (pmap == vmspace_pmap(curthread->td_proc->p_vmspace) && > - (pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] & PG_FRAME))); > + return (pmap == kernel_pmap || pmap == > + vmspace_pmap(curthread->td_proc->p_vmspace)); > } > > /* > @@ -1923,108 +1919,6 @@ retry: > * Pmap allocation/deallocation routines. > ***************************************************/ > > -#ifdef SMP > -/* > - * Deal with a SMP shootdown of other users of the pmap that we are > - * trying to dispose of. This can be a bit hairy. > - */ > -static cpuset_t *lazymask; > -static u_int lazyptd; > -static volatile u_int lazywait; > - > -void pmap_lazyfix_action(void); > - > -void > -pmap_lazyfix_action(void) > -{ > - > -#ifdef COUNT_IPIS > - (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; > -#endif > - if (rcr3() == lazyptd) > - load_cr3(curpcb->pcb_cr3); > - CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); > - atomic_store_rel_int(&lazywait, 1); > -} > - > -static void > -pmap_lazyfix_self(u_int cpuid) > -{ > - > - if (rcr3() == lazyptd) > - load_cr3(curpcb->pcb_cr3); > - CPU_CLR_ATOMIC(cpuid, lazymask); > -} > - > - > -static void > -pmap_lazyfix(pmap_t pmap) > -{ > - cpuset_t mymask, mask; > - u_int cpuid, spins; > - int lsb; > - > - mask = pmap->pm_active; > - while (!CPU_EMPTY(&mask)) { > - spins = 50000000; > - > - /* Find least significant set bit. */ > - lsb = CPU_FFS(&mask); > - MPASS(lsb != 0); > - lsb--; > - CPU_SETOF(lsb, &mask); > - mtx_lock_spin(&smp_ipi_mtx); > -#if defined(PAE) || defined(PAE_TABLES) > - lazyptd = vtophys(pmap->pm_pdpt); > -#else > - lazyptd = vtophys(pmap->pm_pdir); > -#endif > - cpuid = PCPU_GET(cpuid); > - > - /* Use a cpuset just for having an easy check. */ > - CPU_SETOF(cpuid, &mymask); > - if (!CPU_CMP(&mask, &mymask)) { > - lazymask = &pmap->pm_active; > - pmap_lazyfix_self(cpuid); > - } else { > - atomic_store_rel_int((u_int *)&lazymask, > - (u_int)&pmap->pm_active); > - atomic_store_rel_int(&lazywait, 0); > - ipi_selected(mask, IPI_LAZYPMAP); > - while (lazywait == 0) { > - ia32_pause(); > - if (--spins == 0) > - break; > - } > - } > - mtx_unlock_spin(&smp_ipi_mtx); > - if (spins == 0) > - printf("pmap_lazyfix: spun for 50000000\n"); > - mask = pmap->pm_active; > - } > -} > - > -#else /* SMP */ > - > -/* > - * Cleaning up on uniprocessor is easy. For various reasons, we're > - * unlikely to have to even execute this code, including the fact > - * that the cleanup is deferred until the parent does a wait(2), which > - * means that another userland process has run. > - */ > -static void > -pmap_lazyfix(pmap_t pmap) > -{ > - u_int cr3; > - > - cr3 = vtophys(pmap->pm_pdir); > - if (cr3 == rcr3()) { > - load_cr3(curpcb->pcb_cr3); > - CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); > - } > -} > -#endif /* SMP */ > - > /* > * Release any resources held by the given physical map. > * Called when a pmap initialized by pmap_pinit is being released. > @@ -2041,8 +1935,9 @@ pmap_release(pmap_t pmap) > pmap->pm_stats.resident_count)); > KASSERT(vm_radix_is_empty(&pmap->pm_root), > ("pmap_release: pmap has reserved page table page(s)")); > + KASSERT(CPU_EMPTY(&pmap->pm_active), > + ("releasing active pmap %p", pmap)); > > - pmap_lazyfix(pmap); > mtx_lock_spin(&allpmaps_lock); > LIST_REMOVE(pmap, pm_list); > mtx_unlock_spin(&allpmaps_lock); > > Modified: head/sys/i386/i386/swtch.s > ============================================================================== > --- head/sys/i386/i386/swtch.s Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/i386/swtch.s Sat Apr 18 21:23:16 2015 (r281707) > @@ -174,12 +174,6 @@ ENTRY(cpu_switch) > > /* switch address space */ > movl PCB_CR3(%edx),%eax > -#if defined(PAE) || defined(PAE_TABLES) > - cmpl %eax,IdlePDPT /* Kernel address space? */ > -#else > - cmpl %eax,IdlePTD /* Kernel address space? */ > -#endif > - je sw0 > READ_CR3(%ebx) /* The same address space? */ > cmpl %ebx,%eax > je sw0 > > Modified: head/sys/i386/include/smp.h > ============================================================================== > --- head/sys/i386/include/smp.h Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/include/smp.h Sat Apr 18 21:23:16 2015 (r281707) > @@ -42,7 +42,6 @@ extern u_long *ipi_invlrng_counts[MAXCPU > extern u_long *ipi_invlpg_counts[MAXCPU]; > extern u_long *ipi_invlcache_counts[MAXCPU]; > extern u_long *ipi_rendezvous_counts[MAXCPU]; > -extern u_long *ipi_lazypmap_counts[MAXCPU]; > #endif > > /* IPI handlers */ > @@ -54,8 +53,7 @@ inthand_t > IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ > IDTVEC(cpustop), /* CPU stops & waits to be restarted */ > IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ > - IDTVEC(rendezvous), /* handle CPU rendezvous */ > - IDTVEC(lazypmap); /* handle lazy pmap release */ > + IDTVEC(rendezvous); /* handle CPU rendezvous */ > > /* functions in mp_machdep.c */ > void cpu_add(u_int apic_id, char boot_cpu); > > Modified: head/sys/i386/xen/mp_machdep.c > ============================================================================== > --- head/sys/i386/xen/mp_machdep.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/xen/mp_machdep.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -96,7 +96,6 @@ extern struct pcpu __pcpu[]; > > extern void Xhypervisor_callback(void); > extern void failsafe_callback(void); > -extern void pmap_lazyfix_action(void); > > /*--------------------------- Forward Declarations ---------------------------*/ > static driver_filter_t smp_reschedule_interrupt; > @@ -370,24 +369,16 @@ iv_invlcache(uintptr_t a, uintptr_t b) > atomic_add_int(&smp_tlb_wait, 1); > } > > -static void > -iv_lazypmap(uintptr_t a, uintptr_t b) > -{ > - pmap_lazyfix_action(); > - atomic_add_int(&smp_tlb_wait, 1); > -} > - > /* > * These start from "IPI offset" APIC_IPI_INTS > */ > -static call_data_func_t *ipi_vectors[6] = > +static call_data_func_t *ipi_vectors[5] = > { > iv_rendezvous, > iv_invltlb, > iv_invlpg, > iv_invlrng, > iv_invlcache, > - iv_lazypmap, > }; > > /* > > Modified: head/sys/i386/xen/pmap.c > ============================================================================== > --- head/sys/i386/xen/pmap.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/i386/xen/pmap.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -1652,107 +1652,6 @@ retry: > * Pmap allocation/deallocation routines. > ***************************************************/ > > -#ifdef SMP > -/* > - * Deal with a SMP shootdown of other users of the pmap that we are > - * trying to dispose of. This can be a bit hairy. > - */ > -static cpuset_t *lazymask; > -static u_int lazyptd; > -static volatile u_int lazywait; > - > -void pmap_lazyfix_action(void); > - > -void > -pmap_lazyfix_action(void) > -{ > - > -#ifdef COUNT_IPIS > - (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; > -#endif > - if (rcr3() == lazyptd) > - load_cr3(PCPU_GET(curpcb)->pcb_cr3); > - CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); > - atomic_store_rel_int(&lazywait, 1); > -} > - > -static void > -pmap_lazyfix_self(u_int cpuid) > -{ > - > - if (rcr3() == lazyptd) > - load_cr3(PCPU_GET(curpcb)->pcb_cr3); > - CPU_CLR_ATOMIC(cpuid, lazymask); > -} > - > - > -static void > -pmap_lazyfix(pmap_t pmap) > -{ > - cpuset_t mymask, mask; > - u_int cpuid, spins; > - int lsb; > - > - mask = pmap->pm_active; > - while (!CPU_EMPTY(&mask)) { > - spins = 50000000; > - > - /* Find least significant set bit. */ > - lsb = CPU_FFS(&mask); > - MPASS(lsb != 0); > - lsb--; > - CPU_SETOF(lsb, &mask); > - mtx_lock_spin(&smp_ipi_mtx); > -#ifdef PAE > - lazyptd = vtophys(pmap->pm_pdpt); > -#else > - lazyptd = vtophys(pmap->pm_pdir); > -#endif > - cpuid = PCPU_GET(cpuid); > - > - /* Use a cpuset just for having an easy check. */ > - CPU_SETOF(cpuid, &mymask); > - if (!CPU_CMP(&mask, &mymask)) { > - lazymask = &pmap->pm_active; > - pmap_lazyfix_self(cpuid); > - } else { > - atomic_store_rel_int((u_int *)&lazymask, > - (u_int)&pmap->pm_active); > - atomic_store_rel_int(&lazywait, 0); > - ipi_selected(mask, IPI_LAZYPMAP); > - while (lazywait == 0) { > - ia32_pause(); > - if (--spins == 0) > - break; > - } > - } > - mtx_unlock_spin(&smp_ipi_mtx); > - if (spins == 0) > - printf("pmap_lazyfix: spun for 50000000\n"); > - mask = pmap->pm_active; > - } > -} > - > -#else /* SMP */ > - > -/* > - * Cleaning up on uniprocessor is easy. For various reasons, we're > - * unlikely to have to even execute this code, including the fact > - * that the cleanup is deferred until the parent does a wait(2), which > - * means that another userland process has run. > - */ > -static void > -pmap_lazyfix(pmap_t pmap) > -{ > - u_int cr3; > - > - cr3 = vtophys(pmap->pm_pdir); > - if (cr3 == rcr3()) { > - load_cr3(PCPU_GET(curpcb)->pcb_cr3); > - CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); > - } > -} > -#endif /* SMP */ > > /* > * Release any resources held by the given physical map. > @@ -1780,7 +1679,8 @@ pmap_release(pmap_t pmap) > mtx_lock(&createdelete_lock); > #endif > > - pmap_lazyfix(pmap); > + KASSERT(CPU_EMPTY(&pmap->pm_active), > + ("releasing active pmap %p", pmap)); > mtx_lock_spin(&allpmaps_lock); > LIST_REMOVE(pmap, pm_list); > mtx_unlock_spin(&allpmaps_lock); > > Modified: head/sys/x86/include/acpica_machdep.h > ============================================================================== > --- head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:23:16 2015 (r281707) > @@ -74,6 +74,7 @@ enum intr_polarity; > > void acpi_SetDefaultIntrModel(int model); > void acpi_cpu_c1(void); > +void acpi_cpu_idle_mwait(uint32_t mwait_hint); This change is related of this commit or this belongs to other modificatons? > void *acpi_map_table(vm_paddr_t pa, const char *sig); > void acpi_unmap_table(void *table); > vm_paddr_t acpi_find_table(const char *sig); > > Modified: head/sys/x86/xen/xen_apic.c > ============================================================================== > --- head/sys/x86/xen/xen_apic.c Sat Apr 18 21:22:26 2015 (r281706) > +++ head/sys/x86/xen/xen_apic.c Sat Apr 18 21:23:16 2015 (r281707) > @@ -68,9 +68,6 @@ static driver_filter_t xen_invltlb; > static driver_filter_t xen_invlpg; > static driver_filter_t xen_invlrng; > static driver_filter_t xen_invlcache; > -#ifdef __i386__ > -static driver_filter_t xen_lazypmap; > -#endif > static driver_filter_t xen_ipi_bitmap_handler; > static driver_filter_t xen_cpustop_handler; > static driver_filter_t xen_cpususpend_handler; > @@ -79,9 +76,6 @@ static driver_filter_t xen_cpustophard_h > > /*---------------------------- Extern Declarations ---------------------------*/ > /* Variables used by mp_machdep to perform the MMU related IPIs */ > -#ifdef __i386__ > -extern void pmap_lazyfix_action(void); > -#endif > #ifdef __amd64__ > extern int pmap_pcid_enabled; > #endif > @@ -104,9 +98,6 @@ static struct xen_ipi_handler xen_ipis[] > [IPI_TO_IDX(IPI_INVLPG)] = { xen_invlpg, "ipg" }, > [IPI_TO_IDX(IPI_INVLRNG)] = { xen_invlrng, "irg" }, > [IPI_TO_IDX(IPI_INVLCACHE)] = { xen_invlcache, "ic" }, > -#ifdef __i386__ > - [IPI_TO_IDX(IPI_LAZYPMAP)] = { xen_lazypmap, "lp" }, > -#endif > [IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, > [IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, > [IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, > @@ -474,16 +465,6 @@ xen_invlcache(void *arg) > return (FILTER_HANDLED); > } > > -#ifdef __i386__ > -static int > -xen_lazypmap(void *arg) > -{ > - > - pmap_lazyfix_action(); > - return (FILTER_HANDLED); > -} > -#endif > - > static int > xen_cpustop_handler(void *arg) > { > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 22:40:20 2015 Return-Path: Delivered-To: svn-src-all@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 EFFB1604 for ; Sat, 18 Apr 2015 22:40:20 +0000 (UTC) Received: from frv25.fwdcdn.com (frv25.fwdcdn.com [212.42.77.25]) by mx1.freebsd.org (Postfix) with ESMTP id B1EC7CB3 for ; Sat, 18 Apr 2015 22:40:20 +0000 (UTC) Received: from [10.10.14.27] (helo=frv158.fwdcdn.com) by frv25.fwdcdn.com QID:1Yjb9Q-000M4R-MI/RC:1; Sun, 19 Apr 2015 01:23:48 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:To:From:Date; bh=O9BEd3VIwYh/sfA9CEaMFAFVSxSEbDixnyYUUXbaqhk=; b=UIlAGVUNjuCNhggbLT2dPz4qrXH2UKsMDJt7Dl77l+SmlFKBrk+Q7F88mWLeddGsGbGqmltF+AHdjn/NyM25HE8613//DpOzfP1dL79CcGSBUAbdXhBm1FKBPnJcRu6lK5TpXbXLO6wGI0thFQYyHTonrkU8VVvaEUEkK4dYdtU=; Received: from [37.229.192.210] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1Yjb9J-0003FU-8L for svn-src-all@freebsd.org; Sun, 19 Apr 2015 01:23:41 +0300 Date: Sun, 19 Apr 2015 01:23:40 +0300 From: Ivan Klymenko To: svn-src-all@freebsd.org Subject: Re: svn commit: r281713 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/modules/hwpmc sys/powerpc/booke sys/powerpc/include Message-ID: <20150419012340.043bdf90@nonamehost.local> In-Reply-To: <201504182139.t3ILdHjO093364@svn.freebsd.org> References: <201504182139.t3ILdHjO093364@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=37.229.192.210; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-Ukrnet-Yellow: 0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 22:40:21 -0000 Sat, 18 Apr 2015 21:39:17 +0000 (UTC) Justin Hibbits =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0= =D0=B2: > PMC_CLASS_E500 ... --- all_subdir_libpcap --- /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sys= root=3D/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin = -fpic -DPIC -O2 -pipe -mmmx -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -m= sse4.2 -mavx -maes -mpclmul -march=3Dnative -DHAVE_CONFIG_H -Dyylval=3Dpca= pyylval -I/usr/src/lib/libpcap -I. -D_U_=3D"__attribute__((unused))" -DHAVE= _SNPRINTF -DHAVE_VSNPRINTF -DINET6 -DHAVE_NET_PFVAR_H -I/usr/src/lib/libpca= p/../../contrib/libpcap -std=3Dgnu99 -fstack-protector -Wno-pointer-sign -W= no-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautolog= ical-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-functi= on -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch -Wno-switch-e= num -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -c /usr= /src/lib/libpcap/../../contrib/libpcap/optimize.c -o optimize.So --- all_subdir_libpmc --- /usr/src/lib/libpmc/libpmc.c:302:1: error: use of undeclared identifier 'PM= C_CLASS_E500'; did you mean 'PMC_CLASS_P5'? PMC_MDEP_TABLE(e500, E500, PMC_CLASS_SOFT, PMC_CLASS_E500, PMC_CLASS_TSC); ^ /usr/src/lib/libpmc/libpmc.c:273:3: note: expanded from macro 'PMC_MDEP_TAB= LE' PMC_CLASS_##C, __VA_ARGS__ \ ^ :64:1: note: expanded from here PMC_CLASS_E500 ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:144:2: note: 'PMC_CLASS_= P5' declared here __PMC_CLASSES() ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:125:2: note: expanded fr= om macro '__PMC_CLASSES' __PMC_CLASS(P5) /* Intel Pentium counters */ \ ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:143:24: note: expanded f= rom macro '__PMC_CLASS' #define __PMC_CLASS(N) PMC_CLASS_##N , ^ :46:1: note: expanded from here PMC_CLASS_P5 ^ /usr/src/lib/libpmc/libpmc.c:302:44: error: use of undeclared identifier 'P= MC_CLASS_E500'; did you mean 'PMC_CLASS_P5'? PMC_MDEP_TABLE(e500, E500, PMC_CLASS_SOFT, PMC_CLASS_E500, PMC_CLASS_TSC); ^~~~~~~~~~~~~~ PMC_CLASS_P5 /usr/src/lib/libpmc/libpmc.c:273:18: note: expanded from macro 'PMC_MDEP_TA= BLE' PMC_CLASS_##C, __VA_ARGS__ \ ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:144:2: note: 'PMC_CLASS_= P5' declared here __PMC_CLASSES() ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:125:2: note: expanded fr= om macro '__PMC_CLASSES' __PMC_CLASS(P5) /* Intel Pentium counters */ \ ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:143:24: note: expanded f= rom macro '__PMC_CLASS' #define __PMC_CLASS(N) PMC_CLASS_##N , ^ :46:1: note: expanded from here PMC_CLASS_P5 ^ /usr/src/lib/libpmc/libpmc.c:2961:7: error: use of undeclared identifier 'P= MC_CLASS_E500'; did you mean 'PMC_CLASS_P5'? case PMC_CLASS_E500: ^~~~~~~~~~~~~~ PMC_CLASS_P5 /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:144:2: note: 'PMC_CLASS_= P5' declared here __PMC_CLASSES() ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:125:2: note: expanded fr= om macro '__PMC_CLASSES' __PMC_CLASS(P5) /* Intel Pentium counters */ \ ^ /media/da0s1/obj/usr/src/tmp/usr/include/sys/pmc.h:143:24: note: expanded f= rom macro '__PMC_CLASS' #define __PMC_CLASS(N) PMC_CLASS_##N , ^ :46:1: note: expanded from here PMC_CLASS_P5 ^ /usr/src/lib/libpmc/libpmc.c:2961:7: error: duplicate case value 'PMC_CLASS= _P5' case PMC_CLASS_E500: ^ /usr/src/lib/libpmc/libpmc.c:2925:7: note: previous case defined here case PMC_CLASS_P5: ^ 4 errors generated. *** [libpmc.So] Error code 1 make[5]: stopped in /usr/src/lib/libpmc 1 error make[5]: stopped in /usr/src/lib/libpmc *** [all_subdir_libpmc] Error code 2 make[4]: stopped in /usr/src/lib --- all_subdir_libdwarf --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/lib/libdwarf *** [all_subdir_libdwarf] Error code 2 make[4]: stopped in /usr/src/lib --- all_subdir_libpcap --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/lib/libpcap *** [all_subdir_libpcap] Error code 2 make[4]: stopped in /usr/src/lib --- all_subdir_libngatm --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/lib/libngatm *** [all_subdir_libngatm] Error code 2 make[4]: stopped in /usr/src/lib 4 errors make[4]: stopped in /usr/src/lib A failure has been detected in another branch of the parallel make make[3]: stopped in /usr/src *** [libraries] Error code 2 make[2]: stopped in /usr/src 1 error make[2]: stopped in /usr/src *** [_libraries] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 22:56:47 2015 Return-Path: Delivered-To: svn-src-all@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 9D7FF873 for ; Sat, 18 Apr 2015 22:56:47 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A451DA8 for ; Sat, 18 Apr 2015 22:56:47 +0000 (UTC) Received: by oiko83 with SMTP id o83so99670997oik.1 for ; Sat, 18 Apr 2015 15:56:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=X9I7FQX5GgW/tbERj9lNGBhQlwg6urg+WOESblvF0Ts=; b=Y5D1gkKiakwLvTSyyrgepvlruqen2k2/RvnP6D1O2pmQu2UbsRKcESXcOmcfKkoe0y Ul7k+tIqa88zH8ED6jo8AxZSyZBkFExnRJECV/t8Yera1U4BpPy7w0/3UTeu6rSHsIhT xted1BTKzRjfTmagpzfnNm0zRQmv9ZWlvNv/cVwf7+k3p8eLm6No6yMoxiTeKNPHfWAB l6r5HBUHD7RUMWKe4BW/8JqQrxZgEJqdtFNmFQrJJVkV0bKpfwi/Skt353rkIIM6Dg9f Qrlol4S0hKD1UFFTvLaa7xNclpQuLOnNy+NiIfpLIBVD2427fJdyWHO5jTVlmC698Osh gl3w== X-Gm-Message-State: ALoCoQkwh5zF+IHiNXmDL9cW4J14cqkdi3WVCNTjsy2sTaQPuoM0Ts6ETF6MWHDbtL4fBg0nvB0g MIME-Version: 1.0 X-Received: by 10.202.84.135 with SMTP id i129mr7945453oib.114.1429397806346; Sat, 18 Apr 2015 15:56:46 -0700 (PDT) Received: by 10.202.80.6 with HTTP; Sat, 18 Apr 2015 15:56:46 -0700 (PDT) In-Reply-To: References: <201504182123.t3ILNHUk080941@svn.freebsd.org> Date: Sun, 19 Apr 2015 00:56:46 +0200 Message-ID: Subject: Re: svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen From: Oliver Pinter To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 22:56:47 -0000 On Sun, Apr 19, 2015 at 12:39 AM, Oliver Pinter wrote: > On Sat, Apr 18, 2015 at 11:23 PM, Konstantin Belousov wrote: >> Author: kib >> Date: Sat Apr 18 21:23:16 2015 >> New Revision: 281707 >> URL: https://svnweb.freebsd.org/changeset/base/281707 >> >> Log: >> Remove lazy pmap switch code from i386. Naive benchmark with md(4) >> shows no difference with the code removed. >> >> On both amd64 and i386, assert that a released pmap is not active. >> >> Proposed and reviewed by: alc >> Discussed with: Svatopluk Kraus , peter >> Sponsored by: The FreeBSD Foundation >> MFC after: 2 weeks >> >> Modified: >> head/sys/amd64/amd64/pmap.c >> head/sys/i386/i386/apic_vector.s >> head/sys/i386/i386/db_trace.c >> head/sys/i386/i386/mp_machdep.c >> head/sys/i386/i386/pmap.c >> head/sys/i386/i386/swtch.s >> head/sys/i386/include/smp.h >> head/sys/i386/xen/mp_machdep.c >> head/sys/i386/xen/pmap.c >> head/sys/x86/include/acpica_machdep.h >> head/sys/x86/xen/xen_apic.c >> >> Modified: head/sys/amd64/amd64/pmap.c >> ============================================================================== >> --- head/sys/amd64/amd64/pmap.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/amd64/amd64/pmap.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -2532,6 +2532,8 @@ pmap_release(pmap_t pmap) >> pmap->pm_stats.resident_count)); >> KASSERT(vm_radix_is_empty(&pmap->pm_root), >> ("pmap_release: pmap has reserved page table page(s)")); >> + KASSERT(CPU_EMPTY(&pmap->pm_active), >> + ("releasing active pmap %p", pmap)); >> >> if (pmap_pcid_enabled) { >> /* >> >> Modified: head/sys/i386/i386/apic_vector.s >> ============================================================================== >> --- head/sys/i386/i386/apic_vector.s Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/i386/apic_vector.s Sat Apr 18 21:23:16 2015 (r281707) >> @@ -320,19 +320,4 @@ IDTVEC(rendezvous) >> POP_FRAME >> iret >> >> -/* >> - * Clean up when we lose out on the lazy context switch optimization. >> - * ie: when we are about to release a PTD but a cpu is still borrowing it. >> - */ >> - SUPERALIGN_TEXT >> -IDTVEC(lazypmap) >> - PUSH_FRAME >> - SET_KERNEL_SREGS >> - cld >> - >> - call pmap_lazyfix_action >> - >> - call as_lapic_eoi >> - POP_FRAME >> - iret >> #endif /* SMP */ >> >> Modified: head/sys/i386/i386/db_trace.c >> ============================================================================== >> --- head/sys/i386/i386/db_trace.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/i386/db_trace.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -316,8 +316,7 @@ db_nextframe(struct i386_frame **fp, db_ >> frame_type = TRAP_TIMERINT; >> else if (strcmp(name, "Xcpustop") == 0 || >> strcmp(name, "Xrendezvous") == 0 || >> - strcmp(name, "Xipi_intr_bitmap_handler") == 0 || >> - strcmp(name, "Xlazypmap") == 0) >> + strcmp(name, "Xipi_intr_bitmap_handler") == 0) >> frame_type = TRAP_INTERRUPT; >> } >> >> >> Modified: head/sys/i386/i386/mp_machdep.c >> ============================================================================== >> --- head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -163,7 +163,6 @@ u_long *ipi_invlrng_counts[MAXCPU]; >> u_long *ipi_invlpg_counts[MAXCPU]; >> u_long *ipi_invlcache_counts[MAXCPU]; >> u_long *ipi_rendezvous_counts[MAXCPU]; >> -u_long *ipi_lazypmap_counts[MAXCPU]; >> static u_long *ipi_hardclock_counts[MAXCPU]; >> #endif >> >> @@ -576,10 +575,6 @@ cpu_mp_start(void) >> setidt(IPI_INVLCACHE, IDTVEC(invlcache), >> SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); >> >> - /* Install an inter-CPU IPI for lazy pmap release */ >> - setidt(IPI_LAZYPMAP, IDTVEC(lazypmap), >> - SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); >> - >> /* Install an inter-CPU IPI for all-CPU rendezvous */ >> setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous), >> SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); >> @@ -1672,8 +1667,6 @@ mp_ipi_intrcnt(void *dummy) >> intrcnt_add(buf, &ipi_ast_counts[i]); >> snprintf(buf, sizeof(buf), "cpu%d:rendezvous", i); >> intrcnt_add(buf, &ipi_rendezvous_counts[i]); >> - snprintf(buf, sizeof(buf), "cpu%d:lazypmap", i); >> - intrcnt_add(buf, &ipi_lazypmap_counts[i]); >> snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); >> intrcnt_add(buf, &ipi_hardclock_counts[i]); >> } >> >> Modified: head/sys/i386/i386/pmap.c >> ============================================================================== >> --- head/sys/i386/i386/pmap.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/i386/pmap.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -1248,18 +1248,14 @@ pmap_invalidate_cache_pages(vm_page_t *p >> } >> >> /* >> - * Are we current address space or kernel? N.B. We return FALSE when >> - * a pmap's page table is in use because a kernel thread is borrowing >> - * it. The borrowed page table can change spontaneously, making any >> - * dependence on its continued use subject to a race condition. >> + * Are we current address space or kernel? >> */ >> static __inline int >> pmap_is_current(pmap_t pmap) >> { >> >> - return (pmap == kernel_pmap || >> - (pmap == vmspace_pmap(curthread->td_proc->p_vmspace) && >> - (pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] & PG_FRAME))); >> + return (pmap == kernel_pmap || pmap == >> + vmspace_pmap(curthread->td_proc->p_vmspace)); >> } >> >> /* >> @@ -1923,108 +1919,6 @@ retry: >> * Pmap allocation/deallocation routines. >> ***************************************************/ >> >> -#ifdef SMP >> -/* >> - * Deal with a SMP shootdown of other users of the pmap that we are >> - * trying to dispose of. This can be a bit hairy. >> - */ >> -static cpuset_t *lazymask; >> -static u_int lazyptd; >> -static volatile u_int lazywait; >> - >> -void pmap_lazyfix_action(void); >> - >> -void >> -pmap_lazyfix_action(void) >> -{ >> - >> -#ifdef COUNT_IPIS >> - (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; >> -#endif >> - if (rcr3() == lazyptd) >> - load_cr3(curpcb->pcb_cr3); >> - CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); >> - atomic_store_rel_int(&lazywait, 1); >> -} >> - >> -static void >> -pmap_lazyfix_self(u_int cpuid) >> -{ >> - >> - if (rcr3() == lazyptd) >> - load_cr3(curpcb->pcb_cr3); >> - CPU_CLR_ATOMIC(cpuid, lazymask); >> -} >> - >> - >> -static void >> -pmap_lazyfix(pmap_t pmap) >> -{ >> - cpuset_t mymask, mask; >> - u_int cpuid, spins; >> - int lsb; >> - >> - mask = pmap->pm_active; >> - while (!CPU_EMPTY(&mask)) { >> - spins = 50000000; >> - >> - /* Find least significant set bit. */ >> - lsb = CPU_FFS(&mask); >> - MPASS(lsb != 0); >> - lsb--; >> - CPU_SETOF(lsb, &mask); >> - mtx_lock_spin(&smp_ipi_mtx); >> -#if defined(PAE) || defined(PAE_TABLES) >> - lazyptd = vtophys(pmap->pm_pdpt); >> -#else >> - lazyptd = vtophys(pmap->pm_pdir); >> -#endif >> - cpuid = PCPU_GET(cpuid); >> - >> - /* Use a cpuset just for having an easy check. */ >> - CPU_SETOF(cpuid, &mymask); >> - if (!CPU_CMP(&mask, &mymask)) { >> - lazymask = &pmap->pm_active; >> - pmap_lazyfix_self(cpuid); >> - } else { >> - atomic_store_rel_int((u_int *)&lazymask, >> - (u_int)&pmap->pm_active); >> - atomic_store_rel_int(&lazywait, 0); >> - ipi_selected(mask, IPI_LAZYPMAP); >> - while (lazywait == 0) { >> - ia32_pause(); >> - if (--spins == 0) >> - break; >> - } >> - } >> - mtx_unlock_spin(&smp_ipi_mtx); >> - if (spins == 0) >> - printf("pmap_lazyfix: spun for 50000000\n"); >> - mask = pmap->pm_active; >> - } >> -} >> - >> -#else /* SMP */ >> - >> -/* >> - * Cleaning up on uniprocessor is easy. For various reasons, we're >> - * unlikely to have to even execute this code, including the fact >> - * that the cleanup is deferred until the parent does a wait(2), which >> - * means that another userland process has run. >> - */ >> -static void >> -pmap_lazyfix(pmap_t pmap) >> -{ >> - u_int cr3; >> - >> - cr3 = vtophys(pmap->pm_pdir); >> - if (cr3 == rcr3()) { >> - load_cr3(curpcb->pcb_cr3); >> - CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); >> - } >> -} >> -#endif /* SMP */ >> - >> /* >> * Release any resources held by the given physical map. >> * Called when a pmap initialized by pmap_pinit is being released. >> @@ -2041,8 +1935,9 @@ pmap_release(pmap_t pmap) >> pmap->pm_stats.resident_count)); >> KASSERT(vm_radix_is_empty(&pmap->pm_root), >> ("pmap_release: pmap has reserved page table page(s)")); >> + KASSERT(CPU_EMPTY(&pmap->pm_active), >> + ("releasing active pmap %p", pmap)); >> >> - pmap_lazyfix(pmap); >> mtx_lock_spin(&allpmaps_lock); >> LIST_REMOVE(pmap, pm_list); >> mtx_unlock_spin(&allpmaps_lock); >> >> Modified: head/sys/i386/i386/swtch.s >> ============================================================================== >> --- head/sys/i386/i386/swtch.s Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/i386/swtch.s Sat Apr 18 21:23:16 2015 (r281707) >> @@ -174,12 +174,6 @@ ENTRY(cpu_switch) >> >> /* switch address space */ >> movl PCB_CR3(%edx),%eax >> -#if defined(PAE) || defined(PAE_TABLES) >> - cmpl %eax,IdlePDPT /* Kernel address space? */ >> -#else >> - cmpl %eax,IdlePTD /* Kernel address space? */ >> -#endif >> - je sw0 >> READ_CR3(%ebx) /* The same address space? */ >> cmpl %ebx,%eax >> je sw0 >> >> Modified: head/sys/i386/include/smp.h >> ============================================================================== >> --- head/sys/i386/include/smp.h Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/include/smp.h Sat Apr 18 21:23:16 2015 (r281707) >> @@ -42,7 +42,6 @@ extern u_long *ipi_invlrng_counts[MAXCPU >> extern u_long *ipi_invlpg_counts[MAXCPU]; >> extern u_long *ipi_invlcache_counts[MAXCPU]; >> extern u_long *ipi_rendezvous_counts[MAXCPU]; >> -extern u_long *ipi_lazypmap_counts[MAXCPU]; >> #endif >> >> /* IPI handlers */ >> @@ -54,8 +53,7 @@ inthand_t >> IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ >> IDTVEC(cpustop), /* CPU stops & waits to be restarted */ >> IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ >> - IDTVEC(rendezvous), /* handle CPU rendezvous */ >> - IDTVEC(lazypmap); /* handle lazy pmap release */ >> + IDTVEC(rendezvous); /* handle CPU rendezvous */ >> >> /* functions in mp_machdep.c */ >> void cpu_add(u_int apic_id, char boot_cpu); >> >> Modified: head/sys/i386/xen/mp_machdep.c >> ============================================================================== >> --- head/sys/i386/xen/mp_machdep.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/xen/mp_machdep.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -96,7 +96,6 @@ extern struct pcpu __pcpu[]; >> >> extern void Xhypervisor_callback(void); >> extern void failsafe_callback(void); >> -extern void pmap_lazyfix_action(void); >> >> /*--------------------------- Forward Declarations ---------------------------*/ >> static driver_filter_t smp_reschedule_interrupt; >> @@ -370,24 +369,16 @@ iv_invlcache(uintptr_t a, uintptr_t b) >> atomic_add_int(&smp_tlb_wait, 1); >> } >> >> -static void >> -iv_lazypmap(uintptr_t a, uintptr_t b) >> -{ >> - pmap_lazyfix_action(); >> - atomic_add_int(&smp_tlb_wait, 1); >> -} >> - >> /* >> * These start from "IPI offset" APIC_IPI_INTS >> */ >> -static call_data_func_t *ipi_vectors[6] = >> +static call_data_func_t *ipi_vectors[5] = >> { >> iv_rendezvous, >> iv_invltlb, >> iv_invlpg, >> iv_invlrng, >> iv_invlcache, >> - iv_lazypmap, >> }; >> >> /* >> >> Modified: head/sys/i386/xen/pmap.c >> ============================================================================== >> --- head/sys/i386/xen/pmap.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/i386/xen/pmap.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -1652,107 +1652,6 @@ retry: >> * Pmap allocation/deallocation routines. >> ***************************************************/ >> >> -#ifdef SMP >> -/* >> - * Deal with a SMP shootdown of other users of the pmap that we are >> - * trying to dispose of. This can be a bit hairy. >> - */ >> -static cpuset_t *lazymask; >> -static u_int lazyptd; >> -static volatile u_int lazywait; >> - >> -void pmap_lazyfix_action(void); >> - >> -void >> -pmap_lazyfix_action(void) >> -{ >> - >> -#ifdef COUNT_IPIS >> - (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; >> -#endif >> - if (rcr3() == lazyptd) >> - load_cr3(PCPU_GET(curpcb)->pcb_cr3); >> - CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); >> - atomic_store_rel_int(&lazywait, 1); >> -} >> - >> -static void >> -pmap_lazyfix_self(u_int cpuid) >> -{ >> - >> - if (rcr3() == lazyptd) >> - load_cr3(PCPU_GET(curpcb)->pcb_cr3); >> - CPU_CLR_ATOMIC(cpuid, lazymask); >> -} >> - >> - >> -static void >> -pmap_lazyfix(pmap_t pmap) >> -{ >> - cpuset_t mymask, mask; >> - u_int cpuid, spins; >> - int lsb; >> - >> - mask = pmap->pm_active; >> - while (!CPU_EMPTY(&mask)) { >> - spins = 50000000; >> - >> - /* Find least significant set bit. */ >> - lsb = CPU_FFS(&mask); >> - MPASS(lsb != 0); >> - lsb--; >> - CPU_SETOF(lsb, &mask); >> - mtx_lock_spin(&smp_ipi_mtx); >> -#ifdef PAE >> - lazyptd = vtophys(pmap->pm_pdpt); >> -#else >> - lazyptd = vtophys(pmap->pm_pdir); >> -#endif >> - cpuid = PCPU_GET(cpuid); >> - >> - /* Use a cpuset just for having an easy check. */ >> - CPU_SETOF(cpuid, &mymask); >> - if (!CPU_CMP(&mask, &mymask)) { >> - lazymask = &pmap->pm_active; >> - pmap_lazyfix_self(cpuid); >> - } else { >> - atomic_store_rel_int((u_int *)&lazymask, >> - (u_int)&pmap->pm_active); >> - atomic_store_rel_int(&lazywait, 0); >> - ipi_selected(mask, IPI_LAZYPMAP); >> - while (lazywait == 0) { >> - ia32_pause(); >> - if (--spins == 0) >> - break; >> - } >> - } >> - mtx_unlock_spin(&smp_ipi_mtx); >> - if (spins == 0) >> - printf("pmap_lazyfix: spun for 50000000\n"); >> - mask = pmap->pm_active; >> - } >> -} >> - >> -#else /* SMP */ >> - >> -/* >> - * Cleaning up on uniprocessor is easy. For various reasons, we're >> - * unlikely to have to even execute this code, including the fact >> - * that the cleanup is deferred until the parent does a wait(2), which >> - * means that another userland process has run. >> - */ >> -static void >> -pmap_lazyfix(pmap_t pmap) >> -{ >> - u_int cr3; >> - >> - cr3 = vtophys(pmap->pm_pdir); >> - if (cr3 == rcr3()) { >> - load_cr3(PCPU_GET(curpcb)->pcb_cr3); >> - CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); >> - } >> -} >> -#endif /* SMP */ >> >> /* >> * Release any resources held by the given physical map. >> @@ -1780,7 +1679,8 @@ pmap_release(pmap_t pmap) >> mtx_lock(&createdelete_lock); >> #endif >> >> - pmap_lazyfix(pmap); >> + KASSERT(CPU_EMPTY(&pmap->pm_active), >> + ("releasing active pmap %p", pmap)); >> mtx_lock_spin(&allpmaps_lock); >> LIST_REMOVE(pmap, pm_list); >> mtx_unlock_spin(&allpmaps_lock); >> >> Modified: head/sys/x86/include/acpica_machdep.h >> ============================================================================== >> --- head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/x86/include/acpica_machdep.h Sat Apr 18 21:23:16 2015 (r281707) >> @@ -74,6 +74,7 @@ enum intr_polarity; >> >> void acpi_SetDefaultIntrModel(int model); >> void acpi_cpu_c1(void); > > >> +void acpi_cpu_idle_mwait(uint32_t mwait_hint); > > This change is related of this commit or this belongs to other modificatons? Ahh, sorry. I just found now the r281710 commit. > >> void *acpi_map_table(vm_paddr_t pa, const char *sig); >> void acpi_unmap_table(void *table); >> vm_paddr_t acpi_find_table(const char *sig); >> >> Modified: head/sys/x86/xen/xen_apic.c >> ============================================================================== >> --- head/sys/x86/xen/xen_apic.c Sat Apr 18 21:22:26 2015 (r281706) >> +++ head/sys/x86/xen/xen_apic.c Sat Apr 18 21:23:16 2015 (r281707) >> @@ -68,9 +68,6 @@ static driver_filter_t xen_invltlb; >> static driver_filter_t xen_invlpg; >> static driver_filter_t xen_invlrng; >> static driver_filter_t xen_invlcache; >> -#ifdef __i386__ >> -static driver_filter_t xen_lazypmap; >> -#endif >> static driver_filter_t xen_ipi_bitmap_handler; >> static driver_filter_t xen_cpustop_handler; >> static driver_filter_t xen_cpususpend_handler; >> @@ -79,9 +76,6 @@ static driver_filter_t xen_cpustophard_h >> >> /*---------------------------- Extern Declarations ---------------------------*/ >> /* Variables used by mp_machdep to perform the MMU related IPIs */ >> -#ifdef __i386__ >> -extern void pmap_lazyfix_action(void); >> -#endif >> #ifdef __amd64__ >> extern int pmap_pcid_enabled; >> #endif >> @@ -104,9 +98,6 @@ static struct xen_ipi_handler xen_ipis[] >> [IPI_TO_IDX(IPI_INVLPG)] = { xen_invlpg, "ipg" }, >> [IPI_TO_IDX(IPI_INVLRNG)] = { xen_invlrng, "irg" }, >> [IPI_TO_IDX(IPI_INVLCACHE)] = { xen_invlcache, "ic" }, >> -#ifdef __i386__ >> - [IPI_TO_IDX(IPI_LAZYPMAP)] = { xen_lazypmap, "lp" }, >> -#endif >> [IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, >> [IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, >> [IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, >> @@ -474,16 +465,6 @@ xen_invlcache(void *arg) >> return (FILTER_HANDLED); >> } >> >> -#ifdef __i386__ >> -static int >> -xen_lazypmap(void *arg) >> -{ >> - >> - pmap_lazyfix_action(); >> - return (FILTER_HANDLED); >> -} >> -#endif >> - >> static int >> xen_cpustop_handler(void *arg) >> { >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 23:49:59 2015 Return-Path: Delivered-To: svn-src-all@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 C82B634D; Sat, 18 Apr 2015 23:49:59 +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 B617E312; Sat, 18 Apr 2015 23:49:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3INnxpb002802; Sat, 18 Apr 2015 23:49:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3INnwZc002791; Sat, 18 Apr 2015 23:49:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201504182349.t3INnwZc002791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 18 Apr 2015 23:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281718 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 23:49:59 -0000 Author: bdrewery Date: Sat Apr 18 23:49:57 2015 New Revision: 281718 URL: https://svnweb.freebsd.org/changeset/base/281718 Log: sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap n n...'. The parser considered 'trap exit INT' to reset the default for both EXIT and INT. This beahvior is not POSIX compliant. This was avoided if a value was specified for 'exit', but then disallows exiting with the signal received. A possible workaround is using ' exit'. However POSIX does allow this type of behavior if the parameters are all integers. Fix the handling for this and clarify its support in the manpage since it is specifically allowed by POSIX. Differential Revision: https://reviews.freebsd.org/D2325 Reviewed by: jilles MFC after: 2 weeks Added: head/bin/sh/tests/builtins/trap15.0 (contents, props changed) head/bin/sh/tests/builtins/trap16.0 (contents, props changed) Modified: head/bin/sh/sh.1 head/bin/sh/tests/builtins/Makefile head/bin/sh/trap.c Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat Apr 18 23:08:52 2015 (r281717) +++ head/bin/sh/sh.1 Sat Apr 18 23:49:57 2015 (r281718) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd February 22, 2015 +.Dd April 18, 2015 .Dt SH 1 .Os .Sh NAME @@ -2574,8 +2574,7 @@ the former causes the specified signal t and the latter causes the default action to be taken. Omitting the .Ar action -is another way to request the default action, for compatibility reasons this -usage is not recommended though. +and using only signal numbers is another way to request the default action. In a subshell or utility environment, the shell resets trapped (but not ignored) signals to the default action. The Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sat Apr 18 23:08:52 2015 (r281717) +++ head/bin/sh/tests/builtins/Makefile Sat Apr 18 23:49:57 2015 (r281718) @@ -137,6 +137,8 @@ FILES+= trap11.0 FILES+= trap12.0 FILES+= trap13.0 FILES+= trap14.0 +FILES+= trap15.0 +FILES+= trap16.0 FILES+= trap2.0 FILES+= trap3.0 FILES+= trap4.0 Added: head/bin/sh/tests/builtins/trap15.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/trap15.0 Sat Apr 18 23:49:57 2015 (r281718) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +(${SH} -c 'term(){ exit 5;}; trap term TERM; kill -TERM $$') & +wait >/dev/null 2>&1 $! +[ $? -eq 5 ] Added: head/bin/sh/tests/builtins/trap16.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/trap16.0 Sat Apr 18 23:49:57 2015 (r281718) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +traps=$(${SH} -c 'trap "echo bad" 0; trap - 0; trap') +[ -z "$traps" ] || exit 1 +traps=$(${SH} -c 'trap "echo bad" 0; trap "" 0; trap') +expected_traps=$(${SH} -c 'trap "" EXIT; trap') +[ "$traps" = "$expected_traps" ] || exit 2 +traps=$(${SH} -c 'trap "echo bad" 0; trap 0; trap') +[ -z "$traps" ] || exit 3 +traps=$(${SH} -c 'trap "echo bad" 0; trap -- 0; trap') +[ -z "$traps" ] || exit 4 +traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap - 0 1 2; trap') +[ -z "$traps" ] || exit 5 +traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap "" 0 1 2; trap') +expected_traps=$(${SH} -c 'trap "" EXIT HUP INT; trap') +[ "$traps" = "$expected_traps" ] || exit 6 +traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap 0 1 2; trap') +[ -z "$traps" ] || exit 7 +traps=$(${SH} -c 'trap "echo bad" 0 1 2; trap -- 0 1 2; trap') +[ -z "$traps" ] || exit 8 Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sat Apr 18 23:08:52 2015 (r281717) +++ head/bin/sh/trap.c Sat Apr 18 23:49:57 2015 (r281718) @@ -183,7 +183,7 @@ trapcmd(int argc __unused, char **argv) return 0; } action = NULL; - if (*argv && sigstring_to_signum(*argv) == -1) { + if (*argv && !is_number(*argv)) { if (strcmp(*argv, "-") == 0) argv++; else { From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 23:56:05 2015 Return-Path: Delivered-To: svn-src-all@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 2C4245DF; Sat, 18 Apr 2015 23:56: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 1AE713F1; Sat, 18 Apr 2015 23:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3INu4ba008808; Sat, 18 Apr 2015 23:56:04 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3INu4HD008807; Sat, 18 Apr 2015 23:56:04 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504182356.t3INu4HD008807@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 18 Apr 2015 23:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281719 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 23:56:05 -0000 Author: eadler Date: Sat Apr 18 23:56:04 2015 New Revision: 281719 URL: https://svnweb.freebsd.org/changeset/base/281719 Log: bin/ed: use correct type in multiplication The result is line_t** so the multiplication should be size * sizeof(line_t*) MFC After: 1 month Modified: head/bin/ed/glbl.c Modified: head/bin/ed/glbl.c ============================================================================== --- head/bin/ed/glbl.c Sat Apr 18 23:49:57 2015 (r281718) +++ head/bin/ed/glbl.c Sat Apr 18 23:56:04 2015 (r281719) @@ -153,7 +153,7 @@ set_active_node(line_t *lp) if (active_list != NULL) { #endif if ((ts = (line_t **) realloc(active_list, - (ti += MINBUFSZ) * sizeof(line_t **))) == NULL) { + (ti += MINBUFSZ) * sizeof(line_t *))) == NULL) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "out of memory"; SPL0();