From owner-svn-src-all@freebsd.org Sun Aug 30 01:40:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B799C5890; Sun, 30 Aug 2015 01:40:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.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 8740FE9D; Sun, 30 Aug 2015 01:40:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7U1e0MK039050; Sun, 30 Aug 2015 01:40:00 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7U1e0ej039049; Sun, 30 Aug 2015 01:40:00 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508300140.t7U1e0ej039049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 30 Aug 2015 01:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287299 - head/sys/boot/efi/loader/arch/amd64 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: Sun, 30 Aug 2015 01:40:00 -0000 Author: marcel Date: Sun Aug 30 01:39:59 2015 New Revision: 287299 URL: https://svnweb.freebsd.org/changeset/base/287299 Log: Add a gop command to help diagnose VT efifb problems. The gop command has the following sub-commands: list - list all possible modes (paged) get - return the current mode set - set the current mode to Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Aug 29 20:41:09 2015 (r287298) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sun Aug 30 01:39:59 2015 (r287299) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -83,3 +84,97 @@ efi_find_framebuffer(struct efi_fb *efif } return (0); } + +COMMAND_SET(gop, "gop", "graphics output protocol", command_gop); + +static void +command_gop_display(u_int mode, EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info) +{ + + printf("mode %u: %ux%u, stride=%u, color=", mode, + info->HorizontalResolution, info->VerticalResolution, + info->PixelsPerScanLine); + switch (info->PixelFormat) { + case PixelRedGreenBlueReserved8BitPerColor: + printf("32-bit (RGB)"); + break; + case PixelBlueGreenRedReserved8BitPerColor: + printf("32-bit (BGR)"); + break; + case PixelBitMask: + printf("mask (R=%x, G=%x, B=%x, X=%x)", + info->PixelInformation.RedMask, + info->PixelInformation.GreenMask, + info->PixelInformation.BlueMask, + info->PixelInformation.ReservedMask); + break; + case PixelBltOnly: + printf("unsupported (blt only)"); + break; + default: + printf("unsupported (unknown)"); + break; + } +} + +static int +command_gop(int argc, char *argv[]) +{ + EFI_GRAPHICS_OUTPUT *gop; + EFI_STATUS status; + u_int mode; + + status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); + if (EFI_ERROR(status)) { + sprintf(command_errbuf, "%s: Graphics Output Protocol not " + "present (error=%lu)", argv[0], status & ~EFI_ERROR_MASK); + return (CMD_ERROR); + } + + if (argc == 1) + goto usage; + + if (!strcmp(argv[1], "set")) { + char *cp; + + if (argc != 3) + goto usage; + mode = strtol(argv[2], &cp, 0); + if (cp[0] != '\0') { + sprintf(command_errbuf, "mode is an integer"); + return (CMD_ERROR); + } + status = gop->SetMode(gop, mode); + if (EFI_ERROR(status)) { + sprintf(command_errbuf, "%s: Unable to set mode to " + "%u (error=%lu)", argv[0], mode, + status & ~EFI_ERROR_MASK); + return (CMD_ERROR); + } + } else if (!strcmp(argv[1], "get")) { + command_gop_display(gop->Mode->Mode, gop->Mode->Info); + printf("\n frame buffer: address=%jx, size=%lx\n", + (uintmax_t)gop->Mode->FrameBufferBase, + gop->Mode->FrameBufferSize); + } else if (!strcmp(argv[1], "list")) { + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; + UINTN infosz; + + pager_open(); + for (mode = 0; mode < gop->Mode->MaxMode; mode++) { + status = gop->QueryMode(gop, mode, &infosz, &info); + if (EFI_ERROR(status)) + continue; + command_gop_display(mode, info); + if (pager_output("\n")) + break; + } + pager_close(); + } + return (CMD_OK); + + usage: + sprintf(command_errbuf, "usage: %s [list | get | set ]", + argv[0]); + return (CMD_ERROR); +} From owner-svn-src-all@freebsd.org Sun Aug 30 04:46:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F249C09BC; Sun, 30 Aug 2015 04:46:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 671DE1DD; Sun, 30 Aug 2015 04:46:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7U4kjqH026051; Sun, 30 Aug 2015 04:46:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7U4kjlp026050; Sun, 30 Aug 2015 04:46:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508300446.t7U4kjlp026050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Aug 2015 04:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287300 - head/lib/libc/gen 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: Sun, 30 Aug 2015 04:46:45 -0000 Author: kib Date: Sun Aug 30 04:46:44 2015 New Revision: 287300 URL: https://svnweb.freebsd.org/changeset/base/287300 Log: Fix a mistake in r287292. Despite correctly stating intent in the comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF handlers used libthr interposed functions instead of syscalls. Noted by: jilles Sponsored by: The FreeBSD Foundation MFC after: 6 days Modified: head/lib/libc/gen/posix_spawn.c Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Sun Aug 30 01:39:59 2015 (r287299) +++ head/lib/libc/gen/posix_spawn.c Sun Aug 30 04:46:44 2015 (r287300) @@ -123,13 +123,13 @@ process_spawnattr(const posix_spawnattr_ * Use unwrapped syscall, libthr is in undefined state after vfork(). */ if (sa->sa_flags & POSIX_SPAWN_SETSIGMASK) { - __libc_sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL); + __sys_sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL); } if (sa->sa_flags & POSIX_SPAWN_SETSIGDEF) { for (i = 1; i <= _SIG_MAXSIG; i++) { if (sigismember(&sa->sa_sigdefault, i)) - if (__libc_sigaction(i, &sigact, NULL) != 0) + if (__sys_sigaction(i, &sigact, NULL) != 0) return (errno); } } From owner-svn-src-all@freebsd.org Sun Aug 30 05:55:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDDC69C5C31; Sun, 30 Aug 2015 05:55:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFADF11; Sun, 30 Aug 2015 05:55:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) 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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 4C4FF42406D; Sun, 30 Aug 2015 15:36:28 +1000 (AEST) Date: Sun, 30 Aug 2015 15:36:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Joerg Sonnenberger cc: Bruce Evans , Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd In-Reply-To: <20150828143847.GA24222@britannica.bec.de> Message-ID: <20150830151625.K1159@besplex.bde.org> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> 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=C/8Usl7+ c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=mGv_DlIlq0PPiHA2Y44A: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: Sun, 30 Aug 2015 05:55:28 -0000 On Fri, 28 Aug 2015, Joerg Sonnenberger wrote: > On Fri, Aug 28, 2015 at 10:17:56PM +1000, Bruce Evans wrote: >>> -static void die(int); >>> +static void die(int) __dead2; >> >> Since the function is static, it is very easy for the compiler to see >> that it doesn't return. > > But the compiler can't tell if it is the *intention* that the function > never returns. The warning behavior exists because that can easily > change with macros etc. The compiler should trust the programmer to write correct functions. >> Even gcc-4.2.1 does this by default, since >> -O implies -funit-at-a-time for gcc-4.2.1. For clang, there is no way >> to prevent this (except possibly -O0) since, since -fno-unit-at-a-time >> is broken in clang. > > It is not broken. It is loadly ignored as unsupported. The very > existance of the option in GCC has always been a concession to broken > and badly written code, including of course GCC's own CRT. Unsupported == incompatible == broken. My use of this option can probably be reduced to -fno-toplevel-reorder, but that is even more broken in clang (it and -ftoplevel-reorder are "unknown arguments", while -fno-unit-at-a-time is an "unsupported optimization", and -funit-at-a-time works). Bruce From owner-svn-src-all@freebsd.org Sun Aug 30 08:39:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 302229C32EE; Sun, 30 Aug 2015 08:39:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 21304644; Sun, 30 Aug 2015 08:39:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7U8d0nK019948; Sun, 30 Aug 2015 08:39:00 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7U8cxvj019947; Sun, 30 Aug 2015 08:38:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508300838.t7U8cxvj019947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Aug 2015 08:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287301 - head/libexec/talkd 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: Sun, 30 Aug 2015 08:39:00 -0000 Author: delphij Date: Sun Aug 30 08:38:59 2015 New Revision: 287301 URL: https://svnweb.freebsd.org/changeset/base/287301 Log: Don't assign 'ptr' without using it. Reported by: clang static analyzer MFC after: 2 weeks Modified: head/libexec/talkd/table.c Modified: head/libexec/talkd/table.c ============================================================================== --- head/libexec/talkd/table.c Sun Aug 30 04:46:44 2015 (r287300) +++ head/libexec/talkd/table.c Sun Aug 30 08:38:59 2015 (r287301) @@ -197,7 +197,6 @@ delete_invite(u_int32_t id_num) { TABLE_ENTRY *ptr; - ptr = table; if (debug) syslog(LOG_DEBUG, "delete_invite(%d)", id_num); for (ptr = table; ptr != NIL; ptr = ptr->next) { From owner-svn-src-all@freebsd.org Sun Aug 30 08:46:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8879C37C4; Sun, 30 Aug 2015 08:46:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1B270BA2; Sun, 30 Aug 2015 08:46:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7U8koRj024037; Sun, 30 Aug 2015 08:46:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7U8kovc024036; Sun, 30 Aug 2015 08:46:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508300846.t7U8kovc024036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 30 Aug 2015 08:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287302 - head/sys/contrib/dev/ath/ath_hal/ar9300 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: Sun, 30 Aug 2015 08:46:51 -0000 Author: adrian Date: Sun Aug 30 08:46:50 2015 New Revision: 287302 URL: https://svnweb.freebsd.org/changeset/base/287302 Log: Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed logical negation when used in this fashion. Tested: * compile only Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sun Aug 30 08:38:59 2015 (r287301) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sun Aug 30 08:46:50 2015 (r287302) @@ -539,7 +539,7 @@ skip_ws_det: OS_REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); } - if (!is_on != ani_state->ofdm_weak_sig_detect_off) { + if ((!is_on) != ani_state->ofdm_weak_sig_detect_off) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: ofdm weak signal: %s=>%s\n", __func__, chan->ic_freq, @@ -684,7 +684,7 @@ skip_ws_det: OS_REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL, AR_PHY_MRC_CCK_MUX_REG, is_on); } - if (!is_on != ani_state->mrc_cck_off) { + if ((!is_on) != ani_state->mrc_cck_off) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: MRC CCK: %s=>%s\n", __func__, chan->ic_freq, !ani_state->mrc_cck_off ? "on" : "off", is_on ? "on" : "off"); From owner-svn-src-all@freebsd.org Sun Aug 30 08:48:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 048049C38B4; Sun, 30 Aug 2015 08:48:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E8A20D35; Sun, 30 Aug 2015 08:48:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7U8mWEm024150; Sun, 30 Aug 2015 08:48:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7U8mWVk024148; Sun, 30 Aug 2015 08:48:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508300848.t7U8mWVk024148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Aug 2015 08:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287303 - head/sys/dev/ipmi 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: Sun, 30 Aug 2015 08:48:33 -0000 Author: delphij Date: Sun Aug 30 08:48:31 2015 New Revision: 287303 URL: https://svnweb.freebsd.org/changeset/base/287303 Log: Remove support for FreeBSD < 602110. Modified: head/sys/dev/ipmi/ipmi_smbios.c head/sys/dev/ipmi/ipmivars.h Modified: head/sys/dev/ipmi/ipmi_smbios.c ============================================================================== --- head/sys/dev/ipmi/ipmi_smbios.c Sun Aug 30 08:46:50 2015 (r287302) +++ head/sys/dev/ipmi/ipmi_smbios.c Sun Aug 30 08:48:31 2015 (r287303) @@ -47,11 +47,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#if __FreeBSD_version < 602110 -#define pmap_mapbios pmap_mapdev -#define pmap_unmapbios pmap_unmapdev -#endif - struct ipmi_entry { uint8_t type; uint8_t length; Modified: head/sys/dev/ipmi/ipmivars.h ============================================================================== --- head/sys/dev/ipmi/ipmivars.h Sun Aug 30 08:46:50 2015 (r287302) +++ head/sys/dev/ipmi/ipmivars.h Sun Aug 30 08:48:31 2015 (r287303) @@ -194,13 +194,6 @@ struct ipmi_ipmb { #define IPMI_IO_UNLOCK(sc) mtx_unlock(&(sc)->ipmi_io_lock) #define IPMI_IO_LOCK_ASSERT(sc) mtx_assert(&(sc)->ipmi_io_lock, MA_OWNED) -#if __FreeBSD_version < 601105 -#define bus_read_1(r, o) \ - bus_space_read_1(rman_get_bustag(r), rman_get_bushandle(r), (o)) -#define bus_write_1(r, o, v) \ - bus_space_write_1(rman_get_bustag(r), rman_get_bushandle(r), (o), (v)) -#endif - /* I/O to a single I/O resource. */ #define INB_SINGLE(sc, x) \ bus_read_1((sc)->ipmi_io_res[0], (sc)->ipmi_io_spacing * (x)) From owner-svn-src-all@freebsd.org Sun Aug 30 09:53:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A1D29C4D0A for ; Sun, 30 Aug 2015 09:53:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yk0-f173.google.com (mail-yk0-f173.google.com [209.85.160.173]) (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 13A3AE78 for ; Sun, 30 Aug 2015 09:53:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by ykbu129 with SMTP id u129so21367524ykb.2 for ; Sun, 30 Aug 2015 02:53: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:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=x8LARGHCL01ANF6lnRA5Z+YIgRR0hR56n/+mY661S2o=; b=Ve7aedfveqgDzOiK9DlJvWyOn/mduMxN8YQT8bEXsXEh2aCEIdMDnLR9Kr5noPq50Z AkeWypHuNxFRfNAIdQWIUDq2ZLDIqd9V2NFcdrrDonrMRNksbVNoxVYEKL/fDpR9jPvx Jdj0gaW0yNjU/ObZInh3ZX0K6iNzCrkMVl0EoHQDck+T38VPKwgTs9e2Vb6TTt7lTeIk Q453LEvuYj9aQqu0PeI6VuuDxl5sRWW25TiqfXsdf/r/AAE91cRurhyiAQ/0joUwMFLb yia/vkm7/Sb7vFaP4yO4SdGvtO1bd+NvdMVxsyj14DHbEbKYNP7RF5kcvVM+YvhVZICX FSew== X-Gm-Message-State: ALoCoQm/di0N87DUbpYyqsoellDZnnM/fMR3xijMy3q1opgfFmxIq4M/5vnq27YCvM8b/JdXm2Qo MIME-Version: 1.0 X-Received: by 10.170.117.22 with SMTP id j22mr1303448ykb.79.1440928380346; Sun, 30 Aug 2015 02:53:00 -0700 (PDT) Received: by 10.129.113.67 with HTTP; Sun, 30 Aug 2015 02:53:00 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <20150828143847.GA24222@britannica.bec.de> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> Date: Sun, 30 Aug 2015 11:53:00 +0200 Message-ID: Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd From: Ed Schouten To: Joerg Sonnenberger Cc: Bruce Evans , Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers 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: Sun, 30 Aug 2015 09:53:08 -0000 2015-08-28 16:38 GMT+02:00 Joerg Sonnenberger : > But the compiler can't tell if it is the *intention* that the function > never returns. The warning behavior exists because that can easily > change with macros etc. I think it's important to keep in mind what this keyword was designed for. The idea behind this attribute (and the C11 _Noreturn keyword) is to allow for propagation of optimisation state across compilation units. You use it to annotate functions in header files, so that the compiler does not need to handle function return at the call site. This knowledge can be automatically be inferred if the function is static. Whether the compiler can throw additional warnings or not based on whether this keyword is present or what the intent of the programmer is, is completely irrelevant. I agree with Bruce that this change makes little sense. I would even go as far as to say that GCC/Clang should just throw warnings if _Noreturn is used on a function that is static or used on a definition instead of a declaration. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Sun Aug 30 12:07:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 485EB9C6D77; Sun, 30 Aug 2015 12:07:21 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F8E5F82; Sun, 30 Aug 2015 12:07:21 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 473713592E1; Sun, 30 Aug 2015 14:07:18 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 0530B28494; Sun, 30 Aug 2015 14:07:18 +0200 (CEST) Date: Sun, 30 Aug 2015 14:07:17 +0200 From: Jilles Tjoelker To: Ed Schouten Cc: Joerg Sonnenberger , Bruce Evans , Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd Message-ID: <20150830120717.GA65410@stack.nl> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: Sun, 30 Aug 2015 12:07:21 -0000 On Sun, Aug 30, 2015 at 11:53:00AM +0200, Ed Schouten wrote: > 2015-08-28 16:38 GMT+02:00 Joerg Sonnenberger : > > But the compiler can't tell if it is the *intention* that the function > > never returns. The warning behavior exists because that can easily > > change with macros etc. > I think it's important to keep in mind what this keyword was designed for. > The idea behind this attribute (and the C11 _Noreturn keyword) is to > allow for propagation of optimisation state across compilation units. > You use it to annotate functions in header files, so that the compiler > does not need to handle function return at the call site. This > knowledge can be automatically be inferred if the function is static. Although you are right philosophically, in practice there are some compilers and static analyzers that do benefit from noreturn attributes on static functions. In particular, gcc 4.2.1 generates better code and fewer warnings if static functions are annotated with noreturn if appropriate, and some versions of the Clang/LLVM static analyzer do not do any cross-procedural analysis at all and depend on noreturn attributes on static functions to avoid false positives. > Whether the compiler can throw additional warnings or not based on > whether this keyword is present or what the intent of the programmer > is, is completely irrelevant. In practice this means that many compiler warnings need to be disabled for the affected compilers. > I agree with Bruce that this change makes little sense. I would even > go as far as to say that GCC/Clang should just throw warnings if > _Noreturn is used on a function that is static or used on a definition > instead of a declaration. _Noreturn on a global definition makes no sense but on a static function it may still be needed. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Sun Aug 30 13:44:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5291D9C62D8; Sun, 30 Aug 2015 13:44:40 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.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 36E791027; Sun, 30 Aug 2015 13:44:40 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UDieqD051399; Sun, 30 Aug 2015 13:44:40 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UDidiA051397; Sun, 30 Aug 2015 13:44:39 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508301344.t7UDidiA051397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Sun, 30 Aug 2015 13:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287304 - 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: Sun, 30 Aug 2015 13:44:40 -0000 Author: jch Date: Sun Aug 30 13:44:39 2015 New Revision: 287304 URL: https://svnweb.freebsd.org/changeset/base/287304 Log: Put r284245 back in place: If at first this fix was seen as a temporary workaround for a callout(9) issue, it turns out it is instead the right way to use callout in mpsafe mode without using callout_drain(). r284245 commit message: Fix a callout race condition introduced in TCP timers callouts with r281599. In TCP timer context, it is not enough to check callout_stop() return value to decide if a callout is still running or not, previous callout_reset() return values have also to be checked. Differential Revision: https://reviews.freebsd.org/D2763 Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Aug 30 08:48:31 2015 (r287303) +++ head/sys/netinet/tcp_timer.c Sun Aug 30 13:44:39 2015 (r287304) @@ -355,10 +355,12 @@ tcp_timer_2msl(void *xtp) TCPSTAT_INC(tcps_finwait2_drops); tp = tcp_close(tp); } else { - if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) - callout_reset(&tp->t_timers->tt_2msl, - TP_KEEPINTVL(tp), tcp_timer_2msl, tp); - else + if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { + if (!callout_reset(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { + tp->t_timers->tt_flags &= ~TT_2MSL_RST; + } + } else tp = tcp_close(tp); } @@ -438,11 +440,14 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), - tcp_timer_keep, tp); - } else - callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), - tcp_timer_keep, tp); + if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp)) { + tp->t_timers->tt_flags &= ~TT_KEEP_RST; + } + } else if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp)) { + tp->t_timers->tt_flags &= ~TT_KEEP_RST; + } #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) @@ -801,6 +806,7 @@ tcp_timer_activate(struct tcpcb *tp, uin timeout_t *f_callout; struct inpcb *inp = tp->t_inpcb; int cpu = inp_to_cpuid(inp); + uint32_t f_reset; #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) @@ -814,38 +820,49 @@ tcp_timer_activate(struct tcpcb *tp, uin case TT_DELACK: t_callout = &tp->t_timers->tt_delack; f_callout = tcp_timer_delack; + f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; f_callout = tcp_timer_rexmt; + f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; f_callout = tcp_timer_persist; + f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; f_callout = tcp_timer_keep; + f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; f_callout = tcp_timer_2msl; + f_reset = TT_2MSL_RST; break; default: panic("tp %p bad timer_type %#x", tp, timer_type); } if (delta == 0) { if ((tp->t_timers->tt_flags & timer_type) && - callout_stop(t_callout)) { - tp->t_timers->tt_flags &= ~timer_type; + callout_stop(t_callout) && + (tp->t_timers->tt_flags & f_reset)) { + tp->t_timers->tt_flags &= ~(timer_type | f_reset); } } else { if ((tp->t_timers->tt_flags & timer_type) == 0) { - tp->t_timers->tt_flags |= timer_type; + tp->t_timers->tt_flags |= (timer_type | f_reset); 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); + if (!callout_reset(t_callout, delta, f_callout, tp)) { + /* + * Callout not cancelled, consider it as not + * properly restarted. */ + tp->t_timers->tt_flags &= ~f_reset; + } } } } @@ -882,6 +899,7 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ { struct callout *t_callout; timeout_t *f_callout; + uint32_t f_reset; tp->t_timers->tt_flags |= TT_STOPPED; @@ -889,30 +907,36 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ case TT_DELACK: t_callout = &tp->t_timers->tt_delack; f_callout = tcp_timer_delack_discard; + f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; f_callout = tcp_timer_rexmt_discard; + f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; f_callout = tcp_timer_persist_discard; + f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; f_callout = tcp_timer_keep_discard; + f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; f_callout = tcp_timer_2msl_discard; + f_reset = TT_2MSL_RST; 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; + if (callout_stop(t_callout) && + (tp->t_timers->tt_flags & f_reset)) { + tp->t_timers->tt_flags &= ~(timer_type | f_reset); } else { /* * Can't stop the callout, defer tcpcb actual deletion Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Sun Aug 30 08:48:31 2015 (r287303) +++ head/sys/netinet/tcp_timer.h Sun Aug 30 13:44:39 2015 (r287304) @@ -159,6 +159,12 @@ struct tcp_timer { #define TT_2MSL 0x0010 #define TT_MASK (TT_DELACK|TT_REXMT|TT_PERSIST|TT_KEEP|TT_2MSL) +#define TT_DELACK_RST 0x0100 +#define TT_REXMT_RST 0x0200 +#define TT_PERSIST_RST 0x0400 +#define TT_KEEP_RST 0x0800 +#define TT_2MSL_RST 0x1000 + #define TT_STOPPED 0x00010000 #define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) From owner-svn-src-all@freebsd.org Sun Aug 30 13:44:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5D99C62FC; Sun, 30 Aug 2015 13:44:47 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.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 DD3C3113A; Sun, 30 Aug 2015 13:44:46 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UDikZ7051453; Sun, 30 Aug 2015 13:44:46 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UDikio051452; Sun, 30 Aug 2015 13:44:46 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508301344.t7UDikio051452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Sun, 30 Aug 2015 13:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287305 - 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: Sun, 30 Aug 2015 13:44:47 -0000 Author: jch Date: Sun Aug 30 13:44:46 2015 New Revision: 287305 URL: https://svnweb.freebsd.org/changeset/base/287305 Log: Revert r286880: If at first this change made sense, it turns out it helps only the TCP timers callout(9) usage. As the benefit for others callout(9) usages did not reach a consensus the historical usage should prevail. Differential Revision: https://reviews.freebsd.org/D3078 Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Aug 30 13:44:39 2015 (r287304) +++ head/sys/kern/kern_timeout.c Sun Aug 30 13:44:46 2015 (r287305) @@ -1151,7 +1151,6 @@ _callout_stop_safe(struct callout *c, in struct lock_class *class; int direct, sq_locked, use_lock; int not_on_a_list; - int not_running = 1; if (safe) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, @@ -1379,17 +1378,8 @@ again: } } callout_cc_del(c, cc); - - if (!use_lock) { - /* - * If we are asked to stop a callout which is currently in progress - * and indeed impossible to stop then return 0. - */ - not_running = !(cc_exec_curr(cc, direct) == c); - } - CC_UNLOCK(cc); - return (not_running); + return (1); } void From owner-svn-src-all@freebsd.org Sun Aug 30 15:11:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52CE89C648C; Sun, 30 Aug 2015 15:11:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 14175A46; Sun, 30 Aug 2015 15:11:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) 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 7375F783A1E; Mon, 31 Aug 2015 00:42:43 +1000 (AEST) Date: Mon, 31 Aug 2015 00:42:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker cc: Ed Schouten , Joerg Sonnenberger , Bruce Evans , Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd In-Reply-To: <20150830120717.GA65410@stack.nl> Message-ID: <20150830231012.Y2323@besplex.bde.org> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> <20150830120717.GA65410@stack.nl> 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=L4TgOLn8 c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=OkyNbYsw98JM7tdQpS4A: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: Sun, 30 Aug 2015 15:11:49 -0000 On Sun, 30 Aug 2015, Jilles Tjoelker wrote: > On Sun, Aug 30, 2015 at 11:53:00AM +0200, Ed Schouten wrote: >> 2015-08-28 16:38 GMT+02:00 Joerg Sonnenberger : >>> But the compiler can't tell if it is the *intention* that the function >>> never returns. The warning behavior exists because that can easily >>> change with macros etc. > >> I think it's important to keep in mind what this keyword was designed for. > >> The idea behind this attribute (and the C11 _Noreturn keyword) is to >> allow for propagation of optimisation state across compilation units. >> You use it to annotate functions in header files, so that the compiler >> does not need to handle function return at the call site. This >> knowledge can be automatically be inferred if the function is static. > > Although you are right philosophically, in practice there are some > compilers and static analyzers that do benefit from noreturn attributes > on static functions. In particular, gcc 4.2.1 generates better code and > fewer warnings if static functions are annotated with noreturn if > appropriate, and some versions of the Clang/LLVM static analyzer do not > do any cross-procedural analysis at all and depend on noreturn > attributes on static functions to avoid false positives. If this were important, then __dead2 would be used a lot for important functions, not for usage() and die(). It is in fact so important that __dead2 is used a whole 86 times in $(find /usr/src -name *.c): - 10 uses for non-static functions where there is actually a reason to use __dead2, but about half of these 10 are due to missing staticization - 30 uses for static usage(). All of these uses have the correct syntax with __dead2 at the end (some versions of gcc only allow attributes near the end) - 46 other uses. Mostly for functions like panic(), exit() or err(). 18 of these have syntax errors with __dead2 not at the end (or near the end, preceding other attributes). There are 10 'static __dead2 void's, 7 'static void __dead2's, and 1 '__dead2 static void'. Non-FreeBSD spellings of __dead2 are more popular. $(find /usr/src -name *.c) has 200 lines matching 'oreturn'. About 73 of these use the hard-coded gccism __attribute(()). The C11ish _Noreturn is used just 4 times (3 times in rlogin for static functions that don't need it and 1 time in libstdthreads). Outside of contrib, there are just 30 lines matching 'oreturn': 11 in crypto/heimdal, 2 in routed/rtqery, 8 in tools/regression for static usage(), 4 _Noreturns as above, 1 in xlint, 1 in pkill, 2 in comments and 1 unrelated match. > In practice this means that many compiler warnings need to be disabled > for the affected compilers. An example is the LLVM static checker in 2008, but hopefully not later versions if this or any compiler ever used in FreeBSD. errexit() in echo/echo.c always compiled at WARNS=6 with gcc, but was changed in 2008 to define (sic) it as __dead2 with the excuse that this reduces warnings with the static checker. The change is quite broken: - it has the syntax error 'static __dead2 void' - __dead2 is applied to the definition of the function. It doesn't take -funit-at-a-time to see when a static function which is defined before it is used doesn't return. This application point also makes the syntax problems larger. It is now natural to place the attribute declaration where it is, and there is a good chance that the old versions of gcc that didn't like it there also didn't like it being at the end. The errexit() function has many style bugs: - no prototype before the function. This is not a large style bug. The function is unsorted before main() so that it can be its own protoype. But this leaves no natural place to put the attribute. - initialization in declaration - missing blank line after declarations - garbage reason for existence of the function. 4.4BSD doesn't have the function or its style bugs, but just uses printf(). /bin/echo was "optimized" in FreeBSD to avoid using printf(). But with dynamic linkage, the space optimization is almost null, and with libc bloat for static linkage, the optimization doesn't work (/bin/echo has size 11K in my version of 5.2 where the bloat is smaller, but 415K in -current). The main() function in echo/echo.c has rotted similarly. To avoid using printf() in a loop, it uses complicated allocation and writev(). This optimization is about 5% faster for 10000 args created by $(jot 10000 0), but most uses of echo are with only a couple of args. With 10 args created by $(jot 10 0), the "optimization" is about 2% slower. Bruce From owner-svn-src-all@freebsd.org Sun Aug 30 15:38:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D8FF9C6A7C; Sun, 30 Aug 2015 15:38:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4E3FAA97; Sun, 30 Aug 2015 15:38:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UFcgL3099236; Sun, 30 Aug 2015 15:38:42 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UFcg41099235; Sun, 30 Aug 2015 15:38:42 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508301538.t7UFcg41099235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 30 Aug 2015 15:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287306 - 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.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: Sun, 30 Aug 2015 15:38:42 -0000 Author: loos Date: Sun Aug 30 15:38:41 2015 New Revision: 287306 URL: https://svnweb.freebsd.org/changeset/base/287306 Log: In preparation to support other A20 based boards, rename the CUBIEBOARD2 kernel configuration to A20. There are other boards (namely the banana pi) that use exactly the same devices. Additionally, we are moving from static FDT support (DTB compiled in-kernel) to DTB passed to kernel by the boot loader (ubldr). The u-boot for these boards are already available on ports and as the crochet support for these boards isn't committed yet, this should not bring any issues. Discussed with: ian Added: head/sys/arm/conf/A20 - copied, changed from r287120, head/sys/arm/conf/CUBIEBOARD2 Deleted: head/sys/arm/conf/CUBIEBOARD2 Copied and modified: head/sys/arm/conf/A20 (from r287120, head/sys/arm/conf/CUBIEBOARD2) ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Mon Aug 24 23:40:36 2015 (r287120, copy source) +++ head/sys/arm/conf/A20 Sun Aug 30 15:38:41 2015 (r287306) @@ -1,6 +1,5 @@ # -# CUBIEBOARD2 -- Custom configuration for the CUBIEBOARD2 ARM development -# platform, check out http://www.cubieboard.org +# A20 -- Custom configuration for the Allwinner A20 ARM SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -19,7 +18,7 @@ # # $FreeBSD$ -ident CUBIEBOARD2 +ident A20 include "std.armv6" include "../allwinner/a20/std.a20" @@ -109,6 +108,4 @@ device miibus # Flattened Device Tree options FDT # Configure using FDT/DTB data -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=cubieboard2.dts makeoptions MODULES_EXTRA=dtb/allwinner From owner-svn-src-all@freebsd.org Sun Aug 30 16:10:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A5559C6578; Sun, 30 Aug 2015 16:10:13 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1B47EE8F; Sun, 30 Aug 2015 16:10:13 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UGACI5013411; Sun, 30 Aug 2015 16:10:12 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UGAC4e013410; Sun, 30 Aug 2015 16:10:12 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508301610.t7UGAC4e013410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 30 Aug 2015 16:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287307 - head/sys/boot/fdt/dts/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: Sun, 30 Aug 2015 16:10:13 -0000 Author: loos Date: Sun Aug 30 16:10:12 2015 New Revision: 287307 URL: https://svnweb.freebsd.org/changeset/base/287307 Log: Reduce the difference to vendor DTS by using the vendor compat strings (at some point we have to use the complete vendor DTS files, but we're not there yet). Modified: head/sys/boot/fdt/dts/arm/bananapi.dts Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Sun Aug 30 15:38:41 2015 (r287306) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Sun Aug 30 16:10:12 2015 (r287307) @@ -31,7 +31,8 @@ /include/ "sun7i-a20.dtsi" / { - model = "BananaPi"; + model = "LeMaker Banana Pi"; + compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; memory { device_type = "memory"; From owner-svn-src-all@freebsd.org Sun Aug 30 16:55:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C9D09C4E1C for ; Sun, 30 Aug 2015 16:55:41 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.smtp.rzone.de (mo6-p00-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5300::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F19E4C5F for ; Sun, 30 Aug 2015 16:55:40 +0000 (UTC) (envelope-from joerg@britannica.bec.de) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssSp3lvLxwWP2 X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-207-14-72.web.vodafone.de [2.207.14.72]) by smtp.strato.de (RZmta 37.11 DYNA|AUTH) with ESMTPSA id N07076r7UGtXCOn (using TLSv1 with cipher AES256-SHA (256 bits)) (Client did not present a certificate) for ; Sun, 30 Aug 2015 18:55:33 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 30 Aug 2015 18:55:32 +0200 Date: Sun, 30 Aug 2015 18:55:32 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd Message-ID: <20150830165532.GB7574@britannica.bec.de> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> <20150830151625.K1159@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150830151625.K1159@besplex.bde.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: Sun, 30 Aug 2015 16:55:41 -0000 On Sun, Aug 30, 2015 at 03:36:27PM +1000, Bruce Evans wrote: > On Fri, 28 Aug 2015, Joerg Sonnenberger wrote: > > >On Fri, Aug 28, 2015 at 10:17:56PM +1000, Bruce Evans wrote: > >>>-static void die(int); > >>>+static void die(int) __dead2; > >> > >>Since the function is static, it is very easy for the compiler to see > >>that it doesn't return. > > > >But the compiler can't tell if it is the *intention* that the function > >never returns. The warning behavior exists because that can easily > >change with macros etc. > > The compiler should trust the programmer to write correct functions. That's a good one. Programmers are notorious for one thing, which is not writing correct code. > >>Even gcc-4.2.1 does this by default, since > >>-O implies -funit-at-a-time for gcc-4.2.1. For clang, there is no way > >>to prevent this (except possibly -O0) since, since -fno-unit-at-a-time > >>is broken in clang. > > > >It is not broken. It is loadly ignored as unsupported. The very > >existance of the option in GCC has always been a concession to broken > >and badly written code, including of course GCC's own CRT. > > Unsupported == incompatible == broken. > > My use of this option can probably be reduced to -fno-toplevel-reorder, > but that is even more broken in clang (it and -ftoplevel-reorder are > "unknown arguments", while -fno-unit-at-a-time is an "unsupported > optimization", and -funit-at-a-time works). Neither -fno-unit-at-a-time nor -funit-at-a-time is an optimisation. Nothing in the standard suggests a specific ordering and well written programs don't make such assumptions. All use cases I have seen so far are miswritten and fragile and would be better served by using a different approach. This is no different from broken code requiring function calls in a sequence point to be executed in a specific order. Joerg From owner-svn-src-all@freebsd.org Sun Aug 30 17:02:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D7CE9C5460 for ; Sun, 30 Aug 2015 17:02:58 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.smtp.rzone.de (mo6-p00-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5300::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCFB21066 for ; Sun, 30 Aug 2015 17:02:57 +0000 (UTC) (envelope-from joerg@britannica.bec.de) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssSp3lvLxwWP2 X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-207-14-72.web.vodafone.de [2.207.14.72]) by smtp.strato.de (RZmta 37.11 DYNA|AUTH) with ESMTPSA id 401741r7UH2s8bW (using TLSv1 with cipher AES256-SHA (256 bits)) (Client did not present a certificate) for ; Sun, 30 Aug 2015 19:02:54 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 30 Aug 2015 19:02:53 +0200 Date: Sun, 30 Aug 2015 19:02:53 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd Message-ID: <20150830170253.GC7574@britannica.bec.de> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> 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-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: Sun, 30 Aug 2015 17:02:58 -0000 On Sun, Aug 30, 2015 at 11:53:00AM +0200, Ed Schouten wrote: > 2015-08-28 16:38 GMT+02:00 Joerg Sonnenberger : > > But the compiler can't tell if it is the *intention* that the function > > never returns. The warning behavior exists because that can easily > > change with macros etc. > > I think it's important to keep in mind what this keyword was designed for. > > The idea behind this attribute (and the C11 _Noreturn keyword) is to > allow for propagation of optimisation state across compilation units. > You use it to annotate functions in header files, so that the compiler > does not need to handle function return at the call site. This > knowledge can be automatically be inferred if the function is static. I disagree that optimisation is the primary design goal. Static analysis and optimisation just have a huge overlap in this area. > I agree with Bruce that this change makes little sense. I would even > go as far as to say that GCC/Clang should just throw warnings if > _Noreturn is used on a function that is static or used on a definition > instead of a declaration. That makes no sense. The presence of the attribute allows the compiler to *ensure* that the function really does not return. Having done this in NetBSD, I can assure you that there are often enough cases where the compiler can not figure it out automatically, especially if the attribution is missing on some function pulled in externally. GCC at least up to 4.8 has not warned about such cases and I have multiple bugs where function *could* fall through. Joerg From owner-svn-src-all@freebsd.org Sun Aug 30 17:24:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38CA99C5F4F; Sun, 30 Aug 2015 17:24:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.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 241F41A46; Sun, 30 Aug 2015 17:24:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UHOOpX051302; Sun, 30 Aug 2015 17:24:24 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UHON4k051299; Sun, 30 Aug 2015 17:24:23 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508301724.t7UHON4k051299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 30 Aug 2015 17:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287308 - 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: Sun, 30 Aug 2015 17:24:24 -0000 Author: jilles Date: Sun Aug 30 17:24:22 2015 New Revision: 287308 URL: https://svnweb.freebsd.org/changeset/base/287308 Log: sh: Fix read with escaped IFS characters at the end. Characters escaped with a backslash must be treated as if they were not in IFS. This includes stripping trailing IFS characters. Added: head/bin/sh/tests/builtins/read9.0 (contents, props changed) Modified: head/bin/sh/miscbltin.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Aug 30 16:10:12 2015 (r287307) +++ head/bin/sh/miscbltin.c Sun Aug 30 17:24:22 2015 (r287308) @@ -100,6 +100,7 @@ readcmd(int argc __unused, char **argv _ int i; int is_ifs; int saveall = 0; + ptrdiff_t lastnonifs, lastnonifsws; struct timeval tv; char *tvptr; fd_set ifds; @@ -169,6 +170,7 @@ readcmd(int argc __unused, char **argv _ startword = 2; backslash = 0; STARTSTACKSTR(p); + lastnonifs = lastnonifsws = -1; for (;;) { nread = read(STDIN_FILENO, &c, 1); if (nread == -1) { @@ -193,6 +195,7 @@ readcmd(int argc __unused, char **argv _ backslash = 0; if (c != '\n') { startword = 0; + lastnonifs = lastnonifsws = p - stackblock(); USTPUTC(c, p); } continue; @@ -218,8 +221,10 @@ readcmd(int argc __unused, char **argv _ if (is_ifs == 2 && startword == 1) { /* Only one non-whitespace IFS per word */ startword = 2; - if (saveall) + if (saveall) { + lastnonifsws = p - stackblock(); USTPUTC(c, p); + } continue; } } @@ -230,6 +235,7 @@ readcmd(int argc __unused, char **argv _ if (saveall) /* Not just a spare terminator */ saveall++; + lastnonifs = lastnonifsws = p - stackblock(); USTPUTC(c, p); continue; } @@ -240,6 +246,8 @@ readcmd(int argc __unused, char **argv _ if (ap[1] == NULL) { /* Last variable needs all IFS chars */ saveall++; + if (is_ifs == 2) + lastnonifsws = p - stackblock(); USTPUTC(c, p); continue; } @@ -248,20 +256,17 @@ readcmd(int argc __unused, char **argv _ setvar(*ap, stackblock(), 0); ap++; STARTSTACKSTR(p); + lastnonifs = lastnonifsws = -1; } STACKSTRNUL(p); - /* Remove trailing IFS chars */ - for (; stackblock() <= --p; *p = 0) { - if (!strchr(ifs, *p)) - break; - if (strchr(" \t\n", *p)) - /* Always remove whitespace */ - continue; - if (saveall > 1) - /* Don't remove non-whitespace unless it was naked */ - break; - } + /* + * Remove trailing IFS chars: always remove whitespace, don't remove + * non-whitespace unless it was naked + */ + if (saveall <= 1) + lastnonifsws = lastnonifs; + stackblock()[lastnonifsws + 1] = '\0'; setvar(*ap, stackblock(), 0); /* Set any remaining args to "" */ Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Aug 30 16:10:12 2015 (r287307) +++ head/bin/sh/tests/builtins/Makefile Sun Aug 30 17:24:22 2015 (r287308) @@ -123,6 +123,7 @@ FILES+= read5.0 FILES+= read6.0 FILES+= read7.0 FILES+= read8.0 +FILES+= read9.0 FILES+= return1.0 FILES+= return2.1 FILES+= return3.1 Added: head/bin/sh/tests/builtins/read9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/read9.0 Sun Aug 30 17:24:22 2015 (r287308) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +empty='' +read a b c < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D7D9C6E23; Sun, 30 Aug 2015 17:58:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D96E0BEF; Sun, 30 Aug 2015 17:58:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UHwCeO065129; Sun, 30 Aug 2015 17:58:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UHwCIK065126; Sun, 30 Aug 2015 17:58:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508301758.t7UHwCIK065126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Aug 2015 17:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287309 - 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: Sun, 30 Aug 2015 17:58:13 -0000 Author: kib Date: Sun Aug 30 17:58:11 2015 New Revision: 287309 URL: https://svnweb.freebsd.org/changeset/base/287309 Log: Remove single-use macros obfuscating malloc(9) and free(9) calls. Style. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/ksched.c head/sys/sys/posix4.h Modified: head/sys/kern/ksched.c ============================================================================== --- head/sys/kern/ksched.c Sun Aug 30 17:24:22 2015 (r287308) +++ head/sys/kern/ksched.c Sun Aug 30 17:58:11 2015 (r287309) @@ -30,8 +30,7 @@ * SUCH DAMAGE. */ -/* ksched: Soft real time scheduling based on "rtprio". - */ +/* ksched: Soft real time scheduling based on "rtprio". */ #include __FBSDID("$FreeBSD$"); @@ -51,8 +50,7 @@ __FBSDID("$FreeBSD$"); FEATURE(kposix_priority_scheduling, "POSIX P1003.1B realtime extensions"); -/* ksched: Real-time extension to support POSIX priority scheduling. - */ +/* ksched: Real-time extension to support POSIX priority scheduling. */ struct ksched { struct timespec rr_interval; @@ -61,21 +59,21 @@ struct ksched { int ksched_attach(struct ksched **p) { - struct ksched *ksched= p31b_malloc(sizeof(*ksched)); + struct ksched *ksched; + ksched = malloc(sizeof(*ksched), M_P31B, M_WAITOK); ksched->rr_interval.tv_sec = 0; ksched->rr_interval.tv_nsec = 1000000000L / hz * sched_rr_interval(); - *p = ksched; - return 0; + return (0); } int ksched_detach(struct ksched *ks) { - p31b_free(ks); - return 0; + free(ks, M_P31B); + return (0); } /* @@ -108,47 +106,39 @@ static __inline int getscheduler(struct ksched *ksched, struct thread *td, int *policy) { struct rtprio rtp; - int e = 0; + int e; + e = 0; pri_to_rtp(td, &rtp); - switch (rtp.type) - { - case RTP_PRIO_FIFO: + switch (rtp.type) { + case RTP_PRIO_FIFO: *policy = SCHED_FIFO; break; - - case RTP_PRIO_REALTIME: + case RTP_PRIO_REALTIME: *policy = SCHED_RR; break; - - default: + default: *policy = SCHED_OTHER; break; } - - return e; + return (e); } int ksched_setparam(struct ksched *ksched, struct thread *td, const struct sched_param *param) { - int policy; - int e; + int e, policy; e = getscheduler(ksched, td, &policy); - if (e == 0) - { - e = ksched_setscheduler(ksched, td, policy, param); - } - - return e; + e = ksched_setscheduler(ksched, td, policy, param); + return (e); } int -ksched_getparam(struct ksched *ksched, - struct thread *td, struct sched_param *param) +ksched_getparam(struct ksched *ksched, struct thread *td, + struct sched_param *param) { struct rtprio rtp; @@ -159,13 +149,14 @@ ksched_getparam(struct ksched *ksched, if (PRI_MIN_TIMESHARE < rtp.prio) /* * The interactive score has it to min realtime - * so we must show max (64 most likely + * so we must show max (64 most likely). */ - param->sched_priority = (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE); + param->sched_priority = PRI_MAX_TIMESHARE - + PRI_MIN_TIMESHARE; else param->sched_priority = tsprio_to_p4prio(rtp.prio); } - return 0; + return (0); } /* @@ -176,117 +167,106 @@ ksched_getparam(struct ksched *ksched, * */ int -ksched_setscheduler(struct ksched *ksched, - struct thread *td, int policy, const struct sched_param *param) +ksched_setscheduler(struct ksched *ksched, struct thread *td, int policy, + const struct sched_param *param) { - int e = 0; struct rtprio rtp; + int e; - switch(policy) - { - case SCHED_RR: - case SCHED_FIFO: - + e = 0; + switch(policy) { + case SCHED_RR: + case SCHED_FIFO: if (param->sched_priority >= P1B_PRIO_MIN && - param->sched_priority <= P1B_PRIO_MAX) - { + param->sched_priority <= P1B_PRIO_MAX) { rtp.prio = p4prio_to_rtpprio(param->sched_priority); - rtp.type = (policy == SCHED_FIFO) - ? RTP_PRIO_FIFO : RTP_PRIO_REALTIME; - + rtp.type = (policy == SCHED_FIFO) ? RTP_PRIO_FIFO : + RTP_PRIO_REALTIME; rtp_to_pri(&rtp, td); - } - else + } else { e = EPERM; - - + } break; - - case SCHED_OTHER: - if (param->sched_priority >= 0 && - param->sched_priority <= (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) { + case SCHED_OTHER: + if (param->sched_priority >= 0 && param->sched_priority <= + (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) { rtp.type = RTP_PRIO_NORMAL; rtp.prio = p4prio_to_tsprio(param->sched_priority); rtp_to_pri(&rtp, td); - } else + } else { e = EINVAL; - + } + break; + default: + e = EINVAL; break; - - default: - e = EINVAL; - break; } - - return e; + return (e); } int ksched_getscheduler(struct ksched *ksched, struct thread *td, int *policy) { - return getscheduler(ksched, td, policy); + + return (getscheduler(ksched, td, policy)); } -/* ksched_yield: Yield the CPU. - */ +/* ksched_yield: Yield the CPU. */ int ksched_yield(struct ksched *ksched) { + sched_relinquish(curthread); - return 0; + return (0); } int ksched_get_priority_max(struct ksched *ksched, int policy, int *prio) { - int e = 0; + int e; - switch (policy) - { - case SCHED_FIFO: - case SCHED_RR: + e = 0; + switch (policy) { + case SCHED_FIFO: + case SCHED_RR: *prio = RTP_PRIO_MAX; break; - - case SCHED_OTHER: + case SCHED_OTHER: *prio = PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE; break; - - default: + default: e = EINVAL; + break; } - - return e; + return (e); } int ksched_get_priority_min(struct ksched *ksched, int policy, int *prio) { - int e = 0; + int e; - switch (policy) - { - case SCHED_FIFO: - case SCHED_RR: + e = 0; + switch (policy) { + case SCHED_FIFO: + case SCHED_RR: *prio = P1B_PRIO_MIN; break; - - case SCHED_OTHER: + case SCHED_OTHER: *prio = 0; break; - - default: + default: e = EINVAL; + break; } - - return e; + return (e); } int -ksched_rr_get_interval(struct ksched *ksched, - struct thread *td, struct timespec *timespec) +ksched_rr_get_interval(struct ksched *ksched, struct thread *td, + struct timespec *timespec) { - *timespec = ksched->rr_interval; - return 0; + *timespec = ksched->rr_interval; + return (0); } Modified: head/sys/sys/posix4.h ============================================================================== --- head/sys/sys/posix4.h Sun Aug 30 17:24:22 2015 (r287308) +++ head/sys/sys/posix4.h Sun Aug 30 17:58:11 2015 (r287309) @@ -56,9 +56,6 @@ int sys_ ## SC (struct thread *td, struc MALLOC_DECLARE(M_P31B); -#define p31b_malloc(SIZE) malloc((SIZE), M_P31B, M_WAITOK) -#define p31b_free(P) free((P), M_P31B) - int p31b_proc(struct proc *, pid_t, struct proc **); void p31b_setcfg(int, int); From owner-svn-src-all@freebsd.org Sun Aug 30 18:02:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FCE49C60E4; Sun, 30 Aug 2015 18:02:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6DDCD1189; Sun, 30 Aug 2015 18:02:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UI2wr0069312; Sun, 30 Aug 2015 18:02:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UI2w1i069311; Sun, 30 Aug 2015 18:02:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508301802.t7UI2w1i069311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Aug 2015 18:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287310 - 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: Sun, 30 Aug 2015 18:02:58 -0000 Author: kib Date: Sun Aug 30 18:02:57 2015 New Revision: 287310 URL: https://svnweb.freebsd.org/changeset/base/287310 Log: Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO scheduler types. It was intended to be used there, compare with the min value, and with the test for correctness in ksched_setscheduler(). Note that P1B_PRIO_MAX and RTP_PRIO_MAX do have the same numerical values, the change is cosmetical. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/ksched.c Modified: head/sys/kern/ksched.c ============================================================================== --- head/sys/kern/ksched.c Sun Aug 30 17:58:11 2015 (r287309) +++ head/sys/kern/ksched.c Sun Aug 30 18:02:57 2015 (r287310) @@ -229,7 +229,7 @@ ksched_get_priority_max(struct ksched *k switch (policy) { case SCHED_FIFO: case SCHED_RR: - *prio = RTP_PRIO_MAX; + *prio = P1B_PRIO_MAX; break; case SCHED_OTHER: *prio = PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE; From owner-svn-src-all@freebsd.org Sun Aug 30 18:27:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE359C6B92; Sun, 30 Aug 2015 18:27:19 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0D711E22; Sun, 30 Aug 2015 18:27:19 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from akita.local (c-73-162-13-215.hsd1.ca.comcast.net [73.162.13.215]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0NTW008QAR9BQV20@mr11p00im-asmtp001.me.com>; Sun, 30 Aug 2015 18:27:13 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-08-30_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1412110000 definitions=main-1508300338 Message-id: <1440959231.1192.5.camel@me.com> Subject: Re: svn commit: r287299 - head/sys/boot/efi/loader/arch/amd64 From: Rui Paulo To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 30 Aug 2015 11:27:11 -0700 In-reply-to: <201508300140.t7U1e0ej039049@repo.freebsd.org> References: <201508300140.t7U1e0ej039049@repo.freebsd.org> Content-type: text/plain; charset=UTF-8 X-Mailer: Evolution 3.16.4 FreeBSD GNOME Team Port MIME-version: 1.0 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: Sun, 30 Aug 2015 18:27:19 -0000 On Sun, 2015-08-30 at 01:40 +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Sun Aug 30 01:39:59 2015 > New Revision: 287299 > URL: https://svnweb.freebsd.org/changeset/base/287299 > > Log: > Add a gop command to help diagnose VT efifb problems. The gop > command has the following sub-commands: > list - list all possible modes (paged) > get - return the current mode > set - set the current mode to > This is duplicating the functionality of the `mode' command. Please remove the mode command. Also, 'gop' is pretty weird for a command name. Maybe we can change that to something more user friendly? -- Rui Paulo From owner-svn-src-all@freebsd.org Sun Aug 30 20:59:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 413809C0AD6; Sun, 30 Aug 2015 20:59:20 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.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 309B190D; Sun, 30 Aug 2015 20:59:20 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UKxKva045932; Sun, 30 Aug 2015 20:59:20 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UKxKmp045931; Sun, 30 Aug 2015 20:59:20 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201508302059.t7UKxKmp045931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sun, 30 Aug 2015 20:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287311 - head/share/doc/papers 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: Sun, 30 Aug 2015 20:59:20 -0000 Author: gnn Date: Sun Aug 30 20:59:19 2015 New Revision: 287311 URL: https://svnweb.freebsd.org/changeset/base/287311 Log: A bibliography of FreeBSD and BSD related papers and books. Keep this file in order by primary key which is the first author's last name and the year of publication. Added: head/share/doc/papers/bsdreferences.bib (contents, props changed) Added: head/share/doc/papers/bsdreferences.bib ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/papers/bsdreferences.bib Sun Aug 30 20:59:19 2015 (r287311) @@ -0,0 +1,363 @@ +@Comment{A Bilbiography of papers that either use or extend FreeBSD.} +@Comment{NOTE: Entries are alphabetical by primary key (author)} +@article{Anderson2014a, +author = {Anderson, J and Watson, Rnm and Chisnall, D and Gudka, K. and Marinos, I and Davis, B}, +file = {:Users/gnn/Documents/Mendeley Desktop/Anderson et al/Proceedings of the European Conference on Computer Systems/Anderson et al. - 2014 - TESLA temporally enhanced system logic assertions.pdf:pdf}, +isbn = {9781450327046}, +journal = {Proceedings of the European Conference on Computer Systems}, +mendeley-groups = {CADETS}, +title = {{TESLA: temporally enhanced system logic assertions}}, +url = {http://dl.acm.org/citation.cfm?id=2592801}, +year = {2014} +} + +@article{Armitage:2003:MSE:956993.957010, + author = {Armitage, Grenville}, + title = {Maximising Student Exposure to Networking Using FreeBSD Virtual Hosts}, + journal = {SIGCOMM Comput. Commun. Rev.}, + issue_date = {July 2003}, + volume = {33}, + number = {3}, + month = jul, + year = {2003}, + issn = {0146-4833}, + pages = {137--143}, + numpages = {7}, + url = {http://doi.acm.org/10.1145/956993.957010}, + doi = {10.1145/956993.957010}, + acmid = {957010}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {FreeBSD, IP, Unix, networking, students, teaching, virtual hosts}, +} + +@article{Armitage:2008:IHI:1384609.1384613, + author = {Armitage, Grenville and Stewart, Lawrence and Welzl, Michael and Healy, James}, + title = {An Independent H-TCP Implementation Under FreeBSD 7.0: Description and Observed Behaviour}, + journal = {SIGCOMM Comput. Commun. Rev.}, + issue_date = {July 2008}, + volume = {38}, + number = {3}, + month = jul, + year = {2008}, + issn = {0146-4833}, + pages = {27--38}, + numpages = {12}, + url = {http://doi.acm.org/10.1145/1384609.1384613}, + doi = {10.1145/1384609.1384613}, + acmid = {1384613}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {FreeBSD, H-TCP, TCP, congestion control}, +} + +@inproceedings{Bless:2004:IFT:1161734.1162020, + author = {Bless, Roland and Doll, Mark}, + title = {Integration of the FreeBSD TCP/IP-stack into the Discrete Event Simulator OMNet++}, + booktitle = {Proceedings of the 36th Conference on Winter Simulation}, + series = {WSC '04}, + year = {2004}, + isbn = {0-7803-8786-4}, + location = {Washington, D.C.}, + pages = {1556--1561}, + numpages = {6}, + url = {http://dl.acm.org/citation.cfm?id=1161734.1162020}, + acmid = {1162020}, + publisher = {Winter Simulation Conference}, +} + +@inproceedings{Canfora:2011:SIA:1985441.1985463, + author = {Canfora, Gerardo and Cerulo, Luigi and Cimitile, Marta and Di Penta, Massimiliano}, + title = {Social Interactions Around Cross-system Bug Fixings: The Case of FreeBSD and OpenBSD}, + booktitle = {Proceedings of the 8th Working Conference on Mining Software Repositories}, + series = {MSR '11}, + year = {2011}, + isbn = {978-1-4503-0574-7}, + location = {Waikiki, Honolulu, HI, USA}, + pages = {143--152}, + numpages = {10}, + url = {http://doi.acm.org/10.1145/1985441.1985463}, + doi = {10.1145/1985441.1985463}, + acmid = {1985463}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {bug fixing, code migration, empirical study, social network analysis}, +} + + +@inproceedings{Chang:2008:ESC:1370750.1370766, + author = {Chang, Hung-Fu and Mockus, Audris}, + title = {Evaluation of Source Code Copy Detection Methods on Freebsd}, + booktitle = {Proceedings of the 2008 International Working Conference on Mining Software Repositories}, + series = {MSR '08}, + year = {2008}, + isbn = {978-1-60558-024-1}, + location = {Leipzig, Germany}, + pages = {61--66}, + numpages = {6}, + url = {http://doi.acm.org/10.1145/1370750.1370766}, + doi = {10.1145/1370750.1370766}, + acmid = {1370766}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {clone detection, cloning, code copying, open source, version control}, +} + +@article{Chisnall:2015:BPA:2786763.2694367, + author = {Chisnall, David and Rothwell, Colin and Watson, Robert N.M. and Woodruff, Jonathan and Vadera, Munraj and Moore, Simon W. and Roe, Michael and Davis, Brooks and Neumann, Peter G.}, + title = {Beyond the PDP-11: Architectural Support for a Memory-Safe C Abstract Machine}, + journal = {SIGARCH Comput. Archit. News}, + issue_date = {March 2015}, + volume = {43}, + number = {1}, + month = mar, + year = {2015}, + issn = {0163-5964}, + pages = {117--130}, + numpages = {14}, + url = {http://doi.acm.org/10.1145/2786763.2694367}, + doi = {10.1145/2786763.2694367}, + acmid = {2694367}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {C language, bounds checking, capabilities, compilers, memory protection, memory safety, processor design, security}, +} + +@article{Chisnall:2015:BPA:2775054.2694367, + author = {Chisnall, David and Rothwell, Colin and Watson, Robert N.M. and Woodruff, Jonathan and Vadera, Munraj and Moore, Simon W. and Roe, Michael and Davis, Brooks and Neumann, Peter G.}, + title = {Beyond the PDP-11: Architectural Support for a Memory-Safe C Abstract Machine}, + journal = {SIGPLAN Not.}, + issue_date = {April 2015}, + volume = {50}, + number = {4}, + month = mar, + year = {2015}, + issn = {0362-1340}, + pages = {117--130}, + numpages = {14}, + url = {http://doi.acm.org/10.1145/2775054.2694367}, + doi = {10.1145/2775054.2694367}, + acmid = {2694367}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {C language, bounds checking, capabilities, compilers, memory protection, memory safety, processor design, security}, +} + +@inproceedings{Chisnall:2015:BPA:2694344.2694367, + author = {Chisnall, David and Rothwell, Colin and Watson, Robert N.M. and Woodruff, Jonathan and Vadera, Munraj and Moore, Simon W. and Roe, Michael and Davis, Brooks and Neumann, Peter G.}, + title = {Beyond the PDP-11: Architectural Support for a Memory-Safe C Abstract Machine}, + booktitle = {Proceedings of the Twentieth International Conference on Architectural Support for Programming Languages and Operating Systems}, + series = {ASPLOS '15}, + year = {2015}, + isbn = {978-1-4503-2835-7}, + location = {Istanbul, Turkey}, + pages = {117--130}, + numpages = {14}, + url = {http://doi.acm.org/10.1145/2694344.2694367}, + doi = {10.1145/2694344.2694367}, + acmid = {2694367}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {C language, bounds checking, capabilities, compilers, memory protection, memory safety, processor design, security}, +} + +@article{Frenger:2000:FFB:360271.360272, + author = {Frenger, Paul}, + title = {Forth and the FreeBSD Bootloader}, + journal = {SIGPLAN Not.}, + issue_date = {Aug., 2000}, + volume = {35}, + number = {8}, + month = aug, + year = {2000}, + issn = {0362-1340}, + pages = {15--17}, + numpages = {3}, + url = {http://doi.acm.org/10.1145/360271.360272}, + doi = {10.1145/360271.360272}, + acmid = {360272}, + publisher = {ACM}, + address = {New York, NY, USA}, +} + +@inproceedings{Hsu:2003:RSF:1250972.1250973, + author = {Hsu, Jeffrey}, + title = {Reasoning About SMP in FreeBSD}, + booktitle = {Proceedings of the BSD Conference 2003 on BSD Conference}, + series = {BSDC'03}, + year = {2003}, + location = {San Mateo, California}, + pages = {1--1}, + numpages = {1}, + url = {http://dl.acm.org/citation.cfm?id=1250972.1250973}, + acmid = {1250973}, + publisher = {USENIX Association}, + address = {Berkeley, CA, USA}, +} + +@inproceedings{Izurieta:2006:EFL:1159733.1159765, + author = {Izurieta, Clemente and Bieman, James}, + title = {The Evolution of FreeBSD and Linux}, + booktitle = {Proceedings of the 2006 ACM/IEEE International Symposium on Empirical Software Engineering}, + series = {ISESE '06}, + year = {2006}, + isbn = {1-59593-218-6}, + location = {Rio de Janeiro, Brazil}, + pages = {204--211}, + numpages = {8}, + url = {http://doi.acm.org/10.1145/1159733.1159765}, + doi = {10.1145/1159733.1159765}, + acmid = {1159765}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {FreeBSD, evolution, linux, open source software, replication study, software engineering}, +} + +@inproceedings{Li:2009:OBR:1592631.1592641, + author = {Li, Qing and Macy, Kip}, + title = {Optimizing the BSD Routing System for Parallel Processing}, + booktitle = {Proceedings of the 2Nd ACM SIGCOMM Workshop on Programmable Routers for Extensible Services of Tomorrow}, + series = {PRESTO '09}, + year = {2009}, + isbn = {978-1-60558-446-1}, + location = {Barcelona, Spain}, + pages = {37--42}, + numpages = {6}, + url = {http://doi.acm.org/10.1145/1592631.1592641}, + doi = {10.1145/1592631.1592641}, + acmid = {1592641}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {arp, flow table, freebsd, ip, ipv6, mp, neighbor cache, routing, server load balancing (slb), smp, synchronization}, +} + +@book{McKusick:1996:DIO:231070, + author = {McKusick, Marshall Kirk and Bostic, Keith and Karels, Michael J. and Quarterman, John S.}, + title = {The Design and Implementation of the 4.4BSD Operating System}, + year = {1996}, + isbn = {0-201-54979-4}, + publisher = {Addison Wesley Longman Publishing Co., Inc.}, + address = {Redwood City, CA, USA}, +} + +@book{McKusick:2004:DIF:1014910, + author = {McKusick, Marshall Kirk and Neville-Neil, George V.}, + title = {The Design and Implementation of the FreeBSD Operating System}, + year = {2004}, + isbn = {0201702452}, + publisher = {Pearson Education}, +} + +@book{McKusick:2014:DIF:2659919, + author = {McKusick, Marshall Kirk and Neville-Neil, George and Watson, Robert N.M.}, + title = {The Design and Implementation of the FreeBSD Operating System}, + year = {2014}, + isbn = {0321968972, 9780321968975}, + edition = {2nd}, + publisher = {Addison-Wesley Professional}, +} + +@article{McKusick:2004:TSF:1035594.1035622, + author = {McKusick, Marshall Kirk and Neville-Neil, George V.}, + title = {Thread Scheduling in FreeBSD 5.2}, + journal = {Queue}, + issue_date = {October 2004}, + volume = {2}, + number = {7}, + month = oct, + year = {2004}, + issn = {1542-7730}, + pages = {58--64}, + numpages = {7}, + url = {http://doi.acm.org/10.1145/1035594.1035622}, + doi = {10.1145/1035594.1035622}, + acmid = {1035622}, + publisher = {ACM}, + address = {New York, NY, USA}, +} + +@inproceedings{Murray:2002:IYP:1250894.1250900, + author = {Murray, Mark R. V.}, + title = {An Implementation of the Yarrow PRNG for FreeBSD}, + booktitle = {Proceedings of the BSD Conference 2002 on BSD Conference}, + series = {BSDC'02}, + year = {2002}, + location = {San Francisco, California}, + pages = {6--6}, + numpages = {1}, + url = {http://dl.acm.org/citation.cfm?id=1250894.1250900}, + acmid = {1250900}, + publisher = {USENIX Association}, + address = {Berkeley, CA, USA}, +} + +@inproceedings{Spinellis:2006:GSD:1138506.1138524, + author = {Spinellis, Diomidis}, + title = {Global Software Development in the freeBSD Project}, + booktitle = {Proceedings of the 2006 International Workshop on Global Software Development for the Practitioner}, + series = {GSD '06}, + year = {2006}, + isbn = {1-59593-404-9}, + location = {Shanghai, China}, + pages = {73--79}, + numpages = {7}, + url = {http://doi.acm.org/10.1145/1138506.1138524}, + doi = {10.1145/1138506.1138524}, + acmid = {1138524}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {global development, open source, quantitative analysis}, +} + +@inproceedings{Spinellis:2008:TFK:1368088.1368140, + author = {Spinellis, Diomidis}, + title = {A Tale of Four Kernels}, + booktitle = {Proceedings of the 30th International Conference on Software Engineering}, + series = {ICSE '08}, + year = {2008}, + isbn = {978-1-60558-079-1}, + location = {Leipzig, Germany}, + pages = {381--390}, + numpages = {10}, + url = {http://doi.acm.org/10.1145/1368088.1368140}, + doi = {10.1145/1368088.1368140}, + acmid = {1368140}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {comparison, freebsd, linux, open source, opensolaris, proprietary software, wrk}, +} + +@inproceedings{Woodruff:2014:CCM:2665671.2665740, + author = {Woodruff, Jonathan and Watson, Robert N.M. and Chisnall, David and Moore, Simon W. and Anderson, Jonathan and Davis, Brooks and Laurie, Ben and Neumann, Peter G. and Norton, Robert and Roe, Michael}, + title = {The CHERI Capability Model: Revisiting RISC in an Age of Risk}, + booktitle = {Proceeding of the 41st Annual International Symposium on Computer Architecuture}, + series = {ISCA '14}, + year = {2014}, + isbn = {978-1-4799-4394-4}, + location = {Minneapolis, Minnesota, USA}, + pages = {457--468}, + numpages = {12}, + url = {http://dl.acm.org/citation.cfm?id=2665671.2665740}, + acmid = {2665740}, + publisher = {IEEE Press}, + address = {Piscataway, NJ, USA}, +} + +@article{Woodruff:2014:CCM:2678373.2665740, + author = {Woodruff, Jonathan and Watson, Robert N.M. and Chisnall, David and Moore, Simon W. and Anderson, Jonathan and Davis, Brooks and Laurie, Ben and Neumann, Peter G. and Norton, Robert and Roe, Michael}, + title = {The CHERI Capability Model: Revisiting RISC in an Age of Risk}, + journal = {SIGARCH Comput. Archit. News}, + issue_date = {June 2014}, + volume = {42}, + number = {3}, + month = jun, + year = {2014}, + issn = {0163-5964}, + pages = {457--468}, + numpages = {12}, + url = {http://doi.acm.org/10.1145/2678373.2665740}, + doi = {10.1145/2678373.2665740}, + acmid = {2665740}, + publisher = {ACM}, + address = {New York, NY, USA}, +} From owner-svn-src-all@freebsd.org Sun Aug 30 21:05:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F599C1D9B; Sun, 30 Aug 2015 21:05:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c: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 67D2F1E1; Sun, 30 Aug 2015 21:05:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wicpl12 with SMTP id pl12so14534318wic.0; Sun, 30 Aug 2015 14:05:44 -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=fLxoLBGENDHErjdNV+RWHpnA4bR5sZFyCwp9JxyC8ik=; b=zhJNsEl5b2HIaD8nTrApjg9pGA8NXGVkfwwyWXxRYMmT2qiU54aEXadSYLB7jCw6H8 S8wxLTfF08giAeZavA5N6CcgiY/kCN2oJ0k103HHxWYv1uG38MfV0ZDBHdrxoZkLM2Cj iTynZhtqFw30JpeC4pu0ruJMsW0lTqKpZPkhQXFL6UIWHDPY0e7YMbTPFi2qL4/8xlyE uFcU2ZWaBoOMzC1G326yIJNHvUX2AIrOTP1G7Vpt/s2NzQGd+rPcugNR/Ot0FIvV6I5j nSTnyq95cdr6IU/RDMZ+1//tYRu1rsqmKbvzOogYiqEdJrM2tM/PbYdWpNXfEIhMr4vG u2ug== X-Received: by 10.180.91.131 with SMTP id ce3mr16496437wib.84.1440968744589; Sun, 30 Aug 2015 14:05:44 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id im10sm18951469wjb.40.2015.08.30.14.05.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 14:05:43 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 30 Aug 2015 23:05:41 +0200 From: Baptiste Daroussin To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287311 - head/share/doc/papers Message-ID: <20150830210541.GA30483@ivaldir.etoilebsd.net> References: <201508302059.t7UKxKmp045931@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <201508302059.t7UKxKmp045931@repo.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: Sun, 30 Aug 2015 21:05:46 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 30, 2015 at 08:59:20PM +0000, George V. Neville-Neil wrote: > Author: gnn > Date: Sun Aug 30 20:59:19 2015 > New Revision: 287311 > URL: https://svnweb.freebsd.org/changeset/base/287311 >=20 > Log: > A bibliography of FreeBSD and BSD related papers and books. > Keep this file in order by primary key which is the first author's > last name and the year of publication. >=20 Wouldn't it be more useful to have this on the website? That would be of interest of lot of people interested in freebsd including people that haven= 't an installed freebsd, imho the website would be more accurate than sources. Best regards, Bapt --0F1p//8PRICkK4MW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXjcCUACgkQ8kTtMUmk6EyLcQCgjXAY6XpGosTzs6BsyRcieURs zSUAn0T6wB+LkGcUfAs8QGk8Vfobulku =Eght -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- From owner-svn-src-all@freebsd.org Sun Aug 30 21:54:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4DD39C6958; Sun, 30 Aug 2015 21:54:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.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 897C71C1A; Sun, 30 Aug 2015 21:54:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ULsYSm070456; Sun, 30 Aug 2015 21:54:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ULsXaT070453; Sun, 30 Aug 2015 21:54:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508302154.t7ULsXaT070453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 30 Aug 2015 21:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287312 - head/sys/dev/iwn 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: Sun, 30 Aug 2015 21:54:34 -0000 Author: adrian Date: Sun Aug 30 21:54:33 2015 New Revision: 287312 URL: https://svnweb.freebsd.org/changeset/base/287312 Log: Migrate the stats API for iwn(4) into a cdev ioctl, rather than tying into the vap. This allows for possible hardware interaction without needing a vap configured. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwn_ioctl.h head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Aug 30 20:59:19 2015 (r287311) +++ head/sys/dev/iwn/if_iwn.c Sun Aug 30 21:54:33 2015 (r287312) @@ -39,11 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include #include #include @@ -378,6 +380,19 @@ MODULE_DEPEND(iwn, firmware, 1, 1, 1); MODULE_DEPEND(iwn, pci, 1, 1, 1); MODULE_DEPEND(iwn, wlan, 1, 1, 1); +static d_ioctl_t iwn_cdev_ioctl; +static d_open_t iwn_cdev_open; +static d_close_t iwn_cdev_close; + +static struct cdevsw iwn_cdevsw = { + .d_version = D_VERSION, + .d_flags = 0, + .d_open = iwn_cdev_open, + .d_close = iwn_cdev_close, + .d_ioctl = iwn_cdev_ioctl, + .d_name = "iwn", +}; + static int iwn_probe(device_t dev) { @@ -704,6 +719,15 @@ iwn_attach(device_t dev) if (bootverbose) ieee80211_announce(ic); DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + + /* Add debug ioctl right at the end */ + sc->sc_cdev = make_dev(&iwn_cdevsw, device_get_unit(dev), + UID_ROOT, GID_WHEEL, 0600, "%s", device_get_nameunit(dev)); + if (sc->sc_cdev == NULL) { + device_printf(dev, "failed to create debug character device\n"); + } else { + sc->sc_cdev->si_drv1 = sc; + } return 0; fail: iwn_detach(dev); @@ -1416,6 +1440,11 @@ iwn_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem), sc->mem); + if (sc->sc_cdev) { + destroy_dev(sc->sc_cdev); + sc->sc_cdev = NULL; + } + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n", __func__); IWN_LOCK_DESTROY(sc); return 0; @@ -4999,18 +5028,37 @@ iwn_watchdog(void *arg) } static int -iwn_ioctl(struct ieee80211com *ic, u_long cmd, void *data) +iwn_cdev_open(struct cdev *dev, int flags, int type, struct thread *td) { - struct ifreq *ifr = data; - struct iwn_softc *sc = ic->ic_softc; - int error = 0; - + + return (0); +} + +static int +iwn_cdev_close(struct cdev *dev, int flags, int type, struct thread *td) +{ + + return (0); +} + +static int +iwn_cdev_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, + struct thread *td) +{ + int rc; + struct iwn_softc *sc = dev->si_drv1; + struct iwn_ioctl_data *d; + + rc = priv_check(td, PRIV_DRIVER); + if (rc != 0) + return (0); + switch (cmd) { case SIOCGIWNSTATS: + d = (struct iwn_ioctl_data *) data; IWN_LOCK(sc); /* XXX validate permissions/memory/etc? */ - error = copyout(&sc->last_stat, ifr->ifr_data, - sizeof(struct iwn_stats)); + rc = copyout(&sc->last_stat, d->dst_addr, sizeof(struct iwn_stats)); IWN_UNLOCK(sc); break; case SIOCZIWNSTATS: @@ -5019,10 +5067,17 @@ iwn_ioctl(struct ieee80211com *ic, u_lon IWN_UNLOCK(sc); break; default: - error = ENOTTY; + rc = EINVAL; break; } - return (error); + return (rc); +} + +static int +iwn_ioctl(struct ieee80211com *ic, u_long cmd, void *data) +{ + + return (ENOTTY); } static void @@ -8979,3 +9034,5 @@ iwn_debug_register(struct iwn_softc *sc) DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n"); } #endif + + Modified: head/sys/dev/iwn/if_iwn_ioctl.h ============================================================================== --- head/sys/dev/iwn/if_iwn_ioctl.h Sun Aug 30 20:59:19 2015 (r287311) +++ head/sys/dev/iwn/if_iwn_ioctl.h Sun Aug 30 21:54:33 2015 (r287312) @@ -18,8 +18,13 @@ #ifndef __IF_IWN_IOCTL_H__ #define __IF_IWN_IOCTL_H__ +struct iwn_ioctl_data { + void *dst_addr; + int dst_len; +}; + /* XXX how should I pick appropriate ioctl numbers? */ -#define SIOCGIWNSTATS _IOWR('i', 145, struct ifreq) -#define SIOCZIWNSTATS _IOWR('i', 146, struct ifreq) +#define SIOCGIWNSTATS _IOWR('f', 145, struct iwn_ioctl_data) +#define SIOCZIWNSTATS _IOWR('f', 146, struct iwn_ioctl_data) #endif /* __IF_IWN_IOCTL_H__ */ Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun Aug 30 20:59:19 2015 (r287311) +++ head/sys/dev/iwn/if_iwnvar.h Sun Aug 30 21:54:33 2015 (r287312) @@ -235,6 +235,7 @@ struct iwn_vap { struct iwn_softc { device_t sc_dev; int sc_debug; + struct cdev *sc_cdev; struct mtx sc_mtx; struct ieee80211com sc_ic; struct mbufq sc_snd; From owner-svn-src-all@freebsd.org Sun Aug 30 21:54:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05A249C69B8; Sun, 30 Aug 2015 21:54:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.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 EA7561D61; Sun, 30 Aug 2015 21:54:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ULsnHw070518; Sun, 30 Aug 2015 21:54:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ULsmY9070510; Sun, 30 Aug 2015 21:54:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508302154.t7ULsmY9070510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 30 Aug 2015 21:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287313 - head/tools/tools/iwn/iwnstats 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: Sun, 30 Aug 2015 21:54:50 -0000 Author: adrian Date: Sun Aug 30 21:54:47 2015 New Revision: 287313 URL: https://svnweb.freebsd.org/changeset/base/287313 Log: Convert this over to use the new cdev based ioctl path. Modified: head/tools/tools/iwn/iwnstats/Makefile head/tools/tools/iwn/iwnstats/iwn_ioctl.c head/tools/tools/iwn/iwnstats/iwn_ioctl.h head/tools/tools/iwn/iwnstats/iwnstats.h head/tools/tools/iwn/iwnstats/main.c Modified: head/tools/tools/iwn/iwnstats/Makefile ============================================================================== --- head/tools/tools/iwn/iwnstats/Makefile Sun Aug 30 21:54:33 2015 (r287312) +++ head/tools/tools/iwn/iwnstats/Makefile Sun Aug 30 21:54:47 2015 (r287313) @@ -9,6 +9,8 @@ MAN= CFLAGS+=-I${.CURDIR}/../../../../sys/dev/iwn/ CFLAGS+=-I${.CURDIR}/../../../../sys/ +CFLAGS+= -g -ggdb -O0 + PROG= iwnstats # Because of a clang preprocessor parser limitation causing this Modified: head/tools/tools/iwn/iwnstats/iwn_ioctl.c ============================================================================== --- head/tools/tools/iwn/iwnstats/iwn_ioctl.c Sun Aug 30 21:54:33 2015 (r287312) +++ head/tools/tools/iwn/iwnstats/iwn_ioctl.c Sun Aug 30 21:54:47 2015 (r287313) @@ -63,28 +63,24 @@ #include "iwn_ioctl.h" void -iwn_setifname(struct iwnstats *is, const char *ifname) -{ - - strncpy(is->ifr.ifr_name, ifname, sizeof (is->ifr.ifr_name)); -} - -void iwn_zerostats(struct iwnstats *is) { - if (ioctl(is->s, SIOCZIWNSTATS, &is->ifr) < 0) - err(-1, "ioctl: %s", is->ifr.ifr_name); + if (ioctl(is->s, SIOCZIWNSTATS, NULL) < 0) + err(-1, "ioctl"); } int iwn_collect(struct iwnstats *is) { int err; + struct iwn_ioctl_data d; - is->ifr.ifr_data = (caddr_t) &is->st; - err = ioctl(is->s, SIOCGIWNSTATS, &is->ifr); + printf("st: %p\n", &is->st); + d.dst_addr = &is->st; + d.dst_len = sizeof(is->st); + err = ioctl(is->s, SIOCGIWNSTATS, (caddr_t) &d); if (err < 0) - warn("ioctl: %s", is->ifr.ifr_name); + warn("ioctl"); return (err); } Modified: head/tools/tools/iwn/iwnstats/iwn_ioctl.h ============================================================================== --- head/tools/tools/iwn/iwnstats/iwn_ioctl.h Sun Aug 30 21:54:33 2015 (r287312) +++ head/tools/tools/iwn/iwnstats/iwn_ioctl.h Sun Aug 30 21:54:47 2015 (r287313) @@ -31,7 +31,6 @@ #ifndef __IWN_IOCTL_H__ #define __IWN_IOCTL_H__ -extern void iwn_setifname(struct iwnstats *is, const char *ifname); extern void iwn_zerostats(struct iwnstats *is); extern int iwn_collect(struct iwnstats *is); Modified: head/tools/tools/iwn/iwnstats/iwnstats.h ============================================================================== --- head/tools/tools/iwn/iwnstats/iwnstats.h Sun Aug 30 21:54:33 2015 (r287312) +++ head/tools/tools/iwn/iwnstats/iwnstats.h Sun Aug 30 21:54:47 2015 (r287313) @@ -33,7 +33,6 @@ struct iwnstats { int s; - struct ifreq ifr; struct iwn_stats st; }; Modified: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- head/tools/tools/iwn/iwnstats/main.c Sun Aug 30 21:54:33 2015 (r287312) +++ head/tools/tools/iwn/iwnstats/main.c Sun Aug 30 21:54:47 2015 (r287313) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -50,22 +51,23 @@ #include "iwnstats.h" #include "iwn_ioctl.h" -#define IWN_DEFAULT_IF "wlan0" +#define IWN_DEFAULT_IF "iwn0" static struct iwnstats * iwnstats_new(const char *ifname) { struct iwnstats *is; + char buf[128]; is = calloc(1, sizeof(struct iwnstats)); if (is == NULL) return (NULL); - is->s = socket(AF_INET, SOCK_DGRAM, 0); + snprintf(buf, sizeof(buf), "/dev/%s", ifname); + is->s = open(buf, O_RDWR); if (is->s < 0) - err(1, "socket"); + err(1, "open"); - iwn_setifname(is, ifname); return (is); } From owner-svn-src-all@freebsd.org Sun Aug 30 21:55:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAAC89C6A17; Sun, 30 Aug 2015 21:55:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.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 ABC241ED7; Sun, 30 Aug 2015 21:55:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ULt1vV070612; Sun, 30 Aug 2015 21:55:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ULt176070611; Sun, 30 Aug 2015 21:55:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508302155.t7ULt176070611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 30 Aug 2015 21:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287314 - head/tools/tools/iwn/iwnstats 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: Sun, 30 Aug 2015 21:55:01 -0000 Author: adrian Date: Sun Aug 30 21:55:01 2015 New Revision: 287314 URL: https://svnweb.freebsd.org/changeset/base/287314 Log: oops - mis-commit. Modified: head/tools/tools/iwn/iwnstats/Makefile Modified: head/tools/tools/iwn/iwnstats/Makefile ============================================================================== --- head/tools/tools/iwn/iwnstats/Makefile Sun Aug 30 21:54:47 2015 (r287313) +++ head/tools/tools/iwn/iwnstats/Makefile Sun Aug 30 21:55:01 2015 (r287314) @@ -9,8 +9,6 @@ MAN= CFLAGS+=-I${.CURDIR}/../../../../sys/dev/iwn/ CFLAGS+=-I${.CURDIR}/../../../../sys/ -CFLAGS+= -g -ggdb -O0 - PROG= iwnstats # Because of a clang preprocessor parser limitation causing this From owner-svn-src-all@freebsd.org Sun Aug 30 22:38:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0870D9C6FAB; Sun, 30 Aug 2015 22:38:07 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.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 ED6FB6C9; Sun, 30 Aug 2015 22:38:06 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UMc6nP086923; Sun, 30 Aug 2015 22:38:06 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UMc6aj086922; Sun, 30 Aug 2015 22:38:06 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508302238.t7UMc6aj086922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 30 Aug 2015 22:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287315 - 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: Sun, 30 Aug 2015 22:38:07 -0000 Author: loos Date: Sun Aug 30 22:38:06 2015 New Revision: 287315 URL: https://svnweb.freebsd.org/changeset/base/287315 Log: The vendor's DTS for Allwinner A20 uses a different way to map the gpio pins, they specify the bank and the pin in two separated cells. This allow the use of vendor's DTS definitions by adding a gpio map routine that copes with that. Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sun Aug 30 21:55:01 2015 (r287314) +++ head/sys/arm/allwinner/a10_gpio.c Sun Aug 30 22:38:06 2015 (r287315) @@ -449,6 +449,18 @@ a10_gpio_get_node(device_t dev, device_t return (ofw_bus_get_node(dev)); } +static int +a10_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + + /* The GPIO pins are mapped as: . */ + *pin = gpios[0] * 32 + gpios[1]; + *flags = gpios[gcells - 1]; + + return (0); +} + static device_method_t a10_gpio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, a10_gpio_probe), @@ -465,6 +477,7 @@ static device_method_t a10_gpio_methods[ DEVMETHOD(gpio_pin_get, a10_gpio_pin_get), DEVMETHOD(gpio_pin_set, a10_gpio_pin_set), DEVMETHOD(gpio_pin_toggle, a10_gpio_pin_toggle), + DEVMETHOD(gpio_map_gpios, a10_gpio_map_gpios), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, a10_gpio_get_node), From owner-svn-src-all@freebsd.org Sun Aug 30 23:20:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55819C57B8; Sun, 30 Aug 2015 23:20:02 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9804EA95; Sun, 30 Aug 2015 23:20:02 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UNK275004011; Sun, 30 Aug 2015 23:20:02 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UNK12U003860; Sun, 30 Aug 2015 23:20:01 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508302320.t7UNK12U003860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 30 Aug 2015 23:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287316 - in head/sys: arm/conf boot/fdt/dts/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: Sun, 30 Aug 2015 23:20:02 -0000 Author: loos Date: Sun Aug 30 23:20:00 2015 New Revision: 287316 URL: https://svnweb.freebsd.org/changeset/base/287316 Log: Add the LED definitions from vendor's DTS. Add gpioled support to A20 kernel. While here rename the gpio phandle to match the one used in the vendor's DTS. Modified: head/sys/arm/conf/A20 head/sys/boot/fdt/dts/arm/bananapi.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Sun Aug 30 22:38:06 2015 (r287315) +++ head/sys/arm/conf/A20 Sun Aug 30 23:20:00 2015 (r287316) @@ -78,6 +78,7 @@ device random # Entropy device # GPIO device gpio +device gpioled device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Sun Aug 30 22:38:06 2015 (r287315) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Sun Aug 30 23:20:00 2015 (r287316) @@ -30,6 +30,8 @@ /include/ "sun7i-a20.dtsi" +#include + / { model = "LeMaker Banana Pi"; compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; @@ -72,6 +74,15 @@ }; }; + leds { + compatible = "gpio-leds"; + + green { + label = "bananapi:green:usr"; + gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; + }; + }; + chosen { bootargs = "-v"; stdin = "UART0"; Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Sun Aug 30 22:38:06 2015 (r287315) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Sun Aug 30 23:20:00 2015 (r287316) @@ -30,6 +30,8 @@ /include/ "sun7i-a20.dtsi" +#include + / { model = "Cubietech Cubieboard2"; @@ -70,6 +72,20 @@ }; }; + leds { + compatible = "gpio-leds"; + + blue { + label = "cubieboard2:blue:usr"; + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; + }; + + green { + label = "cubieboard2:green:usr"; + gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; + }; + }; + chosen { bootargs = "-v"; stdin = "UART0"; Modified: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Sun Aug 30 22:38:06 2015 (r287315) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Sun Aug 30 23:20:00 2015 (r287316) @@ -86,7 +86,7 @@ reg = <0x01c20c90 0x10>; }; - GPIO: gpio@01c20800 { + pio: gpio@01c20800 { #gpio-cells = <3>; compatible = "allwinner,sun4i-gpio"; gpio-controller; From owner-svn-src-all@freebsd.org Sun Aug 30 23:58:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF699C6B29; Sun, 30 Aug 2015 23:58:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.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 7D1D1C83; Sun, 30 Aug 2015 23:58:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7UNwsV4019595; Sun, 30 Aug 2015 23:58:54 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7UNwrWn019592; Sun, 30 Aug 2015 23:58:53 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508302358.t7UNwrWn019592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 30 Aug 2015 23:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287317 - in head/sys/boot/efi: include loader/arch/amd64 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: Sun, 30 Aug 2015 23:58:54 -0000 Author: marcel Date: Sun Aug 30 23:58:53 2015 New Revision: 287317 URL: https://svnweb.freebsd.org/changeset/base/287317 Log: Add support for the UGA draw protocol. This includes adding a command called 'uga' to show whether UGA is implemented by the firmware and what the settings are. It also includes filling the efi_fb structure from the UGA information when GOP isn't implemented by the firmware. Since UGA does not provide information about the stride, we set the stride to the horizontal resolution. This is likely not correct and we should determine the stride by trial and error. For now, this should show something on the console rather than nothing. Refactor this file to maximize code reuse. PR: 202730 Added: head/sys/boot/efi/include/efipciio.h (contents, props changed) head/sys/boot/efi/include/efiuga.h (contents, props changed) Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c Added: head/sys/boot/efi/include/efipciio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efipciio.h Sun Aug 30 23:58:53 2015 (r287317) @@ -0,0 +1,559 @@ +/* $FreeBSD$ */ +/** @file + EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration, + and DMA interfaces that a driver uses to access its PCI controller. + + Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __PCI_IO_H__ +#define __PCI_IO_H__ + +/// +/// Global ID for the PCI I/O Protocol +/// +#define EFI_PCI_IO_PROTOCOL_GUID \ + { \ + 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \ + } + +typedef struct _EFI_PCI_IO_PROTOCOL EFI_PCI_IO_PROTOCOL; + +/// +/// ******************************************************* +/// EFI_PCI_IO_PROTOCOL_WIDTH +/// ******************************************************* +/// +typedef enum { + EfiPciIoWidthUint8 = 0, + EfiPciIoWidthUint16, + EfiPciIoWidthUint32, + EfiPciIoWidthUint64, + EfiPciIoWidthFifoUint8, + EfiPciIoWidthFifoUint16, + EfiPciIoWidthFifoUint32, + EfiPciIoWidthFifoUint64, + EfiPciIoWidthFillUint8, + EfiPciIoWidthFillUint16, + EfiPciIoWidthFillUint32, + EfiPciIoWidthFillUint64, + EfiPciIoWidthMaximum +} EFI_PCI_IO_PROTOCOL_WIDTH; + +// +// Complete PCI address generater +// +#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff ///< Special BAR that passes a memory or I/O cycle through unchanged +#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f ///< All the following I/O and Memory cycles +#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 ///< I/O cycles 0x0000-0x00FF (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 ///< I/O cycles 0x0100-0x03FF or greater (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 ///< MEM cycles 0xA0000-0xBFFFF (24 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 ///< I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 ///< I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 ///< Map a memory range so writes are combined +#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 ///< Enable the I/O decode bit in the PCI Config Header +#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 ///< Enable the Memory decode bit in the PCI Config Header +#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 ///< Enable the DMA bit in the PCI Config Header +#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 ///< Map a memory range so all r/w accesses are cached +#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ///< Disable a memory range +#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 ///< Clear for an add-in PCI Device +#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 ///< Clear for a physical PCI Option ROM accessed through ROM BAR +#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 ///< Clear for PCI controllers that can not genrate a DAC +#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 ///< I/O cycles 0x0100-0x03FF or greater (16 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode) + +#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER) +#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO) + +/// +/// ******************************************************* +/// EFI_PCI_IO_PROTOCOL_OPERATION +/// ******************************************************* +/// +typedef enum { + /// + /// A read operation from system memory by a bus master. + /// + EfiPciIoOperationBusMasterRead, + /// + /// A write operation from system memory by a bus master. + /// + EfiPciIoOperationBusMasterWrite, + /// + /// Provides both read and write access to system memory by both the processor and a + /// bus master. The buffer is coherent from both the processor's and the bus master's point of view. + /// + EfiPciIoOperationBusMasterCommonBuffer, + EfiPciIoOperationMaximum +} EFI_PCI_IO_PROTOCOL_OPERATION; + +/// +/// ******************************************************* +/// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION +/// ******************************************************* +/// +typedef enum { + /// + /// Retrieve the PCI controller's current attributes, and return them in Result. + /// + EfiPciIoAttributeOperationGet, + /// + /// Set the PCI controller's current attributes to Attributes. + /// + EfiPciIoAttributeOperationSet, + /// + /// Enable the attributes specified by the bits that are set in Attributes for this PCI controller. + /// + EfiPciIoAttributeOperationEnable, + /// + /// Disable the attributes specified by the bits that are set in Attributes for this PCI controller. + /// + EfiPciIoAttributeOperationDisable, + /// + /// Retrieve the PCI controller's supported attributes, and return them in Result. + /// + EfiPciIoAttributeOperationSupported, + EfiPciIoAttributeOperationMaximum +} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; + +/** + Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is + satisfied or after a defined duration. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Width Signifies the width of the memory or I/O operations. + @param BarIndex The BAR index of the standard PCI Configuration header to use as the + base address for the memory operation to perform. + @param Offset The offset within the selected BAR to start the memory operation. + @param Mask Mask used for the polling criteria. + @param Value The comparison value used for the polling exit criteria. + @param Delay The number of 100 ns units to poll. + @param Result Pointer to the last value read from the memory location. + + @retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria. + @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. + @retval EFI_UNSUPPORTED Offset is not valid for the BarIndex of this PCI controller. + @retval EFI_TIMEOUT Delay expired before a match occurred. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT8 BarIndex, + IN UINT64 Offset, + IN UINT64 Mask, + IN UINT64 Value, + IN UINT64 Delay, + OUT UINT64 *Result + ); + +/** + Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Width Signifies the width of the memory or I/O operations. + @param BarIndex The BAR index of the standard PCI Configuration header to use as the + base address for the memory or I/O operation to perform. + @param Offset The offset within the selected BAR to start the memory or I/O operation. + @param Count The number of memory or I/O operations to perform. + @param Buffer For read operations, the destination buffer to store the results. For write + operations, the source buffer to write data from. + + @retval EFI_SUCCESS The data was read from or written to the PCI controller. + @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. + @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not + valid for the PCI BAR specified by BarIndex. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT8 BarIndex, + IN UINT64 Offset, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +typedef struct { + /// + /// Read PCI controller registers in the PCI memory or I/O space. + /// + EFI_PCI_IO_PROTOCOL_IO_MEM Read; + /// + /// Write PCI controller registers in the PCI memory or I/O space. + /// + EFI_PCI_IO_PROTOCOL_IO_MEM Write; +} EFI_PCI_IO_PROTOCOL_ACCESS; + +/** + Enable a PCI driver to access PCI controller registers in PCI configuration space. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Width Signifies the width of the memory operations. + @param Offset The offset within the PCI configuration space for the PCI controller. + @param Count The number of PCI configuration operations to perform. + @param Buffer For read operations, the destination buffer to store the results. For write + operations, the source buffer to write data from. + + + @retval EFI_SUCCESS The data was read from or written to the PCI controller. + @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not + valid for the PCI configuration header of the PCI controller. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. + @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT32 Offset, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +typedef struct { + /// + /// Read PCI controller registers in PCI configuration space. + /// + EFI_PCI_IO_PROTOCOL_CONFIG Read; + /// + /// Write PCI controller registers in PCI configuration space. + /// + EFI_PCI_IO_PROTOCOL_CONFIG Write; +} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS; + +/** + Enables a PCI driver to copy one region of PCI memory space to another region of PCI + memory space. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Width Signifies the width of the memory operations. + @param DestBarIndex The BAR index in the standard PCI Configuration header to use as the + base address for the memory operation to perform. + @param DestOffset The destination offset within the BAR specified by DestBarIndex to + start the memory writes for the copy operation. + @param SrcBarIndex The BAR index in the standard PCI Configuration header to use as the + base address for the memory operation to perform. + @param SrcOffset The source offset within the BAR specified by SrcBarIndex to start + the memory reads for the copy operation. + @param Count The number of memory operations to perform. Bytes moved is Width + size * Count, starting at DestOffset and SrcOffset. + + @retval EFI_SUCCESS The data was copied from one memory region to another memory region. + @retval EFI_UNSUPPORTED DestBarIndex not valid for this PCI controller. + @retval EFI_UNSUPPORTED SrcBarIndex not valid for this PCI controller. + @retval EFI_UNSUPPORTED The address range specified by DestOffset, Width, and Count + is not valid for the PCI BAR specified by DestBarIndex. + @retval EFI_UNSUPPORTED The address range specified by SrcOffset, Width, and Count is + not valid for the PCI BAR specified by SrcBarIndex. + @retval EFI_INVALID_PARAMETER Width is invalid. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT8 DestBarIndex, + IN UINT64 DestOffset, + IN UINT8 SrcBarIndex, + IN UINT64 SrcOffset, + IN UINTN Count + ); + +/** + Provides the PCI controller-specific addresses needed to access system memory. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Operation Indicates if the bus master is going to read or write to system memory. + @param HostAddress The system memory address to map to the PCI controller. + @param NumberOfBytes On input the number of bytes to map. On output the number of bytes + that were mapped. + @param DeviceAddress The resulting map address for the bus master PCI controller to use to + access the hosts HostAddress. + @param Mapping A resulting value to pass to Unmap(). + + @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. + @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. + @retval EFI_DEVICE_ERROR The system hardware could not map the requested address. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, + IN VOID *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping + ); + +/** + Completes the Map() operation and releases any corresponding resources. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Mapping The mapping value returned from Map(). + + @retval EFI_SUCCESS The range was unmapped. + @retval EFI_DEVICE_ERROR The data was not committed to the target system memory. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP)( + IN EFI_PCI_IO_PROTOCOL *This, + IN VOID *Mapping + ); + +/** + Allocates pages that are suitable for an EfiPciIoOperationBusMasterCommonBuffer + mapping. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Type This parameter is not used and must be ignored. + @param MemoryType The type of memory to allocate, EfiBootServicesData or + EfiRuntimeServicesData. + @param Pages The number of pages to allocate. + @param HostAddress A pointer to store the base system memory address of the + allocated range. + @param Attributes The requested bit mask of attributes for the allocated range. + + @retval EFI_SUCCESS The requested memory pages were allocated. + @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are + MEMORY_WRITE_COMBINE and MEMORY_CACHED. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + OUT VOID **HostAddress, + IN UINT64 Attributes + ); + +/** + Frees memory that was allocated with AllocateBuffer(). + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Pages The number of pages to free. + @param HostAddress The base system memory address of the allocated range. + + @retval EFI_SUCCESS The requested memory pages were freed. + @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages + was not allocated with AllocateBuffer(). + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER)( + IN EFI_PCI_IO_PROTOCOL *This, + IN UINTN Pages, + IN VOID *HostAddress + ); + +/** + Flushes all PCI posted write transactions from a PCI host bridge to system memory. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + + @retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host + bridge to system memory. + @retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI + host bridge due to a hardware error. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH)( + IN EFI_PCI_IO_PROTOCOL *This + ); + +/** + Retrieves this PCI controller's current PCI bus number, device number, and function number. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param SegmentNumber The PCI controller's current PCI segment number. + @param BusNumber The PCI controller's current PCI bus number. + @param DeviceNumber The PCI controller's current PCI device number. + @param FunctionNumber The PCI controller's current PCI function number. + + @retval EFI_SUCCESS The PCI controller location was returned. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION)( + IN EFI_PCI_IO_PROTOCOL *This, + OUT UINTN *SegmentNumber, + OUT UINTN *BusNumber, + OUT UINTN *DeviceNumber, + OUT UINTN *FunctionNumber + ); + +/** + Performs an operation on the attributes that this PCI controller supports. The operations include + getting the set of supported attributes, retrieving the current attributes, setting the current + attributes, enabling attributes, and disabling attributes. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Operation The operation to perform on the attributes for this PCI controller. + @param Attributes The mask of attributes that are used for Set, Enable, and Disable + operations. + @param Result A pointer to the result mask of attributes that are returned for the Get + and Supported operations. + + @retval EFI_SUCCESS The operation on the PCI controller's attributes was completed. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_UNSUPPORTED one or more of the bits set in + Attributes are not supported by this PCI controller or one of + its parent bridges when Operation is Set, Enable or Disable. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES)( + IN EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, + IN UINT64 Attributes, + OUT UINT64 *Result OPTIONAL + ); + +/** + Gets the attributes that this PCI controller supports setting on a BAR using + SetBarAttributes(), and retrieves the list of resource descriptors for a BAR. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param BarIndex The BAR index of the standard PCI Configuration header to use as the + base address for resource range. The legal range for this field is 0..5. + @param Supports A pointer to the mask of attributes that this PCI controller supports + setting for this BAR with SetBarAttributes(). + @param Resources A pointer to the ACPI 2.0 resource descriptors that describe the current + configuration of this BAR of the PCI controller. + + @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI + controller supports are returned in Supports. If Resources + is not NULL, then the ACPI 2.0 resource descriptors that the PCI + controller is currently using are returned in Resources. + @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL. + @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. + @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate + Resources. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES)( + IN EFI_PCI_IO_PROTOCOL *This, + IN UINT8 BarIndex, + OUT UINT64 *Supports, OPTIONAL + OUT VOID **Resources OPTIONAL + ); + +/** + Sets the attributes for a range of a BAR on a PCI controller. + + @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. + @param Attributes The mask of attributes to set for the resource range specified by + BarIndex, Offset, and Length. + @param BarIndex The BAR index of the standard PCI Configuration header to use as the + base address for resource range. The legal range for this field is 0..5. + @param Offset A pointer to the BAR relative base address of the resource range to be + modified by the attributes specified by Attributes. + @param Length A pointer to the length of the resource range to be modified by the + attributes specified by Attributes. + + @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource + range specified by BarIndex, Offset, and Length were + set on the PCI controller, and the actual resource range is returned + in Offset and Length. + @retval EFI_INVALID_PARAMETER Offset or Length is NULL. + @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. + @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the + resource range specified by BarIndex, Offset, and + Length. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES)( + IN EFI_PCI_IO_PROTOCOL *This, + IN UINT64 Attributes, + IN UINT8 BarIndex, + IN OUT UINT64 *Offset, + IN OUT UINT64 *Length + ); + +/// +/// The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration, +/// and DMA interfaces used to abstract accesses to PCI controllers. +/// There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus. +/// A device driver that wishes to manage a PCI controller in a system will have to +/// retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller. +/// +struct _EFI_PCI_IO_PROTOCOL { + EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem; + EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo; + EFI_PCI_IO_PROTOCOL_ACCESS Mem; + EFI_PCI_IO_PROTOCOL_ACCESS Io; + EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci; + EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem; + EFI_PCI_IO_PROTOCOL_MAP Map; + EFI_PCI_IO_PROTOCOL_UNMAP Unmap; + EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; + EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer; + EFI_PCI_IO_PROTOCOL_FLUSH Flush; + EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation; + EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes; + EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes; + EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes; + + /// + /// The size, in bytes, of the ROM image. + /// + UINT64 RomSize; + + /// + /// A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible + /// for allocating memory for the ROM image, and copying the contents of the ROM to memory. + /// The contents of this buffer are either from the PCI option ROM that can be accessed + /// through the ROM BAR of the PCI controller, or it is from a platform-specific location. + /// The Attributes() function can be used to determine from which of these two sources + /// the RomImage buffer was initialized. + /// + VOID *RomImage; +}; + +extern EFI_GUID gEfiPciIoProtocolGuid; + +#endif Added: head/sys/boot/efi/include/efiuga.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efiuga.h Sun Aug 30 23:58:53 2015 (r287317) @@ -0,0 +1,170 @@ +/* $FreeBSD$ */ +/** @file + UGA Draw protocol from the EFI 1.1 specification. + + Abstraction of a very simple graphics device. + + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at: + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + File name: UgaDraw.h + +**/ + +#ifndef __UGA_DRAW_H__ +#define __UGA_DRAW_H__ + +#define EFI_UGA_DRAW_PROTOCOL_GUID \ + { \ + 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \ + } + +typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL; + +/** + Return the current video mode information. + + @param This Protocol instance pointer. + @param HorizontalResolution Current video horizontal resolution in pixels + @param VerticalResolution Current video vertical resolution in pixels + @param ColorDepth Current video color depth in bits per pixel + @param RefreshRate Current video refresh rate in Hz. + + @retval EFI_SUCCESS Mode information returned. + @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode () + @retval EFI_INVALID_PARAMETER One of the input args was NULL. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) ( + IN EFI_UGA_DRAW_PROTOCOL *This, + OUT UINT32 *HorizontalResolution, + OUT UINT32 *VerticalResolution, + OUT UINT32 *ColorDepth, + OUT UINT32 *RefreshRate + ) +; + +/** + Return the current video mode information. + + @param This Protocol instance pointer. + @param HorizontalResolution Current video horizontal resolution in pixels + @param VerticalResolution Current video vertical resolution in pixels + @param ColorDepth Current video color depth in bits per pixel + @param RefreshRate Current video refresh rate in Hz. + + @retval EFI_SUCCESS Mode information returned. + @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode () + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) ( + IN EFI_UGA_DRAW_PROTOCOL *This, + IN UINT32 HorizontalResolution, + IN UINT32 VerticalResolution, + IN UINT32 ColorDepth, + IN UINT32 RefreshRate + ) +; + +typedef struct { + UINT8 Blue; + UINT8 Green; + UINT8 Red; + UINT8 Reserved; +} EFI_UGA_PIXEL; + +typedef union { + EFI_UGA_PIXEL Pixel; + UINT32 Raw; +} EFI_UGA_PIXEL_UNION; + +typedef enum { + EfiUgaVideoFill, + EfiUgaVideoToBltBuffer, + EfiUgaBltBufferToVideo, + EfiUgaVideoToVideo, + EfiUgaBltMax +} EFI_UGA_BLT_OPERATION; + +/** + Type specifying a pointer to a function to perform an UGA Blt operation. + + The following table defines actions for BltOperations: + + EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + Only one pixel will be used from the BltBuffer. Delta is NOT used. + + EfiUgaVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes + of a row in the BltBuffer. + + EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the + BltBuffer. + + EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY) + (SourceX + Width, SourceY + Height) .to the video display rectangle + (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + The BltBuffer and Delta are not used in this mode. + + + @param[in] This - Protocol instance pointer. + @param[in] BltBuffer - Buffer containing data to blit into video buffer. This + buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL) + @param[in] BltOperation - Operation to perform on BlitBuffer and video memory + @param[in] SourceX - X coordinate of source for the BltBuffer. + @param[in] SourceY - Y coordinate of source for the BltBuffer. + @param[in] DestinationX - X coordinate of destination for the BltBuffer. + @param[in] DestinationY - Y coordinate of destination for the BltBuffer. + @param[in] Width - Width of rectangle in BltBuffer in pixels. + @param[in] Height - Hight of rectangle in BltBuffer in pixels. + @param[in] Delta - OPTIONAL + + @retval EFI_SUCCESS - The Blt operation completed. + @retval EFI_INVALID_PARAMETER - BltOperation is not valid. + @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer. + +--*/ +typedef +EFI_STATUS +(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) ( + IN EFI_UGA_DRAW_PROTOCOL * This, + IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL + IN EFI_UGA_BLT_OPERATION BltOperation, + IN UINTN SourceX, + IN UINTN SourceY, + IN UINTN DestinationX, + IN UINTN DestinationY, + IN UINTN Width, + IN UINTN Height, + IN UINTN Delta OPTIONAL + ); + +struct _EFI_UGA_DRAW_PROTOCOL { + EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode; + EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode; + EFI_UGA_DRAW_PROTOCOL_BLT Blt; +}; + +extern EFI_GUID gEfiUgaDrawProtocolGuid; + +#endif Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sun Aug 30 23:20:00 2015 (r287316) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sun Aug 30 23:58:53 2015 (r287317) @@ -30,36 +30,27 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include +#include #include static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; +static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; +static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; -int -efi_find_framebuffer(struct efi_fb *efifb) +static int +efifb_mask_from_pixfmt(struct efi_fb *efifb, EFI_GRAPHICS_PIXEL_FORMAT pixfmt, + EFI_PIXEL_BITMASK *pixinfo) { - EFI_GRAPHICS_OUTPUT *gop; - EFI_STATUS status; - EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *mode; - EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; - - status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); - if (EFI_ERROR(status)) - return (1); + int result; - mode = gop->Mode; - info = gop->Mode->Info; - - efifb->fb_addr = mode->FrameBufferBase; - efifb->fb_size = mode->FrameBufferSize; - efifb->fb_height = info->VerticalResolution; - efifb->fb_width = info->HorizontalResolution; - efifb->fb_stride = info->PixelsPerScanLine; - - switch (info->PixelFormat) { + result = 0; + switch (pixfmt) { case PixelRedGreenBlueReserved8BitPerColor: efifb->fb_mask_red = 0x000000ff; efifb->fb_mask_green = 0x0000ff00; @@ -73,53 +64,164 @@ efi_find_framebuffer(struct efi_fb *efif efifb->fb_mask_reserved = 0xff000000; break; case PixelBitMask: - efifb->fb_mask_red = info->PixelInformation.RedMask; - efifb->fb_mask_green = info->PixelInformation.GreenMask; - efifb->fb_mask_blue = info->PixelInformation.BlueMask; - efifb->fb_mask_reserved = - info->PixelInformation.ReservedMask; + efifb->fb_mask_red = pixinfo->RedMask; + efifb->fb_mask_green = pixinfo->GreenMask; + efifb->fb_mask_blue = pixinfo->BlueMask; + efifb->fb_mask_reserved = pixinfo->ReservedMask; break; default: + result = 1; + break; + } + return (result); +} + +static int +efifb_from_gop(struct efi_fb *efifb, EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *mode, + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info) +{ + int result; + + efifb->fb_addr = mode->FrameBufferBase; + efifb->fb_size = mode->FrameBufferSize; + efifb->fb_height = info->VerticalResolution; + efifb->fb_width = info->HorizontalResolution; + efifb->fb_stride = info->PixelsPerScanLine; + result = efifb_mask_from_pixfmt(efifb, info->PixelFormat, + &info->PixelInformation); + return (result); +} + +static int +efifb_from_uga(struct efi_fb *efifb, EFI_UGA_DRAW_PROTOCOL *uga) +{ + uint8_t *buf; + EFI_PCI_IO_PROTOCOL *pciio; + EFI_HANDLE handle; + EFI_STATUS status; + UINTN bufofs, bufsz; + uint64_t address, length; + uint32_t horiz, vert, depth, refresh; + u_int bar; + + status = uga->GetMode(uga, &horiz, &vert, &depth, &refresh); + if (EFI_ERROR(status)) + return (1); + efifb->fb_height = vert; + efifb->fb_width = horiz; + efifb_mask_from_pixfmt(efifb, PixelBlueGreenRedReserved8BitPerColor, + NULL); + /* Find all handles that support the UGA protocol. */ + bufsz = 0; + status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, NULL); + if (status != EFI_BUFFER_TOO_SMALL) return (1); + buf = malloc(bufsz); + status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, + (EFI_HANDLE *)buf); + if (status != EFI_SUCCESS) { + free(buf); + return (1); + } + /* Get the PCI I/O interface of the first handle that supports it. */ + pciio = NULL; + for (bufofs = 0; bufofs < bufsz; bufofs += sizeof(EFI_HANDLE)) { + handle = *(EFI_HANDLE *)(buf + bufofs); + status = BS->HandleProtocol(handle, &pciio_guid, + (void **)&pciio); + if (status == EFI_SUCCESS) + break; + } + free(buf); + if (pciio == NULL) + return (1); + /* Attempt to get the frame buffer address (imprecise). */ + efifb->fb_addr = 0; + efifb->fb_size = 0; + for (bar = 0; bar < 6; bar++) { + status = pciio->GetBarAttributes(pciio, bar, NULL, + (EFI_HANDLE *)&buf); + if (status != EFI_SUCCESS) + continue; + /* XXX magic offsets and constants. */ + if (buf[0] == 0x87 && buf[3] == 0) { + /* 32-bit address space descriptor (MEMIO) */ + address = le32dec(buf + 10); + length = le32dec(buf + 22); + } else if (buf[0] == 0x8a && buf[3] == 0) { + /* 64-bit address space descriptor (MEMIO) */ + address = le64dec(buf + 14); + length = le64dec(buf + 38); + } else { + address = 0; + length = 0; + } + BS->FreePool(buf); + if (address == 0 || length == 0) + continue; + /* We assume the largest BAR is the frame buffer. */ + if (length > efifb->fb_size) { + efifb->fb_addr = address; + efifb->fb_size = length; + } } + if (efifb->fb_addr == 0 || efifb->fb_size == 0) + return (1); + /* TODO determine the stride. */ + efifb->fb_stride = efifb->fb_width; /* XXX */ return (0); } -COMMAND_SET(gop, "gop", "graphics output protocol", command_gop); +int +efi_find_framebuffer(struct efi_fb *efifb) +{ + EFI_GRAPHICS_OUTPUT *gop; + EFI_UGA_DRAW_PROTOCOL *uga; + EFI_STATUS status; + + status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); + if (status == EFI_SUCCESS) + return (efifb_from_gop(efifb, gop->Mode, gop->Mode->Info)); + + status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); + if (status == EFI_SUCCESS) + return (efifb_from_uga(efifb, uga)); + + return (1); +} static void -command_gop_display(u_int mode, EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info) +print_efifb(int mode, struct efi_fb *efifb, int verbose) { + uint32_t mask; + u_int depth; - printf("mode %u: %ux%u, stride=%u, color=", mode, - info->HorizontalResolution, info->VerticalResolution, - info->PixelsPerScanLine); - switch (info->PixelFormat) { - case PixelRedGreenBlueReserved8BitPerColor: - printf("32-bit (RGB)"); - break; - case PixelBlueGreenRedReserved8BitPerColor: - printf("32-bit (BGR)"); - break; - case PixelBitMask: - printf("mask (R=%x, G=%x, B=%x, X=%x)", - info->PixelInformation.RedMask, - info->PixelInformation.GreenMask, - info->PixelInformation.BlueMask, - info->PixelInformation.ReservedMask); - break; - case PixelBltOnly: - printf("unsupported (blt only)"); - break; - default: - printf("unsupported (unknown)"); - break; + if (mode >= 0) + printf("mode %d: ", mode); + mask = efifb->fb_mask_red | efifb->fb_mask_green | + efifb->fb_mask_blue | efifb->fb_mask_reserved; + if (mask > 0) { + for (depth = 1; mask != 1; depth++) + mask >>= 1; + } else + depth = 0; + printf("%ux%ux%u, stride=%u", efifb->fb_width, efifb->fb_height, + depth, efifb->fb_stride); + if (verbose) { + printf("\n frame buffer: address=%jx, size=%jx", + (uintmax_t)efifb->fb_addr, (uintmax_t)efifb->fb_size); + printf("\n color mask: R=%08x, G=%08x, B=%08x\n", + efifb->fb_mask_red, efifb->fb_mask_green, + efifb->fb_mask_blue); } } +COMMAND_SET(gop, "gop", "graphics output protocol", command_gop); + static int command_gop(int argc, char *argv[]) { + struct efi_fb efifb; EFI_GRAPHICS_OUTPUT *gop; EFI_STATUS status; u_int mode; @@ -131,7 +233,7 @@ command_gop(int argc, char *argv[]) return (CMD_ERROR); } - if (argc == 1) + if (argc < 2) goto usage; if (!strcmp(argv[1], "set")) { @@ -152,20 +254,24 @@ command_gop(int argc, char *argv[]) return (CMD_ERROR); } } else if (!strcmp(argv[1], "get")) { - command_gop_display(gop->Mode->Mode, gop->Mode->Info); - printf("\n frame buffer: address=%jx, size=%lx\n", - (uintmax_t)gop->Mode->FrameBufferBase, - gop->Mode->FrameBufferSize); + if (argc != 2) + goto usage; + efifb_from_gop(&efifb, gop->Mode, gop->Mode->Info); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 31 01:32:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 613A59C65F0; Mon, 31 Aug 2015 01:32:18 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.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 2199F11A9; Mon, 31 Aug 2015 01:32:17 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.22] (atc.xcllnt.net [50.0.150.213]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id t7V1WAWu028075 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 30 Aug 2015 18:32:11 -0700 (PDT) (envelope-from marcel@xcllnt.net) Subject: Re: svn commit: r287299 - head/sys/boot/efi/loader/arch/amd64 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_428714FE-F1BC-4EE0-BA1D-6E3212AD90C9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.1 From: Marcel Moolenaar In-Reply-To: <1440959231.1192.5.camel@me.com> Date: Sun, 30 Aug 2015 18:32:09 -0700 Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201508300140.t7U1e0ej039049@repo.freebsd.org> <1440959231.1192.5.camel@me.com> To: Rui Paulo X-Mailer: Apple Mail (2.2104) 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, 31 Aug 2015 01:32:18 -0000 --Apple-Mail=_428714FE-F1BC-4EE0-BA1D-6E3212AD90C9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 30, 2015, at 11:27 AM, Rui Paulo wrote: >=20 > On Sun, 2015-08-30 at 01:40 +0000, Marcel Moolenaar wrote: >> Author: marcel >> Date: Sun Aug 30 01:39:59 2015 >> New Revision: 287299 >> URL: https://svnweb.freebsd.org/changeset/base/287299 >>=20 >> Log: >> Add a gop command to help diagnose VT efifb problems. The gop >> command has the following sub-commands: >> list - list all possible modes (paged) >> get - return the current mode >> set - set the current mode to >>=20 >=20 > This is duplicating the functionality of the `mode' command. Please > remove the mode command. It doesn=E2=80=99t. The mode command works on text modes only. This command works on the Graphics Output Protocol (GOP) modes. >=20 > Also, 'gop' is pretty weird for a command name. Maybe we can change > that to something more user friendly? Maybe. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_428714FE-F1BC-4EE0-BA1D-6E3212AD90C9 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 iQIcBAEBCgAGBQJV466aAAoJEIda8t8f0tjj05YP/RkkYIF2JcGaRX2zd/YAV6vm IpK3oyizsFkeOe6/fiB/LTkBDNfJ5MbTboqb2sNx1/w0BXoS+LuTHhxBbFQ8O2iC WKqmVOXQQB4tqn5qtTtlgTTtbsrmHx5M86KEdIl7CwVRC+NLRcWIDAP2rdFGKezc ks2M07OUFg0GGB3rBBWdvVXJDz7irUzMYYCTbmN0+R0P29H7QvpG2NX4zdliDgXd +CLshv12sA+vwvieMJb/9WwFEv3llufjCYPzWMI7xStgCvw/j8MKfIQfHJvaCHO3 xZZiJO+CqDAuwydDFr1+1uTgsCXzDepJtSTTgXridJbR2QYv3DaN9wapCk35il5G mldAYlf7nOZvILCn9esWU1mwZuTnZCutiPxKbAgQO/EdIOcyE3xr0kNz2g9p9Klp ZCsD5KJYDQhRLGScGnMeOALUujO7VliWYCM5XcT7Ft2BeJ1Z/LXM3MshoofEaM5l wPRxl3E//bIMl7VElCtZi1bLVEmO/xk0SEZ2UAfjDDk52m9gYKwX9tKG/YUDzICw DIIydzkvhcl8F6CQMGBMvr+OVUkEg/Gq1zW4sBREhByI55v4TUaMdXDcvYVRf+5F j6X3czrEO0yBqNrQ3tPD52BwmCbOgMo1mcvdwi2lvO0ARF3xlhvmN7Iw3x/t7cJ0 i49tr2buRneSxL0a0zRZ =eaGO -----END PGP SIGNATURE----- --Apple-Mail=_428714FE-F1BC-4EE0-BA1D-6E3212AD90C9-- From owner-svn-src-all@freebsd.org Mon Aug 31 05:03:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB55C9C661E; Mon, 31 Aug 2015 05:03:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.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 A25C5192A; Mon, 31 Aug 2015 05:03:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7V53bJN046589; Mon, 31 Aug 2015 05:03:37 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7V53aWQ046586; Mon, 31 Aug 2015 05:03:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508310503.t7V53aWQ046586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 31 Aug 2015 05:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287318 - in head/sys: net 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: Mon, 31 Aug 2015 05:03:37 -0000 Author: melifaro Date: Mon Aug 31 05:03:36 2015 New Revision: 287318 URL: https://svnweb.freebsd.org/changeset/base/287318 Log: Simplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in alloc handler, based on flags. Modified: head/sys/net/if_llatbl.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sun Aug 30 23:58:53 2015 (r287317) +++ head/sys/net/if_llatbl.c Mon Aug 31 05:03:36 2015 (r287318) @@ -592,7 +592,10 @@ lla_rt_output(struct rt_msghdr *rtm, str switch (rtm->rtm_type) { case RTM_ADD: /* Add static LLE */ - lle = lltable_alloc_entry(llt, 0, dst); + laflags = 0; + if (rtm->rtm_rmx.rmx_expire == 0) + laflags = LLE_STATIC; + lle = lltable_alloc_entry(llt, laflags, dst); if (lle == NULL) return (ENOMEM); @@ -600,22 +603,8 @@ lla_rt_output(struct rt_msghdr *rtm, str if ((rtm->rtm_flags & RTF_ANNOUNCE)) lle->la_flags |= LLE_PUB; lle->la_flags |= LLE_VALID; -#ifdef INET6 - /* - * ND6 - */ - if (dst->sa_family == AF_INET6) - lle->ln_state = ND6_LLINFO_REACHABLE; -#endif - /* - * NB: arp and ndp always set (RTF_STATIC | RTF_HOST) - */ + lle->la_expire = rtm->rtm_rmx.rmx_expire; - if (rtm->rtm_rmx.rmx_expire == 0) { - lle->la_flags |= LLE_STATIC; - lle->la_expire = 0; - } else - lle->la_expire = rtm->rtm_rmx.rmx_expire; laflags = lle->la_flags; /* Try to link new entry */ Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Aug 30 23:58:53 2015 (r287317) +++ head/sys/netinet6/in6.c Mon Aug 31 05:03:36 2015 (r287318) @@ -2264,6 +2264,9 @@ in6_lltable_alloc(struct lltable *llt, u lle->la_flags |= (LLE_VALID | LLE_STATIC); } + if ((lle->la_flags & LLE_STATIC) != 0) + lle->ln_state = ND6_LLINFO_REACHABLE; + return (lle); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Aug 30 23:58:53 2015 (r287317) +++ head/sys/netinet6/nd6.c Mon Aug 31 05:03:36 2015 (r287318) @@ -2275,9 +2275,6 @@ nd6_add_ifa_lle(struct in6_ifaddr *ia) if (ln == NULL) return (ENOBUFS); - ln->la_expire = 0; /* for IPv6 this means permanent */ - ln->ln_state = ND6_LLINFO_REACHABLE; - IF_AFDATA_WLOCK(ifp); LLE_WLOCK(ln); /* Unlink any entry if exists */ From owner-svn-src-all@freebsd.org Mon Aug 31 05:57:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F421D9C7125; Mon, 31 Aug 2015 05:57:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E53181257; Mon, 31 Aug 2015 05:57:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7V5vQwg067077; Mon, 31 Aug 2015 05:57:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7V5vQUi067076; Mon, 31 Aug 2015 05:57:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508310557.t7V5vQUi067076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 31 Aug 2015 05:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287319 - head/usr.bin/iconv 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, 31 Aug 2015 05:57:27 -0000 Author: delphij Date: Mon Aug 31 05:57:26 2015 New Revision: 287319 URL: https://svnweb.freebsd.org/changeset/base/287319 Log: Constify opt_f and opt_t and eliminate unneeded copying. This fixes memory leaks. Reported by: clang static analyzer MFC after: 2 weeks Modified: head/usr.bin/iconv/iconv.c Modified: head/usr.bin/iconv/iconv.c ============================================================================== --- head/usr.bin/iconv/iconv.c Mon Aug 31 05:03:36 2015 (r287318) +++ head/usr.bin/iconv/iconv.c Mon Aug 31 05:57:26 2015 (r287319) @@ -156,11 +156,11 @@ int main(int argc, char **argv) { FILE *fp; - char *opt_f, *opt_t; + const char *opt_f, *opt_t; int ch, i, res; bool opt_c = false, opt_s = false; - opt_f = opt_t = strdup(""); + opt_f = opt_t = ""; setlocale(LC_ALL, ""); setprogname(argv[0]); @@ -186,12 +186,12 @@ main(int argc, char **argv) case 'f': /* from */ if (optarg != NULL) - opt_f = strdup(optarg); + opt_f = optarg; break; case 't': /* to */ if (optarg != NULL) - opt_t = strdup(optarg); + opt_t = optarg; break; default: usage(); From owner-svn-src-all@freebsd.org Mon Aug 31 06:11:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BD89C7755; Mon, 31 Aug 2015 06:11:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 77E2C1B2A; Mon, 31 Aug 2015 06:11:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7V6Beq4073105; Mon, 31 Aug 2015 06:11:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7V6BecW073104; Mon, 31 Aug 2015 06:11:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508310611.t7V6BecW073104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 31 Aug 2015 06:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287320 - head/usr.bin/tftp 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, 31 Aug 2015 06:11:40 -0000 Author: delphij Date: Mon Aug 31 06:11:39 2015 New Revision: 287320 URL: https://svnweb.freebsd.org/changeset/base/287320 Log: - uri is expected to be nul-terminated (strchr used later), so use strlcpy instead of strncpy. - unroll the other two cases of strncpy+\0 to strlcpy. MFC after: 2 weeks Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Mon Aug 31 05:57:26 2015 (r287319) +++ head/usr.bin/tftp/main.c Mon Aug 31 06:11:39 2015 (r287320) @@ -223,7 +223,7 @@ urihandling(char *URI) char line[MAXLINE]; int i; - strncpy(uri, URI, ARG_MAX); + strlcpy(uri, URI, ARG_MAX); host = uri + 7; if ((s = strchr(host, '/')) == NULL) { @@ -320,11 +320,10 @@ setpeer0(char *host, const char *lport) /* res->ai_addr <= sizeof(peeraddr) is guaranteed */ memcpy(&peer_sock, res->ai_addr, res->ai_addrlen); if (res->ai_canonname) { - (void) strncpy(hostname, res->ai_canonname, + (void) strlcpy(hostname, res->ai_canonname, sizeof(hostname)); } else - (void) strncpy(hostname, host, sizeof(hostname)); - hostname[sizeof(hostname)-1] = 0; + (void) strlcpy(hostname, host, sizeof(hostname)); connected = 1; } From owner-svn-src-all@freebsd.org Mon Aug 31 07:18:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CBE09C5B07; Mon, 31 Aug 2015 07:18:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0D6C81F26; Mon, 31 Aug 2015 07:18:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7V7IEpo000644; Mon, 31 Aug 2015 07:18:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7V7IEQV000642; Mon, 31 Aug 2015 07:18:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201508310718.t7V7IEQV000642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 31 Aug 2015 07:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287321 - in head/sys/dev/usb: . quirk 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, 31 Aug 2015 07:18:15 -0000 Author: hselasky Date: Mon Aug 31 07:18:13 2015 New Revision: 287321 URL: https://svnweb.freebsd.org/changeset/base/287321 Log: Add new USB quirk. MFC after: 1 week PR: 202783 Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Aug 31 06:11:39 2015 (r287320) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Aug 31 07:18:13 2015 (r287321) @@ -97,6 +97,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(REALTEK, RTL8153, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), + USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* Quirks for printer devices */ USB_QUIRK(HP, 895C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), USB_QUIRK(HP, 880C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Aug 31 06:11:39 2015 (r287320) +++ head/sys/dev/usb/usbdevs Mon Aug 31 07:18:13 2015 (r287321) @@ -1408,6 +1408,7 @@ product CISCOLINKSYS WUSB54GC 0x0020 WUS product CISCOLINKSYS WUSB54GR 0x0023 WUSB54GR product CISCOLINKSYS WUSBF54G 0x0024 WUSBF54G product CISCOLINKSYS AE1000 0x002f AE1000 +product CISCOLINKSYS USB3GIGV1 0x0041 USB3GIGV1 USB Ethernet Adapter product CISCOLINKSYS2 RT3070 0x4001 RT3070 product CISCOLINKSYS3 RT3070 0x0101 RT3070 From owner-svn-src-all@freebsd.org Mon Aug 31 08:43:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC859C7E43; Mon, 31 Aug 2015 08:43:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) 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 0D4E4118D; Mon, 31 Aug 2015 08:43:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7V8hX2F053589 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 31 Aug 2015 11:43:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7V8hX2F053589 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7V8hXc6053588; Mon, 31 Aug 2015 11:43:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 31 Aug 2015 11:43:33 +0300 From: Konstantin Belousov To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287312 - head/sys/dev/iwn Message-ID: <20150831084333.GP2072@kib.kiev.ua> References: <201508302154.t7ULsXaT070453@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508302154.t7ULsXaT070453@repo.freebsd.org> 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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, 31 Aug 2015 08:43:38 -0000 On Sun, Aug 30, 2015 at 09:54:33PM +0000, Adrian Chadd wrote: > static int > -iwn_ioctl(struct ieee80211com *ic, u_long cmd, void *data) > +iwn_cdev_open(struct cdev *dev, int flags, int type, struct thread *td) > { > - struct ifreq *ifr = data; > - struct iwn_softc *sc = ic->ic_softc; > - int error = 0; > - > + > + return (0); > +} > + > +static int > +iwn_cdev_close(struct cdev *dev, int flags, int type, struct thread *td) > +{ > + > + return (0); > +} devfs does the right thing for drivers which does not provide d_open and d_close methods, these empty stubs are not needed. From owner-svn-src-all@freebsd.org Mon Aug 31 08:50:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A4059C622B; Mon, 31 Aug 2015 08:50:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (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 56E03164F; Mon, 31 Aug 2015 08:50:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igui7 with SMTP id i7so50284711igu.0; Mon, 31 Aug 2015 01:50:44 -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=nQii4d3TfSRfobucyfpCKydbWgDS6YfCr4FMWCwIHeM=; b=iOKoRhZWUEN3E+kFsEldQdrfElDCbmtmZVIo58bgby2uKn8IFjyX+gb9elZn53DuZl DncbzREvobyD5OolmeCpcYAGIhg3xPnMOJVdRAX8gvOsWCrxW9ucJ32C1wGe7B5EzAi4 sAt7qEw5ekzengGT/eMnQo/3XXwc2TYgca8xKztyDnrOWg0Ee9g14LRwrm25QuIqb8gC AX7YN0+fa7YX9tmYfPqWnQ5HJRF9UsxCo+I7n2oqc9p2XLijKJAksVLalteYRoolCNOL tNuS6uQ3yoBG5ey1/LMH0XoeuEbjJ9jf0rsv1Fv3OKLdwWoNbi00/bRK4MLiWmlb4n/M 1Daw== MIME-Version: 1.0 X-Received: by 10.50.43.227 with SMTP id z3mr12420505igl.22.1441011044719; Mon, 31 Aug 2015 01:50:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.28.208 with HTTP; Mon, 31 Aug 2015 01:50:44 -0700 (PDT) In-Reply-To: <20150831084333.GP2072@kib.kiev.ua> References: <201508302154.t7ULsXaT070453@repo.freebsd.org> <20150831084333.GP2072@kib.kiev.ua> Date: Mon, 31 Aug 2015 01:50:44 -0700 X-Google-Sender-Auth: Wkm8fk9aINt-wCcevzUwJ_lsSpQ Message-ID: Subject: Re: svn commit: r287312 - head/sys/dev/iwn From: Adrian Chadd 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: Mon, 31 Aug 2015 08:50:45 -0000 On 31 August 2015 at 01:43, Konstantin Belousov wrote: > On Sun, Aug 30, 2015 at 09:54:33PM +0000, Adrian Chadd wrote: >> static int >> -iwn_ioctl(struct ieee80211com *ic, u_long cmd, void *data) >> +iwn_cdev_open(struct cdev *dev, int flags, int type, struct thread *td) >> { >> - struct ifreq *ifr = data; >> - struct iwn_softc *sc = ic->ic_softc; >> - int error = 0; >> - >> + >> + return (0); >> +} >> + >> +static int >> +iwn_cdev_close(struct cdev *dev, int flags, int type, struct thread *td) >> +{ >> + >> + return (0); >> +} > > devfs does the right thing for drivers which does not provide d_open and > d_close methods, these empty stubs are not needed. I'll remove them tomorrow. I copied off of cxgbe, which does this. Thanks! -adrian From owner-svn-src-all@freebsd.org Mon Aug 31 09:39:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295EE9C617D; Mon, 31 Aug 2015 09:39:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1A0561257; Mon, 31 Aug 2015 09:39:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7V9dGX0078644; Mon, 31 Aug 2015 09:39:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7V9dGjo078643; Mon, 31 Aug 2015 09:39:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508310939.t7V9dGjo078643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 31 Aug 2015 09:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287322 - 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: Mon, 31 Aug 2015 09:39:17 -0000 Author: andrew Date: Mon Aug 31 09:39:16 2015 New Revision: 287322 URL: https://svnweb.freebsd.org/changeset/base/287322 Log: Clean up the style of the LEAVE_HYP macro. Modified: head/sys/arm/arm/locore-v6.S Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Mon Aug 31 07:18:13 2015 (r287321) +++ head/sys/arm/arm/locore-v6.S Mon Aug 31 09:39:16 2015 (r287322) @@ -67,23 +67,23 @@ __FBSDID("$FreeBSD$"); .align 2 #if __ARM_ARCH >= 7 -#define LEAVE_HYP \ - /* Leave HYP mode */ ;\ - mrs r0, cpsr ;\ - and r0, r0, #(PSR_MODE) /* Mode is in the low 5 bits of CPSR */ ;\ - teq r0, #(PSR_HYP32_MODE) /* Hyp Mode? */ ;\ - bne 1f ;\ - /* Ensure that IRQ, FIQ and Aborts will be disabled after eret */;\ - mrs r0, spsr ;\ - orr r0, r0, #(PSR_I | PSR_F | PSR_A) ;\ - msr spsr, r0 ;\ - /* Exit hypervisor mode */ ;\ - adr lr, 1f ;\ - MSR_ELR_HYP(14) ;\ - ERET ;\ +#define LEAVE_HYP \ + /* Leave HYP mode */ ;\ + mrs r0, cpsr ;\ + and r0, r0, #(PSR_MODE) /* Mode is in the low 5 bits of CPSR */ ;\ + teq r0, #(PSR_HYP32_MODE) /* Hyp Mode? */ ;\ + bne 1f ;\ + /* Ensure that IRQ, FIQ and Aborts will be disabled after eret */ ;\ + mrs r0, spsr ;\ + orr r0, r0, #(PSR_I | PSR_F | PSR_A) ;\ + msr spsr, r0 ;\ + /* Exit hypervisor mode */ ;\ + adr lr, 1f ;\ + MSR_ELR_HYP(14) ;\ + ERET ;\ 1: #else -#define LEAVE_HYP +#define LEAVE_HYP #endif /* __ARM_ARCH >= 7 */ /* From owner-svn-src-all@freebsd.org Mon Aug 31 10:43:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1359C61DE; Mon, 31 Aug 2015 10:43:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D3C6D1A01; Mon, 31 Aug 2015 10:43:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VAh1UQ017244; Mon, 31 Aug 2015 10:43:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VAh1NB017243; Mon, 31 Aug 2015 10:43:01 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508311043.t7VAh1NB017243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 31 Aug 2015 10:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287323 - head/sys/dev/iwn 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, 31 Aug 2015 10:43:02 -0000 Author: glebius Date: Mon Aug 31 10:43:00 2015 New Revision: 287323 URL: https://svnweb.freebsd.org/changeset/base/287323 Log: Remove now unneeded includes. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Aug 31 09:39:16 2015 (r287322) +++ head/sys/dev/iwn/if_iwn.c Mon Aug 31 10:43:00 2015 (r287323) @@ -56,20 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -#include -#include #include #include -#include #include -#include -#include #include -#include #include #include From owner-svn-src-all@freebsd.org Mon Aug 31 12:28:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8209C6475; Mon, 31 Aug 2015 12:28:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4053620C; Mon, 31 Aug 2015 12:28:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VCSELa070428; Mon, 31 Aug 2015 12:28:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VCSEqG070427; Mon, 31 Aug 2015 12:28:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508311228.t7VCSEqG070427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 12:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287324 - head/usr.bin/ar 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, 31 Aug 2015 12:28:14 -0000 Author: emaste Date: Mon Aug 31 12:28:13 2015 New Revision: 287324 URL: https://svnweb.freebsd.org/changeset/base/287324 Log: ar: fix deterministic mode when running as ranlib This was broken by r286024. PR: 202741 Submitted by: fk@fabiankeil.de Obtained from: ElectroBSD Modified: head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Mon Aug 31 10:43:00 2015 (r287323) +++ head/usr.bin/ar/ar.c Mon Aug 31 12:28:13 2015 (r287324) @@ -144,6 +144,9 @@ main(int argc, char **argv) if (*argv == NULL) ranlib_usage(); + /* Enable determinstic mode unless -U is set. */ + if (Uflag == 0) + bsdar->options |= AR_D; bsdar->options |= AR_S; for (;(bsdar->filename = *argv++) != NULL;) ar_mode_s(bsdar); From owner-svn-src-all@freebsd.org Mon Aug 31 17:30:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCCFB9C685E; Mon, 31 Aug 2015 17:30:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 AC20792A; Mon, 31 Aug 2015 17:30:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VHUEha002194; Mon, 31 Aug 2015 17:30:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VHUE9Y002192; Mon, 31 Aug 2015 17:30:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508311730.t7VHUE9Y002192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 17:30: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: r287326 - stable/10/usr.bin/ar 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, 31 Aug 2015 17:30:14 -0000 Author: emaste Date: Mon Aug 31 17:30:13 2015 New Revision: 287326 URL: https://svnweb.freebsd.org/changeset/base/287326 Log: MFC r285844: ar: add -U (unique) option to disable -D (deterministic) mode This is required in order for us to support deterministic mode by default. If multiple -D or -U options are specified on the command line, the final one takes precedence. GNU ar also uses -U for this. PR: 196929 Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/ar/ar.1 stable/10/usr.bin/ar/ar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ar/ar.1 ============================================================================== --- stable/10/usr.bin/ar/ar.1 Mon Aug 31 12:42:21 2015 (r287325) +++ stable/10/usr.bin/ar/ar.1 Mon Aug 31 17:30:13 2015 (r287326) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2011 +.Dd August 31, 2015 .Dt AR 1 .Os .Sh NAME @@ -66,6 +66,7 @@ .Op Fl D .Op Fl f .Op Fl s | Fl S +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -82,6 +83,7 @@ .Op Fl j .Op Fl s | Fl S .Op Fl u +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -112,6 +114,7 @@ .Fl M .Nm ranlib .Op Fl D +.Op Fl U .Ar archive ... .Sh DESCRIPTION The @@ -207,6 +210,11 @@ and 0644 instead of file mode from the m .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl f Synonymous with option .Fl T . @@ -316,6 +324,19 @@ option, the members specified by argumen .Ar will be extracted only if they are newer than the corresponding files in the file system. +.It Fl U +When used in combination with the +.Fl r +or +.Fl q +option, insert the real mtime, uid and gid, and file mode values +from the members named by arguments +.Ar . +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl v Provide verbose output. When used with the Modified: stable/10/usr.bin/ar/ar.c ============================================================================== --- stable/10/usr.bin/ar/ar.c Mon Aug 31 12:42:21 2015 (r287325) +++ stable/10/usr.bin/ar/ar.c Mon Aug 31 17:30:13 2015 (r287326) @@ -113,7 +113,7 @@ main(int argc, char **argv) len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { - while ((opt = getopt_long(argc, argv, "tDV", longopts, + while ((opt = getopt_long(argc, argv, "tDUV", longopts, NULL)) != -1) { switch(opt) { case 't': @@ -122,6 +122,9 @@ main(int argc, char **argv) case 'D': bsdar->options |= AR_D; break; + case 'U': + bsdar->options &= ~AR_D; + break; case 'V': ranlib_version(); break; @@ -157,7 +160,7 @@ main(int argc, char **argv) } } - while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtuVvxz", + while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtUuVvxz", longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -216,6 +219,9 @@ main(int argc, char **argv) case 't': set_mode(bsdar, opt); break; + case 'U': + bsdar->options &= ~AR_D; + break; case 'u': bsdar->options |= AR_U; break; @@ -364,9 +370,9 @@ bsdar_usage(void) (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n"); (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); - (void)fprintf(stderr, "\tar -q [-TcDjsvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-TcDjsuvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-TabcDijsuvz] position archive file ...\n"); + (void)fprintf(stderr, "\tar -q [-TcDjsUvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TcDjsUuvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TabcDijsUuvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -s [-jz] archive\n"); (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n"); @@ -378,7 +384,7 @@ static void ranlib_usage(void) { - (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); + (void)fprintf(stderr, "usage: ranlib [-DtU] archive ...\n"); (void)fprintf(stderr, "\tranlib -V\n"); exit(EX_USAGE); } From owner-svn-src-all@freebsd.org Mon Aug 31 18:07:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 091C99C78B0; Mon, 31 Aug 2015 18:07:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 EDAE6321; Mon, 31 Aug 2015 18:07:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VI7H7P018397; Mon, 31 Aug 2015 18:07:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VI7Hms018396; Mon, 31 Aug 2015 18:07:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508311807.t7VI7Hms018396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 18:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287327 - head/usr.bin/ar 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, 31 Aug 2015 18:07:18 -0000 Author: emaste Date: Mon Aug 31 18:07:17 2015 New Revision: 287327 URL: https://svnweb.freebsd.org/changeset/base/287327 Log: ar: Deobfuscate a while loop Modified: head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Mon Aug 31 17:30:13 2015 (r287326) +++ head/usr.bin/ar/ar.c Mon Aug 31 18:07:17 2015 (r287327) @@ -148,7 +148,7 @@ main(int argc, char **argv) if (Uflag == 0) bsdar->options |= AR_D; bsdar->options |= AR_S; - for (;(bsdar->filename = *argv++) != NULL;) + while ((bsdar->filename = *argv++) != NULL) ar_mode_s(bsdar); exit(EX_OK); From owner-svn-src-all@freebsd.org Mon Aug 31 18:53:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DB69C6D7E; Mon, 31 Aug 2015 18:53:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 BAC5B1C99; Mon, 31 Aug 2015 18:53:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VIrgpi040421; Mon, 31 Aug 2015 18:53:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VIrgg6040419; Mon, 31 Aug 2015 18:53:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508311853.t7VIrgg6040419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 31 Aug 2015 18:53: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: r287328 - stable/10/sbin/ping6 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, 31 Aug 2015 18:53:43 -0000 Author: delphij Date: Mon Aug 31 18:53:41 2015 New Revision: 287328 URL: https://svnweb.freebsd.org/changeset/base/287328 Log: MFC r286834: Use arc4random_buf(). While there, unifdef the code for !HAVE_ARC4RANDOM. Modified: stable/10/sbin/ping6/Makefile stable/10/sbin/ping6/ping6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ping6/Makefile ============================================================================== --- stable/10/sbin/ping6/Makefile Mon Aug 31 18:07:17 2015 (r287327) +++ stable/10/sbin/ping6/Makefile Mon Aug 31 18:53:41 2015 (r287328) @@ -3,8 +3,7 @@ PROG= ping6 MAN= ping6.8 -CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS \ - -DHAVE_ARC4RANDOM +CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS WARNS?= 2 BINOWN= root Modified: stable/10/sbin/ping6/ping6.c ============================================================================== --- stable/10/sbin/ping6/ping6.c Mon Aug 31 18:07:17 2015 (r287327) +++ stable/10/sbin/ping6/ping6.c Mon Aug 31 18:53:41 2015 (r287328) @@ -289,9 +289,6 @@ main(int argc, char *argv[]) { struct timeval last, intvl; struct sockaddr_in6 from, *sin6; -#ifndef HAVE_ARC4RANDOM - struct timeval seed; -#endif struct addrinfo hints, *res; struct sigaction si_sa; int cc, i; @@ -743,17 +740,7 @@ main(int argc, char *argv[]) *datap++ = i; ident = getpid() & 0xFFFF; -#ifndef HAVE_ARC4RANDOM - gettimeofday(&seed, NULL); - srand((unsigned int)(seed.tv_sec ^ seed.tv_usec ^ (long)ident)); - memset(nonce, 0, sizeof(nonce)); - for (i = 0; i < sizeof(nonce); i += sizeof(int)) - *((int *)&nonce[i]) = rand(); -#else - memset(nonce, 0, sizeof(nonce)); - for (i = 0; i < sizeof(nonce); i += sizeof(u_int32_t)) - *((u_int32_t *)&nonce[i]) = arc4random(); -#endif + arc4random_buf(nonce, sizeof(nonce)); optval = 1; if (options & F_DONTFRAG) if (setsockopt(s, IPPROTO_IPV6, IPV6_DONTFRAG, From owner-svn-src-all@freebsd.org Mon Aug 31 18:58:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 783A39C6F5D; Mon, 31 Aug 2015 18:58:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6884D1F33; Mon, 31 Aug 2015 18:58:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VIwsU8040821; Mon, 31 Aug 2015 18:58:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VIwsX4040820; Mon, 31 Aug 2015 18:58:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508311858.t7VIwsX4040820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 31 Aug 2015 18:58: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: r287329 - 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: Mon, 31 Aug 2015 18:58:54 -0000 Author: delphij Date: Mon Aug 31 18:58:53 2015 New Revision: 287329 URL: https://svnweb.freebsd.org/changeset/base/287329 Log: MFC r286836: so_vnet is constant after creation and no locking is necessary, document this fact. Modified: stable/10/sys/sys/socketvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/socketvar.h ============================================================================== --- stable/10/sys/sys/socketvar.h Mon Aug 31 18:53:41 2015 (r287328) +++ stable/10/sys/sys/socketvar.h Mon Aug 31 18:58:53 2015 (r287329) @@ -76,7 +76,7 @@ struct socket { short so_state; /* (b) internal state flags SS_* */ int so_qstate; /* (e) internal state flags SQ_* */ void *so_pcb; /* protocol control block */ - struct vnet *so_vnet; /* network stack instance */ + struct vnet *so_vnet; /* (a) network stack instance */ struct protosw *so_proto; /* (a) protocol handle */ /* * Variables for connection queuing. From owner-svn-src-all@freebsd.org Mon Aug 31 19:12:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FE5B9C74F6; Mon, 31 Aug 2015 19:12:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 90D83AD2; Mon, 31 Aug 2015 19:12:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VJCBbJ048883; Mon, 31 Aug 2015 19:12:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VJCBAL048882; Mon, 31 Aug 2015 19:12:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508311912.t7VJCBAL048882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 31 Aug 2015 19:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287330 - head/sys/dev/e1000 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, 31 Aug 2015 19:12:11 -0000 Author: sbruno Date: Mon Aug 31 19:12:10 2015 New Revision: 287330 URL: https://svnweb.freebsd.org/changeset/base/287330 Log: Restrict tso_max to IP_MAXPACKET to avoid the panic reported in: https://lists.freebsd.org/pipermail/freebsd-current/2015-August/057192.html Submitted by: pyunyh@gmail.com MFC after: 2 weeks Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Aug 31 18:58:53 2015 (r287329) +++ head/sys/dev/e1000/if_em.c Mon Aug 31 19:12:10 2015 (r287330) @@ -3044,7 +3044,7 @@ em_setup_interface(device_t dev, struct if_setioctlfn(ifp, em_ioctl); if_setgetcounterfn(ifp, em_get_counter); /* TSO parameters */ - ifp->if_hw_tsomax = EM_TSO_SIZE; + ifp->if_hw_tsomax = IP_MAXPACKET; ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER; ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE; From owner-svn-src-all@freebsd.org Mon Aug 31 19:20:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D589C77A6; Mon, 31 Aug 2015 19:20:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B7049E41; Mon, 31 Aug 2015 19:20:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VJKJgE049283; Mon, 31 Aug 2015 19:20:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VJKJX0049281; Mon, 31 Aug 2015 19:20:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508311920.t7VJKJX0049281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 19:20: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: r287331 - 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.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, 31 Aug 2015 19:20:19 -0000 Author: emaste Date: Mon Aug 31 19:20:18 2015 New Revision: 287331 URL: https://svnweb.freebsd.org/changeset/base/287331 Log: MFC r282551: Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in rtld. Modified: stable/10/libexec/rtld-elf/debug.h stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/debug.h ============================================================================== --- stable/10/libexec/rtld-elf/debug.h Mon Aug 31 19:12:10 2015 (r287330) +++ stable/10/libexec/rtld-elf/debug.h Mon Aug 31 19:20:18 2015 (r287331) @@ -32,10 +32,6 @@ #ifndef DEBUG_H #define DEBUG_H 1 -#ifndef __GNUC__ -#error "This file must be compiled with GCC" -#endif - #include #include Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Mon Aug 31 19:12:10 2015 (r287330) +++ stable/10/libexec/rtld-elf/rtld.c Mon Aug 31 19:20:18 2015 (r287331) @@ -34,10 +34,6 @@ * John Polstra . */ -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include #include #include From owner-svn-src-all@freebsd.org Mon Aug 31 19:40:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C108C9C602B; Mon, 31 Aug 2015 19:40:55 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B1AA01AE7; Mon, 31 Aug 2015 19:40:55 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VJetwp058451; Mon, 31 Aug 2015 19:40:55 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VJetXQ058450; Mon, 31 Aug 2015 19:40:55 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201508311940.t7VJetXQ058450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Mon, 31 Aug 2015 19:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287332 - head/lib/libc/gen 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, 31 Aug 2015 19:40:55 -0000 Author: rodrigc Date: Mon Aug 31 19:40:54 2015 New Revision: 287332 URL: https://svnweb.freebsd.org/changeset/base/287332 Log: Include stdlib.h to get devname() prototype. Eliminates -Wmissing-prototypes warnings with gcc Modified: head/lib/libc/gen/devname.c Modified: head/lib/libc/gen/devname.c ============================================================================== --- head/lib/libc/gen/devname.c Mon Aug 31 19:20:18 2015 (r287331) +++ head/lib/libc/gen/devname.c Mon Aug 31 19:40:54 2015 (r287332) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Mon Aug 31 20:30:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862429C736E; Mon, 31 Aug 2015 20:30:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5F2C31291; Mon, 31 Aug 2015 20:30:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VKU70B078265; Mon, 31 Aug 2015 20:30:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VKU7cr078264; Mon, 31 Aug 2015 20:30:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508312030.t7VKU7cr078264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 20:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287333 - head/lib/libproc/tests 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, 31 Aug 2015 20:30:07 -0000 Author: emaste Date: Mon Aug 31 20:30:06 2015 New Revision: 287333 URL: https://svnweb.freebsd.org/changeset/base/287333 Log: Enable libproc symbol_lookup tests on arm64 This reverts part of r286863, as the kernel support required by these tests was added in r287105. PR: 202305 Sponsored by: The FreeBSD Foundation Modified: head/lib/libproc/tests/proc_test.c Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Mon Aug 31 19:40:54 2015 (r287332) +++ head/lib/libproc/tests/proc_test.c Mon Aug 31 20:30:06 2015 (r287333) @@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$"); #include static const char *aout_object = "a.out"; -#if !defined(__aarch64__) static const char *ldelf_object = "ld-elf.so.1"; -#endif static const char *target_prog_file = "target_prog"; /* @@ -77,7 +75,6 @@ start_prog(const struct atf_tc *tc, bool return (phdl); } -#if !defined(__aarch64__) static void set_bkpt(struct proc_handle *phdl, uintptr_t addr, u_long *saved) { @@ -154,7 +151,6 @@ verify_bkpt(struct proc_handle *phdl, GE ATF_REQUIRE_EQ_MSG(strcmp(mapname, mapbname), 0, "expected map name '%s' doesn't match '%s'", mapname, mapbname); } -#endif ATF_TC(map_alias_obj2map); ATF_TC_HEAD(map_alias_obj2map, tc) @@ -259,7 +255,6 @@ ATF_TC_BODY(map_alias_name2sym, tc) proc_free(phdl); } -#if !defined(__aarch64__) ATF_TC(symbol_lookup); ATF_TC_HEAD(symbol_lookup, tc) { @@ -336,7 +331,6 @@ ATF_TC_BODY(symbol_lookup_fail, tc) proc_free(phdl); } -#endif ATF_TC(signal_forward); ATF_TC_HEAD(signal_forward, tc) @@ -385,11 +379,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, map_alias_obj2map); ATF_TP_ADD_TC(tp, map_alias_name2map); ATF_TP_ADD_TC(tp, map_alias_name2sym); -/* On arm64 triggers panic ARM64TODO: pmap_sync_icache (PR202305). */ -#if !defined(__aarch64__) ATF_TP_ADD_TC(tp, symbol_lookup); ATF_TP_ADD_TC(tp, symbol_lookup_fail); -#endif ATF_TP_ADD_TC(tp, signal_forward); return (atf_no_error()); From owner-svn-src-all@freebsd.org Mon Aug 31 20:44:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A984A9C79EC; Mon, 31 Aug 2015 20:44:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.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 800221D29; Mon, 31 Aug 2015 20:44:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VKirwN086147; Mon, 31 Aug 2015 20:44:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VKir4Q086145; Mon, 31 Aug 2015 20:44:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508312044.t7VKir4Q086145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 31 Aug 2015 20:44: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: r287334 - stable/10/share/mk 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, 31 Aug 2015 20:44:53 -0000 Author: bdrewery Date: Mon Aug 31 20:44:52 2015 New Revision: 287334 URL: https://svnweb.freebsd.org/changeset/base/287334 Log: MFC r272282,r272363,r272383: r272282: Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR. This will only take effect if PORTSDIR is not set, as previously supported. r272363: Always resolve PORTSDIR to absolute paths using realpath(1). r272383: Revise r272363 by collapsing the tests into a for loop. Relnotes: yes Modified: stable/10/share/mk/bsd.port.mk stable/10/share/mk/bsd.port.subdir.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.port.mk ============================================================================== --- stable/10/share/mk/bsd.port.mk Mon Aug 31 20:30:06 2015 (r287333) +++ stable/10/share/mk/bsd.port.mk Mon Aug 31 20:44:52 2015 (r287334) @@ -1,6 +1,18 @@ # $FreeBSD$ -PORTSDIR?= /usr/ports +.if !defined(PORTSDIR) +# Autodetect if the command is being run in a ports tree that's not rooted +# in the default /usr/ports. The ../../.. case is in case ports ever grows +# a third level. +.for RELPATH in . .. ../.. ../../.. +.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk) +_PORTSDIR= ${.CURDIR}/${RELPATH} +.endif +.endfor +_PORTSDIR?= /usr/ports +PORTSDIR!= realpath ${_PORTSDIR} +.endif + BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk # Needed to keep bsd.own.mk from reading in /etc/src.conf Modified: stable/10/share/mk/bsd.port.subdir.mk ============================================================================== --- stable/10/share/mk/bsd.port.subdir.mk Mon Aug 31 20:30:06 2015 (r287333) +++ stable/10/share/mk/bsd.port.subdir.mk Mon Aug 31 20:44:52 2015 (r287334) @@ -1,6 +1,18 @@ # $FreeBSD$ -PORTSDIR?= /usr/ports +.if !defined(PORTSDIR) +# Autodetect if the command is being run in a ports tree that's not rooted +# in the default /usr/ports. The ../../.. case is in case ports ever grows +# a third level. +.for RELPATH in . .. ../.. ../../.. +.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk) +_PORTSDIR= ${.CURDIR}/${RELPATH} +.endif +.endfor +_PORTSDIR?= /usr/ports +PORTSDIR!= realpath ${_PORTSDIR} +.endif + BSDPORTSUBDIRMK?= ${PORTSDIR}/Mk/bsd.port.subdir.mk .include "${BSDPORTSUBDIRMK}" From owner-svn-src-all@freebsd.org Mon Aug 31 22:36:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D889C6E6C; Mon, 31 Aug 2015 22:36:18 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.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 59A8F18DC; Mon, 31 Aug 2015 22:36:18 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VMaIEf031698; Mon, 31 Aug 2015 22:36:18 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VMaIIY031697; Mon, 31 Aug 2015 22:36:18 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201508312236.t7VMaIIY031697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 31 Aug 2015 22:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287335 - head/cddl/contrib/opensolaris/lib/libzpool/common/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: Mon, 31 Aug 2015 22:36:18 -0000 Author: allanjude Date: Mon Aug 31 22:36:17 2015 New Revision: 287335 URL: https://svnweb.freebsd.org/changeset/base/287335 Log: Remove duplicate defines introduced in initial ZFS import (r168404) This change reduces compiler warnings by removing duplicate defines Line numbers are from r168404 (and r284648) #define lbolt: lines 384 and 459 (531 and 648) (original was renamed later) #define lbolt64: lines 385 and 460 (532 and 649) (original was renamed later) #define gethrestime_sec: lines 390 and 465 (540 and 653) uint64_t physmem: lines 402 and 463 (561 and 651) Reviewed by: smh, delphij Approved by: bapt (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2878 Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Aug 31 20:44:52 2015 (r287334) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Aug 31 22:36:17 2015 (r287335) @@ -655,13 +655,6 @@ extern int zfs_secpolicy_rename_perms(co extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr); extern zoneid_t getzoneid(void); /* Random compatibility stuff. */ -#define lbolt (gethrtime() >> 23) -#define lbolt64 (gethrtime() >> 23) - -extern uint64_t physmem; - -#define gethrestime_sec() time(NULL) - #define pwrite64(d, p, n, o) pwrite(d, p, n, o) #define readdir64(d) readdir(d) #define SIGPENDING(td) (0) From owner-svn-src-all@freebsd.org Mon Aug 31 23:08:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9D069C7CD0; Mon, 31 Aug 2015 23:08:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 BB1C9826; Mon, 31 Aug 2015 23:08:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VN8e91043897; Mon, 31 Aug 2015 23:08:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VN8e8L043896; Mon, 31 Aug 2015 23:08:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508312308.t7VN8e8L043896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 23:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287336 - head/usr.bin/vtfontcvt 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, 31 Aug 2015 23:08:40 -0000 Author: emaste Date: Mon Aug 31 23:08:39 2015 New Revision: 287336 URL: https://svnweb.freebsd.org/changeset/base/287336 Log: vtfontcvt: introduce xmalloc to abort on out-of-memory Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Mon Aug 31 22:36:17 2015 (r287335) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Mon Aug 31 23:08:39 2015 (r287336) @@ -96,6 +96,16 @@ usage(void) exit(1); } +static void * +xmalloc(size_t size) +{ + void *m; + + if ((m = malloc(size)) == NULL) + errx(1, "memory allocation failure"); + return (m); +} + static int add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx) { @@ -104,7 +114,7 @@ add_mapping(struct glyph *gl, unsigned i mapping_total++; - mp = malloc(sizeof *mp); + mp = xmalloc(sizeof *mp); mp->m_char = c; mp->m_glyph = gl; mp->m_length = 0; @@ -163,8 +173,8 @@ add_glyph(const uint8_t *bytes, unsigned } } - gl = malloc(sizeof *gl); - gl->g_data = malloc(wbytes * height); + gl = xmalloc(sizeof *gl); + gl->g_data = xmalloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height); if (fallback) TAILQ_INSERT_HEAD(&glyphs[map_idx], gl, g_list); From owner-svn-src-all@freebsd.org Mon Aug 31 23:10:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 932999C7DF8; Mon, 31 Aug 2015 23:10:43 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.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 83D4AA1E; Mon, 31 Aug 2015 23:10:43 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VNAhUY044054; Mon, 31 Aug 2015 23:10:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VNAhjq044053; Mon, 31 Aug 2015 23:10:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201508312310.t7VNAhjq044053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 31 Aug 2015 23:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287337 - 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: Mon, 31 Aug 2015 23:10:43 -0000 Author: allanjude Date: Mon Aug 31 23:10:42 2015 New Revision: 287337 URL: https://svnweb.freebsd.org/changeset/base/287337 Log: Apply the noline attribute to vdev_queue_max_async_writes This makes it possible to analyze the performance of the new ZFS write throttle with dtrace PR: 200316 Submitted by: Lacey Powers Reviewed by: avg, smh, delphij (no objection) Approved by: bapt (mentor) MFC after: 1 month Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3472 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Mon Aug 31 23:08:39 2015 (r287336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Mon Aug 31 23:10:42 2015 (r287337) @@ -508,7 +508,7 @@ vdev_queue_class_min_active(zio_priority } } -static int +static __noinline int vdev_queue_max_async_writes(spa_t *spa) { int writes; From owner-svn-src-all@freebsd.org Tue Sep 1 01:01:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3889C7BBE; Tue, 1 Sep 2015 01:01:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 63754B0; Tue, 1 Sep 2015 01:01:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8111aV9092081; Tue, 1 Sep 2015 01:01:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8111Z0I092079; Tue, 1 Sep 2015 01:01:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509010101.t8111Z0I092079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Sep 2015 01:01: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: r287338 - stable/10/sys/rpc 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, 01 Sep 2015 01:01:36 -0000 Author: delphij Date: Tue Sep 1 01:01:35 2015 New Revision: 287338 URL: https://svnweb.freebsd.org/changeset/base/287338 Log: MFC r286894: Set curvnet context inside the RPC code in more places. Reviewed by: melifaro Modified: stable/10/sys/rpc/rpc_generic.c stable/10/sys/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/rpc_generic.c ============================================================================== --- stable/10/sys/rpc/rpc_generic.c Mon Aug 31 23:10:42 2015 (r287337) +++ stable/10/sys/rpc/rpc_generic.c Tue Sep 1 01:01:35 2015 (r287338) @@ -703,7 +703,9 @@ __rpc_sockisbound(struct socket *so) struct sockaddr *sa; int error, bound; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return (0); @@ -791,7 +793,9 @@ bindresvport(struct socket *so, struct s socklen_t salen; if (sa == NULL) { + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return (error); freesa = TRUE; Modified: stable/10/sys/rpc/svc_vc.c ============================================================================== --- stable/10/sys/rpc/svc_vc.c Mon Aug 31 23:10:42 2015 (r287337) +++ stable/10/sys/rpc/svc_vc.c Tue Sep 1 01:01:35 2015 (r287338) @@ -150,7 +150,9 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCK_LOCK(so); if (so->so_state & (SS_ISCONNECTED|SS_ISDISCONNECTED)) { SOCK_UNLOCK(so); + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); + CURVNET_RESTORE(); if (error) return (NULL); xprt = svc_vc_create_conn(pool, so, sa); @@ -167,7 +169,9 @@ svc_vc_create(SVCPOOL *pool, struct sock xprt->xp_p2 = NULL; xprt->xp_ops = &svc_vc_rendezvous_ops; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) { goto cleanup_svc_vc_create; } @@ -249,7 +253,9 @@ svc_vc_create_conn(SVCPOOL *pool, struct memcpy(&xprt->xp_rtaddr, raddr, raddr->sa_len); + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) goto cleanup_svc_vc_create; From owner-svn-src-all@freebsd.org Tue Sep 1 01:03:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E6B9C7CF7; Tue, 1 Sep 2015 01:03:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 23A022EA; Tue, 1 Sep 2015 01:03:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8113k0Z092890; Tue, 1 Sep 2015 01:03:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8113k3G092889; Tue, 1 Sep 2015 01:03:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509010103.t8113k3G092889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Sep 2015 01:03:45 +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: r287339 - stable/10/lib/libc/net 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, 01 Sep 2015 01:03:46 -0000 Author: delphij Date: Tue Sep 1 01:03:45 2015 New Revision: 287339 URL: https://svnweb.freebsd.org/changeset/base/287339 Log: MFC r286910: - ANSIfy - Remove the redundant _PATH_RSH definition (paths.h at r96194); - Use pid_t for PIDs - Note that we are at the same level of OpenBSD's counterpart of revision 1.7 (r94757). Modified: stable/10/lib/libc/net/rcmdsh.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/rcmdsh.c ============================================================================== --- stable/10/lib/libc/net/rcmdsh.c Tue Sep 1 01:01:35 2015 (r287338) +++ stable/10/lib/libc/net/rcmdsh.c Tue Sep 1 01:03:45 2015 (r287339) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.5 1998/04/25 16:23:58 millert Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.7 2002/03/12 00:05:44 millert Exp $ */ /* * Copyright (c) 2001, MagniComp @@ -49,23 +49,18 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef _PATH_RSH -#define _PATH_RSH "/usr/bin/rsh" -#endif - /* * This is a replacement rcmd() function that uses the rsh(1) * program in place of a direct rcmd(3) function call so as to * avoid having to be root. Note that rport is ignored. */ int -rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) - char **ahost; - int rport; - const char *locuser, *remuser, *cmd, *rshprog; +rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, + const char *cmd, const char *rshprog) { struct addrinfo hints, *res; - int cpid, sp[2], error; + int sp[2], error; + pid_t cpid; char *p; struct passwd *pw; char num[8]; From owner-svn-src-all@freebsd.org Tue Sep 1 01:35:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 457469C6FFC; Tue, 1 Sep 2015 01:35:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1BC571167; Tue, 1 Sep 2015 01:35:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t811Zhx8005595; Tue, 1 Sep 2015 01:35:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t811ZhiQ005594; Tue, 1 Sep 2015 01:35:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201509010135.t811ZhiQ005594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 1 Sep 2015 01:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287340 - head/usr.bin/vtfontcvt 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, 01 Sep 2015 01:35:44 -0000 Author: emaste Date: Tue Sep 1 01:35:43 2015 New Revision: 287340 URL: https://svnweb.freebsd.org/changeset/base/287340 Log: vtfontcvt: fix buffer overflow for non-default size .hex fonts Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Sep 1 01:03:45 2015 (r287339) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Sep 1 01:35:43 2015 (r287340) @@ -300,17 +300,26 @@ parse_hex(FILE *fp, unsigned int map_idx char *ln, *p; char fmt_str[8]; size_t length; - uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; + uint8_t *bytes = NULL, *bytes_r = NULL; unsigned curchar = 0, i, line, chars_per_row, dwidth; + int rv = 0; while ((ln = fgetln(fp, &length)) != NULL) { ln[length - 1] = '\0'; if (strncmp(ln, "# Height: ", 10) == 0) { + if (bytes != NULL) + errx(1, "malformed input: Height tag after font data"); height = atoi(ln + 10); } else if (strncmp(ln, "# Width: ", 9) == 0) { + if (bytes != NULL) + errx(1, "malformed input: Width tag after font data"); set_width(atoi(ln + 9)); } else if (sscanf(ln, "%4x:", &curchar)) { + if (bytes == NULL) { + bytes = xmalloc(wbytes * height); + bytes_r = xmalloc(wbytes * height); + } p = ln + 5; chars_per_row = strlen(p) / height; dwidth = width; @@ -323,16 +332,23 @@ parse_hex(FILE *fp, unsigned int map_idx sscanf(p, fmt_str, &line); p += chars_per_row; if (parse_bitmap_line(bytes + i * wbytes, - bytes_r + i * wbytes, line, dwidth) != 0) - return (1); + bytes_r + i * wbytes, line, dwidth) != 0) { + rv = 1; + goto out; + } } if (add_char(curchar, map_idx, bytes, - dwidth == width * 2 ? bytes_r : NULL) != 0) - return (1); + dwidth == width * 2 ? bytes_r : NULL) != 0) { + rv = 1; + goto out; + } } } - return (0); +out: + free(bytes); + free(bytes_r); + return (rv); } static int From owner-svn-src-all@freebsd.org Tue Sep 1 02:39:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18F4B9C729A; Tue, 1 Sep 2015 02:39:12 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 08313D03; Tue, 1 Sep 2015 02:39:12 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t812dCwi032773; Tue, 1 Sep 2015 02:39:12 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t812d8xc032753; Tue, 1 Sep 2015 02:39:08 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509010239.t812d8xc032753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 1 Sep 2015 02:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287341 - head/lib/libc/rpc 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, 01 Sep 2015 02:39:12 -0000 Author: rodrigc Date: Tue Sep 1 02:39:07 2015 New Revision: 287341 URL: https://svnweb.freebsd.org/changeset/base/287341 Log: Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: head/lib/libc/rpc/auth_time.c head/lib/libc/rpc/clnt_dg.c head/lib/libc/rpc/crypt_client.c head/lib/libc/rpc/des_crypt.c head/lib/libc/rpc/des_soft.c head/lib/libc/rpc/getpublickey.c head/lib/libc/rpc/key_call.c head/lib/libc/rpc/rpc_soc.c head/lib/libc/rpc/rpcb_clnt.c head/lib/libc/rpc/rpcdname.c head/lib/libc/rpc/rtime.c head/lib/libc/rpc/svc_auth.c head/lib/libc/rpc/svc_auth_des.c head/lib/libc/rpc/svc_dg.c head/lib/libc/rpc/svc_vc.c Modified: head/lib/libc/rpc/auth_time.c ============================================================================== --- head/lib/libc/rpc/auth_time.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/auth_time.c Tue Sep 1 02:39:07 2015 (r287341) @@ -61,8 +61,7 @@ extern int _rpc_dtablesize( void ); static int saw_alarm = 0; static void -alarm_hndler(s) - int s; +alarm_hndler(int s) { saw_alarm = 1; return; @@ -83,12 +82,7 @@ alarm_hndler(s) * Turn a 'universal address' into a struct sockaddr_in. * Bletch. */ -static int uaddr_to_sockaddr(uaddr, sin) -#ifdef foo - endpoint *endpt; -#endif - char *uaddr; - struct sockaddr_in *sin; +static int uaddr_to_sockaddr(char *uaddr, struct sockaddr_in *sin) { unsigned char p_bytes[2]; int i; @@ -118,9 +112,7 @@ static int uaddr_to_sockaddr(uaddr, sin) * Free the strings that were strduped into the eps structure. */ static void -free_eps(eps, num) - endpoint eps[]; - int num; +free_eps(endpoint eps[], int num) { int i; @@ -142,14 +134,15 @@ free_eps(eps, num) * fact that gethostbyname() could do an NIS search. Ideally, the * NIS+ server will call __rpc_get_time_offset() with the nis_server * structure already populated. + * + * host - name of the time host + * srv - nis_server struct to use. + * eps[] - array of endpoints + * maxep - max array size */ static nis_server * -get_server(sin, host, srv, eps, maxep) - struct sockaddr_in *sin; - char *host; /* name of the time host */ - nis_server *srv; /* nis_server struct to use. */ - endpoint eps[]; /* array of endpoints */ - int maxep; /* max array size */ +get_server(struct sockaddr_in *sin, char *host, nis_server *srv, + endpoint eps[], int maxep) { char hname[256]; int num_ep = 0, i; @@ -236,14 +229,16 @@ get_server(sin, host, srv, eps, maxep) * structure and to then contact the machine for the time. * * td = "server" - "client" + * + * td - Time difference + * srv - NIS Server description + * thost - if no server, this is the timehost + * uaddr - known universal address + * netid - known network identifier */ int -__rpc_get_time_offset(td, srv, thost, uaddr, netid) - struct timeval *td; /* Time difference */ - nis_server *srv; /* NIS Server description */ - char *thost; /* if no server, this is the timehost */ - char **uaddr; /* known universal address */ - struct sockaddr_in *netid; /* known network identifier */ +__rpc_get_time_offset(struct timeval *td, nis_server *srv, char *thost, + char **uaddr, struct sockaddr_in *netid) { CLIENT *clnt; /* Client handle */ endpoint *ep, /* useful endpoints */ Modified: head/lib/libc/rpc/clnt_dg.c ============================================================================== --- head/lib/libc/rpc/clnt_dg.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/clnt_dg.c Tue Sep 1 02:39:07 2015 (r287341) @@ -153,15 +153,17 @@ struct cu_data { * If they are 0, use the transport default. * * If svcaddr is NULL, returns NULL. + * + * fd - open file descriptor + * svcaddr - servers address + * program - program number + * version - version number + * sendsz - buffer recv size + * recvsz - buffer send size */ CLIENT * -clnt_dg_create(fd, svcaddr, program, version, sendsz, recvsz) - int fd; /* open file descriptor */ - const struct netbuf *svcaddr; /* servers address */ - rpcprog_t program; /* program number */ - rpcvers_t version; /* version number */ - u_int sendsz; /* buffer recv size */ - u_int recvsz; /* buffer send size */ +clnt_dg_create(int fd, const struct netbuf *svcaddr, rpcprog_t program, + rpcvers_t version, u_int sendsz, u_int recvsz) { CLIENT *cl = NULL; /* client handle */ struct cu_data *cu = NULL; /* private data */ @@ -301,15 +303,18 @@ err2: return (NULL); } +/* + * cl - client handle + * proc - procedure number + * xargs - xdr routine for args + * argsp - pointer to args + * xresults - xdr routine for results + * resultsp - pointer to results + * utimeout - seconds to wait before giving up + */ static enum clnt_stat -clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) - CLIENT *cl; /* client handle */ - rpcproc_t proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - void *argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - void *resultsp; /* pointer to results */ - struct timeval utimeout; /* seconds to wait before giving up */ +clnt_dg_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xargs, void *argsp, + xdrproc_t xresults, void *resultsp, struct timeval utimeout) { struct cu_data *cu = (struct cu_data *)cl->cl_private; XDR *xdrs; @@ -602,9 +607,7 @@ out: } static void -clnt_dg_geterr(cl, errp) - CLIENT *cl; - struct rpc_err *errp; +clnt_dg_geterr(CLIENT *cl, struct rpc_err *errp) { struct cu_data *cu = (struct cu_data *)cl->cl_private; @@ -612,10 +615,7 @@ clnt_dg_geterr(cl, errp) } static bool_t -clnt_dg_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void *res_ptr; +clnt_dg_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr) { struct cu_data *cu = (struct cu_data *)cl->cl_private; XDR *xdrs = &(cu->cu_outxdrs); @@ -638,16 +638,12 @@ clnt_dg_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clnt_dg_abort(h) - CLIENT *h; +clnt_dg_abort(CLIENT *h) { } static bool_t -clnt_dg_control(cl, request, info) - CLIENT *cl; - u_int request; - void *info; +clnt_dg_control(CLIENT *cl, u_int request, void *info) { struct cu_data *cu = (struct cu_data *)cl->cl_private; struct netbuf *addr; @@ -790,8 +786,7 @@ clnt_dg_control(cl, request, info) } static void -clnt_dg_destroy(cl) - CLIENT *cl; +clnt_dg_destroy(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; int cu_fd = cu->cu_fd; @@ -820,7 +815,7 @@ clnt_dg_destroy(cl) } static struct clnt_ops * -clnt_dg_ops() +clnt_dg_ops(void) { static struct clnt_ops ops; sigset_t mask; @@ -848,8 +843,7 @@ clnt_dg_ops() * Make sure that the time is not garbage. -1 value is allowed. */ static bool_t -time_not_ok(t) - struct timeval *t; +time_not_ok(struct timeval *t) { return (t->tv_sec < -1 || t->tv_sec > 100000000 || t->tv_usec < -1 || t->tv_usec > 1000000); Modified: head/lib/libc/rpc/crypt_client.c ============================================================================== --- head/lib/libc/rpc/crypt_client.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/crypt_client.c Tue Sep 1 02:39:07 2015 (r287341) @@ -43,10 +43,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" int -_des_crypt_call(buf, len, dparms) - char *buf; - int len; - struct desparams *dparms; +_des_crypt_call(char *buf, int len, struct desparams *dparms) { CLIENT *clnt; desresp *result_1; Modified: head/lib/libc/rpc/des_crypt.c ============================================================================== --- head/lib/libc/rpc/des_crypt.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/des_crypt.c Tue Sep 1 02:39:07 2015 (r287341) @@ -70,12 +70,7 @@ extern int _des_crypt_call(char *, int, * CBC mode encryption */ int -cbc_crypt(key, buf, len, mode, ivec) - char *key; - char *buf; - unsigned len; - unsigned mode; - char *ivec; +cbc_crypt(char *key, char *buf, unsigned len, unsigned mode, char *ivec) { int err; struct desparams dp; @@ -97,11 +92,7 @@ cbc_crypt(key, buf, len, mode, ivec) * ECB mode encryption */ int -ecb_crypt(key, buf, len, mode) - char *key; - char *buf; - unsigned len; - unsigned mode; +ecb_crypt(char *key, char *buf, unsigned len, unsigned mode) { struct desparams dp; @@ -120,12 +111,8 @@ ecb_crypt(key, buf, len, mode) * Common code to cbc_crypt() & ecb_crypt() */ static int -common_crypt(key, buf, len, mode, desp) - char *key; - char *buf; - unsigned len; - unsigned mode; - struct desparams *desp; +common_crypt(char *key, char *buf, unsigned len, unsigned mode, + struct desparams *desp) { int desdev; Modified: head/lib/libc/rpc/des_soft.c ============================================================================== --- head/lib/libc/rpc/des_soft.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/des_soft.c Tue Sep 1 02:39:07 2015 (r287341) @@ -58,8 +58,7 @@ static char partab[128] = { * Add odd parity to low bit of 8 byte key */ void -des_setparity(p) - char *p; +des_setparity(char *p) { int i; Modified: head/lib/libc/rpc/getpublickey.c ============================================================================== --- head/lib/libc/rpc/getpublickey.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/getpublickey.c Tue Sep 1 02:39:07 2015 (r287341) @@ -62,9 +62,7 @@ int (*__getpublickey_LOCAL)() = 0; * Get somebody's public key */ static int -__getpublickey_real(netname, publickey) - const char *netname; - char *publickey; +__getpublickey_real(const char *netname, char *publickey) { char lookup[3 * HEXKEYBYTES]; char *p; @@ -89,9 +87,7 @@ __getpublickey_real(netname, publickey) */ int -getpublicandprivatekey(key, ret) - const char *key; - char *ret; +getpublicandprivatekey(const char *key, char *ret) { char buf[1024]; /* big enough */ char *res; @@ -166,9 +162,7 @@ getpublicandprivatekey(key, ret) } } -int getpublickey(netname, publickey) - const char *netname; - char *publickey; +int getpublickey(const char *netname, char *publickey) { if (__getpublickey_LOCAL != NULL) return(__getpublickey_LOCAL(netname, publickey)); Modified: head/lib/libc/rpc/key_call.c ============================================================================== --- head/lib/libc/rpc/key_call.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/key_call.c Tue Sep 1 02:39:07 2015 (r287341) @@ -88,8 +88,7 @@ des_block *(*__key_gendes_LOCAL)() = 0; static int key_call( u_long, xdrproc_t, void *, xdrproc_t, void *); int -key_setsecret(secretkey) - const char *secretkey; +key_setsecret(const char *secretkey) { keystatus status; @@ -131,10 +130,7 @@ key_secretkey_is_set(void) } int -key_encryptsession_pk(remotename, remotekey, deskey) - char *remotename; - netobj *remotekey; - des_block *deskey; +key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) { cryptkeyarg2 arg; cryptkeyres res; @@ -155,10 +151,7 @@ key_encryptsession_pk(remotename, remote } int -key_decryptsession_pk(remotename, remotekey, deskey) - char *remotename; - netobj *remotekey; - des_block *deskey; +key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) { cryptkeyarg2 arg; cryptkeyres res; @@ -179,9 +172,7 @@ key_decryptsession_pk(remotename, remote } int -key_encryptsession(remotename, deskey) - const char *remotename; - des_block *deskey; +key_encryptsession(const char *remotename, des_block *deskey) { cryptkeyarg arg; cryptkeyres res; @@ -201,9 +192,7 @@ key_encryptsession(remotename, deskey) } int -key_decryptsession(remotename, deskey) - const char *remotename; - des_block *deskey; +key_decryptsession(const char *remotename, des_block *deskey) { cryptkeyarg arg; cryptkeyres res; @@ -223,8 +212,7 @@ key_decryptsession(remotename, deskey) } int -key_gendes(key) - des_block *key; +key_gendes(des_block *key) { if (!key_call((u_long)KEY_GEN, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_des_block, key)) { @@ -234,8 +222,7 @@ key_gendes(key) } int -key_setnet(arg) -struct key_netstarg *arg; +key_setnet(struct key_netstarg *arg) { keystatus status; @@ -254,9 +241,7 @@ struct key_netstarg *arg; int -key_get_conv(pkey, deskey) - char *pkey; - des_block *deskey; +key_get_conv(char *pkey, des_block *deskey) { cryptkeyres res; @@ -305,8 +290,7 @@ key_call_init(void) * Keep the handle cached. This call may be made quite often. */ static CLIENT * -getkeyserv_handle(vers) -int vers; +getkeyserv_handle(int vers) { void *localhandle; struct netconfig *nconf; @@ -429,12 +413,8 @@ int vers; /* returns 0 on failure, 1 on success */ static int -key_call(proc, xdr_arg, arg, xdr_rslt, rslt) - u_long proc; - xdrproc_t xdr_arg; - void *arg; - xdrproc_t xdr_rslt; - void *rslt; +key_call(u_long proc, xdrproc_t xdr_arg, void *arg, xdrproc_t xdr_rslt, + void *rslt) { CLIENT *clnt; struct timeval wait_time; Modified: head/lib/libc/rpc/rpc_soc.c ============================================================================== --- head/lib/libc/rpc/rpc_soc.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/rpc_soc.c Tue Sep 1 02:39:07 2015 (r287341) @@ -88,14 +88,8 @@ static bool_t rpc_wrap_bcast(char *, str * A common clnt create routine */ static CLIENT * -clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp) - struct sockaddr_in *raddr; - rpcprog_t prog; - rpcvers_t vers; - int *sockp; - u_int sendsz; - u_int recvsz; - char *tp; +clnt_com_create(struct sockaddr_in *raddr, rpcprog_t prog, rpcvers_t vers, int *sockp, + u_int sendsz, u_int recvsz, char *tp) { CLIENT *cl; int madefd = FALSE; @@ -164,14 +158,8 @@ err: if (madefd == TRUE) } CLIENT * -clntudp_bufcreate(raddr, prog, vers, wait, sockp, sendsz, recvsz) - struct sockaddr_in *raddr; - u_long prog; - u_long vers; - struct timeval wait; - int *sockp; - u_int sendsz; - u_int recvsz; +clntudp_bufcreate(struct sockaddr_in *raddr, u_long prog, u_long vers, + struct timeval wait, int *sockp, u_int sendsz, u_int recvsz) { CLIENT *cl; @@ -185,12 +173,8 @@ clntudp_bufcreate(raddr, prog, vers, wai } CLIENT * -clntudp_create(raddr, program, version, wait, sockp) - struct sockaddr_in *raddr; - u_long program; - u_long version; - struct timeval wait; - int *sockp; +clntudp_create(struct sockaddr_in *raddr, u_long program, u_long version, + struct timeval wait, int *sockp) { return clntudp_bufcreate(raddr, program, version, wait, sockp, @@ -198,13 +182,8 @@ clntudp_create(raddr, program, version, } CLIENT * -clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) - struct sockaddr_in *raddr; - u_long prog; - u_long vers; - int *sockp; - u_int sendsz; - u_int recvsz; +clnttcp_create(struct sockaddr_in *raddr, u_long prog, u_long vers, int *sockp, + u_int sendsz, u_int recvsz) { return clnt_com_create(raddr, (rpcprog_t)prog, (rpcvers_t)vers, sockp, @@ -212,9 +191,7 @@ clnttcp_create(raddr, prog, vers, sockp, } CLIENT * -clntraw_create(prog, vers) - u_long prog; - u_long vers; +clntraw_create(u_long prog, u_long vers) { return clnt_raw_create((rpcprog_t)prog, (rpcvers_t)vers); @@ -224,11 +201,7 @@ clntraw_create(prog, vers) * A common server create routine */ static SVCXPRT * -svc_com_create(fd, sendsize, recvsize, netid) - int fd; - u_int sendsize; - u_int recvsize; - char *netid; +svc_com_create(int fd, u_int sendsize, u_int recvsize, char *netid) { struct netconfig *nconf; SVCXPRT *svc; @@ -268,29 +241,21 @@ svc_com_create(fd, sendsize, recvsize, n } SVCXPRT * -svctcp_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svctcp_create(int fd, u_int sendsize, u_int recvsize) { return svc_com_create(fd, sendsize, recvsize, "tcp"); } SVCXPRT * -svcudp_bufcreate(fd, sendsz, recvsz) - int fd; - u_int sendsz, recvsz; +svcudp_bufcreate(int fd, u_int sendsz, u_int recvsz) { return svc_com_create(fd, sendsz, recvsz, "udp"); } SVCXPRT * -svcfd_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svcfd_create(int fd, u_int sendsize, u_int recvsize) { return svc_fd_create(fd, sendsize, recvsize); @@ -298,8 +263,7 @@ svcfd_create(fd, sendsize, recvsize) SVCXPRT * -svcudp_create(fd) - int fd; +svcudp_create(int fd) { return svc_com_create(fd, UDPMSGSIZE, UDPMSGSIZE, "udp"); @@ -313,8 +277,7 @@ svcraw_create() } int -get_myaddress(addr) - struct sockaddr_in *addr; +get_myaddress(struct sockaddr_in *addr) { memset((void *) addr, 0, sizeof(*addr)); @@ -328,11 +291,8 @@ get_myaddress(addr) * For connectionless "udp" transport. Obsoleted by rpc_call(). */ int -callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) - const char *host; - int prognum, versnum, procnum; - xdrproc_t inproc, outproc; - void *in, *out; +callrpc(const char *host, int prognum, int versnum, int procnum, + xdrproc_t inproc, void *in, xdrproc_t outproc, void *out) { return (int)rpc_call(host, (rpcprog_t)prognum, (rpcvers_t)versnum, @@ -343,10 +303,9 @@ callrpc(host, prognum, versnum, procnum, * For connectionless kind of transport. Obsoleted by rpc_reg() */ int -registerrpc(prognum, versnum, procnum, progname, inproc, outproc) - int prognum, versnum, procnum; - char *(*progname)(char [UDPMSGSIZE]); - xdrproc_t inproc, outproc; +registerrpc(int prognum, int versnum, int procnum, + char *(*progname)(char [UDPMSGSIZE]), + xdrproc_t inproc, xdrproc_t outproc) { return rpc_reg((rpcprog_t)prognum, (rpcvers_t)versnum, @@ -374,10 +333,12 @@ clnt_broadcast_key_init(void) */ /* ARGSUSED */ static bool_t -rpc_wrap_bcast(resultp, addr, nconf) - char *resultp; /* results of the call */ - struct netbuf *addr; /* address of the guy who responded */ - struct netconfig *nconf; /* Netconf of the transport */ +rpc_wrap_bcast(char *resultp, struct netbuf *addr, struct netconfig *nconf) +/* + * char *resultp; // results of the call + * struct netbuf *addr; // address of the guy who responded + * struct netconfig *nconf; // Netconf of the transport + */ { resultproc_t clnt_broadcast_result; @@ -395,15 +356,18 @@ rpc_wrap_bcast(resultp, addr, nconf) * Broadcasts on UDP transport. Obsoleted by rpc_broadcast(). */ enum clnt_stat -clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) - u_long prog; /* program number */ - u_long vers; /* version number */ - u_long proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - void *argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - void *resultsp; /* pointer to results */ - resultproc_t eachresult; /* call with each result obtained */ +clnt_broadcast(u_long prog, u_long vers, u_long proc, xdrproc_t xargs, + void *argsp, xdrproc_t xresults, void *resultsp, resultproc_t eachresult) +/* + * u_long prog; // program number + * u_long vers; // version number + * u_long proc; // procedure number + * xdrproc_t xargs; // xdr routine for args + * void *argsp; // pointer to args + * xdrproc_t xresults; // xdr routine for results + * void *resultsp; // pointer to results + * resultproc_t eachresult; // call with each result obtained + */ { if (thr_main()) @@ -422,11 +386,14 @@ clnt_broadcast(prog, vers, proc, xargs, * authdes_seccreate(). */ AUTH * -authdes_create(servername, window, syncaddr, ckey) - char *servername; /* network name of server */ - u_int window; /* time to live */ - struct sockaddr *syncaddr; /* optional hostaddr to sync with */ - des_block *ckey; /* optional conversation key to use */ +authdes_create(char *servername, u_int window, struct sockaddr *syncaddr, + des_block *ckey) +/* + * char *servername; // network name of server + * u_int window; // time to live + * struct sockaddr *syncaddr; // optional hostaddr to sync with + * des_block *ckey; // optional conversation key to use + */ { AUTH *dummy; AUTH *nauth; @@ -453,13 +420,8 @@ fallback: * Create a client handle for a unix connection. Obsoleted by clnt_vc_create() */ CLIENT * -clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - struct sockaddr_un *raddr; - u_long prog; - u_long vers; - int *sockp; - u_int sendsz; - u_int recvsz; +clntunix_create(struct sockaddr_un *raddr, u_long prog, u_long vers, int *sockp, + u_int sendsz, u_int recvsz) { struct netbuf *svcaddr; CLIENT *cl; @@ -504,11 +466,7 @@ done: * Obsoleted by svc_vc_create(). */ SVCXPRT * -svcunix_create(sock, sendsize, recvsize, path) - int sock; - u_int sendsize; - u_int recvsize; - char *path; +svcunix_create(int sock, u_int sendsize, u_int recvsize, char *path) { struct netconfig *nconf; void *localhandle; @@ -568,10 +526,7 @@ done: * descriptor as its first input. Obsoleted by svc_fd_create(); */ SVCXPRT * -svcunixfd_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svcunixfd_create(int fd, u_int sendsize, u_int recvsize) { return (svc_fd_create(fd, sendsize, recvsize)); } Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/rpcb_clnt.c Tue Sep 1 02:39:07 2015 (r287341) @@ -109,9 +109,7 @@ static struct netbuf *got_entry(rpcb_ent * These are private routines that may not be provided in future releases. */ bool_t -__rpc_control(request, info) - int request; - void *info; +__rpc_control(int request, void *info) { switch (request) { case CLCR_GET_RPCB_TIMEOUT: @@ -150,8 +148,7 @@ __rpc_control(request, info) */ static struct address_cache * -check_cache(host, netid) - const char *host, *netid; +check_cache(const char *host, const char *netid) { struct address_cache *cptr; @@ -171,8 +168,7 @@ check_cache(host, netid) } static void -delete_cache(addr) - struct netbuf *addr; +delete_cache(struct netbuf *addr) { struct address_cache *cptr, *prevptr = NULL; @@ -286,10 +282,7 @@ out: * On error, returns NULL and free's everything. */ static CLIENT * -getclnthandle(host, nconf, targaddr) - const char *host; - const struct netconfig *nconf; - char **targaddr; +getclnthandle(const char *host, const struct netconfig *nconf, char **targaddr) { CLIENT *client; struct netbuf *addr, taddr; @@ -531,13 +524,13 @@ try_nconf: /* * Set a mapping between program, version and address. * Calls the rpcbind service to do the mapping. + * + * nconf - Network structure of transport + * address - Services netconfig address */ bool_t -rpcb_set(program, version, nconf, address) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; /* Network structure of transport */ - const struct netbuf *address; /* Services netconfig address */ +rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, + const struct netbuf *address) { CLIENT *client; bool_t rslt = FALSE; @@ -594,10 +587,7 @@ rpcb_set(program, version, nconf, addres * only for the given transport. */ bool_t -rpcb_unset(program, version, nconf) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; +rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf) { CLIENT *client; bool_t rslt = FALSE; @@ -634,9 +624,7 @@ rpcb_unset(program, version, nconf) * From the merged list, find the appropriate entry */ static struct netbuf * -got_entry(relp, nconf) - rpcb_entry_list_ptr relp; - const struct netconfig *nconf; +got_entry(rpcb_entry_list_ptr relp, const struct netconfig *nconf) { struct netbuf *na = NULL; rpcb_entry_list_ptr sp; @@ -722,13 +710,9 @@ __rpcbind_is_up() * starts working properly. Also look under clnt_vc.c. */ struct netbuf * -__rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; - const char *host; - CLIENT **clpp; - struct timeval *tp; +__rpcb_findaddr_timed(rpcprog_t program, rpcvers_t version, + const struct netconfig *nconf, const char *host, + CLIENT **clpp, struct timeval *tp) { static bool_t check_rpcbind = TRUE; CLIENT *client = NULL; @@ -1037,12 +1021,8 @@ done: * Assuming that the address is all properly allocated */ int -rpcb_getaddr(program, version, nconf, address, host) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; - struct netbuf *address; - const char *host; +rpcb_getaddr(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, + struct netbuf *address, const char *host) { struct netbuf *na; @@ -1073,9 +1053,7 @@ rpcb_getaddr(program, version, nconf, ad * It returns NULL on failure. */ rpcblist * -rpcb_getmaps(nconf, host) - const struct netconfig *nconf; - const char *host; +rpcb_getmaps(const struct netconfig *nconf, const char *host) { rpcblist_ptr head = NULL; CLIENT *client; @@ -1206,9 +1184,7 @@ error: * Returns 1 if succeeds else 0. */ bool_t -rpcb_gettime(host, timep) - const char *host; - time_t *timep; +rpcb_gettime(const char *host, time_t *timep) { CLIENT *client = NULL; void *handle; @@ -1267,9 +1243,7 @@ rpcb_gettime(host, timep) * really be called because local n2a libraries are always provided. */ char * -rpcb_taddr2uaddr(nconf, taddr) - struct netconfig *nconf; - struct netbuf *taddr; +rpcb_taddr2uaddr(struct netconfig *nconf, struct netbuf *taddr) { CLIENT *client; char *uaddr = NULL; @@ -1301,9 +1275,7 @@ rpcb_taddr2uaddr(nconf, taddr) * really be called because local n2a libraries are always provided. */ struct netbuf * -rpcb_uaddr2taddr(nconf, uaddr) - struct netconfig *nconf; - char *uaddr; +rpcb_uaddr2taddr(struct netconfig *nconf, char *uaddr) { CLIENT *client; struct netbuf *taddr; Modified: head/lib/libc/rpc/rpcdname.c ============================================================================== --- head/lib/libc/rpc/rpcdname.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/rpcdname.c Tue Sep 1 02:39:07 2015 (r287341) @@ -71,8 +71,7 @@ get_default_domain() * get rejected elsewhere in the NIS client package. */ int -__rpc_get_default_domain(domain) - char **domain; +__rpc_get_default_domain(char **domain) { if ((*domain = get_default_domain()) != 0) return (0); Modified: head/lib/libc/rpc/rtime.c ============================================================================== --- head/lib/libc/rpc/rtime.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/rtime.c Tue Sep 1 02:39:07 2015 (r287341) @@ -67,10 +67,8 @@ extern int _rpc_dtablesize( void ); static void do_close( int ); int -rtime(addrp, timep, timeout) - struct sockaddr_in *addrp; - struct timeval *timep; - struct timeval *timeout; +rtime(struct sockaddr_in *addrp, struct timeval *timep, + struct timeval *timeout) { int s; fd_set readfds; @@ -148,8 +146,7 @@ rtime(addrp, timep, timeout) } static void -do_close(s) - int s; +do_close(int s) { int save; Modified: head/lib/libc/rpc/svc_auth.c ============================================================================== --- head/lib/libc/rpc/svc_auth.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/svc_auth.c Tue Sep 1 02:39:07 2015 (r287341) @@ -151,11 +151,7 @@ _authenticate(rqst, msg) * that don't need to inspect or modify the message body. */ static bool_t -svcauth_null_wrap(auth, xdrs, xdr_func, xdr_ptr) - SVCAUTH *auth; - XDR *xdrs; - xdrproc_t xdr_func; - caddr_t xdr_ptr; +svcauth_null_wrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) { return (xdr_func(xdrs, xdr_ptr)); @@ -168,9 +164,7 @@ struct svc_auth_ops svc_auth_null_ops = /*ARGSUSED*/ enum auth_stat -_svcauth_null(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +_svcauth_null(struct svc_req *rqst, struct rpc_msg *msg) { return (AUTH_OK); } @@ -190,9 +184,8 @@ _svcauth_null(rqst, msg) */ int -svc_auth_reg(cred_flavor, handler) - int cred_flavor; - enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *); +svc_auth_reg(int cred_flavor, + enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *)) { struct authsvc *asp; Modified: head/lib/libc/rpc/svc_auth_des.c ============================================================================== --- head/lib/libc/rpc/svc_auth_des.c Tue Sep 1 01:35:43 2015 (r287340) +++ head/lib/libc/rpc/svc_auth_des.c Tue Sep 1 02:39:07 2015 (r287341) @@ -92,7 +92,7 @@ static short *authdes_lru/* [AUTHDES_CAC static void cache_init(); /* initialize the cache */ static short cache_spot(); /* find an entry in the cache */ -static void cache_ref(/*short sid*/); /* note that sid was ref'd */ +static void cache_ref(short sid); /* note that sid was ref'd */ static void invalidate(); /* invalidate entry in cache */ @@ -109,9 +109,7 @@ static struct { * Service side authenticator for AUTH_DES */ enum auth_stat -_svcauth_des(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +_svcauth_des(struct svc_req *rqst, struct rpc_msg *msg) { long *ixdr; @@ -387,8 +385,7 @@ cache_victim() * Note that sid was referenced */ static void -cache_ref(sid) - short sid; +cache_ref(short sid) { int i; short curr; @@ -410,10 +407,7 @@ cache_ref(sid) * return the spot in the cache. */ static short -cache_spot(key, name, timestamp) - des_block *key; - char *name; - struct timeval *timestamp; +cache_spot(des_block *key, char *name, struct timeval *timestamp) { struct cache_entry *cp; int i; @@ -461,12 +455,8 @@ struct bsdcred { * the credential. */ int -authdes_getucred(adc, uid, gid, grouplen, groups) - struct authdes_cred *adc; - uid_t *uid; - gid_t *gid; - int *grouplen; - gid_t *groups; +authdes_getucred(struct authdes_cred *adc, uid_t *uid, gid_t *gid, + int *grouplen, gid_t *groups) { unsigned sid; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 1 02:42:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C79899C74C1; Tue, 1 Sep 2015 02:42:06 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B50D510C2; Tue, 1 Sep 2015 02:42:06 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t812g6eC036755; Tue, 1 Sep 2015 02:42:06 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t812g6aI036754; Tue, 1 Sep 2015 02:42:06 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509010242.t812g6aI036754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 1 Sep 2015 02:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287342 - head/lib/libc/rpc 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, 01 Sep 2015 02:42:06 -0000 Author: rodrigc Date: Tue Sep 1 02:42:05 2015 New Revision: 287342 URL: https://svnweb.freebsd.org/changeset/base/287342 Log: Mark unused parameters to reduce gcc 4.9 warnings. Modified: head/lib/libc/rpc/auth_des.c Modified: head/lib/libc/rpc/auth_des.c ============================================================================== --- head/lib/libc/rpc/auth_des.c Tue Sep 1 02:39:07 2015 (r287341) +++ head/lib/libc/rpc/auth_des.c Tue Sep 1 02:42:05 2015 (r287342) @@ -259,7 +259,7 @@ failed: */ /*ARGSUSED*/ static void -authdes_nextverf(AUTH *auth) +authdes_nextverf(AUTH *auth __unused) { /* what the heck am I supposed to do??? */ } @@ -420,7 +420,7 @@ authdes_validate(AUTH *auth, struct opaq */ /*ARGSUSED*/ static bool_t -authdes_refresh(AUTH *auth, void *dummy) +authdes_refresh(AUTH *auth, void *dummy __unused) { /* LINTED pointer alignment */ struct ad_private *ad = AUTH_PRIVATE(auth); From owner-svn-src-all@freebsd.org Tue Sep 1 06:05:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9F959C8B5B; Tue, 1 Sep 2015 06:05:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 DB31D15B8; Tue, 1 Sep 2015 06:05:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8165hpT026964; Tue, 1 Sep 2015 06:05:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8165hjD026963; Tue, 1 Sep 2015 06:05:43 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509010605.t8165hjD026963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Sep 2015 06:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287343 - head/usr.bin/netstat 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, 01 Sep 2015 06:05:44 -0000 Author: delphij Date: Tue Sep 1 06:05:43 2015 New Revision: 287343 URL: https://svnweb.freebsd.org/changeset/base/287343 Log: Failure of dropping privilege should be fatal, so test and bail out when setgid() fails. Reported by: clang static analyzer MFC after: 2 weeks Modified: head/usr.bin/netstat/main.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Sep 1 02:42:05 2015 (r287342) +++ head/usr.bin/netstat/main.c Tue Sep 1 06:05:43 2015 (r287343) @@ -498,8 +498,10 @@ main(int argc, char *argv[]) * guys can't print interesting stuff from kernel memory. */ live = (nlistf == NULL && memf == NULL); - if (!live) - setgid(getgid()); + if (!live) { + if (setgid(getgid()) != 0) + xo_err(-1, "setgid"); + } if (xflag && Tflag) xo_errx(1, "-x and -T are incompatible, pick one."); @@ -704,7 +706,8 @@ kvmd_init(void) return (0); kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - setgid(getgid()); + if (setgid(getgid()) != 0) + xo_err(-1, "setgid"); if (kvmd == NULL) { xo_warnx("kvm not available: %s", errbuf); From owner-svn-src-all@freebsd.org Tue Sep 1 06:21:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F2C79C6A0C; Tue, 1 Sep 2015 06:21:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1158D1E1E; Tue, 1 Sep 2015 06:21:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t816LCW3034926; Tue, 1 Sep 2015 06:21:12 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t816LCZ4034925; Tue, 1 Sep 2015 06:21:12 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201509010621.t816LCZ4034925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 1 Sep 2015 06:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287344 - 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.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, 01 Sep 2015 06:21:13 -0000 Author: alc Date: Tue Sep 1 06:21:12 2015 New Revision: 287344 URL: https://svnweb.freebsd.org/changeset/base/287344 Log: Handle held pages earlier in the inactive queue scan. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Sep 1 06:05:43 2015 (r287343) +++ head/sys/vm/vm_pageout.c Tue Sep 1 06:21:12 2015 (r287344) @@ -1125,31 +1125,45 @@ vm_pageout_scan(struct vm_domain *vmd, i * different position within the queue. In either * case, addl_page_shortage should not be incremented. */ - if (!vm_pageout_page_lock(m, &next)) { - vm_page_unlock(m); - continue; + if (!vm_pageout_page_lock(m, &next)) + goto unlock_page; + else if (m->hold_count != 0) { + /* + * Held pages are essentially stuck in the + * queue. So, they ought to be discounted + * from the inactive count. See the + * calculation of the page_shortage for the + * loop over the active queue below. + */ + addl_page_shortage++; + goto unlock_page; } object = m->object; - if (!VM_OBJECT_TRYWLOCK(object) && - !vm_pageout_fallback_object_lock(m, &next)) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); - continue; + if (!VM_OBJECT_TRYWLOCK(object)) { + if (!vm_pageout_fallback_object_lock(m, &next)) + goto unlock_object; + else if (m->hold_count != 0) { + addl_page_shortage++; + goto unlock_object; + } } - - /* - * Don't mess with busy pages, keep them at at the - * front of the queue, most likely they are being - * paged out. Increment addl_page_shortage for busy - * pages, because they may leave the inactive queue - * shortly after page scan is finished. - */ if (vm_page_busied(m)) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); + /* + * Don't mess with busy pages. Leave them at + * the front of the queue. Most likely, they + * are being paged out and will leave the + * queue shortly after the scan finishes. So, + * they ought to be discounted from the + * inactive count. + */ addl_page_shortage++; +unlock_object: + VM_OBJECT_WUNLOCK(object); +unlock_page: + vm_page_unlock(m); continue; } + KASSERT(m->hold_count == 0, ("Held page %p", m)); /* * We unlock the inactive page queue, invalidating the @@ -1164,7 +1178,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * Invalid pages can be easily freed. They cannot be * mapped, vm_page_free() asserts this. */ - if (m->valid == 0 && m->hold_count == 0) { + if (m->valid == 0) { vm_page_free(m); PCPU_INC(cnt.v_dfree); --page_shortage; @@ -1208,18 +1222,6 @@ vm_pageout_scan(struct vm_domain *vmd, i goto drop_page; } - if (m->hold_count != 0) { - /* - * Held pages are essentially stuck in the - * queue. So, they ought to be discounted - * from the inactive count. See the - * calculation of the page_shortage for the - * loop over the active queue below. - */ - addl_page_shortage++; - goto drop_page; - } - /* * If the page appears to be clean at the machine-independent * layer, then remove all of its mappings from the pmap in From owner-svn-src-all@freebsd.org Tue Sep 1 06:36:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B78949C8570; Tue, 1 Sep 2015 06:36:17 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6406B1B; Tue, 1 Sep 2015 06:36:17 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id 8FDAFC8F49; Mon, 31 Aug 2015 23:36:16 -0700 (PDT) Date: Mon, 31 Aug 2015 23:36:16 -0700 From: hiren panchasara To: Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287344 - head/sys/vm Message-ID: <20150901063616.GA68814@strugglingcoder.info> References: <201509010621.t816LCZ4034925@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <201509010621.t816LCZ4034925@repo.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: Tue, 01 Sep 2015 06:36:17 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alan, On 09/01/15 at 06:21P, Alan Cox wrote: > Author: alc > Date: Tue Sep 1 06:21:12 2015 > New Revision: 287344 > URL: https://svnweb.freebsd.org/changeset/base/287344 >=20 > Log: > Handle held pages earlier in the inactive queue scan. > Is this fixing a bug or is it just an enhancement? Can you share more details on what prompted this commit? Cheers, Hiren --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJV5UdgXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lx+IH/0EFzgC6AUSbB42EpYFKFTdh D4vRfKqxmYeVC/VOEBmoMqTkANNmh29r4JzwZA5K3Y3IqRv0qrxAYll0OiVOkOxx GlTiW3eKSVyl0LPD1+LcFjMrjfFBywq7PcSi7r2dasIwcAcrdT4Pt1zsRnykjYYJ 8lyJBnUtriKmCI2e7tsYTj5mtCpiuFCE58X6GrhjJ+oxHjw01X8KRnu+5q0o+2WF czhVuO0xS4DUOB//Cn8R4TSNrsjU+a+eqId9mgWk2ABP6ycwp1y3kT2gZ0FOJAV/ 5ndIPfwQuzR+INAOSxq+R/n13KLlp5L4icp5Xv0vSWeKO28gxwRKmZfcCwFTeWg= =TZ5r -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm-- From owner-svn-src-all@freebsd.org Tue Sep 1 06:28:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D22A9C753A; Tue, 1 Sep 2015 06:28:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 F263E1F3; Tue, 1 Sep 2015 06:28:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t816SGcB035262; Tue, 1 Sep 2015 06:28:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t816SGQi035261; Tue, 1 Sep 2015 06:28:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509010628.t816SGQi035261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Sep 2015 06:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287345 - head/usr.bin/bluetooth/btsockstat 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, 01 Sep 2015 06:28:17 -0000 Author: delphij Date: Tue Sep 1 06:28:16 2015 New Revision: 287345 URL: https://svnweb.freebsd.org/changeset/base/287345 Log: Drop group privileges after opening the kvm descriptor, otherwise, the code would not drop privileges as expected. While there also add checks for the drop and bail out immediately if we failed. MFC after: 3 days Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c ============================================================================== --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Tue Sep 1 06:21:12 2015 (r287344) +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Tue Sep 1 06:28:16 2015 (r287345) @@ -154,9 +154,9 @@ main(int argc, char *argv[]) * Discard setgid privileges if not the running kernel so that * bad guys can't print interesting stuff from kernel memory. */ - if (memf != NULL) - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); kvmd = kopen(memf); if (kvmd == NULL) @@ -583,15 +583,9 @@ kopen(char const *memf) kvm_t *kvmd = NULL; char errbuf[_POSIX2_LINE_MAX]; - /* - * Discard setgid privileges if not the running kernel so that - * bad guys can't print interesting stuff from kernel memory. - */ - - if (memf != NULL) - setgid(getgid()); - kvmd = kvm_openfiles(NULL, memf, NULL, O_RDONLY, errbuf); + if (setgid(getgid()) != 0) + err(1, "setgid"); if (kvmd == NULL) { warnx("kvm_openfiles: %s", errbuf); return (NULL); From owner-svn-src-all@freebsd.org Tue Sep 1 06:32:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F949C7ED1; Tue, 1 Sep 2015 06:32:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 63357991; Tue, 1 Sep 2015 06:32:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t816W38B039083; Tue, 1 Sep 2015 06:32:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t816W3PK039082; Tue, 1 Sep 2015 06:32:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509010632.t816W3PK039082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Sep 2015 06:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287346 - head/usr.sbin/trpt 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, 01 Sep 2015 06:32:03 -0000 Author: delphij Date: Tue Sep 1 06:32:02 2015 New Revision: 287346 URL: https://svnweb.freebsd.org/changeset/base/287346 Log: Check and fail if drop of privileges failed. MFC after: 2 weeks Modified: head/usr.sbin/trpt/trpt.c Modified: head/usr.sbin/trpt/trpt.c ============================================================================== --- head/usr.sbin/trpt/trpt.c Tue Sep 1 06:28:16 2015 (r287345) +++ head/usr.sbin/trpt/trpt.c Tue Sep 1 06:32:02 2015 (r287346) @@ -148,7 +148,8 @@ main(int argc, char **argv) * Discard setgid privileges if not the running kernel so that * bad guys can't print interesting stuff from kernel memory. */ - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); } else syst = getbootfile(); @@ -157,7 +158,8 @@ main(int argc, char **argv) errx(1, "%s: no namelist", syst); if ((memf = open(core, O_RDONLY)) < 0) err(2, "%s", core); - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); if (kflag) errx(1, "can't do core files yet"); (void)klseek(memf, (off_t)nl[N_TCP_DEBX].n_value, L_SET); From owner-svn-src-all@freebsd.org Tue Sep 1 07:32:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E9569C8681; Tue, 1 Sep 2015 07:32:04 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4302DE84; Tue, 1 Sep 2015 07:32:04 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t817W4tm063811; Tue, 1 Sep 2015 07:32:04 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t817W4OH063810; Tue, 1 Sep 2015 07:32:04 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509010732.t817W4OH063810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 1 Sep 2015 07:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287347 - head/lib/libc/rpc 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, 01 Sep 2015 07:32:04 -0000 Author: rodrigc Date: Tue Sep 1 07:32:03 2015 New Revision: 287347 URL: https://svnweb.freebsd.org/changeset/base/287347 Log: Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: head/lib/libc/rpc/rpc_prot.c Modified: head/lib/libc/rpc/rpc_prot.c ============================================================================== --- head/lib/libc/rpc/rpc_prot.c Tue Sep 1 06:32:02 2015 (r287346) +++ head/lib/libc/rpc/rpc_prot.c Tue Sep 1 07:32:03 2015 (r287347) @@ -68,9 +68,7 @@ extern struct opaque_auth _null_auth; * (see auth.h) */ bool_t -xdr_opaque_auth(xdrs, ap) - XDR *xdrs; - struct opaque_auth *ap; +xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) { assert(xdrs != NULL); @@ -86,9 +84,7 @@ xdr_opaque_auth(xdrs, ap) * XDR a DES block */ bool_t -xdr_des_block(xdrs, blkp) - XDR *xdrs; - des_block *blkp; +xdr_des_block(XDR *xdrs, des_block *blkp) { assert(xdrs != NULL); @@ -103,9 +99,7 @@ xdr_des_block(xdrs, blkp) * XDR the MSG_ACCEPTED part of a reply message union */ bool_t -xdr_accepted_reply(xdrs, ar) - XDR *xdrs; - struct accepted_reply *ar; +xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) { enum accept_stat *par_stat; @@ -142,9 +136,7 @@ xdr_accepted_reply(xdrs, ar) * XDR the MSG_DENIED part of a reply message union */ bool_t -xdr_rejected_reply(xdrs, rr) - XDR *xdrs; - struct rejected_reply *rr; +xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) { enum reject_stat *prj_stat; enum auth_stat *prj_why; @@ -182,9 +174,7 @@ static const struct xdr_discrim reply_ds * XDR a reply message */ bool_t -xdr_replymsg(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; +xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) { enum msg_type *prm_direction; enum reply_stat *prp_stat; @@ -212,9 +202,7 @@ xdr_replymsg(xdrs, rmsg) * The rm_xid is not really static, but the user can easily munge on the fly. */ bool_t -xdr_callhdr(xdrs, cmsg) - XDR *xdrs; - struct rpc_msg *cmsg; +xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) { enum msg_type *prm_direction; @@ -238,9 +226,7 @@ xdr_callhdr(xdrs, cmsg) /* ************************** Client utility routine ************* */ static void -accepted(acpt_stat, error) - enum accept_stat acpt_stat; - struct rpc_err *error; +accepted(enum accept_stat acpt_stat, struct rpc_err *error) { assert(error != NULL); From owner-svn-src-all@freebsd.org Tue Sep 1 07:33:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D00369C87C8; Tue, 1 Sep 2015 07:33:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C12ADFF8; Tue, 1 Sep 2015 07:33:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t817XbwB063937; Tue, 1 Sep 2015 07:33:37 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t817Xbfo063936; Tue, 1 Sep 2015 07:33:37 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509010733.t817Xbfo063936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 1 Sep 2015 07:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287348 - head/lib/libc/rpc 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, 01 Sep 2015 07:33:37 -0000 Author: rodrigc Date: Tue Sep 1 07:33:36 2015 New Revision: 287348 URL: https://svnweb.freebsd.org/changeset/base/287348 Log: Use correct function prototype for signal handler. Eliminates gcc 4.9 warning. Modified: head/lib/libc/rpc/auth_time.c Modified: head/lib/libc/rpc/auth_time.c ============================================================================== --- head/lib/libc/rpc/auth_time.c Tue Sep 1 07:32:03 2015 (r287347) +++ head/lib/libc/rpc/auth_time.c Tue Sep 1 07:33:36 2015 (r287348) @@ -255,7 +255,7 @@ __rpc_get_time_offset(struct timeval *td char ut[64], ipuaddr[64]; endpoint teps[32]; nis_server tsrv; - void (*oldsig)() = NULL; /* old alarm handler */ + void (*oldsig)(int) = NULL; /* old alarm handler */ struct sockaddr_in sin; socklen_t len; int s = RPC_ANYSOCK; @@ -424,7 +424,7 @@ __rpc_get_time_offset(struct timeval *td } else { int res; - oldsig = (void (*)())signal(SIGALRM, alarm_hndler); + oldsig = (void (*)(int))signal(SIGALRM, alarm_hndler); saw_alarm = 0; /* global tracking the alarm */ alarm(20); /* only wait 20 seconds */ res = _connect(s, (struct sockaddr *)&sin, sizeof(sin)); From owner-svn-src-all@freebsd.org Tue Sep 1 08:29:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6FBC9C7F23; Tue, 1 Sep 2015 08:29:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D8371AD8; Tue, 1 Sep 2015 08:29:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t818TdYR085189; Tue, 1 Sep 2015 08:29:39 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t818TdkY085188; Tue, 1 Sep 2015 08:29:39 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509010829.t818TdkY085188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Tue, 1 Sep 2015 08:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287349 - head/lib/libc/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, 01 Sep 2015 08:29:40 -0000 Author: hrs Date: Tue Sep 1 08:29:39 2015 New Revision: 287349 URL: https://svnweb.freebsd.org/changeset/base/287349 Log: Print sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does. MFC after: 1 week Modified: head/lib/libc/net/getnameinfo.c Modified: head/lib/libc/net/getnameinfo.c ============================================================================== --- head/lib/libc/net/getnameinfo.c Tue Sep 1 07:33:36 2015 (r287348) +++ head/lib/libc/net/getnameinfo.c Tue Sep 1 08:29:39 2015 (r287349) @@ -396,9 +396,24 @@ getnameinfo_link(const struct sockaddr * n = snprintf(host, hostlen, "link#%d", sdl->sdl_index); if (n > hostlen) { *host = '\0'; - return EAI_MEMORY; + return (EAI_MEMORY); } - return 0; + return (0); + } + + if (sdl->sdl_nlen > 0) { + if (sdl->sdl_nlen + 1 > hostlen) { + *host = '\0'; + return (EAI_MEMORY); + } + memcpy(host, sdl->sdl_data, sdl->sdl_nlen); + n = sdl->sdl_nlen; + host += n; + if (sdl->sdl_alen > 0) { + *host++ = ':'; + n++; + } + hostlen -= n; } switch (sdl->sdl_type) { @@ -440,10 +455,7 @@ getnameinfo_link(const struct sockaddr * } static int -hexname(cp, len, host, hostlen) - const u_int8_t *cp; - char *host; - size_t len, hostlen; +hexname(const u_int8_t *cp, size_t len, char *host, size_t hostlen) { int i, n; char *outp = host; From owner-svn-src-all@freebsd.org Tue Sep 1 08:34:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E2F9C629B; Tue, 1 Sep 2015 08:34:46 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E26A1F1B; Tue, 1 Sep 2015 08:34:46 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t818Ykv4089154; Tue, 1 Sep 2015 08:34:46 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t818YjCX089147; Tue, 1 Sep 2015 08:34:45 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509010834.t818YjCX089147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 1 Sep 2015 08:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287350 - head/lib/libc/rpc 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, 01 Sep 2015 08:34:47 -0000 Author: rodrigc Date: Tue Sep 1 08:34:44 2015 New Revision: 287350 URL: https://svnweb.freebsd.org/changeset/base/287350 Log: Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: head/lib/libc/rpc/auth_des.c head/lib/libc/rpc/auth_none.c head/lib/libc/rpc/rpcb_clnt.c head/lib/libc/rpc/rpcdname.c head/lib/libc/rpc/svc_auth_des.c Modified: head/lib/libc/rpc/auth_des.c ============================================================================== --- head/lib/libc/rpc/auth_des.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/auth_des.c Tue Sep 1 08:34:44 2015 (r287350) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *); extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *); -extern int key_encryptsession_pk(); +extern int key_encryptsession_pk(char *, netobj *, des_block *); extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *, char **, char **); Modified: head/lib/libc/rpc/auth_none.c ============================================================================== --- head/lib/libc/rpc/auth_none.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/auth_none.c Tue Sep 1 08:34:44 2015 (r287350) @@ -65,9 +65,9 @@ static bool_t authnone_validate (AUTH *, static bool_t authnone_refresh (AUTH *, void *); static void authnone_destroy (AUTH *); -extern bool_t xdr_opaque_auth(); +extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); -static struct auth_ops *authnone_ops(); +static struct auth_ops *authnone_ops(void); static struct authnone_private { AUTH no_client; @@ -76,7 +76,7 @@ static struct authnone_private { } *authnone_private; AUTH * -authnone_create() +authnone_create(void) { struct authnone_private *ap = authnone_private; XDR xdr_stream; @@ -156,7 +156,7 @@ authnone_destroy(AUTH *client) } static struct auth_ops * -authnone_ops() +authnone_ops(void) { static struct auth_ops ops; Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/rpcb_clnt.c Tue Sep 1 08:34:44 2015 (r287350) @@ -655,7 +655,7 @@ got_entry(rpcb_entry_list_ptr relp, cons * local transport. */ static bool_t -__rpcbind_is_up() +__rpcbind_is_up(void) { struct netconfig *nconf; struct sockaddr_un sun; Modified: head/lib/libc/rpc/rpcdname.c ============================================================================== --- head/lib/libc/rpc/rpcdname.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/rpcdname.c Tue Sep 1 08:34:44 2015 (r287350) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); static char *default_domain = 0; static char * -get_default_domain() +get_default_domain(void) { char temp[256]; Modified: head/lib/libc/rpc/svc_auth_des.c ============================================================================== --- head/lib/libc/rpc/svc_auth_des.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/svc_auth_des.c Tue Sep 1 08:34:44 2015 (r287350) @@ -90,11 +90,11 @@ struct cache_entry { static struct cache_entry *authdes_cache/* [AUTHDES_CACHESZ] */; static short *authdes_lru/* [AUTHDES_CACHESZ] */; -static void cache_init(); /* initialize the cache */ -static short cache_spot(); /* find an entry in the cache */ +static void cache_init(void); /* initialize the cache */ +static short cache_spot(des_block *, char *, struct timeval *); /* find an entry in the cache */ static void cache_ref(short sid); /* note that sid was ref'd */ -static void invalidate(); /* invalidate entry in cache */ +static void invalidate(char *); /* invalidate entry in cache */ /* * cache statistics @@ -353,7 +353,7 @@ _svcauth_des(struct svc_req *rqst, struc * Initialize the cache */ static void -cache_init() +cache_init(void) { int i; @@ -376,7 +376,7 @@ cache_init() * Find the lru victim */ static short -cache_victim() +cache_victim(void) { return (authdes_lru[AUTHDES_CACHESZ-1]); } From owner-svn-src-all@freebsd.org Tue Sep 1 08:42:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C079C6725; Tue, 1 Sep 2015 08:42:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E7AF2138D; Tue, 1 Sep 2015 08:42:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t818g7nf093263; Tue, 1 Sep 2015 08:42:07 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t818g50g093254; Tue, 1 Sep 2015 08:42:05 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509010842.t818g50g093254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Tue, 1 Sep 2015 08:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287351 - head/usr.bin/netstat 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, 01 Sep 2015 08:42:08 -0000 Author: hrs Date: Tue Sep 1 08:42:04 2015 New Revision: 287351 URL: https://svnweb.freebsd.org/changeset/base/287351 Log: - Add -W flag support for network column in intpr() (-i flag) and routepr() (-r flag). It is too narrow to show an IPv6 prefix in most cases. - Accept "local" as a synonym of "unix" in protocol family name. - Show a prefix length in CIDR notation when name resolution failed in netname(). - Make routename() and netname() AF-independent and remove unnecessary typecasting from struct sockaddr. - Use getnameinfo(3) to format L2 addr in intpr(). - Fix a bug which showed "Address" when -A flag is specfied in pr_rthdr(). - Replace cryptic GETSA() macro with SA_SIZE(). - Fix declarations shadowing local variables with the same names. - Add more static, remove unused header files and variables. MFC after: 1 week Modified: head/usr.bin/netstat/if.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mroute.c head/usr.bin/netstat/mroute6.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/if.c Tue Sep 1 08:42:04 2015 (r287351) @@ -75,11 +75,7 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" -static void sidewaysintpr(int); - -#ifdef INET6 -static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */ -#endif +static void sidewaysintpr(void); #ifdef PF static const char* pfsyncacts[] = { @@ -280,13 +276,13 @@ next_ifma(struct ifmaddrs *ifma, const c * Print a description of the network interfaces. */ void -intpr(int interval, void (*pfunc)(char *), int af) +intpr(void (*pfunc)(char *), int af) { struct ifaddrs *ifap, *ifa; struct ifmaddrs *ifmap, *ifma; if (interval) - return sidewaysintpr(interval); + return sidewaysintpr(); if (getifaddrs(&ifap) != 0) err(EX_OSERR, "getifaddrs"); @@ -366,63 +362,54 @@ intpr(int interval, void (*pfunc)(char * xo_emit("{:address/%-15.15s} ", "none"); break; case AF_INET: - { - struct sockaddr_in *sin, *mask; - - sin = (struct sockaddr_in *)ifa->ifa_addr; - mask = (struct sockaddr_in *)ifa->ifa_netmask; - xo_emit("{t:network/%-13.13s} ", - netname(sin->sin_addr.s_addr, - mask->sin_addr.s_addr)); - xo_emit("{t:address/%-17.17s} ", - routename(sin->sin_addr.s_addr)); + if (Wflag) { + xo_emit("{t:network/%-13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } else { + xo_emit("{t:network/%-13.13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17.17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } network = true; break; - } #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 *sin6, *mask; - - sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; - mask = (struct sockaddr_in6 *)ifa->ifa_netmask; - - xo_emit("{t:network/%-13.13s} ", - netname6(sin6, &mask->sin6_addr)); - getnameinfo(ifa->ifa_addr, ifa->ifa_addr->sa_len, - addr_buf, sizeof(addr_buf), 0, 0, NI_NUMERICHOST); - xo_emit("{t:address/%-17.17s} ", addr_buf); + if (Wflag) { + xo_emit("{t:network/%-13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } else { + xo_emit("{t:network/%-13.13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17.17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } - network = 1; + network = true; break; - } #endif /* INET6 */ case AF_LINK: { struct sockaddr_dl *sdl; - char *cp, linknum[10]; - int len = 32; - char buf[len]; - int n, z; + char linknum[10]; sdl = (struct sockaddr_dl *)ifa->ifa_addr; - cp = (char *)LLADDR(sdl); - n = sdl->sdl_alen; sprintf(linknum, "", sdl->sdl_index); xo_emit("{t:network/%-13.13s} ", linknum); - buf[0] = '\0'; - z = 0; - while ((--n >= 0) && (z < len)) { - snprintf(buf + z, len - z, "%02x%c", - *cp++ & 0xff, n > 0 ? ':' : ' '); - z += 3; - } - if (z > 0) - xo_emit("{:address/%*s}", 32 - z, buf); - else + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) xo_emit("{P: }"); - link = 1; + else + xo_emit("{:address/%*s}", + 32 - 3 * sdl->sdl_alen, + routename(ifa->ifa_addr, 1)); + link = true; break; } } @@ -465,44 +452,30 @@ intpr(int interval, void (*pfunc)(char * xo_open_instance("multicast-address"); switch (ifma->ifma_addr->sa_family) { - case AF_INET: - { - struct sockaddr_in *sin; - - sin = (struct sockaddr_in *)ifma->ifma_addr; - fmt = routename(sin->sin_addr.s_addr); - break; - } -#ifdef INET6 - case AF_INET6: - - /* in6_fillscopeid(&msa.in6); */ - getnameinfo(ifma->ifma_addr, - ifma->ifma_addr->sa_len, addr_buf, - sizeof(addr_buf), 0, 0, NI_NUMERICHOST); - xo_emit("{P:/%*s }{t:address/%-19.19s}", - Wflag ? 27 : 25, "", addr_buf); - break; -#endif /* INET6 */ case AF_LINK: { struct sockaddr_dl *sdl; sdl = (struct sockaddr_dl *)ifma->ifma_addr; - switch (sdl->sdl_type) { - case IFT_ETHER: - case IFT_FDDI: - fmt = ether_ntoa( - (struct ether_addr *)LLADDR(sdl)); + if (sdl->sdl_type != IFT_ETHER && + sdl->sdl_type != IFT_FDDI) break; - } - break; } + /* FALLTHROUGH */ + case AF_INET: +#ifdef INET6 + case AF_INET6: +#endif /* INET6 */ + fmt = routename(ifma->ifma_addr, numeric_addr); + break; } - if (fmt) { - xo_emit("{P:/%*s }{t:address/%-17.17s/}", - Wflag ? 27 : 25, "", fmt); + if (Wflag) + xo_emit("{P:/%27s }" + "{t:address/%-17s/}", "", fmt); + else + xo_emit("{P:/%25s }" + "{t:address/%-17.17s/}", "", fmt); if (ifma->ifma_addr->sa_family == AF_LINK) { xo_emit(" {:received-packets/%8lu}", IFA_STAT(imcasts)); @@ -596,7 +569,7 @@ catchalarm(int signo __unused) * First line printed at top of screen is always cumulative. */ static void -sidewaysintpr(int interval) +sidewaysintpr(void) { struct iftot ift[2], *new, *old; struct itimerval interval_it; Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/inet.c Tue Sep 1 08:42:04 2015 (r287351) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/inet6.c Tue Sep 1 08:42:04 2015 (r287351) @@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include "netstat.h" -struct socket sockb; - char *inet6name(struct in6_addr *); static char ntop_buf[INET6_ADDRSTRLEN]; Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/main.c Tue Sep 1 08:42:04 2015 (r287351) @@ -374,7 +374,8 @@ main(int argc, char *argv[]) else if (strcmp(optarg, "pfkey") == 0) af = PF_KEY; #endif - else if (strcmp(optarg, "unix") == 0) + else if (strcmp(optarg, "unix") == 0 || + strcmp(optarg, "local") == 0) af = AF_UNIX; #ifdef NETGRAPH else if (strcmp(optarg, "ng") == 0 @@ -547,7 +548,7 @@ main(int argc, char *argv[]) #endif if (iflag && !sflag) { xo_open_container("statistics"); - intpr(interval, NULL, af); + intpr(NULL, af); xo_close_container("statistics"); xo_finish(); exit(0); @@ -645,7 +646,7 @@ printproto(struct protox *tp, const char if (sflag) { if (iflag) { if (tp->pr_istats) - intpr(interval, tp->pr_istats, af); + intpr(tp->pr_istats, af); else if (pflag) xo_message("%s: no per-interface stats routine", tp->pr_name); Modified: head/usr.bin/netstat/mroute.c ============================================================================== --- head/usr.bin/netstat/mroute.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/mroute.c Tue Sep 1 08:42:04 2015 (r287351) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "netstat.h" @@ -178,12 +179,17 @@ print_bw_meter(struct bw_meter *bw_meter static void print_mfc(struct mfc *m, int maxvif, int *banner_printed) { + struct sockaddr_in sin; + struct sockaddr *sa = (struct sockaddr *)&sin; struct bw_meter bw_meter, *bwm; int bw_banner_printed; int error; vifi_t vifi; bw_banner_printed = 0; + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; if (! *banner_printed) { xo_open_list("multicast-forwarding-entry"); @@ -193,9 +199,11 @@ print_mfc(struct mfc *m, int maxvif, int *banner_printed = 1; } - xo_emit(" {:origin-address/%-15.15s}", routename(m->mfc_origin.s_addr)); + memcpy(&sin.sin_addr, &m->mfc_origin, sizeof(sin.sin_addr)); + xo_emit(" {:origin-address/%-15.15s}", routename(sa, numeric_addr)); + memcpy(&sin.sin_addr, &m->mfc_mcastgrp, sizeof(sin.sin_addr)); xo_emit(" {:group-address/%-15.15s}", - routename(m->mfc_mcastgrp.s_addr)); + routename(sa, numeric_addr)); xo_emit(" {:sent-packets/%9lu}", m->mfc_pkt_cnt); xo_emit(" {:parent/%3d} ", m->mfc_parent); xo_open_list("vif-ttl"); @@ -230,6 +238,8 @@ print_mfc(struct mfc *m, int maxvif, int void mroutepr() { + struct sockaddr_in sin; + struct sockaddr *sa = (struct sockaddr *)&sin; struct vif viftable[MAXVIFS]; struct vif *v; struct mfc *m; @@ -242,6 +252,10 @@ mroutepr() saved_numeric_addr = numeric_addr; numeric_addr = 1; + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + /* * TODO: * The VIF table will move to hanging off the struct if_info for @@ -294,12 +308,14 @@ mroutepr() } xo_open_instance("vif"); + memcpy(&sin.sin_addr, &v->v_lcl_addr, sizeof(sin.sin_addr)); xo_emit(" {:vif/%2u} {:threshold/%6u} {:route/%-15.15s}", /* opposite math of add_vif() */ vifi, v->v_threshold, - routename(v->v_lcl_addr.s_addr)); + routename(sa, numeric_addr)); + memcpy(&sin.sin_addr, &v->v_rmt_addr, sizeof(sin.sin_addr)); xo_emit(" {:source/%-15.15s}", (v->v_flags & VIFF_TUNNEL) ? - routename(v->v_rmt_addr.s_addr) : ""); + routename(sa, numeric_addr) : ""); xo_emit(" {:received-packets/%9lu} {:sent-packets/%9lu}\n", v->v_pkt_in, v->v_pkt_out); Modified: head/usr.bin/netstat/mroute6.c ============================================================================== --- head/usr.bin/netstat/mroute6.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/mroute6.c Tue Sep 1 08:42:04 2015 (r287351) @@ -186,9 +186,11 @@ mroute6pr() xo_open_instance("multicast-forwarding-cache"); xo_emit(" {:origin/%-*.*s}", WID_ORG, WID_ORG, - routename6(&mfc.mf6c_origin)); + routename(sin6tosa(&mfc.mf6c_origin), + numeric_addr)); xo_emit(" {:group/%-*.*s}", WID_GRP, WID_GRP, - routename6(&mfc.mf6c_mcastgrp)); + routename(sin6tosa(&mfc.mf6c_mcastgrp), + numeric_addr)); xo_emit(" {:total-packets/%9ju}", (uintmax_t)mfc.mf6c_pkt_cnt); Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/netstat.h Tue Sep 1 08:42:04 2015 (r287351) @@ -32,6 +32,10 @@ #include +#define satosin(sa) ((struct sockaddr_in *)(sa)) +#define satosin6(sa) ((struct sockaddr_in6 *)(sa)) +#define sin6tosa(sin6) ((struct sockaddr *)(sin6)) + extern int Aflag; /* show addresses of protocol control block */ extern int aflag; /* show all sockets (including servers) */ extern int bflag; /* show i/f total bytes in/out */ @@ -106,8 +110,6 @@ void mrt6_stats(void); struct sockaddr_in6; struct in6_addr; void in6_fillscopeid(struct sockaddr_in6 *); -char *routename6(struct sockaddr_in6 *); -const char *netname6(struct sockaddr_in6 *, struct in6_addr *); void inet6print(const char *, struct in6_addr *, int, const char *, int); #endif /*INET6*/ @@ -122,15 +124,14 @@ void netisr_stats(void *); void hostpr(u_long, u_long); void impstats(u_long, u_long); -void intpr(int, void (*)(char *), int); +void intpr(void (*)(char *), int); -void pr_rthdr(int); void pr_family(int); void rt_stats(void); void flowtable_stats(void); -char *routename(in_addr_t); -char *netname(in_addr_t, in_addr_t); +char *routename(struct sockaddr *, int); +const char *netname(struct sockaddr *, struct sockaddr *); char *ns_print(struct sockaddr *); void routepr(int, int); Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/route.c Tue Sep 1 08:42:04 2015 (r287351) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); /* * Definitions for showing gateway flags. */ -struct bits { +static struct bits { u_long b_mask; char b_val; const char *b_name; @@ -107,19 +107,15 @@ static struct nlist rl[] = { { .n_name = NULL }, }; -typedef union { - long dummy; /* Helps align structure. */ - struct sockaddr u_sa; - u_short u_data[128]; -} sa_u; - struct ifmap_entry { char ifname[IFNAMSIZ]; }; static struct ifmap_entry *ifmap; static int ifmap_size; -struct timespec uptime; +static struct timespec uptime; +static const char *netname4(in_addr_t, in_addr_t); +static const char *netname6(struct sockaddr_in6 *, struct sockaddr_in6 *); static void p_rtable_sysctl(int, int); static void p_rtentry_sysctl(const char *name, struct rt_msghdr *); static void p_sockaddr(const char *name, struct sockaddr *, struct sockaddr *, @@ -130,6 +126,7 @@ static void p_flags(int, const char *); static const char *fmt_flags(int f); static void domask(char *, in_addr_t, u_long); + /* * Print routing tables. */ @@ -228,12 +225,10 @@ static int wid_expire; /* * Print header for routing table columns. */ -void -pr_rthdr(int af1) +static void +pr_rthdr(int af1 __unused) { - if (Aflag) - xo_emit("{T:/%-8.8s} ","Address"); if (Wflag) { xo_emit("{T:/%-*.*s} {T:/%-*.*s} {T:/%-*.*s} {T:/%*.*s} " "{T:/%*.*s} {T:/%*.*s} {T:/%*s}\n", @@ -365,30 +360,22 @@ p_rtable_sysctl(int fibnum, int af) static void p_rtentry_sysctl(const char *name, struct rt_msghdr *rtm) { - struct sockaddr *sa = (struct sockaddr *)(rtm + 1); + struct sockaddr *sa, *addr[RTAX_MAX]; char buffer[128]; char prettyname[128]; - sa_u addr, mask, gw; - unsigned int l; + int i; xo_open_instance(name); + sa = (struct sockaddr *)(rtm + 1); + for (i = 0; i < RTAX_MAX; i++) { + if (rtm->rtm_addrs & (1 << i)) + addr[i] = sa; + sa = (struct sockaddr *)((char *)sa + SA_SIZE(sa)); + } -#define GETSA(_s, _f) { \ - bzero(&(_s), sizeof(_s)); \ - if (rtm->rtm_addrs & _f) { \ - l = roundup(sa->sa_len, sizeof(long)); \ - memcpy(&(_s), sa, (l > sizeof(_s)) ? sizeof(_s) : l); \ - sa = (struct sockaddr *)((char *)sa + l); \ - } \ -} - - GETSA(addr, RTA_DST); - GETSA(gw, RTA_GATEWAY); - GETSA(mask, RTA_NETMASK); - - p_sockaddr("destination", &addr.u_sa, &mask.u_sa, rtm->rtm_flags, - wid_dst); - p_sockaddr("gateway", &gw.u_sa, NULL, RTF_HOST, wid_gw); + p_sockaddr("destination", addr[RTAX_DST], addr[RTAX_NETMASK], + rtm->rtm_flags, wid_dst); + p_sockaddr("gateway", addr[RTAX_GATEWAY], NULL, RTF_HOST, wid_gw); snprintf(buffer, sizeof(buffer), "{[:-%d}{:flags/%%s}{]:} ", wid_flags); p_flags(rtm->rtm_flags, buffer); @@ -435,7 +422,7 @@ p_sockaddr(const char *name, struct sock snprintf(buf, sizeof(buf), "{:%s/%%s} ", name); xo_emit(buf, cp); } else { - if (numeric_addr) { + if (Wflag != 0 || numeric_addr) { snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%s}{]:} ", -width, name); xo_emit(buf, cp); @@ -450,107 +437,67 @@ p_sockaddr(const char *name, struct sock static const char * fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags) { - static char workbuf[128]; + static char buf[128]; const char *cp; if (sa == NULL) return ("null"); switch(sa->sa_family) { - case AF_INET: - { - struct sockaddr_in *sockin = (struct sockaddr_in *)sa; - - if ((sockin->sin_addr.s_addr == INADDR_ANY) && - mask && - ntohl(((struct sockaddr_in *)mask)->sin_addr.s_addr) - ==0L) - cp = "default" ; - else if (flags & RTF_HOST) - cp = routename(sockin->sin_addr.s_addr); - else if (mask) - cp = netname(sockin->sin_addr.s_addr, - ((struct sockaddr_in *)mask)->sin_addr.s_addr); - else - cp = netname(sockin->sin_addr.s_addr, INADDR_ANY); - break; - } - #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa; - /* * The sa6->sin6_scope_id must be filled here because * this sockaddr is extracted from kmem(4) directly * and has KAME-specific embedded scope id in * sa6->sin6_addr.s6_addr[2]. */ - in6_fillscopeid(sa6); - + in6_fillscopeid(satosin6(sa)); + /* FALLTHROUGH */ +#endif /*INET6*/ + case AF_INET: if (flags & RTF_HOST) - cp = routename6(sa6); + cp = routename(sa, numeric_addr); else if (mask) - cp = netname6(sa6, - &((struct sockaddr_in6 *)mask)->sin6_addr); - else { - cp = netname6(sa6, NULL); - } + cp = netname(sa, mask); + else + cp = netname(sa, NULL); break; - } -#endif /*INET6*/ - case AF_NETGRAPH: { - strlcpy(workbuf, ((struct sockaddr_ng *)sa)->sg_data, - sizeof(workbuf)); - cp = workbuf; + strlcpy(buf, ((struct sockaddr_ng *)sa)->sg_data, + sizeof(buf)); + cp = buf; break; } - case AF_LINK: { +#if 0 struct sockaddr_dl *sdl = (struct sockaddr_dl *)sa; - if (sdl->sdl_nlen == 0 && sdl->sdl_alen == 0 && - sdl->sdl_slen == 0) { - (void) sprintf(workbuf, "link#%d", sdl->sdl_index); - cp = workbuf; - } else - switch (sdl->sdl_type) { - - case IFT_ETHER: - case IFT_L2VLAN: - case IFT_BRIDGE: - if (sdl->sdl_alen == ETHER_ADDR_LEN) { - cp = ether_ntoa((struct ether_addr *) - (sdl->sdl_data + sdl->sdl_nlen)); - break; - } - /* FALLTHROUGH */ - default: - cp = link_ntoa(sdl); - break; - } + /* Interface route. */ + if (sdl->sdl_nlen) + cp = sdl->sdl_data; + else +#endif + cp = routename(sa, 1); break; } - default: { u_char *s = (u_char *)sa->sa_data, *slim; char *cq, *cqlim; - cq = workbuf; + cq = buf; slim = sa->sa_len + (u_char *) sa; - cqlim = cq + sizeof(workbuf) - 6; + cqlim = cq + sizeof(buf) - 6; cq += sprintf(cq, "(%d)", sa->sa_family); while (s < slim && cq < cqlim) { cq += sprintf(cq, " %02x", *s++); if (s < slim) cq += sprintf(cq, "%02x", *s++); } - cp = workbuf; + cp = buf; } } @@ -586,28 +533,35 @@ fmt_flags(int f) } char * -routename(in_addr_t in) +routename(struct sockaddr *sa, int flags) { - char *cp; - static char line[MAXHOSTNAMELEN]; - struct hostent *hp; - - cp = 0; - if (!numeric_addr) { - hp = gethostbyaddr(&in, sizeof (struct in_addr), AF_INET); - if (hp) { - cp = hp->h_name; - trimdomain(cp, strlen(cp)); + static char line[NI_MAXHOST]; + int error, f; + + f = (flags) ? NI_NUMERICHOST : 0; + error = getnameinfo(sa, sa->sa_len, line, sizeof(line), + NULL, 0, f); + if (error) { + const void *src; + switch (sa->sa_family) { +#ifdef INET + case AF_INET: + src = &satosin(sa)->sin_addr; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + src = &satosin6(sa)->sin6_addr; + break; +#endif /* INET6 */ + default: + return(line); } + inet_ntop(sa->sa_family, src, line, sizeof(line) - 1); + return (line); } - if (cp) { - strlcpy(line, cp, sizeof(line)); - } else { -#define C(x) ((x) & 0xff) - in = ntohl(in); - sprintf(line, "%u.%u.%u.%u", - C(in >> 24), C(in >> 16), C(in >> 8), C(in)); - } + trimdomain(line, strlen(line)); + return (line); } @@ -622,7 +576,7 @@ domask(char *dst, in_addr_t addr __unuse { int b, i; - if (mask == 0 || (!numeric_addr && NSHIFT(mask) != 0)) { + if (mask == 0) { *dst = '\0'; return; } @@ -648,14 +602,41 @@ domask(char *dst, in_addr_t addr __unuse /* * Return the name of the network whose address is given. */ -char * -netname(in_addr_t in, in_addr_t mask) +const char * +netname(struct sockaddr *sa, struct sockaddr *mask) +{ + switch (sa->sa_family) { + case AF_INET: + if (mask != NULL) + return (netname4(satosin(sa)->sin_addr.s_addr, + satosin(mask)->sin_addr.s_addr)); + else + return (netname4(satosin(sa)->sin_addr.s_addr, + INADDR_ANY)); + break; +#ifdef INET6 + case AF_INET6: + return (netname6(satosin6(sa), satosin6(mask))); +#endif /* INET6 */ + default: + return (NULL); + } +} + +static const char * +netname4(in_addr_t in, in_addr_t mask) { char *cp = 0; - static char line[MAXHOSTNAMELEN]; + static char line[MAXHOSTNAMELEN + sizeof("/xx")]; + char nline[INET_ADDRSTRLEN]; struct netent *np = 0; in_addr_t i; + if (in == INADDR_ANY && mask == 0) { + strlcpy(line, "default", sizeof(line)); + return (line); + } + /* It is ok to supply host address. */ in &= mask; @@ -667,12 +648,15 @@ netname(in_addr_t in, in_addr_t mask) trimdomain(cp, strlen(cp)); } } + inet_ntop(AF_INET, &in, nline, sizeof(line)); if (cp != NULL) { + if (strcpy(cp, nline) != 0) + return (line); strlcpy(line, cp, sizeof(line)); - } else { - inet_ntop(AF_INET, &in, line, sizeof(line) - 1); - } + } else + strlcpy(line, nline, sizeof(line)); domask(line + strlen(line), i, ntohl(mask)); + return (line); } @@ -698,47 +682,35 @@ in6_fillscopeid(struct sockaddr_in6 *sa6 #endif } -const char * -netname6(struct sockaddr_in6 *sa6, struct in6_addr *mask) +/* Mask to length table. To check an invalid value, (length + 1) is used. */ +static int masktolen[256] = { + [0xff] = 8 + 1, + [0xfe] = 7 + 1, + [0xfc] = 6 + 1, + [0xf8] = 5 + 1, + [0xf0] = 4 + 1, + [0xe0] = 3 + 1, + [0xc0] = 2 + 1, + [0x80] = 1 + 1, + [0x00] = 0 + 1, +}; + +static const char * +netname6(struct sockaddr_in6 *sa6, struct sockaddr_in6 *mask) { - static char line[MAXHOSTNAMELEN]; - u_char *p = (u_char *)mask; - u_char *lim; - int masklen, illegal = 0, flag = 0; + static char line[NI_MAXHOST + sizeof("/xxx") - 1]; + char nline[NI_MAXHOST]; + u_char *p, *lim; + int masklen, illegal = 0; if (mask) { + p = (u_char *)&mask->sin6_addr; for (masklen = 0, lim = p + 16; p < lim; p++) { - switch (*p) { - case 0xff: - masklen += 8; - break; - case 0xfe: - masklen += 7; - break; - case 0xfc: - masklen += 6; - break; - case 0xf8: - masklen += 5; - break; - case 0xf0: - masklen += 4; - break; - case 0xe0: - masklen += 3; - break; - case 0xc0: - masklen += 2; - break; - case 0x80: - masklen += 1; - break; - case 0x00: - break; - default: - illegal ++; - break; - } + if (masktolen[*p] > 0) + /* -1 is required. */ + masklen += masktolen[*p] - 1; + else + illegal++; } if (illegal) xo_error("illegal prefixlen\n"); @@ -749,37 +721,17 @@ netname6(struct sockaddr_in6 *sa6, struc if (masklen == 0 && IN6_IS_ADDR_UNSPECIFIED(&sa6->sin6_addr)) return("default"); + getnameinfo((struct sockaddr *)sa6, sa6->sin6_len, nline, sizeof(nline), + NULL, 0, NI_NUMERICHOST); if (numeric_addr) - flag |= NI_NUMERICHOST; - getnameinfo((struct sockaddr *)sa6, sa6->sin6_len, line, sizeof(line), - NULL, 0, flag); - - if (numeric_addr) + strlcpy(line, nline, sizeof(line)); + else + getnameinfo((struct sockaddr *)sa6, sa6->sin6_len, line, + sizeof(line), NULL, 0, 0); + if (numeric_addr || strcmp(line, nline) == 0) sprintf(&line[strlen(line)], "/%d", masklen); - return line; -} - -char * -routename6(struct sockaddr_in6 *sa6) -{ - static char line[MAXHOSTNAMELEN]; - int flag = 0; - /* use local variable for safety */ - struct sockaddr_in6 sa6_local; - - sa6_local.sin6_family = AF_INET6; - sa6_local.sin6_len = sizeof(sa6_local); - sa6_local.sin6_addr = sa6->sin6_addr; - sa6_local.sin6_scope_id = sa6->sin6_scope_id; - - if (numeric_addr) - flag |= NI_NUMERICHOST; - - getnameinfo((struct sockaddr *)&sa6_local, sa6_local.sin6_len, - line, sizeof(line), NULL, 0, flag); - - return line; + return (line); } #endif /*INET6*/ Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Tue Sep 1 08:34:44 2015 (r287350) +++ head/usr.bin/netstat/sctp.c Tue Sep 1 08:42:04 2015 (r287351) @@ -79,7 +79,7 @@ static void sctp_statesprint(uint32_t st #define NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT 0x8 #define NETSTAT_SCTP_STATES_SHUTDOWN_PENDING 0x9 -const char *sctpstates[] = { +static const char *sctpstates[] = { "CLOSED", "BOUND", "LISTEN", @@ -92,13 +92,13 @@ const char *sctpstates[] = { "SHUTDOWN_PENDING" }; -LIST_HEAD(xladdr_list, xladdr_entry) xladdr_head; +static LIST_HEAD(xladdr_list, xladdr_entry) xladdr_head; struct xladdr_entry { struct xsctp_laddr *xladdr; LIST_ENTRY(xladdr_entry) xladdr_entries; }; -LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head; +static LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head; struct xraddr_entry { struct xsctp_raddr *xraddr; LIST_ENTRY(xraddr_entry) xraddr_entries; From owner-svn-src-all@freebsd.org Tue Sep 1 09:22:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7029E9C84BB; Tue, 1 Sep 2015 09:22:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 60FDDC77; Tue, 1 Sep 2015 09:22:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t819MPfZ010327; Tue, 1 Sep 2015 09:22:25 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t819MPRv010326; Tue, 1 Sep 2015 09:22:25 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509010922.t819MPRv010326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 1 Sep 2015 09:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287353 - head/lib/libc/rpc 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, 01 Sep 2015 09:22:25 -0000 Author: rodrigc Date: Tue Sep 1 09:22:24 2015 New Revision: 287353 URL: https://svnweb.freebsd.org/changeset/base/287353 Log: Use unsigned variable. Eliminates gcc 4.9 compiler warning. Modified: head/lib/libc/rpc/clnt_bcast.c Modified: head/lib/libc/rpc/clnt_bcast.c ============================================================================== --- head/lib/libc/rpc/clnt_bcast.c Tue Sep 1 09:09:49 2015 (r287352) +++ head/lib/libc/rpc/clnt_bcast.c Tue Sep 1 09:22:24 2015 (r287353) @@ -251,7 +251,7 @@ rpc_broadcast_exp(prog, vers, proc, xarg int inlen; u_int maxbufsize = 0; AUTH *sys_auth = authunix_create_default(); - int i; + u_int i; void *handle; char uaddress[1024]; /* A self imposed limit */ char *uaddrp = uaddress; From owner-svn-src-all@freebsd.org Tue Sep 1 09:27:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A0369C875E; Tue, 1 Sep 2015 09:27:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4B05FE3D; Tue, 1 Sep 2015 09:27:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t819RF0V010628; Tue, 1 Sep 2015 09:27:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t819RFEM010627; Tue, 1 Sep 2015 09:27:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201509010927.t819RFEM010627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 1 Sep 2015 09:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287354 - 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, 01 Sep 2015 09:27:15 -0000 Author: avg Date: Tue Sep 1 09:27:14 2015 New Revision: 287354 URL: https://svnweb.freebsd.org/changeset/base/287354 Log: callout_reset: fix a reversed check for cc_exec_cancel The typo was introduced in r278469 / 344ecf88af2dfb. As a result of the bug there was a timing window where callout_reset() would fail to cancel a concurrent execution of a callout that is about to start and would schedule the callout again. The callout would fire more times than it is scheduled. That would happen even if the callout is initialized with a lock. For example, the bug triggered the "Stray timeout" assertion in taskqueue_timeout_func(). MFC after: 5 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Sep 1 09:22:24 2015 (r287353) +++ head/sys/kern/kern_timeout.c Tue Sep 1 09:27:14 2015 (r287354) @@ -1032,7 +1032,7 @@ callout_reset_sbt_on(struct callout *c, * currently in progress. If there is a lock then we * can cancel the callout if it has not really started. */ - if (c->c_lock != NULL && cc_exec_cancel(cc, direct)) + if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; if (cc_exec_waiting(cc, direct)) { /* From owner-svn-src-all@freebsd.org Tue Sep 1 09:33:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BF6F9C8C3C; Tue, 1 Sep 2015 09:33:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4C6AE12BD; Tue, 1 Sep 2015 09:33:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t819XP8W014660; Tue, 1 Sep 2015 09:33:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t819XP4a014659; Tue, 1 Sep 2015 09:33:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201509010933.t819XP4a014659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 1 Sep 2015 09:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287355 - 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.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, 01 Sep 2015 09:33:25 -0000 Author: hselasky Date: Tue Sep 1 09:33:24 2015 New Revision: 287355 URL: https://svnweb.freebsd.org/changeset/base/287355 Log: Add new PCI ID. Submitted by: Dmitry Luhtionov MFC after: 1 month PR: 202807 Modified: head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Tue Sep 1 09:27:14 2015 (r287354) +++ head/sys/dev/usb/controller/uhci_pci.c Tue Sep 1 09:33:24 2015 (r287355) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include "usb_if.h" #define PCI_UHCI_VENDORID_INTEL 0x8086 +#define PCI_UHCI_VENDORID_HP 0x103c #define PCI_UHCI_VENDORID_VIA 0x1106 /* PIIX4E has no separate stepping */ @@ -222,6 +223,9 @@ uhci_pci_match(device_t self) case 0x76028086: return ("Intel 82372FB/82468GX USB controller"); + case 0x3309103c: + return ("HP iLO Standard Virtual USB controller"); + case 0x30381106: return ("VIA 83C572 USB controller"); @@ -309,6 +313,9 @@ uhci_pci_attach(device_t self) case PCI_UHCI_VENDORID_INTEL: sprintf(sc->sc_vendor, "Intel"); break; + case PCI_UHCI_VENDORID_HP: + sprintf(sc->sc_vendor, "HP"); + break; case PCI_UHCI_VENDORID_VIA: sprintf(sc->sc_vendor, "VIA"); break; From owner-svn-src-all@freebsd.org Tue Sep 1 10:47:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F699C8564; Tue, 1 Sep 2015 10:47:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 078ED156E; Tue, 1 Sep 2015 10:47:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81AlgjY043885; Tue, 1 Sep 2015 10:47:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81AlgII043884; Tue, 1 Sep 2015 10:47:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011047.t81AlgII043884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 10:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287356 - head/sys/dev/mmc/host 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, 01 Sep 2015 10:47:43 -0000 Author: andrew Date: Tue Sep 1 10:47:42 2015 New Revision: 287356 URL: https://svnweb.freebsd.org/changeset/base/287356 Log: Remove an variable we only ever write to, and stop assigning 0 to values in the softc as it's the default value. The latter helps with subclassing this driver. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 09:33:24 2015 (r287355) +++ head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 10:47:42 2015 (r287356) @@ -538,7 +538,6 @@ static int dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; - device_t child; int error; int slot; @@ -574,8 +573,6 @@ dwmmc_attach(device_t dev) device_printf(dev, "Hardware version ID is %04x\n", READ4(sc, SDMMC_VERID) & 0xffff); - sc->use_pio = 0; - sc->pwren_inverted = 0; sc->desc_count = DESC_MAX; if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { @@ -651,7 +648,7 @@ dwmmc_attach(device_t dev) sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = MMC_CAP_4_BIT_DATA; - child = device_add_child(dev, "mmc", 0); + device_add_child(dev, "mmc", 0); return (bus_generic_attach(dev)); } From owner-svn-src-all@freebsd.org Tue Sep 1 11:46:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22B7D9C760B; Tue, 1 Sep 2015 11:46:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 ED26210F3; Tue, 1 Sep 2015 11:46:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81BkDJE068038; Tue, 1 Sep 2015 11:46:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81BkDeD068037; Tue, 1 Sep 2015 11:46:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509011146.t81BkDeD068037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 1 Sep 2015 11:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287357 - 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: Tue, 01 Sep 2015 11:46:14 -0000 Author: glebius Date: Tue Sep 1 11:46:13 2015 New Revision: 287357 URL: https://svnweb.freebsd.org/changeset/base/287357 Log: When building multiple kernels use [2..-1] to extract !INSTALLKERNEL from BUILDKERNELS list. This is more strict, since INSTALLKERNEL by definition is the first word of BUILDKERNELS list. The previous code failed if INSTALLKERNEL is a substring of additional kernel name. Reviewed by: gjb Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Sep 1 10:47:42 2015 (r287356) +++ head/Makefile.inc1 Tue Sep 1 11:46:13 2015 (r287357) @@ -1146,7 +1146,7 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif @@ -1168,7 +1168,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz @@ -1177,7 +1177,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz From owner-svn-src-all@freebsd.org Tue Sep 1 11:59:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E603B9C7D5B; Tue, 1 Sep 2015 11:59:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D67031943; Tue, 1 Sep 2015 11:59:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81BxC3S072209; Tue, 1 Sep 2015 11:59:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81BxCkm072208; Tue, 1 Sep 2015 11:59:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509011159.t81BxCkm072208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 1 Sep 2015 11:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287358 - 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: Tue, 01 Sep 2015 11:59:13 -0000 Author: glebius Date: Tue Sep 1 11:59:12 2015 New Revision: 287358 URL: https://svnweb.freebsd.org/changeset/base/287358 Log: Not only build with buildworld, but also install with installworld all alternative kernels. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015 (r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 2015 (r287358) @@ -1127,6 +1127,14 @@ reinstallkernel reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} +.for _kernel in ${BUILDKERNELS:[2..-1]} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${_kernel}" + @echo "--------------------------------------------------------------" + cd ${KRNLOBJDIR}/${_kernel}; \ + ${CROSSENV} PATH=${TMPPATH} \ + ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor distributekernel distributekernel.debug: .if empty(INSTALLKERNEL) From owner-svn-src-all@freebsd.org Tue Sep 1 12:47:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BD999C709A; Tue, 1 Sep 2015 12:47:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0FDD81606; Tue, 1 Sep 2015 12:47:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81ClCq1092377; Tue, 1 Sep 2015 12:47:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81ClCpZ092375; Tue, 1 Sep 2015 12:47:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509011247.t81ClCpZ092375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 1 Sep 2015 12:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287360 - in head: contrib/netbsd-tests/lib/libc/gen/posix_spawn lib/libc/tests/gen/posix_spawn 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, 01 Sep 2015 12:47:13 -0000 Author: kib Date: Tue Sep 1 12:47:11 2015 New Revision: 287360 URL: https://svnweb.freebsd.org/changeset/base/287360 Log: Fix t_spawnattr test for attributes handling by posix_spawn(3). Connect it to the build. The code assumed that SCHED_* constants form a contiguous set of numbers, remove the assumption by using schedulers[] array in get_different_scheduler(). This is no-op on FreeBSD, but improves code portability. The selection of different priority used the min/max priority range of the current scheduler class, instead of the priority to be changed to. The bug caused the test failure. Remove duplication of POSIX_SPAWN_SETSIGDEF flag and now unused duplications of MIN/MAX definitions. Reviewed by: jilles, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3533 Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c head/lib/libc/tests/gen/posix_spawn/Makefile Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Tue Sep 1 12:33:35 2015 (r287359) +++ head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c Tue Sep 1 12:47:11 2015 (r287360) @@ -30,6 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -42,51 +43,56 @@ #include #include -#define MAX(a, b) (a) > (b) ? (a) : (b) -#define MIN(a, b) (a) > (b) ? (b) : (a) - static int get_different_scheduler(void); -static int get_different_priority(void); +static int get_different_priority(int scheduler); + +static const int schedulers[] = { + SCHED_OTHER, + SCHED_FIFO, + SCHED_RR +}; static int -get_different_scheduler() +get_different_scheduler(void) { - int scheduler, max, min, new; - - max = MAX(MAX(SCHED_FIFO, SCHED_OTHER), SCHED_RR); - min = MIN(MIN(SCHED_FIFO, SCHED_OTHER), SCHED_RR); + u_int i; + int scheduler; /* get current schedule policy */ scheduler = sched_getscheduler(0); + for (i = 0; i < nitems(schedulers); i++) { + if (schedulers[i] == scheduler) + break; + } + ATF_REQUIRE_MSG(i < nitems(schedulers), + "Unknown current scheduler %d", scheduler); /* new scheduler */ - new = (scheduler + 1); - if (new > max) - new = min; - - return new; + i++; + if (i >= nitems(schedulers)) + i = 0; + return schedulers[i]; } static int -get_different_priority() +get_different_priority(int scheduler) { - int scheduler, max, min, new, priority; + int max, min, new, priority; struct sched_param param; - /* get current schedule policy */ - scheduler = sched_getscheduler(0); - max = sched_get_priority_max(scheduler); min = sched_get_priority_min(scheduler); sched_getparam(0, ¶m); priority = param.sched_priority; - /* new schedule policy */ - new = (priority + 1); + /* + * Change numerical value of the priority, to ensure that it + * was set for the spawned child. + */ + new = priority + 1; if (new > max) new = min; - return new; } @@ -119,16 +125,15 @@ ATF_TC_BODY(t_spawnattr, tc) posix_spawnattr_init(&attr); scheduler = get_different_scheduler(); - priority = get_different_priority(); + priority = get_different_priority(scheduler); sp.sched_priority = priority; sigemptyset(&sig); sigaddset(&sig, SIGUSR1); - posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSCHEDULER | - POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETPGROUP | - POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF | - POSIX_SPAWN_SETSIGDEF); + posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSCHEDULER | + POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETPGROUP | + POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF); posix_spawnattr_setpgroup(&attr, 0); posix_spawnattr_setschedparam(&attr, &sp); posix_spawnattr_setschedpolicy(&attr, scheduler); Modified: head/lib/libc/tests/gen/posix_spawn/Makefile ============================================================================== --- head/lib/libc/tests/gen/posix_spawn/Makefile Tue Sep 1 12:33:35 2015 (r287359) +++ head/lib/libc/tests/gen/posix_spawn/Makefile Tue Sep 1 12:47:11 2015 (r287360) @@ -10,9 +10,9 @@ TESTSDIR= ${TESTSBASE}/lib/libc/gen/posi BINDIR= ${TESTSDIR} -# TODO: t_spawnattr (fix from pho@ needs additional review) NETBSD_ATF_TESTS_C= fileactions_test NETBSD_ATF_TESTS_C+= spawn_test +NETBSD_ATF_TESTS_C+= spawnattr_test PROGS= h_fileactions PROGS+= h_spawn From owner-svn-src-all@freebsd.org Tue Sep 1 13:07:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB1D9C7C0F; Tue, 1 Sep 2015 13:07:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 F1444149; Tue, 1 Sep 2015 13:07:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81D7RcT000645; Tue, 1 Sep 2015 13:07:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81D7R1G000644; Tue, 1 Sep 2015 13:07:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509011307.t81D7R1G000644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 1 Sep 2015 13:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287361 - head/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: Tue, 01 Sep 2015 13:07:28 -0000 Author: kib Date: Tue Sep 1 13:07:27 2015 New Revision: 287361 URL: https://svnweb.freebsd.org/changeset/base/287361 Log: By doing file extension fast, it is possible to create excess supply of the D_NEWBLK kinds of dependencies (i.e. D_ALLOCDIRECT and D_ALLOCINDIR), which can exhaust kmem. Handle excess of D_NEWBLK in the same way as excess of D_INODEDEP and D_DIRREM, by scheduling ast to flush dependencies, after the thread, which created new dep, left the VFS/FFS innards. For D_NEWBLK, the only way to get rid of them is to do full sync, since items are attached to data blocks of arbitrary vnodes. The check for D_NEWBLK excess in softdep_ast_cleanup_proc() is unlocked. For 32bit arches, reduce the total amount of allowed dependencies by two. It could be considered increasing the limit for 64 bit platforms with direct maps. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 1 12:47:11 2015 (r287360) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 1 13:07:27 2015 (r287361) @@ -923,8 +923,7 @@ static int journal_unsuspend(struct ufsm static void softdep_prelink(struct vnode *, struct vnode *); static void add_to_journal(struct worklist *); static void remove_from_journal(struct worklist *); -static bool softdep_excess_inodes(struct ufsmount *); -static bool softdep_excess_dirrem(struct ufsmount *); +static bool softdep_excess_items(struct ufsmount *, int); static void softdep_process_journal(struct mount *, struct worklist *, int); static struct jremref *newjremref(struct dirrem *, struct inode *, struct inode *ip, off_t, nlink_t); @@ -2212,7 +2211,7 @@ inodedep_lookup(mp, inum, flags, inodede * responsible for more than our share of that usage and * we are not in a rush, request some inodedep cleanup. */ - if (softdep_excess_inodes(ump)) + if (softdep_excess_items(ump, D_INODEDEP)) schedule_cleanup(mp); else FREE_LOCK(ump); @@ -2307,7 +2306,12 @@ newblk_lookup(mp, newblkno, flags, newbl return (1); if ((flags & DEPALLOC) == 0) return (0); - FREE_LOCK(ump); + if (softdep_excess_items(ump, D_NEWBLK) || + softdep_excess_items(ump, D_ALLOCDIRECT) || + softdep_excess_items(ump, D_ALLOCINDIR)) + schedule_cleanup(mp); + else + FREE_LOCK(ump); newblk = malloc(sizeof(union allblk), M_NEWBLK, M_SOFTDEP_FLAGS | M_ZERO); workitem_alloc(&newblk->nb_list, D_NEWBLK, mp); @@ -2406,7 +2410,11 @@ softdep_initialize() { TAILQ_INIT(&softdepmounts); +#ifdef __LP64__ max_softdeps = desiredvnodes * 4; +#else + max_softdeps = desiredvnodes * 2; +#endif /* initialise bioops hack */ bioops.io_start = softdep_disk_io_initiation; @@ -9106,7 +9114,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre * the number of freefile and freeblks structures. */ ACQUIRE_LOCK(ip->i_ump); - if (!IS_SNAPSHOT(ip) && softdep_excess_dirrem(ip->i_ump)) + if (!IS_SNAPSHOT(ip) && softdep_excess_items(ip->i_ump, D_DIRREM)) schedule_cleanup(ITOV(dp)->v_mount); else FREE_LOCK(ip->i_ump); @@ -13244,20 +13252,12 @@ retry: } static bool -softdep_excess_inodes(struct ufsmount *ump) +softdep_excess_items(struct ufsmount *ump, int item) { - return (dep_current[D_INODEDEP] > max_softdeps && - ump->softdep_curdeps[D_INODEDEP] > max_softdeps / - stat_flush_threads); -} - -static bool -softdep_excess_dirrem(struct ufsmount *ump) -{ - - return (dep_current[D_DIRREM] > max_softdeps / 2 && - ump->softdep_curdeps[D_DIRREM] > (max_softdeps / 2) / + KASSERT(item >= 0 && item < D_LAST, ("item %d", item)); + return (dep_current[item] > max_softdeps && + ump->softdep_curdeps[item] > max_softdeps / stat_flush_threads); } @@ -13313,15 +13313,21 @@ softdep_ast_cleanup_proc(void) for (;;) { req = false; ACQUIRE_LOCK(ump); - if (softdep_excess_inodes(ump)) { + if (softdep_excess_items(ump, D_INODEDEP)) { req = true; request_cleanup(mp, FLUSH_INODES); } - if (softdep_excess_dirrem(ump)) { + if (softdep_excess_items(ump, D_DIRREM)) { req = true; request_cleanup(mp, FLUSH_BLOCKS); } FREE_LOCK(ump); + if (softdep_excess_items(ump, D_NEWBLK) || + softdep_excess_items(ump, D_ALLOCDIRECT) || + softdep_excess_items(ump, D_ALLOCINDIR)) { + req = true; + VFS_SYNC(mp, MNT_WAIT); + } if ((td->td_pflags & TDP_KTHREAD) != 0 || !req) break; } From owner-svn-src-all@freebsd.org Tue Sep 1 13:21:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70EE29C84B7; Tue, 1 Sep 2015 13:21:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 45245C09; Tue, 1 Sep 2015 13:21:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81DLXZN008781; Tue, 1 Sep 2015 13:21:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81DLXoD008780; Tue, 1 Sep 2015 13:21:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509011321.t81DLXoD008780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 1 Sep 2015 13:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287362 - 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, 01 Sep 2015 13:21:33 -0000 Author: kib Date: Tue Sep 1 13:21:32 2015 New Revision: 287362 URL: https://svnweb.freebsd.org/changeset/base/287362 Log: Clean up the kqueue use of the uma KPI. Explain why it is fine to not check for M_NOWAIT failures in kqueue_register(). Remove unneeded check for NULL result from waitable allocation in kqueue_scan(). uma_free(9) handles NULL argument correctly, remove checks for NULL. Remove useless cast and adjust style in knote_alloc(). Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Tue Sep 1 13:07:27 2015 (r287361) +++ head/sys/kern/kern_event.c Tue Sep 1 13:21:32 2015 (r287362) @@ -1105,10 +1105,16 @@ kqueue_register(struct kqueue *kq, struc if (fops == NULL) return EINVAL; - if (kev->flags & EV_ADD) - tkn = knote_alloc(waitok); /* prevent waiting with locks */ - else + if (kev->flags & EV_ADD) { + /* + * Prevent waiting with locks. Non-sleepable + * allocation failures are handled in the loop, only + * if the spare knote appears to be actually required. + */ + tkn = knote_alloc(waitok); + } else { tkn = NULL; + } findkn: if (fops->f_isfd) { @@ -1310,8 +1316,7 @@ done: FILEDESC_XUNLOCK(td->td_proc->p_fd); if (fp != NULL) fdrop(fp, td); - if (tkn != NULL) - knote_free(tkn); + knote_free(tkn); if (fops != NULL) kqueue_fo_release(filt); return (error); @@ -1507,10 +1512,6 @@ kqueue_scan(struct kqueue *kq, int maxev } else asbt = 0; marker = knote_alloc(1); - if (marker == NULL) { - error = ENOMEM; - goto done_nl; - } marker->kn_status = KN_MARKER; KQ_LOCK(kq); @@ -2385,15 +2386,16 @@ SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_A static struct knote * knote_alloc(int waitok) { - return ((struct knote *)uma_zalloc(knote_zone, - (waitok ? M_WAITOK : M_NOWAIT)|M_ZERO)); + + return (uma_zalloc(knote_zone, (waitok ? M_WAITOK : M_NOWAIT) | + M_ZERO)); } static void knote_free(struct knote *kn) { - if (kn != NULL) - uma_zfree(knote_zone, kn); + + uma_zfree(knote_zone, kn); } /* From owner-svn-src-all@freebsd.org Tue Sep 1 13:51:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CF29C65BA; Tue, 1 Sep 2015 13:51:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 73B7D1FCA; Tue, 1 Sep 2015 13:51:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81Dp86I017778; Tue, 1 Sep 2015 13:51:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Dp8h5017776; Tue, 1 Sep 2015 13:51:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011351.t81Dp8h5017776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 13:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287365 - in head/sys/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, 01 Sep 2015 13:51:08 -0000 Author: andrew Date: Tue Sep 1 13:51:07 2015 New Revision: 287365 URL: https://svnweb.freebsd.org/changeset/base/287365 Log: Install the forth bits on arm64. For now limit it to just arm64 as on x86 these should have been installed as part of the regular loader. Modified: head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/arm64/Makefile.inc Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Sep 1 13:47:12 2015 (r287364) +++ head/sys/boot/efi/loader/Makefile Tue Sep 1 13:51:07 2015 (r287365) @@ -73,13 +73,13 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGIN .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common -FILES= loader.efi +FILES+= loader.efi FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -CLEANFILES= vers.c loader.efi +CLEANFILES+= vers.c loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} Modified: head/sys/boot/efi/loader/arch/arm64/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue Sep 1 13:47:12 2015 (r287364) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue Sep 1 13:51:07 2015 (r287365) @@ -9,3 +9,16 @@ CFLAGS+=-I${.CURDIR}/../../arm64/libarm6 SRCS+= cache.c CFLAGS+= -msoft-float -mgeneral-regs-only + +CLEANFILES+= loader.help + +loader.help: help.common + cat ${.ALLSRC} | \ + awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + +.if !defined(LOADER_ONLY) +.PATH: ${.CURDIR}/../../forth +.include "${.CURDIR}/../../forth/Makefile.inc" + +FILES+= loader.rc +.endif From owner-svn-src-all@freebsd.org Tue Sep 1 14:05:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2E689C6F05; Tue, 1 Sep 2015 14:05:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 AA2FFB24; Tue, 1 Sep 2015 14:05:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81E5Uxt025929; Tue, 1 Sep 2015 14:05:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81E5U0g025928; Tue, 1 Sep 2015 14:05:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509011405.t81E5U0g025928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 1 Sep 2015 14:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287366 - 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, 01 Sep 2015 14:05:30 -0000 Author: kib Date: Tue Sep 1 14:05:29 2015 New Revision: 287366 URL: https://svnweb.freebsd.org/changeset/base/287366 Log: Exit notification for EVFILT_PROC removes knote from the knlist. In particular, this invalidates the knote kn_link linkage, making the SLIST_FOREACH() loop accessing undefined values (e.g. trashed by QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq lock is released or when influx is cleared, e.g. by knote_scan() for kqueue owning the knote, the iteration step would access freed memory. Use SLIST_FOREACH_SAFE() to fix iteration. Diagnosed by: avg Tested by: avg, lstewart, pawel Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Tue Sep 1 13:51:07 2015 (r287365) +++ head/sys/kern/kern_event.c Tue Sep 1 14:05:29 2015 (r287366) @@ -1930,7 +1930,7 @@ void knote(struct knlist *list, long hint, int lockflags) { struct kqueue *kq; - struct knote *kn; + struct knote *kn, *tkn; int error; if (list == NULL) @@ -1942,14 +1942,13 @@ knote(struct knlist *list, long hint, in list->kl_lock(list->kl_lockarg); /* - * If we unlock the list lock (and set KN_INFLUX), we can eliminate - * the kqueue scheduling, but this will introduce four - * lock/unlock's for each knote to test. If we do, continue to use - * SLIST_FOREACH, SLIST_FOREACH_SAFE is not safe in our case, it is - * only safe if you want to remove the current item, which we are - * not doing. + * If we unlock the list lock (and set KN_INFLUX), we can + * eliminate the kqueue scheduling, but this will introduce + * four lock/unlock's for each knote to test. Also, marker + * would be needed to keep iteration position, since filters + * or other threads could remove events. */ - SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { + SLIST_FOREACH_SAFE(kn, &list->kl_list, kn_selnext, tkn) { kq = kn->kn_kq; KQ_LOCK(kq); if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { From owner-svn-src-all@freebsd.org Tue Sep 1 14:53:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62F539C8A82; Tue, 1 Sep 2015 14:53:11 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-vk0-x22f.google.com (mail-vk0-x22f.google.com [IPv6:2607:f8b0: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 27B76CE6; Tue, 1 Sep 2015 14:53:11 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by vkbf67 with SMTP id f67so52673872vkb.0; Tue, 01 Sep 2015 07:53:10 -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=faBbrJV5xw7Nchz6AvT+HBoTlqkPmKlRwttNjM2a6m0=; b=Od3i3RoPjyIPuyPqFBmOfMkLMXO8welRzQbmHVfcilcfjbRvEN80dGxriywqsF7zwv K2FwnMJLRI5i1HdUlOVtHSuIOdcwMeV0zSD/RPHdDtzMgrF2OcvOGxo19LnsACIsHEhm gcik+M3EyzX2su4FrLki4O+XdY5tSFJfmsERCPSwrOLXscfn9BnMLyTM7mj+1MbsQpPn T82bocsyGFys487WDKBeJ+XNyocHT+z6VyRbqzNb4Xblezb56ycTqkV4zG3kvVdv9kMY riFz61NLdLUrqbB+oWL3lL5+aEPT0cnO2uxDB6xpd9mn6khGymmFXBpMJn8RgIgsfShe kymw== MIME-Version: 1.0 X-Received: by 10.52.246.132 with SMTP id xw4mr31121530vdc.29.1441119190119; Tue, 01 Sep 2015 07:53:10 -0700 (PDT) Received: by 10.31.182.20 with HTTP; Tue, 1 Sep 2015 07:53:10 -0700 (PDT) In-Reply-To: <201509010834.t818YjCX089147@repo.freebsd.org> References: <201509010834.t818YjCX089147@repo.freebsd.org> Date: Tue, 1 Sep 2015 09:53:10 -0500 Message-ID: Subject: Re: svn commit: r287350 - head/lib/libc/rpc From: Benjamin Kaduk To: Craig Rodrigues Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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, 01 Sep 2015 14:53:11 -0000 On Tue, Sep 1, 2015 at 3:34 AM, Craig Rodrigues wrote: > Author: rodrigc > Date: Tue Sep 1 08:34:44 2015 > New Revision: 287350 > URL: https://svnweb.freebsd.org/changeset/base/287350 > > Log: > Use ANSI C prototypes. > > Eliminates gcc 4.9 warnings. > > Modified: > head/lib/libc/rpc/auth_des.c > head/lib/libc/rpc/auth_none.c > head/lib/libc/rpc/rpcb_clnt.c > head/lib/libc/rpc/rpcdname.c > head/lib/libc/rpc/svc_auth_des.c > > Modified: head/lib/libc/rpc/auth_des.c > Not picking on Craig, since he's just building with GCC 4.9, but maybe it's time to start getting rid of auth_des and svc_auth_des? -Ben > > ============================================================================== > --- head/lib/libc/rpc/auth_des.c Tue Sep 1 08:29:39 2015 > (r287349) > +++ head/lib/libc/rpc/auth_des.c Tue Sep 1 08:34:44 2015 > (r287350) > @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); > > extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *); > extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *); > -extern int key_encryptsession_pk(); > +extern int key_encryptsession_pk(char *, netobj *, des_block *); > > extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char > *, > char **, char **); > > Modified: head/lib/libc/rpc/svc_auth_des.c > > ============================================================================== > --- head/lib/libc/rpc/svc_auth_des.c Tue Sep 1 08:29:39 2015 > (r287349) > +++ head/lib/libc/rpc/svc_auth_des.c Tue Sep 1 08:34:44 2015 > (r287350) > @@ -90,11 +90,11 @@ struct cache_entry { > static struct cache_entry *authdes_cache/* [AUTHDES_CACHESZ] */; > static short *authdes_lru/* [AUTHDES_CACHESZ] */; > > -static void cache_init(); /* initialize the cache */ > -static short cache_spot(); /* find an entry in the cache */ > +static void cache_init(void); /* initialize the cache */ > +static short cache_spot(des_block *, char *, struct timeval *); /* find > an entry in the cache */ > static void cache_ref(short sid); /* note that sid was ref'd */ > > -static void invalidate(); /* invalidate entry in cache */ > +static void invalidate(char *); /* invalidate entry in cache */ > > /* > * cache statistics > @@ -353,7 +353,7 @@ _svcauth_des(struct svc_req *rqst, struc > * Initialize the cache > */ > static void > -cache_init() > +cache_init(void) > { > int i; > > @@ -376,7 +376,7 @@ cache_init() > * Find the lru victim > */ > static short > -cache_victim() > +cache_victim(void) > { > return (authdes_lru[AUTHDES_CACHESZ-1]); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Tue Sep 1 15:26:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBA959C79A3; Tue, 1 Sep 2015 15:26:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 BC7571EC6; Tue, 1 Sep 2015 15:26:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81FQMXf059637; Tue, 1 Sep 2015 15:26:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81FQMIL059635; Tue, 1 Sep 2015 15:26:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011526.t81FQMIL059635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 15:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287367 - head/sys/dev/mmc/host 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, 01 Sep 2015 15:26:23 -0000 Author: andrew Date: Tue Sep 1 15:26:21 2015 New Revision: 287367 URL: https://svnweb.freebsd.org/changeset/base/287367 Log: Finish allowing the dwmmc driver to be subclassed, move the softc to a new header, along with the hwtype enum, device attach prototype, and driver_t. Sponsored by: ABT Systems Ltd Added: head/sys/dev/mmc/host/dwmmc_var.h (contents, props changed) Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 14:05:29 2015 (r287366) +++ head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 15:26:21 2015 (r287367) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "mmcbr_if.h" @@ -115,39 +116,6 @@ struct idmac_desc { #define DESC_SIZE (sizeof(struct idmac_desc) * DESC_MAX) #define DEF_MSIZE 0x2 /* Burst size of multiple transaction */ -struct dwmmc_softc { - struct resource *res[2]; - device_t dev; - void *intr_cookie; - struct mmc_host host; - struct mtx sc_mtx; - struct mmc_request *req; - struct mmc_command *curcmd; - uint32_t flags; - uint32_t hwtype; - uint32_t use_auto_stop; - uint32_t use_pio; - uint32_t pwren_inverted; - u_int desc_count; - - bus_dma_tag_t desc_tag; - bus_dmamap_t desc_map; - struct idmac_desc *desc_ring; - bus_addr_t desc_ring_paddr; - bus_dma_tag_t buf_tag; - bus_dmamap_t buf_map; - - uint32_t bus_busy; - uint32_t dto_rcvd; - uint32_t acd_rcvd; - uint32_t cmd_done; - uint32_t bus_hz; - uint32_t fifo_depth; - uint32_t num_slots; - uint32_t sdr_timing; - uint32_t ddr_timing; -}; - static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); static int dma_done(struct dwmmc_softc *, struct mmc_command *); @@ -161,13 +129,6 @@ static struct resource_spec dwmmc_spec[] { -1, 0 } }; -enum { - HWTYPE_NONE, - HWTYPE_ALTERA, - HWTYPE_EXYNOS, - HWTYPE_ROCKCHIP, -}; - #define HWTYPE_MASK (0x0000ffff) #define HWFLAG_MASK (0xffff << 16) @@ -534,7 +495,7 @@ dwmmc_probe(device_t dev) return (BUS_PROBE_DEFAULT); } -static int +int dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; @@ -544,7 +505,10 @@ dwmmc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (sc->hwtype == HWTYPE_NONE) { + sc->hwtype = + ofw_bus_search_compatible(dev, compat_data)->ocd_data; + } /* Why not to use Auto Stop? It save a hundred of irq per second */ sc->use_auto_stop = 1; @@ -573,7 +537,8 @@ dwmmc_attach(device_t dev) device_printf(dev, "Hardware version ID is %04x\n", READ4(sc, SDMMC_VERID) & 0xffff); - sc->desc_count = DESC_MAX; + if (sc->desc_count == 0) + sc->desc_count = DESC_MAX; if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { sc->use_pio = 1; @@ -648,7 +613,7 @@ dwmmc_attach(device_t dev) sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = MMC_CAP_4_BIT_DATA; - device_add_child(dev, "mmc", 0); + device_add_child(dev, "mmc", -1); return (bus_generic_attach(dev)); } @@ -1202,7 +1167,7 @@ static device_method_t dwmmc_methods[] = DEVMETHOD_END }; -static driver_t dwmmc_driver = { +driver_t dwmmc_driver = { "dwmmc", dwmmc_methods, sizeof(struct dwmmc_softc), Added: head/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mmc/host/dwmmc_var.h Tue Sep 1 15:26:21 2015 (r287367) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 DEV_MMC_HOST_DWMMC_VAR_H +#define DEV_MMC_HOST_DWMMC_VAR_H + +enum { + HWTYPE_NONE, + HWTYPE_ALTERA, + HWTYPE_EXYNOS, + HWTYPE_HISILICON, + HWTYPE_ROCKCHIP, +}; + +struct dwmmc_softc { + struct resource *res[2]; + device_t dev; + void *intr_cookie; + struct mmc_host host; + struct mtx sc_mtx; + struct mmc_request *req; + struct mmc_command *curcmd; + uint32_t flags; + uint32_t hwtype; + uint32_t use_auto_stop; + uint32_t use_pio; + uint32_t pwren_inverted; + u_int desc_count; + + bus_dma_tag_t desc_tag; + bus_dmamap_t desc_map; + struct idmac_desc *desc_ring; + bus_addr_t desc_ring_paddr; + bus_dma_tag_t buf_tag; + bus_dmamap_t buf_map; + + uint32_t bus_busy; + uint32_t dto_rcvd; + uint32_t acd_rcvd; + uint32_t cmd_done; + uint32_t bus_hz; + uint32_t fifo_depth; + uint32_t num_slots; + uint32_t sdr_timing; + uint32_t ddr_timing; +}; + +extern driver_t dwmmc_driver; + +int dwmmc_attach(device_t); + +#endif From owner-svn-src-all@freebsd.org Tue Sep 1 15:28:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCFB19C7AE5; Tue, 1 Sep 2015 15:28:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 CE8E11E1; Tue, 1 Sep 2015 15:28:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81FSacR059894; Tue, 1 Sep 2015 15:28:36 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81FSaZ2059893; Tue, 1 Sep 2015 15:28:36 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201509011528.t81FSaZ2059893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 1 Sep 2015 15:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287368 - head/release 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, 01 Sep 2015 15:28:37 -0000 Author: gjb Date: Tue Sep 1 15:28:35 2015 New Revision: 287368 URL: https://svnweb.freebsd.org/changeset/base/287368 Log: Remove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant builds, and prepend it to SNAPSHOT_DATE to prevent a trailing '-' in the final box name for a release build. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vagrant Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Tue Sep 1 15:26:21 2015 (r287367) +++ head/release/Makefile.vagrant Tue Sep 1 15:28:35 2015 (r287368) @@ -17,11 +17,11 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +%Y%m%d +SNAPSHOT_DATE!= date +-%Y%m%d .endif VAGRANT_VERSION!= date +%Y.%m.%d -VAGRANT_TARGET:= ${OSRELEASE}-${SNAPSHOT_DATE} +VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE} .if !empty(CLOUDWARE) . for _PROVIDER in ${CLOUDWARE} . if ${_PROVIDER:MVAGRANT*} From owner-svn-src-all@freebsd.org Tue Sep 1 15:43:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D9BD9C64DA; Tue, 1 Sep 2015 15:43:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6EBC01010; Tue, 1 Sep 2015 15:43:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81Fhvx3068020; Tue, 1 Sep 2015 15:43:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81FhvxT068019; Tue, 1 Sep 2015 15:43:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011543.t81FhvxT068019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 15:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287369 - 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: Tue, 01 Sep 2015 15:43:57 -0000 Author: andrew Date: Tue Sep 1 15:43:56 2015 New Revision: 287369 URL: https://svnweb.freebsd.org/changeset/base/287369 Log: Ensure we use calculate_first_tls_offset, even if the main program doesn't have TLS program header. This is needed on architectures with Variant I tls, that is arm, arm64, mips, and powerpc. These place the thread control block at the start of the buffer and, without this, this data may be trashed. This appears to not be an issue on mips or powerpc as they include a second adjustment to move the thread local data, however this is on arm64 (with a future change to fix placing this data), and should be on arm. I am unable to trigger this on arm, even after changing the code to move the data around to make it more likely to be hit. This is most likely because my tests didn't use the variable in offset 0. Reviewed by: kib MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Sep 1 15:28:35 2015 (r287368) +++ head/libexec/rtld-elf/rtld.c Tue Sep 1 15:43:56 2015 (r287369) @@ -4611,7 +4611,7 @@ allocate_tls_offset(Obj_Entry *obj) return true; } - if (obj->tlsindex == 1) + if (tls_last_offset == 0) off = calculate_first_tls_offset(obj->tlssize, obj->tlsalign); else off = calculate_tls_offset(tls_last_offset, tls_last_size, From owner-svn-src-all@freebsd.org Tue Sep 1 15:57:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F3309C6D1E; Tue, 1 Sep 2015 15:57:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 DA1101B41; Tue, 1 Sep 2015 15:57:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81Fv4kQ072560; Tue, 1 Sep 2015 15:57:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Fv4Yh072558; Tue, 1 Sep 2015 15:57:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011557.t81Fv4Yh072558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 15:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287370 - 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: Tue, 01 Sep 2015 15:57:05 -0000 Author: andrew Date: Tue Sep 1 15:57:03 2015 New Revision: 287370 URL: https://svnweb.freebsd.org/changeset/base/287370 Log: Fix how we place each objects thread local data. The code used was based on the Variant II code, however arm64 uses Variant I. The former placed the thread pointer after the data, pointing at the thread control block, while the latter places these before said data. Because of this we need to use the size of the previous entry to calculate where to place the current entry. We also need to reserve 16 bytes at the start for the thread control block. This also fixes the value of TLS_TCB_SIZE to be correct. This is the size of two unsigned longs, i.e. 2 * 8 bytes. While here remove the bogus adjustment of the pointer in the R_AARCH64_TLS_TPREL64 case. It should be the offset of the data relative to the thread pointer, including the thread control block. Sponsored by: ABT Systems Ltd Modified: head/libexec/rtld-elf/aarch64/reloc.c head/libexec/rtld-elf/aarch64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/reloc.c ============================================================================== --- head/libexec/rtld-elf/aarch64/reloc.c Tue Sep 1 15:43:56 2015 (r287369) +++ head/libexec/rtld-elf/aarch64/reloc.c Tue Sep 1 15:57:03 2015 (r287370) @@ -381,7 +381,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } *where = def->st_value + rela->r_addend + - defobj->tlsoffset - TLS_TCB_SIZE; + defobj->tlsoffset; break; case R_AARCH64_RELATIVE: *where = (Elf_Addr)(obj->relocbase + rela->r_addend); Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Tue Sep 1 15:43:56 2015 (r287369) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Tue Sep 1 15:57:03 2015 (r287370) @@ -64,12 +64,12 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(size, align) + round(16, align) #define calculate_tls_offset(prev_offset, prev_size, size, align) \ - round((prev_offset) + (size), align) + round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) -#define TLS_TCB_SIZE 8 +#define TLS_TCB_SIZE 16 typedef struct { unsigned long ti_module; unsigned long ti_offset; From owner-svn-src-all@freebsd.org Tue Sep 1 16:18:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 871149C7A19; Tue, 1 Sep 2015 16:18:53 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5264DF51; Tue, 1 Sep 2015 16:18:52 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.15.0.59/8.15.0.59) with SMTP id t81GF1kp012726; Tue, 1 Sep 2015 11:18:45 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp2.rice.edu with ESMTP id 1wk7sf9m2m-1; Tue, 01 Sep 2015 11:18:45 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.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 mh11.mail.rice.edu (Postfix) with ESMTPSA id 0C9BA4C03B8; Tue, 1 Sep 2015 11:18:45 -0500 (CDT) Message-ID: <55E5CFE3.2020801@rice.edu> Date: Tue, 01 Sep 2015 11:18:43 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: hiren panchasara , Alan Cox CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287344 - head/sys/vm References: <201509010621.t816LCZ4034925@repo.freebsd.org> <20150901063616.GA68814@strugglingcoder.info> In-Reply-To: <20150901063616.GA68814@strugglingcoder.info> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1509010246 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, 01 Sep 2015 16:18:53 -0000 On 09/01/2015 01:36, hiren panchasara wrote: > Hi Alan, > > On 09/01/15 at 06:21P, Alan Cox wrote: >> Author: alc >> Date: Tue Sep 1 06:21:12 2015 >> New Revision: 287344 >> URL: https://svnweb.freebsd.org/changeset/base/287344 >> >> Log: >> Handle held pages earlier in the inactive queue scan. >> > Is this fixing a bug or is it just an enhancement? Can you share more > details on what prompted this commit? The latter. The objective is to avoid spending additional time, i.e., cycles, on pages that will not move from their current position in the inactive queue. Alan From owner-svn-src-all@freebsd.org Tue Sep 1 16:25:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295C69C7FA5; Tue, 1 Sep 2015 16:25:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0D9DC19C2; Tue, 1 Sep 2015 16:25:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81GPD2t085941; Tue, 1 Sep 2015 16:25:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81GPD7s085938; Tue, 1 Sep 2015 16:25:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011625.t81GPD7s085938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 16:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287371 - in head/sys: arm64/conf conf dev/mmc/host 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, 01 Sep 2015 16:25:14 -0000 Author: andrew Date: Tue Sep 1 16:25:12 2015 New Revision: 287371 URL: https://svnweb.freebsd.org/changeset/base/287371 Log: Add support for the DesignWare MMC hardware in the HiSilicon hi6220. This SoC is used in the HiKey board from 96boards. Currently on the SD card is working on the HiKey, as such devices 0 and 2 will need to be disabled, for example by adding the following to loader.conf: hint.hisi_dwmmc.0.disabled=1 hint.hisi_dwmmc.2.disabled=1 Relnotes: yes (Hikey board booting) Sponsored by: ABT Systems Ltd Added: head/sys/dev/mmc/host/dwmmc_hisi.c (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 Tue Sep 1 15:57:03 2015 (r287370) +++ head/sys/arm64/conf/GENERIC Tue Sep 1 16:25:12 2015 (r287371) @@ -107,6 +107,11 @@ device ahci device scbus device da +# MMC/SD/SDIO Card slot support +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device dwmmc + # Serial (COM) ports device uart # Generic UART driver device pl011 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 1 15:57:03 2015 (r287370) +++ head/sys/conf/files.arm64 Tue Sep 1 16:25:12 2015 (r287371) @@ -59,6 +59,8 @@ dev/acpica/acpi_if.m optional acpi dev/fdt/fdt_arm64.c optional fdt dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc +dev/mmc/host/dwmmc.c optional dwmmc +dev/mmc/host/dwmmc_hisi.c optional dwmmc soc_hisi_hi6220 dev/ofw/ofw_cpu.c optional fdt dev/pci/pci_host_generic.c optional pci fdt dev/psci/psci.c optional psci Added: head/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mmc/host/dwmmc_hisi.c Tue Sep 1 16:25:12 2015 (r287371) @@ -0,0 +1,96 @@ +/* + * Copyright 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$"); + +#include +#include +#include +#include + +#include + +#include + +#include + +#include + +static device_probe_t hisi_dwmmc_probe; +static device_attach_t hisi_dwmmc_attach; + +static int +hisi_dwmmc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "hisilicon,hi6220-dw-mshc")) + return (ENXIO); + + device_set_desc(dev, "Synopsys DesignWare Mobile " + "Storage Host Controller (HiSilicon)"); + + return (BUS_PROBE_VENDOR); +} + +static int +hisi_dwmmc_attach(device_t dev) +{ + struct dwmmc_softc *sc; + + sc = device_get_softc(dev); + sc->hwtype = HWTYPE_HISILICON; + /* TODO: Calculate this from a clock driver */ + sc->bus_hz = 24000000; /* 24MHz */ + + /* + * ARM64TODO: This is likely because we lack support for + * DMA when the controller is not cache-coherent on arm64. + */ + sc->use_pio = 1; + sc->desc_count = 1; + + return (dwmmc_attach(dev)); +} + +static device_method_t hisi_dwmmc_methods[] = { + /* bus interface */ + DEVMETHOD(device_probe, hisi_dwmmc_probe), + DEVMETHOD(device_attach, hisi_dwmmc_attach), + + DEVMETHOD_END +}; + +static devclass_t hisi_dwmmc_devclass; + +DEFINE_CLASS_1(hisi_dwmmc, hisi_dwmmc_driver, hisi_dwmmc_methods, + sizeof(struct dwmmc_softc), dwmmc_driver); +DRIVER_MODULE(hisi_dwmmc, simplebus, hisi_dwmmc_driver, + hisi_dwmmc_devclass, 0, 0); From owner-svn-src-all@freebsd.org Tue Sep 1 16:28:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F0B9C808B; Tue, 1 Sep 2015 16:28:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C47CC1BF8; Tue, 1 Sep 2015 16:28:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81GS8ec086107; Tue, 1 Sep 2015 16:28:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81GS7X8086099; Tue, 1 Sep 2015 16:28:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509011628.t81GS7X8086099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Sep 2015 16:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287372 - head/sys/cam/ctl 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, 01 Sep 2015 16:28:09 -0000 Author: mav Date: Tue Sep 1 16:28:06 2015 New Revision: 287372 URL: https://svnweb.freebsd.org/changeset/base/287372 Log: Make most of port methods optional and remove bunch of dummies. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_tpc_local.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl.c Tue Sep 1 16:28:06 2015 (r287372) @@ -3100,7 +3100,8 @@ ctl_lun_map_init(struct ctl_port *port) return (ENOMEM); for (i = 0; i < CTL_MAX_LUNS; i++) port->lun_map[i] = UINT32_MAX; - if (port->status & CTL_PORT_STATUS_ONLINE) { + if (port->status & CTL_PORT_STATUS_ONLINE && + port->lun_disable != NULL) { STAILQ_FOREACH(lun, &softc->lun_list, links) port->lun_disable(port->targ_lun_arg, lun->lun); } @@ -3117,7 +3118,8 @@ ctl_lun_map_deinit(struct ctl_port *port return (0); free(port->lun_map, M_CTL); port->lun_map = NULL; - if (port->status & CTL_PORT_STATUS_ONLINE) { + if (port->status & CTL_PORT_STATUS_ONLINE && + port->lun_enable != NULL) { STAILQ_FOREACH(lun, &softc->lun_list, links) port->lun_enable(port->targ_lun_arg, lun->lun); } @@ -3137,7 +3139,8 @@ ctl_lun_map_set(struct ctl_port *port, u } old = port->lun_map[plun]; port->lun_map[plun] = glun; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS) + if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS && + port->lun_enable != NULL) port->lun_enable(port->targ_lun_arg, plun); return (0); } @@ -3151,7 +3154,8 @@ ctl_lun_map_unset(struct ctl_port *port, return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS) + if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS && + port->lun_disable != NULL) port->lun_disable(port->targ_lun_arg, plun); return (0); } @@ -4319,7 +4323,7 @@ ctl_enable_lun(struct ctl_be_lun *be_lun for (port = STAILQ_FIRST(&softc->port_list); port != NULL; port = nport) { nport = STAILQ_NEXT(port, links); if ((port->status & CTL_PORT_STATUS_ONLINE) == 0 || - port->lun_map != NULL) + port->lun_map != NULL || port->lun_enable == NULL) continue; /* @@ -4366,9 +4370,9 @@ ctl_disable_lun(struct ctl_be_lun *be_lu STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0 || - port->lun_map != NULL) + port->lun_map != NULL || port->lun_disable == NULL) continue; - mtx_unlock(&softc->ctl_lock); + /* * Drop the lock before we call the frontend's disable * routine, to avoid lock order reversals. @@ -4376,6 +4380,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu * XXX KDM what happens if the frontend list changes while * we're traversing it? It's unlikely, but should be handled. */ + mtx_unlock(&softc->ctl_lock); retval = port->lun_disable(port->targ_lun_arg, lun->lun); mtx_lock(&softc->ctl_lock); if (retval != 0) { Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl_frontend.c Tue Sep 1 16:28:06 2015 (r287372) @@ -304,17 +304,21 @@ ctl_port_online(struct ctl_port *port) struct ctl_lun *lun; uint32_t l; - if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS) - continue; - port->lun_enable(port->targ_lun_arg, l); + if (port->lun_enable != NULL) { + if (port->lun_map) { + for (l = 0; l < CTL_MAX_LUNS; l++) { + if (ctl_lun_map_from_port(port, l) >= + CTL_MAX_LUNS) + continue; + port->lun_enable(port->targ_lun_arg, l); + } + } else { + STAILQ_FOREACH(lun, &softc->lun_list, links) + port->lun_enable(port->targ_lun_arg, lun->lun); } - } else { - STAILQ_FOREACH(lun, &softc->lun_list, links) - port->lun_enable(port->targ_lun_arg, lun->lun); } - port->port_online(port->onoff_arg); + if (port->port_online != NULL) + port->port_online(port->onoff_arg); /* XXX KDM need a lock here? */ port->status |= CTL_PORT_STATUS_ONLINE; } @@ -326,16 +330,20 @@ ctl_port_offline(struct ctl_port *port) struct ctl_lun *lun; uint32_t l; - port->port_offline(port->onoff_arg); - if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS) - continue; - port->lun_disable(port->targ_lun_arg, l); + if (port->port_offline != NULL) + port->port_offline(port->onoff_arg); + if (port->lun_disable != NULL) { + if (port->lun_map) { + for (l = 0; l < CTL_MAX_LUNS; l++) { + if (ctl_lun_map_from_port(port, l) >= + CTL_MAX_LUNS) + continue; + port->lun_disable(port->targ_lun_arg, l); + } + } else { + STAILQ_FOREACH(lun, &softc->lun_list, links) + port->lun_disable(port->targ_lun_arg, lun->lun); } - } else { - STAILQ_FOREACH(lun, &softc->lun_list, links) - port->lun_disable(port->targ_lun_arg, lun->lun); } /* XXX KDM need a lock here? */ port->status &= ~CTL_PORT_STATUS_ONLINE; Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Sep 1 16:28:06 2015 (r287372) @@ -98,8 +98,6 @@ int cfcs_init(void); static void cfcs_poll(struct cam_sim *sim); static void cfcs_online(void *arg); static void cfcs_offline(void *arg); -static int cfcs_lun_enable(void *arg, int lun_id); -static int cfcs_lun_disable(void *arg, int lun_id); static void cfcs_datamove(union ctl_io *io); static void cfcs_done(union ctl_io *io); void cfcs_action(struct cam_sim *sim, union ccb *ccb); @@ -152,9 +150,6 @@ cfcs_init(void) port->port_online = cfcs_online; port->port_offline = cfcs_offline; port->onoff_arg = softc; - port->lun_enable = cfcs_lun_enable; - port->lun_disable = cfcs_lun_disable; - port->targ_lun_arg = softc; port->fe_datamove = cfcs_datamove; port->fe_done = cfcs_done; @@ -301,17 +296,6 @@ cfcs_offline(void *arg) cfcs_onoffline(arg, /*online*/ 0); } -static int -cfcs_lun_enable(void *arg, int lun_id) -{ - return (0); -} -static int -cfcs_lun_disable(void *arg, int lun_id) -{ - return (0); -} - /* * This function is very similar to ctl_ioctl_do_datamove(). Is there a * way to combine the functionality? Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Tue Sep 1 16:28:06 2015 (r287372) @@ -65,10 +65,6 @@ static struct cfi_softc cfi_softc; static int cfi_init(void); static void cfi_shutdown(void); -static void cfi_online(void *arg); -static void cfi_offline(void *arg); -static int cfi_lun_enable(void *arg, int lun_id); -static int cfi_lun_disable(void *arg, int lun_id); static void cfi_datamove(union ctl_io *io); static void cfi_done(union ctl_io *io); @@ -93,12 +89,6 @@ cfi_init(void) port->port_type = CTL_PORT_IOCTL; port->num_requested_ctl_io = 100; port->port_name = "ioctl"; - port->port_online = cfi_online; - port->port_offline = cfi_offline; - port->onoff_arg = &isoftc; - port->lun_enable = cfi_lun_enable; - port->lun_disable = cfi_lun_disable; - port->targ_lun_arg = &isoftc; port->fe_datamove = cfi_datamove; port->fe_done = cfi_done; port->max_targets = 1; @@ -125,30 +115,6 @@ cfi_shutdown(void) printf("%s: ctl_frontend_deregister() failed\n", __func__); } -static void -cfi_online(void *arg) -{ -} - -static void -cfi_offline(void *arg) -{ -} - -static int -cfi_lun_enable(void *arg, int lun_id) -{ - - return (0); -} - -static int -cfi_lun_disable(void *arg, int lun_id) -{ - - return (0); -} - /* * Data movement routine for the CTL ioctl frontend port. */ Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Sep 1 16:28:06 2015 (r287372) @@ -146,8 +146,6 @@ int cfiscsi_init(void); static void cfiscsi_online(void *arg); static void cfiscsi_offline(void *arg); static int cfiscsi_info(void *arg, struct sbuf *sb); -static int cfiscsi_lun_enable(void *arg, int lun_id); -static int cfiscsi_lun_disable(void *arg, int lun_id); static int cfiscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); static void cfiscsi_datamove(union ctl_io *io); @@ -2100,9 +2098,6 @@ cfiscsi_ioctl_port_create(struct ctl_req port->port_offline = cfiscsi_offline; port->port_info = cfiscsi_info; port->onoff_arg = ct; - port->lun_enable = cfiscsi_lun_enable; - port->lun_disable = cfiscsi_lun_disable; - port->targ_lun_arg = ct; port->fe_datamove = cfiscsi_datamove; port->fe_done = cfiscsi_done; @@ -2369,20 +2364,6 @@ cfiscsi_target_find_or_create(struct cfi return (newct); } -static int -cfiscsi_lun_enable(void *arg, int lun_id) -{ - - return (0); -} - -static int -cfiscsi_lun_disable(void *arg, int lun_id) -{ - - return (0); -} - static void cfiscsi_datamove_in(union ctl_io *io) { Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl_tpc_local.c Tue Sep 1 16:28:06 2015 (r287372) @@ -66,10 +66,6 @@ static struct tpcl_softc tpcl_softc; static int tpcl_init(void); static void tpcl_shutdown(void); -static void tpcl_online(void *arg); -static void tpcl_offline(void *arg); -static int tpcl_lun_enable(void *arg, int lun_id); -static int tpcl_lun_disable(void *arg, int lun_id); static void tpcl_datamove(union ctl_io *io); static void tpcl_done(union ctl_io *io); @@ -97,12 +93,6 @@ tpcl_init(void) port->port_type = CTL_PORT_INTERNAL; port->num_requested_ctl_io = 100; port->port_name = "tpc"; - port->port_online = tpcl_online; - port->port_offline = tpcl_offline; - port->onoff_arg = tsoftc; - port->lun_enable = tpcl_lun_enable; - port->lun_disable = tpcl_lun_disable; - port->targ_lun_arg = tsoftc; port->fe_datamove = tpcl_datamove; port->fe_done = tpcl_done; port->max_targets = 1; @@ -141,30 +131,6 @@ tpcl_shutdown(void) } static void -tpcl_online(void *arg) -{ -} - -static void -tpcl_offline(void *arg) -{ -} - -static int -tpcl_lun_enable(void *arg, int lun_id) -{ - - return (0); -} - -static int -tpcl_lun_disable(void *arg, int lun_id) -{ - - return (0); -} - -static void tpcl_datamove(union ctl_io *io) { struct ctl_sg_entry *ext_sglist, *kern_sglist; From owner-svn-src-all@freebsd.org Tue Sep 1 17:13:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94DF19C78D1; Tue, 1 Sep 2015 17:13:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 78F841E72; Tue, 1 Sep 2015 17:13:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81HD594008013; Tue, 1 Sep 2015 17:13:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81HD4xI008010; Tue, 1 Sep 2015 17:13:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509011713.t81HD4xI008010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 1 Sep 2015 17:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287373 - in head/sys: arm64/conf conf 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.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, 01 Sep 2015 17:13:05 -0000 Author: andrew Date: Tue Sep 1 17:13:04 2015 New Revision: 287373 URL: https://svnweb.freebsd.org/changeset/base/287373 Log: Add support for the dwc usb in the HiSilicon hi6220 in the HiKey board. For this we need to force the driver into host mode, as without this the driver fails to detect any devices. Relnotes: yes Sponsored by: ABT Systems Ltd Added: head/sys/dev/usb/controller/dwc_otg_hisi.c (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 Tue Sep 1 16:28:06 2015 (r287372) +++ head/sys/arm64/conf/GENERIC Tue Sep 1 17:13:04 2015 (r287373) @@ -116,6 +116,11 @@ device dwmmc device uart # Generic UART driver device pl011 +# USB support +options USB_DEBUG # enable debug msgs +device dwcotg # DWC OTG controller +device usb # USB Bus (required) + # Pseudo devices. device loop # Network loopback device random # Entropy device Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 1 16:28:06 2015 (r287372) +++ head/sys/conf/files.arm64 Tue Sep 1 17:13:04 2015 (r287373) @@ -67,6 +67,7 @@ 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 +dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220 kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard libkern/bcmp.c standard Added: head/sys/dev/usb/controller/dwc_otg_hisi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/dwc_otg_hisi.c Tue Sep 1 17:13:04 2015 (r287373) @@ -0,0 +1,97 @@ +/* + * Copyright 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$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static device_probe_t hisi_dwc_otg_probe; +static device_attach_t hisi_dwc_otg_attach; + +static int +hisi_dwc_otg_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "huawei,hisi-usb")) + return (ENXIO); + + device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (hisilicon)"); + + return (BUS_PROBE_VENDOR); +} + +static int +hisi_dwc_otg_attach(device_t dev) +{ + struct dwc_otg_fdt_softc *sc; + + /* Set the default to host mode. */ + /* TODO: Use vbus to detect this. */ + sc = device_get_softc(dev); + sc->sc_otg.sc_mode = DWC_MODE_HOST; + + return (dwc_otg_attach(dev)); +} + +static device_method_t hisi_dwc_otg_methods[] = { + /* bus interface */ + DEVMETHOD(device_probe, hisi_dwc_otg_probe), + DEVMETHOD(device_attach, hisi_dwc_otg_attach), + + DEVMETHOD_END +}; + +static devclass_t hisi_dwc_otg_devclass; + +DEFINE_CLASS_1(hisi_dwcotg, hisi_dwc_otg_driver, hisi_dwc_otg_methods, + sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver); +DRIVER_MODULE(hisi_dwcotg, simplebus, hisi_dwc_otg_driver, + hisi_dwc_otg_devclass, 0, 0); +MODULE_DEPEND(hisi_dwcotg, usb, 1, 1, 1); From owner-svn-src-all@freebsd.org Tue Sep 1 17:19:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C419C7B68; Tue, 1 Sep 2015 17:19:19 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::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 A1FF3299; Tue, 1 Sep 2015 17:19:19 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by qkbp67 with SMTP id p67so50610169qkb.3; Tue, 01 Sep 2015 10:19:18 -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=FfYdWkV7XRXciwVp3/3k1eV3c/0W2NIZrMYWPv4MBeQ=; b=NKQkNINbDHtFPmQ1Pe1ipl/AJ4Tt26mY/cob8blQTrvdiy7d4pTK7bp2keXhR8I8my ILotIfwMSeXiQ83Sv8FmIg1onc6xOSVa7VRlr48EVBe3gfriJykVhF0ltlV115fXNGT9 JmZSwyqeo0SkBqfND5TELhzMgtQIwHLrpVoqS+SmSPRlFU/nQgpcwQ/L+4Lc3wsmzExT Hy5VZ1rHRILGI9aKpeuj/eCPHPNBtIJZjKOkBcfA0z6goxRIy4567mO7/g0K7zWoYwZg g4804OQ2+Ze89/fzUPnQOfo4OJZTAhj6SHCGKMqRhBY0eaLOlOPgsq0FkDi+BJwHuve9 EYvw== MIME-Version: 1.0 X-Received: by 10.13.212.7 with SMTP id w7mr29613091ywd.14.1441127958766; Tue, 01 Sep 2015 10:19:18 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.37.99.3 with HTTP; Tue, 1 Sep 2015 10:19:18 -0700 (PDT) In-Reply-To: References: <201509010834.t818YjCX089147@repo.freebsd.org> Date: Tue, 1 Sep 2015 10:19:18 -0700 X-Google-Sender-Auth: 6b8CiM_V-9aVKFdhDoLvuDCuZqI Message-ID: Subject: Re: svn commit: r287350 - head/lib/libc/rpc From: Craig Rodrigues To: Benjamin Kaduk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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, 01 Sep 2015 17:19:20 -0000 On Tue, Sep 1, 2015 at 7:53 AM, Benjamin Kaduk wrote: > Not picking on Craig, since he's just building with GCC 4.9, but maybe > it's time to start getting rid of auth_des and svc_auth_des? > > If you have ideas as to the best way to do this, you might want to submit a patch and start a discussion on freebsd-arch. Since these files are part of libc, it is a core part of the system, so would need to be discussed there. -- Craig From owner-svn-src-all@freebsd.org Tue Sep 1 17:52:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665C69C70E2; Tue, 1 Sep 2015 17:52:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5755222C; Tue, 1 Sep 2015 17:52:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81HqiYn024258; Tue, 1 Sep 2015 17:52:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81HqiM6024257; Tue, 1 Sep 2015 17:52:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509011752.t81HqiM6024257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 1 Sep 2015 17:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287374 - head/usr.sbin/pmcstat 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, 01 Sep 2015 17:52:44 -0000 Author: jhb Date: Tue Sep 1 17:52:43 2015 New Revision: 287374 URL: https://svnweb.freebsd.org/changeset/base/287374 Log: Fix an off by one error in r283613: Like regular ffs(), CPU_FFS() returns 1 for CPU 0, etc. so the return value must be decremented to obtain the first valid CPU ID. Submitted by: fabient MFC after: 1 week Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Tue Sep 1 17:13:04 2015 (r287373) +++ head/usr.sbin/pmcstat/pmcstat.c Tue Sep 1 17:52:43 2015 (r287374) @@ -769,7 +769,7 @@ main(int argc, char **argv) ev->ev_count = -1; if (option == 'S' || option == 's') - ev->ev_cpu = CPU_FFS(&cpumask); + ev->ev_cpu = CPU_FFS(&cpumask) - 1; else ev->ev_cpu = PMC_CPU_ANY; From owner-svn-src-all@freebsd.org Tue Sep 1 18:26:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF269C8346; Tue, 1 Sep 2015 18:26:36 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BC8A113CB; Tue, 1 Sep 2015 18:26:36 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t81IQaux048358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Sep 2015 11:26:36 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t81IQaEO048357; Tue, 1 Sep 2015 11:26:36 -0700 (PDT) (envelope-from jmg) Date: Tue, 1 Sep 2015 11:26:36 -0700 From: John-Mark Gurney To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287366 - head/sys/kern Message-ID: <20150901182636.GO33167@funkthat.com> References: <201509011405.t81E5U0g025928@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201509011405.t81E5U0g025928@repo.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 01 Sep 2015 11:26:36 -0700 (PDT) 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, 01 Sep 2015 18:26:37 -0000 Konstantin Belousov wrote this message on Tue, Sep 01, 2015 at 14:05 +0000: > Author: kib > Date: Tue Sep 1 14:05:29 2015 > New Revision: 287366 > URL: https://svnweb.freebsd.org/changeset/base/287366 > > Log: > Exit notification for EVFILT_PROC removes knote from the knlist. In > particular, this invalidates the knote kn_link linkage, making the > SLIST_FOREACH() loop accessing undefined values (e.g. trashed by > QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq > lock is released or when influx is cleared, e.g. by knote_scan() for > kqueue owning the knote, the iteration step would access freed memory. > > Use SLIST_FOREACH_SAFE() to fix iteration. Please back this out immediately. I objected to this change, and you did not give me enough time to properly address this change. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@freebsd.org Tue Sep 1 18:57:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CC3D9C7342; Tue, 1 Sep 2015 18:57:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.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 009F7B60; Tue, 1 Sep 2015 18:57:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81IvwA8049252; Tue, 1 Sep 2015 18:57:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Ivw8U049249; Tue, 1 Sep 2015 18:57:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201509011857.t81Ivw8U049249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 1 Sep 2015 18:57: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: r287375 - stable/10/usr.sbin/ypserv 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, 01 Sep 2015 18:57:59 -0000 Author: asomers Date: Tue Sep 1 18:57:57 2015 New Revision: 287375 URL: https://svnweb.freebsd.org/changeset/base/287375 Log: MFC r286892 Serve /etc/eui64 via NIS. The C library already knows how to lookup eui64 entries from NIS. For example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes that. Modified: stable/10/usr.sbin/ypserv/Makefile.yp stable/10/usr.sbin/ypserv/ypinit.8 stable/10/usr.sbin/ypserv/ypinit.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ypserv/Makefile.yp ============================================================================== --- stable/10/usr.sbin/ypserv/Makefile.yp Tue Sep 1 17:52:43 2015 (r287374) +++ stable/10/usr.sbin/ypserv/Makefile.yp Tue Sep 1 18:57:57 2015 (r287375) @@ -103,6 +103,7 @@ YPMAPDIR = $(YPDIR)/$(DOMAIN) # passwd file will be generated from the master.passwd file automagically. # ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd) +EUI64 = $(YPSRCDIR)/eui64 # eui64 addresses (for firewire) BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd) HOSTS = $(YPSRCDIR)/hosts IPNODES = $(YPDIR)/ipnodes @@ -143,8 +144,8 @@ TARGETS= servers hosts networks protocol #TARGETS+= aliases # Sanity checks: filter out targets we can't build -# Note that we don't build the ethers or boorparams maps by default -# since /etc/ethers and /etc/bootparams are not likely to be present +# Note that we don't build the ethers, eui64, or boorparams maps by default +# since /etc/ethers, /etc/eui64 and /etc/bootparams are not likely to be present # on all systems. .if exists($(ETHERS)) TARGETS+= ethers @@ -152,6 +153,12 @@ TARGETS+= ethers ETHERS= /dev/null .endif +.if exists($(EUI64)) +TARGETS+= eui64 +.else +EUI64= /dev/null +.endif + .if exists($(BOOTPARAMS)) TARGETS+= bootparams .else @@ -195,6 +202,7 @@ IPNODES= /dev/null all: $(TARGETS) ethers: ethers.byname ethers.byaddr +eui64: eui64.byname eui64.byid bootparam: bootparams hosts: hosts.byname hosts.byaddr ipnodes: ipnodes.byname ipnodes.byaddr @@ -294,6 +302,32 @@ ethers.byaddr: $(ETHERS) @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi .endif +eui64.byname: $(EUI64) + @echo "Updating $@..." +.if ${EUI64} == "/dev/null" + @echo "EUI64 source file not found -- skipping" +.else + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$2"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \ + -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif + +eui64.byid: $(EUI64) + @echo "Updating $@..." +.if ${EUI64} == "/dev/null" + @echo "EUI64 source file not found -- skipping" +.else + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \ + -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif + bootparams: $(BOOTPARAMS) @echo "Updating $@..." Modified: stable/10/usr.sbin/ypserv/ypinit.8 ============================================================================== --- stable/10/usr.sbin/ypserv/ypinit.8 Tue Sep 1 17:52:43 2015 (r287374) +++ stable/10/usr.sbin/ypserv/ypinit.8 Tue Sep 1 18:57:57 2015 (r287375) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 1997 +.Dd August 18, 2015 .Dt YPINIT 8 .Os .Sh NAME @@ -147,6 +147,8 @@ can propagate updates on the master to a Bootparams source file .It Pa /etc/ethers Ethers data source file +.It Pa /etc/eui64 +EUI64 data source file .It Pa /etc/group Group source file .It Pa /etc/hosts Modified: stable/10/usr.sbin/ypserv/ypinit.sh ============================================================================== --- stable/10/usr.sbin/ypserv/ypinit.sh Tue Sep 1 17:52:43 2015 (r287374) +++ stable/10/usr.sbin/ypserv/ypinit.sh Tue Sep 1 18:57:57 2015 (r287375) @@ -14,8 +14,9 @@ MAPLIST="master.passwd.byname master.pas group.byname group.bygid hosts.byname hosts.byaddr services.byname \ rpc.byname rpc.bynumber networks.byname networks.byaddr netgroup \ netgroup.byuser netgroup.byhost netid.byname publickey.byname \ - bootparams ethers.byname ethers.byaddr amd.host mail.aliases \ - ypservers protocols.byname protocols.bynumber netmasks.byaddr" + bootparams ethers.byname ethers.byaddr eui64.byname eui64.byid \ + amd.host mail.aliases ypservers protocols.byname protocols.bynumber \ + netmasks.byaddr" ERROR_EXISTS="NO" umask 077 From owner-svn-src-all@freebsd.org Tue Sep 1 18:58:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F449C7396; Tue, 1 Sep 2015 18:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 309AECB4; Tue, 1 Sep 2015 18:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 29BC61945; Tue, 1 Sep 2015 18:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E4047FDB3; Tue, 1 Sep 2015 18:58:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id zzXAtODLAcGE; Tue, 1 Sep 2015 18:58:16 +0000 (UTC) Subject: Re: svn commit: r287366 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 88AF3FDAA References: <201509011405.t81E5U0g025928@repo.freebsd.org> <20150901182636.GO33167@funkthat.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <55E5F548.50007@FreeBSD.org> Date: Tue, 1 Sep 2015 11:58:16 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150901182636.GO33167@funkthat.com> Content-Type: text/plain; charset=windows-1252 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, 01 Sep 2015 18:58:19 -0000 On 9/1/15 11:26 AM, John-Mark Gurney wrote: > Konstantin Belousov wrote this message on Tue, Sep 01, 2015 at 14:05 +0000: >> Author: kib >> Date: Tue Sep 1 14:05:29 2015 >> New Revision: 287366 >> URL: https://svnweb.freebsd.org/changeset/base/287366 >> >> Log: >> Exit notification for EVFILT_PROC removes knote from the knlist. In >> particular, this invalidates the knote kn_link linkage, making the >> SLIST_FOREACH() loop accessing undefined values (e.g. trashed by >> QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq >> lock is released or when influx is cleared, e.g. by knote_scan() for >> kqueue owning the knote, the iteration step would access freed memory. >> >> Use SLIST_FOREACH_SAFE() to fix iteration. > > Please back this out immediately. > > I objected to this change, and you did not give me enough time to > properly address this change. > FWIW we've had the same change in the Isilon codebase for some time as well. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Tue Sep 1 19:04:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 526749C76D8; Tue, 1 Sep 2015 19:04:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.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 42F03128A; Tue, 1 Sep 2015 19:04:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81J45AC053307; Tue, 1 Sep 2015 19:04:05 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81J45CP053306; Tue, 1 Sep 2015 19:04:05 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201509011904.t81J45CP053306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 1 Sep 2015 19:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287376 - 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, 01 Sep 2015 19:04:05 -0000 Author: kp Date: Tue Sep 1 19:04:04 2015 New Revision: 287376 URL: https://svnweb.freebsd.org/changeset/base/287376 Log: pf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set If net.link.bridge.pfil_bridge is set we can end up thinking we're forwarding in pf_test6() because the rcvif and the ifp (output interface) are different. In that case we're bridging though, and the rcvif the the bridge member on which the packet was received and ifp is the bridge itself. If we'd set dir to PF_FWD we'd end up calling ip6_forward() which is incorrect. Instead check if the rcvif is a member of the ifp bridge. (In other words, the if_bridge is the ifp's softc). If that's the case we're not forwarding but bridging. PR: 202351 Reviewed by: eri Differential Revision: https://reviews.freebsd.org/D3534 Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Sep 1 18:57:57 2015 (r287375) +++ head/sys/netpfil/pf/pf.c Tue Sep 1 19:04:04 2015 (r287376) @@ -6085,7 +6085,17 @@ pf_test6(int dir, struct ifnet *ifp, str M_ASSERTPKTHDR(m); - if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) + /* Detect packet forwarding. + * If the input interface is different from the output interface we're + * forwarding. + * We do need to be careful about bridges. If the + * net.link.bridge.pfil_bridge sysctl is set we can be filtering on a + * bridge, so if the input interface is a bridge member and the output + * interface is its bridge we're not actually forwarding but bridging. + */ + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif + && (m->m_pkthdr.rcvif->if_bridge == NULL + || m->m_pkthdr.rcvif->if_bridge != ifp->if_softc)) fwdir = PF_FWD; if (!V_pf_status.running) From owner-svn-src-all@freebsd.org Tue Sep 1 21:18:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400EA9C7DDC; Tue, 1 Sep 2015 21:18:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 30F311F68; Tue, 1 Sep 2015 21:18:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LIYNJ007909; Tue, 1 Sep 2015 21:18:34 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81LIYAM007908; Tue, 1 Sep 2015 21:18:34 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012118.t81LIYAM007908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287378 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:18:34 -0000 Author: dteske Date: Tue Sep 1 21:18:33 2015 New Revision: 287378 URL: https://svnweb.freebsd.org/changeset/base/287378 Log: Remove `SYSRC_' prefix from $SYSRC_VERBOSE (prefix unnecessary since this is a non-inheritable attribute; was previously). MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 20:49:38 2015 (r287377) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:18:33 2015 (r287378) @@ -57,7 +57,7 @@ SHOW_EQUALS= SHOW_FILE= SHOW_NAME=1 SHOW_VALUE=1 -SYSRC_VERBOSE= +VERBOSE= ############################################################ FUNCTIONS @@ -240,11 +240,11 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag JAIL="$OPTARG";; n) SHOW_NAME=;; N) SHOW_VALUE=;; - q) QUIET=1 SYSRC_VERBOSE=;; + q) QUIET=1 VERBOSE=;; R) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-R' flag" "$pgm" ROOTDIR="$OPTARG";; - v) SYSRC_VERBOSE=1 QUIET=;; + v) VERBOSE=1 QUIET=;; x) DELETE=${DELETE:-1};; X) DELETE=2;; \?) usage;; @@ -300,7 +300,7 @@ fi SEP=': ' [ "$SHOW_FILE" ] && SHOW_EQUALS= [ "$SHOW_NAME" ] || SHOW_EQUALS= -[ "$SYSRC_VERBOSE" = "0" ] && SYSRC_VERBOSE= +[ "$VERBOSE" = "0" ] && VERBOSE= if [ ! "$SHOW_VALUE" ]; then SHOW_NAME=1 SHOW_EQUALS= @@ -315,7 +315,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then # Reconstruct the arguments that we want to carry-over # args=" - ${SYSRC_VERBOSE:+-v} + ${VERBOSE:+-v} ${QUIET:+-q} $( [ "$DELETE" = "1" ] && echo \ -x ) $( [ "$DELETE" = "2" ] && echo \ -X ) @@ -431,7 +431,7 @@ if [ "$SHOW_ALL" ]; then IFS="$IFS|" EXCEPT="IFS|EXCEPT|PATH|RC_DEFAULTS|OPTIND|DESCRIBE|SEP" EXCEPT="$EXCEPT|DELETE|SHOW_ALL|SHOW_EQUALS|SHOW_NAME" - EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|SYSRC_VERBOSE|RC_CONFS" + EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|VERBOSE|RC_CONFS" EXCEPT="$EXCEPT|pgm|SUCCESS|FAILURE|CHECK_ONLY" EXCEPT="$EXCEPT|f_sysrc_desc_awk|f_sysrc_delete_awk" @@ -499,7 +499,7 @@ if [ "$SHOW_ALL" ]; then continue fi - [ "$SYSRC_VERBOSE" ] && \ + [ "$VERBOSE" ] && \ echo -n "$( f_sysrc_find "$NAME" ): " # @@ -546,7 +546,7 @@ while [ $# -gt 0 ]; do # # If verbose, prefix line with where the directive lives - if [ "$SYSRC_VERBOSE" -a ! "$CHECK_ONLY" ]; then + if [ "$VERBOSE" -a ! "$CHECK_ONLY" ]; then file=$( f_sysrc_find "$NAME" ) [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \ file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' ) @@ -573,7 +573,7 @@ while [ $# -gt 0 ]; do if [ "$CHECK_ONLY" ]; then if ! IGNORED=$( f_sysrc_get "$NAME?" ); then status=$FAILURE - [ "$SYSRC_VERBOSE" ] && + [ "$VERBOSE" ] && echo "$NAME: not currently set" shift 1 continue @@ -581,12 +581,12 @@ while [ $# -gt 0 ]; do value=$( f_sysrc_get "$NAME" ) if [ "$value" != "${1#*=}" ]; then status=$FAILURE - if [ "$SYSRC_VERBOSE" ]; then + if [ "$VERBOSE" ]; then echo -n "$( f_sysrc_find "$NAME" ): " echo -n "$NAME: would change from " echo "\`$value' to \`${1#*=}'" fi - elif [ "$SYSRC_VERBOSE" ]; then + elif [ "$VERBOSE" ]; then echo -n "$( f_sysrc_find "$NAME" ): " echo "$NAME: already set to \`$value'" fi @@ -715,7 +715,7 @@ while [ $# -gt 0 ]; do continue fi - if [ "$SYSRC_VERBOSE" ]; then + if [ "$VERBOSE" ]; then if [ "$SHOW_EQUALS" ]; then echo -n ": $( f_sysrc_find "$NAME" ); " else From owner-svn-src-all@freebsd.org Tue Sep 1 21:19:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F4989C7FA7; Tue, 1 Sep 2015 21:19:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0012B17D; Tue, 1 Sep 2015 21:19:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LJj5r008002; Tue, 1 Sep 2015 21:19:45 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81LJjTb008001; Tue, 1 Sep 2015 21:19:45 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012119.t81LJjTb008001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287379 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:19:46 -0000 Author: dteske Date: Tue Sep 1 21:19:45 2015 New Revision: 287379 URL: https://svnweb.freebsd.org/changeset/base/287379 Log: Style consistency: add single space before each `;;' case entry MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:18:33 2015 (r287378) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:19:45 2015 (r287379) @@ -225,29 +225,29 @@ jail_depend() # while getopts aAcdDef:Fhij:nNqR:vxX flag; do case "$flag" in - a) SHOW_ALL=${SHOW_ALL:-1};; - A) SHOW_ALL=2;; - c) CHECK_ONLY=1;; - d) DESCRIBE=1;; - D) RC_CONFS=;; - e) SHOW_EQUALS=1;; - f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG";; - F) SHOW_FILE=1;; - h) usage;; - i) IGNORE_UNKNOWNS=1;; + a) SHOW_ALL=${SHOW_ALL:-1} ;; + A) SHOW_ALL=2 ;; + c) CHECK_ONLY=1 ;; + d) DESCRIBE=1 ;; + D) RC_CONFS= ;; + e) SHOW_EQUALS=1 ;; + f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG" ;; + F) SHOW_FILE=1 ;; + h) usage ;; + i) IGNORE_UNKNOWNS=1 ;; j) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-j' flag" "$pgm" - JAIL="$OPTARG";; - n) SHOW_NAME=;; - N) SHOW_VALUE=;; - q) QUIET=1 VERBOSE=;; + JAIL="$OPTARG" ;; + n) SHOW_NAME= ;; + N) SHOW_VALUE= ;; + q) QUIET=1 VERBOSE= ;; R) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-R' flag" "$pgm" - ROOTDIR="$OPTARG";; - v) VERBOSE=1 QUIET=;; - x) DELETE=${DELETE:-1};; - X) DELETE=2;; - \?) usage;; + ROOTDIR="$OPTARG" ;; + v) VERBOSE=1 QUIET= ;; + x) DELETE=${DELETE:-1} ;; + X) DELETE=2 ;; + \?) usage ;; esac done shift $(( $OPTIND - 1 )) From owner-svn-src-all@freebsd.org Tue Sep 1 21:20:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2AA39C80F5; Tue, 1 Sep 2015 21:20:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B3B0C627; Tue, 1 Sep 2015 21:20:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LKiKQ010525; Tue, 1 Sep 2015 21:20:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81LKiK5010524; Tue, 1 Sep 2015 21:20:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012120.t81LKiK5010524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287380 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:20:44 -0000 Author: dteske Date: Tue Sep 1 21:20:43 2015 New Revision: 287380 URL: https://svnweb.freebsd.org/changeset/base/287380 Log: Style: comments MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:19:45 2015 (r287379) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:20:43 2015 (r287380) @@ -200,7 +200,7 @@ jail_depend() # # Perform sanity checks # -[ $# -gt 0 ] || usage +[ $# -gt 0 ] || usage # NOTREACHED # # Check for `--help' and `--version' command-line option @@ -233,7 +233,7 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag e) SHOW_EQUALS=1 ;; f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG" ;; F) SHOW_FILE=1 ;; - h) usage ;; + h) usage ;; # NOTREACHED i) IGNORE_UNKNOWNS=1 ;; j) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-j' flag" "$pgm" @@ -247,7 +247,7 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag v) VERBOSE=1 QUIET= ;; x) DELETE=${DELETE:-1} ;; X) DELETE=2 ;; - \?) usage ;; + \?) usage ;; # NOTREACHED esac done shift $(( $OPTIND - 1 )) @@ -255,7 +255,7 @@ shift $(( $OPTIND - 1 )) # # [More] Sanity checks (e.g., "sysrc --") # -[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage +[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage # NOTREACHED # # Taint-check all rc.conf(5) files From owner-svn-src-all@freebsd.org Tue Sep 1 21:40:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA4719C8A8F; Tue, 1 Sep 2015 21:40:05 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 CB5761119; Tue, 1 Sep 2015 21:40:05 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81Le50P019738; Tue, 1 Sep 2015 21:40:05 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Le5In019737; Tue, 1 Sep 2015 21:40:05 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012140.t81Le5In019737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287381 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:40:06 -0000 Author: dteske Date: Tue Sep 1 21:40:04 2015 New Revision: 287381 URL: https://svnweb.freebsd.org/changeset/base/287381 Log: Properly escape arguments when moving into jail or chroot MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:20:43 2015 (r287380) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:40:04 2015 (r287381) @@ -195,6 +195,24 @@ jail_depend() cat $BSDCFG_SHARE/sysrc.subr } +escape() +{ + local __start="$1" __var_to_set="$2" __string= + while [ "$__start" ]; do + case "$__start" in *\'*) + __string="$__string${__start%%\'*}'\\''" + __start="${__start#*\'}" continue + esac + break + done + __string="$__string$__start" + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__string" + else + echo "$__string" + fi +} + ############################################################ MAIN SOURCE # @@ -330,9 +348,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then $( [ "$SHOW_FILE" ] && echo \ -F ) " if [ "${RC_CONFS+set}" ]; then - args="$args -f '$RC_CONFS'" + escape "$RC_CONFS" _RC_CONFS + args="$args -f '$_RC_CONFS'" + unset _RC_CONFS fi for arg in "$@"; do + escape "$arg" arg args="$args '$arg'" done From owner-svn-src-all@freebsd.org Tue Sep 1 21:42:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6D89C8C05; Tue, 1 Sep 2015 21:42:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 2EAB214BE; Tue, 1 Sep 2015 21:42:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81Lg1JY022926; Tue, 1 Sep 2015 21:42:01 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Lg10H022925; Tue, 1 Sep 2015 21:42:01 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012142.t81Lg10H022925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287382 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:42:01 -0000 Author: dteske Date: Tue Sep 1 21:42:00 2015 New Revision: 287382 URL: https://svnweb.freebsd.org/changeset/base/287382 Log: Comment MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:40:04 2015 (r287381) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:42:00 2015 (r287382) @@ -663,7 +663,7 @@ while [ $# -gt 0 ]; do unset remove delim oldIFS b add r [ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" ) ;; - *) + *) # ASSIGN if [ "$SHOW_FILE" ]; then before=$( f_sysrc_find "$NAME" ) else From owner-svn-src-all@freebsd.org Tue Sep 1 21:48:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F9D49C8ECB; Tue, 1 Sep 2015 21:48:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1094A1852; Tue, 1 Sep 2015 21:48:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LmM0H023245; Tue, 1 Sep 2015 21:48:22 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81LmM9I023244; Tue, 1 Sep 2015 21:48:22 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012148.t81LmM9I023244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287383 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:48:23 -0000 Author: dteske Date: Tue Sep 1 21:48:22 2015 New Revision: 287383 URL: https://svnweb.freebsd.org/changeset/base/287383 Log: Comment for escape() function. MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:42:00 2015 (r287382) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:48:22 2015 (r287383) @@ -195,6 +195,14 @@ jail_depend() cat $BSDCFG_SHARE/sysrc.subr } +# escape $string [$var_to_set] +# +# Escape $string contents so that the contents can be properly encapsulated in +# single-quotes (making for safe evaluation). +# +# NB: See `bsdconfig includes -dF escape' for relevant information/discussion. +# NB: Abridged version of `f_shell_escape()' from bsdconfig(8) `strings.subr'. +# escape() { local __start="$1" __var_to_set="$2" __string= From owner-svn-src-all@freebsd.org Tue Sep 1 21:50:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A379C810F; Tue, 1 Sep 2015 21:50:56 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 53C421A93; Tue, 1 Sep 2015 21:50:56 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LoujB025078; Tue, 1 Sep 2015 21:50:56 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81Louvg025077; Tue, 1 Sep 2015 21:50:56 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012150.t81Louvg025077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287384 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:50:56 -0000 Author: dteske Date: Tue Sep 1 21:50:55 2015 New Revision: 287384 URL: https://svnweb.freebsd.org/changeset/base/287384 Log: Style: Remove whitespace around brackets from function syntax options MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:48:22 2015 (r287383) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:50:55 2015 (r287384) @@ -61,7 +61,7 @@ VERBOSE= ############################################################ FUNCTIONS -# die [ $fmt [ $opts ... ]] +# die [$fmt [$opts ...]] # # Optionally print a message to stderr before exiting with failure status. # From owner-svn-src-all@freebsd.org Tue Sep 1 21:52:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9491F9C81E4; Tue, 1 Sep 2015 21:52:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 85A761DA8; Tue, 1 Sep 2015 21:52:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LqvdB027133; Tue, 1 Sep 2015 21:52:57 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81LqvsT027132; Tue, 1 Sep 2015 21:52:57 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012152.t81LqvsT027132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287385 - head/usr.sbin/sysrc 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, 01 Sep 2015 21:52:57 -0000 Author: dteske Date: Tue Sep 1 21:52:56 2015 New Revision: 287385 URL: https://svnweb.freebsd.org/changeset/base/287385 Log: Bump version for prior fix (SVN r287381) MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:50:55 2015 (r287384) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:52:56 2015 (r287385) @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.3 Mar-4,2015" +SYSRC_VERSION="6.4 Sep-1,2015" # # Options From owner-svn-src-all@freebsd.org Tue Sep 1 22:24:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 878979C71A1; Tue, 1 Sep 2015 22:24:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6C012F61; Tue, 1 Sep 2015 22:24:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81MOu9R039632; Tue, 1 Sep 2015 22:24:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81MOtmB039628; Tue, 1 Sep 2015 22:24:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509012224.t81MOtmB039628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 1 Sep 2015 22:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287386 - 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: Tue, 01 Sep 2015 22:24:56 -0000 Author: jhb Date: Tue Sep 1 22:24:54 2015 New Revision: 287386 URL: https://svnweb.freebsd.org/changeset/base/287386 Log: Export current system call code and argument count for system call entry and exit events. procfs stop events for system call tracing report these values (argument count for system call entry and code for system call exit), but ptrace() does not provide this information. (Note that while the system call code can be determined in an ABI-specific manner during system call entry, it is not generally available during system call exit.) The values are exported via new fields at the end of struct ptrace_lwpinfo available via PT_LWPINFO. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3536 Modified: head/sys/kern/subr_syscall.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/ptrace.h Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Tue Sep 1 21:52:56 2015 (r287385) +++ head/sys/kern/subr_syscall.c Tue Sep 1 22:24:54 2015 (r287386) @@ -85,6 +85,8 @@ syscallenter(struct thread *td, struct s STOPEVENT(p, S_SCE, sa->narg); if (p->p_flag & P_TRACED && p->p_stops & S_PT_SCE) { PROC_LOCK(p); + td->td_dbg_sc_code = sa->code; + td->td_dbg_sc_narg = sa->narg; ptracestop((td), SIGTRAP); PROC_UNLOCK(p); } @@ -94,6 +96,10 @@ syscallenter(struct thread *td, struct s * debugger modified registers or memory. */ error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); + PROC_LOCK(p); + td->td_dbg_sc_code = sa->code; + td->td_dbg_sc_narg = sa->narg; + PROC_UNLOCK(p); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Sep 1 21:52:56 2015 (r287385) +++ head/sys/kern/sys_process.c Tue Sep 1 22:24:54 2015 (r287386) @@ -97,6 +97,8 @@ struct ptrace_lwpinfo32 { struct siginfo32 pl_siginfo; /* siginfo for signal */ char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */ int pl_child_pid; /* New child pid */ + u_int pl_syscall_code; + u_int pl_syscall_narg; }; #endif @@ -481,6 +483,8 @@ ptrace_lwpinfo_to32(const struct ptrace_ siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); strcpy(pl32->pl_tdname, pl->pl_tdname); pl32->pl_child_pid = pl->pl_child_pid; + pl32->pl_syscall_code = pl->pl_syscall_code; + pl32->pl_syscall_narg = pl->pl_syscall_narg; } #endif /* COMPAT_FREEBSD32 */ @@ -1211,6 +1215,13 @@ kern_ptrace(struct thread *td, int req, pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; strcpy(pl->pl_tdname, td2->td_name); + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) { + pl->pl_syscall_code = td2->td_dbg_sc_code; + pl->pl_syscall_narg = td2->td_dbg_sc_narg; + } else { + pl->pl_syscall_code = 0; + pl->pl_syscall_narg = 0; + } #ifdef COMPAT_FREEBSD32 if (wrap32) ptrace_lwpinfo_to32(pl, pl32); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Sep 1 21:52:56 2015 (r287385) +++ head/sys/sys/proc.h Tue Sep 1 22:24:54 2015 (r287386) @@ -174,6 +174,7 @@ struct procdesc; struct racct; struct sbuf; struct sleepqueue; +struct syscall_args; struct td_sched; struct thread; struct trapframe; @@ -282,6 +283,8 @@ struct thread { int td_no_sleeping; /* (k) Sleeping disabled count. */ int td_dom_rr_idx; /* (k) RR Numa domain selection. */ void *td_su; /* (k) FFS SU private */ + u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */ + u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/ #define td_endzero td_sigmask /* Copied during fork1() or create_thread(). */ @@ -979,7 +982,6 @@ void userret(struct thread *, struct tra void cpu_exit(struct thread *); void exit1(struct thread *, int, int) __dead2; -struct syscall_args; int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa); void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_set_fork_handler(struct thread *, void (*)(void *), void *); Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Tue Sep 1 21:52:56 2015 (r287385) +++ head/sys/sys/ptrace.h Tue Sep 1 22:24:54 2015 (r287386) @@ -113,6 +113,8 @@ struct ptrace_lwpinfo { struct __siginfo pl_siginfo; /* siginfo for signal */ char pl_tdname[MAXCOMLEN + 1]; /* LWP name */ int pl_child_pid; /* New child pid */ + u_int pl_syscall_code; + u_int pl_syscall_narg; }; /* Argument structure for PT_VM_ENTRY. */ From owner-svn-src-all@freebsd.org Tue Sep 1 22:28:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BFD89C7334; Tue, 1 Sep 2015 22:28:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5D866110E; Tue, 1 Sep 2015 22:28:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81MSONg039815; Tue, 1 Sep 2015 22:28:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81MSONF039814; Tue, 1 Sep 2015 22:28:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509012228.t81MSONF039814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 1 Sep 2015 22:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287387 - 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, 01 Sep 2015 22:28:24 -0000 Author: jhb Date: Tue Sep 1 22:28:23 2015 New Revision: 287387 URL: https://svnweb.freebsd.org/changeset/base/287387 Log: The 'sa' argument to syscallret() is not unused. Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Tue Sep 1 22:24:54 2015 (r287386) +++ head/sys/kern/subr_syscall.c Tue Sep 1 22:28:23 2015 (r287387) @@ -170,7 +170,7 @@ syscallenter(struct thread *td, struct s } static inline void -syscallret(struct thread *td, int error, struct syscall_args *sa __unused) +syscallret(struct thread *td, int error, struct syscall_args *sa) { struct proc *p, *p2; int traced; From owner-svn-src-all@freebsd.org Tue Sep 1 22:35:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844449C77B8; Tue, 1 Sep 2015 22:35:54 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.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 74E301722; Tue, 1 Sep 2015 22:35:54 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81MZsxx043908; Tue, 1 Sep 2015 22:35:54 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81MZsPf043907; Tue, 1 Sep 2015 22:35:54 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201509012235.t81MZsPf043907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Tue, 1 Sep 2015 22:35: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: r287388 - stable/10/sys/dev/sound/midi 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, 01 Sep 2015 22:35:54 -0000 Author: avatar Date: Tue Sep 1 22:35:53 2015 New Revision: 287388 URL: https://svnweb.freebsd.org/changeset/base/287388 Log: MFC r286887: Using the error return code documented in the comment. Though there is no direct midi_uninit() caller amongst existing drivers at this moment, a quick experiment indicates that EBUSY gives users more precise error message once drivers start to honour this result. For example, emu_midi_detach() should check the result of mpu401_uninit() and block module unloading if there is any MIDI I/O in progress. Modified: stable/10/sys/dev/sound/midi/midi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/midi/midi.c ============================================================================== --- stable/10/sys/dev/sound/midi/midi.c Tue Sep 1 22:28:23 2015 (r287387) +++ stable/10/sys/dev/sound/midi/midi.c Tue Sep 1 22:35:53 2015 (r287388) @@ -403,7 +403,7 @@ midi_uninit(struct snd_midi *m) { int err; - err = ENXIO; + err = EBUSY; mtx_lock(&midistat_lock); mtx_lock(&m->lock); if (m->busy) { From owner-svn-src-all@freebsd.org Tue Sep 1 22:37:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 988F99C78AF; Tue, 1 Sep 2015 22:37:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 89698190E; Tue, 1 Sep 2015 22:37:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81MbYcO044112; Tue, 1 Sep 2015 22:37:34 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81MbYNW044111; Tue, 1 Sep 2015 22:37:34 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012237.t81MbYNW044111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 22:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287389 - head/usr.sbin/sysrc 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, 01 Sep 2015 22:37:34 -0000 Author: dteske Date: Tue Sep 1 22:37:33 2015 New Revision: 287389 URL: https://svnweb.freebsd.org/changeset/base/287389 Log: Simplify long-option processing MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 22:35:53 2015 (r287388) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 22:37:33 2015 (r287389) @@ -231,20 +231,16 @@ escape() # # Check for `--help' and `--version' command-line option # -( # Operate in sub-shell to protect $@ in parent - while [ $# -gt 0 ]; do - case "$1" in - --help) help ;; - --version) # see GLOBALS - echo "$SYSRC_VERSION" - exit 1 ;; - -[fRj]) # These flags take an argument - shift 1 ;; - esac - shift 1 - done - exit 0 -) || die +for arg in "$@"; do + case "$arg" in + --) break ;; + --help) help ;; # NOTREACHED + --version) # see GLOBALS + echo "$SYSRC_VERSION" + exit $FAILURE ;; + esac +done +unset arg # # Process command-line flags From owner-svn-src-all@freebsd.org Tue Sep 1 22:39:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F3E09C79AF; Tue, 1 Sep 2015 22:39:10 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9067A1B21; Tue, 1 Sep 2015 22:39:10 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81MdAOd044291; Tue, 1 Sep 2015 22:39:10 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81MdATx044290; Tue, 1 Sep 2015 22:39:10 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012239.t81MdATx044290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 22:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287390 - head/usr.sbin/sysrc 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, 01 Sep 2015 22:39:10 -0000 Author: dteske Date: Tue Sep 1 22:39:09 2015 New Revision: 287390 URL: https://svnweb.freebsd.org/changeset/base/287390 Log: Bump version for altered long-opts processing MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 22:37:33 2015 (r287389) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 22:39:09 2015 (r287390) @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.4 Sep-1,2015" +SYSRC_VERSION="6.5 Sep-1,2015" # # Options From owner-svn-src-all@freebsd.org Wed Sep 2 01:31:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2BC99C6CA6; Wed, 2 Sep 2015 01:31:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id AF4F2309; Wed, 2 Sep 2015 01:31:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A83DB135D; Wed, 2 Sep 2015 01:31:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 67D461172C; Wed, 2 Sep 2015 01:31:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0xwAX5v8m4x2; Wed, 2 Sep 2015 01:31:29 +0000 (UTC) Subject: Re: svn commit: r284598 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DE17811722 To: "Simon J. Gerraty" References: <201506191456.t5JEuPDU074336@svn.freebsd.org> <55B8268A.5030305@FreeBSD.org> <4974.1438488939@chaos> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Bryan Drewery Organization: FreeBSD Message-ID: <55E6516F.5000805@FreeBSD.org> Date: Tue, 1 Sep 2015 18:31:27 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <4974.1438488939@chaos> Content-Type: text/plain; charset=windows-1252 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: Wed, 02 Sep 2015 01:31:31 -0000 On 8/1/15 9:15 PM, Simon J. Gerraty wrote: > Bryan Drewery wrote: >>> > > head/share/mk/local.sys.mk >> > >> > I'm bothered by the amount of local.* files committed in the tree. I >> > expect, as a user and working in a downstream product, that a local.* >> > file is MINE, not FREEBSD. The pattern of using 'local' is quite common >> > as a *user* file. > Yes that's exactly the point. > local*mk (and src*) do not get installed in /usr/share/mk, yet the > inlcudes exist as points for you to customize the behavior. > >> > Why are these named as such? It seems they should just be 'src.' with >> > .sinclude hooks for actual local overrides. > local* are name as such since that's all that bsd* should know about. > Providing for local customization. My concern is that checked in 'local' files should not be changed by FreeBSD. I should not have to fight conflicts of _my customizations_ against _FreeBSD customizations (against bmake upstream)_. There is so much logic in these local.* files, they seem more aptly named 'freebsd.*' as they seem to be intended to be customizations for FreeBSD, rather than optional customizations for a developer or other downstream consumer of FreeBSD. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Wed Sep 2 02:44:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89AAC9C838E; Wed, 2 Sep 2015 02:44:46 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (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 44380208; Wed, 2 Sep 2015 02:44:46 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qgez77 with SMTP id z77so10376046qge.1; Tue, 01 Sep 2015 19:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=VHX8pcbkr8lYeWo0PWG2vL1LleOCFKn7jXksR8Bid/0=; b=e8h1USrJGLR0bim8wtPNr33DMUSua4volutt/LU3e4KNcw9VCr4GySgiCy8+lLEZpx c8NgFTy0EnDs6d3flJT8iz9mmvCdOSmS1E4LWTBd2w1irQkzvKJljVD5QdN1ik+IfTKc XMya9hlQremdCcT8+WTijnKU32XcMFPTJ74S7UxcCTygTNR5TGIcNG2B9t22JLpRxG19 d7NMyS0UbArR55KEFWLGo8A+VlwU7p+p2zIKAs1wykpLqFqoonw8KDlTJwoNawm2YFTU /JmigGCtaQwojCrJNQxEMzv4C5kZk+87Bw/ONju2bJ1oh7z2NYwVtybSqEK3G9ZCipEZ 3Fyg== X-Received: by 10.140.133.84 with SMTP id 81mr56145359qhf.13.1441161885225; Tue, 01 Sep 2015 19:44:45 -0700 (PDT) Received: from kan ([2601:18f:0:1570:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id 49sm12048403qgh.4.2015.09.01.19.44.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Sep 2015 19:44:43 -0700 (PDT) Date: Tue, 1 Sep 2015 22:44:38 -0400 From: Alexander Kabaev To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150901224438.32e982dd@kan> In-Reply-To: <201509011159.t81BxCkm072208@repo.freebsd.org> References: <201509011159.t81BxCkm072208@repo.freebsd.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/9Vq9WXQG9DtoVPSTqcT1t0v"; 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, 02 Sep 2015 02:44:46 -0000 --Sig_/9Vq9WXQG9DtoVPSTqcT1t0v Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 1 Sep 2015 11:59:12 +0000 (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Tue Sep 1 11:59:12 2015 > New Revision: 287358 > URL: https://svnweb.freebsd.org/changeset/base/287358 >=20 > Log: > Not only build with buildworld, but also install with installworld > all alternative kernels. > =20 > Sponsored by: Netflix > Sponsored by: Nginx, Inc. >=20 > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015 > (r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 > 2015 (r287358) @@ -1127,6 +1127,14 @@ reinstallkernel > reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ > ${CROSSENV} PATH=3D${TMPPATH} \ > ${MAKE} ${IMAKE_INSTALL} KERNEL=3D${INSTKERNNAME} > ${.TARGET:S/kernel//} +.for _kernel in ${BUILDKERNELS:[2..-1]} > + @echo > "--------------------------------------------------------------" > + @echo ">>> Installing kernel ${_kernel}" > + @echo > "--------------------------------------------------------------" > + cd ${KRNLOBJDIR}/${_kernel}; \ > + ${CROSSENV} PATH=3D${TMPPATH} \ > + ${MAKE} ${IMAKE_INSTALL} > KERNEL=3D${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor > =20 > distributekernel distributekernel.debug: > .if empty(INSTALLKERNEL) This is probably not doing what you think it is doing. Now, when installing my kernel, built from config file , I get it installed into /boot/kernel, which is good and normal, and I get an extra and highly undesired copy in boot/kernel.. That one I didn't ask for and would rather see it gone.=20 --=20 Alexander Kabaev --Sig_/9Vq9WXQG9DtoVPSTqcT1t0v Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJV5mKWXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+Q0sQANnp1ex8i0vWpDyVT/F6CZ3m 9W0rQUXvBqQBP0ZaS3SGaivEhgmnHNpzlbVOMg8k7S/Ix9RVeWROKa8vUzq76Tz3 R8NgGF+PY86LIUUzGRg6Z/U2N3uTYApwpaNzFDdtJiAZjjxgxQOvHEN1rESiXKY3 vXYbsMnS5G2Xe3owQia7EAR0g4GNqnfINmha5BpYQ8k31kfP1jsYr1IwB/YCzHHd TSjo16/fxR7YrGBREtLnfDh467RlI8fAeoac4DdOqn4Zc6T5rGMA15A54WWvjLpJ MjCQ48H1830vYqEG7MxVs72jNHSvkt9NYepvpzqnGX60yJcWrDo8zpOzwU7m1M/5 ypSVnb5L+2KN/z53SFcgU1M1IZtpKBvS4GS70PKr/aIyIYRAFtxV/KIgHXBRikvs lzEKdVG/klgDASFPHyuFj7Etln2xSaQDhhbhG+yB5vAQ+RMFVZZj8TCGlHK2nyy7 JUiVqrwPBiUgPteEsjQN9K5GE50hLIelwJBWIVJUbzDWO0KZ24xoHfHQomdZwmjm aaS9mP5Aqq8dhpOM/5zDCBnxMlzBxYakZvBj0Mk2Aoe/dXiyxu581xOx4NUe0vV/ Ug3RJqACAnnXn3Tpa1if3XDtZNEFHIjq14uO2tWCQ/klAszrhXaX3Y2Lxu9dN9k9 GixC771S2aranxfui+p8 =6TI6 -----END PGP SIGNATURE----- --Sig_/9Vq9WXQG9DtoVPSTqcT1t0v-- From owner-svn-src-all@freebsd.org Wed Sep 2 02:50:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC6509C862D; Wed, 2 Sep 2015 02:50:42 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9CC0C6DD; Wed, 2 Sep 2015 02:50:42 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t822ogYS048367; Wed, 2 Sep 2015 02:50:42 GMT (envelope-from jmallett@FreeBSD.org) Received: (from jmallett@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t822ogC3048366; Wed, 2 Sep 2015 02:50:42 GMT (envelope-from jmallett@FreeBSD.org) Message-Id: <201509020250.t822ogC3048366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmallett set sender to jmallett@FreeBSD.org using -f From: Juli Mallett Date: Wed, 2 Sep 2015 02:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r287391 - 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: Wed, 02 Sep 2015 02:50:42 -0000 Author: jmallett Date: Wed Sep 2 02:50:41 2015 New Revision: 287391 URL: https://svnweb.freebsd.org/changeset/base/287391 Log: Release Patrick Kelsey (pkelsey@) from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Sep 1 22:39:09 2015 (r287390) +++ svnadmin/conf/mentors Wed Sep 2 02:50:41 2015 (r287391) @@ -30,7 +30,6 @@ mahrens mckusick miwi rwatson monthadar adrian peterj jhb Co-mentor: grog -pkelsey jmallett slm ken Co-mentor: scottl, ambrisko snb dwmalone torek rpaulo From owner-svn-src-all@freebsd.org Wed Sep 2 05:45:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCB09C8C70; Wed, 2 Sep 2015 05:45:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5FFC1A4F; Wed, 2 Sep 2015 05:45:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t825jnYl022575; Wed, 2 Sep 2015 05:45:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t825jmpT022570; Wed, 2 Sep 2015 05:45:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509020545.t825jmpT022570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 2 Sep 2015 05:45:48 +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: r287392 - in stable/10: etc/mtree usr.bin usr.bin/timeout usr.bin/timeout/tests 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, 02 Sep 2015 05:45:49 -0000 Author: bapt Date: Wed Sep 2 05:45:47 2015 New Revision: 287392 URL: https://svnweb.freebsd.org/changeset/base/287392 Log: MFC: r268745,r268746,r268747,r268748,r268749,r268861,r268750,r268751,r268763 r273769,r273771,r276771,r278810 New BSDL timeout(1) utility compatible with GNU timeout Relnotes: yes Added: stable/10/usr.bin/timeout/ - copied from r268745, head/usr.bin/timeout/ stable/10/usr.bin/timeout/tests/ - copied from r273771, head/usr.bin/timeout/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/Makefile stable/10/usr.bin/timeout/Makefile stable/10/usr.bin/timeout/timeout.1 stable/10/usr.bin/timeout/timeout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Wed Sep 2 02:50:41 2015 (r287391) +++ stable/10/etc/mtree/BSD.tests.dist Wed Sep 2 05:45:47 2015 (r287392) @@ -323,6 +323,8 @@ .. .. .. + timeout + .. variables modifier_M .. Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Wed Sep 2 02:50:41 2015 (r287391) +++ stable/10/usr.bin/Makefile Wed Sep 2 05:45:47 2015 (r287392) @@ -157,6 +157,7 @@ SUBDIR= alias \ tee \ ${_tests} \ time \ + timeout \ tip \ top \ touch \ Modified: stable/10/usr.bin/timeout/Makefile ============================================================================== --- head/usr.bin/timeout/Makefile Wed Jul 16 09:55:36 2014 (r268745) +++ stable/10/usr.bin/timeout/Makefile Wed Sep 2 05:45:47 2015 (r287392) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + PROG= timeout +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Wed Jul 16 09:55:36 2014 (r268745) +++ stable/10/usr.bin/timeout/timeout.1 Wed Sep 2 05:45:47 2015 (r287392) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2014 +.Dd Oct 28, 2014 .Dt TIMEOUT 1 .Os .Sh NAME @@ -44,12 +44,18 @@ starts the .Ar command with its -.Ar args -and kills if it is still runs after -.Ar duration . +.Ar args. +If +.Ar command +is still running after +.Ar duration , +it is killed. +By default, +.Ar SIGTERM. +is sent. .Bl -tag -width "-k time, --kill-after time" .It Fl -preserve-status -Always exist with the same status as +Always exits with the same status as .Ar command even if it times out. .It Fl -foreground @@ -57,14 +63,67 @@ Do not propagate timeout to the .Ar command children. .It Fl s Ar sig , Fl -signal Ar sig -Speficy the signal to send on timeout by default +Specify the signal to send on timeout. +By default, .Ar SIGTERM . +is sent. .It Fl k Ar time , Fl -kill-after Ar time -Send a second kill if the +Send a second kill signal if .Ar command is still running after .Ar time -seconds after the first signal was sent +after the first signal was sent. +.El +.Sh DURATION FORMAT +.Ar duration +and +.Ar time +can be integer or decimal numbers. +Values without unit symbols are interpreted as seconds. +.Pp +Supported unit symbols are: +.Bl -tag -width indent -compact +.It s +seconds +.It m +minutes +.It h +hours +.It d +days +.El +.Sh EXIT STATUS +If the timeout was not reached, the exit status of +.Ar command +is returned. +.Pp +If the timeout was reached and +.Fl -preserve-status +is set, the exit status of +.Ar command +is returned. +If +.Fl -preserve-status +is not set, an exit status of 124 is returned. +.Pp +If +.Ar command +exits after receiving a signal, the exit status returned is the signal number +plus 128. +.Pp +If +.Ar command +is an invalid command, the exit status returned is 126. +.Pp +If +.Ar command +is a non existing command, the exit status returned is 127. +.Pp +If an invalid parameter is passed to +.Fl s +or +.Fl k , +the exit status return is 125. .Sh SEE ALSO -.Xr signal 3 , -.Xr kill 1 +.Xr kill 1 , +.Xr signal 3 Modified: stable/10/usr.bin/timeout/timeout.c ============================================================================== --- head/usr.bin/timeout/timeout.c Wed Jul 16 09:55:36 2014 (r268745) +++ stable/10/usr.bin/timeout/timeout.c Wed Sep 2 05:45:47 2015 (r287392) @@ -2,7 +2,7 @@ * Copyright (c) 2014 Baptiste Daroussin * Copyright (c) 2014 Vsevolod Stakhov * All rights reserved. - *~ + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -12,7 +12,7 @@ * 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(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. @@ -28,20 +28,20 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include + +#include +#include +#include #include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #define EXIT_TIMEOUT 124 @@ -53,6 +53,7 @@ static sig_atomic_t sig_ign = 0; static void usage(void) { + fprintf(stderr, "Usage: %s [--signal sig | -s sig] [--preserve-status]" " [--kill-after time | -k time] [--foreground] " " \n", getprogname()); @@ -68,7 +69,7 @@ parse_duration(const char *duration) ret = strtod(duration, &end); if (ret == 0 && end == duration) - errx(EXIT_FAILURE, "invalid duration"); + errx(125, "invalid duration"); if (end == NULL || *end == '\0') return (ret); @@ -89,11 +90,11 @@ parse_duration(const char *duration) ret *= 60 * 60 * 24; break; default: - errx(EX_USAGE, "invalid duration"); + errx(125, "invalid duration"); } - + if (ret < 0 || ret >= 100000000UL) - errx(EX_USAGE, "invalid duration"); + errx(125, "invalid duration"); return (ret); } @@ -102,11 +103,11 @@ static int parse_signal(const char *str) { int sig, i; - const char *err; + const char *errstr; - sig = strtonum(str, 0, sys_nsig, &err); + sig = strtonum(str, 0, sys_nsig, &errstr); - if (err == NULL) + if (errstr == NULL) return (sig); if (strncasecmp(str, "SIG", 3) == 0) str += 3; @@ -115,8 +116,8 @@ parse_signal(const char *str) if (strcasecmp(str, sys_signame[i]) == 0) return (i); } - - errx(EX_USAGE, "invalid signal"); + + errx(125, "invalid signal"); } static void @@ -166,13 +167,15 @@ main(int argc, char **argv) int foreground, preserve; int error, pstat, status; int killsig = SIGTERM; - int killedwith; - pid_t pgid, pid, cpid; + pid_t pid, cpid; double first_kill; double second_kill; bool timedout = false; bool do_second_kill = false; + bool child_done = false; struct sigaction signals; + struct procctl_reaper_status info; + struct procctl_reaper_kill killemall; int signums[] = { -1, SIGTERM, @@ -185,9 +188,8 @@ main(int argc, char **argv) foreground = preserve = 0; second_kill = 0; - cpid = -1; - struct option longopts[] = { + const struct option longopts[] = { { "preserve-status", no_argument, &preserve, 1 }, { "foreground", no_argument, &foreground, 1 }, { "kill-after", required_argument, NULL, 'k'}, @@ -225,10 +227,9 @@ main(int argc, char **argv) argv++; if (!foreground) { - pgid = setpgid(0,0); - - if (pgid == -1) - err(EX_OSERR, "setpgid()"); + /* Aquire a reaper */ + if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) + err(EX_OSERR, "Fail to acquire the reaper"); } memset(&signals, 0, sizeof(signals)); @@ -260,8 +261,12 @@ main(int argc, char **argv) signal(SIGTTOU, SIG_DFL); error = execvp(argv[0], argv); - if (error == -1) - err(EX_UNAVAILABLE, "exec()"); + if (error == -1) { + if (errno == ENOENT) + err(127, "exec(%s)", argv[0]); + else + err(126, "exec(%s)", argv[0]); + } } if (sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL) == -1) @@ -270,29 +275,44 @@ main(int argc, char **argv) /* parent continues here */ set_interval(first_kill); - sigemptyset(&signals.sa_mask); - for (;;) { - killedwith = killsig; sigemptyset(&signals.sa_mask); sigsuspend(&signals.sa_mask); if (sig_chld) { sig_chld = 0; - while (((cpid = wait(&status)) < 0) && errno != EINTR) - continue; - if (cpid == pid) { - pstat = status; - break; + while ((cpid = waitpid(-1, &status, WNOHANG)) != 0) { + if (cpid < 0) { + if (errno == EINTR) + continue; + else + break; + } else if (cpid == pid) { + pstat = status; + child_done = true; + } + } + if (child_done) { + if (foreground) { + break; + } else { + procctl(P_PID, getpid(), + PROC_REAP_STATUS, &info); + if (info.rs_children == 0) + break; + } } } else if (sig_alrm) { sig_alrm = 0; timedout = true; - if (!foreground) - killpg(pgid, killsig); - else + if (!foreground) { + killemall.rk_sig = killsig; + killemall.rk_flags = 0; + procctl(P_PID, getpid(), PROC_REAP_KILL, + &killemall); + } else kill(pid, killsig); if (do_second_kill) { @@ -304,9 +324,12 @@ main(int argc, char **argv) break; } else if (sig_term) { - if (!foreground) - killpg(pgid, killsig); - else + if (!foreground) { + killemall.rk_sig = sig_term; + killemall.rk_flags = 0; + procctl(P_PID, getpid(), PROC_REAP_KILL, + &killemall); + } else kill(pid, sig_term); if (do_second_kill) { @@ -319,18 +342,21 @@ main(int argc, char **argv) } } - while (cpid != pid && wait(&pstat) == -1) { + while (!child_done && wait(&pstat) == -1) { if (errno != EINTR) err(EX_OSERR, "waitpid()"); } + if (!foreground) + procctl(P_PID, getpid(), PROC_REAP_RELEASE, NULL); + if (WEXITSTATUS(pstat)) pstat = WEXITSTATUS(pstat); else if(WIFSIGNALED(pstat)) pstat = 128 + WTERMSIG(pstat); if (timedout && !preserve) - pstat = EXIT_TIMEOUT; + pstat = EXIT_TIMEOUT; return (pstat); } From owner-svn-src-all@freebsd.org Wed Sep 2 05:55:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EB59C7289; Wed, 2 Sep 2015 05:55:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 7977A96; Wed, 2 Sep 2015 05:55:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t825twBw027172; Wed, 2 Sep 2015 05:55:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t825twGv027171; Wed, 2 Sep 2015 05:55:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509020555.t825twGv027171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 2 Sep 2015 05:55: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: r287393 - stable/10/lib/libc/locale 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, 02 Sep 2015 05:55:58 -0000 Author: bapt Date: Wed Sep 2 05:55:57 2015 New Revision: 287393 URL: https://svnweb.freebsd.org/changeset/base/287393 Log: MFC: r286490,r286491,r287125 Per rfc3629 value greater than 0x10ffff should be rejected (r286490,r286491) Make UTF-8 parsing and generation more strict. (r287125 by ed) - in mbrtowc() we need to disallow codepoints above 0x10ffff. - In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff. Modified: stable/10/lib/libc/locale/utf8.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/utf8.c ============================================================================== --- stable/10/lib/libc/locale/utf8.c Wed Sep 2 05:45:47 2015 (r287392) +++ stable/10/lib/libc/locale/utf8.c Wed Sep 2 05:55:57 2015 (r287393) @@ -145,14 +145,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, mask = 0x07; want = 4; lbound = 0x10000; - } else if ((ch & 0xfc) == 0xf8) { - mask = 0x03; - want = 5; - lbound = 0x200000; - } else if ((ch & 0xfe) == 0xfc) { - mask = 0x01; - want = 6; - lbound = 0x4000000; } else { /* * Malformed input; input is not UTF-8. @@ -199,7 +191,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, errno = EILSEQ; return ((size_t)-1); } - if (wch >= 0xd800 && wch <= 0xdfff) { + if ((wch >= 0xd800 && wch <= 0xdfff) || wch > 0x10ffff) { /* * Malformed input; invalid code points. */ @@ -326,17 +318,15 @@ _UTF8_wcrtomb(char * __restrict s, wchar lead = 0xc0; len = 2; } else if ((wc & ~0xffff) == 0) { + if (wc >= 0xd800 && wc <= 0xdfff) { + errno = EILSEQ; + return ((size_t)-1); + } lead = 0xe0; len = 3; - } else if ((wc & ~0x1fffff) == 0) { + } else if (wc >= 0 && wc <= 0x10ffff) { lead = 0xf0; len = 4; - } else if ((wc & ~0x3ffffff) == 0) { - lead = 0xf8; - len = 5; - } else if ((wc & ~0x7fffffff) == 0) { - lead = 0xfc; - len = 6; } else { errno = EILSEQ; return ((size_t)-1); From owner-svn-src-all@freebsd.org Wed Sep 2 06:16:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FBDC9C509B; Wed, 2 Sep 2015 06:16:19 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (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 C3D5CCCF; Wed, 2 Sep 2015 06:16:18 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wibz8 with SMTP id z8so53371858wib.1; Tue, 01 Sep 2015 23:16:17 -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=BZL2SCrbDyWvNrLkA26BEQGFcmxWMlHa0AmtQUABpWo=; b=EWFI2EcxWBCcJ9WynhoPORE2m/Ve4ipVMh0BDwkwN1DI4af8mbm8PbXbE4ZCyaZIgl TfBwgEVr+bqO+vWhz2+ylhgal+zqTAevLKU+VDMtsbOQyLXHYHPuocG7+/Ny1sl1BSm9 68I9rQ0pitnVDFS/Oi5eXhHvv6xSmuGjpG6KdCE5HksNrrFLJl2dutgCt/f8DRHDg8Gy ozQ3jvX8buDhtlLH3OFFYbx8jcey+SG89s/ClPS8CWSEa/n2nui7p4VGUy3fjW1TXFYN TqIPLM0wZYmY1JWe85tHg+/L0CPYa/SUyBG28e7VivWbNseNdUyjfnqIkGHmyZQt8M2+ RQKw== X-Received: by 10.194.185.146 with SMTP id fc18mr37078088wjc.46.1441174577184; Tue, 01 Sep 2015 23:16:17 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id yu4sm30599255wjc.43.2015.09.01.23.16.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Sep 2015 23:16:16 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 2 Sep 2015 08:16:14 +0200 From: Baptiste Daroussin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287366 - head/sys/kern Message-ID: <20150902061614.GB61752@ivaldir.etoilebsd.net> References: <201509011405.t81E5U0g025928@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eAbsdosE1cNLO4uF" Content-Disposition: inline In-Reply-To: <201509011405.t81E5U0g025928@repo.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, 02 Sep 2015 06:16:19 -0000 --eAbsdosE1cNLO4uF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 01, 2015 at 02:05:30PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Sep 1 14:05:29 2015 > New Revision: 287366 > URL: https://svnweb.freebsd.org/changeset/base/287366 >=20 > Log: > Exit notification for EVFILT_PROC removes knote from the knlist. In > particular, this invalidates the knote kn_link linkage, making the > SLIST_FOREACH() loop accessing undefined values (e.g. trashed by > QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq > lock is released or when influx is cleared, e.g. by knote_scan() for > kqueue owning the knote, the iteration step would access freed memory. > =20 > Use SLIST_FOREACH_SAFE() to fix iteration. > =20 > Diagnosed by: avg > Tested by: avg, lstewart, pawel > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks >=20 Thank you! that makes my package builders stable again! Best regards, Bapt --eAbsdosE1cNLO4uF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXmlC4ACgkQ8kTtMUmk6EwPYgCffTXrongm+5WcyqPlbDnbi0/F 50AAn3UFsEw08TLJKEXcg9hWwuur3Vzp =FFvj -----END PGP SIGNATURE----- --eAbsdosE1cNLO4uF-- From owner-svn-src-all@freebsd.org Wed Sep 2 12:46:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA1E9C7242; Wed, 2 Sep 2015 12:46:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B580717A1; Wed, 2 Sep 2015 12:46:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82CkhWF099534; Wed, 2 Sep 2015 12:46:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82Ckhkn099532; Wed, 2 Sep 2015 12:46:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509021246.t82Ckhkn099532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 2 Sep 2015 12:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287394 - 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, 02 Sep 2015 12:46:44 -0000 Author: glebius Date: Wed Sep 2 12:46:42 2015 New Revision: 287394 URL: https://svnweb.freebsd.org/changeset/base/287394 Log: Fix dynamic attach/detach of 802.11 devices after r287197: o In pccard_ether add code to start children of a 802.11 device, that are configured in rc.conf. o In devd.conf provide a regex matching all 802.11 devices, and on match run pccard_ether to spawn children. PR: 202784 Submitted by: In collaboration with: "Oleg V. Nauman" Modified: head/etc/devd.conf head/etc/pccard_ether Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Wed Sep 2 05:55:57 2015 (r287393) +++ head/etc/devd.conf Wed Sep 2 12:46:42 2015 (r287394) @@ -22,6 +22,9 @@ options { "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\ [0-9]+"; + set wifi-driver-regex + "(ath|bwi|bwn|ipw|iwi|iwn|malo|mwl|ral|rsu|rum|run|uath|upgt|\ + ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can @@ -57,17 +60,16 @@ notify 0 { }; # -# Like Ethernet devices, but separate because -# they have a different media type. We may want -# to exploit this later. +# Like Ethernet devices, but separate because 802.11 require spawning +# wlan(4) interface. # -detach 0 { - media-type "802.11"; - action "/etc/pccard_ether $device-name stop"; -}; attach 0 { - media-type "802.11"; - action "/etc/pccard_ether $device-name start"; + device-name "$wifi-driver-regex"; + action "/etc/pccard_ether $device-name startchildren"; +}; +detach 0 { + device-name "$wifi-driver-regex"; + action "/etc/pccard_ether $device-name stopchildren"; }; notify 0 { match "system" "IFNET"; Modified: head/etc/pccard_ether ============================================================================== --- head/etc/pccard_ether Wed Sep 2 05:55:57 2015 (r287393) +++ head/etc/pccard_ether Wed Sep 2 12:46:42 2015 (r287394) @@ -17,6 +17,9 @@ stop_precmd="checkauto" stop_cmd="pccard_ether_stop" restart_precmd="checkauto" restart_cmd="pccard_ether_restart" +startchildren_cmd="pccard_ether_startchildren" +stopchildren_cmd="pccard_ether_stopchildren" +extra_commands="startchildren stopchildren" setup_routes() { @@ -114,6 +117,20 @@ pccard_ether_restart() pccard_ether_start } +pccard_ether_startchildren() +{ + for child in `get_if_var $ifn wlans_IF`; do + /etc/rc.d/netif quietstart $child + done +} + +pccard_ether_stopchildren() +{ + for child in `get_if_var $ifn wlans_IF`; do + /etc/rc.d/netif quietstop $child + done +} + ifn=$1 shift if [ -z "$*" ]; then From owner-svn-src-all@freebsd.org Wed Sep 2 12:50:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 883FC9C7528; Wed, 2 Sep 2015 12:50:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 133071A60; Wed, 2 Sep 2015 12:50:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t82CoODJ008776 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Sep 2015 15:50:24 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t82CoO3o008775; Wed, 2 Sep 2015 15:50:24 +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, 2 Sep 2015 15:50:24 +0300 From: Gleb Smirnoff To: Alexander Kabaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150902125024.GH1023@FreeBSD.org> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150901224438.32e982dd@kan> 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, 02 Sep 2015 12:50:34 -0000 Alexander, On Tue, Sep 01, 2015 at 10:44:38PM -0400, Alexander Kabaev wrote: A> On Tue, 1 Sep 2015 11:59:12 +0000 (UTC) A> > Log: A> > Not only build with buildworld, but also install with installworld A> > all alternative kernels. A> > A> > Sponsored by: Netflix A> > Sponsored by: Nginx, Inc. A> > A> > Modified: A> > head/Makefile.inc1 A> > A> > Modified: head/Makefile.inc1 A> > ============================================================================== A> > --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015 A> > (r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 A> > 2015 (r287358) @@ -1127,6 +1127,14 @@ reinstallkernel A> > reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ A> > ${CROSSENV} PATH=${TMPPATH} \ A> > ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} A> > ${.TARGET:S/kernel//} +.for _kernel in ${BUILDKERNELS:[2..-1]} A> > + @echo A> > "--------------------------------------------------------------" A> > + @echo ">>> Installing kernel ${_kernel}" A> > + @echo A> > "--------------------------------------------------------------" A> > + cd ${KRNLOBJDIR}/${_kernel}; \ A> > + ${CROSSENV} PATH=${TMPPATH} \ A> > + ${MAKE} ${IMAKE_INSTALL} A> > KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor A> > A> > distributekernel distributekernel.debug: A> > .if empty(INSTALLKERNEL) A> A> This is probably not doing what you think it is doing. Now, when A> installing my kernel, built from config file , I get it installed A> into /boot/kernel, which is good and normal, and I get an extra and A> highly undesired copy in boot/kernel.. That one I didn't ask for A> and would rather see it gone. Does that happen to you, or do you just suppose that this is going to happen looking at the code? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Sep 2 13:08:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B38049C7DB3; Wed, 2 Sep 2015 13:08:36 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (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 6CB8A645; Wed, 2 Sep 2015 13:08:36 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qkdv1 with SMTP id v1so4712027qkd.0; Wed, 02 Sep 2015 06:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=Y1ViPkmauj6uZGy0YD0oXw2ftJuJFrsom3jNkL44Ebo=; b=t9sK5AcPk5rrOBo5KVDvAGx4mwQNHHQw3kBMZggirb5AVYFgMjLRKfp6VDZhdRX76b e2jW7/HUW/rDJlIrMKsMe4krsY9neMsDVrT+//XYuI+2ob8GSnMvEYmpBWUi4ApvcFaR JV5zHSgJ7shA6P3s3jyXq7kxR7U8clFe3zJig05nkjY7zLRNw2x+jWe+sYu04kZqyXw+ 78QmJTLgA4Ct2nnxIDQ8FwXhiGQrzQJkRUhe9vL7u1XKqerR+O9kFSAtQH5KWftLVaFQ uo4bSGfdm5gGi87BhgiL3RVkyqSjSefaViraJXzgpS/Yn6x8hv299pAhxbJbDiuGjab2 Pnpw== X-Received: by 10.55.31.65 with SMTP id f62mr28567966qkf.6.1441199314139; Wed, 02 Sep 2015 06:08:34 -0700 (PDT) Received: from kan ([2601:18f:0:1570:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id o25sm12039071qkl.29.2015.09.02.06.08.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 06:08:33 -0700 (PDT) Date: Wed, 2 Sep 2015 09:08:25 -0400 From: Alexander Kabaev To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150902090825.619467d9@kan> In-Reply-To: <20150902125024.GH1023@FreeBSD.org> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/fK/_3W+ekQd6et=g+S0kolU"; 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, 02 Sep 2015 13:08:36 -0000 --Sig_/fK/_3W+ekQd6et=g+S0kolU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 2 Sep 2015 15:50:24 +0300 Gleb Smirnoff wrote: > Alexander, >=20 > On Tue, Sep 01, 2015 at 10:44:38PM -0400, Alexander Kabaev wrote: > A> On Tue, 1 Sep 2015 11:59:12 +0000 (UTC) > A> > Log: > A> > Not only build with buildworld, but also install with > A> > installworld all alternative kernels. > A> > =20 > A> > Sponsored by: Netflix > A> > Sponsored by: Nginx, Inc. > A> >=20 > A> > Modified: > A> > head/Makefile.inc1 > A> >=20 > A> > Modified: head/Makefile.inc1 > A> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > A> > --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015 > A> > (r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 > A> > 2015 (r287358) @@ -1127,6 +1127,14 @@ reinstallkernel > A> > reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ > A> > ${CROSSENV} PATH=3D${TMPPATH} \ > A> > ${MAKE} ${IMAKE_INSTALL} KERNEL=3D${INSTKERNNAME} > A> > ${.TARGET:S/kernel//} +.for _kernel in ${BUILDKERNELS:[2..-1]} > A> > + @echo > A> > "--------------------------------------------------------------" > A> > + @echo ">>> Installing kernel ${_kernel}" > A> > + @echo > A> > "--------------------------------------------------------------" > A> > + cd ${KRNLOBJDIR}/${_kernel}; \ > A> > + ${CROSSENV} PATH=3D${TMPPATH} \ > A> > + ${MAKE} ${IMAKE_INSTALL} > A> > KERNEL=3D${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor > A> > =20 > A> > distributekernel distributekernel.debug: > A> > .if empty(INSTALLKERNEL) > A>=20 > A> This is probably not doing what you think it is doing. Now, when > A> installing my kernel, built from config file , I get it > A> installed into /boot/kernel, which is good and normal, and I get > A> an extra and highly undesired copy in boot/kernel.. That one > A> I didn't ask for and would rather see it gone.=20 >=20 > Does that happen to you, or do you just suppose that this is going to > happen looking at the code? >=20 > --=20 > Totus tuus, Glebius. It does happen to me, I wouldn't bother you otherwise. 'make installworld KERNCONF=3DKANBSD' now results in kernel installed twice, once as /boot/kernel and once as /boot/kernel.KANBSD. Re-running it once more, I even get to have /boot/kernel.KANBSD.old. As a side point, 'make buildworld' does not suffer from same issue. --=20 Alexander Kabaev --Sig_/fK/_3W+ekQd6et=g+S0kolU Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJV5vTLXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+GKkP/AgntcLYxL1VAX7tSdZQeaDQ od5j42rCy9nGuj2aUrDqlgHd+WaTVa0N6On2AjPmtcAswozhnWfK24lyCkM5EX8b ZOnrA2Ox64jj6BSk7hx2g9WH/uEm1AJauDYMHmvfjmw1dAZDOG7gpfyg1g7kV8eG rRqJwNokh1P15RGX4qrtqSkPmN/Ug/JYsDdS2SmVns9OtWlWi7C2tF2KgltYZdZH GF/d6C4Hqvf3nrLoniMV8wVUCqx/Q0vpJJEvp/KR5mR+M1HcGfsZl7j3lkbtpmPe RR+fBRvyYQme4ks0XPVpYi0MxkSgpzAdIxUdino4Tn1WWB4EQfp1zdOEW4iAi2Vd Q0Lgs/RLnqZcuuefoonJWyR5CrqKb7+ViqQmIDc9JUsTy9evJFkBj0UNkaFYQc+0 NkusV7f+eM+72tlgPxH+hwDipFnlI+8iyJdQmyPKRtpZCkLpcQLdbaU9ZrLH/pcz DON/VeawUkMHLb9mMmCyWUcAO4sDAjKNLZksQFXRqvHX9CZgSY4VKy35YCGma0PC /WRcYoUDbCLZRwwh823bJZCP1bAc/xgpBIzrNWQHvIec/0U/J0E4M6vnfDL6a37w qcEgwrihlfaNWw8Z0SN8XYi7RakkED8139nFUlbRlsmKjlBimdYCmhJBNmxSnURD 72vyhMa7NQXYJtbdhtMi =eYuu -----END PGP SIGNATURE----- --Sig_/fK/_3W+ekQd6et=g+S0kolU-- From owner-svn-src-all@freebsd.org Wed Sep 2 13:20:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0BD79C8475; Wed, 2 Sep 2015 13:20:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 5E430D9A; Wed, 2 Sep 2015 13:20:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t82DKYNJ009025 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Sep 2015 16:20:34 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t82DKYEO009024; Wed, 2 Sep 2015 16:20:34 +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, 2 Sep 2015 16:20:34 +0300 From: Gleb Smirnoff To: Alexander Kabaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150902132034.GL1023@FreeBSD.org> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150902090825.619467d9@kan> 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, 02 Sep 2015 13:20:38 -0000 On Wed, Sep 02, 2015 at 09:08:25AM -0400, Alexander Kabaev wrote: A> > A> > Modified: head/Makefile.inc1 A> > A> > ============================================================================== A> > A> > --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015 A> > A> > (r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 A> > A> > 2015 (r287358) @@ -1127,6 +1127,14 @@ reinstallkernel A> > A> > reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ A> > A> > ${CROSSENV} PATH=${TMPPATH} \ A> > A> > ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} A> > A> > ${.TARGET:S/kernel//} +.for _kernel in ${BUILDKERNELS:[2..-1]} A> > A> > + @echo A> > A> > "--------------------------------------------------------------" A> > A> > + @echo ">>> Installing kernel ${_kernel}" A> > A> > + @echo A> > A> > "--------------------------------------------------------------" A> > A> > + cd ${KRNLOBJDIR}/${_kernel}; \ A> > A> > + ${CROSSENV} PATH=${TMPPATH} \ A> > A> > + ${MAKE} ${IMAKE_INSTALL} A> > A> > KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor A> > A> > A> > A> > distributekernel distributekernel.debug: A> > A> > .if empty(INSTALLKERNEL) A> > A> A> > A> This is probably not doing what you think it is doing. Now, when A> > A> installing my kernel, built from config file , I get it A> > A> installed into /boot/kernel, which is good and normal, and I get A> > A> an extra and highly undesired copy in boot/kernel.. That one A> > A> I didn't ask for and would rather see it gone. A> > A> > Does that happen to you, or do you just suppose that this is going to A> > happen looking at the code? A> > A> > -- A> > Totus tuus, Glebius. A> A> It does happen to me, I wouldn't bother you otherwise. A> A> 'make installworld KERNCONF=KANBSD' now results in kernel installed A> twice, once as /boot/kernel and once as /boot/kernel.KANBSD. Re-running A> it once more, I even get to have /boot/kernel.KANBSD.old. A> A> As a side point, 'make buildworld' does not suffer from same issue. installworld? Now I'm really confused. Was that typo? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Sep 2 13:29:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CDE09C8842; Wed, 2 Sep 2015 13:29:15 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (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 55BEF75A; Wed, 2 Sep 2015 13:29:15 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qgx61 with SMTP id 61so5248646qgx.3; Wed, 02 Sep 2015 06:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=AnTJeFI1p7/FYHaNdGKnJnreVOJWMcPeCJlE3Gpn6OM=; b=m508Zf2GJyhhU1RuN+VgzEepQxR/l2afakd/XbONwYQOqibIm3c67KNuo5EKJe1WKP 1zdZpoiMhH3lC8zSR/mxFpZOOK590GtGeLyyPNFSZuK7RCHvRiy/JGGiWbmAq+4cAGpT dEQMzL8K9JlhxlQpqEojtgb5YiUAo1McHmHPnUJ79cVFS7WapYJohCGn2nQbQhzGLz3n TrV3nzX6lnrhpFYR7ZpJL8QmlGmmQun+07bw6BJuA3lOLZmmHlU6jo9yofjdJW7A3Rpa MLplnydiAqOMqa0Ie8C/TAH1eoVvpvhYlLd+027djq8IK7YrnBPYE7p5Nd3I2EBln1iy WslA== X-Received: by 10.140.147.69 with SMTP id 66mr59681223qht.57.1441200554377; Wed, 02 Sep 2015 06:29:14 -0700 (PDT) Received: from kan ([2601:18f:0:1570:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id 21sm6056526qgd.39.2015.09.02.06.29.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 06:29:13 -0700 (PDT) Date: Wed, 2 Sep 2015 09:28:53 -0400 From: Alexander Kabaev To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150902092853.794f0640@kan> In-Reply-To: <20150902132034.GL1023@FreeBSD.org> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> <20150902132034.GL1023@FreeBSD.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/5vH+QpFs8pfBHeV4N/2x21e"; 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, 02 Sep 2015 13:29:15 -0000 --Sig_/5vH+QpFs8pfBHeV4N/2x21e Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 2 Sep 2015 16:20:34 +0300 Gleb Smirnoff wrote: > On Wed, Sep 02, 2015 at 09:08:25AM -0400, Alexander Kabaev wrote: > A> > A> > Modified: head/Makefile.inc1 > A> > A> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > A> > A> > --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015 > A> > A> > (r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 > A> > A> > 2015 (r287358) @@ -1127,6 +1127,14 @@ reinstallkernel > A> > A> > reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; > A> > A> > \ ${CROSSENV} PATH=3D${TMPPATH} \ > A> > A> > ${MAKE} ${IMAKE_INSTALL} KERNEL=3D${INSTKERNNAME} > A> > A> > ${.TARGET:S/kernel//} +.for _kernel in > A> > A> > ${BUILDKERNELS:[2..-1]} > A> > A> > + @echo > A> > A> > "--------------------------------------------------------------" > A> > A> > + @echo ">>> Installing kernel ${_kernel}" > A> > A> > + @echo > A> > A> > "--------------------------------------------------------------" > A> > A> > + cd ${KRNLOBJDIR}/${_kernel}; \ > A> > A> > + ${CROSSENV} PATH=3D${TMPPATH} \ > A> > A> > + ${MAKE} ${IMAKE_INSTALL} > A> > A> > KERNEL=3D${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} > A> > A> > +.endfor=20 > A> > A> > distributekernel distributekernel.debug: > A> > A> > .if empty(INSTALLKERNEL) > A> > A>=20 > A> > A> This is probably not doing what you think it is doing. Now, > A> > A> when installing my kernel, built from config file , I > A> > A> get it installed into /boot/kernel, which is good and normal, > A> > A> and I get an extra and highly undesired copy in > A> > A> boot/kernel.. That one I didn't ask for and would > A> > A> rather see it gone.=20 > A> >=20 > A> > Does that happen to you, or do you just suppose that this is > A> > going to happen looking at the code? > A> >=20 > A> > --=20 > A> > Totus tuus, Glebius. > A>=20 > A> It does happen to me, I wouldn't bother you otherwise. > A>=20 > A> 'make installworld KERNCONF=3DKANBSD' now results in kernel installed > A> twice, once as /boot/kernel and once as /boot/kernel.KANBSD. > A> Re-running it once more, I even get to > A> have /boot/kernel.KANBSD.old. > A>=20 > A> As a side point, 'make buildworld' does not suffer from same issue. >=20 > installworld? Now I'm really confused. Was that typo? >=20 > --=20 > Totus tuus, Glebius. Sorry, read them as installkernel and buildkernel respectively. --=20 Alexander Kabaev --Sig_/5vH+QpFs8pfBHeV4N/2x21e Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJV5vmVXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+6EoP/j9ECtz3dL5RSuf7P1OTNT90 pVhyQMWaSy02TRj9vH7ZaMQX8ZOi4Ta0jFgruHAIOPvCfSHIqr4P5nh9OoWO/Yco X58CccgoNZmRBNzJlHaEiUCNeDzeiSyTbRmGAXwhYspps9ikV0vKhoSB8S3MULFg 5SRKu3omWIvdsrkJo9oZ+tG8AF/VEFFwH65OvqZaDZqisz151n95AuYXggqUBTlr y6h3UI1N9LNVbYSUGl8cH6TBW/yjDqM+dnTAApJYCLvH7ythJUrY/Bj9k0u0tdlH C8+ZoDPYhHwgPnCrBnzUJXVfrkeDHeHfr4KS7rn1zpiJFknGX6vcHHutQ+/NwCdi PPOEQX591RQKyXmZXgP0q1QYpWCp2x6ICwgYA1qnZUXsfMS+5SjcfyZCf7NLRcNb 8n2K2ITsLr0eOqQ1dkDoxHvtJBqF13du+dhUyoCKJp5G352gdUmunoikoRh7O2rW r/1lrospFRdCLFR7HhfJ2oSKb/ryByO7ENxqp9+jreLy6NuFWmUYthzA+mN09pZC su5ayqMdY6pV0nbbp97EMqNoWbkJDD1L5ziVGdMGYPUXEF3Mf2qHMZO9JgGO/2VB oeEbFxGWk1s/UsRFT5ulkwASqSGehxEDgHz/YPjk+ya5AvjuQsV3qa0Ow2IQi+k7 bIHkzKmsTEJmTg8SkM8R =EabN -----END PGP SIGNATURE----- --Sig_/5vH+QpFs8pfBHeV4N/2x21e-- From owner-svn-src-all@freebsd.org Wed Sep 2 13:36:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C02C9C8C30; Wed, 2 Sep 2015 13:36:26 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (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 F1502CF7; Wed, 2 Sep 2015 13:36:25 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qkdv1 with SMTP id v1so5245073qkd.0; Wed, 02 Sep 2015 06:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=g9wBh9NXVFZI+DGrRlLIe9FkxYNou59tFmrse6/2bUc=; b=MopTzlxdKz8ahTOgIAjRNsRs9VmXob8OsAwZAJRdUTfI4DXwVRb6Ss+FY5cBTE1lwI Mi10ntIJSywC6oIhmgCpDgKvA5Q7cLxTVd6GuA1NPHaBR5XToeMJyMiDbPvOf3SAn6ey FsSMXbZsGdy52Pwyz7bZekYzh8zqX+031i91jcaIeP2nzNZM9fzYYmWVWFYFk9NMj+TS iGYAdkFij+X6bJd6xTLxU+XuMfW+4lnB/E3BIneIgMtCubAwHt0FChLP/xtTOu0K1oWZ yqDGw0BGS0rnGr8g7LJz7qW4Il+3HxmiUnh6znEyyWP4ENLukOGGemCxoAVyVvlyBrsa iJsg== X-Received: by 10.55.217.84 with SMTP id u81mr28311872qki.76.1441200985074; Wed, 02 Sep 2015 06:36:25 -0700 (PDT) Received: from kan ([2601:18f:0:1570:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id k32sm12845216qkh.39.2015.09.02.06.36.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 06:36:24 -0700 (PDT) Date: Wed, 2 Sep 2015 09:36:22 -0400 From: Alexander Kabaev To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150902093622.751a85f2@kan> In-Reply-To: <20150902132034.GL1023@FreeBSD.org> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> <20150902132034.GL1023@FreeBSD.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/ldBm5CQJKPAygIti8ivwxIy"; 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, 02 Sep 2015 13:36:26 -0000 --Sig_/ldBm5CQJKPAygIti8ivwxIy Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 2 Sep 2015 16:20:34 +0300 Gleb Smirnoff wrote: > On Wed, Sep 02, 2015 at 09:08:25AM -0400, Alexander Kabaev wrote: > A> >=20 > A> > Does that happen to you, or do you just suppose that this is > A> > going to happen looking at the code? > A> >=20 > A> > --=20 > A> > Totus tuus, Glebius. > A>=20 > A> It does happen to me, I wouldn't bother you otherwise. > A>=20 > A> 'make installworld KERNCONF=3DKANBSD' now results in kernel installed > A> twice, once as /boot/kernel and once as /boot/kernel.KANBSD. > A> Re-running it once more, I even get to > A> have /boot/kernel.KANBSD.old. > A>=20 > A> As a side point, 'make buildworld' does not suffer from same issue. >=20 > installworld? Now I'm really confused. Was that typo? >=20 > --=20 > Totus tuus, Glebius. Just to make sure information gets through un-munged this time, the output of the sudo make installkernel KERNCONF=3DKANBSD 2>&1 | tee installkernel.log is available at=20 https://people.freebsd.org/~kan/installkernel.log --=20 Alexander Kabaev --Sig_/ldBm5CQJKPAygIti8ivwxIy Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJV5vtXXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+9PYQAKICuU4lPwU+mFEn34CnJ4SZ MQpO09eWduwmhTzKBilvqeDenWaNj9EOxV9HSx2eai/k+Q2k/oZ9A800qehLEgHi QCRiGRziZvJ62kc5vdoGfEbuT0dOKVURFacJQFvV780N0QEsd3IAiUBxMxv2sGtT CX7T0HR7tySAXwdn8w+VO9z4iHzUHCiJDATPG3QIZ8RvMF8gLqpnAY1lCKUudm0h V/eZk21w87bZ7KPswu/cExrvGL9afyRHYRxQK4cgEU0wuPPrDH3ZfYVvHs1KE8di HeBI8dmGQJQ5P+hwzs1hK41cKcj6j9+DynOFBEpBE+I+aHhWVqAAp7oNIm9+sIz1 JkrSY0KyLac844PxCRJ89Auj8h0DUrjkIZ4TkQFCz4VPQ+B1kqVGOhuZoiRzOUfu SUGNjgA/lJJ4ZZi5ndVlGfrB6JvfwvS2jmNgppj+3rdOrs4hWqmdBUf5ZyR8cXws 5YZzQiW2F9DJHbr19TDQkjSXmeFflWFWDNmn1Te73b1h7JNSAT5dsXPjJmwyhVxL FjC5TFvYcC8DaZzJIEgLg/5QmMhNj43GuKtq9y0bt3xkPy2OmdRqBUjs8O/LeLUP 7G9Lydgq4xlhMZFLyHrBK0tH/USsbHIrJ5n88XXG7eSmVxPK2/YT7aKPRRac/lC8 51zMUi/0948PT8VouXJ3 =Dbwh -----END PGP SIGNATURE----- --Sig_/ldBm5CQJKPAygIti8ivwxIy-- From owner-svn-src-all@freebsd.org Wed Sep 2 13:57:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 101E99C873C; Wed, 2 Sep 2015 13:57:06 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (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 AE010E96; Wed, 2 Sep 2015 13:57:05 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by wicge5 with SMTP id ge5so41979851wic.0; Wed, 02 Sep 2015 06:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=hokxZ2remcT2coa4Z/bB06qd+iDPsmuDVy2CbQsy/j8=; b=O7V8+iu8olEp1XPQk7hEe4vZ1Wxj+AkSwzAfQyT9AhwDVpmnkZgRUxEZxmabzQgugn mMfWh/PMLe+5EfC4j14Fc7z4F5amBeKbzbh1hV9ojuJ3DT4SkOL5KKwLrtVj8+xD5RVY sJpgMh462LpCHfY88/GtAZg+qXgIysmbYm3m6+vCoVt8MAlXpFdQ14OO0o3CCGmldRv5 eaRFg/3TMk268UAWIl/+EvMSHVErk31kiWCNY3zo2UmMUfiVnay9jX/OOuyVUvo3BfNr w9wxfkTMX116/38QjEle3z4bbZrk4Q7juOSoYeM2cIrA9Gx8cMKuk6L8Sjr6OvgkMG9q FMvQ== X-Received: by 10.194.121.100 with SMTP id lj4mr39567803wjb.104.1441202224150; Wed, 02 Sep 2015 06:57:04 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([2a01:d0:c0a9:3:c685:8ff:fe11:1aa2]) by smtp.googlemail.com with ESMTPSA id ik8sm32589498wjb.8.2015.09.02.06.57.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 06:57:03 -0700 (PDT) Message-ID: <55E7002D.8080001@gmail.com> Date: Wed, 02 Sep 2015 16:57:01 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Alexander Kabaev , Gleb Smirnoff CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> <20150902132034.GL1023@FreeBSD.org> <20150902093622.751a85f2@kan> In-Reply-To: <20150902093622.751a85f2@kan> Content-Type: text/plain; charset=windows-1252 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, 02 Sep 2015 13:57:06 -0000 On 02.09.2015 16:36, Alexander Kabaev wrote: > On Wed, 2 Sep 2015 16:20:34 +0300 > Gleb Smirnoff wrote: > >> On Wed, Sep 02, 2015 at 09:08:25AM -0400, Alexander Kabaev wrote: >> A> > >> A> > Does that happen to you, or do you just suppose that this is >> A> > going to happen looking at the code? >> A> > >> A> > -- >> A> > Totus tuus, Glebius. >> A> >> A> It does happen to me, I wouldn't bother you otherwise. >> A> >> A> 'make installworld KERNCONF=KANBSD' now results in kernel installed >> A> twice, once as /boot/kernel and once as /boot/kernel.KANBSD. >> A> Re-running it once more, I even get to >> A> have /boot/kernel.KANBSD.old. >> A> >> A> As a side point, 'make buildworld' does not suffer from same issue. >> >> installworld? Now I'm really confused. Was that typo? >> >> -- >> Totus tuus, Glebius. > > Just to make sure information gets through un-munged this time, the > output of the > sudo make installkernel KERNCONF=KANBSD 2>&1 | tee installkernel.log is > available at > https://people.freebsd.org/~kan/installkernel.log Sorry if it is documented somewhere, but can this be disabled somehow? On my development server installkernel for some reason already took more time then buildkernel -DKERNFAST. Now I suppose it will take twice more. I am doing it hundred times a day, and I am not happy. :-\ -- Alexander Motin From owner-svn-src-all@freebsd.org Wed Sep 2 14:04:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6560A9C8C85; Wed, 2 Sep 2015 14:04:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 56136C47; Wed, 2 Sep 2015 14:04:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82E4ErG037570; Wed, 2 Sep 2015 14:04:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82E4E46037569; Wed, 2 Sep 2015 14:04:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509021404.t82E4E46037569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 2 Sep 2015 14:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287395 - 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: Wed, 02 Sep 2015 14:04:14 -0000 Author: trasz Date: Wed Sep 2 14:04:13 2015 New Revision: 287395 URL: https://svnweb.freebsd.org/changeset/base/287395 Log: Fixes a panic triggered by threaded Linux applications when running with RACCT/RCTL enabled. Reviewed by: ngie@, ed@ Tested by: Larry Rosenman MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3470 Modified: head/sys/compat/linux/linux_fork.c Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Wed Sep 2 12:46:42 2015 (r287394) +++ head/sys/compat/linux/linux_fork.c Wed Sep 2 14:04:13 2015 (r287395) @@ -285,10 +285,20 @@ linux_clone_thread(struct thread *td, st p = td->td_proc; +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(p); + error = racct_add(p, RACCT_NTHR, 1); + PROC_UNLOCK(p); + if (error != 0) + return (EPROCLIM); + } +#endif + /* Initialize our td */ error = kern_thr_alloc(p, 0, &newtd); if (error) - return (error); + goto fail; cpu_set_upcall(newtd, td); @@ -369,6 +379,16 @@ linux_clone_thread(struct thread *td, st td->td_retval[0] = newtd->td_tid; return (0); + +fail: +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(p); + racct_sub(p, RACCT_NTHR, 1); + PROC_UNLOCK(p); + } +#endif + return (error); } int From owner-svn-src-all@freebsd.org Wed Sep 2 14:06:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB22D9C8DCC; Wed, 2 Sep 2015 14:06:52 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::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 719DAE7F; Wed, 2 Sep 2015 14:06:52 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qkdv1 with SMTP id v1so5851648qkd.0; Wed, 02 Sep 2015 07:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=/rQ34U+DsZGNVK7QsdyOFfEe6+NUU2+d15ytvb9554I=; b=y6naDGfNjyKK/J5i3pGK7LYikYVvf7fzs/NcnyBmx53qdaRvtud0Li/sgqRJQi0USf euXdHN8J82+o9cfpzkmoESfhNH1zrWrIVxAGOzNzJZ2vuPdhyDoowoa3u51yBr+y+faf Qha/dgMaIAX/ZgW20dgvgAGyBY4zYbYh5EsvIhlavUix5GDw1iG+3wr7y3E0/L+X471w 4vnxRO9VW9/42GpXPTajt9Sb5bVAuByZrto/x1jAlfww57IDapKbI6bxFFRcmRddCzdz JJ80HfNwgGlVg31pJvJfFYmJcY4A7oa43Dt3Lbh4cak8o9UadKkPhamWm/PWCihJ2chl 6RuA== X-Received: by 10.55.192.26 with SMTP id o26mr28110791qki.89.1441202811559; Wed, 02 Sep 2015 07:06:51 -0700 (PDT) Received: from kan ([2601:18f:0:1570:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id f9sm12803846qhe.7.2015.09.02.07.06.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 07:06:50 -0700 (PDT) Date: Wed, 2 Sep 2015 10:06:43 -0400 From: Alexander Kabaev To: Alexander Motin Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287358 - head Message-ID: <20150902100643.78da76c4@kan> In-Reply-To: <55E7002D.8080001@gmail.com> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> <20150902132034.GL1023@FreeBSD.org> <20150902093622.751a85f2@kan> <55E7002D.8080001@gmail.com> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/rNntuTm9KB=S.fcoQS==RGj"; 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, 02 Sep 2015 14:06:52 -0000 --Sig_/rNntuTm9KB=S.fcoQS==RGj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 02 Sep 2015 16:57:01 +0300 Alexander Motin wrote: > On 02.09.2015 16:36, Alexander Kabaev wrote: > > On Wed, 2 Sep 2015 16:20:34 +0300 > > Gleb Smirnoff wrote: > >=20 > >> On Wed, Sep 02, 2015 at 09:08:25AM -0400, Alexander Kabaev wrote: > >> A> >=20 > >> A> > Does that happen to you, or do you just suppose that this is > >> A> > going to happen looking at the code? > >> A> >=20 > >> A> > --=20 > >> A> > Totus tuus, Glebius. > >> A>=20 > >> A> It does happen to me, I wouldn't bother you otherwise. > >> A>=20 > >> A> 'make installworld KERNCONF=3DKANBSD' now results in kernel > >> A> installed twice, once as /boot/kernel and once > >> A> as /boot/kernel.KANBSD. Re-running it once more, I even get to > >> A> have /boot/kernel.KANBSD.old. > >> A>=20 > >> A> As a side point, 'make buildworld' does not suffer from same > >> A> issue. > >> > >> installworld? Now I'm really confused. Was that typo? > >> > >> --=20 > >> Totus tuus, Glebius. > >=20 > > Just to make sure information gets through un-munged this time, the > > output of the > > sudo make installkernel KERNCONF=3DKANBSD 2>&1 | tee > > installkernel.log is available at=20 > > https://people.freebsd.org/~kan/installkernel.log >=20 > Sorry if it is documented somewhere, but can this be disabled somehow? > On my development server installkernel for some reason already took > more time then buildkernel -DKERNFAST. Now I suppose it will take > twice more. I am doing it hundred times a day, and I am not happy. :-\ >=20 Well, I do not think this this was the intended behaviour, so it is pretty safe to assume it will get fixed. Makefile.inc1 uses documented '[2..-1]' subscript to prevent same kernel installed more than once but somehow that does not work. --=20 Alexander Kabaev --Sig_/rNntuTm9KB=S.fcoQS==RGj Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJV5wJzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+ab4P/1tLXem6N2p3bF5ZP34LEi73 tIf+8Ry7Lh/guK9LNOUv/+/DG+1IlNO8Re1sef1UhGCJNzv2LmbXSmknGY0SJlKD Pjr6TxO0KVmwWOvqJbn3HrkmnPR3oRQqNIDIkwVutDTsGKG7VXtmmcOlkKiR+RAL ADrxrl1U4+6W0wgpOPLRjrehO1LD1yel+iGJaOar/tB70WFcBAx98UniCcYCit72 CYlEgFhh/fUx9+KDYVqYHMSmYpBBtgVdjP/B4H8hqrCXt90X1YRkl3CPsdS9SAYg 2sOVo4PMP9DUoQikWlOB+7BYkL30iS5I3xshGGr8vekgBYRnXEbVtIeb1pLXNOTC iXMPP0vJEmW42QYJfNpw7P0ErQ9EBYjrGpcay/ulRZbolSqfZaDrnkloYmK+X4gq F5AWCrKhKlgjlGXB6De8euL4eUAQPADVbqX1Xwd+K/0BhaTQAsKMBTO1We9Zwh9T WgaCKSWugCDAguRABTl+nNAesnqmjBfjoBjUy+5WABPdmokZHtdl6Rwwhd3+0q6g HsM386DniYm6oXbtjgT18qTqwberaJvUVW64LTjFKL0XMdfbJMZcu84Oh09D3YB+ 7KyT129aRLPBMeqabCKdTCLNzJ34bM+5bYhuLA4TlXCEWOlLuksuyjuhze1KqUUV ng3m+GRB7NeS4wFrUPmW =SnaX -----END PGP SIGNATURE----- --Sig_/rNntuTm9KB=S.fcoQS==RGj-- From owner-svn-src-all@freebsd.org Wed Sep 2 14:08:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 451B69C8F1F; Wed, 2 Sep 2015 14:08:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 2916E286; Wed, 2 Sep 2015 14:08:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82E8mBN038352; Wed, 2 Sep 2015 14:08:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82E8h0Q038324; Wed, 2 Sep 2015 14:08:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509021408.t82E8h0Q038324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 2 Sep 2015 14:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287396 - in head: sbin/bsdlabel sbin/dumpfs sbin/fdisk sbin/ffsinfo sbin/mdconfig sbin/newfs sbin/newfs_msdos sbin/newfs_nandfs sbin/reboot share/man/man4 share/man/man7 share/man/man8... 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, 02 Sep 2015 14:08:48 -0000 Author: trasz Date: Wed Sep 2 14:08:43 2015 New Revision: 287396 URL: https://svnweb.freebsd.org/changeset/base/287396 Log: It's 2015, and some people are still trying to use fdisk and then go asking what debug flags to set for GEOM to make it work. Advice them to use gpart(8) instead. Something similar should probably done with disklabel, but I need to rewrite the disklabel examples first. Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3315 Modified: head/sbin/bsdlabel/bsdlabel.8 head/sbin/dumpfs/dumpfs.8 head/sbin/fdisk/fdisk.8 head/sbin/ffsinfo/ffsinfo.8 head/sbin/mdconfig/mdconfig.8 head/sbin/newfs/newfs.8 head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_nandfs/newfs_nandfs.8 head/sbin/reboot/boot_i386.8 head/share/man/man4/da.4 head/share/man/man4/md.4 head/share/man/man4/vpo.4 head/share/man/man7/tuning.7 head/share/man/man8/picobsd.8 head/usr.sbin/boot0cfg/boot0cfg.8 Modified: head/sbin/bsdlabel/bsdlabel.8 ============================================================================== --- head/sbin/bsdlabel/bsdlabel.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/bsdlabel/bsdlabel.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -445,7 +445,10 @@ to properly recognize the disk: .Bd -literal -offset indent dd if=/dev/zero of=/dev/da0 bs=512 count=32 -fdisk -BI da0 +gpart create -s MBR da0 +gpart add -t freebsd da0 +gpart set -a active -i 1 da0 +gpart bootcode -b /boot/mbr da0 dd if=/dev/zero of=/dev/da0s1 bs=512 count=32 bsdlabel -w -B da0s1 bsdlabel -e da0s1 @@ -495,6 +498,5 @@ are not generally compatible. .Xr md 4 , .Xr disktab 5 , .Xr boot0cfg 8 , -.Xr fdisk 8 , .Xr gpart 8 , .Xr newfs 8 Modified: head/sbin/dumpfs/dumpfs.8 ============================================================================== --- head/sbin/dumpfs/dumpfs.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/dumpfs/dumpfs.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -100,8 +100,8 @@ flag is needed if the filesystem uses .Sh SEE ALSO .Xr disktab 5 , .Xr fs 5 , -.Xr disklabel 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr newfs 8 , .Xr tunefs 8 .Sh HISTORY Modified: head/sbin/fdisk/fdisk.8 ============================================================================== --- head/sbin/fdisk/fdisk.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/fdisk/fdisk.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -39,6 +39,13 @@ The utility can be used to divide space on the disk into slices and set one active. .Sh DESCRIPTION +.Bf -symbolic +This command is obsolete. +Users are advised to use +.Xr gpart 8 +instead. +.Ef +.Pp The .Fx utility, Modified: head/sbin/ffsinfo/ffsinfo.8 ============================================================================== --- head/sbin/ffsinfo/ffsinfo.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/ffsinfo/ffsinfo.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -121,9 +121,9 @@ to .Pa /var/tmp/ffsinfo with all available information. .Sh SEE ALSO -.Xr disklabel 8 , .Xr dumpfs 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr growfs 8 , .Xr gvinum 8 , .Xr newfs 8 , Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/mdconfig/mdconfig.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -300,8 +300,7 @@ mount /dev/md1.nop /mnt .Sh SEE ALSO .Xr md 4 , .Xr ffs 7 , -.Xr bsdlabel 8 , -.Xr fdisk 8 , +.Xr gpart 8 , .Xr mdmfs 8 , .Xr malloc 9 .Sh HISTORY Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/newfs/newfs.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -303,11 +303,11 @@ on file systems that contain many small .Xr geom 4 , .Xr disktab 5 , .Xr fs 5 , -.Xr bsdlabel 8 , .Xr camcontrol 8 , .Xr dump 8 , .Xr dumpfs 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr gjournal 8 , .Xr growfs 8 , .Xr gvinum 8 , Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/newfs_msdos/newfs_msdos.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -228,9 +228,7 @@ Create a 30MB image file, with the FAT p newfs_msdos -C 30M -@63s ./somefile .Ed .Sh SEE ALSO -.Xr disktab 5 , -.Xr disklabel 8 , -.Xr fdisk 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh HISTORY The Modified: head/sbin/newfs_nandfs/newfs_nandfs.8 ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/newfs_nandfs/newfs_nandfs.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -63,9 +63,7 @@ Create a file system, using default para newfs_nandfs /dev/ada0s1 .Ed .Sh SEE ALSO -.Xr disktab 5 , -.Xr disklabel 8 , -.Xr fdisk 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh HISTORY The Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/sbin/reboot/boot_i386.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -352,9 +352,9 @@ requirement has not been adhered to. .Xr make.conf 5 , .Xr ttys 5 , .Xr boot0cfg 8 , -.Xr bsdlabel 8 , .Xr btxld 8 , .Xr config 8 , +.Xr gpart 8 , .Xr gptboot 8 , .Xr halt 8 , .Xr loader 8 , Modified: head/share/man/man4/da.4 ============================================================================== --- head/share/man/man4/da.4 Wed Sep 2 14:04:13 2015 (r287395) +++ head/share/man/man4/da.4 Wed Sep 2 14:08:43 2015 (r287396) @@ -205,8 +205,7 @@ None. .Xr ada 4 , .Xr cam 4 , .Xr geom 4 , -.Xr bsdlabel 8 , -.Xr fdisk 8 +.Xr gpart 8 .Sh HISTORY The .Nm Modified: head/share/man/man4/md.4 ============================================================================== --- head/share/man/man4/md.4 Wed Sep 2 14:04:13 2015 (r287395) +++ head/share/man/man4/md.4 Wed Sep 2 14:08:43 2015 (r287396) @@ -81,8 +81,7 @@ disk found in the man page. Other tools will also create these images, such as NanoBSD. .Sh SEE ALSO -.Xr disklabel 8 , -.Xr fdisk 8 , +.Xr gpart 8 , .Xr loader 8 , .Xr mdconfig 8 , .Xr mdmfs 8 , Modified: head/share/man/man4/vpo.4 ============================================================================== --- head/share/man/man4/vpo.4 Wed Sep 2 14:04:13 2015 (r287395) +++ head/share/man/man4/vpo.4 Wed Sep 2 14:08:43 2015 (r287396) @@ -64,7 +64,7 @@ When mounting a DOS file system or formatting a .Fx file system, check the slice of the disk with the -.Xr fdisk 8 +.Xr gpart 8 utility. .Pp In order to unixify a ZIP disk, put the following in /etc/disktab: Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Wed Sep 2 14:04:13 2015 (r287395) +++ head/share/man/man7/tuning.7 Wed Sep 2 14:08:43 2015 (r287396) @@ -753,10 +753,10 @@ over services you export from your box ( .Xr ports 7 , .Xr boot 8 , .Xr bsdinstall 8 , -.Xr bsdlabel 8 , .Xr ccdconfig 8 , .Xr config 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr gjournal 8 , .Xr gstripe 8 , .Xr gvinum 8 , Modified: head/share/man/man8/picobsd.8 ============================================================================== --- head/share/man/man8/picobsd.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/share/man/man8/picobsd.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -425,7 +425,7 @@ third form, replacing .Ar NN with the actual start of the partition (which you can determine using -.Xr fdisk 8 ) . +.Xr gpart 8 ) . Note that after saving the image to the slice, it will not yet be recognised. You have to use the Modified: head/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.8 Wed Sep 2 14:04:13 2015 (r287395) +++ head/usr.sbin/boot0cfg/boot0cfg.8 Wed Sep 2 14:08:43 2015 (r287396) @@ -180,14 +180,13 @@ To enable just slices 1 and 3 in the men .Dl "boot0cfg -m 0x5 ada0" .Pp To go back to non-interactive booting, use -.Xr fdisk 8 +.Xr gpart 8 to install the default MBR: .Pp -.Dl "fdisk -B ada0" +.Dl "gpart bootcode -b /boot/mbr ada0" .Sh SEE ALSO .Xr geom 4 , .Xr boot 8 , -.Xr fdisk 8 , .Xr gpart 8 .Sh AUTHORS .An Robert Nordier Aq Mt rnordier@FreeBSD.org From owner-svn-src-all@freebsd.org Wed Sep 2 14:10:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF15E9C9027; Wed, 2 Sep 2015 14:10:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 CFF106E7; Wed, 2 Sep 2015 14:10:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82EAAPg039134; Wed, 2 Sep 2015 14:10:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82EAAea039133; Wed, 2 Sep 2015 14:10:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509021410.t82EAAea039133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 2 Sep 2015 14:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287397 - head/sbin/mount_unionfs 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, 02 Sep 2015 14:10:11 -0000 Author: trasz Date: Wed Sep 2 14:10:09 2015 New Revision: 287397 URL: https://svnweb.freebsd.org/changeset/base/287397 Log: Fix markup. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_unionfs/mount_unionfs.8 Modified: head/sbin/mount_unionfs/mount_unionfs.8 ============================================================================== --- head/sbin/mount_unionfs/mount_unionfs.8 Wed Sep 2 14:08:43 2015 (r287396) +++ head/sbin/mount_unionfs/mount_unionfs.8 Wed Sep 2 14:10:09 2015 (r287397) @@ -83,7 +83,7 @@ becomes the upper layer. However, .Ar uniondir remains the mount point. -.It Sm Cm copymode No = Cm traditional | transparent | masquerade Sm +.It Cm copymode No = Cm traditional | transparent | masquerade Specifies the way to create a file or a directory in the upper layer automatically when needed. The @@ -98,7 +98,7 @@ For behavior of the mode, see .Sx MASQUERADE MODE below. -.It Sm Cm whiteout No = Cm always | whenneeded Sm +.It Cm whiteout No = Cm always | whenneeded Specifies whether whiteouts should always be made in the upper layer when removing a file or directory or only when it already exists in the lower layer. From owner-svn-src-all@freebsd.org Wed Sep 2 14:12:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27EFF9C91EA for ; Wed, 2 Sep 2015 14:12:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com [209.85.220.170]) (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 E30FFC14 for ; Wed, 2 Sep 2015 14:12:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by qkcj187 with SMTP id j187so5974307qkc.2 for ; Wed, 02 Sep 2015 07:12:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:content-type:mime-version; bh=+/UOooNepZJEVfr9SaLmSXNZFvuFsHcIddj4hJ2YlCM=; b=IKECmG15jLmaP043EFBIYA/MTg9bKTJmSFP7OGs7seULoFLhp7/8k2lMhc6IFewmA0 q+wJS7eOktDUR6i0sdJdvySQJCjgZmUS/qDRJBnB9HlNumkPcGGYcljFTK3bp83GJlw9 PKXkeytel7kKxjMZ1w1gkqTQZQvZ2KFOgnvjJNNASdeag13UShQREyFCZVf4dB98hOMq ex8SYY/D649tx+Rw3PDPbb4Xa1oLjydv51A482sInUSbPNWqlisUTCPGthMqNv/3vmZ5 PH/mZHDwTqJd0EBwAmkgX2C17dJ3dZ/om7fMA90hlMRd5EHuYcXznDykRH5bFdnyeXg6 AdCQ== X-Gm-Message-State: ALoCoQks/llDxVnMNu5pgi5CZF23LPTbB9VV/CYHuk4lvNR35EqVrA6cK3iKm5MNsTD3x1kqsdRS X-Received: by 10.55.215.134 with SMTP id t6mr29114080qkt.18.1441203141897; Wed, 02 Sep 2015 07:12:21 -0700 (PDT) Received: from [192.168.170.11] ([63.88.83.104]) by smtp.gmail.com with ESMTPSA id y7sm12914816qky.20.2015.09.02.07.12.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 07:12:21 -0700 (PDT) Message-ID: <1441203135.5667.25.camel@hardenedbsd.org> Subject: Re: svn commit: r287394 - head/etc From: Shawn Webb To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 02 Sep 2015 10:12:15 -0400 In-Reply-To: <201509021246.t82Ckhkn099532@repo.freebsd.org> References: <201509021246.t82Ckhkn099532@repo.freebsd.org> Organization: HardenedBSD Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-SoH8rS3hwyGJkhKisPoU" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.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: Wed, 02 Sep 2015 14:12:29 -0000 --=-SoH8rS3hwyGJkhKisPoU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Gleb, On Wed, 2015-09-02 at 12:46 +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Sep 2 12:46:42 2015 > New Revision: 287394 > URL: https://svnweb.freebsd.org/changeset/base/287394 >=20 > Log: > Fix dynamic attach/detach of 802.11 devices after r287197: > =20 > o In pccard_ether add code to start children of a 802.11 > device, that are configured in rc.conf. > o In devd.conf provide a regex matching all 802.11 devices, > and on match run pccard_ether to spawn children. > =20 > PR: 202784 > Submitted by: > In collaboration with: "Oleg V. Nauman" >=20 > Modified: > head/etc/devd.conf > head/etc/pccard_ether >=20 > Modified: head/etc/devd.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/devd.conf Wed Sep 2 05:55:57 2015 (r287393) > +++ head/etc/devd.conf Wed Sep 2 12:46:42 2015 (r287394) > @@ -22,6 +22,9 @@ options { > "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ > esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\ > [0-9]+"; > + set wifi-driver-regex > + "(ath|bwi|bwn|ipw|iwi|iwn|malo|mwl|ral|rsu|rum|run|uath|upgt|\ > + ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; > }; Should the new iwm driver also be added? > =20 > # Note that the attach/detach with the highest value wins, so that one c= an > @@ -57,17 +60,16 @@ notify 0 { > }; > =20 > # > -# Like Ethernet devices, but separate because > -# they have a different media type. We may want > -# to exploit this later. > +# Like Ethernet devices, but separate because 802.11 require spawning > +# wlan(4) interface. > # > -detach 0 { > - media-type "802.11"; > - action "/etc/pccard_ether $device-name stop"; > -}; > attach 0 { > - media-type "802.11"; > - action "/etc/pccard_ether $device-name start"; > + device-name "$wifi-driver-regex"; > + action "/etc/pccard_ether $device-name startchildren"; > +}; > +detach 0 { > + device-name "$wifi-driver-regex"; > + action "/etc/pccard_ether $device-name stopchildren"; > }; > notify 0 { > match "system" "IFNET"; >=20 > Modified: head/etc/pccard_ether > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/pccard_ether Wed Sep 2 05:55:57 2015 (r287393) > +++ head/etc/pccard_ether Wed Sep 2 12:46:42 2015 (r287394) > @@ -17,6 +17,9 @@ stop_precmd=3D"checkauto" > stop_cmd=3D"pccard_ether_stop" > restart_precmd=3D"checkauto" > restart_cmd=3D"pccard_ether_restart" > +startchildren_cmd=3D"pccard_ether_startchildren" > +stopchildren_cmd=3D"pccard_ether_stopchildren" > +extra_commands=3D"startchildren stopchildren" > =20 > setup_routes() > { > @@ -114,6 +117,20 @@ pccard_ether_restart() > pccard_ether_start > } > =20 > +pccard_ether_startchildren() > +{ > + for child in `get_if_var $ifn wlans_IF`; do > + /etc/rc.d/netif quietstart $child > + done > +} > + > +pccard_ether_stopchildren() > +{ > + for child in `get_if_var $ifn wlans_IF`; do > + /etc/rc.d/netif quietstop $child > + done > +} > + > ifn=3D$1 > shift > if [ -z "$*" ]; then > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --=-SoH8rS3hwyGJkhKisPoU 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 iQIcBAABCgAGBQJV5wO/AAoJEGqEZY9SRW7uWV8P/A5g4o2fIOcZqZMTpQlp8s7V jdGIjLvW+RwB8QeKi7t5c4L7wwlVQiVTV0n70xRA4EVcUeAQMTVPogU9vQPMLhkP ixmTmDZNPK2XWFN/HNFQbN1rke27l9ddEKMAL3QOUD9J/hZg+htUSn4ceMVeJDj1 Kl7Zehu9EIuoxaUIPCWw3gGsnX9tSRILgpGJBHBERLR36wSs9SkrP12/vb6iI/3Q 667W0WnMnIGW+NlHxsNS4kjJJ33kzgvPWI4pK/k6nofEyGLmAH+9II3Z+gLYHmbr 44yeUeDx1BlIq/UuRM3tyZLiZ/XP3xBnfynPb5rAyCaPrRim3giAPo6/Bfp/PXX0 885WcZRzdkz117dLXgBCjFIOOm9oh26yC7KFrvCgAJcJeimxlP91rg9q6wwRBsuI 680NhSHVMIWaMLVpVuWO5zyqN8hCxfQ8c9B1K3nxzUKbhTWqjmQ2MCAhhOfKcnh6 O5MskntG6fhc2/EGDMFU4iJGbZpaU/3Ft+Fk2OVYR15Hh82TRLxP8IMitEr2BRfe rTR4+PoydlyRt5vbP0tAcBi8oV8ZyQAzYqwfJAgWpAEQekFUW6focIm2rU5W9lo9 ID1WWbY4l9queGf537rLgQm33kil2dq2xQ2JtT09YRUGvdxrBtFHyF3vMOYuoDq1 NJ60SpHkjCqGp8fh1gU/ =tPj/ -----END PGP SIGNATURE----- --=-SoH8rS3hwyGJkhKisPoU-- From owner-svn-src-all@freebsd.org Wed Sep 2 14:15:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D619A9C93AB; Wed, 2 Sep 2015 14:15:17 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (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 7767FFC5; Wed, 2 Sep 2015 14:15:17 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by lamp12 with SMTP id p12so7663720lam.0; Wed, 02 Sep 2015 07:15:15 -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:from:date:message-id :subject:to:cc:content-type; bh=itEEdr7S0w6DycvhcHZOcDCKyOU3h63FJ4Byrj5oUjA=; b=wjLYlo5DWMDJ1XfYHVrqyg+51AIKNP9ChonyBnpjVKhSWQHU0dDuX6ntSoVeNnPF0/ or2+mCcGYIju58Jr7U2ZtmuNZqxsAQPYpobeIR1YbvDz/hppYSXvTF1Rc6OuCI1opTcu KbKI7ZGRWDjHJk4zDIhG6QEKFrbMr7JIcdQ3N3eXtw2b3qJrZ5FMQ/aDjc/fGb/uSP/J I1OqE5s85scl4FK+1vFNH41eaCvs9PgCHmpk1drHZ9hg9cRSeJh6GS3J/rQ6Aj8v7+0a FzoKNT6mbZYHaE+3pfr4iP2jqjF1X2JKTQ7p0/ILgWFE8XLnU/62S47+UYfHL9uuQlw/ mF0g== X-Received: by 10.152.28.105 with SMTP id a9mr16179300lah.9.1441203315370; Wed, 02 Sep 2015 07:15:15 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.25.197.67 with HTTP; Wed, 2 Sep 2015 07:14:56 -0700 (PDT) In-Reply-To: <55E7002D.8080001@gmail.com> References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> <20150902132034.GL1023@FreeBSD.org> <20150902093622.751a85f2@kan> <55E7002D.8080001@gmail.com> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Wed, 2 Sep 2015 16:14:56 +0200 X-Google-Sender-Auth: zxnQlLOfvFkYimlrxR8iGFlV_sg Message-ID: Subject: Re: svn commit: r287358 - head To: Alexander Motin Cc: Gleb Smirnoff , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset=UTF-8 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: Wed, 02 Sep 2015 14:15:18 -0000 On Wed, Sep 2, 2015 at 3:57 PM, Alexander Motin wrote: > > > Sorry if it is documented somewhere, but can this be disabled somehow? > On my development server installkernel for some reason already took more > time then buildkernel -DKERNFAST. Now I suppose it will take twice more. > I am doing it hundred times a day, and I am not happy. :-\ > > =E2=80=8BThis create problem for generating nanobsd image too: It install k= ernel twice, then the resulting /boot is too big for being copied into the small OS partition. Regards, =E2=80=8BOlivier=E2=80=8B From owner-svn-src-all@freebsd.org Wed Sep 2 14:16:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F269C9C9454 for ; Wed, 2 Sep 2015 14:16:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (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 B0509201 for ; Wed, 2 Sep 2015 14:16:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wicfx3 with SMTP id fx3so19308555wic.1 for ; Wed, 02 Sep 2015 07:16:36 -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 :content-transfer-encoding; bh=LhxErpNDkLojN7l55Gpf/IGemN482tSkURSMjnw6KYQ=; b=fQjZWsIlICVG6F9pfouZhgCvkjfFYEgPazj1UyUe9PPlzzHLWJsQQgNAvRAiiMSSBu EEgleSJpvCIOS+mOBFSAHp5xZRnJQr0NEyQnkAb+n5OXLJGYVUpa0L1SAeQO8dbxWSDs 4KHf6gKAyXwwcKoAa/fDUSDqox603WsJZh/5Lm1ViFXNRusZQ9cvoBnQxur6J31Fz8i5 mItPl56FbLwmI7LqcfDMAXLVaee/gocrf2ybzglduJCmw/FIGeeemq7NV6gxgxTgOso8 kUV2VC671JlFYAW+INrtPWp+QhU1m2okgJKT2t+cUCDXqfZLbhBZI/YDqpNkBBUiz0O0 2Z4g== X-Gm-Message-State: ALoCoQkPic1OTj0qIHzzm4E4PdfIedWC/FodITBRWy8T+Jf8KFz0W9YAVAZURiegtHusduvALqZa MIME-Version: 1.0 X-Received: by 10.180.182.112 with SMTP id ed16mr4324850wic.19.1441203395931; Wed, 02 Sep 2015 07:16:35 -0700 (PDT) Received: by 10.194.73.6 with HTTP; Wed, 2 Sep 2015 07:16:35 -0700 (PDT) In-Reply-To: References: <201509011159.t81BxCkm072208@repo.freebsd.org> <20150901224438.32e982dd@kan> <20150902125024.GH1023@FreeBSD.org> <20150902090825.619467d9@kan> <20150902132034.GL1023@FreeBSD.org> <20150902093622.751a85f2@kan> <55E7002D.8080001@gmail.com> Date: Wed, 2 Sep 2015 16:16:35 +0200 Message-ID: Subject: Re: svn commit: r287358 - head From: Oliver Pinter To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Alexander Motin , svn-src-head , svn-src-all , Gleb Smirnoff , src-committers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 02 Sep 2015 14:16:38 -0000 On 9/2/15, Olivier Cochard-Labb=C3=A9 wrote: > On Wed, Sep 2, 2015 at 3:57 PM, Alexander Motin wrote: > >> >> >> Sorry if it is documented somewhere, but can this be disabled somehow? >> On my development server installkernel for some reason already took more >> time then buildkernel -DKERNFAST. Now I suppose it will take twice more. >> I am doing it hundred times a day, and I am not happy. :-\ >> >> > =E2=80=8BThis create problem for generating nanobsd image too: It install= kernel > twice, then the resulting /boot is too big for being copied into the smal= l > OS partition. We have problems with this change too, because our kernel added twice to installer mediums. > > Regards, > > =E2=80=8BOlivier=E2=80=8B > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://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 Wed Sep 2 14:37:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9369C9D06; Wed, 2 Sep 2015 14:37:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 B773DE08; Wed, 2 Sep 2015 14:37:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t82Eb2Ss009497 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Sep 2015 17:37:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t82Eb2Im009496; Wed, 2 Sep 2015 17:37: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, 2 Sep 2015 17:37:02 +0300 From: Gleb Smirnoff To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287396 - in head: sbin/bsdlabel sbin/dumpfs sbin/fdisk sbin/ffsinfo sbin/mdconfig sbin/newfs sbin/newfs_msdos sbin/newfs_nandfs sbin/reboot share/man/man4 share/man/man7 share/man/man8... Message-ID: <20150902143702.GM1023@FreeBSD.org> References: <201509021408.t82E8h0Q038324@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201509021408.t82E8h0Q038324@repo.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, 02 Sep 2015 14:37:07 -0000 On Wed, Sep 02, 2015 at 02:08:43PM +0000, Edward Tomasz Napierala wrote: E> Author: trasz E> Date: Wed Sep 2 14:08:43 2015 E> New Revision: 287396 E> URL: https://svnweb.freebsd.org/changeset/base/287396 E> E> Log: E> It's 2015, and some people are still trying to use fdisk and then E> go asking what debug flags to set for GEOM to make it work. Advice E> them to use gpart(8) instead. E> E> Something similar should probably done with disklabel, E> but I need to rewrite the disklabel examples first. Thanks! Do we still have functionality of fdisk/bsdlabel that isn't covered by gpart? Can we simply remove the tools? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Sep 2 14:38:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D429C9DF3; Wed, 2 Sep 2015 14:38:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 43DC6A4; Wed, 2 Sep 2015 14:38:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82EcHZq053001; Wed, 2 Sep 2015 14:38:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82EcHFL053000; Wed, 2 Sep 2015 14:38:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509021438.t82EcHFL053000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 2 Sep 2015 14:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287398 - 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, 02 Sep 2015 14:38:17 -0000 Author: glebius Date: Wed Sep 2 14:38:16 2015 New Revision: 287398 URL: https://svnweb.freebsd.org/changeset/base/287398 Log: Add iwm(4), that was missing in r287394. Submitted by: Shawn Webb Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Wed Sep 2 14:10:09 2015 (r287397) +++ head/etc/devd.conf Wed Sep 2 14:38:16 2015 (r287398) @@ -23,8 +23,8 @@ options { esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\ [0-9]+"; set wifi-driver-regex - "(ath|bwi|bwn|ipw|iwi|iwn|malo|mwl|ral|rsu|rum|run|uath|upgt|\ - ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; + "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\ + upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can From owner-svn-src-all@freebsd.org Wed Sep 2 15:15:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D1479C92AC for ; Wed, 2 Sep 2015 15:15:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-f53.google.com (mail-qg0-f53.google.com [209.85.192.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 D505986E for ; Wed, 2 Sep 2015 15:15:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgx61 with SMTP id 61so7477647qgx.3 for ; Wed, 02 Sep 2015 08:15:33 -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:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZWycm+vII2hVUKIoYfY3sLheVMuFczcq50PhH+HnJgo=; b=YfvmmxCV8ws/pQn+6YLodNG1l8GKAuRZaFsIgJdgfZMOHFbcl4I21ywruaHZzMKFGs neiwWN70Miwklu5KMuDYXe7Uh/cLAnuYI6LLMqvtsXyhH/ONk3TTOAhTObfOEDLhVNvz 0fd0hgt13BCQzIknADikfeUPj1a4umrat/fzaOdrfAALRKpr2nbcPiq9bse2BhSQqHg5 Bag6iJvILh/XZicfyPFD/PqoPLzRZDyecWTXf3DIydH19OU41HEMo455Lv037AGXbdRT hMtNwubHjHw0lQof2tD1wkzYWYyXESyojKOZODYXoxBD3nKcq9kSH6SVbcJBcZ0+NjiX 4Qkg== X-Gm-Message-State: ALoCoQmV6q6cal6i4FKcUZg3mjP/twQqxRNjvMbeBisR4nMQ3dAa1iDnz/M4xJx4uLdgI+EyVwYn MIME-Version: 1.0 X-Received: by 10.140.196.10 with SMTP id r10mr58154672qha.29.1441206933655; Wed, 02 Sep 2015 08:15:33 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.80.164 with HTTP; Wed, 2 Sep 2015 08:15:33 -0700 (PDT) X-Originating-IP: [69.53.245.39] In-Reply-To: <201509021246.t82Ckhkn099532@repo.freebsd.org> References: <201509021246.t82Ckhkn099532@repo.freebsd.org> Date: Wed, 2 Sep 2015 09:15:33 -0600 X-Google-Sender-Auth: w4TpTT5OqgfFoDHJm3SATA-_MAs Message-ID: Subject: Re: svn commit: r287394 - head/etc From: Warner Losh To: Gleb Smirnoff Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Wed, 02 Sep 2015 15:15:40 -0000 On Wed, Sep 2, 2015 at 6:46 AM, Gleb Smirnoff wrote: > + set wifi-driver-regex > + > "(ath|bwi|bwn|ipw|iwi|iwn|malo|mwl|ral|rsu|rum|run|uath|upgt|\ > + ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+"; > This moves us in the wrong direction. We've been looking at ways of getting rid of the NIC regex since it went in. Now there's another one to fight with :( Warner From owner-svn-src-all@freebsd.org Wed Sep 2 15:23:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036ED9C96E9; Wed, 2 Sep 2015 15:23:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E832FF02; Wed, 2 Sep 2015 15:23:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82FNq3a076527; Wed, 2 Sep 2015 15:23:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82FNqjn076524; Wed, 2 Sep 2015 15:23:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509021523.t82FNqjn076524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 2 Sep 2015 15:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287399 - head/sys/dev/iwn 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, 02 Sep 2015 15:23:53 -0000 Author: glebius Date: Wed Sep 2 15:23:51 2015 New Revision: 287399 URL: https://svnweb.freebsd.org/changeset/base/287399 Log: Remove the software queue, which is a remnant of ifnet ifqueue. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Sep 2 14:38:16 2015 (r287398) +++ head/sys/dev/iwn/if_iwn.c Wed Sep 2 15:23:51 2015 (r287399) @@ -231,7 +231,6 @@ static void iwn_xmit_task(void *arg0, in static int iwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static int iwn_transmit(struct ieee80211com *, struct mbuf *); -static void iwn_start_locked(struct iwn_softc *); static void iwn_watchdog(void *); static int iwn_ioctl(struct ieee80211com *, u_long , void *); static void iwn_parent(struct ieee80211com *); @@ -471,7 +470,6 @@ iwn_attach(device_t dev) } IWN_LOCK_INIT(sc); - mbufq_init(&sc->sc_snd, ifqmaxlen); /* Read hardware revision and attach. */ sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT) @@ -1409,8 +1407,6 @@ iwn_detach(device_t dev) ieee80211_ifdetach(&sc->sc_ic); } - mbufq_drain(&sc->sc_snd); - /* Uninstall interrupt handler. */ if (sc->irq != NULL) { bus_teardown_intr(dev, sc->irq, sc->sc_ih); @@ -3597,14 +3593,10 @@ iwn_tx_done(struct iwn_softc *sc, struct (status & IWN_TX_FAIL) != 0); sc->sc_tx_timer = 0; - if (--ring->queued < IWN_TX_RING_LOMARK) { + if (--ring->queued < IWN_TX_RING_LOMARK) sc->qfullmsk &= ~(1 << ring->qid); - if (sc->qfullmsk == 0) - iwn_start_locked(sc); - } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); - } /* @@ -3781,14 +3773,10 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, } sc->sc_tx_timer = 0; - if (ring->queued < IWN_TX_RING_LOMARK) { + if (ring->queued < IWN_TX_RING_LOMARK) sc->qfullmsk &= ~(1 << ring->qid); - if (sc->qfullmsk == 0) - iwn_start_locked(sc); - } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); - } /* @@ -4948,54 +4936,30 @@ iwn_raw_xmit(struct ieee80211_node *ni, static int iwn_transmit(struct ieee80211com *ic, struct mbuf *m) { - struct iwn_softc *sc; + struct iwn_softc *sc = ic->ic_softc; + struct ieee80211_node *ni; int error; - sc = ic->ic_softc; - IWN_LOCK(sc); - if ((sc->sc_flags & IWN_FLAG_RUNNING) == 0) { + if ((sc->sc_flags & IWN_FLAG_RUNNING) == 0 || sc->sc_beacon_wait) { IWN_UNLOCK(sc); return (ENXIO); } - error = mbufq_enqueue(&sc->sc_snd, m); - if (error) { - IWN_UNLOCK(sc); - return (error); - } - iwn_start_locked(sc); - IWN_UNLOCK(sc); - return (0); -} - -static void -iwn_start_locked(struct iwn_softc *sc) -{ - struct ieee80211_node *ni; - struct mbuf *m; - IWN_LOCK_ASSERT(sc); - - /* - * If we're waiting for a beacon, we can just exit out here - * and wait for the taskqueue to be kicked. - */ - if (sc->sc_beacon_wait) { - return; + if (sc->qfullmsk) { + IWN_UNLOCK(sc); + return (ENOBUFS); } - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: called\n", __func__); - while (sc->qfullmsk == 0 && - (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { - ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; - if (iwn_tx_data(sc, m, ni) != 0) { - if_inc_counter(ni->ni_vap->iv_ifp, - IFCOUNTER_OERRORS, 1); - ieee80211_free_node(ni); - } else - sc->sc_tx_timer = 5; - } - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: done\n", __func__); + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + error = iwn_tx_data(sc, m, ni); + if (error) { + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); + } else + sc->sc_tx_timer = 5; + IWN_UNLOCK(sc); + return (error); } static void @@ -8731,9 +8695,6 @@ iwn_panicked(void *arg0, int pending) "%s: could not move to run state\n", __func__); } - /* Only run start once the NIC is in a useful state, like associated */ - iwn_start_locked(sc); - IWN_UNLOCK(sc); } Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Wed Sep 2 14:38:16 2015 (r287398) +++ head/sys/dev/iwn/if_iwnvar.h Wed Sep 2 15:23:51 2015 (r287399) @@ -238,7 +238,6 @@ struct iwn_softc { struct cdev *sc_cdev; struct mtx sc_mtx; struct ieee80211com sc_ic; - struct mbufq sc_snd; u_int sc_flags; #define IWN_FLAG_HAS_OTPROM (1 << 1) From owner-svn-src-all@freebsd.org Wed Sep 2 15:42:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C35FF9C9FA2; Wed, 2 Sep 2015 15:42:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9A0F11F57; Wed, 2 Sep 2015 15:42:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82FgF98085987; Wed, 2 Sep 2015 15:42:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82FgFVV085986; Wed, 2 Sep 2015 15:42:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509021542.t82FgFVV085986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 2 Sep 2015 15:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287400 - 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: Wed, 02 Sep 2015 15:42:15 -0000 Author: glebius Date: Wed Sep 2 15:42:14 2015 New Revision: 287400 URL: https://svnweb.freebsd.org/changeset/base/287400 Log: The ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for a one word variable, which is quite unexpected from documentation. So, to avoid double installation of a single kernel, protect the extra kernels loop with ${BUILDKERNELS:[#]} > 1 conditional. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 2 15:23:51 2015 (r287399) +++ head/Makefile.inc1 Wed Sep 2 15:42:14 2015 (r287400) @@ -1127,6 +1127,7 @@ reinstallkernel reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} +.if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @@ -1135,6 +1136,7 @@ reinstallkernel reinstallkernel.debug: _ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} .endfor +.endif distributekernel distributekernel.debug: .if empty(INSTALLKERNEL) @@ -1154,6 +1156,7 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif +.if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta @@ -1170,27 +1173,32 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta .endif .endfor +.endif packagekernel: .if defined(NO_ROOT) cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz +.if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor +.endif .else cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz +.if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor .endif +.endif # # doxygen From owner-svn-src-all@freebsd.org Wed Sep 2 16:30:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D62B9C95E4; Wed, 2 Sep 2015 16:30:46 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.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 45786F15; Wed, 2 Sep 2015 16:30:46 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82GUkl6006279; Wed, 2 Sep 2015 16:30:46 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82GUkDW006278; Wed, 2 Sep 2015 16:30:46 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509021630.t82GUkDW006278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 2 Sep 2015 16:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287402 - 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, 02 Sep 2015 16:30:46 -0000 Author: hrs Date: Wed Sep 2 16:30:45 2015 New Revision: 287402 URL: https://svnweb.freebsd.org/changeset/base/287402 Log: Fix a panic which was reproducible by an infinite loop of "ifconfig epair0 create && ifconfig epair0a destroy". This was caused by an uninitialized function pointer in softc->media. Modified: head/sys/net/if_epair.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Wed Sep 2 16:06:25 2015 (r287401) +++ head/sys/net/if_epair.c Wed Sep 2 16:30:45 2015 (r287402) @@ -809,6 +809,14 @@ epair_clone_create(struct if_clone *ifc, netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount()); scb->cpuid = netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount()); + + /* Initialise pseudo media types. */ + ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); + ifmedia_add(&sca->media, IFM_ETHER | IFM_10G_T, 0, NULL); + ifmedia_set(&sca->media, IFM_ETHER | IFM_10G_T); + ifmedia_init(&scb->media, 0, epair_media_change, epair_media_status); + ifmedia_add(&scb->media, IFM_ETHER | IFM_10G_T, 0, NULL); + ifmedia_set(&scb->media, IFM_ETHER | IFM_10G_T); /* Finish initialization of interface a. */ ifp = sca->ifp; @@ -867,14 +875,6 @@ epair_clone_create(struct if_clone *ifc, strlcpy(name, sca->ifp->if_xname, len); DPRINTF("name='%s/%db' created sca=%p scb=%p\n", name, unit, sca, scb); - /* Initialise pseudo media types. */ - ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); - ifmedia_add(&sca->media, IFM_ETHER | IFM_10G_T, 0, NULL); - ifmedia_set(&sca->media, IFM_ETHER | IFM_10G_T); - ifmedia_init(&scb->media, 0, epair_media_change, epair_media_status); - ifmedia_add(&scb->media, IFM_ETHER | IFM_10G_T, 0, NULL); - ifmedia_set(&scb->media, IFM_ETHER | IFM_10G_T); - /* Tell the world, that we are ready to rock. */ sca->ifp->if_drv_flags |= IFF_DRV_RUNNING; scb->ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-all@freebsd.org Wed Sep 2 16:48:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC3649C9E72; Wed, 2 Sep 2015 16:48:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.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 BD4A11D54; Wed, 2 Sep 2015 16:48:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82Gm4H1015185; Wed, 2 Sep 2015 16:48:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82Gm451015184; Wed, 2 Sep 2015 16:48:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201509021648.t82Gm451015184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 2 Sep 2015 16:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287403 - head/sys/dev/ioat 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, 02 Sep 2015 16:48:05 -0000 Author: cem Date: Wed Sep 2 16:48:03 2015 New Revision: 287403 URL: https://svnweb.freebsd.org/changeset/base/287403 Log: ioat: re-initialize interrupts after resetting hw on BDXDE Resetting some generations of the I/OAT hardware (just BDXDE for now) resets the corresponding MSI-X registers. So, teardown and re-initialize interrupts after resetting the hardware. Reviewed by: jimharris Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3549 Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Wed Sep 2 16:30:45 2015 (r287402) +++ head/sys/dev/ioat/ioat.c Wed Sep 2 16:48:03 2015 (r287403) @@ -53,12 +53,14 @@ __FBSDID("$FreeBSD$"); static int ioat_probe(device_t device); static int ioat_attach(device_t device); static int ioat_detach(device_t device); +static int ioat_setup_intr(struct ioat_softc *ioat); +static int ioat_teardown_intr(struct ioat_softc *ioat); static int ioat3_attach(device_t device); static int ioat_map_pci_bar(struct ioat_softc *ioat); static void ioat_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); -static int ioat_interrupt_setup(struct ioat_softc *ioat); static void ioat_interrupt_handler(void *arg); +static boolean_t ioat_is_bdxde(struct ioat_softc *ioat); static void ioat_process_events(struct ioat_softc *ioat); static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); @@ -220,13 +222,15 @@ ioat_attach(device_t device) goto err; ioat->version = ioat_read_cbver(ioat); - ioat_interrupt_setup(ioat); - if (ioat->version < IOAT_VER_3_0) { error = ENODEV; goto err; } + error = ioat_setup_intr(ioat); + if (error != 0) + return (error); + error = ioat3_attach(device); if (error != 0) goto err; @@ -273,15 +277,23 @@ ioat_detach(device_t device) bus_dma_tag_destroy(ioat->hw_desc_tag); + ioat_teardown_intr(ioat); + + return (0); +} + +static int +ioat_teardown_intr(struct ioat_softc *ioat) +{ + if (ioat->tag != NULL) - bus_teardown_intr(device, ioat->res, ioat->tag); + bus_teardown_intr(ioat->device, ioat->res, ioat->tag); if (ioat->res != NULL) - bus_release_resource(device, SYS_RES_IRQ, + bus_release_resource(ioat->device, SYS_RES_IRQ, rman_get_rid(ioat->res), ioat->res); - pci_release_msi(device); - + pci_release_msi(ioat->device); return (0); } @@ -455,7 +467,7 @@ ioat_dmamap_cb(void *arg, bus_dma_segmen * Interrupt setup and handlers */ static int -ioat_interrupt_setup(struct ioat_softc *ioat) +ioat_setup_intr(struct ioat_softc *ioat) { uint32_t num_vectors; int error; @@ -498,6 +510,23 @@ ioat_interrupt_setup(struct ioat_softc * return (0); } +static boolean_t +ioat_is_bdxde(struct ioat_softc *ioat) +{ + u_int32_t pciid; + + pciid = pci_get_devid(ioat->device); + switch (pciid) { + case 0x6f508086: + case 0x6f518086: + case 0x6f528086: + case 0x6f538086: + return (TRUE); + } + + return (FALSE); +} + static void ioat_interrupt_handler(void *arg) { @@ -918,7 +947,7 @@ ioat_reset_hw(struct ioat_softc *ioat) { uint64_t status; uint32_t chanerr; - int timeout; + int timeout, error; status = ioat_get_chansts(ioat); if (is_ioat_active(status) || is_ioat_idle(status)) @@ -953,6 +982,20 @@ ioat_reset_hw(struct ioat_softc *ioat) if (timeout == 20) return (ETIMEDOUT); + /* + * BDXDE models reset MSI-X registers on device reset. We must + * teardown and re-setup interrupts. + */ + if (ioat_is_bdxde(ioat)) { + error = ioat_teardown_intr(ioat); + if (error) + return (error); + + error = ioat_setup_intr(ioat); + if (error) + return (error); + } + return (0); } From owner-svn-src-all@freebsd.org Wed Sep 2 16:50:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A839C9FA7; Wed, 2 Sep 2015 16:50:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.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 381AFA1; Wed, 2 Sep 2015 16:50:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82Goock015512; Wed, 2 Sep 2015 16:50:50 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82GooQb015511; Wed, 2 Sep 2015 16:50:50 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509021650.t82GooQb015511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 2 Sep 2015 16:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287404 - head/lib/libc/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, 02 Sep 2015 16:50:50 -0000 Author: hrs Date: Wed Sep 2 16:50:49 2015 New Revision: 287404 URL: https://svnweb.freebsd.org/changeset/base/287404 Log: - snprintf() returns at most size-1 of the chars printed into the buffer. (n == hostlen) also means the buffer length was too short. - Use sdl->sdl_data only when (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0) to prevent redundant output. Modified: head/lib/libc/net/getnameinfo.c Modified: head/lib/libc/net/getnameinfo.c ============================================================================== --- head/lib/libc/net/getnameinfo.c Wed Sep 2 16:48:03 2015 (r287403) +++ head/lib/libc/net/getnameinfo.c Wed Sep 2 16:50:49 2015 (r287404) @@ -394,26 +394,22 @@ getnameinfo_link(const struct sockaddr * if (sdl->sdl_nlen == 0 && sdl->sdl_alen == 0 && sdl->sdl_slen == 0) { n = snprintf(host, hostlen, "link#%d", sdl->sdl_index); - if (n > hostlen) { + if (n >= hostlen) { *host = '\0'; return (EAI_MEMORY); } return (0); } - if (sdl->sdl_nlen > 0) { - if (sdl->sdl_nlen + 1 > hostlen) { + if (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0) { + n = sdl->sdl_nlen; + if (n >= hostlen) { *host = '\0'; return (EAI_MEMORY); } memcpy(host, sdl->sdl_data, sdl->sdl_nlen); - n = sdl->sdl_nlen; - host += n; - if (sdl->sdl_alen > 0) { - *host++ = ':'; - n++; - } - hostlen -= n; + host[n] = '\0'; + return (0); } switch (sdl->sdl_type) { From owner-svn-src-all@freebsd.org Wed Sep 2 17:29:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C3B29C8B18; Wed, 2 Sep 2015 17:29:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0094CA7E; Wed, 2 Sep 2015 17:29:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82HTU0V036120; Wed, 2 Sep 2015 17:29:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82HTULW036119; Wed, 2 Sep 2015 17:29:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201509021729.t82HTULW036119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 2 Sep 2015 17:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287405 - head/sys/geom 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, 02 Sep 2015 17:29:31 -0000 Author: imp Date: Wed Sep 2 17:29:30 2015 New Revision: 287405 URL: https://svnweb.freebsd.org/changeset/base/287405 Log: After the introduction of direct dispatch, the pacing code in g_down() broke in two ways. One, the pacing variable was accessed in multiple threads in an unsafe way. Two, since large numbers of I/O could come down from the buf layer at one time, large numbers of allocation failures could happen all at once, resulting in a huge pace value that would limit I/Os to 10 IOPS for minutes (or even hours) at a time. While a real solution to these problems requires substantial work (to go to a no-allocation after the first model, or to have some way to wait for more memory with some kind of reserve for pager and swapper requests), it is relatively easy to make this simplistic pacing less pathological. Move to using a volatile variable with loads and stores. While this is a little racy, losing the race is safe: either you get memory and proceed, or you don't and queue. Second, sleep for 1ms (or one tick, whichever is larger) instead of 100ms. This removes the artificial 10 IOPS limit while still easing up on new I/Os during memory shortages. Remove tying the amount of time we do this to the number of failed requests and do it only as long as we keep failing requests. Finally, to avoid needless recursion when memory is tight (start -> g_io_deliver() -> g_io_request() -> start -> ... until we use 1/2 the stack), don't do direct dispatch while pacing. This should be a rare event (not steady state) so the performance hit here is worth the extra safety of not starving g_down() with directly dispatched I/O. Differential Review: https://reviews.freebsd.org/D3546 Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Sep 2 16:50:49 2015 (r287404) +++ head/sys/geom/geom_io.c Wed Sep 2 17:29:30 2015 (r287405) @@ -71,7 +71,17 @@ static struct g_bioq g_bio_run_down; static struct g_bioq g_bio_run_up; static struct g_bioq g_bio_run_task; -static u_int pace; +/* + * Pace is a hint that we've had some trouble recently allocating + * bios, so we should back off trying to send I/O down the stack + * a bit to let the problem resolve. When pacing, we also turn + * off direct dispatch to also reduce memory pressure from I/Os + * there, at the expxense of some added latency while the memory + * pressures exist. See g_io_schedule_down() for more details + * and limitations. + */ +static volatile u_int pace; + static uma_zone_t biozone; /* @@ -521,7 +531,8 @@ g_io_request(struct bio *bp, struct g_co (pp->flags & G_PF_DIRECT_RECEIVE) != 0 && !g_is_geom_thread(curthread) && ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 || - (bp->bio_flags & BIO_UNMAPPED) == 0 || THREAD_CAN_SLEEP()); + (bp->bio_flags & BIO_UNMAPPED) == 0 || THREAD_CAN_SLEEP()) && + pace == 0; if (direct) { /* Block direct execution if less then half of stack left. */ size_t st, su; @@ -688,7 +699,7 @@ g_io_deliver(struct bio *bp, int error) bp->bio_driver2 = NULL; bp->bio_pflags = 0; g_io_request(bp, cp); - pace++; + pace = 1; return; } @@ -777,10 +788,33 @@ g_io_schedule_down(struct thread *tp __u } CTR0(KTR_GEOM, "g_down has work to do"); g_bioq_unlock(&g_bio_run_down); - if (pace > 0) { - CTR1(KTR_GEOM, "g_down pacing self (pace %d)", pace); - pause("g_down", hz/10); - pace--; + if (pace != 0) { + /* + * There has been at least one memory allocation + * failure since the last I/O completed. Pause 1ms to + * give the system a chance to free up memory. We only + * do this once because a large number of allocations + * can fail in the direct dispatch case and there's no + * relationship between the number of these failures and + * the length of the outage. If there's still an outage, + * we'll pause again and again until it's + * resolved. Older versions paused longer and once per + * allocation failure. This was OK for a single threaded + * g_down, but with direct dispatch would lead to max of + * 10 IOPs for minutes at a time when transient memory + * issues prevented allocation for a batch of requests + * from the upper layers. + * + * XXX This pacing is really lame. It needs to be solved + * by other methods. This is OK only because the worst + * case scenario is so rare. In the worst case scenario + * all memory is tied up waiting for I/O to complete + * which can never happen since we can't allocate bios + * for that I/O. + */ + CTR0(KTR_GEOM, "g_down pacing self"); + pause("g_down", min(hz/1000, 1)); + pace = 0; } CTR2(KTR_GEOM, "g_down processing bp %p provider %s", bp, bp->bio_to->name); From owner-svn-src-all@freebsd.org Wed Sep 2 18:35:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C960C9C89CE; Wed, 2 Sep 2015 18:35:36 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 A7E6C68A; Wed, 2 Sep 2015 18:35:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A9D47B9A9; Wed, 2 Sep 2015 14:35:35 -0400 (EDT) From: John Baldwin To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287403 - head/sys/dev/ioat Date: Wed, 02 Sep 2015 10:26:43 -0700 Message-ID: <3589074.YABE6tqvK0@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201509021648.t82Gm451015184@repo.freebsd.org> References: <201509021648.t82Gm451015184@repo.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); Wed, 02 Sep 2015 14:35:35 -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: Wed, 02 Sep 2015 18:35:36 -0000 On Wednesday, September 02, 2015 04:48:04 PM Conrad E. Meyer wrote: > Author: cem > Date: Wed Sep 2 16:48:03 2015 > New Revision: 287403 > URL: https://svnweb.freebsd.org/changeset/base/287403 > > Log: > ioat: re-initialize interrupts after resetting hw on BDXDE > > Resetting some generations of the I/OAT hardware (just BDXDE for now) > resets the corresponding MSI-X registers. So, teardown and > re-initialize interrupts after resetting the hardware. > > Reviewed by: jimharris > Approved by: markj (mentor) > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D3549 Alternatively you could use pci_restore_state() (before reset) and pci_save_state() (after reset) to restore standard PCI config registers (including MSI/MSI-X) after a reset. This might be more scalable if you want to ensure other PCI config registers (e.g. PCI-e capabilities) are restored after a reset. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Sep 2 18:42:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A9909C8E96; Wed, 2 Sep 2015 18:42:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1AE0AD61; Wed, 2 Sep 2015 18:42:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82IgZdn069909; Wed, 2 Sep 2015 18:42:35 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82IgZxt069908; Wed, 2 Sep 2015 18:42:35 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509021842.t82IgZxt069908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 2 Sep 2015 18:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287406 - head/usr.bin/netstat 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, 02 Sep 2015 18:42:36 -0000 Author: hrs Date: Wed Sep 2 18:42:35 2015 New Revision: 287406 URL: https://svnweb.freebsd.org/changeset/base/287406 Log: Divide statistics in the number of packets with 1000 instead of 1024 in human-readable form. PR: 183598 Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Wed Sep 2 17:29:30 2015 (r287405) +++ head/usr.bin/netstat/if.c Wed Sep 2 18:42:35 2015 (r287406) @@ -201,7 +201,7 @@ pfsync_stats(u_long off, const char *nam */ static void show_stat(const char *fmt, int width, const char *name, - u_long value, short showvalue) + u_long value, short showvalue, int div1000) { const char *lsep, *rsep; char newfmt[64]; @@ -238,7 +238,8 @@ show_stat(const char *fmt, int width, co /* Format in human readable form. */ humanize_number(buf, sizeof(buf), (int64_t)value, "", - HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); + HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL | \ + ((div1000) ? HN_DIVISOR_1000 : 0)); maybe_pad(lsep); snprintf(newfmt, sizeof(newfmt), "{:%s/%%%ds}", name, width); xo_emit(newfmt, buf); @@ -353,7 +354,7 @@ intpr(void (*pfunc)(char *), int af) name, ifa->ifa_flags, xname); #define IFA_MTU(ifa) (((struct if_data *)(ifa)->ifa_data)->ifi_mtu) - show_stat("lu", 6, "mtu", IFA_MTU(ifa), IFA_MTU(ifa)); + show_stat("lu", 6, "mtu", IFA_MTU(ifa), IFA_MTU(ifa), 0); #undef IFA_MTU switch (ifa->ifa_addr->sa_family) { @@ -416,22 +417,25 @@ intpr(void (*pfunc)(char *), int af) #define IFA_STAT(s) (((struct if_data *)ifa->ifa_data)->ifi_ ## s) show_stat("lu", 8, "received-packets", IFA_STAT(ipackets), - link|network); - show_stat("lu", 5, "received-errors", IFA_STAT(ierrors), link); - show_stat("lu", 5, "dropped-packets", IFA_STAT(iqdrops), link); + link|network, 1); + show_stat("lu", 5, "received-errors", IFA_STAT(ierrors), + link, 1); + show_stat("lu", 5, "dropped-packets", IFA_STAT(iqdrops), + link, 1); if (bflag) show_stat("lu", 10, "received-bytes", IFA_STAT(ibytes), - link|network); + link|network, 0); show_stat("lu", 8, "sent-packets", IFA_STAT(opackets), - link|network); - show_stat("lu", 5, "send-errors", IFA_STAT(oerrors), link); + link|network, 1); + show_stat("lu", 5, "send-errors", IFA_STAT(oerrors), link, 1); if (bflag) show_stat("lu", 10, "sent-bytes", IFA_STAT(obytes), - link|network); - show_stat("NRSlu", 5, "collisions", IFA_STAT(collisions), link); + link|network, 0); + show_stat("NRSlu", 5, "collisions", IFA_STAT(collisions), + link, 1); if (dflag) show_stat("LSlu", 5, "dropped-packets", - IFA_STAT(oqdrops), link); + IFA_STAT(oqdrops), link, 1); xo_emit("\n"); if (!aflag) { @@ -616,24 +620,24 @@ loop: xo_open_instance("stats"); show_stat("lu", 10, "received-packets", - new->ift_ip - old->ift_ip, 1); + new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", - new->ift_ie - old->ift_ie, 1); + new->ift_ie - old->ift_ie, 1, 1); show_stat("lu", 5, "dropped-packets", - new->ift_id - old->ift_id, 1); + new->ift_id - old->ift_id, 1, 1); show_stat("lu", 10, "received-bytes", - new->ift_ib - old->ift_ib, 1); + new->ift_ib - old->ift_ib, 1, 0); show_stat("lu", 10, "sent-packets", - new->ift_op - old->ift_op, 1); + new->ift_op - old->ift_op, 1, 1); show_stat("lu", 5, "send-errors", - new->ift_oe - old->ift_oe, 1); + new->ift_oe - old->ift_oe, 1, 1); show_stat("lu", 10, "sent-bytes", - new->ift_ob - old->ift_ob, 1); + new->ift_ob - old->ift_ob, 1, 0); show_stat("NRSlu", 5, "collisions", - new->ift_co - old->ift_co, 1); + new->ift_co - old->ift_co, 1, 1); if (dflag) show_stat("LSlu", 5, "dropped-packets", - new->ift_od - old->ift_od, 1); + new->ift_od - old->ift_od, 1, 1); xo_close_instance("stats"); xo_emit("\n"); xo_flush(); From owner-svn-src-all@freebsd.org Wed Sep 2 18:51:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA759C9241; Wed, 2 Sep 2015 18:51:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.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 7C27720C; Wed, 2 Sep 2015 18:51:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82IpdCV070947; Wed, 2 Sep 2015 18:51:39 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82IpbJd070937; Wed, 2 Sep 2015 18:51:37 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509021851.t82IpbJd070937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 2 Sep 2015 18:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287407 - head/usr.bin/netstat 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, 02 Sep 2015 18:51:39 -0000 Author: hrs Date: Wed Sep 2 18:51:36 2015 New Revision: 287407 URL: https://svnweb.freebsd.org/changeset/base/287407 Log: Simplify kvm symbol resolution and error handling. The symbol table nl_symbols will eventually be organized into several modules depending on MK_* variables. Added: head/usr.bin/netstat/nlist_symbols (contents, props changed) Modified: head/usr.bin/netstat/Makefile head/usr.bin/netstat/main.c head/usr.bin/netstat/mroute.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/netisr.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/Makefile Wed Sep 2 18:51:36 2015 (r287407) @@ -4,9 +4,32 @@ .include PROG= netstat -SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c route.c \ +SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c nl_symbols.c route.c \ unix.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c \ flowtable.c +DPSRCS= nl_defs.h + +nl_symbols.c: nlist_symbols + awk '\ + BEGIN { \ + print "#include "; \ + print "#include "; \ + print "struct nlist nl[] = {"; \ + } \ + !/^\#/ { printf("\t{ .n_name = \"%s\" },\n", $$2); } \ + END { print "\t{ .n_name = NULL },\n};" } \ + ' < ${.ALLSRC} > ${.TARGET} || rm -f ${.TARGET} +nl_defs.h: nlist_symbols + awk '\ + BEGIN { \ + print "#include "; \ + print "extern struct nlist nl[];"; \ + i = 0; \ + } \ + !/^\#/ { printf("\#define\tN%s\t%s\n", toupper($$2), i++); }' \ + < ${.ALLSRC} > ${.TARGET} || rm -f ${.TARGET} +CLEANFILES+= nl_symbols.c nl_defs.h +CFLAGS+= -I${.OBJDIR} WARNS?= 3 CFLAGS+=-fno-strict-aliasing Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/main.c Wed Sep 2 18:51:36 2015 (r287407) @@ -28,7 +28,7 @@ */ #ifndef lint -char const copyright[] = +static char const copyright[] = "@(#) Copyright (c) 1983, 1988, 1993\n\ Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ @@ -69,95 +69,10 @@ __FBSDID("$FreeBSD$"); #include #include #include "netstat.h" +#include "nl_defs.h" #include -static struct nlist nl[] = { -#define N_RTSTAT 0 - { .n_name = "_rtstat" }, -#define N_RTREE 1 - { .n_name = "_rt_tables"}, -#define N_MRTSTAT 2 - { .n_name = "_mrtstat" }, -#define N_MFCHASHTBL 3 - { .n_name = "_mfchashtbl" }, -#define N_VIFTABLE 4 - { .n_name = "_viftable" }, -#define N_NGSOCKS 5 - { .n_name = "_ngsocklist"}, -#define N_IP6STAT 6 - { .n_name = "_ip6stat" }, -#define N_ICMP6STAT 7 - { .n_name = "_icmp6stat" }, -#define N_IPSECSTAT 8 - { .n_name = "_ipsec4stat" }, -#define N_IPSEC6STAT 9 - { .n_name = "_ipsec6stat" }, -#define N_PIM6STAT 10 - { .n_name = "_pim6stat" }, -#define N_MRT6STAT 11 - { .n_name = "_mrt6stat" }, -#define N_MF6CTABLE 12 - { .n_name = "_mf6ctable" }, -#define N_MIF6TABLE 13 - { .n_name = "_mif6table" }, -#define N_PFKEYSTAT 14 - { .n_name = "_pfkeystat" }, -#define N_RTTRASH 15 - { .n_name = "_rttrash" }, -#define N_CARPSTAT 16 - { .n_name = "_carpstats" }, -#define N_PFSYNCSTAT 17 - { .n_name = "_pfsyncstats" }, -#define N_AHSTAT 18 - { .n_name = "_ahstat" }, -#define N_ESPSTAT 19 - { .n_name = "_espstat" }, -#define N_IPCOMPSTAT 20 - { .n_name = "_ipcompstat" }, -#define N_TCPSTAT 21 - { .n_name = "_tcpstat" }, -#define N_UDPSTAT 22 - { .n_name = "_udpstat" }, -#define N_IPSTAT 23 - { .n_name = "_ipstat" }, -#define N_ICMPSTAT 24 - { .n_name = "_icmpstat" }, -#define N_IGMPSTAT 25 - { .n_name = "_igmpstat" }, -#define N_PIMSTAT 26 - { .n_name = "_pimstat" }, -#define N_TCBINFO 27 - { .n_name = "_tcbinfo" }, -#define N_UDBINFO 28 - { .n_name = "_udbinfo" }, -#define N_DIVCBINFO 29 - { .n_name = "_divcbinfo" }, -#define N_RIPCBINFO 30 - { .n_name = "_ripcbinfo" }, -#define N_UNP_COUNT 31 - { .n_name = "_unp_count" }, -#define N_UNP_GENCNT 32 - { .n_name = "_unp_gencnt" }, -#define N_UNP_DHEAD 33 - { .n_name = "_unp_dhead" }, -#define N_UNP_SHEAD 34 - { .n_name = "_unp_shead" }, -#define N_RIP6STAT 36 - { .n_name = "_rip6stat" }, -#define N_SCTPSTAT 36 - { .n_name = "_sctpstat" }, -#define N_MFCTABLESIZE 37 - { .n_name = "_mfctablesize" }, -#define N_ARPSTAT 38 - { .n_name = "_arpstat" }, -#define N_UNP_SPHEAD 39 - { .n_name = "unp_sphead" }, -#define N_SFSTAT 40 - { .n_name = "_sfstat"}, - { .n_name = NULL }, -}; - -struct protox { +static struct protox { int pr_index; /* index into nlist of cb head */ int pr_sindex; /* index into nlist of stat block */ u_char pr_wanted; /* 1 if wanted, 0 otherwise */ @@ -191,7 +106,7 @@ struct protox { { N_RIPCBINFO, N_IGMPSTAT, 1, protopr, igmp_stats, NULL, "igmp", 1, IPPROTO_IGMP }, #ifdef IPSEC - { -1, N_IPSECSTAT, 1, NULL, /* keep as compat */ + { -1, N_IPSEC4STAT, 1, NULL, /* keep as compat */ ipsec_stats, NULL, "ipsec", 0, 0}, { -1, N_AHSTAT, 1, NULL, ah_stats, NULL, "ah", 0, 0}, @@ -202,10 +117,10 @@ struct protox { #endif { N_RIPCBINFO, N_PIMSTAT, 1, protopr, pim_stats, NULL, "pim", 1, IPPROTO_PIM }, - { -1, N_CARPSTAT, 1, NULL, + { -1, N_CARPSTATS, 1, NULL, carp_stats, NULL, "carp", 1, 0 }, #ifdef PF - { -1, N_PFSYNCSTAT, 1, NULL, + { -1, N_PFSYNCSTATS, 1, NULL, pfsync_stats, NULL, "pfsync", 1, 0 }, #endif { -1, N_ARPSTAT, 1, NULL, @@ -215,7 +130,7 @@ struct protox { }; #ifdef INET6 -struct protox ip6protox[] = { +static struct protox ip6protox[] = { { N_TCBINFO, N_TCPSTAT, 1, protopr, tcp_stats, NULL, "tcp", 1, IPPROTO_TCP }, { N_UDBINFO, N_UDPSTAT, 1, protopr, @@ -244,7 +159,7 @@ struct protox ip6protox[] = { #endif /*INET6*/ #ifdef IPSEC -struct protox pfkeyprotox[] = { +static struct protox pfkeyprotox[] = { { -1, N_PFKEYSTAT, 1, NULL, pfkey_stats, NULL, "pfkey", 0, 0 }, { -1, -1, 0, NULL, @@ -253,17 +168,17 @@ struct protox pfkeyprotox[] = { #endif #ifdef NETGRAPH -struct protox netgraphprotox[] = { - { N_NGSOCKS, -1, 1, netgraphprotopr, +static struct protox netgraphprotox[] = { + { N_NGSOCKLIST, -1, 1, netgraphprotopr, NULL, NULL, "ctrl", 0, 0 }, - { N_NGSOCKS, -1, 1, netgraphprotopr, + { N_NGSOCKLIST, -1, 1, netgraphprotopr, NULL, NULL, "data", 0, 0 }, { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; #endif -struct protox *protoprotox[] = { +static struct protox *protoprotox[] = { protox, #ifdef INET6 ip6protox, @@ -278,12 +193,14 @@ static void usage(void); static struct protox *name2protox(const char *); static struct protox *knownname(const char *); +static int kresolve_list(struct nlist *_nl); + static kvm_t *kvmd; static char *nlistf = NULL, *memf = NULL; int Aflag; /* show addresses of protocol control block */ int aflag; /* show all sockets (including servers) */ -int Bflag; /* show information about bpf consumers */ +static int Bflag; /* show information about bpf consumers */ int bflag; /* show i/f total bytes in/out */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ @@ -295,7 +212,7 @@ int noutputs = 0; /* how much outputs be int numeric_addr; /* show addresses numerically */ int numeric_port; /* show ports numerically */ static int pflag; /* show given protocol */ -int Qflag; /* show netisr information */ +static int Qflag; /* show netisr information */ int rflag; /* show routing tables (or routing stats) */ int Rflag; /* show flow / RSS statistics */ int sflag; /* show protocol statistics */ @@ -309,7 +226,7 @@ int interval; /* repeat interval for i/f char *interface; /* desired i/f for stats, or NULL for all i/fs */ int unit; /* unit number for above */ -int af; /* address family */ +static int af; /* address family */ int live; /* true if we are examining a live system */ int @@ -526,9 +443,9 @@ main(int argc, char *argv[]) if (Qflag) { if (!live) { if (kread(0, NULL, 0) == 0) - netisr_stats(kvmd); + netisr_stats(); } else - netisr_stats(NULL); + netisr_stats(); xo_finish(); exit(0); } @@ -721,7 +638,7 @@ kvmd_init(void) /* * Resolve symbol list, return 0 on success. */ -int +static int kresolve_list(struct nlist *_nl) { @@ -743,6 +660,22 @@ kresolve_list(struct nlist *_nl) } /* + * Wrapper of kvm_dpcpu_setcpu(). + */ +void +kset_dpcpu(u_int cpuid) +{ + + if ((kvmd == NULL) && (kvmd_init() != 0)) + xo_errx(-1, "%s: kvm is not available", __func__); + + if (kvm_dpcpu_setcpu(kvmd, cpuid) < 0) + xo_errx(-1, "%s: kvm_dpcpu_setcpu(%u): %s", __func__, + cpuid, kvm_geterr(kvmd)); + return; +} + +/* * Read kernel memory, return 0 on success. */ int Modified: head/usr.bin/netstat/mroute.c ============================================================================== --- head/usr.bin/netstat/mroute.c Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/mroute.c Wed Sep 2 18:51:36 2015 (r287407) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #undef _KERNEL #include -#include #include #include #include @@ -73,21 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "netstat.h" - -/* - * kvm(3) bindings for every needed symbol - */ -static struct nlist mrl[] = { -#define N_MRTSTAT 0 - { .n_name = "_mrtstat" }, -#define N_MFCHASHTBL 1 - { .n_name = "_mfchashtbl" }, -#define N_VIFTABLE 2 - { .n_name = "_viftable" }, -#define N_MFCTABLESIZE 3 - { .n_name = "_mfctablesize" }, - { .n_name = NULL }, -}; +#include "nl_defs.h" static void print_bw_meter(struct bw_meter *, int *); static void print_mfc(struct mfc *, int, int *); @@ -280,10 +265,9 @@ mroutepr() return; } } else { - kresolve_list(mrl); - pmfchashtbl = mrl[N_MFCHASHTBL].n_value; - pmfctablesize = mrl[N_MFCTABLESIZE].n_value; - pviftbl = mrl[N_VIFTABLE].n_value; + pmfchashtbl = nl[N_MFCHASHTBL].n_value; + pmfctablesize = nl[N_MFCTABLESIZE].n_value; + pviftbl = nl[N_VIFTABLE].n_value; if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { xo_warnx("No IPv4 MROUTING kernel support."); @@ -418,8 +402,7 @@ mrt_stats() u_long mstaddr; size_t len = sizeof(mrtstat); - kresolve_list(mrl); - mstaddr = mrl[N_MRTSTAT].n_value; + mstaddr = nl[N_MRTSTAT].n_value; if (mstaddr == 0) { fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/netgraph.c Wed Sep 2 18:51:36 2015 (r287407) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/netstat/netisr.c ============================================================================== --- head/usr.bin/netstat/netisr.c Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/netisr.c Wed Sep 2 18:51:36 2015 (r287407) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -50,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "netstat.h" +#include "nl_defs.h" /* * Print statistics for the kernel netisr subsystem. @@ -102,41 +102,18 @@ netisr_dispatch_policy_to_string(u_int p snprintf(buf, buflen, "%s", str); } -static void -netisr_load_kvm_uint(kvm_t *kd, const char *name, u_int *p) -{ - struct nlist nl[] = { - { .n_name = name }, - { .n_name = NULL }, - }; - int ret; - - ret = kvm_nlist(kd, nl); - if (ret < 0) - xo_errx(-1, "%s: kvm_nlist(%s): %s", __func__, name, - kvm_geterr(kd)); - if (ret != 0) - xo_errx(-1, "%s: kvm_nlist(%s): unresolved symbol", __func__, - name); - if (kvm_read(kd, nl[0].n_value, p, sizeof(*p)) != sizeof(*p)) - xo_errx(-1, "%s: kvm_read(%s): %s", __func__, name, - kvm_geterr(kd)); -} - /* * Load a nul-terminated string from KVM up to 'limit', guarantee that the * string in local memory is nul-terminated. */ static void -netisr_load_kvm_string(kvm_t *kd, uintptr_t addr, char *dest, u_int limit) +netisr_load_kvm_string(uintptr_t addr, char *dest, u_int limit) { u_int i; for (i = 0; i < limit; i++) { - if (kvm_read(kd, addr + i, &dest[i], sizeof(dest[i])) != - sizeof(dest[i])) - xo_err(-1, "%s: kvm_read: %s", __func__, - kvm_geterr(kd)); + if (kread(addr + i, &dest[i], sizeof(dest[i])) != 0) + xo_errx(-1, "%s: kread()", __func__); if (dest[i] == '\0') break; } @@ -168,18 +145,18 @@ netisr_protoispresent(u_int proto) } static void -netisr_load_kvm_config(kvm_t *kd) +netisr_load_kvm_config(void) { u_int tmp; - netisr_load_kvm_uint(kd, "_netisr_bindthreads", &bindthreads); - netisr_load_kvm_uint(kd, "_netisr_maxthreads", &maxthreads); - netisr_load_kvm_uint(kd, "_nws_count", &numthreads); - - netisr_load_kvm_uint(kd, "_netisr_defaultqlimit", &defaultqlimit); - netisr_load_kvm_uint(kd, "_netisr_maxqlimit", &maxqlimit); + kread(nl[N_NETISR_BINDTHREADS].n_value, &bindthreads, sizeof(u_int)); + kread(nl[N_NETISR_MAXTHREADS].n_value, &maxthreads, sizeof(u_int)); + kread(nl[N_NWS_COUNT].n_value, &numthreads, sizeof(u_int)); + kread(nl[N_NETISR_DEFAULTQLIMIT].n_value, &defaultqlimit, + sizeof(u_int)); + kread(nl[N_NETISR_MAXQLIMIT].n_value, &maxqlimit, sizeof(u_int)); + kread(nl[N_NETISR_DISPATCH_POLICY].n_value, &tmp, sizeof(u_int)); - netisr_load_kvm_uint(kd, "_netisr_dispatch_policy", &tmp); netisr_dispatch_policy_to_string(tmp, dispatch_policy, sizeof(dispatch_policy)); } @@ -223,41 +200,26 @@ netisr_load_sysctl_config(void) } static void -netisr_load_kvm_proto(kvm_t *kd) +netisr_load_kvm_proto(void) { - struct nlist nl[] = { -#define NLIST_NETISR_PROTO 0 - { .n_name = "_netisr_proto" }, - { .n_name = NULL }, - }; struct netisr_proto *np_array, *npp; u_int i, protocount; struct sysctl_netisr_proto *snpp; size_t len; - int ret; /* * Kernel compile-time and user compile-time definitions of * NETISR_MAXPROT must match, as we use that to size work arrays. */ - netisr_load_kvm_uint(kd, "_netisr_maxprot", &maxprot); + kread(nl[N_NETISR_MAXPROT].n_value, &maxprot, sizeof(u_int)); if (maxprot != NETISR_MAXPROT) xo_errx(-1, "%s: NETISR_MAXPROT mismatch", __func__); len = maxprot * sizeof(*np_array); np_array = malloc(len); if (np_array == NULL) xo_err(-1, "%s: malloc", __func__); - ret = kvm_nlist(kd, nl); - if (ret < 0) - xo_errx(-1, "%s: kvm_nlist(_netisr_proto): %s", __func__, - kvm_geterr(kd)); - if (ret != 0) - xo_errx(-1, "%s: kvm_nlist(_netisr_proto): unresolved symbol", - __func__); - if (kvm_read(kd, nl[NLIST_NETISR_PROTO].n_value, np_array, len) != - (ssize_t)len) - xo_errx(-1, "%s: kvm_read(_netisr_proto): %s", __func__, - kvm_geterr(kd)); + if (kread(nl[N_NETISR_PROTO].n_value, np_array, len) != 0) + xo_errx(-1, "%s: kread(_netisr_proto)", __func__); /* * Size and allocate memory to hold only live protocols. @@ -278,7 +240,7 @@ netisr_load_kvm_proto(kvm_t *kd) continue; snpp = &proto_array[protocount]; snpp->snp_version = sizeof(*snpp); - netisr_load_kvm_string(kd, (uintptr_t)npp->np_name, + netisr_load_kvm_string((uintptr_t)npp->np_name, snpp->snp_name, sizeof(snpp->snp_name)); snpp->snp_proto = i; snpp->snp_qlimit = npp->np_qlimit; @@ -320,35 +282,21 @@ netisr_load_sysctl_proto(void) } static void -netisr_load_kvm_workstream(kvm_t *kd) +netisr_load_kvm_workstream(void) { - struct nlist nl[] = { -#define NLIST_NWS_ARRAY 0 - { .n_name = "_nws_array" }, - { .n_name = NULL }, - }; struct netisr_workstream nws; struct sysctl_netisr_workstream *snwsp; struct sysctl_netisr_work *snwp; struct netisr_work *nwp; - struct nlist nl_nws[2]; u_int counter, cpuid, proto, wsid; size_t len; - int ret; len = numthreads * sizeof(*nws_array); nws_array = malloc(len); if (nws_array == NULL) xo_err(-1, "malloc"); - ret = kvm_nlist(kd, nl); - if (ret < 0) - xo_errx(-1, "%s: kvm_nlist: %s", __func__, kvm_geterr(kd)); - if (ret != 0) - xo_errx(-1, "%s: kvm_nlist: unresolved symbol", __func__); - if (kvm_read(kd, nl[NLIST_NWS_ARRAY].n_value, nws_array, len) != - (ssize_t)len) - xo_errx(-1, "%s: kvm_read(_nws_array): %s", __func__, - kvm_geterr(kd)); + if (kread(nl[N_NWS_ARRAY].n_value, nws_array, len) != 0) + xo_errx(-1, "%s: kread(_nws_array)", __func__); workstream_array = calloc(numthreads, sizeof(*workstream_array)); if (workstream_array == NULL) xo_err(-1, "calloc"); @@ -359,22 +307,9 @@ netisr_load_kvm_workstream(kvm_t *kd) counter = 0; for (wsid = 0; wsid < numthreads; wsid++) { cpuid = nws_array[wsid]; - if (kvm_dpcpu_setcpu(kd, cpuid) < 0) - xo_errx(-1, "%s: kvm_dpcpu_setcpu(%u): %s", __func__, - cpuid, kvm_geterr(kd)); - bzero(nl_nws, sizeof(nl_nws)); - nl_nws[0].n_name = "_nws"; - ret = kvm_nlist(kd, nl_nws); - if (ret < 0) - xo_errx(-1, "%s: kvm_nlist looking up nws on CPU " - "%u: %s", __func__, cpuid, kvm_geterr(kd)); - if (ret != 0) - xo_errx(-1, "%s: kvm_nlist(nws): unresolved symbol on " - "CPU %u", __func__, cpuid); - if (kvm_read(kd, nl_nws[0].n_value, &nws, sizeof(nws)) != - sizeof(nws)) - xo_errx(-1, "%s: kvm_read(nw): %s", __func__, - kvm_geterr(kd)); + kset_dpcpu(cpuid); + if (kread(nl[N_NWS].n_value, &nws, sizeof(nws)) != 0) + xo_errx(-1, "%s: kread(nw)", __func__); snwsp = &workstream_array[wsid]; snwsp->snws_version = sizeof(*snwsp); snwsp->snws_wsid = cpuid; @@ -507,11 +442,10 @@ netisr_print_workstream(struct sysctl_ne } void -netisr_stats(void *kvmd) +netisr_stats(void) { struct sysctl_netisr_workstream *snwsp; struct sysctl_netisr_proto *snpp; - kvm_t *kd = kvmd; u_int i; if (live) { @@ -520,11 +454,9 @@ netisr_stats(void *kvmd) netisr_load_sysctl_workstream(); netisr_load_sysctl_work(); } else { - if (kd == NULL) - xo_errx(-1, "netisr_stats: !live but !kd"); - netisr_load_kvm_config(kd); - netisr_load_kvm_proto(kd); - netisr_load_kvm_workstream(kd); /* Also does work. */ + netisr_load_kvm_config(); + netisr_load_kvm_proto(); + netisr_load_kvm_workstream(); /* Also does work. */ } xo_open_container("netisr"); Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/netstat.h Wed Sep 2 18:51:36 2015 (r287407) @@ -63,11 +63,10 @@ extern int unit; /* unit number for abov extern int live; /* true if we are examining a live system */ -struct nlist; int kread(u_long addr, void *buf, size_t size); uint64_t kread_counter(u_long addr); int kread_counters(u_long addr, void *buf, size_t size); -int kresolve_list(struct nlist *); +void kset_dpcpu(u_int); const char *plural(uintmax_t); const char *plurales(uintmax_t); const char *pluralies(uintmax_t); @@ -119,7 +118,7 @@ void pfkey_stats(u_long, const char *, i void mbpr(void *, u_long); -void netisr_stats(void *); +void netisr_stats(void); void hostpr(u_long, u_long); void impstats(u_long, u_long); Added: head/usr.bin/netstat/nlist_symbols ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/netstat/nlist_symbols Wed Sep 2 18:51:36 2015 (r287407) @@ -0,0 +1,54 @@ +# $FreeBSD$ +# +# module_name symbol_name +all _ahstat +all _arpstat +all _carpstats +all _divcbinfo +all _espstat +all _icmp6stat +all _icmpstat +all _igmpstat +all _ip6stat +all _ipcompstat +all _ipsec4stat +all _ipsec6stat +all _ipstat +all _mf6ctable +all _mfchashtbl +all _mfctablesize +all _mif6table +all _mrt6stat +all _mrtstat +all _netisr_bindthreads +all _netisr_defaultqlimit +all _netisr_dispatch_policy +all _netisr_maxprot +all _netisr_maxqlimit +all _netisr_maxthreads +all _netisr_proto +all _ngsocklist +all _nws +all _nws_array +all _nws_count +all _pfkeystat +all _pfsyncstats +all _pim6stat +all _pimstat +all _rip6stat +all _ripcbinfo +all _rtree +all _rtstat +all _rttrash +all _sctpstat +all _sfstat +all _tcbinfo +all _tcpstat +all _udbinfo +all _udpstat +all _unp_count +all _unp_dhead +all _unp_gencnt +all _unp_shead +all _unp_sphead +all _viftable Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Sep 2 18:42:35 2015 (r287406) +++ head/usr.bin/netstat/route.c Wed Sep 2 18:51:36 2015 (r287407) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -67,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "netstat.h" +#include "nl_defs.h" /* * Definitions for showing gateway flags. @@ -96,17 +96,6 @@ static struct bits { { 0 , 0, NULL } }; -/* - * kvm(3) bindings for every needed symbol - */ -static struct nlist rl[] = { -#define N_RTSTAT 0 - { .n_name = "_rtstat" }, -#define N_RTTRASH 1 - { .n_name = "_rttrash" }, - { .n_name = NULL }, -}; - struct ifmap_entry { char ifname[IFNAMSIZ]; }; @@ -745,13 +734,11 @@ rt_stats(void) u_long rtsaddr, rttaddr; int rttrash; - kresolve_list(rl); - - if ((rtsaddr = rl[N_RTSTAT].n_value) == 0) { + if ((rtsaddr = nl[N_RTSTAT].n_value) == 0) { xo_emit("{W:rtstat: symbol not in namelist}\n"); return; } - if ((rttaddr = rl[N_RTTRASH].n_value) == 0) { + if ((rttaddr = nl[N_RTTRASH].n_value) == 0) { xo_emit("{W:rttrash: symbol not in namelist}\n"); return; } From owner-svn-src-all@freebsd.org Wed Sep 2 19:15:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 424A79C9BBC; Wed, 2 Sep 2015 19:15:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com [209.85.160.169]) (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 0897616E; Wed, 2 Sep 2015 19:15:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykei199 with SMTP id i199so20702205yke.0; Wed, 02 Sep 2015 12:15:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=nxJeuOj6OcaEMZs2sR6ATv2qCaZUhqp0QvC8mVPgStM=; b=MI73JSIgWYSwsb03r03/qRWJ157Lu5102ywVFf7uzea0nm37M3SB9f1Vs8NJUCyx6N EdpoH6FW3Ck2loFDCwSb6z/kKquK3tppsW6OQSz44pIELcMwxzbYRz7V0vDe/bt+JEoQ RlWOns2gD9s5gFYDsjoTGw41z6jK5C6gv5HEitT+9TAQr9DJtXz1cv2pMRrL7ThyTqrd M4TzOt8/a3pN8lIlhH0WQ3Mq42GjrAJypvTlkrHB1PpoTEKciPDKSYB9l+i0WNDrbuHl Vdlv36q0DsTVT7ZNK3VEWSz58617F9JHGNpBXEO/jloIprHj1KKJLcLmWQncErj2pSiq RiMQ== X-Received: by 10.170.130.145 with SMTP id w139mr5776983ykb.37.1441221314690; Wed, 02 Sep 2015 12:15:14 -0700 (PDT) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id t129sm21656372ywa.26.2015.09.02.12.15.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 12:15:14 -0700 (PDT) Received: by ykdg206 with SMTP id g206so20639863ykd.1; Wed, 02 Sep 2015 12:15:14 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.174.136 with SMTP id q130mr5987474ykd.126.1441221314211; Wed, 02 Sep 2015 12:15:14 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.48.134 with HTTP; Wed, 2 Sep 2015 12:15:14 -0700 (PDT) In-Reply-To: <3589074.YABE6tqvK0@ralph.baldwin.cx> References: <201509021648.t82Gm451015184@repo.freebsd.org> <3589074.YABE6tqvK0@ralph.baldwin.cx> Date: Wed, 2 Sep 2015 12:15:14 -0700 Message-ID: Subject: Re: svn commit: r287403 - head/sys/dev/ioat From: Conrad Meyer To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jimharris@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, 02 Sep 2015 19:15:22 -0000 On Wed, Sep 2, 2015 at 10:26 AM, John Baldwin wrote: > Alternatively you could use pci_restore_state() (before reset) and > pci_save_state() (after reset) to restore standard PCI config registers > (including MSI/MSI-X) after a reset. > > This might be more scalable if you want to ensure other PCI config > registers (e.g. PCI-e capabilities) are restored after a reset. Hi John, Do you mean pci_save_state() before reset and pci_restore_state() afterwards? Seems reasonable to me. Thanks, Conrad From owner-svn-src-all@freebsd.org Wed Sep 2 19:49:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 672099C8F50; Wed, 2 Sep 2015 19:49:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3E95A9FE; Wed, 2 Sep 2015 19:49:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82Jnviw095155; Wed, 2 Sep 2015 19:49:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82JnuDi095151; Wed, 2 Sep 2015 19:49:56 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201509021949.t82JnuDi095151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 2 Sep 2015 19:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287408 - in head/bin/sh: . tests/parser 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, 02 Sep 2015 19:49:57 -0000 Author: jilles Date: Wed Sep 2 19:49:55 2015 New Revision: 287408 URL: https://svnweb.freebsd.org/changeset/base/287408 Log: sh: Allow empty << EOF markers. Added: head/bin/sh/tests/parser/heredoc13.0 (contents, props changed) Modified: head/bin/sh/parser.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Sep 2 18:51:36 2015 (r287407) +++ head/bin/sh/parser.c Wed Sep 2 19:49:55 2015 (r287408) @@ -106,6 +106,8 @@ static int startlinno; /* line # where static int funclinno; /* line # where the current function started */ static struct parser_temp *parser_temp; +#define NOEOFMARK ((const char *)&heredoclist) + static union node *list(int); static union node *andor(void); @@ -972,6 +974,10 @@ checkend(int c, const char *eofmark, int pungetc(); pushstring(eofmark + 1, q - (eofmark + 1), NULL); } + } else if (c == '\n' && *eofmark == '\0') { + c = PEOF; + plinno++; + needprompt = doprompt; } return (c); } @@ -1383,7 +1389,7 @@ readtoken1(int firstc, char const *initi STARTSTACKSTR(out); loop: { /* for each line, until end of word */ - if (eofmark) + if (eofmark && eofmark != NOEOFMARK) /* set c to PEOF if at end of here document */ c = checkend(c, eofmark, striptabs); for (;;) { /* until end of line or end of word */ @@ -2046,7 +2052,7 @@ expandstr(const char *ps) parser_temp = NULL; setinputstring(ps, 1); doprompt = 0; - readtoken1(pgetc(), DQSYNTAX, "", 0); + readtoken1(pgetc(), DQSYNTAX, NOEOFMARK, 0); if (backquotelist != NULL) error("Command substitution not allowed here"); Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Wed Sep 2 18:51:36 2015 (r287407) +++ head/bin/sh/tests/parser/Makefile Wed Sep 2 19:49:55 2015 (r287408) @@ -57,6 +57,7 @@ FILES+= heredoc9.0 FILES+= heredoc10.0 FILES+= heredoc11.0 FILES+= heredoc12.0 +FILES+= heredoc13.0 FILES+= line-cont1.0 FILES+= line-cont2.0 FILES+= line-cont3.0 Added: head/bin/sh/tests/parser/heredoc13.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/heredoc13.0 Wed Sep 2 19:49:55 2015 (r287408) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check '"$(cat <<"" + +echo yes)" = "yes"' + +check '"$(cat <<"" +yes + +)" = "yes"' + +exit $((failures != 0)) From owner-svn-src-all@freebsd.org Wed Sep 2 19:52:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE8C9C9109; Wed, 2 Sep 2015 19:52:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) (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 7DA3FD9E; Wed, 2 Sep 2015 19:52:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykei199 with SMTP id i199so21802860yke.0; Wed, 02 Sep 2015 12:51:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=bN8M83yy7DO3aFAWbG9IgW9CDgKmGMerP/swFHNKhyc=; b=QKUojOm5k2HdhcKbrU5iOHd2LuPule0SbnDf4rqNjWwcagaDqKJB1mtVJYkmgu6tgi HLMQjF+7Pc/4Ul4/pHYRpObO7PiMFVjwIFCvJE2g+A9Wcux58WwM9FtQgZzqoqUX2pSl PnBcRRJMbKIHwO5HV2uf+KoJHEOGZVQj7qMFz8mzR1muUZHxnhTM3NBpRswmaotWHsd3 +zzy+9rdsWoWOqZmcul8bUD3Re0MpnJWXDoERYGRfHnzJJTKWST0STdQqyq9vvNZsD7P WTAh7sPfRCBAtlDZFDJ//9td7mj19ptw64Wm965vbrx20soA5vh5SB+Fm2P5W5MdYGEU j5vw== X-Received: by 10.170.35.215 with SMTP id 206mr6156524ykd.33.1441223512660; Wed, 02 Sep 2015 12:51:52 -0700 (PDT) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id m187sm21419263ywe.8.2015.09.02.12.51.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 12:51:52 -0700 (PDT) Received: by ykei199 with SMTP id i199so21802476yke.0; Wed, 02 Sep 2015 12:51:51 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.208.145 with SMTP id z139mr6124162yke.108.1441223511938; Wed, 02 Sep 2015 12:51:51 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.48.134 with HTTP; Wed, 2 Sep 2015 12:51:51 -0700 (PDT) In-Reply-To: References: <201509021648.t82Gm451015184@repo.freebsd.org> <3589074.YABE6tqvK0@ralph.baldwin.cx> Date: Wed, 2 Sep 2015 12:51:51 -0700 Message-ID: Subject: Re: svn commit: r287403 - head/sys/dev/ioat From: Conrad Meyer To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jimharris@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, 02 Sep 2015 19:52:00 -0000 https://reviews.freebsd.org/D3552 On Wed, Sep 2, 2015 at 12:15 PM, Conrad Meyer wrote: > On Wed, Sep 2, 2015 at 10:26 AM, John Baldwin wrote: >> Alternatively you could use pci_restore_state() (before reset) and >> pci_save_state() (after reset) to restore standard PCI config registers >> (including MSI/MSI-X) after a reset. >> >> This might be more scalable if you want to ensure other PCI config >> registers (e.g. PCI-e capabilities) are restored after a reset. > > > Hi John, > > Do you mean pci_save_state() before reset and pci_restore_state() > afterwards? Seems reasonable to me. > > Thanks, > Conrad From owner-svn-src-all@freebsd.org Wed Sep 2 20:06:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A7BD9C97C1; Wed, 2 Sep 2015 20:06:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5901F903; Wed, 2 Sep 2015 20:06:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82K6n6d003787; Wed, 2 Sep 2015 20:06:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82K6kCR003777; Wed, 2 Sep 2015 20:06:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509022006.t82K6kCR003777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Sep 2015 20:06:46 +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: r287409 - in stable/9/contrib/bind9/lib/dns: . include/dst rdata/generic 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, 02 Sep 2015 20:06:49 -0000 Author: delphij Date: Wed Sep 2 20:06:46 2015 New Revision: 287409 URL: https://svnweb.freebsd.org/changeset/base/287409 Log: Fix remote denial of service vulnerability when parsing malformed key. Fix remote denial of service vulnerability caused by an incorrect boundary check in openpgpkey_61.c. Security: CVE-2015-5722, FreeBSD-SA-15:23.bind Security: CVE-2015-5986 Modified: stable/9/contrib/bind9/lib/dns/hmac_link.c stable/9/contrib/bind9/lib/dns/include/dst/dst.h stable/9/contrib/bind9/lib/dns/ncache.c stable/9/contrib/bind9/lib/dns/openssldh_link.c stable/9/contrib/bind9/lib/dns/openssldsa_link.c stable/9/contrib/bind9/lib/dns/opensslecdsa_link.c stable/9/contrib/bind9/lib/dns/opensslrsa_link.c stable/9/contrib/bind9/lib/dns/rdata/generic/openpgpkey_61.c stable/9/contrib/bind9/lib/dns/resolver.c Modified: stable/9/contrib/bind9/lib/dns/hmac_link.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/hmac_link.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/hmac_link.c Wed Sep 2 20:06:46 2015 (r287409) @@ -76,7 +76,7 @@ hmacmd5_createctx(dst_key_t *key, dst_co hmacmd5ctx = isc_mem_get(dctx->mctx, sizeof(isc_hmacmd5_t)); if (hmacmd5ctx == NULL) return (ISC_R_NOMEMORY); - isc_hmacmd5_init(hmacmd5ctx, hkey->key, ISC_SHA1_BLOCK_LENGTH); + isc_hmacmd5_init(hmacmd5ctx, hkey->key, ISC_MD5_BLOCK_LENGTH); dctx->ctxdata.hmacmd5ctx = hmacmd5ctx; return (ISC_R_SUCCESS); } @@ -139,7 +139,7 @@ hmacmd5_compare(const dst_key_t *key1, c else if (hkey1 == NULL || hkey2 == NULL) return (ISC_FALSE); - if (isc_safe_memcmp(hkey1->key, hkey2->key, ISC_SHA1_BLOCK_LENGTH)) + if (isc_safe_memcmp(hkey1->key, hkey2->key, ISC_MD5_BLOCK_LENGTH)) return (ISC_TRUE); else return (ISC_FALSE); @@ -150,17 +150,17 @@ hmacmd5_generate(dst_key_t *key, int pse isc_buffer_t b; isc_result_t ret; unsigned int bytes; - unsigned char data[ISC_SHA1_BLOCK_LENGTH]; + unsigned char data[ISC_MD5_BLOCK_LENGTH]; UNUSED(callback); bytes = (key->key_size + 7) / 8; - if (bytes > ISC_SHA1_BLOCK_LENGTH) { - bytes = ISC_SHA1_BLOCK_LENGTH; - key->key_size = ISC_SHA1_BLOCK_LENGTH * 8; + if (bytes > ISC_MD5_BLOCK_LENGTH) { + bytes = ISC_MD5_BLOCK_LENGTH; + key->key_size = ISC_MD5_BLOCK_LENGTH * 8; } - memset(data, 0, ISC_SHA1_BLOCK_LENGTH); + memset(data, 0, ISC_MD5_BLOCK_LENGTH); ret = dst__entropy_getdata(data, bytes, ISC_TF(pseudorandom_ok != 0)); if (ret != ISC_R_SUCCESS) @@ -169,7 +169,7 @@ hmacmd5_generate(dst_key_t *key, int pse isc_buffer_init(&b, data, bytes); isc_buffer_add(&b, bytes); ret = hmacmd5_fromdns(key, &b); - memset(data, 0, ISC_SHA1_BLOCK_LENGTH); + memset(data, 0, ISC_MD5_BLOCK_LENGTH); return (ret); } @@ -223,7 +223,7 @@ hmacmd5_fromdns(dst_key_t *key, isc_buff memset(hkey->key, 0, sizeof(hkey->key)); - if (r.length > ISC_SHA1_BLOCK_LENGTH) { + if (r.length > ISC_MD5_BLOCK_LENGTH) { isc_md5_init(&md5ctx); isc_md5_update(&md5ctx, r.base, r.length); isc_md5_final(&md5ctx, hkey->key); @@ -236,6 +236,8 @@ hmacmd5_fromdns(dst_key_t *key, isc_buff key->key_size = keylen * 8; key->keydata.hmacmd5 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -512,6 +514,8 @@ hmacsha1_fromdns(dst_key_t *key, isc_buf key->key_size = keylen * 8; key->keydata.hmacsha1 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -790,6 +794,8 @@ hmacsha224_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha224 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -1068,6 +1074,8 @@ hmacsha256_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha256 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -1346,6 +1354,8 @@ hmacsha384_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha384 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -1624,6 +1634,8 @@ hmacsha512_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha512 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } Modified: stable/9/contrib/bind9/lib/dns/include/dst/dst.h ============================================================================== --- stable/9/contrib/bind9/lib/dns/include/dst/dst.h Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/include/dst/dst.h Wed Sep 2 20:06:46 2015 (r287409) @@ -69,6 +69,7 @@ typedef struct dst_context dst_context_ #define DST_ALG_HMACSHA256 163 /* XXXMPA */ #define DST_ALG_HMACSHA384 164 /* XXXMPA */ #define DST_ALG_HMACSHA512 165 /* XXXMPA */ +#define DST_ALG_INDIRECT 252 #define DST_ALG_PRIVATE 254 #define DST_ALG_EXPAND 255 #define DST_MAX_ALGS 255 Modified: stable/9/contrib/bind9/lib/dns/ncache.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/ncache.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/ncache.c Wed Sep 2 20:06:46 2015 (r287409) @@ -614,13 +614,11 @@ dns_ncache_getsigrdataset(dns_rdataset_t dns_name_fromregion(&tname, &remaining); INSIST(remaining.length >= tname.length); isc_buffer_forward(&source, tname.length); - remaining.length -= tname.length; - remaining.base += tname.length; + isc_region_consume(&remaining, tname.length); INSIST(remaining.length >= 2); type = isc_buffer_getuint16(&source); - remaining.length -= 2; - remaining.base += 2; + isc_region_consume(&remaining, 2); if (type != dns_rdatatype_rrsig || !dns_name_equal(&tname, name)) { @@ -632,8 +630,7 @@ dns_ncache_getsigrdataset(dns_rdataset_t INSIST(remaining.length >= 1); trust = isc_buffer_getuint8(&source); INSIST(trust <= dns_trust_ultimate); - remaining.length -= 1; - remaining.base += 1; + isc_region_consume(&remaining, 1); raw = remaining.base; count = raw[0] * 256 + raw[1]; Modified: stable/9/contrib/bind9/lib/dns/openssldh_link.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/openssldh_link.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/openssldh_link.c Wed Sep 2 20:06:46 2015 (r287409) @@ -266,8 +266,10 @@ openssldh_destroy(dst_key_t *key) { static void uint16_toregion(isc_uint16_t val, isc_region_t *region) { - *region->base++ = (val & 0xff00) >> 8; - *region->base++ = (val & 0x00ff); + *region->base = (val & 0xff00) >> 8; + isc_region_consume(region, 1); + *region->base = (val & 0x00ff); + isc_region_consume(region, 1); } static isc_uint16_t @@ -278,7 +280,8 @@ uint16_fromregion(isc_region_t *region) val = ((unsigned int)(cp[0])) << 8; val |= ((unsigned int)(cp[1])); - region->base += 2; + isc_region_consume(region, 2); + return (val); } @@ -319,16 +322,16 @@ openssldh_todns(const dst_key_t *key, is } else BN_bn2bin(dh->p, r.base); - r.base += plen; + isc_region_consume(&r, plen); uint16_toregion(glen, &r); if (glen > 0) BN_bn2bin(dh->g, r.base); - r.base += glen; + isc_region_consume(&r, glen); uint16_toregion(publen, &r); BN_bn2bin(dh->pub_key, r.base); - r.base += publen; + isc_region_consume(&r, publen); isc_buffer_add(data, dnslen); @@ -369,10 +372,12 @@ openssldh_fromdns(dst_key_t *key, isc_bu return (DST_R_INVALIDPUBLICKEY); } if (plen == 1 || plen == 2) { - if (plen == 1) - special = *r.base++; - else + if (plen == 1) { + special = *r.base; + isc_region_consume(&r, 1); + } else { special = uint16_fromregion(&r); + } switch (special) { case 1: dh->p = &bn768; @@ -387,10 +392,9 @@ openssldh_fromdns(dst_key_t *key, isc_bu DH_free(dh); return (DST_R_INVALIDPUBLICKEY); } - } - else { + } else { dh->p = BN_bin2bn(r.base, plen, NULL); - r.base += plen; + isc_region_consume(&r, plen); } /* @@ -421,15 +425,14 @@ openssldh_fromdns(dst_key_t *key, isc_bu return (DST_R_INVALIDPUBLICKEY); } } - } - else { + } else { if (glen == 0) { DH_free(dh); return (DST_R_INVALIDPUBLICKEY); } dh->g = BN_bin2bn(r.base, glen, NULL); } - r.base += glen; + isc_region_consume(&r, glen); if (r.length < 2) { DH_free(dh); @@ -441,7 +444,7 @@ openssldh_fromdns(dst_key_t *key, isc_bu return (DST_R_INVALIDPUBLICKEY); } dh->pub_key = BN_bin2bn(r.base, publen, NULL); - r.base += publen; + isc_region_consume(&r, publen); key->key_size = BN_num_bits(dh->p); Modified: stable/9/contrib/bind9/lib/dns/openssldsa_link.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/openssldsa_link.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/openssldsa_link.c Wed Sep 2 20:06:46 2015 (r287409) @@ -29,8 +29,6 @@ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - #ifdef OPENSSL #ifndef USE_EVP #define USE_EVP 1 @@ -137,6 +135,7 @@ openssldsa_sign(dst_context_t *dctx, isc DSA *dsa = key->keydata.dsa; isc_region_t r; DSA_SIG *dsasig; + unsigned int klen; #if USE_EVP EVP_MD_CTX *evp_md_ctx = dctx->ctxdata.evp_md_ctx; EVP_PKEY *pkey; @@ -188,6 +187,7 @@ openssldsa_sign(dst_context_t *dctx, isc ISC_R_FAILURE)); } free(sigbuf); + #elif 0 /* Only use EVP for the Digest */ if (!EVP_DigestFinal_ex(evp_md_ctx, digest, &siglen)) { @@ -209,11 +209,17 @@ openssldsa_sign(dst_context_t *dctx, isc "DSA_do_sign", DST_R_SIGNFAILURE)); #endif - *r.base++ = (key->key_size - 512)/64; + + klen = (key->key_size - 512)/64; + if (klen > 255) + return (ISC_R_FAILURE); + *r.base = klen; + isc_region_consume(&r, 1); + BN_bn2bin_fixed(dsasig->r, r.base, ISC_SHA1_DIGESTLENGTH); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); BN_bn2bin_fixed(dsasig->s, r.base, ISC_SHA1_DIGESTLENGTH); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); DSA_SIG_free(dsasig); isc_buffer_add(sig, ISC_SHA1_DIGESTLENGTH * 2 + 1); @@ -446,15 +452,16 @@ openssldsa_todns(const dst_key_t *key, i if (r.length < (unsigned int) dnslen) return (ISC_R_NOSPACE); - *r.base++ = t; + *r.base = t; + isc_region_consume(&r, 1); BN_bn2bin_fixed(dsa->q, r.base, ISC_SHA1_DIGESTLENGTH); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); BN_bn2bin_fixed(dsa->p, r.base, key->key_size/8); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); BN_bn2bin_fixed(dsa->g, r.base, key->key_size/8); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); BN_bn2bin_fixed(dsa->pub_key, r.base, key->key_size/8); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); isc_buffer_add(data, dnslen); @@ -479,29 +486,30 @@ openssldsa_fromdns(dst_key_t *key, isc_b return (ISC_R_NOMEMORY); dsa->flags &= ~DSA_FLAG_CACHE_MONT_P; - t = (unsigned int) *r.base++; + t = (unsigned int) *r.base; + isc_region_consume(&r, 1); if (t > 8) { DSA_free(dsa); return (DST_R_INVALIDPUBLICKEY); } p_bytes = 64 + 8 * t; - if (r.length < 1 + ISC_SHA1_DIGESTLENGTH + 3 * p_bytes) { + if (r.length < ISC_SHA1_DIGESTLENGTH + 3 * p_bytes) { DSA_free(dsa); return (DST_R_INVALIDPUBLICKEY); } dsa->q = BN_bin2bn(r.base, ISC_SHA1_DIGESTLENGTH, NULL); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); dsa->p = BN_bin2bn(r.base, p_bytes, NULL); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); dsa->g = BN_bin2bn(r.base, p_bytes, NULL); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); dsa->pub_key = BN_bin2bn(r.base, p_bytes, NULL); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); key->key_size = p_bytes * 8; Modified: stable/9/contrib/bind9/lib/dns/opensslecdsa_link.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/opensslecdsa_link.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/opensslecdsa_link.c Wed Sep 2 20:06:46 2015 (r287409) @@ -14,8 +14,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - #include #ifdef HAVE_OPENSSL_ECDSA @@ -159,9 +157,9 @@ opensslecdsa_sign(dst_context_t *dctx, i "ECDSA_do_sign", DST_R_SIGNFAILURE)); BN_bn2bin_fixed(ecdsasig->r, r.base, siglen / 2); - r.base += siglen / 2; + isc_region_consume(&r, siglen / 2); BN_bn2bin_fixed(ecdsasig->s, r.base, siglen / 2); - r.base += siglen / 2; + isc_region_consume(&r, siglen / 2); ECDSA_SIG_free(ecdsasig); isc_buffer_add(sig, siglen); ret = ISC_R_SUCCESS; Modified: stable/9/contrib/bind9/lib/dns/opensslrsa_link.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/opensslrsa_link.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/opensslrsa_link.c Wed Sep 2 20:06:46 2015 (r287409) @@ -965,6 +965,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_b RSA *rsa; isc_region_t r; unsigned int e_bytes; + unsigned int length; #if USE_EVP EVP_PKEY *pkey; #endif @@ -972,6 +973,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_b isc_buffer_remainingregion(data, &r); if (r.length == 0) return (ISC_R_SUCCESS); + length = r.length; rsa = RSA_new(); if (rsa == NULL) @@ -982,17 +984,18 @@ opensslrsa_fromdns(dst_key_t *key, isc_b RSA_free(rsa); return (DST_R_INVALIDPUBLICKEY); } - e_bytes = *r.base++; - r.length--; + e_bytes = *r.base; + isc_region_consume(&r, 1); if (e_bytes == 0) { if (r.length < 2) { RSA_free(rsa); return (DST_R_INVALIDPUBLICKEY); } - e_bytes = ((*r.base++) << 8); - e_bytes += *r.base++; - r.length -= 2; + e_bytes = (*r.base) << 8; + isc_region_consume(&r, 1); + e_bytes += *r.base; + isc_region_consume(&r, 1); } if (r.length < e_bytes) { @@ -1000,14 +1003,13 @@ opensslrsa_fromdns(dst_key_t *key, isc_b return (DST_R_INVALIDPUBLICKEY); } rsa->e = BN_bin2bn(r.base, e_bytes, NULL); - r.base += e_bytes; - r.length -= e_bytes; + isc_region_consume(&r, e_bytes); rsa->n = BN_bin2bn(r.base, r.length, NULL); key->key_size = BN_num_bits(rsa->n); - isc_buffer_forward(data, r.length); + isc_buffer_forward(data, length); #if USE_EVP pkey = EVP_PKEY_new(); Modified: stable/9/contrib/bind9/lib/dns/rdata/generic/openpgpkey_61.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/rdata/generic/openpgpkey_61.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/rdata/generic/openpgpkey_61.c Wed Sep 2 20:06:46 2015 (r287409) @@ -76,6 +76,8 @@ fromwire_openpgpkey(ARGS_FROMWIRE) { * Keyring. */ isc_buffer_activeregion(source, &sr); + if (sr.length < 1) + return (ISC_R_UNEXPECTEDEND); isc_buffer_forward(source, sr.length); return (mem_tobuffer(target, sr.base, sr.length)); } Modified: stable/9/contrib/bind9/lib/dns/resolver.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/resolver.c Wed Sep 2 19:49:55 2015 (r287408) +++ stable/9/contrib/bind9/lib/dns/resolver.c Wed Sep 2 20:06:46 2015 (r287409) @@ -9058,6 +9058,12 @@ dns_resolver_algorithm_supported(dns_res REQUIRE(VALID_RESOLVER(resolver)); + /* + * DH is unsupported for DNSKEYs, see RFC 4034 sec. A.1. + */ + if ((alg == DST_ALG_DH) || (alg == DST_ALG_INDIRECT)) + return (ISC_FALSE); + #if USE_ALGLOCK RWLOCK(&resolver->alglock, isc_rwlocktype_read); #endif @@ -9077,6 +9083,7 @@ dns_resolver_algorithm_supported(dns_res #endif if (found) return (ISC_FALSE); + return (dst_algorithm_supported(alg)); } From owner-svn-src-all@freebsd.org Wed Sep 2 20:07:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA8F9C982D; Wed, 2 Sep 2015 20:07:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3E98FA73; Wed, 2 Sep 2015 20:07:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82K77VZ003860; Wed, 2 Sep 2015 20:07:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82K74P8003849; Wed, 2 Sep 2015 20:07:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509022007.t82K74P8003849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Sep 2015 20:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r287410 - in releng/9.3: . contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dst sys/conf X-SVN-Group: releng 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, 02 Sep 2015 20:07:07 -0000 Author: delphij Date: Wed Sep 2 20:07:03 2015 New Revision: 287410 URL: https://svnweb.freebsd.org/changeset/base/287410 Log: Fix remote denial of service vulnerability when parsing malformed key. Security: CVE-2015-5722 Security: FreeBSD-SA-15:23.bind Approved by: so Modified: releng/9.3/UPDATING releng/9.3/contrib/bind9/lib/dns/hmac_link.c releng/9.3/contrib/bind9/lib/dns/include/dst/dst.h releng/9.3/contrib/bind9/lib/dns/ncache.c releng/9.3/contrib/bind9/lib/dns/openssldh_link.c releng/9.3/contrib/bind9/lib/dns/openssldsa_link.c releng/9.3/contrib/bind9/lib/dns/opensslecdsa_link.c releng/9.3/contrib/bind9/lib/dns/opensslrsa_link.c releng/9.3/contrib/bind9/lib/dns/resolver.c releng/9.3/sys/conf/newvers.sh Modified: releng/9.3/UPDATING ============================================================================== --- releng/9.3/UPDATING Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/UPDATING Wed Sep 2 20:07:03 2015 (r287410) @@ -11,6 +11,10 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20150902: p25 FreeBSD-SA-15:23.bind + + Fix BIND remote denial of service vulnerability. [SA-15:23] + 20150825: p24 FreeBSD-SA-15:21.amd64 FreeBSD-SA-15:22.openssh FreeBSD-EN-15:15.pkg Modified: releng/9.3/contrib/bind9/lib/dns/hmac_link.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/hmac_link.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/hmac_link.c Wed Sep 2 20:07:03 2015 (r287410) @@ -76,7 +76,7 @@ hmacmd5_createctx(dst_key_t *key, dst_co hmacmd5ctx = isc_mem_get(dctx->mctx, sizeof(isc_hmacmd5_t)); if (hmacmd5ctx == NULL) return (ISC_R_NOMEMORY); - isc_hmacmd5_init(hmacmd5ctx, hkey->key, ISC_SHA1_BLOCK_LENGTH); + isc_hmacmd5_init(hmacmd5ctx, hkey->key, ISC_MD5_BLOCK_LENGTH); dctx->ctxdata.hmacmd5ctx = hmacmd5ctx; return (ISC_R_SUCCESS); } @@ -139,7 +139,7 @@ hmacmd5_compare(const dst_key_t *key1, c else if (hkey1 == NULL || hkey2 == NULL) return (ISC_FALSE); - if (isc_safe_memcmp(hkey1->key, hkey2->key, ISC_SHA1_BLOCK_LENGTH)) + if (isc_safe_memcmp(hkey1->key, hkey2->key, ISC_MD5_BLOCK_LENGTH)) return (ISC_TRUE); else return (ISC_FALSE); @@ -150,17 +150,17 @@ hmacmd5_generate(dst_key_t *key, int pse isc_buffer_t b; isc_result_t ret; unsigned int bytes; - unsigned char data[ISC_SHA1_BLOCK_LENGTH]; + unsigned char data[ISC_MD5_BLOCK_LENGTH]; UNUSED(callback); bytes = (key->key_size + 7) / 8; - if (bytes > ISC_SHA1_BLOCK_LENGTH) { - bytes = ISC_SHA1_BLOCK_LENGTH; - key->key_size = ISC_SHA1_BLOCK_LENGTH * 8; + if (bytes > ISC_MD5_BLOCK_LENGTH) { + bytes = ISC_MD5_BLOCK_LENGTH; + key->key_size = ISC_MD5_BLOCK_LENGTH * 8; } - memset(data, 0, ISC_SHA1_BLOCK_LENGTH); + memset(data, 0, ISC_MD5_BLOCK_LENGTH); ret = dst__entropy_getdata(data, bytes, ISC_TF(pseudorandom_ok != 0)); if (ret != ISC_R_SUCCESS) @@ -169,7 +169,7 @@ hmacmd5_generate(dst_key_t *key, int pse isc_buffer_init(&b, data, bytes); isc_buffer_add(&b, bytes); ret = hmacmd5_fromdns(key, &b); - memset(data, 0, ISC_SHA1_BLOCK_LENGTH); + memset(data, 0, ISC_MD5_BLOCK_LENGTH); return (ret); } @@ -223,7 +223,7 @@ hmacmd5_fromdns(dst_key_t *key, isc_buff memset(hkey->key, 0, sizeof(hkey->key)); - if (r.length > ISC_SHA1_BLOCK_LENGTH) { + if (r.length > ISC_MD5_BLOCK_LENGTH) { isc_md5_init(&md5ctx); isc_md5_update(&md5ctx, r.base, r.length); isc_md5_final(&md5ctx, hkey->key); @@ -236,6 +236,8 @@ hmacmd5_fromdns(dst_key_t *key, isc_buff key->key_size = keylen * 8; key->keydata.hmacmd5 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -512,6 +514,8 @@ hmacsha1_fromdns(dst_key_t *key, isc_buf key->key_size = keylen * 8; key->keydata.hmacsha1 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -790,6 +794,8 @@ hmacsha224_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha224 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -1068,6 +1074,8 @@ hmacsha256_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha256 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -1346,6 +1354,8 @@ hmacsha384_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha384 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } @@ -1624,6 +1634,8 @@ hmacsha512_fromdns(dst_key_t *key, isc_b key->key_size = keylen * 8; key->keydata.hmacsha512 = hkey; + isc_buffer_forward(data, r.length); + return (ISC_R_SUCCESS); } Modified: releng/9.3/contrib/bind9/lib/dns/include/dst/dst.h ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/include/dst/dst.h Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/include/dst/dst.h Wed Sep 2 20:07:03 2015 (r287410) @@ -69,6 +69,7 @@ typedef struct dst_context dst_context_ #define DST_ALG_HMACSHA256 163 /* XXXMPA */ #define DST_ALG_HMACSHA384 164 /* XXXMPA */ #define DST_ALG_HMACSHA512 165 /* XXXMPA */ +#define DST_ALG_INDIRECT 252 #define DST_ALG_PRIVATE 254 #define DST_ALG_EXPAND 255 #define DST_MAX_ALGS 255 Modified: releng/9.3/contrib/bind9/lib/dns/ncache.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/ncache.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/ncache.c Wed Sep 2 20:07:03 2015 (r287410) @@ -614,13 +614,11 @@ dns_ncache_getsigrdataset(dns_rdataset_t dns_name_fromregion(&tname, &remaining); INSIST(remaining.length >= tname.length); isc_buffer_forward(&source, tname.length); - remaining.length -= tname.length; - remaining.base += tname.length; + isc_region_consume(&remaining, tname.length); INSIST(remaining.length >= 2); type = isc_buffer_getuint16(&source); - remaining.length -= 2; - remaining.base += 2; + isc_region_consume(&remaining, 2); if (type != dns_rdatatype_rrsig || !dns_name_equal(&tname, name)) { @@ -632,8 +630,7 @@ dns_ncache_getsigrdataset(dns_rdataset_t INSIST(remaining.length >= 1); trust = isc_buffer_getuint8(&source); INSIST(trust <= dns_trust_ultimate); - remaining.length -= 1; - remaining.base += 1; + isc_region_consume(&remaining, 1); raw = remaining.base; count = raw[0] * 256 + raw[1]; Modified: releng/9.3/contrib/bind9/lib/dns/openssldh_link.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/openssldh_link.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/openssldh_link.c Wed Sep 2 20:07:03 2015 (r287410) @@ -266,8 +266,10 @@ openssldh_destroy(dst_key_t *key) { static void uint16_toregion(isc_uint16_t val, isc_region_t *region) { - *region->base++ = (val & 0xff00) >> 8; - *region->base++ = (val & 0x00ff); + *region->base = (val & 0xff00) >> 8; + isc_region_consume(region, 1); + *region->base = (val & 0x00ff); + isc_region_consume(region, 1); } static isc_uint16_t @@ -278,7 +280,8 @@ uint16_fromregion(isc_region_t *region) val = ((unsigned int)(cp[0])) << 8; val |= ((unsigned int)(cp[1])); - region->base += 2; + isc_region_consume(region, 2); + return (val); } @@ -319,16 +322,16 @@ openssldh_todns(const dst_key_t *key, is } else BN_bn2bin(dh->p, r.base); - r.base += plen; + isc_region_consume(&r, plen); uint16_toregion(glen, &r); if (glen > 0) BN_bn2bin(dh->g, r.base); - r.base += glen; + isc_region_consume(&r, glen); uint16_toregion(publen, &r); BN_bn2bin(dh->pub_key, r.base); - r.base += publen; + isc_region_consume(&r, publen); isc_buffer_add(data, dnslen); @@ -369,10 +372,12 @@ openssldh_fromdns(dst_key_t *key, isc_bu return (DST_R_INVALIDPUBLICKEY); } if (plen == 1 || plen == 2) { - if (plen == 1) - special = *r.base++; - else + if (plen == 1) { + special = *r.base; + isc_region_consume(&r, 1); + } else { special = uint16_fromregion(&r); + } switch (special) { case 1: dh->p = &bn768; @@ -387,10 +392,9 @@ openssldh_fromdns(dst_key_t *key, isc_bu DH_free(dh); return (DST_R_INVALIDPUBLICKEY); } - } - else { + } else { dh->p = BN_bin2bn(r.base, plen, NULL); - r.base += plen; + isc_region_consume(&r, plen); } /* @@ -421,15 +425,14 @@ openssldh_fromdns(dst_key_t *key, isc_bu return (DST_R_INVALIDPUBLICKEY); } } - } - else { + } else { if (glen == 0) { DH_free(dh); return (DST_R_INVALIDPUBLICKEY); } dh->g = BN_bin2bn(r.base, glen, NULL); } - r.base += glen; + isc_region_consume(&r, glen); if (r.length < 2) { DH_free(dh); @@ -441,7 +444,7 @@ openssldh_fromdns(dst_key_t *key, isc_bu return (DST_R_INVALIDPUBLICKEY); } dh->pub_key = BN_bin2bn(r.base, publen, NULL); - r.base += publen; + isc_region_consume(&r, publen); key->key_size = BN_num_bits(dh->p); Modified: releng/9.3/contrib/bind9/lib/dns/openssldsa_link.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/openssldsa_link.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/openssldsa_link.c Wed Sep 2 20:07:03 2015 (r287410) @@ -29,8 +29,6 @@ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - #ifdef OPENSSL #ifndef USE_EVP #define USE_EVP 1 @@ -137,6 +135,7 @@ openssldsa_sign(dst_context_t *dctx, isc DSA *dsa = key->keydata.dsa; isc_region_t r; DSA_SIG *dsasig; + unsigned int klen; #if USE_EVP EVP_MD_CTX *evp_md_ctx = dctx->ctxdata.evp_md_ctx; EVP_PKEY *pkey; @@ -188,6 +187,7 @@ openssldsa_sign(dst_context_t *dctx, isc ISC_R_FAILURE)); } free(sigbuf); + #elif 0 /* Only use EVP for the Digest */ if (!EVP_DigestFinal_ex(evp_md_ctx, digest, &siglen)) { @@ -209,11 +209,17 @@ openssldsa_sign(dst_context_t *dctx, isc "DSA_do_sign", DST_R_SIGNFAILURE)); #endif - *r.base++ = (key->key_size - 512)/64; + + klen = (key->key_size - 512)/64; + if (klen > 255) + return (ISC_R_FAILURE); + *r.base = klen; + isc_region_consume(&r, 1); + BN_bn2bin_fixed(dsasig->r, r.base, ISC_SHA1_DIGESTLENGTH); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); BN_bn2bin_fixed(dsasig->s, r.base, ISC_SHA1_DIGESTLENGTH); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); DSA_SIG_free(dsasig); isc_buffer_add(sig, ISC_SHA1_DIGESTLENGTH * 2 + 1); @@ -446,15 +452,16 @@ openssldsa_todns(const dst_key_t *key, i if (r.length < (unsigned int) dnslen) return (ISC_R_NOSPACE); - *r.base++ = t; + *r.base = t; + isc_region_consume(&r, 1); BN_bn2bin_fixed(dsa->q, r.base, ISC_SHA1_DIGESTLENGTH); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); BN_bn2bin_fixed(dsa->p, r.base, key->key_size/8); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); BN_bn2bin_fixed(dsa->g, r.base, key->key_size/8); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); BN_bn2bin_fixed(dsa->pub_key, r.base, key->key_size/8); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); isc_buffer_add(data, dnslen); @@ -479,29 +486,30 @@ openssldsa_fromdns(dst_key_t *key, isc_b return (ISC_R_NOMEMORY); dsa->flags &= ~DSA_FLAG_CACHE_MONT_P; - t = (unsigned int) *r.base++; + t = (unsigned int) *r.base; + isc_region_consume(&r, 1); if (t > 8) { DSA_free(dsa); return (DST_R_INVALIDPUBLICKEY); } p_bytes = 64 + 8 * t; - if (r.length < 1 + ISC_SHA1_DIGESTLENGTH + 3 * p_bytes) { + if (r.length < ISC_SHA1_DIGESTLENGTH + 3 * p_bytes) { DSA_free(dsa); return (DST_R_INVALIDPUBLICKEY); } dsa->q = BN_bin2bn(r.base, ISC_SHA1_DIGESTLENGTH, NULL); - r.base += ISC_SHA1_DIGESTLENGTH; + isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH); dsa->p = BN_bin2bn(r.base, p_bytes, NULL); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); dsa->g = BN_bin2bn(r.base, p_bytes, NULL); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); dsa->pub_key = BN_bin2bn(r.base, p_bytes, NULL); - r.base += p_bytes; + isc_region_consume(&r, p_bytes); key->key_size = p_bytes * 8; Modified: releng/9.3/contrib/bind9/lib/dns/opensslecdsa_link.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/opensslecdsa_link.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/opensslecdsa_link.c Wed Sep 2 20:07:03 2015 (r287410) @@ -14,8 +14,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - #include #ifdef HAVE_OPENSSL_ECDSA @@ -159,9 +157,9 @@ opensslecdsa_sign(dst_context_t *dctx, i "ECDSA_do_sign", DST_R_SIGNFAILURE)); BN_bn2bin_fixed(ecdsasig->r, r.base, siglen / 2); - r.base += siglen / 2; + isc_region_consume(&r, siglen / 2); BN_bn2bin_fixed(ecdsasig->s, r.base, siglen / 2); - r.base += siglen / 2; + isc_region_consume(&r, siglen / 2); ECDSA_SIG_free(ecdsasig); isc_buffer_add(sig, siglen); ret = ISC_R_SUCCESS; Modified: releng/9.3/contrib/bind9/lib/dns/opensslrsa_link.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/opensslrsa_link.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/opensslrsa_link.c Wed Sep 2 20:07:03 2015 (r287410) @@ -965,6 +965,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_b RSA *rsa; isc_region_t r; unsigned int e_bytes; + unsigned int length; #if USE_EVP EVP_PKEY *pkey; #endif @@ -972,6 +973,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_b isc_buffer_remainingregion(data, &r); if (r.length == 0) return (ISC_R_SUCCESS); + length = r.length; rsa = RSA_new(); if (rsa == NULL) @@ -982,17 +984,18 @@ opensslrsa_fromdns(dst_key_t *key, isc_b RSA_free(rsa); return (DST_R_INVALIDPUBLICKEY); } - e_bytes = *r.base++; - r.length--; + e_bytes = *r.base; + isc_region_consume(&r, 1); if (e_bytes == 0) { if (r.length < 2) { RSA_free(rsa); return (DST_R_INVALIDPUBLICKEY); } - e_bytes = ((*r.base++) << 8); - e_bytes += *r.base++; - r.length -= 2; + e_bytes = (*r.base) << 8; + isc_region_consume(&r, 1); + e_bytes += *r.base; + isc_region_consume(&r, 1); } if (r.length < e_bytes) { @@ -1000,14 +1003,13 @@ opensslrsa_fromdns(dst_key_t *key, isc_b return (DST_R_INVALIDPUBLICKEY); } rsa->e = BN_bin2bn(r.base, e_bytes, NULL); - r.base += e_bytes; - r.length -= e_bytes; + isc_region_consume(&r, e_bytes); rsa->n = BN_bin2bn(r.base, r.length, NULL); key->key_size = BN_num_bits(rsa->n); - isc_buffer_forward(data, r.length); + isc_buffer_forward(data, length); #if USE_EVP pkey = EVP_PKEY_new(); Modified: releng/9.3/contrib/bind9/lib/dns/resolver.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/resolver.c Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/contrib/bind9/lib/dns/resolver.c Wed Sep 2 20:07:03 2015 (r287410) @@ -8937,6 +8937,12 @@ dns_resolver_algorithm_supported(dns_res REQUIRE(VALID_RESOLVER(resolver)); + /* + * DH is unsupported for DNSKEYs, see RFC 4034 sec. A.1. + */ + if ((alg == DST_ALG_DH) || (alg == DST_ALG_INDIRECT)) + return (ISC_FALSE); + #if USE_ALGLOCK RWLOCK(&resolver->alglock, isc_rwlocktype_read); #endif @@ -8956,6 +8962,7 @@ dns_resolver_algorithm_supported(dns_res #endif if (found) return (ISC_FALSE); + return (dst_algorithm_supported(alg)); } Modified: releng/9.3/sys/conf/newvers.sh ============================================================================== --- releng/9.3/sys/conf/newvers.sh Wed Sep 2 20:06:46 2015 (r287409) +++ releng/9.3/sys/conf/newvers.sh Wed Sep 2 20:07:03 2015 (r287410) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p24" +BRANCH="RELEASE-p25" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Sep 2 21:03:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30EE79C994F; Wed, 2 Sep 2015 21:03:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 21DDDB0D; Wed, 2 Sep 2015 21:03:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82L3LjZ028651; Wed, 2 Sep 2015 21:03:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82L3K0h028650; Wed, 2 Sep 2015 21:03:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201509022103.t82L3K0h028650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 2 Sep 2015 21:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r287411 - 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: Wed, 02 Sep 2015 21:03:21 -0000 Author: gjb Date: Wed Sep 2 21:03:20 2015 New Revision: 287411 URL: https://svnweb.freebsd.org/changeset/base/287411 Log: Turn releng/10.2 over to secteam. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Wed Sep 2 20:07:03 2015 (r287410) +++ svnadmin/conf/approvers Wed Sep 2 21:03:20 2015 (r287411) @@ -18,8 +18,7 @@ # #^head/ re #^stable/10/ re -^releng/10.2/ (re|security-officer|so) -^releng/10.[0-1]/ (security-officer|so) +^releng/10.[0-2]/ (security-officer|so) ^releng/9.[0-3]/ (security-officer|so) ^releng/8.[0-4]/ (security-officer|so) ^releng/7.[0-4]/ (security-officer|so) From owner-svn-src-all@freebsd.org Wed Sep 2 21:13:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 381829C3368; Wed, 2 Sep 2015 21:13:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 2844119E4; Wed, 2 Sep 2015 21:13:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82LD7hS033207; Wed, 2 Sep 2015 21:13:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82LD7JN033206; Wed, 2 Sep 2015 21:13:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201509022113.t82LD7JN033206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 2 Sep 2015 21:13:07 +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: r287412 - stable/9/release/doc/share/xml 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, 02 Sep 2015 21:13:07 -0000 Author: gjb Date: Wed Sep 2 21:13:06 2015 New Revision: 287412 URL: https://svnweb.freebsd.org/changeset/base/287412 Log: Document SA-15:23. Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/share/xml/security.xml Modified: stable/9/release/doc/share/xml/security.xml ============================================================================== --- stable/9/release/doc/share/xml/security.xml Wed Sep 2 21:03:20 2015 (r287411) +++ stable/9/release/doc/share/xml/security.xml Wed Sep 2 21:13:06 2015 (r287412) @@ -224,6 +224,13 @@ 25 August 2015 Multiple vulnerabilities + + + FreeBSD-SA-15:23.bind + 2 September 2015 + Remote denial of service + vulnerability + From owner-svn-src-all@freebsd.org Wed Sep 2 21:44:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DB629C86DF; Wed, 2 Sep 2015 21:44:13 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0107.outbound.protection.outlook.com [207.46.100.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5560BF4A; Wed, 2 Sep 2015 21:44:12 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BL2PR05CA0014.namprd05.prod.outlook.com (10.255.226.14) by BLUPR05MB771.namprd05.prod.outlook.com (10.141.209.26) with Microsoft SMTP Server (TLS) id 15.1.256.15; Wed, 2 Sep 2015 21:28:44 +0000 Received: from BY2FFO11FD024.protection.gbl (2a01:111:f400:7c0c::183) by BL2PR05CA0014.outlook.office365.com (2a01:111:e400:c04::14) with Microsoft SMTP Server (TLS) id 15.1.262.15 via Frontend Transport; Wed, 2 Sep 2015 21:28:44 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.17) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.17 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.17) by BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (TLS) id 15.1.262.18 via Frontend Transport; Wed, 2 Sep 2015 21:28:42 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 2 Sep 2015 14:28:42 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t82LSfD39860; Wed, 2 Sep 2015 14:28:41 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 9602E5829C; Wed, 2 Sep 2015 14:28:41 -0700 (PDT) To: Bryan Drewery CC: , , Subject: Re: svn commit: r284598 - head/share/mk In-Reply-To: <55E6516F.5000805@FreeBSD.org> References: <201506191456.t5JEuPDU074336@svn.freebsd.org> <55B8268A.5030305@FreeBSD.org> <4974.1438488939@chaos> <55E6516F.5000805@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Tue, 01 Sep 2015 18:31:27 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 2 Sep 2015 14:28:41 -0700 Message-ID: <16776.1441229321@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD024; 1:RctzsUVkbnTN4sjoiSZMAsx2FXjqFnq1fAsCl1rjxOwhEzQ8sxvt+PV0IvPIrpiHYLTiFrfTgcARF25uPQdfVpvXEg0UG1g2pTbTUCmx2G5zl4GH9QZvbop12u2z3BirY4nUy6uun8TIHu0iRcr/JDb/umFvC+ZMhS1OAKRbjFCcgVsU+MK4PKTLC4QIvHch/HGD3RpVhPtwY0V1yN28qwgOEmFzvn7qZ1TMbHoeGnqBCZ6ijR8gbfTOgvENU/7ppoilShdUc6ga5k0AQixtWCpgFLLg3YY4Gz/MrEpFa/5UxV2aqHcjSekIKvNeWNnXQznw9+NVlX2GJ0nlQ7UFdIVQ2fjSM/6376sd4PXsEWDAKouaHFXwORL1MZC3JL91 X-Forefront-Antispam-Report: CIP:66.129.239.17; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(3050300001)(199003)(189002)(24454002)(76506005)(86362001)(57986006)(50466002)(76176999)(47776003)(19580395003)(64706001)(6806004)(87936001)(19580405001)(50226001)(97736004)(69596002)(110136002)(50986999)(81156007)(4001540100001)(48376002)(5001960100002)(33716001)(106466001)(5001830100001)(5001860100001)(5001920100001)(105596002)(450100001)(62966003)(5007970100001)(189998001)(2950100001)(117636001)(77096005)(68736005)(92566002)(93886004)(77156002)(46102003)(5003940100001)(62816006)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB771; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB771; 2:kzDFy8JfNsGCqHFoNpWdMIGFTz8yqmL4eVb5HJzL3r0UfiGgRLZj9cDlxtDV7ClWsSawL1vhuMTTolLOwXEc8RJSZ6dBCV/fwewQ2VI3elnEi7oQAFWKFD2bGNPZhbW0UxVpFlIz9BWIiKaJlgMpWOj0We+QjE7F6iZcp18QJFw=; 3:UMOMMyOm4yeSK5mo9Kjv68IHUVmpQXRVr3o6Bs7Sm6QKtlPEw00s/AAbAEFUW9UsubJywJRzrC7dDTLlngQQV3nPd1prZdBYNRW7j1kYLtbFTNnxHbTwXpf5GVL6mN8vCZXnG0ZyMT6GbO9wawD6snhQU77fs2laXDsLHBVURpEq82UjVjQNqS4H7J/tDMYNvhREEuKQqJPRS/8gzJoL2tegK3ato3tvLzPO0g9ZJyc=; 25:sZ3ZnmWjq4xKcB/bKiW2qOZVO+EfHKiLPcB420eqbu3JASpjMyJUJdn3qVSnENFVD85P3BS5hcrU7MliHH09cBisv4u59SKGMhisMg0gIhTcImxYWmFCxx6Yn0+1KAdpQ2rWx+jwwHRfPpJGRGumW4RkohmLAC+e5VoFPvd948grJ6f8RKmDIpVuhVXFrh6/7pvRLxM2MgiuE/qrUHMPOt5y0m6U/grVCH0B2Zh81tl4gBFurAGy+G5kvYBDubTZ/FTFsyr1/wagYzM8IN5bUw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB771; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB771; 20:J2B2BtPfMX/FHj/AFkVSY57u+g4WNgnaEjhbMwCH0dIYxit0tiookyMj83MhLGIq2gnU8z8Z+7W+02+7ivUCs7tWNqnj8DadZaywi5IrazGe33N4p65gMj5qvbN4F0OnIiTVgYGDNHPt55sKwpZIvG5E3F7p77jDjkhuUSYXCdW7Z0firBszCIfthigDGTb7uLTbtRhz6yEPmoFzLSWd+GxEQZpNynGPIQO9W6WIP+14inNxH6yZW8SDlgsyCfvvc1zYokqBLx7gTsPLsIUm2EkygH1iF4noqkMW+cy8kZuIemYsHSf7wOW8KLknZuooUtkC6dLqEOVj/XldB7j+3AGxbND4ETXbK6QXPOh9qxmirTEfzfTq0ykde1tlWVnLgHSkUkwyRn5oPYsV2Y9wxFQ4yO838iXMkRu7/iyDzD+S9osrF8m25BEtOJhOmBMbmW6n+B2VYw6FrCYeOyZw2CdQ+e9y5KuSsWjyV9R1swSE8rWXx6WSz+0bAjI6Zvgs; 4:c++AKNkXiEiER8KHVAqBc6XOJay901s8wS8pdbi0K6fMHcbUQE54IIpCK1WX6Is6vtn/sYbipDalP2CavwKnjnIoiyGJA26FqXvOh8vacG4cbVRgvXdt6xqoorXP47i+R0vh4ncg+aPgA3Ws7rqfSGKRlz5LrFGaYXEEVuamFKXUH1WkpWqL1nkPQ71s4Vrhy/sbpqbPoQEDmz4PML7RpxRgJ3TikL0DfgztbJ+pvfbauwDxl8zjwnCbRVwdGBAttD7TR1mN2rledFQVGNTRAnciZExuK9BKbzqNt3+7Dc8QBKKkkRv9OEK6AT4HhS7Y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(8121501046)(5005006)(3002001); SRVR:BLUPR05MB771; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB771; X-Forefront-PRVS: 0687389FB0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB771; 23:i/q5XK+VwB9MHykb2KulPHO5wQmsWm5JlJupZvtDxT?= =?us-ascii?Q?FSZyxL0xkb23AX45/FAHAAkURl7aJk7/BMwcKBqCTHP/AvkUjRMA2cP95VjW?= =?us-ascii?Q?JMaV/Tu/VBdDUQe/tUhlxEbn5rvmIA0ogBr692mLAl5TqDBWpth5+NK47Hqw?= =?us-ascii?Q?B9aUUAccAh4YxD9T1XOg1gjBqr55V1++FB1WKyiKmlRft7tz4EBng9FopY/F?= =?us-ascii?Q?sa07ELIxKRuhcXVgpY3/nRrZ1iux5eg2yext/Qt8OhmmrkGTe96ACf64aVkc?= =?us-ascii?Q?Kx0ppNIhv0Slfx6Vq567i0DSdpcQ4MV4Hcc6RUo0Xpx+EvyawVTk5jeedOMu?= =?us-ascii?Q?ZCupPqNHYMYo9TLRUjyDO2L7Q7CMoK36EWOBt2bP5u8DZjKBhz539wxnwAE8?= =?us-ascii?Q?Bj5dRls/fQAaZ8LnWkES1MZOiQj/6L9XaZCFYeXKfyk72DxGp44Srz11Gzom?= =?us-ascii?Q?nMCeeAB/nifFk/Uw18Qhgt+xHplUv1UZATjMaLlk8rhhcTDw3QhayYqzyl/W?= =?us-ascii?Q?+46pMUkPD+ISy4IbMvIL1M4BKpUkpik+qA/DsUEkxT7Vg+PtGOoRen8dwjk1?= =?us-ascii?Q?Ktmo7O1Hpcn3QhwYYIGFZYCyt2647wp3bBWkade0mACPL9PiFD86j+J9JboG?= =?us-ascii?Q?0TonjYAS558pwS1d9lyFDrnjuXPegEoaHF2+9pRCDwz6q1hHJlWCV82ihk1D?= =?us-ascii?Q?LGI0O9cZ6hWU8X8R371P8KrtGYt+JtfTSe1AvfnO1SceRb8jLvgPBieoHQzN?= =?us-ascii?Q?gj5yQ98Wh6wWq4t60KMPdKVd/PohXJbergBdq5yWPWTUKRGGUN4RY5EC2rGp?= =?us-ascii?Q?DTJJQYHwUbkFbf5VD8elymRbW1m6hJuyfjgjRiNf7jEsfjPBHEDrqwZOh0jY?= =?us-ascii?Q?0oqp3EFK6HED9rdAAUOKXX13KvPVaA05eHZQdLql4gHpBueFdn6BpPslSTc1?= =?us-ascii?Q?YRJrI6ADNScQGD/d/FyF/851XGs+O3qh0XpuSKExtTA4QNaSlplrF7geeeq0?= =?us-ascii?Q?kDSix6UDy0UWlByMr6Xb02mgVXjEcac/PqdXo5SY36rAOyC4gQXGErkgkMps?= =?us-ascii?Q?Jy8N7HYg4KYTiqMuRb+W3o1JDv/XtH3tPnI11zubxYP2ew+EStwkc/D4Xf2/?= =?us-ascii?Q?4jqF7oCDgS94xABdOWkXjYYt6PWx2psW+jCFTs46jVF4wGm+wCaZ34lamth7?= =?us-ascii?Q?eMdTb/Z+u8BN7fbscYIAvzNcA8n+mbfS4iPmmCkI7UJB+/0HWfi+QBjJvWm5?= =?us-ascii?Q?3fH9+oQhhiMrRHwF+R1b/NRHNONPyXn6LELRxT?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB771; 5:EZRpr1IbLZBJW/SEMF6jZgsTpbDLaWCmgSAAl+tAeVEeM11x2eEsly/7N9tAe0vAfJR4LoEtcHelq72qNWQLhux+dPtg2SoXBMWqtxDg7Be7GmMPuos3H1vYICTXg0aVNA6ND3kFDuY3k+qtkXC2Qw==; 24:uk1v2LNa3B+1+P4QgMj2P6qwV1ZA5LnYqIgGCR5pTGTjcyOJKFF6s7erXLDpMOqns7ZdPl1y0ohPLpqIyHtJa+cJLb5DjkGQL2kCqgcVzzQ=; 20:V+/Ntssgj2y4NZoEghFrLBS+pHwEFFSPi/BLTIDMH5wGVfwxMp2d/qsCOObqNRa86/ETsuki1pHogex+vQi1qg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2015 21:28:42.8409 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.17]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB771 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, 02 Sep 2015 21:44:13 -0000 Bryan Drewery wrote: > My concern is that checked in 'local' files should not be changed by > FreeBSD. I should not have to fight conflicts of _my customizations_ > against _FreeBSD customizations (against bmake upstream)_. There is so > much logic in these local.* files, they seem more aptly named > 'freebsd.*' as they seem to be intended to be customizations for > FreeBSD, rather than optional customizations for a developer or other > downstream consumer of FreeBSD. Yes that's true though src.* is what freebsd is using afaik It will take some time - to optimize this, cleanly separating infrastructure from freebsd specifics. It is not unreasonable for some logic to exist in the checked in local.*.mk to serve as examples. FWIW in re-working our internal build to accommodate what is now in FreeBSD, we now have many of the local.*.mk's include a juniper.*.mk to hold our local customizations with minimal risk of conflicts From owner-svn-src-all@freebsd.org Wed Sep 2 21:53:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78AE89C8C38; Wed, 2 Sep 2015 21:53:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5D12114E5; Wed, 2 Sep 2015 21:53:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82LrnOd049646; Wed, 2 Sep 2015 21:53:49 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82LrnOJ049645; Wed, 2 Sep 2015 21:53:49 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509022153.t82LrnOJ049645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 2 Sep 2015 21:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287413 - head/usr.sbin/sysrc 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, 02 Sep 2015 21:53:49 -0000 Author: dteske Date: Wed Sep 2 21:53:48 2015 New Revision: 287413 URL: https://svnweb.freebsd.org/changeset/base/287413 Log: Minor code cleanups (no functional changes). MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Wed Sep 2 21:13:06 2015 (r287412) +++ head/usr.sbin/sysrc/sysrc Wed Sep 2 21:53:48 2015 (r287413) @@ -257,14 +257,14 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag F) SHOW_FILE=1 ;; h) usage ;; # NOTREACHED i) IGNORE_UNKNOWNS=1 ;; - j) [ "$OPTARG" ] || die \ - "%s: Missing or null argument to \`-j' flag" "$pgm" + j) [ "$OPTARG" ] || + die "%s: Missing or null argument to \`-j' flag" "$pgm" JAIL="$OPTARG" ;; n) SHOW_NAME= ;; N) SHOW_VALUE= ;; q) QUIET=1 VERBOSE= ;; - R) [ "$OPTARG" ] || die \ - "%s: Missing or null argument to \`-R' flag" "$pgm" + R) [ "$OPTARG" ] || + die "%s: Missing or null argument to \`-R' flag" "$pgm" ROOTDIR="$OPTARG" ;; v) VERBOSE=1 QUIET= ;; x) DELETE=${DELETE:-1} ;; @@ -384,13 +384,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then # jls(1) or jexec(8) utilities are missing. # if f_have jexec && f_have jls; then - jid="`jls jid path | \ - ( + jid=$( jls jid path | while read JID JROOT; do [ "$JROOT" = "$ROOTDIR" ] || continue echo $JID done - )`" + ) # # If multiple running jails match the specified root @@ -472,8 +471,8 @@ if [ "$SHOW_ALL" ]; then # If passed `-a' (rather than `-A'), re-purge the # environment, removing the rc.conf(5) defaults. # - [ "$SHOW_ALL" = "1" ] \ - && f_clean_env --except rc_conf_files $EXCEPT + [ "$SHOW_ALL" = "1" ] && + f_clean_env --except rc_conf_files $EXCEPT # # If `-f file' was passed, set $rc_conf_files to an @@ -491,8 +490,7 @@ if [ "$SHOW_ALL" ]; then # [ "$SHOW_ALL" = "1" -a \ "$( f_sysrc_find rc_conf_files )" = "$RC_DEFAULTS" \ - ] \ - && unset rc_conf_files + ] && unset rc_conf_files fi for NAME in $( set | @@ -524,7 +522,7 @@ if [ "$SHOW_ALL" ]; then continue fi - [ "$VERBOSE" ] && \ + [ "$VERBOSE" ] && echo -n "$( f_sysrc_find "$NAME" ): " # @@ -560,7 +558,7 @@ while [ $# -gt 0 ]; do *) mode=ASSIGN esac - [ "$DESCRIBE" ] && \ + [ "$DESCRIBE" ] && echo "$NAME: $( f_sysrc_desc "$NAME" )" case "$1" in @@ -573,7 +571,7 @@ while [ $# -gt 0 ]; do # If verbose, prefix line with where the directive lives if [ "$VERBOSE" -a ! "$CHECK_ONLY" ]; then file=$( f_sysrc_find "$NAME" ) - [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \ + [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' ) if [ "$SHOW_EQUALS" ]; then echo -n ": $file; " From owner-svn-src-all@freebsd.org Wed Sep 2 22:48:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B6A69C892A; Wed, 2 Sep 2015 22:48:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.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 42AE81BBF; Wed, 2 Sep 2015 22:48:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82Mmg21071633; Wed, 2 Sep 2015 22:48:42 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82MmgFC071632; Wed, 2 Sep 2015 22:48:42 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201509022248.t82MmgFC071632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 2 Sep 2015 22:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287414 - head/sys/dev/ioat 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, 02 Sep 2015 22:48:42 -0000 Author: cem Date: Wed Sep 2 22:48:41 2015 New Revision: 287414 URL: https://svnweb.freebsd.org/changeset/base/287414 Log: ioat(4): pci_save/restore_state to persist MSI-X registers over BDXDE reset Also for BWD devices, per jimharris@. Reviewed by: jhb Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3552 Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Wed Sep 2 21:53:48 2015 (r287413) +++ head/sys/dev/ioat/ioat.c Wed Sep 2 22:48:41 2015 (r287414) @@ -60,7 +60,7 @@ static int ioat_map_pci_bar(struct ioat_ static void ioat_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); static void ioat_interrupt_handler(void *arg); -static boolean_t ioat_is_bdxde(struct ioat_softc *ioat); +static boolean_t ioat_model_resets_msix(struct ioat_softc *ioat); static void ioat_process_events(struct ioat_softc *ioat); static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); @@ -511,12 +511,18 @@ ioat_setup_intr(struct ioat_softc *ioat) } static boolean_t -ioat_is_bdxde(struct ioat_softc *ioat) +ioat_model_resets_msix(struct ioat_softc *ioat) { u_int32_t pciid; pciid = pci_get_devid(ioat->device); switch (pciid) { + /* BWD: */ + case 0x0c508086: + case 0x0c518086: + case 0x0c528086: + case 0x0c538086: + /* BDXDE: */ case 0x6f508086: case 0x6f518086: case 0x6f528086: @@ -947,7 +953,7 @@ ioat_reset_hw(struct ioat_softc *ioat) { uint64_t status; uint32_t chanerr; - int timeout, error; + int timeout; status = ioat_get_chansts(ioat); if (is_ioat_active(status) || is_ioat_idle(status)) @@ -974,6 +980,13 @@ ioat_reset_hw(struct ioat_softc *ioat) chanerr = pci_read_config(ioat->device, IOAT_CFG_CHANERR_INT_OFFSET, 4); pci_write_config(ioat->device, IOAT_CFG_CHANERR_INT_OFFSET, chanerr, 4); + /* + * BDXDE and BWD models reset MSI-X registers on device reset. + * Save/restore their contents manually. + */ + if (ioat_model_resets_msix(ioat)) + pci_save_state(ioat->device); + ioat_reset(ioat); /* Wait at most 20 ms */ @@ -982,19 +995,8 @@ ioat_reset_hw(struct ioat_softc *ioat) if (timeout == 20) return (ETIMEDOUT); - /* - * BDXDE models reset MSI-X registers on device reset. We must - * teardown and re-setup interrupts. - */ - if (ioat_is_bdxde(ioat)) { - error = ioat_teardown_intr(ioat); - if (error) - return (error); - - error = ioat_setup_intr(ioat); - if (error) - return (error); - } + if (ioat_model_resets_msix(ioat)) + pci_restore_state(ioat->device); return (0); } From owner-svn-src-all@freebsd.org Wed Sep 2 23:09:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B3BE9C9347; Wed, 2 Sep 2015 23:09:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6C562B9D; Wed, 2 Sep 2015 23:09:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82N92bw080287; Wed, 2 Sep 2015 23:09:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82N92Op080286; Wed, 2 Sep 2015 23:09:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201509022309.t82N92Op080286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 2 Sep 2015 23:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287415 - 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.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, 02 Sep 2015 23:09:02 -0000 Author: mjg Date: Wed Sep 2 23:09:01 2015 New Revision: 287415 URL: https://svnweb.freebsd.org/changeset/base/287415 Log: Don't trash memory from UMA_ZONE_NOFREE zones. Objects obtained from such zones are supposed to retain type stability, which was violated by aforementioned trashing. This is a follow-up to r284861. Discussed with: kib Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Sep 2 22:48:41 2015 (r287414) +++ head/sys/vm/uma_core.c Wed Sep 2 23:09:01 2015 (r287415) @@ -1946,8 +1946,8 @@ uma_zcreate(const char *name, size_t siz * destructor, pass UMA constructor/destructor which checks for * memory use after free. */ - if ((!(flags & UMA_ZONE_ZINIT)) && ctor == NULL && dtor == NULL && - uminit == NULL && fini == NULL) { + if ((!(flags & (UMA_ZONE_ZINIT | UMA_ZONE_NOFREE))) && + ctor == NULL && dtor == NULL && uminit == NULL && fini == NULL) { args.ctor = trash_ctor; args.dtor = trash_dtor; args.uminit = trash_init; From owner-svn-src-all@freebsd.org Wed Sep 2 23:14:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B420A9C9736; Wed, 2 Sep 2015 23:14:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.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 A53C323E; Wed, 2 Sep 2015 23:14:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82NEe7F084491; Wed, 2 Sep 2015 23:14:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82NEe7f084490; Wed, 2 Sep 2015 23:14:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201509022314.t82NEe7f084490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 2 Sep 2015 23:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287416 - 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, 02 Sep 2015 23:14:40 -0000 Author: mjg Date: Wed Sep 2 23:14:39 2015 New Revision: 287416 URL: https://svnweb.freebsd.org/changeset/base/287416 Log: fd: remove UMA_ZONE_ZINIT argument from Files zone Originally it was added in order to prevent trashing of objects with INVARIANTS enabled. The same effect is now provided with mere UMA_ZONE_NOFREE. This reverts r286921. Discussed with: kib Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Sep 2 23:09:01 2015 (r287415) +++ head/sys/kern/kern_descrip.c Wed Sep 2 23:14:39 2015 (r287416) @@ -3833,7 +3833,7 @@ filelistinit(void *dummy) { file_zone = uma_zcreate("Files", sizeof(struct file), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_ZINIT); + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); filedesc0_zone = uma_zcreate("filedesc0", sizeof(struct filedesc0), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&sigio_lock, "sigio lock", NULL, MTX_DEF); From owner-svn-src-all@freebsd.org Thu Sep 3 01:15:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0A089C96BD; Thu, 3 Sep 2015 01:15:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C1BACA2E; Thu, 3 Sep 2015 01:15:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t831FOeB037183; Thu, 3 Sep 2015 01:15:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t831FOmG037182; Thu, 3 Sep 2015 01:15:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509030115.t831FOmG037182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 3 Sep 2015 01:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287417 - head/usr.sbin/makefs 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, 03 Sep 2015 01:15:24 -0000 Author: delphij Date: Thu Sep 3 01:15:23 2015 New Revision: 287417 URL: https://svnweb.freebsd.org/changeset/base/287417 Log: Don't leak 'var'. Reported by: clang static analyzer Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Wed Sep 2 23:14:39 2015 (r287416) +++ head/usr.sbin/makefs/mtree.c Thu Sep 3 01:15:23 2015 (r287417) @@ -181,7 +181,7 @@ static char * mtree_resolve(const char *spec, int *istemp) { struct sbuf *sb; - char *res, *var; + char *res, *var = NULL; const char *base, *p, *v; size_t len; int c, error, quoted, subst; @@ -284,8 +284,10 @@ mtree_resolve(const char *spec, int *ist free(res); } free(var); + var = NULL; } + free(var); sbuf_finish(sb); res = (error == 0) ? strdup(sbuf_data(sb)) : NULL; sbuf_delete(sb); From owner-svn-src-all@freebsd.org Thu Sep 3 01:38:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48DD69C8185; Thu, 3 Sep 2015 01:38:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3971C1302; Thu, 3 Sep 2015 01:38:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t831cGBY046277; Thu, 3 Sep 2015 01:38:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t831cFox046275; Thu, 3 Sep 2015 01:38:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201509030138.t831cFox046275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 3 Sep 2015 01:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287418 - in head/sys/powerpc: include powerpc 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, 03 Sep 2015 01:38:16 -0000 Author: jhibbits Date: Thu Sep 3 01:38:15 2015 New Revision: 287418 URL: https://svnweb.freebsd.org/changeset/base/287418 Log: pmap_mapdev_attr() also takes a vm_paddr_t. This was missed in r235936. With recent work for 36-bit paddr, this is now needed. Modified: head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu Sep 3 01:15:23 2015 (r287417) +++ head/sys/powerpc/include/pmap.h Thu Sep 3 01:38:15 2015 (r287418) @@ -235,7 +235,7 @@ void pmap_kenter(vm_offset_t va, vm_pad void pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t); void pmap_kremove(vm_offset_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); -void *pmap_mapdev_attr(vm_offset_t, vm_size_t, vm_memattr_t); +void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); void pmap_deactivate(struct thread *); Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Thu Sep 3 01:15:23 2015 (r287417) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Thu Sep 3 01:38:15 2015 (r287418) @@ -463,7 +463,7 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t siz } void * -pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t attr) +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t attr) { CTR4(KTR_PMAP, "%s(%#x, %#x, %#x)", __func__, pa, size, attr); From owner-svn-src-all@freebsd.org Thu Sep 3 02:28:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBAC29C999A; Thu, 3 Sep 2015 02:28:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.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 DC7DAA19; Thu, 3 Sep 2015 02:28:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t832SIuR068421; Thu, 3 Sep 2015 02:28:18 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t832SIKZ068420; Thu, 3 Sep 2015 02:28:18 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201509030228.t832SIKZ068420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 3 Sep 2015 02:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287419 - head/sys/boot/fdt/dts/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: Thu, 03 Sep 2015 02:28:19 -0000 Author: gonzo Date: Thu Sep 3 02:28:18 2015 New Revision: 287419 URL: https://svnweb.freebsd.org/changeset/base/287419 Log: Enable both i2c1 and i2c2. These devices are disabled in TI's DTS so they were disabled during DTS transition. Though there are no standard devices/drivers on them people might use iic(4) userland interface to access these buses. Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Thu Sep 3 01:38:15 2015 (r287418) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Thu Sep 3 02:28:18 2015 (r287419) @@ -30,6 +30,22 @@ #include "am335x-boneblack.dts" #include "beaglebone-common.dtsi" +&am33xx_pinmux { + i2c1_pins: pinmux_i2c1_pins { + pinctrl-single,pins = < + 0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */ + 0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ + >; + }; + + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + 0x178 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ + 0x17c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ + >; + }; +}; + &i2c0 { tda998x: hdmi-encoder { compatible = "nxp,tda998x"; @@ -42,6 +58,20 @@ }; }; +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; +}; + &lcdc { hdmi = <&tda998x>; }; From owner-svn-src-all@freebsd.org Thu Sep 3 03:29:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336239C799E; Thu, 3 Sep 2015 03:29:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 247A19E6; Thu, 3 Sep 2015 03:29:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t833TjsQ095595; Thu, 3 Sep 2015 03:29:45 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t833Tjxd095594; Thu, 3 Sep 2015 03:29:45 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509030329.t833Tjxd095594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 3 Sep 2015 03:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287420 - head/usr.sbin/sysrc 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, 03 Sep 2015 03:29:45 -0000 Author: dteske Date: Thu Sep 3 03:29:44 2015 New Revision: 287420 URL: https://svnweb.freebsd.org/changeset/base/287420 Log: Remove non-functional examples. MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Thu Sep 3 02:28:18 2015 (r287419) +++ head/usr.sbin/sysrc/sysrc.8 Thu Sep 3 03:29:44 2015 (r287420) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 4, 2015 +.Dd September 2, 2015 .Dt SYSRC 8 .Os .Sh NAME @@ -394,27 +394,6 @@ usbd_flags-"default" .Nm cloned_interfaces+"alternate" .Dl returns "alternate" if $cloned_interfaces is set . -.Pp -.Nm -\&'#kern_securelevel' -.Dl returns length in characters of $kern_securelevel . -.Pp -.Nm -\&'hostname?' -.Dl returns NULL and error status 2 if $hostname is unset Pq or if set, returns the value of $hostname with no error status . -.Pp -.Nm -\&'hostname:?' -.Dl returns NULL and error status 2 if $hostname is unset or NULL Pq or if set and non-NULL, returns value without error status . -.Sh LIMITATIONS -The -.Nm -utility presently does not support the -.Ql rc.conf.d -collection of system configuration files -.Pq which requires a service name to be known during execution . -.Pp -This will be corrected by a future enhancement. .Sh SEE ALSO .Xr jls 1 , .Xr rc.conf 5 , From owner-svn-src-all@freebsd.org Thu Sep 3 03:59:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA8829C974D; Thu, 3 Sep 2015 03:59:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.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 919948EC; Thu, 3 Sep 2015 03:59:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t833x0Bs009048; Thu, 3 Sep 2015 03:59:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t833x0R4009047; Thu, 3 Sep 2015 03:59:00 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509030359.t833x0R4009047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 3 Sep 2015 03:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287421 - head/usr.sbin/sysrc 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, 03 Sep 2015 03:59:00 -0000 Author: dteske Date: Thu Sep 3 03:58:59 2015 New Revision: 287421 URL: https://svnweb.freebsd.org/changeset/base/287421 Log: Fix mandoc(1) "WARNING: end of line whitespace" MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Thu Sep 3 03:29:44 2015 (r287420) +++ head/usr.sbin/sysrc/sysrc.8 Thu Sep 3 03:58:59 2015 (r287421) @@ -199,8 +199,8 @@ syntax to add items to existing values, the first character of the value is taken as the delimiter separating items .Pq usually Qo \ Qc or Qo , Qc . For example, in the following statement: -.Bl -tag -width indent+ -.It \ +.Bl -item -offset indent +.It .Nm cloned_interfaces+=" gif0" .El @@ -223,25 +223,25 @@ For example, the above and below stateme .Dq gif0 starts with an alpha-numeric character .Pq the letter Li g : -.Bl -tag -width indent+ -.It \ +.Bl -item -offset indent +.It .Nm cloned_interfaces+=gif0 .El .Pp Take the following sequence for example: -.Bl -tag -width indent+ -.It \ +.Bl -item -offset indent +.It .Nm cloned_interfaces= # start with NULL -.It \ +.It .Nm cloned_interfaces+=gif0 .Dl # NULL -> `gif0' Pq NB: no preceding delimiter -.It \ +.It .Nm cloned_interfaces+=gif0 # no change -.It \ +.It .Nm cloned_interfaces+="tun0 gif0" .Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication @@ -277,21 +277,21 @@ For example, the above and below stateme .Dq gif0 starts with an alpha-numeric character .Pq the letter Li g : -.Bl -tag -width indent+ -.It \ +.Bl -item -offset indent +.It .Nm cloned_interfaces-=gif0 .El .Pp Take the following sequence for example: -.Bl -tag -width indent+ -.It \ +.Bl -item -offset indent +.It .Nm foo="bar baz" # start -.It \ +.It .Nm foo-=bar # `bar baz' -> `baz' -.It \ +.It .Nm foo-=baz # `baz' -> NULL .El From owner-svn-src-all@freebsd.org Thu Sep 3 04:35:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E22A39C87D0; Thu, 3 Sep 2015 04:35:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C3A8F186A; Thu, 3 Sep 2015 04:35:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t834ZIpv026262; Thu, 3 Sep 2015 04:35:18 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t834ZI7i026261; Thu, 3 Sep 2015 04:35:18 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201509030435.t834ZI7i026261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 3 Sep 2015 04:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287422 - head/sys/boot/efi/loader/arch/amd64 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, 03 Sep 2015 04:35:19 -0000 Author: marcel Date: Thu Sep 3 04:35:17 2015 New Revision: 287422 URL: https://svnweb.freebsd.org/changeset/base/287422 Log: For UGA, the frame buffer address obtained by scanning the PCI BARs does not necessarily correspond to the upper-left most pixel. Scan the frame buffer for which byte changed when changing the pixel at (0,0). Use the same technique to determine the stride. Except for changing the pixel at (0,0), we change the pixel at (0,1). PR: 202730 Tested by: hartzell (at) alerce.com Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Thu Sep 3 03:58:59 2015 (r287421) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Thu Sep 3 04:35:17 2015 (r287422) @@ -43,6 +43,21 @@ static EFI_GUID gop_guid = EFI_GRAPHICS_ static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; +static u_int +efifb_color_depth(struct efi_fb *efifb) +{ + uint32_t mask; + u_int depth; + + mask = efifb->fb_mask_red | efifb->fb_mask_green | + efifb->fb_mask_blue | efifb->fb_mask_reserved; + if (mask == 0) + return (0); + for (depth = 1; mask != 1; depth++) + mask >>= 1; + return (depth); +} + static int efifb_mask_from_pixfmt(struct efi_fb *efifb, EFI_GRAPHICS_PIXEL_FORMAT pixfmt, EFI_PIXEL_BITMASK *pixinfo) @@ -92,83 +107,198 @@ efifb_from_gop(struct efi_fb *efifb, EFI return (result); } -static int -efifb_from_uga(struct efi_fb *efifb, EFI_UGA_DRAW_PROTOCOL *uga) +static ssize_t +efifb_uga_find_pixel(EFI_UGA_DRAW_PROTOCOL *uga, u_int line, + EFI_PCI_IO_PROTOCOL *pciio, uint64_t addr, uint64_t size) +{ + EFI_UGA_PIXEL pix0, pix1; + uint8_t *data1, *data2; + size_t count, maxcount = 1024; + ssize_t ofs; + EFI_STATUS status; + u_int idx; + + status = uga->Blt(uga, &pix0, EfiUgaVideoToBltBuffer, + 0, line, 0, 0, 1, 1, 0); + if (EFI_ERROR(status)) { + printf("UGA BLT operation failed (video->buffer)"); + return (-1); + } + pix1.Red = ~pix0.Red; + pix1.Green = ~pix0.Green; + pix1.Blue = ~pix0.Blue; + pix1.Reserved = 0; + + data1 = calloc(maxcount, 2); + if (data1 == NULL) { + printf("Unable to allocate memory"); + return (-1); + } + data2 = data1 + maxcount; + + ofs = 0; + while (size > 0) { + count = min(size, maxcount); + + status = pciio->Mem.Read(pciio, EfiPciIoWidthUint32, + EFI_PCI_IO_PASS_THROUGH_BAR, addr + ofs, count >> 2, + data1); + if (EFI_ERROR(status)) { + printf("Error reading frame buffer (before)"); + goto fail; + } + status = uga->Blt(uga, &pix1, EfiUgaBltBufferToVideo, + 0, 0, 0, line, 1, 1, 0); + if (EFI_ERROR(status)) { + printf("UGA BLT operation failed (modify)"); + goto fail; + } + status = pciio->Mem.Read(pciio, EfiPciIoWidthUint32, + EFI_PCI_IO_PASS_THROUGH_BAR, addr + ofs, count >> 2, + data2); + if (EFI_ERROR(status)) { + printf("Error reading frame buffer (after)"); + goto fail; + } + status = uga->Blt(uga, &pix0, EfiUgaBltBufferToVideo, + 0, 0, 0, line, 1, 1, 0); + if (EFI_ERROR(status)) { + printf("UGA BLT operation failed (restore)"); + goto fail; + } + for (idx = 0; idx < count; idx++) { + if (data1[idx] != data2[idx]) { + free(data1); + return (ofs + (idx & ~3)); + } + } + ofs += count; + size -= count; + } + printf("Couldn't find the pixel"); + + fail: + printf(" -- error %lu\n", status & ~EFI_ERROR_MASK); + free(data1); + return (-1); +} + +static EFI_STATUS +efifb_uga_detect_framebuffer(EFI_UGA_DRAW_PROTOCOL *uga, + EFI_PCI_IO_PROTOCOL **pciiop, uint64_t *addrp, uint64_t *sizep) { - uint8_t *buf; EFI_PCI_IO_PROTOCOL *pciio; - EFI_HANDLE handle; + EFI_HANDLE *buf, *hp; + uint8_t *resattr; + uint64_t a, addr, s, size; + ssize_t ofs; EFI_STATUS status; - UINTN bufofs, bufsz; - uint64_t address, length; - uint32_t horiz, vert, depth, refresh; + UINTN bufsz; u_int bar; - status = uga->GetMode(uga, &horiz, &vert, &depth, &refresh); - if (EFI_ERROR(status)) - return (1); - efifb->fb_height = vert; - efifb->fb_width = horiz; - efifb_mask_from_pixfmt(efifb, PixelBlueGreenRedReserved8BitPerColor, - NULL); - /* Find all handles that support the UGA protocol. */ + /* Get all handles that support the UGA protocol. */ bufsz = 0; status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, NULL); if (status != EFI_BUFFER_TOO_SMALL) - return (1); + return (status); buf = malloc(bufsz); - status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, - (EFI_HANDLE *)buf); + status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, buf); if (status != EFI_SUCCESS) { free(buf); - return (1); + return (status); } + bufsz /= sizeof(EFI_HANDLE); + /* Get the PCI I/O interface of the first handle that supports it. */ pciio = NULL; - for (bufofs = 0; bufofs < bufsz; bufofs += sizeof(EFI_HANDLE)) { - handle = *(EFI_HANDLE *)(buf + bufofs); - status = BS->HandleProtocol(handle, &pciio_guid, - (void **)&pciio); + for (hp = buf; hp < buf + bufsz; hp++) { + status = BS->HandleProtocol(*hp, &pciio_guid, (void **)&pciio); if (status == EFI_SUCCESS) break; } free(buf); - if (pciio == NULL) - return (1); + if (status != EFI_SUCCESS || pciio == NULL) + return (EFI_NOT_FOUND); + /* Attempt to get the frame buffer address (imprecise). */ - efifb->fb_addr = 0; - efifb->fb_size = 0; + addr = 0; + size = 0; for (bar = 0; bar < 6; bar++) { status = pciio->GetBarAttributes(pciio, bar, NULL, - (EFI_HANDLE *)&buf); + (void **)&resattr); if (status != EFI_SUCCESS) continue; /* XXX magic offsets and constants. */ - if (buf[0] == 0x87 && buf[3] == 0) { + if (resattr[0] == 0x87 && resattr[3] == 0) { /* 32-bit address space descriptor (MEMIO) */ - address = le32dec(buf + 10); - length = le32dec(buf + 22); - } else if (buf[0] == 0x8a && buf[3] == 0) { + a = le32dec(resattr + 10); + s = le32dec(resattr + 22); + } else if (resattr[0] == 0x8a && resattr[3] == 0) { /* 64-bit address space descriptor (MEMIO) */ - address = le64dec(buf + 14); - length = le64dec(buf + 38); + a = le64dec(resattr + 14); + s = le64dec(resattr + 38); } else { - address = 0; - length = 0; + a = 0; + s = 0; } - BS->FreePool(buf); - if (address == 0 || length == 0) + BS->FreePool(resattr); + if (a == 0 || s == 0) continue; + /* We assume the largest BAR is the frame buffer. */ - if (length > efifb->fb_size) { - efifb->fb_addr = address; - efifb->fb_size = length; + if (s > size) { + addr = a; + size = s; } } - if (efifb->fb_addr == 0 || efifb->fb_size == 0) + if (addr == 0 || size == 0) + return (EFI_DEVICE_ERROR); + + /* + * The visible part of the frame buffer may not start at offset + * 0, so try to detect it. + */ + ofs = efifb_uga_find_pixel(uga, 0, pciio, addr, size); + if (ofs == -1) + return (EFI_NO_RESPONSE); + + addr += ofs; + size -= ofs; + + *pciiop = pciio; + *addrp = addr; + *sizep = size; + return (0); +} + +static int +efifb_from_uga(struct efi_fb *efifb, EFI_UGA_DRAW_PROTOCOL *uga) +{ + EFI_PCI_IO_PROTOCOL *pciio; + EFI_STATUS status; + ssize_t ofs; + uint32_t horiz, vert, depth, refresh; + + status = uga->GetMode(uga, &horiz, &vert, &depth, &refresh); + if (EFI_ERROR(status)) + return (1); + efifb->fb_height = vert; + efifb->fb_width = horiz; + efifb_mask_from_pixfmt(efifb, PixelBlueGreenRedReserved8BitPerColor, + NULL); + + /* Try and find the frame buffer. */ + status = efifb_uga_detect_framebuffer(uga, &pciio, &efifb->fb_addr, + &efifb->fb_size); + if (EFI_ERROR(status)) + return (1); + + /* Try and detect the stride. */ + ofs = efifb_uga_find_pixel(uga, 1, pciio, efifb->fb_addr, + efifb->fb_size); + if (ofs == -1) return (1); - /* TODO determine the stride. */ - efifb->fb_stride = efifb->fb_width; /* XXX */ + efifb->fb_stride = ofs >> 2; return (0); } @@ -193,18 +323,11 @@ efi_find_framebuffer(struct efi_fb *efif static void print_efifb(int mode, struct efi_fb *efifb, int verbose) { - uint32_t mask; u_int depth; if (mode >= 0) printf("mode %d: ", mode); - mask = efifb->fb_mask_red | efifb->fb_mask_green | - efifb->fb_mask_blue | efifb->fb_mask_reserved; - if (mask > 0) { - for (depth = 1; mask != 1; depth++) - mask >>= 1; - } else - depth = 0; + depth = efifb_color_depth(efifb); printf("%ux%ux%u, stride=%u", efifb->fb_width, efifb->fb_height, depth, efifb->fb_stride); if (verbose) { From owner-svn-src-all@freebsd.org Thu Sep 3 06:53:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5FD9C7A0C; Thu, 3 Sep 2015 06:53:18 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.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 F039611A4; Thu, 3 Sep 2015 06:53:17 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t836rHaN088433; Thu, 3 Sep 2015 06:53:17 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t836rHRA088432; Thu, 3 Sep 2015 06:53:17 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201509030653.t836rHRA088432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 3 Sep 2015 06:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287423 - head/sys/dev/virtio/network 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, 03 Sep 2015 06:53:18 -0000 Author: araujo Date: Thu Sep 3 06:53:17 2015 New Revision: 287423 URL: https://svnweb.freebsd.org/changeset/base/287423 Log: Lower the compiler warning: unused-but-set-variable. Approved by: bapt (mentor) Differential Revision: D3556 Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Sep 3 04:35:17 2015 (r287422) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Sep 3 06:53:17 2015 (r287423) @@ -1642,14 +1642,12 @@ static int vtnet_rxq_merged_eof(struct vtnet_rxq *rxq, struct mbuf *m_head, int nbufs) { struct vtnet_softc *sc; - struct ifnet *ifp; struct virtqueue *vq; struct mbuf *m, *m_tail; int len; sc = rxq->vtnrx_sc; vq = rxq->vtnrx_vq; - ifp = sc->vtnet_ifp; m_tail = m_head; while (--nbufs > 0) { @@ -3645,10 +3643,8 @@ vtnet_set_rx_process_limit(struct vtnet_ static void vtnet_set_tx_intr_threshold(struct vtnet_softc *sc) { - device_t dev; int size, thresh; - dev = sc->vtnet_dev; size = virtqueue_size(sc->vtnet_txqs[0].vtntx_vq); /* From owner-svn-src-all@freebsd.org Thu Sep 3 07:12:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B839A9C916B; Thu, 3 Sep 2015 07:12:41 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9C6191B25; Thu, 3 Sep 2015 07:12:41 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t837CfLw097510; Thu, 3 Sep 2015 07:12:41 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t837Cfeb097507; Thu, 3 Sep 2015 07:12:41 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201509030712.t837Cfeb097507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 3 Sep 2015 07:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287424 - head/usr.sbin/yppoll 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, 03 Sep 2015 07:12:41 -0000 Author: araujo Date: Thu Sep 3 07:12:40 2015 New Revision: 287424 URL: https://svnweb.freebsd.org/changeset/base/287424 Log: Sync with the latest code from OpenBSD. Approved by: rodrigc (mentor) Differential Revision: D3550 Modified: head/usr.sbin/yppoll/yppoll.8 head/usr.sbin/yppoll/yppoll.c Modified: head/usr.sbin/yppoll/yppoll.8 ============================================================================== --- head/usr.sbin/yppoll/yppoll.8 Thu Sep 3 06:53:17 2015 (r287423) +++ head/usr.sbin/yppoll/yppoll.8 Thu Sep 3 07:12:40 2015 (r287424) @@ -1,3 +1,6 @@ +.\" $OpenBSD: yppoll.8,v 1.10 2014/09/08 01:27:56 schwarze Exp $ +.\" $NetBSD: yppoll.8,v 1.3 1996/02/28 01:23:12 thorpej Exp $ +.\" .\" Copyright (c) 1996 The NetBSD Foundation, Inc. .\" All rights reserved. .\" @@ -16,52 +19,49 @@ .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" 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. -.\" .\" $FreeBSD$ .\" -.Dd May 31, 2015 +.Dd September 3, 2015 .Dt YPPOLL 8 .Os .Sh NAME .Nm yppoll -.Nd ask version of YP map from YP server +.Nd ask version of NIS map from NIS server .Sh SYNOPSIS -.Nm -.\".Op Fl h Ar host +.Nm yppoll .Op Fl d Ar domain +.Op Fl h Ar host .Ar mapname .Sh DESCRIPTION -The .Nm -utility -asks a YP server process for the order number and which host is the master +asks a NIS server process for the order number and which host is the master server for .Ar mapname . .Pp The options are as follows: -.Bl -tag -width indent -.\".It Fl h Ar host -.\"Ask the YP server process running on -.\".Ar host -.\"for information about -.\".Ar mapname . -.\"If -.\".Ar host -.\"is not specified, the server polled is the default server returned by -.\".Xr ypwhich 1 . +.Bl -tag -width Ds .It Fl d Ar domain -Use the YP domain +Use the NIS domain .Ar domain instead of the default domain as returned by .Xr domainname 1 . +.It Fl h Ar host +Ask the NIS server process running on +.Ar host +for information about +.Ar mapname . +If +.Ar host +is not specified, the server polled is the default server returned by +.Xr ypwhich 1 . .El .Sh SEE ALSO .Xr domainname 1 , @@ -72,6 +72,7 @@ instead of the default domain as returne .Xr ypbind 8 , .Xr ypset 8 .Sh AUTHORS -.An Theo De Raadt +.An -nosplit +.An Theo de Raadt and .An John Brezak Modified: head/usr.sbin/yppoll/yppoll.c ============================================================================== --- head/usr.sbin/yppoll/yppoll.c Thu Sep 3 06:53:17 2015 (r287423) +++ head/usr.sbin/yppoll/yppoll.c Thu Sep 3 07:12:40 2015 (r287424) @@ -1,6 +1,9 @@ +/* $OpenBSD: yppoll.c,v 1.15 2015/01/16 06:40:22 deraadt Exp $ */ +/* $NetBSD: yppoll.c,v 1.5 1996/05/13 02:46:36 thorpej Exp $ */ + /* - * Copyright (c) 1992/3 Theo de Raadt - * Copyright (c) 1992/3 John Brezak + * Copyright (c) 1992, 1993 Theo de Raadt + * Copyright (c) 1992, 1993 John Brezak * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +37,17 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include + +#include #include +#include #include #include +#include #include -#include #include #include @@ -49,59 +58,116 @@ __FBSDID("$FreeBSD$"); static void usage(void) { -#if 0 - fprintf(stderr, "usage: yppoll [-h host] [-d domainname] mapname\n"); -#else - fprintf(stderr, "usage: yppoll [-d domainname] mapname\n"); -#endif + fprintf(stderr, "usage: yppoll [-d domain] [-h host] mapname\n"); exit(1); } +static int +get_remote_info(char *indomain, char *inmap, char *server, int *outorder, + char **outname) +{ + struct ypresp_order ypro; + struct ypresp_master yprm; + struct ypreq_nokey yprnk; + struct timeval tv; + struct sockaddr_in rsrv_sin; + int rsrv_sock; + CLIENT *client; + struct hostent *h; + int r; + + bzero((char *)&rsrv_sin, sizeof rsrv_sin); + rsrv_sin.sin_len = sizeof rsrv_sin; + rsrv_sin.sin_family = AF_INET; + rsrv_sock = RPC_ANYSOCK; + + h = gethostbyname(server); + if (h == NULL) { + if (inet_aton(server, &rsrv_sin.sin_addr) == 0) + errx(1, "unknown host %s.", server); + } else + rsrv_sin.sin_addr.s_addr = *(u_int32_t *)h->h_addr; + + tv.tv_sec = 10; + tv.tv_usec = 0; + + client = clntudp_create(&rsrv_sin, YPPROG, YPVERS, tv, &rsrv_sock); + if (client == NULL) + errx(1, "clntudp_create: no contact with host %s.", server); + + yprnk.domain = indomain; + yprnk.map = inmap; + + bzero((char *)(char *)&ypro, sizeof ypro); + + r = clnt_call(client, YPPROC_ORDER, (xdrproc_t)xdr_ypreq_nokey, &yprnk, + (xdrproc_t)xdr_ypresp_order, &ypro, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_order: clnt_call"); + + *outorder = ypro.ordernum; + xdr_free((xdrproc_t)xdr_ypresp_order, (char *)&ypro); + + r = ypprot_err(ypro.status); + if (r == RPC_SUCCESS) { + bzero((char *)&yprm, sizeof yprm); + + r = clnt_call(client, YPPROC_MASTER, (xdrproc_t)xdr_ypreq_nokey, + &yprnk, (xdrproc_t)xdr_ypresp_master, &yprm, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_master: clnt_call"); + r = ypprot_err(yprm.status); + if (r == 0) + *outname = (char *)strdup(yprm.master); + xdr_free((xdrproc_t)xdr_ypresp_master, (char *)&yprm); + } + clnt_destroy(client); + return (r); +} + int main(int argc, char *argv[]) { - char *domainname; -#if 0 - char *hostname = "localhost"; -#endif - char *inmap, *master; - int order; - int c, r; - time_t t; + char *domainname, *hostname = NULL, *inmap, *master; + int order, c, r; + time_t torder; - yp_get_default_domain(&domainname); + yp_get_default_domain(&domainname); while ((c = getopt(argc, argv, "h:d:")) != -1) switch (c) { case 'd': - domainname = optarg; + domainname = optarg; break; - case 'h': -#if 0 - hostname = optarg; -#else - /* does nothing */ -#endif - break; - case '?': - usage(); - /*NOTREACHED*/ + case 'h': + hostname = optarg; + break; + default: + usage(); + /*NOTREACHED*/ } if (optind + 1 != argc) usage(); - inmap = argv[optind]; - r = yp_order(domainname, inmap, &order); - if (r != 0) - errx(1, "no such map %s. Reason: %s", inmap, yperr_string(r)); - t = _int_to_time(order); - printf("Map %s has order number %d. %s", inmap, order, ctime(&t)); - r = yp_master(domainname, inmap, &master); - if (r != 0) - errx(1, "no such map %s. Reason: %s", inmap, yperr_string(r)); - printf("The master server is %s.\n", master); + if (hostname != NULL) { + r = get_remote_info(domainname, inmap, hostname, + &order, &master); + } else { + r = yp_order(domainname, inmap, &order); + if (r == 0) + r = yp_master(domainname, inmap, &master); + } + + if (r != 0) + errx(1, "no such map %s: reason: %s", + inmap, yperr_string(r)); + + torder = order; + printf("Map %s has order number %lld. %s", inmap, + (long long)order, ctime(&torder)); + printf("The master server is %s.\n", master); - exit(0); + exit(0); } From owner-svn-src-all@freebsd.org Thu Sep 3 07:18:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8206A9C933C; Thu, 3 Sep 2015 07:18:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.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 662711D64; Thu, 3 Sep 2015 07:18:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t837IsCT098083; Thu, 3 Sep 2015 07:18:54 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t837IrNR098079; Thu, 3 Sep 2015 07:18:53 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201509030718.t837IrNR098079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 3 Sep 2015 07:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287425 - in head: usr.bin/ypcat usr.bin/ypmatch usr.bin/ypwhich usr.sbin/ypset 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, 03 Sep 2015 07:18:54 -0000 Author: araujo Date: Thu Sep 3 07:18:52 2015 New Revision: 287425 URL: https://svnweb.freebsd.org/changeset/base/287425 Log: Rename YP to NIS in the manpages. Approved by: bapt (mentor) Differential Revision: D3555 Modified: head/usr.bin/ypcat/ypcat.1 head/usr.bin/ypmatch/ypmatch.1 head/usr.bin/ypwhich/ypwhich.1 head/usr.sbin/ypset/ypset.8 Modified: head/usr.bin/ypcat/ypcat.1 ============================================================================== --- head/usr.bin/ypcat/ypcat.1 Thu Sep 3 07:12:40 2015 (r287424) +++ head/usr.bin/ypcat/ypcat.1 Thu Sep 3 07:18:52 2015 (r287425) @@ -28,12 +28,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 1993 +.Dd September 3, 2015 .Dt YPCAT 1 .Os .Sh NAME .Nm ypcat -.Nd "print the values of all keys in a YP database" +.Nd print the values of all keys in a NIS database .Sh SYNOPSIS .Nm .Op Fl kt @@ -45,7 +45,7 @@ The .Nm utility prints out the values of all keys from the -.Tn YP +.Tn NIS database specified by .Ar mapname , which may be a map name or a map nickname. Modified: head/usr.bin/ypmatch/ypmatch.1 ============================================================================== --- head/usr.bin/ypmatch/ypmatch.1 Thu Sep 3 07:12:40 2015 (r287424) +++ head/usr.bin/ypmatch/ypmatch.1 Thu Sep 3 07:18:52 2015 (r287425) @@ -28,12 +28,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 1993 +.Dd September 3, 2015 .Dt YPMATCH 1 .Os .Sh NAME .Nm ypmatch -.Nd "print the values of one or more keys in a YP database" +.Nd print the values of one or more keys in a NIS database .Sh SYNOPSIS .Nm .Op Fl kt @@ -46,7 +46,7 @@ The .Nm utility prints out the values of one or more keys from the -.Tn YP +.Tn NIS database specified by .Ar mapname , which may be a map name or a map nickname. Modified: head/usr.bin/ypwhich/ypwhich.1 ============================================================================== --- head/usr.bin/ypwhich/ypwhich.1 Thu Sep 3 07:12:40 2015 (r287424) +++ head/usr.bin/ypwhich/ypwhich.1 Thu Sep 3 07:18:52 2015 (r287425) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 1994 +.Dd September 3, 2015 .Dt YPWHICH 1 .Os .Sh NAME .Nm ypwhich -.Nd return hostname of YP server of map master +.Nd return hostname of NIS server of map master .Sh SYNOPSIS .Nm .Op Fl d Ar domain @@ -49,18 +49,18 @@ The .Nm utility tells which -.Tn YP +.Tn NIS server supplies -.Tn YP +.Tn NIS services to a client, or which is the master for a map. If invoked without arguments, it gives the -.Tn YP +.Tn NIS server for the local machine. If .Ar host is specified, that machine is queried to find out which -.Tn YP +.Tn NIS server it is using. .Pp The options are as follows: @@ -72,7 +72,7 @@ Inhibit translation of map nicknames to their corresponding map names. .It Fl m Op Ar mname Find the master -.Tn YP +.Tn NIS server for the named map. No .Ar host Modified: head/usr.sbin/ypset/ypset.8 ============================================================================== --- head/usr.sbin/ypset/ypset.8 Thu Sep 3 07:12:40 2015 (r287424) +++ head/usr.sbin/ypset/ypset.8 Thu Sep 3 07:18:52 2015 (r287425) @@ -31,14 +31,14 @@ .\" .\" $FreeBSD$ .\" -.Dd August 04, 2015 +.Dd September 3, 2015 .Dt YPSET 8 .Os .Sh NAME .Nm ypset .Nd tell .Xr ypbind 8 -which YP server process to use +which NIS server process to use .Sh SYNOPSIS .Nm .Op Fl h Ar host @@ -49,32 +49,32 @@ The .Nm utility tells the .Xr ypbind 8 -process on the current machine which YP server process to communicate with. +process on the current machine which NIS server process to communicate with. If .Ar server -is down or is not running a YP server process, it is not discovered until -a YP client process attempts to access a YP map, at which time +is down or is not running a NIS server process, it is not discovered until +a NIS client process attempts to access a NIS map, at which time .Xr ypbind 8 tests the binding and takes appropriate action. .Pp The .Nm utility -is most useful for binding a YP client that is not on the same broadcast -network as the closest YP server, but can also be used for debugging -a local network's YP configuration, testing specific YP client +is most useful for binding a NIS client that is not on the same broadcast +network as the closest NIS server, but can also be used for debugging +a local network's NIS configuration, testing specific NIS client programs, or binding to a specific server when there are many servers on -the local network supplying YP maps. +the local network supplying NIS maps. .Pp The options are as follows: .Bl -tag -width indent .It Fl d Ar domain -Use the YP domain +Use the NIS domain .Ar domain instead of the default domain as returned by .Xr domainname 1 . .It Fl h Ar host -Set the YP binding on +Set the NIS binding on .Ar host instead of the local machine. .El From owner-svn-src-all@freebsd.org Thu Sep 3 11:30:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 305799C9508; Thu, 3 Sep 2015 11:30:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 214EE1803; Thu, 3 Sep 2015 11:30:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83BUdRg006751; Thu, 3 Sep 2015 11:30:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83BUd2x006750; Thu, 3 Sep 2015 11:30:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509031130.t83BUd2x006750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 3 Sep 2015 11:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287426 - head/lib/libc/posix1e 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, 03 Sep 2015 11:30:40 -0000 Author: trasz Date: Thu Sep 3 11:30:39 2015 New Revision: 287426 URL: https://svnweb.freebsd.org/changeset/base/287426 Log: Fix the way acl_init(3) uses posix_memalign(3) - the latter doesn't set errno. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/posix1e/acl_init.c Modified: head/lib/libc/posix1e/acl_init.c ============================================================================== --- head/lib/libc/posix1e/acl_init.c Thu Sep 3 07:18:52 2015 (r287425) +++ head/lib/libc/posix1e/acl_init.c Thu Sep 3 11:30:39 2015 (r287426) @@ -67,8 +67,10 @@ acl_init(int count) error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS, sizeof(struct acl_t_struct)); - if (error) + if (error) { + errno = error; return (NULL); + } bzero(acl, sizeof(struct acl_t_struct)); acl->ats_brand = ACL_BRAND_UNKNOWN; From owner-svn-src-all@freebsd.org Thu Sep 3 11:31:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFED69C957D; Thu, 3 Sep 2015 11:31:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D07291A07; Thu, 3 Sep 2015 11:31:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83BVYs7009406; Thu, 3 Sep 2015 11:31:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83BVYEg009405; Thu, 3 Sep 2015 11:31:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509031131.t83BVYEg009405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 3 Sep 2015 11:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287427 - head/lib/libc/posix1e 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, 03 Sep 2015 11:31:35 -0000 Author: trasz Date: Thu Sep 3 11:31:34 2015 New Revision: 287427 URL: https://svnweb.freebsd.org/changeset/base/287427 Log: Fix acl_strip_np(3) breakage introduced in r279962. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/posix1e/acl_strip.c Modified: head/lib/libc/posix1e/acl_strip.c ============================================================================== --- head/lib/libc/posix1e/acl_strip.c Thu Sep 3 11:30:39 2015 (r287426) +++ head/lib/libc/posix1e/acl_strip.c Thu Sep 3 11:31:34 2015 (r287427) @@ -107,13 +107,13 @@ _posix1e_acl_strip_np(const acl_t aclp, if (acl_get_permset(entry, &perm) == -1) goto fail; if (acl_create_entry(&acl_new, &entry_new) == -1) - return (NULL); + goto fail; if (acl_set_tag_type(entry_new, tag) == -1) - return (NULL); + goto fail; if (acl_set_permset(entry_new, perm) == -1) - return (NULL); + goto fail; if (acl_copy_entry(entry_new, entry) == -1) - return (NULL); + goto fail; assert(_entry_brand(entry_new) == ACL_BRAND_POSIX); break; case ACL_MASK: @@ -122,20 +122,22 @@ _posix1e_acl_strip_np(const acl_t aclp, default: break; } -fail: - acl_free(acl_new); - acl_free(acl_old); - return (NULL); } assert(_acl_brand(acl_new) == ACL_BRAND_POSIX); if (have_mask_entry && recalculate_mask) { if (acl_calc_mask(&acl_new) == -1) - return (NULL); + goto fail; } return (acl_new); + +fail: + acl_free(acl_new); + acl_free(acl_old); + + return (NULL); } acl_t From owner-svn-src-all@freebsd.org Thu Sep 3 11:33:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A9199C9675; Thu, 3 Sep 2015 11:33:36 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.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 2A1321CC1; Thu, 3 Sep 2015 11:33:36 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83BXaTB010564; Thu, 3 Sep 2015 11:33:36 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83BXY45010556; Thu, 3 Sep 2015 11:33:34 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201509031133.t83BXY45010556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 3 Sep 2015 11:33:34 +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: r287428 - in stable/10/kerberos5: . lib/libhdb libexec/digest-service libexec/kdc usr.bin/string2key usr.sbin/iprop-log 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, 03 Sep 2015 11:33:36 -0000 Author: ume Date: Thu Sep 3 11:33:33 2015 New Revision: 287428 URL: https://svnweb.freebsd.org/changeset/base/287428 Log: MFC r287208, r287216: Make it buildable with WITH_OPENLDAP, again. Modified: stable/10/kerberos5/Makefile.inc stable/10/kerberos5/lib/libhdb/Makefile stable/10/kerberos5/libexec/digest-service/Makefile stable/10/kerberos5/libexec/kdc/Makefile stable/10/kerberos5/usr.bin/string2key/Makefile stable/10/kerberos5/usr.sbin/iprop-log/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/Makefile.inc ============================================================================== --- stable/10/kerberos5/Makefile.inc Thu Sep 3 11:31:34 2015 (r287427) +++ stable/10/kerberos5/Makefile.inc Thu Sep 3 11:33:33 2015 (r287428) @@ -11,7 +11,7 @@ OPENLDAPBASE?= /usr/local LDAPLDADD= -lldap -llber LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;} LDAPCFLAGS= -I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1 -LDAPLDFLAGS= -L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib +LDAPLDFLAGS= -L${OPENLDAPBASE}/lib -rpath ${OPENLDAPBASE}/lib .endif LIBVERS= ${.OBJDIR}/../../lib/libvers/libvers.a Modified: stable/10/kerberos5/lib/libhdb/Makefile ============================================================================== --- stable/10/kerberos5/lib/libhdb/Makefile Thu Sep 3 11:31:34 2015 (r287427) +++ stable/10/kerberos5/lib/libhdb/Makefile Thu Sep 3 11:33:33 2015 (r287428) @@ -1,9 +1,9 @@ # $FreeBSD$ LIB= hdb -LDFLAGS= -Wl,--no-undefined +LDFLAGS= -Wl,--no-undefined ${LDAPLDFLAGS} VERSION_MAP= ${KRB5DIR}/lib/hdb/version-script.map -LDADD= -lasn1 -lcom_err -lkrb5 -lroken -lheimsqlite +LDADD= -lasn1 -lcom_err -lkrb5 -lroken -lheimsqlite ${LDAPLDADD} DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} ${LIBHEIMSQLITE} ${LDAPDPADD} MAN= HDB.3 hdb_entry_ex.3 Modified: stable/10/kerberos5/libexec/digest-service/Makefile ============================================================================== --- stable/10/kerberos5/libexec/digest-service/Makefile Thu Sep 3 11:31:34 2015 (r287427) +++ stable/10/kerberos5/libexec/digest-service/Makefile Thu Sep 3 11:33:33 2015 (r287428) @@ -12,6 +12,7 @@ DPADD= ${LIBHDB} ${LIBKDC} ${LIBHEIMIPCS ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} LDADD= -lhdb -lkdc -lheimipcs -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \ ${LIBVERS} -lheimntlm +LDFLAGS=${LDAPLDFLAGS} USEPRIVATELIB= heimipcs .include Modified: stable/10/kerberos5/libexec/kdc/Makefile ============================================================================== --- stable/10/kerberos5/libexec/kdc/Makefile Thu Sep 3 11:31:34 2015 (r287427) +++ stable/10/kerberos5/libexec/kdc/Makefile Thu Sep 3 11:33:33 2015 (r287428) @@ -13,6 +13,7 @@ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DI DPADD= ${LIBKDC} ${LIBHDB} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} \ ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} LDADD= -lkdc -lhdb -lkrb5 -lroken -lasn1 -lcrypto -lcrypt ${LIBVERS} +LDFLAGS=${LDAPLDFLAGS} .include Modified: stable/10/kerberos5/usr.bin/string2key/Makefile ============================================================================== --- stable/10/kerberos5/usr.bin/string2key/Makefile Thu Sep 3 11:31:34 2015 (r287427) +++ stable/10/kerberos5/usr.bin/string2key/Makefile Thu Sep 3 11:33:33 2015 (r287428) @@ -7,9 +7,9 @@ CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/krb5 \ -I${KRB5DIR}/lib/roken \ -I${KRB5DIR}/lib/windc -DPADD= ${LIBHDB} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} ${LIBCRYPTO} \ +DPADD= ${LIBKRB5} ${LIBROKEN} ${LIBASN1} ${LIBCRYPTO} \ ${LIBCRYPT} ${LIBVERS} -LDADD= -lhdb -lkrb5 -lroken -lasn1 -lcrypto -lcrypt ${LIBVERS} +LDADD= -lkrb5 -lroken -lasn1 -lcrypto -lcrypt ${LIBVERS} .include Modified: stable/10/kerberos5/usr.sbin/iprop-log/Makefile ============================================================================== --- stable/10/kerberos5/usr.sbin/iprop-log/Makefile Thu Sep 3 11:31:34 2015 (r287427) +++ stable/10/kerberos5/usr.sbin/iprop-log/Makefile Thu Sep 3 11:33:33 2015 (r287428) @@ -12,6 +12,7 @@ DPADD= ${LIBKADM5SRV} ${LIBHDB} ${LIBKRB ${LIBCRYPT} ${LIBSL} ${LIBROKEN} ${LIBVERS} ${LIBEDIT} LDADD= -lkadm5srv -lhdb -lkrb5 -lasn1 -lcrypto -lcrypt ${LIBSL} -lroken \ ${LIBVERS} -ledit +LDFLAGS=${LDAPLDFLAGS} iprop-commands.h: iprop-commands.in ${SLC} ${.ALLSRC:M*.in} From owner-svn-src-all@freebsd.org Thu Sep 3 11:40:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134E79C997D; Thu, 3 Sep 2015 11:40:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 046F11FF1; Thu, 3 Sep 2015 11:40:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83Belk2013360; Thu, 3 Sep 2015 11:40:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83BelKv013359; Thu, 3 Sep 2015 11:40:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509031140.t83BelKv013359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 3 Sep 2015 11:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287429 - head/sbin/dumpfs 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, 03 Sep 2015 11:40:48 -0000 Author: trasz Date: Thu Sep 3 11:40:47 2015 New Revision: 287429 URL: https://svnweb.freebsd.org/changeset/base/287429 Log: The dumpfs(8) utility doesn't actually use disktab(5); remove it from "SEE ALSO". MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/dumpfs/dumpfs.8 Modified: head/sbin/dumpfs/dumpfs.8 ============================================================================== --- head/sbin/dumpfs/dumpfs.8 Thu Sep 3 11:33:33 2015 (r287428) +++ head/sbin/dumpfs/dumpfs.8 Thu Sep 3 11:40:47 2015 (r287429) @@ -98,7 +98,6 @@ The flag is needed if the filesystem uses .Xr gjournal 8 . .Sh SEE ALSO -.Xr disktab 5 , .Xr fs 5 , .Xr fsck 8 , .Xr gpart 8 , From owner-svn-src-all@freebsd.org Thu Sep 3 11:43:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54B309C9BA1; Thu, 3 Sep 2015 11:43:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 45D093E6; Thu, 3 Sep 2015 11:43:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83Bh05B014660; Thu, 3 Sep 2015 11:43:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83Bh0QD014659; Thu, 3 Sep 2015 11:43:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509031143.t83Bh0QD014659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 3 Sep 2015 11:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287430 - 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: Thu, 03 Sep 2015 11:43:00 -0000 Author: trasz Date: Thu Sep 3 11:42:59 2015 New Revision: 287430 URL: https://svnweb.freebsd.org/changeset/base/287430 Log: Simplify the introductory example in ctl.conf(5) down to absolute basics. The more complicated cases - like how to use physical ports - are explained later, in the "EXAMPLES" section. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Thu Sep 3 11:40:47 2015 (r287429) +++ head/usr.sbin/ctld/ctl.conf.5 Thu Sep 3 11:42:59 2015 (r287430) @@ -60,15 +60,9 @@ file is: .Dl ... } -.No lun Ar name No { -.Dl path Ar path -} - .No target Ar name { .Dl auth-group Ar name -.Dl portal-group Ar name Op Ar agname -.Dl port Ar name -.Dl lun Ar number Ar name +.Dl portal-group Ar name .Dl lun Ar number No { .Dl path Ar path .Dl } From owner-svn-src-all@freebsd.org Thu Sep 3 11:43:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A9B9C9C5B; Thu, 3 Sep 2015 11:43:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C938B7D0; Thu, 3 Sep 2015 11:43:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83Bhvjd014737; Thu, 3 Sep 2015 11:43:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83Bhv5K014735; Thu, 3 Sep 2015 11:43:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201509031143.t83Bhv5K014735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 3 Sep 2015 11:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287431 - in head/usr.sbin: ctld iscsid 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, 03 Sep 2015 11:43:57 -0000 Author: trasz Date: Thu Sep 3 11:43:56 2015 New Revision: 287431 URL: https://svnweb.freebsd.org/changeset/base/287431 Log: Use proper term in the ctld(8) and iscsid(8) man pages. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.8 head/usr.sbin/iscsid/iscsid.8 Modified: head/usr.sbin/ctld/ctld.8 ============================================================================== --- head/usr.sbin/ctld/ctld.8 Thu Sep 3 11:42:59 2015 (r287430) +++ head/usr.sbin/ctld/ctld.8 Thu Sep 3 11:43:56 2015 (r287431) @@ -80,9 +80,9 @@ The default is .Pa /etc/ctl.conf . .It Fl d Debug mode. -The server sends verbose debug output to standard error, and does not +The daemon sends verbose debug output to standard error, and does not put itself in the background. -The server will also not fork and will exit after processing one connection. +The daemon will also not fork and will exit after processing one connection. This option is only intended for debugging the target. .El .Sh FILES Modified: head/usr.sbin/iscsid/iscsid.8 ============================================================================== --- head/usr.sbin/iscsid/iscsid.8 Thu Sep 3 11:42:59 2015 (r287430) +++ head/usr.sbin/iscsid/iscsid.8 Thu Sep 3 11:43:56 2015 (r287431) @@ -68,9 +68,9 @@ The default location is .Pa /var/run/iscsid.pid . .It Fl d Debug mode. -The server sends verbose debug output to standard error, and does not +The daemon sends verbose debug output to standard error, and does not put itself in the background. -The server will also not fork and will exit after processing one connection. +The daemon will also not fork and will exit after processing one connection. This option is only intended for debugging the initiator. .It Fl l Ar loglevel Specifies debug level. From owner-svn-src-all@freebsd.org Thu Sep 3 12:01:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3419E9C9BF2; Thu, 3 Sep 2015 12:01:40 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c: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 CD5C61275; Thu, 3 Sep 2015 12:01:39 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wicge5 with SMTP id ge5so71273648wic.0; Thu, 03 Sep 2015 05:01:38 -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:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=sbgSYxmIXstcQOzVR/gAEs5xT9+0wPMIRZImb1D0IHE=; b=lYVdCQR5W/QGrCBFt2X5XmOSmq0WgZjDG9yK9o0e3FRFCS5m8kF2X8/y3r6LtrHahV pnqhJsgXcXtpAAibLJjdAX2CQL1fjgZ6DRGYE2eW9gnEBZFn6ulJBsI+PhXUr7dyGm0B gFNErT7fRcHDsFtcwcCDX7tece7GKwnsUV94EAvApVWXl4y/y8+oapXIzvRYBZlMydau yI1Dv+a10mxlYIn6iUsl9WbhTw5BAkiMC358QAk7ADH1p7Uy2TeFaQlxl3oSmKLzftlu AcFUNcp7YUUIvgXUQtk4RoAa1J/gUW4xmUv7xBf7CuwAxpYgoWVkXNVUnETpwgjVgGTR dKOA== X-Received: by 10.194.9.170 with SMTP id a10mr42092970wjb.135.1441281698096; Thu, 03 Sep 2015 05:01:38 -0700 (PDT) Received: from brick.home (euj88.neoplus.adsl.tpnet.pl. [83.20.181.88]) by smtp.gmail.com with ESMTPSA id r8sm8692894wiz.2.2015.09.03.05.01.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 05:01:37 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 3 Sep 2015 14:01:34 +0200 From: Edward Tomasz Napierala To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287396 - in head: sbin/bsdlabel sbin/dumpfs sbin/fdisk sbin/ffsinfo sbin/mdconfig sbin/newfs sbin/newfs_msdos sbin/newfs_nandfs sbin/reboot share/man/man4 share/man/man7 share/man/man8... Message-ID: <20150903120134.GA75381@brick.home> Mail-Followup-To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201509021408.t82E8h0Q038324@repo.freebsd.org> <20150902143702.GM1023@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150902143702.GM1023@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: Thu, 03 Sep 2015 12:01:40 -0000 On 0902T1737, Gleb Smirnoff wrote: > On Wed, Sep 02, 2015 at 02:08:43PM +0000, Edward Tomasz Napierala wrote: > E> Author: trasz > E> Date: Wed Sep 2 14:08:43 2015 > E> New Revision: 287396 > E> URL: https://svnweb.freebsd.org/changeset/base/287396 > E> > E> Log: > E> It's 2015, and some people are still trying to use fdisk and then > E> go asking what debug flags to set for GEOM to make it work. Advice > E> them to use gpart(8) instead. > E> > E> Something similar should probably done with disklabel, > E> but I need to rewrite the disklabel examples first. > > Thanks! > > Do we still have functionality of fdisk/bsdlabel that isn't covered > by gpart? Can we simply remove the tools? I think it would be possible, but I don't plan to do it. Some people are still happily using them, and they are used in scripts, like the nanobsd build system. From owner-svn-src-all@freebsd.org Thu Sep 3 12:06:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 184879C9E08; Thu, 3 Sep 2015 12:06:12 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (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 B28A414E9; Thu, 3 Sep 2015 12:06:11 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wicfx3 with SMTP id fx3so17521634wic.1; Thu, 03 Sep 2015 05:06:10 -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:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=PLU4qn9R42yiC2PH91yOFJlNmRCa9qg2aGYnxeiCe2A=; b=kBnlo/RbYGLdTJHDfF8laO50wbbeg+R+hwC1DQywzYj6dDZS6rRxHdw+CzBQnkAxx4 Bqm+NG8JhOWKUlqCDfVHKmkjUowTupPyygGIn0VVJ+CBCBLrWWKQj4+Po2fc5il45/4O aMSf+rkkQIQ2dpr9DyLhWBw+c35DFNQ88P74u910s9G7oSfjEUPl+rKqH0o0c2wXYXGd cqwdgZQlhNajtWGDzNsLGZKjTd62QR0yGDJaczuOGPTQbn73ZGJm/OhHvrZItUQv08OU yUdNFCCAjZFvE5+nBWnzqNX4lH+iACYofThxwupijf1UhMmdT9Xmk48d29lslCZhdmUS bOsA== X-Received: by 10.194.205.68 with SMTP id le4mr20500959wjc.74.1441281970004; Thu, 03 Sep 2015 05:06:10 -0700 (PDT) Received: from brick.home (euj88.neoplus.adsl.tpnet.pl. [83.20.181.88]) by smtp.gmail.com with ESMTPSA id y15sm8700369wib.7.2015.09.03.05.06.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 05:06:09 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 3 Sep 2015 14:06:06 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287405 - head/sys/geom Message-ID: <20150903120606.GB75381@brick.home> Mail-Followup-To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201509021729.t82HTULW036119@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201509021729.t82HTULW036119@repo.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: Thu, 03 Sep 2015 12:06:12 -0000 On 0902T1729, Warner Losh wrote: > Author: imp > Date: Wed Sep 2 17:29:30 2015 > New Revision: 287405 > URL: https://svnweb.freebsd.org/changeset/base/287405 > > Log: > After the introduction of direct dispatch, the pacing code in g_down() > broke in two ways. One, the pacing variable was accessed in multiple > threads in an unsafe way. Two, since large numbers of I/O could come > down from the buf layer at one time, large numbers of allocation > failures could happen all at once, resulting in a huge pace value that > would limit I/Os to 10 IOPS for minutes (or even hours) at a > time. While a real solution to these problems requires substantial > work (to go to a no-allocation after the first model, or to have some > way to wait for more memory with some kind of reserve for pager and > swapper requests), it is relatively easy to make this simplistic > pacing less pathological. Shouldn't we emit some warning the first time this happens, to aid in debugging strange IO performance degradation? Something like... > @@ -688,7 +699,7 @@ g_io_deliver(struct bio *bp, int error) > bp->bio_driver2 = NULL; > bp->bio_pflags = 0; > g_io_request(bp, cp); if (warned_about_pace == 0) { printf("WARNING: GEOM io allocation failed; expect reduced IO performance\n"); warned_about_pace = 1; } > - pace++; > + pace = 1; > return; > } From owner-svn-src-all@freebsd.org Thu Sep 3 12:15:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC77E9C72E0; Thu, 3 Sep 2015 12:15:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9DB1C1B7D; Thu, 3 Sep 2015 12:15:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83CFF8v027303; Thu, 3 Sep 2015 12:15:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83CFFbx027302; Thu, 3 Sep 2015 12:15:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509031215.t83CFFbx027302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 3 Sep 2015 12:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287432 - head/sys/cam/ctl 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, 03 Sep 2015 12:15:15 -0000 Author: mav Date: Thu Sep 3 12:15:14 2015 New Revision: 287432 URL: https://svnweb.freebsd.org/changeset/base/287432 Log: Fix copy-paste bug introduced in r275458. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Sep 3 11:43:56 2015 (r287431) +++ head/sys/cam/ctl/ctl.c Thu Sep 3 12:15:14 2015 (r287432) @@ -8951,7 +8951,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); - ctl_clr_ua(lun, initidx, CTL_UA_RES_RELEASE); + ctl_clr_ua(lun, initidx, CTL_UA_LUN_CHANGE); mtx_unlock(&lun->lun_lock); } } From owner-svn-src-all@freebsd.org Thu Sep 3 12:56:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 324C49C87E1; Thu, 3 Sep 2015 12:56:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.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 23379E38; Thu, 3 Sep 2015 12:56:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83CuxeE043611; Thu, 3 Sep 2015 12:56:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83Cuwao043608; Thu, 3 Sep 2015 12:56:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509031256.t83Cuwao043608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 3 Sep 2015 12:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287433 - head/sys/cam/ctl 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, 03 Sep 2015 12:56:59 -0000 Author: mav Date: Thu Sep 3 12:56:57 2015 New Revision: 287433 URL: https://svnweb.freebsd.org/changeset/base/287433 Log: Small UA cleanup. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_error.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Sep 3 12:15:14 2015 (r287432) +++ head/sys/cam/ctl/ctl.c Thu Sep 3 12:56:57 2015 (r287433) @@ -437,7 +437,7 @@ static int ctl_scsiio_lun_check(struct c #ifdef notyet static void ctl_failover(void); #endif -static void ctl_clear_ua(struct ctl_softc *ctl_softc, uint32_t initidx, +static void ctl_clr_ua_allluns(struct ctl_softc *ctl_softc, uint32_t initidx, ctl_ua_type ua_type); static int ctl_scsiio_precheck(struct ctl_softc *ctl_softc, struct ctl_scsiio *ctsio); @@ -1012,6 +1012,20 @@ ctl_clr_ua_all(struct ctl_lun *lun, uint } } +static void +ctl_clr_ua_allluns(struct ctl_softc *ctl_softc, uint32_t initidx, + ctl_ua_type ua_type) +{ + struct ctl_lun *lun; + + mtx_assert(&ctl_softc->ctl_lock, MA_OWNED); + STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + ctl_clr_ua(lun, initidx, ua_type); + mtx_unlock(&lun->lun_lock); + } +} + static int ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) { @@ -9100,7 +9114,7 @@ ctl_request_sense(struct ctl_scsiio *cts if (ua_type == CTL_UA_LUN_CHANGE) { mtx_unlock(&lun->lun_lock); mtx_lock(&ctl_softc->ctl_lock); - ctl_clear_ua(ctl_softc, initidx, ua_type); + ctl_clr_ua_allluns(ctl_softc, initidx, ua_type); mtx_unlock(&ctl_softc->ctl_lock); mtx_lock(&lun->lun_lock); } @@ -11088,24 +11102,6 @@ ctl_failover(void) } #endif -static void -ctl_clear_ua(struct ctl_softc *ctl_softc, uint32_t initidx, - ctl_ua_type ua_type) -{ - struct ctl_lun *lun; - ctl_ua_type *pu; - - mtx_assert(&ctl_softc->ctl_lock, MA_OWNED); - - STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) { - mtx_lock(&lun->lun_lock); - pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; - if (pu != NULL) - pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua_type; - mtx_unlock(&lun->lun_lock); - } -} - static int ctl_scsiio_precheck(struct ctl_softc *softc, struct ctl_scsiio *ctsio) { Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Thu Sep 3 12:15:14 2015 (r287432) +++ head/sys/cam/ctl/ctl.h Thu Sep 3 12:56:57 2015 (r287433) @@ -120,8 +120,6 @@ typedef enum { CTL_UA_LUN_CHANGE = 0x0020, CTL_UA_MODE_CHANGE = 0x0040, CTL_UA_LOG_CHANGE = 0x0080, - CTL_UA_LVD = 0x0100, - CTL_UA_SE = 0x0200, CTL_UA_RES_PREEMPT = 0x0400, CTL_UA_RES_RELEASE = 0x0800, CTL_UA_REG_PREEMPT = 0x1000, Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Thu Sep 3 12:15:14 2015 (r287432) +++ head/sys/cam/ctl/ctl_error.c Thu Sep 3 12:56:57 2015 (r287433) @@ -446,16 +446,6 @@ ctl_build_ua(struct ctl_lun *lun, uint32 asc = 0x2A; ascq = 0x02; break; - case CTL_UA_LVD: - /* 29h/06h TRANSCEIVER MODE CHANGED TO LVD */ - asc = 0x29; - ascq = 0x06; - break; - case CTL_UA_SE: - /* 29h/05h TRANSCEIVER MODE CHANGED TO SINGLE-ENDED */ - asc = 0x29; - ascq = 0x05; - break; case CTL_UA_RES_PREEMPT: /* 2Ah/03h RESERVATIONS PREEMPTED */ asc = 0x2A; From owner-svn-src-all@freebsd.org Thu Sep 3 16:38:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFD829C97BA; Thu, 3 Sep 2015 16:38:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C044C891; Thu, 3 Sep 2015 16:38:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83GcRdl041918; Thu, 3 Sep 2015 16:38:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83GcQaE041914; Thu, 3 Sep 2015 16:38:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031638.t83GcQaE041914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 16:38:26 +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: r287434 - stable/9/sys/dev/ipmi 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: Thu, 03 Sep 2015 16:38:28 -0000 Author: jhb Date: Thu Sep 3 16:38:26 2015 New Revision: 287434 URL: https://svnweb.freebsd.org/changeset/base/287434 Log: MFC 248705,253812,253813: - Unlock IPMI sc while performing requests via KCS and SMIC interfaces. - empirical testing showed that 3 seconds is just too slow for GET_DEVICE_ID to return on newer Dell hardware. Bump to 6 second timeouts until someone has a better idea on how to handle this - Check for ipmi_attached in ipmi_isa_probe as a suggested alternative to ipmi_isa_attach. This keeps unintended but harmless noise about "ipmi1" from appearing in the boot up sequence. Modified: stable/9/sys/dev/ipmi/ipmi_isa.c stable/9/sys/dev/ipmi/ipmi_kcs.c stable/9/sys/dev/ipmi/ipmi_smic.c stable/9/sys/dev/ipmi/ipmivars.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ipmi/ipmi_isa.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi_isa.c Thu Sep 3 12:56:57 2015 (r287433) +++ stable/9/sys/dev/ipmi/ipmi_isa.c Thu Sep 3 16:38:26 2015 (r287434) @@ -78,6 +78,14 @@ static int ipmi_isa_probe(device_t dev) { + /* + * Give other drivers precedence. Unfortunately, this doesn't + * work if we have an SMBIOS table that duplicates a PCI device + * that's later on the bus than the PCI-ISA bridge. + */ + if (ipmi_attached) + return (ENXIO); + /* Skip any PNP devices. */ if (isa_get_logicalid(dev) != 0) return (ENXIO); @@ -175,14 +183,6 @@ ipmi_isa_attach(device_t dev) !ipmi_hint_identify(dev, &info)) return (ENXIO); - /* - * Give other drivers precedence. Unfortunately, this doesn't - * work if we have an SMBIOS table that duplicates a PCI device - * that's later on the bus than the PCI-ISA bridge. - */ - if (ipmi_attached) - return (EBUSY); - switch (info.iface_type) { case KCS_MODE: count = 2; Modified: stable/9/sys/dev/ipmi/ipmi_kcs.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi_kcs.c Thu Sep 3 12:56:57 2015 (r287433) +++ stable/9/sys/dev/ipmi/ipmi_kcs.c Thu Sep 3 16:38:26 2015 (r287434) @@ -473,6 +473,7 @@ kcs_loop(void *arg) IPMI_LOCK(sc); while ((req = ipmi_dequeue_request(sc)) != NULL) { + IPMI_UNLOCK(sc); ok = 0; for (i = 0; i < 3 && !ok; i++) ok = kcs_polled_request(sc, req); @@ -480,6 +481,7 @@ kcs_loop(void *arg) req->ir_error = 0; else req->ir_error = EIO; + IPMI_LOCK(sc); ipmi_complete_request(sc, req); } IPMI_UNLOCK(sc); Modified: stable/9/sys/dev/ipmi/ipmi_smic.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi_smic.c Thu Sep 3 12:56:57 2015 (r287433) +++ stable/9/sys/dev/ipmi/ipmi_smic.c Thu Sep 3 16:38:26 2015 (r287434) @@ -362,6 +362,7 @@ smic_loop(void *arg) IPMI_LOCK(sc); while ((req = ipmi_dequeue_request(sc)) != NULL) { + IPMI_UNLOCK(sc); ok = 0; for (i = 0; i < 3 && !ok; i++) { IPMI_IO_LOCK(sc); @@ -372,6 +373,7 @@ smic_loop(void *arg) req->ir_error = 0; else req->ir_error = EIO; + IPMI_LOCK(sc); ipmi_complete_request(sc, req); } IPMI_UNLOCK(sc); Modified: stable/9/sys/dev/ipmi/ipmivars.h ============================================================================== --- stable/9/sys/dev/ipmi/ipmivars.h Thu Sep 3 12:56:57 2015 (r287433) +++ stable/9/sys/dev/ipmi/ipmivars.h Thu Sep 3 16:38:26 2015 (r287434) @@ -222,7 +222,7 @@ struct ipmi_ipmb { ((sc)->ipmi_io_res[1] != NULL ? OUTB_MULTIPLE(sc, x, value) : \ OUTB_SINGLE(sc, x, value)) -#define MAX_TIMEOUT 3 * hz +#define MAX_TIMEOUT 6 * hz int ipmi_attach(device_t); int ipmi_detach(device_t); From owner-svn-src-all@freebsd.org Thu Sep 3 16:43:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48F639C9A9A; Thu, 3 Sep 2015 16:43:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 38EE7CD6; Thu, 3 Sep 2015 16:43:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83Ghb4e045861; Thu, 3 Sep 2015 16:43:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83GhaH2045857; Thu, 3 Sep 2015 16:43:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031643.t83GhaH2045857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 16:43: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: r287435 - in stable: 10/sys/dev/ipmi 9/sys/dev/ipmi 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, 03 Sep 2015 16:43:37 -0000 Author: jhb Date: Thu Sep 3 16:43:35 2015 New Revision: 287435 URL: https://svnweb.freebsd.org/changeset/base/287435 Log: MFC 281941: Watchdog drivers need to support rearming the watchdog in contexts which are not permitted to sleep. Only use the IPMI watchdog with backends which poll driver-initiated requests to meet this requirement. In practice this means that watchdogs will no longer be used on systems that use the SSIF backend. Modified: stable/10/sys/dev/ipmi/ipmi.c stable/10/sys/dev/ipmi/ipmi_kcs.c stable/10/sys/dev/ipmi/ipmi_smic.c stable/10/sys/dev/ipmi/ipmivars.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/ipmi/ipmi.c stable/9/sys/dev/ipmi/ipmi_kcs.c stable/9/sys/dev/ipmi/ipmi_smic.c stable/9/sys/dev/ipmi/ipmivars.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/10/sys/dev/ipmi/ipmi.c Thu Sep 3 16:38:26 2015 (r287434) +++ stable/10/sys/dev/ipmi/ipmi.c Thu Sep 3 16:43:35 2015 (r287435) @@ -756,17 +756,22 @@ ipmi_startup(void *arg) } device_printf(dev, "Number of channels %d\n", i); - /* probe for watchdog */ - IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), - IPMI_GET_WDOG, 0, 0); - - ipmi_submit_driver_request(sc, req, 0); - - if (req->ir_compcode == 0x00) { - device_printf(dev, "Attached watchdog\n"); - /* register the watchdog event handler */ - sc->ipmi_watchdog_tag = EVENTHANDLER_REGISTER(watchdog_list, - ipmi_wd_event, sc, 0); + /* + * Probe for watchdog, but only for backends which support + * polled driver requests. + */ + if (sc->ipmi_driver_requests_polled) { + IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), + IPMI_GET_WDOG, 0, 0); + + ipmi_submit_driver_request(sc, req, 0); + + if (req->ir_compcode == 0x00) { + device_printf(dev, "Attached watchdog\n"); + /* register the watchdog event handler */ + sc->ipmi_watchdog_tag = EVENTHANDLER_REGISTER( + watchdog_list, ipmi_wd_event, sc, 0); + } } sc->ipmi_cdev = make_dev(&ipmi_cdevsw, device_get_unit(dev), Modified: stable/10/sys/dev/ipmi/ipmi_kcs.c ============================================================================== --- stable/10/sys/dev/ipmi/ipmi_kcs.c Thu Sep 3 16:38:26 2015 (r287434) +++ stable/10/sys/dev/ipmi/ipmi_kcs.c Thu Sep 3 16:43:35 2015 (r287435) @@ -520,6 +520,7 @@ ipmi_kcs_attach(struct ipmi_softc *sc) sc->ipmi_startup = kcs_startup; sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; sc->ipmi_driver_request = kcs_driver_request; + sc->ipmi_driver_requests_polled = 1; /* See if we can talk to the controller. */ status = INB(sc, KCS_CTL_STS); Modified: stable/10/sys/dev/ipmi/ipmi_smic.c ============================================================================== --- stable/10/sys/dev/ipmi/ipmi_smic.c Thu Sep 3 16:38:26 2015 (r287434) +++ stable/10/sys/dev/ipmi/ipmi_smic.c Thu Sep 3 16:43:35 2015 (r287435) @@ -415,6 +415,7 @@ ipmi_smic_attach(struct ipmi_softc *sc) sc->ipmi_startup = smic_startup; sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; sc->ipmi_driver_request = smic_driver_request; + sc->ipmi_driver_requests_polled = 1; /* See if we can talk to the controller. */ flags = INB(sc, SMIC_FLAGS); Modified: stable/10/sys/dev/ipmi/ipmivars.h ============================================================================== --- stable/10/sys/dev/ipmi/ipmivars.h Thu Sep 3 16:38:26 2015 (r287434) +++ stable/10/sys/dev/ipmi/ipmivars.h Thu Sep 3 16:43:35 2015 (r287435) @@ -105,6 +105,7 @@ struct ipmi_softc { int ipmi_opened; struct cdev *ipmi_cdev; TAILQ_HEAD(,ipmi_request) ipmi_pending_requests; + int ipmi_driver_requests_polled; eventhandler_tag ipmi_watchdog_tag; int ipmi_watchdog_active; struct intr_config_hook ipmi_ich; From owner-svn-src-all@freebsd.org Thu Sep 3 16:43:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA4629C9AA1; Thu, 3 Sep 2015 16:43:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 CA6E7CD8; Thu, 3 Sep 2015 16:43:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83Ghcuh045871; Thu, 3 Sep 2015 16:43:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83GhbSO045866; Thu, 3 Sep 2015 16:43:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031643.t83GhbSO045866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 16:43:37 +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: r287435 - in stable: 10/sys/dev/ipmi 9/sys/dev/ipmi 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: Thu, 03 Sep 2015 16:43:39 -0000 Author: jhb Date: Thu Sep 3 16:43:35 2015 New Revision: 287435 URL: https://svnweb.freebsd.org/changeset/base/287435 Log: MFC 281941: Watchdog drivers need to support rearming the watchdog in contexts which are not permitted to sleep. Only use the IPMI watchdog with backends which poll driver-initiated requests to meet this requirement. In practice this means that watchdogs will no longer be used on systems that use the SSIF backend. Modified: stable/9/sys/dev/ipmi/ipmi.c stable/9/sys/dev/ipmi/ipmi_kcs.c stable/9/sys/dev/ipmi/ipmi_smic.c stable/9/sys/dev/ipmi/ipmivars.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/ipmi/ipmi.c stable/10/sys/dev/ipmi/ipmi_kcs.c stable/10/sys/dev/ipmi/ipmi_smic.c stable/10/sys/dev/ipmi/ipmivars.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi.c Thu Sep 3 16:38:26 2015 (r287434) +++ stable/9/sys/dev/ipmi/ipmi.c Thu Sep 3 16:43:35 2015 (r287435) @@ -753,17 +753,22 @@ ipmi_startup(void *arg) } device_printf(dev, "Number of channels %d\n", i); - /* probe for watchdog */ - IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), - IPMI_GET_WDOG, 0, 0); - - ipmi_submit_driver_request(sc, req, 0); - - if (req->ir_compcode == 0x00) { - device_printf(dev, "Attached watchdog\n"); - /* register the watchdog event handler */ - sc->ipmi_watchdog_tag = EVENTHANDLER_REGISTER(watchdog_list, - ipmi_wd_event, sc, 0); + /* + * Probe for watchdog, but only for backends which support + * polled driver requests. + */ + if (sc->ipmi_driver_requests_polled) { + IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), + IPMI_GET_WDOG, 0, 0); + + ipmi_submit_driver_request(sc, req, 0); + + if (req->ir_compcode == 0x00) { + device_printf(dev, "Attached watchdog\n"); + /* register the watchdog event handler */ + sc->ipmi_watchdog_tag = EVENTHANDLER_REGISTER( + watchdog_list, ipmi_wd_event, sc, 0); + } } sc->ipmi_cdev = make_dev(&ipmi_cdevsw, device_get_unit(dev), Modified: stable/9/sys/dev/ipmi/ipmi_kcs.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi_kcs.c Thu Sep 3 16:38:26 2015 (r287434) +++ stable/9/sys/dev/ipmi/ipmi_kcs.c Thu Sep 3 16:43:35 2015 (r287435) @@ -520,6 +520,7 @@ ipmi_kcs_attach(struct ipmi_softc *sc) sc->ipmi_startup = kcs_startup; sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; sc->ipmi_driver_request = kcs_driver_request; + sc->ipmi_driver_requests_polled = 1; /* See if we can talk to the controller. */ status = INB(sc, KCS_CTL_STS); Modified: stable/9/sys/dev/ipmi/ipmi_smic.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi_smic.c Thu Sep 3 16:38:26 2015 (r287434) +++ stable/9/sys/dev/ipmi/ipmi_smic.c Thu Sep 3 16:43:35 2015 (r287435) @@ -415,6 +415,7 @@ ipmi_smic_attach(struct ipmi_softc *sc) sc->ipmi_startup = smic_startup; sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; sc->ipmi_driver_request = smic_driver_request; + sc->ipmi_driver_requests_polled = 1; /* See if we can talk to the controller. */ flags = INB(sc, SMIC_FLAGS); Modified: stable/9/sys/dev/ipmi/ipmivars.h ============================================================================== --- stable/9/sys/dev/ipmi/ipmivars.h Thu Sep 3 16:38:26 2015 (r287434) +++ stable/9/sys/dev/ipmi/ipmivars.h Thu Sep 3 16:43:35 2015 (r287435) @@ -105,6 +105,7 @@ struct ipmi_softc { int ipmi_opened; struct cdev *ipmi_cdev; TAILQ_HEAD(,ipmi_request) ipmi_pending_requests; + int ipmi_driver_requests_polled; eventhandler_tag ipmi_watchdog_tag; int ipmi_watchdog_active; struct intr_config_hook ipmi_ich; From owner-svn-src-all@freebsd.org Thu Sep 3 17:01:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7F289CA3B1; Thu, 3 Sep 2015 17:01:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.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 98C5B1C19; Thu, 3 Sep 2015 17:01:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83H1xlx054404; Thu, 3 Sep 2015 17:01:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83H1xnE054400; Thu, 3 Sep 2015 17:01:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201509031701.t83H1xnE054400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 3 Sep 2015 17:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287436 - 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, 03 Sep 2015 17:01:59 -0000 Author: bdrewery Date: Thu Sep 3 17:01:58 2015 New Revision: 287436 URL: https://svnweb.freebsd.org/changeset/base/287436 Log: Avoid sub-shell for realpath(1) for bmake by using its built-in :tA. MFC after: 2 weeks Approved by: portmgr (implicit) Modified: head/share/mk/bsd.port.mk head/share/mk/bsd.port.subdir.mk Modified: head/share/mk/bsd.port.mk ============================================================================== --- head/share/mk/bsd.port.mk Thu Sep 3 16:43:35 2015 (r287435) +++ head/share/mk/bsd.port.mk Thu Sep 3 17:01:58 2015 (r287436) @@ -10,8 +10,12 @@ _PORTSDIR= ${.CURDIR}/${RELPATH} .endif .endfor _PORTSDIR?= /usr/ports +.if defined(.PARSEDIR) +PORTSDIR= ${_PORTSDIR:tA} +.else # fmake doesn't have :tA PORTSDIR!= realpath ${_PORTSDIR} .endif +.endif BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk Modified: head/share/mk/bsd.port.subdir.mk ============================================================================== --- head/share/mk/bsd.port.subdir.mk Thu Sep 3 16:43:35 2015 (r287435) +++ head/share/mk/bsd.port.subdir.mk Thu Sep 3 17:01:58 2015 (r287436) @@ -10,8 +10,12 @@ _PORTSDIR= ${.CURDIR}/${RELPATH} .endif .endfor _PORTSDIR?= /usr/ports +.if defined(.PARSEDIR) +PORTSDIR= ${_PORTSDIR:tA} +.else # fmake doesn't have :tA PORTSDIR!= realpath ${_PORTSDIR} .endif +.endif BSDPORTSUBDIRMK?= ${PORTSDIR}/Mk/bsd.port.subdir.mk From owner-svn-src-all@freebsd.org Thu Sep 3 17:46:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A7B99C95F0; Thu, 3 Sep 2015 17:46:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B72B5914; Thu, 3 Sep 2015 17:46:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA02750; Thu, 03 Sep 2015 20:46:20 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZXYaa-0008UB-6L; Thu, 03 Sep 2015 20:46:20 +0300 Subject: Re: svn commit: r287283 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201508290922.t7T9MXhF007620@repo.freebsd.org> From: Andriy Gapon X-Enigmail-Draft-Status: N1110 Message-ID: <55E88733.5010403@FreeBSD.org> Date: Thu, 3 Sep 2015 20:45:23 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201508290922.t7T9MXhF007620@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 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: Thu, 03 Sep 2015 17:46:25 -0000 On 29/08/2015 12:22, Xin LI wrote: > Author: delphij > Date: Sat Aug 29 09:22:32 2015 > New Revision: 287283 > URL: https://svnweb.freebsd.org/changeset/base/287283 > > Log: > Fix a buffer overrun which may lead to data corruption, introduced in > r286951 by reinstating changes in r274628. > > In l2arc_compress_buf(), we allocate a buffer to stash away the compressed > data in 'cdata', allocated of l2hdr->b_asize bytes. > > We then ask zio_compress_data() to compress the buffer, b_l1hdr.b_tmp_cdata, > which is of l2hdr->b_asize bytes, and have the compressed size (or original > size, if compress didn't gain enough) stored in csize. > > To pad the buffer to fit the optimal write size, we round up the compressed > size to L2 device's vdev_ashift. > > Illumos code rounds up the size by at most SPA_MINBLOCKSIZE. Because we > know csize <= b_asize, and b_asize is integer multiple of SPA_MINBLOCKSIZE, > we are guaranteed that the rounded up csize would be <= b_asize. However, > this is not necessarily true when we round up to 1 << vdev_ashift, because > it could be larger than SPA_MINBLOCKSIZE. > > So, in the worst case scenario, we are overwriting at most > > (1 << vdev_ashift - SPA_MINBLOCKSIZE) > > bytes of memory next to the compressed data buffer. > > Andriy's original change in r274628 reorganized the code a little bit, > by moving the padding to after we determined that the compression was > beneficial. At which point, we would check rounded size against the > allocated buffer size, and the buffer overrun would not be possible. Thank you very much for this fix! I completely forgot why I had that code moved (and it was exactly to avoid the buffer overrun) and so I thought that it was a non-essential difference from upstream. -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Sep 3 17:46:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFC0B9C9631; Thu, 3 Sep 2015 17:46:58 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B6819A53; Thu, 3 Sep 2015 17:46:58 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83HkwbR072329; Thu, 3 Sep 2015 17:46:58 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83HkwqW072328; Thu, 3 Sep 2015 17:46:58 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509031746.t83HkwqW072328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 3 Sep 2015 17:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287437 - head/sys/dev/ciss 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, 03 Sep 2015 17:46:59 -0000 Author: sbruno Date: Thu Sep 3 17:46:57 2015 New Revision: 287437 URL: https://svnweb.freebsd.org/changeset/base/287437 Log: r249170 was just plain wrong. The effect of the change is to always delete a logic volume on status change which is NOT what we want here. The original code is correct in that when the volume changes status the driver will only delete the volume if the status is one of the fatal errors. A drive failure in a mirrored volume is NOT a situtation where the volume should dissapear. Reported on freebsd-scsi@: https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html MFC after: 3 days Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Thu Sep 3 17:01:58 2015 (r287436) +++ head/sys/dev/ciss/ciss.c Thu Sep 3 17:46:57 2015 (r287437) @@ -4016,8 +4016,7 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) { struct ciss_ldrive *ld; - int bus, target; - int rescan_ld; + int ostatus, bus, target; debug_called(2); @@ -4040,6 +4039,7 @@ ciss_notify_logical(struct ciss_softc *s /* * Update our idea of the drive's status. */ + ostatus = ciss_decode_ldrive_status(cn->data.logical_status.previous_state); ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state); if (ld->cl_lstatus != NULL) ld->cl_lstatus->status = cn->data.logical_status.new_state; @@ -4047,9 +4047,7 @@ ciss_notify_logical(struct ciss_softc *s /* * Have CAM rescan the drive if its status has changed. */ - rescan_ld = (cn->data.logical_status.previous_state != - cn->data.logical_status.new_state) ? 1 : 0; - if (rescan_ld) { + if (ostatus != ld->cl_status) { ld->cl_update = 1; ciss_notify_rescan_logical(sc); } From owner-svn-src-all@freebsd.org Thu Sep 3 18:14:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9FD49CA2FA; Thu, 3 Sep 2015 18:14:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.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 CA869BBE; Thu, 3 Sep 2015 18:14:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83IEWGp084894; Thu, 3 Sep 2015 18:14:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83IEWYH084893; Thu, 3 Sep 2015 18:14:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201509031814.t83IEWYH084893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 3 Sep 2015 18:14:32 +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: r287438 - 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.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, 03 Sep 2015 18:14:33 -0000 Author: imp Date: Thu Sep 3 18:14:31 2015 New Revision: 287438 URL: https://svnweb.freebsd.org/changeset/base/287438 Log: MFC: r287183, r287264, r287265 Export kern.features.invariants when kernel is compiled with invariants. Modified: stable/10/sys/kern/init_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/init_main.c ============================================================================== --- stable/10/sys/kern/init_main.c Thu Sep 3 17:46:57 2015 (r287437) +++ stable/10/sys/kern/init_main.c Thu Sep 3 18:14:31 2015 (r287438) @@ -115,6 +115,10 @@ int bootverbose = BOOTVERBOSE; SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0, "Control the output of verbose kernel messages"); +#ifdef INVARIANTS +FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance"); +#endif + /* * This ensures that there is at least one entry so that the sysinit_set * symbol is not undefined. A sybsystem ID of SI_SUB_DUMMY is never From owner-svn-src-all@freebsd.org Thu Sep 3 18:23:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 985B09CA665; Thu, 3 Sep 2015 18:23:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 7A4D584; Thu, 3 Sep 2015 18:23:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83IN9a1089027; Thu, 3 Sep 2015 18:23:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83IN8Ma089019; Thu, 3 Sep 2015 18:23:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031823.t83IN8Ma089019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 18:23:08 +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: r287439 - in stable: 10/lib/libutil 9/lib/libutil 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, 03 Sep 2015 18:23:09 -0000 Author: jhb Date: Thu Sep 3 18:23:07 2015 New Revision: 287439 URL: https://svnweb.freebsd.org/changeset/base/287439 Log: MFC 283622: Add to the SYNOPSIS of the kinfo_get*() functions since these functions all return types that are defined in that header. Modified: stable/10/lib/libutil/kinfo_getallproc.3 stable/10/lib/libutil/kinfo_getfile.3 stable/10/lib/libutil/kinfo_getproc.3 stable/10/lib/libutil/kinfo_getvmmap.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/lib/libutil/kinfo_getallproc.3 stable/9/lib/libutil/kinfo_getfile.3 stable/9/lib/libutil/kinfo_getproc.3 stable/9/lib/libutil/kinfo_getvmmap.3 Directory Properties: stable/9/lib/libutil/ (props changed) Modified: stable/10/lib/libutil/kinfo_getallproc.3 ============================================================================== --- stable/10/lib/libutil/kinfo_getallproc.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/10/lib/libutil/kinfo_getallproc.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd May 27, 2015 .Dt KINFO_GETALLPROC 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_proc * .Fn kinfo_getallproc "int *cntp" Modified: stable/10/lib/libutil/kinfo_getfile.3 ============================================================================== --- stable/10/lib/libutil/kinfo_getfile.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/10/lib/libutil/kinfo_getfile.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2008 +.Dd May 27, 2015 .Dt KINFO_GETFILE 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_file * .Fn kinfo_getfile "pid_t pid" "int *cntp" Modified: stable/10/lib/libutil/kinfo_getproc.3 ============================================================================== --- stable/10/lib/libutil/kinfo_getproc.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/10/lib/libutil/kinfo_getproc.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2013 +.Dd May 27, 2015 .Dt KINFO_GETPROC 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_proc * .Fn kinfo_getproc "pid_t pid" Modified: stable/10/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- stable/10/lib/libutil/kinfo_getvmmap.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/10/lib/libutil/kinfo_getvmmap.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2008 +.Dd May 27, 2015 .Dt KINFO_GETVMMAP 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_vmentry * .Fn kinfo_getvmmap "pid_t pid" "int *cntp" From owner-svn-src-all@freebsd.org Thu Sep 3 18:23:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E33A9CA66B; Thu, 3 Sep 2015 18:23:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 12AE58A; Thu, 3 Sep 2015 18:23:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83INAuc089038; Thu, 3 Sep 2015 18:23:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83INANS089034; Thu, 3 Sep 2015 18:23:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031823.t83INANS089034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 18:23:10 +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: r287439 - in stable: 10/lib/libutil 9/lib/libutil 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: Thu, 03 Sep 2015 18:23:11 -0000 Author: jhb Date: Thu Sep 3 18:23:07 2015 New Revision: 287439 URL: https://svnweb.freebsd.org/changeset/base/287439 Log: MFC 283622: Add to the SYNOPSIS of the kinfo_get*() functions since these functions all return types that are defined in that header. Modified: stable/9/lib/libutil/kinfo_getallproc.3 stable/9/lib/libutil/kinfo_getfile.3 stable/9/lib/libutil/kinfo_getproc.3 stable/9/lib/libutil/kinfo_getvmmap.3 Directory Properties: stable/9/lib/libutil/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libutil/kinfo_getallproc.3 stable/10/lib/libutil/kinfo_getfile.3 stable/10/lib/libutil/kinfo_getproc.3 stable/10/lib/libutil/kinfo_getvmmap.3 Directory Properties: stable/10/ (props changed) Modified: stable/9/lib/libutil/kinfo_getallproc.3 ============================================================================== --- stable/9/lib/libutil/kinfo_getallproc.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/9/lib/libutil/kinfo_getallproc.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd May 27, 2015 .Os .Dt KINFO_GETALLPROC 3 .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_proc * .Fn kinfo_getallproc "int *cntp" Modified: stable/9/lib/libutil/kinfo_getfile.3 ============================================================================== --- stable/9/lib/libutil/kinfo_getfile.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/9/lib/libutil/kinfo_getfile.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2008 +.Dd May 27, 2015 .Dt KINFO_GETFILE 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_file * .Fn kinfo_getfile "pid_t pid" "int *cntp" Modified: stable/9/lib/libutil/kinfo_getproc.3 ============================================================================== --- stable/9/lib/libutil/kinfo_getproc.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/9/lib/libutil/kinfo_getproc.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2013 +.Dd May 27, 2015 .Os .Dt KINFO_GETPROC 3 .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_proc * .Fn kinfo_getproc "pid_t pid" Modified: stable/9/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- stable/9/lib/libutil/kinfo_getvmmap.3 Thu Sep 3 18:14:31 2015 (r287438) +++ stable/9/lib/libutil/kinfo_getvmmap.3 Thu Sep 3 18:23:07 2015 (r287439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2008 +.Dd May 27, 2015 .Dt KINFO_GETVMMAP 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_vmentry * .Fn kinfo_getvmmap "pid_t pid" "int *cntp" From owner-svn-src-all@freebsd.org Thu Sep 3 18:27:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E55919CA86C; Thu, 3 Sep 2015 18:27:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D60927A0; Thu, 3 Sep 2015 18:27:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83IRe0G089282; Thu, 3 Sep 2015 18:27:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83IReKJ089280; Thu, 3 Sep 2015 18:27:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509031827.t83IReKJ089280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Sep 2015 18:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287440 - head/sys/ofed/include/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: Thu, 03 Sep 2015 18:27:41 -0000 Author: jhb Date: Thu Sep 3 18:27:39 2015 New Revision: 287440 URL: https://svnweb.freebsd.org/changeset/base/287440 Log: Currently the Linux character device mmap handling only supports mmap operations that map a single page that has an associated vm_page_t. This does not permit mapping larger regions (such as a PCI memory BAR) and it does not permit mapping addresses beyond the top of RAM (such as a 64-bit BAR located above the top of RAM). Instead of using a single OBJT_DEVICE object and passing the physaddr via the offset as a hack, create a new sglist and OBJT_SG object for each mmap request. The requested memory attribute is applied to the object thus affecting all pages mapped by the request. Reviewed by: hselasky, np MFC after: 1 week Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D3386 Modified: head/sys/ofed/include/linux/linux_compat.c head/sys/ofed/include/linux/mm.h Modified: head/sys/ofed/include/linux/linux_compat.c ============================================================================== --- head/sys/ofed/include/linux/linux_compat.c Thu Sep 3 18:23:07 2015 (r287439) +++ head/sys/ofed/include/linux/linux_compat.c Thu Sep 3 18:27:39 2015 (r287440) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -416,16 +417,6 @@ linux_dev_poll(struct cdev *dev, int eve } static int -linux_dev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int nprot, vm_memattr_t *memattr) -{ - - /* XXX memattr not honored. */ - *paddr = offset; - return (0); -} - -static int linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, int nprot) { @@ -433,36 +424,41 @@ linux_dev_mmap_single(struct cdev *dev, struct linux_file *filp; struct file *file; struct vm_area_struct vma; - vm_paddr_t paddr; - vm_page_t m; int error; file = curthread->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (ENODEV); - if (size != PAGE_SIZE) - return (EINVAL); if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; vma.vm_start = 0; - vma.vm_end = PAGE_SIZE; + vma.vm_end = size; vma.vm_pgoff = *offset / PAGE_SIZE; vma.vm_pfn = 0; vma.vm_page_prot = 0; if (filp->f_op->mmap) { error = -filp->f_op->mmap(filp, &vma); if (error == 0) { - paddr = (vm_paddr_t)vma.vm_pfn << PAGE_SHIFT; - *offset = paddr; - m = PHYS_TO_VM_PAGE(paddr); - *object = vm_pager_allocate(OBJT_DEVICE, dev, - PAGE_SIZE, nprot, *offset, curthread->td_ucred); - if (*object == NULL) - return (EINVAL); - if (vma.vm_page_prot != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, vma.vm_page_prot); + struct sglist *sg; + + sg = sglist_alloc(1, M_WAITOK); + sglist_append_phys(sg, + (vm_paddr_t)vma.vm_pfn << PAGE_SHIFT, vma.vm_len); + *object = vm_pager_allocate(OBJT_SG, sg, vma.vm_len, + nprot, 0, curthread->td_ucred); + if (*object == NULL) { + sglist_free(sg); + return (EINVAL); + } + *offset = 0; + if (vma.vm_page_prot != VM_MEMATTR_DEFAULT) { + VM_OBJECT_WLOCK(*object); + vm_object_set_memattr(*object, + vma.vm_page_prot); + VM_OBJECT_WUNLOCK(*object); + } } } else error = ENODEV; @@ -479,7 +475,6 @@ struct cdevsw linuxcdevsw = { .d_write = linux_dev_write, .d_ioctl = linux_dev_ioctl, .d_mmap_single = linux_dev_mmap_single, - .d_mmap = linux_dev_mmap, .d_poll = linux_dev_poll, }; Modified: head/sys/ofed/include/linux/mm.h ============================================================================== --- head/sys/ofed/include/linux/mm.h Thu Sep 3 18:23:07 2015 (r287439) +++ head/sys/ofed/include/linux/mm.h Thu Sep 3 18:27:39 2015 (r287440) @@ -40,6 +40,7 @@ struct vm_area_struct { vm_offset_t vm_end; vm_offset_t vm_pgoff; vm_paddr_t vm_pfn; /* PFN For mmap. */ + vm_size_t vm_len; /* length for mmap. */ vm_memattr_t vm_page_prot; }; @@ -78,6 +79,7 @@ io_remap_pfn_range(struct vm_area_struct { vma->vm_page_prot = prot; vma->vm_pfn = pfn; + vma->vm_len = size; return (0); } From owner-svn-src-all@freebsd.org Thu Sep 3 18:59:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F829C9555; Thu, 3 Sep 2015 18:59:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (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 2DA419; Thu, 3 Sep 2015 18:59:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by obqa2 with SMTP id a2so40575726obq.3; Thu, 03 Sep 2015 11:59:36 -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=1+sWQP9SksRP6JYz1LsGUoXnAhIJ+3vOYeaVl5kzqdQ=; b=GBe7j94LhgTl2x1m5dln+R9EfVFAL65YgqDYnfYQkT2ESFtPuikE9m/Coh5P/eF9Bv ueic8PunMZdG0UiUHcUYKf8+V2aDSqrXldHtmAB+QF5y//0ddTOU1JBlp7D1nvkvofIO TbHP8HmbNIMm6MLCrfc/HOFe+66/6KzlMSiIpKoV/yxrV4i5J3VfrseH+La+miyifVuh EU28+RGICDTYzKd5Wgtc8pqnZXVg6csTO4dhE4Vs1MAN9x9/nqn7Si+wRMQQw30zhs0A nUDHlC2b9W8jFa96JYY53ZKB/ZJSm6XWTZFi0/5Htd9eYkkOk2tKe37GldruUbmSUtOW 0U/w== MIME-Version: 1.0 X-Received: by 10.182.96.100 with SMTP id dr4mr14491993obb.49.1441306776330; Thu, 03 Sep 2015 11:59:36 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.79.140 with HTTP; Thu, 3 Sep 2015 11:59:36 -0700 (PDT) In-Reply-To: <201509020545.t825jmpT022570@repo.freebsd.org> References: <201509020545.t825jmpT022570@repo.freebsd.org> Date: Thu, 3 Sep 2015 12:59:36 -0600 X-Google-Sender-Auth: UTnswRGPgWWHxLdwXknGR4Adoqc Message-ID: Subject: Re: svn commit: r287392 - in stable/10: etc/mtree usr.bin usr.bin/timeout usr.bin/timeout/tests From: Alan Somers To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@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, 03 Sep 2015 18:59:37 -0000 On Tue, Sep 1, 2015 at 11:45 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Sep 2 05:45:47 2015 > New Revision: 287392 > URL: https://svnweb.freebsd.org/changeset/base/287392 > > Log: > MFC: r268745,r268746,r268747,r268748,r268749,r268861,r268750,r268751,r268763 > r273769,r273771,r276771,r278810 > > New BSDL timeout(1) utility compatible with GNU timeout > > Relnotes: yes > > Added: > stable/10/usr.bin/timeout/ > - copied from r268745, head/usr.bin/timeout/ > stable/10/usr.bin/timeout/tests/ > - copied from r273771, head/usr.bin/timeout/tests/ > Modified: > stable/10/etc/mtree/BSD.tests.dist > stable/10/usr.bin/Makefile > stable/10/usr.bin/timeout/Makefile > stable/10/usr.bin/timeout/timeout.1 > stable/10/usr.bin/timeout/timeout.c > Directory Properties: > stable/10/ (props changed) > It looks like you mismerged etc/mtree/BSD.tests.dist. Instead of creating "/usr/tests/usr.bin/timeout", you created "/usr/tests/usr.sbin/bmake/timeout". > Modified: stable/10/etc/mtree/BSD.tests.dist > ============================================================================== > --- stable/10/etc/mtree/BSD.tests.dist Wed Sep 2 02:50:41 2015 (r287391) > +++ stable/10/etc/mtree/BSD.tests.dist Wed Sep 2 05:45:47 2015 (r287392) > @@ -323,6 +323,8 @@ > .. > .. > .. > + timeout > + .. > variables > modifier_M > .. > From owner-svn-src-all@freebsd.org Thu Sep 3 19:09:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A4069C9A39 for ; Thu, 3 Sep 2015 19:09:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-f45.google.com (mail-qg0-f45.google.com [209.85.192.45]) (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 B52AC929 for ; Thu, 3 Sep 2015 19:09:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgx61 with SMTP id 61so36739406qgx.3 for ; Thu, 03 Sep 2015 12:09:18 -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:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=pSAa1R/pqF1sZgvGt076HW3uns0TmUb/SaSwcpqF4fU=; b=eExjyklsSvZBV4hCnxZUNZ4K7QkzK2PbFdYRrbuO8RpFW8o49JY6+BEo2KWn3xXRbJ GncP/UgmMyMKm7//C1oN46V+I0Fd+tg1zVa+FP8RkI6ij7D+kgD8mhPWoce+UZQ1UT8u HSyxblqVAG/00tA68CsTBxAjCpzc4a6WB5okVAsVamDm+GQCN1ZEMLjpUa/1UKKxZEfx FtrMCYyf8HzReYEGq9H+Z2w9eQKeJTG0WcMggYMgnQnJYyrRWERR+N6Hdd5d9OfZ+hpp WZ73nahHyVc1/92nG+A9pvO8i3F/HqT5QASg0TMmuZ4BqyYYVZqNOuoeEUuYVCO9TrsE M3Ng== X-Gm-Message-State: ALoCoQk/UnHmcNLFw0tI11zb/d0CIAlBJ5rqBODFD2FgF4sbJMH2egWgYZ+R+IUhNdvI6vaw+S3P MIME-Version: 1.0 X-Received: by 10.140.35.103 with SMTP id m94mr8896954qgm.50.1441307357942; Thu, 03 Sep 2015 12:09:17 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.80.164 with HTTP; Thu, 3 Sep 2015 12:09:17 -0700 (PDT) X-Originating-IP: [69.53.245.39] In-Reply-To: <20150903120134.GA75381@brick.home> References: <201509021408.t82E8h0Q038324@repo.freebsd.org> <20150902143702.GM1023@FreeBSD.org> <20150903120134.GA75381@brick.home> Date: Thu, 3 Sep 2015 13:09:17 -0600 X-Google-Sender-Auth: 1rxwOOAX8bZhMVZjo65Flhk7_80 Message-ID: Subject: Re: svn commit: r287396 - in head: sbin/bsdlabel sbin/dumpfs sbin/fdisk sbin/ffsinfo sbin/mdconfig sbin/newfs sbin/newfs_msdos sbin/newfs_nandfs sbin/reboot share/man/man4 share/man/man7 share/man/man8... From: Warner Losh To: Gleb Smirnoff , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Thu, 03 Sep 2015 19:09:25 -0000 On Thu, Sep 3, 2015 at 6:01 AM, Edward Tomasz Napierala wrote: > On 0902T1737, Gleb Smirnoff wrote: > > On Wed, Sep 02, 2015 at 02:08:43PM +0000, Edward Tomasz Napierala wrote: > > E> Author: trasz > > E> Date: Wed Sep 2 14:08:43 2015 > > E> New Revision: 287396 > > E> URL: https://svnweb.freebsd.org/changeset/base/287396 > > E> > > E> Log: > > E> It's 2015, and some people are still trying to use fdisk and then > > E> go asking what debug flags to set for GEOM to make it work. Advice > > E> them to use gpart(8) instead. > > E> > > E> Something similar should probably done with disklabel, > > E> but I need to rewrite the disklabel examples first. > > > > Thanks! > > > > Do we still have functionality of fdisk/bsdlabel that isn't covered > > by gpart? Can we simply remove the tools? > > I think it would be possible, but I don't plan to do it. Some > people are still happily using them, and they are used in scripts, > like the nanobsd build system. > Gpart still bogusly and steadfastly requires partitions to be aligned to the bogus cylinder boundaries that are largely made-up by different layers in the system (and are largely conflicting without any way to resolve the issue because some of the lie comes from hardware adapters). fdisk doesn't have this issue. Until gpart is fixed to make it's alignment to cylinder groups optional, fdisk must remain. As for nanobsd, I have plans to migrate them away from fdisk. None of the three conflicting patches I've gotten for it to date are quite right. Warner From owner-svn-src-all@freebsd.org Thu Sep 3 19:17:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EE999C9EB6 for ; Thu, 3 Sep 2015 19:17:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) (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 E0C1CE6D for ; Thu, 3 Sep 2015 19:17:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgez77 with SMTP id z77so37130392qge.1 for ; Thu, 03 Sep 2015 12:17:44 -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:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=OaeZaBT43pI/Itvb87bEUZPS885MW34lLX4OMfaa/+0=; b=Dv6qpml04XaSOw33RtZMk5FksbuaKIxJB+2u6DyquUm0vfRUlvNpVlNFczTtpTWzVA tqhQtuM/HheyjUP9iSTYySeG+wfMUIll8cF2vpuQqHRENNVU0wNAr7ExRFIeQ+7YEMwG 55sNjPqAj/Y8Kpo8/BJNOd7KRo3Pg2TPqw0uh3vEApv3TxrXaCeOpe2Inumgm9aRnT+w PyY2JJUsnGy0fUkIt90YITFsjSMr835zzdDV5VXBCnyvBj99mxAu57iWTLx7KTHfJZ0R OZbiUw/zE/i9HPjaL87BH5CvSPYwhdsm+NSO273gKOoM/32FsWTuc+g5VKQkiR3/kNXi 3ZeQ== X-Gm-Message-State: ALoCoQkkbn1up4dR8us1VdKZLLRxAdMKnwpituewDDHJUuohhEi4M5yVzC6CVNvVL69EvvstQ3ES MIME-Version: 1.0 X-Received: by 10.140.164.7 with SMTP id k7mr72283505qhk.40.1441307864242; Thu, 03 Sep 2015 12:17:44 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.80.164 with HTTP; Thu, 3 Sep 2015 12:17:44 -0700 (PDT) X-Originating-IP: [69.53.245.39] In-Reply-To: <20150903120606.GB75381@brick.home> References: <201509021729.t82HTULW036119@repo.freebsd.org> <20150903120606.GB75381@brick.home> Date: Thu, 3 Sep 2015 13:17:44 -0600 X-Google-Sender-Auth: PqRpKJljyluadjVRCLuG_xYAg_0 Message-ID: Subject: Re: svn commit: r287405 - head/sys/geom From: Warner Losh To: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Thu, 03 Sep 2015 19:17:51 -0000 On Thu, Sep 3, 2015 at 6:06 AM, Edward Tomasz Napiera=C5=82a wrote: > On 0902T1729, Warner Losh wrote: > > Author: imp > > Date: Wed Sep 2 17:29:30 2015 > > New Revision: 287405 > > URL: https://svnweb.freebsd.org/changeset/base/287405 > > > > Log: > > After the introduction of direct dispatch, the pacing code in g_down(= ) > > broke in two ways. One, the pacing variable was accessed in multiple > > threads in an unsafe way. Two, since large numbers of I/O could come > > down from the buf layer at one time, large numbers of allocation > > failures could happen all at once, resulting in a huge pace value tha= t > > would limit I/Os to 10 IOPS for minutes (or even hours) at a > > time. While a real solution to these problems requires substantial > > work (to go to a no-allocation after the first model, or to have some > > way to wait for more memory with some kind of reserve for pager and > > swapper requests), it is relatively easy to make this simplistic > > pacing less pathological. > > Shouldn't we emit some warning the first time this happens, to aid > in debugging strange IO performance degradation? Something like... No. We shouldn't. We should fix the damn underlying problem instead of polishing this turd of a rate limiter. It is really horrible by design and my patches make it less horrible only by degree. I know it is tempting, but this is no different than dropping a packet or many of the other places where we return ENOMEM and do retries or not based on the local policy. Well, apart from the horrible policy we implement.... > > > @@ -688,7 +699,7 @@ g_io_deliver(struct bio *bp, int error) > > bp->bio_driver2 =3D NULL; > > bp->bio_pflags =3D 0; > > g_io_request(bp, cp); > > if (warned_about_pace =3D=3D 0) { > printf("WARNING: GEOM io allocation failed; expect reduce= d > IO performance\n"); > warned_about_pace =3D 1; > } > We have no good facility to pace these messages out, and failures are typically very transient. The old code would explode a shortage that was < 1s into reduced I/O performance for minutes or hours (yes, hours). The new code typically will see shortages in the millisecond to tens of millisecond duration. Adding this would be just noise. We don't whine when we drop packets in the network layer. We just provide a count of dropped packets. This also causes a performance degradation. There's adequate statistical reporting in uma to see if this is happening. Anyway, I will spend exactly 0 more energy on polishing the POS pace turd. I'll spend somewhat more time and energy on exploring real fixes to this issue. Warner > - pace++; > > + pace =3D 1; > > return; > > } > > From owner-svn-src-all@freebsd.org Thu Sep 3 19:42:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 227AC9CA919; Thu, 3 Sep 2015 19:42:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.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 124B5DC0; Thu, 3 Sep 2015 19:42:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83JgvJu023305; Thu, 3 Sep 2015 19:42:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83JgvZo023303; Thu, 3 Sep 2015 19:42:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201509031942.t83JgvZo023303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 3 Sep 2015 19:42:57 +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: r287441 - in stable/10: etc/mtree usr.sbin/fstyp usr.sbin/fstyp/tests 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, 03 Sep 2015 19:42:58 -0000 Author: asomers Date: Thu Sep 3 19:42:56 2015 New Revision: 287441 URL: https://svnweb.freebsd.org/changeset/base/287441 Log: MFC r286964 Add ATF functional tests for fstyp(8). No ZFS or GELI tests yet. Added: stable/10/usr.sbin/fstyp/tests/ - copied from r286964, head/usr.sbin/fstyp/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.sbin/fstyp/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Sep 3 18:27:39 2015 (r287440) +++ stable/10/etc/mtree/BSD.tests.dist Thu Sep 3 19:42:56 2015 (r287441) @@ -388,6 +388,8 @@ usr.sbin etcupdate .. + fstyp + .. newsyslog .. nmtree Modified: stable/10/usr.sbin/fstyp/Makefile ============================================================================== --- stable/10/usr.sbin/fstyp/Makefile Thu Sep 3 18:27:39 2015 (r287440) +++ stable/10/usr.sbin/fstyp/Makefile Thu Sep 3 19:42:56 2015 (r287441) @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + PROG= fstyp SRCS= fstyp.c ext2fs.c cd9660.c msdosfs.c ntfs.c ufs.c MAN= fstyp.8 WARNS= 6 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include From owner-svn-src-all@freebsd.org Thu Sep 3 20:32:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D978F9CA005; Thu, 3 Sep 2015 20:32:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C543D97F; Thu, 3 Sep 2015 20:32:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83KWCSf043708; Thu, 3 Sep 2015 20:32:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83KWAtl043698; Thu, 3 Sep 2015 20:32:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201509032032.t83KWAtl043698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 3 Sep 2015 20:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287442 - in head: lib/libprocstat lib/libutil share/man/man5 sys/kern 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, 03 Sep 2015 20:32:13 -0000 Author: cem Date: Thu Sep 3 20:32:10 2015 New Revision: 287442 URL: https://svnweb.freebsd.org/changeset/base/287442 Log: Detect badly behaved coredump note helpers Coredump notes depend on being able to invoke dump routines twice; once in a dry-run mode to get the size of the note, and another to actually emit the note to the corefile. When a note helper emits a different length section the second time around than the length it requested the first time, the kernel produces a corrupt coredump. NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' fd table via vn_fullpath. As vnodes may move around during dump, this is racy. So: - Detect badly behaved notes in putnote() and pad underfilled notes. - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to exercise the NT_PROCSTAT_FILES corruption. It simply picks random lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to disable kinfo packing for PROCSTAT_FILES notes. This should avoid both FILES note corruption and truncation, even if filenames change, at the cost of about 1 kiB in padding bloat per open fd. Document the new sysctl in core.5. - Fix note_procstat_files to self-limit in the 2nd pass. Since sometimes this will result in a short write, pad up to our advertised size. This addresses note corruption, at the risk of sometimes truncating the last several fd info entries. - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the zero padding. With suggestions from: bjk, jhb, kib, wblock Approved by: markj (mentor) Relnotes: yes Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3548 Modified: head/lib/libprocstat/libprocstat.c head/lib/libutil/kinfo_getfile.c head/share/man/man5/core.5 head/sys/kern/imgact_elf.c head/sys/kern/kern_descrip.c head/sys/kern/vfs_vnops.c head/sys/sys/user.h Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu Sep 3 19:42:56 2015 (r287441) +++ head/lib/libprocstat/libprocstat.c Thu Sep 3 20:32:10 2015 (r287442) @@ -767,6 +767,8 @@ kinfo_getfile_core(struct procstat_core eb = buf + len; while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; bp += kf->kf_structsize; cnt++; } @@ -782,6 +784,8 @@ kinfo_getfile_core(struct procstat_core /* Pass 2: unpack */ while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kf, kf->kf_structsize); /* Advance to next packed record */ Modified: head/lib/libutil/kinfo_getfile.c ============================================================================== --- head/lib/libutil/kinfo_getfile.c Thu Sep 3 19:42:56 2015 (r287441) +++ head/lib/libutil/kinfo_getfile.c Thu Sep 3 20:32:10 2015 (r287442) @@ -44,6 +44,8 @@ kinfo_getfile(pid_t pid, int *cntp) eb = buf + len; while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; bp += kf->kf_structsize; cnt++; } @@ -59,6 +61,8 @@ kinfo_getfile(pid_t pid, int *cntp) /* Pass 2: unpack */ while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kf, kf->kf_structsize); /* Advance to next packed record */ Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Thu Sep 3 19:42:56 2015 (r287441) +++ head/share/man/man5/core.5 Thu Sep 3 20:32:10 2015 (r287442) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 8, 2015 +.Dd September 2, 2015 .Dt CORE 5 .Os .Sh NAME @@ -120,6 +120,16 @@ Compressed core files will have a suffix .Ql .gz appended to them. .El +.Sh NOTES +Corefiles are written with open file descriptor information as an ELF note. +By default, file paths are packed to only use as much space as needed. +However, file paths can change at any time, including during core dump, +and this can result in truncated file descriptor data. +.Pp +All file descriptor information can be preserved by disabling packing. +This potentially wastes up to PATH_MAX bytes per open fd. +Packing is disabled with +.Dl sysctl kern.coredump_pack_fileinfo=0 . .Sh EXAMPLES In order to store all core images in per-user private areas under .Pa /var/coredumps , Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Sep 3 19:42:56 2015 (r287441) +++ head/sys/kern/imgact_elf.c Thu Sep 3 20:32:10 2015 (r287442) @@ -1677,7 +1677,8 @@ static void __elfN(putnote)(struct note_info *ninfo, struct sbuf *sb) { Elf_Note note; - ssize_t old_len; + ssize_t old_len, sect_len; + size_t new_len, descsz, i; if (ninfo->type == -1) { ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); @@ -1696,7 +1697,33 @@ __elfN(putnote)(struct note_info *ninfo, return; sbuf_start_section(sb, &old_len); ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); - sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); + sect_len = sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); + if (sect_len < 0) + return; + + new_len = (size_t)sect_len; + descsz = roundup(note.n_descsz, ELF_NOTE_ROUNDSIZE); + if (new_len < descsz) { + /* + * It is expected that individual note emitters will correctly + * predict their expected output size and fill up to that size + * themselves, padding in a format-specific way if needed. + * However, in case they don't, just do it here with zeros. + */ + for (i = 0; i < descsz - new_len; i++) + sbuf_putc(sb, 0); + } else if (new_len > descsz) { + /* + * We can't always truncate sb -- we may have drained some + * of it already. + */ + KASSERT(new_len == descsz, ("%s: Note type %u changed as we " + "read it (%zu > %zu). Since it is longer than " + "expected, this coredump's notes are corrupt. THIS " + "IS A BUG in the note_procstat routine for type %u.\n", + __func__, (unsigned)note.n_type, new_len, descsz, + (unsigned)note.n_type)); + } } /* @@ -1875,29 +1902,56 @@ __elfN(note_procstat_proc)(void *arg, st CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); #endif +static int pack_fileinfo = 1; +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_fileinfo, CTLFLAG_RWTUN, + &pack_fileinfo, 0, + "Enable file path packing in 'procstat -f' coredump notes"); + static void note_procstat_files(void *arg, struct sbuf *sb, size_t *sizep) { struct proc *p; - size_t size; - int structsize; + size_t size, sect_sz, i; + ssize_t start_len, sect_len; + int structsize, filedesc_flags; + + if (pack_fileinfo) + filedesc_flags = KERN_FILEDESC_PACK_KINFO; + else + filedesc_flags = 0; p = (struct proc *)arg; + structsize = sizeof(struct kinfo_file); if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); sbuf_set_drain(sb, sbuf_drain_count, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_filedesc_out(p, sb, -1); + kern_proc_filedesc_out(p, sb, -1, filedesc_flags); sbuf_finish(sb); sbuf_delete(sb); *sizep = size; } else { - structsize = sizeof(struct kinfo_file); + sbuf_start_section(sb, &start_len); + sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_filedesc_out(p, sb, -1); + kern_proc_filedesc_out(p, sb, *sizep - sizeof(structsize), + filedesc_flags); + + sect_len = sbuf_end_section(sb, start_len, 0, 0); + if (sect_len < 0) + return; + sect_sz = sect_len; + + KASSERT(sect_sz <= *sizep, + ("kern_proc_filedesc_out did not respect maxlen; " + "requested %zu, got %zu", *sizep - sizeof(structsize), + sect_sz - sizeof(structsize))); + + for (i = 0; i < *sizep - sect_sz && sb->s_error == 0; i++) + sbuf_putc(sb, 0); } } Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Sep 3 19:42:56 2015 (r287441) +++ head/sys/kern/kern_descrip.c Thu Sep 3 20:32:10 2015 (r287442) @@ -3283,7 +3283,7 @@ pack_kinfo(struct kinfo_file *kif) static void export_file_to_kinfo(struct file *fp, int fd, cap_rights_t *rightsp, - struct kinfo_file *kif, struct filedesc *fdp) + struct kinfo_file *kif, struct filedesc *fdp, int flags) { int error; @@ -3307,12 +3307,15 @@ export_file_to_kinfo(struct file *fp, in error = fo_fill_kinfo(fp, kif, fdp); if (error == 0) kif->kf_status |= KF_ATTR_VALID; - pack_kinfo(kif); + if ((flags & KERN_FILEDESC_PACK_KINFO) != 0) + pack_kinfo(kif); + else + kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t)); } static void export_vnode_to_kinfo(struct vnode *vp, int fd, int fflags, - struct kinfo_file *kif) + struct kinfo_file *kif, int flags) { int error; @@ -3327,7 +3330,10 @@ export_vnode_to_kinfo(struct vnode *vp, kif->kf_fd = fd; kif->kf_ref_count = -1; kif->kf_offset = -1; - pack_kinfo(kif); + if ((flags & KERN_FILEDESC_PACK_KINFO) != 0) + pack_kinfo(kif); + else + kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t)); vrele(vp); } @@ -3336,6 +3342,7 @@ struct export_fd_buf { struct sbuf *sb; ssize_t remainder; struct kinfo_file kif; + int flags; }; static int @@ -3363,7 +3370,8 @@ export_file_to_sb(struct file *fp, int f if (efbuf->remainder == 0) return (0); - export_file_to_kinfo(fp, fd, rightsp, &efbuf->kif, efbuf->fdp); + export_file_to_kinfo(fp, fd, rightsp, &efbuf->kif, efbuf->fdp, + efbuf->flags); FILEDESC_SUNLOCK(efbuf->fdp); error = export_kinfo_to_sb(efbuf); FILEDESC_SLOCK(efbuf->fdp); @@ -3380,7 +3388,7 @@ export_vnode_to_sb(struct vnode *vp, int return (0); if (efbuf->fdp != NULL) FILEDESC_SUNLOCK(efbuf->fdp); - export_vnode_to_kinfo(vp, fd, fflags, &efbuf->kif); + export_vnode_to_kinfo(vp, fd, fflags, &efbuf->kif, efbuf->flags); error = export_kinfo_to_sb(efbuf); if (efbuf->fdp != NULL) FILEDESC_SLOCK(efbuf->fdp); @@ -3393,7 +3401,8 @@ export_vnode_to_sb(struct vnode *vp, int * Takes a locked proc as argument, and returns with the proc unlocked. */ int -kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) +kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags) { struct file *fp; struct filedesc *fdp; @@ -3425,6 +3434,7 @@ kern_proc_filedesc_out(struct proc *p, efbuf->fdp = NULL; efbuf->sb = sb; efbuf->remainder = maxlen; + efbuf->flags = flags; if (tracevp != NULL) export_vnode_to_sb(tracevp, KF_FD_TYPE_TRACE, FREAD | FWRITE, efbuf); @@ -3501,7 +3511,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER return (error); } maxlen = req->oldptr != NULL ? req->oldlen : -1; - error = kern_proc_filedesc_out(p, &sb, maxlen); + error = kern_proc_filedesc_out(p, &sb, maxlen, + KERN_FILEDESC_PACK_KINFO); error2 = sbuf_finish(&sb); sbuf_delete(&sb); return (error != 0 ? error : error2); @@ -3541,7 +3552,7 @@ export_vnode_for_osysctl(struct vnode *v vref(vp); FILEDESC_SUNLOCK(fdp); - export_vnode_to_kinfo(vp, type, 0, kif); + export_vnode_to_kinfo(vp, type, 0, kif, KERN_FILEDESC_PACK_KINFO); kinfo_to_okinfo(kif, okif); error = SYSCTL_OUT(req, okif, sizeof(*okif)); FILEDESC_SLOCK(fdp); @@ -3584,7 +3595,8 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; - export_file_to_kinfo(fp, i, NULL, kif, fdp); + export_file_to_kinfo(fp, i, NULL, kif, fdp, + KERN_FILEDESC_PACK_KINFO); FILEDESC_SUNLOCK(fdp); kinfo_to_okinfo(kif, okif); error = SYSCTL_OUT(req, okif, sizeof(*okif)); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Sep 3 19:42:56 2015 (r287441) +++ head/sys/kern/vfs_vnops.c Thu Sep 3 20:32:10 2015 (r287442) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2379,6 +2380,24 @@ vn_fill_kinfo(struct file *fp, struct ki return (error); } +static inline void +vn_fill_junk(struct kinfo_file *kif) +{ + size_t len, olen; + + /* + * Simulate vn_fullpath returning changing values for a given + * vp during e.g. coredump. + */ + len = (arc4random() % (sizeof(kif->kf_path) - 2)) + 1; + olen = strlen(kif->kf_path); + if (len < olen) + strcpy(&kif->kf_path[len - 1], "$"); + else + for (; olen < len; olen++) + strcpy(&kif->kf_path[olen], "A"); +} + int vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif) { @@ -2396,6 +2415,10 @@ vn_fill_kinfo_vnode(struct vnode *vp, st if (freepath != NULL) free(freepath, M_TEMP); + KFAIL_POINT_CODE(DEBUG_FP, fill_kinfo_vnode__random_path, + vn_fill_junk(kif); + ); + /* * Retrieve vnode attributes. */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Thu Sep 3 19:42:56 2015 (r287441) +++ head/sys/sys/user.h Thu Sep 3 20:32:10 2015 (r287442) @@ -539,6 +539,8 @@ struct kinfo_sigtramp { #define KERN_PROC_NOTHREADS 0x1 #define KERN_PROC_MASK32 0x2 +/* Flags for kern_proc_filedesc_out. */ +#define KERN_FILEDESC_PACK_KINFO 0x00000001U struct sbuf; /* @@ -550,7 +552,8 @@ struct sbuf; * to be locked on enter. On return the process is unlocked. */ -int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags); int kern_proc_cwd_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); From owner-svn-src-all@freebsd.org Thu Sep 3 20:47:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 087759CA733; Thu, 3 Sep 2015 20:47:14 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 ED06B2FB; Thu, 3 Sep 2015 20:47:13 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83KlDPX048396; Thu, 3 Sep 2015 20:47:13 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83KlDww048395; Thu, 3 Sep 2015 20:47:13 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509032047.t83KlDww048395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Thu, 3 Sep 2015 20:47: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: r287443 - stable/10/etc/mtree 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, 03 Sep 2015 20:47:14 -0000 Author: rodrigc Date: Thu Sep 3 20:47:13 2015 New Revision: 287443 URL: https://svnweb.freebsd.org/changeset/base/287443 Log: Put timeout directory in correct place Modified: stable/10/etc/mtree/BSD.tests.dist Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Sep 3 20:32:10 2015 (r287442) +++ stable/10/etc/mtree/BSD.tests.dist Thu Sep 3 20:47:13 2015 (r287443) @@ -323,8 +323,6 @@ .. .. .. - timeout - .. variables modifier_M .. @@ -370,6 +368,8 @@ regress.multitest.out .. .. + timeout + .. tr .. truncate From owner-svn-src-all@freebsd.org Thu Sep 3 22:07:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A3F29CA840; Thu, 3 Sep 2015 22:07:49 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (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 B53891B55; Thu, 3 Sep 2015 22:07:48 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wicfx3 with SMTP id fx3so4350066wic.1; Thu, 03 Sep 2015 15:07:47 -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=slOYgfhCl1yqIfqUj8pCVowOJC7OqJ9QPdDWnNihNN4=; b=V5ACO9oACmIB7UjvUBxKCzIrxx453+3MhlGiYl6gu2hE2R6UesBPmeNgqBmzM4Uy0f 5F2V0XkFlLF7W3WNBcn6HKbWDO8M3uMAgdrqjyuHw5g+IRl+rl0yqMp1JMdIcZfoH4Zv ht42Kli6kSvHosm1YlXKAExkPXbUHzP+3qldrmSHbAAAjq+su8f1GVdwCj1Y471yYvsn S7jAUYbs2qKfvLmPjaznCUbIgO+/uNfqf16rcJ+VeChrzUhplRf1DSvdBRdbcte4lFl4 l0eSxkNquLh/m3pf+6uClPKUSsuxhDqxBb91+zHQiTz+cVefxLIa60TfAHg3ERvhz0KG tQ7Q== X-Received: by 10.194.192.99 with SMTP id hf3mr404174wjc.78.1441318066851; Thu, 03 Sep 2015 15:07:46 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id f7sm421030wij.17.2015.09.03.15.07.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 15:07:46 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 4 Sep 2015 00:07:44 +0200 From: Baptiste Daroussin To: Craig Rodrigues Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r287443 - stable/10/etc/mtree Message-ID: <20150903220744.GJ61752@ivaldir.etoilebsd.net> References: <201509032047.t83KlDww048395@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUvfsPTz/SzOZDdw" Content-Disposition: inline In-Reply-To: <201509032047.t83KlDww048395@repo.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: Thu, 03 Sep 2015 22:07:49 -0000 --fUvfsPTz/SzOZDdw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 03, 2015 at 08:47:13PM +0000, Craig Rodrigues wrote: > Author: rodrigc > Date: Thu Sep 3 20:47:13 2015 > New Revision: 287443 > URL: https://svnweb.freebsd.org/changeset/base/287443 >=20 > Log: > Put timeout directory in correct place >=20 Thank you and also thanks to Alan Somers who reported me the issue when was about to fix when I noticed you just did it. Best regards, Bapt --fUvfsPTz/SzOZDdw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXoxLAACgkQ8kTtMUmk6ExLPQCdGlOoq2VKqCmWJ6ELgEXIMrij RDgAn3qSlk2zOJksT18KIb1FqJ7J+wW9 =D1rr -----END PGP SIGNATURE----- --fUvfsPTz/SzOZDdw-- From owner-svn-src-all@freebsd.org Thu Sep 3 22:15:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 664109CABE1; Thu, 3 Sep 2015 22:15:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3D77D9C; Thu, 3 Sep 2015 22:15:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83MFvpb085730; Thu, 3 Sep 2015 22:15:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83MFvoB085729; Thu, 3 Sep 2015 22:15:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201509032215.t83MFvoB085729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Sep 2015 22:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287444 - 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, 03 Sep 2015 22:15:57 -0000 Author: tuexen Date: Thu Sep 3 22:15:56 2015 New Revision: 287444 URL: https://svnweb.freebsd.org/changeset/base/287444 Log: Fix a bug where two SHUTDOWN_ACK chunks were sent if a SHUTDOWN chunk was received acking all outstanding data. Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Sep 3 20:47:13 2015 (r287443) +++ head/sys/netinet/sctp_input.c Thu Sep 3 22:15:56 2015 (r287444) @@ -867,6 +867,7 @@ sctp_handle_shutdown(struct sctp_shutdow { struct sctp_association *asoc; int some_on_streamwheel; + int old_state; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -885,11 +886,11 @@ sctp_handle_shutdown(struct sctp_shutdow if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_shutdown_chunk)) { /* Shutdown NOT the expected size */ return; - } else { - sctp_update_acked(stcb, cp, abort_flag); - if (*abort_flag) { - return; - } + } + old_state = SCTP_GET_STATE(asoc); + sctp_update_acked(stcb, cp, abort_flag); + if (*abort_flag) { + return; } if (asoc->control_pdapi) { /* @@ -959,12 +960,16 @@ sctp_handle_shutdown(struct sctp_shutdow (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown_ack(stcb, net); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, - stcb, net); + if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) { + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); + sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown_ack(stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, + stcb->sctp_ep, stcb, net); + } else if (old_state == SCTP_STATE_SHUTDOWN_ACK_SENT) { + sctp_send_shutdown_ack(stcb, net); + } } } From owner-svn-src-all@freebsd.org Fri Sep 4 00:14:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2317D9CA6DC; Fri, 4 Sep 2015 00:14:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 110BD147B; Fri, 4 Sep 2015 00:14:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t840EPGi034823; Fri, 4 Sep 2015 00:14:25 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t840ELno034811; Fri, 4 Sep 2015 00:14:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040014.t840ELno034811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 00:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools 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, 04 Sep 2015 00:14:25 -0000 Author: delphij Date: Fri Sep 4 00:14:20 2015 New Revision: 287445 URL: https://svnweb.freebsd.org/changeset/base/287445 Log: Expose an interface to determine if an ACE is inherited. Submitted by: sef Reviewed by: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3540 Modified: head/bin/setfacl/setfacl.1 head/lib/libc/posix1e/acl_add_flag_np.3 head/lib/libc/posix1e/acl_support_nfs4.c head/share/man/man9/acl.9 head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h head/sys/kern/subr_acl_nfs4.c head/sys/sys/acl.h head/tools/regression/acltools/tools-crossfs.test head/tools/regression/acltools/tools-nfs4-psarc.test head/tools/regression/acltools/tools-nfs4-trivial.test head/tools/regression/acltools/tools-nfs4.test Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Thu Sep 3 22:15:56 2015 (r287444) +++ head/bin/setfacl/setfacl.1 Fri Sep 4 00:14:20 2015 (r287445) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2013 +.Dd September 4, 2015 .Dt SETFACL 1 .Os .Sh NAME @@ -378,9 +378,11 @@ dir_inherit inherit_only .It n no_propagate +.It I +inherited .El .Pp -Inheritance flags may be only set on directories. +Other than the "inherited" flag, inheritance flags may be only set on directories. .It Ar "ACL type" The ACL type field is either .Dq Li allow Modified: head/lib/libc/posix1e/acl_add_flag_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_add_flag_np.3 Thu Sep 3 22:15:56 2015 (r287444) +++ head/lib/libc/posix1e/acl_add_flag_np.3 Fri Sep 4 00:14:20 2015 (r287445) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2014 +.Dd September 4, 2015 .Dt ACL_ADD_FLAG_NP 3 .Os .Sh NAME @@ -56,6 +56,7 @@ Valid values are: .It ACL_ENTRY_DIRECTORY_INHERIT Ta "Will be inherited by directories." .It ACL_ENTRY_NO_PROPAGATE_INHERIT Ta "Will not propagate." .It ACL_ENTRY_INHERIT_ONLY Ta "Inherit-only." +.It ACL_ENTRY_INHERITED Ta "Inherited from parent" .El .Sh RETURN VALUES .Rv -std acl_add_flag_np Modified: head/lib/libc/posix1e/acl_support_nfs4.c ============================================================================== --- head/lib/libc/posix1e/acl_support_nfs4.c Thu Sep 3 22:15:56 2015 (r287444) +++ head/lib/libc/posix1e/acl_support_nfs4.c Fri Sep 4 00:14:20 2015 (r287445) @@ -48,6 +48,7 @@ struct flagnames_struct a_flags[] = { ACL_ENTRY_NO_PROPAGATE_INHERIT, "no_propagate", 'n'}, { ACL_ENTRY_SUCCESSFUL_ACCESS, "successfull_access", 'S'}, { ACL_ENTRY_FAILED_ACCESS, "failed_access", 'F'}, + { ACL_ENTRY_INHERITED, "inherited", 'I' }, /* * There is no ACE_IDENTIFIER_GROUP here - SunOS does not show it * in the "flags" field. There is no ACE_OWNER, ACE_GROUP or Modified: head/share/man/man9/acl.9 ============================================================================== --- head/share/man/man9/acl.9 Thu Sep 3 22:15:56 2015 (r287444) +++ head/share/man/man9/acl.9 Fri Sep 4 00:14:20 2015 (r287445) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2009 +.Dd September 4, 2015 .Dt ACL 9 .Os .Sh NAME @@ -203,7 +203,13 @@ The following values are valid: .It Dv ACL_ENTRY_DIRECTORY_INHERIT .It Dv ACL_ENTRY_NO_PROPAGATE_INHERIT .It Dv ACL_ENTRY_INHERIT_ONLY +.It Dv ACL_ENTRY_INHERITED .El +The +.Dv ACL_ENTRY_INHERITED +flag is set on an ACE that has been inherited from its parent. +It may also be set programmatically, and is valid on both files +and directories. .El .Sh SEE ALSO .Xr acl 3 , Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Thu Sep 3 22:15:56 2015 (r287444) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Fri Sep 4 00:14:20 2015 (r287445) @@ -64,6 +64,8 @@ struct zfs2bsd flags[] = {{ACE_FILE_INHE ACL_ENTRY_NO_PROPAGATE_INHERIT}, {ACE_INHERIT_ONLY_ACE, ACL_ENTRY_INHERIT_ONLY}, + {ACE_INHERITED_ACE, + ACL_ENTRY_INHERITED}, {ACE_SUCCESSFUL_ACCESS_ACE_FLAG, ACL_ENTRY_SUCCESSFUL_ACCESS}, {ACE_FAILED_ACCESS_ACE_FLAG, Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) @@ -189,11 +189,12 @@ typedef struct ace_object { ACE_DIRECTORY_INHERIT_ACE | \ ACE_NO_PROPAGATE_INHERIT_ACE | \ ACE_INHERIT_ONLY_ACE | \ + ACE_INHERITED_ACE | \ ACE_IDENTIFIER_GROUP) #define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE| \ ACE_IDENTIFIER_GROUP) -#define ACE_INHERIT_FLAGS (ACE_FILE_INHERIT_ACE| \ +#define ACE_INHERIT_FLAGS (ACE_FILE_INHERIT_ACE| ACL_INHERITED_ACE| \ ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|ACE_INHERIT_ONLY_ACE) /* cmd args to acl(2) for aclent_t */ Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Thu Sep 3 22:15:56 2015 (r287444) +++ head/sys/kern/subr_acl_nfs4.c Fri Sep 4 00:14:20 2015 (r287445) @@ -1068,6 +1068,7 @@ acl_nfs4_inherit_entries(const struct ac child_aclp->acl_cnt++; entry->ae_flags &= ~ACL_ENTRY_INHERIT_ONLY; + entry->ae_flags |= ACL_ENTRY_INHERITED; /* * If the type of the ACE is neither ALLOW nor DENY, Modified: head/sys/sys/acl.h ============================================================================== --- head/sys/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) +++ head/sys/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) @@ -249,11 +249,12 @@ typedef void *acl_t; #define ACL_ENTRY_INHERIT_ONLY 0x0008 #define ACL_ENTRY_SUCCESSFUL_ACCESS 0x0010 #define ACL_ENTRY_FAILED_ACCESS 0x0020 +#define ACL_ENTRY_INHERITED 0x0080 #define ACL_FLAGS_BITS (ACL_ENTRY_FILE_INHERIT | \ ACL_ENTRY_DIRECTORY_INHERIT | ACL_ENTRY_NO_PROPAGATE_INHERIT | \ ACL_ENTRY_INHERIT_ONLY | ACL_ENTRY_SUCCESSFUL_ACCESS | \ - ACL_ENTRY_FAILED_ACCESS) + ACL_ENTRY_FAILED_ACCESS | ACL_ENTRY_INHERITED) /* * Undefined value in ae_id field. ae_id should be set to this value Modified: head/tools/regression/acltools/tools-crossfs.test ============================================================================== --- head/tools/regression/acltools/tools-crossfs.test Thu Sep 3 22:15:56 2015 (r287444) +++ head/tools/regression/acltools/tools-crossfs.test Fri Sep 4 00:14:20 2015 (r287445) @@ -43,9 +43,9 @@ $ umask 022 $ touch nfs4/xxx $ getfacl -nq nfs4/xxx -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ touch posix/xxx $ getfacl -nq posix/xxx @@ -96,10 +96,10 @@ $ ls -l posix/xxx | cut -d' ' -f1 $ mv posix/yyy nfs4/xxx > mv: failed to set acl entries for nfs4/xxx: Invalid argument $ getfacl -nq nfs4/xxx -> owner@:-wxp----------:------:deny -> owner@:r-----aARWcCos:------:allow -> group@:rwxp--a-R-c--s:------:allow -> everyone@:rw-p--a-R-c--s:------:allow +> owner@:-wxp----------:-------:deny +> owner@:r-----aARWcCos:-------:allow +> group@:rwxp--a-R-c--s:-------:allow +> everyone@:rw-p--a-R-c--s:-------:allow $ ls -l nfs4/xxx | cut -d' ' -f1 > -r--rwxrw- @@ -110,11 +110,11 @@ $ touch nfs4/xxx $ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx $ mv nfs4/xxx nfs4/yyy $ getfacl -nq nfs4/yyy -> user:42:--x-----------:------:allow -> group:43:-w------------:------:allow -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:42:--x-----------:-------:allow +> group:43:-w------------:-------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ ls -l nfs4/yyy | cut -d' ' -f1 > -rw-r--r--+ @@ -261,14 +261,14 @@ $ chmod 543 nfs4/xxx $ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx $ cp -p nfs4/xxx nfs4/yyy $ getfacl -nq nfs4/yyy -> user:42:--x-----------:------:allow -> group:43:-w------------:------:allow -> owner@:--x-----------:------:allow -> owner@:-w-p----------:------:deny -> group@:-wxp----------:------:deny -> owner@:r-x---aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:-wxp--a-R-c--s:------:allow +> user:42:--x-----------:-------:allow +> group:43:-w------------:-------:allow +> owner@:--x-----------:-------:allow +> owner@:-w-p----------:-------:deny +> group@:-wxp----------:-------:deny +> owner@:r-x---aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:-wxp--a-R-c--s:-------:allow $ ls -l nfs4/yyy | cut -d' ' -f1 > -r-xr---wx+ Modified: head/tools/regression/acltools/tools-nfs4-psarc.test ============================================================================== --- head/tools/regression/acltools/tools-nfs4-psarc.test Thu Sep 3 22:15:56 2015 (r287444) +++ head/tools/regression/acltools/tools-nfs4-psarc.test Fri Sep 4 00:14:20 2015 (r287445) @@ -42,14 +42,14 @@ $ getfacl xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ getfacl -q xxx -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow # Check verbose mode formatting. $ getfacl -v xxx @@ -66,11 +66,11 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test user and group name resolving. $ rm xxx @@ -80,11 +80,11 @@ $ getfacl xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> user:root:-----------C--:------:allow -> group:daemon:----------c---:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> user:root:-----------C--:-------:allow +> group:daemon:----------c---:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Check whether ls correctly marks files with "+". $ ls -l xxx | cut -d' ' -f1 @@ -96,10 +96,10 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test setfacl -m. $ setfacl -a0 everyone@:rwx:deny xxx @@ -110,26 +110,26 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> owner@:rw-p--aARWcCos:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:r-----a-R-c--s:------:allow +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> owner@:rw-p--aARWcCos:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test getfacl -i. $ getfacl -i xxx > # file: xxx > # owner: root > # group: wheel -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> owner@:rw-p--aARWcCos:------:allow -> user:root:-----------C--:------:allow:0 -> group:daemon:----------c---:------:deny:1 -> everyone@:r-----a-R-c--s:------:allow +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> owner@:rw-p--aARWcCos:-------:allow +> user:root:-----------C--:-------:allow:0 +> group:daemon:----------c---:-------:deny:1 +> everyone@:r-----a-R-c--s:-------:allow # Make sure cp without any flags does not copy copy the ACL. $ cp xxx yyy @@ -143,13 +143,13 @@ $ getfacl -n yyy > # file: yyy > # owner: root > # group: wheel -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> owner@:rw-p--aARWcCos:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:r-----a-R-c--s:------:allow +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> owner@:rw-p--aARWcCos:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:r-----a-R-c--s:-------:allow $ rm yyy @@ -159,10 +159,10 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test setfacl -b. $ setfacl -b xxx @@ -170,9 +170,9 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ ls -l xxx | cut -d' ' -f1 > -rw-r--r-- @@ -196,23 +196,23 @@ $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 $ getfacl -nq nnn xxx yyy zzz > getfacl: nnn: stat() failed: No such file or directory -> user:42:--x-----------:------:allow -> group:43:-w------------:------:allow -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:42:--x-----------:-------:allow +> group:43:-w------------:-------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow > -> user:42:--x-----------:------:allow -> group:43:-w------------:------:allow -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:42:--x-----------:-------:allow +> group:43:-w------------:-------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow > -> user:42:--x-----------:------:allow -> group:43:-w------------:------:allow -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:42:--x-----------:-------:allow +> group:43:-w------------:-------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ setfacl -b nnn xxx yyy zzz > setfacl: nnn: stat() failed: No such file or directory @@ -233,9 +233,9 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> group@:------a-R-c--s:------:allow -> everyone@:------a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:------a-R-c--s:-------:allow +> everyone@:------a-R-c--s:-------:allow $ ls -l xxx | cut -d' ' -f1 > -rw------- @@ -249,9 +249,9 @@ $ getfacl -n xxx > # file: xxx > # owner: 42 > # group: wheel -> owner@:rw-p--aARWcCos:------:allow -> group@:------a-R-c--s:------:allow -> everyone@:------a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:------a-R-c--s:-------:allow +> everyone@:------a-R-c--s:-------:allow $ ls -l xxx | cut -d' ' -f1 > -rw------- @@ -264,11 +264,11 @@ $ getfacl -n xxx > # file: xxx > # owner: 43 > # group: wheel -> owner@:rw-p----------:------:deny -> group@:r-------------:------:deny -> owner@:--x---aARWcCos:------:allow -> group@:-w-p--a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p----------:-------:deny +> group@:r-------------:-------:deny +> owner@:--x---aARWcCos:-------:allow +> group@:-w-p--a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ ls -l xxx | cut -d' ' -f1 > ---x-w-r-- @@ -281,11 +281,11 @@ $ getfacl -n xxx > # file: xxx > # owner: 43 > # group: wheel -> owner@:-wxp----------:------:deny -> group@:-w-p----------:------:deny -> owner@:r-----aARWcCos:------:allow -> group@:--x---a-R-c--s:------:allow -> everyone@:-w-p--a-R-c--s:------:allow +> owner@:-wxp----------:-------:deny +> group@:-w-p----------:-------:deny +> owner@:r-----aARWcCos:-------:allow +> group@:--x---a-R-c--s:-------:allow +> everyone@:-w-p--a-R-c--s:-------:allow $ ls -l xxx | cut -d' ' -f1 > -r----x-w- @@ -298,23 +298,23 @@ $ getfacl -n ddd > # file: ddd > # owner: root > # group: wheel -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:-d----:allow -> group:43:-w--D---------:-d----:deny -> group@:-----da-------:------:allow -> group:44:rw-p-da-------:------:allow -> owner@:rwxp--aARWcCos:------:allow -> group@:r-x---a-R-c--s:------:allow -> everyone@:-w-p--a-R-c--s:f-i---:allow +> user:42:r-x-----------:f-i----:allow +> group:42:-w--D---------:-d-----:allow +> group:43:-w--D---------:-d-----:deny +> group@:-----da-------:-------:allow +> group:44:rw-p-da-------:-------:allow +> owner@:rwxp--aARWcCos:-------:allow +> group@:r-x---a-R-c--s:-------:allow +> everyone@:-w-p--a-R-c--s:f-i----:allow $ chmod 777 ddd $ getfacl -n ddd > # file: ddd > # owner: root > # group: wheel -> owner@:rwxp--aARWcCos:------:allow -> group@:rwxp--a-R-c--s:------:allow -> everyone@:rwxp--a-R-c--s:------:allow +> owner@:rwxp--aARWcCos:-------:allow +> group@:rwxp--a-R-c--s:-------:allow +> everyone@:rwxp--a-R-c--s:-------:allow # Test applying ACL to mode. $ rmdir ddd @@ -360,104 +360,104 @@ $ setfacl -a0 user:42:write_acl/write_ow $ setfacl -a0 group:41:read_data/read_attributes:dni:allow ddd $ setfacl -a0 user:41:write_data/write_attributes:fn:allow ddd $ getfacl -qn ddd -> user:41:-w-----A------:f--n--:allow -> group:41:r-----a-------:-din--:allow -> user:42:-----------Co-:f-i---:allow -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:-d-n--:deny -> group:43:-w---------C--:f-in--:deny -> user:43:rwxp----------:------:allow -> owner@:rwxp--aARWcCos:------:allow -> group@:r-x---a-R-c--s:------:allow -> everyone@:r-x---a-R-c--s:------:allow +> user:41:-w-----A------:f--n---:allow +> group:41:r-----a-------:-din---:allow +> user:42:-----------Co-:f-i----:allow +> user:42:r-x-----------:f-i----:allow +> group:42:-w--D---------:-d-n---:deny +> group:43:-w---------C--:f-in---:deny +> user:43:rwxp----------:-------:allow +> owner@:rwxp--aARWcCos:-------:allow +> group@:r-x---a-R-c--s:-------:allow +> everyone@:r-x---a-R-c--s:-------:allow $ cd ddd $ touch xxx $ getfacl -qn xxx -> user:41:--------------:------:allow -> user:42:--------------:------:allow -> user:42:r-------------:------:allow -> group:43:-w---------C--:------:deny -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:41:--------------:------I:allow +> user:42:--------------:------I:allow +> user:42:r-------------:------I:allow +> group:43:-w---------C--:------I:deny +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ rm xxx $ umask 077 $ touch xxx $ getfacl -qn xxx -> user:41:--------------:------:allow -> user:42:--------------:------:allow -> user:42:--------------:------:allow -> group:43:-w---------C--:------:deny -> owner@:rw-p--aARWcCos:------:allow -> group@:------a-R-c--s:------:allow -> everyone@:------a-R-c--s:------:allow +> user:41:--------------:------I:allow +> user:42:--------------:------I:allow +> user:42:--------------:------I:allow +> group:43:-w---------C--:------I:deny +> owner@:rw-p--aARWcCos:-------:allow +> group@:------a-R-c--s:-------:allow +> everyone@:------a-R-c--s:-------:allow $ rm xxx $ umask 770 $ touch xxx $ getfacl -qn xxx -> owner@:rw-p----------:------:deny -> group@:rw-p----------:------:deny -> user:41:--------------:------:allow -> user:42:--------------:------:allow -> user:42:--------------:------:allow -> group:43:-w---------C--:------:deny -> owner@:------aARWcCos:------:allow -> group@:------a-R-c--s:------:allow -> everyone@:rw-p--a-R-c--s:------:allow +> owner@:rw-p----------:-------:deny +> group@:rw-p----------:-------:deny +> user:41:--------------:------I:allow +> user:42:--------------:------I:allow +> user:42:--------------:------I:allow +> group:43:-w---------C--:------I:deny +> owner@:------aARWcCos:-------:allow +> group@:------a-R-c--s:-------:allow +> everyone@:rw-p--a-R-c--s:-------:allow $ rm xxx $ umask 707 $ touch xxx $ getfacl -qn xxx -> owner@:rw-p----------:------:deny -> user:41:-w------------:------:allow -> user:42:--------------:------:allow -> user:42:r-------------:------:allow -> group:43:-w---------C--:------:deny -> owner@:------aARWcCos:------:allow -> group@:rw-p--a-R-c--s:------:allow -> everyone@:------a-R-c--s:------:allow +> owner@:rw-p----------:-------:deny +> user:41:-w------------:------I:allow +> user:42:--------------:------I:allow +> user:42:r-------------:------I:allow +> group:43:-w---------C--:------I:deny +> owner@:------aARWcCos:-------:allow +> group@:rw-p--a-R-c--s:-------:allow +> everyone@:------a-R-c--s:-------:allow $ umask 077 $ mkdir yyy $ getfacl -qn yyy -> group:41:------a-------:------:allow -> user:42:-----------Co-:f-i---:allow -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:------:deny -> owner@:rwxp--aARWcCos:------:allow -> group@:------a-R-c--s:------:allow -> everyone@:------a-R-c--s:------:allow +> group:41:------a-------:------I:allow +> user:42:-----------Co-:f-i---I:allow +> user:42:r-x-----------:f-i---I:allow +> group:42:-w--D---------:------I:deny +> owner@:rwxp--aARWcCos:-------:allow +> group@:------a-R-c--s:-------:allow +> everyone@:------a-R-c--s:-------:allow $ rmdir yyy $ umask 770 $ mkdir yyy $ getfacl -qn yyy -> owner@:rwxp----------:------:deny -> group@:rwxp----------:------:deny -> group:41:------a-------:------:allow -> user:42:-----------Co-:f-i---:allow -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:------:deny -> owner@:------aARWcCos:------:allow -> group@:------a-R-c--s:------:allow -> everyone@:rwxp--a-R-c--s:------:allow +> owner@:rwxp----------:-------:deny +> group@:rwxp----------:-------:deny +> group:41:------a-------:------I:allow +> user:42:-----------Co-:f-i---I:allow +> user:42:r-x-----------:f-i---I:allow +> group:42:-w--D---------:------I:deny +> owner@:------aARWcCos:-------:allow +> group@:------a-R-c--s:-------:allow +> everyone@:rwxp--a-R-c--s:-------:allow $ rmdir yyy $ umask 707 $ mkdir yyy $ getfacl -qn yyy -> owner@:rwxp----------:------:deny -> group:41:r-----a-------:------:allow -> user:42:-----------Co-:f-i---:allow -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:------:deny -> owner@:------aARWcCos:------:allow -> group@:rwxp--a-R-c--s:------:allow -> everyone@:------a-R-c--s:------:allow +> owner@:rwxp----------:-------:deny +> group:41:r-----a-------:------I:allow +> user:42:-----------Co-:f-i---I:allow +> user:42:r-x-----------:f-i---I:allow +> group:42:-w--D---------:------I:deny +> owner@:------aARWcCos:-------:allow +> group@:rwxp--a-R-c--s:-------:allow +> everyone@:------a-R-c--s:-------:allow # There is some complication regarding how write_acl and write_owner flags # get inherited. Make sure we got it right. @@ -478,34 +478,34 @@ $ umask 022 $ rm xxx $ touch xxx $ getfacl -nq xxx -> user:53:--------------:------:allow -> user:51:--------------:------:allow -> user:50:--------------:------:allow -> user:48:--------------:------:allow -> user:47:--------------:------:allow -> user:45:--------------:------:allow -> user:44:--------------:------:allow -> user:42:--------------:------:allow -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:53:--------------:------I:allow +> user:51:--------------:------I:allow +> user:50:--------------:------I:allow +> user:48:--------------:------I:allow +> user:47:--------------:------I:allow +> user:45:--------------:------I:allow +> user:44:--------------:------I:allow +> user:42:--------------:------I:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ rmdir yyy $ mkdir yyy $ getfacl -nq yyy -> user:53:--------------:------:allow -> user:52:--------------:------:allow -> user:50:--------------:------:allow -> user:49:--------------:------:allow -> user:47:--------------:fd----:allow -> user:46:--------------:-d----:allow -> user:45:-----------Co-:f-i---:allow -> user:44:--------------:fd----:allow -> user:43:--------------:-d----:allow -> user:42:-----------Co-:f-i---:allow -> owner@:rwxp--aARWcCos:------:allow -> group@:r-x---a-R-c--s:------:allow -> everyone@:r-x---a-R-c--s:------:allow +> user:53:--------------:------I:allow +> user:52:--------------:------I:allow +> user:50:--------------:------I:allow +> user:49:--------------:------I:allow +> user:47:--------------:fd----I:allow +> user:46:--------------:-d----I:allow +> user:45:-----------Co-:f-i---I:allow +> user:44:--------------:fd----I:allow +> user:43:--------------:-d----I:allow +> user:42:-----------Co-:f-i---I:allow +> owner@:rwxp--aARWcCos:-------:allow +> group@:r-x---a-R-c--s:-------:allow +> everyone@:r-x---a-R-c--s:-------:allow $ setfacl -b . $ setfacl -a0 u:42:Co:f:deny . @@ -524,34 +524,34 @@ $ umask 022 $ rm xxx $ touch xxx $ getfacl -nq xxx -> user:53:-----------Co-:------:deny -> user:51:-----------Co-:------:deny -> user:50:-----------Co-:------:deny -> user:48:-----------Co-:------:deny -> user:47:-----------Co-:------:deny -> user:45:-----------Co-:------:deny -> user:44:-----------Co-:------:deny -> user:42:-----------Co-:------:deny -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> user:53:-----------Co-:------I:deny +> user:51:-----------Co-:------I:deny +> user:50:-----------Co-:------I:deny +> user:48:-----------Co-:------I:deny +> user:47:-----------Co-:------I:deny +> user:45:-----------Co-:------I:deny +> user:44:-----------Co-:------I:deny +> user:42:-----------Co-:------I:deny +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow $ rmdir yyy $ mkdir yyy $ getfacl -nq yyy -> user:53:-----------Co-:------:deny -> user:52:-----------Co-:------:deny -> user:50:-----------Co-:------:deny -> user:49:-----------Co-:------:deny -> user:47:-----------Co-:fd----:deny -> user:46:-----------Co-:-d----:deny -> user:45:-----------Co-:f-i---:deny -> user:44:-----------Co-:fd----:deny -> user:43:-----------Co-:-d----:deny -> user:42:-----------Co-:f-i---:deny -> owner@:rwxp--aARWcCos:------:allow -> group@:r-x---a-R-c--s:------:allow -> everyone@:r-x---a-R-c--s:------:allow +> user:53:-----------Co-:------I:deny +> user:52:-----------Co-:------I:deny +> user:50:-----------Co-:------I:deny +> user:49:-----------Co-:------I:deny +> user:47:-----------Co-:fd----I:deny +> user:46:-----------Co-:-d----I:deny +> user:45:-----------Co-:f-i---I:deny +> user:44:-----------Co-:fd----I:deny +> user:43:-----------Co-:-d----I:deny +> user:42:-----------Co-:f-i---I:deny +> owner@:rwxp--aARWcCos:-------:allow +> group@:r-x---a-R-c--s:-------:allow +> everyone@:r-x---a-R-c--s:-------:allow $ rmdir yyy $ rm xxx Modified: head/tools/regression/acltools/tools-nfs4-trivial.test ============================================================================== --- head/tools/regression/acltools/tools-nfs4-trivial.test Thu Sep 3 22:15:56 2015 (r287444) +++ head/tools/regression/acltools/tools-nfs4-trivial.test Fri Sep 4 00:14:20 2015 (r287445) @@ -42,9 +42,9 @@ $ ls -l xxx | cut -d' ' -f1 > -rw-r--r-- $ getfacl -q xxx -> owner@:rw-p--aARWcCos:------:allow -> group@:r-----a-R-c--s:------:allow -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p--aARWcCos:-------:allow +> group@:r-----a-R-c--s:-------:allow +> everyone@:r-----a-R-c--s:-------:allow # Check whether ls(1) correctly recognizes draft-style trivial ACLs. $ rm xxx @@ -58,12 +58,12 @@ $ ls -l xxx | cut -d' ' -f1 > -rw-r--r-- $ getfacl -q xxx -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> group@:-wxp----------:-------:deny +> group@:r-------------:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Make sure ls(1) actually can recognize something as non-trivial. $ setfacl -x0 xxx @@ -72,11 +72,11 @@ $ ls -l xxx | cut -d' ' -f1 > -rw-r--r--+ $ getfacl -q xxx -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:rw-p---A-W-Co-:-------:allow +> group@:-wxp----------:-------:deny +> group@:r-------------:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow $ rm xxx Modified: head/tools/regression/acltools/tools-nfs4.test ============================================================================== --- head/tools/regression/acltools/tools-nfs4.test Thu Sep 3 22:15:56 2015 (r287444) +++ head/tools/regression/acltools/tools-nfs4.test Fri Sep 4 00:14:20 2015 (r287445) @@ -42,20 +42,20 @@ $ getfacl xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> group@:-wxp----------:-------:deny +> group@:r-------------:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow $ getfacl -q xxx -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> group@:-wxp----------:-------:deny +> group@:r-------------:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Check verbose mode formatting. $ getfacl -v xxx @@ -75,14 +75,14 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> group@:-wxp----------:-------:deny +> group@:r-------------:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test user and group name resolving. $ rm xxx @@ -92,14 +92,14 @@ $ getfacl xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> user:root:-----------C--:------:allow -> group:daemon:----------c---:------:deny -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> user:root:-----------C--:-------:allow +> group:daemon:----------c---:-------:deny +> group@:-wxp----------:-------:deny +> group@:r-------------:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Check whether ls correctly marks files with "+". $ ls -l xxx | cut -d' ' -f1 @@ -112,12 +112,12 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test setfacl -m. $ setfacl -a0 everyone@:rwx:deny xxx @@ -128,30 +128,30 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:--------------:------:deny -> everyone@:r-----a-R-c--s:------:allow +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> user:0:-----------C--:-------:allow +> group:1:----------c---:-------:deny +> everyone@:--------------:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Test getfacl -i. $ getfacl -i xxx > # file: xxx > # owner: root > # group: wheel -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> user:root:-----------C--:------:allow:0 -> group:daemon:----------c---:------:deny:1 -> everyone@:--------------:------:deny -> everyone@:r-----a-R-c--s:------:allow +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny +> owner@:--x-----------:-------:deny +> owner@:rw-p---A-W-Co-:-------:allow +> user:root:-----------C--:-------:allow:0 +> group:daemon:----------c---:-------:deny:1 +> everyone@:--------------:-------:deny +> everyone@:r-----a-R-c--s:-------:allow # Make sure cp without any flags does not copy copy the ACL. $ cp xxx yyy @@ -165,15 +165,15 @@ $ getfacl -n yyy > # file: yyy > # owner: root > # group: wheel -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> everyone@:--------------:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> user:0:-----------C--:------:allow -> group:1:----------c---:------:deny -> everyone@:--------------:------:deny -> everyone@:r-----a-R-c--s:------:allow +> everyone@:--------------:-------:deny +> everyone@:--------------:-------:deny *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 4 00:41:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E6369C935A; Fri, 4 Sep 2015 00:41:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0EF13204; Fri, 4 Sep 2015 00:41:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t840fTZN046981; Fri, 4 Sep 2015 00:41:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t840fTMS046980; Fri, 4 Sep 2015 00:41:29 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040041.t840fTMS046980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 00:41:29 +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: r287446 - stable/10/usr.bin/bluetooth/btsockstat 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, 04 Sep 2015 00:41:30 -0000 Author: delphij Date: Fri Sep 4 00:41:29 2015 New Revision: 287446 URL: https://svnweb.freebsd.org/changeset/base/287446 Log: MFC r287345: Drop group privileges after opening the kvm descriptor, otherwise, the code would not drop privileges as expected. While there also add checks for the drop and bail out immediately if we failed. Modified: stable/10/usr.bin/bluetooth/btsockstat/btsockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bluetooth/btsockstat/btsockstat.c ============================================================================== --- stable/10/usr.bin/bluetooth/btsockstat/btsockstat.c Fri Sep 4 00:14:20 2015 (r287445) +++ stable/10/usr.bin/bluetooth/btsockstat/btsockstat.c Fri Sep 4 00:41:29 2015 (r287446) @@ -154,9 +154,9 @@ main(int argc, char *argv[]) * Discard setgid privileges if not the running kernel so that * bad guys can't print interesting stuff from kernel memory. */ - if (memf != NULL) - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); kvmd = kopen(memf); if (kvmd == NULL) @@ -583,15 +583,9 @@ kopen(char const *memf) kvm_t *kvmd = NULL; char errbuf[_POSIX2_LINE_MAX]; - /* - * Discard setgid privileges if not the running kernel so that - * bad guys can't print interesting stuff from kernel memory. - */ - - if (memf != NULL) - setgid(getgid()); - kvmd = kvm_openfiles(NULL, memf, NULL, O_RDONLY, errbuf); + if (setgid(getgid()) != 0) + err(1, "setgid"); if (kvmd == NULL) { warnx("kvm_openfiles: %s", errbuf); return (NULL); From owner-svn-src-all@freebsd.org Fri Sep 4 00:42:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D138D9C93F4; Fri, 4 Sep 2015 00:42:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C16D63E8; Fri, 4 Sep 2015 00:42:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t840g6Z0047064; Fri, 4 Sep 2015 00:42:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t840g6Mt047063; Fri, 4 Sep 2015 00:42:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040042.t840g6Mt047063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 00:42:06 +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: r287447 - stable/9/usr.bin/bluetooth/btsockstat 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: Fri, 04 Sep 2015 00:42:06 -0000 Author: delphij Date: Fri Sep 4 00:42:05 2015 New Revision: 287447 URL: https://svnweb.freebsd.org/changeset/base/287447 Log: MFC r287345: Drop group privileges after opening the kvm descriptor, otherwise, the code would not drop privileges as expected. While there also add checks for the drop and bail out immediately if we failed. Modified: stable/9/usr.bin/bluetooth/btsockstat/btsockstat.c Directory Properties: stable/9/usr.bin/bluetooth/ (props changed) Modified: stable/9/usr.bin/bluetooth/btsockstat/btsockstat.c ============================================================================== --- stable/9/usr.bin/bluetooth/btsockstat/btsockstat.c Fri Sep 4 00:41:29 2015 (r287446) +++ stable/9/usr.bin/bluetooth/btsockstat/btsockstat.c Fri Sep 4 00:42:05 2015 (r287447) @@ -154,9 +154,9 @@ main(int argc, char *argv[]) * Discard setgid privileges if not the running kernel so that * bad guys can't print interesting stuff from kernel memory. */ - if (memf != NULL) - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); kvmd = kopen(memf); if (kvmd == NULL) @@ -583,15 +583,9 @@ kopen(char const *memf) kvm_t *kvmd = NULL; char errbuf[_POSIX2_LINE_MAX]; - /* - * Discard setgid privileges if not the running kernel so that - * bad guys can't print interesting stuff from kernel memory. - */ - - if (memf != NULL) - setgid(getgid()); - kvmd = kvm_openfiles(NULL, memf, NULL, O_RDONLY, errbuf); + if (setgid(getgid()) != 0) + err(1, "setgid"); if (kvmd == NULL) { warnx("kvm_openfiles: %s", errbuf); return (NULL); From owner-svn-src-all@freebsd.org Fri Sep 4 00:59:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A489C9ACE; Fri, 4 Sep 2015 00:59:41 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yk0-x232.google.com (mail-yk0-x232.google.com [IPv6:2607:f8b0:4002:c07::232]) (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 B6686AFA; Fri, 4 Sep 2015 00:59:40 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykei199 with SMTP id i199so6909674yke.0; Thu, 03 Sep 2015 17:59:39 -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=A7KShMHVJOV1tFwCsG4Jbk8l10hC0FNvM1FskeTw+F4=; b=pj2IbMOoy4xo0Mi2lAzB1ymA/FOxfPcpEEUkHVSfw7NesQoYk/pkTji5BOqwJlfgmN 8YzrgFyZ94Gb7NrQ2/WxMg/k05LWrxR+pgr8NyixZn0OFG0INzjArVlpKfTKEj2d4AN+ KhIOm1HOBNOT/fGqmgFgPsMlMor0dgDGM5v3MR4An4QSCCk75IBWc8Cp6dEYtaICSTLh O/5mJC7l2CiJdH38NqdgdRPUeTEECj/MHsCjz3eraLaMdy+fGnt/av6bK2lWx/0rS+ub 9kydPMaoNu1wldiWtxGhPrp4j8o4WNVeS9xqqdVi5Vv/2ZsXFIICC2Fxt8gZaJpU0qgx UjwA== MIME-Version: 1.0 X-Received: by 10.170.123.83 with SMTP id p80mr967774ykb.127.1441328379344; Thu, 03 Sep 2015 17:59:39 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.37.99.3 with HTTP; Thu, 3 Sep 2015 17:59:39 -0700 (PDT) In-Reply-To: <20150903220744.GJ61752@ivaldir.etoilebsd.net> References: <201509032047.t83KlDww048395@repo.freebsd.org> <20150903220744.GJ61752@ivaldir.etoilebsd.net> Date: Thu, 3 Sep 2015 17:59:39 -0700 X-Google-Sender-Auth: 2WLGPhtBDrWP9YYmTKcF6kZXkhg Message-ID: Subject: Re: svn commit: r287443 - stable/10/etc/mtree From: Craig Rodrigues To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 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: Fri, 04 Sep 2015 00:59:41 -0000 On Thu, Sep 3, 2015 at 3:07 PM, Baptiste Daroussin wrote: > On Thu, Sep 03, 2015 at 08:47:13PM +0000, Craig Rodrigues wrote: > > Author: rodrigc > > Date: Thu Sep 3 20:47:13 2015 > > New Revision: 287443 > > URL: https://svnweb.freebsd.org/changeset/base/287443 > > > > Log: > > Put timeout directory in correct place > > > Thank you and also thanks to Alan Somers who reported me the issue when was > about to fix when I noticed you just did it. > > You are welcome. I put the fix in because of this Jenkins failure: https://jenkins.freebsd.org/job/Build-UFS-image/2256/console -- Craig From owner-svn-src-all@freebsd.org Fri Sep 4 01:02:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B0D9C9CCE; Fri, 4 Sep 2015 01:02:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4B75EE83; Fri, 4 Sep 2015 01:02:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8412MBi055231; Fri, 4 Sep 2015 01:02:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8412M42055230; Fri, 4 Sep 2015 01:02:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201509040102.t8412M42055230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Sep 2015 01:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287448 - head/tests/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.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, 04 Sep 2015 01:02:22 -0000 Author: jhb Date: Fri Sep 4 01:02:21 2015 New Revision: 287448 URL: https://svnweb.freebsd.org/changeset/base/287448 Log: Add more mmap tests related to character devices. - Add cdev-related tests for bad args. - Add two simple tests cases for mapping /dev/zero that test for MAP_ANON-like behavior. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3323 Modified: head/tests/sys/vm/mmap_test.c Modified: head/tests/sys/vm/mmap_test.c ============================================================================== --- head/tests/sys/vm/mmap_test.c Fri Sep 4 00:42:05 2015 (r287447) +++ head/tests/sys/vm/mmap_test.c Fri Sep 4 01:02:21 2015 (r287448) @@ -110,23 +110,31 @@ checked_mmap(int prot, int flags, int fd ATF_TC_WITHOUT_HEAD(mmap__bad_arguments); ATF_TC_BODY(mmap__bad_arguments, tc) { - int fd; + int devstatfd, shmfd, zerofd; - ATF_REQUIRE((fd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); - ATF_REQUIRE(ftruncate(fd, getpagesize()) == 0); + ATF_REQUIRE((devstatfd = open("/dev/devstat", O_RDONLY)) >= 0); + ATF_REQUIRE((shmfd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); + ATF_REQUIRE(ftruncate(shmfd, getpagesize()) == 0); + ATF_REQUIRE((zerofd = open("/dev/zero", O_RDONLY)) >= 0); /* These should work. */ checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON, -1, 0, "simple MAP_ANON"); - checked_mmap(PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0, + checked_mmap(PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, 0, "simple shm fd shared"); - checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0, + checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE, shmfd, 0, "simple shm fd private"); + checked_mmap(PROT_READ, MAP_SHARED, zerofd, 0, + "simple /dev/zero shared"); + checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE, zerofd, 0, + "simple /dev/zero private"); + checked_mmap(PROT_READ, MAP_SHARED, devstatfd, 0, + "simple /dev/devstat shared"); /* Extra PROT flags. */ checked_mmap(PROT_READ | PROT_WRITE | 0x100000, MAP_ANON, -1, EINVAL, "MAP_ANON with extra PROT flags"); - checked_mmap(0xffff, MAP_SHARED, fd, EINVAL, + checked_mmap(0xffff, MAP_SHARED, shmfd, EINVAL, "shm fd with garbage PROT"); /* Undefined flag. */ @@ -136,11 +144,11 @@ ATF_TC_BODY(mmap__bad_arguments, tc) /* Both MAP_SHARED and MAP_PRIVATE */ checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | MAP_SHARED, -1, EINVAL, "MAP_ANON with both SHARED and PRIVATE"); - checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_SHARED, fd, + checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_SHARED, shmfd, EINVAL, "shm fd with both SHARED and PRIVATE"); /* At least one of MAP_SHARED or MAP_PRIVATE without ANON */ - checked_mmap(PROT_READ | PROT_WRITE, 0, fd, EINVAL, + checked_mmap(PROT_READ | PROT_WRITE, 0, shmfd, EINVAL, "shm fd without sharing flag"); /* MAP_ANON with either sharing flag (impacts fork). */ @@ -152,6 +160,91 @@ ATF_TC_BODY(mmap__bad_arguments, tc) /* MAP_ANON should require an fd of -1. */ checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, EINVAL, "MAP_ANON with fd != -1"); + + /* Writable MAP_SHARED should fail on read-only descriptors. */ + checked_mmap(PROT_READ | PROT_WRITE, MAP_SHARED, zerofd, EACCES, + "MAP_SHARED of read-only /dev/zero"); + + /* + * Character devices other than /dev/zero do not support private + * mappings. + */ + checked_mmap(PROT_READ, MAP_PRIVATE, devstatfd, EINVAL, + "MAP_PRIVATE of /dev/devstat"); +} + +ATF_TC_WITHOUT_HEAD(mmap__dev_zero_private); +ATF_TC_BODY(mmap__dev_zero_private, tc) +{ + char *p1, *p2, *p3; + size_t i; + int fd; + + ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0); + + p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, + 0); + ATF_REQUIRE(p1 != MAP_FAILED); + + p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, + 0); + ATF_REQUIRE(p2 != MAP_FAILED); + + for (i = 0; i < getpagesize(); i++) + ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); + + ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + + p1[0] = 1; + + ATF_REQUIRE(p2[0] == 0); + + p2[0] = 2; + + ATF_REQUIRE(p1[0] == 1); + + p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, + 0); + ATF_REQUIRE(p3 != MAP_FAILED); + + ATF_REQUIRE(p3[0] == 0); +} + +ATF_TC_WITHOUT_HEAD(mmap__dev_zero_shared); +ATF_TC_BODY(mmap__dev_zero_shared, tc) +{ + char *p1, *p2, *p3; + size_t i; + int fd; + + ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0); + + p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE(p1 != MAP_FAILED); + + p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE(p2 != MAP_FAILED); + + for (i = 0; i < getpagesize(); i++) + ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); + + ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + + p1[0] = 1; + + ATF_REQUIRE(p2[0] == 0); + + p2[0] = 2; + + ATF_REQUIRE(p1[0] == 1); + + p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE(p3 != MAP_FAILED); + + ATF_REQUIRE(p3[0] == 0); } ATF_TP_ADD_TCS(tp) @@ -159,6 +252,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, mmap__map_at_zero); ATF_TP_ADD_TC(tp, mmap__bad_arguments); + ATF_TP_ADD_TC(tp, mmap__dev_zero_private); + ATF_TP_ADD_TC(tp, mmap__dev_zero_shared); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Fri Sep 4 01:13:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4840F9CA209; Fri, 4 Sep 2015 01:13:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3901012F6; Fri, 4 Sep 2015 01:13:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t841Df27059376; Fri, 4 Sep 2015 01:13:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t841Df6x059375; Fri, 4 Sep 2015 01:13:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201509040113.t841Df6x059375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 4 Sep 2015 01:13:41 +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: r287449 - stable/10/release 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, 04 Sep 2015 01:13:41 -0000 Author: gjb Date: Fri Sep 4 01:13:40 2015 New Revision: 287449 URL: https://svnweb.freebsd.org/changeset/base/287449 Log: MFC r287368: Remove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant builds, and prepend it to SNAPSHOT_DATE to prevent a trailing '-' in the final box name for a release build. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.vagrant Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile.vagrant ============================================================================== --- stable/10/release/Makefile.vagrant Fri Sep 4 01:02:21 2015 (r287448) +++ stable/10/release/Makefile.vagrant Fri Sep 4 01:13:40 2015 (r287449) @@ -17,11 +17,11 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +%Y%m%d +SNAPSHOT_DATE!= date +-%Y%m%d .endif VAGRANT_VERSION!= date +%Y.%m.%d -VAGRANT_TARGET:= ${OSRELEASE}-${SNAPSHOT_DATE} +VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE} .if !empty(CLOUDWARE) . for _PROVIDER in ${CLOUDWARE} . if ${_PROVIDER:MVAGRANT*} From owner-svn-src-all@freebsd.org Fri Sep 4 05:32:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4A79C98B4; Fri, 4 Sep 2015 05:32:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9AB3F3A0; Fri, 4 Sep 2015 05:32:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t845WUut065527; Fri, 4 Sep 2015 05:32:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t845WRk5065513; Fri, 4 Sep 2015 05:32:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040532.t845WRk5065513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 05:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r287450 - in vendor/file/dist: . magic/Magdir src 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: Fri, 04 Sep 2015 05:32:30 -0000 Author: delphij Date: Fri Sep 4 05:32:26 2015 New Revision: 287450 URL: https://svnweb.freebsd.org/changeset/base/287450 Log: Vendor import of file 5.24. Modified: vendor/file/dist/ChangeLog vendor/file/dist/configure vendor/file/dist/configure.ac vendor/file/dist/magic/Magdir/database vendor/file/dist/magic/Magdir/elf vendor/file/dist/magic/Magdir/fortran vendor/file/dist/magic/Magdir/mail.news vendor/file/dist/magic/Magdir/map vendor/file/dist/src/file.c vendor/file/dist/src/funcs.c vendor/file/dist/src/readelf.c Modified: vendor/file/dist/ChangeLog ============================================================================== --- vendor/file/dist/ChangeLog Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/ChangeLog Fri Sep 4 05:32:26 2015 (r287450) @@ -1,3 +1,7 @@ +2015-07-09 10:35 Christos Zoulas + + * release 5.24 + 2015-06-11 8:52 Christos Zoulas * redo long option encoding to fix off-by-one in 5.23 Modified: vendor/file/dist/configure ============================================================================== --- vendor/file/dist/configure Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/configure Fri Sep 4 05:32:26 2015 (r287450) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.23. +# Generated by GNU Autoconf 2.69 for file 5.24. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.23' -PACKAGE_STRING='file 5.23' +PACKAGE_VERSION='5.24' +PACKAGE_STRING='file 5.24' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.23 to adapt to many kinds of systems. +\`configure' configures file 5.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.23:";; + short | recursive ) echo "Configuration of file 5.24:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.23 +file configure 5.24 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.23, which was +It was created by file $as_me 5.24, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.23' + VERSION='5.24' cat >>confdefs.h <<_ACEOF @@ -15036,7 +15036,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.23, which was +This file was extended by file $as_me 5.24, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15102,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.23 +file config.status 5.24 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/file/dist/configure.ac ============================================================================== --- vendor/file/dist/configure.ac Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/configure.ac Fri Sep 4 05:32:26 2015 (r287450) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.23],[christos@astron.com]) +AC_INIT([file],[5.24],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: vendor/file/dist/magic/Magdir/database ============================================================================== --- vendor/file/dist/magic/Magdir/database Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/magic/Magdir/database Fri Sep 4 05:32:26 2015 (r287450) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $ +# $File: database,v 1.44 2015/07/02 18:25:57 christos Exp $ # database: file(1) magic for various databases # # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) @@ -533,7 +533,9 @@ # From: Stephane Blondon http://www.yaal.fr # Database file for Zope (done by FileStorage) -0 string FS21 Zope Object Database File Storage (data) +0 string FS21 Zope Object Database File Storage v3 (data) +0 string FS30 Zope Object Database File Storage v4 (data) + # Cache file for the database of Zope (done by ClientStorage) 0 string ZEC3 Zope Object Database Client Cache File (data) Modified: vendor/file/dist/magic/Magdir/elf ============================================================================== --- vendor/file/dist/magic/Magdir/elf Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/magic/Magdir/elf Fri Sep 4 05:32:26 2015 (r287450) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: elf,v 1.68 2014/09/19 19:05:57 christos Exp $ +# $File: elf,v 1.69 2015/06/16 17:23:08 christos Exp $ # elf: file(1) magic for ELF executables # # We have to check the byte order flag to see what byte order all the @@ -15,6 +15,32 @@ # Modified by (4): (VMS Itanium) # Modified by (5): Matthias Urlichs (Listing of many architectures) +0 name elf-mips +>0 lelong&0xf0000000 0x00000000 MIPS-I +>0 lelong&0xf0000000 0x10000000 MIPS-II +>0 lelong&0xf0000000 0x20000000 MIPS-III +>0 lelong&0xf0000000 0x30000000 MIPS-IV +>0 lelong&0xf0000000 0x40000000 MIPS-V +>0 lelong&0xf0000000 0x50000000 MIPS32 +>0 lelong&0xf0000000 0x60000000 MIPS64 +>0 lelong&0xf0000000 0x70000000 MIPS32 rel2 +>0 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>0 lelong&0xf0000000 0x90000000 MIPS32 rel6 +>0 lelong&0xf0000000 0xa0000000 MIPS64 rel6 + +0 name elf-sparc +>0 lelong&0x00ffff00 0x00000100 V8+ Required, +>0 lelong&0x00ffff00 0x00000200 Sun UltraSPARC1 Extensions Required, +>0 lelong&0x00ffff00 0x00000400 HaL R1 Extensions Required, +>0 lelong&0x00ffff00 0x00000800 Sun UltraSPARC3 Extensions Required, +>0 lelong&0x3 0 total store ordering, +>0 lelong&0x3 1 partial store ordering, +>0 lelong&0x3 2 relaxed memory ordering, + +0 name elf-pa-risc +>2 leshort 0x0214 2.0 +>0 leshort &0x0008 (LP64) + 0 name elf-le >16 leshort 0 no file type, !:mime application/octet-stream @@ -55,47 +81,26 @@ >18 leshort 8 # only for 32-bit >>4 byte 1 ->>>36 lelong&0xf0000000 0x00000000 MIPS-I ->>>36 lelong&0xf0000000 0x10000000 MIPS-II ->>>36 lelong&0xf0000000 0x20000000 MIPS-III ->>>36 lelong&0xf0000000 0x30000000 MIPS-IV ->>>36 lelong&0xf0000000 0x40000000 MIPS-V ->>>36 lelong&0xf0000000 0x50000000 MIPS32 ->>>36 lelong&0xf0000000 0x60000000 MIPS64 ->>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2 ->>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>>>36 use elf-mips # only for 64-bit >>4 byte 2 ->>>48 lelong&0xf0000000 0x00000000 MIPS-I ->>>48 lelong&0xf0000000 0x10000000 MIPS-II ->>>48 lelong&0xf0000000 0x20000000 MIPS-III ->>>48 lelong&0xf0000000 0x30000000 MIPS-IV ->>>48 lelong&0xf0000000 0x40000000 MIPS-V ->>>48 lelong&0xf0000000 0x50000000 MIPS32 ->>>48 lelong&0xf0000000 0x60000000 MIPS64 ->>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2 ->>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>>>48 use elf-mips >18 leshort 9 Amdahl, >18 leshort 10 MIPS (deprecated), >18 leshort 11 RS6000, >18 leshort 15 PA-RISC, # only for 32-bit >>4 byte 1 ->>>38 leshort 0x0214 2.0 ->>>36 leshort &0x0008 (LP64) +>>>36 use elf-pa-risc # only for 64-bit >>4 byte 2 ->>>50 leshort 0x0214 2.0 ->>>48 leshort &0x0008 (LP64) +>>>48 use elf-pa-risc >18 leshort 16 nCUBE, >18 leshort 17 Fujitsu VPP500, >18 leshort 18 SPARC32PLUS, # only for 32-bit >>4 byte 1 ->>>36 lelong&0xffff00 0x000100 V8+ Required, ->>>36 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ->>>36 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ->>>36 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, +>>>36 use elf-sparc >18 leshort 19 Intel 80960, >18 leshort 20 PowerPC or cisco 4500, >18 leshort 21 64-bit PowerPC or cisco 7500, @@ -117,12 +122,7 @@ >18 leshort 42 Renesas SH, >18 leshort 43 SPARC V9, >>4 byte 2 ->>>48 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ->>>48 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ->>>48 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, ->>>48 lelong&0x3 0 total store ordering, ->>>48 lelong&0x3 1 partial store ordering, ->>>48 lelong&0x3 2 relaxed memory ordering, +>>>48 use elf-sparc >18 leshort 44 Siemens Tricore Embedded Processor, >18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc., >18 leshort 46 Renesas H8/300, Modified: vendor/file/dist/magic/Magdir/fortran ============================================================================== --- vendor/file/dist/magic/Magdir/fortran Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/magic/Magdir/fortran Fri Sep 4 05:32:26 2015 (r287450) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ -# $File: fortran,v 1.8 2014/06/03 19:01:34 christos Exp $ +# $File: fortran,v 1.9 2015/06/17 19:55:27 christos Exp $ # FORTRAN source -0 regex/100l \^[Cc][\ \t] FORTRAN program +0 regex/100l \^[Cc][\ \t] FORTRAN program text !:mime text/x-fortran !:strength - 5 Modified: vendor/file/dist/magic/Magdir/mail.news ============================================================================== --- vendor/file/dist/magic/Magdir/mail.news Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/magic/Magdir/mail.news Fri Sep 4 05:32:26 2015 (r287450) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: mail.news,v 1.22 2013/01/04 14:22:07 christos Exp $ +# $File: mail.news,v 1.23 2015/06/29 14:44:26 christos Exp $ # mail.news: file(1) magic for mail and news # # Unfortunately, saved netnews also has From line added in some news software. @@ -41,6 +41,7 @@ # From: Simon Matter 0 string \241\002\213\015skiplist\ file\0\0\0 Cyrus skiplist DB +0 string \241\002\213\015twoskip\ file\0\0\0\0 Cyrus twoskip DB # JAM(mbp) Fidonet message area databases # JHR file Modified: vendor/file/dist/magic/Magdir/map ============================================================================== --- vendor/file/dist/magic/Magdir/map Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/magic/Magdir/map Fri Sep 4 05:32:26 2015 (r287450) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ -# $File: map,v 1.1 2014/06/03 18:22:25 christos Exp $ +# $File: map,v 1.3 2015/07/09 15:16:41 christos Exp $ # map: file(1) magic for Map data # @@ -9,9 +9,11 @@ 8 string .FIT FIT Map data >15 byte 0 >>35 belong x \b, unit id %d -# 20 years after unix epoch >>39 lelong x \b, serial %u ->>43 ledate/631152000 x \b, %s +# http://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml +# 20 years after unix epoch +# TZ=GMT date -d '1989-12-31 0:00' +%s +>>43 leldate+631065600 x \b, %s >>47 leshort x \b, manufacturer %d >>47 leshort 1 \b (garmin) Modified: vendor/file/dist/src/file.c ============================================================================== --- vendor/file/dist/src/file.c Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/src/file.c Fri Sep 4 05:32:26 2015 (r287450) @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.164 2015/06/03 18:21:24 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.165 2015/06/11 12:52:32 christos Exp $") #endif /* lint */ #include "magic.h" Modified: vendor/file/dist/src/funcs.c ============================================================================== --- vendor/file/dist/src/funcs.c Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/src/funcs.c Fri Sep 4 05:32:26 2015 (r287450) @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.82 2015/06/03 18:01:20 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.83 2015/06/16 14:17:37 christos Exp $") #endif /* lint */ #include "magic.h" @@ -107,8 +107,10 @@ file_error_core(struct magic_set *ms, in if (lineno != 0) { free(ms->o.buf); ms->o.buf = NULL; - file_printf(ms, "line %" SIZE_T_FORMAT "u: ", lineno); + file_printf(ms, "line %" SIZE_T_FORMAT "u:", lineno); } + if (ms->o.buf && *ms->o.buf) + file_printf(ms, " "); file_vprintf(ms, f, va); if (error > 0) file_printf(ms, " (%s)", strerror(error)); Modified: vendor/file/dist/src/readelf.c ============================================================================== --- vendor/file/dist/src/readelf.c Fri Sep 4 01:13:40 2015 (r287449) +++ vendor/file/dist/src/readelf.c Fri Sep 4 05:32:26 2015 (r287450) @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.119 2015/04/09 20:01:41 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.120 2015/06/16 14:18:07 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -1048,9 +1048,18 @@ doshn(struct magic_set *ms, int clazz, i break; } + /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: + if (xsh_size + xsh_offset > (uintmax_t)fsize) { + if (file_printf(ms, + ", note offset/size 0x%jx+0x%jx exceeds" + " file size 0x%jx", (uintmax_t)xsh_offset, + (uintmax_t)xsh_size, (uintmax_t)fsize) == -1) + return -1; + return 0; + } if ((nbuf = malloc(xsh_size)) == NULL) { file_error(ms, errno, "Cannot allocate memory" " for note"); From owner-svn-src-all@freebsd.org Fri Sep 4 05:33:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C1349C98FE; Fri, 4 Sep 2015 05:33:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D72AC756; Fri, 4 Sep 2015 05:33:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t845XBY2065627; Fri, 4 Sep 2015 05:33:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t845XB9n065626; Fri, 4 Sep 2015 05:33:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040533.t845XB9n065626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 05:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r287451 - vendor/file/5.24 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: Fri, 04 Sep 2015 05:33:12 -0000 Author: delphij Date: Fri Sep 4 05:33:11 2015 New Revision: 287451 URL: https://svnweb.freebsd.org/changeset/base/287451 Log: Tag file 5.24. Added: - copied from r287450, vendor/file/dist/ Directory Properties: vendor/file/5.24/ (props changed) From owner-svn-src-all@freebsd.org Fri Sep 4 05:42:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E71ED9C9D5C; Fri, 4 Sep 2015 05:42:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D7BCAB08; Fri, 4 Sep 2015 05:42:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t845g8ft069640; Fri, 4 Sep 2015 05:42:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t845g8QH069639; Fri, 4 Sep 2015 05:42:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040542.t845g8QH069639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 05:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r287452 - vendor/file/dist/magic/Magdir 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: Fri, 04 Sep 2015 05:42:09 -0000 Author: delphij Date: Fri Sep 4 05:42:08 2015 New Revision: 287452 URL: https://svnweb.freebsd.org/changeset/base/287452 Log: Apply vendor changeset e64bdc5 to address FreeBSD bin/181436. Modified: vendor/file/dist/magic/Magdir/make Modified: vendor/file/dist/magic/Magdir/make ============================================================================== --- vendor/file/dist/magic/Magdir/make Fri Sep 4 05:33:11 2015 (r287451) +++ vendor/file/dist/magic/Magdir/make Fri Sep 4 05:42:08 2015 (r287452) @@ -2,14 +2,20 @@ # $File: make,v 1.1 2011/12/08 12:12:46 rrt Exp $ # make: file(1) magic for makefiles # -0 regex \^CFLAGS makefile script text +0 regex/100l \^CFLAGS makefile script text !:mime text/x-makefile -0 regex \^LDFLAGS makefile script text +0 regex/100l \^VPATH makefile script text !:mime text/x-makefile -0 regex \^all: makefile script text +0 regex/100l \^LDFLAGS makefile script text !:mime text/x-makefile -0 regex \^.PRECIOUS makefile script text +0 regex/100l \^all: makefile script text +!:mime text/x-makefile +0 regex/100l \^\.PRECIOUS makefile script text +!:mime text/x-makefile +0 regex/100l \^\.BEGIN BSD makefile script text +!:mime text/x-makefile +0 regex/100l \^\.include BSD makefile script text !:mime text/x-makefile -0 regex \^SUBDIRS automake makefile script text +0 regex/100l \^SUBDIRS automake makefile script text !:mime text/x-makefile From owner-svn-src-all@freebsd.org Fri Sep 4 05:56:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1647D9CA327; Fri, 4 Sep 2015 05:56:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0121C1045; Fri, 4 Sep 2015 05:56:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t845uIhu074073; Fri, 4 Sep 2015 05:56:18 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t845uFku074060; Fri, 4 Sep 2015 05:56:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040556.t845uFku074060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 05:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287453 - in head: contrib/file contrib/file/magic/Magdir contrib/file/src lib/libmagic 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, 04 Sep 2015 05:56:19 -0000 Author: delphij Date: Fri Sep 4 05:56:14 2015 New Revision: 287453 URL: https://svnweb.freebsd.org/changeset/base/287453 Log: MFV r287451 + 287452: file 5.24 + fix for bin/181436. PR: 181436 MFC after: 2 weeks Modified: head/contrib/file/ChangeLog head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/elf head/contrib/file/magic/Magdir/fortran head/contrib/file/magic/Magdir/mail.news head/contrib/file/magic/Magdir/make head/contrib/file/magic/Magdir/map head/contrib/file/src/file.c head/contrib/file/src/funcs.c head/contrib/file/src/readelf.c head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/ChangeLog Fri Sep 4 05:56:14 2015 (r287453) @@ -1,3 +1,7 @@ +2015-07-09 10:35 Christos Zoulas + + * release 5.24 + 2015-06-11 8:52 Christos Zoulas * redo long option encoding to fix off-by-one in 5.23 Modified: head/contrib/file/configure ============================================================================== --- head/contrib/file/configure Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/configure Fri Sep 4 05:56:14 2015 (r287453) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.23. +# Generated by GNU Autoconf 2.69 for file 5.24. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.23' -PACKAGE_STRING='file 5.23' +PACKAGE_VERSION='5.24' +PACKAGE_STRING='file 5.24' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.23 to adapt to many kinds of systems. +\`configure' configures file 5.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.23:";; + short | recursive ) echo "Configuration of file 5.24:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.23 +file configure 5.24 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.23, which was +It was created by file $as_me 5.24, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.23' + VERSION='5.24' cat >>confdefs.h <<_ACEOF @@ -15036,7 +15036,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.23, which was +This file was extended by file $as_me 5.24, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15102,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.23 +file config.status 5.24 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/file/configure.ac ============================================================================== --- head/contrib/file/configure.ac Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/configure.ac Fri Sep 4 05:56:14 2015 (r287453) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.23],[christos@astron.com]) +AC_INIT([file],[5.24],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: head/contrib/file/magic/Magdir/database ============================================================================== --- head/contrib/file/magic/Magdir/database Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/magic/Magdir/database Fri Sep 4 05:56:14 2015 (r287453) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $ +# $File: database,v 1.44 2015/07/02 18:25:57 christos Exp $ # database: file(1) magic for various databases # # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) @@ -533,7 +533,9 @@ # From: Stephane Blondon http://www.yaal.fr # Database file for Zope (done by FileStorage) -0 string FS21 Zope Object Database File Storage (data) +0 string FS21 Zope Object Database File Storage v3 (data) +0 string FS30 Zope Object Database File Storage v4 (data) + # Cache file for the database of Zope (done by ClientStorage) 0 string ZEC3 Zope Object Database Client Cache File (data) Modified: head/contrib/file/magic/Magdir/elf ============================================================================== --- head/contrib/file/magic/Magdir/elf Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/magic/Magdir/elf Fri Sep 4 05:56:14 2015 (r287453) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: elf,v 1.68 2014/09/19 19:05:57 christos Exp $ +# $File: elf,v 1.69 2015/06/16 17:23:08 christos Exp $ # elf: file(1) magic for ELF executables # # We have to check the byte order flag to see what byte order all the @@ -15,6 +15,32 @@ # Modified by (4): (VMS Itanium) # Modified by (5): Matthias Urlichs (Listing of many architectures) +0 name elf-mips +>0 lelong&0xf0000000 0x00000000 MIPS-I +>0 lelong&0xf0000000 0x10000000 MIPS-II +>0 lelong&0xf0000000 0x20000000 MIPS-III +>0 lelong&0xf0000000 0x30000000 MIPS-IV +>0 lelong&0xf0000000 0x40000000 MIPS-V +>0 lelong&0xf0000000 0x50000000 MIPS32 +>0 lelong&0xf0000000 0x60000000 MIPS64 +>0 lelong&0xf0000000 0x70000000 MIPS32 rel2 +>0 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>0 lelong&0xf0000000 0x90000000 MIPS32 rel6 +>0 lelong&0xf0000000 0xa0000000 MIPS64 rel6 + +0 name elf-sparc +>0 lelong&0x00ffff00 0x00000100 V8+ Required, +>0 lelong&0x00ffff00 0x00000200 Sun UltraSPARC1 Extensions Required, +>0 lelong&0x00ffff00 0x00000400 HaL R1 Extensions Required, +>0 lelong&0x00ffff00 0x00000800 Sun UltraSPARC3 Extensions Required, +>0 lelong&0x3 0 total store ordering, +>0 lelong&0x3 1 partial store ordering, +>0 lelong&0x3 2 relaxed memory ordering, + +0 name elf-pa-risc +>2 leshort 0x0214 2.0 +>0 leshort &0x0008 (LP64) + 0 name elf-le >16 leshort 0 no file type, !:mime application/octet-stream @@ -55,47 +81,26 @@ >18 leshort 8 # only for 32-bit >>4 byte 1 ->>>36 lelong&0xf0000000 0x00000000 MIPS-I ->>>36 lelong&0xf0000000 0x10000000 MIPS-II ->>>36 lelong&0xf0000000 0x20000000 MIPS-III ->>>36 lelong&0xf0000000 0x30000000 MIPS-IV ->>>36 lelong&0xf0000000 0x40000000 MIPS-V ->>>36 lelong&0xf0000000 0x50000000 MIPS32 ->>>36 lelong&0xf0000000 0x60000000 MIPS64 ->>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2 ->>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>>>36 use elf-mips # only for 64-bit >>4 byte 2 ->>>48 lelong&0xf0000000 0x00000000 MIPS-I ->>>48 lelong&0xf0000000 0x10000000 MIPS-II ->>>48 lelong&0xf0000000 0x20000000 MIPS-III ->>>48 lelong&0xf0000000 0x30000000 MIPS-IV ->>>48 lelong&0xf0000000 0x40000000 MIPS-V ->>>48 lelong&0xf0000000 0x50000000 MIPS32 ->>>48 lelong&0xf0000000 0x60000000 MIPS64 ->>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2 ->>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>>>48 use elf-mips >18 leshort 9 Amdahl, >18 leshort 10 MIPS (deprecated), >18 leshort 11 RS6000, >18 leshort 15 PA-RISC, # only for 32-bit >>4 byte 1 ->>>38 leshort 0x0214 2.0 ->>>36 leshort &0x0008 (LP64) +>>>36 use elf-pa-risc # only for 64-bit >>4 byte 2 ->>>50 leshort 0x0214 2.0 ->>>48 leshort &0x0008 (LP64) +>>>48 use elf-pa-risc >18 leshort 16 nCUBE, >18 leshort 17 Fujitsu VPP500, >18 leshort 18 SPARC32PLUS, # only for 32-bit >>4 byte 1 ->>>36 lelong&0xffff00 0x000100 V8+ Required, ->>>36 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ->>>36 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ->>>36 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, +>>>36 use elf-sparc >18 leshort 19 Intel 80960, >18 leshort 20 PowerPC or cisco 4500, >18 leshort 21 64-bit PowerPC or cisco 7500, @@ -117,12 +122,7 @@ >18 leshort 42 Renesas SH, >18 leshort 43 SPARC V9, >>4 byte 2 ->>>48 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ->>>48 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ->>>48 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, ->>>48 lelong&0x3 0 total store ordering, ->>>48 lelong&0x3 1 partial store ordering, ->>>48 lelong&0x3 2 relaxed memory ordering, +>>>48 use elf-sparc >18 leshort 44 Siemens Tricore Embedded Processor, >18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc., >18 leshort 46 Renesas H8/300, Modified: head/contrib/file/magic/Magdir/fortran ============================================================================== --- head/contrib/file/magic/Magdir/fortran Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/magic/Magdir/fortran Fri Sep 4 05:56:14 2015 (r287453) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ -# $File: fortran,v 1.8 2014/06/03 19:01:34 christos Exp $ +# $File: fortran,v 1.9 2015/06/17 19:55:27 christos Exp $ # FORTRAN source -0 regex/100l \^[Cc][\ \t] FORTRAN program +0 regex/100l \^[Cc][\ \t] FORTRAN program text !:mime text/x-fortran !:strength - 5 Modified: head/contrib/file/magic/Magdir/mail.news ============================================================================== --- head/contrib/file/magic/Magdir/mail.news Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/magic/Magdir/mail.news Fri Sep 4 05:56:14 2015 (r287453) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: mail.news,v 1.22 2013/01/04 14:22:07 christos Exp $ +# $File: mail.news,v 1.23 2015/06/29 14:44:26 christos Exp $ # mail.news: file(1) magic for mail and news # # Unfortunately, saved netnews also has From line added in some news software. @@ -41,6 +41,7 @@ # From: Simon Matter 0 string \241\002\213\015skiplist\ file\0\0\0 Cyrus skiplist DB +0 string \241\002\213\015twoskip\ file\0\0\0\0 Cyrus twoskip DB # JAM(mbp) Fidonet message area databases # JHR file Modified: head/contrib/file/magic/Magdir/make ============================================================================== --- head/contrib/file/magic/Magdir/make Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/magic/Magdir/make Fri Sep 4 05:56:14 2015 (r287453) @@ -2,14 +2,20 @@ # $File: make,v 1.1 2011/12/08 12:12:46 rrt Exp $ # make: file(1) magic for makefiles # -0 regex \^CFLAGS makefile script text +0 regex/100l \^CFLAGS makefile script text !:mime text/x-makefile -0 regex \^LDFLAGS makefile script text +0 regex/100l \^VPATH makefile script text !:mime text/x-makefile -0 regex \^all: makefile script text +0 regex/100l \^LDFLAGS makefile script text !:mime text/x-makefile -0 regex \^.PRECIOUS makefile script text +0 regex/100l \^all: makefile script text +!:mime text/x-makefile +0 regex/100l \^\.PRECIOUS makefile script text +!:mime text/x-makefile +0 regex/100l \^\.BEGIN BSD makefile script text +!:mime text/x-makefile +0 regex/100l \^\.include BSD makefile script text !:mime text/x-makefile -0 regex \^SUBDIRS automake makefile script text +0 regex/100l \^SUBDIRS automake makefile script text !:mime text/x-makefile Modified: head/contrib/file/magic/Magdir/map ============================================================================== --- head/contrib/file/magic/Magdir/map Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/magic/Magdir/map Fri Sep 4 05:56:14 2015 (r287453) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ -# $File: map,v 1.1 2014/06/03 18:22:25 christos Exp $ +# $File: map,v 1.3 2015/07/09 15:16:41 christos Exp $ # map: file(1) magic for Map data # @@ -9,9 +9,11 @@ 8 string .FIT FIT Map data >15 byte 0 >>35 belong x \b, unit id %d -# 20 years after unix epoch >>39 lelong x \b, serial %u ->>43 ledate/631152000 x \b, %s +# http://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml +# 20 years after unix epoch +# TZ=GMT date -d '1989-12-31 0:00' +%s +>>43 leldate+631065600 x \b, %s >>47 leshort x \b, manufacturer %d >>47 leshort 1 \b (garmin) Modified: head/contrib/file/src/file.c ============================================================================== --- head/contrib/file/src/file.c Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/src/file.c Fri Sep 4 05:56:14 2015 (r287453) @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.164 2015/06/03 18:21:24 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.165 2015/06/11 12:52:32 christos Exp $") #endif /* lint */ #include "magic.h" Modified: head/contrib/file/src/funcs.c ============================================================================== --- head/contrib/file/src/funcs.c Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/src/funcs.c Fri Sep 4 05:56:14 2015 (r287453) @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.82 2015/06/03 18:01:20 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.83 2015/06/16 14:17:37 christos Exp $") #endif /* lint */ #include "magic.h" @@ -107,8 +107,10 @@ file_error_core(struct magic_set *ms, in if (lineno != 0) { free(ms->o.buf); ms->o.buf = NULL; - file_printf(ms, "line %" SIZE_T_FORMAT "u: ", lineno); + file_printf(ms, "line %" SIZE_T_FORMAT "u:", lineno); } + if (ms->o.buf && *ms->o.buf) + file_printf(ms, " "); file_vprintf(ms, f, va); if (error > 0) file_printf(ms, " (%s)", strerror(error)); Modified: head/contrib/file/src/readelf.c ============================================================================== --- head/contrib/file/src/readelf.c Fri Sep 4 05:42:08 2015 (r287452) +++ head/contrib/file/src/readelf.c Fri Sep 4 05:56:14 2015 (r287453) @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.119 2015/04/09 20:01:41 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.120 2015/06/16 14:18:07 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -1048,9 +1048,18 @@ doshn(struct magic_set *ms, int clazz, i break; } + /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: + if (xsh_size + xsh_offset > (uintmax_t)fsize) { + if (file_printf(ms, + ", note offset/size 0x%jx+0x%jx exceeds" + " file size 0x%jx", (uintmax_t)xsh_offset, + (uintmax_t)xsh_size, (uintmax_t)fsize) == -1) + return -1; + return 0; + } if ((nbuf = malloc(xsh_size)) == NULL) { file_error(ms, errno, "Cannot allocate memory" " for note"); Modified: head/lib/libmagic/config.h ============================================================================== --- head/lib/libmagic/config.h Fri Sep 4 05:42:08 2015 (r287452) +++ head/lib/libmagic/config.h Fri Sep 4 05:56:14 2015 (r287453) @@ -290,7 +290,7 @@ #define PACKAGE_NAME "file" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "file 5.23" +#define PACKAGE_STRING "file 5.24" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "file" @@ -299,7 +299,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "5.23" +#define PACKAGE_VERSION "5.24" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -330,7 +330,7 @@ /* Version number of package */ -#define VERSION "5.23" +#define VERSION "5.24" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ From owner-svn-src-all@freebsd.org Fri Sep 4 08:04:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 412219C91CB; Fri, 4 Sep 2015 08:04:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.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 31FBB1FA; Fri, 4 Sep 2015 08:04:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8484DHw026995; Fri, 4 Sep 2015 08:04:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8484Dth026994; Fri, 4 Sep 2015 08:04:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509040804.t8484Dth026994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 4 Sep 2015 08:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287454 - head/contrib/file/src 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, 04 Sep 2015 08:04:13 -0000 Author: delphij Date: Fri Sep 4 08:04:12 2015 New Revision: 287454 URL: https://svnweb.freebsd.org/changeset/base/287454 Log: Fix build. Modified: head/contrib/file/src/readelf.c Modified: head/contrib/file/src/readelf.c ============================================================================== --- head/contrib/file/src/readelf.c Fri Sep 4 05:56:14 2015 (r287453) +++ head/contrib/file/src/readelf.c Fri Sep 4 08:04:12 2015 (r287454) @@ -1052,7 +1052,7 @@ doshn(struct magic_set *ms, int clazz, i /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: - if (xsh_size + xsh_offset > (uintmax_t)fsize) { + if (xsh_size + (uintmax_t)xsh_offset > (uintmax_t)fsize) { if (file_printf(ms, ", note offset/size 0x%jx+0x%jx exceeds" " file size 0x%jx", (uintmax_t)xsh_offset, From owner-svn-src-all@freebsd.org Fri Sep 4 08:37:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5F989CA24B for ; Fri, 4 Sep 2015 08:37:08 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (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 75C341318 for ; Fri, 4 Sep 2015 08:37:08 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wicge5 with SMTP id ge5so9757649wic.0 for ; Fri, 04 Sep 2015 01:37:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ZOVt1dyZjOOmXF/vCsRiMRjMQA9iimVQhu8Okoi8fS4=; b=DKTPNs0pwYFWVCzBiuQRRRwvs3VV7Z+fZSaYLzvRZ4FV/8VlRX23jqyjCvjCqvB3jt tlaVu/3Cw2yuNBGsoJuaL1W4Fxf0VT6KmAQxbDRwnWv/VvRy85R0s6qEM8bUhXw7U4mi cADNwcx7wWJT/W+VA06p9PxyLKLflsWNgM2ZlCqNZ38yoMei86lt1VDcZefDsagMm3zp FKEgRzOhHsfip6AWC2P3f9fe46KntHQVct+ua0yGmENZ76tnO76bnvOQiPIMcxkCJUpu VjzKf399MIHBPlqU8esX8dHDaie7nrQDrLdVEjC58oDYzcNCJn6XMUxbw8tnT1eGfwuq lq5g== X-Gm-Message-State: ALoCoQmHHxEucN4YvmaPqIhhW7jlqmAmS/Wy9L78ZvSX8o1x3i8zSG2G6Vaddfplsnm3myKMDNHA X-Received: by 10.180.12.145 with SMTP id y17mr4905202wib.87.1441355821570; Fri, 04 Sep 2015 01:37:01 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id 4sm2638865wjt.46.2015.09.04.01.37.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2015 01:37:00 -0700 (PDT) Subject: Re: svn commit: r287283 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Andriy Gapon , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201508290922.t7T9MXhF007620@repo.freebsd.org> <55E88733.5010403@FreeBSD.org> From: Steven Hartland Message-ID: <55E95826.8070005@multiplay.co.uk> Date: Fri, 4 Sep 2015 09:36:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55E88733.5010403@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: Fri, 04 Sep 2015 08:37:08 -0000 Would it be worth commenting in the code about this, so we don't make the mistake again? On 03/09/2015 18:45, Andriy Gapon wrote: > >Date: Sat Aug From owner-svn-src-all@freebsd.org Fri Sep 4 09:19:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B63E9C980B; Fri, 4 Sep 2015 09:19:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4D21CE29; Fri, 4 Sep 2015 09:19:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t849J2Kv056688; Fri, 4 Sep 2015 09:19:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t849J10i056685; Fri, 4 Sep 2015 09:19:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509040919.t849J10i056685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 4 Sep 2015 09:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287455 - head/sys/cam/ctl 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, 04 Sep 2015 09:19:02 -0000 Author: mav Date: Fri Sep 4 09:19:01 2015 New Revision: 287455 URL: https://svnweb.freebsd.org/changeset/base/287455 Log: Remove some dead code. Deleted: head/sys/cam/ctl/ctl_backend_block.h Modified: head/sys/cam/ctl/README.ctl.txt head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/README.ctl.txt ============================================================================== --- head/sys/cam/ctl/README.ctl.txt Fri Sep 4 08:04:12 2015 (r287454) +++ head/sys/cam/ctl/README.ctl.txt Fri Sep 4 09:19:01 2015 (r287455) @@ -318,7 +318,6 @@ These files define the basic CTL backend explain the API. ctl_backend_block.c -ctl_backend_block.h: ------------------- The block and file backend. This allows for using a disk or a file as the Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Fri Sep 4 08:04:12 2015 (r287454) +++ head/sys/cam/ctl/ctl_backend_block.c Fri Sep 4 09:19:01 2015 (r287455) @@ -154,7 +154,6 @@ typedef uint64_t (*cbb_getattr_t)(struct */ struct ctl_be_block_lun { struct ctl_lun_create_params params; - struct ctl_block_disk *disk; char lunname[32]; char *dev_path; ctl_be_block_type dev_type; @@ -196,8 +195,6 @@ struct ctl_be_block_lun { */ struct ctl_be_block_softc { struct mtx lock; - int num_disks; - STAILQ_HEAD(, ctl_block_disk) disk_list; int num_luns; STAILQ_HEAD(, ctl_be_block_lun) lun_list; }; @@ -2906,7 +2903,6 @@ ctl_be_block_init(void) mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - STAILQ_INIT(&softc->disk_list); STAILQ_INIT(&softc->lun_list); return (retval); From owner-svn-src-all@freebsd.org Fri Sep 4 09:22:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADE979C9A93; Fri, 4 Sep 2015 09:22:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9F7CC11A8; Fri, 4 Sep 2015 09:22:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t849MHX6060510; Fri, 4 Sep 2015 09:22:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t849MHkw060509; Fri, 4 Sep 2015 09:22:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201509040922.t849MHkw060509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 4 Sep 2015 09:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287456 - 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: Fri, 04 Sep 2015 09:22:17 -0000 Author: tuexen Date: Fri Sep 4 09:22:16 2015 New Revision: 287456 URL: https://svnweb.freebsd.org/changeset/base/287456 Log: Add a NULL pointer check to silence the clang code analyzer. MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Sep 4 09:19:01 2015 (r287455) +++ head/sys/netinet/sctputil.c Fri Sep 4 09:22:16 2015 (r287456) @@ -2667,6 +2667,9 @@ sctp_notify_assoc_change(uint16_t state, #endif + if (stcb == NULL) { + return; + } if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { notif_len = sizeof(struct sctp_assoc_change); if (abort != NULL) { From owner-svn-src-all@freebsd.org Fri Sep 4 09:24:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C7C9C9BAF; Fri, 4 Sep 2015 09:24:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.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 B4C4F1330; Fri, 4 Sep 2015 09:24:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t849O8fJ060621; Fri, 4 Sep 2015 09:24:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t849O8RK060620; Fri, 4 Sep 2015 09:24:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201509040924.t849O8RK060620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 4 Sep 2015 09:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287457 - 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: Fri, 04 Sep 2015 09:24:08 -0000 Author: tuexen Date: Fri Sep 4 09:24:07 2015 New Revision: 287457 URL: https://svnweb.freebsd.org/changeset/base/287457 Log: Don't leak memory in an error case. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Sep 4 09:22:16 2015 (r287456) +++ head/sys/netinet/sctp_output.c Fri Sep 4 09:24:07 2015 (r287457) @@ -11235,6 +11235,11 @@ sctp_send_hb(struct sctp_tcb *stcb, stru break; #endif default: + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } + sctp_free_a_chunk(stcb, chk, so_locked); return; break; } From owner-svn-src-all@freebsd.org Fri Sep 4 10:14:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 901C49C91D7; Fri, 4 Sep 2015 10:14:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.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 81EF5EEE; Fri, 4 Sep 2015 10:14:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84AExJ6081736; Fri, 4 Sep 2015 10:14:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84AExOD081735; Fri, 4 Sep 2015 10:14:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509041014.t84AExOD081735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 4 Sep 2015 10:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287458 - head/usr.sbin/ctladm 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, 04 Sep 2015 10:14:59 -0000 Author: mav Date: Fri Sep 4 10:14:58 2015 New Revision: 287458 URL: https://svnweb.freebsd.org/changeset/base/287458 Log: Addition to r287455. Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Fri Sep 4 09:24:07 2015 (r287457) +++ head/usr.sbin/ctladm/ctladm.c Fri Sep 4 10:14:58 2015 (r287458) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Fri Sep 4 10:16:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 552839C92E6; Fri, 4 Sep 2015 10:16:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.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 47113116A; Fri, 4 Sep 2015 10:16:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84AGM9t081976; Fri, 4 Sep 2015 10:16:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84AGMO0081975; Fri, 4 Sep 2015 10:16:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509041016.t84AGMO0081975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 4 Sep 2015 10:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287459 - 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: Fri, 04 Sep 2015 10:16:22 -0000 Author: mav Date: Fri Sep 4 10:16:21 2015 New Revision: 287459 URL: https://svnweb.freebsd.org/changeset/base/287459 Log: Another addition to r287455. Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Fri Sep 4 10:14:58 2015 (r287458) +++ head/usr.sbin/ctld/kernel.c Fri Sep 4 10:16:21 2015 (r287459) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Fri Sep 4 12:02:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE81F9CAEA0; Fri, 4 Sep 2015 12:02:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 960A017A4; Fri, 4 Sep 2015 12:02:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84C2DpI028067; Fri, 4 Sep 2015 12:02:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84C2DZX028065; Fri, 4 Sep 2015 12:02:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509041202.t84C2DZX028065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 4 Sep 2015 12:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287460 - 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: Fri, 04 Sep 2015 12:02:13 -0000 Author: glebius Date: Fri Sep 4 12:02:12 2015 New Revision: 287460 URL: https://svnweb.freebsd.org/changeset/base/287460 Log: Make tcp_mtudisc() static and void. No functional changes. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Sep 4 10:16:21 2015 (r287459) +++ head/sys/netinet/tcp_subr.c Fri Sep 4 12:02:12 2015 (r287460) @@ -228,6 +228,7 @@ VNET_DEFINE(struct hhook_head *, tcp_hhh static struct inpcb *tcp_notify(struct inpcb *, int); static struct inpcb *tcp_mtudisc_notify(struct inpcb *, int); +static void tcp_mtudisc(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); @@ -1811,10 +1812,11 @@ static struct inpcb * tcp_mtudisc_notify(struct inpcb *inp, int error) { - return (tcp_mtudisc(inp, -1)); + tcp_mtudisc(inp, -1); + return (inp); } -struct inpcb * +static void tcp_mtudisc(struct inpcb *inp, int mtuoffer) { struct tcpcb *tp; @@ -1823,7 +1825,7 @@ tcp_mtudisc(struct inpcb *inp, int mtuof INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) || (inp->inp_flags & INP_DROPPED)) - return (inp); + return; tp = intotcpcb(inp); KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); @@ -1845,7 +1847,6 @@ tcp_mtudisc(struct inpcb *inp, int mtuof if (tp->t_flags & TF_SACK_PERMIT) EXIT_FASTRECOVERY(tp->t_flags); tcp_output(tp); - return (inp); } #ifdef INET Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Sep 4 10:16:21 2015 (r287459) +++ head/sys/netinet/tcp_var.h Fri Sep 4 12:02:12 2015 (r287460) @@ -687,8 +687,6 @@ void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct inpcb * tcp_drop_syn_sent(struct inpcb *, int); -struct inpcb * - tcp_mtudisc(struct inpcb *, int); struct tcpcb * tcp_newtcpcb(struct inpcb *); int tcp_output(struct tcpcb *); From owner-svn-src-all@freebsd.org Fri Sep 4 14:18:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A74B59C9109 for ; Fri, 4 Sep 2015 14:18:21 +0000 (UTC) (envelope-from s.tyshchenko@identika.pro) Received: from scale222.ru (scale222.ru [51.254.99.22]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5717C18B2 for ; Fri, 4 Sep 2015 14:18:20 +0000 (UTC) (envelope-from s.tyshchenko@identika.pro) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=scale222.ru; s=default; h=Content-Type:List-Unsubscribe:Message-ID:Sender:From:Date:MIME-Version:Subject:To; bh=WrUygQB12l8kpGhqCsynlDeeHuvWc0oxWeoZd1tdoJg=; b=T8/xZ75tHrX0y/2nXd+na76gLtv3rdYxFb7GuPPCtbfzHpN4rhvg/J7dXSOqaACrNh0YGyQVKTU6jGg/IYfDZOBLj8mKhiK8ufwwbYaKNls25aarGCfpNMSnEouENzEi4kGd070GYVI2a2EpM5LqVMcGTpTx6ftwEv85kxR9b+Y=; Received: from root by scale222.ru with local (Exim 4.80) (envelope-from ) id 1ZXron-0006vy-Lp for svn-src-all@freebsd.org; Fri, 04 Sep 2015 16:18:17 +0200 To: svn-src-all@freebsd.org Subject: Plastic ProductS MIME-Version: 1.0 Date: Fri, 4 Sep 2015 16:18:17 +0200 From: Sergey Tyshchenko Sender: s.tyshchenko@identika.pro Message-ID: <243144876.27121@scale222.ru> X-Priority: 3 X-Mailer: scale222.ru mailer. Ver. 1.1. Precedence: bulk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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, 04 Sep 2015 14:18:21 -0000 TWFudWZhY3R1cmUgb2YgwqBwcmludGVkIHByb2R1Y3RzIGZyb20gQUJTIHBsYXN0aWMsIGFjcnls aWMsIFBFVCBtZXRob2Qgb2YgdmFjdXVtIGZvcm1pbmcuIFNlcmllcyBwcm9kdWN0aW9uIG9mIExl dHRlcnMsIHNpZ25zLCBsaWdodCBib3hlcyAobGlnaHRib3gpLCBQT1MgbWF0ZXJpYWwgZm9yIHJl dGFpbCBjaGFpbnMuRXhhbXBsZXMgb2Ygb3VyIHdvcms6wqBodHRwOi8vaWRlbnRpa2EucHJvL2Nv dW50ZXJfbGluay9wcmVzZW50YXRpb25fZW4ucGRm4oCLDQoJCQkJCQkJCQkJCQkJCQkJCQkJDQoJ CQkJCQkJCQkJCQkJCQkJCQkJDQoJCQkJCQkJCQkJCQkJCQkJCQkJCQ0KCQkJCQkJCQkJCQkJCQkJ CQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkJCQkJDQoJCQkJCQkJCQkJCQkJCQkJCQkJCQ0KCQkJCQkJ CQkJCQkJCQkJCQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkNCgkJCQkJ CQkJCQkJCQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkJDQoJCQkJCQkJ CQkJCQkJCQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkJCQkNCgkJCQkJCQkJCQkJCQkJCQkJCQkJU2Vy Z2V5IFR5c2hjaGVua29DRU8gfMKgSURFTlRJS0EuUFJPVmliZXI6wqArMzgwNTA1NTY2OTY1wqB8 IFdoYXRzQXBwOsKgKzM4MDUwNTU2Njk2NVNreXBlOiB0LnNlcmdleS5tcy50eXNoY2hlbmtvQGlk ZW50aWthLnBybyB8wqBpZGVudGlrYS5wcm8wMzA0MCB8IEdvbG9zaWl2c2t5aSBBdmUuIDcwIHwg b2ZmaWNlIDUwMiB8IEtpZXbCoA== From owner-svn-src-all@freebsd.org Fri Sep 4 15:34:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EE619CAD2C; Fri, 4 Sep 2015 15:34:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 F336FAF; Fri, 4 Sep 2015 15:34:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84FYRa2015874; Fri, 4 Sep 2015 15:34:27 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84FYRqP015873; Fri, 4 Sep 2015 15:34:27 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041534.t84FYRqP015873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 15:34: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: r287461 - stable/10/sys/dev/ixgbe 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, 04 Sep 2015 15:34:28 -0000 Author: sbruno Date: Fri Sep 4 15:34:27 2015 New Revision: 287461 URL: https://svnweb.freebsd.org/changeset/base/287461 Log: MFC r286238 A misplaced #endif in ixgbe_ioctl() causes interface MTU to become zero when INET and INET6 are undefined. PR: 162028 Submitted by: hoomanfazaeli@gmail.com pluknet Modified: stable/10/sys/dev/ixgbe/if_ix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Fri Sep 4 12:02:12 2015 (r287460) +++ stable/10/sys/dev/ixgbe/if_ix.c Fri Sep 4 15:34:27 2015 (r287461) @@ -770,9 +770,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c struct ifreq *ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; - bool avoid_reset = FALSE; #endif int error = 0; + bool avoid_reset = FALSE; switch (command) { @@ -785,7 +785,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c if (ifa->ifa_addr->sa_family == AF_INET6) avoid_reset = TRUE; #endif -#if defined(INET) || defined(INET6) /* ** Calling init results in link renegotiation, ** so we avoid doing it when possible. @@ -794,11 +793,12 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixgbe_init(adapter); +#if defined(INET) if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); +#endif } else error = ether_ioctl(ifp, command, data); -#endif break; case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); From owner-svn-src-all@freebsd.org Fri Sep 4 15:40:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 138729CAFA8; Fri, 4 Sep 2015 15:40:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 03272650; Fri, 4 Sep 2015 15:40:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84FeKUP016214; Fri, 4 Sep 2015 15:40:20 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84FeKIH016212; Fri, 4 Sep 2015 15:40:20 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041540.t84FeKIH016212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 15:40:20 +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: r287462 - in stable/10/sys/x86: include 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: Fri, 04 Sep 2015 15:40:21 -0000 Author: sbruno Date: Fri Sep 4 15:40:19 2015 New Revision: 287462 URL: https://svnweb.freebsd.org/changeset/base/287462 Log: MFC r276834 Update Features2 to display SDBG capability of processor. This is showing up on Haswell-class CPUs From the Intel SDM, "Table 3-20. Feature Information Returned in the ECX Register" 11 | SDBG | A value of 1 indicates the processor supports IA32_DEBUG_INTERFACE MSR for silicon debug. Submitted by: jiashiun@gmail.com Modified: stable/10/sys/x86/include/specialreg.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Fri Sep 4 15:34:27 2015 (r287461) +++ stable/10/sys/x86/include/specialreg.h Fri Sep 4 15:40:19 2015 (r287462) @@ -157,6 +157,7 @@ #define CPUID2_TM2 0x00000100 #define CPUID2_SSSE3 0x00000200 #define CPUID2_CNXTID 0x00000400 +#define CPUID2_SDBG 0x00000800 #define CPUID2_FMA 0x00001000 #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Fri Sep 4 15:34:27 2015 (r287461) +++ stable/10/sys/x86/x86/identcpu.c Fri Sep 4 15:40:19 2015 (r287462) @@ -781,7 +781,7 @@ printcpuinfo(void) "\011TM2" /* Thermal Monitor 2 */ "\012SSSE3" /* SSSE3 */ "\013CNXT-ID" /* L1 context ID available */ - "\014" + "\014SDBG" /* IA32 silicon debug */ "\015FMA" /* Fused Multiply Add */ "\016CX16" /* CMPXCHG16B Instruction */ "\017xTPR" /* Send Task Priority Messages*/ From owner-svn-src-all@freebsd.org Fri Sep 4 15:45:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE55E9CA213; Fri, 4 Sep 2015 15:45:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 9E134A51; Fri, 4 Sep 2015 15:45:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84FjhtF020112; Fri, 4 Sep 2015 15:45:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84FjhSv020111; Fri, 4 Sep 2015 15:45:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041545.t84FjhSv020111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 15:45: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: r287463 - stable/10/usr.sbin/binmiscctl 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, 04 Sep 2015 15:45:43 -0000 Author: sbruno Date: Fri Sep 4 15:45:42 2015 New Revision: 287463 URL: https://svnweb.freebsd.org/changeset/base/287463 Log: MFC r277853 Check for invalid length or more than max length for the interpreter, instead of the validity of the string pointer holding the interpreter. Submitted by: sson Modified: stable/10/usr.sbin/binmiscctl/binmiscctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- stable/10/usr.sbin/binmiscctl/binmiscctl.c Fri Sep 4 15:40:19 2015 (r287462) +++ stable/10/usr.sbin/binmiscctl/binmiscctl.c Fri Sep 4 15:45:42 2015 (r287463) @@ -363,7 +363,7 @@ add_cmd(__unused int argc, char *argv[], usage("Error: Missing magic argument"); } - if (!xbe->xbe_interpreter) { + if (!strnlen(xbe->xbe_interpreter, IBE_INTERP_LEN_MAX)) { usage("Error: Missing 'interpreter' argument"); } From owner-svn-src-all@freebsd.org Fri Sep 4 16:07:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D70109CAD64; Fri, 4 Sep 2015 16:07:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 C6362B20; Fri, 4 Sep 2015 16:07:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84G7S7v029317; Fri, 4 Sep 2015 16:07:28 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84G7S6f029313; Fri, 4 Sep 2015 16:07:28 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041607.t84G7S6f029313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 16:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287465 - head/sys/dev/e1000 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, 04 Sep 2015 16:07:29 -0000 Author: sbruno Date: Fri Sep 4 16:07:27 2015 New Revision: 287465 URL: https://svnweb.freebsd.org/changeset/base/287465 Log: igb(4): Update and fix HW errata - HW errata workaround for IPv6 offload w/ extension headers - Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl Differential Revision: https://reviews.freebsd.org/D3165 Submitted by: erj MFC after: 1 month Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Sep 4 15:49:51 2015 (r287464) +++ head/sys/dev/e1000/if_igb.c Fri Sep 4 16:07:27 2015 (r287465) @@ -42,71 +42,12 @@ #include "opt_altq.h" #endif -#include -#include -#ifndef IGB_LEGACY_TX -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#ifdef RSS -#include -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "e1000_api.h" -#include "e1000_82575.h" #include "if_igb.h" /********************************************************************* - * Set this to one to display debug statistics - *********************************************************************/ -int igb_display_debug_stats = 0; - -/********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 2.4.0"; +char igb_driver_version[] = "2.5.2"; /********************************************************************* @@ -121,60 +62,47 @@ char igb_driver_version[] = "version - 2 static igb_vendor_info_t igb_vendor_info_array[] = { - { 0x8086, E1000_DEV_ID_82575EB_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82575EB_FIBER_SERDES, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82575GB_QUAD_COPPER, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_NS, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_NS_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_SERDES_QUAD, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_QUAD_COPPER, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_QUAD_COPPER_ET2, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82576_VF, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82580_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82580_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82580_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82580_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82580_COPPER_DUAL, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_82580_QUAD_FIBER, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_DH89XXCC_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_DH89XXCC_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_DH89XXCC_SFP, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_DH89XXCC_BACKPLANE, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I350_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I350_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I350_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I350_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I350_VF, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_COPPER_IT, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_COPPER_OEM1, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I210_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I211_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I354_BACKPLANE_1GBPS, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS, - PCI_ANY_ID, PCI_ANY_ID, 0}, - { 0x8086, E1000_DEV_ID_I354_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82575EB_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82575EB_FIBER_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82575GB_QUAD_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_NS, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_NS_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_FIBER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_SERDES_QUAD, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_QUAD_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_QUAD_COPPER_ET2, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82576_VF, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82580_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82580_FIBER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82580_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82580_SGMII, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82580_COPPER_DUAL, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_82580_QUAD_FIBER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_SGMII, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_SFP, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_BACKPLANE, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I350_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I350_FIBER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I350_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I350_SGMII, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I350_VF, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_IT, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_OEM1, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_FLASHLESS, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SERDES_FLASHLESS, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_FIBER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SERDES, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I211_COPPER, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I354_BACKPLANE_1GBPS, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS, 0, 0, 0}, + {IGB_INTEL_VENDOR_ID, E1000_DEV_ID_I354_SGMII, 0, 0, 0}, /* required last entry */ - { 0, 0, 0, 0, 0} + {0, 0, 0, 0, 0} }; /********************************************************************* @@ -423,7 +351,7 @@ SYSCTL_INT(_hw_igb, OID_AUTO, rx_process static int igb_probe(device_t dev) { - char adapter_name[60]; + char adapter_name[256]; uint16_t pci_vendor_id = 0; uint16_t pci_device_id = 0; uint16_t pci_subvendor_id = 0; @@ -433,7 +361,7 @@ igb_probe(device_t dev) INIT_DEBUGOUT("igb_probe: begin"); pci_vendor_id = pci_get_vendor(dev); - if (pci_vendor_id != IGB_VENDOR_ID) + if (pci_vendor_id != IGB_INTEL_VENDOR_ID) return (ENXIO); pci_device_id = pci_get_device(dev); @@ -446,11 +374,11 @@ igb_probe(device_t dev) (pci_device_id == ent->device_id) && ((pci_subvendor_id == ent->subvendor_id) || - (ent->subvendor_id == PCI_ANY_ID)) && + (ent->subvendor_id == 0)) && ((pci_subdevice_id == ent->subdevice_id) || - (ent->subdevice_id == PCI_ANY_ID))) { - sprintf(adapter_name, "%s %s", + (ent->subdevice_id == 0))) { + sprintf(adapter_name, "%s, Version - %s", igb_strings[ent->index], igb_driver_version); device_set_desc_copy(dev, adapter_name); @@ -458,7 +386,6 @@ igb_probe(device_t dev) } ent++; } - return (ENXIO); } @@ -490,7 +417,7 @@ igb_attach(device_t dev) adapter->dev = adapter->osdep.dev = dev; IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* SYSCTL stuff */ + /* SYSCTLs */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, @@ -1030,7 +957,6 @@ igb_mq_start_locked(struct ifnet *ifp, s adapter->link_active == 0) return (ENETDOWN); - /* Process the queue */ while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = igb_xmit(txr, &next)) != 0) { @@ -1367,6 +1293,7 @@ igb_init_locked(struct adapter *adapter) return; } igb_initialize_receive_units(adapter); + e1000_rx_fifo_flush_82575(&adapter->hw); /* Enable VLAN support */ if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) @@ -3008,21 +2935,6 @@ igb_init_dmac(struct adapter *adapter, u E1000_WRITE_REG(hw, E1000_DMACR, reg); -#ifdef I210_OBFF_SUPPORT - /* - * Set the OBFF Rx threshold to DMA Coalescing Rx - * threshold - 2KB and enable the feature in the - * hardware for I210. - */ - if (hw->mac.type == e1000_i210) { - int obff = dmac - 2; - reg = E1000_READ_REG(hw, E1000_DOBFFCTL); - reg &= ~E1000_DOBFFCTL_OBFFTHR_MASK; - reg |= (obff & E1000_DOBFFCTL_OBFFTHR_MASK) - | E1000_DOBFFCTL_EXIT_ACT_MASK; - E1000_WRITE_REG(hw, E1000_DOBFFCTL, reg); - } -#endif E1000_WRITE_REG(hw, E1000_DMCRTRH, 0); /* Set the interval before transition */ @@ -5675,7 +5587,7 @@ igb_update_stats_counters(struct adapter stats = (struct e1000_hw_stats *)adapter->stats; - if(adapter->hw.phy.media_type == e1000_media_type_copper || + if (adapter->hw.phy.media_type == e1000_media_type_copper || (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) { stats->symerrs += E1000_READ_REG(hw,E1000_SYMERRS); @@ -6140,18 +6052,18 @@ igb_add_hw_stats(struct adapter *adapter "1023-1522 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", CTLFLAG_RD, &stats->gorc, - "Good Octets Received"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_recvd", - CTLFLAG_RD, &stats->tor, - "Total Octets Received"); + "Good Octets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_recvd", + CTLFLAG_RD, &stats->tor, + "Total Octets Received"); /* Packet Transmission Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, "Good Octets Transmitted"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_txd", - CTLFLAG_RD, &stats->tot, - "Total Octets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_txd", + CTLFLAG_RD, &stats->tot, + "Total Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &stats->tpt, "Total Packets Transmitted"); @@ -6412,7 +6324,7 @@ igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) switch (adapter->dmac) { case 0: - /*Disabling */ + /* Disabling */ break; case 1: /* Just enable and use default */ adapter->dmac = 1000; Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Fri Sep 4 15:49:51 2015 (r287464) +++ head/sys/dev/e1000/if_igb.h Fri Sep 4 16:07:27 2015 (r287465) @@ -32,11 +32,66 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifndef _IGB_H_DEFINED_ -#define _IGB_H_DEFINED_ +#ifndef _IF_IGB_H_ +#define _IF_IGB_H_ -/* Tunables */ +#include +#include +#ifndef IGB_LEGACY_TX +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#ifdef RSS +#include +#include +#endif +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "e1000_api.h" +#include "e1000_82575.h" + +/* Tunables */ /* * IGB_TXD: Maximum number of Transmit Descriptors * @@ -168,7 +223,7 @@ /* * Micellaneous constants */ -#define IGB_VENDOR_ID 0x8086 +#define IGB_INTEL_VENDOR_ID 0x8086 #define IGB_JUMBO_PBA 0x00000028 #define IGB_DEFAULT_PBA 0x00000030 @@ -567,6 +622,6 @@ drbr_needs_enqueue(struct ifnet *ifp, st } #endif -#endif /* _IGB_H_DEFINED_ */ +#endif /* _IF_IGB_H_ */ From owner-svn-src-all@freebsd.org Fri Sep 4 16:13:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D6AB9CB110; Fri, 4 Sep 2015 16:13:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5BA3A12EF; Fri, 4 Sep 2015 16:13:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84GDTxh033871; Fri, 4 Sep 2015 16:13:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84GDQJR033838; Fri, 4 Sep 2015 16:13:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509041613.t84GDQJR033838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 4 Sep 2015 16:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287466 - in head/secure: libexec/sftp-server libexec/ssh-keysign libexec/ssh-pkcs11-helper usr.bin/scp usr.bin/sftp usr.bin/ssh-add usr.bin/ssh-agent usr.bin/ssh-keyscan usr.sbin/sshd 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, 04 Sep 2015 16:13:29 -0000 Author: bapt Date: Fri Sep 4 16:13:25 2015 New Revision: 287466 URL: https://svnweb.freebsd.org/changeset/base/287466 Log: Remove remnant from USEPRIVATELIB removal Sponsored by: gandi.net Modified: head/secure/libexec/sftp-server/Makefile head/secure/libexec/ssh-keysign/Makefile head/secure/libexec/ssh-pkcs11-helper/Makefile head/secure/usr.bin/scp/Makefile head/secure/usr.bin/sftp/Makefile head/secure/usr.bin/ssh-add/Makefile head/secure/usr.bin/ssh-agent/Makefile head/secure/usr.bin/ssh-keyscan/Makefile head/secure/usr.sbin/sshd/Makefile Modified: head/secure/libexec/sftp-server/Makefile ============================================================================== --- head/secure/libexec/sftp-server/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/libexec/sftp-server/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -18,7 +18,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif .include Modified: head/secure/libexec/ssh-keysign/Makefile ============================================================================== --- head/secure/libexec/ssh-keysign/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/libexec/ssh-keysign/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -14,7 +14,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif LIBADD+= crypto Modified: head/secure/libexec/ssh-pkcs11-helper/Makefile ============================================================================== --- head/secure/libexec/ssh-pkcs11-helper/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/libexec/ssh-pkcs11-helper/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -18,7 +18,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif LIBADD+= crypto Modified: head/secure/usr.bin/scp/Makefile ============================================================================== --- head/secure/usr.bin/scp/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/usr.bin/scp/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -17,7 +17,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif .include Modified: head/secure/usr.bin/sftp/Makefile ============================================================================== --- head/secure/usr.bin/sftp/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/usr.bin/sftp/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -17,7 +17,6 @@ LIBADD= ssh edit CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif .include Modified: head/secure/usr.bin/ssh-add/Makefile ============================================================================== --- head/secure/usr.bin/ssh-add/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/usr.bin/ssh-add/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -17,7 +17,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif .include Modified: head/secure/usr.bin/ssh-agent/Makefile ============================================================================== --- head/secure/usr.bin/ssh-agent/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/usr.bin/ssh-agent/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -17,7 +17,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif LIBADD+= crypto Modified: head/secure/usr.bin/ssh-keyscan/Makefile ============================================================================== --- head/secure/usr.bin/ssh-keyscan/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/usr.bin/ssh-keyscan/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -12,7 +12,6 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif .include Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Fri Sep 4 16:07:27 2015 (r287465) +++ head/secure/usr.sbin/sshd/Makefile Fri Sep 4 16:13:25 2015 (r287466) @@ -32,7 +32,6 @@ LIBADD= pam ssh util wrap CFLAGS+= -DHAVE_LDNS=1 #DPADD+= ${LIBLDNS} #LDADD+= -lldns -#USEPRIVATELIB+= ldns .endif .if ${MK_AUDIT} != "no" From owner-svn-src-all@freebsd.org Fri Sep 4 16:18:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA9A09CB2DE; Fri, 4 Sep 2015 16:18:19 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C80581870; Fri, 4 Sep 2015 16:18:19 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id B4F68E45D; Fri, 4 Sep 2015 09:18:13 -0700 (PDT) Date: Fri, 4 Sep 2015 09:18:13 -0700 From: hiren panchasara To: Sean Bruno , erj@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287465 - head/sys/dev/e1000 Message-ID: <20150904161813.GX68814@strugglingcoder.info> References: <201509041607.t84G7S6f029313@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NgLNC/STdjXvE6Rt" Content-Disposition: inline In-Reply-To: <201509041607.t84G7S6f029313@repo.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, 04 Sep 2015 16:18:20 -0000 --NgLNC/STdjXvE6Rt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable + erj On 09/04/15 at 04:07P, Sean Bruno wrote: > Author: sbruno > Date: Fri Sep 4 16:07:27 2015 > New Revision: 287465 > URL: https://svnweb.freebsd.org/changeset/base/287465 >=20 > Log: > igb(4): Update and fix HW errata > - HW errata workaround for IPv6 offload w/ extension headers It would be useful to know what is the actual problem here. > - Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl I'd also prefer if such changes come via separate commits. :-) > =20 > Differential Revision: https://reviews.freebsd.org/D3165 > Submitted by: erj > MFC after: 1 month > Sponsored by: Intel Corporation >=20 > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/e1000/if_igb.h [skip] Cheers, Hiren --NgLNC/STdjXvE6Rt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJV6cREXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lEsoH/2CBPzeGsRoK0pwP9VOUlJB5 IfNAKz2TqyFcynrHkQoyG2sDoj07UgRdFJIckayLDATJR8zg3kOLll3tEUei3iiK XKxAxtXKEb211NzO1OlytUY2dKWgYliD8ze/P1pOoQWAgWF9R7WP6yqe3duUar8Q PNR5GVO9hj6lpfoxwxMwi2+XyC0gM627eMGZFjPjCWJetJe9AtIyDZOL6BmugbLY /KVeryOB3aD9Xcd6DBJUbGGEN8CMsvFUjd1v4NdlowOePtxXMgMOvmZdQW8JxHf5 Bfzdcbs589fmxuT/yxYwSilLFPI3TNjaDjywKVp2Ks8GonR+m0P58HNkC5Gzmfo= =gEh5 -----END PGP SIGNATURE----- --NgLNC/STdjXvE6Rt-- From owner-svn-src-all@freebsd.org Fri Sep 4 16:30:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 739969CB82D; Fri, 4 Sep 2015 16:30:53 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 62C6B8D; Fri, 4 Sep 2015 16:30:53 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84GUroF039395; Fri, 4 Sep 2015 16:30:53 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84GUnT8039376; Fri, 4 Sep 2015 16:30:49 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041630.t84GUnT8039376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 16:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287467 - head/sys/dev/e1000 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, 04 Sep 2015 16:30:53 -0000 Author: sbruno Date: Fri Sep 4 16:30:48 2015 New Revision: 287467 URL: https://svnweb.freebsd.org/changeset/base/287467 Log: e1000: Shared code updates - Fix compiler warning in 80003es2lan.c - Add return value handler for e1000_*_kmrn_reg_80003es2lan - Fix usage of DEBUGOUT - Remove unnecessary variable initializations. - Removed unused variables (complaints from gcc). - Edit defines in 82571.h. - Add workaround for igb hw errata. - Shared code changes for Skylake/I219 support. - Remove unused OBFF and LTR functions. Differential Revision: https://reviews.freebsd.org/D3162 Submitted by: erj MFC after: 1 month Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_82540.c head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82542.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_82571.h head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_i210.c head/sys/dev/e1000/e1000_i210.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_nvm.h head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_80003es2lan.c Fri Sep 4 16:30:48 2015 (r287467) @@ -851,11 +851,17 @@ static s32 e1000_reset_hw_80003es2lan(st e1000_release_phy_80003es2lan(hw); /* Disable IBIST slave mode (far-end loopback) */ - e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - &kum_reg_data); - kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; - e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - kum_reg_data); + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data); + if (!ret_val) { + kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_INBAND_PARAM, + kum_reg_data); + if (ret_val) + DEBUGOUT("Error disabling far-end loopback\n"); + } else + DEBUGOUT("Error disabling far-end loopback\n"); ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) @@ -911,11 +917,18 @@ static s32 e1000_init_hw_80003es2lan(str return ret_val; /* Disable IBIST slave mode (far-end loopback) */ - e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - &kum_reg_data); - kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; - e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - kum_reg_data); + ret_val = + e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + &kum_reg_data); + if (!ret_val) { + kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_INBAND_PARAM, + kum_reg_data); + if (ret_val) + DEBUGOUT("Error disabling far-end loopback\n"); + } else + DEBUGOUT("Error disabling far-end loopback\n"); /* Set the transmit descriptor write-back policy */ reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0)); Modified: head/sys/dev/e1000/e1000_82540.c ============================================================================== --- head/sys/dev/e1000/e1000_82540.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82540.c Fri Sep 4 16:30:48 2015 (r287467) @@ -66,7 +66,7 @@ static s32 e1000_read_mac_addr_82540(st static s32 e1000_init_phy_params_82540(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; phy->addr = 1; phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; @@ -329,7 +329,7 @@ static s32 e1000_init_hw_82540(struct e1 { struct e1000_mac_info *mac = &hw->mac; u32 txdctl, ctrl_ext; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 i; DEBUGFUNC("e1000_init_hw_82540"); @@ -411,7 +411,7 @@ static s32 e1000_init_hw_82540(struct e1 static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw) { u32 ctrl; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 data; DEBUGFUNC("e1000_setup_copper_link_82540"); @@ -498,7 +498,7 @@ out: **/ static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 nvm_data; DEBUGFUNC("e1000_adjust_serdes_amplitude_82540"); @@ -528,7 +528,7 @@ out: **/ static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 default_page = 0; u16 phy_data; Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82541.c Fri Sep 4 16:30:48 2015 (r287467) @@ -85,7 +85,7 @@ static const u16 e1000_igp_cable_length_ static s32 e1000_init_phy_params_82541(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_init_phy_params_82541"); @@ -295,7 +295,7 @@ void e1000_init_function_pointers_82541( **/ static s32 e1000_reset_hw_82541(struct e1000_hw *hw) { - u32 ledctl, ctrl, icr, manc; + u32 ledctl, ctrl, manc; DEBUGFUNC("e1000_reset_hw_82541"); @@ -317,6 +317,7 @@ static s32 e1000_reset_hw_82541(struct e /* Must reset the Phy before resetting the MAC */ if ((hw->mac.type == e1000_82541) || (hw->mac.type == e1000_82547)) { E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_PHY_RST)); + E1000_WRITE_FLUSH(hw); msec_delay(5); } @@ -359,7 +360,7 @@ static s32 e1000_reset_hw_82541(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); /* Clear any pending interrupt events. */ - icr = E1000_READ_REG(hw, E1000_ICR); + E1000_READ_REG(hw, E1000_ICR); return E1000_SUCCESS; } Modified: head/sys/dev/e1000/e1000_82542.c ============================================================================== --- head/sys/dev/e1000/e1000_82542.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82542.c Fri Sep 4 16:30:48 2015 (r287467) @@ -317,7 +317,7 @@ static s32 e1000_init_hw_82542(struct e1 static s32 e1000_setup_link_82542(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_setup_link_82542"); @@ -565,7 +565,7 @@ static void e1000_clear_hw_cntrs_82542(s * * Reads the device MAC address from the EEPROM and stores the value. **/ -static s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) +s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) { s32 ret_val = E1000_SUCCESS; u16 offset, nvm_data, i; Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82543.c Fri Sep 4 16:30:48 2015 (r287467) @@ -900,7 +900,7 @@ static s32 e1000_phy_hw_reset_82543(stru **/ static s32 e1000_reset_hw_82543(struct e1000_hw *hw) { - u32 ctrl, icr; + u32 ctrl; s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_reset_hw_82543"); @@ -942,7 +942,7 @@ static s32 e1000_reset_hw_82543(struct e /* Masking off and clearing any pending interrupts */ E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); - icr = E1000_READ_REG(hw, E1000_ICR); + E1000_READ_REG(hw, E1000_ICR); return ret_val; } Modified: head/sys/dev/e1000/e1000_82571.h ============================================================================== --- head/sys/dev/e1000/e1000_82571.h Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82571.h Fri Sep 4 16:30:48 2015 (r287467) @@ -50,9 +50,10 @@ #define E1000_EIAC_82574 0x000DC /* Ext. Interrupt Auto Clear - RW */ #define E1000_EIAC_MASK_82574 0x01F00000 -#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ +#define E1000_IVAR_INT_ALLOC_VALID 0x8 -#define E1000_RXCFGL 0x0B634 /* TimeSync Rx EtherType & Msg Type Reg - RW */ +/* Manageability Operation Mode mask */ +#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 #define E1000_BASE1000T_STATUS 10 #define E1000_IDLE_ERROR_COUNT_MASK 0xFF Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82575.c Fri Sep 4 16:30:48 2015 (r287467) @@ -1235,7 +1235,7 @@ static s32 e1000_check_for_link_media_sw DEBUGFUNC("e1000_check_for_link_media_swap"); - /* Check the copper medium. */ + /* Check for copper. */ ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); if (ret_val) return ret_val; @@ -1247,7 +1247,7 @@ static s32 e1000_check_for_link_media_sw if (data & E1000_M88E1112_STATUS_LINK) port = E1000_MEDIA_PORT_COPPER; - /* Check the other medium. */ + /* Check for other. */ ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 1); if (ret_val) return ret_val; @@ -1256,11 +1256,6 @@ static s32 e1000_check_for_link_media_sw if (ret_val) return ret_val; - /* reset page to 0 */ - ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); - if (ret_val) - return ret_val; - if (data & E1000_M88E1112_STATUS_LINK) port = E1000_MEDIA_PORT_OTHER; @@ -1268,8 +1263,20 @@ static s32 e1000_check_for_link_media_sw if (port && (hw->dev_spec._82575.media_port != port)) { hw->dev_spec._82575.media_port = port; hw->dev_spec._82575.media_changed = TRUE; + } + + if (port == E1000_MEDIA_PORT_COPPER) { + /* reset page to 0 */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); + if (ret_val) + return ret_val; + e1000_check_for_link_82575(hw); } else { - ret_val = e1000_check_for_link_82575(hw); + e1000_check_for_link_82575(hw); + /* reset page to 0 */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); + if (ret_val) + return ret_val; } return E1000_SUCCESS; @@ -2136,7 +2143,13 @@ void e1000_rx_fifo_flush_82575(struct e1 u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; int i, ms_wait; - DEBUGFUNC("e1000_rx_fifo_workaround_82575"); + DEBUGFUNC("e1000_rx_fifo_flush_82575"); + + /* disable IPv6 options as per hardware errata */ + rfctl = E1000_READ_REG(hw, E1000_RFCTL); + rfctl |= E1000_RFCTL_IPV6_EX_DIS; + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); + if (hw->mac.type != e1000_82575 || !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) return; @@ -2164,7 +2177,6 @@ void e1000_rx_fifo_flush_82575(struct e1 * incoming packets are rejected. Set enable and wait 2ms so that * any packet that was coming in as RCTL.EN was set is flushed */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); E1000_WRITE_REG(hw, E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); rlpml = E1000_READ_REG(hw, E1000_RLPML); @@ -2894,11 +2906,13 @@ out: /** * e1000_set_eee_i350 - Enable/disable EEE support * @hw: pointer to the HW structure + * @adv1g: boolean flag enabling 1G EEE advertisement + * @adv100m: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE based on setting in dev_spec structure. * **/ -s32 e1000_set_eee_i350(struct e1000_hw *hw) +s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M) { u32 ipcnfg, eeer; @@ -2914,7 +2928,16 @@ s32 e1000_set_eee_i350(struct e1000_hw * if (!(hw->dev_spec._82575.eee_disable)) { u32 eee_su = E1000_READ_REG(hw, E1000_EEE_SU); - ipcnfg |= (E1000_IPCNFG_EEE_1G_AN | E1000_IPCNFG_EEE_100M_AN); + if (adv100M) + ipcnfg |= E1000_IPCNFG_EEE_100M_AN; + else + ipcnfg &= ~E1000_IPCNFG_EEE_100M_AN; + + if (adv1G) + ipcnfg |= E1000_IPCNFG_EEE_1G_AN; + else + ipcnfg &= ~E1000_IPCNFG_EEE_1G_AN; + eeer |= (E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN | E1000_EEER_LPI_FC); @@ -2938,11 +2961,13 @@ out: /** * e1000_set_eee_i354 - Enable/disable EEE support * @hw: pointer to the HW structure + * @adv1g: boolean flag enabling 1G EEE advertisement + * @adv100m: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE legacy mode based on setting in dev_spec structure. * **/ -s32 e1000_set_eee_i354(struct e1000_hw *hw) +s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M) { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; @@ -2984,8 +3009,16 @@ s32 e1000_set_eee_i354(struct e1000_hw * if (ret_val) goto out; - phy_data |= E1000_EEE_ADV_100_SUPPORTED | - E1000_EEE_ADV_1000_SUPPORTED; + if (adv100M) + phy_data |= E1000_EEE_ADV_100_SUPPORTED; + else + phy_data &= ~E1000_EEE_ADV_100_SUPPORTED; + + if (adv1G) + phy_data |= E1000_EEE_ADV_1000_SUPPORTED; + else + phy_data &= ~E1000_EEE_ADV_1000_SUPPORTED; + ret_val = e1000_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, E1000_EEE_ADV_DEV_I354, phy_data); Modified: head/sys/dev/e1000/e1000_82575.h ============================================================================== --- head/sys/dev/e1000/e1000_82575.h Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_82575.h Fri Sep 4 16:30:48 2015 (r287467) @@ -495,8 +495,8 @@ void e1000_rlpml_set_vf(struct e1000_hw s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type); u16 e1000_rxpbs_adjust_82580(u32 data); s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data); -s32 e1000_set_eee_i350(struct e1000_hw *); -s32 e1000_set_eee_i354(struct e1000_hw *); +s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M); +s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M); s32 e1000_get_eee_status_i354(struct e1000_hw *, bool *); s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw); Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_api.c Fri Sep 4 16:30:48 2015 (r287467) @@ -299,6 +299,12 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_I218_V3: mac->type = e1000_pch_lpt; break; + case E1000_DEV_ID_PCH_SPT_I219_LM: + case E1000_DEV_ID_PCH_SPT_I219_V: + case E1000_DEV_ID_PCH_SPT_I219_LM2: + case E1000_DEV_ID_PCH_SPT_I219_V2: + mac->type = e1000_pch_spt; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -449,6 +455,7 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_pchlan: case e1000_pch2lan: case e1000_pch_lpt: + case e1000_pch_spt: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: @@ -929,21 +936,6 @@ s32 e1000_mng_enable_host_if(struct e100 } /** - * e1000_set_obff_timer - Set Optimized Buffer Flush/Fill timer - * @hw: pointer to the HW structure - * @itr: u32 indicating itr value - * - * Set the OBFF timer based on the given interrupt rate. - **/ -s32 e1000_set_obff_timer(struct e1000_hw *hw, u32 itr) -{ - if (hw->mac.ops.set_obff_timer) - return hw->mac.ops.set_obff_timer(hw, itr); - - return E1000_SUCCESS; -} - -/** * e1000_check_reset_block - Verifies PHY can be reset * @hw: pointer to the HW structure * @@ -1216,6 +1208,21 @@ s32 e1000_read_pba_length(struct e1000_h } /** + * e1000_read_pba_num - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) +{ + return e1000_read_pba_num_generic(hw, pba_num); +} + +/** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure * Modified: head/sys/dev/e1000/e1000_api.h ============================================================================== --- head/sys/dev/e1000/e1000_api.h Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_api.h Fri Sep 4 16:30:48 2015 (r287467) @@ -97,6 +97,7 @@ s32 e1000_phy_commit(struct e1000_hw *hw void e1000_power_up_phy(struct e1000_hw *hw); void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); void e1000_reload_nvm(struct e1000_hw *hw); Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_defines.h Fri Sep 4 16:30:48 2015 (r287467) @@ -197,6 +197,8 @@ #define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ #define E1000_RCTL_DTYP_PS 0x00000400 /* Packet Split descriptor */ #define E1000_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */ +#define E1000_RCTL_RDMTS_HEX 0x00010000 +#define E1000_RCTL_RDMTS1_HEX E1000_RCTL_RDMTS_HEX #define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */ #define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */ #define E1000_RCTL_BAM 0x00008000 /* broadcast enable */ @@ -565,9 +567,6 @@ #define E1000_ICR_THS 0x00800000 /* ICR.THS: Thermal Sensor Event*/ #define E1000_ICR_MDDET 0x10000000 /* Malicious Driver Detect */ -#define E1000_ITR_MASK 0x000FFFFF /* ITR value bitfield */ -#define E1000_ITR_MULT 256 /* ITR mulitplier in nsec */ - /* PBA ECC Register */ #define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */ #define E1000_PBA_ECC_COUNTER_SHIFT 20 /* ECC counter shift value */ @@ -753,6 +752,12 @@ #define E1000_TSYNCTXCTL_VALID 0x00000001 /* Tx timestamp valid */ #define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable Tx timestamping */ +/* HH Time Sync */ +#define E1000_TSYNCTXCTL_MAX_ALLOWED_DLY_MASK 0x0000F000 /* max delay */ +#define E1000_TSYNCTXCTL_SYNC_COMP_ERR 0x20000000 /* sync err */ +#define E1000_TSYNCTXCTL_SYNC_COMP 0x40000000 /* sync complete */ +#define E1000_TSYNCTXCTL_START_SYNC 0x80000000 /* initiate sync */ + #define E1000_TSYNCRXCTL_VALID 0x00000001 /* Rx timestamp valid */ #define E1000_TSYNCRXCTL_TYPE_MASK 0x0000000E /* Rx type mask */ #define E1000_TSYNCRXCTL_TYPE_L2_V2 0x00 @@ -1020,9 +1025,7 @@ /* NVM Addressing bits based on type 0=small, 1=large */ #define E1000_EECD_ADDR_BITS 0x00000400 #define E1000_EECD_TYPE 0x00002000 /* NVM Type (1-SPI, 0-Microwire) */ -#ifndef E1000_NVM_GRANT_ATTEMPTS #define E1000_NVM_GRANT_ATTEMPTS 1000 /* NVM # attempts to gain grant */ -#endif #define E1000_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */ #define E1000_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */ #define E1000_EECD_SIZE_EX_SHIFT 11 @@ -1059,11 +1062,44 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 +#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_ETRACK_HIWORD 0x0043 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +/* NVM version defines */ +#define NVM_MAJOR_MASK 0xF000 +#define NVM_MINOR_MASK 0x0FF0 +#define NVM_IMAGE_ID_MASK 0x000F +#define NVM_COMB_VER_MASK 0x00FF +#define NVM_MAJOR_SHIFT 12 +#define NVM_MINOR_SHIFT 4 +#define NVM_COMB_VER_SHFT 8 +#define NVM_VER_INVALID 0xFFFF +#define NVM_ETRACK_SHIFT 16 +#define NVM_ETRACK_VALID 0x8000 +#define NVM_NEW_DEC_MASK 0x0F00 +#define NVM_HEX_CONV 16 +#define NVM_HEX_TENS 10 + +/* FW version defines */ +/* Offset of "Loader patch ptr" in Firmware Header */ +#define E1000_I350_NVM_FW_LOADER_PATCH_PTR_OFFSET 0x01 +/* Patch generation hour & minutes */ +#define E1000_I350_NVM_FW_VER_WORD1_OFFSET 0x04 +/* Patch generation month & day */ +#define E1000_I350_NVM_FW_VER_WORD2_OFFSET 0x05 +/* Patch generation year */ +#define E1000_I350_NVM_FW_VER_WORD3_OFFSET 0x06 +/* Patch major & minor numbers */ +#define E1000_I350_NVM_FW_VER_WORD4_OFFSET 0x07 + #define NVM_MAC_ADDR 0x0000 #define NVM_SUB_DEV_ID 0x000B #define NVM_SUB_VEN_ID 0x000C @@ -1440,8 +1476,6 @@ #define I210_RXPBSIZE_DEFAULT 0x000000A2 /* RXPBSIZE default */ #define I210_TXPBSIZE_DEFAULT 0x04000014 /* TXPBSIZE default */ -#define E1000_DOBFFCTL_OBFFTHR_MASK 0x000000FF /* OBFF threshold */ -#define E1000_DOBFFCTL_EXIT_ACT_MASK 0x01000000 /* Exit active CB */ /* Proxy Filter Control */ #define E1000_PROXYFC_D0 0x00000001 /* Enable offload in D0 */ Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_hw.h Fri Sep 4 16:30:48 2015 (r287467) @@ -137,6 +137,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_I218_V2 0x15A1 #define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */ #define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM 0x156F /* Sunrise Point PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_V 0x1570 /* Sunrise Point PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -222,6 +226,7 @@ enum e1000_mac_type { e1000_pchlan, e1000_pch2lan, e1000_pch_lpt, + e1000_pch_spt, e1000_82575, e1000_82576, e1000_82580, @@ -703,7 +708,6 @@ struct e1000_mac_operations { int (*rar_set)(struct e1000_hw *, u8*, u32); s32 (*read_mac_addr)(struct e1000_hw *); s32 (*validate_mdi_setting)(struct e1000_hw *); - s32 (*set_obff_timer)(struct e1000_hw *, u32); s32 (*acquire_swfw_sync)(struct e1000_hw *, u16); void (*release_swfw_sync)(struct e1000_hw *, u16); }; @@ -805,7 +809,7 @@ struct e1000_mac_info { enum e1000_serdes_link_state serdes_link_state; bool serdes_has_link; bool tx_pkt_filtering; - u32 max_frame_size; + u32 max_frame_size; }; struct e1000_phy_info { Modified: head/sys/dev/e1000/e1000_i210.c ============================================================================== --- head/sys/dev/e1000/e1000_i210.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_i210.c Fri Sep 4 16:30:48 2015 (r287467) @@ -489,6 +489,105 @@ static s32 e1000_read_invm_i210(struct e } /** + * e1000_read_invm_version - Reads iNVM version and image type + * @hw: pointer to the HW structure + * @invm_ver: version structure for the version read + * + * Reads iNVM version and image type. + **/ +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver) +{ + u32 *record = NULL; + u32 *next_record = NULL; + u32 i = 0; + u32 invm_dword = 0; + u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / + E1000_INVM_RECORD_SIZE_IN_BYTES); + u32 buffer[E1000_INVM_SIZE]; + s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; + u16 version = 0; + + DEBUGFUNC("e1000_read_invm_version"); + + /* Read iNVM memory */ + for (i = 0; i < E1000_INVM_SIZE; i++) { + invm_dword = E1000_READ_REG(hw, E1000_INVM_DATA_REG(i)); + buffer[i] = invm_dword; + } + + /* Read version number */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have first version location used */ + if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) { + version = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have second version location used */ + else if ((i == 1) && + ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have odd version location + * used and it is the last one used + */ + else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) && + ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) && + (i != 1))) { + version = (*next_record & E1000_INVM_VER_FIELD_TWO) + >> 13; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have even version location + * used and it is the last one used + */ + else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && + ((*record & 0x3) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + } + + if (status == E1000_SUCCESS) { + invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK) + >> E1000_INVM_MAJOR_SHIFT; + invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK; + } + /* Read Image Type */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have image type in first location used */ + if ((i == 1) && ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) { + invm_ver->invm_img_type = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have image type in first location used */ + else if ((((*record & 0x3) == 0) && + ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) || + ((((*record & 0x3) != 0) && (i != 1)))) { + invm_ver->invm_img_type = + (*next_record & E1000_INVM_IMGTYPE_FIELD) >> 23; + status = E1000_SUCCESS; + break; + } + } + return status; +} + +/** * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum * @hw: pointer to the HW structure * Modified: head/sys/dev/e1000/e1000_i210.h ============================================================================== --- head/sys/dev/e1000/e1000_i210.h Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_i210.h Fri Sep 4 16:30:48 2015 (r287467) @@ -43,6 +43,8 @@ s32 e1000_write_nvm_srwr_i210(struct e10 u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver); s32 e1000_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask); void e1000_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask); s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Fri Sep 4 16:13:25 2015 (r287466) +++ head/sys/dev/e1000/e1000_ich8lan.c Fri Sep 4 16:30:48 2015 (r287467) @@ -92,10 +92,13 @@ static s32 e1000_set_d3_lplu_state_ich8 bool active); static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); +static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, + u16 *data); static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw); static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw); +static s32 e1000_update_nvm_checksum_spt(struct e1000_hw *hw); static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data); static s32 e1000_id_led_init_pchlan(struct e1000_hw *hw); @@ -123,6 +126,14 @@ static s32 e1000_read_flash_byte_ich8la u32 offset, u8 *data); static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, u8 size, u16 *data); +static s32 e1000_read_flash_data32_ich8lan(struct e1000_hw *hw, u32 offset, + u32 *data); +static s32 e1000_read_flash_dword_ich8lan(struct e1000_hw *hw, + u32 offset, u32 *data); +static s32 e1000_write_flash_data32_ich8lan(struct e1000_hw *hw, + u32 offset, u32 data); +static s32 e1000_retry_write_flash_dword_ich8lan(struct e1000_hw *hw, + u32 offset, u32 dword); static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, u16 *data); static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw, @@ -133,7 +144,6 @@ static s32 e1000_check_for_copper_link_i static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); -static s32 e1000_set_obff_timer_pch_lpt(struct e1000_hw *hw, u32 itr); /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ /* Offset 04h HSFSTS */ @@ -232,16 +242,21 @@ static bool e1000_phy_is_accessible_pchl if (ret_val) return FALSE; out: - if (hw->mac.type == e1000_pch_lpt) { - /* Unforce SMBus mode in PHY */ - hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg); - phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; - hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg); + if ((hw->mac.type == e1000_pch_lpt) || + (hw->mac.type == e1000_pch_spt)) { + /* Only unforce SMBus if ME is not active */ + if (!(E1000_READ_REG(hw, E1000_FWSM) & + E1000_ICH_FWSM_FW_VALID)) { + /* Unforce SMBus mode in PHY */ + hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg); + phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; + hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg); - /* Unforce SMBus mode in MAC */ - mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT); - mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; - E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg); + /* Unforce SMBus mode in MAC */ + mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT); + mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; + E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg); + } } return TRUE; @@ -328,6 +343,7 @@ static s32 e1000_init_phy_workarounds_pc */ switch (hw->mac.type) { case e1000_pch_lpt: + case e1000_pch_spt: if (e1000_phy_is_accessible_pchlan(hw)) break; @@ -475,6 +491,7 @@ static s32 e1000_init_phy_params_pchlan( /* fall-through */ case e1000_pch2lan: case e1000_pch_lpt: + case e1000_pch_spt: /* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */ @@ -617,36 +634,53 @@ static s32 e1000_init_nvm_params_ich8lan struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; u32 gfpreg, sector_base_addr, sector_end_addr; u16 i; + u32 nvm_size; DEBUGFUNC("e1000_init_nvm_params_ich8lan"); /* Can't read flash registers if the register set isn't mapped. */ nvm->type = e1000_nvm_flash_sw; - if (!hw->flash_address) { - DEBUGOUT("ERROR: Flash registers not mapped\n"); - return -E1000_ERR_CONFIG; - } + /* in SPT, gfpreg doesn't exist. NVM size is taken from the + * STRAP register + */ + if (hw->mac.type == e1000_pch_spt) { + nvm->flash_base_addr = 0; + nvm_size = + (((E1000_READ_REG(hw, E1000_STRAP) >> 1) & 0x1F) + 1) + * NVM_SIZE_MULTIPLIER; + nvm->flash_bank_size = nvm_size / 2; + /* Adjust to word count */ + nvm->flash_bank_size /= sizeof(u16); + /* Set the base address for flash register access */ + hw->flash_address = hw->hw_addr + E1000_FLASH_BASE_ADDR; + } else { + if (!hw->flash_address) { + DEBUGOUT("ERROR: Flash registers not mapped\n"); + return -E1000_ERR_CONFIG; + } + + gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG); + + /* sector_X_addr is a "sector"-aligned address (4096 bytes) + * Add 1 to sector_end_addr since this sector is included in + * the overall size. + */ + sector_base_addr = gfpreg & FLASH_GFPREG_BASE_MASK; + sector_end_addr = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK) + 1; - gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG); + /* flash_base_addr is byte-aligned */ + nvm->flash_base_addr = sector_base_addr + << FLASH_SECTOR_ADDR_SHIFT; - /* sector_X_addr is a "sector"-aligned address (4096 bytes) - * Add 1 to sector_end_addr since this sector is included in - * the overall size. - */ - sector_base_addr = gfpreg & FLASH_GFPREG_BASE_MASK; - sector_end_addr = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK) + 1; - - /* flash_base_addr is byte-aligned */ - nvm->flash_base_addr = sector_base_addr << FLASH_SECTOR_ADDR_SHIFT; - - /* find total size of the NVM, then cut in half since the total - * size represents two separate NVM banks. - */ - nvm->flash_bank_size = ((sector_end_addr - sector_base_addr) - << FLASH_SECTOR_ADDR_SHIFT); - nvm->flash_bank_size /= 2; - /* Adjust to word count */ - nvm->flash_bank_size /= sizeof(u16); + /* find total size of the NVM, then cut in half since the total + * size represents two separate NVM banks. + */ + nvm->flash_bank_size = ((sector_end_addr - sector_base_addr) + << FLASH_SECTOR_ADDR_SHIFT); + nvm->flash_bank_size /= 2; + /* Adjust to word count */ + nvm->flash_bank_size /= sizeof(u16); + } nvm->word_size = E1000_SHADOW_RAM_WORDS; @@ -662,8 +696,13 @@ static s32 e1000_init_nvm_params_ich8lan /* Function Pointers */ nvm->ops.acquire = e1000_acquire_nvm_ich8lan; nvm->ops.release = e1000_release_nvm_ich8lan; - nvm->ops.read = e1000_read_nvm_ich8lan; - nvm->ops.update = e1000_update_nvm_checksum_ich8lan; + if (hw->mac.type == e1000_pch_spt) { + nvm->ops.read = e1000_read_nvm_spt; + nvm->ops.update = e1000_update_nvm_checksum_spt; + } else { + nvm->ops.read = e1000_read_nvm_ich8lan; + nvm->ops.update = e1000_update_nvm_checksum_ich8lan; + } nvm->ops.valid_led_default = e1000_valid_led_default_ich8lan; nvm->ops.validate = e1000_validate_nvm_checksum_ich8lan; nvm->ops.write = e1000_write_nvm_ich8lan; @@ -681,9 +720,7 @@ static s32 e1000_init_nvm_params_ich8lan static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; -#if defined(QV_RELEASE) || !defined(NO_PCH_LPT_B0_SUPPORT) u16 pci_cfg; -#endif /* QV_RELEASE || !defined(NO_PCH_LPT_B0_SUPPORT) */ DEBUGFUNC("e1000_init_mac_params_ich8lan"); @@ -752,15 +789,21 @@ static s32 e1000_init_mac_params_ich8lan mac->ops.rar_set = e1000_rar_set_pch2lan; /* fall-through */ case e1000_pch_lpt: + case e1000_pch_spt: /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; + /* fall-through */ case e1000_pchlan: -#if defined(QV_RELEASE) || !defined(NO_PCH_LPT_B0_SUPPORT) /* save PCH revision_id */ e1000_read_pci_cfg(hw, E1000_PCI_REVISION_ID_REG, &pci_cfg); - hw->revision_id = (u8)(pci_cfg &= 0x000F); -#endif /* QV_RELEASE || !defined(NO_PCH_LPT_B0_SUPPORT) */ + /* SPT uses full byte for revision ID, + * as opposed to previous generations + */ + if (hw->mac.type >= e1000_pch_spt) + hw->revision_id = (u8)(pci_cfg &= 0x00FF); + else + hw->revision_id = (u8)(pci_cfg &= 0x000F); /* check management mode */ mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; /* ID LED init */ @@ -777,11 +820,11 @@ static s32 e1000_init_mac_params_ich8lan break; } - if (mac->type == e1000_pch_lpt) { + if ((mac->type == e1000_pch_lpt) || + (mac->type == e1000_pch_spt)) { mac->rar_entry_count = E1000_PCH_LPT_RAR_ENTRIES; mac->ops.rar_set = e1000_rar_set_pch_lpt; mac->ops.setup_physical_interface = e1000_setup_copper_link_pch_lpt; - mac->ops.set_obff_timer = e1000_set_obff_timer_pch_lpt; } /* Enable PCS Lock-loss workaround for ICH8 */ @@ -1007,8 +1050,9 @@ release: /* clear FEXTNVM6 bit 8 on link down or 10/100 */ fextnvm6 &= ~E1000_FEXTNVM6_REQ_PLL_CLK; - if (!link || ((status & E1000_STATUS_SPEED_100) && - (status & E1000_STATUS_FD))) + if ((hw->phy.revision > 5) || !link || + ((status & E1000_STATUS_SPEED_100) && + (status & E1000_STATUS_FD))) goto update_fextnvm6; ret_val = hw->phy.ops.read_reg(hw, I217_INBAND_CTRL, ®); @@ -1044,168 +1088,6 @@ update_fextnvm6: return ret_val; } -static u64 e1000_ltr2ns(u16 ltr) -{ - u32 value, scale; - - /* Determine the latency in nsec based on the LTR value & scale */ - value = ltr & E1000_LTRV_VALUE_MASK; - scale = (ltr & E1000_LTRV_SCALE_MASK) >> E1000_LTRV_SCALE_SHIFT; - - return value * (1 << (scale * E1000_LTRV_SCALE_FACTOR)); -} - -/** - * e1000_platform_pm_pch_lpt - Set platform power management values - * @hw: pointer to the HW structure - * @link: bool indicating link status - * - * Set the Latency Tolerance Reporting (LTR) values for the "PCIe-like" - * GbE MAC in the Lynx Point PCH based on Rx buffer size and link speed - * when link is up (which must not exceed the maximum latency supported - * by the platform), otherwise specify there is no LTR requirement. - * Unlike TRUE-PCIe devices which set the LTR maximum snoop/no-snoop - * latencies in the LTR Extended Capability Structure in the PCIe Extended - * Capability register set, on this device LTR is set by writing the - * equivalent snoop/no-snoop latencies in the LTRV register in the MAC and - * set the SEND bit to send an Intel On-chip System Fabric sideband (IOSF-SB) - * message to the PMC. - * - * Use the LTR value to calculate the Optimized Buffer Flush/Fill (OBFF) - * high-water mark. - **/ -static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) -{ - u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) | - link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND; - u16 lat_enc = 0; /* latency encoded */ - s32 obff_hwm = 0; - - DEBUGFUNC("e1000_platform_pm_pch_lpt"); - - if (link) { - u16 speed, duplex, scale = 0; - u16 max_snoop, max_nosnoop; - u16 max_ltr_enc; /* max LTR latency encoded */ - s64 lat_ns; - s64 value; - u32 rxa; - - if (!hw->mac.max_frame_size) { - DEBUGOUT("max_frame_size not set.\n"); - return -E1000_ERR_CONFIG; - } - - hw->mac.ops.get_link_up_info(hw, &speed, &duplex); - if (!speed) { - DEBUGOUT("Speed not set.\n"); - return -E1000_ERR_CONFIG; - } - - /* Rx Packet Buffer Allocation size (KB) */ - rxa = E1000_READ_REG(hw, E1000_PBA) & E1000_PBA_RXA_MASK; - - /* Determine the maximum latency tolerated by the device. - * - * Per the PCIe spec, the tolerated latencies are encoded as - * a 3-bit encoded scale (only 0-5 are valid) multiplied by - * a 10-bit value (0-1023) to provide a range from 1 ns to - * 2^25*(2^10-1) ns. The scale is encoded as 0=2^0ns, - * 1=2^5ns, 2=2^10ns,...5=2^25ns. - */ - lat_ns = ((s64)rxa * 1024 - - (2 * (s64)hw->mac.max_frame_size)) * 8 * 1000; - if (lat_ns < 0) - lat_ns = 0; - else - lat_ns /= speed; - value = lat_ns; - - while (value > E1000_LTRV_VALUE_MASK) { - scale++; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 4 16:59:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1373E9CA3E1; Fri, 4 Sep 2015 16:59:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0144F1333; Fri, 4 Sep 2015 16:59:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84Gx2MV051195; Fri, 4 Sep 2015 16:59:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84Gx2ob051194; Fri, 4 Sep 2015 16:59:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201509041659.t84Gx2ob051194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Sep 2015 16:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287468 - head/usr.sbin/ntp 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, 04 Sep 2015 16:59:03 -0000 Author: cy Date: Fri Sep 4 16:59:01 2015 New Revision: 287468 URL: https://svnweb.freebsd.org/changeset/base/287468 Log: Turn on RAWDCF by default. Suggested by: ian Approved by: roberto MFC after: 1 week Modified: head/usr.sbin/ntp/config.h Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Fri Sep 4 16:30:48 2015 (r287467) +++ head/usr.sbin/ntp/config.h Fri Sep 4 16:59:01 2015 (r287468) @@ -120,7 +120,7 @@ #define CLOCK_PST 1 /* DCF77 raw time code */ -/* #undef CLOCK_RAWDCF */ +#define CLOCK_RAWDCF 1 /* RCC 8000 clock */ /* #undef CLOCK_RCC8000 */ From owner-svn-src-all@freebsd.org Fri Sep 4 17:21:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20779CB057; Fri, 4 Sep 2015 17:21:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 A22C7D26; Fri, 4 Sep 2015 17:21:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84HLuLj063557; Fri, 4 Sep 2015 17:21:56 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84HLu6W063410; Fri, 4 Sep 2015 17:21:56 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041721.t84HLu6W063410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 17:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287469 - head/sys/dev/e1000 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, 04 Sep 2015 17:21:56 -0000 Author: sbruno Date: Fri Sep 4 17:21:55 2015 New Revision: 287469 URL: https://svnweb.freebsd.org/changeset/base/287469 Log: em(4): Add Skylake/I219 support. - driver rev 7.5.2 - use new functions em_flush* for i219 devices Differential Revision: https://reviews.freebsd.org/D3163 Submitted by: erj jfv Reviewed by: jfv MFC after: 1 month Relnotes: Yes Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Sep 4 16:59:01 2015 (r287468) +++ head/sys/dev/e1000/if_em.c Fri Sep 4 17:21:55 2015 (r287469) @@ -103,7 +103,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.4.2"; +char em_driver_version[] = "7.5.2"; /********************************************************************* * PCI Device ID Table @@ -191,6 +191,11 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_I218_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_I218_LM3, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_I218_V3, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; @@ -238,6 +243,7 @@ static void em_free_pci_resources(struct static void em_local_timer(void *); static void em_reset(struct adapter *); static int em_setup_interface(device_t, struct adapter *); +static void em_flush_desc_rings(struct adapter *); static void em_setup_transmit_structures(struct adapter *); static void em_initialize_transmit_unit(struct adapter *); @@ -584,6 +590,20 @@ em_attach(device_t dev) } /* + ** In the new SPT device flash is not a + ** separate BAR, rather it is also in BAR0, + ** so use the same tag and handle for the + ** FLASH read/write macros in the shared + ** code. + */ + if (hw->mac.type == e1000_pch_spt) { + adapter->osdep.flash_bus_space_tag = + adapter->osdep.mem_bus_space_tag; + adapter->osdep.flash_bus_space_handle = + adapter->osdep.mem_bus_space_handle; + } + + /* * Setup MSI/X or MSI if PCI Express */ adapter->msix = em_setup_msix(adapter); @@ -1168,6 +1188,7 @@ em_ioctl(if_t ifp, u_long command, caddr case e1000_ich10lan: case e1000_pch2lan: case e1000_pch_lpt: + case e1000_pch_spt: case e1000_82574: case e1000_82583: case e1000_80003es2lan: /* 9K Jumbo Frame size */ @@ -1369,8 +1390,15 @@ em_init_locked(struct adapter *adapter) if_clearhwassist(ifp); if (if_getcapenable(ifp) & IFCAP_TXCSUM) if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); - if (if_getcapenable(ifp) & IFCAP_TSO4) - if_sethwassistbits(ifp, CSUM_TSO, 0); + /* + ** There have proven to be problems with TSO when not + ** at full gigabit speed, so disable the assist automatically + ** when at lower speeds. -jfv + */ + if (if_getcapenable(ifp) & IFCAP_TSO4) { + if (adapter->link_speed == SPEED_1000) + if_sethwassistbits(ifp, CSUM_TSO, 0); + } /* Configure for OS presence */ em_init_manageability(adapter); @@ -2350,6 +2378,8 @@ em_update_link_status(struct adapter *ad switch (hw->phy.media_type) { case e1000_media_type_copper: if (hw->mac.get_link_status) { + if (hw->mac.type == e1000_pch_spt) + msec_delay(50); /* Do the work to read phy */ e1000_check_for_link(hw); link_check = !hw->mac.get_link_status; @@ -2441,6 +2471,10 @@ em_stop(void *arg) EM_TX_UNLOCK(txr); } + /* I219 needs some special flushing to avoid hangs */ + if (adapter->hw.mac.type == e1000_pch_spt) + em_flush_desc_rings(adapter); + e1000_reset_hw(&adapter->hw); E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0); @@ -2860,6 +2894,116 @@ msi: } +/* +** The 3 following flush routines are used as a workaround in the +** I219 client parts and only for them. +** +** em_flush_tx_ring - remove all descriptors from the tx_ring +** +** We want to clear all pending descriptors from the TX ring. +** zeroing happens when the HW reads the regs. We assign the ring itself as +** the data of the next descriptor. We don't care about the data we are about +** to reset the HW. +*/ +static void +em_flush_tx_ring(struct adapter *adapter) +{ + struct e1000_hw *hw = &adapter->hw; + struct tx_ring *txr = adapter->tx_rings; + struct e1000_tx_desc *txd; + u32 tctl, txd_lower = E1000_TXD_CMD_IFCS; + u16 size = 512; + + tctl = E1000_READ_REG(hw, E1000_TCTL); + E1000_WRITE_REG(hw, E1000_TCTL, tctl | E1000_TCTL_EN); + + txd = &txr->tx_base[txr->next_avail_desc++]; + if (txr->next_avail_desc == adapter->num_tx_desc) + txr->next_avail_desc = 0; + + /* Just use the ring as a dummy buffer addr */ + txd->buffer_addr = txr->txdma.dma_paddr; + txd->lower.data = htole32(txd_lower | size); + txd->upper.data = 0; + + /* flush descriptors to memory before notifying the HW */ + wmb(); + + E1000_WRITE_REG(hw, E1000_TDT(0), txr->next_avail_desc); + mb(); + usec_delay(250); +} + +/* +** em_flush_rx_ring - remove all descriptors from the rx_ring +** +** Mark all descriptors in the RX ring as consumed and disable the rx ring +*/ +static void +em_flush_rx_ring(struct adapter *adapter) +{ + struct e1000_hw *hw = &adapter->hw; + u32 rctl, rxdctl; + + rctl = E1000_READ_REG(hw, E1000_RCTL); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + + rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); + /* zero the lower 14 bits (prefetch and host thresholds) */ + rxdctl &= 0xffffc000; + /* + * update thresholds: prefetch threshold to 31, host threshold to 1 + * and make sure the granularity is "descriptors" and not "cache lines" + */ + rxdctl |= (0x1F | (1 << 8) | E1000_RXDCTL_THRESH_UNIT_DESC); + E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl); + + /* momentarily enable the RX ring for the changes to take effect */ + E1000_WRITE_REG(hw, E1000_RCTL, rctl | E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); +} + +/* +** em_flush_desc_rings - remove all descriptors from the descriptor rings +** +** In i219, the descriptor rings must be emptied before resetting the HW +** or before changing the device state to D3 during runtime (runtime PM). +** +** Failure to do this will cause the HW to enter a unit hang state which can +** only be released by PCI reset on the device +** +*/ +static void +em_flush_desc_rings(struct adapter *adapter) +{ + struct e1000_hw *hw = &adapter->hw; + device_t dev = adapter->dev; + u16 hang_state; + u32 fext_nvm11, tdlen; + + /* First, disable MULR fix in FEXTNVM11 */ + fext_nvm11 = E1000_READ_REG(hw, E1000_FEXTNVM11); + fext_nvm11 |= E1000_FEXTNVM11_DISABLE_MULR_FIX; + E1000_WRITE_REG(hw, E1000_FEXTNVM11, fext_nvm11); + + /* do nothing if we're not in faulty state, or if the queue is empty */ + tdlen = E1000_READ_REG(hw, E1000_TDLEN(0)); + hang_state = pci_read_config(dev, PCICFG_DESC_RING_STATUS, 2); + if (!(hang_state & FLUSH_DESC_REQUIRED) || !tdlen) + return; + em_flush_tx_ring(adapter); + + /* recheck, maybe the fault is caused by the rx ring */ + hang_state = pci_read_config(dev, PCICFG_DESC_RING_STATUS, 2); + if (hang_state & FLUSH_DESC_REQUIRED) + em_flush_rx_ring(adapter); +} + + /********************************************************************* * * Initialize the hardware to a configuration @@ -2921,6 +3065,7 @@ em_reset(struct adapter *adapter) case e1000_pchlan: case e1000_pch2lan: case e1000_pch_lpt: + case e1000_pch_spt: pba = E1000_PBA_26K; break; default: @@ -2979,6 +3124,7 @@ em_reset(struct adapter *adapter) break; case e1000_pch2lan: case e1000_pch_lpt: + case e1000_pch_spt: hw->fc.high_water = 0x5C20; hw->fc.low_water = 0x5048; hw->fc.pause_time = 0x0650; @@ -3003,6 +3149,10 @@ em_reset(struct adapter *adapter) break; } + /* I219 needs some special flushing to avoid hangs */ + if (hw->mac.type == e1000_pch_spt) + em_flush_desc_rings(adapter); + /* Issue a global reset */ e1000_reset_hw(hw); E1000_WRITE_REG(hw, E1000_WUC, 0); @@ -3599,6 +3749,15 @@ em_initialize_transmit_unit(struct adapt /* This write will effectively turn on the transmit unit. */ E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); + if (hw->mac.type == e1000_pch_spt) { + u32 reg; + reg = E1000_READ_REG(hw, E1000_IOSFPC); + reg |= E1000_RCTL_RDMTS_HEX; + E1000_WRITE_REG(hw, E1000_IOSFPC, reg); + reg = E1000_READ_REG(hw, E1000_TARC(0)); + reg |= E1000_TARC0_CB_MULTIQ_3_REQ; + E1000_WRITE_REG(hw, E1000_TARC(0), reg); + } } Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Fri Sep 4 16:59:01 2015 (r287468) +++ head/sys/dev/e1000/if_em.h Fri Sep 4 17:21:55 2015 (r287469) @@ -218,6 +218,9 @@ #define EM_TX_HUNG 0x80000000 #define EM_TX_MAXTRIES 10 +#define PCICFG_DESC_RING_STATUS 0xe4 +#define FLUSH_DESC_REQUIRED 0x100 + /* * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary. This will From owner-svn-src-all@freebsd.org Fri Sep 4 17:48:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF489CBAB4; Fri, 4 Sep 2015 17:48:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D01501E73; Fri, 4 Sep 2015 17:48:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84HmKMa073241; Fri, 4 Sep 2015 17:48:20 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84HmKmk073239; Fri, 4 Sep 2015 17:48:20 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041748.t84HmKmk073239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 17:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287470 - head/sys/dev/mii 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, 04 Sep 2015 17:48:21 -0000 Author: sbruno Date: Fri Sep 4 17:48:19 2015 New Revision: 287470 URL: https://svnweb.freebsd.org/changeset/base/287470 Log: Add more BCM gigabit PHYs Gleaned from a public header file. 5402 and 5404 look like they may be used on embedded devices. 5478 and 5488 are switch PHYs. 5754 change is just to note a product alias. Differential Revision: https://reviews.freebsd.org/D3338 Submitted by: kevin.bowling@kev009.com Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Fri Sep 4 17:21:55 2015 (r287469) +++ head/sys/dev/mii/brgphy.c Fri Sep 4 17:48:19 2015 (r287470) @@ -118,7 +118,10 @@ static void brgphy_jumbo_settings(struct static const struct mii_phydesc brgphys[] = { MII_PHY_DESC(BROADCOM, BCM5400), MII_PHY_DESC(BROADCOM, BCM5401), + MII_PHY_DESC(BROADCOM, BCM5402), MII_PHY_DESC(BROADCOM, BCM5411), + MII_PHY_DESC(BROADCOM, BCM5404), + MII_PHY_DESC(BROADCOM, BCM5424), MII_PHY_DESC(BROADCOM, BCM54K2), MII_PHY_DESC(BROADCOM, BCM5701), MII_PHY_DESC(BROADCOM, BCM5703), @@ -132,6 +135,8 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM, BCM5780), MII_PHY_DESC(BROADCOM, BCM5708C), MII_PHY_DESC(BROADCOM, BCM5466), + MII_PHY_DESC(BROADCOM2, BCM5478), + MII_PHY_DESC(BROADCOM2, BCM5488), MII_PHY_DESC(BROADCOM2, BCM5482), MII_PHY_DESC(BROADCOM2, BCM5708S), MII_PHY_DESC(BROADCOM2, BCM5709C), Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Fri Sep 4 17:21:55 2015 (r287469) +++ head/sys/dev/mii/miidevs Fri Sep 4 17:48:19 2015 (r287470) @@ -154,7 +154,10 @@ model xxBROADCOM BCM4401 0x0036 BCM4401 model xxBROADCOM BCM5365 0x0037 BCM5365 10/100 5-port PHY switch model BROADCOM BCM5400 0x0004 BCM5400 1000BASE-T media interface model BROADCOM BCM5401 0x0005 BCM5401 1000BASE-T media interface +model BROADCOM BCM5402 0x0006 BCM5402 1000BASE-T media interface model BROADCOM BCM5411 0x0007 BCM5411 1000BASE-T media interface +model BROADCOM BCM5404 0x0008 BCM5404 1000BASE-T media interface +model BROADCOM BCM5424 0x000a BCM5424/BCM5234 1000BASE-T media interface model BROADCOM BCM5464 0x000b BCM5464 1000BASE-T media interface model BROADCOM BCM5461 0x000c BCM5461 1000BASE-T media interface model BROADCOM BCM5462 0x000d BCM5462 1000BASE-T media interface @@ -173,10 +176,12 @@ model BROADCOM BCM5708C 0x0036 BCM5708C model BROADCOM BCM5466 0x003b BCM5466 1000BASE-T media interface model BROADCOM2 BCM5325 0x0003 BCM5325 10/100 5-port PHY switch model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX media interface +model BROADCOM2 BCM5478 0x0008 BCM5478 1000BASE-T media interface +model BROADCOM2 BCM5488 0x0009 BCM5488 1000BASE-T media interface model BROADCOM2 BCM5481 0x000a BCM5481 1000BASE-T media interface model BROADCOM2 BCM5482 0x000b BCM5482 1000BASE-T media interface model BROADCOM2 BCM5755 0x000c BCM5755 1000BASE-T media interface -model BROADCOM2 BCM5754 0x000e BCM5754/5787 1000BASE-T media interface +model BROADCOM2 BCM5754 0x000e BCM5754/BCM5787 1000BASE-T media interface model BROADCOM2 BCM5708S 0x0015 BCM5708S 1000/2500baseSX PHY model BROADCOM2 BCM5785 0x0016 BCM5785 1000BASE-T media interface model BROADCOM2 BCM5709CAX 0x002c BCM5709CAX 10/100/1000baseT PHY From owner-svn-src-all@freebsd.org Fri Sep 4 19:57:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB5A9CB17E; Fri, 4 Sep 2015 19:57:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 DCDB53D4; Fri, 4 Sep 2015 19:57:29 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84JvTcR026847; Fri, 4 Sep 2015 19:57:29 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84JvTGL026844; Fri, 4 Sep 2015 19:57:29 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509041957.t84JvTGL026844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 4 Sep 2015 19:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287471 - in head/sys/mips/rmi: . dev/nlge dev/xlr 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, 04 Sep 2015 19:57:30 -0000 Author: sbruno Date: Fri Sep 4 19:57:28 2015 New Revision: 287471 URL: https://svnweb.freebsd.org/changeset/base/287471 Log: Remove rge driver from Broadcom XLR nlge(4) is supposed to deprecate rge(4) for Broadcom XLR when it was introduced 5 years ago. rge doesn't build on -CURRENT due to MII changes. All the XLR kernel confs use nlge. Let's get rid of the old driver for FreeBSD 11. We can use 10-STABLE or SVN to go back and look at the old driver if needed. Differential Revision: https://reviews.freebsd.org/D3339 Submitted by: kevin.bowling@kev009.com Deleted: head/sys/mips/rmi/dev/xlr/rge.c head/sys/mips/rmi/dev/xlr/rge.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/files.xlr head/sys/mips/rmi/iodi.c Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 4 17:48:19 2015 (r287470) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 4 19:57:28 2015 (r287471) @@ -1154,7 +1154,7 @@ nlna_config_pde(struct nlna_softc *sc) cpumask = 0x1; #ifdef SMP /* - * rge may be called before SMP start in a BOOTP/NFSROOT + * nlna may be called before SMP start in a BOOTP/NFSROOT * setup. we will distribute packets to other cpus only when * the SMP is started. */ Modified: head/sys/mips/rmi/files.xlr ============================================================================== --- head/sys/mips/rmi/files.xlr Fri Sep 4 17:48:19 2015 (r287470) +++ head/sys/mips/rmi/files.xlr Fri Sep 4 19:57:28 2015 (r287471) @@ -11,8 +11,8 @@ mips/rmi/fmn.c standard mips/rmi/intr_machdep.c standard mips/rmi/mpwait.S optional smp mips/rmi/xlr_i2c.c optional iic -mips/rmi/uart_bus_xlr_iodi.c optional uart -mips/rmi/uart_cpu_mips_xlr.c optional uart +mips/rmi/uart_bus_xlr_iodi.c optional uart +mips/rmi/uart_cpu_mips_xlr.c optional uart mips/rmi/xlr_pci.c optional pci mips/rmi/xlr_pcmcia.c optional ata mips/rmi/xls_ehci.c optional usb ehci @@ -20,7 +20,6 @@ mips/rmi/bus_space_rmi.c standard mips/rmi/bus_space_rmi_pci.c standard mips/rmi/dev/sec/rmisec.c optional rmisec mips/rmi/dev/sec/rmilib.c optional rmisec -mips/rmi/dev/xlr/rge.c optional rge mips/rmi/dev/nlge/if_nlge.c optional nlge -mips/rmi/dev/iic/max6657.c optional max6657 -mips/rmi/dev/iic/at24co2n.c optional at24co2n +mips/rmi/dev/iic/max6657.c optional max6657 +mips/rmi/dev/iic/at24co2n.c optional at24co2n Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Fri Sep 4 17:48:19 2015 (r287470) +++ head/sys/mips/rmi/iodi.c Fri Sep 4 19:57:28 2015 (r287471) @@ -104,12 +104,12 @@ iodi_setup_intr(device_t dev, device_t c cpu_establish_hardintr("uart", filt, intr, arg, PIC_UART_0_IRQ, flags, cookiep); pic_setup_intr(PIC_IRT_UART_0_INDEX, PIC_UART_0_IRQ, 0x1, 1); - } else if (strcmp(name, "rge") == 0 || strcmp(name, "nlge") == 0) { + } else if (strcmp(name, "nlge") == 0) { int irq; /* This is a hack to pass in the irq */ irq = (intptr_t)ires->__r_i; - cpu_establish_hardintr("rge", filt, intr, arg, irq, flags, + cpu_establish_hardintr("nlge", filt, intr, arg, irq, flags, cookiep); pic_setup_intr(irq - PIC_IRQ_BASE, irq, 0x1, 1); } else if (strcmp(name, "ehci") == 0) { @@ -224,58 +224,13 @@ iodi_attach(device_t dev) if (xlr_board_info.ata) device_add_child(dev, "ata", 0); - if (xlr_board_info.gmac_block[0].enabled) { - tmpd = device_add_child(dev, "rge", 0); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[0]); - - tmpd = device_add_child(dev, "rge", 1); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[0]); - - tmpd = device_add_child(dev, "rge", 2); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[0]); - - tmpd = device_add_child(dev, "rge", 3); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[0]); - } - if (xlr_board_info.gmac_block[1].enabled) { - if (xlr_board_info.gmac_block[1].type == XLR_GMAC) { - tmpd = device_add_child(dev, "rge", 4); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - - tmpd = device_add_child(dev, "rge", 5); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - - if (xlr_board_info.gmac_block[1].enabled & 0x4) { - tmpd = device_add_child(dev, "rge", 6); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - } - - if (xlr_board_info.gmac_block[1].enabled & 0x8) { - tmpd = device_add_child(dev, "rge", 7); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - } - } else if (xlr_board_info.gmac_block[1].type == XLR_XGMAC) { -#if 0 /* XGMAC not yet */ - tmpd = device_add_child(dev, "rge", 4); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - - tmpd = device_add_child(dev, "rge", 5); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); -#endif - } else - device_printf(dev, "Unknown type of gmac 1\n"); - } - - /* This is to add the new GMAC driver. The above adds the old driver, - which has been retained for now as the new driver is stabilized. - The new driver is enabled with "option nlge". Make sure that only - one of rge or nlge is enabled in the conf file. */ for (i = 0; i < 3; i++) { if (xlr_board_info.gmac_block[i].enabled == 0) continue; tmpd = device_add_child(dev, "nlna", i); device_set_ivars(tmpd, &xlr_board_info.gmac_block[i]); } + bus_generic_probe(dev); bus_generic_attach(dev); return 0; From owner-svn-src-all@freebsd.org Fri Sep 4 20:15:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 387769CB779; Fri, 4 Sep 2015 20:15:21 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.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 29ADFD83; Fri, 4 Sep 2015 20:15:21 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t84KFLB1034925; Fri, 4 Sep 2015 20:15:21 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t84KFLFG034924; Fri, 4 Sep 2015 20:15:21 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201509042015.t84KFLFG034924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Fri, 4 Sep 2015 20:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287472 - head/share/misc 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, 04 Sep 2015 20:15:21 -0000 Author: feld (ports committer) Date: Fri Sep 4 20:15:20 2015 New Revision: 287472 URL: https://svnweb.freebsd.org/changeset/base/287472 Log: Update ports-secteam roster Approved by: delphij Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Fri Sep 4 19:57:28 2015 (r287471) +++ head/share/misc/organization.dot Fri Sep 4 20:15:20 2015 (r287472) @@ -34,7 +34,7 @@ portmgr [label="Port Management Team\npo portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nculot"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\nmiwi, rea, swills, wxs,\njgh, sbz, eadler, zi, remko, simon"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jhg, rea, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-all@freebsd.org Sat Sep 5 00:06:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C4009CB909; Sat, 5 Sep 2015 00:06:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 7ACC6A60; Sat, 5 Sep 2015 00:06:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85063NG031957; Sat, 5 Sep 2015 00:06:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85062c3031950; Sat, 5 Sep 2015 00:06:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509050006.t85062c3031950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 5 Sep 2015 00:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287473 - in head/usr.sbin: . sesutil 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, 05 Sep 2015 00:06:03 -0000 Author: bapt Date: Sat Sep 5 00:06:01 2015 New Revision: 287473 URL: https://svnweb.freebsd.org/changeset/base/287473 Log: Add a new sesutil(8) utility This is an utility for managing SCSI Enclosure Services (SES) device. For now only one command is supported "locate" which will change the test of the external LED associated to a given disk. Usage if the following: sesutil locate disk [on|off] Disk can be a device name: "da12" or a special keyword: "all". Reviewed by: mav MFC after: 1 month Relnotes: yes Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D3544 Added: head/usr.sbin/sesutil/ head/usr.sbin/sesutil/Makefile (contents, props changed) head/usr.sbin/sesutil/sesutil.8 (contents, props changed) head/usr.sbin/sesutil/sesutil.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Sep 4 20:15:20 2015 (r287472) +++ head/usr.sbin/Makefile Sat Sep 5 00:06:01 2015 (r287473) @@ -74,6 +74,7 @@ SUBDIR= adduser \ rtprio \ service \ services_mkdb \ + sesutil \ setfib \ setfmac \ setpmac \ Added: head/usr.sbin/sesutil/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/sesutil/Makefile Sat Sep 5 00:06:01 2015 (r287473) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= sesutil +MAN= sesutil.8 + +.include Added: head/usr.sbin/sesutil/sesutil.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/sesutil/sesutil.8 Sat Sep 5 00:06:01 2015 (r287473) @@ -0,0 +1,73 @@ +.\" Copyright (c) 2015 Baptiste Daroussin +.\" 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 September 1, 2015 +.Dt SESUTIL 8 +.Os +.Sh NAME +.Nm sesutil +.Nd Utility for managing SCSI Enclosure Services (SES) device +.Sh SYNOPSIS +.Nm +.Cm locate Ar disk Bq on|off +.Sh DESCRIPTION +The +.Nm +utility can be used to modify various parameter on SCSI Enclosure Services +(SES) device. +.Pp +List of supported commands: +.Bl -tag -width indent +.It Cm locate Ar disk Bq on|off +Change the state of the external LED associated with +.Ar disk . +.Ar disk +can be the device name of the disk, like +.Cm da12 , +or +.Cm all . +to indicate all disks attached to SES controllers. +.El +.Sh EXAMPLES +Turn off all external LEDs: +.Pp +.Dl Nm Cm locate all off +.Pp +Turn on the external LED of drive +.Pa da15 : +.Pp +.Dl Nm Cm locate da15 on +.Sh SEE ALSO +.Xr ses 4 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm utility was written by +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org . Added: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/sesutil/sesutil.c Sat Sep 5 00:06:01 2015 (r287473) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2015 Baptiste Daroussin + * 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 + * in this position and unchanged. + * 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(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 AUTHOR(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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static int locate(int argc, char **argv); + +static struct command { + const char *name; + const char *desc; + int (*exec)(int argc, char **argv); +} cmds[] = { + { "locate", "Change the state of the external LED associated with a" + " disk", locate} , +}; + +static const int nbcmds = nitems(cmds); + +static void +do_locate(int fd, unsigned int idx, bool onoff) +{ + encioc_elm_status_t o; + + o.elm_idx = idx; + if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &o) < 0) { + close(fd); + err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); + } + o.cstat[0] |= 0x80; + if (onoff) + o.cstat[2] |= 0x02; + else + o.cstat[2] &= 0xfd; + + if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &o) < 0) { + close(fd); + err(EXIT_FAILURE, "ENCIOC_SETELMSTAT"); + } +} + +static bool +disk_match(const char *devnames, const char *disk, size_t len) +{ + const char *devname; + + devname = devnames; + while ((devname = strstr(devname, disk)) != NULL) { + if (devname[len] == '\0' || devname[len] == ',') + return (true); + devname++; + } + return (false); +} + +static int +locate(int argc, char **argv) +{ + encioc_elm_devnames_t objdn; + encioc_element_t *objp; + glob_t g; + char *disk; + size_t len, i; + int fd, nobj, j; + bool all = false; + bool locate; + + if (argc != 2) { + errx(EXIT_FAILURE, "usage: %s locate [disk] [on|off]", + getprogname()); + } + + disk = argv[0]; + + if (strcmp(argv[1], "on") == 0) { + locate = true; + } else if (strcmp(argv[1], "off") == 0) { + locate = false; + } else { + errx(EXIT_FAILURE, "usage: %s locate [disk] [on|off]", + getprogname()); + } + + if (strcmp(disk, "all") == 0) { + all = true; + } + len = strlen(disk); + + /* Get the list of ses devices */ + if (glob("/dev/ses[0-9]*", 0, NULL, &g) == GLOB_NOMATCH) { + globfree(&g); + errx(EXIT_FAILURE, "No SES devices found"); + } + for (i = 0; i < g.gl_pathc; i++) { + /* ensure we only got numbers after ses */ + if (strspn(g.gl_pathv[i] + 8, "0123456789") != + strlen(g.gl_pathv[i] + 8)) + continue; + if ((fd = open(g.gl_pathv[i], O_RDWR)) < 0) { + if (errno == EACCES) + err(EXIT_FAILURE, "enable to access SES device"); + break; + } + + if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) + err(EXIT_FAILURE, "ENCIOC_GETNELM"); + + objp = calloc(nobj, sizeof(encioc_element_t)); + if (objp == NULL) + err(EXIT_FAILURE, "calloc()"); + + if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) + err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); + + for (j = 0; j < nobj; j++) { + memset(&objdn, 0, sizeof(objdn)); + objdn.elm_idx = objp[j].elm_idx; + objdn.elm_names_size = 128; + objdn.elm_devnames = calloc(128, sizeof(char)); + if (objdn.elm_devnames == NULL) + err(EXIT_FAILURE, "calloc()"); + if (ioctl(fd, ENCIOC_GETELMDEVNAMES, + (caddr_t) &objdn) <0) + continue; + if (objdn.elm_names_len > 0) { + if (all) { + do_locate(fd, objdn.elm_idx, locate); + continue; + } + if (disk_match(objdn.elm_devnames, disk, len)) { + do_locate(fd, objdn.elm_idx, locate); + break; + } + } + } + close(fd); + i++; + } + globfree(&g); + + return (EXIT_SUCCESS); +} + +static void +usage(FILE *out) +{ + int i; + + fprintf(out, "Usage: %s [command] [options]\n", getprogname()); + fprintf(out, "Commands supported:\n"); + for (i = 0; i < nbcmds; i++) + fprintf(out, "\t%-15s%s\n", cmds[i].name, cmds[i].desc); +} + +int +main(int argc, char **argv) +{ + int i; + struct command *cmd = NULL; + + if (argc < 2) { + warnx("Missing command"); + usage(stderr); + return (EXIT_FAILURE); + } + + for (i = 0; i < nbcmds; i++) { + if (strcmp(argv[1], cmds[i].name) == 0) { + cmd = &cmds[i]; + break; + } + } + + if (cmd == NULL) { + warnx("unknown command %s", argv[1]); + usage(stderr); + return (EXIT_FAILURE); + } + + argc-=2; + argv+=2; + + return (cmd->exec(argc, argv)); +} From owner-svn-src-all@freebsd.org Sat Sep 5 01:00:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 602B49CB160; Sat, 5 Sep 2015 01:00:03 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.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 50AE01F0E; Sat, 5 Sep 2015 01:00:03 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85103qY052460; Sat, 5 Sep 2015 01:00:03 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85103Db052459; Sat, 5 Sep 2015 01:00:03 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201509050100.t85103Db052459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Sat, 5 Sep 2015 01:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287474 - head/share/misc 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, 05 Sep 2015 01:00:03 -0000 Author: feld (ports committer) Date: Sat Sep 5 01:00:02 2015 New Revision: 287474 URL: https://svnweb.freebsd.org/changeset/base/287474 Log: jhg -> jgh Submitted by: junovitch Approved by: delphij (implicit) Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sat Sep 5 00:06:01 2015 (r287473) +++ head/share/misc/organization.dot Sat Sep 5 01:00:02 2015 (r287474) @@ -34,7 +34,7 @@ portmgr [label="Port Management Team\npo portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nculot"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jhg, rea, sbz, simon, swills, zi"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, rea, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-all@freebsd.org Sat Sep 5 03:27:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 063AB9C9996; Sat, 5 Sep 2015 03:27:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.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 EB99D264; Sat, 5 Sep 2015 03:27:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t853RNiQ014329; Sat, 5 Sep 2015 03:27:23 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t853RNKK014328; Sat, 5 Sep 2015 03:27:23 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201509050327.t853RNKK014328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 5 Sep 2015 03:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287475 - head/sys/boot/efi/loader/arch/amd64 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, 05 Sep 2015 03:27:24 -0000 Author: marcel Date: Sat Sep 5 03:27:23 2015 New Revision: 287475 URL: https://svnweb.freebsd.org/changeset/base/287475 Log: My MacBook has UGA only, but we fail to detect any changes in the frame buffer when we flip pixels. Allow the detection to be bypassed by setting the uga_framebuffer and uga_stride variables. The kernel console works fine even when we can't detect pixel changes in the frame buffer, which indicates that the problem could be with reading from the frame buffer and not writing to it. Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Sep 5 01:00:02 2015 (r287474) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Sep 5 03:27:23 2015 (r287475) @@ -183,29 +183,24 @@ efifb_uga_find_pixel(EFI_UGA_DRAW_PROTOC return (-1); } -static EFI_STATUS -efifb_uga_detect_framebuffer(EFI_UGA_DRAW_PROTOCOL *uga, - EFI_PCI_IO_PROTOCOL **pciiop, uint64_t *addrp, uint64_t *sizep) +static EFI_PCI_IO_PROTOCOL * +efifb_uga_get_pciio(void) { EFI_PCI_IO_PROTOCOL *pciio; EFI_HANDLE *buf, *hp; - uint8_t *resattr; - uint64_t a, addr, s, size; - ssize_t ofs; EFI_STATUS status; UINTN bufsz; - u_int bar; /* Get all handles that support the UGA protocol. */ bufsz = 0; status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, NULL); if (status != EFI_BUFFER_TOO_SMALL) - return (status); + return (NULL); buf = malloc(bufsz); status = BS->LocateHandle(ByProtocol, &uga_guid, NULL, &bufsz, buf); if (status != EFI_SUCCESS) { free(buf); - return (status); + return (NULL); } bufsz /= sizeof(EFI_HANDLE); @@ -213,12 +208,24 @@ efifb_uga_detect_framebuffer(EFI_UGA_DRA pciio = NULL; for (hp = buf; hp < buf + bufsz; hp++) { status = BS->HandleProtocol(*hp, &pciio_guid, (void **)&pciio); - if (status == EFI_SUCCESS) - break; + if (status == EFI_SUCCESS) { + free(buf); + return (pciio); + } } free(buf); - if (status != EFI_SUCCESS || pciio == NULL) - return (EFI_NOT_FOUND); + return (NULL); +} + +static EFI_STATUS +efifb_uga_detect_framebuffer(EFI_UGA_DRAW_PROTOCOL *uga, + EFI_PCI_IO_PROTOCOL *pciio, uint64_t *addrp, uint64_t *sizep) +{ + uint8_t *resattr; + uint64_t a, addr, s, size; + ssize_t ofs; + EFI_STATUS status; + u_int bar; /* Attempt to get the frame buffer address (imprecise). */ addr = 0; @@ -265,7 +272,6 @@ efifb_uga_detect_framebuffer(EFI_UGA_DRA addr += ofs; size -= ofs; - *pciiop = pciio; *addrp = addr; *sizep = size; return (0); @@ -275,6 +281,7 @@ static int efifb_from_uga(struct efi_fb *efifb, EFI_UGA_DRAW_PROTOCOL *uga) { EFI_PCI_IO_PROTOCOL *pciio; + char *ev, *p; EFI_STATUS status; ssize_t ofs; uint32_t horiz, vert, depth, refresh; @@ -287,18 +294,37 @@ efifb_from_uga(struct efi_fb *efifb, EFI efifb_mask_from_pixfmt(efifb, PixelBlueGreenRedReserved8BitPerColor, NULL); - /* Try and find the frame buffer. */ - status = efifb_uga_detect_framebuffer(uga, &pciio, &efifb->fb_addr, - &efifb->fb_size); - if (EFI_ERROR(status)) + pciio = efifb_uga_get_pciio(); + if (pciio == NULL) return (1); - /* Try and detect the stride. */ - ofs = efifb_uga_find_pixel(uga, 1, pciio, efifb->fb_addr, - efifb->fb_size); - if (ofs == -1) - return (1); - efifb->fb_stride = ofs >> 2; + ev = getenv("uga_framebuffer"); + if (ev == NULL) { + /* Try to find the frame buffer. */ + status = efifb_uga_detect_framebuffer(uga, pciio, + &efifb->fb_addr, &efifb->fb_size); + if (EFI_ERROR(status)) + return (1); + } else { + efifb->fb_size = horiz * vert * 4; + efifb->fb_addr = strtoul(ev, &p, 0); + if (*p != '\0') + return (1); + } + + ev = getenv("uga_stride"); + if (ev == NULL) { + /* Try to detect the stride. */ + ofs = efifb_uga_find_pixel(uga, 1, pciio, efifb->fb_addr, + efifb->fb_size); + if (ofs == -1) + return (1); + efifb->fb_stride = ofs >> 2; + } else { + efifb->fb_stride = strtoul(ev, &p, 0); + if (*p != '\0') + return (1); + } return (0); } From owner-svn-src-all@freebsd.org Sat Sep 5 05:33:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1852E9CB23F; Sat, 5 Sep 2015 05:33:23 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.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 EE55B1A5E; Sat, 5 Sep 2015 05:33:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t855XMiN071351; Sat, 5 Sep 2015 05:33:22 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t855XLZs071346; Sat, 5 Sep 2015 05:33:21 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201509050533.t855XLZs071346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 5 Sep 2015 05:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287476 - 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: Sat, 05 Sep 2015 05:33:23 -0000 Author: melifaro Date: Sat Sep 5 05:33:20 2015 New Revision: 287476 URL: https://svnweb.freebsd.org/changeset/base/287476 Log: Constantify lookup key in ifa_ifwith* functions. Some places in our network stack already have const arguments (like if_output() routines and LLE functions). Code using ifa_ifwith (and similar functins) along with LLE/_output functions is currently bound to use tricks like __DECONST(). Provide a cleaner way by making sockaddr lookup key really constant. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3464 Modified: head/sys/net/if.c head/sys/net/if_dl.h head/sys/net/if_var.h head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Sep 5 03:27:23 2015 (r287475) +++ head/sys/net/if.c Sat Sep 5 05:33:20 2015 (r287476) @@ -1624,18 +1624,18 @@ ifa_switch_loopback_route(struct ifaddr */ #define sa_dl_equal(a1, a2) \ - ((((struct sockaddr_dl *)(a1))->sdl_len == \ - ((struct sockaddr_dl *)(a2))->sdl_len) && \ - (bcmp(LLADDR((struct sockaddr_dl *)(a1)), \ - LLADDR((struct sockaddr_dl *)(a2)), \ - ((struct sockaddr_dl *)(a1))->sdl_alen) == 0)) + ((((const struct sockaddr_dl *)(a1))->sdl_len == \ + ((const struct sockaddr_dl *)(a2))->sdl_len) && \ + (bcmp(CLLADDR((const struct sockaddr_dl *)(a1)), \ + CLLADDR((const struct sockaddr_dl *)(a2)), \ + ((const struct sockaddr_dl *)(a1))->sdl_alen) == 0)) /* * Locate an interface based on a complete address. */ /*ARGSUSED*/ static struct ifaddr * -ifa_ifwithaddr_internal(struct sockaddr *addr, int getref) +ifa_ifwithaddr_internal(const struct sockaddr *addr, int getref) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1672,14 +1672,14 @@ done: } struct ifaddr * -ifa_ifwithaddr(struct sockaddr *addr) +ifa_ifwithaddr(const struct sockaddr *addr) { return (ifa_ifwithaddr_internal(addr, 1)); } int -ifa_ifwithaddr_check(struct sockaddr *addr) +ifa_ifwithaddr_check(const struct sockaddr *addr) { return (ifa_ifwithaddr_internal(addr, 0) != NULL); @@ -1690,7 +1690,7 @@ ifa_ifwithaddr_check(struct sockaddr *ad */ /* ARGSUSED */ struct ifaddr * -ifa_ifwithbroadaddr(struct sockaddr *addr, int fibnum) +ifa_ifwithbroadaddr(const struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1725,7 +1725,7 @@ done: */ /*ARGSUSED*/ struct ifaddr * -ifa_ifwithdstaddr(struct sockaddr *addr, int fibnum) +ifa_ifwithdstaddr(const struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1760,20 +1760,20 @@ done: * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp, int fibnum) +ifa_ifwithnet(const struct sockaddr *addr, int ignore_ptp, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; struct ifaddr *ifa_maybe = NULL; u_int af = addr->sa_family; - char *addr_data = addr->sa_data, *cplim; + const char *addr_data = addr->sa_data, *cplim; /* * AF_LINK addresses can be looked up directly by their index number, * so do that if we can. */ if (af == AF_LINK) { - struct sockaddr_dl *sdl = (struct sockaddr_dl *)addr; + const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)addr; if (sdl->sdl_index && sdl->sdl_index <= V_if_index) return (ifaddr_byindex(sdl->sdl_index)); } @@ -1790,7 +1790,7 @@ ifa_ifwithnet(struct sockaddr *addr, int continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - char *cp, *cp2, *cp3; + const char *cp, *cp2, *cp3; if (ifa->ifa_addr->sa_family != af) next: continue; @@ -1863,10 +1863,10 @@ done: * a given address. */ struct ifaddr * -ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp) +ifaof_ifpforaddr(const struct sockaddr *addr, struct ifnet *ifp) { struct ifaddr *ifa; - char *cp, *cp2, *cp3; + const char *cp, *cp2, *cp3; char *cplim; struct ifaddr *ifa_maybe = NULL; u_int af = addr->sa_family; @@ -2924,7 +2924,7 @@ if_allmulti(struct ifnet *ifp, int onswi } struct ifmultiaddr * -if_findmulti(struct ifnet *ifp, struct sockaddr *sa) +if_findmulti(struct ifnet *ifp, const struct sockaddr *sa) { struct ifmultiaddr *ifma; Modified: head/sys/net/if_dl.h ============================================================================== --- head/sys/net/if_dl.h Sat Sep 5 03:27:23 2015 (r287475) +++ head/sys/net/if_dl.h Sat Sep 5 05:33:20 2015 (r287476) @@ -67,6 +67,7 @@ struct sockaddr_dl { }; #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) +#define CLLADDR(s) ((c_caddr_t)((s)->sdl_data + (s)->sdl_nlen)) #define LLINDEX(s) ((s)->sdl_index) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat Sep 5 03:27:23 2015 (r287475) +++ head/sys/net/if_var.h Sat Sep 5 05:33:20 2015 (r287476) @@ -487,7 +487,7 @@ void if_purgeaddrs(struct ifnet *); void if_delallmulti(struct ifnet *); void if_down(struct ifnet *); struct ifmultiaddr * - if_findmulti(struct ifnet *, struct sockaddr *); + if_findmulti(struct ifnet *, const struct sockaddr *); void if_free(struct ifnet *); void if_initname(struct ifnet *, const char *, int); void if_link_state_change(struct ifnet *, int); @@ -505,13 +505,14 @@ int ifa_add_loopback_route(struct ifaddr int ifa_del_loopback_route(struct ifaddr *, struct sockaddr *); int ifa_switch_loopback_route(struct ifaddr *, struct sockaddr *, int fib); -struct ifaddr *ifa_ifwithaddr(struct sockaddr *); -int ifa_ifwithaddr_check(struct sockaddr *); -struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *, int); -struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *, int); -struct ifaddr *ifa_ifwithnet(struct sockaddr *, int, int); -struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *, u_int); -struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); +struct ifaddr *ifa_ifwithaddr(const struct sockaddr *); +int ifa_ifwithaddr_check(const struct sockaddr *); +struct ifaddr *ifa_ifwithbroadaddr(const struct sockaddr *, int); +struct ifaddr *ifa_ifwithdstaddr(const struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet(const struct sockaddr *, int, int); +struct ifaddr *ifa_ifwithroute(int, const struct sockaddr *, struct sockaddr *, + u_int); +struct ifaddr *ifaof_ifpforaddr(const struct sockaddr *, struct ifnet *); int ifa_preferred(struct ifaddr *, struct ifaddr *); int if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Sep 5 03:27:23 2015 (r287475) +++ head/sys/net/route.c Sat Sep 5 05:33:20 2015 (r287476) @@ -704,7 +704,7 @@ rtioctl_fib(u_long req, caddr_t data, u_ } struct ifaddr * -ifa_ifwithroute(int flags, struct sockaddr *dst, struct sockaddr *gateway, +ifa_ifwithroute(int flags, const struct sockaddr *dst, struct sockaddr *gateway, u_int fibnum) { struct ifaddr *ifa; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Sep 5 03:27:23 2015 (r287475) +++ head/sys/net/route.h Sat Sep 5 05:33:20 2015 (r287476) @@ -282,8 +282,8 @@ struct rt_addrinfo { 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) #define sa_equal(a, b) ( \ - (((struct sockaddr *)(a))->sa_len == ((struct sockaddr *)(b))->sa_len) && \ - (bcmp((a), (b), ((struct sockaddr *)(b))->sa_len) == 0)) + (((const struct sockaddr *)(a))->sa_len == ((const struct sockaddr *)(b))->sa_len) && \ + (bcmp((a), (b), ((const struct sockaddr *)(b))->sa_len) == 0)) #ifdef _KERNEL From owner-svn-src-all@freebsd.org Sat Sep 5 05:54:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AF19CBBD4; Sat, 5 Sep 2015 05:54:11 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.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 D49E4307; Sat, 5 Sep 2015 05:54:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t855sA7J079456; Sat, 5 Sep 2015 05:54:10 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t855sA4e079454; Sat, 5 Sep 2015 05:54:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201509050554.t855sA4e079454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 5 Sep 2015 05:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287477 - 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: Sat, 05 Sep 2015 05:54:11 -0000 Author: melifaro Date: Sat Sep 5 05:54:09 2015 New Revision: 287477 URL: https://svnweb.freebsd.org/changeset/base/287477 Log: Make in6ifa_ifpwithaddr() take const param. Remove unneded DECONST from in6_lltable_rtcheck(). Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Sep 5 05:33:20 2015 (r287476) +++ head/sys/netinet6/in6.c Sat Sep 5 05:54:09 2015 (r287477) @@ -1518,7 +1518,7 @@ in6ifa_ifwithaddr(const struct in6_addr * ifaddr is returned referenced. */ struct in6_ifaddr * -in6ifa_ifpwithaddr(struct ifnet *ifp, struct in6_addr *addr) +in6ifa_ifpwithaddr(struct ifnet *ifp, const struct in6_addr *addr) { struct ifaddr *ifa; @@ -2138,8 +2138,7 @@ in6_lltable_rtcheck(struct ifnet *ifp, * Create an ND6 cache for an IPv6 neighbor * that is not covered by our own prefix. */ - /* XXX ifaof_ifpforaddr should take a const param */ - ifa = ifaof_ifpforaddr(__DECONST(struct sockaddr *, l3addr), ifp); + ifa = ifaof_ifpforaddr(l3addr, ifp); if (ifa != NULL) { ifa_free(ifa); if (rt != NULL) Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sat Sep 5 05:33:20 2015 (r287476) +++ head/sys/netinet6/in6_var.h Sat Sep 5 05:54:09 2015 (r287477) @@ -808,7 +808,7 @@ int in6_domifmtu(struct ifnet *); void in6_setmaxmtu(void); int in6_if2idlen(struct ifnet *); struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int); -struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, struct in6_addr *); +struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, const struct in6_addr *); struct in6_ifaddr *in6ifa_ifwithaddr(const struct in6_addr *, uint32_t); struct in6_ifaddr *in6ifa_llaonifp(struct ifnet *); int in6_addr2zoneid(struct ifnet *, struct in6_addr *, u_int32_t *); From owner-svn-src-all@freebsd.org Sat Sep 5 06:24:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDD079C9A91; Sat, 5 Sep 2015 06:24:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.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 BE7E410D8; Sat, 5 Sep 2015 06:24:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t856O0oX091810; Sat, 5 Sep 2015 06:24:00 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t856O0mZ091809; Sat, 5 Sep 2015 06:24:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201509050624.t856O0mZ091809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 5 Sep 2015 06:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287478 - 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: Sat, 05 Sep 2015 06:24:00 -0000 Author: melifaro Date: Sat Sep 5 06:24:00 2015 New Revision: 287478 URL: https://svnweb.freebsd.org/changeset/base/287478 Log: Do not skip entries without LLE_VALID flag. This one fixes showing incomplete entries in ndp -an. MFC after: 2 weeks Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Sep 5 05:54:09 2015 (r287477) +++ head/sys/netinet6/in6.c Sat Sep 5 06:24:00 2015 (r287478) @@ -2313,8 +2313,8 @@ in6_lltable_dump_entry(struct lltable *l int error; bzero(&ndpc, sizeof(ndpc)); - /* skip invalid entries */ - if ((lle->la_flags & (LLE_DELETED|LLE_VALID)) != LLE_VALID) + /* skip deleted entries */ + if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) return (0); /* Skip if jailed and not a valid IP of the prison. */ lltable_fill_sa_entry(lle, From owner-svn-src-all@freebsd.org Sat Sep 5 08:48:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC149CA043; Sat, 5 Sep 2015 08:48:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6E3E415B6; Sat, 5 Sep 2015 08:48:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t858mPur049435; Sat, 5 Sep 2015 08:48:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t858mPut049434; Sat, 5 Sep 2015 08:48:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509050848.t858mPut049434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Sep 2015 08:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287479 - head/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: Sat, 05 Sep 2015 08:48:25 -0000 Author: kib Date: Sat Sep 5 08:48:24 2015 New Revision: 287479 URL: https://svnweb.freebsd.org/changeset/base/287479 Log: Declare the writes around the call to VFS_SYNC() in softdep_ast_cleanup_proc(). Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Sep 5 06:24:00 2015 (r287478) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Sep 5 08:48:24 2015 (r287479) @@ -13325,8 +13325,13 @@ softdep_ast_cleanup_proc(void) if (softdep_excess_items(ump, D_NEWBLK) || softdep_excess_items(ump, D_ALLOCDIRECT) || softdep_excess_items(ump, D_ALLOCINDIR)) { - req = true; - VFS_SYNC(mp, MNT_WAIT); + error = vn_start_write(NULL, &mp, V_MNTREF | + V_WAIT); + if (error == 0) { + req = true; + VFS_SYNC(mp, MNT_WAIT); + vn_finished_write(mp); + } } if ((td->td_pflags & TDP_KTHREAD) != 0 || !req) break; From owner-svn-src-all@freebsd.org Sat Sep 5 08:55:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7073C9CA42D; Sat, 5 Sep 2015 08:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 55E2A1AFA; Sat, 5 Sep 2015 08:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t858twKR053429; Sat, 5 Sep 2015 08:55:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t858tqhN053404; Sat, 5 Sep 2015 08:55:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509050855.t858tqhN053404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Sep 2015 08:55: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: r287480 - in stable/10/lib/libc: amd64/gen compat-43 db/btree db/hash gen i386/gen include net stdio stdlib 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, 05 Sep 2015 08:55:58 -0000 Author: kib Date: Sat Sep 5 08:55:51 2015 New Revision: 287480 URL: https://svnweb.freebsd.org/changeset/base/287480 Log: MFC r287292: Switch libc from using _sig{procmask,action,suspend} symbols, which are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. MFC r287300: Use libthr interposed functions instead of syscalls, in posix_spawn()' child. Modified: stable/10/lib/libc/amd64/gen/setjmp.S stable/10/lib/libc/amd64/gen/sigsetjmp.S stable/10/lib/libc/compat-43/sigcompat.c stable/10/lib/libc/db/btree/bt_open.c stable/10/lib/libc/db/hash/hash_page.c stable/10/lib/libc/gen/daemon.c stable/10/lib/libc/gen/posix_spawn.c stable/10/lib/libc/gen/readpassphrase.c stable/10/lib/libc/gen/setmode.c stable/10/lib/libc/gen/siginterrupt.c stable/10/lib/libc/gen/signal.c stable/10/lib/libc/gen/wordexp.c stable/10/lib/libc/i386/gen/setjmp.S stable/10/lib/libc/i386/gen/sigsetjmp.S stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/net/rcmd.c stable/10/lib/libc/stdio/tmpfile.c stable/10/lib/libc/stdlib/abort.c stable/10/lib/libc/stdlib/system.c stable/10/lib/libc/sys/sigaction.c stable/10/lib/libc/sys/sigprocmask.c stable/10/lib/libc/sys/sigsuspend.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/amd64/gen/setjmp.S ============================================================================== --- stable/10/lib/libc/amd64/gen/setjmp.S Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/amd64/gen/setjmp.S Sat Sep 5 08:55:51 2015 (r287480) @@ -55,7 +55,7 @@ ENTRY(setjmp) movq $0,%rsi /* (sigset_t*)set */ leaq 72(%rcx),%rdx /* 9,10; (sigset_t*)oset */ /* stack is 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask popq %rdi movq %rdi,%rcx movq 0(%rsp),%rdx /* retval */ @@ -83,7 +83,7 @@ ENTRY(__longjmp) leaq 72(%rdx),%rsi /* (sigset_t*)set */ movq $0,%rdx /* (sigset_t*)oset */ subq $0x8,%rsp /* make the stack 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask addq $0x8,%rsp popq %rsi popq %rdi /* jmpbuf */ Modified: stable/10/lib/libc/amd64/gen/sigsetjmp.S ============================================================================== --- stable/10/lib/libc/amd64/gen/sigsetjmp.S Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/amd64/gen/sigsetjmp.S Sat Sep 5 08:55:51 2015 (r287480) @@ -63,7 +63,7 @@ ENTRY(sigsetjmp) movq $0,%rsi /* (sigset_t*)set */ leaq 72(%rcx),%rdx /* 9,10 (sigset_t*)oset */ /* stack is 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask popq %rdi 2: movq %rdi,%rcx movq 0(%rsp),%rdx /* retval */ @@ -92,7 +92,7 @@ ENTRY(__siglongjmp) leaq 72(%rdx),%rsi /* (sigset_t*)set */ movq $0,%rdx /* (sigset_t*)oset */ subq $0x8,%rsp /* make the stack 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask addq $0x8,%rsp popq %rsi popq %rdi /* jmpbuf */ Modified: stable/10/lib/libc/compat-43/sigcompat.c ============================================================================== --- stable/10/lib/libc/compat-43/sigcompat.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/compat-43/sigcompat.c Sat Sep 5 08:55:51 2015 (r287480) @@ -59,7 +59,7 @@ sigvec(signo, sv, osv) } else sap = NULL; osap = osv != NULL ? &osa : NULL; - ret = _sigaction(signo, sap, osap); + ret = __libc_sigaction(signo, sap, osap); if (ret == 0 && osv != NULL) { osv->sv_handler = osa.sa_handler; osv->sv_flags = osa.sa_flags ^ SV_INTERRUPT; @@ -77,7 +77,7 @@ sigsetmask(mask) sigemptyset(&set); set.__bits[0] = mask; - n = _sigprocmask(SIG_SETMASK, &set, &oset); + n = __libc_sigprocmask(SIG_SETMASK, &set, &oset); if (n) return (n); return (oset.__bits[0]); @@ -92,7 +92,7 @@ sigblock(mask) sigemptyset(&set); set.__bits[0] = mask; - n = _sigprocmask(SIG_BLOCK, &set, &oset); + n = __libc_sigprocmask(SIG_BLOCK, &set, &oset); if (n) return (n); return (oset.__bits[0]); @@ -105,7 +105,7 @@ sigpause(int mask) sigemptyset(&set); set.__bits[0] = mask; - return (_sigsuspend(&set)); + return (__libc_sigsuspend(&set)); } int @@ -113,11 +113,11 @@ xsi_sigpause(int sig) { sigset_t set; - if (_sigprocmask(SIG_BLOCK, NULL, &set) == -1) + if (__libc_sigprocmask(SIG_BLOCK, NULL, &set) == -1) return (-1); if (sigdelset(&set, sig) == -1) return (-1); - return (_sigsuspend(&set)); + return (__libc_sigsuspend(&set)); } int @@ -128,7 +128,7 @@ sighold(int sig) sigemptyset(&set); if (sigaddset(&set, sig) == -1) return (-1); - return (_sigprocmask(SIG_BLOCK, &set, NULL)); + return (__libc_sigprocmask(SIG_BLOCK, &set, NULL)); } int @@ -138,7 +138,7 @@ sigignore(int sig) bzero(&sa, sizeof(sa)); sa.sa_handler = SIG_IGN; - return (_sigaction(sig, &sa, NULL)); + return (__libc_sigaction(sig, &sa, NULL)); } int @@ -149,7 +149,7 @@ sigrelse(int sig) sigemptyset(&set); if (sigaddset(&set, sig) == -1) return (-1); - return (_sigprocmask(SIG_UNBLOCK, &set, NULL)); + return (__libc_sigprocmask(SIG_UNBLOCK, &set, NULL)); } void @@ -161,26 +161,26 @@ void sigemptyset(&set); if (sigaddset(&set, sig) == -1) return (SIG_ERR); - if (_sigprocmask(SIG_BLOCK, NULL, &pset) == -1) + if (__libc_sigprocmask(SIG_BLOCK, NULL, &pset) == -1) return (SIG_ERR); if ((__sighandler_t *)disp == SIG_HOLD) { - if (_sigprocmask(SIG_BLOCK, &set, &pset) == -1) + if (__libc_sigprocmask(SIG_BLOCK, &set, &pset) == -1) return (SIG_ERR); if (sigismember(&pset, sig)) return (SIG_HOLD); else { - if (_sigaction(sig, NULL, &psa) == -1) + if (__libc_sigaction(sig, NULL, &psa) == -1) return (SIG_ERR); return (psa.sa_handler); } } else { - if (_sigprocmask(SIG_UNBLOCK, &set, &pset) == -1) + if (__libc_sigprocmask(SIG_UNBLOCK, &set, &pset) == -1) return (SIG_ERR); } bzero(&sa, sizeof(sa)); sa.sa_handler = disp; - if (_sigaction(sig, &sa, &psa) == -1) + if (__libc_sigaction(sig, &sa, &psa) == -1) return (SIG_ERR); if (sigismember(&pset, sig)) return (SIG_HOLD); Modified: stable/10/lib/libc/db/btree/bt_open.c ============================================================================== --- stable/10/lib/libc/db/btree/bt_open.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/db/btree/bt_open.c Sat Sep 5 08:55:51 2015 (r287480) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" #include #include "btree.h" @@ -401,10 +402,10 @@ tmp(void) } (void)sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); if ((fd = mkostemp(path, O_CLOEXEC)) != -1) (void)unlink(path); - (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, NULL); return(fd); } Modified: stable/10/lib/libc/db/hash/hash_page.c ============================================================================== --- stable/10/lib/libc/db/hash/hash_page.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/db/hash/hash_page.c Sat Sep 5 08:55:51 2015 (r287480) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include "un-namespace.h" +#include "libc_private.h" #include #include "hash.h" @@ -861,10 +862,10 @@ open_temp(HTAB *hashp) /* Block signals; make sure file goes away at process exit. */ (void)sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1) (void)unlink(path); - (void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); return (hashp->fp != -1 ? 0 : -1); } Modified: stable/10/lib/libc/gen/daemon.c ============================================================================== --- stable/10/lib/libc/gen/daemon.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/daemon.c Sat Sep 5 08:55:51 2015 (r287480) @@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" int -daemon(nochdir, noclose) - int nochdir, noclose; +daemon(int nochdir, int noclose) { struct sigaction osa, sa; int fd; @@ -56,7 +56,7 @@ daemon(nochdir, noclose) sigemptyset(&sa.sa_mask); sa.sa_handler = SIG_IGN; sa.sa_flags = 0; - osa_ok = _sigaction(SIGHUP, &sa, &osa); + osa_ok = __libc_sigaction(SIGHUP, &sa, &osa); switch (fork()) { case -1: @@ -74,7 +74,7 @@ daemon(nochdir, noclose) newgrp = setsid(); oerrno = errno; if (osa_ok != -1) - _sigaction(SIGHUP, &osa, NULL); + __libc_sigaction(SIGHUP, &osa, NULL); if (newgrp == -1) { errno = oerrno; Modified: stable/10/lib/libc/gen/posix_spawn.c ============================================================================== --- stable/10/lib/libc/gen/posix_spawn.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/posix_spawn.c Sat Sep 5 08:55:51 2015 (r287480) @@ -118,15 +118,18 @@ process_spawnattr(const posix_spawnattr_ return (errno); } - /* Set signal masks/defaults */ + /* + * Set signal masks/defaults. + * Use unwrapped syscall, libthr is in undefined state after vfork(). + */ if (sa->sa_flags & POSIX_SPAWN_SETSIGMASK) { - _sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL); + __sys_sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL); } if (sa->sa_flags & POSIX_SPAWN_SETSIGDEF) { for (i = 1; i <= _SIG_MAXSIG; i++) { if (sigismember(&sa->sa_sigdefault, i)) - if (_sigaction(i, &sigact, NULL) != 0) + if (__sys_sigaction(i, &sigact, NULL) != 0) return (errno); } } Modified: stable/10/lib/libc/gen/readpassphrase.c ============================================================================== --- stable/10/lib/libc/gen/readpassphrase.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/readpassphrase.c Sat Sep 5 08:55:51 2015 (r287480) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" static volatile sig_atomic_t signo[NSIG]; @@ -104,15 +105,15 @@ restart: sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; - (void)_sigaction(SIGALRM, &sa, &savealrm); - (void)_sigaction(SIGHUP, &sa, &savehup); - (void)_sigaction(SIGINT, &sa, &saveint); - (void)_sigaction(SIGPIPE, &sa, &savepipe); - (void)_sigaction(SIGQUIT, &sa, &savequit); - (void)_sigaction(SIGTERM, &sa, &saveterm); - (void)_sigaction(SIGTSTP, &sa, &savetstp); - (void)_sigaction(SIGTTIN, &sa, &savettin); - (void)_sigaction(SIGTTOU, &sa, &savettou); + (void)__libc_sigaction(SIGALRM, &sa, &savealrm); + (void)__libc_sigaction(SIGHUP, &sa, &savehup); + (void)__libc_sigaction(SIGINT, &sa, &saveint); + (void)__libc_sigaction(SIGPIPE, &sa, &savepipe); + (void)__libc_sigaction(SIGQUIT, &sa, &savequit); + (void)__libc_sigaction(SIGTERM, &sa, &saveterm); + (void)__libc_sigaction(SIGTSTP, &sa, &savetstp); + (void)__libc_sigaction(SIGTTIN, &sa, &savettin); + (void)__libc_sigaction(SIGTTOU, &sa, &savettou); if (!(flags & RPP_STDIN)) (void)_write(output, prompt, strlen(prompt)); @@ -142,15 +143,15 @@ restart: errno == EINTR && !signo[SIGTTOU]) continue; } - (void)_sigaction(SIGALRM, &savealrm, NULL); - (void)_sigaction(SIGHUP, &savehup, NULL); - (void)_sigaction(SIGINT, &saveint, NULL); - (void)_sigaction(SIGQUIT, &savequit, NULL); - (void)_sigaction(SIGPIPE, &savepipe, NULL); - (void)_sigaction(SIGTERM, &saveterm, NULL); - (void)_sigaction(SIGTSTP, &savetstp, NULL); - (void)_sigaction(SIGTTIN, &savettin, NULL); - (void)_sigaction(SIGTTOU, &savettou, NULL); + (void)__libc_sigaction(SIGALRM, &savealrm, NULL); + (void)__libc_sigaction(SIGHUP, &savehup, NULL); + (void)__libc_sigaction(SIGINT, &saveint, NULL); + (void)__libc_sigaction(SIGQUIT, &savequit, NULL); + (void)__libc_sigaction(SIGPIPE, &savepipe, NULL); + (void)__libc_sigaction(SIGTERM, &saveterm, NULL); + (void)__libc_sigaction(SIGTSTP, &savetstp, NULL); + (void)__libc_sigaction(SIGTTIN, &savettin, NULL); + (void)__libc_sigaction(SIGTTOU, &savettou, NULL); if (input != STDIN_FILENO) (void)_close(input); Modified: stable/10/lib/libc/gen/setmode.c ============================================================================== --- stable/10/lib/libc/gen/setmode.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/setmode.c Sat Sep 5 08:55:51 2015 (r287480) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include "un-namespace.h" +#include "libc_private.h" #define SET_LEN 6 /* initial # of bitcmd struct to malloc */ #define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ @@ -364,9 +365,9 @@ getumask(void) * handler, protect them as best we can. */ sigfillset(&sigset); - (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); + (void)__libc_sigprocmask(SIG_BLOCK, &sigset, &sigoset); (void)umask(mask = umask(0)); - (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &sigoset, NULL); return (mask); } Modified: stable/10/lib/libc/gen/siginterrupt.c ============================================================================== --- stable/10/lib/libc/gen/siginterrupt.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/siginterrupt.c Sat Sep 5 08:55:51 2015 (r287480) @@ -43,14 +43,13 @@ __FBSDID("$FreeBSD$"); * after an instance of the indicated signal. */ int -siginterrupt(sig, flag) - int sig, flag; +siginterrupt(int sig, int flag) { extern sigset_t _sigintr __hidden; struct sigaction sa; int ret; - if ((ret = _sigaction(sig, (struct sigaction *)0, &sa)) < 0) + if ((ret = __libc_sigaction(sig, (struct sigaction *)0, &sa)) < 0) return (ret); if (flag) { sigaddset(&_sigintr, sig); @@ -59,5 +58,5 @@ siginterrupt(sig, flag) sigdelset(&_sigintr, sig); sa.sa_flags |= SA_RESTART; } - return (_sigaction(sig, &sa, (struct sigaction *)0)); + return (__libc_sigaction(sig, &sa, (struct sigaction *)0)); } Modified: stable/10/lib/libc/gen/signal.c ============================================================================== --- stable/10/lib/libc/gen/signal.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/signal.c Sat Sep 5 08:55:51 2015 (r287480) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); sigset_t _sigintr __hidden; /* shared with siginterrupt */ sig_t -signal(s, a) - int s; - sig_t a; +signal(int s, sig_t a) { struct sigaction sa, osa; @@ -55,7 +53,7 @@ signal(s, a) sa.sa_flags = 0; if (!sigismember(&_sigintr, s)) sa.sa_flags |= SA_RESTART; - if (_sigaction(s, &sa, &osa) < 0) + if (__libc_sigaction(s, &sa, &osa) < 0) return (SIG_ERR); return (osa.sa_handler); } Modified: stable/10/lib/libc/gen/wordexp.c ============================================================================== --- stable/10/lib/libc/gen/wordexp.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/gen/wordexp.c Sat Sep 5 08:55:51 2015 (r287480) @@ -38,6 +38,7 @@ #include #include #include "un-namespace.h" +#include "libc_private.h" __FBSDID("$FreeBSD$"); @@ -127,12 +128,12 @@ we_askshell(const char *words, wordexp_t return (WRDE_NOSPACE); /* XXX */ (void)sigemptyset(&newsigblock); (void)sigaddset(&newsigblock, SIGCHLD); - (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + (void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); if ((pid = fork()) < 0) { serrno = errno; _close(pdes[0]); _close(pdes[1]); - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); errno = serrno; return (WRDE_NOSPACE); /* XXX */ } @@ -141,7 +142,7 @@ we_askshell(const char *words, wordexp_t * We are the child; just get /bin/sh to run the wordexp * builtin on `words'. */ - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); if ((pdes[1] != STDOUT_FILENO ? _dup2(pdes[1], STDOUT_FILENO) : _fcntl(pdes[1], F_SETFD, 0)) < 0) @@ -210,7 +211,7 @@ cleanup: do wpid = _waitpid(pid, &status, 0); while (wpid < 0 && errno == EINTR); - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); if (error != 0) { errno = serrno; return (error); Modified: stable/10/lib/libc/i386/gen/setjmp.S ============================================================================== --- stable/10/lib/libc/i386/gen/setjmp.S Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/i386/gen/setjmp.S Sat Sep 5 08:55:51 2015 (r287480) @@ -50,21 +50,12 @@ __FBSDID("$FreeBSD$"); ENTRY(setjmp) movl 4(%esp),%ecx - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif leal 28(%ecx), %eax pushl %eax /* (sigset_t*)oset */ pushl $0 /* (sigset_t*)set */ pushl $1 /* SIG_BLOCK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%ecx movl 0(%esp),%edx movl %edx, 0(%ecx) @@ -82,21 +73,12 @@ END(setjmp) .set CNAME(longjmp),CNAME(__longjmp) ENTRY(__longjmp) movl 4(%esp),%edx - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif pushl $0 /* (sigset_t*)oset */ leal 28(%edx), %eax pushl %eax /* (sigset_t*)set */ pushl $3 /* SIG_SETMASK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%edx movl 8(%esp),%eax movl 0(%edx),%ecx Modified: stable/10/lib/libc/i386/gen/sigsetjmp.S ============================================================================== --- stable/10/lib/libc/i386/gen/sigsetjmp.S Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/i386/gen/sigsetjmp.S Sat Sep 5 08:55:51 2015 (r287480) @@ -59,21 +59,12 @@ ENTRY(sigsetjmp) movl %eax,44(%ecx) testl %eax,%eax jz 2f - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif leal 28(%ecx), %eax pushl %eax /* (sigset_t*)oset */ pushl $0 /* (sigset_t*)set */ pushl $1 /* SIG_BLOCK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%ecx 2: movl 0(%esp),%edx movl %edx, 0(%ecx) @@ -93,21 +84,12 @@ ENTRY(__siglongjmp) movl 4(%esp),%edx cmpl $0,44(%edx) jz 2f - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif pushl $0 /* (sigset_t*)oset */ leal 28(%edx), %eax pushl %eax /* (sigset_t*)set */ pushl $3 /* SIG_SETMASK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%edx 2: movl 8(%esp),%eax movl 0(%edx),%ecx Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/include/libc_private.h Sat Sep 5 08:55:51 2015 (r287480) @@ -368,6 +368,11 @@ __pid_t __sys_wait6(enum idtype, __id_t __ssize_t __sys_write(int, const void *, __size_t); __ssize_t __sys_writev(int, const struct iovec *, int); +int __libc_sigaction(int, const struct sigaction *, + struct sigaction *) __hidden; +int __libc_sigprocmask(int, const __sigset_t *, __sigset_t *) + __hidden; +int __libc_sigsuspend(const __sigset_t *) __hidden; int __libc_sigwait(const __sigset_t * __restrict, int * restrict sig); int __libc_system(const char *); Modified: stable/10/lib/libc/net/rcmd.c ============================================================================== --- stable/10/lib/libc/net/rcmd.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/net/rcmd.c Sat Sep 5 08:55:51 2015 (r287480) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include "un-namespace.h" +#include "libc_private.h" extern int innetgr( const char *, const char *, const char *, const char * ); @@ -148,7 +149,7 @@ rcmd_af(ahost, rport, locuser, remuser, refused = 0; sigemptyset(&newmask); sigaddset(&newmask, SIGURG); - _sigprocmask(SIG_BLOCK, (const sigset_t *)&newmask, &oldmask); + __libc_sigprocmask(SIG_BLOCK, (const sigset_t *)&newmask, &oldmask); for (timo = 1, lport = IPPORT_RESERVED - 1;;) { s = rresvport_af(&lport, ai->ai_family); if (s < 0) { @@ -163,7 +164,7 @@ rcmd_af(ahost, rport, locuser, remuser, (void)fprintf(stderr, "rcmd: socket: %s\n", strerror(errno)); freeaddrinfo(res); - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); return (-1); } @@ -181,7 +182,7 @@ rcmd_af(ahost, rport, locuser, remuser, (void)fprintf(stderr, "%s: %s\n", *ahost, strerror(errno)); freeaddrinfo(res); - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); return (-1); } @@ -306,7 +307,7 @@ again: } goto bad2; } - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); freeaddrinfo(res); return (s); bad2: @@ -314,7 +315,7 @@ bad2: (void)_close(*fd2p); bad: (void)_close(s); - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); freeaddrinfo(res); return (-1); } Modified: stable/10/lib/libc/stdio/tmpfile.c ============================================================================== --- stable/10/lib/libc/stdio/tmpfile.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/stdio/tmpfile.c Sat Sep 5 08:55:51 2015 (r287480) @@ -46,9 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" FILE * -tmpfile() +tmpfile(void) { sigset_t set, oset; FILE *fp; @@ -69,7 +70,7 @@ tmpfile() return (NULL); sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); fd = mkstemp(buf); if (fd != -1) @@ -77,7 +78,7 @@ tmpfile() free(buf); - (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, NULL); if (fd == -1) return (NULL); Modified: stable/10/lib/libc/stdlib/abort.c ============================================================================== --- stable/10/lib/libc/stdlib/abort.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/stdlib/abort.c Sat Sep 5 08:55:51 2015 (r287480) @@ -61,7 +61,7 @@ abort() * any errors -- ISO C doesn't allow abort to return anyway. */ sigdelset(&act.sa_mask, SIGABRT); - (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); (void)raise(SIGABRT); /* @@ -71,9 +71,9 @@ abort() act.sa_handler = SIG_DFL; act.sa_flags = 0; sigfillset(&act.sa_mask); - (void)_sigaction(SIGABRT, &act, NULL); + (void)__libc_sigaction(SIGABRT, &act, NULL); sigdelset(&act.sa_mask, SIGABRT); - (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); (void)raise(SIGABRT); exit(1); } Modified: stable/10/lib/libc/stdlib/system.c ============================================================================== --- stable/10/lib/libc/stdlib/system.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/stdlib/system.c Sat Sep 5 08:55:51 2015 (r287480) @@ -70,16 +70,20 @@ __libc_system(const char *command) (void)sigaddset(&newsigblock, SIGCHLD); (void)sigaddset(&newsigblock, SIGINT); (void)sigaddset(&newsigblock, SIGQUIT); - (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + (void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); switch(pid = vfork()) { + /* + * In the child, use unwrapped syscalls. libthr is in + * undefined state after vfork(). + */ case -1: /* error */ - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); return (-1); case 0: /* child */ /* * Restore original signal dispositions and exec the command. */ - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__sys_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); _exit(127); } @@ -92,16 +96,16 @@ __libc_system(const char *command) memset(&ign, 0, sizeof(ign)); ign.sa_handler = SIG_IGN; (void)sigemptyset(&ign.sa_mask); - (void)_sigaction(SIGINT, &ign, &intact); - (void)_sigaction(SIGQUIT, &ign, &quitact); + (void)__libc_sigaction(SIGINT, &ign, &intact); + (void)__libc_sigaction(SIGQUIT, &ign, &quitact); savedpid = pid; do { pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0); } while (pid == -1 && errno == EINTR); - (void)_sigaction(SIGINT, &intact, NULL); - (void)_sigaction(SIGQUIT, &quitact, NULL); - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); - return(pid == -1 ? -1 : pstat); + (void)__libc_sigaction(SIGINT, &intact, NULL); + (void)__libc_sigaction(SIGQUIT, &quitact, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + return (pid == -1 ? -1 : pstat); } __weak_reference(__libc_system, __system); Modified: stable/10/lib/libc/sys/sigaction.c ============================================================================== --- stable/10/lib/libc/sys/sigaction.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/sys/sigaction.c Sat Sep 5 08:55:51 2015 (r287480) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" __weak_reference(__sys_sigaction, __sigaction); +__weak_reference(sigaction, __libc_sigaction); #pragma weak sigaction int Modified: stable/10/lib/libc/sys/sigprocmask.c ============================================================================== --- stable/10/lib/libc/sys/sigprocmask.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/sys/sigprocmask.c Sat Sep 5 08:55:51 2015 (r287480) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" __weak_reference(__sys_sigprocmask, __sigprocmask); +__weak_reference(sigprocmask, __libc_sigprocmask); #pragma weak sigprocmask int Modified: stable/10/lib/libc/sys/sigsuspend.c ============================================================================== --- stable/10/lib/libc/sys/sigsuspend.c Sat Sep 5 08:48:24 2015 (r287479) +++ stable/10/lib/libc/sys/sigsuspend.c Sat Sep 5 08:55:51 2015 (r287480) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" __weak_reference(__sys_sigsuspend, __sigsuspend); +__weak_reference(sigsuspend, __libc_sigsuspend); #pragma weak sigsuspend int From owner-svn-src-all@freebsd.org Sat Sep 5 10:15:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AEBF9CACF8; Sat, 5 Sep 2015 10:15:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 104651B99; Sat, 5 Sep 2015 10:15:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85AFKWr086346; Sat, 5 Sep 2015 10:15:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85AFKue086342; Sat, 5 Sep 2015 10:15:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509051015.t85AFKue086342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 5 Sep 2015 10:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287481 - 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: Sat, 05 Sep 2015 10:15:21 -0000 Author: glebius Date: Sat Sep 5 10:15:19 2015 New Revision: 287481 URL: https://svnweb.freebsd.org/changeset/base/287481 Log: Use Jenkins hash for TCP syncache. o Unlike xor, in Jenkins hash every bit of input affects virtually every bit of output, thus salting the hash actually works. With xor salting only provides a false sense of security, since if hash(x) collides with hash(y), then of course, hash(x) ^ salt would also collide with hash(y) ^ salt. [1] o Jenkins provides much better distribution than xor, very close to ideal. TCP connection setup/teardown benchmark has shown a 10% increase with default hash size, and with bigger hashes that still provide possibility for collisions. With enormous hash size, when dataset is by an order of magnitude smaller than hash size, the benchmark has shown 4% decrease in performance decrease, which is expected and acceptable. Noticed by: Jeffrey Knockel [1] Benchmarks by: jch Reviewed by: jch, pkelsey, delphij Security: strengthens protection against hash collision DoS Sponsored by: Nginx, Inc. Modified: head/sys/netinet/in_pcb.h head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sat Sep 5 08:55:51 2015 (r287480) +++ head/sys/netinet/in_pcb.h Sat Sep 5 10:15:19 2015 (r287481) @@ -79,6 +79,8 @@ struct in_addr_4in6 { /* * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has * some extra padding to accomplish this. + * NOTE 2: tcp_syncache.c uses first 5 32-bit words, which identify fport, + * lport, faddr to generate hash, so these fields shouldn't be moved. */ struct in_endpoints { u_int16_t ie_fport; /* foreign port */ Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Sep 5 08:55:51 2015 (r287480) +++ head/sys/netinet/tcp_syncache.c Sat Sep 5 10:15:19 2015 (r287481) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -186,27 +187,6 @@ SYSCTL_INT(_net_inet_tcp_syncache, OID_A static MALLOC_DEFINE(M_SYNCACHE, "syncache", "TCP syncache"); -#define SYNCACHE_HASH(inc, mask) \ - ((V_tcp_syncache.hash_secret ^ \ - (inc)->inc_faddr.s_addr ^ \ - ((inc)->inc_faddr.s_addr >> 16) ^ \ - (inc)->inc_fport ^ (inc)->inc_lport) & mask) - -#define SYNCACHE_HASH6(inc, mask) \ - ((V_tcp_syncache.hash_secret ^ \ - (inc)->inc6_faddr.s6_addr32[0] ^ \ - (inc)->inc6_faddr.s6_addr32[3] ^ \ - (inc)->inc_fport ^ (inc)->inc_lport) & mask) - -#define ENDPTS_EQ(a, b) ( \ - (a)->ie_fport == (b)->ie_fport && \ - (a)->ie_lport == (b)->ie_lport && \ - (a)->ie_faddr.s_addr == (b)->ie_faddr.s_addr && \ - (a)->ie_laddr.s_addr == (b)->ie_laddr.s_addr \ -) - -#define ENDPTS6_EQ(a, b) (memcmp(a, b, sizeof(*a)) == 0) - #define SCH_LOCK(sch) mtx_lock(&(sch)->sch_mtx) #define SCH_UNLOCK(sch) mtx_unlock(&(sch)->sch_mtx) #define SCH_LOCK_ASSERT(sch) mtx_assert(&(sch)->sch_mtx, MA_OWNED) @@ -486,41 +466,29 @@ syncache_lookup(struct in_conninfo *inc, { struct syncache *sc; struct syncache_head *sch; + uint32_t hash; -#ifdef INET6 - if (inc->inc_flags & INC_ISIPV6) { - sch = &V_tcp_syncache.hashbase[ - SYNCACHE_HASH6(inc, V_tcp_syncache.hashmask)]; - *schp = sch; - - SCH_LOCK(sch); + /* + * The hash is built on foreign port + local port + foreign address. + * We rely on the fact that struct in_conninfo starts with 16 bits + * of foreign port, then 16 bits of local port then followed by 128 + * bits of foreign address. In case of IPv4 address, the first 3 + * 32-bit words of the address always are zeroes. + */ + hash = jenkins_hash32((uint32_t *)&inc->inc_ie, 5, + V_tcp_syncache.hash_secret) & V_tcp_syncache.hashmask; - /* Circle through bucket row to find matching entry. */ - TAILQ_FOREACH(sc, &sch->sch_bucket, sc_hash) { - if (ENDPTS6_EQ(&inc->inc_ie, &sc->sc_inc.inc_ie)) - return (sc); - } - } else -#endif - { - sch = &V_tcp_syncache.hashbase[ - SYNCACHE_HASH(inc, V_tcp_syncache.hashmask)]; - *schp = sch; + sch = &V_tcp_syncache.hashbase[hash]; + *schp = sch; + SCH_LOCK(sch); - SCH_LOCK(sch); + /* Circle through bucket row to find matching entry. */ + TAILQ_FOREACH(sc, &sch->sch_bucket, sc_hash) + if (bcmp(&inc->inc_ie, &sc->sc_inc.inc_ie, + sizeof(struct in_endpoints)) == 0) + break; - /* Circle through bucket row to find matching entry. */ - TAILQ_FOREACH(sc, &sch->sch_bucket, sc_hash) { -#ifdef INET6 - if (sc->sc_inc.inc_flags & INC_ISIPV6) - continue; -#endif - if (ENDPTS_EQ(&inc->inc_ie, &sc->sc_inc.inc_ie)) - return (sc); - } - } - SCH_LOCK_ASSERT(*schp); - return (NULL); /* always returns with locked sch */ + return (sc); /* Always returns with locked sch. */ } /* Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Sat Sep 5 08:55:51 2015 (r287480) +++ head/sys/netinet/tcp_syncache.h Sat Sep 5 10:15:19 2015 (r287481) @@ -118,7 +118,7 @@ struct tcp_syncache { u_int bucket_limit; u_int cache_limit; u_int rexmt_limit; - u_int hash_secret; + uint32_t hash_secret; struct vnet *vnet; struct syncookie_secret secret; }; From owner-svn-src-all@freebsd.org Sat Sep 5 10:29:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B47F9CB33C; Sat, 5 Sep 2015 10:29:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6C3BD84; Sat, 5 Sep 2015 10:29:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85ATmC1090613; Sat, 5 Sep 2015 10:29:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85ATmH8090612; Sat, 5 Sep 2015 10:29:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509051029.t85ATmH8090612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 5 Sep 2015 10:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287482 - head/share/man/man4 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, 05 Sep 2015 10:29:48 -0000 Author: bapt Date: Sat Sep 5 10:29:47 2015 New Revision: 287482 URL: https://svnweb.freebsd.org/changeset/base/287482 Log: Cross reference sesutil(8) and ses(4) Submitted by: trasz MFC after: 1 month (with r287473) Modified: head/share/man/man4/ses.4 Modified: head/share/man/man4/ses.4 ============================================================================== --- head/share/man/man4/ses.4 Sat Sep 5 10:15:19 2015 (r287481) +++ head/share/man/man4/ses.4 Sat Sep 5 10:29:47 2015 (r287482) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2000 +.Dd September 05, 2015 .Dt SES 4 .Os .Sh NAME @@ -123,6 +123,8 @@ When the kernel is configured with .Tn DEBUG enabled, the first open to an SES device will spit out overall enclosure parameters to the console. +.Sh SEE ALSO +.Xr sesutil 8 .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Sat Sep 5 12:28:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E9789C9E53; Sat, 5 Sep 2015 12:28:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5047F1328; Sat, 5 Sep 2015 12:28:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85CSJa3039923; Sat, 5 Sep 2015 12:28:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85CSJPx039922; Sat, 5 Sep 2015 12:28:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509051228.t85CSJPx039922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Sep 2015 12:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287483 - head/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: Sat, 05 Sep 2015 12:28:19 -0000 Author: kib Date: Sat Sep 5 12:28:18 2015 New Revision: 287483 URL: https://svnweb.freebsd.org/changeset/base/287483 Log: Do not consume extra reference. This is a bug in r287479. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Sep 5 10:29:47 2015 (r287482) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Sep 5 12:28:18 2015 (r287483) @@ -13325,8 +13325,7 @@ softdep_ast_cleanup_proc(void) if (softdep_excess_items(ump, D_NEWBLK) || softdep_excess_items(ump, D_ALLOCDIRECT) || softdep_excess_items(ump, D_ALLOCINDIR)) { - error = vn_start_write(NULL, &mp, V_MNTREF | - V_WAIT); + error = vn_start_write(NULL, &mp, V_WAIT); if (error == 0) { req = true; VFS_SYNC(mp, MNT_WAIT); From owner-svn-src-all@freebsd.org Sat Sep 5 14:04:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A0A9CA9E4; Sat, 5 Sep 2015 14:04:51 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay111.isp.belgacom.be (mailrelay111.isp.belgacom.be [195.238.20.138]) by mx1.freebsd.org (Postfix) with ESMTP id BBEE9B9; Sat, 5 Sep 2015 14:04:50 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=z2WTV4mAI6UWamCjDJCdLIA+c/M+fkeu8SyhGDYh7nk= c=1 sm=2 a=6I5d2MoRAAAA:8 a=pL__uFuU6VXqykJWFi8A:9 a=CjuIK1q_8ugA:10 a=pEm6xrANGHqmbCiX:21 a=KcrZtCmqaCGjBTt7:21 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CaBgDr9epV/4OL8VFdgyNUWg+/cYV5AoEkPRABAQEBAQEBgQqEJAEBBDocIxALFAQJJQ8qHgYTiDIBCMoBAQEBAQEBAQMBAQEBAQEBFwSLboQ0DxYzB4QsAQSVVYUKh21UmiYmghAcFoFAPDOIA4FHAQEB Received: from 131.139-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.139.131]) by relay.skynet.be with ESMTP; 05 Sep 2015 16:04:28 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id t85E4Ptg002203; Sat, 5 Sep 2015 16:04:26 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 5 Sep 2015 16:04:25 +0200 From: Tijl Coosemans To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287442 - in head: lib/libprocstat lib/libutil share/man/man5 sys/kern sys/sys Message-ID: <20150905160425.2b7c4088@kalimero.tijl.coosemans.org> In-Reply-To: <201509032032.t83KWAtl043698@repo.freebsd.org> References: <201509032032.t83KWAtl043698@repo.freebsd.org> 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: Sat, 05 Sep 2015 14:04:52 -0000 On Thu, 3 Sep 2015 20:32:10 +0000 (UTC) "Conrad E. Meyer" wrote: > Author: cem > Date: Thu Sep 3 20:32:10 2015 > New Revision: 287442 > URL: https://svnweb.freebsd.org/changeset/base/287442 > > Log: > Detect badly behaved coredump note helpers > > Coredump notes depend on being able to invoke dump routines twice; once > in a dry-run mode to get the size of the note, and another to actually > emit the note to the corefile. > > When a note helper emits a different length section the second time > around than the length it requested the first time, the kernel produces > a corrupt coredump. > > NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to > the length of filenames corresponding to vnodes in the process' fd table > via vn_fullpath. As vnodes may move around during dump, this is racy. > > So: > > - Detect badly behaved notes in putnote() and pad underfilled notes. > > - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to > exercise the NT_PROCSTAT_FILES corruption. It simply picks random > lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). > > - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to > disable kinfo packing for PROCSTAT_FILES notes. This should avoid > both FILES note corruption and truncation, even if filenames change, > at the cost of about 1 kiB in padding bloat per open fd. Document > the new sysctl in core.5. > > - Fix note_procstat_files to self-limit in the 2nd pass. Since > sometimes this will result in a short write, pad up to our advertised > size. This addresses note corruption, at the risk of sometimes > truncating the last several fd info entries. > > - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the > zero padding. > > With suggestions from: bjk, jhb, kib, wblock > Approved by: markj (mentor) > Relnotes: yes > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D3548 > > Modified: > head/lib/libprocstat/libprocstat.c > head/lib/libutil/kinfo_getfile.c > head/share/man/man5/core.5 > head/sys/kern/imgact_elf.c > head/sys/kern/kern_descrip.c > head/sys/kern/vfs_vnops.c > head/sys/sys/user.h > > Modified: head/sys/kern/imgact_elf.c > ============================================================================== > --- head/sys/kern/imgact_elf.c Thu Sep 3 19:42:56 2015 (r287441) > +++ head/sys/kern/imgact_elf.c Thu Sep 3 20:32:10 2015 (r287442) > @@ -1875,29 +1902,56 @@ __elfN(note_procstat_proc)(void *arg, st > CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); > #endif > > +static int pack_fileinfo = 1; > +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_fileinfo, CTLFLAG_RWTUN, > + &pack_fileinfo, 0, > + "Enable file path packing in 'procstat -f' coredump notes"); This file can be compiled twice (included by both imgact_elf32.c and imgact_elf64.c) so this sysctl can be added twice and the second time results in an error message in dmesg: "can't re-use a leaf". From owner-svn-src-all@freebsd.org Sat Sep 5 14:14:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01F819CAE35; Sat, 5 Sep 2015 14:14:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E5EBA842; Sat, 5 Sep 2015 14:14:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85EE4vB084923; Sat, 5 Sep 2015 14:14:04 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85EE3Qu084919; Sat, 5 Sep 2015 14:14:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201509051414.t85EE3Qu084919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 5 Sep 2015 14:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287484 - in head/sys: 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: Sat, 05 Sep 2015 14:14:05 -0000 Author: melifaro Date: Sat Sep 5 14:14:03 2015 New Revision: 287484 URL: https://svnweb.freebsd.org/changeset/base/287484 Log: Do not pass lle to nd6_ns_output(). Use newly-added nd6_llinfo_get_holdsrc() to extract desired IPv6 source from holdchain and pass it to the nd6_ns_output(). Modified: head/sys/netinet/toecore.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Sat Sep 5 12:28:18 2015 (r287483) +++ head/sys/netinet/toecore.c Sat Sep 5 14:14:03 2015 (r287484) @@ -482,7 +482,7 @@ restart: (long)ND_IFINFO(ifp)->retrans * hz / 1000); LLE_WUNLOCK(lle); - nd6_ns_output(ifp, NULL, &sin6->sin6_addr, NULL, 0); + nd6_ns_output(ifp, NULL, NULL, &sin6->sin6_addr, 0); return (EWOULDBLOCK); } else { Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sat Sep 5 12:28:18 2015 (r287483) +++ head/sys/netinet6/nd6.c Sat Sep 5 14:14:03 2015 (r287484) @@ -510,6 +510,34 @@ nd6_llinfo_settimer_locked(struct llentr LLE_REMREF(ln); } +/* +* Gets source address of the first packet in hold queue +* and stores it in @src. +* Returns pointer to @src (if hold queue is not empty) or NULL. +* +*/ +static struct in6_addr * +nd6_llinfo_get_holdsrc(struct llentry *ln, struct in6_addr *src) +{ + struct ip6_hdr hdr; + struct mbuf *m; + + if (ln->la_hold == NULL) + return (NULL); + + /* + * assume every packet in la_hold has the same IP header + */ + m = ln->la_hold; + if (sizeof(hdr) < m->m_len) + return (NULL); + + m_copydata(m, 0, sizeof(hdr), (caddr_t)&hdr); + *src = hdr.ip6_src; + + return (src); +} + void nd6_llinfo_settimer(struct llentry *ln, long tick) { @@ -523,9 +551,10 @@ static void nd6_llinfo_timer(void *arg) { struct llentry *ln; - struct in6_addr *dst; + struct in6_addr *dst, *pdst, *psrc, src; struct ifnet *ifp; struct nd_ifinfo *ndi = NULL; + int send_ns; KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; @@ -552,6 +581,10 @@ nd6_llinfo_timer(void *arg) } ifp = ln->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); + ndi = ND_IFINFO(ifp); + send_ns = 0; + dst = &ln->r_l3addr.addr6; + pdst = dst; if (ln->ln_ntick > 0) { if (ln->ln_ntick > INT_MAX) { @@ -564,8 +597,6 @@ nd6_llinfo_timer(void *arg) goto done; } - ndi = ND_IFINFO(ifp); - dst = &ln->r_l3addr.addr6; if (ln->la_flags & LLE_STATIC) { goto done; } @@ -580,10 +611,9 @@ nd6_llinfo_timer(void *arg) case ND6_LLINFO_INCOMPLETE: if (ln->la_asked < V_nd6_mmaxtries) { ln->la_asked++; - nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); - LLE_WUNLOCK(ln); - nd6_ns_output(ifp, NULL, dst, ln, NULL); - LLE_WLOCK(ln); + send_ns = 1; + /* Send NS to multicast address */ + pdst = NULL; } else { struct mbuf *m = ln->la_hold; if (m) { @@ -627,10 +657,7 @@ nd6_llinfo_timer(void *arg) /* We need NUD */ ln->la_asked = 1; ln->ln_state = ND6_LLINFO_PROBE; - nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); - LLE_WUNLOCK(ln); - nd6_ns_output(ifp, dst, dst, ln, NULL); - LLE_WLOCK(ln); + send_ns = 1; } else { ln->ln_state = ND6_LLINFO_STALE; /* XXX */ nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); @@ -639,10 +666,7 @@ nd6_llinfo_timer(void *arg) case ND6_LLINFO_PROBE: if (ln->la_asked < V_nd6_umaxtries) { ln->la_asked++; - nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); - LLE_WUNLOCK(ln); - nd6_ns_output(ifp, dst, dst, ln, NULL); - LLE_WLOCK(ln); + send_ns = 1; } else { EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); (void)nd6_free(ln, 0); @@ -654,6 +678,14 @@ nd6_llinfo_timer(void *arg) __func__, ln->ln_state); } done: + if (send_ns != 0) { + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + psrc = nd6_llinfo_get_holdsrc(ln, &src); + LLE_FREE_LOCKED(ln); + ln = NULL; + nd6_ns_output(ifp, psrc, pdst, dst, NULL); + } + if (ln != NULL) LLE_FREE_LOCKED(ln); CURVNET_RESTORE(); @@ -2170,12 +2202,14 @@ nd6_output_lle(struct ifnet *ifp, struct * INCOMPLETE state, send the first solicitation. */ if (!ND6_LLINFO_PERMANENT(lle) && lle->la_asked == 0) { + struct in6_addr src, *psrc; lle->la_asked++; nd6_llinfo_settimer_locked(lle, (long)ND_IFINFO(ifp)->retrans * hz / 1000); + psrc = nd6_llinfo_get_holdsrc(lle, &src); LLE_WUNLOCK(lle); - nd6_ns_output(ifp, NULL, &dst->sin6_addr, lle, NULL); + nd6_ns_output(ifp, psrc, NULL, &dst->sin6_addr, NULL); } else { /* We did the lookup so we need to do the unlock here. */ LLE_WUNLOCK(lle); Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Sat Sep 5 12:28:18 2015 (r287483) +++ head/sys/netinet6/nd6.h Sat Sep 5 14:14:03 2015 (r287484) @@ -437,7 +437,7 @@ void nd6_na_output(struct ifnet *, const const struct in6_addr *, u_long, int, struct sockaddr *); void nd6_ns_input(struct mbuf *, int, int); void nd6_ns_output(struct ifnet *, const struct in6_addr *, - const struct in6_addr *, struct llentry *, uint8_t *); + const struct in6_addr *, const struct in6_addr *, uint8_t *); caddr_t nd6_ifptomac(struct ifnet *); void nd6_dad_init(void); void nd6_dad_start(struct ifaddr *, int); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sat Sep 5 12:28:18 2015 (r287483) +++ head/sys/netinet6/nd6_nbr.c Sat Sep 5 14:14:03 2015 (r287484) @@ -95,7 +95,7 @@ static void nd6_dad_na_input(struct ifad static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_long, int, struct sockaddr *, u_int); static void nd6_ns_output_fib(struct ifnet *, const struct in6_addr *, - const struct in6_addr *, struct llentry *, uint8_t *, u_int); + const struct in6_addr *, const struct in6_addr *, uint8_t *, u_int); static VNET_DEFINE(int, dad_enhanced) = 1; #define V_dad_enhanced VNET(dad_enhanced) @@ -396,9 +396,9 @@ nd6_ns_input(struct mbuf *m, int off, in * the value (length is ND_OPT_NONCE_LEN) is used as a random nonce. */ static void -nd6_ns_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6, - const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce, - u_int fibnum) +nd6_ns_output_fib(struct ifnet *ifp, const struct in6_addr *saddr6, + const struct in6_addr *daddr6, const struct in6_addr *taddr6, + uint8_t *nonce, u_int fibnum) { struct mbuf *m; struct m_tag *mtag; @@ -462,7 +462,7 @@ nd6_ns_output_fib(struct ifnet *ifp, con goto bad; } if (nonce == NULL) { - struct ifaddr *ifa; + struct ifaddr *ifa = NULL; /* * RFC2461 7.2.2: @@ -474,35 +474,15 @@ nd6_ns_output_fib(struct ifnet *ifp, con * interface should be used." * * We use the source address for the prompting packet - * (saddr6), if: - * - saddr6 is given from the caller (by giving "ln"), and - * - saddr6 belongs to the outgoing interface. + * (saddr6), if saddr6 belongs to the outgoing interface. * Otherwise, we perform the source address selection as usual. */ - struct in6_addr *hsrc; - hsrc = NULL; - if (ln != NULL) { - LLE_RLOCK(ln); - if (ln->la_hold != NULL) { - struct ip6_hdr *hip6; /* hold ip6 */ - - /* - * assuming every packet in la_hold has the same IP - * header - */ - hip6 = mtod(ln->la_hold, struct ip6_hdr *); - /* XXX pullup? */ - if (sizeof(*hip6) < ln->la_hold->m_len) { - ip6->ip6_src = hip6->ip6_src; - hsrc = &hip6->ip6_src; - } - } - LLE_RUNLOCK(ln); - } - if (hsrc && (ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, - hsrc)) != NULL) { + if (saddr6 != NULL) + ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, saddr6); + if (ifa != NULL) { /* ip6_src set already. */ + ip6->ip6_src = *saddr6; ifa_free(ifa); } else { int error; @@ -626,11 +606,11 @@ nd6_ns_output_fib(struct ifnet *ifp, con #ifndef BURN_BRIDGES void -nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, - const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce) +nd6_ns_output(struct ifnet *ifp, const struct in6_addr *saddr6, + const struct in6_addr *daddr6, const struct in6_addr *taddr6,uint8_t *nonce) { - nd6_ns_output_fib(ifp, daddr6, taddr6, ln, nonce, RT_DEFAULT_FIB); + nd6_ns_output_fib(ifp, saddr6, daddr6, taddr6, nonce, RT_DEFAULT_FIB); } #endif /* @@ -1581,7 +1561,7 @@ nd6_dad_ns_output(struct dadq *dp, struc * should work well in almost all cases. */ } - nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, + nd6_ns_output(ifp, NULL, NULL, &ia->ia_addr.sin6_addr, (uint8_t *)&dp->dad_nonce[0]); } From owner-svn-src-all@freebsd.org Sat Sep 5 14:56:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F7D9CA59E; Sat, 5 Sep 2015 14:56:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f180.google.com (mail-yk0-f180.google.com [209.85.160.180]) (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 D0E1D323; Sat, 5 Sep 2015 14:56:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykek143 with SMTP id k143so46127068yke.2; Sat, 05 Sep 2015 07:56:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=3Ct1UuKnNaAVhQKJEJ+F9afP225AANyqSpwAI7G8T1Y=; b=HKfI+y1rOzLySNppQVseIgOQUdDKcXmz4ekuMeWU5B4uO7Cnk5qnBZDutMfs0VoA+K 6eyRehanEPHgzX2Hk6GVxEcMfGuYssog20cvubcrIwVR55IuQniYuUlzYm9N0o7GR8O1 9btEQW4+3Fr+CxHUq5qKf6ynfd7mhIgVDQIq93xw+8gkq4SJIpjWgX0kk/kgkF4+EBeu 5ZDV9CZltlwHuFdZLe2qFVfcow6Vv/XJZX+igV1ZFwu0LT7F/Ka11QuJ7Q2F4caRtTI1 8Dwvq3BaEiPqxtGiTgi7Jfjk3FkXA/uLv6vXD4kW2xELNNZzB40l0mhVtl0k35OUqI4A RTCw== X-Received: by 10.170.169.66 with SMTP id l63mr10382670ykd.60.1441464614091; Sat, 05 Sep 2015 07:50:14 -0700 (PDT) Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com. [209.85.160.177]) by smtp.gmail.com with ESMTPSA id g197sm5613986ywe.4.2015.09.05.07.50.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Sep 2015 07:50:13 -0700 (PDT) Received: by ykek143 with SMTP id k143so46051418yke.2; Sat, 05 Sep 2015 07:50:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.56.2 with SMTP id 2mr10580419yky.106.1441464613658; Sat, 05 Sep 2015 07:50:13 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.48.134 with HTTP; Sat, 5 Sep 2015 07:50:13 -0700 (PDT) In-Reply-To: <20150905160425.2b7c4088@kalimero.tijl.coosemans.org> References: <201509032032.t83KWAtl043698@repo.freebsd.org> <20150905160425.2b7c4088@kalimero.tijl.coosemans.org> Date: Sat, 5 Sep 2015 07:50:13 -0700 Message-ID: Subject: Re: svn commit: r287442 - in head: lib/libprocstat lib/libutil share/man/man5 sys/kern sys/sys From: Conrad Meyer 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: Sat, 05 Sep 2015 14:56:17 -0000 I'll be offline for the next ~48 hours. It sounds like it's annoying but not critical to fix. If it isn't fixed when I get back, I'll figure something out. Thanks, Conrad P.S., What systems have both imgact_elf64 and 32? On Sat, Sep 5, 2015 at 7:04 AM, Tijl Coosemans wrote: > On Thu, 3 Sep 2015 20:32:10 +0000 (UTC) "Conrad E. Meyer" wrote: >> Author: cem >> Date: Thu Sep 3 20:32:10 2015 >> New Revision: 287442 >> URL: https://svnweb.freebsd.org/changeset/base/287442 >> >> Log: >> Detect badly behaved coredump note helpers >> >> Coredump notes depend on being able to invoke dump routines twice; once >> in a dry-run mode to get the size of the note, and another to actually >> emit the note to the corefile. >> >> When a note helper emits a different length section the second time >> around than the length it requested the first time, the kernel produces >> a corrupt coredump. >> >> NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to >> the length of filenames corresponding to vnodes in the process' fd table >> via vn_fullpath. As vnodes may move around during dump, this is racy. >> >> So: >> >> - Detect badly behaved notes in putnote() and pad underfilled notes. >> >> - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to >> exercise the NT_PROCSTAT_FILES corruption. It simply picks random >> lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). >> >> - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to >> disable kinfo packing for PROCSTAT_FILES notes. This should avoid >> both FILES note corruption and truncation, even if filenames change, >> at the cost of about 1 kiB in padding bloat per open fd. Document >> the new sysctl in core.5. >> >> - Fix note_procstat_files to self-limit in the 2nd pass. Since >> sometimes this will result in a short write, pad up to our advertised >> size. This addresses note corruption, at the risk of sometimes >> truncating the last several fd info entries. >> >> - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the >> zero padding. >> >> With suggestions from: bjk, jhb, kib, wblock >> Approved by: markj (mentor) >> Relnotes: yes >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision: https://reviews.freebsd.org/D3548 >> >> Modified: >> head/lib/libprocstat/libprocstat.c >> head/lib/libutil/kinfo_getfile.c >> head/share/man/man5/core.5 >> head/sys/kern/imgact_elf.c >> head/sys/kern/kern_descrip.c >> head/sys/kern/vfs_vnops.c >> head/sys/sys/user.h >> >> Modified: head/sys/kern/imgact_elf.c >> ============================================================================== >> --- head/sys/kern/imgact_elf.c Thu Sep 3 19:42:56 2015 (r287441) >> +++ head/sys/kern/imgact_elf.c Thu Sep 3 20:32:10 2015 (r287442) >> @@ -1875,29 +1902,56 @@ __elfN(note_procstat_proc)(void *arg, st >> CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); >> #endif >> >> +static int pack_fileinfo = 1; >> +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_fileinfo, CTLFLAG_RWTUN, >> + &pack_fileinfo, 0, >> + "Enable file path packing in 'procstat -f' coredump notes"); > > This file can be compiled twice (included by both imgact_elf32.c and > imgact_elf64.c) so this sysctl can be added twice and the second time > results in an error message in dmesg: "can't re-use a leaf". From owner-svn-src-all@freebsd.org Sat Sep 5 15:42:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10C579CBA47; Sat, 5 Sep 2015 15:42:03 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay113.isp.belgacom.be (mailrelay113.isp.belgacom.be [195.238.20.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2387818FA; Sat, 5 Sep 2015 15:42:01 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=r3/LV5qEOeRNqOlObU3fPeZ+G8vFrxRTI9UozocECbw= c=1 sm=2 a=6I5d2MoRAAAA:8 a=FupvLkObQos7m2l_w0QA:9 a=CjuIK1q_8ugA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CWBgBzDOtV/4OL8VFegyNUWg+9eoF3hXkCgSQ6EwEBAQEBAQGBCoQkAQEEOhwjEAsOBgQJJQ8qHgYTiDIBCMlXAQEBAQEBAQEBAQEBAQEBAQEXBItuhQwHhCwBBI0BiFSFCodtVJomJoQCPDOJSgEBAQ Received: from 131.139-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.139.131]) by relay.skynet.be with ESMTP; 05 Sep 2015 17:40:53 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id t85Feplr002753; Sat, 5 Sep 2015 17:40:51 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 5 Sep 2015 17:40:51 +0200 From: Tijl Coosemans To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287467 - head/sys/dev/e1000 Message-ID: <20150905174051.674d889f@kalimero.tijl.coosemans.org> In-Reply-To: <201509041630.t84GUnT8039376@repo.freebsd.org> References: <201509041630.t84GUnT8039376@repo.freebsd.org> 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: Sat, 05 Sep 2015 15:42:03 -0000 On Fri, 4 Sep 2015 16:30:49 +0000 (UTC) Sean Bruno wrote: > Author: sbruno > Date: Fri Sep 4 16:30:48 2015 > New Revision: 287467 > URL: https://svnweb.freebsd.org/changeset/base/287467 > > Log: > e1000: Shared code updates > - Fix compiler warning in 80003es2lan.c > - Add return value handler for e1000_*_kmrn_reg_80003es2lan > - Fix usage of DEBUGOUT > - Remove unnecessary variable initializations. > - Removed unused variables (complaints from gcc). > - Edit defines in 82571.h. > - Add workaround for igb hw errata. > - Shared code changes for Skylake/I219 support. > - Remove unused OBFF and LTR functions. > > Differential Revision: https://reviews.freebsd.org/D3162 > Submitted by: erj > MFC after: 1 month > Sponsored by: Intel Corporation > > Modified: > head/sys/dev/e1000/e1000_80003es2lan.c > head/sys/dev/e1000/e1000_82540.c > head/sys/dev/e1000/e1000_82541.c > head/sys/dev/e1000/e1000_82542.c > head/sys/dev/e1000/e1000_82543.c > head/sys/dev/e1000/e1000_82571.h > head/sys/dev/e1000/e1000_82575.c > head/sys/dev/e1000/e1000_82575.h > head/sys/dev/e1000/e1000_api.c > head/sys/dev/e1000/e1000_api.h > head/sys/dev/e1000/e1000_defines.h > head/sys/dev/e1000/e1000_hw.h > head/sys/dev/e1000/e1000_i210.c > head/sys/dev/e1000/e1000_i210.h > head/sys/dev/e1000/e1000_ich8lan.c > head/sys/dev/e1000/e1000_ich8lan.h > head/sys/dev/e1000/e1000_mac.c > head/sys/dev/e1000/e1000_mac.h > head/sys/dev/e1000/e1000_nvm.c > head/sys/dev/e1000/e1000_nvm.h > head/sys/dev/e1000/e1000_osdep.h > head/sys/dev/e1000/e1000_phy.c > head/sys/dev/e1000/e1000_regs.h > head/sys/dev/e1000/if_igb.c I have an em device that fails to attach after this commit: em0@pci0:0:25:0: class=0x020000 card=0x00018086 chip=0x294c8086 rev=0x02 hdr=0x00 vendor = 'Intel Corporation' device = '82566DC-2 Gigabit Network Connection' class = network subclass = ethernet em0: port 0x3400-0x341f mem 0x92200000-0x9221ffff,0x92224000-0x92224fff irq 20 at device 25.0 on pci0 em0: Using an MSI interrupt At this point the machine waits for about half a minute and then continues with this: em0: The EEPROM Checksum Is Not Valid device_attach: em0 attach returned 5 From owner-svn-src-all@freebsd.org Sat Sep 5 15:49:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C29BC9CBCD6; Sat, 5 Sep 2015 15:49:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e: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 9127D1ADA; Sat, 5 Sep 2015 15:49:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pacex6 with SMTP id ex6so52612800pac.0; Sat, 05 Sep 2015 08:49:58 -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 :content-transfer-encoding:message-id:references:to; bh=Ny5KlzcgcnJr5ElK1egMkjVc0KgcMLDE/YiAEnKq2X0=; b=TBtKbdV+WsZc/eF5PzLZIH9Y1VP+jTCEgUXB8Fibkiz0QkKvQXk3+s4LdVI51UGxXc sRZ6i/DI3AsineUS5V8DG+3h9aBn07rhYlEontSyHcj1N1MOyJNRflNTTcygjOUYz55R Y2jVw9vL9s2ZzN7/ChbI7snh8ZkK86/240xL326dHv7rBE5N4fImYofjcYNCrG3ZJpqT oTZt0U3OZXWdBO+4KQJ2D2lh8kiPBHb2a0VjflAf2yLlJELla92/jiYmafeakXzJZZIC K3dk1PJEwmCEuMWOiLvthEUIPCNAaIrtZ6xirLfvvTyYw8yID5o8M9XLo9jJ1Hni5Fhd IX/w== X-Received: by 10.68.231.5 with SMTP id tc5mr22514221pbc.54.1441468198607; Sat, 05 Sep 2015 08:49:58 -0700 (PDT) Received: from [192.168.20.10] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id q1sm6224416pdr.46.2015.09.05.08.49.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Sep 2015 08:49:57 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r287442 - in head: lib/libprocstat lib/libutil share/man/man5 sys/kern sys/sys From: Garrett Cooper X-Mailer: iPhone Mail (12H321) In-Reply-To: Date: Sat, 5 Sep 2015 08:49:57 -0700 Cc: Tijl Coosemans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <1F244AA4-B8AC-46DD-B38D-D9F9C584110E@gmail.com> References: <201509032032.t83KWAtl043698@repo.freebsd.org> <20150905160425.2b7c4088@kalimero.tijl.coosemans.org> To: "cem@FreeBSD.org" 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, 05 Sep 2015 15:49:59 -0000 > On Sep 5, 2015, at 07:50, Conrad Meyer wrote: > > I'll be offline for the next ~48 hours. It sounds like it's annoying > but not critical to fix. If it isn't fixed when I get back, I'll > figure something out. > > Thanks, > Conrad > > P.S., What systems have both imgact_elf64 and 32? Anything with COMPAT32 on (amd64, powerpc64, etc). Cheers, -NGie From owner-svn-src-all@freebsd.org Sat Sep 5 16:59:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B5A59CBCAA; Sat, 5 Sep 2015 16:59:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5B2D21E67; Sat, 5 Sep 2015 16:59:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85GxVe7052015; Sat, 5 Sep 2015 16:59:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85GxV3g052014; Sat, 5 Sep 2015 16:59:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509051659.t85GxV3g052014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 5 Sep 2015 16:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287485 - head/usr.sbin/sesutil 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, 05 Sep 2015 16:59:31 -0000 Author: bapt Date: Sat Sep 5 16:59:30 2015 New Revision: 287485 URL: https://svnweb.freebsd.org/changeset/base/287485 Log: Fix build with gcc 4.2 Reported by: kib Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Sat Sep 5 14:14:03 2015 (r287484) +++ head/usr.sbin/sesutil/sesutil.c Sat Sep 5 16:59:30 2015 (r287485) @@ -104,7 +104,7 @@ locate(int argc, char **argv) size_t len, i; int fd, nobj, j; bool all = false; - bool locate; + bool onoff; if (argc != 2) { errx(EXIT_FAILURE, "usage: %s locate [disk] [on|off]", @@ -114,9 +114,9 @@ locate(int argc, char **argv) disk = argv[0]; if (strcmp(argv[1], "on") == 0) { - locate = true; + onoff = true; } else if (strcmp(argv[1], "off") == 0) { - locate = false; + onoff = false; } else { errx(EXIT_FAILURE, "usage: %s locate [disk] [on|off]", getprogname()); @@ -165,11 +165,11 @@ locate(int argc, char **argv) continue; if (objdn.elm_names_len > 0) { if (all) { - do_locate(fd, objdn.elm_idx, locate); + do_locate(fd, objdn.elm_idx, onoff); continue; } if (disk_match(objdn.elm_devnames, disk, len)) { - do_locate(fd, objdn.elm_idx, locate); + do_locate(fd, objdn.elm_idx, onoff); break; } } From owner-svn-src-all@freebsd.org Sat Sep 5 17:02:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 139BB9CBEB2; Sat, 5 Sep 2015 17:02:05 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.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 F336129B; Sat, 5 Sep 2015 17:02:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85H24DV055824; Sat, 5 Sep 2015 17:02:04 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85H21JL055809; Sat, 5 Sep 2015 17:02:01 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201509051702.t85H21JL055809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 5 Sep 2015 17:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287486 - head/usr.bin/procstat 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, 05 Sep 2015 17:02:05 -0000 Author: allanjude Date: Sat Sep 5 17:02:01 2015 New Revision: 287486 URL: https://svnweb.freebsd.org/changeset/base/287486 Log: Introduce libxo to procstat(1) Reviewed by: rodrigc, bapt Approved by: marcel (mentor) Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2446 Modified: head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_auxv.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_bin.c head/usr.bin/procstat/procstat_cred.c head/usr.bin/procstat/procstat_cs.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_rlimit.c head/usr.bin/procstat/procstat_rusage.c head/usr.bin/procstat/procstat_sigs.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/Makefile Sat Sep 5 17:02:01 2015 (r287486) @@ -17,6 +17,6 @@ SRCS= procstat.c \ procstat_threads.c \ procstat_vm.c -LIBADD+= util procstat +LIBADD+= procstat xo util sbuf .include Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat.1 Sat Sep 5 17:02:01 2015 (r287486) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2015 +.Dd September 5, 2015 .Dt PROCSTAT 1 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nd get detailed process information .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl CHhn .Op Fl w Ar interval .Op Fl b | c | e | f | i | j | k | l | r | s | S | t | v | x @@ -52,6 +53,13 @@ By default, basic process statistics are options may be specified in order to select more detailed process information for printing: .Bl -tag -width indent +.It Fl -libxo +Generate output via +.Xr libxo 3 +in a selection of different human and machine readable formats. +See +.Xr xo_parse_args 3 +for details on command line arguments. .It Fl b Display binary information for the process. .It Fl c @@ -531,16 +539,19 @@ auxiliary vector value .Xr cap_enter 2 , .Xr cap_rights_limit 2 , .Xr libprocstat 3 , +.Xr libxo 3 , +.Xr xo_parse_args 3 , .Xr ddb 4 , .Xr stack 9 .Sh AUTHORS -.An Robert N M Watson +.An Robert N M Watson Aq Mt rwatson@FreeBSD.org . +.br +.Xr libxo 3 +support was added by +.An -nosplit +Allan Jude +.Aq Mt allanjude@FreeBSD.org . .Sh BUGS -Some field values may include spaces, which limits the extent to which the -output of -.Nm -may be mechanically parsed. -.Pp The display of open file or memory mapping pathnames is implemented using the kernel's name cache. If a file system does not use the name cache, or the path to a file is not in Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007, 2011 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,17 +48,24 @@ static void usage(void) { - fprintf(stderr, "usage: procstat [-CHhn] [-M core] [-N system] " - "[-w interval] \n"); - fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -r | -s | -S | -t | -v | -x]\n"); - fprintf(stderr, " [-a | pid | core ...]\n"); + xo_error("usage: procstat [-CHhn] [-M core] [-N system] " + "[-w interval]\n" + " [-b | -c | -e | -f | -i | -j | -k | " + "-l | -r | -s | -S | -t | -v | -x]\n" + " [-a | pid | core ...]\n"); + xo_finish(); exit(EX_USAGE); } static void procstat(struct procstat *prstat, struct kinfo_proc *kipp) { + char *pidstr = NULL; + + asprintf(&pidstr, "%d", kipp->ki_pid); + if (pidstr == NULL) + xo_errc(1, ENOMEM, "Failed to allocate memory in procstat()"); + xo_open_container(pidstr); if (bflag) procstat_bin(prstat, kipp); @@ -89,6 +97,9 @@ procstat(struct procstat *prstat, struct procstat_cs(prstat, kipp); else procstat_basic(kipp); + + xo_close_container(pidstr); + free(pidstr); } /* @@ -126,10 +137,14 @@ main(int argc, char *argv[]) pid_t pid; char *dummy; char *nlistf, *memf; + const char *xocontainer; int cnt; interval = 0; memf = nlistf = NULL; + argc = xo_parse_args(argc, argv); + xocontainer = "basic"; + while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrsStvw:x")) != -1) { switch (ch) { case 'C': @@ -148,6 +163,7 @@ main(int argc, char *argv[]) break; case 'S': Sflag++; + xocontainer = "cs"; break; case 'a': aflag++; @@ -155,34 +171,42 @@ main(int argc, char *argv[]) case 'b': bflag++; + xocontainer = "binary"; break; case 'c': cflag++; + xocontainer = "arguments"; break; case 'e': eflag++; + xocontainer = "environment"; break; case 'f': fflag++; + xocontainer = "files"; break; case 'i': iflag++; + xocontainer = "signals"; break; case 'j': jflag++; + xocontainer = "thread_signals"; break; case 'k': kflag++; + xocontainer = "kstack"; break; case 'l': lflag++; + xocontainer = "rlimit"; break; case 'n': @@ -195,18 +219,22 @@ main(int argc, char *argv[]) case 'r': rflag++; + xocontainer = "rusage"; break; case 's': sflag++; + xocontainer = "credentials"; break; case 't': tflag++; + xocontainer = "threads"; break; case 'v': vflag++; + xocontainer = "vm"; break; case 'w': @@ -220,6 +248,7 @@ main(int argc, char *argv[]) case 'x': xflag++; + xocontainer = "auxv"; break; case '?': @@ -254,18 +283,23 @@ main(int argc, char *argv[]) else prstat = procstat_open_sysctl(); if (prstat == NULL) - errx(1, "procstat_open()"); + xo_errx(1, "procstat_open()"); do { + xo_set_version(PROCSTAT_XO_VERSION); + xo_open_container("procstat"); + xo_open_container(xocontainer); + if (aflag) { p = procstat_getprocs(prstat, KERN_PROC_PROC, 0, &cnt); if (p == NULL) - errx(1, "procstat_getprocs()"); + xo_errx(1, "procstat_getprocs()"); kinfo_proc_sort(p, cnt); for (i = 0; i < cnt; i++) { procstat(prstat, &p[i]); /* Suppress header after first process. */ hflag = 1; + xo_flush(); } procstat_freeprocs(prstat, p); } @@ -276,9 +310,10 @@ main(int argc, char *argv[]) usage(); pid = l; - p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt); + p = procstat_getprocs(prstat, KERN_PROC_PID, + pid, &cnt); if (p == NULL) - errx(1, "procstat_getprocs()"); + xo_errx(1, "procstat_getprocs()"); if (cnt != 0) procstat(prstat, p); procstat_freeprocs(prstat, p); @@ -291,7 +326,7 @@ main(int argc, char *argv[]) p = procstat_getprocs(cprstat, KERN_PROC_PID, -1, &cnt); if (p == NULL) - errx(1, "procstat_getprocs()"); + xo_errx(1, "procstat_getprocs()"); if (cnt != 0) procstat(cprstat, p); procstat_freeprocs(cprstat, p); @@ -300,9 +335,15 @@ main(int argc, char *argv[]) /* Suppress header after first process. */ hflag = 1; } + + xo_close_container(xocontainer); + xo_close_container("procstat"); + xo_finish(); if (interval) sleep(interval); } while (interval); + procstat_close(prstat); + exit(0); } Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat.h Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,9 +27,13 @@ * $FreeBSD$ */ +#include + #ifndef PROCSTAT_H #define PROCSTAT_H +#define PROCSTAT_XO_VERSION "1" + extern int hflag, nflag, Cflag, Hflag; struct kinfo_proc; Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_args.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,40 +41,56 @@ #include "procstat.h" -static void -do_args(struct procstat *procstat, struct kinfo_proc *kipp, int env) +void +procstat_args(struct procstat *procstat, struct kinfo_proc *kipp) { int i; char **args; if (!hflag) { - printf("%5s %-16s %-53s\n", "PID", "COMM", - env ? "ENVIRONMENT" : "ARGS"); + xo_emit("{T:/%5s %-16s %-53s}\n", "PID", "COMM", "ARGS"); } - args = env ? procstat_getenvv(procstat, kipp, 0) : - procstat_getargv(procstat, kipp, 0); + args = procstat_getargv(procstat, kipp, 0); - printf("%5d %-16s", kipp->ki_pid, kipp->ki_comm); + xo_emit("{k:process_id/%5d/%d} {:command/%-16s/%s}", kipp->ki_pid, + kipp->ki_comm); if (args == NULL) { - printf(" -\n"); + xo_emit(" {d:args/-}\n"); return; } + xo_open_list("arguments"); for (i = 0; args[i] != NULL; i++) - printf(" %s", args[i]); - printf("\n"); -} - -void -procstat_args(struct procstat *procstat, struct kinfo_proc *kipp) -{ - do_args(procstat, kipp, 0); + xo_emit(" {l:args/%s}", args[i]); + xo_close_list("arguments"); + xo_emit("\n"); } void procstat_env(struct procstat *procstat, struct kinfo_proc *kipp) { - do_args(procstat, kipp, 1); + int i; + char **envs; + + if (!hflag) { + xo_emit("{T:/%5s %-16s %-53s}\n", "PID", "COMM", "ENVIRONMENT"); + } + + envs = procstat_getenvv(procstat, kipp, 0); + + xo_emit("{k:process_id/%5d/%d} {:command/%-16s/%s}", kipp->ki_pid, + kipp->ki_comm); + + if (envs == NULL) { + xo_emit(" {d:env/-}\n"); + return; + } + + xo_open_list("environment"); + for (i = 0; envs[i] != NULL; i++) + xo_emit(" {l:env/%s}", envs[i]); + xo_close_list("environment"); + xo_emit("\n"); } Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_auxv.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Mikolaj Golub + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,11 +44,6 @@ #include "procstat.h" -#define PRINT(name, spec, val) \ - printf("%s %-16s " #spec "\n", prefix, #name, (val)) -#define PRINT_UNKNOWN(type, val) \ - printf("%s %16ld %#lx\n", prefix, (long)type, (u_long)(val)) - void procstat_auxv(struct procstat *procstat, struct kinfo_proc *kipp) { @@ -56,12 +52,18 @@ procstat_auxv(struct procstat *procstat, static char prefix[256]; if (!hflag) - printf("%5s %-16s %-16s %-16s\n", "PID", "COMM", "AUXV", "VALUE"); + xo_emit("{T:/%5s %-16s %-16s %-16s}\n", "PID", "COMM", "AUXV", + "VALUE"); + auxv = procstat_getauxv(procstat, kipp, &count); if (auxv == NULL) return; - snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid, + snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid, + kipp->ki_comm); + + xo_emit("{e:process_id/%5d/%d}{e:command/%-16s/%s}", kipp->ki_pid, kipp->ki_comm); + for (i = 0; i < count; i++) { switch(auxv[i].a_type) { case AT_NULL: @@ -69,92 +71,119 @@ procstat_auxv(struct procstat *procstat, case AT_IGNORE: break; case AT_EXECFD: - PRINT(AT_EXECFD, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EXECFD/%ld}\n", + prefix, "AT_EXECFD", (long)auxv[i].a_un.a_val); break; case AT_PHDR: - PRINT(AT_PHDR, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_PHDR/%p}\n", + prefix, "AT_PHDR", auxv[i].a_un.a_ptr); break; case AT_PHENT: - PRINT(AT_PHENT, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_PHENT/%ld}\n", + prefix, "AT_PHENT", (long)auxv[i].a_un.a_val); break; case AT_PHNUM: - PRINT(AT_PHNUM, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_PHNUM/%ld}\n", + prefix, "AT_PHNUM", (long)auxv[i].a_un.a_val); break; case AT_PAGESZ: - PRINT(AT_PAGESZ, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_PAGESZ/%ld}\n", + prefix, "AT_PAGESZ", (long)auxv[i].a_un.a_val); break; case AT_BASE: - PRINT(AT_BASE, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_BASE/%p}\n", + prefix, "AT_BASE", auxv[i].a_un.a_ptr); break; case AT_FLAGS: - PRINT(AT_FLAGS, %#lx, (u_long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_FLAGS/%#lx}\n", + prefix, "AT_FLAGS", (u_long)auxv[i].a_un.a_val); break; case AT_ENTRY: - PRINT(AT_ENTRY, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_ENTRY/%p}\n", + prefix, "AT_ENTRY", auxv[i].a_un.a_ptr); break; #ifdef AT_NOTELF case AT_NOTELF: - PRINT(AT_NOTELF, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_NOTELF/%ld}\n", + prefix, "AT_NOTELF", (long)auxv[i].a_un.a_val); break; #endif #ifdef AT_UID case AT_UID: - PRINT(AT_UID, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_UID/%ld}\n", + prefix, "AT_UID", (long)auxv[i].a_un.a_val); break; #endif #ifdef AT_EUID case AT_EUID: - PRINT(AT_EUID, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EUID/%ld}\n", + prefix, "AT_EUID", (long)auxv[i].a_un.a_val); break; #endif #ifdef AT_GID case AT_GID: - PRINT(AT_GID, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_GID/%ld}\n", + prefix, "AT_GID", (long)auxv[i].a_un.a_val); break; #endif #ifdef AT_EGID case AT_EGID: - PRINT(AT_EGID, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EGID/%ld}\n", + prefix, "AT_EGID", (long)auxv[i].a_un.a_val); break; #endif case AT_EXECPATH: - PRINT(AT_EXECPATH, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EXECPATH/%p}\n", + prefix, "AT_EXECPATH", auxv[i].a_un.a_ptr); break; case AT_CANARY: - PRINT(AT_CANARY, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_CANARY/%p}\n", + prefix, "AT_CANARY", auxv[i].a_un.a_ptr); break; case AT_CANARYLEN: - PRINT(AT_CANARYLEN, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_CANARYLEN/%ld}\n", + prefix, "AT_CANARYLEN", (long)auxv[i].a_un.a_val); break; case AT_OSRELDATE: - PRINT(AT_OSRELDATE, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_OSRELDATE/%ld}\n", + prefix, "AT_OSRELDATE", (long)auxv[i].a_un.a_val); break; case AT_NCPUS: - PRINT(AT_NCPUS, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_NCPUS/%ld}\n", + prefix, "AT_NCPUS", (long)auxv[i].a_un.a_val); break; case AT_PAGESIZES: - PRINT(AT_PAGESIZES, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_PAGESIZES/%p}\n", + prefix, "AT_PAGESIZES", auxv[i].a_un.a_ptr); break; case AT_PAGESIZESLEN: - PRINT(AT_PAGESIZESLEN, %ld, (long)auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}" + "{:AT_PAGESIZESLEN/%ld}\n", prefix, + "AT_PAGESIZESLEN", (long)auxv[i].a_un.a_val); break; case AT_STACKPROT: if ((auxv[i].a_un.a_val & VM_PROT_EXECUTE) != 0) - PRINT(AT_STACKPROT, %s, "NONEXECUTABLE"); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}" + "{:AT_STACKPROT/%s}\n", prefix, + "AT_STACKPROT", "NONEXECUTABLE"); else - PRINT(AT_STACKPROT, %s, "EXECUTABLE"); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}" + "{:AT_STACKPROT/%s}\n", prefix, + "AT_STACKPROT", "EXECUTABLE"); break; #ifdef AT_TIMEKEEP case AT_TIMEKEEP: - PRINT(AT_TIMEKEEP, %p, auxv[i].a_un.a_ptr); + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_TIMEKEEP/%p}\n", + prefix, "AT_TIMEKEEP", auxv[i].a_un.a_ptr); break; #endif default: - PRINT_UNKNOWN(auxv[i].a_type, auxv[i].a_un.a_val); + xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", + prefix, auxv[i].a_type, auxv[i].a_un.a_val); break; } } - printf("\n"); + xo_emit("\n"); procstat_freeauxv(procstat, auxv); } Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_basic.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,24 +43,26 @@ procstat_basic(struct kinfo_proc *kipp) { if (!hflag) - printf("%5s %5s %5s %5s %5s %3s %-8s %-9s %-13s %-12s\n", + xo_emit("{T:/%5s %5s %5s %5s %5s %3s %-8s %-9s %-13s %-12s}\n", "PID", "PPID", "PGID", "SID", "TSID", "THR", "LOGIN", "WCHAN", "EMUL", "COMM"); - printf("%5d ", kipp->ki_pid); - printf("%5d ", kipp->ki_ppid); - printf("%5d ", kipp->ki_pgid); - printf("%5d ", kipp->ki_sid); - printf("%5d ", kipp->ki_tsid); - printf("%3d ", kipp->ki_numthreads); - printf("%-8s ", strlen(kipp->ki_login) ? kipp->ki_login : "-"); + xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); + xo_emit("{:parent_process_id/%5d/%d} ", kipp->ki_ppid); + xo_emit("{:process_group_id/%5d/%d} ", kipp->ki_pgid); + xo_emit("{:session_id/%5d/%d} ", kipp->ki_sid); + xo_emit("{:terminal_session_id/%5d/%d} ", kipp->ki_tsid); + xo_emit("{:threads/%3d/%d} ", kipp->ki_numthreads); + xo_emit("{:login/%-8s/%s} ", strlen(kipp->ki_login) ? + kipp->ki_login : "-"); if (kipp->ki_kiflag & KI_LOCKBLOCK) { - printf("*%-8s ", strlen(kipp->ki_lockname) ? + xo_emit("{:lockname/*%-8s/%s} ", strlen(kipp->ki_lockname) ? kipp->ki_lockname : "-"); } else { - printf("%-9s ", strlen(kipp->ki_wmesg) ? + xo_emit("{:wait_channel/%-9s/%s} ", strlen(kipp->ki_wmesg) ? kipp->ki_wmesg : "-"); } - printf("%-13s ", strcmp(kipp->ki_emul, "null") ? kipp->ki_emul : "-"); - printf("%-12s\n", kipp->ki_comm); + xo_emit("{:emulation/%-13s/%s} ", strcmp(kipp->ki_emul, "null") ? + kipp->ki_emul : "-"); + xo_emit("{:command/%-12s/%s}\n", kipp->ki_comm); } Modified: head/usr.bin/procstat/procstat_bin.c ============================================================================== --- head/usr.bin/procstat/procstat_bin.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_bin.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,7 +47,8 @@ procstat_bin(struct procstat *prstat, st static char pathname[PATH_MAX]; if (!hflag) - printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH"); + xo_emit("{T:/%5s %-16s %8s %s}\n", "PID", "COMM", "OSREL", + "PATH"); if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname)) != 0) return; @@ -55,8 +57,8 @@ procstat_bin(struct procstat *prstat, st if (procstat_getosrel(prstat, kipp, &osrel) != 0) return; - printf("%5d ", kipp->ki_pid); - printf("%-16s ", kipp->ki_comm); - printf("%8d ", osrel); - printf("%s\n", pathname); + xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); + xo_emit("{:command/%-16s/%s} ", kipp->ki_comm); + xo_emit("{:osrel/%8d/%d} ", osrel); + xo_emit("{:pathname/%s}\n", pathname); } Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_cred.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007-2008 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,21 +49,22 @@ procstat_cred(struct procstat *procstat, gid_t *groups; if (!hflag) - printf("%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s\n", + xo_emit("{T:/%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s}\n", "PID", "COMM", "EUID", "RUID", "SVUID", "EGID", "RGID", "SVGID", "UMASK", "FLAGS", "GROUPS"); - printf("%5d ", kipp->ki_pid); - printf("%-16s ", kipp->ki_comm); - printf("%5d ", kipp->ki_uid); - printf("%5d ", kipp->ki_ruid); - printf("%5d ", kipp->ki_svuid); - printf("%5d ", kipp->ki_groups[0]); - printf("%5d ", kipp->ki_rgid); - printf("%5d ", kipp->ki_svgid); - printf("%5s ", get_umask(procstat, kipp)); - printf("%s", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? "C" : "-"); - printf(" "); + xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); + xo_emit("{:command/%-16s/%s} ", kipp->ki_comm); + xo_emit("{:uid/%5d} ", kipp->ki_uid); + xo_emit("{:ruid/%5d} ", kipp->ki_ruid); + xo_emit("{:svuid/%5d} ", kipp->ki_svuid); + xo_emit("{:group/%5d} ", kipp->ki_groups[0]); + xo_emit("{:rgid/%5d} ", kipp->ki_rgid); + xo_emit("{:svgid/%5d} ", kipp->ki_svgid); + xo_emit("{:umask/%5s} ", get_umask(procstat, kipp)); + xo_emit("{:cr_flags/%s}", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? + "C" : "-"); + xo_emit("{P: }"); groups = NULL; /* @@ -76,12 +78,14 @@ procstat_cred(struct procstat *procstat, ngroups = kipp->ki_ngroups; groups = kipp->ki_groups; } + xo_open_list("groups"); for (i = 0; i < ngroups; i++) - printf("%s%d", (i > 0) ? "," : "", groups[i]); + xo_emit("{D:/%s}{l:groups/%d}", (i > 0) ? "," : "", groups[i]); if (groups != kipp->ki_groups) procstat_freegroups(procstat, groups); - printf("\n"); + xo_close_list("groups"); + xo_emit("\n"); } static const char * Modified: head/usr.bin/procstat/procstat_cs.c ============================================================================== --- head/usr.bin/procstat/procstat_cs.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_cs.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,6 +29,7 @@ #include #include +#include #include #include @@ -46,11 +48,12 @@ procstat_cs(struct procstat *procstat, s cpusetid_t cs; cpuset_t mask; struct kinfo_proc *kip; + struct sbuf *cpusetbuf; unsigned int count, i; int once, twice, lastcpu, cpu; if (!hflag) - printf("%5s %6s %-16s %-16s %2s %4s %-7s\n", "PID", + xo_emit("{T:/%5s %6s %-16s %-16s %2s %4s %-7s}\n", "PID", "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK"); kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, @@ -60,49 +63,57 @@ procstat_cs(struct procstat *procstat, s kinfo_proc_sort(kip, count); for (i = 0; i < count; i++) { kipp = &kip[i]; - printf("%5d ", kipp->ki_pid); - printf("%6d ", kipp->ki_tid); - printf("%-16s ", strlen(kipp->ki_comm) ? + xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); + xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid); + xo_emit("{:command/%-16s/%s} ", strlen(kipp->ki_comm) ? kipp->ki_comm : "-"); - printf("%-16s ", (strlen(kipp->ki_tdname) && + xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) && (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? kipp->ki_tdname : "-"); if (kipp->ki_oncpu != 255) - printf("%3d ", kipp->ki_oncpu); + xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu); else if (kipp->ki_lastcpu != 255) - printf("%3d ", kipp->ki_lastcpu); + xo_emit("{:cpu/%3d/%d} ", kipp->ki_lastcpu); else - printf("%3s ", "-"); + xo_emit("{:cpu/%3s/%s} ", "-"); if (cpuset_getid(CPU_LEVEL_CPUSET, CPU_WHICH_TID, kipp->ki_tid, &cs) != 0) { cs = CPUSET_INVALID; } - printf("%4d ", cs); + xo_emit("{:cpu_set_id/%4d/%d} ", cs); if ((cs != CPUSET_INVALID) && (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, kipp->ki_tid, sizeof(mask), &mask) == 0)) { lastcpu = -1; once = 0; twice = 0; + cpusetbuf = sbuf_new_auto(); for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { if (CPU_ISSET(cpu, &mask)) { if (once == 0) { - printf("%d", cpu); + sbuf_printf(cpusetbuf, "%d", + cpu); once = 1; } else if (cpu == lastcpu + 1) { twice = 1; } else if (twice == 1) { - printf("-%d,%d", lastcpu, cpu); + sbuf_printf(cpusetbuf, "-%d,%d", + lastcpu, cpu); twice = 0; } else - printf(",%d", cpu); + sbuf_printf(cpusetbuf, ",%d", + cpu); lastcpu = cpu; } } if (once && twice) - printf("-%d", lastcpu); + sbuf_printf(cpusetbuf, "-%d", lastcpu); + if (sbuf_finish(cpusetbuf) != 0) + xo_err(1, "Could not generate output"); + xo_emit("{:cpu_set/%s}", sbuf_data(cpusetbuf)); + sbuf_delete(cpusetbuf); } - printf("\n"); + xo_emit("\n"); } procstat_freeprocs(procstat, kip); } Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sat Sep 5 16:59:30 2015 (r287485) +++ head/usr.bin/procstat/procstat_files.c Sat Sep 5 17:02:01 2015 (r287486) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007-2011 Robert N. M. Watson + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -123,15 +124,6 @@ addr_to_string(struct sockaddr_storage * } } -static void -print_address(struct sockaddr_storage *ss) -{ - char addr[PATH_MAX]; - - addr_to_string(ss, addr, sizeof(addr)); - printf("%s", addr); -} - static struct cap_desc { uint64_t cd_right; const char *cd_desc; @@ -273,19 +265,22 @@ print_capability(cap_rights_t *rightsp, width = 0; for (i = width_capability(rightsp); i < capwidth; i++) { if (i != 0) - printf(" "); + xo_emit(" "); else - printf("-"); + xo_emit("-"); } + xo_open_list("capabilities"); for (i = 0; i < cap_desc_count; i++) { if (cap_rights_is_set(rightsp, cap_desc[i].cd_right)) { - printf("%s%s", count ? "," : "", cap_desc[i].cd_desc); + xo_emit("{D:/%s}{l:capabilities/%s}", count ? "," : "", + cap_desc[i].cd_desc); width += strlen(cap_desc[i].cd_desc); if (count) width++; count++; } } + xo_close_list("capabilities"); } void @@ -298,6 +293,8 @@ procstat_files(struct procstat *procstat struct vnstat vn; u_int capwidth, width; int error; + char src_addr[PATH_MAX]; + char dst_addr[PATH_MAX]; /* * To print the header in capability mode, we need to know the width @@ -319,84 +316,103 @@ procstat_files(struct procstat *procstat if (!hflag) { if (Cflag) - printf("%5s %-16s %5s %1s %-8s %-*s " - "%-3s %-12s\n", "PID", "COMM", "FD", "T", + xo_emit("{T:/%5s %-16s %5s %1s %-8s %-*s " + "%-3s %-12s}\n", "PID", "COMM", "FD", "T", "FLAGS", capwidth, "CAPABILITIES", "PRO", "NAME"); else - printf("%5s %-16s %5s %1s %1s %-8s " - "%3s %7s %-3s %-12s\n", "PID", "COMM", "FD", "T", + xo_emit("{T:/%5s %-16s %5s %1s %1s %-8s " + "%3s %7s %-3s %-12s}\n", "PID", "COMM", "FD", "T", "V", "FLAGS", "REF", "OFFSET", "PRO", "NAME"); } if (head == NULL) return; + xo_emit("{ek:process_id/%5d/%d}", kipp->ki_pid); + xo_emit("{e:command/%-16s/%s}", kipp->ki_comm); + xo_open_list("files"); STAILQ_FOREACH(fst, head, next) { - printf("%5d ", kipp->ki_pid); - printf("%-16s ", kipp->ki_comm); + xo_open_instance("files"); + xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid); + xo_emit("{d:command/%-16s/%s} ", kipp->ki_comm); if (fst->fs_uflags & PS_FST_UFLAG_CTTY) - printf(" ctty "); + xo_emit("{P: }{:fd/%s} ", "ctty"); else if (fst->fs_uflags & PS_FST_UFLAG_CDIR) - printf(" cwd "); + xo_emit("{P: }{:fd/%s} ", "cwd"); else if (fst->fs_uflags & PS_FST_UFLAG_JAIL) - printf(" jail "); + xo_emit("{P: }{:fd/%s} ", "jail"); else if (fst->fs_uflags & PS_FST_UFLAG_RDIR) - printf(" root "); + xo_emit("{P: }{:fd/%s} ", "root"); else if (fst->fs_uflags & PS_FST_UFLAG_TEXT) - printf(" text "); + xo_emit("{P: }{:fd/%s} ", "text"); else if (fst->fs_uflags & PS_FST_UFLAG_TRACE) - printf("trace "); + xo_emit("{:fd/%s} ", "trace"); else - printf("%5d ", fst->fs_fd); + xo_emit("{:fd/%5d} ", fst->fs_fd); switch (fst->fs_type) { case PS_FST_TYPE_VNODE: str = "v"; + xo_emit("{eq:fd_type/vnode}"); break; case PS_FST_TYPE_SOCKET: str = "s"; + xo_emit("{eq:fd_type/socket}"); break; case PS_FST_TYPE_PIPE: str = "p"; + xo_emit("{eq:fd_type/pipe}"); break; case PS_FST_TYPE_FIFO: str = "f"; + xo_emit("{eq:fd_type/fifo}"); break; case PS_FST_TYPE_KQUEUE: str = "k"; + xo_emit("{eq:fd_type/kqueue}"); break; case PS_FST_TYPE_CRYPTO: str = "c"; + xo_emit("{eq:fd_type/crypto}"); break; case PS_FST_TYPE_MQUEUE: str = "m"; + xo_emit("{eq:fd_type/mqueue}"); break; case PS_FST_TYPE_SHM: str = "h"; + xo_emit("{eq:fd_type/shm}"); break; case PS_FST_TYPE_PTS: str = "t"; + xo_emit("{eq:fd_type/pts}"); break; case PS_FST_TYPE_SEM: str = "e"; + xo_emit("{eq:fd_type/sem}"); break; case PS_FST_TYPE_NONE: + str = "?"; + xo_emit("{eq:fd_type/none}"); + break; + case PS_FST_TYPE_UNKNOWN: default: str = "?"; + xo_emit("{eq:fd_type/unknown}"); break; } - printf("%1s ", str); + xo_emit("{d:fd_type/%1s/%s} ", str); if (!Cflag) { str = "-"; if (fst->fs_type == PS_FST_TYPE_VNODE) { @@ -405,74 +421,118 @@ procstat_files(struct procstat *procstat switch (vn.vn_type) { case PS_FST_VTYPE_VREG: str = "r"; + xo_emit("{eq:vode_type/regular}"); break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 5 17:29:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C43A9CAAED; Sat, 5 Sep 2015 17:29:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.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 505D5E1E; Sat, 5 Sep 2015 17:29:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85HT8JD064197; Sat, 5 Sep 2015 17:29:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85HT8xp064196; Sat, 5 Sep 2015 17:29:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201509051729.t85HT8xp064196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 5 Sep 2015 17:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287487 - 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: Sat, 05 Sep 2015 17:29:08 -0000 Author: andrew Date: Sat Sep 5 17:29:07 2015 New Revision: 287487 URL: https://svnweb.freebsd.org/changeset/base/287487 Log: Add ddb show commands to print the special registers and to ask the hardware to perform address translation for us. These are useful to help track down what caused us to enter the debugger. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sat Sep 5 17:02:01 2015 (r287486) +++ head/sys/arm64/arm64/machdep.c Sat Sep 5 17:29:07 2015 (r287487) @@ -26,6 +26,7 @@ */ #include "opt_platform.h" +#include "opt_ddb.h" #include __FBSDID("$FreeBSD$"); @@ -868,3 +869,89 @@ initarm(struct arm64_bootparams *abp) early_boot = 0; } +#ifdef DDB +#include + +DB_SHOW_COMMAND(specialregs, db_show_spregs) +{ +#define PRINT_REG(reg) \ + db_printf(__STRING(reg) " = %#016lx\n", READ_SPECIALREG(reg)) + + PRINT_REG(actlr_el1); + PRINT_REG(afsr0_el1); + PRINT_REG(afsr1_el1); + PRINT_REG(aidr_el1); + PRINT_REG(amair_el1); + PRINT_REG(ccsidr_el1); + PRINT_REG(clidr_el1); + PRINT_REG(contextidr_el1); + PRINT_REG(cpacr_el1); + PRINT_REG(csselr_el1); + PRINT_REG(ctr_el0); + PRINT_REG(currentel); + PRINT_REG(daif); + PRINT_REG(dczid_el0); + PRINT_REG(elr_el1); + PRINT_REG(esr_el1); + PRINT_REG(far_el1); + PRINT_REG(fpcr); + PRINT_REG(fpsr); + PRINT_REG(id_aa64afr0_el1); + PRINT_REG(id_aa64afr1_el1); + PRINT_REG(id_aa64dfr0_el1); + PRINT_REG(id_aa64dfr1_el1); + PRINT_REG(id_aa64isar0_el1); + PRINT_REG(id_aa64isar1_el1); + PRINT_REG(id_aa64pfr0_el1); + PRINT_REG(id_aa64pfr1_el1); + PRINT_REG(id_afr0_el1); + PRINT_REG(id_dfr0_el1); + PRINT_REG(id_isar0_el1); + PRINT_REG(id_isar1_el1); + PRINT_REG(id_isar2_el1); + PRINT_REG(id_isar3_el1); + PRINT_REG(id_isar4_el1); + PRINT_REG(id_isar5_el1); + PRINT_REG(id_mmfr0_el1); + PRINT_REG(id_mmfr1_el1); + PRINT_REG(id_mmfr2_el1); + PRINT_REG(id_mmfr3_el1); +#if 0 + /* Missing from llvm */ + PRINT_REG(id_mmfr4_el1); +#endif + PRINT_REG(id_pfr0_el1); + PRINT_REG(id_pfr1_el1); + PRINT_REG(isr_el1); + PRINT_REG(mair_el1); + PRINT_REG(midr_el1); + PRINT_REG(mpidr_el1); + PRINT_REG(mvfr0_el1); + PRINT_REG(mvfr1_el1); + PRINT_REG(mvfr2_el1); + PRINT_REG(revidr_el1); + PRINT_REG(sctlr_el1); + PRINT_REG(sp_el0); + PRINT_REG(spsel); + PRINT_REG(spsr_el1); + PRINT_REG(tcr_el1); + PRINT_REG(tpidr_el0); + PRINT_REG(tpidr_el1); + PRINT_REG(tpidrro_el0); + PRINT_REG(ttbr0_el1); + PRINT_REG(ttbr1_el1); + PRINT_REG(vbar_el1); +#undef PRINT_REG +} + +DB_SHOW_COMMAND(vtop, db_show_vtop) +{ + uint64_t phys; + + if (have_addr) { + phys = arm64_address_translate_s1e1r(addr); + db_printf("Physical address reg: 0x%016lx\n", phys); + } else + db_printf("show vtop \n"); +} +#endif From owner-svn-src-all@freebsd.org Sat Sep 5 17:34:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AE29CAE55; Sat, 5 Sep 2015 17:34:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 6623212C0; Sat, 5 Sep 2015 17:34:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85HYoaY068100; Sat, 5 Sep 2015 17:34:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85HYoQ9068099; Sat, 5 Sep 2015 17:34:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201509051734.t85HYoQ9068099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 5 Sep 2015 17:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287488 - 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.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, 05 Sep 2015 17:34:50 -0000 Author: alc Date: Sat Sep 5 17:34:49 2015 New Revision: 287488 URL: https://svnweb.freebsd.org/changeset/base/287488 Log: Eliminate pointless requeueing of pages from terminated objects. These pages will have left the inactive queue before the page daemon performs its next scan. Also, ignore references to pages from terminated objects. This allows the clean pages to be freed a little sooner. Move some comments to their proper place, i.e., next to the code that they describe, and update other nearby comments. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Sep 5 17:29:07 2015 (r287487) +++ head/sys/vm/vm_pageout.c Sat Sep 5 17:34:49 2015 (r287488) @@ -1186,13 +1186,9 @@ unlock_page: } /* - * We bump the activation count if the page has been - * referenced while in the inactive queue. This makes - * it less likely that the page will be added back to the - * inactive queue prematurely again. Here we check the - * page tables (or emulated bits, if any), given the upper - * level VM system not knowing anything about existing - * references. + * If the page has been referenced and the object is not dead, + * reactivate or requeue the page depending on whether the + * object is mapped. */ if ((m->aflags & PGA_REFERENCED) != 0) { vm_page_aflag_clear(m, PGA_REFERENCED); @@ -1205,21 +1201,25 @@ unlock_page: KASSERT(!pmap_page_is_mapped(m), ("vm_pageout_scan: page %p is mapped", m)); } - - /* - * If the upper level VM system knows about any page - * references, we reactivate the page or requeue it. - */ if (act_delta != 0) { if (object->ref_count != 0) { vm_page_activate(m); + + /* + * Increase the activation count if the page + * was referenced while in the inactive queue. + * This makes it less likely that the page will + * be returned prematurely to the inactive + * queue. + */ m->act_count += act_delta + ACT_ADVANCE; - } else { + goto drop_page; + } else if ((object->flags & OBJ_DEAD) == 0) { vm_pagequeue_lock(pq); queues_locked = TRUE; vm_page_requeue_locked(m); + goto drop_page; } - goto drop_page; } /* @@ -1243,6 +1243,15 @@ unlock_page: vm_page_free(m); PCPU_INC(cnt.v_dfree); --page_shortage; + } else if ((object->flags & OBJ_DEAD) != 0) { + /* + * Leave dirty pages from dead objects at the front of + * the queue. They are being paged out and freed by + * the thread that destroyed the object. They will + * leave the queue shortly after the scan finishes, so + * they should be discounted from the inactive count. + */ + addl_page_shortage++; } else if ((m->flags & PG_WINATCFLS) == 0 && pass < 2) { /* * Dirty pages need to be paged out, but flushing @@ -1278,18 +1287,11 @@ unlock_page: pageout_ok = vm_page_count_min(); else pageout_ok = TRUE; - - /* - * We don't bother paging objects that are "dead". - * Those objects are in a "rundown" state. - */ - if (!pageout_ok || (object->flags & OBJ_DEAD) != 0) { + if (!pageout_ok) { vm_pagequeue_lock(pq); - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); queues_locked = TRUE; vm_page_requeue_locked(m); - goto relock_queues; + goto drop_page; } error = vm_pageout_clean(m); /* From owner-svn-src-all@freebsd.org Sat Sep 5 18:24:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 810859CA326; Sat, 5 Sep 2015 18:24:52 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.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 71B34C57; Sat, 5 Sep 2015 18:24:52 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85IOqHW088562; Sat, 5 Sep 2015 18:24:52 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85IOqYZ088561; Sat, 5 Sep 2015 18:24:52 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201509051824.t85IOqYZ088561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 5 Sep 2015 18:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287489 - head/sys/boot/efi/loader/arch/amd64 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, 05 Sep 2015 18:24:52 -0000 Author: marcel Date: Sat Sep 5 18:24:51 2015 New Revision: 287489 URL: https://svnweb.freebsd.org/changeset/base/287489 Log: Auto-detect the UGA frame buffer and stride on a MacBook. We're striking a delicate balance between exhaustive searching and banking on assumptions. The environment variables can be used as a fall-back anyway. With this change, all known and tested Macs with only UGA should have a working console out of the box... for now... Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Sep 5 17:34:49 2015 (r287488) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Sep 5 18:24:51 2015 (r287489) @@ -175,7 +175,7 @@ efifb_uga_find_pixel(EFI_UGA_DRAW_PROTOC ofs += count; size -= count; } - printf("Couldn't find the pixel"); + printf("No change detected in frame buffer"); fail: printf(" -- error %lu\n", status & ~EFI_ERROR_MASK); @@ -218,18 +218,20 @@ efifb_uga_get_pciio(void) } static EFI_STATUS -efifb_uga_detect_framebuffer(EFI_UGA_DRAW_PROTOCOL *uga, - EFI_PCI_IO_PROTOCOL *pciio, uint64_t *addrp, uint64_t *sizep) +efifb_uga_locate_framebuffer(EFI_PCI_IO_PROTOCOL *pciio, uint64_t *addrp, + uint64_t *sizep) { uint8_t *resattr; - uint64_t a, addr, s, size; - ssize_t ofs; + uint64_t addr, size; EFI_STATUS status; u_int bar; + if (pciio == NULL) + return (EFI_DEVICE_ERROR); + /* Attempt to get the frame buffer address (imprecise). */ - addr = 0; - size = 0; + *addrp = 0; + *sizep = 0; for (bar = 0; bar < 6; bar++) { status = pciio->GetBarAttributes(pciio, bar, NULL, (void **)&resattr); @@ -238,43 +240,27 @@ efifb_uga_detect_framebuffer(EFI_UGA_DRA /* XXX magic offsets and constants. */ if (resattr[0] == 0x87 && resattr[3] == 0) { /* 32-bit address space descriptor (MEMIO) */ - a = le32dec(resattr + 10); - s = le32dec(resattr + 22); + addr = le32dec(resattr + 10); + size = le32dec(resattr + 22); } else if (resattr[0] == 0x8a && resattr[3] == 0) { /* 64-bit address space descriptor (MEMIO) */ - a = le64dec(resattr + 14); - s = le64dec(resattr + 38); + addr = le64dec(resattr + 14); + size = le64dec(resattr + 38); } else { - a = 0; - s = 0; + addr = 0; + size = 0; } BS->FreePool(resattr); - if (a == 0 || s == 0) + if (addr == 0 || size == 0) continue; /* We assume the largest BAR is the frame buffer. */ - if (s > size) { - addr = a; - size = s; + if (size > *sizep) { + *addrp = addr; + *sizep = size; } } - if (addr == 0 || size == 0) - return (EFI_DEVICE_ERROR); - - /* - * The visible part of the frame buffer may not start at offset - * 0, so try to detect it. - */ - ofs = efifb_uga_find_pixel(uga, 0, pciio, addr, size); - if (ofs == -1) - return (EFI_NO_RESPONSE); - - addr += ofs; - size -= ofs; - - *addrp = addr; - *sizep = size; - return (0); + return ((*addrp == 0 || *sizep == 0) ? EFI_DEVICE_ERROR : 0); } static int @@ -284,29 +270,75 @@ efifb_from_uga(struct efi_fb *efifb, EFI char *ev, *p; EFI_STATUS status; ssize_t ofs; - uint32_t horiz, vert, depth, refresh; + uint32_t np, horiz, vert, depth, refresh; status = uga->GetMode(uga, &horiz, &vert, &depth, &refresh); if (EFI_ERROR(status)) return (1); efifb->fb_height = vert; efifb->fb_width = horiz; + /* Paranoia... */ + if (efifb->fb_height == 0 || efifb->fb_width == 0) + return (1); + + /* The color masks are fixed AFAICT. */ efifb_mask_from_pixfmt(efifb, PixelBlueGreenRedReserved8BitPerColor, NULL); + /* + * The stride is equal or larger to the width. Often it's the + * next larger power of two. We'll start with that... + */ + efifb->fb_stride = efifb->fb_width; + do { + np = efifb->fb_stride & (efifb->fb_stride - 1); + if (np) { + efifb->fb_stride |= (np - 1); + efifb->fb_stride++; + } + } while (np); + + /* pciio can be NULL on return! */ pciio = efifb_uga_get_pciio(); - if (pciio == NULL) - return (1); ev = getenv("uga_framebuffer"); if (ev == NULL) { /* Try to find the frame buffer. */ - status = efifb_uga_detect_framebuffer(uga, pciio, - &efifb->fb_addr, &efifb->fb_size); - if (EFI_ERROR(status)) + status = efifb_uga_locate_framebuffer(pciio, &efifb->fb_addr, + &efifb->fb_size); + if (EFI_ERROR(status)) { + printf("Please set uga_framebuffer!\n"); return (1); + } + + /* + * The visible part of the frame buffer may not start at + * offset 0, so try to detect it. Note that we may not + * always be able to read from the frame buffer, which + * means that we may not be able to detect anything. In + * that case, we would take a long time scanning for a + * pixel change in the frame buffer, which would have it + * appear that we're hanging, so we limit the scan to + * 1/256th of the frame buffer. This number is mostly + * based on PR 202730 and the fact that on a MacBoook, + * where we can't read from the frame buffer the offset + * of the visible region is 0. In short: we want to scan + * enough to handle all adapters that have an offset + * larger than 0 and we want to scan as little as we can + * to not appear to hang when we can't read from the + * frame buffer. + */ + ofs = efifb_uga_find_pixel(uga, 0, pciio, efifb->fb_addr, + efifb->fb_size >> 8); + if (ofs == -1) { + printf("Unable to reliably detect frame buffer.\n"); + } else if (ofs > 0) { + efifb->fb_addr += ofs; + efifb->fb_size -= ofs; + } } else { - efifb->fb_size = horiz * vert * 4; + ofs = 0; + efifb->fb_size = efifb->fb_height * efifb->fb_stride * 4; efifb->fb_addr = strtoul(ev, &p, 0); if (*p != '\0') return (1); @@ -314,17 +346,26 @@ efifb_from_uga(struct efi_fb *efifb, EFI ev = getenv("uga_stride"); if (ev == NULL) { - /* Try to detect the stride. */ - ofs = efifb_uga_find_pixel(uga, 1, pciio, efifb->fb_addr, - efifb->fb_size); - if (ofs == -1) - return (1); - efifb->fb_stride = ofs >> 2; + if (pciio != NULL && ofs != -1) { + /* Determine the stride. */ + ofs = efifb_uga_find_pixel(uga, 1, pciio, + efifb->fb_addr, horiz * 8); + if (ofs != -1) + efifb->fb_stride = ofs >> 2; + } else { + printf("Unable to reliably detect the stride.\n"); + } } else { efifb->fb_stride = strtoul(ev, &p, 0); if (*p != '\0') return (1); } + + /* + * We finalized on the stride, so recalculate the size of the + * frame buffer. + */ + efifb->fb_size = efifb->fb_height * efifb->fb_stride * 4; return (0); } From owner-svn-src-all@freebsd.org Sat Sep 5 19:28:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BABE9CA03C; Sat, 5 Sep 2015 19:28:42 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3D223A21; Sat, 5 Sep 2015 19:28:42 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85JSgSa013362; Sat, 5 Sep 2015 19:28:42 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85JSgQw013361; Sat, 5 Sep 2015 19:28:42 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201509051928.t85JSgQw013361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 5 Sep 2015 19:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287491 - head/usr.bin/procstat 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, 05 Sep 2015 19:28:42 -0000 Author: allanjude Date: Sat Sep 5 19:28:41 2015 New Revision: 287491 URL: https://svnweb.freebsd.org/changeset/base/287491 Log: Fix build error on gcc platforms Approved by: bapt (mentor) Modified: head/usr.bin/procstat/procstat_kstack.c Modified: head/usr.bin/procstat/procstat_kstack.c ============================================================================== --- head/usr.bin/procstat/procstat_kstack.c Sat Sep 5 18:36:23 2015 (r287490) +++ head/usr.bin/procstat/procstat_kstack.c Sat Sep 5 19:28:41 2015 (r287491) @@ -131,6 +131,7 @@ kstack_cleanup_encoded(const char *old, cp_new++; } } + *cp_new = '\0'; cp_tofree = cp_loop = strdup(new); } else cp_tofree = cp_loop = strdup(old); @@ -138,7 +139,6 @@ kstack_cleanup_encoded(const char *old, if (strlen(cp_line) != 0 && *cp_line != 127) xo_emit("{le:token/%s}", cp_line); } - *cp_new = '\0'; free(cp_tofree); } From owner-svn-src-all@freebsd.org Sat Sep 5 21:12:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155189CAC23; Sat, 5 Sep 2015 21:12:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.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 059CA1D03; Sat, 5 Sep 2015 21:12:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85LCOuR058074; Sat, 5 Sep 2015 21:12:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85LCKJm058052; Sat, 5 Sep 2015 21:12:20 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201509052112.t85LCKJm058052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 5 Sep 2015 21:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287492 - head/sys/dev/e1000 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, 05 Sep 2015 21:12:25 -0000 Author: sbruno Date: Sat Sep 5 21:12:19 2015 New Revision: 287492 URL: https://svnweb.freebsd.org/changeset/base/287492 Log: Revert last two commits to em(4)/igb(4). Reports are coming in that this breaks initialization and reads from EEPROM on boot/driver load. r287469 is being reverted as a dependancy on r287467 Modified: head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_82540.c head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82542.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_82571.h head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_i210.c head/sys/dev/e1000/e1000_i210.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_nvm.h head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_80003es2lan.c Sat Sep 5 21:12:19 2015 (r287492) @@ -851,17 +851,11 @@ static s32 e1000_reset_hw_80003es2lan(st e1000_release_phy_80003es2lan(hw); /* Disable IBIST slave mode (far-end loopback) */ - ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data); - if (!ret_val) { - kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_INBAND_PARAM, - kum_reg_data); - if (ret_val) - DEBUGOUT("Error disabling far-end loopback\n"); - } else - DEBUGOUT("Error disabling far-end loopback\n"); + e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + &kum_reg_data); + kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; + e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + kum_reg_data); ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) @@ -917,18 +911,11 @@ static s32 e1000_init_hw_80003es2lan(str return ret_val; /* Disable IBIST slave mode (far-end loopback) */ - ret_val = - e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - &kum_reg_data); - if (!ret_val) { - kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_INBAND_PARAM, - kum_reg_data); - if (ret_val) - DEBUGOUT("Error disabling far-end loopback\n"); - } else - DEBUGOUT("Error disabling far-end loopback\n"); + e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + &kum_reg_data); + kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; + e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + kum_reg_data); /* Set the transmit descriptor write-back policy */ reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0)); Modified: head/sys/dev/e1000/e1000_82540.c ============================================================================== --- head/sys/dev/e1000/e1000_82540.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82540.c Sat Sep 5 21:12:19 2015 (r287492) @@ -66,7 +66,7 @@ static s32 e1000_read_mac_addr_82540(st static s32 e1000_init_phy_params_82540(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val; + s32 ret_val = E1000_SUCCESS; phy->addr = 1; phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; @@ -329,7 +329,7 @@ static s32 e1000_init_hw_82540(struct e1 { struct e1000_mac_info *mac = &hw->mac; u32 txdctl, ctrl_ext; - s32 ret_val; + s32 ret_val = E1000_SUCCESS; u16 i; DEBUGFUNC("e1000_init_hw_82540"); @@ -411,7 +411,7 @@ static s32 e1000_init_hw_82540(struct e1 static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw) { u32 ctrl; - s32 ret_val; + s32 ret_val = E1000_SUCCESS; u16 data; DEBUGFUNC("e1000_setup_copper_link_82540"); @@ -498,7 +498,7 @@ out: **/ static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw) { - s32 ret_val; + s32 ret_val = E1000_SUCCESS; u16 nvm_data; DEBUGFUNC("e1000_adjust_serdes_amplitude_82540"); @@ -528,7 +528,7 @@ out: **/ static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw) { - s32 ret_val; + s32 ret_val = E1000_SUCCESS; u16 default_page = 0; u16 phy_data; Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82541.c Sat Sep 5 21:12:19 2015 (r287492) @@ -85,7 +85,7 @@ static const u16 e1000_igp_cable_length_ static s32 e1000_init_phy_params_82541(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val; + s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_init_phy_params_82541"); @@ -295,7 +295,7 @@ void e1000_init_function_pointers_82541( **/ static s32 e1000_reset_hw_82541(struct e1000_hw *hw) { - u32 ledctl, ctrl, manc; + u32 ledctl, ctrl, icr, manc; DEBUGFUNC("e1000_reset_hw_82541"); @@ -317,7 +317,6 @@ static s32 e1000_reset_hw_82541(struct e /* Must reset the Phy before resetting the MAC */ if ((hw->mac.type == e1000_82541) || (hw->mac.type == e1000_82547)) { E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_PHY_RST)); - E1000_WRITE_FLUSH(hw); msec_delay(5); } @@ -360,7 +359,7 @@ static s32 e1000_reset_hw_82541(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); /* Clear any pending interrupt events. */ - E1000_READ_REG(hw, E1000_ICR); + icr = E1000_READ_REG(hw, E1000_ICR); return E1000_SUCCESS; } Modified: head/sys/dev/e1000/e1000_82542.c ============================================================================== --- head/sys/dev/e1000/e1000_82542.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82542.c Sat Sep 5 21:12:19 2015 (r287492) @@ -317,7 +317,7 @@ static s32 e1000_init_hw_82542(struct e1 static s32 e1000_setup_link_82542(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val; + s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_setup_link_82542"); @@ -565,7 +565,7 @@ static void e1000_clear_hw_cntrs_82542(s * * Reads the device MAC address from the EEPROM and stores the value. **/ -s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) +static s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) { s32 ret_val = E1000_SUCCESS; u16 offset, nvm_data, i; Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82543.c Sat Sep 5 21:12:19 2015 (r287492) @@ -900,7 +900,7 @@ static s32 e1000_phy_hw_reset_82543(stru **/ static s32 e1000_reset_hw_82543(struct e1000_hw *hw) { - u32 ctrl; + u32 ctrl, icr; s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_reset_hw_82543"); @@ -942,7 +942,7 @@ static s32 e1000_reset_hw_82543(struct e /* Masking off and clearing any pending interrupts */ E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); - E1000_READ_REG(hw, E1000_ICR); + icr = E1000_READ_REG(hw, E1000_ICR); return ret_val; } Modified: head/sys/dev/e1000/e1000_82571.h ============================================================================== --- head/sys/dev/e1000/e1000_82571.h Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82571.h Sat Sep 5 21:12:19 2015 (r287492) @@ -50,10 +50,9 @@ #define E1000_EIAC_82574 0x000DC /* Ext. Interrupt Auto Clear - RW */ #define E1000_EIAC_MASK_82574 0x01F00000 -#define E1000_IVAR_INT_ALLOC_VALID 0x8 +#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ -/* Manageability Operation Mode mask */ -#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 +#define E1000_RXCFGL 0x0B634 /* TimeSync Rx EtherType & Msg Type Reg - RW */ #define E1000_BASE1000T_STATUS 10 #define E1000_IDLE_ERROR_COUNT_MASK 0xFF Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82575.c Sat Sep 5 21:12:19 2015 (r287492) @@ -1235,7 +1235,7 @@ static s32 e1000_check_for_link_media_sw DEBUGFUNC("e1000_check_for_link_media_swap"); - /* Check for copper. */ + /* Check the copper medium. */ ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); if (ret_val) return ret_val; @@ -1247,7 +1247,7 @@ static s32 e1000_check_for_link_media_sw if (data & E1000_M88E1112_STATUS_LINK) port = E1000_MEDIA_PORT_COPPER; - /* Check for other. */ + /* Check the other medium. */ ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 1); if (ret_val) return ret_val; @@ -1256,6 +1256,11 @@ static s32 e1000_check_for_link_media_sw if (ret_val) return ret_val; + /* reset page to 0 */ + ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); + if (ret_val) + return ret_val; + if (data & E1000_M88E1112_STATUS_LINK) port = E1000_MEDIA_PORT_OTHER; @@ -1263,20 +1268,8 @@ static s32 e1000_check_for_link_media_sw if (port && (hw->dev_spec._82575.media_port != port)) { hw->dev_spec._82575.media_port = port; hw->dev_spec._82575.media_changed = TRUE; - } - - if (port == E1000_MEDIA_PORT_COPPER) { - /* reset page to 0 */ - ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); - if (ret_val) - return ret_val; - e1000_check_for_link_82575(hw); } else { - e1000_check_for_link_82575(hw); - /* reset page to 0 */ - ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); - if (ret_val) - return ret_val; + ret_val = e1000_check_for_link_82575(hw); } return E1000_SUCCESS; @@ -2143,13 +2136,7 @@ void e1000_rx_fifo_flush_82575(struct e1 u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; int i, ms_wait; - DEBUGFUNC("e1000_rx_fifo_flush_82575"); - - /* disable IPv6 options as per hardware errata */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - rfctl |= E1000_RFCTL_IPV6_EX_DIS; - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - + DEBUGFUNC("e1000_rx_fifo_workaround_82575"); if (hw->mac.type != e1000_82575 || !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) return; @@ -2177,6 +2164,7 @@ void e1000_rx_fifo_flush_82575(struct e1 * incoming packets are rejected. Set enable and wait 2ms so that * any packet that was coming in as RCTL.EN was set is flushed */ + rfctl = E1000_READ_REG(hw, E1000_RFCTL); E1000_WRITE_REG(hw, E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); rlpml = E1000_READ_REG(hw, E1000_RLPML); @@ -2906,13 +2894,11 @@ out: /** * e1000_set_eee_i350 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE based on setting in dev_spec structure. * **/ -s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M) +s32 e1000_set_eee_i350(struct e1000_hw *hw) { u32 ipcnfg, eeer; @@ -2928,16 +2914,7 @@ s32 e1000_set_eee_i350(struct e1000_hw * if (!(hw->dev_spec._82575.eee_disable)) { u32 eee_su = E1000_READ_REG(hw, E1000_EEE_SU); - if (adv100M) - ipcnfg |= E1000_IPCNFG_EEE_100M_AN; - else - ipcnfg &= ~E1000_IPCNFG_EEE_100M_AN; - - if (adv1G) - ipcnfg |= E1000_IPCNFG_EEE_1G_AN; - else - ipcnfg &= ~E1000_IPCNFG_EEE_1G_AN; - + ipcnfg |= (E1000_IPCNFG_EEE_1G_AN | E1000_IPCNFG_EEE_100M_AN); eeer |= (E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN | E1000_EEER_LPI_FC); @@ -2961,13 +2938,11 @@ out: /** * e1000_set_eee_i354 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE legacy mode based on setting in dev_spec structure. * **/ -s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M) +s32 e1000_set_eee_i354(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; @@ -3009,16 +2984,8 @@ s32 e1000_set_eee_i354(struct e1000_hw * if (ret_val) goto out; - if (adv100M) - phy_data |= E1000_EEE_ADV_100_SUPPORTED; - else - phy_data &= ~E1000_EEE_ADV_100_SUPPORTED; - - if (adv1G) - phy_data |= E1000_EEE_ADV_1000_SUPPORTED; - else - phy_data &= ~E1000_EEE_ADV_1000_SUPPORTED; - + phy_data |= E1000_EEE_ADV_100_SUPPORTED | + E1000_EEE_ADV_1000_SUPPORTED; ret_val = e1000_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, E1000_EEE_ADV_DEV_I354, phy_data); Modified: head/sys/dev/e1000/e1000_82575.h ============================================================================== --- head/sys/dev/e1000/e1000_82575.h Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_82575.h Sat Sep 5 21:12:19 2015 (r287492) @@ -495,8 +495,8 @@ void e1000_rlpml_set_vf(struct e1000_hw s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type); u16 e1000_rxpbs_adjust_82580(u32 data); s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data); -s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M); -s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M); +s32 e1000_set_eee_i350(struct e1000_hw *); +s32 e1000_set_eee_i354(struct e1000_hw *); s32 e1000_get_eee_status_i354(struct e1000_hw *, bool *); s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw); Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_api.c Sat Sep 5 21:12:19 2015 (r287492) @@ -299,12 +299,6 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_I218_V3: mac->type = e1000_pch_lpt; break; - case E1000_DEV_ID_PCH_SPT_I219_LM: - case E1000_DEV_ID_PCH_SPT_I219_V: - case E1000_DEV_ID_PCH_SPT_I219_LM2: - case E1000_DEV_ID_PCH_SPT_I219_V2: - mac->type = e1000_pch_spt; - break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -455,7 +449,6 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_pchlan: case e1000_pch2lan: case e1000_pch_lpt: - case e1000_pch_spt: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: @@ -936,6 +929,21 @@ s32 e1000_mng_enable_host_if(struct e100 } /** + * e1000_set_obff_timer - Set Optimized Buffer Flush/Fill timer + * @hw: pointer to the HW structure + * @itr: u32 indicating itr value + * + * Set the OBFF timer based on the given interrupt rate. + **/ +s32 e1000_set_obff_timer(struct e1000_hw *hw, u32 itr) +{ + if (hw->mac.ops.set_obff_timer) + return hw->mac.ops.set_obff_timer(hw, itr); + + return E1000_SUCCESS; +} + +/** * e1000_check_reset_block - Verifies PHY can be reset * @hw: pointer to the HW structure * @@ -1208,21 +1216,6 @@ s32 e1000_read_pba_length(struct e1000_h } /** - * e1000_read_pba_num - Read device part number - * @hw: pointer to the HW structure - * @pba_num: pointer to device part number - * - * Reads the product board assembly (PBA) number from the EEPROM and stores - * the value in pba_num. - * Currently no func pointer exists and all implementations are handled in the - * generic version of this function. - **/ -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) -{ - return e1000_read_pba_num_generic(hw, pba_num); -} - -/** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure * Modified: head/sys/dev/e1000/e1000_api.h ============================================================================== --- head/sys/dev/e1000/e1000_api.h Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_api.h Sat Sep 5 21:12:19 2015 (r287492) @@ -97,7 +97,6 @@ s32 e1000_phy_commit(struct e1000_hw *hw void e1000_power_up_phy(struct e1000_hw *hw); void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); void e1000_reload_nvm(struct e1000_hw *hw); Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_defines.h Sat Sep 5 21:12:19 2015 (r287492) @@ -197,8 +197,6 @@ #define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ #define E1000_RCTL_DTYP_PS 0x00000400 /* Packet Split descriptor */ #define E1000_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */ -#define E1000_RCTL_RDMTS_HEX 0x00010000 -#define E1000_RCTL_RDMTS1_HEX E1000_RCTL_RDMTS_HEX #define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */ #define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */ #define E1000_RCTL_BAM 0x00008000 /* broadcast enable */ @@ -567,6 +565,9 @@ #define E1000_ICR_THS 0x00800000 /* ICR.THS: Thermal Sensor Event*/ #define E1000_ICR_MDDET 0x10000000 /* Malicious Driver Detect */ +#define E1000_ITR_MASK 0x000FFFFF /* ITR value bitfield */ +#define E1000_ITR_MULT 256 /* ITR mulitplier in nsec */ + /* PBA ECC Register */ #define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */ #define E1000_PBA_ECC_COUNTER_SHIFT 20 /* ECC counter shift value */ @@ -752,12 +753,6 @@ #define E1000_TSYNCTXCTL_VALID 0x00000001 /* Tx timestamp valid */ #define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable Tx timestamping */ -/* HH Time Sync */ -#define E1000_TSYNCTXCTL_MAX_ALLOWED_DLY_MASK 0x0000F000 /* max delay */ -#define E1000_TSYNCTXCTL_SYNC_COMP_ERR 0x20000000 /* sync err */ -#define E1000_TSYNCTXCTL_SYNC_COMP 0x40000000 /* sync complete */ -#define E1000_TSYNCTXCTL_START_SYNC 0x80000000 /* initiate sync */ - #define E1000_TSYNCRXCTL_VALID 0x00000001 /* Rx timestamp valid */ #define E1000_TSYNCRXCTL_TYPE_MASK 0x0000000E /* Rx type mask */ #define E1000_TSYNCRXCTL_TYPE_L2_V2 0x00 @@ -1025,7 +1020,9 @@ /* NVM Addressing bits based on type 0=small, 1=large */ #define E1000_EECD_ADDR_BITS 0x00000400 #define E1000_EECD_TYPE 0x00002000 /* NVM Type (1-SPI, 0-Microwire) */ +#ifndef E1000_NVM_GRANT_ATTEMPTS #define E1000_NVM_GRANT_ATTEMPTS 1000 /* NVM # attempts to gain grant */ +#endif #define E1000_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */ #define E1000_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */ #define E1000_EECD_SIZE_EX_SHIFT 11 @@ -1062,44 +1059,11 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 -#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 -#define NVM_ETRACK_WORD 0x0042 -#define NVM_ETRACK_HIWORD 0x0043 -#define NVM_COMB_VER_OFF 0x0083 -#define NVM_COMB_VER_PTR 0x003d - -/* NVM version defines */ -#define NVM_MAJOR_MASK 0xF000 -#define NVM_MINOR_MASK 0x0FF0 -#define NVM_IMAGE_ID_MASK 0x000F -#define NVM_COMB_VER_MASK 0x00FF -#define NVM_MAJOR_SHIFT 12 -#define NVM_MINOR_SHIFT 4 -#define NVM_COMB_VER_SHFT 8 -#define NVM_VER_INVALID 0xFFFF -#define NVM_ETRACK_SHIFT 16 -#define NVM_ETRACK_VALID 0x8000 -#define NVM_NEW_DEC_MASK 0x0F00 -#define NVM_HEX_CONV 16 -#define NVM_HEX_TENS 10 - -/* FW version defines */ -/* Offset of "Loader patch ptr" in Firmware Header */ -#define E1000_I350_NVM_FW_LOADER_PATCH_PTR_OFFSET 0x01 -/* Patch generation hour & minutes */ -#define E1000_I350_NVM_FW_VER_WORD1_OFFSET 0x04 -/* Patch generation month & day */ -#define E1000_I350_NVM_FW_VER_WORD2_OFFSET 0x05 -/* Patch generation year */ -#define E1000_I350_NVM_FW_VER_WORD3_OFFSET 0x06 -/* Patch major & minor numbers */ -#define E1000_I350_NVM_FW_VER_WORD4_OFFSET 0x07 - #define NVM_MAC_ADDR 0x0000 #define NVM_SUB_DEV_ID 0x000B #define NVM_SUB_VEN_ID 0x000C @@ -1476,6 +1440,8 @@ #define I210_RXPBSIZE_DEFAULT 0x000000A2 /* RXPBSIZE default */ #define I210_TXPBSIZE_DEFAULT 0x04000014 /* TXPBSIZE default */ +#define E1000_DOBFFCTL_OBFFTHR_MASK 0x000000FF /* OBFF threshold */ +#define E1000_DOBFFCTL_EXIT_ACT_MASK 0x01000000 /* Exit active CB */ /* Proxy Filter Control */ #define E1000_PROXYFC_D0 0x00000001 /* Enable offload in D0 */ Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_hw.h Sat Sep 5 21:12:19 2015 (r287492) @@ -137,10 +137,6 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_I218_V2 0x15A1 #define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */ #define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */ -#define E1000_DEV_ID_PCH_SPT_I219_LM 0x156F /* Sunrise Point PCH */ -#define E1000_DEV_ID_PCH_SPT_I219_V 0x1570 /* Sunrise Point PCH */ -#define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ -#define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -226,7 +222,6 @@ enum e1000_mac_type { e1000_pchlan, e1000_pch2lan, e1000_pch_lpt, - e1000_pch_spt, e1000_82575, e1000_82576, e1000_82580, @@ -708,6 +703,7 @@ struct e1000_mac_operations { int (*rar_set)(struct e1000_hw *, u8*, u32); s32 (*read_mac_addr)(struct e1000_hw *); s32 (*validate_mdi_setting)(struct e1000_hw *); + s32 (*set_obff_timer)(struct e1000_hw *, u32); s32 (*acquire_swfw_sync)(struct e1000_hw *, u16); void (*release_swfw_sync)(struct e1000_hw *, u16); }; @@ -809,7 +805,7 @@ struct e1000_mac_info { enum e1000_serdes_link_state serdes_link_state; bool serdes_has_link; bool tx_pkt_filtering; - u32 max_frame_size; + u32 max_frame_size; }; struct e1000_phy_info { Modified: head/sys/dev/e1000/e1000_i210.c ============================================================================== --- head/sys/dev/e1000/e1000_i210.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_i210.c Sat Sep 5 21:12:19 2015 (r287492) @@ -489,105 +489,6 @@ static s32 e1000_read_invm_i210(struct e } /** - * e1000_read_invm_version - Reads iNVM version and image type - * @hw: pointer to the HW structure - * @invm_ver: version structure for the version read - * - * Reads iNVM version and image type. - **/ -s32 e1000_read_invm_version(struct e1000_hw *hw, - struct e1000_fw_version *invm_ver) -{ - u32 *record = NULL; - u32 *next_record = NULL; - u32 i = 0; - u32 invm_dword = 0; - u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / - E1000_INVM_RECORD_SIZE_IN_BYTES); - u32 buffer[E1000_INVM_SIZE]; - s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; - u16 version = 0; - - DEBUGFUNC("e1000_read_invm_version"); - - /* Read iNVM memory */ - for (i = 0; i < E1000_INVM_SIZE; i++) { - invm_dword = E1000_READ_REG(hw, E1000_INVM_DATA_REG(i)); - buffer[i] = invm_dword; - } - - /* Read version number */ - for (i = 1; i < invm_blocks; i++) { - record = &buffer[invm_blocks - i]; - next_record = &buffer[invm_blocks - i + 1]; - - /* Check if we have first version location used */ - if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) { - version = 0; - status = E1000_SUCCESS; - break; - } - /* Check if we have second version location used */ - else if ((i == 1) && - ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) { - version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; - status = E1000_SUCCESS; - break; - } - /* - * Check if we have odd version location - * used and it is the last one used - */ - else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) && - ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) && - (i != 1))) { - version = (*next_record & E1000_INVM_VER_FIELD_TWO) - >> 13; - status = E1000_SUCCESS; - break; - } - /* - * Check if we have even version location - * used and it is the last one used - */ - else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && - ((*record & 0x3) == 0)) { - version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; - status = E1000_SUCCESS; - break; - } - } - - if (status == E1000_SUCCESS) { - invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK) - >> E1000_INVM_MAJOR_SHIFT; - invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK; - } - /* Read Image Type */ - for (i = 1; i < invm_blocks; i++) { - record = &buffer[invm_blocks - i]; - next_record = &buffer[invm_blocks - i + 1]; - - /* Check if we have image type in first location used */ - if ((i == 1) && ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) { - invm_ver->invm_img_type = 0; - status = E1000_SUCCESS; - break; - } - /* Check if we have image type in first location used */ - else if ((((*record & 0x3) == 0) && - ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) || - ((((*record & 0x3) != 0) && (i != 1)))) { - invm_ver->invm_img_type = - (*next_record & E1000_INVM_IMGTYPE_FIELD) >> 23; - status = E1000_SUCCESS; - break; - } - } - return status; -} - -/** * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum * @hw: pointer to the HW structure * Modified: head/sys/dev/e1000/e1000_i210.h ============================================================================== --- head/sys/dev/e1000/e1000_i210.h Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_i210.h Sat Sep 5 21:12:19 2015 (r287492) @@ -43,8 +43,6 @@ s32 e1000_write_nvm_srwr_i210(struct e10 u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); -s32 e1000_read_invm_version(struct e1000_hw *hw, - struct e1000_fw_version *invm_ver); s32 e1000_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask); void e1000_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask); s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Sat Sep 5 19:28:41 2015 (r287491) +++ head/sys/dev/e1000/e1000_ich8lan.c Sat Sep 5 21:12:19 2015 (r287492) @@ -92,13 +92,10 @@ static s32 e1000_set_d3_lplu_state_ich8 bool active); static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); -static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, - u16 *data); static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw); static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw); -static s32 e1000_update_nvm_checksum_spt(struct e1000_hw *hw); static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data); static s32 e1000_id_led_init_pchlan(struct e1000_hw *hw); @@ -126,14 +123,6 @@ static s32 e1000_read_flash_byte_ich8la u32 offset, u8 *data); static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, u8 size, u16 *data); -static s32 e1000_read_flash_data32_ich8lan(struct e1000_hw *hw, u32 offset, - u32 *data); -static s32 e1000_read_flash_dword_ich8lan(struct e1000_hw *hw, - u32 offset, u32 *data); -static s32 e1000_write_flash_data32_ich8lan(struct e1000_hw *hw, - u32 offset, u32 data); -static s32 e1000_retry_write_flash_dword_ich8lan(struct e1000_hw *hw, - u32 offset, u32 dword); static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, u16 *data); static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw, @@ -144,6 +133,7 @@ static s32 e1000_check_for_copper_link_i static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); +static s32 e1000_set_obff_timer_pch_lpt(struct e1000_hw *hw, u32 itr); /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ /* Offset 04h HSFSTS */ @@ -242,21 +232,16 @@ static bool e1000_phy_is_accessible_pchl if (ret_val) return FALSE; out: - if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { - /* Only unforce SMBus if ME is not active */ - if (!(E1000_READ_REG(hw, E1000_FWSM) & - E1000_ICH_FWSM_FW_VALID)) { - /* Unforce SMBus mode in PHY */ - hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg); - phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; - hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg); + if (hw->mac.type == e1000_pch_lpt) { + /* Unforce SMBus mode in PHY */ + hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg); + phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; + hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg); - /* Unforce SMBus mode in MAC */ - mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT); - mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; - E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg); - } + /* Unforce SMBus mode in MAC */ + mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT); + mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; + E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg); } return TRUE; @@ -343,7 +328,6 @@ static s32 e1000_init_phy_workarounds_pc */ switch (hw->mac.type) { case e1000_pch_lpt: - case e1000_pch_spt: if (e1000_phy_is_accessible_pchlan(hw)) break; @@ -491,7 +475,6 @@ static s32 e1000_init_phy_params_pchlan( /* fall-through */ case e1000_pch2lan: case e1000_pch_lpt: - case e1000_pch_spt: /* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */ @@ -634,53 +617,36 @@ static s32 e1000_init_nvm_params_ich8lan struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; u32 gfpreg, sector_base_addr, sector_end_addr; u16 i; - u32 nvm_size; DEBUGFUNC("e1000_init_nvm_params_ich8lan"); /* Can't read flash registers if the register set isn't mapped. */ nvm->type = e1000_nvm_flash_sw; - /* in SPT, gfpreg doesn't exist. NVM size is taken from the - * STRAP register - */ - if (hw->mac.type == e1000_pch_spt) { - nvm->flash_base_addr = 0; - nvm_size = - (((E1000_READ_REG(hw, E1000_STRAP) >> 1) & 0x1F) + 1) - * NVM_SIZE_MULTIPLIER; - nvm->flash_bank_size = nvm_size / 2; - /* Adjust to word count */ - nvm->flash_bank_size /= sizeof(u16); - /* Set the base address for flash register access */ - hw->flash_address = hw->hw_addr + E1000_FLASH_BASE_ADDR; - } else { - if (!hw->flash_address) { - DEBUGOUT("ERROR: Flash registers not mapped\n"); - return -E1000_ERR_CONFIG; - } - - gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG); - - /* sector_X_addr is a "sector"-aligned address (4096 bytes) - * Add 1 to sector_end_addr since this sector is included in - * the overall size. - */ - sector_base_addr = gfpreg & FLASH_GFPREG_BASE_MASK; - sector_end_addr = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK) + 1; + if (!hw->flash_address) { + DEBUGOUT("ERROR: Flash registers not mapped\n"); + return -E1000_ERR_CONFIG; + } - /* flash_base_addr is byte-aligned */ - nvm->flash_base_addr = sector_base_addr - << FLASH_SECTOR_ADDR_SHIFT; + gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG); - /* find total size of the NVM, then cut in half since the total - * size represents two separate NVM banks. - */ - nvm->flash_bank_size = ((sector_end_addr - sector_base_addr) - << FLASH_SECTOR_ADDR_SHIFT); - nvm->flash_bank_size /= 2; - /* Adjust to word count */ - nvm->flash_bank_size /= sizeof(u16); - } + /* sector_X_addr is a "sector"-aligned address (4096 bytes) + * Add 1 to sector_end_addr since this sector is included in + * the overall size. + */ + sector_base_addr = gfpreg & FLASH_GFPREG_BASE_MASK; + sector_end_addr = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK) + 1; + + /* flash_base_addr is byte-aligned */ + nvm->flash_base_addr = sector_base_addr << FLASH_SECTOR_ADDR_SHIFT; + + /* find total size of the NVM, then cut in half since the total + * size represents two separate NVM banks. + */ + nvm->flash_bank_size = ((sector_end_addr - sector_base_addr) + << FLASH_SECTOR_ADDR_SHIFT); + nvm->flash_bank_size /= 2; + /* Adjust to word count */ + nvm->flash_bank_size /= sizeof(u16); nvm->word_size = E1000_SHADOW_RAM_WORDS; @@ -696,13 +662,8 @@ static s32 e1000_init_nvm_params_ich8lan /* Function Pointers */ nvm->ops.acquire = e1000_acquire_nvm_ich8lan; nvm->ops.release = e1000_release_nvm_ich8lan; - if (hw->mac.type == e1000_pch_spt) { - nvm->ops.read = e1000_read_nvm_spt; - nvm->ops.update = e1000_update_nvm_checksum_spt; - } else { - nvm->ops.read = e1000_read_nvm_ich8lan; - nvm->ops.update = e1000_update_nvm_checksum_ich8lan; - } + nvm->ops.read = e1000_read_nvm_ich8lan; + nvm->ops.update = e1000_update_nvm_checksum_ich8lan; nvm->ops.valid_led_default = e1000_valid_led_default_ich8lan; nvm->ops.validate = e1000_validate_nvm_checksum_ich8lan; nvm->ops.write = e1000_write_nvm_ich8lan; @@ -720,7 +681,9 @@ static s32 e1000_init_nvm_params_ich8lan static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; +#if defined(QV_RELEASE) || !defined(NO_PCH_LPT_B0_SUPPORT) u16 pci_cfg; +#endif /* QV_RELEASE || !defined(NO_PCH_LPT_B0_SUPPORT) */ DEBUGFUNC("e1000_init_mac_params_ich8lan"); @@ -789,21 +752,15 @@ static s32 e1000_init_mac_params_ich8lan mac->ops.rar_set = e1000_rar_set_pch2lan; /* fall-through */ case e1000_pch_lpt: - case e1000_pch_spt: /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; - /* fall-through */ case e1000_pchlan: +#if defined(QV_RELEASE) || !defined(NO_PCH_LPT_B0_SUPPORT) /* save PCH revision_id */ e1000_read_pci_cfg(hw, E1000_PCI_REVISION_ID_REG, &pci_cfg); - /* SPT uses full byte for revision ID, - * as opposed to previous generations - */ - if (hw->mac.type >= e1000_pch_spt) - hw->revision_id = (u8)(pci_cfg &= 0x00FF); - else - hw->revision_id = (u8)(pci_cfg &= 0x000F); + hw->revision_id = (u8)(pci_cfg &= 0x000F); +#endif /* QV_RELEASE || !defined(NO_PCH_LPT_B0_SUPPORT) */ /* check management mode */ mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; /* ID LED init */ @@ -820,11 +777,11 @@ static s32 e1000_init_mac_params_ich8lan break; } - if ((mac->type == e1000_pch_lpt) || - (mac->type == e1000_pch_spt)) { + if (mac->type == e1000_pch_lpt) { mac->rar_entry_count = E1000_PCH_LPT_RAR_ENTRIES; mac->ops.rar_set = e1000_rar_set_pch_lpt; mac->ops.setup_physical_interface = e1000_setup_copper_link_pch_lpt; + mac->ops.set_obff_timer = e1000_set_obff_timer_pch_lpt; } /* Enable PCS Lock-loss workaround for ICH8 */ @@ -1050,9 +1007,8 @@ release: /* clear FEXTNVM6 bit 8 on link down or 10/100 */ fextnvm6 &= ~E1000_FEXTNVM6_REQ_PLL_CLK; - if ((hw->phy.revision > 5) || !link || - ((status & E1000_STATUS_SPEED_100) && - (status & E1000_STATUS_FD))) + if (!link || ((status & E1000_STATUS_SPEED_100) && + (status & E1000_STATUS_FD))) goto update_fextnvm6; ret_val = hw->phy.ops.read_reg(hw, I217_INBAND_CTRL, ®); @@ -1088,6 +1044,168 @@ update_fextnvm6: return ret_val; } +static u64 e1000_ltr2ns(u16 ltr) +{ + u32 value, scale; + + /* Determine the latency in nsec based on the LTR value & scale */ + value = ltr & E1000_LTRV_VALUE_MASK; + scale = (ltr & E1000_LTRV_SCALE_MASK) >> E1000_LTRV_SCALE_SHIFT; + + return value * (1 << (scale * E1000_LTRV_SCALE_FACTOR)); +} + +/** + * e1000_platform_pm_pch_lpt - Set platform power management values + * @hw: pointer to the HW structure + * @link: bool indicating link status + * + * Set the Latency Tolerance Reporting (LTR) values for the "PCIe-like" + * GbE MAC in the Lynx Point PCH based on Rx buffer size and link speed + * when link is up (which must not exceed the maximum latency supported + * by the platform), otherwise specify there is no LTR requirement. + * Unlike TRUE-PCIe devices which set the LTR maximum snoop/no-snoop + * latencies in the LTR Extended Capability Structure in the PCIe Extended + * Capability register set, on this device LTR is set by writing the + * equivalent snoop/no-snoop latencies in the LTRV register in the MAC and + * set the SEND bit to send an Intel On-chip System Fabric sideband (IOSF-SB) + * message to the PMC. + * + * Use the LTR value to calculate the Optimized Buffer Flush/Fill (OBFF) + * high-water mark. + **/ +static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) +{ + u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) | + link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND; + u16 lat_enc = 0; /* latency encoded */ + s32 obff_hwm = 0; + + DEBUGFUNC("e1000_platform_pm_pch_lpt"); + + if (link) { + u16 speed, duplex, scale = 0; + u16 max_snoop, max_nosnoop; + u16 max_ltr_enc; /* max LTR latency encoded */ + s64 lat_ns; + s64 value; + u32 rxa; + + if (!hw->mac.max_frame_size) { + DEBUGOUT("max_frame_size not set.\n"); + return -E1000_ERR_CONFIG; + } + + hw->mac.ops.get_link_up_info(hw, &speed, &duplex); + if (!speed) { + DEBUGOUT("Speed not set.\n"); + return -E1000_ERR_CONFIG; + } + + /* Rx Packet Buffer Allocation size (KB) */ + rxa = E1000_READ_REG(hw, E1000_PBA) & E1000_PBA_RXA_MASK; + + /* Determine the maximum latency tolerated by the device. + * + * Per the PCIe spec, the tolerated latencies are encoded as + * a 3-bit encoded scale (only 0-5 are valid) multiplied by + * a 10-bit value (0-1023) to provide a range from 1 ns to + * 2^25*(2^10-1) ns. The scale is encoded as 0=2^0ns, + * 1=2^5ns, 2=2^10ns,...5=2^25ns. + */ + lat_ns = ((s64)rxa * 1024 - + (2 * (s64)hw->mac.max_frame_size)) * 8 * 1000; + if (lat_ns < 0) + lat_ns = 0; + else + lat_ns /= speed; + value = lat_ns; + + while (value > E1000_LTRV_VALUE_MASK) { + scale++; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 5 21:55:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 934509CB12A; Sat, 5 Sep 2015 21:55:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 842001031; Sat, 5 Sep 2015 21:55:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85Lt2sW074859; Sat, 5 Sep 2015 21:55:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85Lt2k9074858; Sat, 5 Sep 2015 21:55:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509052155.t85Lt2k9074858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 5 Sep 2015 21:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287493 - head/usr.sbin/sesutil 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, 05 Sep 2015 21:55:02 -0000 Author: bapt Date: Sat Sep 5 21:55:01 2015 New Revision: 287493 URL: https://svnweb.freebsd.org/changeset/base/287493 Log: Remove extra i++ Reported by: allanjude@ Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Sat Sep 5 21:12:19 2015 (r287492) +++ head/usr.sbin/sesutil/sesutil.c Sat Sep 5 21:55:01 2015 (r287493) @@ -175,7 +175,6 @@ locate(int argc, char **argv) } } close(fd); - i++; } globfree(&g); From owner-svn-src-all@freebsd.org Sat Sep 5 22:33:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5984F9CBF0E; Sat, 5 Sep 2015 22:33:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 4A3E11EF1; Sat, 5 Sep 2015 22:33:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85MXfqY090983; Sat, 5 Sep 2015 22:33:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85MXfPm090982; Sat, 5 Sep 2015 22:33:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509052233.t85MXfPm090982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 5 Sep 2015 22:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287494 - head/usr.sbin/sesutil 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, 05 Sep 2015 22:33:41 -0000 Author: bapt Date: Sat Sep 5 22:33:40 2015 New Revision: 287494 URL: https://svnweb.freebsd.org/changeset/base/287494 Log: Yet another fix for gcc 4.2 Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Sat Sep 5 21:55:01 2015 (r287493) +++ head/usr.sbin/sesutil/sesutil.c Sat Sep 5 22:33:40 2015 (r287494) @@ -83,13 +83,13 @@ do_locate(int fd, unsigned int idx, bool static bool disk_match(const char *devnames, const char *disk, size_t len) { - const char *devname; + const char *dname; - devname = devnames; - while ((devname = strstr(devname, disk)) != NULL) { - if (devname[len] == '\0' || devname[len] == ',') + dname = devnames; + while ((dname = strstr(dname, disk)) != NULL) { + if (dname[len] == '\0' || dname[len] == ',') return (true); - devname++; + dname++; } return (false); } From owner-svn-src-all@freebsd.org Sat Sep 5 23:23:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 271059CB473; Sat, 5 Sep 2015 23:23:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.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 174921A6A; Sat, 5 Sep 2015 23:23:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t85NN0fG012473; Sat, 5 Sep 2015 23:23:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t85NN0iC012470; Sat, 5 Sep 2015 23:23:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201509052323.t85NN0iC012470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 5 Sep 2015 23:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287496 - head/sys/dev/drm2/i915 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, 05 Sep 2015 23:23:01 -0000 Author: bapt Date: Sat Sep 5 23:22:59 2015 New Revision: 287496 URL: https://svnweb.freebsd.org/changeset/base/287496 Log: Reduce diff with linux 3.8.13 on i915 headers Modified: head/sys/dev/drm2/i915/intel_drv.h head/sys/dev/drm2/i915/intel_ringbuffer.h head/sys/dev/drm2/i915/intel_sdvo_regs.h Modified: head/sys/dev/drm2/i915/intel_drv.h ============================================================================== --- head/sys/dev/drm2/i915/intel_drv.h Sat Sep 5 22:54:02 2015 (r287495) +++ head/sys/dev/drm2/i915/intel_drv.h Sat Sep 5 23:22:59 2015 (r287496) @@ -73,6 +73,10 @@ #define KHz(x) (1000*x) #define MHz(x) KHz(1000*x) +/* + * Display related stuff + */ + /* store information about an Ixxx DVO */ /* The i830->i865 use multiple DVOs with multiple i2cs */ /* the i915, i945 have a single sDVO i2c bus - which is different */ @@ -94,6 +98,7 @@ #define INTEL_OUTPUT_HDMI 6 #define INTEL_OUTPUT_DISPLAYPORT 7 #define INTEL_OUTPUT_EDP 8 +#define INTEL_OUTPUT_UNKNOWN 9 /* Intel Pipe Clone Bit */ #define INTEL_HDMIB_CLONE_BIT 1 Modified: head/sys/dev/drm2/i915/intel_ringbuffer.h ============================================================================== --- head/sys/dev/drm2/i915/intel_ringbuffer.h Sat Sep 5 22:54:02 2015 (r287495) +++ head/sys/dev/drm2/i915/intel_ringbuffer.h Sat Sep 5 23:22:59 2015 (r287496) @@ -5,6 +5,17 @@ #ifndef _INTEL_RINGBUFFER_H_ #define _INTEL_RINGBUFFER_H_ +/* + * Gen2 BSpec "1. Programming Environment" / 1.4.4.6 "Ring Buffer Use" + * Gen3 BSpec "vol1c Memory Interface Functions" / 2.3.4.5 "Ring Buffer Use" + * Gen4+ BSpec "vol1c Memory Interface and Command Stream" / 5.3.4.5 "Ring Buffer Use" + * + * "If the Ring Buffer Head Pointer and the Tail Pointer are on the same + * cacheline, the Head Pointer must not be greater than the Tail + * Pointer." + */ +#define I915_RING_FREE_SPACE 64 + struct intel_hw_status_page { u32 *page_addr; unsigned int gfx_addr; @@ -60,7 +71,7 @@ struct intel_ring_buffer { */ u32 last_retired_head; - u32 irq_refcount; + u32 irq_refcount; /* protected by dev_priv->irq_lock */ u32 irq_enable_mask; /* bitmask to enable ring interrupt */ u32 trace_irq_seqno; u32 sync_seqno[I915_NUM_RINGS-1]; @@ -79,14 +90,15 @@ struct intel_ring_buffer { uint32_t (*get_seqno)(struct intel_ring_buffer *ring); int (*dispatch_execbuffer)(struct intel_ring_buffer *ring, uint32_t offset, uint32_t length); +#define I915_DISPATCH_SECURE 0x1 +#define I915_DISPATCH_PINNED 0x2 void (*cleanup)(struct intel_ring_buffer *ring); int (*sync_to)(struct intel_ring_buffer *ring, struct intel_ring_buffer *to, u32 seqno); - + u32 semaphore_register[3]; /*our mbox written by others */ u32 signal_mbox[2]; /* mboxes this ring signals to */ - /** * List of objects currently involved in rendering from the * ringbuffer. @@ -162,10 +174,10 @@ intel_ring_sync_index(struct intel_ring_ return idx; } -static inline uint32_t -intel_read_status_page(struct intel_ring_buffer *ring, int reg) +static inline u32 +intel_read_status_page(struct intel_ring_buffer *ring, + int reg) { - /* Ensure that the compiler doesn't optimize away the load. */ __compiler_membar(); return (atomic_load_acq_32(ring->status_page.page_addr + reg)); @@ -183,7 +195,7 @@ static inline int intel_wait_ring_idle(s int intel_ring_begin(struct intel_ring_buffer *ring, int n); static inline void intel_ring_emit(struct intel_ring_buffer *ring, - uint32_t data) + u32 data) { *(volatile uint32_t *)((char *)ring->virtual_start + ring->tail) = data; Modified: head/sys/dev/drm2/i915/intel_sdvo_regs.h ============================================================================== --- head/sys/dev/drm2/i915/intel_sdvo_regs.h Sat Sep 5 22:54:02 2015 (r287495) +++ head/sys/dev/drm2/i915/intel_sdvo_regs.h Sat Sep 5 23:22:59 2015 (r287496) @@ -63,6 +63,11 @@ struct intel_sdvo_caps { u16 output_flags; } __attribute__((packed)); +/* Note: SDVO detailed timing flags match EDID misc flags. */ +#define DTD_FLAG_HSYNC_POSITIVE (1 << 1) +#define DTD_FLAG_VSYNC_POSITIVE (1 << 2) +#define DTD_FLAG_INTERLACE (1 << 7) + /** This matches the EDID DTD structure, more or less */ struct intel_sdvo_dtd { struct { @@ -705,6 +710,8 @@ struct intel_sdvo_enhancements_arg { #define SDVO_CMD_SET_AUDIO_STAT 0x91 #define SDVO_CMD_GET_AUDIO_STAT 0x92 #define SDVO_CMD_SET_HBUF_INDEX 0x93 + #define SDVO_HBUF_INDEX_ELD 0 + #define SDVO_HBUF_INDEX_AVI_IF 1 #define SDVO_CMD_GET_HBUF_INDEX 0x94 #define SDVO_CMD_GET_HBUF_INFO 0x95 #define SDVO_CMD_SET_HBUF_AV_SPLIT 0x96