From owner-svn-src-all@freebsd.org Sun Sep 11 01:11:48 2016 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 D835ABCF3E4; Sun, 11 Sep 2016 01:11:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 971A2F8C; Sun, 11 Sep 2016 01:11:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8B1BlS5013523; Sun, 11 Sep 2016 01:11:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8B1BlPX013522; Sun, 11 Sep 2016 01:11:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609110111.u8B1BlPX013522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 11 Sep 2016 01:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305690 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 01:11:48 -0000 Author: emaste Date: Sun Sep 11 01:11:47 2016 New Revision: 305690 URL: https://svnweb.freebsd.org/changeset/base/305690 Log: cap_enter.2: describe flag returned by cap_getmode Previously the flag returned by cap_getmode was not described explicitly in the man page. Reviewed by: wblock Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7822 Modified: head/lib/libc/sys/cap_enter.2 Modified: head/lib/libc/sys/cap_enter.2 ============================================================================== --- head/lib/libc/sys/cap_enter.2 Sat Sep 10 17:45:35 2016 (r305689) +++ head/lib/libc/sys/cap_enter.2 Sun Sep 11 01:11:47 2016 (r305690) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd September 10, 2016 .Dt CAP_ENTER 2 .Os .Sh NAME @@ -84,6 +84,11 @@ to create a runtime environment inside t acquired rights as possible. .Sh RETURN VALUES .Rv -std cap_enter cap_getmode +.Pp +When the process is in capability mode, +.Fn cap_getmode +sets the flag to a non-zero value. +A zero value means the process is not in capability mode. .Sh ERRORS The .Fn cap_enter From owner-svn-src-all@freebsd.org Sun Sep 11 07:24:14 2016 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 309B4BD6714; Sun, 11 Sep 2016 07:24:14 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E164990; Sun, 11 Sep 2016 07:24:13 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8B7ODIj057899; Sun, 11 Sep 2016 07:24:13 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8B7ODI1057898; Sun, 11 Sep 2016 07:24:13 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609110724.u8B7ODI1057898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sun, 11 Sep 2016 07:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305691 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 07:24:14 -0000 Author: kevlo Date: Sun Sep 11 07:24:12 2016 New Revision: 305691 URL: https://svnweb.freebsd.org/changeset/base/305691 Log: MFC r305575: In m_devget(), if the data fits in a packet header mbuf, check the amount of data is less than or equal to MHLEN instead of MLEN when placing initial small packet header at end of mbuf. Reviewed by: glebius Modified: stable/11/sys/kern/uipc_mbuf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mbuf.c ============================================================================== --- stable/11/sys/kern/uipc_mbuf.c Sun Sep 11 01:11:47 2016 (r305690) +++ stable/11/sys/kern/uipc_mbuf.c Sun Sep 11 07:24:12 2016 (r305691) @@ -984,7 +984,7 @@ m_devget(char *buf, int totlen, int off, len = MHLEN; /* Place initial small packet/header at end of mbuf */ - if (m && totlen + off + max_linkhdr <= MLEN) { + if (m && totlen + off + max_linkhdr <= MHLEN) { m->m_data += max_linkhdr; len -= max_linkhdr; } From owner-svn-src-all@freebsd.org Sun Sep 11 09:14:08 2016 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 B6618BD4723; Sun, 11 Sep 2016 09:14:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 781CB7DB; Sun, 11 Sep 2016 09:14:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8B9E7O0000396; Sun, 11 Sep 2016 09:14:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8B9E7FW000392; Sun, 11 Sep 2016 09:14:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609110914.u8B9E7FW000392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 11 Sep 2016 09:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305692 - in head: share/man/man9 sys/amd64/amd64 sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 09:14:08 -0000 Author: kib Date: Sun Sep 11 09:14:07 2016 New Revision: 305692 URL: https://svnweb.freebsd.org/changeset/base/305692 Log: Add FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64. The flag specifies that the block which uses FPU must be executed in critical section, i.e. take no context switches, and does not need an FPU save area during the execution. It is intended to be applied around fast and short code pathes where save area allocation is impossible or undesirable, due to context or due to the relative cost of calculation vs. allocation. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/share/man/man9/fpu_kern.9 head/sys/amd64/amd64/fpu.c head/sys/amd64/include/fpu.h head/sys/amd64/include/pcb.h Modified: head/share/man/man9/fpu_kern.9 ============================================================================== --- head/share/man/man9/fpu_kern.9 Sun Sep 11 07:24:12 2016 (r305691) +++ head/share/man/man9/fpu_kern.9 Sun Sep 11 09:14:07 2016 (r305692) @@ -120,6 +120,16 @@ could be used from both kernel thread an The .Fn fpu_kern_leave function correctly handles such contexts. +.It Dv FPU_KERN_NOCTX +Avoid nesting save area. +If the flag is specified, the +.Fa ctx +must be passed as +.Va NULL . +The flag should only be used for really short code blocks +which can be executed in a critical section. +It avoids the need to allocate the FPU context by the cost +of increased system latency. .El .El .Pp Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sun Sep 11 07:24:12 2016 (r305691) +++ head/sys/amd64/amd64/fpu.c Sun Sep 11 09:14:07 2016 (r305692) @@ -633,6 +633,8 @@ fpudna(void) */ critical_enter(); + KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, + ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); if (PCPU_GET(fpcurthread) == curthread) { printf("fpudna: fpcurthread == curthread\n"); stop_emulating(); @@ -964,13 +966,39 @@ fpu_kern_enter(struct thread *td, struct { struct pcb *pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("using inuse ctx")); + pcb = td->td_pcb; + KASSERT((flags & FPU_KERN_NOCTX) != 0 || ctx != NULL, + ("ctx is required when !FPU_KERN_NOCTX")); + KASSERT(ctx == NULL || (ctx->flags & FPU_KERN_CTX_INUSE) == 0, + ("using inuse ctx")); + KASSERT((pcb->pcb_flags & PCB_FPUNOSAVE) == 0, + ("recursive fpu_kern_enter while in PCB_FPUNOSAVE state")); + if ((flags & FPU_KERN_NOCTX) != 0) { + critical_enter(); + stop_emulating(); + if (curthread == PCPU_GET(fpcurthread)) { + fpusave(curpcb->pcb_save); + PCPU_SET(fpcurthread, NULL); + } else { + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("invalid fpcurthread")); + } + + /* + * This breaks XSAVEOPT tracker, but + * PCB_FPUNOSAVE state is supposed to never need to + * save FPU context at all. + */ + fpurestore(fpu_initialstate); + set_pcb_flags(pcb, PCB_KERNFPU | PCB_FPUNOSAVE | + PCB_FPUINITDONE); + return (0); + } if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { ctx->flags = FPU_KERN_CTX_DUMMY | FPU_KERN_CTX_INUSE; return (0); } - pcb = td->td_pcb; KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == get_pcb_user_save_pcb(pcb), ("mangled pcb_save")); ctx->flags = FPU_KERN_CTX_INUSE; @@ -989,19 +1017,34 @@ fpu_kern_leave(struct thread *td, struct { struct pcb *pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, - ("leaving not inuse ctx")); - ctx->flags &= ~FPU_KERN_CTX_INUSE; - - if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) - return (0); - KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx")); pcb = td->td_pcb; - critical_enter(); - if (curthread == PCPU_GET(fpcurthread)) - fpudrop(); - critical_exit(); - pcb->pcb_save = ctx->prev; + + if ((pcb->pcb_flags & PCB_FPUNOSAVE) != 0) { + KASSERT(ctx == NULL, ("non-null ctx after FPU_KERN_NOCTX")); + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("non-NULL fpcurthread for PCB_FPUNOSAVE")); + CRITICAL_ASSERT(td); + + clear_pcb_flags(pcb, PCB_FPUNOSAVE | PCB_FPUINITDONE); + start_emulating(); + critical_exit(); + } else { + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, + ("leaving not inuse ctx")); + ctx->flags &= ~FPU_KERN_CTX_INUSE; + + if (is_fpu_kern_thread(0) && + (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); + KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, + ("dummy ctx")); + critical_enter(); + if (curthread == PCPU_GET(fpcurthread)) + fpudrop(); + critical_exit(); + pcb->pcb_save = ctx->prev; + } + if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) { set_pcb_flags(pcb, PCB_FPUINITDONE); Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Sun Sep 11 07:24:12 2016 (r305691) +++ head/sys/amd64/include/fpu.h Sun Sep 11 09:14:07 2016 (r305692) @@ -86,6 +86,7 @@ void fpu_save_area_reset(struct savefpu #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 #define FPU_KERN_KTHR 0x0002 +#define FPU_KERN_NOCTX 0x0004 #endif Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Sun Sep 11 07:24:12 2016 (r305691) +++ head/sys/amd64/include/pcb.h Sun Sep 11 09:14:07 2016 (r305692) @@ -83,6 +83,7 @@ struct pcb { #define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ +#define PCB_FPUNOSAVE 0x80 /* no save area for current FPU ctx */ uint16_t pcb_initial_fpucw; From owner-svn-src-all@freebsd.org Sun Sep 11 14:19:07 2016 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 F3023BD6A8A; Sun, 11 Sep 2016 14:19:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A60E6B; Sun, 11 Sep 2016 14:19:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BEJ6VO013530; Sun, 11 Sep 2016 14:19:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BEJ6DL013529; Sun, 11 Sep 2016 14:19:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609111419.u8BEJ6DL013529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 11 Sep 2016 14:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305693 - in stable: 10/contrib/gcclibs/libcpp 11/contrib/gcclibs/libcpp 9/contrib/gcclibs/libcpp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 14:19:08 -0000 Author: dim Date: Sun Sep 11 14:19:06 2016 New Revision: 305693 URL: https://svnweb.freebsd.org/changeset/base/305693 Log: MFC r305430: Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable way. Modified: stable/11/contrib/gcclibs/libcpp/system.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/gcclibs/libcpp/system.h stable/9/contrib/gcclibs/libcpp/system.h Directory Properties: stable/10/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/11/contrib/gcclibs/libcpp/system.h ============================================================================== --- stable/11/contrib/gcclibs/libcpp/system.h Sun Sep 11 09:14:07 2016 (r305692) +++ stable/11/contrib/gcclibs/libcpp/system.h Sun Sep 11 14:19:06 2016 (r305693) @@ -347,9 +347,12 @@ extern void abort (void); ??? C99 designated initializers are not supported by most C++ compilers, including G++. -- gdr, 2005-05-18 */ #if !defined(HAVE_DESIGNATED_INITIALIZERS) -#define HAVE_DESIGNATED_INITIALIZERS \ - ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ - || (__STDC_VERSION__ >= 199901L)) +# if (!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ + ||(__STDC_VERSION__ >= 199901L) +# define HAVE_DESIGNATED_INITIALIZERS 1 +# else +# define HAVE_DESIGNATED_INITIALIZERS 0 +# endif #endif /* Be conservative and only use enum bitfields with GCC. From owner-svn-src-all@freebsd.org Sun Sep 11 14:19:08 2016 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 277B9BD6A8E; Sun, 11 Sep 2016 14:19:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED927E6C; Sun, 11 Sep 2016 14:19:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BEJ7lA013536; Sun, 11 Sep 2016 14:19:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BEJ7mK013535; Sun, 11 Sep 2016 14:19:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609111419.u8BEJ7mK013535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 11 Sep 2016 14:19:07 +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: r305693 - in stable: 10/contrib/gcclibs/libcpp 11/contrib/gcclibs/libcpp 9/contrib/gcclibs/libcpp 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 14:19:08 -0000 Author: dim Date: Sun Sep 11 14:19:06 2016 New Revision: 305693 URL: https://svnweb.freebsd.org/changeset/base/305693 Log: MFC r305430: Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable way. Modified: stable/10/contrib/gcclibs/libcpp/system.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/gcclibs/libcpp/system.h stable/9/contrib/gcclibs/libcpp/system.h Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/10/contrib/gcclibs/libcpp/system.h ============================================================================== --- stable/10/contrib/gcclibs/libcpp/system.h Sun Sep 11 09:14:07 2016 (r305692) +++ stable/10/contrib/gcclibs/libcpp/system.h Sun Sep 11 14:19:06 2016 (r305693) @@ -347,9 +347,12 @@ extern void abort (void); ??? C99 designated initializers are not supported by most C++ compilers, including G++. -- gdr, 2005-05-18 */ #if !defined(HAVE_DESIGNATED_INITIALIZERS) -#define HAVE_DESIGNATED_INITIALIZERS \ - ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ - || (__STDC_VERSION__ >= 199901L)) +# if (!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ + ||(__STDC_VERSION__ >= 199901L) +# define HAVE_DESIGNATED_INITIALIZERS 1 +# else +# define HAVE_DESIGNATED_INITIALIZERS 0 +# endif #endif /* Be conservative and only use enum bitfields with GCC. From owner-svn-src-all@freebsd.org Sun Sep 11 14:19:07 2016 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 BD3EBBD6A86; Sun, 11 Sep 2016 14:19:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC19E6A; Sun, 11 Sep 2016 14:19:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BEJ6B6013524; Sun, 11 Sep 2016 14:19:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BEJ62k013523; Sun, 11 Sep 2016 14:19:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609111419.u8BEJ62k013523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 11 Sep 2016 14:19: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: r305693 - in stable: 10/contrib/gcclibs/libcpp 11/contrib/gcclibs/libcpp 9/contrib/gcclibs/libcpp 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 14:19:07 -0000 Author: dim Date: Sun Sep 11 14:19:06 2016 New Revision: 305693 URL: https://svnweb.freebsd.org/changeset/base/305693 Log: MFC r305430: Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable way. Modified: stable/9/contrib/gcclibs/libcpp/system.h Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/gcclibs/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/gcclibs/libcpp/system.h stable/11/contrib/gcclibs/libcpp/system.h Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/system.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/system.h Sun Sep 11 09:14:07 2016 (r305692) +++ stable/9/contrib/gcclibs/libcpp/system.h Sun Sep 11 14:19:06 2016 (r305693) @@ -347,9 +347,12 @@ extern void abort (void); ??? C99 designated initializers are not supported by most C++ compilers, including G++. -- gdr, 2005-05-18 */ #if !defined(HAVE_DESIGNATED_INITIALIZERS) -#define HAVE_DESIGNATED_INITIALIZERS \ - ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ - || (__STDC_VERSION__ >= 199901L)) +# if (!defined(__cplusplus) && (GCC_VERSION >= 2007)) \ + ||(__STDC_VERSION__ >= 199901L) +# define HAVE_DESIGNATED_INITIALIZERS 1 +# else +# define HAVE_DESIGNATED_INITIALIZERS 0 +# endif #endif /* Be conservative and only use enum bitfields with GCC. From owner-svn-src-all@freebsd.org Sun Sep 11 14:50:01 2016 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 5D16FBD64F5; Sun, 11 Sep 2016 14:50:01 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::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 D129098; Sun, 11 Sep 2016 14:50:00 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id l131so72162209lfl.2; Sun, 11 Sep 2016 07:50:00 -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-disposition:in-reply-to:user-agent; bh=lmqp2v1Clc7JzdTPiqlfqrO11z5UqtK761SAtgFMgj4=; b=HKfBahnyEQ7YhTVokT+OcruDuERWVrj+t4p0F9vGLHH+NKdszoZerU5Ver1sOEXTVJ LeY8riKR8dn83fhRhCMkDeoWhAF+H5KS7apwTJSCPBOA2MTU/upwbEGhAlt6hpcqRkem Al+iNy4TYqNqWcAQ7Od0DxRtRETsNAlCLXiTdplQjle/dYAL/2DOeJ8BgH39AwnfNWrX NYsVTjel4cqqdxjT29GBfodDL2DzSnTZpd+Fy+VEDJhz9F9hUYIK4/UHMbptSeKT+V2k FZDOP1wJh8qyK3nblXBSsD+yoRomypJgR2WI6cUfWZaZsNQeR7lipo6S4ltvRRpvp81I RItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=lmqp2v1Clc7JzdTPiqlfqrO11z5UqtK761SAtgFMgj4=; b=cLjGGHICqyjxkmZIhwKJYoLChKEgm+1oIhPoHoOnrd59TQe7I0EfHxPk7FnEgfP5vA pWSDmEfLqSvFRFcxS0Y6fZ6qdetODcH8M8MK/CCUIaNau1KjQ1w/YrqXTP13ama3QqRX 5UPDd41dzgTGZtvtXbN0IKiriiJKZhuvT6d2fZL8BJVoRivF03NT3PedPMSkP1LY7iZz NC4sRwhsuHpA08NAQrIWBJ8oNqifoh5aTG29VRtRfDTxWc+2hyiUk9oCF+x4yww6Mpd5 ADYvz4YoW1MAOcZTVpvXXaK1WGHp0c8qPeZ+qaaGum+k1JiYFze7f7L0k0Syj0wucqh5 aLxA== X-Gm-Message-State: AE9vXwMbj6iAI8bZsWPGQONo4hjvEIGD8Qvpb+Sgrwwu3fiFipt8s2igtTMzSnXptZ3wRA== X-Received: by 10.25.142.203 with SMTP id q194mr3987160lfd.11.1473605398073; Sun, 11 Sep 2016 07:49:58 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id j196sm461364lfg.9.2016.09.11.07.49.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Sep 2016 07:49:57 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 11 Sep 2016 16:49:55 +0200 From: Baptiste Daroussin To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk Message-ID: <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> References: <201608251940.u7PJePv3023083@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qpafpqfkoojpvp2p" Content-Disposition: inline In-Reply-To: <201608251940.u7PJePv3023083@repo.freebsd.org> User-Agent: Mutt/1.6.2-neo (2016-08-08) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 14:50:01 -0000 --qpafpqfkoojpvp2p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 25, 2016 at 07:40:25PM +0000, Kristof Provost wrote: > Author: kp > Date: Thu Aug 25 19:40:25 2016 > New Revision: 304815 > URL: https://svnweb.freebsd.org/changeset/base/304815 >=20 > Log: > Add libifc, a library implementing core functionality that exists in if= config(8) today. > =20 > libifc (pronounced lib-ifconfig) aims to be a light abstraction layer b= etween > programs and the kernel APIs for managing the network configuration. > This should hopefully make programs easier to maintain, and reduce code > duplication. > =20 > Work will begin on making ifconfig(8) use this library in the near futu= re. > =20 > This code is still evolving. The interface should not be considered sta= ble until > it is announced as such. > =20 Sorry I come to this very late but: If it is not stable yet, it would probably be a good idea to make it a privatelib, so even if we end up shipping a release with the lib before considered stable we are safe updating it? It won't prevent any usage one can imagine in base. The private flag can be dropped once it is considered stable Best regards, Bapt --qpafpqfkoojpvp2p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX1W8PAAoJEGOJi9zxtz5aEQcQAOFzFj/CLDUk7kcvR6Rmg1xU Rvb/ow4+L7T7XZPQXk94eREX61JPh71Ibd9eJNbq5BMQF0R1FQ7at549oSkEfLta zhsxuVF2oy5f3eRPCuw/V9XKOaSwu4ZEQ0VVnp5F6fyz0ByhA0+kcD00V/Q0Jpnp SpgiZDduQzbfWfoPpra6DgvNuU1MmfoBYtAAZdWU6bjnSELYkDCQD12p4dofwn2p hrSkhQ8UaCeW9hgG6PUtMPFTpNWf/yYiMYIVWb4LgRS3nD7oqZ/RQIBJONKm7Rz5 /vUXIL7m7ZswvuoD3azwFUQq8GlssKRx9n1l97zOxexzJ3g8jxLln0/ggonW2iFz 4UNNcPnkENKktqfeQxNYtxns0ETMjFr4C8DQzfrce7UakpAjdGeMM1c92qUwI3mk Gch7sueZQi0aKEcjSE9ov2fZ9M7AdJfb6aRl0X4f9e0Eu721+/vaNBlrB1u5liiC WEZut/mQiiUTDBLIkEHdnZkSkqO3Gh83YGuWaG6ELQrj+OgZccOLe8HxJlG4FN6e S3w0Q8S/8+PCYZbQPFwbSHsALI+EpSyM+D6mnTCpjumk6CPI/Dc2DQQQsXcU+bFY RZTZiE/1gp4I1Wi97l5lvQsFVIglnOSEqgW4boHoOpXGYs5qkRffWwl/nX4ScBZs KhwB1fgdDifzdgcHP6Fl =V6oX -----END PGP SIGNATURE----- --qpafpqfkoojpvp2p-- From owner-svn-src-all@freebsd.org Sun Sep 11 15:55:14 2016 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 A08AEBD661F; Sun, 11 Sep 2016 15:55:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE5DF1; Sun, 11 Sep 2016 15:55:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BFtDEM051711; Sun, 11 Sep 2016 15:55:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BFtCRY051694; Sun, 11 Sep 2016 15:55:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201609111555.u8BFtCRY051694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 11 Sep 2016 15:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 15:55:14 -0000 Author: pfg Date: Sun Sep 11 15:55:11 2016 New Revision: 305694 URL: https://svnweb.freebsd.org/changeset/base/305694 Log: Update OpenRCS to version 20160831 Obtained from: OpenBSD Modified: vendor/OpenBSD/dist/usr.bin/rcs/buf.c vendor/OpenBSD/dist/usr.bin/rcs/ci.c vendor/OpenBSD/dist/usr.bin/rcs/co.c vendor/OpenBSD/dist/usr.bin/rcs/date.y vendor/OpenBSD/dist/usr.bin/rcs/diff.c vendor/OpenBSD/dist/usr.bin/rcs/diff3.c vendor/OpenBSD/dist/usr.bin/rcs/ident.c vendor/OpenBSD/dist/usr.bin/rcs/merge.c vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 vendor/OpenBSD/dist/usr.bin/rcs/rcs.c vendor/OpenBSD/dist/usr.bin/rcs/rcs.h vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c vendor/OpenBSD/dist/usr.bin/rcs/rcsprog.c vendor/OpenBSD/dist/usr.bin/rcs/rcstime.c vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.c vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.h vendor/OpenBSD/dist/usr.bin/rcs/rlog.1 vendor/OpenBSD/dist/usr.bin/rcs/rlog.c vendor/OpenBSD/dist/usr.bin/rcs/worklist.c vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.c vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.h Modified: vendor/OpenBSD/dist/usr.bin/rcs/buf.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/buf.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/buf.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.24 2015/02/05 12:59:58 millert Exp $ */ +/* $OpenBSD: buf.c,v 1.26 2015/11/02 16:45:21 nicm Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau * All rights reserved. @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -137,15 +138,16 @@ out: void buf_free(BUF *b) { - if (b->cb_buf != NULL) - xfree(b->cb_buf); - xfree(b); + if (b == NULL) + return; + free(b->cb_buf); + free(b); } /* * Free the buffer 's structural information but do not free the contents * of the buffer. Instead, they are returned and should be freed later using - * xfree(). + * free(). */ void * buf_release(BUF *b) @@ -153,7 +155,7 @@ buf_release(BUF *b) void *tmp; tmp = b->cb_buf; - xfree(b); + free(b); return (tmp); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/ci.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/ci.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/ci.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.219 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: ci.c,v 1.224 2016/07/04 01:39:12 millert Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins * All rights reserved. @@ -210,8 +210,7 @@ checkin_main(int argc, char **argv) printf("%s\n", rcs_version); exit(0); case 'w': - if (pb.author != NULL) - xfree(pb.author); + free(pb.author); pb.author = xstrdup(rcs_optarg); break; case 'x': @@ -280,7 +279,7 @@ checkin_main(int argc, char **argv) errx(1, "failed to open rcsfile `%s'", pb.fpath); if ((pb.flags & DESCRIPTION) && - rcs_set_description(pb.file, pb.description) == -1) + rcs_set_description(pb.file, pb.description, pb.flags) == -1) err(1, "%s", pb.filename); if (!(pb.flags & QUIET)) @@ -370,16 +369,11 @@ checkin_diff_file(struct checkin_params return (b3); out: - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); - if (b3 != NULL) - buf_free(b3); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); + buf_free(b1); + buf_free(b2); + buf_free(b3); + free(path1); + free(path2); return (NULL); } @@ -412,7 +406,7 @@ checkin_getlogmsg(RCSNUM *rev, RCSNUM *r (void)fprintf(stderr, "new revision: %s; " "previous revision: %s\n", nrev, prev); - rcs_msg = rcs_prompt(prompt); + rcs_msg = rcs_prompt(prompt, flags); return (rcs_msg); } @@ -511,7 +505,7 @@ checkin_update(struct checkin_params *pb fprintf(stderr, "reuse log message of previous file? [yn](y): "); if (rcs_yesno('y') != 'y') { - xfree(pb->rcs_msg); + free(pb->rcs_msg); pb->rcs_msg = NULL; } } @@ -584,7 +578,7 @@ checkin_update(struct checkin_params *pb pb->username, pb->author, NULL, NULL); if ((pb->flags & INTERACTIVE) && (pb->rcs_msg[0] == '\0')) { - xfree(pb->rcs_msg); /* free empty log message */ + free(pb->rcs_msg); /* free empty log message */ pb->rcs_msg = NULL; } @@ -627,7 +621,7 @@ checkin_init(struct checkin_params *pb) /* Get description from user */ if (pb->description == NULL && - rcs_set_description(pb->file, NULL) == -1) { + rcs_set_description(pb->file, NULL, pb->flags) == -1) { warn("%s", pb->filename); return (-1); } @@ -734,7 +728,7 @@ checkin_attach_symbol(struct checkin_par } } } - if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) && + if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev)) == -1 && (rcs_errno == RCS_ERR_DUPENT)) { rcsnum_tostr(rcs_sym_getrev(pb->file, pb->symbol), rbuf, sizeof(rbuf)); @@ -988,25 +982,22 @@ checkin_parsekeyword(char *keystring, RC (void)xasprintf(&datestring, "%s %s", tokens[3], tokens[4]); if ((*date = date_parse(datestring)) == -1) errx(1, "could not parse date"); - xfree(datestring); + free(datestring); if (i < 6) break; - if (*author != NULL) - xfree(*author); + free(*author); *author = xstrdup(tokens[5]); if (i < 7) break; - if (*state != NULL) - xfree(*state); + free(*state); *state = xstrdup(tokens[6]); break; case KW_TYPE_AUTHOR: if (i < 2) break; - if (*author != NULL) - xfree(*author); + free(*author); *author = xstrdup(tokens[1]); break; case KW_TYPE_DATE: @@ -1015,13 +1006,12 @@ checkin_parsekeyword(char *keystring, RC (void)xasprintf(&datestring, "%s %s", tokens[1], tokens[2]); if ((*date = date_parse(datestring)) == -1) errx(1, "could not parse date"); - xfree(datestring); + free(datestring); break; case KW_TYPE_STATE: if (i < 2) break; - if (*state != NULL) - xfree(*state); + free(*state); *state = xstrdup(tokens[1]); break; case KW_TYPE_REVISION: Modified: vendor/OpenBSD/dist/usr.bin/rcs/co.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/co.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/co.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.120 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: co.c,v 1.122 2015/10/21 16:06:57 millert Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -515,7 +515,7 @@ checkout_err_nobranch(RCSFILE *file, con file->rf_path, date ? " a date before " : "", date ? date : "", - author ? " and author " + (date ? 0:4 ) : "", + author ? " and author " + (date ? 0:4) : "", author ? author : "", state ? " and state " + (date || author ? 0:4) : "", state ? state : ""); @@ -554,7 +554,7 @@ checkout_file_has_diffs(RCSFILE *rfp, RC buf_free(bp); unlink(tempfile); - xfree(tempfile); + free(tempfile); return (ret); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/date.y ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/date.y Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/date.y Sun Sep 11 15:55:11 2016 (r305694) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.12 2013/12/03 00:21:49 deraadt Exp $ */ +/* $OpenBSD: date.y,v 1.14 2016/08/26 09:02:54 guenther Exp $ */ /* ** Originally written by Steven M. Bellovin while @@ -17,6 +17,7 @@ #include #include #include +#include #include "rcsprog.h" @@ -494,7 +495,7 @@ yyerror(const char *s) s, yyInput); warnx("%s", str); - xfree(str); + free(str); return (0); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/diff.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/diff.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/diff.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.37 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: diff.c,v 1.38 2015/06/13 20:15:21 nicm Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -374,13 +375,13 @@ diffreg(const char *file1, const char *f clistlen = 100; clist = xcalloc(clistlen, sizeof(*clist)); i = stone(class, slen[0], member, klist, flags); - xfree(member); - xfree(class); + free(member); + free(class); J = xreallocarray(J, len[0] + 2, sizeof(*J)); unravel(klist[i]); - xfree(clist); - xfree(klist); + free(clist); + free(klist); ixold = xreallocarray(ixold, len[0] + 2, sizeof(*ixold)); ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); @@ -769,7 +770,7 @@ unsort(struct line *f, int l, int *b) a[f[i].serial] = f[i].value; for (i = 1; i <= l; i++) b[i] = a[i]; - xfree(a); + free(a); } static int @@ -860,7 +861,7 @@ ignoreline(char *line) int ret; ret = regexec(diff_ignore_re, line, 0, NULL, 0); - xfree(line); + free(line); return (ret == 0); /* if it matched, it should be ignored. */ } @@ -1383,5 +1384,5 @@ diff_output(const char *fmt, ...) buf_append(diffbuf, str, strlen(str)); else printf("%s", str); - xfree(str); + free(str); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/diff3.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/diff3.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/diff3.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.35 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: diff3.c,v 1.39 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -69,6 +69,7 @@ #include #include #include +#include #include #include "diff.h" @@ -234,14 +235,10 @@ merge_diff3(char **av, int flags) warnx("warning: overlaps or other problems during merge"); out: - if (b2 != NULL) - buf_free(b2); - if (b3 != NULL) - buf_free(b3); - if (d1 != NULL) - buf_free(d1); - if (d2 != NULL) - buf_free(d2); + buf_free(b2); + buf_free(b3); + buf_free(d1); + buf_free(d2); (void)unlink(path1); (void)unlink(path2); @@ -249,20 +246,13 @@ out: (void)unlink(dp13); (void)unlink(dp23); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); - if (path3 != NULL) - xfree(path3); - if (dp13 != NULL) - xfree(dp13); - if (dp23 != NULL) - xfree(dp23); - if (data != NULL) - xfree(data); - if (patch != NULL) - xfree(patch); + free(path1); + free(path2); + free(path3); + free(dp13); + free(dp23); + free(data); + free(patch); return (diffb); } @@ -361,14 +351,10 @@ rcs_diff3(RCSFILE *rf, char *workfile, R warnx("warning: overlaps or other problems during merge"); out: - if (b2 != NULL) - buf_free(b2); - if (b3 != NULL) - buf_free(b3); - if (d1 != NULL) - buf_free(d1); - if (d2 != NULL) - buf_free(d2); + buf_free(b2); + buf_free(b3); + buf_free(d1); + buf_free(d2); (void)unlink(path1); (void)unlink(path2); @@ -376,20 +362,13 @@ out: (void)unlink(dp13); (void)unlink(dp23); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); - if (path3 != NULL) - xfree(path3); - if (dp13 != NULL) - xfree(dp13); - if (dp23 != NULL) - xfree(dp23); - if (data != NULL) - xfree(data); - if (patch != NULL) - xfree(patch); + free(path1); + free(path2); + free(path3); + free(dp13); + free(dp23); + free(data); + free(patch); return (diffb); } @@ -657,7 +636,7 @@ merge(size_t m1, size_t m2) d1 = d13; d2 = d23; j = 0; - while ((t1 = d1 < d13 + m1) | (t2 = d2 < d23 + m2)) { + while ((t1 = (d1 < d13 + m1)) | (t2 = (d2 < d23 + m2))) { if (debug) { printf("%d,%d=%d,%d %d,%d=%d,%d\n", d1->old.from, d1->old.to, Modified: vendor/OpenBSD/dist/usr.bin/rcs/ident.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/ident.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/ident.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: ident.c,v 1.30 2014/10/02 06:23:15 otto Exp $ */ +/* $OpenBSD: ident.c,v 1.32 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria * All rights reserved. @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "rcsprog.h" @@ -156,8 +157,7 @@ ident_line(FILE *fp) found++; out: - if (bp != NULL) - buf_free(bp); + buf_free(bp); } __dead void Modified: vendor/OpenBSD/dist/usr.bin/rcs/merge.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/merge.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/merge.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: merge.c,v 1.9 2014/10/10 08:15:25 otto Exp $ */ +/* $OpenBSD: merge.c,v 1.10 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria * All rights reserved. @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "rcsprog.h" Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcs.1,v 1.58 2013/01/18 11:21:09 guenther Exp $ +.\" $OpenBSD: rcs.1,v 1.59 2015/09/25 15:31:24 schwarze Exp $ .\" .\" Copyright (c) 2005 Jean-Francois Brousseau .\" Copyright (c) 2005 Xavier Santolaria @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 18 2013 $ +.Dd $Mdocdate: September 25 2015 $ .Dt RCS 1 .Os .Sh NAME @@ -40,8 +40,7 @@ .Op Fl e Ns Op Ar users .Op Fl k Ns Ar mode .Op Fl l Ns Op Ar rev -.Oo Fl m Ns Ar rev : -.Ar msg Oc +.Op Fl m Ns Ar rev : Ns Ar msg .Op Fl o Ns Ar rev .Op Fl t Ns Op Ar str .Op Fl u Ns Op Ar rev Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.82 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcs.c,v 1.85 2016/05/09 13:03:55 schwarze Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -66,6 +66,7 @@ struct rcs_kw rcs_expkw[] = { { "Revision", RCS_KW_REVISION }, { "Source", RCS_KW_SOURCE }, { "State", RCS_KW_STATE }, + { "Mdocdate", RCS_KW_MDOCDATE }, }; int rcs_errno = RCS_ERR_NOERR; @@ -157,44 +158,40 @@ rcs_close(RCSFILE *rfp) while (!TAILQ_EMPTY(&(rfp->rf_access))) { rap = TAILQ_FIRST(&(rfp->rf_access)); TAILQ_REMOVE(&(rfp->rf_access), rap, ra_list); - xfree(rap->ra_name); - xfree(rap); + free(rap->ra_name); + free(rap); } while (!TAILQ_EMPTY(&(rfp->rf_symbols))) { rsp = TAILQ_FIRST(&(rfp->rf_symbols)); TAILQ_REMOVE(&(rfp->rf_symbols), rsp, rs_list); rcsnum_free(rsp->rs_num); - xfree(rsp->rs_name); - xfree(rsp); + free(rsp->rs_name); + free(rsp); } while (!TAILQ_EMPTY(&(rfp->rf_locks))) { rlp = TAILQ_FIRST(&(rfp->rf_locks)); TAILQ_REMOVE(&(rfp->rf_locks), rlp, rl_list); rcsnum_free(rlp->rl_num); - xfree(rlp->rl_name); - xfree(rlp); + free(rlp->rl_name); + free(rlp); } - if (rfp->rf_head != NULL) - rcsnum_free(rfp->rf_head); - if (rfp->rf_branch != NULL) - rcsnum_free(rfp->rf_branch); + rcsnum_free(rfp->rf_head); + rcsnum_free(rfp->rf_branch); if (rfp->rf_file != NULL) fclose(rfp->rf_file); - if (rfp->rf_path != NULL) - xfree(rfp->rf_path); - if (rfp->rf_comment != NULL) - xfree(rfp->rf_comment); - if (rfp->rf_expand != NULL) - xfree(rfp->rf_expand); - if (rfp->rf_desc != NULL) - xfree(rfp->rf_desc); + + free(rfp->rf_path); + free(rfp->rf_comment); + free(rfp->rf_expand); + free(rfp->rf_desc); if (rfp->rf_pdata != NULL) rcsparse_free(rfp); - xfree(rfp); + + free(rfp); } /* @@ -349,8 +346,7 @@ rcs_write(RCSFILE *rfp) rfp->rf_flags |= RCS_SYNCED; - if (fn != NULL) - xfree(fn); + free(fn); } /* @@ -420,7 +416,7 @@ rcs_movefile(char *from, char *to, mode_ out: (void)fclose(src); (void)fclose(dst); - xfree(buf); + free(buf); return (0); } @@ -509,8 +505,8 @@ rcs_access_remove(RCSFILE *file, const c } TAILQ_REMOVE(&(file->rf_access), ap, ra_list); - xfree(ap->ra_name); - xfree(ap); + free(ap->ra_name); + free(ap); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -582,9 +578,9 @@ rcs_sym_remove(RCSFILE *file, const char } TAILQ_REMOVE(&(file->rf_symbols), symp, rs_list); - xfree(symp->rs_name); + free(symp->rs_name); rcsnum_free(symp->rs_num); - xfree(symp); + free(symp); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -743,8 +739,8 @@ rcs_lock_remove(RCSFILE *file, const cha TAILQ_REMOVE(&(file->rf_locks), lkp, rl_list); rcsnum_free(lkp->rl_num); - xfree(lkp->rl_name); - xfree(lkp); + free(lkp->rl_name); + free(lkp); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -762,8 +758,7 @@ rcs_desc_set(RCSFILE *file, const char * char *tmp; tmp = xstrdup(desc); - if (file->rf_desc != NULL) - xfree(file->rf_desc); + free(file->rf_desc); file->rf_desc = tmp; file->rf_flags &= ~RCS_SYNCED; } @@ -779,8 +774,7 @@ rcs_comment_set(RCSFILE *file, const cha char *tmp; tmp = xstrdup(comment); - if (file->rf_comment != NULL) - xfree(file->rf_comment); + free(file->rf_comment); file->rf_comment = tmp; file->rf_flags &= ~RCS_SYNCED; } @@ -839,7 +833,7 @@ rcs_patch_lines(struct rcs_lines *dlines for (i = 0; (i < nbln) && (dlp != NULL); i++) { ndlp = TAILQ_NEXT(dlp, l_list); TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); - xfree(dlp); + free(dlp); dlp = ndlp; /* last line is gone - reset dlp */ if (dlp == NULL) { @@ -1020,7 +1014,7 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) return (NULL); rbuf = rcs_patchfile(data, dlen, patch, plen, rcs_patch_lines); - xfree(data); + free(data); if (rbuf == NULL) break; @@ -1246,10 +1240,8 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) rcs_freedelta(rdp); - if (path_tmp1 != NULL) - xfree(path_tmp1); - if (path_tmp2 != NULL) - xfree(path_tmp2); + free(path_tmp1); + free(path_tmp2); return (0); } @@ -1343,8 +1335,7 @@ rcs_kwexp_set(RCSFILE *file, int mode) } tmp = xstrdup(buf); - if (file->rf_expand != NULL) - xfree(file->rf_expand); + free(file->rf_expand); file->rf_expand = tmp; /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -1414,29 +1405,22 @@ rcs_freedelta(struct rcs_delta *rdp) { struct rcs_branch *rb; - if (rdp->rd_num != NULL) - rcsnum_free(rdp->rd_num); - if (rdp->rd_next != NULL) - rcsnum_free(rdp->rd_next); - - if (rdp->rd_author != NULL) - xfree(rdp->rd_author); - if (rdp->rd_locker != NULL) - xfree(rdp->rd_locker); - if (rdp->rd_state != NULL) - xfree(rdp->rd_state); - if (rdp->rd_log != NULL) - xfree(rdp->rd_log); - if (rdp->rd_text != NULL) - xfree(rdp->rd_text); + rcsnum_free(rdp->rd_num); + rcsnum_free(rdp->rd_next); + + free(rdp->rd_author); + free(rdp->rd_locker); + free(rdp->rd_state); + free(rdp->rd_log); + free(rdp->rd_text); while ((rb = TAILQ_FIRST(&(rdp->rd_branches))) != NULL) { TAILQ_REMOVE(&(rdp->rd_branches), rb, rb_list); rcsnum_free(rb->rb_num); - xfree(rb); + free(rb); } - xfree(rdp); + free(rdp); } /* @@ -1613,6 +1597,16 @@ rcs_expand_keywords(char *rcsfile_in, st buf_putc(newbuf, ' '); } + if (kwtype & RCS_KW_MDOCDATE) { + strftime(buf, sizeof(buf), "%B", &tb); + buf_puts(newbuf, buf); + /* Only one blank before single-digit day. */ + snprintf(buf, sizeof(buf), " %d", tb.tm_mday); + buf_puts(newbuf, buf); + strftime(buf, sizeof(buf), " %Y ", &tb); + buf_puts(newbuf, buf); + } + if (kwtype & RCS_KW_NAME) buf_putc(newbuf, ' '); @@ -1701,8 +1695,7 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM * if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - if (rdp->rd_text != NULL) - xfree(rdp->rd_text); + free(rdp->rd_text); len = buf_len(bp); dtext = buf_release(bp); @@ -1717,8 +1710,7 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM * rdp->rd_tlen = 0; } - if (dtext != NULL) - xfree(dtext); + free(dtext); return (0); } @@ -1736,8 +1728,7 @@ rcs_rev_setlog(RCSFILE *rfp, RCSNUM *rev if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - if (rdp->rd_log != NULL) - xfree(rdp->rd_log); + free(rdp->rd_log); rdp->rd_log = xstrdup(logtext); rfp->rf_flags &= ~RCS_SYNCED; @@ -1776,8 +1767,7 @@ rcs_state_set(RCSFILE *rfp, RCSNUM *rev, if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - if (rdp->rd_state != NULL) - xfree(rdp->rd_state); + free(rdp->rd_state); rdp->rd_state = xstrdup(state); Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.h ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.h Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.h Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.h,v 1.16 2013/06/03 17:04:35 jcs Exp $ */ +/* $OpenBSD: rcs.h,v 1.17 2016/05/09 13:03:55 schwarze Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -69,6 +69,7 @@ #define RCS_KW_SOURCE 0x0400 #define RCS_KW_STATE 0x0800 #define RCS_KW_FULLPATH 0x0010 +#define RCS_KW_MDOCDATE 0x0020 #define RCS_KW_LOCKER 0x10000 #define RCS_KW_ID \ Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsclean.c,v 1.54 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsclean.c,v 1.56 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "rcsprog.h" @@ -209,10 +210,8 @@ rcsclean_file(char *fname, const char *r rcs_set_mtime(file, rcs_mtime); out: - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); + buf_free(b1); + buf_free(b2); if (file != NULL) rcs_close(file); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsdiff.c,v 1.82 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsdiff.c,v 1.84 2015/11/02 16:45:21 nicm Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -250,15 +250,9 @@ rcsdiff_main(int argc, char **argv) status = rcsdiff_rev(file, rev1, rev2, dflags); rcs_close(file); - - if (rev1 != NULL) { - rcsnum_free(rev1); - rev1 = NULL; - } - if (rev2 != NULL) { - rcsnum_free(rev2); - rev2 = NULL; - } + rcsnum_free(rev1); + rcsnum_free(rev2); + rev1 = rev2 = NULL; } return (status); @@ -354,14 +348,10 @@ rcsdiff_file(RCSFILE *file, RCSNUM *rev, out: if (fd != -1) (void)close(fd); - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); + buf_free(b1); + buf_free(b2); + free(path1); + free(path2); return (ret); } @@ -433,14 +423,10 @@ rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, ret = diffreg(path1, path2, NULL, dflags); out: - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); + buf_free(b1); + buf_free(b2); + free(path1); + free(path2); return (ret); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsmerge.c,v 1.55 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsmerge.c,v 1.57 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria * All rights reserved. @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "rcsprog.h" @@ -173,12 +174,8 @@ rcsmerge_main(int argc, char **argv) out: rcs_close(file); - - if (rev1 != NULL) - rcsnum_free(rev1); - if (rev2 != NULL) - rcsnum_free(rev2); - + rcsnum_free(rev1); + rcsnum_free(rev2); return (status); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsnum.c,v 1.16 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.19 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -26,8 +26,10 @@ #include #include -#include #include +#include +#include +#include #include "rcs.h" #include "xmalloc.h" @@ -104,9 +106,10 @@ rcsnum_parse(const char *str) void rcsnum_free(RCSNUM *rn) { - if (rn->rn_id != NULL) - xfree(rn->rn_id); - xfree(rn); + if (rn == NULL) + return; + free(rn->rn_id); + free(rn); } /* @@ -331,7 +334,7 @@ rcsnum_aton(const char *str, char **ep, rcsnum_aton_failed: nump->rn_len = 0; - xfree(nump->rn_id); + free(nump->rn_id); nump->rn_id = NULL; return (-1); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsparse.c,v 1.14 2014/12/01 21:58:46 deraadt Exp $ */ +/* $OpenBSD: rcsparse.c,v 1.16 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2010 Tobias Stoeckmann * @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "rcs.h" @@ -340,11 +341,10 @@ rcsparse_free(RCSFILE *rfp) pdp = rfp->rf_pdata; - if (pdp->rp_buf != NULL) - xfree(pdp->rp_buf); + free(pdp->rp_buf); if (pdp->rp_token == RCS_TYPE_REVISION) rcsnum_free(pdp->rp_value.rev); - xfree(pdp); + free(pdp); } /* @@ -609,7 +609,7 @@ rcsparse_text(RCSFILE *rfp, struct rcs_p memcpy(pdp->rp_delta->rd_text, pdp->rp_buf, pdp->rp_delta->rd_tlen); } - xfree(pdp->rp_value.str); + free(pdp->rp_value.str); return (0); } @@ -707,7 +707,7 @@ rcsparse_symbols(RCSFILE *rfp, struct rc name = pdp->rp_value.str; if (rcsparse_token(rfp, RCS_TOK_COLON) != RCS_TOK_COLON || rcsparse_token(rfp, RCS_TYPE_NUMBER) != RCS_TYPE_NUMBER) { - xfree(name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Sep 11 16:06:18 2016 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 B50FEBD67EE; Sun, 11 Sep 2016 16:06:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85672914; Sun, 11 Sep 2016 16:06:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BG6HDW055682; Sun, 11 Sep 2016 16:06:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BG6HoB055680; Sun, 11 Sep 2016 16:06:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111606.u8BG6HoB055680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 16:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305695 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 16:06:18 -0000 Author: np Date: Sun Sep 11 16:06:17 2016 New Revision: 305695 URL: https://svnweb.freebsd.org/changeset/base/305695 Log: cxgbe(4): Set up fl_starve_threshold2 accurately for T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4vf_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 15:55:11 2016 (r305694) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 16:06:17 2016 (r305695) @@ -7866,8 +7866,10 @@ int t4_init_sge_params(struct adapter *a sp->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; if (is_t4(adapter)) sp->fl_starve_threshold2 = sp->fl_starve_threshold; - else + else if (is_t5(adapter)) sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1; + else + sp->fl_starve_threshold2 = G_T6_EGRTHRESHOLDPACKING(r) * 2 + 1; /* egress queues: log2 of # of doorbells per BAR2 page */ r = t4_read_reg(adapter, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); Modified: head/sys/dev/cxgbe/common/t4vf_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 15:55:11 2016 (r305694) +++ head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 16:06:17 2016 (r305695) @@ -130,9 +130,10 @@ int t4vf_get_sge_params(struct adapter * sp->fl_starve_threshold = G_EGRTHRESHOLD(vals[5]) * 2 + 1; if (is_t4(adapter)) sp->fl_starve_threshold2 = sp->fl_starve_threshold; + else if (is_t5(adapter)) + sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + 1; else - sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + - 1; + sp->fl_starve_threshold2 = G_T6_EGRTHRESHOLDPACKING(vals[5]) * 2 + 1; /* * We need the Queues/Page and Host Page Size for our VF. From owner-svn-src-all@freebsd.org Sun Sep 11 16:11:52 2016 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 B7222BD693D; Sun, 11 Sep 2016 16:11:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F821C40; Sun, 11 Sep 2016 16:11:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BGBpS3057217; Sun, 11 Sep 2016 16:11:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BGBptY057216; Sun, 11 Sep 2016 16:11:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111611.u8BGBptY057216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 16:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305696 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 16:11:52 -0000 Author: np Date: Sun Sep 11 16:11:51 2016 New Revision: 305696 URL: https://svnweb.freebsd.org/changeset/base/305696 Log: cxgbe(4): Use correct macro for header length with T6 ASICs. This affects the transmit of the VF driver only. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 16:06:17 2016 (r305695) +++ head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 16:11:51 2016 (r305696) @@ -229,8 +229,8 @@ static inline u_int txpkts0_len16(u_int) static inline u_int txpkts1_len16(void); static u_int write_txpkt_wr(struct sge_txq *, struct fw_eth_tx_pkt_wr *, struct mbuf *, u_int); -static u_int write_txpkt_vm_wr(struct sge_txq *, struct fw_eth_tx_pkt_vm_wr *, - struct mbuf *, u_int); +static u_int write_txpkt_vm_wr(struct adapter *, struct sge_txq *, + struct fw_eth_tx_pkt_vm_wr *, struct mbuf *, u_int); static int try_txpkts(struct mbuf *, struct mbuf *, struct txpkts *, u_int); static int add_to_txpkts(struct mbuf *, struct txpkts *, u_int); static u_int write_txpkts_wr(struct sge_txq *, struct fw_eth_tx_pkts_wr *, @@ -2460,7 +2460,8 @@ eth_tx(struct mp_ring *r, u_int cidx, u_ total++; remaining--; ETHER_BPF_MTAP(ifp, m0); - n = write_txpkt_vm_wr(txq, (void *)wr, m0, available); + n = write_txpkt_vm_wr(sc, txq, (void *)wr, m0, + available); } else if (remaining > 1 && try_txpkts(m0, r->items[next_cidx], &txp, available) == 0) { @@ -4039,8 +4040,8 @@ imm_payload(u_int ndesc) * The return value is the # of hardware descriptors used. */ static u_int -write_txpkt_vm_wr(struct sge_txq *txq, struct fw_eth_tx_pkt_vm_wr *wr, - struct mbuf *m0, u_int available) +write_txpkt_vm_wr(struct adapter *sc, struct sge_txq *txq, + struct fw_eth_tx_pkt_vm_wr *wr, struct mbuf *m0, u_int available) { struct sge_eq *eq = &txq->eq; struct tx_sdesc *txsd; @@ -4156,9 +4157,13 @@ write_txpkt_vm_wr(struct sge_txq *txq, s ("%s: mbuf %p needs checksum offload but missing header lengths", __func__, m0)); - /* XXX: T6 */ - ctrl1 |= V_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - - ETHER_HDR_LEN); + if (chip_id(sc) <= CHELSIO_T5) { + ctrl1 |= V_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN); + } else { + ctrl1 |= V_T6_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN); + } ctrl1 |= V_TXPKT_IPHDR_LEN(m0->m_pkthdr.l3hlen); ctrl1 |= V_TXPKT_CSUM_TYPE(csum_type); } else From owner-svn-src-all@freebsd.org Sun Sep 11 16:21:00 2016 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 2507DBD6CDD; Sun, 11 Sep 2016 16:21:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8D35211; Sun, 11 Sep 2016 16:20:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BGKxPV061689; Sun, 11 Sep 2016 16:20:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BGKvbi061672; Sun, 11 Sep 2016 16:20:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201609111620.u8BGKvbi061672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 11 Sep 2016 16:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305697 - vendor/OpenBSD/dist/usr.bin/rcs 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 16:21:00 -0000 Author: pfg Date: Sun Sep 11 16:20:57 2016 New Revision: 305697 URL: https://svnweb.freebsd.org/changeset/base/305697 Log: Revert r305694: This has some changes that we have no interest in. This is only for reference but we will have to chose a different snapshot. Modified: vendor/OpenBSD/dist/usr.bin/rcs/buf.c vendor/OpenBSD/dist/usr.bin/rcs/ci.c vendor/OpenBSD/dist/usr.bin/rcs/co.c vendor/OpenBSD/dist/usr.bin/rcs/date.y vendor/OpenBSD/dist/usr.bin/rcs/diff.c vendor/OpenBSD/dist/usr.bin/rcs/diff3.c vendor/OpenBSD/dist/usr.bin/rcs/ident.c vendor/OpenBSD/dist/usr.bin/rcs/merge.c vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 vendor/OpenBSD/dist/usr.bin/rcs/rcs.c vendor/OpenBSD/dist/usr.bin/rcs/rcs.h vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c vendor/OpenBSD/dist/usr.bin/rcs/rcsprog.c vendor/OpenBSD/dist/usr.bin/rcs/rcstime.c vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.c vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.h vendor/OpenBSD/dist/usr.bin/rcs/rlog.1 vendor/OpenBSD/dist/usr.bin/rcs/rlog.c vendor/OpenBSD/dist/usr.bin/rcs/worklist.c vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.c vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.h Modified: vendor/OpenBSD/dist/usr.bin/rcs/buf.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/buf.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/buf.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.26 2015/11/02 16:45:21 nicm Exp $ */ +/* $OpenBSD: buf.c,v 1.24 2015/02/05 12:59:58 millert Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau * All rights reserved. @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -138,16 +137,15 @@ out: void buf_free(BUF *b) { - if (b == NULL) - return; - free(b->cb_buf); - free(b); + if (b->cb_buf != NULL) + xfree(b->cb_buf); + xfree(b); } /* * Free the buffer 's structural information but do not free the contents * of the buffer. Instead, they are returned and should be freed later using - * free(). + * xfree(). */ void * buf_release(BUF *b) @@ -155,7 +153,7 @@ buf_release(BUF *b) void *tmp; tmp = b->cb_buf; - free(b); + xfree(b); return (tmp); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/ci.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/ci.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/ci.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.224 2016/07/04 01:39:12 millert Exp $ */ +/* $OpenBSD: ci.c,v 1.219 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins * All rights reserved. @@ -210,7 +210,8 @@ checkin_main(int argc, char **argv) printf("%s\n", rcs_version); exit(0); case 'w': - free(pb.author); + if (pb.author != NULL) + xfree(pb.author); pb.author = xstrdup(rcs_optarg); break; case 'x': @@ -279,7 +280,7 @@ checkin_main(int argc, char **argv) errx(1, "failed to open rcsfile `%s'", pb.fpath); if ((pb.flags & DESCRIPTION) && - rcs_set_description(pb.file, pb.description, pb.flags) == -1) + rcs_set_description(pb.file, pb.description) == -1) err(1, "%s", pb.filename); if (!(pb.flags & QUIET)) @@ -369,11 +370,16 @@ checkin_diff_file(struct checkin_params return (b3); out: - buf_free(b1); - buf_free(b2); - buf_free(b3); - free(path1); - free(path2); + if (b1 != NULL) + buf_free(b1); + if (b2 != NULL) + buf_free(b2); + if (b3 != NULL) + buf_free(b3); + if (path1 != NULL) + xfree(path1); + if (path2 != NULL) + xfree(path2); return (NULL); } @@ -406,7 +412,7 @@ checkin_getlogmsg(RCSNUM *rev, RCSNUM *r (void)fprintf(stderr, "new revision: %s; " "previous revision: %s\n", nrev, prev); - rcs_msg = rcs_prompt(prompt, flags); + rcs_msg = rcs_prompt(prompt); return (rcs_msg); } @@ -505,7 +511,7 @@ checkin_update(struct checkin_params *pb fprintf(stderr, "reuse log message of previous file? [yn](y): "); if (rcs_yesno('y') != 'y') { - free(pb->rcs_msg); + xfree(pb->rcs_msg); pb->rcs_msg = NULL; } } @@ -578,7 +584,7 @@ checkin_update(struct checkin_params *pb pb->username, pb->author, NULL, NULL); if ((pb->flags & INTERACTIVE) && (pb->rcs_msg[0] == '\0')) { - free(pb->rcs_msg); /* free empty log message */ + xfree(pb->rcs_msg); /* free empty log message */ pb->rcs_msg = NULL; } @@ -621,7 +627,7 @@ checkin_init(struct checkin_params *pb) /* Get description from user */ if (pb->description == NULL && - rcs_set_description(pb->file, NULL, pb->flags) == -1) { + rcs_set_description(pb->file, NULL) == -1) { warn("%s", pb->filename); return (-1); } @@ -728,7 +734,7 @@ checkin_attach_symbol(struct checkin_par } } } - if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev)) == -1 && + if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) && (rcs_errno == RCS_ERR_DUPENT)) { rcsnum_tostr(rcs_sym_getrev(pb->file, pb->symbol), rbuf, sizeof(rbuf)); @@ -982,22 +988,25 @@ checkin_parsekeyword(char *keystring, RC (void)xasprintf(&datestring, "%s %s", tokens[3], tokens[4]); if ((*date = date_parse(datestring)) == -1) errx(1, "could not parse date"); - free(datestring); + xfree(datestring); if (i < 6) break; - free(*author); + if (*author != NULL) + xfree(*author); *author = xstrdup(tokens[5]); if (i < 7) break; - free(*state); + if (*state != NULL) + xfree(*state); *state = xstrdup(tokens[6]); break; case KW_TYPE_AUTHOR: if (i < 2) break; - free(*author); + if (*author != NULL) + xfree(*author); *author = xstrdup(tokens[1]); break; case KW_TYPE_DATE: @@ -1006,12 +1015,13 @@ checkin_parsekeyword(char *keystring, RC (void)xasprintf(&datestring, "%s %s", tokens[1], tokens[2]); if ((*date = date_parse(datestring)) == -1) errx(1, "could not parse date"); - free(datestring); + xfree(datestring); break; case KW_TYPE_STATE: if (i < 2) break; - free(*state); + if (*state != NULL) + xfree(*state); *state = xstrdup(tokens[1]); break; case KW_TYPE_REVISION: Modified: vendor/OpenBSD/dist/usr.bin/rcs/co.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/co.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/co.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.122 2015/10/21 16:06:57 millert Exp $ */ +/* $OpenBSD: co.c,v 1.120 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -515,7 +515,7 @@ checkout_err_nobranch(RCSFILE *file, con file->rf_path, date ? " a date before " : "", date ? date : "", - author ? " and author " + (date ? 0:4) : "", + author ? " and author " + (date ? 0:4 ) : "", author ? author : "", state ? " and state " + (date || author ? 0:4) : "", state ? state : ""); @@ -554,7 +554,7 @@ checkout_file_has_diffs(RCSFILE *rfp, RC buf_free(bp); unlink(tempfile); - free(tempfile); + xfree(tempfile); return (ret); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/date.y ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/date.y Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/date.y Sun Sep 11 16:20:57 2016 (r305697) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.14 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: date.y,v 1.12 2013/12/03 00:21:49 deraadt Exp $ */ /* ** Originally written by Steven M. Bellovin while @@ -17,7 +17,6 @@ #include #include #include -#include #include "rcsprog.h" @@ -495,7 +494,7 @@ yyerror(const char *s) s, yyInput); warnx("%s", str); - free(str); + xfree(str); return (0); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/diff.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/diff.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/diff.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.38 2015/06/13 20:15:21 nicm Exp $ */ +/* $OpenBSD: diff.c,v 1.37 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -375,13 +374,13 @@ diffreg(const char *file1, const char *f clistlen = 100; clist = xcalloc(clistlen, sizeof(*clist)); i = stone(class, slen[0], member, klist, flags); - free(member); - free(class); + xfree(member); + xfree(class); J = xreallocarray(J, len[0] + 2, sizeof(*J)); unravel(klist[i]); - free(clist); - free(klist); + xfree(clist); + xfree(klist); ixold = xreallocarray(ixold, len[0] + 2, sizeof(*ixold)); ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); @@ -770,7 +769,7 @@ unsort(struct line *f, int l, int *b) a[f[i].serial] = f[i].value; for (i = 1; i <= l; i++) b[i] = a[i]; - free(a); + xfree(a); } static int @@ -861,7 +860,7 @@ ignoreline(char *line) int ret; ret = regexec(diff_ignore_re, line, 0, NULL, 0); - free(line); + xfree(line); return (ret == 0); /* if it matched, it should be ignored. */ } @@ -1384,5 +1383,5 @@ diff_output(const char *fmt, ...) buf_append(diffbuf, str, strlen(str)); else printf("%s", str); - free(str); + xfree(str); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/diff3.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/diff3.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/diff3.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.39 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: diff3.c,v 1.35 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -69,7 +69,6 @@ #include #include #include -#include #include #include "diff.h" @@ -235,10 +234,14 @@ merge_diff3(char **av, int flags) warnx("warning: overlaps or other problems during merge"); out: - buf_free(b2); - buf_free(b3); - buf_free(d1); - buf_free(d2); + if (b2 != NULL) + buf_free(b2); + if (b3 != NULL) + buf_free(b3); + if (d1 != NULL) + buf_free(d1); + if (d2 != NULL) + buf_free(d2); (void)unlink(path1); (void)unlink(path2); @@ -246,13 +249,20 @@ out: (void)unlink(dp13); (void)unlink(dp23); - free(path1); - free(path2); - free(path3); - free(dp13); - free(dp23); - free(data); - free(patch); + if (path1 != NULL) + xfree(path1); + if (path2 != NULL) + xfree(path2); + if (path3 != NULL) + xfree(path3); + if (dp13 != NULL) + xfree(dp13); + if (dp23 != NULL) + xfree(dp23); + if (data != NULL) + xfree(data); + if (patch != NULL) + xfree(patch); return (diffb); } @@ -351,10 +361,14 @@ rcs_diff3(RCSFILE *rf, char *workfile, R warnx("warning: overlaps or other problems during merge"); out: - buf_free(b2); - buf_free(b3); - buf_free(d1); - buf_free(d2); + if (b2 != NULL) + buf_free(b2); + if (b3 != NULL) + buf_free(b3); + if (d1 != NULL) + buf_free(d1); + if (d2 != NULL) + buf_free(d2); (void)unlink(path1); (void)unlink(path2); @@ -362,13 +376,20 @@ out: (void)unlink(dp13); (void)unlink(dp23); - free(path1); - free(path2); - free(path3); - free(dp13); - free(dp23); - free(data); - free(patch); + if (path1 != NULL) + xfree(path1); + if (path2 != NULL) + xfree(path2); + if (path3 != NULL) + xfree(path3); + if (dp13 != NULL) + xfree(dp13); + if (dp23 != NULL) + xfree(dp23); + if (data != NULL) + xfree(data); + if (patch != NULL) + xfree(patch); return (diffb); } @@ -636,7 +657,7 @@ merge(size_t m1, size_t m2) d1 = d13; d2 = d23; j = 0; - while ((t1 = (d1 < d13 + m1)) | (t2 = (d2 < d23 + m2))) { + while ((t1 = d1 < d13 + m1) | (t2 = d2 < d23 + m2)) { if (debug) { printf("%d,%d=%d,%d %d,%d=%d,%d\n", d1->old.from, d1->old.to, Modified: vendor/OpenBSD/dist/usr.bin/rcs/ident.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/ident.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/ident.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: ident.c,v 1.32 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: ident.c,v 1.30 2014/10/02 06:23:15 otto Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria * All rights reserved. @@ -28,7 +28,6 @@ #include #include #include -#include #include #include "rcsprog.h" @@ -157,7 +156,8 @@ ident_line(FILE *fp) found++; out: - buf_free(bp); + if (bp != NULL) + buf_free(bp); } __dead void Modified: vendor/OpenBSD/dist/usr.bin/rcs/merge.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/merge.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/merge.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: merge.c,v 1.10 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: merge.c,v 1.9 2014/10/10 08:15:25 otto Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria * All rights reserved. @@ -27,7 +27,6 @@ #include #include #include -#include #include #include "rcsprog.h" Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcs.1,v 1.59 2015/09/25 15:31:24 schwarze Exp $ +.\" $OpenBSD: rcs.1,v 1.58 2013/01/18 11:21:09 guenther Exp $ .\" .\" Copyright (c) 2005 Jean-Francois Brousseau .\" Copyright (c) 2005 Xavier Santolaria @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 25 2015 $ +.Dd $Mdocdate: January 18 2013 $ .Dt RCS 1 .Os .Sh NAME @@ -40,7 +40,8 @@ .Op Fl e Ns Op Ar users .Op Fl k Ns Ar mode .Op Fl l Ns Op Ar rev -.Op Fl m Ns Ar rev : Ns Ar msg +.Oo Fl m Ns Ar rev : +.Ar msg Oc .Op Fl o Ns Ar rev .Op Fl t Ns Op Ar str .Op Fl u Ns Op Ar rev Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.85 2016/05/09 13:03:55 schwarze Exp $ */ +/* $OpenBSD: rcs.c,v 1.82 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -66,7 +66,6 @@ struct rcs_kw rcs_expkw[] = { { "Revision", RCS_KW_REVISION }, { "Source", RCS_KW_SOURCE }, { "State", RCS_KW_STATE }, - { "Mdocdate", RCS_KW_MDOCDATE }, }; int rcs_errno = RCS_ERR_NOERR; @@ -158,40 +157,44 @@ rcs_close(RCSFILE *rfp) while (!TAILQ_EMPTY(&(rfp->rf_access))) { rap = TAILQ_FIRST(&(rfp->rf_access)); TAILQ_REMOVE(&(rfp->rf_access), rap, ra_list); - free(rap->ra_name); - free(rap); + xfree(rap->ra_name); + xfree(rap); } while (!TAILQ_EMPTY(&(rfp->rf_symbols))) { rsp = TAILQ_FIRST(&(rfp->rf_symbols)); TAILQ_REMOVE(&(rfp->rf_symbols), rsp, rs_list); rcsnum_free(rsp->rs_num); - free(rsp->rs_name); - free(rsp); + xfree(rsp->rs_name); + xfree(rsp); } while (!TAILQ_EMPTY(&(rfp->rf_locks))) { rlp = TAILQ_FIRST(&(rfp->rf_locks)); TAILQ_REMOVE(&(rfp->rf_locks), rlp, rl_list); rcsnum_free(rlp->rl_num); - free(rlp->rl_name); - free(rlp); + xfree(rlp->rl_name); + xfree(rlp); } - rcsnum_free(rfp->rf_head); - rcsnum_free(rfp->rf_branch); + if (rfp->rf_head != NULL) + rcsnum_free(rfp->rf_head); + if (rfp->rf_branch != NULL) + rcsnum_free(rfp->rf_branch); if (rfp->rf_file != NULL) fclose(rfp->rf_file); - - free(rfp->rf_path); - free(rfp->rf_comment); - free(rfp->rf_expand); - free(rfp->rf_desc); + if (rfp->rf_path != NULL) + xfree(rfp->rf_path); + if (rfp->rf_comment != NULL) + xfree(rfp->rf_comment); + if (rfp->rf_expand != NULL) + xfree(rfp->rf_expand); + if (rfp->rf_desc != NULL) + xfree(rfp->rf_desc); if (rfp->rf_pdata != NULL) rcsparse_free(rfp); - - free(rfp); + xfree(rfp); } /* @@ -346,7 +349,8 @@ rcs_write(RCSFILE *rfp) rfp->rf_flags |= RCS_SYNCED; - free(fn); + if (fn != NULL) + xfree(fn); } /* @@ -416,7 +420,7 @@ rcs_movefile(char *from, char *to, mode_ out: (void)fclose(src); (void)fclose(dst); - free(buf); + xfree(buf); return (0); } @@ -505,8 +509,8 @@ rcs_access_remove(RCSFILE *file, const c } TAILQ_REMOVE(&(file->rf_access), ap, ra_list); - free(ap->ra_name); - free(ap); + xfree(ap->ra_name); + xfree(ap); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -578,9 +582,9 @@ rcs_sym_remove(RCSFILE *file, const char } TAILQ_REMOVE(&(file->rf_symbols), symp, rs_list); - free(symp->rs_name); + xfree(symp->rs_name); rcsnum_free(symp->rs_num); - free(symp); + xfree(symp); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -739,8 +743,8 @@ rcs_lock_remove(RCSFILE *file, const cha TAILQ_REMOVE(&(file->rf_locks), lkp, rl_list); rcsnum_free(lkp->rl_num); - free(lkp->rl_name); - free(lkp); + xfree(lkp->rl_name); + xfree(lkp); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -758,7 +762,8 @@ rcs_desc_set(RCSFILE *file, const char * char *tmp; tmp = xstrdup(desc); - free(file->rf_desc); + if (file->rf_desc != NULL) + xfree(file->rf_desc); file->rf_desc = tmp; file->rf_flags &= ~RCS_SYNCED; } @@ -774,7 +779,8 @@ rcs_comment_set(RCSFILE *file, const cha char *tmp; tmp = xstrdup(comment); - free(file->rf_comment); + if (file->rf_comment != NULL) + xfree(file->rf_comment); file->rf_comment = tmp; file->rf_flags &= ~RCS_SYNCED; } @@ -833,7 +839,7 @@ rcs_patch_lines(struct rcs_lines *dlines for (i = 0; (i < nbln) && (dlp != NULL); i++) { ndlp = TAILQ_NEXT(dlp, l_list); TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); - free(dlp); + xfree(dlp); dlp = ndlp; /* last line is gone - reset dlp */ if (dlp == NULL) { @@ -1014,7 +1020,7 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) return (NULL); rbuf = rcs_patchfile(data, dlen, patch, plen, rcs_patch_lines); - free(data); + xfree(data); if (rbuf == NULL) break; @@ -1240,8 +1246,10 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) rcs_freedelta(rdp); - free(path_tmp1); - free(path_tmp2); + if (path_tmp1 != NULL) + xfree(path_tmp1); + if (path_tmp2 != NULL) + xfree(path_tmp2); return (0); } @@ -1335,7 +1343,8 @@ rcs_kwexp_set(RCSFILE *file, int mode) } tmp = xstrdup(buf); - free(file->rf_expand); + if (file->rf_expand != NULL) + xfree(file->rf_expand); file->rf_expand = tmp; /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -1405,22 +1414,29 @@ rcs_freedelta(struct rcs_delta *rdp) { struct rcs_branch *rb; - rcsnum_free(rdp->rd_num); - rcsnum_free(rdp->rd_next); - - free(rdp->rd_author); - free(rdp->rd_locker); - free(rdp->rd_state); - free(rdp->rd_log); - free(rdp->rd_text); + if (rdp->rd_num != NULL) + rcsnum_free(rdp->rd_num); + if (rdp->rd_next != NULL) + rcsnum_free(rdp->rd_next); + + if (rdp->rd_author != NULL) + xfree(rdp->rd_author); + if (rdp->rd_locker != NULL) + xfree(rdp->rd_locker); + if (rdp->rd_state != NULL) + xfree(rdp->rd_state); + if (rdp->rd_log != NULL) + xfree(rdp->rd_log); + if (rdp->rd_text != NULL) + xfree(rdp->rd_text); while ((rb = TAILQ_FIRST(&(rdp->rd_branches))) != NULL) { TAILQ_REMOVE(&(rdp->rd_branches), rb, rb_list); rcsnum_free(rb->rb_num); - free(rb); + xfree(rb); } - free(rdp); + xfree(rdp); } /* @@ -1597,16 +1613,6 @@ rcs_expand_keywords(char *rcsfile_in, st buf_putc(newbuf, ' '); } - if (kwtype & RCS_KW_MDOCDATE) { - strftime(buf, sizeof(buf), "%B", &tb); - buf_puts(newbuf, buf); - /* Only one blank before single-digit day. */ - snprintf(buf, sizeof(buf), " %d", tb.tm_mday); - buf_puts(newbuf, buf); - strftime(buf, sizeof(buf), " %Y ", &tb); - buf_puts(newbuf, buf); - } - if (kwtype & RCS_KW_NAME) buf_putc(newbuf, ' '); @@ -1695,7 +1701,8 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM * if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - free(rdp->rd_text); + if (rdp->rd_text != NULL) + xfree(rdp->rd_text); len = buf_len(bp); dtext = buf_release(bp); @@ -1710,7 +1717,8 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM * rdp->rd_tlen = 0; } - free(dtext); + if (dtext != NULL) + xfree(dtext); return (0); } @@ -1728,7 +1736,8 @@ rcs_rev_setlog(RCSFILE *rfp, RCSNUM *rev if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - free(rdp->rd_log); + if (rdp->rd_log != NULL) + xfree(rdp->rd_log); rdp->rd_log = xstrdup(logtext); rfp->rf_flags &= ~RCS_SYNCED; @@ -1767,7 +1776,8 @@ rcs_state_set(RCSFILE *rfp, RCSNUM *rev, if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - free(rdp->rd_state); + if (rdp->rd_state != NULL) + xfree(rdp->rd_state); rdp->rd_state = xstrdup(state); Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.h ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.h Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.h Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.h,v 1.17 2016/05/09 13:03:55 schwarze Exp $ */ +/* $OpenBSD: rcs.h,v 1.16 2013/06/03 17:04:35 jcs Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -69,7 +69,6 @@ #define RCS_KW_SOURCE 0x0400 #define RCS_KW_STATE 0x0800 #define RCS_KW_FULLPATH 0x0010 -#define RCS_KW_MDOCDATE 0x0020 #define RCS_KW_LOCKER 0x10000 #define RCS_KW_ID \ Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsclean.c,v 1.56 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: rcsclean.c,v 1.54 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -30,7 +30,6 @@ #include #include #include -#include #include #include "rcsprog.h" @@ -210,8 +209,10 @@ rcsclean_file(char *fname, const char *r rcs_set_mtime(file, rcs_mtime); out: - buf_free(b1); - buf_free(b2); + if (b1 != NULL) + buf_free(b1); + if (b2 != NULL) + buf_free(b2); if (file != NULL) rcs_close(file); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsdiff.c,v 1.84 2015/11/02 16:45:21 nicm Exp $ */ +/* $OpenBSD: rcsdiff.c,v 1.82 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -250,9 +250,15 @@ rcsdiff_main(int argc, char **argv) status = rcsdiff_rev(file, rev1, rev2, dflags); rcs_close(file); - rcsnum_free(rev1); - rcsnum_free(rev2); - rev1 = rev2 = NULL; + + if (rev1 != NULL) { + rcsnum_free(rev1); + rev1 = NULL; + } + if (rev2 != NULL) { + rcsnum_free(rev2); + rev2 = NULL; + } } return (status); @@ -348,10 +354,14 @@ rcsdiff_file(RCSFILE *file, RCSNUM *rev, out: if (fd != -1) (void)close(fd); - buf_free(b1); - buf_free(b2); - free(path1); - free(path2); + if (b1 != NULL) + buf_free(b1); + if (b2 != NULL) + buf_free(b2); + if (path1 != NULL) + xfree(path1); + if (path2 != NULL) + xfree(path2); return (ret); } @@ -423,10 +433,14 @@ rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, ret = diffreg(path1, path2, NULL, dflags); out: - buf_free(b1); - buf_free(b2); - free(path1); - free(path2); + if (b1 != NULL) + buf_free(b1); + if (b2 != NULL) + buf_free(b2); + if (path1 != NULL) + xfree(path1); + if (path2 != NULL) + xfree(path2); return (ret); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsmerge.c,v 1.57 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: rcsmerge.c,v 1.55 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria * All rights reserved. @@ -28,7 +28,6 @@ #include #include #include -#include #include #include "rcsprog.h" @@ -174,8 +173,12 @@ rcsmerge_main(int argc, char **argv) out: rcs_close(file); - rcsnum_free(rev1); - rcsnum_free(rev2); + + if (rev1 != NULL) + rcsnum_free(rev1); + if (rev2 != NULL) + rcsnum_free(rev2); + return (status); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsnum.c,v 1.19 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.16 2015/01/16 06:40:11 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -26,10 +26,8 @@ #include #include -#include -#include #include -#include +#include #include "rcs.h" #include "xmalloc.h" @@ -106,10 +104,9 @@ rcsnum_parse(const char *str) void rcsnum_free(RCSNUM *rn) { - if (rn == NULL) - return; - free(rn->rn_id); - free(rn); + if (rn->rn_id != NULL) + xfree(rn->rn_id); + xfree(rn); } /* @@ -334,7 +331,7 @@ rcsnum_aton(const char *str, char **ep, rcsnum_aton_failed: nump->rn_len = 0; - free(nump->rn_id); + xfree(nump->rn_id); nump->rn_id = NULL; return (-1); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c Sun Sep 11 16:11:51 2016 (r305696) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c Sun Sep 11 16:20:57 2016 (r305697) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsparse.c,v 1.16 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: rcsparse.c,v 1.14 2014/12/01 21:58:46 deraadt Exp $ */ /* * Copyright (c) 2010 Tobias Stoeckmann * @@ -24,7 +24,6 @@ #include #include #include -#include #include #include "rcs.h" @@ -341,10 +340,11 @@ rcsparse_free(RCSFILE *rfp) pdp = rfp->rf_pdata; - free(pdp->rp_buf); + if (pdp->rp_buf != NULL) + xfree(pdp->rp_buf); if (pdp->rp_token == RCS_TYPE_REVISION) rcsnum_free(pdp->rp_value.rev); - free(pdp); + xfree(pdp); } /* @@ -609,7 +609,7 @@ rcsparse_text(RCSFILE *rfp, struct rcs_p memcpy(pdp->rp_delta->rd_text, pdp->rp_buf, pdp->rp_delta->rd_tlen); } - free(pdp->rp_value.str); + xfree(pdp->rp_value.str); return (0); } @@ -707,7 +707,7 @@ rcsparse_symbols(RCSFILE *rfp, struct rc name = pdp->rp_value.str; if (rcsparse_token(rfp, RCS_TOK_COLON) != RCS_TOK_COLON || rcsparse_token(rfp, RCS_TYPE_NUMBER) != RCS_TYPE_NUMBER) { - free(name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Sep 11 16:32:18 2016 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 641CFBD6043 for ; Sun, 11 Sep 2016 16:32:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm20.bullet.mail.bf1.yahoo.com (nm20.bullet.mail.bf1.yahoo.com [98.139.212.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AF6FB6F for ; Sun, 11 Sep 2016 16:32:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473610674; bh=tPm4XZ0H6KtEAgPThj46cVodWU1UtvYdh0W9kU4dsps=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=k7uJwpBHsWl6vQVkaT6P0PoP0PN8k0emooXBMPXToRjKgPXWMhrI6wt+QHb9gRr3gsZdZ4ItYlgoV97OPILIoNGcQtBcxB8jIOIkyO7LZsUxACk1dmeT3CJuj8IZIQGPtv/km8DNEVUqdZC6xVVH4SDnUpu+s4bveARM4D7vYG0x+hEU0FBP/tNQkBSwp1x+AQC++JlY7mGVnV4Zk6ivLFBwkkCvEF1udWLORua6RqGVQZlsWYZKlHEqBCpYYeaYI8VzzAbagYu98Azip4/+hDVBOJW3SnQRcRFLMZEj1j5BhurqO01VUy1I5Wi6reSzo/ATCu9oRNfaB0rm2aBSZg== Received: from [66.196.81.173] by nm20.bullet.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 16:17:54 -0000 Received: from [98.139.213.13] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 16:17:54 -0000 Received: from [127.0.0.1] by smtp113.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 16:17:54 -0000 X-Yahoo-Newman-Id: 899002.53990.bm@smtp113.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZcLWhAIVM1l_iffKF0fpO0PpFxDosAKioBRNHIMBNcb9PbG beMdCwr3aZi2xQmYmtF36V8q1QPB7ZM0FAt86zfHxeqtdL1B8C9XouZYLu7D yuxPdmsQg8MaXbSAISN5sz2IKC1H3AHqHd86jG4h2fD5cI7wUomxc3l505kM zUnrDfRgWGKqTE0UmBcY3FaFeLvJKhqqNJYApCMkH1CwcIbMusn4AlFrOIZ7 xFiFzwgEH7znk80Ggr3G1BbUseZiKBxugvx3RLLy_AjSAwinmzdQdDt9gr.C Ux4FYA_jW4PzSzDuZL7zmYwk4FNlLtSIsOKp0Tzj8XiJn8HT7ZwcwQJGqHCA IZALNqP09SJnqVNCdYUjxpYhFROCO8aPWCiaJybDSXPJqwcZ8aIOYWqr06QS enUCZgncsMT8rA7_GlbHjg7MV9siyf9odZpom1.52L4yKeVVKc6uxUwOaFjO GyVGaifSLftjOnmwR7HPmxA_ysEFC2N9MZVS7BA5pCKXFRG05fEgLHDzSKlN Z1JOqm_kPjjAQUmy33nED3um0Zpp7.qyZX7Ijlkmyyj52bw-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201609111555.u8BFtCRY051694@repo.freebsd.org> From: Pedro Giffuni Message-ID: Date: Sun, 11 Sep 2016 11:17:58 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201609111555.u8BFtCRY051694@repo.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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 16:32:18 -0000 On 09/11/16 10:55, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Sep 11 15:55:11 2016 > New Revision: 305694 > URL: https://svnweb.freebsd.org/changeset/base/305694 > > Log: > Update OpenRCS to version 20160831 > > Obtained from: OpenBSD > Bah .. this brings some pledge stuff that makes things ugly/unportable. Will revert. Pedro. From owner-svn-src-all@freebsd.org Sun Sep 11 16:50:36 2016 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 3EC6DBD6750; Sun, 11 Sep 2016 16:50:36 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0130C38; Sun, 11 Sep 2016 16:50:35 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 5DAE31805; Sun, 11 Sep 2016 16:50:29 +0000 (UTC) Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk To: Baptiste Daroussin , Kristof Provost , Marie Helene Kvello-Aune References: <201608251940.u7PJePv3023083@repo.freebsd.org> <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <9855ae5e-1c9a-caea-9b1a-cfda5ece7258@freebsd.org> Date: Sun, 11 Sep 2016 12:50:25 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 16:50:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a Content-Type: multipart/mixed; boundary="280LnlS3ljOLR7Etg31k37Q9XV4wOv1q0" From: Allan Jude To: Baptiste Daroussin , Kristof Provost , Marie Helene Kvello-Aune Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9855ae5e-1c9a-caea-9b1a-cfda5ece7258@freebsd.org> Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk References: <201608251940.u7PJePv3023083@repo.freebsd.org> <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> In-Reply-To: <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> --280LnlS3ljOLR7Etg31k37Q9XV4wOv1q0 Content-Type: multipart/mixed; boundary="------------F8B125D0689F1485C3EC70CA" This is a multi-part message in MIME format. --------------F8B125D0689F1485C3EC70CA Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-09-11 10:49, Baptiste Daroussin wrote: > On Thu, Aug 25, 2016 at 07:40:25PM +0000, Kristof Provost wrote: >> Author: kp >> Date: Thu Aug 25 19:40:25 2016 >> New Revision: 304815 >> URL: https://svnweb.freebsd.org/changeset/base/304815 >> >> Log: >> Add libifc, a library implementing core functionality that exists in= ifconfig(8) today. >> =20 >> libifc (pronounced lib-ifconfig) aims to be a light abstraction laye= r between >> programs and the kernel APIs for managing the network configuration.= >> This should hopefully make programs easier to maintain, and reduce c= ode >> duplication. >> =20 >> Work will begin on making ifconfig(8) use this library in the near f= uture. >> =20 >> This code is still evolving. The interface should not be considered = stable until >> it is announced as such. >> =20 >=20 > Sorry I come to this very late but: >=20 > If it is not stable yet, it would probably be a good idea to make it a > privatelib, so even if we end up shipping a release with the lib before= > considered stable we are safe updating it? >=20 > It won't prevent any usage one can imagine in base. >=20 > The private flag can be dropped once it is considered stable >=20 > Best regards, > Bapt >=20 That is a good idea, and is just a one line change: --=20 Allan Jude --------------F8B125D0689F1485C3EC70CA Content-Type: text/plain; charset=UTF-8; name="libifconfig_private.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libifconfig_private.diff" Index: lib/libifconfig/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libifconfig/Makefile (revision 305635) +++ lib/libifconfig/Makefile (working copy) @@ -2,6 +2,7 @@ =20 PACKAGE=3D lib${LIB} LIB=3D ifconfig +PRIVATELIB=3D true # Don't build shared library, for now. NO_PIC=3D=20 =20 --------------F8B125D0689F1485C3EC70CA-- --280LnlS3ljOLR7Etg31k37Q9XV4wOv1q0-- --oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJX1YtUAAoJEBmVNT4SmAt+MwUQAJQVr0Zy8Qc3XhJAk4z/fVGt 6bVRYtsQ9cVrxIX4I7doz1bF1iOqcbzQIAfrPoI3zPBEz2Qc60iCaUHu92nP/ggO b/kE59R5KidnE4kh5zCCbtE4GBwf+HjaM19V03/pWS+nYoAM9enSwrPi+gv14R/I w/i6pYTqgSTyit23RouX32PpFxtc7fp9TstuCQjXXjJN0JtEsT60Y+7oAKtu2UbF vlPjSnkOxgotBgUkf7WMTvHoGpifvsMOjgNklYiZVamRxWSVrQSEKiXNbySuMgyJ 5R0FgXL5riuVtgvJIA9dIaIo+moxz6cZFhBgbQxYzzSEVNsmczu3+hHcW0n7n77Q 2z4ypQGW1cuh9/H8Qx2j+USksbvC7Sj1yPwXaqgVmOx/c/Q+W+t/muTP/qTmRhjX YfXf3G1a3hQ6iycTmAj3mI8Dx/DAG7SK0EPxnWnmLgDClNd0uO0HR4F+qCLMg8rJ EhgSnfQ0smvY2ZDTwnGbfxI4MbV0Vurm1x0URxsrpZCFymHQF4pWOcdXn+/gL9sf 80z9jj/e1dmpiaJ9Ch5gDbnSE2d5xU+kpd61rfyrUIWMxwReAufPSbmJ5kjgcyHf N2ELj06OSzlte889XBTXZTVP2SpsAUg55D2BsXN0KE0pYX3IpUURdO/YPgnXeY6e ajRTNDyNydw6mZXVS5g2 =Cphj -----END PGP SIGNATURE----- --oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a-- From owner-svn-src-all@freebsd.org Sun Sep 11 16:52:11 2016 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 C6435BD6820; Sun, 11 Sep 2016 16:52:11 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2187F8C; Sun, 11 Sep 2016 16:52:11 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 77BD11811; Sun, 11 Sep 2016 16:52:10 +0000 (UTC) Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201609111555.u8BFtCRY051694@repo.freebsd.org> From: Allan Jude Message-ID: <5739a5ee-4464-2a35-fa9e-5d84d671c6a3@freebsd.org> Date: Sun, 11 Sep 2016 12:52:09 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WD4mJPr81eBMf6AggojVxjMghEkJ8KPat" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 16:52:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WD4mJPr81eBMf6AggojVxjMghEkJ8KPat Content-Type: multipart/mixed; boundary="BPBaebM3gJETRv6HjTuesIKmW5c9hbIoK" From: Allan Jude To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Message-ID: <5739a5ee-4464-2a35-fa9e-5d84d671c6a3@freebsd.org> Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs References: <201609111555.u8BFtCRY051694@repo.freebsd.org> In-Reply-To: --BPBaebM3gJETRv6HjTuesIKmW5c9hbIoK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-09-11 12:17, Pedro Giffuni wrote: >=20 >=20 > On 09/11/16 10:55, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Sun Sep 11 15:55:11 2016 >> New Revision: 305694 >> URL: https://svnweb.freebsd.org/changeset/base/305694 >> >> Log: >> Update OpenRCS to version 20160831 >> >> Obtained from: OpenBSD >> >=20 > Bah .. this brings some pledge stuff that makes things ugly/unportable.= > Will revert. >=20 > Pedro. >=20 How nasty is the pledge stuff? It is usually fairly easy to convert pledge to Capsicum, so it might be worth looking at. I'll take a look at it later in the week. --=20 Allan Jude --BPBaebM3gJETRv6HjTuesIKmW5c9hbIoK-- --WD4mJPr81eBMf6AggojVxjMghEkJ8KPat Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJX1Yu6AAoJEBmVNT4SmAt+8DwP/30ocGt1/oMi9VigRvtyqhzU sqZX5YjL62rbiXG+SXMu/a9UQCTr2m8x9fK/VAL0TKX/4aVA27uXjfx5V78HYGq/ 13pITEyQAS9NikR4c0DirxDxgDiE4DMMVERl3Qfkie8VU210z2Ayrpf8Gio8Wdtj kXiBNszML1J0bi4Wu8Ksws3u/dXwsEV4e3Q6ywnxzsf0/D4C8kwWvZJO5OoQ+Bni GPuVJxkDF3QRPxivwijw88W7RBTyyTia28VKgmoVN55dVW/wh4T374Fwwgq+xXD9 R7LScqeIAxTvLAYHPA29sM6JJDkIOS/1Log17PfaIq55pKoIoIipl0pRrKNgIFx6 x9EFc7qo5TrypjgFQ7JSP25hapIxklK8dr3j9s0OONncPrA10IZjjKR+msjl9U5J opCOZ3bSO0dKSUVUMNwojXr773eioJWslLKz4XtKOglOrdA1LN/9j0VnbUAhGHYd YnPE4wK1zgPTUrswyrlGT7Wys3Y1U1AU6Idihx9ZQ2RRfOC+PBgHClU0AIPuo5BC Is5ajcH68b4HQu7+KenU6fdyM2zJ8ZUN0LkTABAJKMhtwwgRObq/uQNBrlZNQNVI wuxCyWWOu9pc9gLzPtsH5o4AIkW2DO0QDMc993Wr3g++Yx1TZZmIHuGjvsgB43l7 5uCersL2cTv2rZRBkmi4 =es8b -----END PGP SIGNATURE----- --WD4mJPr81eBMf6AggojVxjMghEkJ8KPat-- From owner-svn-src-all@freebsd.org Sun Sep 11 17:22:56 2016 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 3B6E0BD688B; Sun, 11 Sep 2016 17:22:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18CC1BCC; Sun, 11 Sep 2016 17:22:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHMtSZ086887; Sun, 11 Sep 2016 17:22:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHMtCs086884; Sun, 11 Sep 2016 17:22:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111722.u8BHMtCs086884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 17:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305699 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 17:22:56 -0000 Author: np Date: Sun Sep 11 17:22:54 2016 New Revision: 305699 URL: https://svnweb.freebsd.org/changeset/base/305699 Log: cxgbe(4): Update the pad_boundary calculation for T6, which has a different range of boundaries. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4vf_hw.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 17:19:30 2016 (r305698) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 17:22:54 2016 (r305699) @@ -7892,7 +7892,13 @@ int t4_init_sge_params(struct adapter *a sp->sge_control = r; sp->spg_len = r & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(r); - sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5); + if (chip_id(adapter) <= CHELSIO_T5) { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + + X_INGPADBOUNDARY_SHIFT); + } else { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + + X_T6_INGPADBOUNDARY_SHIFT); + } if (is_t4(adapter)) sp->pack_boundary = sp->pad_boundary; else { Modified: head/sys/dev/cxgbe/common/t4vf_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 17:19:30 2016 (r305698) +++ head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 17:22:54 2016 (r305699) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "common.h" #include "t4_regs.h" +#include "t4_regs_values.h" #undef msleep #define msleep(x) do { \ @@ -169,7 +170,13 @@ int t4vf_get_sge_params(struct adapter * */ sp->spg_len = sp->sge_control & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(sp->sge_control); - sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + 5); + if (chip_id(adapter) <= CHELSIO_T5) { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + + X_INGPADBOUNDARY_SHIFT); + } else { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + + X_T6_INGPADBOUNDARY_SHIFT); + } if (is_t4(adapter)) sp->pack_boundary = sp->pad_boundary; else { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:19:30 2016 (r305698) +++ head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:22:54 2016 (r305699) @@ -433,16 +433,20 @@ static inline void setup_pad_and_pack_boundaries(struct adapter *sc) { uint32_t v, m; - int pad, pack; + int pad, pack, pad_shift; + pad_shift = chip_id(sc) > CHELSIO_T5 ? X_T6_INGPADBOUNDARY_SHIFT : + X_INGPADBOUNDARY_SHIFT; pad = fl_pad; - if (fl_pad < 32 || fl_pad > 4096 || !powerof2(fl_pad)) { + if (fl_pad < (1 << pad_shift) || + fl_pad > (1 << (pad_shift + M_INGPADBOUNDARY)) || + !powerof2(fl_pad)) { /* * If there is any chance that we might use buffer packing and * the chip is a T4, then pick 64 as the pad/pack boundary. Set - * it to 32 in all other cases. + * it to the minimum allowed in all other cases. */ - pad = is_t4(sc) && buffer_packing ? 64 : 32; + pad = is_t4(sc) && buffer_packing ? 64 : 1 << pad_shift; /* * For fl_pad = 0 we'll still write a reasonable value to the @@ -456,7 +460,7 @@ setup_pad_and_pack_boundaries(struct ada } } m = V_INGPADBOUNDARY(M_INGPADBOUNDARY); - v = V_INGPADBOUNDARY(ilog2(pad) - 5); + v = V_INGPADBOUNDARY(ilog2(pad) - pad_shift); t4_set_reg_field(sc, A_SGE_CONTROL, m, v); if (is_t4(sc)) { From owner-svn-src-all@freebsd.org Sun Sep 11 17:44:36 2016 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 D7C20BD71EE; Sun, 11 Sep 2016 17:44:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7D1A1AB4; Sun, 11 Sep 2016 17:44:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHiZSr095183; Sun, 11 Sep 2016 17:44:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHiZNb095182; Sun, 11 Sep 2016 17:44:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609111744.u8BHiZNb095182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 11 Sep 2016 17:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305700 - head/lib/libifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 17:44:36 -0000 Author: allanjude Date: Sun Sep 11 17:44:35 2016 New Revision: 305700 URL: https://svnweb.freebsd.org/changeset/base/305700 Log: Mark libifconfig as private until the API/ABI is stable libifconfig is still experimental and under active development. To avoid making any ABI promises, mark the library as private Suggested by: bapt Reviewed by: kp Modified: head/lib/libifconfig/Makefile Modified: head/lib/libifconfig/Makefile ============================================================================== --- head/lib/libifconfig/Makefile Sun Sep 11 17:22:54 2016 (r305699) +++ head/lib/libifconfig/Makefile Sun Sep 11 17:44:35 2016 (r305700) @@ -2,6 +2,7 @@ PACKAGE= lib${LIB} LIB= ifconfig +PRIVATELIB= true # Don't build shared library, for now. NO_PIC= From owner-svn-src-all@freebsd.org Sun Sep 11 17:48:07 2016 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 E6BA9BD734F; Sun, 11 Sep 2016 17:48:07 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE141DCD; Sun, 11 Sep 2016 17:48:07 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHm6lJ095431; Sun, 11 Sep 2016 17:48:06 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHm66n095430; Sun, 11 Sep 2016 17:48:06 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609111748.u8BHm66n095430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 11 Sep 2016 17:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305701 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 17:48:08 -0000 Author: allanjude Date: Sun Sep 11 17:48:06 2016 New Revision: 305701 URL: https://svnweb.freebsd.org/changeset/base/305701 Log: MFV r268120: 4936 lz4 could theoretically overflow a pointer with a certain input illumos/illumos-gate@58d0718061c87e3d647c891ec5281b93c08dba4e Reviewed by: delphij MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7850 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sun Sep 11 17:44:35 2016 (r305700) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sun Sep 11 17:48:06 2016 (r305701) @@ -187,21 +187,18 @@ lz4_decompress(void *s_start, void *d_st defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \ defined(__LP64__) || defined(_LP64)) #define LZ4_ARCH64 1 -/* - * Illumos: On amd64 we have 20k of stack and 24k on sun4u and sun4v, so we - * can spend 16k on the algorithm - */ -/* FreeBSD: Use heap for all platforms for now */ -#define STACKLIMIT 0 #else #define LZ4_ARCH64 0 +#endif + /* - * Illumos: On i386 we only have 12k of stack, so in order to maintain the - * same COMPRESSIONLEVEL we have to use heap allocation. Performance will - * suck, but alas, it's ZFS on 32-bit we're talking about, so... + * Limits the amount of stack space that the algorithm may consume to hold + * the compression lookup table. The value `9' here means we'll never use + * more than 2k of stack (see above for a description of COMPRESSIONLEVEL). + * If more memory is needed, it is allocated from the heap. */ +/* FreeBSD: Use heap for all platforms for now */ #define STACKLIMIT 0 -#endif /* * Little Endian or Big Endian? @@ -870,7 +867,7 @@ real_LZ4_compress(const char *source, ch /* Decompression functions */ /* - * Note: The decoding functionLZ4_uncompress_unknownOutputSize() is safe + * Note: The decoding function LZ4_uncompress_unknownOutputSize() is safe * against "buffer overflow" attack type. They will never write nor * read outside of the provided output buffers. * LZ4_uncompress_unknownOutputSize() also insures that it will never @@ -913,6 +910,9 @@ LZ4_uncompress_unknownOutputSize(const c } /* copy literals */ cpy = op + length; + /* CORNER-CASE: cpy might overflow. */ + if (cpy < op) + goto _output_error; /* cpy was overflowed, bail! */ if ((cpy > oend - COPYLENGTH) || (ip + length > iend - COPYLENGTH)) { if (cpy > oend) From owner-svn-src-all@freebsd.org Sun Sep 11 17:51:18 2016 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 BA1BBBD758B; Sun, 11 Sep 2016 17:51:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D66B1ED; Sun, 11 Sep 2016 17:51:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHpHLK096285; Sun, 11 Sep 2016 17:51:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHpH34096283; Sun, 11 Sep 2016 17:51:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111751.u8BHpH34096283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 17:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305702 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 17:51:18 -0000 Author: np Date: Sun Sep 11 17:51:17 2016 New Revision: 305702 URL: https://svnweb.freebsd.org/changeset/base/305702 Log: cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Sun Sep 11 17:48:06 2016 (r305701) +++ head/sys/dev/cxgbe/t4_netmap.c Sun Sep 11 17:51:17 2016 (r305702) @@ -139,8 +139,10 @@ alloc_nm_rxq_hwq(struct vi_info *vi, str (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) | (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); c.fl0dcaen_to_fl0cidxfthresh = - htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) | - V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); + htobe16(V_FW_IQ_CMD_FL0FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B) | + V_FW_IQ_CMD_FL0FBMAX(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMAX_512B : X_FETCHBURSTMAX_256B)); c.fl0size = htobe16(na->num_rx_desc / 8 + sp->spg_len / EQ_ESIZE); c.fl0addr = htobe64(nm_rxq->fl_ba); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:48:06 2016 (r305701) +++ head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:51:17 2016 (r305702) @@ -2733,8 +2733,10 @@ alloc_iq_fl(struct vi_info *vi, struct s F_FW_IQ_CMD_FL0CONGEN); } c.fl0dcaen_to_fl0cidxfthresh = - htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) | - V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); + htobe16(V_FW_IQ_CMD_FL0FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B) | + V_FW_IQ_CMD_FL0FBMAX(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMAX_512B : X_FETCHBURSTMAX_256B)); c.fl0size = htobe16(fl->qsize); c.fl0addr = htobe64(fl->ba); } From owner-svn-src-all@freebsd.org Sun Sep 11 17:57:54 2016 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 CE360BD778F; Sun, 11 Sep 2016 17:57:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82076ABB; Sun, 11 Sep 2016 17:57:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHvrnb099655; Sun, 11 Sep 2016 17:57:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHvrr7099654; Sun, 11 Sep 2016 17:57:53 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111757.u8BHvrr7099654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 17:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305703 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 17:57:54 -0000 Author: np Date: Sun Sep 11 17:57:53 2016 New Revision: 305703 URL: https://svnweb.freebsd.org/changeset/base/305703 Log: cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Sep 11 17:51:17 2016 (r305702) +++ head/sys/dev/cxgbe/t4_main.c Sun Sep 11 17:57:53 2016 (r305703) @@ -2027,11 +2027,11 @@ t4_map_bar_2(struct adapter *sc) } sc->udbs_base = rman_get_virtual(sc->udbs_res); - if (is_t5(sc)) { + if (chip_id(sc) >= CHELSIO_T5) { setbit(&sc->doorbells, DOORBELL_UDB); #if defined(__i386__) || defined(__amd64__) if (t5_write_combine) { - int rc; + int rc, mode; /* * Enable write combining on BAR2. This is the @@ -2054,8 +2054,9 @@ t4_map_bar_2(struct adapter *sc) rc); } + mode = is_t5(sc) ? V_STATMODE(0) : V_T6_STATMODE(0); t4_write_reg(sc, A_SGE_STAT_CFG, - V_STATSOURCE_T5(7) | V_STATMODE(0)); + V_STATSOURCE_T5(7) | mode); } #endif } @@ -7472,6 +7473,8 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) struct sbuf *sb; int rc, v; + MPASS(chip_id(sc) >= CHELSIO_T5); + rc = sysctl_wire_old_buffer(req, 0); if (rc != 0) return (rc); @@ -7482,14 +7485,19 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) v = t4_read_reg(sc, A_SGE_STAT_CFG); if (G_STATSOURCE_T5(v) == 7) { - if (G_STATMODE(v) == 0) { + int mode; + + mode = is_t5(sc) ? G_STATMODE(v) : G_T6_STATMODE(v); + if (mode == 0) { sbuf_printf(sb, "total %d, incomplete %d", t4_read_reg(sc, A_SGE_STAT_TOTAL), t4_read_reg(sc, A_SGE_STAT_MATCH)); - } else if (G_STATMODE(v) == 1) { + } else if (mode == 1) { sbuf_printf(sb, "total %d, data overflow %d", t4_read_reg(sc, A_SGE_STAT_TOTAL), t4_read_reg(sc, A_SGE_STAT_MATCH)); + } else { + sbuf_printf(sb, "unknown mode %d", mode); } } rc = sbuf_finish(sb); From owner-svn-src-all@freebsd.org Sun Sep 11 18:05:38 2016 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 A1D65BD7ABC; Sun, 11 Sep 2016 18:05:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 721853ED; Sun, 11 Sep 2016 18:05:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BI5bWf004137; Sun, 11 Sep 2016 18:05:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BI5bso004136; Sun, 11 Sep 2016 18:05:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111805.u8BI5bso004136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 18:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305704 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 18:05:38 -0000 Author: np Date: Sun Sep 11 18:05:37 2016 New Revision: 305704 URL: https://svnweb.freebsd.org/changeset/base/305704 Log: cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags. Tunables that end with _flags are special. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Sep 11 17:57:53 2016 (r305703) +++ head/sys/dev/cxgbe/t4_main.c Sun Sep 11 18:05:37 2016 (r305704) @@ -675,7 +675,7 @@ t4_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - TUNABLE_INT_FETCH("hw.cxgbe.debug_flags", &sc->debug_flags); + TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); if ((pci_get_device(dev) & 0xff00) == 0x5400) t5_attribute_workaround(dev); @@ -4642,7 +4642,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dflags", CTLFLAG_RW, &sc->debug_flags, 0, "flags to enable runtime debugging"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version", From owner-svn-src-all@freebsd.org Sun Sep 11 18:56:40 2016 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 3CC9FBD5F12; Sun, 11 Sep 2016 18:56:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC6F13FE; Sun, 11 Sep 2016 18:56:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BIudpI023563; Sun, 11 Sep 2016 18:56:39 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BIucU3023555; Sun, 11 Sep 2016 18:56:38 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609111856.u8BIucU3023555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 11 Sep 2016 18:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305706 - in head: etc/mtree include sys/conf sys/dev/evdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 18:56:40 -0000 Author: gonzo Date: Sun Sep 11 18:56:38 2016 New Revision: 305706 URL: https://svnweb.freebsd.org/changeset/base/305706 Log: Add evdev protocol implementation evdev is a generic input event interface compatible with Linux evdev API at ioctl level. It allows using unmodified (apart from header name) input evdev drivers in Xorg, Wayland, Qt. This commit has only generic kernel API. evdev support for individual hardware drivers like ukbd, ums, atkbd, etc. will be committed later. Project was started by Jakub Klama as part of GSoC 2014. Jakub's evdev implementation was later used as a base, updated and finished by Vladimir Kondratiev. Submitted by: Vladimir Kondratiev Reviewed by: adrian, hans Differential Revision: https://reviews.freebsd.org/D6998 Added: head/sys/dev/evdev/ head/sys/dev/evdev/cdev.c (contents, props changed) head/sys/dev/evdev/evdev.c (contents, props changed) head/sys/dev/evdev/evdev.h (contents, props changed) head/sys/dev/evdev/evdev_mt.c (contents, props changed) head/sys/dev/evdev/evdev_private.h (contents, props changed) head/sys/dev/evdev/evdev_utils.c (contents, props changed) head/sys/dev/evdev/input-event-codes.h (contents, props changed) head/sys/dev/evdev/input.h (contents, props changed) head/sys/dev/evdev/uinput.c (contents, props changed) head/sys/dev/evdev/uinput.h (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Sep 11 18:15:34 2016 (r305705) +++ head/etc/mtree/BSD.include.dist Sun Sep 11 18:56:38 2016 (r305706) @@ -110,6 +110,8 @@ .. ciss .. + evdev + .. filemon .. firewire Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Sep 11 18:15:34 2016 (r305705) +++ head/include/Makefile Sun Sep 11 18:56:38 2016 (r305706) @@ -154,7 +154,7 @@ copies: .PHONY .META done; \ fi .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}${INCLUDEDIR}/$i @@ -177,6 +177,13 @@ copies: .PHONY .META ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \ ${DESTDIR}${INCLUDEDIR}/dev/nand .endif + cd ${.CURDIR}/../sys/dev/evdev; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input.h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input-event-codes.h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev cd ${.CURDIR}/../sys/dev/pci; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ ${DESTDIR}${INCLUDEDIR}/dev/pci @@ -238,7 +245,7 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/nand:Ndev/pci} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ @@ -266,6 +273,11 @@ symlinks: .PHONY .META ${DESTDIR}${INCLUDEDIR}/dev/nand; \ done .endif + cd ${.CURDIR}/../sys/dev/evdev; \ + for h in input.h input-event-codes.h uinput.h; do \ + ln -fs ../../../../sys/dev/evdev/$$h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev; \ + done cd ${.CURDIR}/../sys/dev/pci; \ for h in pcireg.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Sep 11 18:15:34 2016 (r305705) +++ head/sys/conf/NOTES Sun Sep 11 18:56:38 2016 (r305706) @@ -3052,3 +3052,8 @@ options GZIO # BHND(4) drivers options BHND_LOGLEVEL # Logging threshold level + +# evdev interface +options EVDEV +options EVDEV_DEBUG +options UINPUT_DEBUG Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Sep 11 18:15:34 2016 (r305705) +++ head/sys/conf/files Sun Sep 11 18:56:38 2016 (r305706) @@ -1501,6 +1501,11 @@ dev/etherswitch/ip17x/ip17x_vlans.c opti dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb dev/etherswitch/ukswitch/ukswitch.c optional ukswitch +dev/evdev/cdev.c optional evdev +dev/evdev/evdev.c optional evdev +dev/evdev/evdev_mt.c optional evdev +dev/evdev/evdev_utils.c optional evdev +dev/evdev/uinput.c optional evdev uinput dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex pccard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Sep 11 18:15:34 2016 (r305705) +++ head/sys/conf/options Sun Sep 11 18:56:38 2016 (r305706) @@ -987,3 +987,8 @@ BHND_LOGLEVEL opt_global.h # GPIO and child devices GPIO_SPI_DEBUG opt_gpio.h + +# evdev protocol support +EVDEV opt_evdev.h +EVDEV_DEBUG opt_evdev.h +UINPUT_DEBUG opt_evdev.h Added: head/sys/dev/evdev/cdev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/evdev/cdev.c Sun Sep 11 18:56:38 2016 (r305706) @@ -0,0 +1,860 @@ +/*- + * Copyright (c) 2014 Jakub Wojciech Klama + * Copyright (c) 2015-2016 Vladimir Kondratyev + * 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$ + */ + +#include "opt_evdev.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef EVDEV_DEBUG +#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args); +#else +#define debugf(client, fmt, args...) +#endif + +#define DEF_RING_REPORTS 8 + +static d_open_t evdev_open; +static d_read_t evdev_read; +static d_write_t evdev_write; +static d_ioctl_t evdev_ioctl; +static d_poll_t evdev_poll; +static d_kqfilter_t evdev_kqfilter; + +static int evdev_kqread(struct knote *kn, long hint); +static void evdev_kqdetach(struct knote *kn); +static void evdev_dtor(void *); +static int evdev_ioctl_eviocgbit(struct evdev_dev *, int, int, caddr_t); +static void evdev_client_filter_queue(struct evdev_client *, uint16_t); + +static struct cdevsw evdev_cdevsw = { + .d_version = D_VERSION, + .d_open = evdev_open, + .d_read = evdev_read, + .d_write = evdev_write, + .d_ioctl = evdev_ioctl, + .d_poll = evdev_poll, + .d_kqfilter = evdev_kqfilter, + .d_name = "evdev", +}; + +static struct filterops evdev_cdev_filterops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = evdev_kqdetach, + .f_event = evdev_kqread, +}; + +static int +evdev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct evdev_dev *evdev = dev->si_drv1; + struct evdev_client *client; + size_t buffer_size; + int ret; + + if (evdev == NULL) + return (ENODEV); + + /* Initialize client structure */ + buffer_size = evdev->ev_report_size * DEF_RING_REPORTS; + client = malloc(offsetof(struct evdev_client, ec_buffer) + + sizeof(struct input_event) * buffer_size, + M_EVDEV, M_WAITOK | M_ZERO); + + /* Initialize ring buffer */ + client->ec_buffer_size = buffer_size; + client->ec_buffer_head = 0; + client->ec_buffer_tail = 0; + client->ec_buffer_ready = 0; + + client->ec_evdev = evdev; + mtx_init(&client->ec_buffer_mtx, "evclient", "evdev", MTX_DEF); + knlist_init_mtx(&client->ec_selp.si_note, &client->ec_buffer_mtx); + + /* Avoid race with evdev_unregister */ + EVDEV_LOCK(evdev); + if (dev->si_drv1 == NULL) + ret = ENODEV; + else + ret = evdev_register_client(evdev, client); + + if (ret != 0) + evdev_revoke_client(client); + /* + * Unlock evdev here because non-sleepable lock held + * while calling devfs_set_cdevpriv upsets WITNESS + */ + EVDEV_UNLOCK(evdev); + + if (!ret) + ret = devfs_set_cdevpriv(client, evdev_dtor); + + if (ret != 0) { + debugf(client, "cannot register evdev client"); + evdev_dtor(client); + } + + return (ret); +} + +static void +evdev_dtor(void *data) +{ + struct evdev_client *client = (struct evdev_client *)data; + + EVDEV_LOCK(client->ec_evdev); + if (!client->ec_revoked) + evdev_dispose_client(client->ec_evdev, client); + EVDEV_UNLOCK(client->ec_evdev); + + knlist_clear(&client->ec_selp.si_note, 0); + seldrain(&client->ec_selp); + knlist_destroy(&client->ec_selp.si_note); + funsetown(&client->ec_sigio); + mtx_destroy(&client->ec_buffer_mtx); + free(client, M_EVDEV); +} + +static int +evdev_read(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct evdev_client *client; + struct input_event *event; + int ret = 0; + int remaining; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + debugf(client, "read %zd bytes by thread %d", uio->uio_resid, + uio->uio_td->td_tid); + + if (client->ec_revoked) + return (ENODEV); + + /* Zero-sized reads are allowed for error checking */ + if (uio->uio_resid != 0 && uio->uio_resid < sizeof(struct input_event)) + return (EINVAL); + + remaining = uio->uio_resid / sizeof(struct input_event); + + EVDEV_CLIENT_LOCKQ(client); + + if (EVDEV_CLIENT_EMPTYQ(client)) { + if (ioflag & O_NONBLOCK) + ret = EWOULDBLOCK; + else { + if (remaining != 0) { + client->ec_blocked = true; + ret = mtx_sleep(client, &client->ec_buffer_mtx, + PCATCH, "evread", 0); + } + } + } + + while (ret == 0 && !EVDEV_CLIENT_EMPTYQ(client) && remaining > 0) { + event = &client->ec_buffer[client->ec_buffer_head]; + client->ec_buffer_head = + (client->ec_buffer_head + 1) % client->ec_buffer_size; + remaining--; + + EVDEV_CLIENT_UNLOCKQ(client); + ret = uiomove(event, sizeof(struct input_event), uio); + EVDEV_CLIENT_LOCKQ(client); + } + + EVDEV_CLIENT_UNLOCKQ(client); + + return (ret); +} + +static int +evdev_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct evdev_dev *evdev = dev->si_drv1; + struct evdev_client *client; + struct input_event event; + int ret = 0; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + debugf(client, "write %zd bytes by thread %d", uio->uio_resid, + uio->uio_td->td_tid); + + if (client->ec_revoked || evdev == NULL) + return (ENODEV); + + if (uio->uio_resid % sizeof(struct input_event) != 0) { + debugf(client, "write size not multiple of input_event size"); + return (EINVAL); + } + + while (uio->uio_resid > 0 && ret == 0) { + ret = uiomove(&event, sizeof(struct input_event), uio); + if (ret == 0) + ret = evdev_inject_event(evdev, event.type, event.code, + event.value); + } + + return (ret); +} + +static int +evdev_poll(struct cdev *dev, int events, struct thread *td) +{ + struct evdev_client *client; + int ret; + int revents = 0; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (POLLNVAL); + + debugf(client, "poll by thread %d", td->td_tid); + + if (client->ec_revoked) + return (POLLHUP); + + if (events & (POLLIN | POLLRDNORM)) { + EVDEV_CLIENT_LOCKQ(client); + if (!EVDEV_CLIENT_EMPTYQ(client)) + revents = events & (POLLIN | POLLRDNORM); + else { + client->ec_selected = true; + selrecord(td, &client->ec_selp); + } + EVDEV_CLIENT_UNLOCKQ(client); + } + + return (revents); +} + +static int +evdev_kqfilter(struct cdev *dev, struct knote *kn) +{ + struct evdev_client *client; + int ret; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + if (client->ec_revoked) + return (ENODEV); + + switch(kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &evdev_cdev_filterops; + break; + default: + return(EINVAL); + } + kn->kn_hook = (caddr_t)client; + + knlist_add(&client->ec_selp.si_note, kn, 0); + return (0); +} + +static int +evdev_kqread(struct knote *kn, long hint) +{ + struct evdev_client *client; + int ret; + + client = (struct evdev_client *)kn->kn_hook; + + EVDEV_CLIENT_LOCKQ_ASSERT(client); + + if (client->ec_revoked) { + kn->kn_flags |= EV_EOF; + ret = 1; + } else { + kn->kn_data = EVDEV_CLIENT_SIZEQ(client) * + sizeof(struct input_event); + ret = !EVDEV_CLIENT_EMPTYQ(client); + } + return (ret); +} + +static void +evdev_kqdetach(struct knote *kn) +{ + struct evdev_client *client; + + client = (struct evdev_client *)kn->kn_hook; + knlist_remove(&client->ec_selp.si_note, kn, 0); +} + +static int +evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct evdev_dev *evdev = dev->si_drv1; + struct evdev_client *client; + struct input_keymap_entry *ke; + int ret, len, limit, type_num; + uint32_t code; + size_t nvalues; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + if (client->ec_revoked || evdev == NULL) + return (ENODEV); + + /* file I/O ioctl handling */ + switch (cmd) { + case FIOSETOWN: + return (fsetown(*(int *)data, &client->ec_sigio)); + + case FIOGETOWN: + *(int *)data = fgetown(&client->ec_sigio); + return (0); + + case FIONBIO: + return (0); + + case FIOASYNC: + if (*(int *)data) + client->ec_async = true; + else + client->ec_async = false; + + return (0); + + case FIONREAD: + EVDEV_CLIENT_LOCKQ(client); + *(int *)data = + EVDEV_CLIENT_SIZEQ(client) * sizeof(struct input_event); + EVDEV_CLIENT_UNLOCKQ(client); + return (0); + } + + len = IOCPARM_LEN(cmd); + debugf(client, "ioctl called: cmd=0x%08lx, data=%p", cmd, data); + + /* evdev fixed-length ioctls handling */ + switch (cmd) { + case EVIOCGVERSION: + *(int *)data = EV_VERSION; + return (0); + + case EVIOCGID: + debugf(client, "EVIOCGID: bus=%d vendor=0x%04x product=0x%04x", + evdev->ev_id.bustype, evdev->ev_id.vendor, + evdev->ev_id.product); + memcpy(data, &evdev->ev_id, sizeof(struct input_id)); + return (0); + + case EVIOCGREP: + if (!evdev_event_supported(evdev, EV_REP)) + return (ENOTSUP); + + memcpy(data, evdev->ev_rep, sizeof(evdev->ev_rep)); + return (0); + + case EVIOCSREP: + if (!evdev_event_supported(evdev, EV_REP)) + return (ENOTSUP); + + evdev_inject_event(evdev, EV_REP, REP_DELAY, ((int *)data)[0]); + evdev_inject_event(evdev, EV_REP, REP_PERIOD, + ((int *)data)[1]); + return (0); + + case EVIOCGKEYCODE: + /* Fake unsupported ioctl */ + return (0); + + case EVIOCGKEYCODE_V2: + if (evdev->ev_methods == NULL || + evdev->ev_methods->ev_get_keycode == NULL) + return (ENOTSUP); + + ke = (struct input_keymap_entry *)data; + evdev->ev_methods->ev_get_keycode(evdev, evdev->ev_softc, ke); + return (0); + + case EVIOCSKEYCODE: + /* Fake unsupported ioctl */ + return (0); + + case EVIOCSKEYCODE_V2: + if (evdev->ev_methods == NULL || + evdev->ev_methods->ev_set_keycode == NULL) + return (ENOTSUP); + + ke = (struct input_keymap_entry *)data; + evdev->ev_methods->ev_set_keycode(evdev, evdev->ev_softc, ke); + return (0); + + case EVIOCGABS(0) ... EVIOCGABS(ABS_MAX): + if (evdev->ev_absinfo == NULL) + return (EINVAL); + + memcpy(data, &evdev->ev_absinfo[cmd - EVIOCGABS(0)], + sizeof(struct input_absinfo)); + return (0); + + case EVIOCSABS(0) ... EVIOCSABS(ABS_MAX): + if (evdev->ev_absinfo == NULL) + return (EINVAL); + + code = cmd - EVIOCSABS(0); + /* mt-slot number can not be changed */ + if (code == ABS_MT_SLOT) + return (EINVAL); + + EVDEV_LOCK(evdev); + evdev_set_absinfo(evdev, code, (struct input_absinfo *)data); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCSFF: + case EVIOCRMFF: + case EVIOCGEFFECTS: + /* Fake unsupported ioctls */ + return (0); + + case EVIOCGRAB: + EVDEV_LOCK(evdev); + if (*(int *)data) + ret = evdev_grab_client(evdev, client); + else + ret = evdev_release_client(evdev, client); + EVDEV_UNLOCK(evdev); + return (ret); + + case EVIOCREVOKE: + if (*(int *)data != 0) + return (EINVAL); + + EVDEV_LOCK(evdev); + if (dev->si_drv1 != NULL && !client->ec_revoked) { + evdev_dispose_client(evdev, client); + evdev_revoke_client(client); + } + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCSCLOCKID: + switch (*(int *)data) { + case CLOCK_REALTIME: + client->ec_clock_id = EV_CLOCK_REALTIME; + return (0); + case CLOCK_MONOTONIC: + client->ec_clock_id = EV_CLOCK_MONOTONIC; + return (0); + default: + return (EINVAL); + } + } + + /* evdev variable-length ioctls handling */ + switch (IOCBASECMD(cmd)) { + case EVIOCGNAME(0): + strlcpy(data, evdev->ev_name, len); + return (0); + + case EVIOCGPHYS(0): + if (evdev->ev_shortname[0] == 0) + return (ENOENT); + + strlcpy(data, evdev->ev_shortname, len); + return (0); + + case EVIOCGUNIQ(0): + if (evdev->ev_serial[0] == 0) + return (ENOENT); + + strlcpy(data, evdev->ev_serial, len); + return (0); + + case EVIOCGPROP(0): + limit = MIN(len, bitstr_size(INPUT_PROP_CNT)); + memcpy(data, evdev->ev_prop_flags, limit); + return (0); + + case EVIOCGMTSLOTS(0): + if (evdev->ev_mt == NULL) + return (EINVAL); + if (len < sizeof(uint32_t)) + return (EINVAL); + code = *(uint32_t *)data; + if (!ABS_IS_MT(code)) + return (EINVAL); + + nvalues = + MIN(len / sizeof(int32_t) - 1, MAXIMAL_MT_SLOT(evdev) + 1); + for (int i = 0; i < nvalues; i++) + ((int32_t *)data)[i + 1] = + evdev_get_mt_value(evdev, i, code); + return (0); + + case EVIOCGKEY(0): + limit = MIN(len, bitstr_size(KEY_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_KEY); + memcpy(data, evdev->ev_key_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGLED(0): + limit = MIN(len, bitstr_size(LED_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_LED); + memcpy(data, evdev->ev_led_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGSND(0): + limit = MIN(len, bitstr_size(SND_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_SND); + memcpy(data, evdev->ev_snd_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGSW(0): + limit = MIN(len, bitstr_size(SW_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_SW); + memcpy(data, evdev->ev_sw_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGBIT(0, 0) ... EVIOCGBIT(EV_MAX, 0): + type_num = IOCBASECMD(cmd) - EVIOCGBIT(0, 0); + debugf(client, "EVIOCGBIT(%d): data=%p, len=%d", type_num, + data, len); + return (evdev_ioctl_eviocgbit(evdev, type_num, len, data)); + } + + return (EINVAL); +} + +static int +evdev_ioctl_eviocgbit(struct evdev_dev *evdev, int type, int len, caddr_t data) +{ + unsigned long *bitmap; + int limit; + + switch (type) { + case 0: + bitmap = evdev->ev_type_flags; + limit = EV_CNT; + break; + case EV_KEY: + bitmap = evdev->ev_key_flags; + limit = KEY_CNT; + break; + case EV_REL: + bitmap = evdev->ev_rel_flags; + limit = REL_CNT; + break; + case EV_ABS: + bitmap = evdev->ev_abs_flags; + limit = ABS_CNT; + break; + case EV_MSC: + bitmap = evdev->ev_msc_flags; + limit = MSC_CNT; + break; + case EV_LED: + bitmap = evdev->ev_led_flags; + limit = LED_CNT; + break; + case EV_SND: + bitmap = evdev->ev_snd_flags; + limit = SND_CNT; + break; + case EV_SW: + bitmap = evdev->ev_sw_flags; + limit = SW_CNT; + break; + case EV_FF: + /* + * We don't support EV_FF now, so let's + * just fake it returning only zeros. + */ + bzero(data, len); + return (0); + default: + return (ENOTTY); + } + + /* + * Clear ioctl data buffer in case it's bigger than + * bitmap size + */ + bzero(data, len); + + limit = bitstr_size(limit); + len = MIN(limit, len); + memcpy(data, bitmap, len); + return (0); +} + +void +evdev_revoke_client(struct evdev_client *client) +{ + + EVDEV_LOCK_ASSERT(client->ec_evdev); + + client->ec_revoked = true; +} + +void +evdev_notify_event(struct evdev_client *client) +{ + + EVDEV_CLIENT_LOCKQ_ASSERT(client); + + if (client->ec_blocked) { + client->ec_blocked = false; + wakeup(client); + } + if (client->ec_selected) { + client->ec_selected = false; + selwakeup(&client->ec_selp); + } + KNOTE_LOCKED(&client->ec_selp.si_note, 0); + + if (client->ec_async && client->ec_sigio != NULL) + pgsigio(&client->ec_sigio, SIGIO, 0); +} + +int +evdev_cdev_create(struct evdev_dev *evdev) +{ + struct make_dev_args mda; + int ret, unit = 0; + + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; + mda.mda_devsw = &evdev_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = evdev; + + /* Try to coexist with cuse-backed input/event devices */ + while ((ret = make_dev_s(&mda, &evdev->ev_cdev, "input/event%d", unit)) + == EEXIST) + unit++; + + if (ret == 0) + evdev->ev_unit = unit; + + return (ret); +} + +int +evdev_cdev_destroy(struct evdev_dev *evdev) +{ + + destroy_dev(evdev->ev_cdev); + return (0); +} + +static void +evdev_client_gettime(struct evdev_client *client, struct timeval *tv) +{ + + switch (client->ec_clock_id) { + case EV_CLOCK_BOOTTIME: + /* + * XXX: FreeBSD does not support true POSIX monotonic clock. + * So aliase EV_CLOCK_BOOTTIME to EV_CLOCK_MONOTONIC. + */ + case EV_CLOCK_MONOTONIC: + microuptime(tv); + break; + + case EV_CLOCK_REALTIME: + default: + microtime(tv); + break; + } +} + +void +evdev_client_push(struct evdev_client *client, uint16_t type, uint16_t code, + int32_t value) +{ + struct timeval time; + size_t count, head, tail, ready; + + EVDEV_CLIENT_LOCKQ_ASSERT(client); + head = client->ec_buffer_head; + tail = client->ec_buffer_tail; + ready = client->ec_buffer_ready; + count = client->ec_buffer_size; + + /* If queue is full drop its content and place SYN_DROPPED event */ + if ((tail + 1) % count == head) { + debugf(client, "client %p: buffer overflow", client); + + head = (tail + count - 1) % count; + client->ec_buffer[head] = (struct input_event) { + .type = EV_SYN, + .code = SYN_DROPPED, + .value = 0 + }; + /* + * XXX: Here is a small race window from now till the end of + * report. The queue is empty but client has been already + * notified of data readyness. Can be fixed in two ways: + * 1. Implement bulk insert so queue lock would not be dropped + * till the SYN_REPORT event. + * 2. Insert SYN_REPORT just now and skip remaining events + */ + client->ec_buffer_head = head; + client->ec_buffer_ready = head; + } + + client->ec_buffer[tail].type = type; + client->ec_buffer[tail].code = code; + client->ec_buffer[tail].value = value; + client->ec_buffer_tail = (tail + 1) % count; + + /* Allow users to read events only after report has been completed */ + if (type == EV_SYN && code == SYN_REPORT) { + evdev_client_gettime(client, &time); + for (; ready != client->ec_buffer_tail; + ready = (ready + 1) % count) + client->ec_buffer[ready].time = time; + client->ec_buffer_ready = client->ec_buffer_tail; + } +} + +void +evdev_client_dumpqueue(struct evdev_client *client) +{ + struct input_event *event; + size_t i, head, tail, ready, size; + + head = client->ec_buffer_head; + tail = client->ec_buffer_tail; + ready = client->ec_buffer_ready; + size = client->ec_buffer_size; + + printf("evdev client: %p\n", client); + printf("event queue: head=%zu ready=%zu tail=%zu size=%zu\n", + head, ready, tail, size); + + printf("queue contents:\n"); + + for (i = 0; i < size; i++) { + event = &client->ec_buffer[i]; + printf("%zu: ", i); + + if (i < head || i > tail) + printf("unused\n"); + else + printf("type=%d code=%d value=%d ", event->type, + event->code, event->value); + + if (i == head) + printf("<- head\n"); + else if (i == tail) + printf("<- tail\n"); + else if (i == ready) + printf("<- ready\n"); + else + printf("\n"); + } +} + +static void +evdev_client_filter_queue(struct evdev_client *client, uint16_t type) +{ + struct input_event *event; + size_t head, tail, count, i; + bool last_was_syn = false; + + EVDEV_CLIENT_LOCKQ(client); + + i = head = client->ec_buffer_head; + tail = client->ec_buffer_tail; + count = client->ec_buffer_size; + client->ec_buffer_ready = client->ec_buffer_tail; + + while (i != client->ec_buffer_tail) { + event = &client->ec_buffer[i]; + i = (i + 1) % count; + + /* Skip event of given type */ + if (event->type == type) + continue; + + /* Remove empty SYN_REPORT events */ + if (event->type == EV_SYN && event->code == SYN_REPORT) { + if (last_was_syn) + continue; + else + client->ec_buffer_ready = (tail + 1) % count; + } + + /* Rewrite entry */ + memcpy(&client->ec_buffer[tail], event, + sizeof(struct input_event)); + + last_was_syn = (event->type == EV_SYN && + event->code == SYN_REPORT); + + tail = (tail + 1) % count; + } + + client->ec_buffer_head = i; + client->ec_buffer_tail = tail; + + EVDEV_CLIENT_UNLOCKQ(client); +} Added: head/sys/dev/evdev/evdev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/evdev/evdev.c Sun Sep 11 18:56:38 2016 (r305706) @@ -0,0 +1,917 @@ +/*- + * Copyright (c) 2014 Jakub Wojciech Klama + * Copyright (c) 2015-2016 Vladimir Kondratyev + * 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$ + */ + +#include "opt_evdev.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Sep 11 18:58:45 2016 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 8D0AABD5FED; Sun, 11 Sep 2016 18:58:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5D08F5; Sun, 11 Sep 2016 18:58:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BIwi6V023846; Sun, 11 Sep 2016 18:58:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BIwidO023845; Sun, 11 Sep 2016 18:58:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201609111858.u8BIwidO023845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 11 Sep 2016 18:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305707 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 18:58:45 -0000 Author: bapt Date: Sun Sep 11 18:58:44 2016 New Revision: 305707 URL: https://svnweb.freebsd.org/changeset/base/305707 Log: Directly set the O_NONBLOCK flags via open(2) Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sun Sep 11 18:56:38 2016 (r305706) +++ head/usr.sbin/syslogd/syslogd.c Sun Sep 11 18:58:44 2016 (r305707) @@ -621,10 +621,7 @@ main(int argc, char *argv[]) dprintf("sending on inet and/or inet6 socket\n"); } - if ((fklog = open(_PATH_KLOG, O_RDONLY, 0)) >= 0) - if (fcntl(fklog, F_SETFL, O_NONBLOCK) < 0) - fklog = -1; - if (fklog < 0) + if ((fklog = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0)) < 0) dprintf("can't open %s (%d)\n", _PATH_KLOG, errno); /* tuck my process id away */ From owner-svn-src-all@freebsd.org Sun Sep 11 19:08:22 2016 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 C5CC1BD6576; Sun, 11 Sep 2016 19:08:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0F417B; Sun, 11 Sep 2016 19:08:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BJ8LOx027869; Sun, 11 Sep 2016 19:08:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BJ8Lth027865; Sun, 11 Sep 2016 19:08:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609111908.u8BJ8Lth027865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 11 Sep 2016 19:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305708 - in head/sys/arm: conf ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 19:08:22 -0000 Author: gonzo Date: Sun Sep 11 19:08:21 2016 New Revision: 305708 URL: https://svnweb.freebsd.org/changeset/base/305708 Log: Add evdev support to TI ADC/touchscreen driver Add generic evdev support to touchscreen part of ti_adc: two absolute coordinates + button touch to indicate pen position. Pressure value reporting is not implemented yet. Tested on: Beaglebone Black + 4DCAPE-43T + tslib Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_adcreg.h head/sys/arm/ti/ti_adcvar.h Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/conf/BEAGLEBONE Sun Sep 11 19:08:21 2016 (r305708) @@ -131,3 +131,6 @@ device hdmi device ums device ukbd device kbdmux + +# Uncomment to enable evdev support for ti_adc +# options EVDEV Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/ti/ti_adc.c Sun Sep 11 19:08:21 2016 (r305708) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_evdev.h" + #include #include #include @@ -52,6 +54,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EVDEV +#include +#include +#endif + #include #include #include @@ -80,6 +87,41 @@ static struct ti_adc_input ti_adc_inputs static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 }; +static int ti_adc_detach(device_t dev); + +#ifdef EVDEV +static evdev_open_t ti_adc_ev_open; +static evdev_close_t ti_adc_ev_close; + +static struct evdev_methods ti_adc_evdev_methods = { + .ev_open = &ti_adc_ev_open, + .ev_close = &ti_adc_ev_close, +}; + +static void +ti_adc_ev_close(struct evdev_dev *evdev, void *ev_softc) +{ + /* Nothing to do here */ +} + +static int +ti_adc_ev_open(struct evdev_dev *evdev, void *ev_softc) +{ + /* Nothing to do here */ + return (0); +} + +static void +ti_adc_ev_report(struct ti_adc_softc *sc) +{ + + evdev_push_event(sc->sc_evdev, EV_ABS, ABS_X, sc->sc_x); + evdev_push_event(sc->sc_evdev, EV_ABS, ABS_Y, sc->sc_y); + evdev_push_event(sc->sc_evdev, EV_KEY, BTN_TOUCH, sc->sc_pen_down); + evdev_sync(sc->sc_evdev); +} +#endif /* EVDEV */ + static void ti_adc_enable(struct ti_adc_softc *sc) { @@ -450,7 +492,14 @@ ti_adc_tsc_read_data(struct ti_adc_softc #ifdef DEBUG_TSC device_printf(sc->sc_dev, "touchscreen x: %d, y: %d\n", x, y); #endif - /* TODO: That's where actual event reporting should take place */ + +#ifdef EVDEV + if ((sc->sc_x != x) || (sc->sc_y != y)) { + sc->sc_x = x; + sc->sc_y = y; + ti_adc_ev_report(sc); + } +#endif } static void @@ -488,11 +537,17 @@ ti_adc_intr(void *arg) status |= ADC_IRQ_HW_PEN_ASYNC; ADC_WRITE4(sc, ADC_IRQENABLE_CLR, ADC_IRQ_HW_PEN_ASYNC); +#ifdef EVDEV + ti_adc_ev_report(sc); +#endif } if (rawstatus & ADC_IRQ_PEN_UP) { sc->sc_pen_down = 0; status |= ADC_IRQ_PEN_UP; +#ifdef EVDEV + ti_adc_ev_report(sc); +#endif } if (status & ADC_IRQ_FIFO0_THRES) @@ -840,6 +895,39 @@ ti_adc_attach(device_t dev) ti_adc_setup(sc); TI_ADC_UNLOCK(sc); +#ifdef EVDEV + if (sc->sc_tsc_wires > 0) { + sc->sc_evdev = evdev_alloc(); + evdev_set_name(sc->sc_evdev, device_get_desc(dev)); + evdev_set_phys(sc->sc_evdev, device_get_nameunit(dev)); + evdev_set_serial(sc->sc_evdev, "0"); + evdev_set_methods(sc->sc_evdev, sc, &ti_adc_evdev_methods); + evdev_support_prop(sc->sc_evdev, INPUT_PROP_DIRECT); + evdev_support_event(sc->sc_evdev, EV_SYN); + evdev_support_event(sc->sc_evdev, EV_ABS); + evdev_support_event(sc->sc_evdev, EV_KEY); + + evdev_support_abs(sc->sc_evdev, ABS_X, 0, 0, + ADC_MAX_VALUE, 0, 0, 0); + evdev_support_abs(sc->sc_evdev, ABS_Y, 0, 0, + ADC_MAX_VALUE, 0, 0, 0); + + evdev_support_key(sc->sc_evdev, BTN_TOUCH); + + err = evdev_register(sc->sc_evdev); + if (err) { + device_printf(dev, + "failed to register evdev: error=%d\n", err); + ti_adc_detach(dev); + return (err); + } + + sc->sc_pen_down = 0; + sc->sc_x = -1; + sc->sc_y = -1; + } +#endif /* EVDEV */ + return (0); } @@ -854,6 +942,11 @@ ti_adc_detach(device_t dev) TI_ADC_LOCK(sc); ti_adc_reset(sc); ti_adc_setup(sc); + +#ifdef EVDEV + evdev_free(sc->sc_evdev); +#endif + TI_ADC_UNLOCK(sc); TI_ADC_LOCK_DESTROY(sc); Modified: head/sys/arm/ti/ti_adcreg.h ============================================================================== --- head/sys/arm/ti/ti_adcreg.h Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/ti/ti_adcreg.h Sun Sep 11 19:08:21 2016 (r305708) @@ -122,5 +122,6 @@ #define ADC_FIFO_STEP_ID_MSK 0x000f0000 #define ADC_FIFO_STEP_ID_SHIFT 16 #define ADC_FIFO_DATA_MSK 0x00000fff +#define ADC_MAX_VALUE 0xfff #endif /* _TI_ADCREG_H_ */ Modified: head/sys/arm/ti/ti_adcvar.h ============================================================================== --- head/sys/arm/ti/ti_adcvar.h Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/ti/ti_adcvar.h Sun Sep 11 19:08:21 2016 (r305708) @@ -55,6 +55,11 @@ struct ti_adc_softc { int sc_yn_bit, sc_yn_inp; uint32_t sc_tsc_enabled; int sc_pen_down; +#ifdef EVDEV + int sc_x; + int sc_y; + struct evdev_dev *sc_evdev; +#endif }; struct ti_adc_input { From owner-svn-src-all@freebsd.org Sun Sep 11 19:15:51 2016 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 B9976BD6766; Sun, 11 Sep 2016 19:15:51 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CFBC815; Sun, 11 Sep 2016 19:15:51 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [136.179.10.143] (helo=[10.140.230.85]) by id.bluezbox.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bjAEB-000NO1-IJ; Sun, 11 Sep 2016 12:15:44 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r305706 - in head: etc/mtree include sys/conf sys/dev/evdev From: Oleksandr Tymoshenko In-Reply-To: <201609111856.u8BIucU3023555@repo.freebsd.org> Date: Sun, 11 Sep 2016 12:15:13 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <87B6EE13-138A-4473-9953-7D70CBA284CB@freebsd.org> References: <201609111856.u8BIucU3023555@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3124) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Sep 11, 2016, at 11:56 AM, Oleksandr Tymoshenko wrote: > > Author: gonzo > Date: Sun Sep 11 18:56:38 2016 > New Revision: 305706 > URL: https://svnweb.freebsd.org/changeset/base/305706 > > Log: > Add evdev protocol implementation > > evdev is a generic input event interface compatible with Linux > evdev API at ioctl level. It allows using unmodified (apart from > header name) input evdev drivers in Xorg, Wayland, Qt. > > This commit has only generic kernel API. evdev support for individual > hardware drivers like ukbd, ums, atkbd, etc. will be committed later. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 19:15:51 -0000 > On Sep 11, 2016, at 11:56 AM, Oleksandr Tymoshenko = wrote: >=20 > Author: gonzo > Date: Sun Sep 11 18:56:38 2016 > New Revision: 305706 > URL: https://svnweb.freebsd.org/changeset/base/305706 >=20 > Log: > Add evdev protocol implementation >=20 > evdev is a generic input event interface compatible with Linux > evdev API at ioctl level. It allows using unmodified (apart from > header name) input evdev drivers in Xorg, Wayland, Qt. >=20 > This commit has only generic kernel API. evdev support for individual > hardware drivers like ukbd, ums, atkbd, etc. will be committed later. Those who would like to test evdev but doesn=E2=80=99t want to wait = until evdev support=20 patches for generic input hardware land in the tree can get them from = this repo: https://github.com/wulf7/freebsd/tree/evdev= From owner-svn-src-all@freebsd.org Sun Sep 11 19:51:34 2016 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 164AEBD7028; Sun, 11 Sep 2016 19:51:34 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3BF27C5; Sun, 11 Sep 2016 19:51:33 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BJpXd0045922; Sun, 11 Sep 2016 19:51:33 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BJpX1U045921; Sun, 11 Sep 2016 19:51:33 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201609111951.u8BJpX1U045921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Sun, 11 Sep 2016 19:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305709 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 19:51:34 -0000 Author: antoine Date: Sun Sep 11 19:51:32 2016 New Revision: 305709 URL: https://svnweb.freebsd.org/changeset/base/305709 Log: Add more obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Sep 11 19:08:21 2016 (r305708) +++ head/ObsoleteFiles.inc Sun Sep 11 19:51:32 2016 (r305709) @@ -41,6 +41,8 @@ # 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue OLD_FILES+=usr/tests/sys/kqueue/kqtest OLD_FILES+=usr/tests/sys/kqueue/kqueue_test +# 20160903: idle page zeroing support removed +OLD_FILES+=usr/share/man/man9/pmap_zero_idle.9.gz # 20160901: Remove digi(4) OLD_FILES+=usr/share/man/man4/digi.4.gz # 20160819: Remove ie(4) @@ -59,6 +61,8 @@ OLD_FILES+=usr/share/man/man8/sicontrol. OLD_FILES+=usr/share/man/man4/scd.4.gz # 20160815: Remove mcd(4) OLD_FILES+=usr/share/man/man4/mcd.4.gz +# 20160805: lockmgr_waiters(9) removed +OLD_FILES+=usr/share/man/man9/lockmgr_waiters.9.gz # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE @@ -213,18 +217,23 @@ OLD_LIBS+=usr/lib32/pam_unix.so.5 OLD_FILES+=usr/include/altq/altq_codel.h OLD_FILES+=usr/include/altq/altq_fairq.h # 20160519: remove DTrace Toolkit from base +OLD_FILES+=usr/sbin/dtruss OLD_FILES+=usr/share/dtrace/toolkit/execsnoop OLD_FILES+=usr/share/dtrace/toolkit/hotkernel OLD_FILES+=usr/share/dtrace/toolkit/hotuser OLD_FILES+=usr/share/dtrace/toolkit/opensnoop OLD_FILES+=usr/share/dtrace/toolkit/procsystime OLD_DIRS+=usr/share/dtrace/toolkit +OLD_FILES+=usr/share/man/man1/dtruss.1.gz # 20160519: stale MLINK removed OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160517: ReiserFS removed OLD_FILES+=usr/share/man/man5/reiserfs.5.gz +# 20160504: tests rework +OLD_FILES+=usr/tests/lib/libc/regex/data/README # 20160430: kvm_getfiles(3) removed from kvm(3) OLD_LIBS+=lib/libkvm.so.6 +OLD_LIBS+=usr/lib32/libkvm.so.6 OLD_FILES+=usr/share/man/man3/kvm_getfiles.3.gz # 20160423: remove mroute6d OLD_FILES+=etc/rc.d/mroute6d @@ -372,12 +381,18 @@ OLD_LIBS+=usr/lib32/libcapsicum.so.0 OLD_FILES+=usr/lib32/libcapsicum_p.a # 20160223: functionality from mkulzma(1) merged into mkuzip(1) OLD_FILES+=usr/bin/mkulzma +OLD_FILES+=usr/share/man/man4/geom_uncompress.4.gz +OLD_FILES+=usr/share/man/man8/mkulzma.8.gz # 20160211: Remove obsolete unbound-control-setup OLD_FILES+=usr/sbin/unbound-control-setup +# 20160121: cc.h moved +OLD_FILES+=usr/include/netinet/cc.h # 20160116: Update mandoc to cvs snapshot 20160116 OLD_FILES+=usr/share/mdocml/example.style.css OLD_FILES+=usr/share/mdocml/style.css OLD_DIRS+=usr/share/mdocml +# 20160114: SA-16:06.snmpd +OLD_FILES+=usr/share/examples/etc/snmpd.config # 20151225: new clang import which bumps version from 3.7.0 to 3.7.1. OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/asan_interface.h @@ -462,6 +477,9 @@ OLD_FILES+=usr/lib/clang/3.7.0/lib/freeb OLD_DIRS+=usr/lib/clang/3.7.0/lib/freebsd OLD_DIRS+=usr/lib/clang/3.7.0/lib OLD_DIRS+=usr/lib/clang/3.7.0 +# 20151201: mqueue tests 3 and 4 disabled +OLD_FILES+=usr/tests/sys/mqueue/mqtest3 +OLD_FILES+=usr/tests/sys/mqueue/mqtest4 # 20151130: libelf moved from /usr/lib to /lib (libkvm dependency in r291406) OLD_LIBS+=usr/lib/libelf.so.2 # 20151115: Fox bad upgrade scheme @@ -596,6 +614,8 @@ OLD_LIBS+=lib/libcrypto.so.7 OLD_LIBS+=usr/lib/libssl.so.7 OLD_LIBS+=usr/lib32/libcrypto.so.7 OLD_LIBS+=usr/lib32/libssl.so.7 +# 20151029: LinuxKPI moved to sys/compat/linuxkpi +OLD_FILES+=usr/include/dev/usb/usb_compat_linux.h # 20151015: test symbols moved to /usr/lib/debug OLD_DIRS+=usr/tests/lib/atf/libatf-c++/.debug OLD_FILES+=usr/tests/lib/atf/libatf-c++/.debug/atf_c++_test.debug From owner-svn-src-all@freebsd.org Sun Sep 11 20:14:20 2016 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 99C3DBD7507; Sun, 11 Sep 2016 20:14:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7541EC; Sun, 11 Sep 2016 20:14:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BKEJEY054254; Sun, 11 Sep 2016 20:14:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BKEJ9F054253; Sun, 11 Sep 2016 20:14:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201609112014.u8BKEJ9F054253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 11 Sep 2016 20:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305710 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 20:14:20 -0000 Author: cem Date: Sun Sep 11 20:14:19 2016 New Revision: 305710 URL: https://svnweb.freebsd.org/changeset/base/305710 Log: ioat(4): De-spam ioat_process_events KTR logs Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun Sep 11 19:51:32 2016 (r305709) +++ head/sys/dev/ioat/ioat.c Sun Sep 11 20:14:19 2016 (r305710) @@ -663,8 +663,6 @@ ioat_process_events(struct ioat_softc *i boolean_t pending; int error; - CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - mtx_lock(&ioat->cleanup_lock); /* @@ -679,8 +677,6 @@ ioat_process_events(struct ioat_softc *i completed = 0; comp_update = ioat_get_chansts(ioat); - CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx", - __func__, ioat->chan_idx, comp_update, ioat->last_seen); status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; if (status == ioat->last_seen) { @@ -690,6 +686,8 @@ ioat_process_events(struct ioat_softc *i */ goto out; } + CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx", + __func__, ioat->chan_idx, comp_update, ioat->last_seen); desc = ioat_get_ring_entry(ioat, ioat->tail - 1); while (desc->hw_desc_bus_addr != status && ioat_get_active(ioat) > 0) { From owner-svn-src-all@freebsd.org Sun Sep 11 20:15:42 2016 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 E41D9BD75CD; Sun, 11 Sep 2016 20:15:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B72CE692; Sun, 11 Sep 2016 20:15:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BKFf9o054553; Sun, 11 Sep 2016 20:15:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BKFfgZ054552; Sun, 11 Sep 2016 20:15:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201609112015.u8BKFfgZ054552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 11 Sep 2016 20:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305711 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 20:15:43 -0000 Author: cem Date: Sun Sep 11 20:15:41 2016 New Revision: 305711 URL: https://svnweb.freebsd.org/changeset/base/305711 Log: ioat(4): Start poll timer when descriptors are released to HW Rather than when the software creates the descriptors. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun Sep 11 20:14:19 2016 (r305710) +++ head/sys/dev/ioat/ioat.c Sun Sep 11 20:15:41 2016 (r305711) @@ -949,6 +949,13 @@ ioat_release(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); + + if (!ioat->is_completion_pending) { + ioat->is_completion_pending = TRUE; + callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, + ioat); + callout_stop(&ioat->shrink_timer); + } mtx_unlock(&ioat->submit_lock); } @@ -1788,13 +1795,6 @@ ioat_submit_single(struct ioat_softc *io atomic_add_rel_int(&ioat->head, 1); atomic_add_rel_int(&ioat->hw_head, 1); - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); - callout_stop(&ioat->shrink_timer); - } - ioat->stats.descriptors_submitted++; } From owner-svn-src-all@freebsd.org Sun Sep 11 20:50:03 2016 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 0A978BD7FA9 for ; Sun, 11 Sep 2016 20:50:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm4.bullet.mail.bf1.yahoo.com (nm4.bullet.mail.bf1.yahoo.com [98.139.212.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B747A8A6 for ; Sun, 11 Sep 2016 20:50:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473626818; bh=1GnL2pUQf8mzrFtWMZqRwlqlgVFLDe/7JLfX6P23s5w=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=FMsiIxH0QMLgawd9Pn+si9hyvncqGU7o92jCYdfKM8gn9EfYPZxUUZbI915pzvaNTOygg9/Y4QWcs5Oxcw2KzzFfmXDLE3Z+7hQuZ53INDH2YafNiAEBzy0QOTLdQiXXM0GvetMIWbY71GRZEbicqOZwaYxVW7T7R+m3jBkFJQIP2/+bDKjXsPzsRgT8p671lWjW88WsP2jk0dWmEcDF8SFaikIaqpfIqcQ82+/s5HcwNOwmPxm8aSNSbaDhsH6E9pnAwxce5Ooytju3ReSwhXj5zUU4MONnKoyEO+EHdmBxnLGCwAsbRVrk+3skNulxPwL1FYZJJd6/iMHocJ6gPw== Received: from [66.196.81.173] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 20:46:58 -0000 Received: from [98.139.211.192] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 20:46:58 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 20:46:58 -0000 X-Yahoo-Newman-Id: 358015.53969.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: AuYDpH4VM1mqe5DpPdf_MNMjkflSz7eLT7AUday7bXfPi4B EOqPGStBB9e26yXqctcyS3QQhF9rN.Bm4S8uotJmSxunJZLYUR8QZIvCUZN. VznrtC.qR3OMbbQmYKkTOW4pV4Ra.ON0kviCL4H61lh44OQ82nAVwQkbdVcz TAPoD4v50j9DgZbEx3UqpPGNIKS0si4mQ24Z6R7bnrrdHbzvfE0gw8ByRddM .9R8K1q8FUeDV_9dXySk3LJgQsy081nunpume3wiMGAZ78wX4G3nj22siNhy _t6bgmWqL4L2zzDpwDk7jEgJZVizUk6tsaNaAmhJyqlrRBibZOqkgePWzxyS 7tzF397aPRp4BdU0xnfTnxJInwHgwKydonQHBVw3SAAg3bz.I3a3Qf4iF2iM jRV2ewn_oOHJGXbnDL7krOVf6MFh0iH_AAyfmPWEYzrLKE.6u92ovOxZOxGo 0BpIN.BaJxe2CsGwUnbtMsHIa8egfTnqlc7dx.MyXnnseXZJDbDMjCQ5L2Qt yIDn8jmPS5gtoNhO7T.W3wwXXXk4UuB4CJ1vIWjtzeuy5nQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201609111555.u8BFtCRY051694@repo.freebsd.org> <5739a5ee-4464-2a35-fa9e-5d84d671c6a3@freebsd.org> From: Pedro Giffuni Message-ID: <1dd1619f-2369-64d8-879a-cdbb380c2a95@FreeBSD.org> Date: Sun, 11 Sep 2016 15:47:01 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <5739a5ee-4464-2a35-fa9e-5d84d671c6a3@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.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 20:50:03 -0000 On 11/09/2016 11:52, Allan Jude wrote: > On 2016-09-11 12:17, Pedro Giffuni wrote: >> >> On 09/11/16 10:55, Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Sun Sep 11 15:55:11 2016 >>> New Revision: 305694 >>> URL: https://svnweb.freebsd.org/changeset/base/305694 >>> >>> Log: >>> Update OpenRCS to version 20160831 >>> >>> Obtained from: OpenBSD >>> >> Bah .. this brings some pledge stuff that makes things ugly/unportable. >> Will revert. >> >> Pedro. >> > How nasty is the pledge stuff? It is usually fairly easy to convert > pledge to Capsicum, so it might be worth looking at. I didn't look at it too much, TBH. In any case It is not clear that we may want openrcs in the tree, so at least for now there is not need to add more complexity. > I'll take a look at it later in the week. > If you want suggestion for something more interesting, capsicum-ising patch(1) would be useful. I gave it a try once but got stuck with the use of temporary files. Pedro. From owner-svn-src-all@freebsd.org Sun Sep 11 23:04:52 2016 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 2837EBD7393; Sun, 11 Sep 2016 23:04:52 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C774D62A; Sun, 11 Sep 2016 23:04:51 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id jDnlb1pIWgdaljDnnbBg5R; Sun, 11 Sep 2016 17:04:43 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=mACy7ywjV3k7yP9ZORMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A22F61856; Sun, 11 Sep 2016 16:04:41 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u8BN4fG0038653; Sun, 11 Sep 2016 16:04:41 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201609112304.u8BN4fG0038653@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Pedro Giffuni cc: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs In-Reply-To: Message from Pedro Giffuni of "Sun, 11 Sep 2016 15:47:01 -0500." <1dd1619f-2369-64d8-879a-cdbb380c2a95@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Sep 2016 16:04:41 -0700 X-CMAE-Envelope: MS4wfAyUSTdJNMuN9iJzqdS3PC4wTe2JDndflGVXS1r+tQ3BjPjTqA4B/DOQWWHz5K+XXdCDwd5UhYZ53jxuRhaKXXZ6v9yLXOnsUmHEpvBbg+TDeb7/2flh U1eqjQICVM6hMD6/upKHHIwmXywxmxyjs0MQba6oXnNR/Yik3KSYhmj26P/Y4zRcto0GMKiWpJ67/CghIIg96MkI43Y3S0QSCurlPRgYKa8wWU3pRE0/ZKGt CP1ctDSdLiIS8cqHlNKaGxdEUc+c2cOCgNqghG/IB6o8J0xe6t6JwJK3qk6QMFya6Wz2oKJj/7v7E+urhYpRmA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 23:04:52 -0000 In message <1dd1619f-2369-64d8-879a-cdbb380c2a95@FreeBSD.org>, Pedro Giffuni wr ites: > > > On 11/09/2016 11:52, Allan Jude wrote: > > On 2016-09-11 12:17, Pedro Giffuni wrote: > >> > >> On 09/11/16 10:55, Pedro F. Giffuni wrote: > >>> Author: pfg > >>> Date: Sun Sep 11 15:55:11 2016 > >>> New Revision: 305694 > >>> URL: https://svnweb.freebsd.org/changeset/base/305694 > >>> > >>> Log: > >>> Update OpenRCS to version 20160831 > >>> > >>> Obtained from: OpenBSD > >>> > >> Bah .. this brings some pledge stuff that makes things ugly/unportable. > >> Will revert. > >> > >> Pedro. > >> > > How nasty is the pledge stuff? It is usually fairly easy to convert > > pledge to Capsicum, so it might be worth looking at. > > I didn't look at it too much, TBH. > In any case It is not clear that we may want openrcs in the tree, so at > least for > now there is not need to add more complexity. > > > I'll take a look at it later in the week. > > > > If you want suggestion for something more interesting, capsicum-ising > patch(1) > would be useful. I gave it a try once but got stuck with the use of > temporary files. Why would we want to put OpenBSD's or for that matter any other in base? Wasn't it decided just before 10.0 was released to remove RCS from base? I recall that there were a couple of issues that needed resolving, one of which was some ports needed it, which is why I created the rcs57 port. Wouldn't ports be a better home for OpenBSD RCS? The other question I have is, wasn't RCS in the original BSD. How did it become GPL? How did it come about that we ended up having a GPL RCS in our base tree? We don't use CVS any more and the only reason we had to keep RCS in base was to satisfy the need for CVS. Since CVS isn't in the tree any more, do we still need RCS in base? devel/rcs57, which is 100% compatible with what we have in base, is in ports. devel/rcs, though named the same, isn't 100% compatible, causing some software to choke. Would OpenBSD have the same compatibility issues as devel/rcs (rcs 5.9)? I think we should reconsider. My take on it is that now that devel/rcs57 is in ports, rcs in base is redundant and could probably be removed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun Sep 11 23:08:59 2016 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 3FC49BD7412; Sun, 11 Sep 2016 23:08:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16A8C802; Sun, 11 Sep 2016 23:08:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BN8wBD019304; Sun, 11 Sep 2016 23:08:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BN8vru019300; Sun, 11 Sep 2016 23:08:57 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609112308.u8BN8vru019300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 23:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305713 - in head/sys/dev/cxgbe: . common firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 23:08:59 -0000 Author: np Date: Sun Sep 11 23:08:57 2016 New Revision: 305713 URL: https://svnweb.freebsd.org/changeset/base/305713 Log: cxgbe(4): Add support for additional port types and link speeds. Sponsored by: Chelsio Communications. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/adapter.h Sun Sep 11 23:08:57 2016 (r305713) @@ -1040,12 +1040,26 @@ is_10G_port(const struct port_info *pi) } static inline bool +is_25G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) != 0); +} + +static inline bool is_40G_port(const struct port_info *pi) { return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); } +static inline bool +is_100G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) != 0); +} + static inline int port_top_speed(const struct port_info *pi) { @@ -1054,6 +1068,8 @@ port_top_speed(const struct port_info *p return (100); if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) return (40); + if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) + return (25); if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) return (10); if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 23:08:57 2016 (r305713) @@ -3669,8 +3669,9 @@ void t4_ulprx_read_la(struct adapter *ad } #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \ - FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG) + FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \ + FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \ + FW_PORT_CAP_ANEG) /** * t4_link_l1cfg - apply link configuration to MAC/PHY @@ -5775,6 +5776,11 @@ const char *t4_get_port_type_description "QSA", "QSFP", "BP40_BA", + "KR4_100G", + "CR4_QSFP", + "CR_QSFP", + "CR2_QSFP", + "SFP28", }; if (port_type < ARRAY_SIZE(port_type_description)) @@ -7462,8 +7468,12 @@ int t4_handle_fw_rpl(struct adapter *ada speed = 1000; else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) speed = 10000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_25G)) + speed = 25000; else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) speed = 40000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100G)) + speed = 100000; for_each_port(adap, i) { pi = adap2pinfo(adap, i); Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Sun Sep 11 23:08:57 2016 (r305713) @@ -6305,7 +6305,7 @@ struct fw_acl_vlan_cmd { enum fw_port_cap { FW_PORT_CAP_SPEED_100M = 0x0001, FW_PORT_CAP_SPEED_1G = 0x0002, - FW_PORT_CAP_SPEED_2_5G = 0x0004, + FW_PORT_CAP_SPEED_25G = 0x0004, FW_PORT_CAP_SPEED_10G = 0x0008, FW_PORT_CAP_SPEED_40G = 0x0010, FW_PORT_CAP_SPEED_100G = 0x0020, @@ -6776,6 +6776,11 @@ enum fw_port_type { FW_PORT_TYPE_QSA = 13, /* No, 1, Yes, No, No, No, 10G */ FW_PORT_TYPE_QSFP = 14, /* No, 4, Yes, No, No, No, 40G */ FW_PORT_TYPE_BP40_BA = 15, /* No, 4, No, No, Yes, Yes, 40G/10G/1G, BP ANGE */ + FW_PORT_TYPE_KR4_100G = 16, /* No, 4, 100G */ + FW_PORT_TYPE_CR4_QSFP = 17, /* No, 4, 100G */ + FW_PORT_TYPE_CR_QSFP = 18, /* No, 1, 25G */ + FW_PORT_TYPE_CR2_QSFP = 19, /* No, 2, 50G */ + FW_PORT_TYPE_SFP28 = 20, /* No, 1, 25G */ FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/t4_main.c Sun Sep 11 23:08:57 2016 (r305713) @@ -3460,6 +3460,38 @@ build_medialist(struct port_info *pi, st } break; + case FW_PORT_TYPE_CR_QSFP: + case FW_PORT_TYPE_SFP28: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_SR: + MPASS(pi->port_type == FW_PORT_TYPE_SFP28); + ifmedia_add(media, m | IFM_25G_SR, 0, NULL); + ifmedia_set(media, m | IFM_25G_SR); + break; + + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_25G_CR, 0, NULL); + ifmedia_set(media, m | IFM_25G_CR); + break; + + case FW_PORT_MOD_TYPE_NONE: + m &= ~IFM_FDX; + ifmedia_add(media, m | IFM_NONE, 0, NULL); + ifmedia_set(media, m | IFM_NONE); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + case FW_PORT_TYPE_QSFP: switch (pi->mod_type) { @@ -3495,6 +3527,67 @@ build_medialist(struct port_info *pi, st } break; + case FW_PORT_TYPE_CR2_QSFP: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_50G_CR2, 0, NULL); + ifmedia_set(media, m | IFM_50G_CR2); + break; + + case FW_PORT_MOD_TYPE_NONE: + m &= ~IFM_FDX; + ifmedia_add(media, m | IFM_NONE, 0, NULL); + ifmedia_set(media, m | IFM_NONE); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + + case FW_PORT_TYPE_KR4_100G: + case FW_PORT_TYPE_CR4_QSFP: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_LR: + ifmedia_add(media, m | IFM_100G_LR4, 0, NULL); + ifmedia_set(media, m | IFM_100G_LR4); + break; + + case FW_PORT_MOD_TYPE_SR: + ifmedia_add(media, m | IFM_100G_SR4, 0, NULL); + ifmedia_set(media, m | IFM_100G_SR4); + break; + + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_100G_CR4, 0, NULL); + ifmedia_set(media, m | IFM_100G_CR4); + break; + + case FW_PORT_MOD_TYPE_NONE: + m &= ~IFM_FDX; + ifmedia_add(media, m | IFM_NONE, 0, NULL); + ifmedia_set(media, m | IFM_NONE); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + default: device_printf(pi->dev, "unknown port_type (%d), mod_type (%d)\n", pi->port_type, From owner-svn-src-all@freebsd.org Sun Sep 11 23:49:19 2016 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 F2CDDBD793B for ; Sun, 11 Sep 2016 23:49:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 984C36AE for ; Sun, 11 Sep 2016 23:49:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473637751; bh=ZGIx44/NwBkgRgsOmSxeFyAh0LP3hCl45a2FybN363o=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=M00n7vzT3gsG+QNpTJyTQjzZIdUcrYrWbKa8r+A3beYidhAIjXmETazVN1pDxvikoDZbxfGrhCigyKeEBK59KRCYLISRyKU84F7m1oEWhVzfArHiwX1SvsXoWbLkrEo8ZuFggklpbiXZEdN+/RRtXTF1XtaSAWmlrJgVju+Zat1EZFJExzRUD0LYfyx2LoNQQWt8JXs2YR3KArO7Uo4h2oIRzBzJ0X45dfjU62Pkq5m/NfSCHeJIImiPIqJreETDuvxg18Z3Q7BA/sTkgwZetsERLVCH45dQLlyLfq0cnXgS36/VorBYsHRUhWTNEGWvS6BpyRW/3pSezXx3ff/NAw== Received: from [66.196.81.174] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 23:49:11 -0000 Received: from [68.142.230.77] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 23:49:11 -0000 Received: from [127.0.0.1] by smtp234.mail.bf1.yahoo.com with NNFMP; 11 Sep 2016 23:49:11 -0000 X-Yahoo-Newman-Id: 209470.93912.bm@smtp234.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6IBbEJgVM1m1a2bDIAMI3kbnO6Lt7VvBAX2_VyOvyyEh05m MxvPhVC2VC3beg2XyAsRIlmboCaNOj7bnqR8YJfSInEo6hQXw91R8B3OU7uG mvp2CZhHQYZOjrsRussAIgzHitJYRBVhZB54ycdCrEUy4Xdg0xb7Jif42Jkq kIlMaKPXxQJ1tYCNIFyulCa32vD990Zc6x_RbY5qR8pxUhp_054mNP1AsU0x xByyVX4ao1cTGISpZXb2b5093TbqklgvUOFLzx9B_Jo.elAOZo.JjPUO5js_ J5N19Onjyv2mnXDsDgrwxkkcNc.iD9xmi3tH7JJFLKStvLzK9FL19_qiavJK 3VT_nYW1W13DaO8HlJLP6uxsGUyGOG20UIWcS_O9IOVzLURVLfgszLCn6lDq 4fe_a6a1aOyU7tz3cEXV4ua7.Do5pvSjuf_x6Lkh7Z2SW3w.vzS6hJoztIXi lOSpH.7py8CgPezAJOOJKgX.kO6V_HSftfQF5ZN6zo2DGcikvPIhhxelcNop LjXwBBxXPIVFmxlRhYkyRSHKmwKC9UIOXIfg8SYnbVxAIJw-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs To: Cy Schubert References: <201609112304.u8BN4fG0038653@slippy.cwsent.com> Cc: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org From: Pedro Giffuni Message-ID: <3b13fc77-c96b-0ef3-988c-d99b3156963a@FreeBSD.org> Date: Sun, 11 Sep 2016 18:49:15 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201609112304.u8BN4fG0038653@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2016 23:49:19 -0000 On 11/09/2016 18:04, Cy Schubert wrote: > In message <1dd1619f-2369-64d8-879a-cdbb380c2a95@FreeBSD.org>, Pedro > Giffuni wr > ites: >> >> On 11/09/2016 11:52, Allan Jude wrote: >>> On 2016-09-11 12:17, Pedro Giffuni wrote: >>>> On 09/11/16 10:55, Pedro F. Giffuni wrote: >>>>> Author: pfg >>>>> Date: Sun Sep 11 15:55:11 2016 >>>>> New Revision: 305694 >>>>> URL: https://svnweb.freebsd.org/changeset/base/305694 >>>>> >>>>> Log: >>>>> Update OpenRCS to version 20160831 >>>>> >>>>> Obtained from: OpenBSD >>>>> >>>> Bah .. this brings some pledge stuff that makes things ugly/unportable. >>>> Will revert. >>>> >>>> Pedro. >>>> >>> How nasty is the pledge stuff? It is usually fairly easy to convert >>> pledge to Capsicum, so it might be worth looking at. >> I didn't look at it too much, TBH. >> In any case It is not clear that we may want openrcs in the tree, so at >> least for >> now there is not need to add more complexity. >> >>> I'll take a look at it later in the week. >>> >> If you want suggestion for something more interesting, capsicum-ising >> patch(1) >> would be useful. I gave it a try once but got stuck with the use of >> temporary files. > Why would we want to put OpenBSD's or for that matter any other in base? > Wasn't it decided just before 10.0 was released to remove RCS from base? Let me set this straight right away: OpenRCS was brought to the vendor tree at a time when: 1) The removal of GNU rcs proved to be a bad idea. 2) OpenBSD has problems paying electricity builds and there was some (low) risk of loosing it. There will be a second attempt to get rid of GNU RCS for FreeBSD 12: you can follow that up in the -current list. I am personally hoping this attempt will be successful and definitive. There are NO plans to import OpenRCS into base. Pedro. From owner-svn-src-all@freebsd.org Mon Sep 12 00:03:15 2016 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 D6F78BD7FD2; Mon, 12 Sep 2016 00:03:15 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A78B51BC; Mon, 12 Sep 2016 00:03:15 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C03E9g042293; Mon, 12 Sep 2016 00:03:14 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C03EJ6042292; Mon, 12 Sep 2016 00:03:14 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201609120003.u8C03EJ6042292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 12 Sep 2016 00:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305714 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 00:03:15 -0000 Author: grehan Date: Mon Sep 12 00:03:14 2016 New Revision: 305714 URL: https://svnweb.freebsd.org/changeset/base/305714 Log: MFC r302546 Implement right shift/ctl, and convert the VNC/xorg scancode of 0xff03 into right-alt. Modified: stable/11/usr.sbin/bhyve/ps2kbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/ps2kbd.c ============================================================================== --- stable/11/usr.sbin/bhyve/ps2kbd.c Sun Sep 11 23:08:57 2016 (r305713) +++ stable/11/usr.sbin/bhyve/ps2kbd.c Mon Sep 12 00:03:14 2016 (r305714) @@ -324,7 +324,9 @@ ps2kbd_keysym_queue(struct ps2kbd_softc fifo_put(sc, 0x12); break; case 0xffe2: /* Right shift */ - /* XXX */ + if (!down) + fifo_put(sc, 0xf0); + fifo_put(sc, 0x59); break; case 0xffe3: /* Left control */ if (!down) @@ -332,7 +334,10 @@ ps2kbd_keysym_queue(struct ps2kbd_softc fifo_put(sc, 0x14); break; case 0xffe4: /* Right control */ - /* XXX */ + fifo_put(sc, 0xe0); + if (!down) + fifo_put(sc, 0xf0); + fifo_put(sc, 0x14); break; case 0xffe7: /* Left meta */ /* XXX */ @@ -345,6 +350,7 @@ ps2kbd_keysym_queue(struct ps2kbd_softc fifo_put(sc, 0xf0); fifo_put(sc, 0x11); break; + case 0xfe03: /* AltGr */ case 0xffea: /* Right alt */ fifo_put(sc, 0xe0); if (!down) From owner-svn-src-all@freebsd.org Mon Sep 12 00:15:41 2016 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 9CF96BD42AB; Mon, 12 Sep 2016 00:15:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB9E854; Mon, 12 Sep 2016 00:15:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C0FeLd046244; Mon, 12 Sep 2016 00:15:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C0Fem9046241; Mon, 12 Sep 2016 00:15:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609120015.u8C0Fem9046241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 12 Sep 2016 00:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305715 - in head/sys/dev/cxgbe: . firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 00:15:41 -0000 Author: np Date: Mon Sep 12 00:15:40 2016 New Revision: 305715 URL: https://svnweb.freebsd.org/changeset/base/305715 Log: cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps. TLS is one of the capabilities of the crypto engine in T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Sep 12 00:03:14 2016 (r305714) +++ head/sys/dev/cxgbe/adapter.h Mon Sep 12 00:15:40 2016 (r305715) @@ -835,7 +835,7 @@ struct adapter { uint16_t niccaps; uint16_t toecaps; uint16_t rdmacaps; - uint16_t tlscaps; + uint16_t cryptocaps; uint16_t iscsicaps; uint16_t fcoecaps; Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Mon Sep 12 00:03:14 2016 (r305714) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Mon Sep 12 00:15:40 2016 (r305715) @@ -135,7 +135,9 @@ enum fw_wr_opcodes { FW_POFCOE_ULPTX_WR = 0x43, FW_ISCSI_TX_DATA_WR = 0x45, FW_PTP_TX_PKT_WR = 0x46, - FW_SEC_LOOKASIDE_LPBK_WR= 0x6d, + FW_TLSTX_DATA_WR = 0x68, + FW_TLS_KEYCTX_TX_WR = 0x69, + FW_CRYPTO_LOOKASIDE_WR = 0x6d, FW_COiSCSI_TGT_WR = 0x70, FW_COiSCSI_TGT_CONN_WR = 0x71, FW_COiSCSI_TGT_XMIT_WR = 0x72, @@ -3384,8 +3386,429 @@ struct fw_pi_error { #define G_FW_PI_ERROR_ERR_TYPE(x) \ (((x) >> S_FW_PI_ERROR_ERR_TYPE) & M_FW_PI_ERROR_ERR_TYPE) +struct fw_tlstx_data_wr { + __be32 op_to_immdlen; + __be32 flowid_len16; + __be32 plen; + __be32 lsodisable_to_flags; + __be32 ddraddr; + __be32 ctxloc_to_exp; + __be16 mfs; + __u8 r6[6]; +}; + +#define S_FW_TLSTX_DATA_WR_COMPL 21 +#define M_FW_TLSTX_DATA_WR_COMPL 0x1 +#define V_FW_TLSTX_DATA_WR_COMPL(x) ((x) << S_FW_TLSTX_DATA_WR_COMPL) +#define G_FW_TLSTX_DATA_WR_COMPL(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_COMPL) & M_FW_TLSTX_DATA_WR_COMPL) +#define F_FW_TLSTX_DATA_WR_COMPL V_FW_TLSTX_DATA_WR_COMPL(1U) + +#define S_FW_TLSTX_DATA_WR_IMMDLEN 0 +#define M_FW_TLSTX_DATA_WR_IMMDLEN 0xff +#define V_FW_TLSTX_DATA_WR_IMMDLEN(x) ((x) << S_FW_TLSTX_DATA_WR_IMMDLEN) +#define G_FW_TLSTX_DATA_WR_IMMDLEN(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_IMMDLEN) & M_FW_TLSTX_DATA_WR_IMMDLEN) + +#define S_FW_TLSTX_DATA_WR_FLOWID 8 +#define M_FW_TLSTX_DATA_WR_FLOWID 0xfffff +#define V_FW_TLSTX_DATA_WR_FLOWID(x) ((x) << S_FW_TLSTX_DATA_WR_FLOWID) +#define G_FW_TLSTX_DATA_WR_FLOWID(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_FLOWID) & M_FW_TLSTX_DATA_WR_FLOWID) + +#define S_FW_TLSTX_DATA_WR_LEN16 0 +#define M_FW_TLSTX_DATA_WR_LEN16 0xff +#define V_FW_TLSTX_DATA_WR_LEN16(x) ((x) << S_FW_TLSTX_DATA_WR_LEN16) +#define G_FW_TLSTX_DATA_WR_LEN16(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_LEN16) & M_FW_TLSTX_DATA_WR_LEN16) + +#define S_FW_TLSTX_DATA_WR_LSODISABLE 31 +#define M_FW_TLSTX_DATA_WR_LSODISABLE 0x1 +#define V_FW_TLSTX_DATA_WR_LSODISABLE(x) \ + ((x) << S_FW_TLSTX_DATA_WR_LSODISABLE) +#define G_FW_TLSTX_DATA_WR_LSODISABLE(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_LSODISABLE) & M_FW_TLSTX_DATA_WR_LSODISABLE) +#define F_FW_TLSTX_DATA_WR_LSODISABLE V_FW_TLSTX_DATA_WR_LSODISABLE(1U) + +#define S_FW_TLSTX_DATA_WR_ALIGNPLD 30 +#define M_FW_TLSTX_DATA_WR_ALIGNPLD 0x1 +#define V_FW_TLSTX_DATA_WR_ALIGNPLD(x) ((x) << S_FW_TLSTX_DATA_WR_ALIGNPLD) +#define G_FW_TLSTX_DATA_WR_ALIGNPLD(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_ALIGNPLD) & M_FW_TLSTX_DATA_WR_ALIGNPLD) +#define F_FW_TLSTX_DATA_WR_ALIGNPLD V_FW_TLSTX_DATA_WR_ALIGNPLD(1U) + +#define S_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE 29 +#define M_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE 0x1 +#define V_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE(x) \ + ((x) << S_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE) +#define G_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE) & \ + M_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE) +#define F_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE V_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE(1U) + +#define S_FW_TLSTX_DATA_WR_FLAGS 0 +#define M_FW_TLSTX_DATA_WR_FLAGS 0xfffffff +#define V_FW_TLSTX_DATA_WR_FLAGS(x) ((x) << S_FW_TLSTX_DATA_WR_FLAGS) +#define G_FW_TLSTX_DATA_WR_FLAGS(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_FLAGS) & M_FW_TLSTX_DATA_WR_FLAGS) + +#define S_FW_TLSTX_DATA_WR_CTXLOC 30 +#define M_FW_TLSTX_DATA_WR_CTXLOC 0x3 +#define V_FW_TLSTX_DATA_WR_CTXLOC(x) ((x) << S_FW_TLSTX_DATA_WR_CTXLOC) +#define G_FW_TLSTX_DATA_WR_CTXLOC(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_CTXLOC) & M_FW_TLSTX_DATA_WR_CTXLOC) + +#define S_FW_TLSTX_DATA_WR_IVDSGL 29 +#define M_FW_TLSTX_DATA_WR_IVDSGL 0x1 +#define V_FW_TLSTX_DATA_WR_IVDSGL(x) ((x) << S_FW_TLSTX_DATA_WR_IVDSGL) +#define G_FW_TLSTX_DATA_WR_IVDSGL(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_IVDSGL) & M_FW_TLSTX_DATA_WR_IVDSGL) +#define F_FW_TLSTX_DATA_WR_IVDSGL V_FW_TLSTX_DATA_WR_IVDSGL(1U) + +#define S_FW_TLSTX_DATA_WR_KEYSIZE 24 +#define M_FW_TLSTX_DATA_WR_KEYSIZE 0x1f +#define V_FW_TLSTX_DATA_WR_KEYSIZE(x) ((x) << S_FW_TLSTX_DATA_WR_KEYSIZE) +#define G_FW_TLSTX_DATA_WR_KEYSIZE(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_KEYSIZE) & M_FW_TLSTX_DATA_WR_KEYSIZE) + +#define S_FW_TLSTX_DATA_WR_NUMIVS 14 +#define M_FW_TLSTX_DATA_WR_NUMIVS 0xff +#define V_FW_TLSTX_DATA_WR_NUMIVS(x) ((x) << S_FW_TLSTX_DATA_WR_NUMIVS) +#define G_FW_TLSTX_DATA_WR_NUMIVS(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_NUMIVS) & M_FW_TLSTX_DATA_WR_NUMIVS) + +#define S_FW_TLSTX_DATA_WR_EXP 0 +#define M_FW_TLSTX_DATA_WR_EXP 0x3fff +#define V_FW_TLSTX_DATA_WR_EXP(x) ((x) << S_FW_TLSTX_DATA_WR_EXP) +#define G_FW_TLSTX_DATA_WR_EXP(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_EXP) & M_FW_TLSTX_DATA_WR_EXP) + +struct fw_tls_keyctx_tx_wr { + __be32 op_to_compl; + __be32 flowid_len16; + union fw_key_ctx { + struct fw_tx_keyctx_hdr { + __u8 ctxlen; + __u8 r2; + __be16 dualck_to_txvalid; + __u8 txsalt[4]; + __be64 r5; + } txhdr; + struct fw_rx_keyctx_hdr { + __u8 flitcnt_hmacctrl; + __u8 protover_ciphmode; + __u8 authmode_to_rxvalid; + __u8 ivpresent_to_rxmk_size; + __u8 rxsalt[4]; + __be64 ivinsert_to_authinsrt; + } rxhdr; + struct fw_keyctx_clear { + __be32 tx_key; + __be32 rx_key; + } kctx_clr; + } u; + struct keys { + __u8 edkey[32]; + __u8 ipad[64]; + __u8 opad[64]; + } keys; + __u8 reneg_to_write_rx; + __u8 protocol; + __u8 r7[2]; + __be32 ftid; +}; + +#define S_FW_TLS_KEYCTX_TX_WR_OPCODE 24 +#define M_FW_TLS_KEYCTX_TX_WR_OPCODE 0xff +#define V_FW_TLS_KEYCTX_TX_WR_OPCODE(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_OPCODE) +#define G_FW_TLS_KEYCTX_TX_WR_OPCODE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_OPCODE) & M_FW_TLS_KEYCTX_TX_WR_OPCODE) + +#define S_FW_TLS_KEYCTX_TX_WR_ATOMIC 23 +#define M_FW_TLS_KEYCTX_TX_WR_ATOMIC 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_ATOMIC(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_ATOMIC) +#define G_FW_TLS_KEYCTX_TX_WR_ATOMIC(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_ATOMIC) & M_FW_TLS_KEYCTX_TX_WR_ATOMIC) +#define F_FW_TLS_KEYCTX_TX_WR_ATOMIC V_FW_TLS_KEYCTX_TX_WR_ATOMIC(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_FLUSH 22 +#define M_FW_TLS_KEYCTX_TX_WR_FLUSH 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_FLUSH(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_FLUSH) +#define G_FW_TLS_KEYCTX_TX_WR_FLUSH(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_FLUSH) & M_FW_TLS_KEYCTX_TX_WR_FLUSH) +#define F_FW_TLS_KEYCTX_TX_WR_FLUSH V_FW_TLS_KEYCTX_TX_WR_FLUSH(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_COMPL 21 +#define M_FW_TLS_KEYCTX_TX_WR_COMPL 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_COMPL(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_COMPL) +#define G_FW_TLS_KEYCTX_TX_WR_COMPL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_COMPL) & M_FW_TLS_KEYCTX_TX_WR_COMPL) +#define F_FW_TLS_KEYCTX_TX_WR_COMPL V_FW_TLS_KEYCTX_TX_WR_COMPL(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_FLOWID 8 +#define M_FW_TLS_KEYCTX_TX_WR_FLOWID 0xfffff +#define V_FW_TLS_KEYCTX_TX_WR_FLOWID(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_FLOWID) +#define G_FW_TLS_KEYCTX_TX_WR_FLOWID(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_FLOWID) & M_FW_TLS_KEYCTX_TX_WR_FLOWID) + +#define S_FW_TLS_KEYCTX_TX_WR_LEN16 0 +#define M_FW_TLS_KEYCTX_TX_WR_LEN16 0xff +#define V_FW_TLS_KEYCTX_TX_WR_LEN16(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_LEN16) +#define G_FW_TLS_KEYCTX_TX_WR_LEN16(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_LEN16) & M_FW_TLS_KEYCTX_TX_WR_LEN16) + +#define S_FW_TLS_KEYCTX_TX_WR_DUALCK 12 +#define M_FW_TLS_KEYCTX_TX_WR_DUALCK 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_DUALCK(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_DUALCK) +#define G_FW_TLS_KEYCTX_TX_WR_DUALCK(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_DUALCK) & M_FW_TLS_KEYCTX_TX_WR_DUALCK) +#define F_FW_TLS_KEYCTX_TX_WR_DUALCK V_FW_TLS_KEYCTX_TX_WR_DUALCK(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT 11 +#define M_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT \ + V_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT 10 +#define M_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT \ + V_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE 6 +#define M_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE 2 +#define M_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_TXVALID 0 +#define M_FW_TLS_KEYCTX_TX_WR_TXVALID 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_TXVALID(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXVALID) +#define G_FW_TLS_KEYCTX_TX_WR_TXVALID(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXVALID) & M_FW_TLS_KEYCTX_TX_WR_TXVALID) +#define F_FW_TLS_KEYCTX_TX_WR_TXVALID V_FW_TLS_KEYCTX_TX_WR_TXVALID(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_FLITCNT 3 +#define M_FW_TLS_KEYCTX_TX_WR_FLITCNT 0x1f +#define V_FW_TLS_KEYCTX_TX_WR_FLITCNT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_FLITCNT) +#define G_FW_TLS_KEYCTX_TX_WR_FLITCNT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_FLITCNT) & M_FW_TLS_KEYCTX_TX_WR_FLITCNT) + +#define S_FW_TLS_KEYCTX_TX_WR_HMACCTRL 0 +#define M_FW_TLS_KEYCTX_TX_WR_HMACCTRL 0x7 +#define V_FW_TLS_KEYCTX_TX_WR_HMACCTRL(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_HMACCTRL) +#define G_FW_TLS_KEYCTX_TX_WR_HMACCTRL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_HMACCTRL) & M_FW_TLS_KEYCTX_TX_WR_HMACCTRL) + +#define S_FW_TLS_KEYCTX_TX_WR_PROTOVER 4 +#define M_FW_TLS_KEYCTX_TX_WR_PROTOVER 0xf +#define V_FW_TLS_KEYCTX_TX_WR_PROTOVER(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_PROTOVER) +#define G_FW_TLS_KEYCTX_TX_WR_PROTOVER(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_PROTOVER) & M_FW_TLS_KEYCTX_TX_WR_PROTOVER) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHMODE 0 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHMODE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_CIPHMODE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHMODE) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHMODE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHMODE) & M_FW_TLS_KEYCTX_TX_WR_CIPHMODE) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHMODE 4 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHMODE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_AUTHMODE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHMODE) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHMODE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHMODE) & M_FW_TLS_KEYCTX_TX_WR_AUTHMODE) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL 3 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL) & \ + M_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL) +#define F_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL \ + V_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL 1 +#define M_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL 0x3 +#define V_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL) +#define G_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL) & \ + M_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL) + +#define S_FW_TLS_KEYCTX_TX_WR_RXVALID 0 +#define M_FW_TLS_KEYCTX_TX_WR_RXVALID 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_RXVALID(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXVALID) +#define G_FW_TLS_KEYCTX_TX_WR_RXVALID(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXVALID) & M_FW_TLS_KEYCTX_TX_WR_RXVALID) +#define F_FW_TLS_KEYCTX_TX_WR_RXVALID V_FW_TLS_KEYCTX_TX_WR_RXVALID(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_IVPRESENT 7 +#define M_FW_TLS_KEYCTX_TX_WR_IVPRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_IVPRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_IVPRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_IVPRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_IVPRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_IVPRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_IVPRESENT V_FW_TLS_KEYCTX_TX_WR_IVPRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT 6 +#define M_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT \ + V_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE 3 +#define M_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE 0x7 +#define V_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE 0 +#define M_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE 0x7 +#define V_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_IVINSERT 55 +#define M_FW_TLS_KEYCTX_TX_WR_IVINSERT 0x1ffULL +#define V_FW_TLS_KEYCTX_TX_WR_IVINSERT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_IVINSERT) +#define G_FW_TLS_KEYCTX_TX_WR_IVINSERT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_IVINSERT) & M_FW_TLS_KEYCTX_TX_WR_IVINSERT) + +#define S_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST 47 +#define M_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST 0xffULL +#define V_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST 39 +#define M_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST 0xffULL +#define V_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST 30 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST 0x1ffULL +#define V_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST 23 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST 0x7f +#define V_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST 14 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST 0x1ff +#define V_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST 7 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST 0x7f +#define V_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHINSRT 0 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHINSRT 0x7f +#define V_FW_TLS_KEYCTX_TX_WR_AUTHINSRT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHINSRT) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHINSRT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHINSRT) & \ + M_FW_TLS_KEYCTX_TX_WR_AUTHINSRT) + +#define S_FW_TLS_KEYCTX_TX_WR_RENEG 4 +#define M_FW_TLS_KEYCTX_TX_WR_RENEG 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_RENEG(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_RENEG) +#define G_FW_TLS_KEYCTX_TX_WR_RENEG(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RENEG) & M_FW_TLS_KEYCTX_TX_WR_RENEG) +#define F_FW_TLS_KEYCTX_TX_WR_RENEG V_FW_TLS_KEYCTX_TX_WR_RENEG(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_DELETE_TX 3 +#define M_FW_TLS_KEYCTX_TX_WR_DELETE_TX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_DELETE_TX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_DELETE_TX) +#define G_FW_TLS_KEYCTX_TX_WR_DELETE_TX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_DELETE_TX) & \ + M_FW_TLS_KEYCTX_TX_WR_DELETE_TX) +#define F_FW_TLS_KEYCTX_TX_WR_DELETE_TX V_FW_TLS_KEYCTX_TX_WR_DELETE_TX(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_DELETE_RX 2 +#define M_FW_TLS_KEYCTX_TX_WR_DELETE_RX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_DELETE_RX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_DELETE_RX) +#define G_FW_TLS_KEYCTX_TX_WR_DELETE_RX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_DELETE_RX) & \ + M_FW_TLS_KEYCTX_TX_WR_DELETE_RX) +#define F_FW_TLS_KEYCTX_TX_WR_DELETE_RX V_FW_TLS_KEYCTX_TX_WR_DELETE_RX(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_WRITE_TX 1 +#define M_FW_TLS_KEYCTX_TX_WR_WRITE_TX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_WRITE_TX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_WRITE_TX) +#define G_FW_TLS_KEYCTX_TX_WR_WRITE_TX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_WRITE_TX) & M_FW_TLS_KEYCTX_TX_WR_WRITE_TX) +#define F_FW_TLS_KEYCTX_TX_WR_WRITE_TX V_FW_TLS_KEYCTX_TX_WR_WRITE_TX(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_WRITE_RX 0 +#define M_FW_TLS_KEYCTX_TX_WR_WRITE_RX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_WRITE_RX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_WRITE_RX) +#define G_FW_TLS_KEYCTX_TX_WR_WRITE_RX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_WRITE_RX) & M_FW_TLS_KEYCTX_TX_WR_WRITE_RX) +#define F_FW_TLS_KEYCTX_TX_WR_WRITE_RX V_FW_TLS_KEYCTX_TX_WR_WRITE_RX(1U) -struct fw_sec_lookaside_lpbk_wr { +struct fw_crypto_lookaside_wr { __be32 op_to_cctx_size; __be32 len16_pkd; __be32 session_id; @@ -3395,116 +3818,116 @@ struct fw_sec_lookaside_lpbk_wr { __be64 cookie; }; -#define S_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE 24 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_COMPL 23 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_COMPL 0x1 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_COMPL(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_COMPL) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_COMPL(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_COMPL) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_COMPL) -#define F_FW_SEC_LOOKASIDE_LPBK_WR_COMPL V_FW_SEC_LOOKASIDE_LPBK_WR_COMPL(1U) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN 15 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC 5 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE 0 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE 0x1f -#define V_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_LEN16 0 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_LEN16 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_LEN16(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_LEN16) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_LEN16(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_LEN16) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_LEN16) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID 29 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_LCB 27 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_LCB 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_LCB(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_LCB) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_LCB(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_LCB) & M_FW_SEC_LOOKASIDE_LPBK_WR_LCB) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_PHASH 25 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_PHASH 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_PHASH(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_PHASH) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_PHASH(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_PHASH) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_PHASH) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_IV 23 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_IV 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_IV(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_IV) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_IV(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_IV) & M_FW_SEC_LOOKASIDE_LPBK_WR_IV) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH 10 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID 0 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID 0x3ff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE 24 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE 17 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE 0x7f -#define V_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE) +#define S_FW_CRYPTO_LOOKASIDE_WR_OPCODE 24 +#define M_FW_CRYPTO_LOOKASIDE_WR_OPCODE 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_OPCODE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_OPCODE) +#define G_FW_CRYPTO_LOOKASIDE_WR_OPCODE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_OPCODE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_OPCODE) + +#define S_FW_CRYPTO_LOOKASIDE_WR_COMPL 23 +#define M_FW_CRYPTO_LOOKASIDE_WR_COMPL 0x1 +#define V_FW_CRYPTO_LOOKASIDE_WR_COMPL(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_COMPL) +#define G_FW_CRYPTO_LOOKASIDE_WR_COMPL(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_COMPL) & \ + M_FW_CRYPTO_LOOKASIDE_WR_COMPL) +#define F_FW_CRYPTO_LOOKASIDE_WR_COMPL V_FW_CRYPTO_LOOKASIDE_WR_COMPL(1U) + +#define S_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN 15 +#define M_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN) +#define G_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN) & \ + M_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN) + +#define S_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC 5 +#define M_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC) +#define G_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC) & \ + M_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC) + +#define S_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE 0 +#define M_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE 0x1f +#define V_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE) +#define G_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE) + +#define S_FW_CRYPTO_LOOKASIDE_WR_LEN16 0 +#define M_FW_CRYPTO_LOOKASIDE_WR_LEN16 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_LEN16(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_LEN16) +#define G_FW_CRYPTO_LOOKASIDE_WR_LEN16(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_LEN16) & \ + M_FW_CRYPTO_LOOKASIDE_WR_LEN16) + +#define S_FW_CRYPTO_LOOKASIDE_WR_RX_CHID 29 +#define M_FW_CRYPTO_LOOKASIDE_WR_RX_CHID 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_RX_CHID) +#define G_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_RX_CHID) & \ + M_FW_CRYPTO_LOOKASIDE_WR_RX_CHID) + +#define S_FW_CRYPTO_LOOKASIDE_WR_LCB 27 +#define M_FW_CRYPTO_LOOKASIDE_WR_LCB 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_LCB(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_LCB) +#define G_FW_CRYPTO_LOOKASIDE_WR_LCB(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_LCB) & M_FW_CRYPTO_LOOKASIDE_WR_LCB) + +#define S_FW_CRYPTO_LOOKASIDE_WR_PHASH 25 +#define M_FW_CRYPTO_LOOKASIDE_WR_PHASH 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_PHASH(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_PHASH) +#define G_FW_CRYPTO_LOOKASIDE_WR_PHASH(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_PHASH) & \ + M_FW_CRYPTO_LOOKASIDE_WR_PHASH) + +#define S_FW_CRYPTO_LOOKASIDE_WR_IV 23 +#define M_FW_CRYPTO_LOOKASIDE_WR_IV 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_IV(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_IV) +#define G_FW_CRYPTO_LOOKASIDE_WR_IV(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_IV) & M_FW_CRYPTO_LOOKASIDE_WR_IV) + +#define S_FW_CRYPTO_LOOKASIDE_WR_TX_CH 10 +#define M_FW_CRYPTO_LOOKASIDE_WR_TX_CH 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_TX_CH) +#define G_FW_CRYPTO_LOOKASIDE_WR_TX_CH(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_TX_CH) & \ + M_FW_CRYPTO_LOOKASIDE_WR_TX_CH) + +#define S_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID 0 +#define M_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID 0x3ff +#define V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID) +#define G_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID) & \ + M_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID) + +#define S_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE 24 +#define M_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE) +#define G_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE) + +#define S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE 17 +#define M_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE 0x7f +#define V_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) +#define G_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) /****************************************************************************** * C O M M A N D s @@ -4095,8 +4518,9 @@ enum fw_caps_config_iscsi { FW_CAPS_CONFIG_ISCSI_TARGET_CMDOFLD = 0x00000100, }; -enum fw_caps_config_tls { - FW_CAPS_CONFIG_TLSKEYS = 0x00000001, +enum fw_caps_config_crypto { + FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x00000001, + FW_CAPS_CONFIG_TLSKEYS = 0x00000002, }; enum fw_caps_config_fcoe { @@ -4128,7 +4552,7 @@ struct fw_caps_config_cmd { __be16 niccaps; __be16 toecaps; __be16 rdmacaps; - __be16 tlscaps; + __be16 cryptocaps; __be16 iscsicaps; __be16 fcoecaps; __be32 cfcsum; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Sep 12 00:03:14 2016 (r305714) +++ head/sys/dev/cxgbe/t4_main.c Mon Sep 12 00:15:40 2016 (r305715) @@ -355,8 +355,8 @@ TUNABLE_INT("hw.cxgbe.toecaps_allowed", static int t4_rdmacaps_allowed = -1; TUNABLE_INT("hw.cxgbe.rdmacaps_allowed", &t4_rdmacaps_allowed); -static int t4_tlscaps_allowed = 0; -TUNABLE_INT("hw.cxgbe.tlscaps_allowed", &t4_tlscaps_allowed); +static int t4_cryptocaps_allowed = 0; +TUNABLE_INT("hw.cxgbe.cryptocaps_allowed", &t4_cryptocaps_allowed); static int t4_iscsicaps_allowed = -1; TUNABLE_INT("hw.cxgbe.iscsicaps_allowed", &t4_iscsicaps_allowed); @@ -3114,7 +3114,7 @@ use_config_on_flash: LIMIT_CAPS(niccaps); LIMIT_CAPS(toecaps); LIMIT_CAPS(rdmacaps); - LIMIT_CAPS(tlscaps); + LIMIT_CAPS(cryptocaps); LIMIT_CAPS(iscsicaps); LIMIT_CAPS(fcoecaps); #undef LIMIT_CAPS @@ -3251,7 +3251,7 @@ get_params__post_init(struct adapter *sc READ_CAPS(niccaps); READ_CAPS(toecaps); READ_CAPS(rdmacaps); - READ_CAPS(tlscaps); + READ_CAPS(cryptocaps); READ_CAPS(iscsicaps); READ_CAPS(fcoecaps); @@ -4684,7 +4684,7 @@ static char *caps_decoder[] = { "\005INITIATOR_SSNOFLD\006TARGET_SSNOFLD" "\007T10DIF" "\010INITIATOR_CMDOFLD\011TARGET_CMDOFLD", - "\20\00KEYS", /* 7: TLS */ + "\20\001LOOKASIDE\002TLSKEYS", /* 7: Crypto */ "\20\001INITIATOR\002TARGET\003CTRL_OFLD" /* 8: FCoE */ "\004PO_INITIATOR\005PO_TARGET", }; @@ -4792,7 +4792,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_CAP(toecaps, 4, "TCP offload"); SYSCTL_CAP(rdmacaps, 5, "RDMA"); SYSCTL_CAP(iscsicaps, 6, "iSCSI"); - SYSCTL_CAP(tlscaps, 7, "TLS"); + SYSCTL_CAP(cryptocaps, 7, "crypto"); SYSCTL_CAP(fcoecaps, 8, "FCoE"); #undef SYSCTL_CAP From owner-svn-src-all@freebsd.org Mon Sep 12 00:16:27 2016 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 7BABABD4346; Mon, 12 Sep 2016 00:16:27 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48B789D9; Mon, 12 Sep 2016 00:16:27 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C0GQ9C046314; Mon, 12 Sep 2016 00:16:26 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C0GQUd046313; Mon, 12 Sep 2016 00:16:26 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201609120016.u8C0GQUd046313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 12 Sep 2016 00:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305716 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 00:16:27 -0000 Author: grehan Date: Mon Sep 12 00:16:26 2016 New Revision: 305716 URL: https://svnweb.freebsd.org/changeset/base/305716 Log: MFC r302972,r303349 r302972 Disallow interrupt requests on disabled endpoints. r303349 Catch another case where an XHCI interrupt was being injected without state being set up. Modified: stable/11/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_xhci.c Mon Sep 12 00:15:40 2016 (r305715) +++ stable/11/usr.sbin/bhyve/pci_xhci.c Mon Sep 12 00:16:26 2016 (r305716) @@ -2537,9 +2537,11 @@ static int pci_xhci_dev_intr(struct usb_hci *hci, int epctx) { struct pci_xhci_dev_emu *dev; + struct xhci_dev_ctx *dev_ctx; struct xhci_trb evtrb; struct pci_xhci_softc *sc; struct pci_xhci_portregs *p; + struct xhci_endp_ctx *ep_ctx; int error; int dir_in; int epid; @@ -2557,7 +2559,8 @@ pci_xhci_dev_intr(struct usb_hci *hci, i /* check if device is ready; OS has to initialise it */ if (sc->rtsregs.erstba_p == NULL || - (sc->opregs.usbcmd & XHCI_CMD_RS) == 0) + (sc->opregs.usbcmd & XHCI_CMD_RS) == 0 || + dev->dev_ctx == NULL) return (0); p = XHCI_PORTREG_PTR(sc, hci->hci_port); @@ -2578,6 +2581,14 @@ pci_xhci_dev_intr(struct usb_hci *hci, i goto done; } + dev_ctx = dev->dev_ctx; + ep_ctx = &dev_ctx->ctx_ep[epid]; + if ((ep_ctx->dwEpCtx0 & 0x7) == XHCI_ST_EPCTX_DISABLED) { + DPRINTF(("xhci device interrupt on disabled endpoint %d\r\n", + epid)); + return (0); + } + DPRINTF(("xhci device interrupt on endpoint %d\r\n", epid)); pci_xhci_device_doorbell(sc, hci->hci_port, epid, 0); From owner-svn-src-all@freebsd.org Mon Sep 12 00:21:56 2016 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 3EBEFBD44F8; Mon, 12 Sep 2016 00:21:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15588C51; Mon, 12 Sep 2016 00:21:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C0LtUa047148; Mon, 12 Sep 2016 00:21:55 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C0LtmL047147; Mon, 12 Sep 2016 00:21:55 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201609120021.u8C0LtmL047147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 12 Sep 2016 00:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305717 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 00:21:56 -0000 Author: grehan Date: Mon Sep 12 00:21:55 2016 New Revision: 305717 URL: https://svnweb.freebsd.org/changeset/base/305717 Log: MFC r303352 - Change the fbuf "vga" parameter to "vga=on|io|off". "io" is the default, and allows VGA i/o registers to be accessed. This is required by Win7/2k8 graphics guests that use a combination of BIOS int10 and UEFI. "off" disables all VGA i/o and mem accesses. "on" is not yet hooked up, but will enable full VGA rendering. OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off" - Allow "rfb" to be used instead of "tcp" for the fbuf VNC description. "tcp" will be removed at a future point and is kept as an alias. Modified: stable/11/usr.sbin/bhyve/pci_fbuf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_fbuf.c Mon Sep 12 00:16:26 2016 (r305716) +++ stable/11/usr.sbin/bhyve/pci_fbuf.c Mon Sep 12 00:21:55 2016 (r305717) @@ -95,7 +95,8 @@ struct pci_fbuf_softc { char *rfb_host; int rfb_port; int rfb_wait; - int use_vga; + int vga_enabled; + int vga_full; uint32_t fbaddr; char *fb_base; @@ -114,7 +115,7 @@ pci_fbuf_usage(char *opt) { fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt); - fprintf(stderr, "fbuf: {wait,}tcp=:port\r\n"); + fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n"); } static void @@ -234,13 +235,6 @@ pci_fbuf_parse_opts(struct pci_fbuf_soft continue; } -#if 0 /* notyet */ - if (strcmp(xopts, "vga") == 0) { - sc->use_vga = 1; - continue; - } -#endif - if ((config = strchr(xopts, '=')) == NULL) { pci_fbuf_usage(xopts); ret = -1; @@ -252,17 +246,31 @@ pci_fbuf_parse_opts(struct pci_fbuf_soft DPRINTF(DEBUG_VERBOSE, ("pci_fbuf option %s = %s\r\n", xopts, config)); - if (!strcmp(xopts, "tcp")) { + if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) { /* parse host-ip:port */ - tmpstr = strsep(&config, ":"); + tmpstr = strsep(&config, ":"); if (!config) sc->rfb_port = atoi(tmpstr); else { sc->rfb_port = atoi(config); sc->rfb_host = tmpstr; } - } else if (!strcmp(xopts, "w")) { - sc->memregs.width = atoi(config); + } else if (!strcmp(xopts, "vga")) { + if (!strcmp(config, "off")) { + sc->vga_enabled = 0; + } else if (!strcmp(config, "io")) { + sc->vga_enabled = 1; + sc->vga_full = 0; + } else if (!strcmp(config, "on")) { + sc->vga_enabled = 1; + sc->vga_full = 1; + } else { + pci_fbuf_usage(opts); + ret = -1; + goto done; + } + } else if (!strcmp(xopts, "w")) { + sc->memregs.width = atoi(config); if (sc->memregs.width > COLS_MAX) { pci_fbuf_usage(xopts); ret = -1; @@ -299,7 +307,7 @@ pci_fbuf_render(struct bhyvegc *gc, void sc = arg; - if (sc->use_vga && sc->gc_image->vgamode) { + if (sc->vga_full && sc->gc_image->vgamode) { /* TODO: mode switching to vga and vesa should use the special * EFI-bhyve protocol port. */ @@ -352,12 +360,21 @@ pci_fbuf_init(struct vmctx *ctx, struct sc->memregs.height = ROWS_DEFAULT; sc->memregs.depth = 32; + sc->vga_enabled = 1; + sc->vga_full = 0; + sc->fsc_pi = pi; error = pci_fbuf_parse_opts(sc, opts); if (error != 0) goto done; + /* XXX until VGA rendering is enabled */ + if (sc->vga_full != 0) { + fprintf(stderr, "pci_fbuf: VGA rendering not enabled"); + goto done; + } + sc->fb_base = vm_create_devmem(ctx, VM_FRAMEBUFFER, "framebuffer", FB_SIZE); if (sc->fb_base == MAP_FAILED) { error = -1; @@ -382,7 +399,8 @@ pci_fbuf_init(struct vmctx *ctx, struct console_init(sc->memregs.width, sc->memregs.height, sc->fb_base); console_fb_register(pci_fbuf_render, sc); - sc->vgasc = vga_init(!sc->use_vga); + if (sc->vga_enabled) + sc->vgasc = vga_init(!sc->vga_full); sc->gc_image = console_get_image(); fbuf_sc = sc; From owner-svn-src-all@freebsd.org Mon Sep 12 00:24:58 2016 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 0DE2DBD45BC; Mon, 12 Sep 2016 00:24:58 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF198F0C; Mon, 12 Sep 2016 00:24:57 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C0Ou6c049995; Mon, 12 Sep 2016 00:24:56 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C0Ou9p049994; Mon, 12 Sep 2016 00:24:56 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201609120024.u8C0Ou9p049994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 12 Sep 2016 00:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305718 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 00:24:58 -0000 Author: grehan Date: Mon Sep 12 00:24:56 2016 New Revision: 305718 URL: https://svnweb.freebsd.org/changeset/base/305718 Log: MFC r305061 Invert calloc(3) argument order Modified: stable/11/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_e82545.c Mon Sep 12 00:21:55 2016 (r305717) +++ stable/11/usr.sbin/bhyve/pci_e82545.c Mon Sep 12 00:24:56 2016 (r305718) @@ -2273,7 +2273,7 @@ e82545_init(struct vmctx *ctx, struct pc int mac_provided; /* Setup our softc */ - sc = calloc(sizeof(*sc), 1); + sc = calloc(1, sizeof(*sc)); pi->pi_arg = sc; sc->esc_pi = pi; From owner-svn-src-all@freebsd.org Mon Sep 12 01:01:09 2016 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 AC32EBD4BB2; Mon, 12 Sep 2016 01:01:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yb0-x235.google.com (mail-yb0-x235.google.com [IPv6:2607:f8b0:4002:c09::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 7288CE1A; Mon, 12 Sep 2016 01:01:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yb0-x235.google.com with SMTP id n11so721601yba.0; Sun, 11 Sep 2016 18:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ffonl+GejQu7rrhimDZqvBLvwZIpRsMLOs/cEPXG/PQ=; b=c+5B8TuB8MOnAFRr5DrItjeSMjZn7SiucLKFPhXLH/lfPh31gjm4JCGbXC306NH83s HZwXIV8pGPzRoquZJirwu0U16JYlXw9caJAhCQEfUwpWtWhFueF+fJt7J8tpA0Rh8dbA wod7b/AJebpx2nmhRj6FoPP7FCwZyNfHaoPU8PVlnWmrlxIhBBI6hBSq0VwBpU1Ay3uC vIQvHkhAR4x6pLvhWcghKrIFRzvgIch31xSklnrtaYVutDTqXz5G9Zm7tY3oUIq7a/jV cVEX+31RIZ/LvF5H2jH2B00jpXHMMjBoaOGj6YLNVuBoGs1bEJzoYLS5F23AffGj66Dk BvkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ffonl+GejQu7rrhimDZqvBLvwZIpRsMLOs/cEPXG/PQ=; b=mg27+RYVpq8kMPc4smwQ4SMKNGVL7urtbr3tBPbAG8iU9e5yAQ4k+9pbzFHxmytKWw 9lhSv+Rt4DgTaLAJpXb1mou44PXJE33Pa51abBmRYEX5VaTRFH38phyuZbPBJ6cYHtkY NsvpSZmclPldMLW9wMt/gN+IRmi+IhoeyRl2MdPyCwjGgV3vinWBejjZI4iZKp09uUmo YR8MwsG2Tkek2IdMEwXw7LhcfmIoQjuyT5RdYIwYknjWATvjri8MiNs8d6xgpD/3vttU MYbvXNIOQX8HySDdwMcq2Blb73QR7JtAfrax8PGbtiMbf2JnTxDKrj8KiTBqaPqPuR4D dBTg== X-Gm-Message-State: AE9vXwMkccp10ZjHFXVkd88NbGOrc+BiP/gPnfLD5jdgQTp8PcyljOThY3XZDTP37e1vkMH3eakj9KunzLr8Kg== X-Received: by 10.37.57.86 with SMTP id g83mr1715139yba.64.1473642068498; Sun, 11 Sep 2016 18:01:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.56.130 with HTTP; Sun, 11 Sep 2016 18:01:07 -0700 (PDT) Received: by 10.129.56.130 with HTTP; Sun, 11 Sep 2016 18:01:07 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <201609120024.u8C0Ou9p049994@repo.freebsd.org> References: <201609120024.u8C0Ou9p049994@repo.freebsd.org> From: Marcelo Araujo Date: Mon, 12 Sep 2016 09:01:07 +0800 Message-ID: Subject: Re: svn commit: r305718 - stable/11/usr.sbin/bhyve To: Peter Grehan Cc: svn-src-stable-11@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 01:01:09 -0000 Thank you for that. On Sep 12, 2016 8:25 AM, "Peter Grehan" wrote: > Author: grehan > Date: Mon Sep 12 00:24:56 2016 > New Revision: 305718 > URL: https://svnweb.freebsd.org/changeset/base/305718 > > Log: > MFC r305061 > Invert calloc(3) argument order > > Modified: > stable/11/usr.sbin/bhyve/pci_e82545.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/usr.sbin/bhyve/pci_e82545.c > ============================================================ > ================== > --- stable/11/usr.sbin/bhyve/pci_e82545.c Mon Sep 12 00:21:55 2016 > (r305717) > +++ stable/11/usr.sbin/bhyve/pci_e82545.c Mon Sep 12 00:24:56 2016 > (r305718) > @@ -2273,7 +2273,7 @@ e82545_init(struct vmctx *ctx, struct pc > int mac_provided; > > /* Setup our softc */ > - sc = calloc(sizeof(*sc), 1); > + sc = calloc(1, sizeof(*sc)); > > pi->pi_arg = sc; > sc->esc_pi = pi; > > From owner-svn-src-all@freebsd.org Mon Sep 12 01:18:27 2016 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 1327DBD4FFC; Mon, 12 Sep 2016 01:18:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA407750; Mon, 12 Sep 2016 01:18:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C1IQbW068894; Mon, 12 Sep 2016 01:18:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C1IQJD068893; Mon, 12 Sep 2016 01:18:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609120118.u8C1IQJD068893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 12 Sep 2016 01:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305719 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 01:18:27 -0000 Author: gonzo Date: Mon Sep 12 01:18:25 2016 New Revision: 305719 URL: https://svnweb.freebsd.org/changeset/base/305719 Log: Cleanup evdev support for TI ADC/TS - evdev_set_methods call is not required if actual methods are no-ops - evdev_set_serial is also optional if there is no meaningful input device identifier - evdev_set_id on the other hand is mandatory, so set virtual bus with dummy vendor/product/version Suggested by: Vladimir Kondratiev Modified: head/sys/arm/ti/ti_adc.c Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Sep 12 00:24:56 2016 (r305718) +++ head/sys/arm/ti/ti_adc.c Mon Sep 12 01:18:25 2016 (r305719) @@ -90,27 +90,6 @@ static int ti_adc_samples[5] = { 0, 2, 4 static int ti_adc_detach(device_t dev); #ifdef EVDEV -static evdev_open_t ti_adc_ev_open; -static evdev_close_t ti_adc_ev_close; - -static struct evdev_methods ti_adc_evdev_methods = { - .ev_open = &ti_adc_ev_open, - .ev_close = &ti_adc_ev_close, -}; - -static void -ti_adc_ev_close(struct evdev_dev *evdev, void *ev_softc) -{ - /* Nothing to do here */ -} - -static int -ti_adc_ev_open(struct evdev_dev *evdev, void *ev_softc) -{ - /* Nothing to do here */ - return (0); -} - static void ti_adc_ev_report(struct ti_adc_softc *sc) { @@ -900,8 +879,7 @@ ti_adc_attach(device_t dev) sc->sc_evdev = evdev_alloc(); evdev_set_name(sc->sc_evdev, device_get_desc(dev)); evdev_set_phys(sc->sc_evdev, device_get_nameunit(dev)); - evdev_set_serial(sc->sc_evdev, "0"); - evdev_set_methods(sc->sc_evdev, sc, &ti_adc_evdev_methods); + evdev_set_id(sc->sc_evdev, BUS_VIRTUAL, 0, 0, 0); evdev_support_prop(sc->sc_evdev, INPUT_PROP_DIRECT); evdev_support_event(sc->sc_evdev, EV_SYN); evdev_support_event(sc->sc_evdev, EV_ABS); From owner-svn-src-all@freebsd.org Mon Sep 12 01:54:36 2016 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 67278BD770F; Mon, 12 Sep 2016 01:54:36 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 29A447D9; Mon, 12 Sep 2016 01:54:35 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-239-154.lns20.per1.internode.on.net [121.45.239.154]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u8C1sMGG030769 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 11 Sep 2016 18:54:25 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs To: Pedro Giffuni , Cy Schubert References: <201609112304.u8BN4fG0038653@slippy.cwsent.com> <3b13fc77-c96b-0ef3-988c-d99b3156963a@FreeBSD.org> Cc: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org From: Julian Elischer Message-ID: <0bdf76af-c1b1-4ecf-b553-9dd6e137219b@freebsd.org> Date: Mon, 12 Sep 2016 09:54:16 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <3b13fc77-c96b-0ef3-988c-d99b3156963a@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 01:54:36 -0000 On 12/09/2016 7:49 AM, Pedro Giffuni wrote: > > > On 11/09/2016 18:04, Cy Schubert wrote: >> In message <1dd1619f-2369-64d8-879a-cdbb380c2a95@FreeBSD.org>, Pedro >> Giffuni wr >> ites: >>> >>> On 11/09/2016 11:52, Allan Jude wrote: >>>> On 2016-09-11 12:17, Pedro Giffuni wrote: >>>>> On 09/11/16 10:55, Pedro F. Giffuni wrote: >>>>>> Author: pfg >>>>>> Date: Sun Sep 11 15:55:11 2016 >>>>>> New Revision: 305694 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/305694 >>>>>> >>>>>> Log: >>>>>> Update OpenRCS to version 20160831 >>>>>> >>>>>> Obtained from: OpenBSD >>>>>> >>>>> Bah .. this brings some pledge stuff that makes things >>>>> ugly/unportable. >>>>> Will revert. >>>>> >>>>> Pedro. >>>>> >>>> How nasty is the pledge stuff? It is usually fairly easy to convert >>>> pledge to Capsicum, so it might be worth looking at. >>> I didn't look at it too much, TBH. >>> In any case It is not clear that we may want openrcs in the tree, >>> so at >>> least for >>> now there is not need to add more complexity. >>> >>>> I'll take a look at it later in the week. >>>> >>> If you want suggestion for something more interesting, capsicum-ising >>> patch(1) >>> would be useful. I gave it a try once but got stuck with the use of >>> temporary files. >> Why would we want to put OpenBSD's or for that matter any other in >> base? >> Wasn't it decided just before 10.0 was released to remove RCS from >> base? > > > Let me set this straight right away: > > OpenRCS was brought to the vendor tree at a time when: > 1) The removal of GNU rcs proved to be a bad idea. > 2) OpenBSD has problems paying electricity builds and there was some > (low) risk of loosing it. > > There will be a second attempt to get rid of GNU RCS for FreeBSD 12: > you can follow that up in the -current list. > I am personally hoping this attempt will be successful and > definitive. There are NO plans to import OpenRCS into base. > > Pedro. > > when everything is a package, RCS can easily be put in the "optional" pile. just wait until then and avoid the fight. From owner-svn-src-all@freebsd.org Mon Sep 12 04:50:41 2016 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 A32C8BD5CDA; Mon, 12 Sep 2016 04:50:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 486AD949; Mon, 12 Sep 2016 04:50:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4oeLT048933; Mon, 12 Sep 2016 04:50:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4oewv048932; Mon, 12 Sep 2016 04:50:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609120450.u8C4oewv048932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 12 Sep 2016 04:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305720 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 04:50:41 -0000 Author: adrian Date: Mon Sep 12 04:50:40 2016 New Revision: 305720 URL: https://svnweb.freebsd.org/changeset/base/305720 Log: [ath] tweak the TX EDMA debugging a bit. I've used this to debug some amusing issues with the EDMA code. Tested: * AR9380, STA mode * AR9380, TDMA mode (master, slave) Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Sep 12 01:18:25 2016 (r305719) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Sep 12 04:50:40 2016 (r305720) @@ -268,7 +268,7 @@ ath_tx_edma_push_staging_list(struct ath /* Bump FIFO queue */ txq->axq_fifo_depth++; - DPRINTF(sc, ATH_DEBUG_XMIT, + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_TX_PROC, "%s: queued %d packets; depth=%d, fifo depth=%d\n", __func__, sqdepth, txq->fifo.axq_depth, txq->axq_fifo_depth); @@ -296,16 +296,21 @@ ath_edma_tx_fifo_fill(struct ath_softc * ATH_TXQ_LOCK_ASSERT(txq); - DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: Q%d: called\n", + DPRINTF(sc, ATH_DEBUG_TX_PROC, + "%s: Q%d: called; fifo.depth=%d, fifo depth=%d, depth=%d, aggr_depth=%d\n", __func__, - txq->axq_qnum); + txq->axq_qnum, + txq->fifo.axq_depth, + txq->axq_fifo_depth, + txq->axq_depth, + txq->axq_aggr_depth); /* - * For now, push up to 4 frames per TX FIFO slot. + * For now, push up to 32 frames per TX FIFO slot. * If more are in the hardware queue then they'll * get populated when we try to send another frame * or complete a frame - so at most there'll be - * 32 non-AMPDU frames per TXQ. + * 32 non-AMPDU frames per node/TID anyway. * * Note that the hardware staging queue will limit * how many frames in total we will have pushed into @@ -811,10 +816,11 @@ ath_edma_tx_processq(struct ath_softc *s } #if defined(ATH_DEBUG_ALQ) && defined(ATH_DEBUG) - if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS)) + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS)) { if_ath_alq_post(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS, sc->sc_tx_statuslen, (char *) txstatus); + } #endif /* ATH_DEBUG_ALQ */ /* From owner-svn-src-all@freebsd.org Mon Sep 12 04:55:15 2016 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 3316EBD5E87; Mon, 12 Sep 2016 04:55:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E8BDCC; Mon, 12 Sep 2016 04:55:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4tEfX052541; Mon, 12 Sep 2016 04:55:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4tEgJ052540; Mon, 12 Sep 2016 04:55:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609120455.u8C4tEgJ052540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 12 Sep 2016 04:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305721 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 04:55:15 -0000 Author: adrian Date: Mon Sep 12 04:55:13 2016 New Revision: 305721 URL: https://svnweb.freebsd.org/changeset/base/305721 Log: [ath] set the relevant TOA/TOD locationing bits when trying to do locationing. * Don't do RTS/CTS - experiments show that we get ACK frames for each of them and this ends up causing the timestamps to look all funny. * Set the HAL_TXDESC_POS bit, so the AR9300 HAL sets up the hardware to return location and CSI information. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Sep 12 04:50:40 2016 (r305720) +++ head/sys/dev/ath/if_ath_tx.c Mon Sep 12 04:55:13 2016 (r305721) @@ -1042,6 +1042,14 @@ ath_tx_calc_protection(struct ath_softc shortPreamble = bf->bf_state.bfs_shpream; wh = mtod(bf->bf_m, struct ieee80211_frame *); + /* Disable frame protection for TOA probe frames */ + if (bf->bf_flags & ATH_BUF_TOA_PROBE) { + /* XXX count */ + flags &= ~(HAL_TXDESC_CTSENA | HAL_TXDESC_RTSENA); + bf->bf_state.bfs_doprot = 0; + goto finish; + } + /* * If 802.11g protection is enabled, determine whether * to use RTS/CTS or just CTS. Note that this is only @@ -1081,6 +1089,8 @@ ath_tx_calc_protection(struct ath_softc flags |= HAL_TXDESC_RTSENA; sc->sc_stats.ast_tx_htprotect++; } + +finish: bf->bf_state.bfs_txflags = flags; } @@ -1739,6 +1749,34 @@ ath_tx_normal_setup(struct ath_softc *sc } #endif + /* + * If it's a frame to do location reporting on, + * communicate it to the HAL. + */ + if (ieee80211_get_toa_params(m0, NULL)) { + device_printf(sc->sc_dev, + "%s: setting TX positioning bit\n", __func__); + flags |= HAL_TXDESC_POS; + + /* + * Note: The hardware reports timestamps for + * each of the RX'ed packets as part of the packet + * exchange. So this means things like RTS/CTS + * exchanges, as well as the final ACK. + * + * So, if you send a RTS-protected NULL data frame, + * you'll get an RX report for the RTS response, then + * an RX report for the NULL frame, and then the TX + * completion at the end. + * + * NOTE: it doesn't work right for CCK frames; + * there's no channel info data provided unless + * it's OFDM or HT. Will have to dig into it. + */ + flags &= ~(HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + bf->bf_flags |= ATH_BUF_TOA_PROBE; + } + #if 0 /* * Placeholder: if you want to transmit with the azimuth @@ -2175,6 +2213,18 @@ ath_tx_raw_start(struct ath_softc *sc, s try0 = ATH_TXMAXTRY; /* XXX?too many? */ } + /* + * If it's a frame to do location reporting on, + * communicate it to the HAL. + */ + if (ieee80211_get_toa_params(m0, NULL)) { + device_printf(sc->sc_dev, + "%s: setting TX positioning bit\n", __func__); + flags |= HAL_TXDESC_POS; + flags &= ~(HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + bf->bf_flags |= ATH_BUF_TOA_PROBE; + } + txrate = rt->info[rix].rateCode; if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) txrate |= rt->info[rix].shortPreamble; From owner-svn-src-all@freebsd.org Mon Sep 12 04:57:59 2016 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 73A0BBD5F08; Mon, 12 Sep 2016 04:57:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33FA2F57; Mon, 12 Sep 2016 04:57:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4vwRK052666; Mon, 12 Sep 2016 04:57:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4vw9S052665; Mon, 12 Sep 2016 04:57:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120457.u8C4vw9S052665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 04:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305722 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 04:57:59 -0000 Author: sephe Date: Mon Sep 12 04:57:58 2016 New Revision: 305722 URL: https://svnweb.freebsd.org/changeset/base/305722 Log: x86: Use sx lock for interrupt sources. - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long call chain. For msi_assign_cpu, mutex makes complex PCI bridge drivers more tricky, e.g. sleep can note be called, etc, it will be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI pass-through. - It is not used on any hot code path nor non-sleepable context, so sx should have the same effect as mutex. PIC list is still protected by mutex to keep suspend/resume work. Discussed with: jhb Reviewed by: jhb MFC after: 3 weeks Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7784 Modified: head/sys/x86/x86/intr_machdep.c Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Mon Sep 12 04:55:13 2016 (r305721) +++ head/sys/x86/x86/intr_machdep.c Mon Sep 12 04:57:58 2016 (r305722) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +74,8 @@ typedef void (*mask_fn)(void *); static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; -static struct mtx intr_table_lock; +static struct sx intrsrc_lock; +static struct mtx intrpic_lock; static struct mtx intrcnt_lock; static TAILQ_HEAD(pics_head, pic) pics; @@ -117,14 +119,14 @@ intr_register_pic(struct pic *pic) { int error; - mtx_lock(&intr_table_lock); + mtx_lock(&intrpic_lock); if (intr_pic_registered(pic)) error = EBUSY; else { TAILQ_INSERT_TAIL(&pics, pic, pics); error = 0; } - mtx_unlock(&intr_table_lock); + mtx_unlock(&intrpic_lock); return (error); } @@ -148,16 +150,16 @@ intr_register_source(struct intsrc *isrc vector); if (error) return (error); - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); if (interrupt_sources[vector] != NULL) { - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); intr_event_destroy(isrc->is_event); return (EEXIST); } intrcnt_register(isrc); interrupt_sources[vector] = isrc; isrc->is_handlers = 0; - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); return (0); } @@ -181,14 +183,14 @@ intr_add_handler(const char *name, int v error = intr_event_add_handler(isrc->is_event, name, filter, handler, arg, intr_priority(flags), flags, cookiep); if (error == 0) { - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); intrcnt_updatename(isrc); isrc->is_handlers++; if (isrc->is_handlers == 1) { isrc->is_pic->pic_enable_intr(isrc); isrc->is_pic->pic_enable_source(isrc); } - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } return (error); } @@ -202,14 +204,14 @@ intr_remove_handler(void *cookie) isrc = intr_handler_source(cookie); error = intr_event_remove_handler(cookie); if (error == 0) { - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); isrc->is_handlers--; if (isrc->is_handlers == 0) { isrc->is_pic->pic_disable_source(isrc, PIC_NO_EOI); isrc->is_pic->pic_disable_intr(isrc); } intrcnt_updatename(isrc); - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } return (error); } @@ -283,12 +285,12 @@ intr_resume(bool suspend_cancelled) #ifndef DEV_ATPIC atpic_reset(); #endif - mtx_lock(&intr_table_lock); + mtx_lock(&intrpic_lock); TAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic, suspend_cancelled); } - mtx_unlock(&intr_table_lock); + mtx_unlock(&intrpic_lock); } void @@ -296,12 +298,12 @@ intr_suspend(void) { struct pic *pic; - mtx_lock(&intr_table_lock); + mtx_lock(&intrpic_lock); TAILQ_FOREACH_REVERSE(pic, &pics, pics_head, pics) { if (pic->pic_suspend != NULL) pic->pic_suspend(pic); } - mtx_unlock(&intr_table_lock); + mtx_unlock(&intrpic_lock); } static int @@ -322,9 +324,9 @@ intr_assign_cpu(void *arg, int cpu) if (assign_cpu && cpu != NOCPU) { #endif isrc = arg; - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]); - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } else error = 0; return (error); @@ -384,7 +386,8 @@ intr_init(void *dummy __unused) intrcnt_setname("???", 0); intrcnt_index = 1; TAILQ_INIT(&pics); - mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF); + mtx_init(&intrpic_lock, "intrpic", NULL, MTX_DEF); + sx_init(&intrsrc_lock, "intrsrc"); mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN); } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); @@ -449,7 +452,7 @@ intr_reprogram(void) struct intsrc *is; int v; - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); for (v = 0; v < NUM_IO_INTS; v++) { is = interrupt_sources[v]; if (is == NULL) @@ -457,7 +460,7 @@ intr_reprogram(void) if (is->is_pic->pic_reprogram_pin != NULL) is->is_pic->pic_reprogram_pin(is); } - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } #ifdef DDB @@ -562,7 +565,7 @@ intr_shuffle_irqs(void *arg __unused) return; /* Round-robin assign a CPU to each enabled source. */ - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); assign_cpu = 1; for (i = 0; i < NUM_IO_INTS; i++) { isrc = interrupt_sources[i]; @@ -583,7 +586,7 @@ intr_shuffle_irqs(void *arg __unused) } } - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs, NULL); From owner-svn-src-all@freebsd.org Mon Sep 12 04:59:00 2016 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 33493BD5F8E; Mon, 12 Sep 2016 04:59:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05F1F10D7; Mon, 12 Sep 2016 04:58:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4wxiF052745; Mon, 12 Sep 2016 04:58:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4wxPp052744; Mon, 12 Sep 2016 04:58:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609120458.u8C4wxPp052744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 12 Sep 2016 04:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305723 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 04:59:00 -0000 Author: adrian Date: Mon Sep 12 04:58:59 2016 New Revision: 305723 URL: https://svnweb.freebsd.org/changeset/base/305723 Log: [ath_hal] quieten a bit of the boot messages - this stuff has been working for a while. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Mon Sep 12 04:57:58 2016 (r305722) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Mon Sep 12 04:58:59 2016 (r305723) @@ -2339,7 +2339,9 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC } else { ar9300_disable_pcie_phy(ah); } +#if 0 ath_hal_printf(ah, "%s: calling ar9300_hw_attach\n", __func__); +#endif ecode = ar9300_hw_attach(ah); if (ecode != HAL_OK) { goto bad; @@ -3234,7 +3236,9 @@ ar9300_hw_attach(struct ath_hal *ah) return HAL_ESELFTEST; } +#if 0 ath_hal_printf(ah, "%s: calling ar9300_eeprom_attach\n", __func__); +#endif ecode = ar9300_eeprom_attach(ah); ath_hal_printf(ah, "%s: ar9300_eeprom_attach returned %d\n", __func__, ecode); if (ecode != HAL_OK) { From owner-svn-src-all@freebsd.org Mon Sep 12 05:09:46 2016 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 48074BD6351; Mon, 12 Sep 2016 05:09:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0229D1746; Mon, 12 Sep 2016 05:09:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C59jK3056567; Mon, 12 Sep 2016 05:09:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C59jfA056566; Mon, 12 Sep 2016 05:09:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120509.u8C59jfA056566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305724 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 05:09:46 -0000 Author: sephe Date: Mon Sep 12 05:09:45 2016 New Revision: 305724 URL: https://svnweb.freebsd.org/changeset/base/305724 Log: hyperv/hn: Rename RXBUF connect/disconnect functions. Minor cleanup and wording in error messages. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7823 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 04:58:59 2016 (r305723) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:09:45 2016 (r305724) @@ -58,9 +58,9 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper * Forward declarations */ static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); -static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *); +static int hn_nvs_conn_rxbuf(struct hn_softc *); static int hv_nv_destroy_send_buffer(struct hn_softc *sc); -static int hv_nv_destroy_rx_buffer(struct hn_softc *sc); +static int hn_nvs_disconn_rxbuf(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct hn_softc *, struct vmbus_channel *chan, @@ -154,14 +154,8 @@ hn_nvs_req_send(struct hn_softc *sc, voi req, reqlen, &hn_send_ctx_none)); } -/* - * Net VSC initialize receive buffer with net VSP - * - * Net VSP: Network virtual services client, also known as the - * Hyper-V extensible switch and the synthetic data path. - */ static int -hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) +hn_nvs_conn_rxbuf(struct hn_softc *sc) { struct vmbus_xact *xact = NULL; struct hn_nvs_rxbuf_conn *conn; @@ -188,7 +182,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct error = vmbus_chan_gpadl_connect(sc->hn_prichan, sc->hn_rxbuf_dma.hv_paddr, rxbuf_size, &sc->hn_rxbuf_gpadl); if (error) { - if_printf(sc->hn_ifp, "rxbuf gpadl connect failed: %d\n", + if_printf(sc->hn_ifp, "rxbuf gpadl conn failed: %d\n", error); goto cleanup; } @@ -212,7 +206,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct resp = hn_nvs_xact_execute(sc, xact, conn, sizeof(*conn), &resp_len, HN_NVS_TYPE_RXBUF_CONNRESP); if (resp == NULL) { - if_printf(sc->hn_ifp, "exec rxbuf conn failed\n"); + if_printf(sc->hn_ifp, "exec nvs rxbuf conn failed\n"); error = EIO; goto cleanup; } @@ -222,7 +216,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct xact = NULL; if (status != HN_NVS_STATUS_OK) { - if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status); + if_printf(sc->hn_ifp, "nvs rxbuf conn failed: %x\n", status); error = EIO; goto cleanup; } @@ -233,7 +227,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct cleanup: if (xact != NULL) vmbus_xact_put(xact); - hv_nv_destroy_rx_buffer(sc); + hn_nvs_disconn_rxbuf(sc); return (error); } @@ -336,13 +330,10 @@ cleanup: return (error); } -/* - * Net VSC destroy receive buffer - */ static int -hv_nv_destroy_rx_buffer(struct hn_softc *sc) +hn_nvs_disconn_rxbuf(struct hn_softc *sc) { - int ret = 0; + int error; if (sc->hn_flags & HN_FLAG_RXBUF_CONNECTED) { struct hn_nvs_rxbuf_disconn disconn; @@ -355,29 +346,29 @@ hv_nv_destroy_rx_buffer(struct hn_softc disconn.nvs_sig = HN_NVS_RXBUF_SIG; /* NOTE: No response. */ - ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); - if (ret != 0) { + error = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); + if (error) { if_printf(sc->hn_ifp, - "send rxbuf disconn failed: %d\n", ret); - return (ret); + "send nvs rxbuf disconn failed: %d\n", error); + return (error); } sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; } - + if (sc->hn_rxbuf_gpadl != 0) { /* * Disconnect RXBUF from primary channel. */ - ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + error = vmbus_chan_gpadl_disconnect(sc->hn_prichan, sc->hn_rxbuf_gpadl); - if (ret != 0) { + if (error) { if_printf(sc->hn_ifp, - "rxbuf disconn failed: %d\n", ret); - return (ret); + "rxbuf gpadl disconn failed: %d\n", error); + return (error); } sc->hn_rxbuf_gpadl = 0; } - return (ret); + return (0); } /* @@ -566,10 +557,17 @@ hv_nv_connect_to_vsp(struct hn_softc *sc if (ret != 0) return (ret); - ret = hv_nv_init_rx_buffer_with_net_vsp(sc); - if (ret == 0) - ret = hv_nv_init_send_buffer_with_net_vsp(sc); - return (ret); + /* + * Connect RXBUF. + */ + ret = hn_nvs_conn_rxbuf(sc); + if (ret != 0) + return (ret); + + /* + * Connect chimney sending buffer. + */ + return hv_nv_init_send_buffer_with_net_vsp(sc); } /* @@ -578,7 +576,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc static void hv_nv_disconnect_from_vsp(struct hn_softc *sc) { - hv_nv_destroy_rx_buffer(sc); + hn_nvs_disconn_rxbuf(sc); hv_nv_destroy_send_buffer(sc); } From owner-svn-src-all@freebsd.org Mon Sep 12 05:18:32 2016 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 4B16BBD6731; Mon, 12 Sep 2016 05:18:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8741D6C; Mon, 12 Sep 2016 05:18:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5IVQS060520; Mon, 12 Sep 2016 05:18:31 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5IVFX060519; Mon, 12 Sep 2016 05:18:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120518.u8C5IVFX060519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305725 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 05:18:32 -0000 Author: sephe Date: Mon Sep 12 05:18:30 2016 New Revision: 305725 URL: https://svnweb.freebsd.org/changeset/base/305725 Log: hyperv/hn: Rename chimney sending buffer connect/disconnect functions. Minor cleanup and wording in error messages. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7825 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:09:45 2016 (r305724) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:18:30 2016 (r305725) @@ -57,9 +57,9 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper /* * Forward declarations */ -static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); +static int hn_nvs_conn_chim(struct hn_softc *sc); static int hn_nvs_conn_rxbuf(struct hn_softc *); -static int hv_nv_destroy_send_buffer(struct hn_softc *sc); +static int hn_nvs_disconn_chim(struct hn_softc *sc); static int hn_nvs_disconn_rxbuf(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, @@ -231,11 +231,8 @@ cleanup: return (error); } -/* - * Net VSC initialize send buffer with net VSP - */ static int -hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc) +hn_nvs_conn_chim(struct hn_softc *sc) { struct vmbus_xact *xact = NULL; struct hn_nvs_chim_conn *chim; @@ -255,8 +252,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru sc->hn_chim_dma.hv_paddr, NETVSC_SEND_BUFFER_SIZE, &sc->hn_chim_gpadl); if (error) { - if_printf(sc->hn_ifp, "chimney sending buffer gpadl " - "connect failed: %d\n", error); + if_printf(sc->hn_ifp, "chim gpadl conn failed: %d\n", error); goto cleanup; } @@ -279,7 +275,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru resp = hn_nvs_xact_execute(sc, xact, chim, sizeof(*chim), &resp_len, HN_NVS_TYPE_CHIM_CONNRESP); if (resp == NULL) { - if_printf(sc->hn_ifp, "exec chim conn failed\n"); + if_printf(sc->hn_ifp, "exec nvs chim conn failed\n"); error = EIO; goto cleanup; } @@ -290,14 +286,14 @@ hv_nv_init_send_buffer_with_net_vsp(stru xact = NULL; if (status != HN_NVS_STATUS_OK) { - if_printf(sc->hn_ifp, "chim conn failed: %x\n", status); + if_printf(sc->hn_ifp, "nvs chim conn failed: %x\n", status); error = EIO; goto cleanup; } if (sectsz == 0) { if_printf(sc->hn_ifp, "zero chimney sending buffer " "section size\n"); - return 0; + return (0); } sc->hn_chim_szmax = sectsz; @@ -321,12 +317,12 @@ hv_nv_init_send_buffer_with_net_vsp(stru if_printf(sc->hn_ifp, "chimney sending buffer %d/%d\n", sc->hn_chim_szmax, sc->hn_chim_cnt); } - return 0; + return (0); cleanup: if (xact != NULL) vmbus_xact_put(xact); - hv_nv_destroy_send_buffer(sc); + hn_nvs_disconn_chim(sc); return (error); } @@ -371,13 +367,10 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc return (0); } -/* - * Net VSC destroy send buffer - */ static int -hv_nv_destroy_send_buffer(struct hn_softc *sc) +hn_nvs_disconn_chim(struct hn_softc *sc) { - int ret = 0; + int error; if (sc->hn_flags & HN_FLAG_CHIM_CONNECTED) { struct hn_nvs_chim_disconn disconn; @@ -390,25 +383,25 @@ hv_nv_destroy_send_buffer(struct hn_soft disconn.nvs_sig = HN_NVS_CHIM_SIG; /* NOTE: No response. */ - ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); - if (ret != 0) { + error = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); + if (error) { if_printf(sc->hn_ifp, - "send chim disconn failed: %d\n", ret); - return (ret); + "send nvs chim disconn failed: %d\n", error); + return (error); } sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED; } - + if (sc->hn_chim_gpadl != 0) { /* * Disconnect chimney sending buffer from primary channel. */ - ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + error = vmbus_chan_gpadl_disconnect(sc->hn_prichan, sc->hn_chim_gpadl); - if (ret != 0) { + if (error) { if_printf(sc->hn_ifp, - "chim disconn failed: %d\n", ret); - return (ret); + "chim gpadl disconn failed: %d\n", error); + return (error); } sc->hn_chim_gpadl = 0; } @@ -417,8 +410,7 @@ hv_nv_destroy_send_buffer(struct hn_soft free(sc->hn_chim_bmap, M_NETVSC); sc->hn_chim_bmap = NULL; } - - return (ret); + return (0); } static int @@ -567,7 +559,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc /* * Connect chimney sending buffer. */ - return hv_nv_init_send_buffer_with_net_vsp(sc); + return hn_nvs_conn_chim(sc); } /* @@ -577,7 +569,7 @@ static void hv_nv_disconnect_from_vsp(struct hn_softc *sc) { hn_nvs_disconn_rxbuf(sc); - hv_nv_destroy_send_buffer(sc); + hn_nvs_disconn_chim(sc); } /* From owner-svn-src-all@freebsd.org Mon Sep 12 05:19:57 2016 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 9A158BD67A5; Mon, 12 Sep 2016 05:19:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2D91EE7; Mon, 12 Sep 2016 05:19:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5Jubw060614; Mon, 12 Sep 2016 05:19:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5Jubv060613; Mon, 12 Sep 2016 05:19:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201609120519.u8C5Jubv060613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Sep 2016 05:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305726 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 05:19:57 -0000 Author: imp Date: Mon Sep 12 05:19:56 2016 New Revision: 305726 URL: https://svnweb.freebsd.org/changeset/base/305726 Log: Report the Silicon Revisions for the AM335x SoCs correctly. Modified: head/sys/arm/ti/ti_cpuid.c Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Mon Sep 12 05:18:30 2016 (r305725) +++ head/sys/arm/ti/ti_cpuid.c Mon Sep 12 05:19:56 2016 (r305726) @@ -201,8 +201,10 @@ static void am335x_get_revision(void) { uint32_t dev_feature; - uint8_t cpu_last_char; + char cpu_last_char; bus_space_handle_t bsh; + int major; + int minor; bus_space_map(fdtbus_bs_tag, AM335X_CONTROL_BASE, AM335X_CONTROL_SIZE, 0, &bsh); chip_revision = bus_space_read_4(fdtbus_bs_tag, bsh, AM335X_CONTROL_DEVICE_ID); @@ -232,8 +234,26 @@ am335x_get_revision(void) cpu_last_char='x'; } - printf("Texas Instruments AM335%c Processor, Revision ES1.%u\n", - cpu_last_char, AM335X_DEVREV(chip_revision)); + switch(AM335X_DEVREV(chip_revision)) { + case 0: + major = 1; + minor = 0; + break; + case 1: + major = 2; + minor = 0; + break; + case 2: + major = 2; + minor = 1; + break; + default: + major = 0; + minor = AM335X_DEVREV(chip_revision); + break; + } + printf("Texas Instruments AM335%c Processor, Revision ES%u.%u\n", + cpu_last_char, major, minor); } /** From owner-svn-src-all@freebsd.org Mon Sep 12 05:28:52 2016 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 3A6D9BD6A56; Mon, 12 Sep 2016 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1219B3E2; Mon, 12 Sep 2016 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5SpdJ064238; Mon, 12 Sep 2016 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5SpS1064235; Mon, 12 Sep 2016 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120528.u8C5SpS1064235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305727 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 05:28:52 -0000 Author: sephe Date: Mon Sep 12 05:28:50 2016 New Revision: 305727 URL: https://svnweb.freebsd.org/changeset/base/305727 Log: hyperv/hn: Function rename. - Minor style changes. - Nuke unnecessary indirection. - Nuke unapplied comment. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7827 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:19:56 2016 (r305726) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:28:50 2016 (r305727) @@ -61,7 +61,6 @@ static int hn_nvs_conn_chim(struct hn_s static int hn_nvs_conn_rxbuf(struct hn_softc *); static int hn_nvs_disconn_chim(struct hn_softc *sc); static int hn_nvs_disconn_rxbuf(struct hn_softc *sc); -static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct hn_softc *, struct vmbus_channel *chan, const void *, int); @@ -521,45 +520,48 @@ hn_nvs_init(struct hn_softc *sc) return (ENXIO); } -static int -hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu) +int +hn_nvs_attach(struct hn_softc *sc, int mtu) { - int ret; + int error; /* * Initialize NVS. */ - ret = hn_nvs_init(sc); - if (ret != 0) - return (ret); + error = hn_nvs_init(sc); + if (error) + return (error); if (sc->hn_nvs_ver >= HN_NVS_VERSION_2) { /* * Configure NDIS before initializing it. */ - ret = hn_nvs_conf_ndis(sc, mtu); - if (ret != 0) - return (ret); + error = hn_nvs_conf_ndis(sc, mtu); + if (error) + return (error); } /* * Initialize NDIS. */ - ret = hn_nvs_init_ndis(sc); - if (ret != 0) - return (ret); + error = hn_nvs_init_ndis(sc); + if (error) + return (error); /* * Connect RXBUF. */ - ret = hn_nvs_conn_rxbuf(sc); - if (ret != 0) - return (ret); + error = hn_nvs_conn_rxbuf(sc); + if (error) + return (error); /* * Connect chimney sending buffer. */ - return hn_nvs_conn_chim(sc); + error = hn_nvs_conn_chim(sc); + if (error) + return (error); + return (0); } /* @@ -573,21 +575,6 @@ hv_nv_disconnect_from_vsp(struct hn_soft } /* - * Net VSC on device add - * - * Callback when the device belonging to this driver is added - */ -int -hv_nv_on_device_add(struct hn_softc *sc, int mtu) -{ - - /* - * Connect with the NetVsp - */ - return (hv_nv_connect_to_vsp(sc, mtu)); -} - -/* * Net VSC on device remove */ int Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:19:56 2016 (r305726) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:28:50 2016 (r305727) @@ -261,7 +261,7 @@ extern int hv_promisc_mode; struct hn_send_ctx; void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); -int hv_nv_on_device_add(struct hn_softc *sc, int mtu); +int hn_nvs_attach(struct hn_softc *sc, int mtu); int hv_nv_on_device_remove(struct hn_softc *sc); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:19:56 2016 (r305726) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:28:50 2016 (r305727) @@ -1025,13 +1025,7 @@ hv_rf_on_device_add(struct hn_softc *sc, int nchan = *nchan0; int rxr_cnt; - /* - * Let the inner driver handle this first to create the netvsc channel - * NOTE! Once the channel is created, we may get a receive callback - * (hv_rf_on_receive()) before this call is completed. - * Note: Earlier code used a function pointer here. - */ - ret = hv_nv_on_device_add(sc, mtu); + ret = hn_nvs_attach(sc, mtu); if (ret != 0) return (ret); From owner-svn-src-all@freebsd.org Mon Sep 12 05:37:45 2016 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 E5880BD6CB6; Mon, 12 Sep 2016 05:37:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3591B58; Mon, 12 Sep 2016 05:37:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5bjeS067994; Mon, 12 Sep 2016 05:37:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5biRx067991; Mon, 12 Sep 2016 05:37:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120537.u8C5biRx067991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305728 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 05:37:46 -0000 Author: sephe Date: Mon Sep 12 05:37:44 2016 New Revision: 305728 URL: https://svnweb.freebsd.org/changeset/base/305728 Log: hyperv/hn: Reorganize sub-channel allocation. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7829 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:28:50 2016 (r305727) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:37:44 2016 (r305728) @@ -102,7 +102,7 @@ hn_chim_alloc(struct hn_softc *sc) return (ret); } -const void * +static const void * hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, void *req, int reqlen, size_t *resplen0, uint32_t type) { @@ -653,3 +653,54 @@ hv_nv_on_send(struct vmbus_channel *chan return (ret); } + +int +hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch0) +{ + struct vmbus_xact *xact; + struct hn_nvs_subch_req *req; + const struct hn_nvs_subch_resp *resp; + int error, nsubch_req; + uint32_t nsubch; + size_t resp_len; + + nsubch_req = *nsubch0; + KASSERT(nsubch_req > 0, ("invalid # of sub-channels %d", nsubch_req)); + + xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs subch alloc\n"); + return (ENXIO); + } + req = vmbus_xact_req_data(xact); + req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; + req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; + req->nvs_nsubch = nsubch_req; + + resp_len = sizeof(*resp); + resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len, + HN_NVS_TYPE_SUBCH_RESP); + if (resp == NULL) { + if_printf(sc->hn_ifp, "exec nvs subch alloc failed\n"); + error = EIO; + goto done; + } + if (resp->nvs_status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "nvs subch alloc failed: %x\n", + resp->nvs_status); + error = EIO; + goto done; + } + + nsubch = resp->nvs_nsubch; + if (nsubch > nsubch_req) { + if_printf(sc->hn_ifp, "%u subchans are allocated, " + "requested %d\n", nsubch, nsubch_req); + nsubch = nsubch_req; + } + *nsubch0 = nsubch; + error = 0; +done: + vmbus_xact_put(xact); + return (error); +} Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:28:50 2016 (r305727) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:37:44 2016 (r305728) @@ -1017,13 +1017,7 @@ hv_rf_on_device_add(struct hn_softc *sc, int ret; netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; - struct hn_nvs_subch_req *req; - const struct hn_nvs_subch_resp *resp; - size_t resp_len; - struct vmbus_xact *xact = NULL; - uint32_t status, nsubch; - int nchan = *nchan0; - int rxr_cnt; + int nchan = *nchan0, rxr_cnt, nsubch; ret = hn_nvs_attach(sc, mtu); if (ret != 0) @@ -1072,65 +1066,40 @@ hv_rf_on_device_add(struct hn_softc *sc, *nchan0 = 1; return (0); } - if (nchan > rxr_cnt) - nchan = rxr_cnt; if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", rxr_cnt, nchan); + if (nchan > rxr_cnt) + nchan = rxr_cnt; if (nchan == 1) { device_printf(dev, "only 1 channel is supported, no vRSS\n"); - goto out; + *nchan0 = 1; + return (0); } /* - * Ask NVS to allocate sub-channels. + * Allocate sub-channels from NVS. */ - xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); - if (xact == NULL) { - if_printf(sc->hn_ifp, "no xact for nvs subch req\n"); - ret = ENXIO; - goto out; - } - req = vmbus_xact_req_data(xact); - req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; - req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; - req->nvs_nsubch = nchan - 1; - - resp_len = sizeof(*resp); - resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len, - HN_NVS_TYPE_SUBCH_RESP); - if (resp == NULL) { - if_printf(sc->hn_ifp, "exec subch failed\n"); - ret = EIO; - goto out; - } - - status = resp->nvs_status; - nsubch = resp->nvs_nsubch; - vmbus_xact_put(xact); - xact = NULL; - - if (status != HN_NVS_STATUS_OK) { - if_printf(sc->hn_ifp, "subch req failed: %x\n", status); - ret = EIO; - goto out; - } - if (nsubch > nchan - 1) { - if_printf(sc->hn_ifp, "%u subchans are allocated, requested %u\n", - nsubch, nchan - 1); - nsubch = nchan - 1; + nsubch = nchan - 1; + ret = hn_nvs_alloc_subchans(sc, &nsubch); + if (ret || nsubch == 0) { + /* Failed to allocate sub-channels. */ + *nchan0 = 1; + return (0); } nchan = nsubch + 1; + /* + * Configure RSS key and indirect table after all sub-channels + * are allocated. + */ ret = hn_rndis_conf_rss(sc, nchan); - if (ret != 0) - *nchan0 = 1; - else - *nchan0 = nchan; -out: - if (xact != NULL) - vmbus_xact_put(xact); - return (ret); + if (ret != 0) { + /* Failed to configure RSS key or indirect table. */ + nchan = 1; + } + *nchan0 = nchan; + return (0); } /* Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 05:28:50 2016 (r305727) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 05:37:44 2016 (r305728) @@ -114,9 +114,6 @@ hn_nvs_send_sglist(struct vmbus_channel struct vmbus_xact; struct rndis_packet_msg; -const void *hn_nvs_xact_execute(struct hn_softc *sc, - struct vmbus_xact *xact, void *req, int reqlen, - size_t *resp_len, uint32_t type); void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); uint32_t hn_chim_alloc(struct hn_softc *sc); @@ -125,6 +122,7 @@ void hn_chim_free(struct hn_softc *sc, void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); +int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch); int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); void hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); From owner-svn-src-all@freebsd.org Mon Sep 12 05:59:41 2016 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 16A32BD7330; Mon, 12 Sep 2016 05:59:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C39AF842; Mon, 12 Sep 2016 05:59:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5xemm079229; Mon, 12 Sep 2016 05:59:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5xe06079228; Mon, 12 Sep 2016 05:59:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120559.u8C5xe06079228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305729 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 05:59:41 -0000 Author: sephe Date: Mon Sep 12 05:59:39 2016 New Revision: 305729 URL: https://svnweb.freebsd.org/changeset/base/305729 Log: hyperv/hn: Reorganize RNDIS attach MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7830 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:37:44 2016 (r305728) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:59:39 2016 (r305729) @@ -78,7 +78,6 @@ static void hv_rf_receive_data(struct hn static int hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr); static int hv_rf_query_device_link_status(struct hn_softc *sc, uint32_t *link_status); -static int hv_rf_init_device(struct hn_softc *sc); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); @@ -922,11 +921,8 @@ hn_rndis_set_rxfilter(struct hn_softc *s return (error); } -/* - * RNDIS filter init device - */ static int -hv_rf_init_device(struct hn_softc *sc) +hn_rndis_init(struct hn_softc *sc) { struct rndis_init_req *req; const struct rndis_init_comp *comp; @@ -1007,9 +1003,26 @@ hv_rf_halt_device(struct hn_softc *sc) return (0); } -/* - * RNDIS filter on device add - */ +static int +hn_rndis_attach(struct hn_softc *sc) +{ + int error; + + /* + * Initialize RNDIS. + */ + error = hn_rndis_init(sc); + if (error) + return (error); + + /* + * Configure NDIS offload settings. + * XXX no offloading, if error happened? + */ + hn_rndis_conf_offload(sc); + return (0); +} + int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan0, int mtu) @@ -1023,28 +1036,15 @@ hv_rf_on_device_add(struct hn_softc *sc, if (ret != 0) return (ret); - /* - * Initialize the rndis device - */ - - /* Send the rndis initialization message */ - ret = hv_rf_init_device(sc); - if (ret != 0) { - /* - * TODO: If rndis init failed, we will need to shut down - * the channel - */ - } + ret = hn_rndis_attach(sc); + if (ret != 0) + return (ret); /* Get the mac address */ ret = hv_rf_query_device_mac(sc, dev_info->mac_addr); if (ret != 0) { /* TODO: shut down rndis device and the channel */ } - - /* Configure NDIS offload settings */ - hn_rndis_conf_offload(sc); - hv_rf_query_device_link_status(sc, &dev_info->link_state); if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { From owner-svn-src-all@freebsd.org Mon Sep 12 06:12:30 2016 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 19401BD7648; Mon, 12 Sep 2016 06:12:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8BC1EAD; Mon, 12 Sep 2016 06:12:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C6CThw090040; Mon, 12 Sep 2016 06:12:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C6CSLG090032; Mon, 12 Sep 2016 06:12:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120612.u8C6CSLG090032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 06:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305730 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 06:12:30 -0000 Author: sephe Date: Mon Sep 12 06:12:28 2016 New Revision: 305730 URL: https://svnweb.freebsd.org/changeset/base/305730 Log: hyperv/hn: Pull ether address and link status extraction up. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7831 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 06:12:28 2016 (r305730) @@ -99,11 +99,6 @@ struct vmbus_channel; #define NETVSC_DEVICE_RING_BUFFER_SIZE (128 * PAGE_SIZE) #define NETVSC_PACKET_MAXPAGE 32 -typedef struct { - uint8_t mac_addr[ETHER_ADDR_LEN]; - uint32_t link_state; -} netvsc_device_info; - #define HN_XACT_REQ_PGCNT 2 #define HN_XACT_RESP_PGCNT 2 #define HN_XACT_REQ_SIZE (HN_XACT_REQ_PGCNT * PAGE_SIZE) Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Sep 12 06:12:28 2016 (r305730) @@ -440,7 +440,8 @@ netvsc_attach(device_t dev) { struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; - netvsc_device_info device_info; + uint8_t eaddr[ETHER_ADDR_LEN]; + uint32_t link_status; hn_softc_t *sc; int unit = device_get_unit(dev); struct ifnet *ifp = NULL; @@ -564,7 +565,7 @@ netvsc_attach(device_t dev) if (sc->hn_xact == NULL) goto failed; - error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, ETHERMTU); + error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); if (error) goto failed; KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_inuse, @@ -597,9 +598,11 @@ netvsc_attach(device_t dev) } #endif - if (device_info.link_state == NDIS_MEDIA_STATE_CONNECTED) { + error = hn_rndis_get_linkstatus(sc, &link_status); + if (error) + goto failed; + if (link_status == NDIS_MEDIA_STATE_CONNECTED) sc->hn_carrier = 1; - } #if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; @@ -612,7 +615,10 @@ netvsc_attach(device_t dev) (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); #endif - ether_ifattach(ifp, device_info.mac_addr); + error = hn_rndis_get_eaddr(sc, eaddr); + if (error) + goto failed; + ether_ifattach(ifp, eaddr); #if __FreeBSD_version >= 1100045 if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, @@ -1503,7 +1509,6 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; #endif - netvsc_device_info device_info; int mask, error = 0, ring_cnt; int retry_cnt = 500; @@ -1583,8 +1588,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_chan_attach(sc, sc->hn_prichan); /* XXX check error */ ring_cnt = sc->hn_rx_ring_inuse; - error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, - ifr->ifr_mtu); + error = hv_rf_on_device_add(sc, &ring_cnt, ifr->ifr_mtu); if (error) { NV_LOCK(sc); sc->temp_unusable = FALSE; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 06:12:28 2016 (r305730) @@ -75,9 +75,6 @@ static void hv_rf_receive_indicate_statu const void *data, int dlen); static void hv_rf_receive_data(struct hn_rx_ring *rxr, const void *data, int dlen); -static int hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr); -static int hv_rf_query_device_link_status(struct hn_softc *sc, - uint32_t *link_status); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); @@ -479,11 +476,8 @@ hv_rf_on_receive(struct hn_softc *sc, st } } -/* - * RNDIS filter query device MAC address - */ -static int -hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr) +int +hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr) { size_t eaddr_len; int error; @@ -500,11 +494,8 @@ hv_rf_query_device_mac(struct hn_softc * return (0); } -/* - * RNDIS filter query device link status - */ -static int -hv_rf_query_device_link_status(struct hn_softc *sc, uint32_t *link_status) +int +hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status) { size_t size; int error; @@ -1024,11 +1015,9 @@ hn_rndis_attach(struct hn_softc *sc) } int -hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, - int *nchan0, int mtu) +hv_rf_on_device_add(struct hn_softc *sc, int *nchan0, int mtu) { int ret; - netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; int nchan = *nchan0, rxr_cnt, nsubch; @@ -1040,13 +1029,6 @@ hv_rf_on_device_add(struct hn_softc *sc, if (ret != 0) return (ret); - /* Get the mac address */ - ret = hv_rf_query_device_mac(sc, dev_info->mac_addr); - if (ret != 0) { - /* TODO: shut down rndis device and the channel */ - } - hv_rf_query_device_link_status(sc, &dev_info->link_state); - if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { /* * Either RSS is not supported, or multiple RX/TX rings Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Sep 12 06:12:28 2016 (r305730) @@ -43,8 +43,7 @@ struct hn_rx_ring; void hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, const void *data, int dlen); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); -int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan, - int mtu); +int hv_rf_on_device_add(struct hn_softc *sc, int *nchan, int mtu); int hv_rf_on_device_remove(struct hn_softc *sc); int hv_rf_on_open(struct hn_softc *sc); int hv_rf_on_close(struct hn_softc *sc); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 06:12:28 2016 (r305730) @@ -122,6 +122,9 @@ void hn_chim_free(struct hn_softc *sc, void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); +int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); +int hn_rndis_get_linkstatus(struct hn_softc *sc, + uint32_t *link_status); int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch); int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); From owner-svn-src-all@freebsd.org Mon Sep 12 08:14:13 2016 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 31775BD766A; Mon, 12 Sep 2016 08:14:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEADA1F5; Mon, 12 Sep 2016 08:14:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C8ECmi051924; Mon, 12 Sep 2016 08:14:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C8ECaM051923; Mon, 12 Sep 2016 08:14:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120814.u8C8ECaM051923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 08:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305731 - stable/11/sys/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 08:14:13 -0000 Author: sephe Date: Mon Sep 12 08:14:11 2016 New Revision: 305731 URL: https://svnweb.freebsd.org/changeset/base/305731 Log: MFC 305177 net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1. Reviewed by: araujo, hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7710 Modified: stable/11/sys/net/ethernet.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ethernet.h ============================================================================== --- stable/11/sys/net/ethernet.h Mon Sep 12 06:12:28 2016 (r305730) +++ stable/11/sys/net/ethernet.h Mon Sep 12 08:14:11 2016 (r305731) @@ -89,7 +89,7 @@ struct ether_vlan_header { #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7) #define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1) #define EVL_MAKETAG(vlid, pri, cfi) \ - ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) + ((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) /* * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields. From owner-svn-src-all@freebsd.org Mon Sep 12 08:32:08 2016 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 F25ADBD7AF1; Mon, 12 Sep 2016 08:32:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE6FFF96; Mon, 12 Sep 2016 08:32:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C8W7wG061934; Mon, 12 Sep 2016 08:32:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C8W7id061933; Mon, 12 Sep 2016 08:32:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120832.u8C8W7id061933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 08:32:07 +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: r305732 - stable/10/sys/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 08:32:08 -0000 Author: sephe Date: Mon Sep 12 08:32:06 2016 New Revision: 305732 URL: https://svnweb.freebsd.org/changeset/base/305732 Log: MFC 305177 net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1. Reviewed by: araujo, hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7710 Modified: stable/10/sys/net/if_vlan_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_vlan_var.h ============================================================================== --- stable/10/sys/net/if_vlan_var.h Mon Sep 12 08:14:11 2016 (r305731) +++ stable/10/sys/net/if_vlan_var.h Mon Sep 12 08:32:06 2016 (r305732) @@ -46,7 +46,7 @@ struct ether_vlan_header { #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7) #define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1) #define EVL_MAKETAG(vlid, pri, cfi) \ - ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) + ((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) /* Set the VLAN ID in an mbuf packet header non-destructively. */ #define EVL_APPLY_VLID(m, vlid) \ From owner-svn-src-all@freebsd.org Mon Sep 12 08:32:33 2016 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 BE9E3BD7B7F; Mon, 12 Sep 2016 08:32:33 +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 597F01B3; Mon, 12 Sep 2016 08:32:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u8C8WSST061504 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 12 Sep 2016 11:32:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u8C8WSST061504 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u8C8WSkS061503; Mon, 12 Sep 2016 11:32:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Sep 2016 11:32:28 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305722 - head/sys/x86/x86 Message-ID: <20160912083228.GW38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201609120457.u8C4vw9S052665@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 08:32:33 -0000 On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: > Author: sephe > Date: Mon Sep 12 04:57:58 2016 > New Revision: 305722 > URL: https://svnweb.freebsd.org/changeset/base/305722 > > Log: > x86: Use sx lock for interrupt sources. > > - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long > call chain. For msi_assign_cpu, mutex makes complex PCI bridge > drivers more tricky, e.g. sleep can note be called, etc, it will > be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI > pass-through. > - It is not used on any hot code path nor non-sleepable context, so > sx should have the same effect as mutex. Did you tested ACPI_DMAR interrupt remapping mode with your patch and witness enabled ? > > PIC list is still protected by mutex to keep suspend/resume work. From owner-svn-src-all@freebsd.org Mon Sep 12 08:39:58 2016 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 26CB0BD7E3D; Mon, 12 Sep 2016 08:39:58 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c: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 D7040975; Mon, 12 Sep 2016 08:39:57 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x235.google.com with SMTP id v189so123898122vkv.1; Mon, 12 Sep 2016 01:39:57 -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; bh=kbBco9dIv7oYIJlhmjGhaO30B9ptsGC87MhXHDFMd+c=; b=sjc/j2+t19wmkqmETdEUVveWEaLHxpWed9kAtLIbI7+8cCTlHHlTTYXlNqiEG3r72P aBRfVfr1UbFp+dx+OcykA7OYylhC4232mFR1QmqDIKJUq6o3xNY5AS5NazCWeRE9nlCL IsyE63DItCXh1qQeqNFbCbxEdEo4tHdZSU5DimIAvPGuypt4NLwQ5wrhvEfNT/EtL/K8 xc7A2QeG5KvJz8i/HT/2P2DFFaerL151zJxdVbb3LAx5CcSdz6Btpb4y8ypT2vhLC4p3 ya/F1M8e6Ry14BRWJ0ps/gNqa1AfuN3SQO1pfeLvs4NSnTaS50byLKvIqfO5Ma6lAyDp 2UVg== 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:from :date:message-id:subject:to:cc; bh=kbBco9dIv7oYIJlhmjGhaO30B9ptsGC87MhXHDFMd+c=; b=Uzyw55u9/rJBopr9sSUfYnngswDMxplru9cJqXxjkcFNx4oHvvqso2KLgyiKy1fDPs QQslsT6dCif8SiMLqf7a9+TPL2/TIZDO2FvTwQrjkEjIQhqNV5dMMleDzFsgI5uR6aun IFIBQeCfrsYcuzCM06SJuovRz6jlfV3Bq+h0/66MgHDgPuq8qaVobe95gpOs9XfOo9pw VuyO+wLr2hIduBC05C6Ip9UBmUC/E109MS9+jgSWd96jM7n+iLp6sMKZe7RPqJ17c/P3 N4ErLx1nfk2r/sc2lzYce/JMj0HX5h9goDgTxEo/puBYCN6F5oTU2NhAQaUFx8FZxJNO 1cjw== X-Gm-Message-State: AE9vXwM+sa7xSv2LfJbtVSryiHAuLdq1OuJRIU73YTMQR7kd9cxyV6fYyDA0ZDrdkIDbp67u8JgMWv7WRoMl0Q== X-Received: by 10.31.174.131 with SMTP id x125mr10891632vke.11.1473669596855; Mon, 12 Sep 2016 01:39:56 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Mon, 12 Sep 2016 01:39:54 -0700 (PDT) In-Reply-To: <20160912083228.GW38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 16:39:54 +0800 X-Google-Sender-Auth: bsWlCFoAOB780G5S6vetP99ymzw Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 08:39:58 -0000 On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov wrote: > On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: >> Author: sephe >> Date: Mon Sep 12 04:57:58 2016 >> New Revision: 305722 >> URL: https://svnweb.freebsd.org/changeset/base/305722 >> >> Log: >> x86: Use sx lock for interrupt sources. >> >> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long >> call chain. For msi_assign_cpu, mutex makes complex PCI bridge >> drivers more tricky, e.g. sleep can note be called, etc, it will >> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI >> pass-through. > >> - It is not used on any hot code path nor non-sleepable context, so >> sx should have the same effect as mutex. > Did you tested ACPI_DMAR interrupt remapping mode with your patch and > witness enabled ? Nope, I am about to try it now. BTW, I just checked the code for ACPI_DMAR, I didn't see anything obviously w/ the lock type change though. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Mon Sep 12 08:47:37 2016 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 37CAFBD70C6; Mon, 12 Sep 2016 08:47:37 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x233.google.com (mail-vk0-x233.google.com [IPv6:2607:f8b0: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 E2553DF6; Mon, 12 Sep 2016 08:47:36 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x233.google.com with SMTP id v189so124108887vkv.1; Mon, 12 Sep 2016 01:47: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:from:date:message-id :subject:to:cc; bh=oO1erJfWbLPFbUnt8lRGQ+7RUkywAShFNvhl2QGog40=; b=QQc4LgUJfqOiDSJIrThM0zfrnjJQ2VP9bGrWKnsFlKz0Mn/37JOub3MSS404VDsD38 PLB71hVTdiy8eSHG9RLLaIr0MJVH/5BAgfxfgJgK6YfcJyCZNcX3sUknY30SEuKwkK4Q tDn2L4yRz5fNHeWXmTBI8h/mh9f35OP62nJ1uxgoFwqPaWP6DQrjS12oZadDT5S1GCwu Dq3zJw8m1fLAXm+aVhRX1N6EkIcy3V4ziHy6720Qs7MhweOg4trXAkGHwOkR8KL3wUbX HKzMtanbUIcmF9Nwm++9N+n8zsLxA7uX+fl6p0A43MEfABpvgfn0P3VYKrxCu8BS4JNH Kthw== 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:from :date:message-id:subject:to:cc; bh=oO1erJfWbLPFbUnt8lRGQ+7RUkywAShFNvhl2QGog40=; b=Udwt8y1+svtLhPDpgo1/tJHCEUXhyZ53zuwugPreA9171SEUnU7t8wNYYseC/xTHPw mMXqPtPeLRHRxAd3XkDAPcces5x/f3SpROgxppFpSKi0MP//nNkmSU434gFLg6DJrFn7 ImmFaFaLBS89aToyZSMC2DKktX/9MW3IBC6lCJJv4fvwEAihETWnNRwhalRZN641BjuQ BgQqXMgWhVN1lGuio/QDtKe87kKWwOe3uQh25B0xPzn81WgxftNxFeyS7UGDSAZQH4Va 80OiB62Hvepd2MOChfoCsn1GWXrhTtv7I7x++PfZJZ/6X+LN0WtPzC0uHYKPvXlVA0JP 2eng== X-Gm-Message-State: AE9vXwNQ2NySmCep/kyVMjF8NbzS5kGEMomseQbvsxaBF09MTJqsPlVallgNcHS7YDKMHSMQS6giiN29sswwfw== X-Received: by 10.31.244.207 with SMTP id s198mr6246007vkh.126.1473670056057; Mon, 12 Sep 2016 01:47:36 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Mon, 12 Sep 2016 01:47:35 -0700 (PDT) In-Reply-To: References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 16:47:35 +0800 X-Google-Sender-Auth: GF5awTCM-ZUBoReObjUGvtRYeU0 Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 08:47:37 -0000 On Mon, Sep 12, 2016 at 4:39 PM, Sepherosa Ziehau wrote: > On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov > wrote: >> On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: >>> Author: sephe >>> Date: Mon Sep 12 04:57:58 2016 >>> New Revision: 305722 >>> URL: https://svnweb.freebsd.org/changeset/base/305722 >>> >>> Log: >>> x86: Use sx lock for interrupt sources. >>> >>> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long >>> call chain. For msi_assign_cpu, mutex makes complex PCI bridge >>> drivers more tricky, e.g. sleep can note be called, etc, it will >>> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI >>> pass-through. >> >>> - It is not used on any hot code path nor non-sleepable context, so >>> sx should have the same effect as mutex. >> Did you tested ACPI_DMAR interrupt remapping mode with your patch and >> witness enabled ? > > Nope, I am about to try it now. BTW, I just checked the code for > ACPI_DMAR, I didn't see anything obviously w/ the lock type change > though. I didn't notice anything wrong w/ options ACPI_DMAR+WITNESS+INVARIANTS. If you saw anything wrong, please let me know. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Mon Sep 12 10:00:15 2016 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 8745FBD683F; Mon, 12 Sep 2016 10:00:15 +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 057DF824; Mon, 12 Sep 2016 10:00:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u8CA059Z081819 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 12 Sep 2016 13:00:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u8CA059Z081819 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u8CA03om081761; Mon, 12 Sep 2016 13:00:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Sep 2016 13:00:03 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305722 - head/sys/x86/x86 Message-ID: <20160912100003.GX38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 10:00:15 -0000 On Mon, Sep 12, 2016 at 04:47:35PM +0800, Sepherosa Ziehau wrote: > On Mon, Sep 12, 2016 at 4:39 PM, Sepherosa Ziehau wrote: > > On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov > > wrote: > >> On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: > >>> Author: sephe > >>> Date: Mon Sep 12 04:57:58 2016 > >>> New Revision: 305722 > >>> URL: https://svnweb.freebsd.org/changeset/base/305722 > >>> > >>> Log: > >>> x86: Use sx lock for interrupt sources. > >>> > >>> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long > >>> call chain. For msi_assign_cpu, mutex makes complex PCI bridge > >>> drivers more tricky, e.g. sleep can note be called, etc, it will > >>> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI > >>> pass-through. > >> > >>> - It is not used on any hot code path nor non-sleepable context, so > >>> sx should have the same effect as mutex. > >> Did you tested ACPI_DMAR interrupt remapping mode with your patch and > >> witness enabled ? > > > > Nope, I am about to try it now. BTW, I just checked the code for > > ACPI_DMAR, I didn't see anything obviously w/ the lock type change > > though. > > I didn't notice anything wrong w/ options > ACPI_DMAR+WITNESS+INVARIANTS. If you saw anything wrong, please let > me know. Options are not enough, you should explicitely enable interrupt remapping with loader tunable hw.dmar.ir=1. From owner-svn-src-all@freebsd.org Mon Sep 12 10:14:32 2016 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 80E07BD6D2F; Mon, 12 Sep 2016 10:14:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B7D7F97; Mon, 12 Sep 2016 10:14:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CAEVag014182; Mon, 12 Sep 2016 10:14:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CAEUP9014171; Mon, 12 Sep 2016 10:14:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609121014.u8CAEUP9014171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 12 Sep 2016 10:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305733 - in stable/11/sys: dev/usb dev/usb/template sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 10:14:32 -0000 Author: hselasky Date: Mon Sep 12 10:14:30 2016 New Revision: 305733 URL: https://svnweb.freebsd.org/changeset/base/305733 Log: MFC r305421: Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ Modified: stable/11/sys/dev/usb/template/usb_template.c stable/11/sys/dev/usb/usb_device.c stable/11/sys/dev/usb/usb_device.h stable/11/sys/dev/usb/usb_generic.c stable/11/sys/dev/usb/usb_request.c stable/11/sys/dev/usb/usb_transfer.c stable/11/sys/dev/usb/usb_util.c stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template.c Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/template/usb_template.c Mon Sep 12 10:14:30 2016 (r305733) @@ -1245,7 +1245,7 @@ usb_temp_setup(struct usb_device *udev, return (0); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); uts = udev->scratch.temp_setup; @@ -1324,7 +1324,7 @@ done: if (error) usb_temp_unsetup(udev); if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/11/sys/dev/usb/usb_device.c ============================================================================== --- stable/11/sys/dev/usb/usb_device.c Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/usb_device.c Mon Sep 12 10:14:30 2016 (r305733) @@ -1585,6 +1585,7 @@ usb_alloc_device(device_t parent_dev, st /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); + sx_init_flags(&udev->ctrl_sx, "USB control transfer SX lock", SX_DUPOK); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1770,7 +1771,7 @@ usb_alloc_device(device_t parent_dev, st */ /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); scratch_ptr = udev->scratch.data; @@ -1821,7 +1822,7 @@ usb_alloc_device(device_t parent_dev, st } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; @@ -2195,6 +2196,7 @@ usb_free_device(struct usb_device *udev, sx_destroy(&udev->enum_sx); sx_destroy(&udev->sr_sx); + sx_destroy(&udev->ctrl_sx); cv_destroy(&udev->ctrlreq_cv); cv_destroy(&udev->ref_cv); @@ -2358,7 +2360,7 @@ usbd_set_device_strings(struct usb_devic uint8_t do_unlock; /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_ptr = (char *)udev->scratch.data; temp_size = sizeof(udev->scratch.data); @@ -2418,7 +2420,7 @@ usbd_set_device_strings(struct usb_devic } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); } /* @@ -2825,6 +2827,40 @@ usbd_enum_is_locked(struct usb_device *u } /* + * The following function is used to serialize access to USB control + * transfers and the USB scratch area. If the lock is already grabbed + * this function returns zero. Else a value of one is returned. + */ +uint8_t +usbd_ctrl_lock(struct usb_device *udev) +{ + if (sx_xlocked(&udev->ctrl_sx)) + return (0); + sx_xlock(&udev->ctrl_sx); + + /* + * We need to allow suspend and resume at this point, else the + * control transfer will timeout if the device is suspended! + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_unlock(udev); + return (1); +} + +void +usbd_ctrl_unlock(struct usb_device *udev) +{ + sx_xunlock(&udev->ctrl_sx); + + /* + * Restore the suspend and resume lock after we have unlocked + * the USB control transfer lock to avoid LOR: + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_lock(udev); +} + +/* * The following function is used to set the per-interface specific * plug and play information. The string referred to by the pnpinfo * argument can safely be freed after calling this function. The Modified: stable/11/sys/dev/usb/usb_device.h ============================================================================== --- stable/11/sys/dev/usb/usb_device.h Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/usb_device.h Mon Sep 12 10:14:30 2016 (r305733) @@ -162,7 +162,7 @@ struct usb_temp_setup { /* * The scratch area for USB devices. Access to this structure is - * protected by the enumeration SX lock. + * protected by the control SX lock. */ union usb_device_scratch { struct usb_hw_ep_scratch hw_ep_scratch[1]; @@ -183,6 +183,7 @@ struct usb_device { struct usb_udev_msg cs_msg[2]; struct sx enum_sx; struct sx sr_sx; + struct sx ctrl_sx; struct mtx device_mtx; struct cv ctrlreq_cv; struct cv ref_cv; @@ -320,6 +321,8 @@ uint8_t usbd_enum_lock_sig(struct usb_de void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); +uint8_t usbd_ctrl_lock(struct usb_device *); +void usbd_ctrl_unlock(struct usb_device *); uint8_t usbd_enum_is_locked(struct usb_device *); #if USB_HAVE_TT_SUPPORT Modified: stable/11/sys/dev/usb/usb_generic.c ============================================================================== --- stable/11/sys/dev/usb/usb_generic.c Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/usb_generic.c Mon Sep 12 10:14:30 2016 (r305733) @@ -714,16 +714,16 @@ ugen_get_cdesc(struct usb_fifo *f, struc return (error); } -/* - * This function is called having the enumeration SX locked which - * protects the scratch area used. - */ static int ugen_get_sdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd) { void *ptr; uint16_t size; int error; + uint8_t do_unlock; + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(f->udev); ptr = f->udev->scratch.data; size = sizeof(f->udev->scratch.data); @@ -744,6 +744,9 @@ ugen_get_sdesc(struct usb_fifo *f, struc error = copyout(ptr, ugd->ugd_data, size); } + if (do_unlock) + usbd_ctrl_unlock(f->udev); + return (error); } Modified: stable/11/sys/dev/usb/usb_request.c ============================================================================== --- stable/11/sys/dev/usb/usb_request.c Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/usb_request.c Mon Sep 12 10:14:30 2016 (r305733) @@ -460,16 +460,9 @@ usbd_do_request_flags(struct usb_device } /* - * Grab the USB device enumeration SX-lock serialization is - * achieved when multiple threads are involved: + * Serialize access to this function: */ - do_unlock = usbd_enum_lock(udev); - - /* - * We need to allow suspend and resume at this point, else the - * control transfer will timeout if the device is suspended! - */ - usbd_sr_unlock(udev); + do_unlock = usbd_ctrl_lock(udev); hr_func = usbd_get_hr_func(udev); @@ -713,10 +706,8 @@ usbd_do_request_flags(struct usb_device USB_XFER_UNLOCK(xfer); done: - usbd_sr_lock(udev); - if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) mtx_lock(mtx); Modified: stable/11/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/11/sys/dev/usb/usb_transfer.c Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/usb_transfer.c Mon Sep 12 10:14:30 2016 (r305733) @@ -953,7 +953,7 @@ usbd_transfer_setup(struct usb_device *u return (error); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); refcount = 0; info = NULL; @@ -1274,7 +1274,7 @@ done: error = parm->err; if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/11/sys/dev/usb/usb_util.c ============================================================================== --- stable/11/sys/dev/usb/usb_util.c Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/dev/usb/usb_util.c Mon Sep 12 10:14:30 2016 (r305733) @@ -98,7 +98,7 @@ device_set_usb_desc(device_t dev) } /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_p = (char *)udev->scratch.data; @@ -115,7 +115,7 @@ device_set_usb_desc(device_t dev) } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); device_set_desc_copy(dev, temp_p); device_printf(dev, "<%s> on %s\n", temp_p, Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Mon Sep 12 08:32:06 2016 (r305732) +++ stable/11/sys/sys/param.h Mon Sep 12 10:14:30 2016 (r305733) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Sep 12 10:17:27 2016 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 801E0BD6DE4; Mon, 12 Sep 2016 10:17:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 576961C6; Mon, 12 Sep 2016 10:17:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CAHQJi014745; Mon, 12 Sep 2016 10:17:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CAHPeG014734; Mon, 12 Sep 2016 10:17:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609121017.u8CAHPeG014734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 12 Sep 2016 10:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305734 - in stable/10/sys: dev/usb dev/usb/template 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 10:17:27 -0000 Author: hselasky Date: Mon Sep 12 10:17:25 2016 New Revision: 305734 URL: https://svnweb.freebsd.org/changeset/base/305734 Log: MFC r305421: Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ Modified: stable/10/sys/dev/usb/template/usb_template.c stable/10/sys/dev/usb/usb_device.c stable/10/sys/dev/usb/usb_device.h stable/10/sys/dev/usb/usb_generic.c stable/10/sys/dev/usb/usb_request.c stable/10/sys/dev/usb/usb_transfer.c stable/10/sys/dev/usb/usb_util.c stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/10/sys/dev/usb/template/usb_template.c Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/template/usb_template.c Mon Sep 12 10:17:25 2016 (r305734) @@ -1245,7 +1245,7 @@ usb_temp_setup(struct usb_device *udev, return (0); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); uts = udev->scratch.temp_setup; @@ -1324,7 +1324,7 @@ done: if (error) usb_temp_unsetup(udev); if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/10/sys/dev/usb/usb_device.c ============================================================================== --- stable/10/sys/dev/usb/usb_device.c Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/usb_device.c Mon Sep 12 10:17:25 2016 (r305734) @@ -1588,6 +1588,7 @@ usb_alloc_device(device_t parent_dev, st /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); + sx_init_flags(&udev->ctrl_sx, "USB control transfer SX lock", SX_DUPOK); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1773,7 +1774,7 @@ usb_alloc_device(device_t parent_dev, st */ /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); scratch_ptr = udev->scratch.data; @@ -1824,7 +1825,7 @@ usb_alloc_device(device_t parent_dev, st } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; @@ -2195,6 +2196,7 @@ usb_free_device(struct usb_device *udev, sx_destroy(&udev->enum_sx); sx_destroy(&udev->sr_sx); + sx_destroy(&udev->ctrl_sx); cv_destroy(&udev->ctrlreq_cv); cv_destroy(&udev->ref_cv); @@ -2358,7 +2360,7 @@ usbd_set_device_strings(struct usb_devic uint8_t do_unlock; /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_ptr = (char *)udev->scratch.data; temp_size = sizeof(udev->scratch.data); @@ -2418,7 +2420,7 @@ usbd_set_device_strings(struct usb_devic } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); } /* @@ -2825,6 +2827,40 @@ usbd_enum_is_locked(struct usb_device *u } /* + * The following function is used to serialize access to USB control + * transfers and the USB scratch area. If the lock is already grabbed + * this function returns zero. Else a value of one is returned. + */ +uint8_t +usbd_ctrl_lock(struct usb_device *udev) +{ + if (sx_xlocked(&udev->ctrl_sx)) + return (0); + sx_xlock(&udev->ctrl_sx); + + /* + * We need to allow suspend and resume at this point, else the + * control transfer will timeout if the device is suspended! + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_unlock(udev); + return (1); +} + +void +usbd_ctrl_unlock(struct usb_device *udev) +{ + sx_xunlock(&udev->ctrl_sx); + + /* + * Restore the suspend and resume lock after we have unlocked + * the USB control transfer lock to avoid LOR: + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_lock(udev); +} + +/* * The following function is used to set the per-interface specific * plug and play information. The string referred to by the pnpinfo * argument can safely be freed after calling this function. The Modified: stable/10/sys/dev/usb/usb_device.h ============================================================================== --- stable/10/sys/dev/usb/usb_device.h Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/usb_device.h Mon Sep 12 10:17:25 2016 (r305734) @@ -162,7 +162,7 @@ struct usb_temp_setup { /* * The scratch area for USB devices. Access to this structure is - * protected by the enumeration SX lock. + * protected by the control SX lock. */ union usb_device_scratch { struct usb_hw_ep_scratch hw_ep_scratch[1]; @@ -183,6 +183,7 @@ struct usb_device { struct usb_udev_msg cs_msg[2]; struct sx enum_sx; struct sx sr_sx; + struct sx ctrl_sx; struct mtx device_mtx; struct cv ctrlreq_cv; struct cv ref_cv; @@ -320,6 +321,8 @@ uint8_t usbd_enum_lock_sig(struct usb_de void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); +uint8_t usbd_ctrl_lock(struct usb_device *); +void usbd_ctrl_unlock(struct usb_device *); uint8_t usbd_enum_is_locked(struct usb_device *); #if USB_HAVE_TT_SUPPORT Modified: stable/10/sys/dev/usb/usb_generic.c ============================================================================== --- stable/10/sys/dev/usb/usb_generic.c Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/usb_generic.c Mon Sep 12 10:17:25 2016 (r305734) @@ -715,16 +715,16 @@ ugen_get_cdesc(struct usb_fifo *f, struc return (error); } -/* - * This function is called having the enumeration SX locked which - * protects the scratch area used. - */ static int ugen_get_sdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd) { void *ptr; uint16_t size; int error; + uint8_t do_unlock; + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(f->udev); ptr = f->udev->scratch.data; size = sizeof(f->udev->scratch.data); @@ -745,6 +745,9 @@ ugen_get_sdesc(struct usb_fifo *f, struc error = copyout(ptr, ugd->ugd_data, size); } + if (do_unlock) + usbd_ctrl_unlock(f->udev); + return (error); } Modified: stable/10/sys/dev/usb/usb_request.c ============================================================================== --- stable/10/sys/dev/usb/usb_request.c Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/usb_request.c Mon Sep 12 10:17:25 2016 (r305734) @@ -460,16 +460,9 @@ usbd_do_request_flags(struct usb_device } /* - * Grab the USB device enumeration SX-lock serialization is - * achieved when multiple threads are involved: + * Serialize access to this function: */ - do_unlock = usbd_enum_lock(udev); - - /* - * We need to allow suspend and resume at this point, else the - * control transfer will timeout if the device is suspended! - */ - usbd_sr_unlock(udev); + do_unlock = usbd_ctrl_lock(udev); hr_func = usbd_get_hr_func(udev); @@ -713,10 +706,8 @@ usbd_do_request_flags(struct usb_device USB_XFER_UNLOCK(xfer); done: - usbd_sr_lock(udev); - if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) mtx_lock(mtx); Modified: stable/10/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/10/sys/dev/usb/usb_transfer.c Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/usb_transfer.c Mon Sep 12 10:17:25 2016 (r305734) @@ -953,7 +953,7 @@ usbd_transfer_setup(struct usb_device *u return (error); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); refcount = 0; info = NULL; @@ -1274,7 +1274,7 @@ done: error = parm->err; if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/10/sys/dev/usb/usb_util.c ============================================================================== --- stable/10/sys/dev/usb/usb_util.c Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/dev/usb/usb_util.c Mon Sep 12 10:17:25 2016 (r305734) @@ -98,7 +98,7 @@ device_set_usb_desc(device_t dev) } /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_p = (char *)udev->scratch.data; @@ -115,7 +115,7 @@ device_set_usb_desc(device_t dev) } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); device_set_desc_copy(dev, temp_p); device_printf(dev, "<%s> on %s\n", temp_p, Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Mon Sep 12 10:14:30 2016 (r305733) +++ stable/10/sys/sys/param.h Mon Sep 12 10:17:25 2016 (r305734) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Sep 12 10:20:46 2016 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 2F88CBD6EA5; Mon, 12 Sep 2016 10:20:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7373B3; Mon, 12 Sep 2016 10:20:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CAKjBp015393; Mon, 12 Sep 2016 10:20:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CAKiYE015383; Mon, 12 Sep 2016 10:20:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609121020.u8CAKiYE015383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 12 Sep 2016 10:20:44 +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: r305735 - in stable/9/sys: dev/usb dev/usb/template sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 10:20:46 -0000 Author: hselasky Date: Mon Sep 12 10:20:44 2016 New Revision: 305735 URL: https://svnweb.freebsd.org/changeset/base/305735 Log: MFC r305421: Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ Modified: stable/9/sys/dev/usb/template/usb_template.c stable/9/sys/dev/usb/usb_device.c stable/9/sys/dev/usb/usb_device.h stable/9/sys/dev/usb/usb_generic.c stable/9/sys/dev/usb/usb_request.c stable/9/sys/dev/usb/usb_transfer.c stable/9/sys/dev/usb/usb_util.c stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/9/sys/dev/usb/template/usb_template.c Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/template/usb_template.c Mon Sep 12 10:20:44 2016 (r305735) @@ -1240,7 +1240,7 @@ usb_temp_setup(struct usb_device *udev, return (0); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); uts = udev->scratch.temp_setup; @@ -1319,7 +1319,7 @@ done: if (error) usb_temp_unsetup(udev); if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/usb_device.c Mon Sep 12 10:20:44 2016 (r305735) @@ -1555,6 +1555,7 @@ usb_alloc_device(device_t parent_dev, st /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); + sx_init_flags(&udev->ctrl_sx, "USB control transfer SX lock", SX_DUPOK); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1740,7 +1741,7 @@ usb_alloc_device(device_t parent_dev, st */ /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); scratch_ptr = udev->scratch.data; @@ -1791,7 +1792,7 @@ usb_alloc_device(device_t parent_dev, st } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; @@ -2158,6 +2159,7 @@ usb_free_device(struct usb_device *udev, sx_destroy(&udev->enum_sx); sx_destroy(&udev->sr_sx); + sx_destroy(&udev->ctrl_sx); cv_destroy(&udev->ctrlreq_cv); cv_destroy(&udev->ref_cv); @@ -2321,7 +2323,7 @@ usbd_set_device_strings(struct usb_devic uint8_t do_unlock; /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_ptr = (char *)udev->scratch.data; temp_size = sizeof(udev->scratch.data); @@ -2381,7 +2383,7 @@ usbd_set_device_strings(struct usb_devic } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); } /* @@ -2788,6 +2790,40 @@ usbd_enum_is_locked(struct usb_device *u } /* + * The following function is used to serialize access to USB control + * transfers and the USB scratch area. If the lock is already grabbed + * this function returns zero. Else a value of one is returned. + */ +uint8_t +usbd_ctrl_lock(struct usb_device *udev) +{ + if (sx_xlocked(&udev->ctrl_sx)) + return (0); + sx_xlock(&udev->ctrl_sx); + + /* + * We need to allow suspend and resume at this point, else the + * control transfer will timeout if the device is suspended! + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_unlock(udev); + return (1); +} + +void +usbd_ctrl_unlock(struct usb_device *udev) +{ + sx_xunlock(&udev->ctrl_sx); + + /* + * Restore the suspend and resume lock after we have unlocked + * the USB control transfer lock to avoid LOR: + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_lock(udev); +} + +/* * The following function is used to set the per-interface specific * plug and play information. The string referred to by the pnpinfo * argument can safely be freed after calling this function. The Modified: stable/9/sys/dev/usb/usb_device.h ============================================================================== --- stable/9/sys/dev/usb/usb_device.h Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/usb_device.h Mon Sep 12 10:20:44 2016 (r305735) @@ -162,7 +162,7 @@ struct usb_temp_setup { /* * The scratch area for USB devices. Access to this structure is - * protected by the enumeration SX lock. + * protected by the control SX lock. */ union usb_device_scratch { struct usb_hw_ep_scratch hw_ep_scratch[1]; @@ -183,6 +183,7 @@ struct usb_device { struct usb_udev_msg cs_msg[2]; struct sx enum_sx; struct sx sr_sx; + struct sx ctrl_sx; struct mtx device_mtx; struct cv ctrlreq_cv; struct cv ref_cv; @@ -308,6 +309,8 @@ uint8_t usbd_enum_lock_sig(struct usb_de void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); +uint8_t usbd_ctrl_lock(struct usb_device *); +void usbd_ctrl_unlock(struct usb_device *); uint8_t usbd_enum_is_locked(struct usb_device *); #if USB_HAVE_TT_SUPPORT Modified: stable/9/sys/dev/usb/usb_generic.c ============================================================================== --- stable/9/sys/dev/usb/usb_generic.c Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/usb_generic.c Mon Sep 12 10:20:44 2016 (r305735) @@ -706,16 +706,16 @@ ugen_get_cdesc(struct usb_fifo *f, struc return (error); } -/* - * This function is called having the enumeration SX locked which - * protects the scratch area used. - */ static int ugen_get_sdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd) { void *ptr; uint16_t size; int error; + uint8_t do_unlock; + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(f->udev); ptr = f->udev->scratch.data; size = sizeof(f->udev->scratch.data); @@ -736,6 +736,9 @@ ugen_get_sdesc(struct usb_fifo *f, struc error = copyout(ptr, ugd->ugd_data, size); } + if (do_unlock) + usbd_ctrl_unlock(f->udev); + return (error); } Modified: stable/9/sys/dev/usb/usb_request.c ============================================================================== --- stable/9/sys/dev/usb/usb_request.c Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/usb_request.c Mon Sep 12 10:20:44 2016 (r305735) @@ -453,16 +453,9 @@ usbd_do_request_flags(struct usb_device } /* - * Grab the USB device enumeration SX-lock serialization is - * achieved when multiple threads are involved: + * Serialize access to this function: */ - do_unlock = usbd_enum_lock(udev); - - /* - * We need to allow suspend and resume at this point, else the - * control transfer will timeout if the device is suspended! - */ - usbd_sr_unlock(udev); + do_unlock = usbd_ctrl_lock(udev); hr_func = usbd_get_hr_func(udev); @@ -706,10 +699,8 @@ usbd_do_request_flags(struct usb_device USB_XFER_UNLOCK(xfer); done: - usbd_sr_lock(udev); - if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) mtx_lock(mtx); Modified: stable/9/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/9/sys/dev/usb/usb_transfer.c Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/usb_transfer.c Mon Sep 12 10:20:44 2016 (r305735) @@ -872,7 +872,7 @@ usbd_transfer_setup(struct usb_device *u return (error); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); refcount = 0; info = NULL; @@ -1171,7 +1171,7 @@ done: error = parm->err; if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/9/sys/dev/usb/usb_util.c ============================================================================== --- stable/9/sys/dev/usb/usb_util.c Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/dev/usb/usb_util.c Mon Sep 12 10:20:44 2016 (r305735) @@ -94,7 +94,7 @@ device_set_usb_desc(device_t dev) } /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_p = (char *)udev->scratch.data; @@ -111,7 +111,7 @@ device_set_usb_desc(device_t dev) } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); device_set_desc_copy(dev, temp_p); device_printf(dev, "<%s> on %s\n", temp_p, Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Mon Sep 12 10:17:25 2016 (r305734) +++ stable/9/sys/sys/param.h Mon Sep 12 10:20:44 2016 (r305735) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 903510 /* Master, propagated to newvers */ +#define __FreeBSD_version 903511 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Sep 12 10:23:26 2016 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 A25D2BD800C; Mon, 12 Sep 2016 10:23:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 701519AE; Mon, 12 Sep 2016 10:23:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CANPE1019201; Mon, 12 Sep 2016 10:23:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CANOhq019191; Mon, 12 Sep 2016 10:23:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609121023.u8CANOhq019191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 12 Sep 2016 10:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r305736 - in stable/8/sys: dev/usb dev/usb/template sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 10:23:26 -0000 Author: hselasky Date: Mon Sep 12 10:23:24 2016 New Revision: 305736 URL: https://svnweb.freebsd.org/changeset/base/305736 Log: MFC r305421: Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ Modified: stable/8/sys/dev/usb/template/usb_template.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usb_util.c stable/8/sys/sys/param.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template.c Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/template/usb_template.c Mon Sep 12 10:23:24 2016 (r305736) @@ -1240,7 +1240,7 @@ usb_temp_setup(struct usb_device *udev, return (0); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); uts = udev->scratch.temp_setup; @@ -1319,7 +1319,7 @@ done: if (error) usb_temp_unsetup(udev); if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/usb_device.c Mon Sep 12 10:23:24 2016 (r305736) @@ -1550,6 +1550,7 @@ usb_alloc_device(device_t parent_dev, st /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); + sx_init_flags(&udev->ctrl_sx, "USB control transfer SX lock", SX_DUPOK); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1735,7 +1736,7 @@ usb_alloc_device(device_t parent_dev, st */ /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); scratch_ptr = udev->scratch.data; @@ -1786,7 +1787,7 @@ usb_alloc_device(device_t parent_dev, st } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; @@ -2148,6 +2149,7 @@ usb_free_device(struct usb_device *udev, sx_destroy(&udev->enum_sx); sx_destroy(&udev->sr_sx); + sx_destroy(&udev->ctrl_sx); cv_destroy(&udev->ctrlreq_cv); cv_destroy(&udev->ref_cv); @@ -2311,7 +2313,7 @@ usbd_set_device_strings(struct usb_devic uint8_t do_unlock; /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_ptr = (char *)udev->scratch.data; temp_size = sizeof(udev->scratch.data); @@ -2371,7 +2373,7 @@ usbd_set_device_strings(struct usb_devic } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); } /* @@ -2853,6 +2855,40 @@ usbd_enum_is_locked(struct usb_device *u } /* + * The following function is used to serialize access to USB control + * transfers and the USB scratch area. If the lock is already grabbed + * this function returns zero. Else a value of one is returned. + */ +uint8_t +usbd_ctrl_lock(struct usb_device *udev) +{ + if (sx_xlocked(&udev->ctrl_sx)) + return (0); + sx_xlock(&udev->ctrl_sx); + + /* + * We need to allow suspend and resume at this point, else the + * control transfer will timeout if the device is suspended! + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_unlock(udev); + return (1); +} + +void +usbd_ctrl_unlock(struct usb_device *udev) +{ + sx_xunlock(&udev->ctrl_sx); + + /* + * Restore the suspend and resume lock after we have unlocked + * the USB control transfer lock to avoid LOR: + */ + if (usbd_enum_is_locked(udev)) + usbd_sr_lock(udev); +} + +/* * The following function is used to set the per-interface specific * plug and play information. The string referred to by the pnpinfo * argument can safely be freed after calling this function. The Modified: stable/8/sys/dev/usb/usb_device.h ============================================================================== --- stable/8/sys/dev/usb/usb_device.h Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/usb_device.h Mon Sep 12 10:23:24 2016 (r305736) @@ -162,7 +162,7 @@ struct usb_temp_setup { /* * The scratch area for USB devices. Access to this structure is - * protected by the enumeration SX lock. + * protected by the control SX lock. */ union usb_device_scratch { struct usb_hw_ep_scratch hw_ep_scratch[1]; @@ -183,6 +183,7 @@ struct usb_device { struct usb_udev_msg cs_msg[2]; struct sx enum_sx; struct sx sr_sx; + struct sx ctrl_sx; struct mtx device_mtx; struct cv ctrlreq_cv; struct cv ref_cv; @@ -309,6 +310,8 @@ uint8_t usbd_enum_lock_sig(struct usb_de void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); +uint8_t usbd_ctrl_lock(struct usb_device *); +void usbd_ctrl_unlock(struct usb_device *); uint8_t usbd_enum_is_locked(struct usb_device *); #if USB_HAVE_TT_SUPPORT Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/usb_generic.c Mon Sep 12 10:23:24 2016 (r305736) @@ -706,16 +706,16 @@ ugen_get_cdesc(struct usb_fifo *f, struc return (error); } -/* - * This function is called having the enumeration SX locked which - * protects the scratch area used. - */ static int ugen_get_sdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd) { void *ptr; uint16_t size; int error; + uint8_t do_unlock; + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(f->udev); ptr = f->udev->scratch.data; size = sizeof(f->udev->scratch.data); @@ -736,6 +736,9 @@ ugen_get_sdesc(struct usb_fifo *f, struc error = copyout(ptr, ugd->ugd_data, size); } + if (do_unlock) + usbd_ctrl_unlock(f->udev); + return (error); } Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/usb_request.c Mon Sep 12 10:23:24 2016 (r305736) @@ -453,16 +453,9 @@ usbd_do_request_flags(struct usb_device } /* - * Grab the USB device enumeration SX-lock serialization is - * achieved when multiple threads are involved: + * Serialize access to this function: */ - do_unlock = usbd_enum_lock(udev); - - /* - * We need to allow suspend and resume at this point, else the - * control transfer will timeout if the device is suspended! - */ - usbd_sr_unlock(udev); + do_unlock = usbd_ctrl_lock(udev); hr_func = usbd_get_hr_func(udev); @@ -706,10 +699,8 @@ usbd_do_request_flags(struct usb_device USB_XFER_UNLOCK(xfer); done: - usbd_sr_lock(udev); - if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) mtx_lock(mtx); Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/usb_transfer.c Mon Sep 12 10:23:24 2016 (r305736) @@ -872,7 +872,7 @@ usbd_transfer_setup(struct usb_device *u return (error); /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); refcount = 0; info = NULL; @@ -1170,7 +1170,7 @@ done: error = parm->err; if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); return (error); } Modified: stable/8/sys/dev/usb/usb_util.c ============================================================================== --- stable/8/sys/dev/usb/usb_util.c Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/dev/usb/usb_util.c Mon Sep 12 10:23:24 2016 (r305736) @@ -119,7 +119,7 @@ device_set_usb_desc(device_t dev) } /* Protect scratch area */ - do_unlock = usbd_enum_lock(udev); + do_unlock = usbd_ctrl_lock(udev); temp_p = (char *)udev->scratch.data; @@ -136,7 +136,7 @@ device_set_usb_desc(device_t dev) } if (do_unlock) - usbd_enum_unlock(udev); + usbd_ctrl_unlock(udev); device_set_desc_copy(dev, temp_p); device_printf(dev, "<%s> on %s\n", temp_p, Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Mon Sep 12 10:20:44 2016 (r305735) +++ stable/8/sys/sys/param.h Mon Sep 12 10:23:24 2016 (r305736) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 804508 /* Master, propagated to newvers */ +#define __FreeBSD_version 804509 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Sep 12 14:28:39 2016 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 8D620BD8710; Mon, 12 Sep 2016 14:28:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4482D418; Mon, 12 Sep 2016 14:28:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CESceC042824; Mon, 12 Sep 2016 14:28:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CEScb5042823; Mon, 12 Sep 2016 14:28:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609121428.u8CEScb5042823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Sep 2016 14:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305737 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 14:28:39 -0000 Author: emaste Date: Mon Sep 12 14:28:38 2016 New Revision: 305737 URL: https://svnweb.freebsd.org/changeset/base/305737 Log: bspatch: remove superfluous newlines from errx strings Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Mon Sep 12 10:23:24 2016 (r305736) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Mon Sep 12 14:28:38 2016 (r305737) @@ -183,13 +183,13 @@ int main(int argc, char *argv[]) /* Read header */ if (fread(header, 1, 32, f) < 32) { if (feof(f)) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); err(1, "fread(%s)", argv[3]); } /* Check for appropriate magic */ if (memcmp(header, "BSDIFF40", 8) != 0) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read lengths from header */ bzctrllen = offtin(header + 8); @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) if (bzctrllen < 0 || bzctrllen > OFF_MAX - 32 || bzdatalen < 0 || bzctrllen + 32 > OFF_MAX - bzdatalen || newsize < 0 || newsize > SSIZE_MAX) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) @@ -237,24 +237,24 @@ int main(int argc, char *argv[]) lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8); if ((lenread < 8) || ((cbz2err != BZ_OK) && (cbz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); ctrl[i] = offtin(buf); } /* Sanity-check */ if (ctrl[0] < 0 || ctrl[0] > INT_MAX || ctrl[1] < 0 || ctrl[1] > INT_MAX) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Sanity-check */ if (newpos + ctrl[0] > newsize) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read diff string */ lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); if ((lenread < ctrl[0]) || ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Add old data to diff string */ for (i = 0; i < ctrl[0]; i++) @@ -267,13 +267,13 @@ int main(int argc, char *argv[]) /* Sanity-check */ if (newpos + ctrl[1] > newsize) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read extra string */ lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); if ((lenread < ctrl[1]) || ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Adjust pointers */ newpos+=ctrl[1]; From owner-svn-src-all@freebsd.org Mon Sep 12 15:57:36 2016 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 42DF2BD8AF5; Mon, 12 Sep 2016 15:57:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11CB8C7F; Mon, 12 Sep 2016 15:57:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CFvZkx084667; Mon, 12 Sep 2016 15:57:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CFvZrp084666; Mon, 12 Sep 2016 15:57:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201609121557.u8CFvZrp084666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 12 Sep 2016 15:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305738 - releng/11.0/sys/netpfil/ipfw 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 15:57:36 -0000 Author: ae Date: Mon Sep 12 15:57:35 2016 New Revision: 305738 URL: https://svnweb.freebsd.org/changeset/base/305738 Log: Merge from stable/11 r304415,304419 (by oleg): Fix command: ipfw set (enable|disable) N (where N > 4). PR: 212595 Approved by: re (kib) Modified: releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Sep 12 14:28:38 2016 (r305737) +++ releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Sep 12 15:57:35 2016 (r305738) @@ -1414,8 +1414,10 @@ manage_sets(struct ip_fw_chain *chain, i if (rh->range.head.length != sizeof(ipfw_range_tlv)) return (1); - if (rh->range.set >= IPFW_MAX_SETS || - rh->range.new_set >= IPFW_MAX_SETS) + /* enable_sets() expects bitmasks. */ + if (op3->opcode != IP_FW_SET_ENABLE && + (rh->range.set >= IPFW_MAX_SETS || + rh->range.new_set >= IPFW_MAX_SETS)) return (EINVAL); ret = 0; From owner-svn-src-all@freebsd.org Mon Sep 12 16:10:48 2016 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 57242BD7326; Mon, 12 Sep 2016 16:10:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A29982B; Mon, 12 Sep 2016 16:10:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGAltJ088917; Mon, 12 Sep 2016 16:10:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGAlmH088916; Mon, 12 Sep 2016 16:10:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201609121610.u8CGAlmH088916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 12 Sep 2016 16:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305739 - head/release/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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:10:48 -0000 Author: manu Date: Mon Sep 12 16:10:47 2016 New Revision: 305739 URL: https://svnweb.freebsd.org/changeset/base/305739 Log: Use "generic" ALLWINNER_UP kernel config for Cubieboard release. Reviewed by: gjb MFC after: 2 week Modified: head/release/arm/CUBIEBOARD.conf Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Mon Sep 12 15:57:35 2016 (r305738) +++ head/release/arm/CUBIEBOARD.conf Mon Sep 12 16:10:47 2016 (r305739) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -KERNEL="CUBIEBOARD" +KERNEL="ALLWINNER_UP" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" From owner-svn-src-all@freebsd.org Mon Sep 12 16:13:28 2016 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 9C51BBD765D; Mon, 12 Sep 2016 16:13:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 556CCE38; Mon, 12 Sep 2016 16:13:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGDRLi092386; Mon, 12 Sep 2016 16:13:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGDRUB092385; Mon, 12 Sep 2016 16:13:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201609121613.u8CGDRUB092385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 12 Sep 2016 16:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305740 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:13:28 -0000 Author: manu Date: Mon Sep 12 16:13:27 2016 New Revision: 305740 URL: https://svnweb.freebsd.org/changeset/base/305740 Log: Remove CUBIEBOARD kernel config file. Every Allwinner board should either use ALLWINNER (SMP) or ALLWINER_UP kernel config files. MFC after: 2 week Deleted: head/sys/arm/conf/CUBIEBOARD From owner-svn-src-all@freebsd.org Mon Sep 12 16:28:33 2016 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 CC926BD7B33; Mon, 12 Sep 2016 16:28:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A882BA01; Mon, 12 Sep 2016 16:28:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGSWrH096756; Mon, 12 Sep 2016 16:28:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGSW9E096747; Mon, 12 Sep 2016 16:28:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201609121628.u8CGSW9E096747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Sep 2016 16:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305741 - in stable/11/usr.sbin/pw: . tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:28:33 -0000 Author: asomers Date: Mon Sep 12 16:28:32 2016 New Revision: 305741 URL: https://svnweb.freebsd.org/changeset/base/305741 Log: MFC r302778 pw should sanitize the argument of -w. Otherwise, it will silently disable the login for the selected account if the argument is unrecognizable. usr.sbin/pw/pw.h usr.sbin/pw/pw_conf.c usr.sbin/pw/pw_user.c Use separate rules to validate boolean parameters and passwd parameters. Error out if a password parameter cannot be parsed. usr.sbin/pw/tests/Makefile usr.sbin/pw/tests/crypt.c usr.sbin/pw/tests/pw_useradd.sh usr.sbin/pw/tests/pw_usermod.sh Add tests for the validation. Also, enhance existing password-related tests to actually validate that the correct hash is written to master.passwd. Added: stable/11/usr.sbin/pw/tests/crypt.c - copied unchanged from r302778, head/usr.sbin/pw/tests/crypt.c Modified: stable/11/usr.sbin/pw/pw.h stable/11/usr.sbin/pw/pw_conf.c stable/11/usr.sbin/pw/pw_user.c stable/11/usr.sbin/pw/tests/Makefile stable/11/usr.sbin/pw/tests/pw_useradd.sh stable/11/usr.sbin/pw/tests/pw_usermod.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pw/pw.h ============================================================================== --- stable/11/usr.sbin/pw/pw.h Mon Sep 12 16:13:27 2016 (r305740) +++ stable/11/usr.sbin/pw/pw.h Mon Sep 12 16:28:32 2016 (r305741) @@ -93,6 +93,7 @@ int groupadd(struct userconf *, char *na int nis_update(void); int boolean_val(char const * str, int dflt); +int passwd_val(char const * str, int dflt); char const *boolean_str(int val); char *newstr(char const * p); Modified: stable/11/usr.sbin/pw/pw_conf.c ============================================================================== --- stable/11/usr.sbin/pw/pw_conf.c Mon Sep 12 16:13:27 2016 (r305740) +++ stable/11/usr.sbin/pw/pw_conf.c Mon Sep 12 16:28:32 2016 (r305741) @@ -186,6 +186,22 @@ boolean_val(char const * str, int dflt) for (i = 0; boolfalse[i]; i++) if (strcmp(str, boolfalse[i]) == 0) return 0; + } + return dflt; +} + +int +passwd_val(char const * str, int dflt) +{ + if ((str = unquote(str)) != NULL) { + int i; + + for (i = 0; booltrue[i]; i++) + if (strcmp(str, booltrue[i]) == 0) + return 1; + for (i = 0; boolfalse[i]; i++) + if (strcmp(str, boolfalse[i]) == 0) + return 0; /* * Special cases for defaultpassword @@ -194,6 +210,8 @@ boolean_val(char const * str, int dflt) return -1; if (strcmp(str, "none") == 0) return -2; + + errx(1, "Invalid value for default password"); } return dflt; } @@ -258,7 +276,7 @@ read_userconfig(char const * file) #endif switch (i) { case _UC_DEFAULTPWD: - config.default_password = boolean_val(q, 1); + config.default_password = passwd_val(q, 1); break; case _UC_REUSEUID: config.reuse_uids = boolean_val(q, 0); Modified: stable/11/usr.sbin/pw/pw_user.c ============================================================================== --- stable/11/usr.sbin/pw/pw_user.c Mon Sep 12 16:13:27 2016 (r305740) +++ stable/11/usr.sbin/pw/pw_user.c Mon Sep 12 16:28:32 2016 (r305741) @@ -1315,7 +1315,7 @@ pw_user_add(int argc, char **argv, char mix_config(cmdcnf, cnf); if (default_passwd) - cmdcnf->default_password = boolean_val(default_passwd, + cmdcnf->default_password = passwd_val(default_passwd, cnf->default_password); if (genconf) { if (name != NULL) @@ -1717,7 +1717,7 @@ pw_user_mod(int argc, char **argv, char if (lc == NULL || login_setcryptfmt(lc, "sha512", NULL) == NULL) warn("setting crypt(3) format"); login_close(lc); - cnf->default_password = boolean_val(passwd, + cnf->default_password = passwd_val(passwd, cnf->default_password); pwd->pw_passwd = pw_password(cnf, pwd->pw_name, dryrun); edited = true; Modified: stable/11/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/11/usr.sbin/pw/tests/Makefile Mon Sep 12 16:13:27 2016 (r305740) +++ stable/11/usr.sbin/pw/tests/Makefile Mon Sep 12 16:28:32 2016 (r305741) @@ -2,6 +2,11 @@ PACKAGE= tests +BINDIR= ${TESTSDIR} + +PROGS+= crypt +LIBADD+= crypt + ATF_TESTS_SH= pw_etcdir \ pw_lock \ pw_config \ Copied: stable/11/usr.sbin/pw/tests/crypt.c (from r302778, head/usr.sbin/pw/tests/crypt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/crypt.c Mon Sep 12 16:28:32 2016 (r305741, copy of r302778, head/usr.sbin/pw/tests/crypt.c) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2016 Spectra Logic Corporation + * 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 AUTHORS 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 AUTHORS 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$ + */ + +#include +#include +#include + +int main(int argc, char** argv) +{ + char *salt, *pass, *hash; + + if (argc < 3) + errx(1, "Usage: crypt "); + salt = argv[1]; + pass = argv[2]; + + hash = crypt(pass, salt); + printf("%s", hash); + return (hash == NULL ? 1 : 0); +} Modified: stable/11/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- stable/11/usr.sbin/pw/tests/pw_useradd.sh Mon Sep 12 16:13:27 2016 (r305740) +++ stable/11/usr.sbin/pw/tests/pw_useradd.sh Mon Sep 12 16:28:32 2016 (r305741) @@ -235,9 +235,12 @@ atf_test_case user_add_password_from_h user_add_password_from_h_body() { populate_etc_skel - atf_check -s exit:0 ${PW} useradd test -h 0 <<-EOF - $(echo test) + atf_check -s exit:0 ${PW} useradd foo -h 0 <<-EOF + $(echo mypassword) EOF + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "mypassword" } atf_test_case user_add_R @@ -325,17 +328,47 @@ user_add_already_exists_body() { ${PW} useradd foo } +atf_test_case user_add_w_error +user_add_w_error_body() { + populate_etc_skel + + atf_check -s exit:1 -e match:"pw: Invalid value for default password" \ + ${PW} useradd foo -w invalid_value +} + +atf_test_case user_add_w_no +user_add_w_no_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -w no + atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_add_w_none +user_add_w_none_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -w none + atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_add_w_random +user_add_w_random_body() { + populate_etc_skel + + password=`${PW} useradd foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" +} + atf_test_case user_add_w_yes user_add_w_yes_body() { populate_etc_skel - atf_check -s exit:0 ${PW} useradd foo -w yes - atf_check -s exit:0 \ - -o match:'^foo:\$.*' \ - grep "^foo" ${HOME}/master.passwd - atf_check -s exit:0 ${PW} usermod foo -w yes - atf_check -s exit:0 \ - -o match:'^foo:\$.*' \ - grep "^foo" ${HOME}/master.passwd + password=`${PW} useradd foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" } atf_test_case user_add_with_pw_conf @@ -380,6 +413,10 @@ atf_init_test_cases() { atf_add_test_case user_add_uid_too_large atf_add_test_case user_add_bad_shell atf_add_test_case user_add_already_exists + atf_add_test_case user_add_w_error + atf_add_test_case user_add_w_no + atf_add_test_case user_add_w_none + atf_add_test_case user_add_w_random atf_add_test_case user_add_w_yes atf_add_test_case user_add_with_pw_conf } Modified: stable/11/usr.sbin/pw/tests/pw_usermod.sh ============================================================================== --- stable/11/usr.sbin/pw/tests/pw_usermod.sh Mon Sep 12 16:13:27 2016 (r305740) +++ stable/11/usr.sbin/pw/tests/pw_usermod.sh Mon Sep 12 16:28:32 2016 (r305741) @@ -157,8 +157,9 @@ user_mod_h_body() { atf_check -s exit:0 ${PW} usermod foo -h 0 <<- EOF $(echo a) EOF - atf_check -s exit:0 -o not-match:"^foo:\*:.*" \ - grep "^foo" ${HOME}/master.passwd + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "a" atf_check -s exit:0 ${PW} usermod foo -h - <<- EOF $(echo b) EOF @@ -203,6 +204,56 @@ user_mod_uid_body() { atf_check -s exit:0 ${PW} usermod foo -u 5000 } +atf_test_case user_mod_w_error +user_mod_w_error_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:1 -e match:"pw: Invalid value for default password" \ + ${PW} usermod foo -w invalid_value +} + +atf_test_case user_mod_w_no +user_mod_w_no_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -w no + atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_mod_w_none +user_mod_w_none_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -w none + atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_mod_w_random +user_mod_w_random_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + password=`${PW} usermod foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" +} + +atf_test_case user_mod_w_yes +user_mod_w_yes_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -w yes + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "foo" +} + + atf_init_test_cases() { atf_add_test_case user_mod atf_add_test_case user_mod_noupdate @@ -219,4 +270,9 @@ atf_init_test_cases() { atf_add_test_case user_mod_H atf_add_test_case user_mod_renamehome atf_add_test_case user_mod_uid + atf_add_test_case user_mod_w_error + atf_add_test_case user_mod_w_no + atf_add_test_case user_mod_w_none + atf_add_test_case user_mod_w_random + atf_add_test_case user_mod_w_yes } From owner-svn-src-all@freebsd.org Mon Sep 12 16:36:46 2016 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 2075BBD7D9E; Mon, 12 Sep 2016 16:36:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E50DFF02; Mon, 12 Sep 2016 16:36:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGajVV000648; Mon, 12 Sep 2016 16:36:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGajKm000647; Mon, 12 Sep 2016 16:36:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201609121636.u8CGajKm000647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Sep 2016 16:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305742 - stable/11/etc/periodic/daily X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:36:46 -0000 Author: asomers Date: Mon Sep 12 16:36:44 2016 New Revision: 305742 URL: https://svnweb.freebsd.org/changeset/base/305742 Log: MFC r304162 Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour 24 hours is too long. Periodic scripts are executed serially, so when combined with the sleep in 410.pkg-audit periodic could actually take more than 24 hours and block the next invocation. Modified: stable/11/etc/periodic/daily/480.leapfile-ntpd Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- stable/11/etc/periodic/daily/480.leapfile-ntpd Mon Sep 12 16:28:32 2016 (r305741) +++ stable/11/etc/periodic/daily/480.leapfile-ntpd Mon Sep 12 16:36:44 2016 (r305742) @@ -16,7 +16,7 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd onefetch) & + (sleep $(jot -r 1 0 3600); service ntpd onefetch) & ;; *) service ntpd onefetch From owner-svn-src-all@freebsd.org Mon Sep 12 16:38:53 2016 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 4BE46BD7E30; Mon, 12 Sep 2016 16:38:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29E28108; Mon, 12 Sep 2016 16:38:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGcqXT000808; Mon, 12 Sep 2016 16:38:52 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGcqmD000805; Mon, 12 Sep 2016 16:38:52 GMT (envelope-from br@FreeBSD.org) Message-Id: <201609121638.u8CGcqmD000805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 12 Sep 2016 16:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305743 - in head/sys/mips: malta mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:38:53 -0000 Author: br Date: Mon Sep 12 16:38:51 2016 New Revision: 305743 URL: https://svnweb.freebsd.org/changeset/base/305743 Log: Add SMP support for MTI Malta 34kf CPU. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/mips/malta/asm_malta.S head/sys/mips/malta/malta_mp.c head/sys/mips/mips/locore.S Modified: head/sys/mips/malta/asm_malta.S ============================================================================== --- head/sys/mips/malta/asm_malta.S Mon Sep 12 16:36:44 2016 (r305742) +++ head/sys/mips/malta/asm_malta.S Mon Sep 12 16:38:51 2016 (r305743) @@ -37,6 +37,7 @@ #include #define VPECONF0_MVP (1 << 1) +#define VPECONF0_VPA (1 << 0) .set noreorder @@ -54,16 +55,16 @@ LEAF(platform_processor_id) .set pop END(platform_processor_id) -LEAF(enable_mvp) +LEAF(malta_cpu_configure) .set push .set mips32r2 .set noat - li t2, (VPECONF0_MVP) + li t2, (VPECONF0_MVP | VPECONF0_VPA) move $1, t2 jr ra .word 0x41810000 | (1 << 11) | 2 # mttc0 t2, $1, 2 .set pop -END(enable_mvp) +END(malta_cpu_configure) /* * Called on APs to wait until they are told to launch. Modified: head/sys/mips/malta/malta_mp.c ============================================================================== --- head/sys/mips/malta/malta_mp.c Mon Sep 12 16:36:44 2016 (r305742) +++ head/sys/mips/malta/malta_mp.c Mon Sep 12 16:38:51 2016 (r305743) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #define MALTA_MAXCPU 2 +#define VPECONF0_VPA (1 << 0) +#define MVPCONTROL_VPC (1 << 1) +#define TCSTATUS_A (1 << 13) unsigned malta_ap_boot = ~0; @@ -62,6 +65,19 @@ unsigned malta_ap_boot = ~0; #define C_IRQ5 (1 << 15) static inline void +evpe(void) +{ + __asm __volatile( + " .set push \n" + " .set noreorder \n" + " .set noat \n" + " .set mips32r2 \n" + " .word 0x41600021 # evpe \n" + " ehb \n" + " .set pop \n"); +} + +static inline void ehb(void) { __asm __volatile( @@ -118,25 +134,30 @@ ehb(void) __retval; \ }) -void -platform_ipi_send(int cpuid) +static void +set_thread_context(int cpuid) { uint32_t reg; - /* - * Set thread context. - * Note this is not global, so we don't need lock. - */ reg = read_c0_register32(1, 1); reg &= ~(0xff); reg |= cpuid; write_c0_register32(1, 1, reg); ehb(); +} + +void +platform_ipi_send(int cpuid) +{ + uint32_t reg; + + set_thread_context(cpuid); /* Set cause */ reg = mftc0(13, 0); - mttc0(13, 0, (reg | C_SW1)); + reg |= (C_SW1); + mttc0(13, 0, reg); } void @@ -204,8 +225,42 @@ platform_smp_topo(void) int platform_start_ap(int cpuid) { + uint32_t reg; int timeout; + /* Enter into configuration */ + reg = read_c0_register32(0, 1); + reg |= (MVPCONTROL_VPC); + write_c0_register32(0, 1, reg); + + set_thread_context(cpuid); + + /* + * Hint: how to set entry point. + * reg = 0x80000000; + * mttc0(2, 3, reg); + */ + + /* Enable thread */ + reg = mftc0(2, 1); + reg |= (TCSTATUS_A); + mttc0(2, 1, reg); + + /* Unhalt CPU core */ + mttc0(2, 4, 0); + + /* Activate VPE */ + reg = mftc0(1, 2); + reg |= (VPECONF0_VPA); + mttc0(1, 2, reg); + + /* Out of configuration */ + reg = read_c0_register32(0, 1); + reg &= ~(MVPCONTROL_VPC); + write_c0_register32(0, 1, reg); + + evpe(); + if (atomic_cmpset_32(&malta_ap_boot, ~0, cpuid) == 0) return (-1); Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Mon Sep 12 16:36:44 2016 (r305742) +++ head/sys/mips/mips/locore.S Mon Sep 12 16:38:51 2016 (r305743) @@ -161,7 +161,7 @@ VECTOR(_locore, unknown) #if defined(CPU_MALTA) && defined(SMP) .set push .set mips32r2 - jal enable_mvp + jal malta_cpu_configure nop jal platform_processor_id nop From owner-svn-src-all@freebsd.org Mon Sep 12 16:44:22 2016 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 445A5BD8047; Mon, 12 Sep 2016 16:44:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1204C888; Mon, 12 Sep 2016 16:44:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGiLLR004470; Mon, 12 Sep 2016 16:44:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGiLcs004469; Mon, 12 Sep 2016 16:44:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609121644.u8CGiLcs004469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Sep 2016 16:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305744 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:44:22 -0000 Author: kib Date: Mon Sep 12 16:44:21 2016 New Revision: 305744 URL: https://svnweb.freebsd.org/changeset/base/305744 Log: Fix typo in comment. MFC after: 3 days Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Sep 12 16:38:51 2016 (r305743) +++ head/sys/x86/x86/identcpu.c Mon Sep 12 16:44:21 2016 (r305744) @@ -1725,7 +1725,7 @@ print_AMD_info(void) * As long as that bug pops up very rarely (intensive machine usage * on other operating systems generally generates one unexplainable * crash any 2 months) and as long as a model specific fix would be - * impratical at this stage, print out a warning string if the broken + * impractical at this stage, print out a warning string if the broken * model and family are identified. */ if (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x20 && From owner-svn-src-all@freebsd.org Mon Sep 12 16:46:15 2016 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 92D05BD81AB; Mon, 12 Sep 2016 16:46:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 658ACB27; Mon, 12 Sep 2016 16:46:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGkEuw004616; Mon, 12 Sep 2016 16:46:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGkEck004615; Mon, 12 Sep 2016 16:46:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609121646.u8CGkEck004615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 12 Sep 2016 16:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305745 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:46:15 -0000 Author: avos Date: Mon Sep 12 16:46:14 2016 New Revision: 305745 URL: https://svnweb.freebsd.org/changeset/base/305745 Log: urtwn: fix possible driver hang when beacon miss is detected. Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 (r305744) +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 (r305745) @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); end: - if (error != 0) + if (error != 0) { + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 1); m_freem(m); + } URTWN_UNLOCK(sc); From owner-svn-src-all@freebsd.org Mon Sep 12 16:55:17 2016 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 88BA6BD844B; Mon, 12 Sep 2016 16:55:17 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57F8A2A1; Mon, 12 Sep 2016 16:55:17 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGtGnS009012; Mon, 12 Sep 2016 16:55:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGtGCm009011; Mon, 12 Sep 2016 16:55:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201609121655.u8CGtGCm009011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Sep 2016 16:55:16 +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: r305746 - stable/10/etc/periodic/daily 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 16:55:17 -0000 Author: asomers Date: Mon Sep 12 16:55:16 2016 New Revision: 305746 URL: https://svnweb.freebsd.org/changeset/base/305746 Log: MFC r304162 Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour 24 hours is too long. Periodic scripts are executed serially, so when combined with the sleep in 410.pkg-audit periodic could actually take more than 24 hours and block the next invocation. Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- stable/10/etc/periodic/daily/480.leapfile-ntpd Mon Sep 12 16:46:14 2016 (r305745) +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Mon Sep 12 16:55:16 2016 (r305746) @@ -16,7 +16,7 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd onefetch) & + (sleep $(jot -r 1 0 3600); service ntpd onefetch) & ;; *) service ntpd onefetch From owner-svn-src-all@freebsd.org Mon Sep 12 17:02:24 2016 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 2580BBD870B; Mon, 12 Sep 2016 17:02:24 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF67A4B; Mon, 12 Sep 2016 17:02:23 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CH2Nvj012841; Mon, 12 Sep 2016 17:02:23 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CH2NlB012840; Mon, 12 Sep 2016 17:02:23 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201609121702.u8CH2NlB012840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 12 Sep 2016 17:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305747 - stable/11/cddl/lib/libdtrace X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 17:02:24 -0000 Author: gnn Date: Mon Sep 12 17:02:22 2016 New Revision: 305747 URL: https://svnweb.freebsd.org/changeset/base/305747 Log: MFC: 304825 Unlike Solaris, in FreeBSD p_args can be 0 so check for that instead of walking down to ar_args blindly. Reported by: Amanda Strnad Reviewed by: markj, jhb Sponsored by: DARPA, AFRL Modified: stable/11/cddl/lib/libdtrace/psinfo.d Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/lib/libdtrace/psinfo.d ============================================================================== --- stable/11/cddl/lib/libdtrace/psinfo.d Mon Sep 12 16:55:16 2016 (r305746) +++ stable/11/cddl/lib/libdtrace/psinfo.d Mon Sep 12 17:02:22 2016 (r305747) @@ -59,7 +59,7 @@ translator psinfo_t < struct proc *T > { pr_gid = T->p_ucred->cr_rgid; pr_egid = T->p_ucred->cr_groups[0]; pr_addr = 0; - pr_psargs = (T->p_args->ar_args == 0) ? "" : + pr_psargs = (T->p_args == 0) ? "" : memstr(T->p_args->ar_args, ' ', T->p_args->ar_length); pr_arglen = T->p_args->ar_length; pr_jailid = T->p_ucred->cr_prison->pr_id; From owner-svn-src-all@freebsd.org Mon Sep 12 17:05:43 2016 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 A3AD8BD87DB; Mon, 12 Sep 2016 17:05:43 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F4D7CEB; Mon, 12 Sep 2016 17:05:43 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CH5gpR013165; Mon, 12 Sep 2016 17:05:42 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CH5geS013164; Mon, 12 Sep 2016 17:05:42 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201609121705.u8CH5geS013164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 12 Sep 2016 17:05: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: r305748 - stable/10/cddl/lib/libdtrace 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 17:05:43 -0000 Author: gnn Date: Mon Sep 12 17:05:42 2016 New Revision: 305748 URL: https://svnweb.freebsd.org/changeset/base/305748 Log: MFC: 304825 Unlike Solaris, in FreeBSD p_args can be 0 so check for that instead of walking down to ar_args blindly. Reported by: Amanda Strnad Reviewed by: markj, jhb Sponsored by: DARPA, AFRL Modified: stable/10/cddl/lib/libdtrace/psinfo.d Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/lib/libdtrace/psinfo.d ============================================================================== --- stable/10/cddl/lib/libdtrace/psinfo.d Mon Sep 12 17:02:22 2016 (r305747) +++ stable/10/cddl/lib/libdtrace/psinfo.d Mon Sep 12 17:05:42 2016 (r305748) @@ -57,7 +57,7 @@ translator psinfo_t < struct proc *T > { pr_gid = T->p_ucred->cr_rgid; pr_egid = T->p_ucred->cr_groups[0]; pr_addr = 0; - pr_psargs = (T->p_args->ar_args == 0) ? "" : + pr_psargs = (T->p_args == 0) ? "" : memstr(T->p_args->ar_args, ' ', T->p_args->ar_length); pr_arglen = T->p_args->ar_length; pr_jailid = T->p_ucred->cr_prison->pr_id; From owner-svn-src-all@freebsd.org Mon Sep 12 17:29:22 2016 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 2E8D2BD8141; Mon, 12 Sep 2016 17:29:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3D91272; Mon, 12 Sep 2016 17:29:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CHTLO2021788; Mon, 12 Sep 2016 17:29:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CHTL7K021786; Mon, 12 Sep 2016 17:29:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609121729.u8CHTL7K021786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 12 Sep 2016 17:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305749 - head/sys/dev/evdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 17:29:22 -0000 Author: gonzo Date: Mon Sep 12 17:29:20 2016 New Revision: 305749 URL: https://svnweb.freebsd.org/changeset/base/305749 Log: Remove semicolon from the end of the macro definition Reported by: hans Modified: head/sys/dev/evdev/cdev.c head/sys/dev/evdev/uinput.c Modified: head/sys/dev/evdev/cdev.c ============================================================================== --- head/sys/dev/evdev/cdev.c Mon Sep 12 17:05:42 2016 (r305748) +++ head/sys/dev/evdev/cdev.c Mon Sep 12 17:29:20 2016 (r305749) @@ -49,7 +49,7 @@ #include #ifdef EVDEV_DEBUG -#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args); +#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args) #else #define debugf(client, fmt, args...) #endif Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Mon Sep 12 17:05:42 2016 (r305748) +++ head/sys/dev/evdev/uinput.c Mon Sep 12 17:29:20 2016 (r305749) @@ -50,7 +50,7 @@ #include #ifdef UINPUT_DEBUG -#define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args); +#define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args) #else #define debugf(state, fmt, args...) #endif From owner-svn-src-all@freebsd.org Mon Sep 12 17:35:47 2016 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 48E77BD82D1; Mon, 12 Sep 2016 17:35:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2150590A; Mon, 12 Sep 2016 17:35:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CHZk6n025470; Mon, 12 Sep 2016 17:35:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CHZjmL025463; Mon, 12 Sep 2016 17:35:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201609121735.u8CHZjmL025463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Sep 2016 17:35: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: r305750 - in stable/10/usr.sbin/pw: . 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 17:35:47 -0000 Author: asomers Date: Mon Sep 12 17:35:45 2016 New Revision: 305750 URL: https://svnweb.freebsd.org/changeset/base/305750 Log: MFC r302778 pw should sanitize the argument of -w. Otherwise, it will silently disable the login for the selected account if the argument is unrecognizable. usr.sbin/pw/pw.h usr.sbin/pw/pw_conf.c usr.sbin/pw/pw_user.c Use separate rules to validate boolean parameters and passwd parameters. Error out if a password parameter cannot be parsed. usr.sbin/pw/tests/Makefile usr.sbin/pw/tests/crypt.c usr.sbin/pw/tests/pw_useradd.sh usr.sbin/pw/tests/pw_usermod.sh Add tests for the validation. Also, enhance existing password-related tests to actually validate that the correct hash is written to master.passwd. Added: stable/10/usr.sbin/pw/tests/crypt.c - copied unchanged from r302778, head/usr.sbin/pw/tests/crypt.c Modified: stable/10/usr.sbin/pw/pw.h stable/10/usr.sbin/pw/pw_conf.c stable/10/usr.sbin/pw/pw_user.c stable/10/usr.sbin/pw/tests/Makefile stable/10/usr.sbin/pw/tests/pw_useradd.sh stable/10/usr.sbin/pw/tests/pw_usermod.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw.h ============================================================================== --- stable/10/usr.sbin/pw/pw.h Mon Sep 12 17:29:20 2016 (r305749) +++ stable/10/usr.sbin/pw/pw.h Mon Sep 12 17:35:45 2016 (r305750) @@ -93,6 +93,7 @@ int groupadd(struct userconf *, char *na int nis_update(void); int boolean_val(char const * str, int dflt); +int passwd_val(char const * str, int dflt); char const *boolean_str(int val); char *newstr(char const * p); Modified: stable/10/usr.sbin/pw/pw_conf.c ============================================================================== --- stable/10/usr.sbin/pw/pw_conf.c Mon Sep 12 17:29:20 2016 (r305749) +++ stable/10/usr.sbin/pw/pw_conf.c Mon Sep 12 17:35:45 2016 (r305750) @@ -186,6 +186,22 @@ boolean_val(char const * str, int dflt) for (i = 0; boolfalse[i]; i++) if (strcmp(str, boolfalse[i]) == 0) return 0; + } + return dflt; +} + +int +passwd_val(char const * str, int dflt) +{ + if ((str = unquote(str)) != NULL) { + int i; + + for (i = 0; booltrue[i]; i++) + if (strcmp(str, booltrue[i]) == 0) + return 1; + for (i = 0; boolfalse[i]; i++) + if (strcmp(str, boolfalse[i]) == 0) + return 0; /* * Special cases for defaultpassword @@ -194,6 +210,8 @@ boolean_val(char const * str, int dflt) return -1; if (strcmp(str, "none") == 0) return -2; + + errx(1, "Invalid value for default password"); } return dflt; } @@ -258,7 +276,7 @@ read_userconfig(char const * file) #endif switch (i) { case _UC_DEFAULTPWD: - config.default_password = boolean_val(q, 1); + config.default_password = passwd_val(q, 1); break; case _UC_REUSEUID: config.reuse_uids = boolean_val(q, 0); Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Mon Sep 12 17:29:20 2016 (r305749) +++ stable/10/usr.sbin/pw/pw_user.c Mon Sep 12 17:35:45 2016 (r305750) @@ -1317,7 +1317,7 @@ pw_user_add(int argc, char **argv, char mix_config(cmdcnf, cnf); if (default_passwd) - cmdcnf->default_password = boolean_val(default_passwd, + cmdcnf->default_password = passwd_val(default_passwd, cnf->default_password); if (genconf) { if (name != NULL) @@ -1719,7 +1719,7 @@ pw_user_mod(int argc, char **argv, char if (lc == NULL || login_setcryptfmt(lc, "sha512", NULL) == NULL) warn("setting crypt(3) format"); login_close(lc); - cnf->default_password = boolean_val(passwd, + cnf->default_password = passwd_val(passwd, cnf->default_password); pwd->pw_passwd = pw_password(cnf, pwd->pw_name, dryrun); edited = true; Modified: stable/10/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/10/usr.sbin/pw/tests/Makefile Mon Sep 12 17:29:20 2016 (r305749) +++ stable/10/usr.sbin/pw/tests/Makefile Mon Sep 12 17:35:45 2016 (r305750) @@ -2,6 +2,11 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw +BINDIR= ${TESTSDIR} + +PROGS+= crypt +LDADD+= -lcrypt + ATF_TESTS_SH= pw_etcdir \ pw_lock \ pw_config \ Copied: stable/10/usr.sbin/pw/tests/crypt.c (from r302778, head/usr.sbin/pw/tests/crypt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/crypt.c Mon Sep 12 17:35:45 2016 (r305750, copy of r302778, head/usr.sbin/pw/tests/crypt.c) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2016 Spectra Logic Corporation + * 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 AUTHORS 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 AUTHORS 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$ + */ + +#include +#include +#include + +int main(int argc, char** argv) +{ + char *salt, *pass, *hash; + + if (argc < 3) + errx(1, "Usage: crypt "); + salt = argv[1]; + pass = argv[2]; + + hash = crypt(pass, salt); + printf("%s", hash); + return (hash == NULL ? 1 : 0); +} Modified: stable/10/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- stable/10/usr.sbin/pw/tests/pw_useradd.sh Mon Sep 12 17:29:20 2016 (r305749) +++ stable/10/usr.sbin/pw/tests/pw_useradd.sh Mon Sep 12 17:35:45 2016 (r305750) @@ -235,9 +235,12 @@ atf_test_case user_add_password_from_h user_add_password_from_h_body() { populate_etc_skel - atf_check -s exit:0 ${PW} useradd test -h 0 <<-EOF - $(echo test) + atf_check -s exit:0 ${PW} useradd foo -h 0 <<-EOF + $(echo mypassword) EOF + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "mypassword" } atf_test_case user_add_R @@ -325,17 +328,47 @@ user_add_already_exists_body() { ${PW} useradd foo } +atf_test_case user_add_w_error +user_add_w_error_body() { + populate_etc_skel + + atf_check -s exit:1 -e match:"pw: Invalid value for default password" \ + ${PW} useradd foo -w invalid_value +} + +atf_test_case user_add_w_no +user_add_w_no_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -w no + atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_add_w_none +user_add_w_none_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -w none + atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_add_w_random +user_add_w_random_body() { + populate_etc_skel + + password=`${PW} useradd foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" +} + atf_test_case user_add_w_yes user_add_w_yes_body() { populate_etc_skel - atf_check -s exit:0 ${PW} useradd foo -w yes - atf_check -s exit:0 \ - -o match:'^foo:\$.*' \ - grep "^foo" ${HOME}/master.passwd - atf_check -s exit:0 ${PW} usermod foo -w yes - atf_check -s exit:0 \ - -o match:'^foo:\$.*' \ - grep "^foo" ${HOME}/master.passwd + password=`${PW} useradd foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" } atf_test_case user_add_with_pw_conf @@ -380,6 +413,10 @@ atf_init_test_cases() { atf_add_test_case user_add_uid_too_large atf_add_test_case user_add_bad_shell atf_add_test_case user_add_already_exists + atf_add_test_case user_add_w_error + atf_add_test_case user_add_w_no + atf_add_test_case user_add_w_none + atf_add_test_case user_add_w_random atf_add_test_case user_add_w_yes atf_add_test_case user_add_with_pw_conf } Modified: stable/10/usr.sbin/pw/tests/pw_usermod.sh ============================================================================== --- stable/10/usr.sbin/pw/tests/pw_usermod.sh Mon Sep 12 17:29:20 2016 (r305749) +++ stable/10/usr.sbin/pw/tests/pw_usermod.sh Mon Sep 12 17:35:45 2016 (r305750) @@ -157,8 +157,9 @@ user_mod_h_body() { atf_check -s exit:0 ${PW} usermod foo -h 0 <<- EOF $(echo a) EOF - atf_check -s exit:0 -o not-match:"^foo:\*:.*" \ - grep "^foo" ${HOME}/master.passwd + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "a" atf_check -s exit:0 ${PW} usermod foo -h - <<- EOF $(echo b) EOF @@ -203,6 +204,56 @@ user_mod_uid_body() { atf_check -s exit:0 ${PW} usermod foo -u 5000 } +atf_test_case user_mod_w_error +user_mod_w_error_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:1 -e match:"pw: Invalid value for default password" \ + ${PW} usermod foo -w invalid_value +} + +atf_test_case user_mod_w_no +user_mod_w_no_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -w no + atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_mod_w_none +user_mod_w_none_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -w none + atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_mod_w_random +user_mod_w_random_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + password=`${PW} usermod foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" +} + +atf_test_case user_mod_w_yes +user_mod_w_yes_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -w yes + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "foo" +} + + atf_init_test_cases() { atf_add_test_case user_mod atf_add_test_case user_mod_noupdate @@ -219,4 +270,9 @@ atf_init_test_cases() { atf_add_test_case user_mod_H atf_add_test_case user_mod_renamehome atf_add_test_case user_mod_uid + atf_add_test_case user_mod_w_error + atf_add_test_case user_mod_w_no + atf_add_test_case user_mod_w_none + atf_add_test_case user_mod_w_random + atf_add_test_case user_mod_w_yes } From owner-svn-src-all@freebsd.org Mon Sep 12 18:06:43 2016 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 BDF48BD8AB8; Mon, 12 Sep 2016 18:06:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76B54DBD; Mon, 12 Sep 2016 18:06:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CI6glJ037491; Mon, 12 Sep 2016 18:06:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CI6gqg037489; Mon, 12 Sep 2016 18:06:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609121806.u8CI6gqg037489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 12 Sep 2016 18:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305751 - in head: share/man/man9 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 18:06:43 -0000 Author: jhb Date: Mon Sep 12 18:06:42 2016 New Revision: 305751 URL: https://svnweb.freebsd.org/changeset/base/305751 Log: Make device_quiet() an attachment property. In particular, reset the DF_QUIET flag when detaching from a device so that a driver that marks a device quiet doesn't dictate policy for a different driver that may claim the device in the future. Reviewed by: rpokala, wblock MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7803 Modified: head/share/man/man9/device_quiet.9 head/sys/kern/subr_bus.c Modified: head/share/man/man9/device_quiet.9 ============================================================================== --- head/share/man/man9/device_quiet.9 Mon Sep 12 17:35:45 2016 (r305750) +++ head/share/man/man9/device_quiet.9 Mon Sep 12 18:06:42 2016 (r305751) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 1999 +.Dd September 12, 2016 .Dt DEVICE_QUIET 9 .Os .Sh NAME @@ -49,16 +49,18 @@ Each device has a quiet flag associated with it. A device is verbose by default when it is created but may be quieted to prevent -the device identification string to be printed during probe. +printing of the device identification string during attach +and printing of a message during detach. To quiet a device, call -.Fn device_quiet , -to re-enable to probe message (to make the message appear again, for -example after a -.Xr device_detach 9 ) +.Fn device_quiet +during a device driver probe routine. +To re-enable probe messages, call .Fn device_verbose . To test to see if a device is quieted, call .Fn device_is_quiet . +.Pp +Devices are implicitly marked verbose after a driver detaches. .Sh SEE ALSO .Xr device 9 .Sh AUTHORS Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Sep 12 17:35:45 2016 (r305750) +++ head/sys/kern/subr_bus.c Mon Sep 12 18:06:42 2016 (r305751) @@ -2146,6 +2146,12 @@ device_probe_child(device_t dev, device_ } /* + * Reset DF_QUIET in case this driver doesn't + * end up as the best driver. + */ + device_verbose(child); + + /* * Probes that return BUS_PROBE_NOWILDCARD or lower * only match on devices whose driver was explicitly * specified. @@ -2970,6 +2976,7 @@ device_detach(device_t dev) if (!(dev->flags & DF_FIXEDCLASS)) devclass_delete_device(dev->devclass, dev); + device_verbose(dev); dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); From owner-svn-src-all@freebsd.org Mon Sep 12 18:07:08 2016 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 05308BD8B28; Mon, 12 Sep 2016 18:07:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA146C6; Mon, 12 Sep 2016 18:07:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CI776N037559; Mon, 12 Sep 2016 18:07:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CI77ER037558; Mon, 12 Sep 2016 18:07:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609121807.u8CI77ER037558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 12 Sep 2016 18:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305752 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 18:07:08 -0000 Author: jhb Date: Mon Sep 12 18:07:06 2016 New Revision: 305752 URL: https://svnweb.freebsd.org/changeset/base/305752 Log: Remove explicit device_verbose() from the t4iov driver detach routine now that this case is handled generically. Modified: head/sys/dev/cxgbe/t4_iov.c Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Mon Sep 12 18:06:42 2016 (r305751) +++ head/sys/dev/cxgbe/t4_iov.c Mon Sep 12 18:07:06 2016 (r305752) @@ -217,7 +217,6 @@ t4iov_detach(device_t dev) if (error) return (error); } - device_verbose(dev); return (0); } From owner-svn-src-all@freebsd.org Mon Sep 12 18:10:56 2016 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 7E31FBD8CAC; Mon, 12 Sep 2016 18:10:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47907756; Mon, 12 Sep 2016 18:10:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-oi0-x230.google.com with SMTP id q188so211619884oia.3; Mon, 12 Sep 2016 11:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6VIFyNiCfTw1hnrk3+y50gARArdpNVDsmXbQWobkLl0=; b=bO4qPXI00O8TagvFxOEJxsJJwDs8A5ZyoxaprSQr3O3NQTKP0wH3pa5BdemXXq4OXM +cTzmCfl1dh/QkPTq+xr0YGWXTyCixhSbQicPejWzd32OVJc7k3Llcx0N9W8weZ6/y8F F5LDkB7rTHRVplVP30+qlCZyiqW/fjA6bDfEKxHTE0HYbIa0cukpQtoeksqDAbZGOSFx 1d5a10QSREAmJkgN6eMrHIx6GmZHqsrhbx4nI3I/puzQQli+BHWleihhMFhKG8AnawcU FNXAM3g0+1ukZXv4McSa5N7IO7Z1az+/2e7s0xCYrqgUkOFT9uMf05jKmbdeGqjfnMBa HZFA== 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:from:date :message-id:subject:to:cc; bh=6VIFyNiCfTw1hnrk3+y50gARArdpNVDsmXbQWobkLl0=; b=C8X2xuzGs9R7ZAKT4AP1iSYWYQwE+LmYBjSi7G5U3b/K8CGx6UnxO/m/QwRALq2MLq jT6qoHXjUDtclQ2m4fj3pDY6Jlo0dC21eWgWb0ilGmiI18ojgajb8+XgRHufBSw45Gll XO2y7RpsITpMngmP1ZARQyXkfhHdoZsHCgzbD/SF75u5v8RXdb16MzBnWWnejUeN+Ugt 7WZgOrExkwpyBOSeYL8PZYVgDZDJGacj7rXzeMMt/Q4NdjL5rDJGCQEJZRsyiz9NVlyX 4g+K/uUfw+FB28VNr6NQkCsq4QKKpX4hMD5FEjsShPT41rdf8IaE32vuVN8OpQCB9zIO gpMw== X-Gm-Message-State: AE9vXwNDT0M7v51lpt+ew9w2AhTUXb521/6wII+/OoWfwj/XrU62tud2/5D8xzk3rkR7uXhhObd0pffI742FQA== X-Received: by 10.202.87.76 with SMTP id l73mr440432oib.84.1473703855172; Mon, 12 Sep 2016 11:10:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Mon, 12 Sep 2016 11:10:54 -0700 (PDT) In-Reply-To: <201609121646.u8CGkEck004615@repo.freebsd.org> References: <201609121646.u8CGkEck004615@repo.freebsd.org> From: Adrian Chadd Date: Mon, 12 Sep 2016 11:10:54 -0700 Message-ID: Subject: Re: svn commit: r305745 - head/sys/dev/urtwn To: Andriy Voskoboinyk 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 18:10:56 -0000 Hi, That's why I created ieee80211_tx_complete(). Is that not "right" here? -a On 12 September 2016 at 09:46, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon Sep 12 16:46:14 2016 > New Revision: 305745 > URL: https://svnweb.freebsd.org/changeset/base/305745 > > Log: > urtwn: fix possible driver hang when beacon miss is detected. > > Modified: > head/sys/dev/urtwn/if_urtwn.c > > Modified: head/sys/dev/urtwn/if_urtwn.c > ============================================================================== > --- head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 (r305744) > +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 (r305745) > @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni > callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); > > end: > - if (error != 0) > + if (error != 0) { > + if (m->m_flags & M_TXCB) > + ieee80211_process_callback(ni, m, 1); > m_freem(m); > + } > > URTWN_UNLOCK(sc); > > From owner-svn-src-all@freebsd.org Mon Sep 12 18:41:18 2016 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 D479FBD872B; Mon, 12 Sep 2016 18:41:18 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (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 64ED3BF8; Mon, 12 Sep 2016 18:41:18 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f46.google.com with SMTP id h127so94397595lfh.0; Mon, 12 Sep 2016 11:41:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=BefrUrcfXp3noE+gyd3qDc6vj89Ka3W40Nz9tmMJ1I0=; b=JQbzMwdoJ9rJYropKBn6ll4mmcZoPGRHo4JOpgtYcKX3hjMOmSfi4h0zbUe36Mg6ss dq7e8aBqEc+cTkeMRUd1gQoHSyiYDWyGJW0Q6UwPxuBKa6t/Z7vvgmK5OLmxWuwJkfE6 Gc4yI/EuOq6GmTZoKaJmI2Z0bW/szEAHmDOMa6FvPA4KXaq/luHQi3FYIltQ0wIMPOPk YjLoWx6vlN/EBsIK/if+q/jbFL3IcRUHtRz64EtXOTadEVsuA+vGUgwMLw/KZrRYW1Fz XOgbhqXo9j0OQF4vQQjwwevN+TJH/pq4P/j8cU1+ulO+HKlD9ccsBBLC+CTQx+4e4jJX y08g== X-Gm-Message-State: AE9vXwNF3EI+WZOOce8UGio4gWS+kqZJb/FUZLnjcX11aeYUAnYLlx6ybtdPSo57+CsbUg== X-Received: by 10.25.215.35 with SMTP id o35mr6363466lfg.40.1473705675914; Mon, 12 Sep 2016 11:41:15 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id r196sm3251952lfd.41.2016.09.12.11.41.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Sep 2016 11:41:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r305745 - head/sys/dev/urtwn References: <201609121646.u8CGkEck004615@repo.freebsd.org> Date: Mon, 12 Sep 2016 21:40:54 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 18:41:18 -0000 Mon, 12 Sep 2016 21:10:54 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : Hi, The error handling is splitted between ieee80211_raw_output() and = ic_raw_xmit(); it cannot be moved completely to net80211 because of https://lists.freebsd.org/pipermail/freebsd-wireless/2015-November/00627= 2.html > Hi, > > That's why I created ieee80211_tx_complete(). Is that not "right" here= ? > > > > -a > > > On 12 September 2016 at 09:46, Andriy Voskoboinyk = > wrote: >> Author: avos >> Date: Mon Sep 12 16:46:14 2016 >> New Revision: 305745 >> URL: https://svnweb.freebsd.org/changeset/base/305745 >> >> Log: >> urtwn: fix possible driver hang when beacon miss is detected. >> >> Modified: >> head/sys/dev/urtwn/if_urtwn.c >> >> Modified: head/sys/dev/urtwn/if_urtwn.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 = = >> (r305744) >> +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 = = >> (r305745) >> @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni >> callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); >> >> end: >> - if (error !=3D 0) >> + if (error !=3D 0) { >> + if (m->m_flags & M_TXCB) >> + ieee80211_process_callback(ni, m, 1); >> m_freem(m); >> + } >> >> URTWN_UNLOCK(sc); >> From owner-svn-src-all@freebsd.org Mon Sep 12 19:31:16 2016 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 05769BD84B8; Mon, 12 Sep 2016 19:31:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58B9A91; Mon, 12 Sep 2016 19:31:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CJVFIg070881; Mon, 12 Sep 2016 19:31:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CJVF2k070880; Mon, 12 Sep 2016 19:31:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201609121931.u8CJVF2k070880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 12 Sep 2016 19:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305753 - head/usr.sbin/amd/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 19:31:16 -0000 Author: cy Date: Mon Sep 12 19:31:14 2016 New Revision: 305753 URL: https://svnweb.freebsd.org/changeset/base/305753 Log: Fixup whitespace, repace space with a tab. X-MFC-with: Upcoming amd update. Modified: head/usr.sbin/amd/amd/Makefile Modified: head/usr.sbin/amd/amd/Makefile ============================================================================== --- head/usr.sbin/amd/amd/Makefile Mon Sep 12 18:07:06 2016 (r305752) +++ head/usr.sbin/amd/amd/Makefile Mon Sep 12 19:31:14 2016 (r305753) @@ -8,7 +8,7 @@ .include -.PATH: ${.CURDIR}/../../../contrib/amd/amd +.PATH: ${.CURDIR}/../../../contrib/amd/amd PROG= amd MAN= amd.8 From owner-svn-src-all@freebsd.org Mon Sep 12 20:35:57 2016 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 683D3BD8790; Mon, 12 Sep 2016 20:35:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::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 30E3F86F; Mon, 12 Sep 2016 20:35:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x232.google.com with SMTP id 186so27971475itf.0; Mon, 12 Sep 2016 13:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TjE5xudLs/08O7nNzSYpSdyjONVLUM+vIZElrmL7aeE=; b=DHSj5oQ4D5k3J3/K54YSnzOJ66wJiMZkYWki1On2E6hrLz/VjEYlkYpUE5ThDAyp9F zF7ocfjrNkGSqEEYho2+lKTWcFnGwnijahb/rqkoGFvH71i0OFAMj8EVmfDiYmVe5h+P HP6m37eT7mkZQ0YEdQYx8uSsNjHiJyAKWbOxFKgGRC0/oSCOuSrc4X1AN2r9ZQsNjJvH nHfbyzzCchEVgz5NzSFlVPWpSYwHzGKezfnXFGr3nTi0Xqu99Np9yLuB33fHVhabhKzA pr88cyoWFwJ2O2PwyEH8DDFeFipCtjJlMsbWLCRpo1Iq0LWrcQR6b9trJX768+jZWuGp YSmA== 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:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TjE5xudLs/08O7nNzSYpSdyjONVLUM+vIZElrmL7aeE=; b=OyUaRJ/IEn2fZJVFexLWLMn3Tf+tA2s5ZxO9AESTrPPV6wrKVZ9Y/JUHg9FxIMiH/Q MODQedHZTkQEExszv25W2GJ1t4sZcP02xuoTmqG8kJirUtTQPLQ7UdFPu5xhdA+X8gOZ Gbl/ypDUxHBpqI2VYml/ffeQbJQ4FLBkL+oqhygCPi3g+KTYwYkSI+L696mXDZQmRmuZ 1LU6ye+ZBYxXwSE7ELcTwNqWcYn9qaoNwauGoCsNIzn/kea8qhY7d23Z3WEadZNKGIO7 dH8imr2uxMpBXVuqSqojccJat8FAWq18MMKEyxALyLUd22YHOkeavVg6f4U0D7TcsvAv OcIw== X-Gm-Message-State: AE9vXwOJNXE8DcqOIMHzneFPG04/4lBCt/HHTui0fFeRyJ5Z6rnX0isetvBJDLqmGgbAzRcb3I4npmEj/SqhYQ== X-Received: by 10.157.57.137 with SMTP id y9mr28521858otb.21.1473712556260; Mon, 12 Sep 2016 13:35:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Mon, 12 Sep 2016 13:35:55 -0700 (PDT) In-Reply-To: References: <201609121646.u8CGkEck004615@repo.freebsd.org> From: Adrian Chadd Date: Mon, 12 Sep 2016 13:35:55 -0700 Message-ID: Subject: Re: svn commit: r305745 - head/sys/dev/urtwn To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 20:35:57 -0000 Ah, ugh, that thing.. :( -adrian On 12 September 2016 at 11:40, Andriy Voskoboinyk wrote: > Mon, 12 Sep 2016 21:10:54 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd > : > > Hi, > > The error handling is splitted between ieee80211_raw_output() and > ic_raw_xmit(); > it cannot be moved completely to net80211 because of > https://lists.freebsd.org/pipermail/freebsd-wireless/2015-November/006272= .html > > >> Hi, >> >> That's why I created ieee80211_tx_complete(). Is that not "right" here? >> >> >> >> -a >> >> >> On 12 September 2016 at 09:46, Andriy Voskoboinyk >> wrote: >>> >>> Author: avos >>> Date: Mon Sep 12 16:46:14 2016 >>> New Revision: 305745 >>> URL: https://svnweb.freebsd.org/changeset/base/305745 >>> >>> Log: >>> urtwn: fix possible driver hang when beacon miss is detected. >>> >>> Modified: >>> head/sys/dev/urtwn/if_urtwn.c >>> >>> Modified: head/sys/dev/urtwn/if_urtwn.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 >>> (r305744) >>> +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 >>> (r305745) >>> @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni >>> callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); >>> >>> end: >>> - if (error !=3D 0) >>> + if (error !=3D 0) { >>> + if (m->m_flags & M_TXCB) >>> + ieee80211_process_callback(ni, m, 1); >>> m_freem(m); >>> + } >>> >>> URTWN_UNLOCK(sc); >>> > From owner-svn-src-all@freebsd.org Mon Sep 12 22:07:01 2016 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 A2A13BD70D7; Mon, 12 Sep 2016 22:07:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7337689E; Mon, 12 Sep 2016 22:07:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CM70Qh029676; Mon, 12 Sep 2016 22:07:00 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CM70Lv029670; Mon, 12 Sep 2016 22:07:00 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609122207.u8CM70Lv029670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 12 Sep 2016 22:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305754 - in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 22:07:01 -0000 Author: mm Date: Mon Sep 12 22:07:00 2016 New Revision: 305754 URL: https://svnweb.freebsd.org/changeset/base/305754 Log: MFC r305422: Sync libarchive with vendor Vendor issues fixed: PR #777: Multiple bugfixes for setup_acls() This includes a bugfix for a bug that caused ACLs not to be read properly for files and directories inside subdirectories and as a result not being stored or being incorrectly stored in tar archives. Added: stable/11/contrib/libarchive/README.md - copied unchanged from r305422, head/contrib/libarchive/README.md Deleted: stable/11/contrib/libarchive/README Modified: stable/11/contrib/libarchive/libarchive/archive_acl.c stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/11/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c stable/11/lib/libarchive/config_freebsd.h Directory Properties: stable/11/ (props changed) Copied: stable/11/contrib/libarchive/README.md (from r305422, head/contrib/libarchive/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/README.md Mon Sep 12 22:07:00 2016 (r305754, copy of r305422, head/contrib/libarchive/README.md) @@ -0,0 +1,222 @@ +# Welcome to libarchive! + +The libarchive project develops a portable, efficient C library that +can read and write streaming archives in a variety of formats. It +also includes implementations of the common `tar`, `cpio`, and `zcat` +command-line tools that use the libarchive library. + +## Questions? Issues? + +* http://www.libarchive.org is the home for ongoing + libarchive development, including documentation, + and links to the libarchive mailing lists. +* To report an issue, use the issue tracker at + https://github.com/libarchive/libarchive/issues +* To submit an enhancement to libarchive, please + submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls + +## Contents of the Distribution + +This distribution bundle includes the following major components: + +* **libarchive**: a library for reading and writing streaming archives +* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive +* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality +* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **examples**: Some small example programs that you may find useful. +* **examples/minitar**: a compact sample demonstrating use of libarchive. +* **contrib**: Various items sent to me by third parties; please contact the authors with any questions. + +The top-level directory contains the following information files: + +* **NEWS** - highlights of recent changes +* **COPYING** - what you can do with this +* **INSTALL** - installation instructions +* **README** - this file +* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL +* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`). + +The following files in the top-level directory are used by the 'configure' script: +* `Makefile.am`, `aclocal.m4`, `configure.ac` - used to build this distribution, only needed by maintainers +* `Makefile.in`, `config.h.in` - templates used by configure script + +## Documentation + +In addition to the informational articles and documentation +in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki), +the distribution also includes a number of manual pages: + + * bsdtar.1 explains the use of the bsdtar program + * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program + * libarchive.3 gives an overview of the library as a whole + * archive_read.3, archive_write.3, archive_write_disk.3, and + archive_read_disk.3 provide detailed calling sequences for the read + and write APIs + * archive_entry.3 details the "struct archive_entry" utility class + * archive_internals.3 provides some insight into libarchive's + internal structure and operation. + * libarchive-formats.5 documents the file formats supported by the library + * cpio.5, mtree.5, and tar.5 provide detailed information about these + popular archive formats, including hard-to-find details about + modern cpio and tar variants. + +The manual pages above are provided in the 'doc' directory in +a number of different formats. + +You should also read the copious comments in `archive.h` and the +source code for the sample programs for more details. Please let us +know about any errors or omissions you find. + +## Supported Formats + +Currently, the library automatically detects and reads the following fomats: + * Old V7 tar archives + * POSIX ustar + * GNU tar format (including GNU long filenames, long link names, and sparse files) + * Solaris 9 extended tar format (including ACLs) + * POSIX pax interchange format + * POSIX octet-oriented cpio + * SVR4 ASCII cpio + * POSIX octet-oriented cpio + * Binary cpio (big-endian or little-endian) + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) + * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * GNU and BSD 'ar' archives + * 'mtree' format + * 7-Zip archives + * Microsoft CAB format + * LHA and LZH archives + * RAR archives (with some limitations due to RAR's proprietary status) + * XAR archives + +The library also detects and handles any of the following before evaluating the archive: + * uuencoded files + * files with RPM wrapper + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + +The library can create archives in any of the following formats: + * POSIX ustar + * POSIX pax interchange format + * "restricted" pax format, which will create ustar archives except for + entries that require pax extensions (for long filenames, ACLs, etc). + * Old GNU tar format + * Old V7 tar format + * POSIX octet-oriented cpio + * SVR4 "newc" cpio + * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * ISO9660 format + * 7-Zip archives + * XAR archives + +When creating archives, the result can be filtered with any of the following: + * uuencode + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + +## Notes about the Library Design + +The following notes address many of the most common +questions we are asked about libarchive: + +* This is a heavily stream-oriented system. That means that + it is optimized to read or write the archive in a single + pass from beginning to end. For example, this allows + libarchive to process archives too large to store on disk + by processing them on-the-fly as they are read from or + written to a network or tape drive. This also makes + libarchive useful for tools that need to produce + archives on-the-fly (such as webservers that provide + archived contents of a users account). + +* In-place modification and random access to the contents + of an archive are not directly supported. For some formats, + this is not an issue: For example, tar.gz archives are not + designed for random access. In some other cases, libarchive + can re-open an archive and scan it from the beginning quickly + enough to provide the needed abilities even without true + random access. Of course, some applications do require true + random access; those applications should consider alternatives + to libarchive. + +* The library is designed to be extended with new compression and + archive formats. The only requirement is that the format be + readable or writable as a stream and that each archive entry be + independent. There are articles on the libarchive Wiki explaining + how to extend libarchive. + +* On read, compression and format are always detected automatically. + +* The same API is used for all formats; in particular, it's very + easy for software using libarchive to transparently handle + any of libarchive's archiving formats. + +* Libarchive's automatic support for decompression can be used + without archiving by explicitly selecting the "raw" and "empty" + formats. + +* I've attempted to minimize static link pollution. If you don't + explicitly invoke a particular feature (such as support for a + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. + +* The library is generally _thread safe_ depending on the platform: + it does not define any global variables of its own. However, some + platforms do not provide fully thread-safe versions of key C library + functions. On those platforms, libarchive will use the non-thread-safe + functions. Patches to improve this are of great interest to us. + +* In particular, libarchive's modules to read or write a directory + tree do use `chdir()` to optimize the directory traversals. This + can cause problems for programs that expect to do disk access from + multiple threads. Of course, those modules are completely + optional and you can use the rest of libarchive without them. + +* The library is _not_ thread aware, however. It does no locking + or thread management of any kind. If you create a libarchive + object and need to access it from multiple threads, you will + need to provide your own locking. + +* On read, the library accepts whatever blocks you hand it. + Your read callback is free to pass the library a byte at a time + or mmap the entire archive and give it to the library at once. + On write, the library always produces correctly-blocked output. + +* The object-style approach allows you to have multiple archive streams + open at once. bsdtar uses this in its "@archive" extension. + +* The archive itself is read/written using callback functions. + You can read an archive directly from an in-memory buffer or + write it to a socket, if you wish. There are some utility + functions to provide easy-to-use "open file," etc, capabilities. + +* The read/write APIs are designed to allow individual entries + to be read or written to any data source: You can create + a block of data in memory and add it to a tar archive without + first writing a temporary file. You can also read an entry from + an archive and write the data directly to a socket. If you want + to read/write entries to disk, there are convenience functions to + make this especially easy. + +* Note: The "pax interchange format" is a POSIX standard extended tar + format that should be used when the older _ustar_ format is not + appropriate. It has many advantages over other tar formats + (including the legacy GNU tar format) and is widely supported by + current tar implementations. + Modified: stable/11/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_acl.c Mon Sep 12 19:31:14 2016 (r305753) +++ stable/11/contrib/libarchive/libarchive/archive_acl.c Mon Sep 12 22:07:00 2016 (r305754) @@ -707,10 +707,11 @@ archive_acl_text_l(struct archive_acl *a if (r != 0) return (-1); *p++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { id = ap->id; - else + } else { id = -1; + } append_entry(&p, NULL, ap->tag, name, ap->permset, id); count++; Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Mon Sep 12 19:31:14 2016 (r305753) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Mon Sep 12 22:07:00 2016 (r305754) @@ -419,12 +419,32 @@ setup_acls(struct archive_read_disk *a, if (accpath == NULL) accpath = archive_entry_pathname(entry); + if (*fd < 0 && a->tree != NULL) { + if (a->follow_symlinks || + archive_entry_filetype(entry) != AE_IFLNK) + *fd = a->open_on_current_dir(a->tree, + accpath, O_RDONLY | O_NONBLOCK); + if (*fd < 0) { + if (a->tree_enter_working_dir(a->tree) != 0) { + archive_set_error(&a->archive, errno, + "Couldn't access %s", accpath); + return (ARCHIVE_FAILED); + } + } + } + archive_entry_acl_clear(entry); + acl = NULL; + #ifdef ACL_TYPE_NFS4 /* Try NFS4 ACL first. */ if (*fd >= 0) +#if HAVE_ACL_GET_FD_NP + acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4); +#else acl = acl_get_fd(*fd); +#endif #if HAVE_ACL_GET_LINK_NP else if (!a->follow_symlinks) acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); @@ -437,12 +457,19 @@ setup_acls(struct archive_read_disk *a, #endif else acl = acl_get_file(accpath, ACL_TYPE_NFS4); + #if HAVE_ACL_IS_TRIVIAL_NP - /* Ignore "trivial" ACLs that just mirror the file mode. */ - acl_is_trivial_np(acl, &r); - if (r) { - acl_free(acl); - acl = NULL; + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (r) { + acl_free(acl); + acl = NULL; + /* + * Simultaneous NFSv4 and POSIX.1e ACLs for the same + * entry are not allowed, so we should return here + */ + return (ARCHIVE_OK); + } } #endif if (acl != NULL) { @@ -450,7 +477,7 @@ setup_acls(struct archive_read_disk *a, acl_free(acl); return (ARCHIVE_OK); } -#endif +#endif /* ACL_TYPE_NFS4 */ /* Retrieve access ACL from file. */ if (*fd >= 0) @@ -467,10 +494,22 @@ setup_acls(struct archive_read_disk *a, #endif else acl = acl_get_file(accpath, ACL_TYPE_ACCESS); + +#if HAVE_ACL_IS_TRIVIAL_NP + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { + if (r) { + acl_free(acl); + acl = NULL; + } + } +#endif + if (acl != NULL) { translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); + acl = NULL; } /* Only directories can have default ACLs. */ Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon Sep 12 19:31:14 2016 (r305753) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon Sep 12 22:07:00 2016 (r305754) @@ -1504,10 +1504,19 @@ setup_current_filesystem(struct archive_ struct tree *t = a->tree; struct statfs sfs; #if defined(HAVE_GETVFSBYNAME) && defined(VFCF_SYNTHETIC) -# if defined(HAVE_STRUCT_VFSCONF) - struct vfsconf vfc; -# else +/* TODO: configure should set GETVFSBYNAME_ARG_TYPE to make + * this accurate; some platforms have both and we need the one that's + * used by getvfsbyname() + * + * Then the following would become: + * #if defined(GETVFSBYNAME_ARG_TYPE) + * GETVFSBYNAME_ARG_TYPE vfc; + * #endif + */ +# if defined(HAVE_STRUCT_XVFSCONF) struct xvfsconf vfc; +# else + struct vfsconf vfc; # endif #endif int r, xr = 0; Modified: stable/11/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Mon Sep 12 19:31:14 2016 (r305753) +++ stable/11/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Mon Sep 12 22:07:00 2016 (r305754) @@ -70,15 +70,9 @@ set_acls(struct archive_entry *ae, struc } static int -acl_match(acl_entry_t aclent, struct myacl_t *myacl) -{ - gid_t g, *gp; - uid_t u, *up; - acl_tag_t tag_type; - acl_permset_t opaque_ps; +acl_entry_get_perm(acl_entry_t aclent) { int permset = 0; - - acl_get_tag_type(aclent, &tag_type); + acl_permset_t opaque_ps; /* translate the silly opaque permset to a bitmap */ acl_get_permset(aclent, &opaque_ps); @@ -88,10 +82,61 @@ acl_match(acl_entry_t aclent, struct mya permset |= ARCHIVE_ENTRY_ACL_WRITE; if (acl_get_perm_np(opaque_ps, ACL_READ)) permset |= ARCHIVE_ENTRY_ACL_READ; + return permset; +} + +#if 0 +static int +acl_get_specific_entry(acl_t acl, acl_tag_t requested_tag_type, int requested_tag) { + int entry_id = ACL_FIRST_ENTRY; + acl_entry_t acl_entry; + acl_tag_t acl_tag_type; + + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* If this matches, return perm mask */ + acl_get_tag_type(acl_entry, &acl_tag_type); + if (acl_tag_type == requested_tag_type) { + switch (acl_tag_type) { + case ACL_USER_OBJ: + if ((uid_t)requested_tag == *(uid_t *)(acl_get_qualifier(acl_entry))) { + return acl_entry_get_perm(acl_entry); + } + break; + case ACL_GROUP_OBJ: + if ((gid_t)requested_tag == *(gid_t *)(acl_get_qualifier(acl_entry))) { + return acl_entry_get_perm(acl_entry); + } + break; + case ACL_USER: + case ACL_GROUP: + case ACL_OTHER: + return acl_entry_get_perm(acl_entry); + default: + failure("Unexpected ACL tag type"); + assert(0); + } + } + - if (permset != myacl->permset) + } + return -1; +} +#endif + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + gid_t g, *gp; + uid_t u, *up; + acl_tag_t tag_type; + + if (myacl->permset != acl_entry_get_perm(aclent)) return (0); + acl_get_tag_type(aclent, &tag_type); switch (tag_type) { case ACL_USER_OBJ: if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); @@ -190,7 +235,7 @@ compare_acls(acl_t acl, struct myacl_t * * Verify ACL restore-to-disk. This test is FreeBSD-specific. */ -DEFINE_TEST(test_acl_freebsd_posix1e) +DEFINE_TEST(test_acl_freebsd_posix1e_restore) { #if !defined(__FreeBSD__) skipping("FreeBSD-specific ACL restore test"); @@ -263,3 +308,111 @@ DEFINE_TEST(test_acl_freebsd_posix1e) acl_free(acl); #endif } + +/* + * Verify ACL reaed-from-disk. This test is FreeBSD-specific. + */ +DEFINE_TEST(test_acl_freebsd_posix1e_read) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL read test"); +#elif __FreeBSD__ < 5 + skipping("ACL read supported only on FreeBSD 5.0 and later"); +#else + struct archive *a; + struct archive_entry *ae; + int n, fd; + const char *acl1_text, *acl2_text; + acl_t acl1, acl2; + + /* + * Manually construct a directory and two files with + * different ACLs. This also serves to verify that ACLs + * are supported on the local filesystem. + */ + + /* Create a test file f1 with acl1 */ + acl1_text = "user::rwx,group::rwx,other::rwx,user:1:rw-,group:15:r-x,mask::rwx"; + acl1 = acl_from_text(acl1_text); + assert((void *)acl1 != NULL); + fd = open("f1", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl1); + return; + } + n = acl_set_fd(fd, acl1); + acl_free(acl1); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + assertMakeDir("d", 0700); + + /* + * Create file d/f1 with acl2 + * + * This differs from acl1 in the u:1: and g:15: permissions. + * + * This file deliberately has the same name but a different ACL. + * Github Issue #777 explains how libarchive's directory traversal + * did not always correctly enter directories before attempting + * to read ACLs, resulting in reading the ACL from a like-named + * file in the wrong directory. + */ + acl2_text = "user::rwx,group::rwx,other::---,user:1:r--,group:15:r--,mask::rwx"; + acl2 = acl_from_text(acl2_text); + assert((void *)acl2 != NULL); + fd = open("d/f1", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl2); + return; + } + n = acl_set_fd(fd, acl2); + acl_free(acl2); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + /* Create a read-from-disk object. */ + assert(NULL != (a = archive_read_disk_new())); + assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, ".")); + assert(NULL != (ae = archive_entry_new())); + + /* Walk the dir until we see both of the files */ + while (ARCHIVE_OK == archive_read_next_header2(a, ae)) { + archive_read_disk_descend(a); + if (strcmp(archive_entry_pathname(ae), "./f1") == 0) { + assertEqualString(archive_entry_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), acl1_text); + + } else if (strcmp(archive_entry_pathname(ae), "./d/f1") == 0) { + assertEqualString(archive_entry_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), acl2_text); + } + } + + archive_free(a); +#endif +} Modified: stable/11/lib/libarchive/config_freebsd.h ============================================================================== --- stable/11/lib/libarchive/config_freebsd.h Mon Sep 12 19:31:14 2016 (r305753) +++ stable/11/lib/libarchive/config_freebsd.h Mon Sep 12 22:07:00 2016 (r305754) @@ -30,6 +30,7 @@ /* FreeBSD 5.0 and later have ACL and extattr support. */ #if __FreeBSD__ > 4 #define HAVE_ACL_CREATE_ENTRY 1 +#define HAVE_ACL_GET_FD_NP 1 #define HAVE_ACL_GET_LINK_NP 1 #define HAVE_ACL_GET_PERM_NP 1 #define HAVE_ACL_INIT 1 @@ -45,6 +46,7 @@ #define HAVE_EXTATTR_LIST_FILE 1 #define HAVE_EXTATTR_SET_FD 1 #define HAVE_EXTATTR_SET_FILE 1 +#define HAVE_STRUCT_XVFSCONF 1 #define HAVE_SYS_ACL_H 1 #define HAVE_SYS_EXTATTR_H 1 #endif From owner-svn-src-all@freebsd.org Mon Sep 12 22:07:37 2016 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 50AACBD713B; Mon, 12 Sep 2016 22:07:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21B7B9ED; Mon, 12 Sep 2016 22:07:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CM7aSL029754; Mon, 12 Sep 2016 22:07:36 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CM7ZaV029748; Mon, 12 Sep 2016 22:07:35 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609122207.u8CM7ZaV029748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 12 Sep 2016 22:07: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: r305755 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 22:07:37 -0000 Author: mm Date: Mon Sep 12 22:07:35 2016 New Revision: 305755 URL: https://svnweb.freebsd.org/changeset/base/305755 Log: MFC r305422: Sync libarchive with vendor Vendor issues fixed: PR #777: Multiple bugfixes for setup_acls() This includes a bugfix for a bug that caused ACLs not to be read properly for files and directories inside subdirectories and as a result not being stored or being incorrectly stored in tar archives. Added: stable/10/contrib/libarchive/README.md - copied unchanged from r305422, head/contrib/libarchive/README.md Deleted: stable/10/contrib/libarchive/README Modified: stable/10/contrib/libarchive/libarchive/archive_acl.c stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/10/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c stable/10/lib/libarchive/config_freebsd.h Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/libarchive/README.md (from r305422, head/contrib/libarchive/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/README.md Mon Sep 12 22:07:35 2016 (r305755, copy of r305422, head/contrib/libarchive/README.md) @@ -0,0 +1,222 @@ +# Welcome to libarchive! + +The libarchive project develops a portable, efficient C library that +can read and write streaming archives in a variety of formats. It +also includes implementations of the common `tar`, `cpio`, and `zcat` +command-line tools that use the libarchive library. + +## Questions? Issues? + +* http://www.libarchive.org is the home for ongoing + libarchive development, including documentation, + and links to the libarchive mailing lists. +* To report an issue, use the issue tracker at + https://github.com/libarchive/libarchive/issues +* To submit an enhancement to libarchive, please + submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls + +## Contents of the Distribution + +This distribution bundle includes the following major components: + +* **libarchive**: a library for reading and writing streaming archives +* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive +* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality +* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **examples**: Some small example programs that you may find useful. +* **examples/minitar**: a compact sample demonstrating use of libarchive. +* **contrib**: Various items sent to me by third parties; please contact the authors with any questions. + +The top-level directory contains the following information files: + +* **NEWS** - highlights of recent changes +* **COPYING** - what you can do with this +* **INSTALL** - installation instructions +* **README** - this file +* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL +* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`). + +The following files in the top-level directory are used by the 'configure' script: +* `Makefile.am`, `aclocal.m4`, `configure.ac` - used to build this distribution, only needed by maintainers +* `Makefile.in`, `config.h.in` - templates used by configure script + +## Documentation + +In addition to the informational articles and documentation +in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki), +the distribution also includes a number of manual pages: + + * bsdtar.1 explains the use of the bsdtar program + * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program + * libarchive.3 gives an overview of the library as a whole + * archive_read.3, archive_write.3, archive_write_disk.3, and + archive_read_disk.3 provide detailed calling sequences for the read + and write APIs + * archive_entry.3 details the "struct archive_entry" utility class + * archive_internals.3 provides some insight into libarchive's + internal structure and operation. + * libarchive-formats.5 documents the file formats supported by the library + * cpio.5, mtree.5, and tar.5 provide detailed information about these + popular archive formats, including hard-to-find details about + modern cpio and tar variants. + +The manual pages above are provided in the 'doc' directory in +a number of different formats. + +You should also read the copious comments in `archive.h` and the +source code for the sample programs for more details. Please let us +know about any errors or omissions you find. + +## Supported Formats + +Currently, the library automatically detects and reads the following fomats: + * Old V7 tar archives + * POSIX ustar + * GNU tar format (including GNU long filenames, long link names, and sparse files) + * Solaris 9 extended tar format (including ACLs) + * POSIX pax interchange format + * POSIX octet-oriented cpio + * SVR4 ASCII cpio + * POSIX octet-oriented cpio + * Binary cpio (big-endian or little-endian) + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) + * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * GNU and BSD 'ar' archives + * 'mtree' format + * 7-Zip archives + * Microsoft CAB format + * LHA and LZH archives + * RAR archives (with some limitations due to RAR's proprietary status) + * XAR archives + +The library also detects and handles any of the following before evaluating the archive: + * uuencoded files + * files with RPM wrapper + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + +The library can create archives in any of the following formats: + * POSIX ustar + * POSIX pax interchange format + * "restricted" pax format, which will create ustar archives except for + entries that require pax extensions (for long filenames, ACLs, etc). + * Old GNU tar format + * Old V7 tar format + * POSIX octet-oriented cpio + * SVR4 "newc" cpio + * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * ISO9660 format + * 7-Zip archives + * XAR archives + +When creating archives, the result can be filtered with any of the following: + * uuencode + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + +## Notes about the Library Design + +The following notes address many of the most common +questions we are asked about libarchive: + +* This is a heavily stream-oriented system. That means that + it is optimized to read or write the archive in a single + pass from beginning to end. For example, this allows + libarchive to process archives too large to store on disk + by processing them on-the-fly as they are read from or + written to a network or tape drive. This also makes + libarchive useful for tools that need to produce + archives on-the-fly (such as webservers that provide + archived contents of a users account). + +* In-place modification and random access to the contents + of an archive are not directly supported. For some formats, + this is not an issue: For example, tar.gz archives are not + designed for random access. In some other cases, libarchive + can re-open an archive and scan it from the beginning quickly + enough to provide the needed abilities even without true + random access. Of course, some applications do require true + random access; those applications should consider alternatives + to libarchive. + +* The library is designed to be extended with new compression and + archive formats. The only requirement is that the format be + readable or writable as a stream and that each archive entry be + independent. There are articles on the libarchive Wiki explaining + how to extend libarchive. + +* On read, compression and format are always detected automatically. + +* The same API is used for all formats; in particular, it's very + easy for software using libarchive to transparently handle + any of libarchive's archiving formats. + +* Libarchive's automatic support for decompression can be used + without archiving by explicitly selecting the "raw" and "empty" + formats. + +* I've attempted to minimize static link pollution. If you don't + explicitly invoke a particular feature (such as support for a + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. + +* The library is generally _thread safe_ depending on the platform: + it does not define any global variables of its own. However, some + platforms do not provide fully thread-safe versions of key C library + functions. On those platforms, libarchive will use the non-thread-safe + functions. Patches to improve this are of great interest to us. + +* In particular, libarchive's modules to read or write a directory + tree do use `chdir()` to optimize the directory traversals. This + can cause problems for programs that expect to do disk access from + multiple threads. Of course, those modules are completely + optional and you can use the rest of libarchive without them. + +* The library is _not_ thread aware, however. It does no locking + or thread management of any kind. If you create a libarchive + object and need to access it from multiple threads, you will + need to provide your own locking. + +* On read, the library accepts whatever blocks you hand it. + Your read callback is free to pass the library a byte at a time + or mmap the entire archive and give it to the library at once. + On write, the library always produces correctly-blocked output. + +* The object-style approach allows you to have multiple archive streams + open at once. bsdtar uses this in its "@archive" extension. + +* The archive itself is read/written using callback functions. + You can read an archive directly from an in-memory buffer or + write it to a socket, if you wish. There are some utility + functions to provide easy-to-use "open file," etc, capabilities. + +* The read/write APIs are designed to allow individual entries + to be read or written to any data source: You can create + a block of data in memory and add it to a tar archive without + first writing a temporary file. You can also read an entry from + an archive and write the data directly to a socket. If you want + to read/write entries to disk, there are convenience functions to + make this especially easy. + +* Note: The "pax interchange format" is a POSIX standard extended tar + format that should be used when the older _ustar_ format is not + appropriate. It has many advantages over other tar formats + (including the legacy GNU tar format) and is widely supported by + current tar implementations. + Modified: stable/10/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_acl.c Mon Sep 12 22:07:00 2016 (r305754) +++ stable/10/contrib/libarchive/libarchive/archive_acl.c Mon Sep 12 22:07:35 2016 (r305755) @@ -707,10 +707,11 @@ archive_acl_text_l(struct archive_acl *a if (r != 0) return (-1); *p++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { id = ap->id; - else + } else { id = -1; + } append_entry(&p, NULL, ap->tag, name, ap->permset, id); count++; Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Mon Sep 12 22:07:00 2016 (r305754) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Mon Sep 12 22:07:35 2016 (r305755) @@ -419,12 +419,32 @@ setup_acls(struct archive_read_disk *a, if (accpath == NULL) accpath = archive_entry_pathname(entry); + if (*fd < 0 && a->tree != NULL) { + if (a->follow_symlinks || + archive_entry_filetype(entry) != AE_IFLNK) + *fd = a->open_on_current_dir(a->tree, + accpath, O_RDONLY | O_NONBLOCK); + if (*fd < 0) { + if (a->tree_enter_working_dir(a->tree) != 0) { + archive_set_error(&a->archive, errno, + "Couldn't access %s", accpath); + return (ARCHIVE_FAILED); + } + } + } + archive_entry_acl_clear(entry); + acl = NULL; + #ifdef ACL_TYPE_NFS4 /* Try NFS4 ACL first. */ if (*fd >= 0) +#if HAVE_ACL_GET_FD_NP + acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4); +#else acl = acl_get_fd(*fd); +#endif #if HAVE_ACL_GET_LINK_NP else if (!a->follow_symlinks) acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); @@ -437,12 +457,19 @@ setup_acls(struct archive_read_disk *a, #endif else acl = acl_get_file(accpath, ACL_TYPE_NFS4); + #if HAVE_ACL_IS_TRIVIAL_NP - /* Ignore "trivial" ACLs that just mirror the file mode. */ - acl_is_trivial_np(acl, &r); - if (r) { - acl_free(acl); - acl = NULL; + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (r) { + acl_free(acl); + acl = NULL; + /* + * Simultaneous NFSv4 and POSIX.1e ACLs for the same + * entry are not allowed, so we should return here + */ + return (ARCHIVE_OK); + } } #endif if (acl != NULL) { @@ -450,7 +477,7 @@ setup_acls(struct archive_read_disk *a, acl_free(acl); return (ARCHIVE_OK); } -#endif +#endif /* ACL_TYPE_NFS4 */ /* Retrieve access ACL from file. */ if (*fd >= 0) @@ -467,10 +494,22 @@ setup_acls(struct archive_read_disk *a, #endif else acl = acl_get_file(accpath, ACL_TYPE_ACCESS); + +#if HAVE_ACL_IS_TRIVIAL_NP + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) { + if (r) { + acl_free(acl); + acl = NULL; + } + } +#endif + if (acl != NULL) { translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); + acl = NULL; } /* Only directories can have default ACLs. */ Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon Sep 12 22:07:00 2016 (r305754) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon Sep 12 22:07:35 2016 (r305755) @@ -1504,10 +1504,19 @@ setup_current_filesystem(struct archive_ struct tree *t = a->tree; struct statfs sfs; #if defined(HAVE_GETVFSBYNAME) && defined(VFCF_SYNTHETIC) -# if defined(HAVE_STRUCT_VFSCONF) - struct vfsconf vfc; -# else +/* TODO: configure should set GETVFSBYNAME_ARG_TYPE to make + * this accurate; some platforms have both and we need the one that's + * used by getvfsbyname() + * + * Then the following would become: + * #if defined(GETVFSBYNAME_ARG_TYPE) + * GETVFSBYNAME_ARG_TYPE vfc; + * #endif + */ +# if defined(HAVE_STRUCT_XVFSCONF) struct xvfsconf vfc; +# else + struct vfsconf vfc; # endif #endif int r, xr = 0; Modified: stable/10/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Mon Sep 12 22:07:00 2016 (r305754) +++ stable/10/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Mon Sep 12 22:07:35 2016 (r305755) @@ -70,15 +70,9 @@ set_acls(struct archive_entry *ae, struc } static int -acl_match(acl_entry_t aclent, struct myacl_t *myacl) -{ - gid_t g, *gp; - uid_t u, *up; - acl_tag_t tag_type; - acl_permset_t opaque_ps; +acl_entry_get_perm(acl_entry_t aclent) { int permset = 0; - - acl_get_tag_type(aclent, &tag_type); + acl_permset_t opaque_ps; /* translate the silly opaque permset to a bitmap */ acl_get_permset(aclent, &opaque_ps); @@ -88,10 +82,61 @@ acl_match(acl_entry_t aclent, struct mya permset |= ARCHIVE_ENTRY_ACL_WRITE; if (acl_get_perm_np(opaque_ps, ACL_READ)) permset |= ARCHIVE_ENTRY_ACL_READ; + return permset; +} + +#if 0 +static int +acl_get_specific_entry(acl_t acl, acl_tag_t requested_tag_type, int requested_tag) { + int entry_id = ACL_FIRST_ENTRY; + acl_entry_t acl_entry; + acl_tag_t acl_tag_type; + + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* If this matches, return perm mask */ + acl_get_tag_type(acl_entry, &acl_tag_type); + if (acl_tag_type == requested_tag_type) { + switch (acl_tag_type) { + case ACL_USER_OBJ: + if ((uid_t)requested_tag == *(uid_t *)(acl_get_qualifier(acl_entry))) { + return acl_entry_get_perm(acl_entry); + } + break; + case ACL_GROUP_OBJ: + if ((gid_t)requested_tag == *(gid_t *)(acl_get_qualifier(acl_entry))) { + return acl_entry_get_perm(acl_entry); + } + break; + case ACL_USER: + case ACL_GROUP: + case ACL_OTHER: + return acl_entry_get_perm(acl_entry); + default: + failure("Unexpected ACL tag type"); + assert(0); + } + } + - if (permset != myacl->permset) + } + return -1; +} +#endif + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + gid_t g, *gp; + uid_t u, *up; + acl_tag_t tag_type; + + if (myacl->permset != acl_entry_get_perm(aclent)) return (0); + acl_get_tag_type(aclent, &tag_type); switch (tag_type) { case ACL_USER_OBJ: if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); @@ -190,7 +235,7 @@ compare_acls(acl_t acl, struct myacl_t * * Verify ACL restore-to-disk. This test is FreeBSD-specific. */ -DEFINE_TEST(test_acl_freebsd_posix1e) +DEFINE_TEST(test_acl_freebsd_posix1e_restore) { #if !defined(__FreeBSD__) skipping("FreeBSD-specific ACL restore test"); @@ -263,3 +308,111 @@ DEFINE_TEST(test_acl_freebsd_posix1e) acl_free(acl); #endif } + +/* + * Verify ACL reaed-from-disk. This test is FreeBSD-specific. + */ +DEFINE_TEST(test_acl_freebsd_posix1e_read) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL read test"); +#elif __FreeBSD__ < 5 + skipping("ACL read supported only on FreeBSD 5.0 and later"); +#else + struct archive *a; + struct archive_entry *ae; + int n, fd; + const char *acl1_text, *acl2_text; + acl_t acl1, acl2; + + /* + * Manually construct a directory and two files with + * different ACLs. This also serves to verify that ACLs + * are supported on the local filesystem. + */ + + /* Create a test file f1 with acl1 */ + acl1_text = "user::rwx,group::rwx,other::rwx,user:1:rw-,group:15:r-x,mask::rwx"; + acl1 = acl_from_text(acl1_text); + assert((void *)acl1 != NULL); + fd = open("f1", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl1); + return; + } + n = acl_set_fd(fd, acl1); + acl_free(acl1); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + assertMakeDir("d", 0700); + + /* + * Create file d/f1 with acl2 + * + * This differs from acl1 in the u:1: and g:15: permissions. + * + * This file deliberately has the same name but a different ACL. + * Github Issue #777 explains how libarchive's directory traversal + * did not always correctly enter directories before attempting + * to read ACLs, resulting in reading the ACL from a like-named + * file in the wrong directory. + */ + acl2_text = "user::rwx,group::rwx,other::---,user:1:r--,group:15:r--,mask::rwx"; + acl2 = acl_from_text(acl2_text); + assert((void *)acl2 != NULL); + fd = open("d/f1", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl2); + return; + } + n = acl_set_fd(fd, acl2); + acl_free(acl2); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + /* Create a read-from-disk object. */ + assert(NULL != (a = archive_read_disk_new())); + assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, ".")); + assert(NULL != (ae = archive_entry_new())); + + /* Walk the dir until we see both of the files */ + while (ARCHIVE_OK == archive_read_next_header2(a, ae)) { + archive_read_disk_descend(a); + if (strcmp(archive_entry_pathname(ae), "./f1") == 0) { + assertEqualString(archive_entry_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), acl1_text); + + } else if (strcmp(archive_entry_pathname(ae), "./d/f1") == 0) { + assertEqualString(archive_entry_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS), acl2_text); + } + } + + archive_free(a); +#endif +} Modified: stable/10/lib/libarchive/config_freebsd.h ============================================================================== --- stable/10/lib/libarchive/config_freebsd.h Mon Sep 12 22:07:00 2016 (r305754) +++ stable/10/lib/libarchive/config_freebsd.h Mon Sep 12 22:07:35 2016 (r305755) @@ -28,6 +28,7 @@ /* FreeBSD 5.0 and later have ACL and extattr support. */ #if __FreeBSD__ > 4 #define HAVE_ACL_CREATE_ENTRY 1 +#define HAVE_ACL_GET_FD_NP 1 #define HAVE_ACL_GET_LINK_NP 1 #define HAVE_ACL_GET_PERM_NP 1 #define HAVE_ACL_INIT 1 @@ -43,6 +44,7 @@ #define HAVE_EXTATTR_LIST_FILE 1 #define HAVE_EXTATTR_SET_FD 1 #define HAVE_EXTATTR_SET_FILE 1 +#define HAVE_STRUCT_XVFSCONF 1 #define HAVE_SYS_ACL_H 1 #define HAVE_SYS_EXTATTR_H 1 #endif From owner-svn-src-all@freebsd.org Mon Sep 12 22:46:21 2016 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 42128BD7849; Mon, 12 Sep 2016 22:46:21 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 065DF981; Mon, 12 Sep 2016 22:46:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CMkKNG044445; Mon, 12 Sep 2016 22:46:20 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CMkKoI044443; Mon, 12 Sep 2016 22:46:20 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201609122246.u8CMkKoI044443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Sep 2016 22:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305756 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 22:46:21 -0000 Author: oshogbo Date: Mon Sep 12 22:46:19 2016 New Revision: 305756 URL: https://svnweb.freebsd.org/changeset/base/305756 Log: fd: add fget_cap and fget_cap_locked primitives They can be used to obtain capabilities along with a referenced fp. Reviewed by: mjg@ Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Sep 12 22:07:35 2016 (r305755) +++ head/sys/kern/kern_descrip.c Mon Sep 12 22:46:19 2016 (r305756) @@ -2446,6 +2446,77 @@ finit(struct file *fp, u_int flag, short } int +fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp) +{ + struct filedescent *fde; + int error; + + FILEDESC_LOCK_ASSERT(fdp); + + fde = fdeget_locked(fdp, fd); + if (fde == NULL) { + error = EBADF; + goto out; + } + +#ifdef CAPABILITIES + error = cap_check(cap_rights_fde(fde), needrightsp); + if (error != 0) + goto out; +#endif + + if (havecapsp != NULL) + filecaps_copy(&fde->fde_caps, havecapsp, true); + + fhold(fde->fde_file); + *fpp = fde->fde_file; + + error = 0; +out: + return (error); +} + +int +fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp) +{ + struct filedesc *fdp; + struct file *fp; + int error; + seq_t seq; + + fdp = td->td_proc->p_fd; + for (;;) { + error = fget_unlocked(fdp, fd, needrightsp, &fp, &seq); + if (error != 0) + return (error); + + if (havecapsp != NULL) { + if (!filecaps_copy(&fdp->fd_ofiles[fd].fde_caps, + havecapsp, false)) { + fdrop(fp, td); + goto get_locked; + } + } + + if (!fd_modified(fdp, fd, seq)) + break; + fdrop(fp, td); + } + + *fpp = fp; + return (0); + +get_locked: + FILEDESC_SLOCK(fdp); + error = fget_cap_locked(fdp, fd, needrightsp, fpp, havecapsp); + FILEDESC_SUNLOCK(fdp); + + return (error); +} + +int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seq_t *seqp) { Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Mon Sep 12 22:07:35 2016 (r305755) +++ head/sys/sys/filedesc.h Mon Sep 12 22:46:19 2016 (r305756) @@ -190,6 +190,11 @@ int getvnode(struct thread *td, int fd, struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); +int fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp); +int fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp); + /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seq_t *seqp); From owner-svn-src-all@freebsd.org Mon Sep 12 23:00:32 2016 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 EE55FBD7B04; Mon, 12 Sep 2016 23:00:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDE22ED3; Mon, 12 Sep 2016 23:00:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CN0WSr048600; Mon, 12 Sep 2016 23:00:32 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CN0W88048599; Mon, 12 Sep 2016 23:00:32 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609122300.u8CN0W88048599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 12 Sep 2016 23:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305757 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2016 23:00:33 -0000 Author: avos Date: Mon Sep 12 23:00:31 2016 New Revision: 305757 URL: https://svnweb.freebsd.org/changeset/base/305757 Log: net80211: fix possible panic in adhoc mode (INIT -> RUN state transition). In case if there is already running interface, a second non-sta interface will omit scanning, going directly to RUN state. Handle this case for adhoc mode appropriately. Tested with RTL8821AU, 2 vaps in IBSS mode. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Sep 12 22:46:19 2016 (r305756) +++ head/sys/net80211/ieee80211_adhoc.c Mon Sep 12 23:00:31 2016 (r305757) @@ -215,6 +215,19 @@ adhoc_newstate(struct ieee80211vap *vap, /* XXX validate prerequisites */ } switch (ostate) { + case IEEE80211_S_INIT: + /* + * Already have a channel; bypass the + * scan and startup immediately. + * Note that ieee80211_create_ibss will call + * back to do a RUN->RUN state change. + */ + ieee80211_create_ibss(vap, + ieee80211_ht_adjust_channel(ic, + ic->ic_curchan, vap->iv_flags_ht)); + /* NB: iv_bss is changed on return */ + ni = vap->iv_bss; + break; case IEEE80211_S_SCAN: #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap)) { From owner-svn-src-all@freebsd.org Tue Sep 13 01:21:27 2016 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 602A5BD775A; Tue, 13 Sep 2016 01:21:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x22a.google.com (mail-vk0-x22a.google.com [IPv6:2607:f8b0:400c:c05::22a]) (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 172DDCEC; Tue, 13 Sep 2016 01:21:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x22a.google.com with SMTP id v189so159560511vkv.1; Mon, 12 Sep 2016 18:21:27 -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; bh=XCr+jeLrl2VPUuXQDl8zmSQfc6tN19XsuVBlZ+lUkJY=; b=RbYbKBXMWcjOsa1FV2Qc7+MRlCQGyz65jicJlKlEVsF2OQCijyTLLfaR6T+XkWnXAb vX1QSDZwJEyenrt2VhimbQP+PYJokmMmgkS+7T0YxawVdduSGUZrhejI8pwAWsq4ouNJ lXQALdCWPjWyokXU6WNlJUtSx6X4KJ6Lu2KgY6clb7tRbTYkUhpSHNCa5aTSjiWsLNF+ len4NoczEt6cS7D28Bzmr6wLRSyi5zRHi7FtYnSwi3n60XdCAaSLQPlBtpV9AsSo7n6D UBPIaUGKzXmpN6EO2NWihWMsrgGJsfGb12ajgah6VTaoroDMlGKC9EB9dy6UXBSJ3iPA ZysQ== 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:from :date:message-id:subject:to:cc; bh=XCr+jeLrl2VPUuXQDl8zmSQfc6tN19XsuVBlZ+lUkJY=; b=GFuTppgL/vakZNi40Ps2Hke5pcLvSXaGcwITwbOz9VeUAPQMXGW/K2cHCY4BDaICC0 Cc2QZjpq0pOflQWMzaKY/vDeUDjkgeAn43H81bcV3AdyY0dqa5OzVsWKJA+OQatqzGjf JmhD0vFF3HjzIanP5jddXHLGiGN0Y4G28XMABKwRZvshTIHC/c1Gu1thJFoXNCM7e2Tk UdKNOr+lWDI86dAcL8bv+UTHKYtsJ6PPqxKnRwz8fAc2jsfv5OuPy48s78ELn13pLEMy AIVSmwhdJTEc1+K/oLN8vARE1CDettww+jNdTP2h5HkgNiAVGcEC6ShgII8OVxSQxu3I tf1A== X-Gm-Message-State: AE9vXwOgjDf5Nrs7a25IZDN0bPHtLlthsVMfSozzRLvcfc2htsEbqpd042mxB2eM77kgkFQAlyM6ekVofeAYxg== X-Received: by 10.31.65.210 with SMTP id o201mr12195322vka.0.1473729686220; Mon, 12 Sep 2016 18:21:26 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Mon, 12 Sep 2016 18:21:25 -0700 (PDT) In-Reply-To: <20160912100003.GX38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> <20160912100003.GX38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 09:21:25 +0800 X-Google-Sender-Auth: SW23PSrQB-LdPTsukKQnraRj6qs Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 01:21:27 -0000 On Mon, Sep 12, 2016 at 6:00 PM, Konstantin Belousov wrote: > On Mon, Sep 12, 2016 at 04:47:35PM +0800, Sepherosa Ziehau wrote: >> On Mon, Sep 12, 2016 at 4:39 PM, Sepherosa Ziehau wrote: >> > On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov >> > wrote: >> >> On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: >> >>> Author: sephe >> >>> Date: Mon Sep 12 04:57:58 2016 >> >>> New Revision: 305722 >> >>> URL: https://svnweb.freebsd.org/changeset/base/305722 >> >>> >> >>> Log: >> >>> x86: Use sx lock for interrupt sources. >> >>> >> >>> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long >> >>> call chain. For msi_assign_cpu, mutex makes complex PCI bridge >> >>> drivers more tricky, e.g. sleep can note be called, etc, it will >> >>> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI >> >>> pass-through. >> >> >> >>> - It is not used on any hot code path nor non-sleepable context, so >> >>> sx should have the same effect as mutex. >> >> Did you tested ACPI_DMAR interrupt remapping mode with your patch and >> >> witness enabled ? >> > >> > Nope, I am about to try it now. BTW, I just checked the code for >> > ACPI_DMAR, I didn't see anything obviously w/ the lock type change >> > though. >> >> I didn't notice anything wrong w/ options >> ACPI_DMAR+WITNESS+INVARIANTS. If you saw anything wrong, please let >> me know. > > Options are not enough, you should explicitely enable interrupt remapping > with loader tunable hw.dmar.ir=1. Still didn't find anything wrong with this tunable set. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Tue Sep 13 02:18:30 2016 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 AEBEABD8A03; Tue, 13 Sep 2016 02:18:30 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70EF917BE; Tue, 13 Sep 2016 02:18:30 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D2ITrn023138; Tue, 13 Sep 2016 02:18:29 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D2ITdv023137; Tue, 13 Sep 2016 02:18:29 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201609130218.u8D2ITdv023137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Tue, 13 Sep 2016 02:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305758 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 02:18:30 -0000 Author: wblock (doc committer) Date: Tue Sep 13 02:18:29 2016 New Revision: 305758 URL: https://svnweb.freebsd.org/changeset/base/305758 Log: Add another badly-needed simple example to the pw(8) man page. Modified: head/usr.sbin/pw/pw.8 Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Mon Sep 12 23:00:31 2016 (r305757) +++ head/usr.sbin/pw/pw.8 Tue Sep 13 02:18:29 2016 (r305758) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2016 +.Dd September 12, 2016 .Dt PW 8 .Os .Sh NAME @@ -966,6 +966,11 @@ Finally, a random password is generated .Bd -literal -offset indent pw useradd -n gsmith -c "Glurmo Smith" -s /bin/csh -m -w random .Ed +.Pp +Delete the gsmith user and their home directory, including contents. +.Bd -literal -offset indent +pw userdel -n gsmith -r +.Ed .Sh EXIT STATUS The .Nm From owner-svn-src-all@freebsd.org Tue Sep 13 05:22:09 2016 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 E2938BD831D; Tue, 13 Sep 2016 05:22:09 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE490BF1; Tue, 13 Sep 2016 05:22:09 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5M8nc095171; Tue, 13 Sep 2016 05:22:08 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5M8Md095170; Tue, 13 Sep 2016 05:22:08 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201609130522.u8D5M8Md095170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 13 Sep 2016 05:22: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: r305759 - stable/10 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 05:22:10 -0000 Author: lwhsu (ports committer) Date: Tue Sep 13 05:22:08 2016 New Revision: 305759 URL: https://svnweb.freebsd.org/changeset/base/305759 Log: MFC r303935 Only remove empty directories before packaging. This preserves files are intentionally empty, most of them are in tests.txz Reviewed by: bdrewery Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Sep 13 02:18:29 2016 (r305758) +++ stable/10/Makefile.inc1 Tue Sep 13 05:22:08 2016 (r305759) @@ -882,7 +882,7 @@ distributeworld installworld: _installch ${IMAKEENV} rm -rf ${INSTALLTMP} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} - find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete + find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete .endfor .if defined(NO_ROOT) .for dist in base ${EXTRA_DISTRIBUTIONS} From owner-svn-src-all@freebsd.org Tue Sep 13 05:27:38 2016 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 5CEB7BD85DE; Tue, 13 Sep 2016 05:27:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB0DE33; Tue, 13 Sep 2016 05:27:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5RbOE095382; Tue, 13 Sep 2016 05:27:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5RbZh095380; Tue, 13 Sep 2016 05:27:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609130527.u8D5RbZh095380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 05:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305760 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 05:27:38 -0000 Author: sephe Date: Tue Sep 13 05:27:36 2016 New Revision: 305760 URL: https://svnweb.freebsd.org/changeset/base/305760 Log: hyperv/hn: Reorganize channel attach/detach code. This paves the way for further attach/detach code reorganization. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7858 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Sep 13 05:22:08 2016 (r305759) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Sep 13 05:27:36 2016 (r305760) @@ -582,11 +582,6 @@ hv_nv_on_device_remove(struct hn_softc * { hv_nv_disconnect_from_vsp(sc); - - /* Now, we can close the channel safely */ - - vmbus_chan_close(sc->hn_prichan); - return (0); } Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:22:08 2016 (r305759) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:27:36 2016 (r305760) @@ -345,8 +345,11 @@ static int hn_create_rx_data(struct hn_s static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_chim_size(struct hn_softc *, int); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); +static void hn_chan_detach(struct hn_softc *, struct vmbus_channel *); static int hn_attach_subchans(struct hn_softc *); +static void hn_detach_allchans(struct hn_softc *); static void hn_chan_callback(struct vmbus_channel *chan, void *xrxr); +static void hn_set_ring_inuse(struct hn_softc *, int); static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt); @@ -520,7 +523,7 @@ netvsc_attach(device_t dev) goto failed; /* - * Associate the first TX/RX ring w/ the primary channel. + * Attach the primary channel before attaching NVS and RNDIS. */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) @@ -576,17 +579,14 @@ netvsc_attach(device_t dev) * Set the # of TX/RX rings that could be used according to * the # of channels that host offered. */ - if (sc->hn_tx_ring_inuse > ring_cnt) - sc->hn_tx_ring_inuse = ring_cnt; - sc->hn_rx_ring_inuse = ring_cnt; - device_printf(dev, "%d TX ring, %d RX ring\n", - sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); + hn_set_ring_inuse(sc, ring_cnt); - if (sc->hn_rx_ring_inuse > 1) { - error = hn_attach_subchans(sc); - if (error) - goto failed; - } + /* + * Attach the sub-channels, if any. + */ + error = hn_attach_subchans(sc); + if (error) + goto failed; #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { @@ -669,6 +669,7 @@ netvsc_detach(device_t dev) */ hv_rf_on_device_remove(sc); + hn_detach_allchans(sc); hn_stop_tx_tasks(sc); @@ -1580,14 +1581,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, break; } - /* Wait for subchannels to be destroyed */ - vmbus_subchan_drain(sc->hn_prichan); + /* + * Detach all of the channels. + */ + hn_detach_allchans(sc); - sc->hn_rx_ring[0].hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; - sc->hn_tx_ring[0].hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; - hn_chan_attach(sc, sc->hn_prichan); /* XXX check error */ + /* + * Attach the primary channel before attaching NVS and RNDIS. + */ + hn_chan_attach(sc, sc->hn_prichan); - ring_cnt = sc->hn_rx_ring_inuse; + ring_cnt = sc->hn_rx_ring_cnt; error = hv_rf_on_device_add(sc, &ring_cnt, ifr->ifr_mtu); if (error) { NV_LOCK(sc); @@ -1595,27 +1599,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, NV_UNLOCK(sc); break; } - /* # of channels can _not_ be changed */ - KASSERT(sc->hn_rx_ring_inuse == ring_cnt, - ("RX ring count %d and channel count %u mismatch", - sc->hn_rx_ring_cnt, ring_cnt)); - if (sc->hn_rx_ring_inuse > 1) { - int r; - /* - * Skip the rings on primary channel; they are - * handled by the hv_rf_on_device_add() above. - */ - for (r = 1; r < sc->hn_rx_ring_cnt; ++r) { - sc->hn_rx_ring[r].hn_rx_flags &= - ~HN_RX_FLAG_ATTACHED; - } - for (r = 1; r < sc->hn_tx_ring_cnt; ++r) { - sc->hn_tx_ring[r].hn_tx_flags &= - ~HN_TX_FLAG_ATTACHED; - } - hn_attach_subchans(sc); /* XXX check error */ - } + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that host offered. + */ + hn_set_ring_inuse(sc, ring_cnt); + + /* + * Attach the sub-channels, if any. + */ + hn_attach_subchans(sc); /* XXX check error */ if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); @@ -3022,6 +3016,42 @@ hn_chan_attach(struct hn_softc *sc, stru return (error); } +static void +hn_chan_detach(struct hn_softc *sc, struct vmbus_channel *chan) +{ + struct hn_rx_ring *rxr; + int idx; + + idx = vmbus_chan_subidx(chan); + + /* + * Link this channel to RX/TX ring. + */ + KASSERT(idx >= 0 && idx < sc->hn_rx_ring_inuse, + ("invalid channel index %d, should > 0 && < %d", + idx, sc->hn_rx_ring_inuse)); + rxr = &sc->hn_rx_ring[idx]; + KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED), + ("RX ring %d is not attached", idx)); + rxr->hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; + + if (idx < sc->hn_tx_ring_inuse) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[idx]; + + KASSERT((txr->hn_tx_flags & HN_TX_FLAG_ATTACHED), + ("TX ring %d is not attached attached", idx)); + txr->hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; + } + + /* + * Close this channel. + * + * NOTE: + * Channel closing does _not_ destroy the target channel. + */ + vmbus_chan_close(chan); +} + static int hn_attach_subchans(struct hn_softc *sc) { @@ -3029,6 +3059,9 @@ hn_attach_subchans(struct hn_softc *sc) int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i, error = 0; + if (subchan_cnt == 0) + return (0); + /* Wait for sub-channels setup to complete. */ subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); @@ -3054,6 +3087,64 @@ hn_attach_subchans(struct hn_softc *sc) } static void +hn_detach_allchans(struct hn_softc *sc) +{ + struct vmbus_channel **subchans; + int subchan_cnt = sc->hn_rx_ring_inuse - 1; + int i; + + if (subchan_cnt == 0) + goto back; + + /* Detach the sub-channels. */ + subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); + for (i = 0; i < subchan_cnt; ++i) + hn_chan_detach(sc, subchans[i]); + vmbus_subchan_rel(subchans, subchan_cnt); + +back: + /* + * Detach the primary channel, _after_ all sub-channels + * are detached. + */ + hn_chan_detach(sc, sc->hn_prichan); + + /* Wait for sub-channels to be destroyed, if any. */ + vmbus_subchan_drain(sc->hn_prichan); + +#ifdef INVARIANTS + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + KASSERT((sc->hn_rx_ring[i].hn_rx_flags & + HN_RX_FLAG_ATTACHED) == 0, + ("%dth RX ring is still attached", i)); + } + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + KASSERT((sc->hn_tx_ring[i].hn_tx_flags & + HN_TX_FLAG_ATTACHED) == 0, + ("%dth TX ring is still attached", i)); + } +#endif +} + +static void +hn_set_ring_inuse(struct hn_softc *sc, int ring_cnt) +{ + KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_cnt, + ("invalid ring count %d", ring_cnt)); + + if (sc->hn_tx_ring_cnt > ring_cnt) + sc->hn_tx_ring_inuse = ring_cnt; + else + sc->hn_tx_ring_inuse = sc->hn_tx_ring_cnt; + sc->hn_rx_ring_inuse = ring_cnt; + + if (bootverbose) { + if_printf(sc->hn_ifp, "%d TX ring, %d RX ring\n", + sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); + } +} + +static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) { const struct hn_nvs_hdr *hdr; From owner-svn-src-all@freebsd.org Tue Sep 13 05:41:14 2016 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 AECBDBD8906; Tue, 13 Sep 2016 05:41:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 656CD7D4; Tue, 13 Sep 2016 05:41:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5fDdt002305; Tue, 13 Sep 2016 05:41:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5fDcV002304; Tue, 13 Sep 2016 05:41:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609130541.u8D5fDcV002304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 05:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305761 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 05:41:14 -0000 Author: sephe Date: Tue Sep 13 05:41:13 2016 New Revision: 305761 URL: https://svnweb.freebsd.org/changeset/base/305761 Log: hyperv/hn: Regroup synthetic parts attach code. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7859 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:27:36 2016 (r305760) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:41:13 2016 (r305761) @@ -523,12 +523,40 @@ netvsc_attach(device_t dev) goto failed; /* + * Create transaction context for NVS and RNDIS transactions. + */ + sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), + HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0); + if (sc->hn_xact == NULL) + goto failed; + + /* * Attach the primary channel before attaching NVS and RNDIS. */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) goto failed; + /* + * Attach NVS and RNDIS (synthetic parts). + */ + error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); + if (error) + goto failed; + + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that host offered. + */ + hn_set_ring_inuse(sc, ring_cnt); + + /* + * Attach the sub-channels, if any. + */ + error = hn_attach_subchans(sc); + if (error) + goto failed; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; ifp->if_init = hn_ifinit; @@ -563,31 +591,6 @@ netvsc_attach(device_t dev) IFCAP_LRO; ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; - sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), - HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0); - if (sc->hn_xact == NULL) - goto failed; - - error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); - if (error) - goto failed; - KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_inuse, - ("invalid channel count %d, should be less than %d", - ring_cnt, sc->hn_rx_ring_inuse)); - - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that host offered. - */ - hn_set_ring_inuse(sc, ring_cnt); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); - if (error) - goto failed; - #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { /* From owner-svn-src-all@freebsd.org Tue Sep 13 05:48:00 2016 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 84DCDBD8A1B; Tue, 13 Sep 2016 05:48:00 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 464E0BE3; Tue, 13 Sep 2016 05:48:00 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5lxB3003240; Tue, 13 Sep 2016 05:47:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5lxE5003238; Tue, 13 Sep 2016 05:47:59 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609130547.u8D5lxE5003238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 13 Sep 2016 05:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305762 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 05:48:00 -0000 Author: avos Date: Tue Sep 13 05:47:59 2016 New Revision: 305762 URL: https://svnweb.freebsd.org/changeset/base/305762 Log: MFC r305470: iwm: fix scanning for hidden SSIDs. Setup SSIDs in scan command so firmware will send direct probe request(s) while scanning. Tested by: dbkirk@gmail.com PR: 211519 Modified: stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Tue Sep 13 05:41:13 2016 (r305761) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Tue Sep 13 05:47:59 2016 (r305762) @@ -265,6 +265,7 @@ iwm_mvm_lmac_scan_fill_channels(struct i struct iwm_scan_channel_cfg_lmac *chan, int n_ssids) { struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_scan_state *ss = ic->ic_scan; struct ieee80211_channel *c; uint8_t nchan; int j; @@ -292,10 +293,11 @@ iwm_mvm_lmac_scan_fill_channels(struct i chan->iter_count = htole16(1); chan->iter_interval = htole32(0); chan->flags = htole32(IWM_UNIFIED_SCAN_CHANNEL_PARTIAL); -#if 0 /* makes scanning while associated less useful */ - if (n_ssids != 0) - chan->flags |= htole32(1 << 1); /* select SSID 0 */ -#endif + chan->flags |= htole32(IWM_SCAN_CHANNEL_NSSIDS(n_ssids)); + /* XXX IEEE80211_SCAN_NOBCAST flag is never set. */ + if (!IEEE80211_IS_CHAN_PASSIVE(c) && + (!(ss->ss_flags & IEEE80211_SCAN_NOBCAST) || n_ssids != 0)) + chan->flags |= htole32(IWM_SCAN_CHANNEL_TYPE_ACTIVE); chan++; nchan++; } @@ -334,11 +336,7 @@ iwm_mvm_umac_scan_fill_channels(struct i chan->channel_num = ieee80211_mhz2ieee(c->ic_freq, 0); chan->iter_count = 1; chan->iter_interval = htole16(0); - chan->flags = htole32(0); -#if 0 /* makes scanning while associated less useful */ - if (n_ssids != 0) - chan->flags = htole32(1 << 0); /* select SSID 0 */ -#endif + chan->flags = htole32(IWM_SCAN_CHANNEL_UMAC_NSSIDS(n_ssids)); chan++; nchan++; } @@ -355,13 +353,11 @@ iwm_mvm_fill_probe_req(struct iwm_softc struct ieee80211_rateset *rs; size_t remain = sizeof(preq->buf); uint8_t *frm, *pos; - int ssid_len = 0; - const uint8_t *ssid = NULL; memset(preq, 0, sizeof(*preq)); /* Ensure enough space for header and SSID IE. */ - if (remain < sizeof(*wh) + 2 + ssid_len) + if (remain < sizeof(*wh) + 2) return ENOBUFS; /* @@ -378,7 +374,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *(uint16_t *)&wh->i_seq[0] = 0; /* filled by HW */ frm = (uint8_t *)(wh + 1); - frm = ieee80211_add_ssid(frm, ssid, ssid_len); + frm = ieee80211_add_ssid(frm, NULL, 0); /* Tell the firmware where the MAC header is. */ preq->mac_header.offset = 0; @@ -544,11 +540,11 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) .data = { NULL, }, .flags = IWM_CMD_SYNC, }; + struct ieee80211_scan_state *ss = sc->sc_ic.ic_scan; struct iwm_scan_req_umac *req; struct iwm_scan_req_umac_tail *tail; size_t req_len; - int ssid_len = 0; - const uint8_t *ssid = NULL; + uint8_t i, nssid; int ret; req_len = sizeof(struct iwm_scan_req_umac) + @@ -577,8 +573,9 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) req->scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH); req->ooc_priority = htole32(IWM_SCAN_PRIORITY_HIGH); + nssid = MIN(ss->ss_nssid, IWM_PROBE_OPTION_MAX); req->n_channels = iwm_mvm_umac_scan_fill_channels(sc, - (struct iwm_scan_channel_cfg_umac *)req->data, ssid_len != 0); + (struct iwm_scan_channel_cfg_umac *)req->data, nssid); req->general_flags = htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL | IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE | @@ -589,15 +586,19 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) sc->sc_capa_n_scan_channels); /* Check if we're doing an active directed scan. */ - if (ssid_len != 0) { - tail->direct_scan[0].id = IEEE80211_ELEMID_SSID; - tail->direct_scan[0].len = ssid_len; - memcpy(tail->direct_scan[0].ssid, ssid, ssid_len); + for (i = 0; i < nssid; i++) { + tail->direct_scan[i].id = IEEE80211_ELEMID_SSID; + tail->direct_scan[i].len = MIN(ss->ss_ssid[i].len, + IEEE80211_NWID_LEN); + memcpy(tail->direct_scan[i].ssid, ss->ss_ssid[i].ssid, + tail->direct_scan[i].len); + /* XXX debug */ + } + if (nssid != 0) { req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT); - } else { + } else req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE); - } if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) @@ -631,11 +632,11 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) .data = { NULL, }, .flags = IWM_CMD_SYNC, }; + struct ieee80211_scan_state *ss = sc->sc_ic.ic_scan; struct iwm_scan_req_lmac *req; size_t req_len; + uint8_t i, nssid; int ret; - int ssid_len = 0; - const uint8_t *ssid = NULL; IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Handling ieee80211 scan request\n"); @@ -668,11 +669,6 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->scan_flags = htole32(IWM_MVM_LMAC_SCAN_FLAG_PASS_ALL | IWM_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE | IWM_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL); - if (ssid_len == 0) - req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAG_PASSIVE); - else - req->scan_flags |= - htole32(IWM_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION); if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); @@ -698,15 +694,23 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->tx_cmd[1].sta_id = sc->sc_aux_sta.sta_id; /* Check if we're doing an active directed scan. */ - if (ssid_len != 0) { - req->direct_scan[0].id = IEEE80211_ELEMID_SSID; - req->direct_scan[0].len = ssid_len; - memcpy(req->direct_scan[0].ssid, ssid, ssid_len); + nssid = MIN(ss->ss_nssid, IWM_PROBE_OPTION_MAX); + for (i = 0; i < nssid; i++) { + req->direct_scan[i].id = IEEE80211_ELEMID_SSID; + req->direct_scan[i].len = MIN(ss->ss_ssid[i].len, + IEEE80211_NWID_LEN); + memcpy(req->direct_scan[i].ssid, ss->ss_ssid[i].ssid, + req->direct_scan[i].len); + /* XXX debug */ } + if (nssid != 0) { + req->scan_flags |= + htole32(IWM_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION); + } else + req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAG_PASSIVE); req->n_channels = iwm_mvm_lmac_scan_fill_channels(sc, - (struct iwm_scan_channel_cfg_lmac *)req->data, - ssid_len != 0); + (struct iwm_scan_channel_cfg_lmac *)req->data, nssid); ret = iwm_mvm_fill_probe_req(sc, (struct iwm_scan_probe_req *)(req->data + Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Tue Sep 13 05:41:13 2016 (r305761) +++ stable/11/sys/dev/iwm/if_iwmreg.h Tue Sep 13 05:47:59 2016 (r305762) @@ -4766,6 +4766,7 @@ struct iwm_scd_txq_cfg_rsp { /* Masks for iwm_scan_channel.type flags */ #define IWM_SCAN_CHANNEL_TYPE_ACTIVE (1 << 0) +#define IWM_SCAN_CHANNEL_NSSIDS(x) (((1 << (x)) - 1) << 1) #define IWM_SCAN_CHANNEL_NARROW_BAND (1 << 22) /* Max number of IEs for direct SSID scans in a command */ @@ -5580,6 +5581,8 @@ enum iwm_umac_scan_general_flags { */ struct iwm_scan_channel_cfg_umac { uint32_t flags; +#define IWM_SCAN_CHANNEL_UMAC_NSSIDS(x) ((1 << (x)) - 1) + uint8_t channel_num; uint8_t iter_count; uint16_t iter_interval; From owner-svn-src-all@freebsd.org Tue Sep 13 05:54:33 2016 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 3C930BD8BE9; Tue, 13 Sep 2016 05:54:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4FD4F98; Tue, 13 Sep 2016 05:54:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5sW3F006789; Tue, 13 Sep 2016 05:54:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5sV05006785; Tue, 13 Sep 2016 05:54:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609130554.u8D5sV05006785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 05:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305763 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 05:54:33 -0000 Author: sephe Date: Tue Sep 13 05:54:31 2016 New Revision: 305763 URL: https://svnweb.freebsd.org/changeset/base/305763 Log: hyperv/hn: Reorganize synthetic parts attach code. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7860 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:54:31 2016 (r305763) @@ -350,6 +350,7 @@ static int hn_attach_subchans(struct hn_ static void hn_detach_allchans(struct hn_softc *); static void hn_chan_callback(struct vmbus_channel *chan, void *xrxr); static void hn_set_ring_inuse(struct hn_softc *, int); +static int hn_synth_attach(struct hn_softc *, int); static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt); @@ -531,29 +532,9 @@ netvsc_attach(device_t dev) goto failed; /* - * Attach the primary channel before attaching NVS and RNDIS. + * Attach the synthetic parts, i.e. NVS and RNDIS. */ - error = hn_chan_attach(sc, sc->hn_prichan); - if (error) - goto failed; - - /* - * Attach NVS and RNDIS (synthetic parts). - */ - error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); - if (error) - goto failed; - - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that host offered. - */ - hn_set_ring_inuse(sc, ring_cnt); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); + error = hn_synth_attach(sc, ETHERMTU); if (error) goto failed; @@ -1513,7 +1494,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; #endif - int mask, error = 0, ring_cnt; + int mask, error = 0; int retry_cnt = 500; switch(cmd) { @@ -1590,29 +1571,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_detach_allchans(sc); /* - * Attach the primary channel before attaching NVS and RNDIS. - */ - hn_chan_attach(sc, sc->hn_prichan); - - ring_cnt = sc->hn_rx_ring_cnt; - error = hv_rf_on_device_add(sc, &ring_cnt, ifr->ifr_mtu); - if (error) { - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); - break; - } - - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that host offered. + * Attach the synthetic parts, i.e. NVS and RNDIS. + * XXX check error. */ - hn_set_ring_inuse(sc, ring_cnt); - - /* - * Attach the sub-channels, if any. - */ - hn_attach_subchans(sc); /* XXX check error */ + hn_synth_attach(sc, ifr->ifr_mtu); if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); @@ -3065,17 +3027,13 @@ hn_attach_subchans(struct hn_softc *sc) if (subchan_cnt == 0) return (0); - /* Wait for sub-channels setup to complete. */ - subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); - /* Attach the sub-channels. */ + subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); for (i = 0; i < subchan_cnt; ++i) { error = hn_chan_attach(sc, subchans[i]); if (error) break; } - - /* Release the sub-channels */ vmbus_subchan_rel(subchans, subchan_cnt); if (error) { @@ -3129,6 +3087,132 @@ back: #endif } +static int +hn_synth_alloc_subchans(struct hn_softc *sc, int *nsubch) +{ + struct vmbus_channel **subchans; + int nchan, rxr_cnt, error; + + nchan = *nsubch + 1; + if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { + /* + * Either RSS is not supported, or multiple RX/TX rings + * are not requested. + */ + *nsubch = 0; + return (0); + } + + /* + * Get RSS capabilities, e.g. # of RX rings, and # of indirect + * table entries. + */ + error = hn_rndis_get_rsscaps(sc, &rxr_cnt); + if (error) { + /* No RSS; this is benign. */ + *nsubch = 0; + return (0); + } + if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", + rxr_cnt, nchan); + + if (nchan > rxr_cnt) + nchan = rxr_cnt; + if (nchan == 1) { + if_printf(sc->hn_ifp, "only 1 channel is supported, no vRSS\n"); + *nsubch = 0; + return (0); + } + + /* + * Allocate sub-channels from NVS. + */ + *nsubch = nchan - 1; + error = hn_nvs_alloc_subchans(sc, nsubch); + if (error || *nsubch == 0) { + /* Failed to allocate sub-channels. */ + *nsubch = 0; + return (0); + } + + /* + * Wait for all sub-channels to become ready before moving on. + */ + subchans = vmbus_subchan_get(sc->hn_prichan, *nsubch); + vmbus_subchan_rel(subchans, *nsubch); + return (0); +} + +static int +hn_synth_attach(struct hn_softc *sc, int mtu) +{ + int error, nsubch; + + /* + * Attach the primary channel _before_ attaching NVS and RNDIS. + */ + error = hn_chan_attach(sc, sc->hn_prichan); + if (error) + return (error); + + /* + * Attach NVS. + */ + error = hn_nvs_attach(sc, mtu); + if (error) + return (error); + + /* + * Attach RNDIS _after_ NVS is attached. + */ + error = hn_rndis_attach(sc); + if (error) + return (error); + + /* + * Allocate sub-channels for multi-TX/RX rings. + * + * NOTE: + * The # of RX rings that can be used is equivalent to the # of + * channels to be requested. + */ + nsubch = sc->hn_rx_ring_cnt - 1; + error = hn_synth_alloc_subchans(sc, &nsubch); + if (error) + return (error); + if (nsubch == 0) { + /* Only the primary channel can be used; done */ + goto back; + } + + /* + * Configure RSS key and indirect table _after_ all sub-channels + * are allocated. + */ + error = hn_rndis_conf_rss(sc, nsubch + 1); + if (error) { + /* + * Failed to configure RSS key or indirect table; only + * the primary channel can be used. + */ + nsubch = 0; + } +back: + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that NVS offered. + */ + hn_set_ring_inuse(sc, nsubch + 1); + + /* + * Attach the sub-channels, if any. + */ + error = hn_attach_subchans(sc); + if (error) + return (error); + return (0); +} + static void hn_set_ring_inuse(struct hn_softc *sc, int ring_cnt) { Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Sep 13 05:54:31 2016 (r305763) @@ -81,8 +81,6 @@ static int hn_rndis_query(struct hn_soft static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen); static int hn_rndis_conf_offload(struct hn_softc *sc); -static int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); -static int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -711,7 +709,7 @@ done: return (error); } -static int +int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt) { struct ndis_rss_caps in, caps; @@ -846,7 +844,7 @@ hn_rndis_conf_offload(struct hn_softc *s return (error); } -static int +int hn_rndis_conf_rss(struct hn_softc *sc, int nchan) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; @@ -994,7 +992,7 @@ hv_rf_halt_device(struct hn_softc *sc) return (0); } -static int +int hn_rndis_attach(struct hn_softc *sc) { int error; @@ -1014,76 +1012,6 @@ hn_rndis_attach(struct hn_softc *sc) return (0); } -int -hv_rf_on_device_add(struct hn_softc *sc, int *nchan0, int mtu) -{ - int ret; - device_t dev = sc->hn_dev; - int nchan = *nchan0, rxr_cnt, nsubch; - - ret = hn_nvs_attach(sc, mtu); - if (ret != 0) - return (ret); - - ret = hn_rndis_attach(sc); - if (ret != 0) - return (ret); - - if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { - /* - * Either RSS is not supported, or multiple RX/TX rings - * are not requested. - */ - *nchan0 = 1; - return (0); - } - - /* - * Get RSS capabilities, e.g. # of RX rings, and # of indirect - * table entries. - */ - ret = hn_rndis_get_rsscaps(sc, &rxr_cnt); - if (ret) { - /* No RSS; this is benign. */ - *nchan0 = 1; - return (0); - } - if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", - rxr_cnt, nchan); - - if (nchan > rxr_cnt) - nchan = rxr_cnt; - if (nchan == 1) { - device_printf(dev, "only 1 channel is supported, no vRSS\n"); - *nchan0 = 1; - return (0); - } - - /* - * Allocate sub-channels from NVS. - */ - nsubch = nchan - 1; - ret = hn_nvs_alloc_subchans(sc, &nsubch); - if (ret || nsubch == 0) { - /* Failed to allocate sub-channels. */ - *nchan0 = 1; - return (0); - } - nchan = nsubch + 1; - - /* - * Configure RSS key and indirect table after all sub-channels - * are allocated. - */ - ret = hn_rndis_conf_rss(sc, nchan); - if (ret != 0) { - /* Failed to configure RSS key or indirect table. */ - nchan = 1; - } - *nchan0 = nchan; - return (0); -} - /* * RNDIS filter on device remove */ Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Sep 13 05:54:31 2016 (r305763) @@ -43,7 +43,6 @@ struct hn_rx_ring; void hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, const void *data, int dlen); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); -int hv_rf_on_device_add(struct hn_softc *sc, int *nchan, int mtu); int hv_rf_on_device_remove(struct hn_softc *sc); int hv_rf_on_open(struct hn_softc *sc); int hv_rf_on_close(struct hn_softc *sc); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 13 05:54:31 2016 (r305763) @@ -114,18 +114,23 @@ hn_nvs_send_sglist(struct vmbus_channel struct vmbus_xact; struct rndis_packet_msg; -void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, - struct vmbus_channel *chan, const void *data, int dlen); uint32_t hn_chim_alloc(struct hn_softc *sc); void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); +int hn_rndis_attach(struct hn_softc *sc); +int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); - +int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); int hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status); + +int hn_nvs_attach(struct hn_softc *sc, int mtu); int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch); +void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, + struct vmbus_channel *chan, const void *data, int dlen); + int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); void hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); From owner-svn-src-all@freebsd.org Tue Sep 13 07:15:40 2016 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 2D67FBD8466; Tue, 13 Sep 2016 07:15:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3D6C9AF; Tue, 13 Sep 2016 07:15:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D7Fd5F036691; Tue, 13 Sep 2016 07:15:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D7FdBV036690; Tue, 13 Sep 2016 07:15:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609130715.u8D7FdBV036690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 13 Sep 2016 07:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305764 - stable/11/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 07:15:40 -0000 Author: mav Date: Tue Sep 13 07:15:39 2016 New Revision: 305764 URL: https://svnweb.freebsd.org/changeset/base/305764 Log: MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand(). Our shim for Solaris random_get_bytes() uses read_random(), that looks reasonable, since it guaranties reliably seeded random data. On the other side Solaris random_get_pseudo_bytes() does not provide this guarantie, and its original Solaris implementation is equivalent to our arc4rand(), using software crypto without stressing slower hardware RNG. Modified: stable/11/sys/cddl/compat/opensolaris/sys/random.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/compat/opensolaris/sys/random.h ============================================================================== --- stable/11/sys/cddl/compat/opensolaris/sys/random.h Tue Sep 13 05:54:31 2016 (r305763) +++ stable/11/sys/cddl/compat/opensolaris/sys/random.h Tue Sep 13 07:15:39 2016 (r305764) @@ -32,6 +32,6 @@ #include_next #define random_get_bytes(p, s) read_random((p), (int)(s)) -#define random_get_pseudo_bytes(p, s) read_random((p), (int)(s)) +#define random_get_pseudo_bytes(p, s) arc4rand((p), (int)(s), 0) #endif /* !_OPENSOLARIS_SYS_RANDOM_H_ */ From owner-svn-src-all@freebsd.org Tue Sep 13 08:28:01 2016 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 89CD2BD1CA8; Tue, 13 Sep 2016 08:28:01 +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 1FD40162; Tue, 13 Sep 2016 08:28:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u8D8RttT014993 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 13 Sep 2016 11:27:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u8D8RttT014993 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u8D8Rtp9014992; Tue, 13 Sep 2016 11:27:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Sep 2016 11:27:55 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305722 - head/sys/x86/x86 Message-ID: <20160913082755.GD38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> <20160912100003.GX38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 08:28:01 -0000 On Tue, Sep 13, 2016 at 09:21:25AM +0800, Sepherosa Ziehau wrote: > Still didn't find anything wrong with this tunable set. Hm, did you have DMAR globally enabled ? I.e. did you get messages about dmar attachment, and then reports about dmar routing interrupts, like msi: Assigning MSI-X IRQ 264 to local APIC 4 vector 51 dmar1: programming irte[5] rid 0xf078 high 0x4f078 low 0x400330001 ? Ok, I tested this on my box. Indeed, this mutex (now sx) seems to not participate there. Thanks. From owner-svn-src-all@freebsd.org Tue Sep 13 08:42:50 2016 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 47E6EBD6206; Tue, 13 Sep 2016 08:42:50 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x236.google.com (mail-vk0-x236.google.com [IPv6:2607:f8b0: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 0279BCA7; Tue, 13 Sep 2016 08:42:49 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x236.google.com with SMTP id f76so167738703vke.0; Tue, 13 Sep 2016 01:42:49 -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; bh=6rlMKn79tw9tG/xmKHFVilZgL7rpWBFwhH6XxvoMM4c=; b=NwOK0b5y7w00d2854KIQtfXdX0sikYBeOTnY6WkNYVCDnXfxjYURJFEzYANkD6d597 LORYQ/Zg1tQWCDysQQoMPHRgABntwqik72RbAOWg5Kp5IiLY4MESfjRDggExwyErd2j4 d0QpzLLWZMgWZ1LhZj8wQEOK3OzwXv2i+FUXoCPCvt7L3U7teaSa2nfuPFD33tOeRcii m9xekj7PfK9faQcPL/YqQb1hn81pdbOZkn2nVOrV1HeBvCJUAEjfJNqcCQWEHsTGx0tS eqGZ/orE1sSZJeSctB10CTHhkCoud+R+IUZOnG0/a4rlF/mDzU3YLYvH+z3HxNCEoaxW wyYQ== 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:from :date:message-id:subject:to:cc; bh=6rlMKn79tw9tG/xmKHFVilZgL7rpWBFwhH6XxvoMM4c=; b=aAwKiPbkQlJWiuEurEOeyvT4aUgLQdpeBSBpmNtasmJZaFDIas+xNqi1hNxef4VQUF 3rFbhHR2WQnaUi6vOtVIcK+SesAdC5PLfsE7KelCnBOfogVpromWxcLnXTXfr0UpnrC8 BjL/F4CUy99ElDGuBF+uK8w7kFKvoWBYNzQJtg181NQs8tdR5Jtzny9R3/T+qC1FzyEq JbX5ud9qyKFLVEQgbfy5L55fOkVQLiJfm/JEMl0N2Ta664Bll2c2EGPULapP6Yp2gp2i WnNdISI2a1Qt/AzSWL3MVU2S//KdW1LxwAMOHzqvffA2s4+/P+WVU7IbYi4oPT8IEedp 80oA== X-Gm-Message-State: AE9vXwNL2ip8r9acNsxHCwx5IhO0kcEYPayA/Xo08C8r5+8mPYyW/lfU5TpgflbRc8ksIP0b+RQ26wv4jXUExA== X-Received: by 10.31.244.207 with SMTP id s198mr11033643vkh.126.1473756169196; Tue, 13 Sep 2016 01:42:49 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Tue, 13 Sep 2016 01:42:48 -0700 (PDT) In-Reply-To: <20160913082755.GD38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> <20160912100003.GX38409@kib.kiev.ua> <20160913082755.GD38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 16:42:48 +0800 X-Google-Sender-Auth: IFPGfyWq-NNPtL5RYm9HGB_0xx0 Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 08:42:50 -0000 On Tue, Sep 13, 2016 at 4:27 PM, Konstantin Belousov wrote: > On Tue, Sep 13, 2016 at 09:21:25AM +0800, Sepherosa Ziehau wrote: >> Still didn't find anything wrong with this tunable set. > Hm, did you have DMAR globally enabled ? I.e. did you get messages > about dmar attachment, and then reports about dmar routing interrupts, like > msi: Assigning MSI-X IRQ 264 to local APIC 4 vector 51 > dmar1: programming irte[5] rid 0xf078 high 0x4f078 low 0x400330001 > ? Let me try it on other boxes. > > Ok, I tested this on my box. Indeed, this mutex (now sx) seems to not > participate there. Thanks. Thank you for the information. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Tue Sep 13 09:25:39 2016 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 384FBBD70D0; Tue, 13 Sep 2016 09:25:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A9A17DE; Tue, 13 Sep 2016 09:25:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D9Pcld086442; Tue, 13 Sep 2016 09:25:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D9PcHB086441; Tue, 13 Sep 2016 09:25:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609130925.u8D9PcHB086441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 13 Sep 2016 09:25:38 +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: r305765 - stable/10/sys/cddl/compat/opensolaris/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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 09:25:39 -0000 Author: mav Date: Tue Sep 13 09:25:38 2016 New Revision: 305765 URL: https://svnweb.freebsd.org/changeset/base/305765 Log: MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand(). Our shim for Solaris random_get_bytes() uses read_random(), that looks reasonable, since it guaranties reliably seeded random data. On the other side Solaris random_get_pseudo_bytes() does not provide this guarantie, and its original Solaris implementation is equivalent to our arc4rand(), using software crypto without stressing slower hardware RNG. Modified: stable/10/sys/cddl/compat/opensolaris/sys/random.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/sys/random.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/random.h Tue Sep 13 07:15:39 2016 (r305764) +++ stable/10/sys/cddl/compat/opensolaris/sys/random.h Tue Sep 13 09:25:38 2016 (r305765) @@ -32,6 +32,6 @@ #include_next #define random_get_bytes(p, s) read_random((p), (int)(s)) -#define random_get_pseudo_bytes(p, s) read_random((p), (int)(s)) +#define random_get_pseudo_bytes(p, s) arc4rand((p), (int)(s), 0) #endif /* !_OPENSOLARIS_SYS_RANDOM_H_ */ From owner-svn-src-all@freebsd.org Tue Sep 13 10:34:04 2016 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 3E6D9BD76EC; Tue, 13 Sep 2016 10:34:04 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id E413F9A2; Tue, 13 Sep 2016 10:34:00 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id 6A0A56E; Tue, 13 Sep 2016 13:24:36 +0300 (MSK) Date: Tue, 13 Sep 2016 13:24:36 +0300 From: Oleg Bulyzhin To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: Re: svn commit: r305738 - releng/11.0/sys/netpfil/ipfw Message-ID: <20160913102436.GA30660@lath.RINET.ru> References: <201609121557.u8CFvZrp084666@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201609121557.u8CFvZrp084666@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 10:34:04 -0000 On Mon, Sep 12, 2016 at 03:57:35PM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Sep 12 15:57:35 2016 > New Revision: 305738 > URL: https://svnweb.freebsd.org/changeset/base/305738 > > Log: > Merge from stable/11 r304415,304419 (by oleg): > Fix command: ipfw set (enable|disable) N (where N > 4). > > PR: 212595 > Approved by: re (kib) Thank you. -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-all@freebsd.org Tue Sep 13 14:10:50 2016 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 7A59DBD9D9A; Tue, 13 Sep 2016 14:10:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCA3B28; Tue, 13 Sep 2016 14:10:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DEAnHH092018; Tue, 13 Sep 2016 14:10:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DEAnAD092017; Tue, 13 Sep 2016 14:10:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131410.u8DEAnAD092017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 14:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305767 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 14:10:50 -0000 Author: andrew Date: Tue Sep 13 14:10:49 2016 New Revision: 305767 URL: https://svnweb.freebsd.org/changeset/base/305767 Log: Add a warning about a known erratum we have observed on ThunderX pass 1.1. As this is evaluation hardware with only a few users, and there is a lack of information add a warning when booting on this hardware. Reported by: cognet Obtained from: ABT Systems Ltd MFC after: Instant Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue Sep 13 13:23:24 2016 (r305766) +++ head/sys/arm64/arm64/identcpu.c Tue Sep 13 14:10:49 2016 (r305767) @@ -179,6 +179,28 @@ print_cpu_features(u_int cpu) } printf("\n"); + /* + * There is a hardware errata where, if one CPU is performing a TLB + * invalidation while another is performing a store-exclusive the + * store-exclusive may return the wrong status. A workaround seems + * to be to use an IPI to invalidate on each CPU, however given the + * limited number of affected units (pass 1.1 is the evaluation + * hardware revision), and the lack of information from Cavium + * this has not been implemented. + * + * At the time of writing this the only information is from: + * https://lkml.org/lkml/2016/8/4/722 + */ + /* + * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on it's own also + * triggers on pass 2.0+. + */ + if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 && + CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) + printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " + "hardware bugs that may cause the incorrect operation of " + "atomic operations.\n"); + if (cpu != 0 && cpu_print_regs == 0) return; From owner-svn-src-all@freebsd.org Tue Sep 13 14:14:41 2016 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 0CE24BD9EB7; Tue, 13 Sep 2016 14:14:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEFF5FE9; Tue, 13 Sep 2016 14:14:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DEEe6g095483; Tue, 13 Sep 2016 14:14:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DEEeZc095482; Tue, 13 Sep 2016 14:14:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131414.u8DEEeZc095482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 14:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305768 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 14:14:41 -0000 Author: andrew Date: Tue Sep 13 14:14:39 2016 New Revision: 305768 URL: https://svnweb.freebsd.org/changeset/base/305768 Log: MFC 305767: Add a warning about a known erratum we have observed on ThunderX pass 1.1. As this is evaluation hardware with only a few users, and there is a lack of information add a warning when booting on this hardware. Modified: stable/11/sys/arm64/arm64/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/identcpu.c ============================================================================== --- stable/11/sys/arm64/arm64/identcpu.c Tue Sep 13 14:10:49 2016 (r305767) +++ stable/11/sys/arm64/arm64/identcpu.c Tue Sep 13 14:14:39 2016 (r305768) @@ -179,6 +179,28 @@ print_cpu_features(u_int cpu) } printf("\n"); + /* + * There is a hardware errata where, if one CPU is performing a TLB + * invalidation while another is performing a store-exclusive the + * store-exclusive may return the wrong status. A workaround seems + * to be to use an IPI to invalidate on each CPU, however given the + * limited number of affected units (pass 1.1 is the evaluation + * hardware revision), and the lack of information from Cavium + * this has not been implemented. + * + * At the time of writing this the only information is from: + * https://lkml.org/lkml/2016/8/4/722 + */ + /* + * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on it's own also + * triggers on pass 2.0+. + */ + if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 && + CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) + printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " + "hardware bugs that may cause the incorrect operation of " + "atomic operations.\n"); + if (cpu != 0 && cpu_print_regs == 0) return; From owner-svn-src-all@freebsd.org Tue Sep 13 15:37:24 2016 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 4D844BD981D; Tue, 13 Sep 2016 15:37:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5D7FFA; Tue, 13 Sep 2016 15:37:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DFbNOx027209; Tue, 13 Sep 2016 15:37:23 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DFbN5i027208; Tue, 13 Sep 2016 15:37:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201609131537.u8DFbN5i027208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 13 Sep 2016 15:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305769 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 15:37:24 -0000 Author: bapt Date: Tue Sep 13 15:37:23 2016 New Revision: 305769 URL: https://svnweb.freebsd.org/changeset/base/305769 Log: Remove code that crept in r305125 by accident Reported by: tsoome Modified: head/sys/boot/common/dev_net.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Tue Sep 13 14:14:39 2016 (r305768) +++ head/sys/boot/common/dev_net.c Tue Sep 13 15:37:23 2016 (r305769) @@ -368,7 +368,7 @@ net_print(int verbose) uint32_t net_parse_rootpath() { - int i, ipstart; + int i; n_long addr = INADDR_NONE; netproto = NET_NFS; @@ -383,7 +383,7 @@ net_parse_rootpath() break; if (i && i != FNAME_SIZE && rootpath[i] == ':') { rootpath[i++] = '\0'; - addr = inet_addr(&rootpath[ipstart]); + addr = inet_addr(&rootpath[0]); bcopy(&rootpath[i], rootpath, strlen(&rootpath[i])+1); } From owner-svn-src-all@freebsd.org Tue Sep 13 15:41:06 2016 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 47A99BD9A44; Tue, 13 Sep 2016 15:41:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AC933BB; Tue, 13 Sep 2016 15:41:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DFf5Pm027394; Tue, 13 Sep 2016 15:41:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DFf5lR027393; Tue, 13 Sep 2016 15:41:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201609131541.u8DFf5lR027393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 13 Sep 2016 15:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305770 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 15:41:06 -0000 Author: bapt Date: Tue Sep 13 15:41:05 2016 New Revision: 305770 URL: https://svnweb.freebsd.org/changeset/base/305770 Log: Add a comment on the #endif related to the guards Reported by: tsoome Modified: head/lib/libstand/net.h Modified: head/lib/libstand/net.h ============================================================================== --- head/lib/libstand/net.h Tue Sep 13 15:37:23 2016 (r305769) +++ head/lib/libstand/net.h Tue Sep 13 15:41:05 2016 (r305770) @@ -130,4 +130,4 @@ n_long inet_addr(char *); /* Machine-dependent functions: */ time_t getsecs(void); -#endif +#endif /* ! _STAND_NET_H */ From owner-svn-src-all@freebsd.org Tue Sep 13 15:45:24 2016 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 3C8BCBD9B51; Tue, 13 Sep 2016 15:45:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2E0C24; Tue, 13 Sep 2016 15:45:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DFjNOr031132; Tue, 13 Sep 2016 15:45:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DFjNmr031130; Tue, 13 Sep 2016 15:45:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131545.u8DFjNmr031130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 15:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305771 - in head/sys: arm64/include 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 15:45:24 -0000 Author: andrew Date: Tue Sep 13 15:45:22 2016 New Revision: 305771 URL: https://svnweb.freebsd.org/changeset/base/305771 Log: Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on DDB, and is unused when it's disabled. Obtained from: ABT Systems Ltd MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/debug_monitor.h head/sys/conf/files.arm64 Modified: head/sys/arm64/include/debug_monitor.h ============================================================================== --- head/sys/arm64/include/debug_monitor.h Tue Sep 13 15:41:05 2016 (r305770) +++ head/sys/arm64/include/debug_monitor.h Tue Sep 13 15:45:22 2016 (r305771) @@ -32,7 +32,7 @@ #ifndef _MACHINE_DEBUG_MONITOR_H_ #define _MACHINE_DEBUG_MONITOR_H_ -#ifdef KDB +#ifdef DDB #include Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 13 15:41:05 2016 (r305770) +++ head/sys/conf/files.arm64 Tue Sep 13 15:45:22 2016 (r305771) @@ -62,7 +62,7 @@ arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb arm64/arm64/db_trace.c optional ddb -arm64/arm64/debug_monitor.c optional kdb +arm64/arm64/debug_monitor.c optional ddb arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard From owner-svn-src-all@freebsd.org Tue Sep 13 16:20:32 2016 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 C5CB5BD9794; Tue, 13 Sep 2016 16:20:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F9EB05; Tue, 13 Sep 2016 16:20:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DGKVnt043182; Tue, 13 Sep 2016 16:20:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DGKVs8043180; Tue, 13 Sep 2016 16:20:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131620.u8DGKVs8043180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 16:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305772 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 16:20:32 -0000 Author: andrew Date: Tue Sep 13 16:20:31 2016 New Revision: 305772 URL: https://svnweb.freebsd.org/changeset/base/305772 Log: Add a missing opt_ddb.h include from places that include debug_moditor.h to fix the build. Obtained from: ABT Systems Ltd X-MFC with: r305771 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/db_trace.c head/sys/arm64/arm64/debug_monitor.c Modified: head/sys/arm64/arm64/db_trace.c ============================================================================== --- head/sys/arm64/arm64/db_trace.c Tue Sep 13 15:45:22 2016 (r305771) +++ head/sys/arm64/arm64/db_trace.c Tue Sep 13 16:20:31 2016 (r305772) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); #include Modified: head/sys/arm64/arm64/debug_monitor.c ============================================================================== --- head/sys/arm64/arm64/debug_monitor.c Tue Sep 13 15:45:22 2016 (r305771) +++ head/sys/arm64/arm64/debug_monitor.c Tue Sep 13 16:20:31 2016 (r305772) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); From owner-svn-src-all@freebsd.org Tue Sep 13 16:22:51 2016 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 E8569BD991C; Tue, 13 Sep 2016 16:22:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98218F6E; Tue, 13 Sep 2016 16:22:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DGMoLl046837; Tue, 13 Sep 2016 16:22:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DGMoru046833; Tue, 13 Sep 2016 16:22:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131622.u8DGMoru046833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 16:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305773 - in stable/11/sys: arm64/arm64 arm64/include conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 16:22:52 -0000 Author: andrew Date: Tue Sep 13 16:22:50 2016 New Revision: 305773 URL: https://svnweb.freebsd.org/changeset/base/305773 Log: MFC 305771, 305772: Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on DDB, and is unused when it's disabled. Modified: stable/11/sys/arm64/arm64/db_trace.c stable/11/sys/arm64/arm64/debug_monitor.c stable/11/sys/arm64/include/debug_monitor.h stable/11/sys/conf/files.arm64 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/db_trace.c ============================================================================== --- stable/11/sys/arm64/arm64/db_trace.c Tue Sep 13 16:20:31 2016 (r305772) +++ stable/11/sys/arm64/arm64/db_trace.c Tue Sep 13 16:22:50 2016 (r305773) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); #include Modified: stable/11/sys/arm64/arm64/debug_monitor.c ============================================================================== --- stable/11/sys/arm64/arm64/debug_monitor.c Tue Sep 13 16:20:31 2016 (r305772) +++ stable/11/sys/arm64/arm64/debug_monitor.c Tue Sep 13 16:22:50 2016 (r305773) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); Modified: stable/11/sys/arm64/include/debug_monitor.h ============================================================================== --- stable/11/sys/arm64/include/debug_monitor.h Tue Sep 13 16:20:31 2016 (r305772) +++ stable/11/sys/arm64/include/debug_monitor.h Tue Sep 13 16:22:50 2016 (r305773) @@ -32,7 +32,7 @@ #ifndef _MACHINE_DEBUG_MONITOR_H_ #define _MACHINE_DEBUG_MONITOR_H_ -#ifdef KDB +#ifdef DDB #include Modified: stable/11/sys/conf/files.arm64 ============================================================================== --- stable/11/sys/conf/files.arm64 Tue Sep 13 16:20:31 2016 (r305772) +++ stable/11/sys/conf/files.arm64 Tue Sep 13 16:22:50 2016 (r305773) @@ -20,7 +20,7 @@ arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb arm64/arm64/db_trace.c optional ddb -arm64/arm64/debug_monitor.c optional kdb +arm64/arm64/debug_monitor.c optional ddb arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard From owner-svn-src-all@freebsd.org Tue Sep 13 16:31:22 2016 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 54DBCBD9A67; Tue, 13 Sep 2016 16:31:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0837969F; Tue, 13 Sep 2016 16:31:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DGVL6i048036; Tue, 13 Sep 2016 16:31:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DGVK71048032; Tue, 13 Sep 2016 16:31:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131631.u8DGVK71048032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 16:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305774 - in releng/11.0/sys: arm64/arm64 arm64/include 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 16:31:22 -0000 Author: andrew Date: Tue Sep 13 16:31:20 2016 New Revision: 305774 URL: https://svnweb.freebsd.org/changeset/base/305774 Log: Merge from stable/11 305773: Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on DDB, and is unused when it's disabled. Approved by: re (gjb) Modified: releng/11.0/sys/arm64/arm64/db_trace.c releng/11.0/sys/arm64/arm64/debug_monitor.c releng/11.0/sys/arm64/include/debug_monitor.h releng/11.0/sys/conf/files.arm64 Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/arm64/arm64/db_trace.c ============================================================================== --- releng/11.0/sys/arm64/arm64/db_trace.c Tue Sep 13 16:22:50 2016 (r305773) +++ releng/11.0/sys/arm64/arm64/db_trace.c Tue Sep 13 16:31:20 2016 (r305774) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); #include Modified: releng/11.0/sys/arm64/arm64/debug_monitor.c ============================================================================== --- releng/11.0/sys/arm64/arm64/debug_monitor.c Tue Sep 13 16:22:50 2016 (r305773) +++ releng/11.0/sys/arm64/arm64/debug_monitor.c Tue Sep 13 16:31:20 2016 (r305774) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); Modified: releng/11.0/sys/arm64/include/debug_monitor.h ============================================================================== --- releng/11.0/sys/arm64/include/debug_monitor.h Tue Sep 13 16:22:50 2016 (r305773) +++ releng/11.0/sys/arm64/include/debug_monitor.h Tue Sep 13 16:31:20 2016 (r305774) @@ -32,7 +32,7 @@ #ifndef _MACHINE_DEBUG_MONITOR_H_ #define _MACHINE_DEBUG_MONITOR_H_ -#ifdef KDB +#ifdef DDB #include Modified: releng/11.0/sys/conf/files.arm64 ============================================================================== --- releng/11.0/sys/conf/files.arm64 Tue Sep 13 16:22:50 2016 (r305773) +++ releng/11.0/sys/conf/files.arm64 Tue Sep 13 16:31:20 2016 (r305774) @@ -20,7 +20,7 @@ arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb arm64/arm64/db_trace.c optional ddb -arm64/arm64/debug_monitor.c optional kdb +arm64/arm64/debug_monitor.c optional ddb arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard From owner-svn-src-all@freebsd.org Tue Sep 13 16:33:34 2016 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 423D7BD9BFC; Tue, 13 Sep 2016 16:33:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 118F094A; Tue, 13 Sep 2016 16:33:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DGXXTQ050981; Tue, 13 Sep 2016 16:33:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DGXXo1050980; Tue, 13 Sep 2016 16:33:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131633.u8DGXXo1050980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 16:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305775 - releng/11.0/sys/arm64/arm64 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 16:33:34 -0000 Author: andrew Date: Tue Sep 13 16:33:33 2016 New Revision: 305775 URL: https://svnweb.freebsd.org/changeset/base/305775 Log: Merge from stable/11 305768: Add a warning about a known erratum we have observed on ThunderX pass 1.1. As this is evaluation hardware with only a few users, and there is a lack of information add a warning when booting on this hardware. Approved by: re (gjb) Modified: releng/11.0/sys/arm64/arm64/identcpu.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/arm64/arm64/identcpu.c ============================================================================== --- releng/11.0/sys/arm64/arm64/identcpu.c Tue Sep 13 16:31:20 2016 (r305774) +++ releng/11.0/sys/arm64/arm64/identcpu.c Tue Sep 13 16:33:33 2016 (r305775) @@ -179,6 +179,28 @@ print_cpu_features(u_int cpu) } printf("\n"); + /* + * There is a hardware errata where, if one CPU is performing a TLB + * invalidation while another is performing a store-exclusive the + * store-exclusive may return the wrong status. A workaround seems + * to be to use an IPI to invalidate on each CPU, however given the + * limited number of affected units (pass 1.1 is the evaluation + * hardware revision), and the lack of information from Cavium + * this has not been implemented. + * + * At the time of writing this the only information is from: + * https://lkml.org/lkml/2016/8/4/722 + */ + /* + * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on it's own also + * triggers on pass 2.0+. + */ + if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 && + CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) + printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " + "hardware bugs that may cause the incorrect operation of " + "atomic operations.\n"); + if (cpu != 0 && cpu_print_regs == 0) return; From owner-svn-src-all@freebsd.org Tue Sep 13 17:21:34 2016 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 27249BD9CF8; Tue, 13 Sep 2016 17:21:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF440E55; Tue, 13 Sep 2016 17:21:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DHLXfg068935; Tue, 13 Sep 2016 17:21:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DHLXgj068934; Tue, 13 Sep 2016 17:21:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609131721.u8DHLXgj068934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Sep 2016 17:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305776 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 17:21:34 -0000 Author: jhb Date: Tue Sep 13 17:21:32 2016 New Revision: 305776 URL: https://svnweb.freebsd.org/changeset/base/305776 Log: MFC 305624: Document PCI_HP and PCI_IOV kernel options and various tunables in pci(4). Describe PCI-related kernel options for HotPlug and SR-IOV support in the pci(4) manual page. While here, add a section describing the various tunables supported by the PCI bus driver as well. Modified: stable/11/share/man/man4/pci.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/pci.4 ============================================================================== --- stable/11/share/man/man4/pci.4 Tue Sep 13 16:33:33 2016 (r305775) +++ stable/11/share/man/man4/pci.4 Tue Sep 13 17:21:32 2016 (r305776) @@ -24,21 +24,47 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2008 +.Dd September 8, 2016 .Dt PCI 4 .Os .Sh NAME .Nm pci -.Nd generic PCI driver +.Nd generic PCI bus driver .Sh SYNOPSIS +To compile the PCI bus driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd device pci +.Ed +.Pp +To compile in support for Single Root I/O Virtualization +.Pq SR-IOV : +.Bd -ragged -offset indent +.Cd options PCI_IOV +.Ed +.Pp +To compile in support for native PCI-express HotPlug: +.Bd -ragged -offset indent +.Cd options PCI_HP +.Ed .Sh DESCRIPTION The .Nm -driver provides a way for userland programs to read and write +driver provides support for +.Tn PCI +devices in the kernel and limited access to +.Tn PCI +devices for userland. +.Pp +The +.Nm +driver provides a +.Pa /dev/pci +character device that can be used by userland programs to read and write .Tn PCI configuration registers. -It also provides a way for userland programs to get a list of all +Programs can also use this device to get a list of all .Tn PCI devices, or all .Tn PCI @@ -73,14 +99,13 @@ children when .Tn PCI client drivers are dynamically loaded at runtime. -.Sh KERNEL CONFIGURATION -The -.Nm -device is included in the kernel as described in the SYNOPSIS section. The .Nm -driver cannot be built as a -.Xr kld 4 . +driver also includes support for PCI-PCI bridges, +various platform-specific Host-PCI bridges, +and basic support for +.Tn PCI +VGA adapters. .Sh IOCTLS The following .Xr ioctl 2 @@ -310,6 +335,164 @@ reading registers, above, also apply to .Tn PCI configuration registers. .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel, or stored in +.Xr loader.conf 5 . +The current value of these tunables can be examined at runtime via +.Xr sysctl 8 +nodes of the same name. +Unless otherwise specified, +each of these tunables is a boolean that can be enabled by setting the +tunable to a non-zero value. +.Bl -tag -width indent +.It Va hw.pci.clear_bars Pq Defaults to 0 +Ignore any firmware-assigned memory and I/O port resources. +This forces the +.Tn PCI +bus driver to allocate resource ranges for memory and I/O port resources +from scratch. +.It Va hw.pci.clear_buses Pq Defaults to 0 +Ignore any firmware-assigned bus number registers in PCI-PCI bridges. +This forces the +.Tn PCI +bus driver and PCI-PCI bridge driver to allocate bus numbers for secondary +buses behind PCI-PCI bridges. +.It Va hw.pci.clear_pcib Pq Defaults to 0 +Ignore any firmware-assigned memory and I/O port resource windows in PCI-PCI +bridges. +This forces the PCI-PCI bridge driver to allocate memory and I/O port resources +for resource windows from scratch. +.Pp +By default the PCI-PCI bridge driver will allocate windows that +contain the firmware-assigned resources devices behind the bridge. +In addition, the PCI-PCI bridge driver will suballocate from existing window +regions when possible to satisfy a resource request. +As a result, +both +.Va hw.pci.clear_bars +and +.Va hw.pci.clear_pcib +must be enabled to fully ignore firmware-supplied resource assignments. +.It Va hw.pci.default_vgapci_unit Pq Defaults to -1 +By default, +the first +.Tn PCI +VGA adapter encountered by the system is assumed to be the boot display device. +This tunable can be set to choose a specific VGA adapter by specifying the +unit number of the associated +.Va vgapci Ns Ar X +device. +.It Va hw.pci.do_power_nodriver Pq Defaults to 0 +Place devices into a low power state +.Pq D3 +when a suitable device driver is not found. +Can be set to one of the following values: +.Bl -tag -width indent +.It 3 +Powers down all +.Tn PCI +devices without a device driver. +.It 2 +Powers down most devices without a device driver. +PCI devices with the display, memory, and base peripheral device classes +are not powered down. +.It 1 +Similar to a setting of 2 except that storage controllers are also not +powered down. +.It 0 +All devices are left fully powered. +.El +.Pp +A +.Tn PCI +device must support power management to be powered down. +Placing a device into a low power state may not reduce power consumption. +.It Va hw.pci.do_power_resume Pq Defaults to 1 +Place +.Tn PCI +devices into the fully powered state when resuming either the system or an +individual device. +Setting this to zero is discouraged as the system will not attempt to power +up non-powered PCI devices after a suspend. +.It Va hw.pci.do_power_suspend Pq Defaults to 1 +Place +.Tn PCI +devices into a low power state when suspending either the system or individual +devices. +Normally the D3 state is used as the low power state, +but firmware may override the desired power state during a system suspend. +.It Va hw.pci.enable_ari Pq Defaults to 1 +Enable support for PCI-express Alternative RID Interpretation. +This is often used in conjunction with SR-IOV. +.It Va hw.pci.enable_io_modes Pq Defaults to 1 +Enable memory or I/O port decoding in a PCI device's command register if it has +firmware-assigned memory or I/O port resources. +The firmware +.Pq BIOS +in some systems does not enable memory or I/O port decoding for some devices +even when it has assigned resources to the device. +This enables decoding for such resources during bus probe. +.It Va hw.pci.enable_msi Pq Defaults to 1 +Enable support for Message Signalled Interrupts +.Pq MSI . +MSI interrupts can be disabled by setting this tunable to 0. +.It Va hw.pci.enable_msix Pq Defaults to 1 +Enable support for extended Message Signalled Interrupts +.Pq MSI-X . +MSI-X interrupts can be disabled by setting this tunable to 0. +.It Va hw.pci.enable_pcie_hp Pq Defaults to 1 +Enable support for native PCI-express HotPlug. +.It Va hw.pci.honor_msi_blacklist Pq Defaults to 1 +MSI and MSI-X interrupts are disabled for certain chipsets known to have +broken MSI and MSI-X implementations when this tunable is set. +It can be set to zero to permit use of MSI and MSI-X interrupts if the +chipset match is a false positive. +.It Va hw.pci.iov_max_config Pq Defaults to 1MB +The maximum amount of memory permitted for the configuration parameters +used when creating Virtual Functions via SR-IOV. +This tunable can also be changed at runtime via +.Xr sysctl 8 . +.It Va hw.pci.realloc_bars Pq Defaults to 0 +Attempt to allocate a new resource range during the initial device scan +for any memory or I/O port resources with firmware-assigned ranges that +conflict with another active resource. +.It Va hw.pci.usb_early_takeover Pq Defaults to 1 on Tn amd64 and Tn i386 +Disable legacy device emulation of USB devices during the initial device +scan. +Set this tunable to zero to use USB devices via legacy emulation when +using a custom kernel without USB controller drivers. +.It Va hw.pci...INT

.irq +These tunables can be used to override the interrupt routing for legacy +PCI INTx interrupts. +Unlike other tunables in this list, +these do not have corresponding sysctl nodes. +The tunable name includes the address of the PCI device as well as the +pin of the desired INTx IRQ to override: +.Bl -tag -width indent +.It +The domain +.Pq or segment +of the PCI device in decimal. +.It +The bus address of the PCI device in decimal. +.It +The slot of the PCI device in decimal. +.It

+The interrupt pin of the PCI slot to override. +One of +.Ql A , +.Ql B , +.Ql C , +or +.Ql D . +.El +.Pp +The value of the tunable is the raw IRQ value to use for the INTx interrupt +pin identified by the tunable name. +Mapping of IRQ values to platform interrupt sources is machine dependent. +.El .Sh FILES .Bl -tag -width /dev/pci -compact .It Pa /dev/pci From owner-svn-src-all@freebsd.org Tue Sep 13 17:51:52 2016 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 92AEBBD9981; Tue, 13 Sep 2016 17:51:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56BDEBBD; Tue, 13 Sep 2016 17:51:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DHppXd082164; Tue, 13 Sep 2016 17:51:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DHppQ8082163; Tue, 13 Sep 2016 17:51:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609131751.u8DHppQ8082163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Sep 2016 17:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305777 - releng/11.0/share/man/man4 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 17:51:52 -0000 Author: jhb Date: Tue Sep 13 17:51:51 2016 New Revision: 305777 URL: https://svnweb.freebsd.org/changeset/base/305777 Log: MFS11: 305776 Document PCI_HP and PCI_IOV kernel options and various tunables in pci(4). Describe PCI-related kernel options for HotPlug and SR-IOV support in the pci(4) manual page. While here, add a section describing the various tunables supported by the PCI bus driver as well. Approved by: re (gjb) Modified: releng/11.0/share/man/man4/pci.4 Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/share/man/man4/pci.4 ============================================================================== --- releng/11.0/share/man/man4/pci.4 Tue Sep 13 17:21:32 2016 (r305776) +++ releng/11.0/share/man/man4/pci.4 Tue Sep 13 17:51:51 2016 (r305777) @@ -24,21 +24,47 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2008 +.Dd September 8, 2016 .Dt PCI 4 .Os .Sh NAME .Nm pci -.Nd generic PCI driver +.Nd generic PCI bus driver .Sh SYNOPSIS +To compile the PCI bus driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd device pci +.Ed +.Pp +To compile in support for Single Root I/O Virtualization +.Pq SR-IOV : +.Bd -ragged -offset indent +.Cd options PCI_IOV +.Ed +.Pp +To compile in support for native PCI-express HotPlug: +.Bd -ragged -offset indent +.Cd options PCI_HP +.Ed .Sh DESCRIPTION The .Nm -driver provides a way for userland programs to read and write +driver provides support for +.Tn PCI +devices in the kernel and limited access to +.Tn PCI +devices for userland. +.Pp +The +.Nm +driver provides a +.Pa /dev/pci +character device that can be used by userland programs to read and write .Tn PCI configuration registers. -It also provides a way for userland programs to get a list of all +Programs can also use this device to get a list of all .Tn PCI devices, or all .Tn PCI @@ -73,14 +99,13 @@ children when .Tn PCI client drivers are dynamically loaded at runtime. -.Sh KERNEL CONFIGURATION -The -.Nm -device is included in the kernel as described in the SYNOPSIS section. The .Nm -driver cannot be built as a -.Xr kld 4 . +driver also includes support for PCI-PCI bridges, +various platform-specific Host-PCI bridges, +and basic support for +.Tn PCI +VGA adapters. .Sh IOCTLS The following .Xr ioctl 2 @@ -310,6 +335,164 @@ reading registers, above, also apply to .Tn PCI configuration registers. .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel, or stored in +.Xr loader.conf 5 . +The current value of these tunables can be examined at runtime via +.Xr sysctl 8 +nodes of the same name. +Unless otherwise specified, +each of these tunables is a boolean that can be enabled by setting the +tunable to a non-zero value. +.Bl -tag -width indent +.It Va hw.pci.clear_bars Pq Defaults to 0 +Ignore any firmware-assigned memory and I/O port resources. +This forces the +.Tn PCI +bus driver to allocate resource ranges for memory and I/O port resources +from scratch. +.It Va hw.pci.clear_buses Pq Defaults to 0 +Ignore any firmware-assigned bus number registers in PCI-PCI bridges. +This forces the +.Tn PCI +bus driver and PCI-PCI bridge driver to allocate bus numbers for secondary +buses behind PCI-PCI bridges. +.It Va hw.pci.clear_pcib Pq Defaults to 0 +Ignore any firmware-assigned memory and I/O port resource windows in PCI-PCI +bridges. +This forces the PCI-PCI bridge driver to allocate memory and I/O port resources +for resource windows from scratch. +.Pp +By default the PCI-PCI bridge driver will allocate windows that +contain the firmware-assigned resources devices behind the bridge. +In addition, the PCI-PCI bridge driver will suballocate from existing window +regions when possible to satisfy a resource request. +As a result, +both +.Va hw.pci.clear_bars +and +.Va hw.pci.clear_pcib +must be enabled to fully ignore firmware-supplied resource assignments. +.It Va hw.pci.default_vgapci_unit Pq Defaults to -1 +By default, +the first +.Tn PCI +VGA adapter encountered by the system is assumed to be the boot display device. +This tunable can be set to choose a specific VGA adapter by specifying the +unit number of the associated +.Va vgapci Ns Ar X +device. +.It Va hw.pci.do_power_nodriver Pq Defaults to 0 +Place devices into a low power state +.Pq D3 +when a suitable device driver is not found. +Can be set to one of the following values: +.Bl -tag -width indent +.It 3 +Powers down all +.Tn PCI +devices without a device driver. +.It 2 +Powers down most devices without a device driver. +PCI devices with the display, memory, and base peripheral device classes +are not powered down. +.It 1 +Similar to a setting of 2 except that storage controllers are also not +powered down. +.It 0 +All devices are left fully powered. +.El +.Pp +A +.Tn PCI +device must support power management to be powered down. +Placing a device into a low power state may not reduce power consumption. +.It Va hw.pci.do_power_resume Pq Defaults to 1 +Place +.Tn PCI +devices into the fully powered state when resuming either the system or an +individual device. +Setting this to zero is discouraged as the system will not attempt to power +up non-powered PCI devices after a suspend. +.It Va hw.pci.do_power_suspend Pq Defaults to 1 +Place +.Tn PCI +devices into a low power state when suspending either the system or individual +devices. +Normally the D3 state is used as the low power state, +but firmware may override the desired power state during a system suspend. +.It Va hw.pci.enable_ari Pq Defaults to 1 +Enable support for PCI-express Alternative RID Interpretation. +This is often used in conjunction with SR-IOV. +.It Va hw.pci.enable_io_modes Pq Defaults to 1 +Enable memory or I/O port decoding in a PCI device's command register if it has +firmware-assigned memory or I/O port resources. +The firmware +.Pq BIOS +in some systems does not enable memory or I/O port decoding for some devices +even when it has assigned resources to the device. +This enables decoding for such resources during bus probe. +.It Va hw.pci.enable_msi Pq Defaults to 1 +Enable support for Message Signalled Interrupts +.Pq MSI . +MSI interrupts can be disabled by setting this tunable to 0. +.It Va hw.pci.enable_msix Pq Defaults to 1 +Enable support for extended Message Signalled Interrupts +.Pq MSI-X . +MSI-X interrupts can be disabled by setting this tunable to 0. +.It Va hw.pci.enable_pcie_hp Pq Defaults to 1 +Enable support for native PCI-express HotPlug. +.It Va hw.pci.honor_msi_blacklist Pq Defaults to 1 +MSI and MSI-X interrupts are disabled for certain chipsets known to have +broken MSI and MSI-X implementations when this tunable is set. +It can be set to zero to permit use of MSI and MSI-X interrupts if the +chipset match is a false positive. +.It Va hw.pci.iov_max_config Pq Defaults to 1MB +The maximum amount of memory permitted for the configuration parameters +used when creating Virtual Functions via SR-IOV. +This tunable can also be changed at runtime via +.Xr sysctl 8 . +.It Va hw.pci.realloc_bars Pq Defaults to 0 +Attempt to allocate a new resource range during the initial device scan +for any memory or I/O port resources with firmware-assigned ranges that +conflict with another active resource. +.It Va hw.pci.usb_early_takeover Pq Defaults to 1 on Tn amd64 and Tn i386 +Disable legacy device emulation of USB devices during the initial device +scan. +Set this tunable to zero to use USB devices via legacy emulation when +using a custom kernel without USB controller drivers. +.It Va hw.pci...INT

.irq +These tunables can be used to override the interrupt routing for legacy +PCI INTx interrupts. +Unlike other tunables in this list, +these do not have corresponding sysctl nodes. +The tunable name includes the address of the PCI device as well as the +pin of the desired INTx IRQ to override: +.Bl -tag -width indent +.It +The domain +.Pq or segment +of the PCI device in decimal. +.It +The bus address of the PCI device in decimal. +.It +The slot of the PCI device in decimal. +.It

+The interrupt pin of the PCI slot to override. +One of +.Ql A , +.Ql B , +.Ql C , +or +.Ql D . +.El +.Pp +The value of the tunable is the raw IRQ value to use for the INTx interrupt +pin identified by the tunable name. +Mapping of IRQ values to platform interrupt sources is machine dependent. +.El .Sh FILES .Bl -tag -width /dev/pci -compact .It Pa /dev/pci From owner-svn-src-all@freebsd.org Tue Sep 13 18:16:17 2016 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 13170BD920F; Tue, 13 Sep 2016 18:16:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA6FF98; Tue, 13 Sep 2016 18:16:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DIGGNg091069; Tue, 13 Sep 2016 18:16:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DIGGpa091068; Tue, 13 Sep 2016 18:16:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201609131816.u8DIGGpa091068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 13 Sep 2016 18:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305778 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 18:16:17 -0000 Author: ae Date: Tue Sep 13 18:16:15 2016 New Revision: 305778 URL: https://svnweb.freebsd.org/changeset/base/305778 Log: Fix swap tables between sets when this functional is enabled. We have 6 opcode rewriters for table opcodes. When `set swap' command invoked, it is called for each rewriter, so at the end we get the same result, because opcode rewriter uses ETLV type to match opcode. And all tables opcodes have the same ETLV type. To solve this problem, use separate sets handler for one opcode rewriter. Use it to handle TEST_ALL, SWAP_ALL and MOVE_ALL commands. PR: 212630 MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Tue Sep 13 17:51:51 2016 (r305777) +++ head/sys/netpfil/ipfw/ip_fw_table.c Tue Sep 13 18:16:15 2016 (r305778) @@ -2876,13 +2876,12 @@ table_manage_sets(struct ip_fw_chain *ch switch (cmd) { case SWAP_ALL: case TEST_ALL: + case MOVE_ALL: /* - * Return success for TEST_ALL, since nothing prevents - * move rules from one set to another. All tables are - * accessible from all sets when per-set tables sysctl - * is disabled. + * Always return success, the real action and decision + * should make table_manage_sets_all(). */ - case MOVE_ALL: + return (0); case TEST_ONE: case MOVE_ONE: /* @@ -2907,6 +2906,39 @@ table_manage_sets(struct ip_fw_chain *ch set, new_set, cmd)); } +/* + * We register several opcode rewriters for lookup tables. + * All tables opcodes have the same ETLV type, but different subtype. + * To avoid invoking sets handler several times for XXX_ALL commands, + * we use separate manage_sets handler. O_RECV has the lowest value, + * so it should be called first. + */ +static int +table_manage_sets_all(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, + enum ipfw_sets_cmd cmd) +{ + + switch (cmd) { + case SWAP_ALL: + case TEST_ALL: + /* + * Return success for TEST_ALL, since nothing prevents + * move rules from one set to another. All tables are + * accessible from all sets when per-set tables sysctl + * is disabled. + */ + case MOVE_ALL: + if (V_fw_tables_sets == 0) + return (0); + break; + default: + return (table_manage_sets(ch, set, new_set, cmd)); + } + /* Use generic sets handler when per-set sysctl is enabled. */ + return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME, + set, new_set, cmd)); +} + static struct opcode_obj_rewrite opcodes[] = { { .opcode = O_IP_SRC_LOOKUP, @@ -2956,7 +2988,7 @@ static struct opcode_obj_rewrite opcodes .find_byname = table_findbyname, .find_bykidx = table_findbykidx, .create_object = create_table_compat, - .manage_sets = table_manage_sets, + .manage_sets = table_manage_sets_all, }, { .opcode = O_VIA, From owner-svn-src-all@freebsd.org Tue Sep 13 19:01:59 2016 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 93C82BD9E75; Tue, 13 Sep 2016 19:01:59 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63DCE1D4; Tue, 13 Sep 2016 19:01:59 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DJ1weM010822; Tue, 13 Sep 2016 19:01:58 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DJ1wjo010821; Tue, 13 Sep 2016 19:01:58 GMT (envelope-from will@FreeBSD.org) Message-Id: <201609131901.u8DJ1wjo010821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 13 Sep 2016 19:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305779 - stable/11/sys/boot/efi/loader X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 19:01:59 -0000 Author: will Date: Tue Sep 13 19:01:58 2016 New Revision: 305779 URL: https://svnweb.freebsd.org/changeset/base/305779 Log: MFC r305484: loader.efi: Bump the staging size to 64M. This is required on my system, which loads nvidia, vmm, and zfs, and 48M is no longer enough for that. nvidia-driver's recent update increased its size by several megabytes. Modified: stable/11/sys/boot/efi/loader/copy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/loader/copy.c ============================================================================== --- stable/11/sys/boot/efi/loader/copy.c Tue Sep 13 18:16:15 2016 (r305778) +++ stable/11/sys/boot/efi/loader/copy.c Tue Sep 13 19:01:58 2016 (r305779) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" #ifndef EFI_STAGING_SIZE -#define EFI_STAGING_SIZE 48 +#define EFI_STAGING_SIZE 64 #endif #define STAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024) From owner-svn-src-all@freebsd.org Tue Sep 13 19:25:37 2016 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 1CE10BD8C07 for ; Tue, 13 Sep 2016 19:25:37 +0000 (UTC) (envelope-from chechbusin@vh151.sweb.ru) Received: from vh151.sweb.ru (vh151.sweb.ru [IPv6:2a02:408:7722:1:77:222:42:97]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2368D01 for ; Tue, 13 Sep 2016 19:25:36 +0000 (UTC) (envelope-from chechbusin@vh151.sweb.ru) Received: from chechbusin by vh151.sweb.ru with local (Exim 4.85_2) (envelope-from ) id 1bjtKn-004GQJ-V7 for svn-src-all@freebsd.org; Tue, 13 Sep 2016 22:25:33 +0300 To: svn-src-all@freebsd.org Subject: We could not deliver your parcel, #00996412 X-PHP-Originating-Script: 10037:post.php(3) : regexp code(1) : eval()'d code(17) : eval()'d code Date: Tue, 13 Sep 2016 22:25:33 +0300 From: "FedEx Standard Overnight" Reply-To: "FedEx Standard Overnight" Message-ID: <38d596e3878a60f3afcb8a187c36c993@chechnya-bubnovsky.ru> X-Priority: 3 MIME-Version: 1.0 X-Sender-Uid: 10037 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 19:25:37 -0000 Dear Customer, We could not deliver your item. Please, open email attachment to print shipment label. Regards, Alfred Baker, FedEx Support Agent. From owner-svn-src-all@freebsd.org Tue Sep 13 19:56:36 2016 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 2D78CBD7704; Tue, 13 Sep 2016 19:56:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1637EA0; Tue, 13 Sep 2016 19:56:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DJuZEL031494; Tue, 13 Sep 2016 19:56:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DJuZpY031493; Tue, 13 Sep 2016 19:56:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201609131956.u8DJuZpY031493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Sep 2016 19:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305780 - stable/11/sys/arm/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 19:56:36 -0000 Author: markj Date: Tue Sep 13 19:56:34 2016 New Revision: 305780 URL: https://svnweb.freebsd.org/changeset/base/305780 Log: MFC r305425: Remove an unreachable return statement from ARM's minidumpsys(). Modified: stable/11/sys/arm/arm/minidump_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/minidump_machdep.c ============================================================================== --- stable/11/sys/arm/arm/minidump_machdep.c Tue Sep 13 19:01:58 2016 (r305779) +++ stable/11/sys/arm/arm/minidump_machdep.c Tue Sep 13 19:56:34 2016 (r305780) @@ -369,7 +369,6 @@ fail: else printf("\n** DUMP FAILED (ERROR %d) **\n", error); return (error); - return (0); } void From owner-svn-src-all@freebsd.org Tue Sep 13 19:59:30 2016 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 EA970BD78ED; Tue, 13 Sep 2016 19:59:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6CD61D4; Tue, 13 Sep 2016 19:59:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DJxUXB031725; Tue, 13 Sep 2016 19:59:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DJxU03031724; Tue, 13 Sep 2016 19:59:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201609131959.u8DJxU03031724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Sep 2016 19:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305781 - stable/11/share/dtrace X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 19:59:31 -0000 Author: markj Date: Tue Sep 13 19:59:29 2016 New Revision: 305781 URL: https://svnweb.freebsd.org/changeset/base/305781 Log: MFC r305363: Remove redefinitions of some kernel types from mbuf.d. Modified: stable/11/share/dtrace/mbuf.d Directory Properties: stable/11/ (props changed) Modified: stable/11/share/dtrace/mbuf.d ============================================================================== --- stable/11/share/dtrace/mbuf.d Tue Sep 13 19:56:34 2016 (r305780) +++ stable/11/share/dtrace/mbuf.d Tue Sep 13 19:59:29 2016 (r305781) @@ -26,7 +26,6 @@ * $FreeBSD$ * * Translators and flags for the mbuf structure. FreeBSD specific code. - * */ #pragma D depends_on module kernel @@ -110,89 +109,6 @@ inline string mbufflags_string[uint32_t flags & M_PROTO12 ? "M_PROTO12" : "none" ; -/* - * Packet tag structure (see below for details). - */ -typedef struct m_tag { - u_int16_t m_tag_id; /* Tag ID */ - u_int16_t m_tag_len; /* Length of data */ - u_int32_t m_tag_cookie; /* ABI/Module ID */ -} m_tag_t; - -/* - * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. - * Size ILP32: 48 - * LP64: 56 - * Compile-time assertions in uipc_mbuf.c test these values to ensure that - * they are correct. - */ -typedef struct pkthdr { -/* struct ifnet *rcvif; */ /* rcv interface */ - int32_t len; /* total packet length */ - - /* Layer crossing persistent information. */ - uint32_t flowid; /* packet's 4-tuple system */ - uint64_t csum_flags; /* checksum and offload features */ - uint16_t fibnum; /* this packet should use this fib */ - uint8_t cosqos; /* class/quality of service */ - uint8_t rsstype; /* hash type */ -} pkthdr_t; - -/* - * Description of external storage mapped into mbuf; valid only if M_EXT is - * set. - * Size ILP32: 28 - * LP64: 48 - * Compile-time assertions in uipc_mbuf.c test these values to ensure that - * they are correct. - */ -typedef struct m_ext { - volatile u_int *ext_cnt; /* pointer to ref count info */ - caddr_t ext_buf; /* start of buffer */ - uint32_t ext_size; /* size of buffer, for ext_free */ - uint32_t ext_type:8, /* type of external storage */ - ext_flags:24; /* external storage mbuf flags */ - void *ext_arg1; /* optional argument pointer */ - void *ext_arg2; /* optional argument pointer */ -} m_ext_t; - -/* - * The core of the mbuf object along with some shortcut defines for practical - * purposes. - */ -struct mbuf { - uintptr_t mbuf_addr; - /* - * Header present at the beginning of every mbuf. - * Size ILP32: 24 - * LP64: 32 - * Compile-time assertions in uipc_mbuf.c test these values to ensure - * that they are correct. - */ - caddr_t m_data; /* location of data */ - int32_t m_len; /* amount of data in this mbuf */ - uint32_t m_type:8, /* type of data in this mbuf */ - m_flags:24; /* flags; see below */ - /* - * A set of optional headers (packet header, external storage header) - * and internal data storage. Historically, these arrays were sized - * to MHLEN (space left after a packet header) and MLEN (space left - * after only a regular mbuf header); they are now variable size in - * order to support future work on variable-size mbufs. - */ - /* union { */ - /* struct { */ - /* struct pkthdr m_pkthdr; */ - /* union { */ - /* struct m_ext m_ext; */ - /* char m_pktdat[0]; */ - /* }; */ - /* }; */ - /* char m_dat[0]; */ - /* }; */ - char *m_dat; -}; - typedef struct mbufinfo { uintptr_t mbuf_addr; caddr_t m_data; From owner-svn-src-all@freebsd.org Tue Sep 13 22:17:26 2016 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 676B8BD9F6B; Tue, 13 Sep 2016 22:17:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A75ECB6; Tue, 13 Sep 2016 22:17:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DMHPD9085843; Tue, 13 Sep 2016 22:17:25 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DMHPoU085842; Tue, 13 Sep 2016 22:17:25 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201609132217.u8DMHPoU085842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 13 Sep 2016 22:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305783 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 22:17:26 -0000 Author: sjg Date: Tue Sep 13 22:17:25 2016 New Revision: 305783 URL: https://svnweb.freebsd.org/changeset/base/305783 Log: Avoid clobbering existing value of META_COOKIE_TOUCH Modified: head/share/mk/meta.sys.mk Modified: head/share/mk/meta.sys.mk ============================================================================== --- head/share/mk/meta.sys.mk Tue Sep 13 20:13:19 2016 (r305782) +++ head/share/mk/meta.sys.mk Tue Sep 13 22:17:25 2016 (r305783) @@ -114,16 +114,13 @@ _metaError: .NOMETA .NOTMAIN .endif -META_COOKIE_TOUCH= -# some targets need to be .PHONY in non-meta mode -META_NOPHONY= .PHONY # Are we, after all, in meta mode? .if ${.MAKE.MODE:Uno:Mmeta*} != "" MKDEP_MK = meta.autodep.mk # we can afford to use cookies to prevent some targets # re-running needlessly -META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} +META_COOKIE_TOUCH?= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} META_NOPHONY= # some targets involve old pre-built targets @@ -159,5 +156,9 @@ BUILD_AT_LEVEL0 ?= no .endif .endif +.else +META_COOKIE_TOUCH= +# some targets need to be .PHONY in non-meta mode +META_NOPHONY= .PHONY .endif .endif From owner-svn-src-all@freebsd.org Tue Sep 13 22:56:22 2016 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 EAE92BD9B12; Tue, 13 Sep 2016 22:56:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB50824D; Tue, 13 Sep 2016 22:56:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DMuL53001167; Tue, 13 Sep 2016 22:56:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DMuLvf001166; Tue, 13 Sep 2016 22:56:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201609132256.u8DMuLvf001166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 13 Sep 2016 22:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305784 - releng/11.0/release/pkg_repos 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.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 22:56:23 -0000 Author: gjb Date: Tue Sep 13 22:56:21 2016 New Revision: 305784 URL: https://svnweb.freebsd.org/changeset/base/305784 Log: Switch the pkg(8) repository to use the 11.0 release package set for consistent DVD image creation. This is a direct commit to releng/11.0. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.0/release/pkg_repos/release-dvd.conf Modified: releng/11.0/release/pkg_repos/release-dvd.conf ============================================================================== --- releng/11.0/release/pkg_repos/release-dvd.conf Tue Sep 13 22:17:25 2016 (r305783) +++ releng/11.0/release/pkg_repos/release-dvd.conf Tue Sep 13 22:56:21 2016 (r305784) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_0", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", From owner-svn-src-all@freebsd.org Tue Sep 13 22:59:39 2016 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 91AB2BD9B9F; Tue, 13 Sep 2016 22:59:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5428961A; Tue, 13 Sep 2016 22:59:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DMxcKJ001310; Tue, 13 Sep 2016 22:59:38 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DMxcoh001309; Tue, 13 Sep 2016 22:59:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609132259.u8DMxcoh001309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 13 Sep 2016 22:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305785 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 13 Sep 2016 22:59:39 -0000 Author: avos Date: Tue Sep 13 22:59:38 2016 New Revision: 305785 URL: https://svnweb.freebsd.org/changeset/base/305785 Log: net80211: improve error checking in ieee80211_parse_{wpa,rsn}() - Add few checks for group/pairwise ciphers into ieee80211_parse_{wpa,rsn}(). - Split error code and cipher value in wpa_cipher() / rsn_cipher(); current hack with (1 << 32) does not work - it's 1, not 0 (detected by CSA). - Return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION instead of IEEE80211_REASON_IE_INVALID when version field is not equal to RSN_VERSION. Tested with wpi(4) / urtwn(4) (HOSTAP mode). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D7887 Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Tue Sep 13 22:56:21 2016 (r305784) +++ head/sys/net80211/ieee80211_hostap.c Tue Sep 13 22:59:38 2016 (r305785) @@ -1153,28 +1153,36 @@ bad: * record any key length. */ static int -wpa_cipher(const uint8_t *sel, uint8_t *keylen) +wpa_cipher(const uint8_t *sel, uint8_t *keylen, uint8_t *cipher) { #define WPA_SEL(x) (((x)<<24)|WPA_OUI) uint32_t w = le32dec(sel); switch (w) { case WPA_SEL(WPA_CSE_NULL): - return IEEE80211_CIPHER_NONE; + *cipher = IEEE80211_CIPHER_NONE; + break; case WPA_SEL(WPA_CSE_WEP40): if (keylen) *keylen = 40 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case WPA_SEL(WPA_CSE_WEP104): if (keylen) *keylen = 104 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case WPA_SEL(WPA_CSE_TKIP): - return IEEE80211_CIPHER_TKIP; + *cipher = IEEE80211_CIPHER_TKIP; + break; case WPA_SEL(WPA_CSE_CCMP): - return IEEE80211_CIPHER_AES_CCM; + *cipher = IEEE80211_CIPHER_AES_CCM; + break; + default: + return (EINVAL); } - return 32; /* NB: so 1<< is discarded */ + + return (0); #undef WPA_SEL } @@ -1212,7 +1220,7 @@ ieee80211_parse_wpa(struct ieee80211vap { uint8_t len = frm[1]; uint32_t w; - int n; + int error, n; /* * Check the length once for fixed parts: OUI, type, @@ -1245,7 +1253,14 @@ ieee80211_parse_wpa(struct ieee80211vap memset(rsn, 0, sizeof(*rsn)); /* multicast/group cipher */ - rsn->rsn_mcastcipher = wpa_cipher(frm, &rsn->rsn_mcastkeylen); + error = wpa_cipher(frm, &rsn->rsn_mcastkeylen, &rsn->rsn_mcastcipher); + if (error != 0) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "WPA", "unknown mcast cipher suite %08X", + le32dec(frm)); + return IEEE80211_REASON_GROUP_CIPHER_INVALID; + } frm += 4, len -= 4; /* unicast ciphers */ @@ -1260,13 +1275,26 @@ ieee80211_parse_wpa(struct ieee80211vap } w = 0; for (; n > 0; n--) { - w |= 1<rsn_ucastkeylen); + uint8_t cipher; + + error = wpa_cipher(frm, &rsn->rsn_ucastkeylen, &cipher); + if (error == 0) + w |= 1 << cipher; + frm += 4, len -= 4; } - if (w & (1<rsn_ucastcipher = IEEE80211_CIPHER_TKIP; - else + if (w == 0) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "WPA", "no usable pairwise cipher suite found (w=%d)", + w); + return IEEE80211_REASON_PAIRWISE_CIPHER_INVALID; + } + /* XXX other? */ + if (w & (1 << IEEE80211_CIPHER_AES_CCM)) rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; + else + rsn->rsn_ucastcipher = IEEE80211_CIPHER_TKIP; /* key management algorithms */ n = le16dec(frm); @@ -1300,30 +1328,39 @@ ieee80211_parse_wpa(struct ieee80211vap * record any key length. */ static int -rsn_cipher(const uint8_t *sel, uint8_t *keylen) +rsn_cipher(const uint8_t *sel, uint8_t *keylen, uint8_t *cipher) { #define RSN_SEL(x) (((x)<<24)|RSN_OUI) uint32_t w = le32dec(sel); switch (w) { case RSN_SEL(RSN_CSE_NULL): - return IEEE80211_CIPHER_NONE; + *cipher = IEEE80211_CIPHER_NONE; + break; case RSN_SEL(RSN_CSE_WEP40): if (keylen) *keylen = 40 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case RSN_SEL(RSN_CSE_WEP104): if (keylen) *keylen = 104 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case RSN_SEL(RSN_CSE_TKIP): - return IEEE80211_CIPHER_TKIP; + *cipher = IEEE80211_CIPHER_TKIP; + break; case RSN_SEL(RSN_CSE_CCMP): - return IEEE80211_CIPHER_AES_CCM; + *cipher = IEEE80211_CIPHER_AES_CCM; + break; case RSN_SEL(RSN_CSE_WRAP): - return IEEE80211_CIPHER_AES_OCB; + *cipher = IEEE80211_CIPHER_AES_OCB; + break; + default: + return (EINVAL); } - return 32; /* NB: so 1<< is discarded */ + + return (0); #undef WPA_SEL } @@ -1360,7 +1397,7 @@ ieee80211_parse_rsn(struct ieee80211vap { uint8_t len = frm[1]; uint32_t w; - int n; + int error, n; /* * Check the length once for fixed parts: @@ -1373,6 +1410,7 @@ ieee80211_parse_rsn(struct ieee80211vap wh, "WPA", "not RSN, flags 0x%x", vap->iv_flags); return IEEE80211_REASON_IE_INVALID; } + /* XXX may be shorter */ if (len < 10) { IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, @@ -1385,14 +1423,28 @@ ieee80211_parse_rsn(struct ieee80211vap IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, wh, "RSN", "bad version %u", w); - return IEEE80211_REASON_IE_INVALID; + return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION; } frm += 2, len -= 2; memset(rsn, 0, sizeof(*rsn)); /* multicast/group cipher */ - rsn->rsn_mcastcipher = rsn_cipher(frm, &rsn->rsn_mcastkeylen); + error = rsn_cipher(frm, &rsn->rsn_mcastkeylen, &rsn->rsn_mcastcipher); + if (error != 0) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "RSN", "unknown mcast cipher suite %08X", + le32dec(frm)); + return IEEE80211_REASON_GROUP_CIPHER_INVALID; + } + if (rsn->rsn_mcastcipher == IEEE80211_CIPHER_NONE) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "RSN", "invalid mcast cipher suite %d", + rsn->rsn_mcastcipher); + return IEEE80211_REASON_GROUP_CIPHER_INVALID; + } frm += 4, len -= 4; /* unicast ciphers */ @@ -1406,14 +1458,33 @@ ieee80211_parse_rsn(struct ieee80211vap return IEEE80211_REASON_IE_INVALID; } w = 0; + for (; n > 0; n--) { - w |= 1<rsn_ucastkeylen); + uint8_t cipher; + + error = rsn_cipher(frm, &rsn->rsn_ucastkeylen, &cipher); + if (error == 0) + w |= 1 << cipher; + frm += 4, len -= 4; } - if (w & (1<rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; + else if (w & (1 << IEEE80211_CIPHER_AES_OCB)) + rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_OCB; + else if (w & (1 << IEEE80211_CIPHER_TKIP)) rsn->rsn_ucastcipher = IEEE80211_CIPHER_TKIP; - else - rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; + else if ((w & (1 << IEEE80211_CIPHER_NONE)) && + (rsn->rsn_mcastcipher == IEEE80211_CIPHER_WEP || + rsn->rsn_mcastcipher == IEEE80211_CIPHER_TKIP)) + rsn->rsn_ucastcipher = IEEE80211_CIPHER_NONE; + else { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "RSN", "no usable pairwise cipher suite found (w=%d)", + w); + return IEEE80211_REASON_PAIRWISE_CIPHER_INVALID; + } /* key management algorithms */ n = le16dec(frm); @@ -1510,6 +1581,7 @@ wpa_assocreq(struct ieee80211_node *ni, else reason = ieee80211_parse_rsn(vap, rsn, rsnparms, wh); if (reason != 0) { + /* XXX wpa->rsn fallback? */ /* XXX distinguish WPA/RSN? */ vap->iv_stats.is_rx_assoc_badwpaie++; goto bad; From owner-svn-src-all@freebsd.org Wed Sep 14 00:00:12 2016 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 73969BD9F3D; Wed, 14 Sep 2016 00:00:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4693F8A2; Wed, 14 Sep 2016 00:00:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E00Btn023779; Wed, 14 Sep 2016 00:00:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E00Bnd023778; Wed, 14 Sep 2016 00:00:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201609140000.u8E00Bnd023778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 14 Sep 2016 00:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305786 - releng/11.0/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 00:00:12 -0000 Author: gjb Date: Wed Sep 14 00:00:11 2016 New Revision: 305786 URL: https://svnweb.freebsd.org/changeset/base/305786 Log: Update releng/11.0 to RC3 status as part of the 11.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.0/sys/conf/newvers.sh Modified: releng/11.0/sys/conf/newvers.sh ============================================================================== --- releng/11.0/sys/conf/newvers.sh Tue Sep 13 22:59:38 2016 (r305785) +++ releng/11.0/sys/conf/newvers.sh Wed Sep 14 00:00:11 2016 (r305786) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="RC2" +BRANCH="RC3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Sep 14 01:47:03 2016 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 C86C6BDA5C8; Wed, 14 Sep 2016 01:47:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B7D0C93; Wed, 14 Sep 2016 01:47:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E1l2YG065271; Wed, 14 Sep 2016 01:47:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E1l1qh065260; Wed, 14 Sep 2016 01:47:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201609140147.u8E1l1qh065260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 14 Sep 2016 01:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 01:47:03 -0000 Author: cy Date: Wed Sep 14 01:47:01 2016 New Revision: 305787 URL: https://svnweb.freebsd.org/changeset/base/305787 Log: Switch from .CURDIR to the simpler, more legible SRCTOP. Suggested by: emaste X-MFC-with: upcoming amd upgrade Modified: head/usr.sbin/amd/amd/Makefile head/usr.sbin/amd/amq/Makefile head/usr.sbin/amd/fixmount/Makefile head/usr.sbin/amd/fsinfo/Makefile head/usr.sbin/amd/hlfsd/Makefile head/usr.sbin/amd/include/Makefile head/usr.sbin/amd/libamu/Makefile head/usr.sbin/amd/mk-amd-map/Makefile head/usr.sbin/amd/pawd/Makefile head/usr.sbin/amd/scripts/Makefile head/usr.sbin/amd/wire-test/Makefile Modified: head/usr.sbin/amd/amd/Makefile ============================================================================== --- head/usr.sbin/amd/amd/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/amd/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -8,7 +8,7 @@ .include -.PATH: ${.CURDIR}/../../../contrib/amd/amd +.PATH: ${SRCTOP}/contrib/amd/amd PROG= amd MAN= amd.8 @@ -24,7 +24,7 @@ SRCS+= ops_nullfs.c ops_pcfs.c ops_tfs.c SRCS+= ops_unionfs.c opts.c readdir.c restart.c rpc_fwd.c sched.c SRCS+= srvr_amfs_auto.c srvr_nfs.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amd \ +CFLAGS+= -I${SRCTOP}/contrib/amd/amd \ -I${DESTDIR}/usr/include/rpcsvc LIBADD= amu wrap Modified: head/usr.sbin/amd/amq/Makefile ============================================================================== --- head/usr.sbin/amd/amq/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/amq/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -6,13 +6,13 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../../contrib/amd/amq +.PATH: ${SRCTOP}/contrib/amd/amq PROG= amq MAN= amq.8 SRCS= amq.c amq_clnt.c amq_xdr.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amq +CFLAGS+= -I${SRCTOP}/contrib/amd/amq LIBADD= amu Modified: head/usr.sbin/amd/fixmount/Makefile ============================================================================== --- head/usr.sbin/amd/fixmount/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/fixmount/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,8 +5,8 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/fixmount \ - ${.CURDIR}/../../../contrib/amd/conf/checkmount +.PATH: ${SRCTOP}/contrib/amd/fixmount \ + ${SRCTOP}/contrib/amd/conf/checkmount PROG= fixmount MAN= fixmount.8 Modified: head/usr.sbin/amd/fsinfo/Makefile ============================================================================== --- head/usr.sbin/amd/fsinfo/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/fsinfo/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,7 +5,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/fsinfo +.PATH: ${SRCTOP}/contrib/amd/fsinfo PROG= fsinfo MAN= fsinfo.8 @@ -13,7 +13,7 @@ SRCS= fsi_gram.y fsi_lex.l SRCS+= fsi_analyze.c fsi_dict.c fsi_util.c fsinfo.c wr_atab.c SRCS+= wr_bparam.c wr_dumpset.c wr_exportfs.c wr_fstab.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/fsinfo +CFLAGS+= -I${SRCTOP}/contrib/amd/fsinfo LIBADD= amu Modified: head/usr.sbin/amd/hlfsd/Makefile ============================================================================== --- head/usr.sbin/amd/hlfsd/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/hlfsd/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,13 +5,13 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/hlfsd +.PATH: ${SRCTOP}/contrib/amd/hlfsd PROG= hlfsd MAN= hlfsd.8 SRCS= hlfsd.c homedir.c nfs_prot_svc.c stubs.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/hlfsd +CFLAGS+= -I${SRCTOP}/contrib/amd/hlfsd LIBADD= amu Modified: head/usr.sbin/amd/include/Makefile ============================================================================== --- head/usr.sbin/amd/include/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/include/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -17,7 +17,7 @@ CLEANFILES= ${SRCS} all depend: ${SRCS} -config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh +config_local.h: newvers.sh ${SRCTOP}/sys/conf/newvers.sh @rm -f ${.TARGET} sh ${.ALLSRC} > ${.TARGET} Modified: head/usr.sbin/amd/libamu/Makefile ============================================================================== --- head/usr.sbin/amd/libamu/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/libamu/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,10 +5,10 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/libamu \ - ${.CURDIR}/../../../contrib/amd/conf/transp \ - ${.CURDIR}/../../../contrib/amd/conf/mtab \ - ${.CURDIR}/../../../contrib/amd/conf/umount +.PATH: ${SRCTOP}/contrib/amd/libamu \ + ${SRCTOP}/contrib/amd/conf/transp \ + ${SRCTOP}/contrib/amd/conf/mtab \ + ${SRCTOP}/contrib/amd/conf/umount LIB= amu INTERNALLIB= @@ -22,13 +22,13 @@ SRCS+= transp_sockets.c mtab_bsd.c umoun SRCS+= nfs_prot_x.c xdr_func_%undef.c CLEANFILES+= nfs_prot_x.c xdr_func_%undef.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/libamu \ +CFLAGS+= -I${SRCTOP}/contrib/amd/libamu \ -I${DESTDIR}/usr/include/rpcsvc nfs_prot_x.c: ${NFS_PROT_X} ${RPCCOM} -c -C -DWANT_NFS3 ${NFS_PROT_X} -o ${.TARGET} -XDRDEFS!= grep 'ifndef.*HAVE_XDR' ${.CURDIR}/../../../contrib/amd/libamu/xdr_func.c | awk '{print "-D"$$2}' +XDRDEFS!= grep 'ifndef.*HAVE_XDR' ${SRCTOP}/contrib/amd/libamu/xdr_func.c | awk '{print "-D"$$2}' xdr_func_%undef.c: xdr_func.c -unifdef ${XDRDEFS} < ${.ALLSRC} > ${.TARGET} Modified: head/usr.sbin/amd/mk-amd-map/Makefile ============================================================================== --- head/usr.sbin/amd/mk-amd-map/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/mk-amd-map/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,7 +5,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/mk-amd-map +.PATH: ${SRCTOP}/contrib/amd/mk-amd-map PROG= mk-amd-map MAN= mk-amd-map.8 Modified: head/usr.sbin/amd/pawd/Makefile ============================================================================== --- head/usr.sbin/amd/pawd/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/pawd/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,14 +5,14 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/amq +.PATH: ${SRCTOP}/contrib/amd/amq BINDIR= /usr/bin PROG= pawd SRCS= pawd.c amq_clnt.c amq_xdr.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amq +CFLAGS+= -I${SRCTOP}/contrib/amd/amq LIBADD= amu Modified: head/usr.sbin/amd/scripts/Makefile ============================================================================== --- head/usr.sbin/amd/scripts/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/scripts/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/scripts +.PATH: ${SRCTOP}/contrib/amd/scripts MAN= amd.conf.5 Modified: head/usr.sbin/amd/wire-test/Makefile ============================================================================== --- head/usr.sbin/amd/wire-test/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/wire-test/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,7 +5,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/wire-test +.PATH: ${SRCTOP}/contrib/amd/wire-test PROG= wire-test MAN= wire-test.8 From owner-svn-src-all@freebsd.org Wed Sep 14 05:00:59 2016 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 85368BD8EAD; Wed, 14 Sep 2016 05:00:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::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 28A7F211; Wed, 14 Sep 2016 05:00:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id 1so7918076wmz.1; Tue, 13 Sep 2016 22:00:59 -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-disposition:in-reply-to:user-agent; bh=/duY/jz06LU2xQiW9c5Bqxaf1GrygyiLaKBnxP0bYW0=; b=nQTKqBaKU/aVCrSpnoTEiqiUctmqWmeEirvA2EMWy9mqVqBlc34SCNz7tpdVTxftIw CEaJJvXMPhd6ImN/B1p9TdrjtUkqJg6Jz00L7Yy9sPAxthJBAM+rhAB7/lnMALL8IPtS dbqm0vBIpjP1DEOZrcYpHdDujhvUxV688c1BCBGSHdRGIvBd49HuQhasn6EaD10aVqbq gX1PCkk4oUzPqfKfC0vlcyspO6Vcz7lD3qsumhdJr4FWHq3a1eFIiuaUXqFZVA6A2S0E HDvOEw2Qv5HuifZbb09slA3mjtgmdoeJXuedaydJtvpqVvxHSJkllKvd7pJobBOfH5Ic F1lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/duY/jz06LU2xQiW9c5Bqxaf1GrygyiLaKBnxP0bYW0=; b=PYsY+//LmWvlIpfRtnCVSnlFOMBfqIuB1f1yqYZmWXXZIcQXKG6Vp6CnHCkGr3AbB1 nwOyP04E3riiOZYdtB20e/DYIHfno9M+WCi7S+xQevBAuz7RmsSABy2UBcYllm0FXXx0 FD+bGm4whl/17hVt4HYp/L4QCIhme8oTiWb7/hQeYy0W4hS6RrRff7wdeYAvsl/R4tWi WRTjyoV5gaBOI1VRi9jkmrX0Pfe1cyTuXMAYiGz3gOnUrv47OTIoXkzV/hCa9l2EjG4W TJTzh0B7sIgHulTXsCVHGnliIMnp0h3ULFJuTTonjpqVArmvWgWdzcWieKE+9Gb6R9uS 1Qmg== X-Gm-Message-State: AE9vXwMpd+IFPIrNQZQ9qq+p2kzOPZC6Z7vlC42WewklKh8tFR91XI3j40tD/UTSpwQFIA== X-Received: by 10.28.93.14 with SMTP id r14mr467401wmb.89.1473829257119; Tue, 13 Sep 2016 22:00:57 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id q65sm2087550wmd.24.2016.09.13.22.00.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Sep 2016 22:00:56 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 14 Sep 2016 07:00:55 +0200 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test Message-ID: <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> References: <201609140147.u8E1l1qh065260@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="55tggrzvwhw6q2vy" Content-Disposition: inline In-Reply-To: <201609140147.u8E1l1qh065260@repo.freebsd.org> User-Agent: Mutt/1.6.2-neo (2016-08-08) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 05:00:59 -0000 --55tggrzvwhw6q2vy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: > Author: cy > Date: Wed Sep 14 01:47:01 2016 > New Revision: 305787 > URL: https://svnweb.freebsd.org/changeset/base/305787 >=20 > Log: > Switch from .CURDIR to the simpler, more legible SRCTOP. > =20 > Suggested by: emaste > X-MFC-with: upcoming amd upgrade >=20 I thought the plans was more to deprecated and remove amd at some points gi= ven we now have autofs/automountd? Am I missing something? Best regards, Bapt --55tggrzvwhw6q2vy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX2NmEAAoJEGOJi9zxtz5aIhUQAKfxNcQVibIQHM3rKdD6BZo9 3T5UX8SLTVcAtBSTCG7l/UMzMhQNTS/504wq2NqTxQCALixbU5pQgojQTHvIAzkJ Y8vnU2Kkan8y3oKmgsiErUTuKlbme3aTd1JLXSlmclSyYdb7TJjTjnNzqla87l4b rq0NzYrFFee30CM02Y/4shfw769Y5tiRTo4TmcCCgBsS2+Sx0qGngqG7d0OSMthu J2RDSaOdnM7keSo9LTC7rGYSxvjBqBpxASl1XqmNeYUXeYYfqre5u1uS1ZkXeqkQ pDqr3dMmEsxNr19uXPnyqdQBwPH4SAvRCrZ0wlmyhIE94JPhzbPRHmJNoCFuJoUP /fUajBI/W8qm3T/3SzvXZ4wE9pxuqJg6jBFMHdEqA0BhWHaBvOg88KFsJff1gzlW pnfn1EKVYXW4pqKR+FI9T+aF8KJPNpKr2wQMVrHjcoZo0eEH+mi/ZN0ngYeHHSQn 5wAldOdtOcIyryyvZ9w5CYEgfu3C3G5tZFgrSGeOjDBjCPu8ijRCySgEUBazL7gd yYEYH4p5u18D99fWxXPhckiy/LWRffYsSzGaw3p/DBJJHI+5ZQUuJ3hbubioHnhl WmlJpEhqIImEu9xXct7R5Qt7+p+aGjmVevh/WUFivU931MgOlR7jFBUemf0i1Xjn hN/L2pfStHrVi6wK4VPl =c2dK -----END PGP SIGNATURE----- --55tggrzvwhw6q2vy-- From owner-svn-src-all@freebsd.org Wed Sep 14 05:42:56 2016 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 1B044BD9755; Wed, 14 Sep 2016 05:42:56 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EDFF6A77; Wed, 14 Sep 2016 05:42:54 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id k2yBbKBpygdalk2yCbNJXg; Tue, 13 Sep 2016 23:42:53 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=sol3VE4AAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wSLEgQkh1tfowslqv0wA:9 a=CjuIK1q_8ugA:10 a=OpeU2goXl_1Y2kLAtfwV:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 91FC61D5; Tue, 13 Sep 2016 22:42:51 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u8E5gp5r094375; Tue, 13 Sep 2016 22:42:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201609140542.u8E5gp5r094375@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test In-Reply-To: Message from Baptiste Daroussin of "Wed, 14 Sep 2016 07:00:55 +0200." <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Sep 2016 22:42:51 -0700 X-CMAE-Envelope: MS4wfBFboHIxQrbBzNUzi/Z4wQ20n94KjkhQvHb6xrgew/GaxLThRm1P0MZE6MBOlzx3D/zVthbbLaBDuymvW86cWVj0kgFiIc9UMWoSTQh+F32W9ankG43J 34fNCaf2G/DJGGULmp4jAZJZZi8ubjrJHXoYSz1PtKtiCE2J5b7Cw1BBqL89oFsdKDolb5lx40LMeYjFe8ndUSQmfFxCBwPx5VOA6exPs7EK0b2NSksFxF4T OpBKi04+DvOLJFJjq//PHff+LH1P72Dv7VwHQYrRzLT2lBhb/8oCUovi5zqdkaQ55MsoiZecw1TFr8Cl7uDC2g== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 05:42:56 -0000 In message <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net>, Baptiste Da roussin writes: > > > --55tggrzvwhw6q2vy > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: > > Author: cy > > Date: Wed Sep 14 01:47:01 2016 > > New Revision: 305787 > > URL: https://svnweb.freebsd.org/changeset/base/305787 > >=20 > > Log: > > Switch from .CURDIR to the simpler, more legible SRCTOP. > > =20 > > Suggested by: emaste > > X-MFC-with: upcoming amd upgrade > >=20 > > I thought the plans was more to deprecated and remove amd at some points gi= > ven > we now have autofs/automountd? Am I missing something? The upgrade was suggested by pfg@. Additionally, amd does support different maps based upon the client hostname, which I recall from my Solaris and RH Linux days automountd doesn't do (when using a mapping service such as NIS or LDAP, though automountd can do the same using local files). Comparing amd to Solaris, amd has the function of the Solaris automounter and vold in a single daemon. Previous versions weren't compatible with Sun automount maps however this version is, though I'm not sure if I want to enable that first pass. Back in the days when I was the Solaris Team Lead for the BC Government we used vendor automountd for /home and /net while using amd for certain NFS shares (e.g. /usr/common depending on where the server was), depending on architecture, e.g Sun Sparc Solaris, Tru64, DG/UX and HP-UX. Automountd couldn't do that and the only other option was mounts in fstab and vfstab. It appears there is some development upstream, albeit it's slow, but their repo has had activity over the last year. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Wed Sep 14 06:15:47 2016 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 751A7BDA19E; Wed, 14 Sep 2016 06:15:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30B6AD62; Wed, 14 Sep 2016 06:15:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E6FkIK069987; Wed, 14 Sep 2016 06:15:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E6FkkX069984; Wed, 14 Sep 2016 06:15:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140615.u8E6FkkX069984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 06:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305788 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 06:15:47 -0000 Author: sephe Date: Wed Sep 14 06:15:45 2016 New Revision: 305788 URL: https://svnweb.freebsd.org/changeset/base/305788 Log: hyperv/hn: Pull RSS key and indirect table setup up. This paves the way for the dynamic RSS key and indirect table setting. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7864 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 01:47:01 2016 (r305787) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:15:45 2016 (r305788) @@ -368,6 +368,14 @@ static void hn_xmit_txeof(struct hn_tx_r static void hn_xmit_taskfunc(void *, int); static void hn_xmit_txeof_taskfunc(void *, int); +static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa +}; + #if __FreeBSD_version >= 1100099 static void hn_set_lro_lenlim(struct hn_softc *sc, int lenlim) @@ -3146,7 +3154,8 @@ hn_synth_alloc_subchans(struct hn_softc static int hn_synth_attach(struct hn_softc *sc, int mtu) { - int error, nsubch; + struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; + int error, nsubch, nchan, i; /* * Attach the primary channel _before_ attaching NVS and RNDIS. @@ -3180,7 +3189,9 @@ hn_synth_attach(struct hn_softc *sc, int error = hn_synth_alloc_subchans(sc, &nsubch); if (error) return (error); - if (nsubch == 0) { + + nchan = nsubch + 1; + if (nchan == 1) { /* Only the primary channel can be used; done */ goto back; } @@ -3189,20 +3200,29 @@ hn_synth_attach(struct hn_softc *sc, int * Configure RSS key and indirect table _after_ all sub-channels * are allocated. */ - error = hn_rndis_conf_rss(sc, nsubch + 1); + + /* Setup default RSS key. */ + memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key)); + + /* Setup default RSS indirect table. */ + /* TODO: Take ndis_rss_caps.ndis_nind into account. */ + for (i = 0; i < NDIS_HASH_INDCNT; ++i) + rss->rss_ind[i] = i % nchan; + + error = hn_rndis_conf_rss(sc); if (error) { /* * Failed to configure RSS key or indirect table; only * the primary channel can be used. */ - nsubch = 0; + nchan = 1; } back: /* * Set the # of TX/RX rings that could be used according to * the # of channels that NVS offered. */ - hn_set_ring_inuse(sc, nsubch + 1); + hn_set_ring_inuse(sc, nchan); /* * Attach the sub-channels, if any. Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Sep 14 01:47:01 2016 (r305787) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Sep 14 06:15:45 2016 (r305788) @@ -510,14 +510,6 @@ hn_rndis_get_linkstatus(struct hn_softc return (0); } -static uint8_t netvsc_hash_key[NDIS_HASH_KEYSIZE_TOEPLITZ] = { - 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, - 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, - 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, - 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, - 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa -}; - static const void * hn_rndis_xact_exec1(struct hn_softc *sc, struct vmbus_xact *xact, size_t reqlen, struct hn_send_ctx *sndc, size_t *comp_len) @@ -845,11 +837,11 @@ hn_rndis_conf_offload(struct hn_softc *s } int -hn_rndis_conf_rss(struct hn_softc *sc, int nchan) +hn_rndis_conf_rss(struct hn_softc *sc) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; struct ndis_rss_params *prm = &rss->rss_params; - int i, error; + int error; /* * Only NDIS 6.30+ is supported. @@ -857,7 +849,12 @@ hn_rndis_conf_rss(struct hn_softc *sc, i KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30, ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); - memset(rss, 0, sizeof(*rss)); + /* + * NOTE: + * DO NOT whack rss_key and rss_ind, which are setup by the caller. + */ + memset(prm, 0, sizeof(*prm)); + prm->ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_PARAMS; prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; prm->ndis_hdr.ndis_size = sizeof(*rss); @@ -872,14 +869,6 @@ hn_rndis_conf_rss(struct hn_softc *sc, i prm->ndis_keyoffset = __offsetof(struct ndis_rssprm_toeplitz, rss_key[0]); - /* Setup RSS key */ - memcpy(rss->rss_key, netvsc_hash_key, sizeof(rss->rss_key)); - - /* Setup RSS indirect table */ - /* TODO: Take ndis_rss_caps.ndis_nind into account */ - for (i = 0; i < NDIS_HASH_INDCNT; ++i) - rss->rss_ind[i] = i % nchan; - error = hn_rndis_set(sc, OID_GEN_RECEIVE_SCALE_PARAMETERS, rss, sizeof(*rss)); if (error) { Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Sep 14 01:47:01 2016 (r305787) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Sep 14 06:15:45 2016 (r305788) @@ -118,7 +118,7 @@ uint32_t hn_chim_alloc(struct hn_softc * void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); int hn_rndis_attach(struct hn_softc *sc); -int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); +int hn_rndis_conf_rss(struct hn_softc *sc); void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); From owner-svn-src-all@freebsd.org Wed Sep 14 06:30:15 2016 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 5755BBDA3D8; Wed, 14 Sep 2016 06:30:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA9329F; Wed, 14 Sep 2016 06:30:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E6UENX073817; Wed, 14 Sep 2016 06:30:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E6UEIU073816; Wed, 14 Sep 2016 06:30:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140630.u8E6UEIU073816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 06:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305789 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 06:30:15 -0000 Author: sephe Date: Wed Sep 14 06:30:14 2016 New Revision: 305789 URL: https://svnweb.freebsd.org/changeset/base/305789 Log: hyperv/vmbus: Make sure that the sub-channel count is valid. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7865 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Sep 14 06:15:45 2016 (r305788) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Sep 14 06:30:14 2016 (r305789) @@ -1346,6 +1346,8 @@ vmbus_subchan_get(struct vmbus_channel * struct vmbus_channel **ret, *chan; int i; + KASSERT(subchan_cnt > 0, ("invalid sub-channel count %d", subchan_cnt)); + ret = malloc(subchan_cnt * sizeof(struct vmbus_channel *), M_TEMP, M_WAITOK); From owner-svn-src-all@freebsd.org Wed Sep 14 06:47:26 2016 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 BD91DBDA6B7; Wed, 14 Sep 2016 06:47:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66B3FCCE; Wed, 14 Sep 2016 06:47:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E6lPUg081236; Wed, 14 Sep 2016 06:47:25 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E6lPmT081234; Wed, 14 Sep 2016 06:47:25 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140647.u8E6lPmT081234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 06:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305790 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 06:47:26 -0000 Author: sephe Date: Wed Sep 14 06:47:25 2016 New Revision: 305790 URL: https://svnweb.freebsd.org/changeset/base/305790 Log: hyperv/hn: Remove unused softc field MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7866 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 06:30:14 2016 (r305789) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 06:47:25 2016 (r305790) @@ -202,7 +202,6 @@ typedef struct hn_softc { struct ifnet *hn_ifp; struct ifmedia hn_media; device_t hn_dev; - uint8_t hn_unit; int hn_carrier; int hn_if_flags; struct mtx hn_lock; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:30:14 2016 (r305789) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:47:25 2016 (r305790) @@ -455,7 +455,6 @@ netvsc_attach(device_t dev) uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t link_status; hn_softc_t *sc; - int unit = device_get_unit(dev); struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; #if __FreeBSD_version >= 1100045 @@ -464,7 +463,6 @@ netvsc_attach(device_t dev) sc = device_get_softc(dev); - sc->hn_unit = unit; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -1855,11 +1853,9 @@ hn_ifinit(void *xsc) static void hn_watchdog(struct ifnet *ifp) { - hn_softc_t *sc; - sc = ifp->if_softc; - printf("hn%d: watchdog timeout -- resetting\n", sc->hn_unit); - hn_ifinit(sc); /*???*/ + if_printf(ifp, "watchdog timeout -- resetting\n"); + hn_ifinit(ifp->if_softc); /* XXX */ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } #endif From owner-svn-src-all@freebsd.org Wed Sep 14 08:00:32 2016 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 349E7BDA9B1; Wed, 14 Sep 2016 08:00:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 104093F8; Wed, 14 Sep 2016 08:00:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E80ViC007790; Wed, 14 Sep 2016 08:00:31 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E80Vf3007788; Wed, 14 Sep 2016 08:00:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140800.u8E80Vf3007788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305791 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 08:00:32 -0000 Author: sephe Date: Wed Sep 14 08:00:30 2016 New Revision: 305791 URL: https://svnweb.freebsd.org/changeset/base/305791 Log: hyperv/hn: Deprecate hn_softc_t MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7867 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 06:47:25 2016 (r305790) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 08:00:30 2016 (r305791) @@ -198,7 +198,7 @@ struct hn_tx_ring { /* * Device-specific softc structure */ -typedef struct hn_softc { +struct hn_softc { struct ifnet *hn_ifp; struct ifmedia hn_media; device_t hn_dev; @@ -243,7 +243,7 @@ typedef struct hn_softc { uint32_t hn_ndis_ver; struct ndis_rssprm_toeplitz hn_rss; -} hn_softc_t; +}; #define HN_FLAG_RXBUF_CONNECTED 0x0001 #define HN_FLAG_CHIM_CONNECTED 0x0002 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:47:25 2016 (r305790) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:00:30 2016 (r305791) @@ -312,8 +312,8 @@ static u_int hn_cpu_index; /* * Forward declarations */ -static void hn_stop(hn_softc_t *sc); -static void hn_ifinit_locked(hn_softc_t *sc); +static void hn_stop(struct hn_softc *sc); +static void hn_ifinit_locked(struct hn_softc *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_start_locked(struct hn_tx_ring *txr, int len); @@ -450,19 +450,17 @@ netvsc_probe(device_t dev) static int netvsc_attach(device_t dev) { + struct hn_softc *sc = device_get_softc(dev); struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t link_status; - hn_softc_t *sc; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif - sc = device_get_softc(dev); - sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -1495,7 +1493,7 @@ skip: static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - hn_softc_t *sc = ifp->if_softc; + struct hn_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; @@ -1708,11 +1706,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, return (error); } -/* - * - */ static void -hn_stop(hn_softc_t *sc) +hn_stop(struct hn_softc *sc) { struct ifnet *ifp; int ret, i; @@ -1791,11 +1786,8 @@ do_sched: } } -/* - * - */ static void -hn_ifinit_locked(hn_softc_t *sc) +hn_ifinit_locked(struct hn_softc *sc) { struct ifnet *ifp; int ret, i; @@ -1829,7 +1821,7 @@ hn_ifinit_locked(hn_softc_t *sc) static void hn_ifinit(void *xsc) { - hn_softc_t *sc = xsc; + struct hn_softc *sc = xsc; NV_LOCK(sc); if (sc->temp_unusable) { @@ -3485,7 +3477,7 @@ static device_method_t netvsc_methods[] static driver_t netvsc_driver = { NETVSC_DEVNAME, netvsc_methods, - sizeof(hn_softc_t) + sizeof(struct hn_softc) }; static devclass_t netvsc_devclass; From owner-svn-src-all@freebsd.org Wed Sep 14 08:08:46 2016 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 9F59EBDAB25; Wed, 14 Sep 2016 08:08:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5326CA7D; Wed, 14 Sep 2016 08:08:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E88jiR011501; Wed, 14 Sep 2016 08:08:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E88jvV011500; Wed, 14 Sep 2016 08:08:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140808.u8E88jvV011500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305792 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 08:08:46 -0000 Author: sephe Date: Wed Sep 14 08:08:45 2016 New Revision: 305792 URL: https://svnweb.freebsd.org/changeset/base/305792 Log: hyperv/hn: Function renaming: hn_ifinit -> hn_init No functional changes. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7868 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:00:30 2016 (r305791) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:08:45 2016 (r305792) @@ -313,8 +313,8 @@ static u_int hn_cpu_index; * Forward declarations */ static void hn_stop(struct hn_softc *sc); -static void hn_ifinit_locked(struct hn_softc *sc); -static void hn_ifinit(void *xsc); +static void hn_init_locked(struct hn_softc *sc); +static void hn_init(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_start_locked(struct hn_tx_ring *txr, int len); static void hn_start(struct ifnet *ifp); @@ -544,7 +544,7 @@ netvsc_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; - ifp->if_init = hn_ifinit; + ifp->if_init = hn_init; ifp->if_mtu = ETHERMTU; if (hn_use_if_start) { int qdepth = hn_get_txswq_depth(&sc->hn_tx_ring[0]); @@ -1508,7 +1508,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - hn_ifinit(sc); + hn_init(sc); arp_ifinit(ifp, ifa); } else #endif @@ -1583,7 +1583,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); - hn_ifinit_locked(sc); + hn_init_locked(sc); NV_LOCK(sc); sc->temp_unusable = FALSE; @@ -1629,7 +1629,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* do something here for Hyper-V */ } else #endif - hn_ifinit_locked(sc); + hn_init_locked(sc); } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { hn_stop(sc); @@ -1787,7 +1787,7 @@ do_sched: } static void -hn_ifinit_locked(struct hn_softc *sc) +hn_init_locked(struct hn_softc *sc) { struct ifnet *ifp; int ret, i; @@ -1819,7 +1819,7 @@ hn_ifinit_locked(struct hn_softc *sc) * */ static void -hn_ifinit(void *xsc) +hn_init(void *xsc) { struct hn_softc *sc = xsc; @@ -1831,7 +1831,7 @@ hn_ifinit(void *xsc) sc->temp_unusable = TRUE; NV_UNLOCK(sc); - hn_ifinit_locked(sc); + hn_init_locked(sc); NV_LOCK(sc); sc->temp_unusable = FALSE; @@ -1847,7 +1847,7 @@ hn_watchdog(struct ifnet *ifp) { if_printf(ifp, "watchdog timeout -- resetting\n"); - hn_ifinit(ifp->if_softc); /* XXX */ + hn_init(ifp->if_softc); /* XXX */ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } #endif From owner-svn-src-all@freebsd.org Wed Sep 14 08:24:02 2016 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 E2E0DBDA0A7; Wed, 14 Sep 2016 08:24:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC765F7; Wed, 14 Sep 2016 08:24:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8O1ZE018703; Wed, 14 Sep 2016 08:24:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8O1L4018702; Wed, 14 Sep 2016 08:24:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140824.u8E8O1L4018702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305793 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 08:24:03 -0000 Author: sephe Date: Wed Sep 14 08:24:01 2016 New Revision: 305793 URL: https://svnweb.freebsd.org/changeset/base/305793 Log: hyperv/hn: Cleanup hn_ioctl. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7869 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:08:45 2016 (r305792) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:24:01 2016 (r305793) @@ -1495,27 +1495,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, { struct hn_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *)data; -#endif int mask, error = 0; int retry_cnt = 500; - switch(cmd) { - - case SIOCSIFADDR: -#ifdef INET - if (ifa->ifa_addr->sa_family == AF_INET) { - ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - hn_init(sc); - arp_ifinit(ifp, ifa); - } else -#endif - error = ether_ioctl(ifp, cmd, data); - break; + switch (cmd) { case SIOCSIFMTU: - /* Check MTU value change */ if (ifp->if_mtu == ifr->ifr_mtu) break; @@ -1589,6 +1573,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; + case SIOCSIFFLAGS: do { NV_LOCK(sc); @@ -1639,8 +1624,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, sc->temp_unusable = FALSE; NV_UNLOCK(sc); sc->hn_if_flags = ifp->if_flags; - error = 0; break; + case SIOCSIFCAP: NV_LOCK(sc); @@ -1679,30 +1664,27 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } NV_UNLOCK(sc); - error = 0; break; + case SIOCADDMULTI: case SIOCDELMULTI: -#ifdef notyet - /* Fixme: Multicast mode? */ - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - NV_LOCK(sc); - netvsc_setmulti(sc); - NV_UNLOCK(sc); - error = 0; - } -#endif - error = EINVAL; + /* Always all-multi */ + /* + * TODO: + * Enable/disable all-multi according to the emptiness of + * the mcast address list. + */ break; + case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); break; + default: error = ether_ioctl(ifp, cmd, data); break; } - return (error); } From owner-svn-src-all@freebsd.org Wed Sep 14 08:33:10 2016 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 3C785BDA25B; Wed, 14 Sep 2016 08:33:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA03B6F; Wed, 14 Sep 2016 08:33:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8X9ac022581; Wed, 14 Sep 2016 08:33:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8X9Zf022579; Wed, 14 Sep 2016 08:33:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140833.u8E8X9Zf022579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305794 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 08:33:10 -0000 Author: sephe Date: Wed Sep 14 08:33:08 2016 New Revision: 305794 URL: https://svnweb.freebsd.org/changeset/base/305794 Log: hyperv/hn: Use sx for the main lock. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7870 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 08:24:01 2016 (r305793) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 08:33:08 2016 (r305794) @@ -204,10 +204,7 @@ struct hn_softc { device_t hn_dev; int hn_carrier; int hn_if_flags; - struct mtx hn_lock; - int hn_initdone; - /* See hv_netvsc_drv_freebsd.c for rules on how to use */ - int temp_unusable; + struct sx hn_lock; struct vmbus_channel *hn_prichan; int hn_rx_ring_cnt; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:24:01 2016 (r305793) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:33:08 2016 (r305794) @@ -195,21 +195,12 @@ struct hn_txdesc { #define HN_LRO_ACKCNT_DEF 1 -/* - * Be aware that this sleepable mutex will exhibit WITNESS errors when - * certain TCP and ARP code paths are taken. This appears to be a - * well-known condition, as all other drivers checked use a sleeping - * mutex to protect their transmit paths. - * Also Be aware that mutexes do not play well with semaphores, and there - * is a conflicting semaphore in a certain channel code path. - */ -#define NV_LOCK_INIT(_sc, _name) \ - mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF) -#define NV_LOCK(_sc) mtx_lock(&(_sc)->hn_lock) -#define NV_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->hn_lock, MA_OWNED) -#define NV_UNLOCK(_sc) mtx_unlock(&(_sc)->hn_lock) -#define NV_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->hn_lock) - +#define HN_LOCK_INIT(sc) \ + sx_init(&(sc)->hn_lock, device_get_nameunit((sc)->hn_dev)) +#define HN_LOCK_ASSERT(sc) sx_assert(&(sc)->hn_lock, SA_XLOCKED) +#define HN_LOCK_DESTROY(sc) sx_destroy(&(sc)->hn_lock) +#define HN_LOCK(sc) sx_xlock(&(sc)->hn_lock) +#define HN_UNLOCK(sc) sx_xunlock(&(sc)->hn_lock) /* * Globals @@ -463,6 +454,7 @@ netvsc_attach(device_t dev) sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); + HN_LOCK_INIT(sc); if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, @@ -484,7 +476,6 @@ netvsc_attach(device_t dev) } else { sc->hn_tx_taskq = hn_tx_taskq; } - NV_LOCK_INIT(sc, "NetVSCLock"); ifp = sc->hn_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; @@ -669,6 +660,7 @@ netvsc_detach(device_t dev) taskqueue_free(sc->hn_tx_taskq); vmbus_xact_ctx_destroy(sc->hn_xact); + HN_LOCK_DESTROY(sc); return (0); } @@ -1475,39 +1467,27 @@ skip: return (0); } -/* - * Rules for using sc->temp_unusable: - * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() - * 2. code reading sc->temp_unusable under NV_LOCK(), and finding - * sc->temp_unusable set, must release NV_LOCK() and exit - * 3. to retain exclusive control of the interface, - * sc->temp_unusable must be set by code before releasing NV_LOCK() - * 4. only code setting sc->temp_unusable can clear sc->temp_unusable - * 5. code setting sc->temp_unusable must eventually clear sc->temp_unusable - */ - -/* - * Standard ioctl entry point. Called when the user wants to configure - * the interface. - */ static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct hn_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int mask, error = 0; - int retry_cnt = 500; - + switch (cmd) { case SIOCSIFMTU: - if (ifp->if_mtu == ifr->ifr_mtu) - break; - if (ifr->ifr_mtu > NETVSC_MAX_CONFIGURABLE_MTU) { error = EINVAL; break; } + HN_LOCK(sc); + + if (ifp->if_mtu == ifr->ifr_mtu) { + HN_UNLOCK(sc); + break; + } + /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; @@ -1516,40 +1496,18 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * Make sure that LRO aggregation length limit is still * valid, after the MTU change. */ - NV_LOCK(sc); if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp)); - NV_UNLOCK(sc); #endif - do { - NV_LOCK(sc); - if (!sc->temp_unusable) { - sc->temp_unusable = TRUE; - retry_cnt = -1; - } - NV_UNLOCK(sc); - if (retry_cnt > 0) { - retry_cnt--; - DELAY(5 * 1000); - } - } while (retry_cnt > 0); - - if (retry_cnt == 0) { - error = EINVAL; - break; - } - /* We must remove and add back the device to cause the new * MTU to take effect. This includes tearing down, but not * deleting the channel, then bringing it back up. */ error = hv_rf_on_device_remove(sc); if (error) { - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); + HN_UNLOCK(sc); break; } @@ -1569,29 +1527,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_init_locked(sc); - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); + HN_UNLOCK(sc); break; case SIOCSIFFLAGS: - do { - NV_LOCK(sc); - if (!sc->temp_unusable) { - sc->temp_unusable = TRUE; - retry_cnt = -1; - } - NV_UNLOCK(sc); - if (retry_cnt > 0) { - retry_cnt--; - DELAY(5 * 1000); - } - } while (retry_cnt > 0); - - if (retry_cnt == 0) { - error = EINVAL; - break; - } + HN_LOCK(sc); if (ifp->if_flags & IFF_UP) { /* @@ -1620,14 +1560,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_stop(sc); } } - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); sc->hn_if_flags = ifp->if_flags; + + HN_UNLOCK(sc); break; case SIOCSIFCAP: - NV_LOCK(sc); + HN_LOCK(sc); mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { @@ -1663,7 +1602,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_hwassist &= ~CSUM_IP6_TSO; } - NV_UNLOCK(sc); + HN_UNLOCK(sc); break; case SIOCADDMULTI: @@ -1694,6 +1633,8 @@ hn_stop(struct hn_softc *sc) struct ifnet *ifp; int ret, i; + HN_LOCK_ASSERT(sc); + ifp = sc->hn_ifp; if (bootverbose) @@ -1705,7 +1646,6 @@ hn_stop(struct hn_softc *sc) sc->hn_tx_ring[i].hn_oactive = 0; if_link_state_change(ifp, LINK_STATE_DOWN); - sc->hn_initdone = 0; ret = hv_rf_on_close(sc); } @@ -1774,6 +1714,8 @@ hn_init_locked(struct hn_softc *sc) struct ifnet *ifp; int ret, i; + HN_LOCK_ASSERT(sc); + ifp = sc->hn_ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { @@ -1783,11 +1725,8 @@ hn_init_locked(struct hn_softc *sc) hv_promisc_mode = 1; ret = hv_rf_on_open(sc); - if (ret != 0) { + if (ret != 0) return; - } else { - sc->hn_initdone = 1; - } atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) @@ -1797,27 +1736,14 @@ hn_init_locked(struct hn_softc *sc) if_link_state_change(ifp, LINK_STATE_UP); } -/* - * - */ static void hn_init(void *xsc) { struct hn_softc *sc = xsc; - NV_LOCK(sc); - if (sc->temp_unusable) { - NV_UNLOCK(sc); - return; - } - sc->temp_unusable = TRUE; - NV_UNLOCK(sc); - + HN_LOCK(sc); hn_init_locked(sc); - - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); + HN_UNLOCK(sc); } #ifdef LATER @@ -1848,13 +1774,15 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS if (error || req->newptr == NULL) return error; + HN_LOCK(sc); if (lenlim < HN_LRO_LENLIM_MIN(sc->hn_ifp) || - lenlim > TCP_LRO_LENGTH_MAX) + lenlim > TCP_LRO_LENGTH_MAX) { + HN_UNLOCK(sc); return EINVAL; - - NV_LOCK(sc); + } hn_set_lro_lenlim(sc, lenlim); - NV_UNLOCK(sc); + HN_UNLOCK(sc); + return 0; } @@ -1881,10 +1809,10 @@ hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS * count limit. */ --ackcnt; - NV_LOCK(sc); + HN_LOCK(sc); for (i = 0; i < sc->hn_rx_ring_inuse; ++i) sc->hn_rx_ring[i].hn_lro.lro_ackcnt_lim = ackcnt; - NV_UNLOCK(sc); + HN_UNLOCK(sc); return 0; } @@ -1905,7 +1833,7 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG if (error || req->newptr == NULL) return error; - NV_LOCK(sc); + HN_LOCK(sc); for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; @@ -1914,7 +1842,7 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG else rxr->hn_trust_hcsum &= ~hcsum; } - NV_UNLOCK(sc); + HN_UNLOCK(sc); return 0; } @@ -1932,7 +1860,9 @@ hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS) if (chim_size > sc->hn_chim_szmax || chim_size <= 0) return EINVAL; + HN_LOCK(sc); hn_set_chim_size(sc, chim_size); + HN_UNLOCK(sc); return 0; } @@ -2028,12 +1958,12 @@ hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARG if (error || req->newptr == NULL) return error; - NV_LOCK(sc); + HN_LOCK(sc); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; *((int *)((uint8_t *)txr + ofs)) = conf; } - NV_UNLOCK(sc); + HN_UNLOCK(sc); return 0; } @@ -2677,10 +2607,8 @@ hn_set_chim_size(struct hn_softc *sc, in { int i; - NV_LOCK(sc); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_chim_size = chim_size; - NV_UNLOCK(sc); } static void From owner-svn-src-all@freebsd.org Wed Sep 14 08:48:10 2016 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 05873BDA535; Wed, 14 Sep 2016 08:48:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E1C2FC; Wed, 14 Sep 2016 08:48:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8m9hw026582; Wed, 14 Sep 2016 08:48:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8m9oN026581; Wed, 14 Sep 2016 08:48:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140848.u8E8m9oN026581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305795 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 08:48:10 -0000 Author: sephe Date: Wed Sep 14 08:48:08 2016 New Revision: 305795 URL: https://svnweb.freebsd.org/changeset/base/305795 Log: hyperv/hn: Bring in shims from stable/10 This eases future MFCs to stable/10. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7871 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:33:08 2016 (r305794) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:48:08 2016 (r305795) @@ -318,8 +318,12 @@ static int hn_lro_ackcnt_sysctl(SYSCTL_H #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS); -static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); +#if __FreeBSD_version < 1100095 +static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#else static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); +#endif +static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS); @@ -1866,32 +1870,33 @@ hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS) return 0; } +#if __FreeBSD_version < 1100095 static int -hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - u_long stat; + uint64_t stat; stat = 0; - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - stat += *((u_long *)((uint8_t *)rxr + ofs)); + stat += *((int *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_long(oidp, &stat, 0, req); + error = sysctl_handle_64(oidp, &stat, 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - *((u_long *)((uint8_t *)rxr + ofs)) = 0; + *((int *)((uint8_t *)rxr + ofs)) = 0; } return 0; } - +#else static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1918,6 +1923,34 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG return 0; } +#endif + +static int +hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_rx_ring *rxr; + u_long stat; + + stat = 0; + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + rxr = &sc->hn_rx_ring[i]; + stat += *((u_long *)((uint8_t *)rxr + ofs)); + } + + error = sysctl_handle_long(oidp, &stat, 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + rxr = &sc->hn_rx_ring[i]; + *((u_long *)((uint8_t *)rxr + ofs)) = 0; + } + return 0; +} + static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { @@ -2168,11 +2201,21 @@ hn_create_rx_data(struct hn_softc *sc, i SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_queued), - hn_rx_stat_u64_sysctl, "LU", "LRO queued"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO queued"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), - hn_rx_stat_u64_sysctl, "LU", "LRO flushed"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO flushed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro_tried), From owner-svn-src-all@freebsd.org Wed Sep 14 08:59:15 2016 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 223E6BDA824; Wed, 14 Sep 2016 08:59:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC0FCDC1; Wed, 14 Sep 2016 08:59:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8xEWu030419; Wed, 14 Sep 2016 08:59:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8xDuc030418; Wed, 14 Sep 2016 08:59:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140859.u8E8xDuc030418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305796 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 08:59:15 -0000 Author: sephe Date: Wed Sep 14 08:59:13 2016 New Revision: 305796 URL: https://svnweb.freebsd.org/changeset/base/305796 Log: hyperv/hn: Remove the FreeBSD_version check for TSO configuration It is available on both stable/10 and stable/11. This eases future MFCs to stable/10. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7872 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:48:08 2016 (r305795) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:59:13 2016 (r305796) @@ -232,12 +232,10 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosti "Trust ip packet verification on host side, " "when csum info is missing (global setting)"); -#if __FreeBSD_version >= 1100045 /* Limit TSO burst size */ static int hn_tso_maxlen = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, &hn_tso_maxlen, 0, "TSO burst limit"); -#endif /* Limit chimney send size */ static int hn_tx_chimney_size = 0; @@ -452,9 +450,7 @@ netvsc_attach(device_t dev) uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; -#if __FreeBSD_version >= 1100045 int tso_maxlen; -#endif sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -587,7 +583,6 @@ netvsc_attach(device_t dev) if (link_status == NDIS_MEDIA_STATE_CONNECTED) sc->hn_carrier = 1; -#if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) tso_maxlen = IP_MAXPACKET; @@ -596,17 +591,14 @@ netvsc_attach(device_t dev) ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ifp->if_hw_tsomax = tso_maxlen - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); -#endif error = hn_rndis_get_eaddr(sc, eaddr); if (error) goto failed; ether_ifattach(ifp, eaddr); -#if __FreeBSD_version >= 1100045 if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); -#endif hn_set_chim_size(sc, sc->hn_chim_szmax); if (hn_tx_chimney_size > 0 && From owner-svn-src-all@freebsd.org Wed Sep 14 09:10:33 2016 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 4385DBDAD7D; Wed, 14 Sep 2016 09:10:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC950982; Wed, 14 Sep 2016 09:10:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E9AWr7034384; Wed, 14 Sep 2016 09:10:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E9AWYX034383; Wed, 14 Sep 2016 09:10:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609140910.u8E9AWYX034383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 14 Sep 2016 09:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305797 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 09:10:33 -0000 Author: mav Date: Wed Sep 14 09:10:31 2016 New Revision: 305797 URL: https://svnweb.freebsd.org/changeset/base/305797 Log: MFC r305536: Fix channel initialization in FBS mode. Due to reading initialized variable, FIS receive area was always allocated as 256 bytes, suitable for command-based switching, instead of 4096 bytes, required for FIS-based switching. This caused memory corruption in case of port multipliers used on FBS-capable HBAs (Marvell). Modified: stable/11/sys/dev/ahci/ahci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Wed Sep 14 08:59:13 2016 (r305796) +++ stable/11/sys/dev/ahci/ahci.c Wed Sep 14 09:10:31 2016 (r305797) @@ -715,6 +715,21 @@ ahci_ch_attach(device_t dev) if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE))) return (ENXIO); + ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); + version = ATA_INL(ctlr->r_mem, AHCI_VS); + if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS)) + ch->chcaps |= AHCI_P_CMD_FBSCP; + if (ch->caps2 & AHCI_CAP2_SDS) + ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP); + if (bootverbose) { + device_printf(dev, "Caps:%s%s%s%s%s%s\n", + (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"", + (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"", + (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"", + (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"", + (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"", + (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":""); + } ahci_dmainit(dev); ahci_slotsalloc(dev); mtx_lock(&ch->mtx); @@ -733,21 +748,6 @@ ahci_ch_attach(device_t dev) error = ENXIO; goto err1; } - ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); - version = ATA_INL(ctlr->r_mem, AHCI_VS); - if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS)) - ch->chcaps |= AHCI_P_CMD_FBSCP; - if (ch->caps2 & AHCI_CAP2_SDS) - ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP); - if (bootverbose) { - device_printf(dev, "Caps:%s%s%s%s%s%s\n", - (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"", - (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"", - (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"", - (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"", - (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"", - (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":""); - } /* Create the device queue for our SIM. */ devq = cam_simq_alloc(ch->numslots); if (devq == NULL) { From owner-svn-src-all@freebsd.org Wed Sep 14 09:11:04 2016 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 AB412BDAE10; Wed, 14 Sep 2016 09:11:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7EEC10; Wed, 14 Sep 2016 09:11:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E9B3Z1035256; Wed, 14 Sep 2016 09:11:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E9B3PG035255; Wed, 14 Sep 2016 09:11:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609140911.u8E9B3PG035255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 14 Sep 2016 09:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305798 - stable/10/sys/dev/ahci 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 09:11:04 -0000 Author: mav Date: Wed Sep 14 09:11:03 2016 New Revision: 305798 URL: https://svnweb.freebsd.org/changeset/base/305798 Log: MFC r305536: Fix channel initialization in FBS mode. Due to reading initialized variable, FIS receive area was always allocated as 256 bytes, suitable for command-based switching, instead of 4096 bytes, required for FIS-based switching. This caused memory corruption in case of MFC r305536: Fix channel initialization in FBS mode. Due to reading initialized variable, FIS receive area was always allocated as 256 bytes, suitable for command-based switching, instead of 4096 bytes, required for FIS-based switching. This caused memory corruption in case of port multipliers used on FBS-capable HBAs (Marvell). Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Wed Sep 14 09:10:31 2016 (r305797) +++ stable/10/sys/dev/ahci/ahci.c Wed Sep 14 09:11:03 2016 (r305798) @@ -668,6 +668,21 @@ ahci_ch_attach(device_t dev) if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE))) return (ENXIO); + ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); + version = ATA_INL(ctlr->r_mem, AHCI_VS); + if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS)) + ch->chcaps |= AHCI_P_CMD_FBSCP; + if (ch->caps2 & AHCI_CAP2_SDS) + ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP); + if (bootverbose) { + device_printf(dev, "Caps:%s%s%s%s%s%s\n", + (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"", + (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"", + (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"", + (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"", + (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"", + (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":""); + } ahci_dmainit(dev); ahci_slotsalloc(dev); mtx_lock(&ch->mtx); @@ -686,21 +701,6 @@ ahci_ch_attach(device_t dev) error = ENXIO; goto err1; } - ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); - version = ATA_INL(ctlr->r_mem, AHCI_VS); - if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS)) - ch->chcaps |= AHCI_P_CMD_FBSCP; - if (ch->caps2 & AHCI_CAP2_SDS) - ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP); - if (bootverbose) { - device_printf(dev, "Caps:%s%s%s%s%s%s\n", - (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"", - (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"", - (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"", - (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"", - (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"", - (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":""); - } /* Create the device queue for our SIM. */ devq = cam_simq_alloc(ch->numslots); if (devq == NULL) { From owner-svn-src-all@freebsd.org Wed Sep 14 09:12:50 2016 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 AE568BDAF3D; Wed, 14 Sep 2016 09:12:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DBAEF69; Wed, 14 Sep 2016 09:12:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E9CnTt037987; Wed, 14 Sep 2016 09:12:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E9CnLo037986; Wed, 14 Sep 2016 09:12:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609140912.u8E9CnLo037986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 14 Sep 2016 09:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305799 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 09:12:50 -0000 Author: mav Date: Wed Sep 14 09:12:49 2016 New Revision: 305799 URL: https://svnweb.freebsd.org/changeset/base/305799 Log: MFC r305123: Fix kernel panic when inheriting properties without default. There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu", that have no default string value. Attempt to unset them or replicate caused kernel panic. This simple bandaid seems fixes the problem nicely. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed Sep 14 09:11:03 2016 (r305798) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed Sep 14 09:12:49 2016 (r305799) @@ -54,6 +54,8 @@ dodefault(zfs_prop_t prop, int intsz, in return (SET_ERROR(ENOENT)); if (zfs_prop_get_type(prop) == PROP_TYPE_STRING) { + if (zfs_prop_default_string(prop) == NULL) + return (SET_ERROR(ENOENT)); if (intsz != 1) return (SET_ERROR(EOVERFLOW)); (void) strncpy(buf, zfs_prop_default_string(prop), From owner-svn-src-all@freebsd.org Wed Sep 14 09:13:18 2016 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 D8B70BDAF9B; Wed, 14 Sep 2016 09:13:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB08B149; Wed, 14 Sep 2016 09:13:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E9DHpZ038061; Wed, 14 Sep 2016 09:13:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E9DHPH038060; Wed, 14 Sep 2016 09:13:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609140913.u8E9DHPH038060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 14 Sep 2016 09:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305800 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 09:13:18 -0000 Author: mav Date: Wed Sep 14 09:13:17 2016 New Revision: 305800 URL: https://svnweb.freebsd.org/changeset/base/305800 Log: MFC r305123: Fix kernel panic when inheriting properties without default. There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu", that have no default string value. Attempt to unset them or replicate caused kernel panic. This simple bandaid seems fixes the problem nicely. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed Sep 14 09:12:49 2016 (r305799) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed Sep 14 09:13:17 2016 (r305800) @@ -54,6 +54,8 @@ dodefault(zfs_prop_t prop, int intsz, in return (SET_ERROR(ENOENT)); if (zfs_prop_get_type(prop) == PROP_TYPE_STRING) { + if (zfs_prop_default_string(prop) == NULL) + return (SET_ERROR(ENOENT)); if (intsz != 1) return (SET_ERROR(EOVERFLOW)); (void) strncpy(buf, zfs_prop_default_string(prop), From owner-svn-src-all@freebsd.org Wed Sep 14 09:17:01 2016 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 71CE2BD8007; Wed, 14 Sep 2016 09:17:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41D76352; Wed, 14 Sep 2016 09:17:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E9H0fo038226; Wed, 14 Sep 2016 09:17:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E9H0o7038225; Wed, 14 Sep 2016 09:17:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140917.u8E9H0o7038225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 09:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305801 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 09:17:01 -0000 Author: sephe Date: Wed Sep 14 09:17:00 2016 New Revision: 305801 URL: https://svnweb.freebsd.org/changeset/base/305801 Log: hyperv/hn: Fix some ifnet settings - ifnet.if_mtu does not require explicit setting. - ifnet.if_hdrlen must be set after ether_ifattach(). MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7873 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 09:13:17 2016 (r305800) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 09:17:00 2016 (r305801) @@ -536,7 +536,6 @@ netvsc_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; ifp->if_init = hn_init; - ifp->if_mtu = ETHERMTU; if (hn_use_if_start) { int qdepth = hn_get_txswq_depth(&sc->hn_tx_ring[0]); @@ -558,7 +557,6 @@ netvsc_attach(device_t dev) /* * Tell upper layers that we support full VLAN capability. */ - ifp->if_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO; @@ -600,6 +598,9 @@ netvsc_attach(device_t dev) if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); + /* Inform the upper layer about the long frame support. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); + hn_set_chim_size(sc, sc->hn_chim_szmax); if (hn_tx_chimney_size > 0 && hn_tx_chimney_size < sc->hn_chim_szmax) From owner-svn-src-all@freebsd.org Wed Sep 14 10:36:45 2016 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 91534BD974B; Wed, 14 Sep 2016 10:36:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 461991B27; Wed, 14 Sep 2016 10:36:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EAaiU1067932; Wed, 14 Sep 2016 10:36:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EAaiQx067931; Wed, 14 Sep 2016 10:36:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609141036.u8EAaiQx067931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Sep 2016 10:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305802 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 10:36:45 -0000 Author: kib Date: Wed Sep 14 10:36:44 2016 New Revision: 305802 URL: https://svnweb.freebsd.org/changeset/base/305802 Log: MFC r305129: Make swapoff reliable. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Wed Sep 14 09:17:00 2016 (r305801) +++ stable/11/sys/vm/swap_pager.c Wed Sep 14 10:36:44 2016 (r305802) @@ -1664,36 +1664,49 @@ static void swap_pager_swapoff(struct swdevt *sp) { struct swblock *swap; + vm_object_t locked_obj, object; + vm_pindex_t pindex; int i, j, retries; sx_assert(&swdev_syscall_lock, SA_XLOCKED); retries = 0; + locked_obj = NULL; full_rescan: mtx_lock(&swhash_mtx); for (i = 0; i <= swhash_mask; i++) { /* '<=' is correct here */ restart: for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { - vm_object_t object = swap->swb_object; - vm_pindex_t pindex = swap->swb_index; + object = swap->swb_object; + pindex = swap->swb_index; for (j = 0; j < SWAP_META_PAGES; ++j) { - if (swp_pager_isondev(swap->swb_pages[j], sp)) { - /* avoid deadlock */ + if (!swp_pager_isondev(swap->swb_pages[j], sp)) + continue; + if (locked_obj != object) { + if (locked_obj != NULL) + VM_OBJECT_WUNLOCK(locked_obj); + locked_obj = object; if (!VM_OBJECT_TRYWLOCK(object)) { - break; - } else { mtx_unlock(&swhash_mtx); - swp_pager_force_pagein(object, - pindex + j); - VM_OBJECT_WUNLOCK(object); + /* Depends on type-stability. */ + VM_OBJECT_WLOCK(object); mtx_lock(&swhash_mtx); goto restart; } } + MPASS(locked_obj == object); + mtx_unlock(&swhash_mtx); + swp_pager_force_pagein(object, pindex + j); + mtx_lock(&swhash_mtx); + goto restart; } } } mtx_unlock(&swhash_mtx); + if (locked_obj != NULL) { + VM_OBJECT_WUNLOCK(locked_obj); + locked_obj = NULL; + } if (sp->sw_used) { /* * Objects may be locked or paging to the device being From owner-svn-src-all@freebsd.org Wed Sep 14 10:51:07 2016 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 87380BD9A26; Wed, 14 Sep 2016 10:51:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3081E10EA; Wed, 14 Sep 2016 10:51:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EAp6qb072649; Wed, 14 Sep 2016 10:51:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EAp6oW072648; Wed, 14 Sep 2016 10:51:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609141051.u8EAp6oW072648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Sep 2016 10:51:06 +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: r305803 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 10:51:07 -0000 Author: kib Date: Wed Sep 14 10:51:06 2016 New Revision: 305803 URL: https://svnweb.freebsd.org/changeset/base/305803 Log: MFC r305129: Make swapoff reliable. Modified: stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Wed Sep 14 10:36:44 2016 (r305802) +++ stable/10/sys/vm/swap_pager.c Wed Sep 14 10:51:06 2016 (r305803) @@ -1764,36 +1764,49 @@ static void swap_pager_swapoff(struct swdevt *sp) { struct swblock *swap; + vm_object_t locked_obj, object; + vm_pindex_t pindex; int i, j, retries; GIANT_REQUIRED; retries = 0; + locked_obj = NULL; full_rescan: mtx_lock(&swhash_mtx); for (i = 0; i <= swhash_mask; i++) { /* '<=' is correct here */ restart: for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { - vm_object_t object = swap->swb_object; - vm_pindex_t pindex = swap->swb_index; + object = swap->swb_object; + pindex = swap->swb_index; for (j = 0; j < SWAP_META_PAGES; ++j) { - if (swp_pager_isondev(swap->swb_pages[j], sp)) { - /* avoid deadlock */ + if (!swp_pager_isondev(swap->swb_pages[j], sp)) + continue; + if (locked_obj != object) { + if (locked_obj != NULL) + VM_OBJECT_WUNLOCK(locked_obj); + locked_obj = object; if (!VM_OBJECT_TRYWLOCK(object)) { - break; - } else { mtx_unlock(&swhash_mtx); - swp_pager_force_pagein(object, - pindex + j); - VM_OBJECT_WUNLOCK(object); + /* Depends on type-stability. */ + VM_OBJECT_WLOCK(object); mtx_lock(&swhash_mtx); goto restart; } } + MPASS(locked_obj == object); + mtx_unlock(&swhash_mtx); + swp_pager_force_pagein(object, pindex + j); + mtx_lock(&swhash_mtx); + goto restart; } } } mtx_unlock(&swhash_mtx); + if (locked_obj != NULL) { + VM_OBJECT_WUNLOCK(locked_obj); + locked_obj = NULL; + } if (sp->sw_used) { /* * Objects may be locked or paging to the device being From owner-svn-src-all@freebsd.org Wed Sep 14 11:16:01 2016 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 CC1ABAC4435; Wed, 14 Sep 2016 11:16:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFF51E1C; Wed, 14 Sep 2016 11:16:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EBG0gU082901; Wed, 14 Sep 2016 11:16:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EBG06e082899; Wed, 14 Sep 2016 11:16:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609141116.u8EBG06e082899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 14 Sep 2016 11:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305804 - head/sys/boot/kshim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 11:16:01 -0000 Author: hselasky Date: Wed Sep 14 11:16:00 2016 New Revision: 305804 URL: https://svnweb.freebsd.org/changeset/base/305804 Log: Make the callout structure in the boot loader's kernel shim more similar to the kernel one. MFC after: 1 week Modified: head/sys/boot/kshim/bsd_kernel.c head/sys/boot/kshim/bsd_kernel.h Modified: head/sys/boot/kshim/bsd_kernel.c ============================================================================== --- head/sys/boot/kshim/bsd_kernel.c Wed Sep 14 10:51:06 2016 (r305803) +++ head/sys/boot/kshim/bsd_kernel.c Wed Sep 14 11:16:00 2016 (r305804) @@ -432,8 +432,8 @@ callout_callback(struct callout *c) } mtx_unlock(&mtx_callout); - if (c->func) - (c->func) (c->arg); + if (c->c_func != NULL) + (c->c_func) (c->c_arg); if (!(c->flags & CALLOUT_RETURNUNLOCKED)) mtx_unlock(c->mtx); @@ -487,8 +487,8 @@ callout_reset(struct callout *c, int to_ { callout_stop(c); - c->func = func; - c->arg = arg; + c->c_func = func; + c->c_arg = arg; c->timeout = ticks + to_ticks; mtx_lock(&mtx_callout); @@ -507,8 +507,8 @@ callout_stop(struct callout *c) } mtx_unlock(&mtx_callout); - c->func = NULL; - c->arg = NULL; + c->c_func = NULL; + c->c_arg = NULL; } void Modified: head/sys/boot/kshim/bsd_kernel.h ============================================================================== --- head/sys/boot/kshim/bsd_kernel.h Wed Sep 14 10:51:06 2016 (r305803) +++ head/sys/boot/kshim/bsd_kernel.h Wed Sep 14 11:16:00 2016 (r305804) @@ -299,8 +299,8 @@ extern volatile int ticks; struct callout { LIST_ENTRY(callout) entry; - callout_fn_t *func; - void *arg; + callout_fn_t *c_func; + void *c_arg; struct mtx *mtx; int flags; int timeout; From owner-svn-src-all@freebsd.org Wed Sep 14 11:21:00 2016 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 5C409AC454D; Wed, 14 Sep 2016 11:21:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5EE1125; Wed, 14 Sep 2016 11:21:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EBKxb0083888; Wed, 14 Sep 2016 11:20:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EBKx1A083885; Wed, 14 Sep 2016 11:20:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201609141120.u8EBKx1A083885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 14 Sep 2016 11:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305805 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 11:21:00 -0000 Author: trasz Date: Wed Sep 14 11:20:58 2016 New Revision: 305805 URL: https://svnweb.freebsd.org/changeset/base/305805 Log: Use proper argument order for calloc(3). MFC after: 1 month Modified: head/usr.sbin/autofs/automountd.c head/usr.sbin/autofs/autounmountd.c head/usr.sbin/autofs/defined.c Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Wed Sep 14 11:16:00 2016 (r305804) +++ head/usr.sbin/autofs/automountd.c Wed Sep 14 11:20:58 2016 (r305805) @@ -97,7 +97,7 @@ pick_option(const char *option, char **o tofree = *optionsp; - newoptions = calloc(strlen(*optionsp) + 1, 1); + newoptions = calloc(1, strlen(*optionsp) + 1); if (newoptions == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Wed Sep 14 11:16:00 2016 (r305804) +++ head/usr.sbin/autofs/autounmountd.c Wed Sep 14 11:20:58 2016 (r305805) @@ -78,7 +78,7 @@ automounted_add(fsid_t fsid, const char { struct automounted_fs *af; - af = calloc(sizeof(*af), 1); + af = calloc(1, sizeof(*af)); if (af == NULL) log_err(1, "calloc"); af->af_mount_time = time(NULL); Modified: head/usr.sbin/autofs/defined.c ============================================================================== --- head/usr.sbin/autofs/defined.c Wed Sep 14 11:16:00 2016 (r305804) +++ head/usr.sbin/autofs/defined.c Wed Sep 14 11:20:58 2016 (r305805) @@ -225,7 +225,7 @@ defined_add(const char *name, const char log_debugx("defining variable %s=%s", name, value); - d = calloc(sizeof(*d), 1); + d = calloc(1, sizeof(*d)); if (d == NULL) log_err(1, "calloc"); d->d_name = checked_strdup(name); From owner-svn-src-all@freebsd.org Wed Sep 14 12:07:37 2016 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 A5F61BDAD15; Wed, 14 Sep 2016 12:07:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9791CE0; Wed, 14 Sep 2016 12:07:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EC7aYT001983; Wed, 14 Sep 2016 12:07:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EC7Yab001962; Wed, 14 Sep 2016 12:07:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609141207.u8EC7Yab001962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 14 Sep 2016 12:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305806 - in head/sys/dev/usb: . input quirk serial storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 12:07:37 -0000 Author: hselasky Date: Wed Sep 14 12:07:34 2016 New Revision: 305806 URL: https://svnweb.freebsd.org/changeset/base/305806 Log: Improve USB polling mode by not locking any mutexes, asserting any mutexes or using any callouts when active. Trying to lock a mutex when KDB is active or the scheduler is stopped can result in infinite wait loops. The same goes for calling callout related functions which in turn lock mutexes. If the USB controller at which a USB keyboard is connected is idle when KDB is entered, polling the USB keyboard via USB will always succeed. Else polling may fail depending on which state the USB subsystem and USB interrupt handler is in. This is unavoidable unless KDB can wait for USB interrupt threads to complete before stalling the CPU(s). Tested by: Bruce Evans MFC after: 4 weeks Modified: head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_core.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/input/ukbd.c Wed Sep 14 12:07:34 2016 (r305806) @@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include @@ -248,32 +246,9 @@ struct ukbd_softc { SCAN_PREFIX_CTL | SCAN_PREFIX_SHIFT) #define SCAN_CHAR(c) ((c) & 0x7f) -#define UKBD_LOCK() mtx_lock(&Giant) -#define UKBD_UNLOCK() mtx_unlock(&Giant) - -#ifdef INVARIANTS - -/* - * Assert that the lock is held in all contexts - * where the code can be executed. - */ -#define UKBD_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED) - -/* - * Assert that the lock is held in the contexts - * where it really has to be so. - */ -#define UKBD_CTX_LOCK_ASSERT() \ - do { \ - if (!kdb_active && panicstr == NULL) \ - mtx_assert(&Giant, MA_OWNED); \ - } while (0) -#else - -#define UKBD_LOCK_ASSERT() (void)0 -#define UKBD_CTX_LOCK_ASSERT() (void)0 - -#endif +#define UKBD_LOCK() USB_MTX_LOCK(&Giant) +#define UKBD_UNLOCK() USB_MTX_UNLOCK(&Giant) +#define UKBD_LOCK_ASSERT() USB_MTX_ASSERT(&Giant, MA_OWNED) struct ukbd_mods { uint32_t mask, key; @@ -400,7 +375,7 @@ ukbd_start_timer(struct ukbd_softc *sc) sc->sc_co_basetime += delay; /* This is rarely called, so prefer precision to efficiency. */ prec = qmin(delay >> 7, SBT_1MS * 10); - callout_reset_sbt(&sc->sc_callout.co, sc->sc_co_basetime, prec, + usb_callout_reset_sbt(&sc->sc_callout, sc->sc_co_basetime, prec, ukbd_timeout, sc, C_ABSOLUTE); } @@ -408,7 +383,7 @@ static void ukbd_put_key(struct ukbd_softc *sc, uint32_t key) { - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); DPRINTF("0x%02x (%d) %s\n", key, key, (key & KEY_RELEASE) ? "released" : "pressed"); @@ -429,12 +404,12 @@ static void ukbd_do_poll(struct ukbd_softc *sc, uint8_t wait) { - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); KASSERT((sc->sc_flags & UKBD_FLAG_POLLING) != 0, ("ukbd_do_poll called when not polling\n")); DPRINTFN(2, "polling\n"); - if (!kdb_active && !SCHEDULER_STOPPED()) { + if (USB_IN_POLLING_MODE_FUNC() == 0) { /* * In this context the kernel is polling for input, * but the USB subsystem works in normal interrupt-driven @@ -479,9 +454,9 @@ ukbd_get_key(struct ukbd_softc *sc, uint { int32_t c; - UKBD_CTX_LOCK_ASSERT(); - KASSERT((!kdb_active && !SCHEDULER_STOPPED()) - || (sc->sc_flags & UKBD_FLAG_POLLING) != 0, + UKBD_LOCK_ASSERT(); + KASSERT((USB_IN_POLLING_MODE_FUNC() == 0) || + (sc->sc_flags & UKBD_FLAG_POLLING) != 0, ("not polling in kdb or panic\n")); if (sc->sc_inputs == 0 && @@ -519,7 +494,7 @@ ukbd_interrupt(struct ukbd_softc *sc) uint8_t i; uint8_t j; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (sc->sc_ndata.keycode[0] == KEY_ERROR) return; @@ -615,7 +590,7 @@ ukbd_event_keyinput(struct ukbd_softc *s { int c; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if ((sc->sc_flags & UKBD_FLAG_POLLING) != 0) return; @@ -838,7 +813,7 @@ ukbd_intr_callback(struct usb_xfer *xfer ukbd_interrupt(sc); - if (ukbd_any_key_pressed(sc)) { + if (ukbd_any_key_pressed(sc) != 0) { ukbd_start_timer(sc); } @@ -1507,7 +1482,7 @@ ukbd_check(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (0); @@ -1532,7 +1507,7 @@ ukbd_check_char_locked(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (0); @@ -1569,7 +1544,7 @@ ukbd_read(keyboard_t *kbd, int wait) #endif - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (-1); @@ -1618,7 +1593,7 @@ ukbd_read_char_locked(keyboard_t *kbd, i uint32_t scancode; #endif - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (NOKEY); @@ -1962,7 +1937,7 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, case KDGKBSTATE: case KDSKBSTATE: case KDSETLED: - if (!mtx_owned(&Giant) && !SCHEDULER_STOPPED()) + if (!mtx_owned(&Giant) && !USB_IN_POLLING_MODE_FUNC()) return (EDEADLK); /* best I could come up with */ /* FALLTHROUGH */ default: @@ -1980,7 +1955,7 @@ ukbd_clear_state(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); sc->sc_flags &= ~(UKBD_FLAG_COMPOSE | UKBD_FLAG_POLLING); sc->sc_state &= LOCK_MASK; /* preserve locking key state */ Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 14 12:07:34 2016 (r305806) @@ -659,7 +659,7 @@ usb_test_quirk_by_info(const struct usbd if (quirk == UQ_NONE) goto done; - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); for (x = 0; x != USB_DEV_QUIRKS_MAX; x++) { /* see if quirk information does not match */ @@ -683,13 +683,13 @@ usb_test_quirk_by_info(const struct usbd /* lookup quirk */ for (y = 0; y != USB_SUB_QUIRKS_MAX; y++) { if (usb_quirks[x].quirks[y] == quirk) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); DPRINTF("Found quirk '%s'.\n", usb_quirkstr(quirk)); return (1); } } } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); done: return (0); /* no quirk match */ } @@ -700,7 +700,7 @@ usb_quirk_get_entry(uint16_t vid, uint16 { uint16_t x; - mtx_assert(&usb_quirk_mtx, MA_OWNED); + USB_MTX_ASSERT(&usb_quirk_mtx, MA_OWNED); if ((vid | pid | lo_rev | hi_rev) == 0) { /* all zero - special case */ @@ -768,7 +768,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr if (y >= USB_DEV_QUIRKS_MAX) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); /* copy out data */ pgq->vid = usb_quirks[y].vid; pgq->pid = usb_quirks[y].pid; @@ -777,7 +777,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr strlcpy(pgq->quirkname, usb_quirkstr(usb_quirks[y].quirks[x]), sizeof(pgq->quirkname)); - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (0); /* success */ case USB_QUIRK_NAME_GET: @@ -810,11 +810,11 @@ usb_quirk_ioctl(unsigned long cmd, caddr if (y == UQ_NONE) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); pqe = usb_quirk_get_entry(pgq->vid, pgq->pid, pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 1); if (pqe == NULL) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (EINVAL); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -823,7 +823,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr break; } } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); if (x == USB_SUB_QUIRKS_MAX) { return (ENOMEM); } @@ -848,11 +848,11 @@ usb_quirk_ioctl(unsigned long cmd, caddr if (y == UQ_NONE) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); pqe = usb_quirk_get_entry(pgq->vid, pgq->pid, pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 0); if (pqe == NULL) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (EINVAL); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -862,7 +862,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr } } if (x == USB_SUB_QUIRKS_MAX) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (ENOMEM); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -874,7 +874,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr /* all quirk entries are unused - release */ memset(pqe, 0, sizeof(*pqe)); } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (0); /* success */ default: @@ -965,14 +965,14 @@ usb_quirk_add_entry_from_str(const char printf("%s: Too many USB quirks, only %d allowed!\n", name, USB_SUB_QUIRKS_MAX); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); new = usb_quirk_get_entry(entry.vid, entry.pid, entry.lo_rev, entry.hi_rev, 1); if (new == NULL) printf("%s: USB quirks table is full!\n", name); else memcpy(new->quirks, entry.quirks, sizeof(entry.quirks)); - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); } else { printf("%s: No USB quirks found!\n", name); } Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/serial/usb_serial.c Wed Sep 14 12:07:34 2016 (r305806) @@ -79,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -1575,7 +1574,7 @@ ucom_cngetc(struct consdev *cd) UCOM_MTX_UNLOCK(sc); /* poll if necessary */ - if (kdb_active && sc->sc_callback->ucom_poll) + if (USB_IN_POLLING_MODE_FUNC() && sc->sc_callback->ucom_poll) (sc->sc_callback->ucom_poll) (sc); return (c); @@ -1611,7 +1610,7 @@ ucom_cnputc(struct consdev *cd, int c) UCOM_MTX_UNLOCK(sc); /* poll if necessary */ - if (kdb_active && sc->sc_callback->ucom_poll) { + if (USB_IN_POLLING_MODE_FUNC() && sc->sc_callback->ucom_poll) { (sc->sc_callback->ucom_poll) (sc); /* simple flow control */ if (temp == 0) Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/serial/usb_serial.h Wed Sep 14 12:07:34 2016 (r305806) @@ -194,9 +194,9 @@ struct ucom_softc { uint8_t sc_jitterbuf[UCOM_JITTERBUF_SIZE]; }; -#define UCOM_MTX_ASSERT(sc, what) mtx_assert((sc)->sc_mtx, what) -#define UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx) -#define UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx) +#define UCOM_MTX_ASSERT(sc, what) USB_MTX_ASSERT((sc)->sc_mtx, what) +#define UCOM_MTX_LOCK(sc) USB_MTX_LOCK((sc)->sc_mtx) +#define UCOM_MTX_UNLOCK(sc) USB_MTX_UNLOCK((sc)->sc_mtx) #define UCOM_UNLOAD_DRAIN(x) \ SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0) Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/storage/umass.c Wed Sep 14 12:07:34 2016 (r305806) @@ -1141,7 +1141,7 @@ umass_cancel_ccb(struct umass_softc *sc) { union ccb *ccb; - mtx_assert(&sc->sc_mtx, MA_OWNED); + USB_MTX_ASSERT(&sc->sc_mtx, MA_OWNED); ccb = sc->sc_transfer.ccb; sc->sc_transfer.ccb = NULL; Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_busdma.c Wed Sep 14 12:07:34 2016 (r305806) @@ -508,7 +508,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ done: owned = mtx_owned(uptag->mtx); if (!owned) - mtx_lock(uptag->mtx); + USB_MTX_LOCK(uptag->mtx); uptag->dma_error = (error ? 1 : 0); if (isload) { @@ -517,7 +517,7 @@ done: cv_broadcast(uptag->cv); } if (!owned) - mtx_unlock(uptag->mtx); + USB_MTX_UNLOCK(uptag->mtx); } /*------------------------------------------------------------------------* @@ -592,7 +592,7 @@ usb_pc_alloc_mem(struct usb_page_cache * pc->tag = utag->tag; pc->ismultiseg = (align == 1); - mtx_lock(uptag->mtx); + USB_MTX_LOCK(uptag->mtx); /* load memory into DMA */ err = bus_dmamap_load( @@ -603,7 +603,7 @@ usb_pc_alloc_mem(struct usb_page_cache * cv_wait(uptag->cv, uptag->mtx); err = 0; } - mtx_unlock(uptag->mtx); + USB_MTX_UNLOCK(uptag->mtx); if (err || uptag->dma_error) { bus_dmamem_free(utag->tag, ptr, map); @@ -659,7 +659,7 @@ usb_pc_load_mem(struct usb_page_cache *p pc->page_offset_end = size; pc->ismultiseg = 1; - mtx_assert(pc->tag_parent->mtx, MA_OWNED); + USB_MTX_ASSERT(pc->tag_parent->mtx, MA_OWNED); if (size > 0) { if (sync) { @@ -917,7 +917,7 @@ usb_bdma_work_loop(struct usb_xfer_queue xfer = pq->curr; info = xfer->xroot; - mtx_assert(info->xfer_mtx, MA_OWNED); + USB_MTX_ASSERT(info->xfer_mtx, MA_OWNED); if (xfer->error) { /* some error happened */ @@ -1041,7 +1041,7 @@ usb_bdma_done_event(struct usb_dma_paren info = USB_DMATAG_TO_XROOT(udpt); - mtx_assert(info->xfer_mtx, MA_OWNED); + USB_MTX_ASSERT(info->xfer_mtx, MA_OWNED); /* copy error */ info->dma_error = udpt->dma_error; Modified: head/sys/dev/usb/usb_core.c ============================================================================== --- head/sys/dev/usb/usb_core.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_core.c Wed Sep 14 12:07:34 2016 (r305806) @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include #include @@ -64,4 +66,16 @@ const struct usb_string_lang usb_string_ MALLOC_DEFINE(M_USB, "USB", "USB"); MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device"); +int +usbd_in_polling_mode(void) +{ + return (USB_IN_POLLING_MODE_VALUE()); +} + +void +usbd_dummy_timeout(void *arg) +{ + /* NOP */ +} + MODULE_VERSION(usb, 1); Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_core.h Wed Sep 14 12:07:34 2016 (r305806) @@ -39,17 +39,20 @@ USB_MODE_DEVICE ? (((xfer)->endpointno & UE_DIR_IN) ? 0 : 1) : \ (((xfer)->endpointno & UE_DIR_IN) ? 1 : 0)) -/* macros */ - -#define USB_BUS_LOCK(_b) mtx_lock(&(_b)->bus_mtx) -#define USB_BUS_UNLOCK(_b) mtx_unlock(&(_b)->bus_mtx) -#define USB_BUS_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_mtx, _t) -#define USB_BUS_SPIN_LOCK(_b) mtx_lock_spin(&(_b)->bus_spin_lock) -#define USB_BUS_SPIN_UNLOCK(_b) mtx_unlock_spin(&(_b)->bus_spin_lock) -#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_spin_lock, _t) -#define USB_XFER_LOCK(_x) mtx_lock((_x)->xroot->xfer_mtx) -#define USB_XFER_UNLOCK(_x) mtx_unlock((_x)->xroot->xfer_mtx) -#define USB_XFER_LOCK_ASSERT(_x, _t) mtx_assert((_x)->xroot->xfer_mtx, _t) +/* locking wrappers for BUS lock */ +#define USB_BUS_LOCK(_b) USB_MTX_LOCK(&(_b)->bus_mtx) +#define USB_BUS_UNLOCK(_b) USB_MTX_UNLOCK(&(_b)->bus_mtx) +#define USB_BUS_LOCK_ASSERT(_b, _t) USB_MTX_ASSERT(&(_b)->bus_mtx, _t) + +/* locking wrappers for BUS spin lock */ +#define USB_BUS_SPIN_LOCK(_b) USB_MTX_LOCK_SPIN(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_UNLOCK(_b) USB_MTX_UNLOCK_SPIN(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) USB_MTX_ASSERT(&(_b)->bus_spin_lock, _t) + +/* locking wrappers for XFER lock */ +#define USB_XFER_LOCK(_x) USB_MTX_LOCK((_x)->xroot->xfer_mtx) +#define USB_XFER_UNLOCK(_x) USB_MTX_UNLOCK((_x)->xroot->xfer_mtx) +#define USB_XFER_LOCK_ASSERT(_x, _t) USB_MTX_ASSERT((_x)->xroot->xfer_mtx, _t) /* helper for converting pointers to integers */ #define USB_P2U(ptr) \ Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_dev.c Wed Sep 14 12:07:34 2016 (r305806) @@ -1159,7 +1159,7 @@ usb_filter_write(struct knote *kn, long f = kn->kn_hook; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); cpd = f->curr_cpd; if (cpd == NULL) { @@ -1200,7 +1200,7 @@ usb_filter_read(struct knote *kn, long h f = kn->kn_hook; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); cpd = f->curr_cpd; if (cpd == NULL) { @@ -1730,7 +1730,7 @@ usb_fifo_wait(struct usb_fifo *f) { int err; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); if (f->flag_iserror) { /* we are gone */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_device.c Wed Sep 14 12:07:34 2016 (r305806) @@ -1511,13 +1511,13 @@ usbd_clear_stall_proc(struct usb_proc_ms /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(&udev->device_mtx); + USB_MTX_LOCK(&udev->device_mtx); /* Start clear stall callback */ usbd_transfer_start(udev->ctrl_xfer[1]); /* Change lock */ - mtx_unlock(&udev->device_mtx); + USB_MTX_UNLOCK(&udev->device_mtx); USB_BUS_LOCK(udev->bus); } Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_freebsd.h Wed Sep 14 12:07:34 2016 (r305806) @@ -90,6 +90,9 @@ #define USB_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ +#define USB_IN_POLLING_MODE_FUNC() usbd_in_polling_mode() +#define USB_IN_POLLING_MODE_VALUE() (SCHEDULER_STOPPED() || kdb_active) + typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ typedef uint32_t usb_frcount_t; /* units */ Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_freebsd_loader.h Wed Sep 14 12:07:34 2016 (r305806) @@ -85,6 +85,9 @@ #define USB_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ +#define USB_IN_POLLING_MODE_FUNC() 0 +#define USB_IN_POLLING_MODE_VALUE() 0 + typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ typedef uint32_t usb_frcount_t; /* units */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_generic.c Wed Sep 14 12:07:34 2016 (r305806) @@ -236,7 +236,7 @@ ugen_open_pipe_write(struct usb_fifo *f) struct usb_endpoint *ep = usb_fifo_softc(f); struct usb_endpoint_descriptor *ed = ep->edesc; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); if (f->xfer[0] || f->xfer[1]) { /* transfers are already opened */ @@ -305,7 +305,7 @@ ugen_open_pipe_read(struct usb_fifo *f) struct usb_endpoint *ep = usb_fifo_softc(f); struct usb_endpoint_descriptor *ed = ep->edesc; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); if (f->xfer[0] || f->xfer[1]) { /* transfers are already opened */ Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_hub.c Wed Sep 14 12:07:34 2016 (r305806) @@ -270,11 +270,11 @@ uhub_reset_tt_proc(struct usb_proc_msg * /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(&sc->sc_mtx); + USB_MTX_LOCK(&sc->sc_mtx); /* Start transfer */ usbd_transfer_start(sc->sc_xfer[UHUB_RESET_TT_TRANSFER]); /* Change lock */ - mtx_unlock(&sc->sc_mtx); + USB_MTX_UNLOCK(&sc->sc_mtx); USB_BUS_LOCK(udev->bus); } #endif @@ -1519,9 +1519,9 @@ uhub_attach(device_t dev) /* Start the interrupt endpoint, if any */ - mtx_lock(&sc->sc_mtx); + USB_MTX_LOCK(&sc->sc_mtx); usbd_transfer_start(sc->sc_xfer[UHUB_INTR_TRANSFER]); - mtx_unlock(&sc->sc_mtx); + USB_MTX_UNLOCK(&sc->sc_mtx); /* Enable automatic power save on all USB HUBs */ Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_msctest.c Wed Sep 14 12:07:34 2016 (r305806) @@ -551,13 +551,13 @@ bbb_command_start(struct bbb_transfer *s memcpy(&sc->cbw->CBWCDB, cmd_ptr, cmd_len); DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, (char *)sc->cbw->CBWCDB, ":"); - mtx_lock(&sc->mtx); + USB_MTX_LOCK(&sc->mtx); usbd_transfer_start(sc->xfer[sc->state]); while (usbd_transfer_pending(sc->xfer[sc->state])) { cv_wait(&sc->cv, &sc->mtx); } - mtx_unlock(&sc->mtx); + USB_MTX_UNLOCK(&sc->mtx); return (sc->error); } @@ -582,11 +582,11 @@ bbb_raw_write(struct bbb_transfer *sc, c DPRINTFN(1, "BULK DATA = %*D\n", (int)data_len, (const char *)data_ptr, ":"); - mtx_lock(&sc->mtx); + USB_MTX_LOCK(&sc->mtx); usbd_transfer_start(sc->xfer[0]); while (usbd_transfer_pending(sc->xfer[0])) cv_wait(&sc->cv, &sc->mtx); - mtx_unlock(&sc->mtx); + USB_MTX_UNLOCK(&sc->mtx); return (sc->error); } Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_process.c Wed Sep 14 12:07:34 2016 (r305806) @@ -115,7 +115,7 @@ usb_process(void *arg) sched_prio(td, up->up_prio); thread_unlock(td); - mtx_lock(up->up_mtx); + USB_MTX_LOCK(up->up_mtx); up->up_curtd = td; @@ -195,7 +195,7 @@ usb_process(void *arg) up->up_ptr = NULL; cv_signal(&up->up_cv); - mtx_unlock(up->up_mtx); + USB_MTX_UNLOCK(up->up_mtx); #if (__FreeBSD_version >= 800000) /* Clear the proc pointer if this is the last thread. */ if (--usb_pcount == 0) @@ -291,11 +291,12 @@ usb_proc_msignal(struct usb_process *up, usb_size_t d; uint8_t t; - /* check if gone, return dummy value */ - if (up->up_gone) + /* check if gone or in polling mode, return dummy value */ + if (up->up_gone != 0 || + USB_IN_POLLING_MODE_FUNC() != 0) return (_pm0); - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); t = 0; @@ -376,7 +377,7 @@ usb_proc_is_gone(struct usb_process *up) * structure is initialised. */ if (up->up_mtx != NULL) - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); return (0); } @@ -397,7 +398,7 @@ usb_proc_mwait(struct usb_process *up, v if (up->up_gone) return; - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); if (up->up_curtd == curthread) { /* Just remove the messages from the queue. */ @@ -437,9 +438,9 @@ usb_proc_drain(struct usb_process *up) return; /* handle special case with Giant */ if (up->up_mtx != &Giant) - mtx_assert(up->up_mtx, MA_NOTOWNED); + USB_MTX_ASSERT(up->up_mtx, MA_NOTOWNED); - mtx_lock(up->up_mtx); + USB_MTX_LOCK(up->up_mtx); /* Set the gone flag */ @@ -472,7 +473,7 @@ usb_proc_drain(struct usb_process *up) DPRINTF("WARNING: Someone is waiting " "for USB process drain!\n"); } - mtx_unlock(up->up_mtx); + USB_MTX_UNLOCK(up->up_mtx); } /*------------------------------------------------------------------------* @@ -493,7 +494,7 @@ usb_proc_rewakeup(struct usb_process *up if (up->up_gone) return; - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); if (up->up_msleep == 0) { /* re-wakeup */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_request.c Wed Sep 14 12:07:34 2016 (r305806) @@ -455,8 +455,8 @@ usbd_do_request_flags(struct usb_device return (USB_ERR_INVAL); #endif if ((mtx != NULL) && (mtx != &Giant)) { - mtx_unlock(mtx); - mtx_assert(mtx, MA_NOTOWNED); + USB_MTX_UNLOCK(mtx); + USB_MTX_ASSERT(mtx, MA_NOTOWNED); } /* @@ -710,7 +710,7 @@ done: usbd_ctrl_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) - mtx_lock(mtx); + USB_MTX_LOCK(mtx); switch (err) { case USB_ERR_NORMAL_COMPLETION: Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_transfer.c Wed Sep 14 12:07:34 2016 (r305806) @@ -45,7 +45,6 @@ #include #include #include -#include #include #include @@ -329,12 +328,12 @@ usbd_transfer_setup_sub_malloc(struct us pc->buffer = USB_ADD_BYTES(buf, y * size); pc->page_start = pg; - mtx_lock(pc->tag_parent->mtx); + USB_MTX_LOCK(pc->tag_parent->mtx); if (usb_pc_load_mem(pc, size, 1 /* synchronous */ )) { - mtx_unlock(pc->tag_parent->mtx); + USB_MTX_UNLOCK(pc->tag_parent->mtx); return (1); /* failure */ } - mtx_unlock(pc->tag_parent->mtx); + USB_MTX_UNLOCK(pc->tag_parent->mtx); } } } @@ -2262,14 +2261,14 @@ usb_callback_proc(struct usb_proc_msg *_ * We exploit the fact that the mutex is the same for all * callbacks that will be called from this thread: */ - mtx_lock(info->xfer_mtx); + USB_MTX_LOCK(info->xfer_mtx); USB_BUS_LOCK(info->bus); /* Continue where we lost track */ usb_command_wrapper(&info->done_q, info->done_q.curr); - mtx_unlock(info->xfer_mtx); + USB_MTX_UNLOCK(info->xfer_mtx); } /*------------------------------------------------------------------------* @@ -2322,7 +2321,7 @@ usbd_callback_wrapper(struct usb_xfer_qu USB_BUS_LOCK_ASSERT(info->bus, MA_OWNED); if ((pq->recurse_3 != 0 || mtx_owned(info->xfer_mtx) == 0) && - SCHEDULER_STOPPED() == 0) { + USB_IN_POLLING_MODE_FUNC() == 0) { /* * Cases that end up here: * @@ -3303,7 +3302,9 @@ usbd_transfer_poll(struct usb_xfer **ppx struct usb_xfer_root *xroot; struct usb_device *udev; struct usb_proc_msg *pm; + struct usb_bus *bus; uint16_t n; + uint16_t drop_bus_spin; uint16_t drop_bus; uint16_t drop_xfer; @@ -3318,36 +3319,47 @@ usbd_transfer_poll(struct usb_xfer **ppx udev = xroot->udev; if (udev == NULL) continue; /* no USB device */ - if (udev->bus == NULL) + bus = udev->bus; + if (bus == NULL) continue; /* no BUS structure */ - if (udev->bus->methods == NULL) + if (bus->methods == NULL) continue; /* no BUS methods */ - if (udev->bus->methods->xfer_poll == NULL) + if (bus->methods->xfer_poll == NULL) continue; /* no poll method */ - /* make sure that the BUS mutex is not locked */ + drop_bus_spin = 0; drop_bus = 0; - while (mtx_owned(&xroot->udev->bus->bus_mtx) && !SCHEDULER_STOPPED()) { - mtx_unlock(&xroot->udev->bus->bus_mtx); - drop_bus++; - } - - /* make sure that the transfer mutex is not locked */ drop_xfer = 0; - while (mtx_owned(xroot->xfer_mtx) && !SCHEDULER_STOPPED()) { - mtx_unlock(xroot->xfer_mtx); - drop_xfer++; + + if (USB_IN_POLLING_MODE_FUNC() == 0) { + /* make sure that the BUS spin mutex is not locked */ + while (mtx_owned(&bus->bus_spin_lock)) { + mtx_unlock_spin(&bus->bus_spin_lock); + drop_bus_spin++; + } + + /* make sure that the BUS mutex is not locked */ + while (mtx_owned(&bus->bus_mtx)) { + mtx_unlock(&bus->bus_mtx); + drop_bus++; + } + + /* make sure that the transfer mutex is not locked */ + while (mtx_owned(xroot->xfer_mtx)) { + mtx_unlock(xroot->xfer_mtx); + drop_xfer++; + } } /* Make sure cv_signal() and cv_broadcast() is not called */ - USB_BUS_CONTROL_XFER_PROC(udev->bus)->up_msleep = 0; - USB_BUS_EXPLORE_PROC(udev->bus)->up_msleep = 0; - USB_BUS_GIANT_PROC(udev->bus)->up_msleep = 0; - USB_BUS_NON_GIANT_ISOC_PROC(udev->bus)->up_msleep = 0; - USB_BUS_NON_GIANT_BULK_PROC(udev->bus)->up_msleep = 0; + USB_BUS_CONTROL_XFER_PROC(bus)->up_msleep = 0; + USB_BUS_EXPLORE_PROC(bus)->up_msleep = 0; + USB_BUS_GIANT_PROC(bus)->up_msleep = 0; + USB_BUS_NON_GIANT_ISOC_PROC(bus)->up_msleep = 0; + USB_BUS_NON_GIANT_BULK_PROC(bus)->up_msleep = 0; /* poll USB hardware */ - (udev->bus->methods->xfer_poll) (udev->bus); + (bus->methods->xfer_poll) (bus); USB_BUS_LOCK(xroot->bus); @@ -3375,7 +3387,11 @@ usbd_transfer_poll(struct usb_xfer **ppx /* restore BUS mutex */ while (drop_bus--) - mtx_lock(&xroot->udev->bus->bus_mtx); + mtx_lock(&bus->bus_mtx); + + /* restore BUS spin mutex */ + while (drop_bus_spin--) + mtx_lock_spin(&bus->bus_spin_lock); } } Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usbdi.h Wed Sep 14 12:07:34 2016 (r305806) @@ -435,6 +435,39 @@ struct usb_attach_arg { }; /* + * General purpose locking wrappers to ease supporting + * USB polled mode: + */ +#ifdef INVARIANTS +#define USB_MTX_ASSERT(_m, _t) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_assert(_m, _t); \ +} while (0) +#else +#define USB_MTX_ASSERT(_m, _t) do { } while (0) +#endif + +#define USB_MTX_LOCK(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_lock(_m); \ +} while (0) + +#define USB_MTX_UNLOCK(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_unlock(_m); \ +} while (0) + +#define USB_MTX_LOCK_SPIN(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_lock_spin(_m); \ +} while (0) + +#define USB_MTX_UNLOCK_SPIN(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_unlock_spin(_m); \ +} while (0) + +/* * The following is a wrapper for the callout structure to ease * porting the code to other platforms. */ @@ -442,8 +475,26 @@ struct usb_callout { struct callout co; }; #define usb_callout_init_mtx(c,m,f) callout_init_mtx(&(c)->co,m,f) -#define usb_callout_reset(c,t,f,d) callout_reset(&(c)->co,t,f,d) -#define usb_callout_stop(c) callout_stop(&(c)->co) +#define usb_callout_reset(c,...) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + callout_reset(&(c)->co, __VA_ARGS__); \ +} while (0) +#define usb_callout_reset_sbt(c,...) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + callout_reset_sbt(&(c)->co, __VA_ARGS__); \ +} while (0) +#define usb_callout_stop(c) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) { \ + callout_stop(&(c)->co); \ + } else { \ + /* \ + * Cannot stop callout when \ + * polling. Set dummy callback \ + * function instead: \ + */ \ + (c)->co.c_func = &usbd_dummy_timeout; \ + } \ +} while (0) #define usb_callout_drain(c) callout_drain(&(c)->co) #define usb_callout_pending(c) callout_pending(&(c)->co) @@ -623,6 +674,8 @@ void usbd_frame_zero(struct usb_page_cac void usbd_start_re_enumerate(struct usb_device *udev); usb_error_t usbd_start_set_config(struct usb_device *, uint8_t); +int usbd_in_polling_mode(void); +void usbd_dummy_timeout(void *); int usb_fifo_attach(struct usb_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb_fifo_methods *pm, From owner-svn-src-all@freebsd.org Wed Sep 14 12:57:42 2016 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 48DB8BDA5B2; Wed, 14 Sep 2016 12:57:42 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0C210EE; Wed, 14 Sep 2016 12:57:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8ECvfOr020354; Wed, 14 Sep 2016 12:57:41 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ECveAs020350; Wed, 14 Sep 2016 12:57:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609141257.u8ECveAs020350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 14 Sep 2016 12:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 12:57:42 -0000 Author: bde Date: Wed Sep 14 12:57:40 2016 New Revision: 305807 URL: https://svnweb.freebsd.org/changeset/base/305807 Log: Use the MI macro TRAPF_USERMODE() instead of open-coded checks for SEL_UPL and sometimes PSL_VM. This is just a style change on amd64, but on i386 it fixes 1 unimportant place where the PSL_VM check was missing and starts fixing 1 important place where the PSL_VM check had a logic error. Fix logic errors in treating vm86 bioscall mode as kernel mode. The main place checked all the necessary flags, but put the necessary parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong place. The broken case is only reached if a vm86 bioscall uses a %cs which is nonzero mod 4, but that is unusual -- most bios calls start with %cs = 0xc000 or 0xf000 and rarely change it. Another place was missing the check for PCB_VM86CALL, but was only reachable if there are bugs virtualizing PSL_I. Add a macro TF_HAS_STACKREGS() and use this instead of converting open-coded checks of SEL_UPL, etc. to TRAPF_USERMODE() when we only care about whether the frame has stack registers. This fixes 3 places in my recent fix for register variables in vm86 mode where I messed up the PSL_VM check and cleans up other places. Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/db_trace.c head/sys/i386/i386/trap.c head/sys/x86/include/frame.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/amd64/amd64/trap.c Wed Sep 14 12:57:40 2016 (r305807) @@ -236,7 +236,7 @@ trap(struct trapframe *frame) * interrupts disabled until they are accidentally * enabled later. */ - if (ISPL(frame->tf_cs) == SEL_UPL) + if (TRAPF_USERMODE(frame)) uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); @@ -260,7 +260,7 @@ trap(struct trapframe *frame) code = frame->tf_err; - if (ISPL(frame->tf_cs) == SEL_UPL) { + if (TRAPF_USERMODE(frame)) { /* user trap */ td->td_pticks = 0; @@ -787,7 +787,7 @@ trap_fatal(frame, eva) else msg = "UNKNOWN"; printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg, - ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel"); + TRAPF_USERMODE(frame) ? "user" : "kernel"); #ifdef SMP /* two separate prints in case of a trap on an unmapped page */ printf("cpuid = %d; ", PCPU_GET(cpuid)); @@ -804,7 +804,7 @@ trap_fatal(frame, eva) } printf("instruction pointer = 0x%lx:0x%lx\n", frame->tf_cs & 0xffff, frame->tf_rip); - if (ISPL(frame->tf_cs) == SEL_UPL) { + if (TF_HAS_STACKREGS(frame)) { ss = frame->tf_ss & 0xffff; esp = frame->tf_rsp; } else { @@ -934,7 +934,7 @@ amd64_syscall(struct thread *td, int tra ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(td->td_frame->tf_cs) != SEL_UPL) { + if (!TRAPF_USERMODE(frame)) { panic("syscall"); /* NOT REACHED */ } Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/i386/i386/db_trace.c Wed Sep 14 12:57:40 2016 (r305807) @@ -82,8 +82,7 @@ struct db_variable *db_eregs = db_regs + static __inline int get_esp(struct trapframe *tf) { - return ((ISPL(tf->tf_cs) || kdb_frame->tf_eflags & PSL_VM) ? - tf->tf_esp : (intptr_t)&tf->tf_esp); + return (TF_HAS_STACKREGS(tf) ? tf->tf_esp : (intptr_t)&tf->tf_esp); } static int @@ -147,7 +146,7 @@ db_esp(struct db_variable *vp, db_expr_t if (op == DB_VAR_GET) *valuep = get_esp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) + else if (TF_HAS_STACKREGS(kdb_frame)) kdb_frame->tf_esp = *valuep; return (1); } @@ -180,9 +179,9 @@ db_ss(struct db_variable *vp, db_expr_t return (0); if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs) || - kdb_frame->tf_eflags & PSL_VM) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs) || kdb_frame->tf_eflags & PSL_VM) + *valuep = TF_HAS_STACKREGS(kdb_frame) ? kdb_frame->tf_ss : + rss(); + else if (TF_HAS_STACKREGS(kdb_frame)) kdb_frame->tf_ss = *valuep; return (1); } @@ -439,7 +438,7 @@ db_backtrace(struct thread *td, struct t * Find where the trap frame actually ends. * It won't contain tf_esp or tf_ss unless crossing rings. */ - if (ISPL(kdb_frame->tf_cs)) + if (TF_HAS_STACKREGS(kdb_frame)) instr = (int)(kdb_frame + 1); else instr = (int)&kdb_frame->tf_esp; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/i386/i386/trap.c Wed Sep 14 12:57:40 2016 (r305807) @@ -267,7 +267,8 @@ trap(struct trapframe *frame) * interrupts disabled until they are accidentally * enabled later. */ - if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM)) + if (TRAPF_USERMODE(frame) && + (curpcb->pcb_flags & PCB_VM86CALL) == 0) uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); @@ -307,9 +308,7 @@ trap(struct trapframe *frame) enable_intr(); } - if ((ISPL(frame->tf_cs) == SEL_UPL) || - ((frame->tf_eflags & PSL_VM) && - !(curpcb->pcb_flags & PCB_VM86CALL))) { + if (TRAPF_USERMODE(frame) && (curpcb->pcb_flags & PCB_VM86CALL) == 0) { /* user trap */ td->td_pticks = 0; @@ -963,7 +962,7 @@ trap_fatal(frame, eva) } printf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip); - if ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) { + if (TF_HAS_STACKREGS(frame)) { ss = frame->tf_ss & 0xffff; esp = frame->tf_esp; } else { @@ -1117,7 +1116,8 @@ syscall(struct trapframe *frame) ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { + if (!(TRAPF_USERMODE(frame) && + (curpcb->pcb_flags & PCB_VM86CALL) == 0)) { panic("syscall"); /* NOT REACHED */ } Modified: head/sys/x86/include/frame.h ============================================================================== --- head/sys/x86/include/frame.h Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/x86/include/frame.h Wed Sep 14 12:57:40 2016 (r305807) @@ -64,7 +64,7 @@ struct trapframe { int tf_eip; int tf_cs; int tf_eflags; - /* below only when crossing rings (e.g. user to kernel) */ + /* below only when crossing rings (user to kernel) */ int tf_esp; int tf_ss; }; @@ -89,10 +89,10 @@ struct trapframe_vm86 { int tf_eip; int tf_cs; int tf_eflags; - /* below only when crossing rings (e.g. user to kernel) */ + /* below only when crossing rings (user (including vm86) to kernel) */ int tf_esp; int tf_ss; - /* below only when switching out of VM86 mode */ + /* below only when crossing from vm86 mode to kernel */ int tf_vm86_es; int tf_vm86_ds; int tf_vm86_fs; @@ -136,6 +136,7 @@ struct trapframe { register_t tf_rip; register_t tf_cs; register_t tf_rflags; + /* below only when crossing rings (user to kernel) */ register_t tf_rsp; register_t tf_ss; }; @@ -145,4 +146,13 @@ struct trapframe { #define TF_HASFPXSTATE 0x4 #endif /* __amd64__ */ +/* + * This alias for the MI TRAPF_USERMODE() should be used when we don't + * care about user mode itself, but need to know if a frame has stack + * registers. The difference is only logical, but on i386 the logic + * for using TRAPF_USERMODE() is complicated by sometimes treating vm86 + * bioscall mode (which is a special ring 3 user mode) as kernel mode. + */ +#define TF_HAS_STACKREGS(tf) TRAPF_USERMODE(tf) + #endif /* _MACHINE_FRAME_H_ */ From owner-svn-src-all@freebsd.org Wed Sep 14 13:48:00 2016 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 5E6C1BD9947; Wed, 14 Sep 2016 13:48:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2859A1E2E; Wed, 14 Sep 2016 13:47:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7F0633C5890; Wed, 14 Sep 2016 23:25:43 +1000 (AEST) Date: Wed, 14 Sep 2016 23:25:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include In-Reply-To: <201609141257.u8ECveAs020350@repo.freebsd.org> Message-ID: <20160914230412.P1341@besplex.bde.org> References: <201609141257.u8ECveAs020350@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=xVT1lvnswLCTB-VdiCcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 13:48:00 -0000 On Wed, 14 Sep 2016, Bruce Evans wrote: > ... > Log: > ... > Fix logic errors in treating vm86 bioscall mode as kernel mode. The > main place checked all the necessary flags, but put the necessary > parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong > place. The broken case is only reached if a vm86 bioscall uses a > %cs which is nonzero mod 4, but that is unusual -- most bios calls > start with %cs = 0xc000 or 0xf000 and rarely change it. Another > place was missing the check for PCB_VM86CALL, but was only reachable > if there are bugs virtualizing PSL_I. Forgot: Reviewed by: kib Just before committing, I checked when this was broken. It was in the Giant attack for SMPng. vm86 bios calls need mutual exclusion, and apparently Giant was used, and WITNESS warned about this, so as a quick fix vm86 bios calls were treated as kernel mode although this causes other problems. Now vm86 bios calls use vm86_lock instead of Giant, but the quick fix is still in place. vm86 bios calls shouldn't be treated as kernel mode, but I used this recently to debug one. ddb almost worked on them without really trying. It should work similarly on normal vm86 user mode and normal user mode if we sent the debugger traps to ddb instead of to the thread. There is the problem that users must not be allowed to enter the kernel using unprivileged debugger traps. Already for vm86 bios calls, we depend on BIOSes not generating any debugger traps. My recent changes to keep the trace flag set by ddb will have to be reviewed to make sure that if vm86 mode initiates the setting of the trace flag then the resulting trap doesn't go to the kernel. Bruce From owner-svn-src-all@freebsd.org Wed Sep 14 13:50:43 2016 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 5711CBD9A4C for ; Wed, 14 Sep 2016 13:50:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm33-vm7.bullet.mail.bf1.yahoo.com (nm33-vm7.bullet.mail.bf1.yahoo.com [72.30.239.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EFE911DE for ; Wed, 14 Sep 2016 13:50:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473860249; bh=guOGPWpn10ETnmQ94zx9ITgFkGjBkmp4g7fqG1y8qj0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=rHdaRhFNSbCC+f4pTFvuUu7951KB1vFwd4mRJcprPcHl8O24cGtVK5QwhGfQrk097ZHTUp6aUcMn8a0SmLAOTpq7AXRhuguK7nna4NRT/2lHDAs71tJduilsSWQxMa0kcoXmKx/h3HD/ZELLu+zz2fmT+fHZLSrlefNYy8hTeJ7PwnElL9dOA3iway+HwtUoOkhpSJTEnzIc+y9VAGaxHpVaNQT0bIiirleYnvk/85oPvtkUfH+1tLNop22nHjM5LW4xACKmEy8r+A7khnoB2Ev3CVbNjCToMqUaGan5UbiJmyVT6MTomUKspHEWVypEzwB+jxcvkMLTnTkDGgfs7g== Received: from [66.196.81.172] by nm33.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 13:37:29 -0000 Received: from [98.139.211.196] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 13:37:29 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 13:37:29 -0000 X-Yahoo-Newman-Id: 622272.71725.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gY.07hsVM1kU3ul1nWePX44cVLuRpHuya7feQLujmUEEPm8 UVs2nlgXD7pNJTa_qQs.kcuT1u4_C5p8i4yuEep9ncx6f92plUufJFOA8ZVc hEwR0VTnbdQuMr_zv0CmYKtKQ6zWgjRp3yGWKukOpfxiK_3qlz3xmDQpvB8H I8UFdsqKmdf9kUUMUp29FOvxcB16mSu0l0i1DjMltEYOnIwLUm7gEVhvFJaA seRbHefHHhYMB0zVGmedzVqM2BzdJw5q9n1S1vLICLODWpOSAzA8y9oHFXRR tcfIiOGd6vqKBrvMLkGwtb9qn5qGy0RPzWl4FDgctm1V6TnF0oOIu0vCtXKW eN3Kpz90ykyUMWQf_y6swM1YSji_eGCs.mapLihi6izEjYMISozOPw1TqHlh ..g2ZR72nmDPQjavHzaE.kiIfgkpLUxAHBom6rbMIVu1PBwABoMDMKZF32w5 BNVYnlyMH1_B5nnENX50tpFhBs3gf7u_z5Mf0eWIQxkp4rPITeNt.6npLtca _50vaBOGuAUelUR6nkQxv.O29Ff51OQWjSJ43TwM6S3hwsQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test To: Baptiste Daroussin , Cy Schubert References: <201609140147.u8E1l1qh065260@repo.freebsd.org> <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: Date: Wed, 14 Sep 2016 08:37:37 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 13:50:43 -0000 Hello; On 14/09/2016 00:00, Baptiste Daroussin wrote: > On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: >> Author: cy >> Date: Wed Sep 14 01:47:01 2016 >> New Revision: 305787 >> URL: https://svnweb.freebsd.org/changeset/base/305787 >> >> Log: >> Switch from .CURDIR to the simpler, more legible SRCTOP. >> >> Suggested by: emaste >> X-MFC-with: upcoming amd upgrade >> > I thought the plans was more to deprecated and remove amd at some points given > we now have autofs/automountd? Am I missing something? We haven't discussed deprecation, although it's not off the table. From what I read about amd, it gets along with autofs well. It appears some sysadmins may be used to amd and just removing it may violate POLA. It may be that the port/pkg is sufficient but before removing we should update it to match what the port has. Pedro. From owner-svn-src-all@freebsd.org Wed Sep 14 14:48:01 2016 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 52711BDAFAF; Wed, 14 Sep 2016 14:48:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3851834; Wed, 14 Sep 2016 14:48:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EEm0KP062878; Wed, 14 Sep 2016 14:48:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EEm0CD062877; Wed, 14 Sep 2016 14:48:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201609141448.u8EEm0CD062877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 14 Sep 2016 14:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305810 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 14:48:01 -0000 Author: tuexen Date: Wed Sep 14 14:48:00 2016 New Revision: 305810 URL: https://svnweb.freebsd.org/changeset/base/305810 Log: Ensure that the IPPROTO_TCP level socket options * TCP_KEEPINIT * TCP_KEEPINTVL * TCP_KEEPIDLE * TCP_KEEPCNT always always report the values currently used when getsockopt() is used. This wasn't the case when the sysctl-inherited default values where used. Ensure that the IPPROTO_TCP level socket option TCP_INFO has the TCPI_OPT_ECN flag set in the tcpi_options field when ECN support has been negotiated successfully. Reviewed by: rrs, jtl, hiren MFC after: 1 month Differential Revision: 7833 Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Sep 14 14:05:31 2016 (r305809) +++ head/sys/netinet/tcp_usrreq.c Wed Sep 14 14:48:00 2016 (r305810) @@ -1329,6 +1329,8 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_snd_wscale = tp->snd_scale; ti->tcpi_rcv_wscale = tp->rcv_scale; } + if (tp->t_flags & TF_ECN_PERMIT) + ti->tcpi_options |= TCPI_OPT_ECN; ti->tcpi_rto = tp->t_rxtcur * tick; ti->tcpi_last_data_recv = (long)(ticks - (int)tp->t_rcvtime) * tick; @@ -1817,16 +1819,16 @@ unlock_and_done: case TCP_KEEPCNT: switch (sopt->sopt_name) { case TCP_KEEPIDLE: - ui = tp->t_keepidle / hz; + ui = TP_KEEPIDLE(tp) / hz; break; case TCP_KEEPINTVL: - ui = tp->t_keepintvl / hz; + ui = TP_KEEPINTVL(tp) / hz; break; case TCP_KEEPINIT: - ui = tp->t_keepinit / hz; + ui = TP_KEEPINIT(tp) / hz; break; case TCP_KEEPCNT: - ui = tp->t_keepcnt; + ui = TP_KEEPCNT(tp); break; } INP_WUNLOCK(inp); From owner-svn-src-all@freebsd.org Wed Sep 14 16:03:47 2016 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 4CF93BDAC5D; Wed, 14 Sep 2016 16:03:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E9834177A; Wed, 14 Sep 2016 16:03:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4C44625D3A9D; Wed, 14 Sep 2016 16:03:42 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 7728AD1F7F1; Wed, 14 Sep 2016 16:03:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 1wKPvZsxEJ6G; Wed, 14 Sep 2016 16:03:39 +0000 (UTC) Received: from [10.248.105.13] (fresh-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4920:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id EA660D1F7DF; Wed, 14 Sep 2016 16:03:38 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Bruce Evans" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include Date: Wed, 14 Sep 2016 16:03:37 +0000 Message-ID: <439B0258-5FEB-4136-BF30-72A0B6E0AEDD@lists.zabbadoz.net> In-Reply-To: <201609141257.u8ECveAs020350@repo.freebsd.org> References: <201609141257.u8ECveAs020350@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (2.0BETAr6054) Content-Type: text/plain; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 16:03:47 -0000 On 14 Sep 2016, at 12:57, Bruce Evans wrote: > Author: bde > Date: Wed Sep 14 12:57:40 2016 > New Revision: 305807 > URL: https://svnweb.freebsd.org/changeset/base/305807 > > Log: > > Modified: > head/sys/amd64/amd64/trap.c breaks all amd64 LINT* kernels: /scratch/tmp/bz/head.svn/sys/amd64/amd64/trap.c:937:22: error: use of undeclared identifier 'frame'; did you mean 'free'? if (!TRAPF_USERMODE(frame)) { ^~~~~ free ./machine/cpu.h:53:9: note: expanded from macro 'TRAPF_USERMODE' (ISPL((framep)->tf_cs) == SEL_UPL) ^ ./x86/segments.h:48:20: note: expanded from macro 'ISPL' #define ISPL(s) ((s)&3) /* priority level of a selector */ ^ /scratch/tmp/bz/head.svn/sys/sys/malloc.h:175:6: note: 'free' declared here void free(void *addr, struct malloc_type *type); ^ /scratch/tmp/bz/head.svn/sys/amd64/amd64/trap.c:937:7: error: member reference base type 'void (void *, struct malloc_type *)' is not a structure or union if (!TRAPF_USERMODE(frame)) { ^~~~~~~~~~~~~~~~~~~~~ ./machine/cpu.h:53:16: note: expanded from macro 'TRAPF_USERMODE' (ISPL((framep)->tf_cs) == SEL_UPL) ~~~~~~~~~~~~~^~~~~~~~ ./x86/segments.h:48:20: note: expanded from macro 'ISPL' #define ISPL(s) ((s)&3) /* priority level of a selector */ ^ 2 errors generated. --- trap.o --- *** [trap.o] Error code 1 bmake[5]: stopped in /storage/head/obj/scratch/tmp/bz/head.svn/sys/LINT From owner-svn-src-all@freebsd.org Wed Sep 14 16:08:25 2016 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 2A4ADBDAE69; Wed, 14 Sep 2016 16:08:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE691B6C; Wed, 14 Sep 2016 16:08:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EG8OX7001241; Wed, 14 Sep 2016 16:08:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EG8O9H001240; Wed, 14 Sep 2016 16:08:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201609141608.u8EG8O9H001240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 14 Sep 2016 16:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305811 - head/sys/amd64/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 16:08:25 -0000 Author: bz Date: Wed Sep 14 16:08:23 2016 New Revision: 305811 URL: https://svnweb.freebsd.org/changeset/base/305811 Log: Try to fix LINT builds after r305807. Seems to be a simple s&r error I missed while reading through the 1st time as well. Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Sep 14 14:48:00 2016 (r305810) +++ head/sys/amd64/amd64/trap.c Wed Sep 14 16:08:23 2016 (r305811) @@ -934,7 +934,7 @@ amd64_syscall(struct thread *td, int tra ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (!TRAPF_USERMODE(frame)) { + if (!TRAPF_USERMODE(td->td_frame)) { panic("syscall"); /* NOT REACHED */ } From owner-svn-src-all@freebsd.org Wed Sep 14 16:34:54 2016 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 3455CBDB648; Wed, 14 Sep 2016 16:34:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECA3E1A3E; Wed, 14 Sep 2016 16:34:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EGYrXp012430; Wed, 14 Sep 2016 16:34:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EGYqIJ012426; Wed, 14 Sep 2016 16:34:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201609141634.u8EGYqIJ012426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 14 Sep 2016 16:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305812 - head/usr.sbin/fifolog/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 16:34:54 -0000 Author: pfg Date: Wed Sep 14 16:34:52 2016 New Revision: 305812 URL: https://svnweb.freebsd.org/changeset/base/305812 Log: fifolog(1): invert order of calloc(3) arguments. The second argment to calloc(3) should be the size, make it so. While here be a little bit more cautious in fifolog_reader_open() to protect in the unlikely event of an overflowed allocation. MFC after: 3 weeks Modified: head/usr.sbin/fifolog/lib/fifolog_create.c head/usr.sbin/fifolog/lib/fifolog_reader.c head/usr.sbin/fifolog/lib/fifolog_write_poll.c head/usr.sbin/fifolog/lib/miniobj.h Modified: head/usr.sbin/fifolog/lib/fifolog_create.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_create.c Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/fifolog_create.c Wed Sep 14 16:34:52 2016 (r305812) @@ -97,7 +97,7 @@ fifolog_create(const char *fn, off_t siz if (S_ISREG(st.st_mode) && ftruncate(fd, size) < 0) return ("Could not ftrunc"); - buf = calloc(recsize, 1); + buf = calloc(1, recsize); if (buf == NULL) return ("Could not malloc"); Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_reader.c Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/fifolog_reader.c Wed Sep 14 16:34:52 2016 (r305812) @@ -67,10 +67,10 @@ fifolog_reader_open(const char *fname) if (retval != NULL) err(1, "%s", retval); - fr->olen = fr->ff->recsize * 16; - fr->obuf = calloc(fr->olen, 1); + fr->obuf = calloc(16, fr->ff->recsize); if (fr->obuf == NULL) err(1, "Cannot malloc"); + fr->olen = fr->ff->recsize * 16; i = inflateInit(fr->ff->zs); assert(i == Z_OK); Modified: head/usr.sbin/fifolog/lib/fifolog_write_poll.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write_poll.c Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/fifolog_write_poll.c Wed Sep 14 16:34:52 2016 (r305812) @@ -45,7 +45,7 @@ static int fifolog_write_gzip(struct fifolog_writer *f, time_t now); #define ALLOC(ptr, size) do { \ - (*(ptr)) = calloc(size, 1); \ + (*(ptr)) = calloc(1, size); \ assert(*(ptr) != NULL); \ } while (0) Modified: head/usr.sbin/fifolog/lib/miniobj.h ============================================================================== --- head/usr.sbin/fifolog/lib/miniobj.h Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/miniobj.h Wed Sep 14 16:34:52 2016 (r305812) @@ -28,7 +28,7 @@ #define ALLOC_OBJ(to, type_magic) \ do { \ - (to) = calloc(sizeof *(to), 1); \ + (to) = calloc(1, sizeof *(to)); \ if ((to) != NULL) \ (to)->magic = (type_magic); \ } while (0) From owner-svn-src-all@freebsd.org Wed Sep 14 16:47:18 2016 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 C4FE7BDBA4A; Wed, 14 Sep 2016 16:47:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9564711B0; Wed, 14 Sep 2016 16:47:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EGlHTB016589; Wed, 14 Sep 2016 16:47:17 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EGlHYv016588; Wed, 14 Sep 2016 16:47:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201609141647.u8EGlHYv016588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 14 Sep 2016 16:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305813 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 16:47:18 -0000 Author: pfg Date: Wed Sep 14 16:47:17 2016 New Revision: 305813 URL: https://svnweb.freebsd.org/changeset/base/305813 Log: localedef(1): make better use of calloc(3) arguments. The first argument of calloc(3) should be an ordinal type, and the second a size: split a multiplication to make better use of calloc(3) and detect overflows. Do some other re-ordering and style fixes while here. MFC after: 3 weeks Modified: head/usr.bin/localedef/collate.c Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Wed Sep 14 16:34:52 2016 (r305812) +++ head/usr.bin/localedef/collate.c Wed Sep 14 16:47:17 2016 (r305813) @@ -1204,7 +1204,7 @@ dump_collate(void) subst_t *temp; RB_COUNT(temp, substs, &substs[i], n); collinfo.subst_count[i] = n; - if ((st = calloc(sizeof (collate_subst_t) * n, 1)) == NULL) { + if ((st = calloc(n, sizeof(collate_subst_t))) == NULL) { fprintf(stderr, "out of memory"); return; } @@ -1233,7 +1233,7 @@ dump_collate(void) */ RB_NUMNODES(collelem_t, elem_by_expand, &elem_by_expand, collinfo.chain_count); - chain = calloc(sizeof (collate_chain_t), collinfo.chain_count); + chain = calloc(collinfo.chain_count, sizeof(collate_chain_t)); if (chain == NULL) { fprintf(stderr, "out of memory"); return; @@ -1253,7 +1253,7 @@ dump_collate(void) * Large (> UCHAR_MAX) character priorities */ RB_NUMNODES(collchar_t, collchars, &collchars, n); - large = calloc(n, sizeof (collate_large_t)); + large = calloc(n, sizeof(collate_large_t)); if (large == NULL) { fprintf(stderr, "out of memory"); return; From owner-svn-src-all@freebsd.org Wed Sep 14 17:28:00 2016 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 C0F3BAC49CD; Wed, 14 Sep 2016 17:28:00 +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 83D3C1A48; Wed, 14 Sep 2016 17:27:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 667D2783A75; Thu, 15 Sep 2016 03:08:01 +1000 (AEST) Date: Thu, 15 Sep 2016 03:08:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305811 - head/sys/amd64/amd64 In-Reply-To: <201609141608.u8EG8O9H001240@repo.freebsd.org> Message-ID: <20160915030636.S2324@besplex.bde.org> References: <201609141608.u8EG8O9H001240@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=fyqRzDaQBy3XwA4F9WMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 17:28:00 -0000 On Wed, 14 Sep 2016, Bjoern A. Zeeb wrote: > Log: > Try to fix LINT builds after r305807. Seems to be a simple s&r error > I missed while reading through the 1st time as well. Thanks. The fix looks right. > Modified: > head/sys/amd64/amd64/trap.c > > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Wed Sep 14 14:48:00 2016 (r305810) > +++ head/sys/amd64/amd64/trap.c Wed Sep 14 16:08:23 2016 (r305811) > @@ -934,7 +934,7 @@ amd64_syscall(struct thread *td, int tra > ksiginfo_t ksi; > > #ifdef DIAGNOSTIC > - if (!TRAPF_USERMODE(frame)) { > + if (!TRAPF_USERMODE(td->td_frame)) { > panic("syscall"); > /* NOT REACHED */ > } Bruce From owner-svn-src-all@freebsd.org Wed Sep 14 17:34:47 2016 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 3E2D6AC4C0F; Wed, 14 Sep 2016 17:34:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id ED7DD1F51; Wed, 14 Sep 2016 17:34:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 373C6D46825; Thu, 15 Sep 2016 03:11:23 +1000 (AEST) Date: Thu, 15 Sep 2016 03:11:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include In-Reply-To: <439B0258-5FEB-4136-BF30-72A0B6E0AEDD@lists.zabbadoz.net> Message-ID: <20160915030828.C2324@besplex.bde.org> References: <201609141257.u8ECveAs020350@repo.freebsd.org> <439B0258-5FEB-4136-BF30-72A0B6E0AEDD@lists.zabbadoz.net> 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=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=NDyNz_EZ-ucPDKsh1gkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 17:34:47 -0000 On Wed, 14 Sep 2016, Bjoern A. Zeeb wrote: > On 14 Sep 2016, at 12:57, Bruce Evans wrote: > >> Author: bde >> Date: Wed Sep 14 12:57:40 2016 >> New Revision: 305807 >> URL: https://svnweb.freebsd.org/changeset/base/305807 >> >> Log: >> >> Modified: >> head/sys/amd64/amd64/trap.c > > breaks all amd64 LINT* kernels: > > /scratch/tmp/bz/head.svn/sys/amd64/amd64/trap.c:937:22: error: use of > undeclared identifier 'frame'; did you mean 'free'? > if (!TRAPF_USERMODE(frame)) { > ^~~~~ > free Oops. I see you fixed it. Thanks. Bruce From owner-svn-src-all@freebsd.org Wed Sep 14 17:43:34 2016 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 19CE8AC4F12; Wed, 14 Sep 2016 17:43:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE3271410; Wed, 14 Sep 2016 17:43:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EHhXNa038841; Wed, 14 Sep 2016 17:43:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EHhX7R038840; Wed, 14 Sep 2016 17:43:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201609141743.u8EHhX7R038840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 14 Sep 2016 17:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305814 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 17:43:34 -0000 Author: manu Date: Wed Sep 14 17:43:32 2016 New Revision: 305814 URL: https://svnweb.freebsd.org/changeset/base/305814 Log: ufsread: Do not cast struct direct from void * This cause alignment problem on ARM (and possibly other archs), instead copy it. MFC after: 1 week Modified: head/sys/boot/common/ufsread.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Wed Sep 14 16:47:17 2016 (r305813) +++ head/sys/boot/common/ufsread.c Wed Sep 14 17:43:32 2016 (r305814) @@ -97,21 +97,21 @@ static __inline uint8_t fsfind(const char *name, ufs_ino_t * ino) { static char buf[DEV_BSIZE]; - struct direct *d; + static struct direct d; char *s; ssize_t n; fs_off = 0; while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) for (s = buf; s < buf + DEV_BSIZE;) { - d = (void *)s; + memcpy(&d, s, sizeof(struct direct)); if (ls) - printf("%s ", d->d_name); - else if (!strcmp(name, d->d_name)) { - *ino = d->d_ino; - return d->d_type; + printf("%s ", d.d_name); + else if (!strcmp(name, d.d_name)) { + *ino = d.d_ino; + return d.d_type; } - s += d->d_reclen; + s += d.d_reclen; } if (n != -1 && ls) printf("\n"); From owner-svn-src-all@freebsd.org Wed Sep 14 18:14:18 2016 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 58F4FBD5900; Wed, 14 Sep 2016 18:14:18 +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 3C3DB13AC; Wed, 14 Sep 2016 18:14:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 32309139B; Wed, 14 Sep 2016 18:14:18 +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 EEDC922837; Wed, 14 Sep 2016 18:14:17 +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 q7B21QvfP6Tn; Wed, 14 Sep 2016 18:14:14 +0000 (UTC) Subject: Re: svn commit: r305634 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5F26C22832 To: "Simon J. Gerraty" References: <201609090121.u891LZOO023156@repo.freebsd.org> <76524.1473467847@kaos.jnpr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 14 Sep 2016 11:14:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <76524.1473467847@kaos.jnpr.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 18:14:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd Content-Type: multipart/mixed; boundary="bVD9fPoNnEJC8xwlVnlM5BhIFiJ5rvKXi"; protected-headers="v1" From: Bryan Drewery To: "Simon J. Gerraty" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r305634 - head/share/mk References: <201609090121.u891LZOO023156@repo.freebsd.org> <76524.1473467847@kaos.jnpr.net> In-Reply-To: <76524.1473467847@kaos.jnpr.net> --bVD9fPoNnEJC8xwlVnlM5BhIFiJ5rvKXi Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/9/16 5:37 PM, Simon J. Gerraty wrote: > Bryan Drewery wrote: >=20 >>> +# some targets involve old pre-built targets >>> +# ignore mtime of shell >>> +# and mtime of makefiles does not matter in meta mode >>> +.MAKE.META.IGNORE_PATHS +=3D \ >>> + ${MAKEFILE} \ >>> + ${SHELL} \ >>> + ${SYS_MK_DIR} >> >> I think it could be problematic to ignore *.mk changes. The build >=20 > If you're not concerned with build optimization, > this can be disabled - but pretty much any sub-make for which there is = a > .meta file will be out-of-date by any changed to *.mk >=20 >> commands may stay the same, but targets could grow new dependencies. = If >> those dependencies are already "met" then meta mode won't reconsider t= hem. >=20 > I'm not sure how easy it is to accomplish that situation. Can you at least wrap it in something like .if !defined(META_CONSIDER_MK_FILES) ? > =20 >> Consider: >> Build 1: >> bar: >> touch dep >> touch bar >> >> foo: >> touch foo >> >> all: bar foo >> >> In the first build, all generates dep, bar and foo. >> >> Then the code is changed to: >> >> bar: >> touch bar >> >> dep: >> touch notmade >> touch dep >> >> foo: dep >> touch foo >> >> all: foo bar >> >> Now in the second build, all finds bar command changes and rebuilds, >> finds foo command is the same and that dep is already satisfied from t= he >> last build. So 'notmade' is never made. >=20 > Actually given you have missing-meta=3Dyes > target dep would be remade, either because there is no .meta file, or > because its commands changed.=20 > Thus notmade should be. >=20 Good point. --=20 Regards, Bryan Drewery --bVD9fPoNnEJC8xwlVnlM5BhIFiJ5rvKXi-- --Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJX2ZN2AAoJEDXXcbtuRpfP2IkH+QHLT895o/vN5jAs67lE4P2L bXf6PASmfNX2YearLKwHbJ9jAdSSYbazYJ/fBVKaktNZHlD3vMl9ae8uvnNHukmD qvHKzWl7JwDXI9FBapgPOwexTuFDOqYdp8hmsfmngX6rXR/1bo3h0uUfXmO40SQK 5+5ugrjDCG4ENGRAtL9U0Um3mXC9z09FZ28GHzs8Sb6AFEfWXYAqVWWy75bFeXpE v4wum0kjP1HRtnpfj6/7ky1cdWz/JA2YNw9Bu8DZRke5Ay40jvVTPRelW08s6H1l llWPing4OAP7SKYzka5DTz2IqfKA1VDmzsFWPYqJloyPlnUjOzz1FfE+0303qFo= =DIW8 -----END PGP SIGNATURE----- --Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd-- From owner-svn-src-all@freebsd.org Wed Sep 14 18:22:13 2016 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 E9DB8BD5A96; Wed, 14 Sep 2016 18:22:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DFA18FF; Wed, 14 Sep 2016 18:22:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EIMCQT051869; Wed, 14 Sep 2016 18:22:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EIMC9u051868; Wed, 14 Sep 2016 18:22:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609141822.u8EIMC9u051868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 14 Sep 2016 18:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305815 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 18:22:14 -0000 Author: emaste Date: Wed Sep 14 18:22:12 2016 New Revision: 305815 URL: https://svnweb.freebsd.org/changeset/base/305815 Log: vtfontcvt: remove superfluous newlines in errx messages Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Wed Sep 14 17:43:32 2016 (r305814) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Wed Sep 14 18:22:12 2016 (r305815) @@ -122,7 +122,7 @@ add_mapping(struct glyph *gl, unsigned i ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && TAILQ_LAST(ml, mapping_list)->m_char >= c) - errx(1, "Bad ordering at character %u\n", c); + errx(1, "Bad ordering at character %u", c); TAILQ_INSERT_TAIL(ml, mp, m_list); map_count[map_idx]++; @@ -143,7 +143,7 @@ dedup_mapping(unsigned int map_idx) while (mp_normal->m_char < mp_bold->m_char) mp_normal = TAILQ_NEXT(mp_normal, m_list); if (mp_bold->m_char != mp_normal->m_char) - errx(1, "Character %u not in normal font!\n", + errx(1, "Character %u not in normal font!", mp_bold->m_char); if (mp_bold->m_glyph != mp_normal->m_glyph) continue; @@ -218,7 +218,7 @@ parse_bitmap_line(uint8_t *left, uint8_t unsigned int i, subline; if (dwidth != width && dwidth != width * 2) - errx(1, "Bitmap with unsupported width %u!\n", dwidth); + errx(1, "Bitmap with unsupported width %u!", dwidth); /* Move pixel data right to simplify splitting double characters. */ line >>= (howmany(dwidth, 8) * 8) - dwidth; @@ -235,7 +235,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *p++ = subline >> 8; *p = subline; } else { - errx(1, "Unsupported wbytes %u!\n", wbytes); + errx(1, "Unsupported wbytes %u!", wbytes); } line >>= width; @@ -267,7 +267,7 @@ parse_bdf(FILE *fp, unsigned int map_idx (ln[6] == ' ' || ln[6] == '\0')) { for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) - errx(1, "Unexpected EOF!\n"); + errx(1, "Unexpected EOF!"); ln[length - 1] = '\0'; sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, From owner-svn-src-all@freebsd.org Wed Sep 14 19:37:23 2016 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 61FD8BDA682; Wed, 14 Sep 2016 19:37:23 +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 E71561629; Wed, 14 Sep 2016 19:37:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id D94EA783F9D; Thu, 15 Sep 2016 05:37:20 +1000 (AEST) Date: Thu, 15 Sep 2016 05:37:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Emmanuel Vadot cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common In-Reply-To: <201609141743.u8EHhX7R038840@repo.freebsd.org> Message-ID: <20160915042715.N2557@besplex.bde.org> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=FKimkyEhhJgGH9YI0qIA:9 a=CZZ8iAWKxe_cZat7:21 a=K80So2YOsUCu8inb:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 19:37:23 -0000 On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > Log: > ufsread: Do not cast struct direct from void * > This cause alignment problem on ARM (and possibly other archs), instead copy it. > > MFC after: 1 week > > Modified: > head/sys/boot/common/ufsread.c > > Modified: head/sys/boot/common/ufsread.c > ============================================================================== > --- head/sys/boot/common/ufsread.c Wed Sep 14 16:47:17 2016 (r305813) > +++ head/sys/boot/common/ufsread.c Wed Sep 14 17:43:32 2016 (r305814) > @@ -97,21 +97,21 @@ static __inline uint8_t > fsfind(const char *name, ufs_ino_t * ino) > { > static char buf[DEV_BSIZE]; > - struct direct *d; > + static struct direct d; > char *s; > ssize_t n; This looks like a good pessimization for space. boot2 on i386 has to fit in 8192 bytes and has a negative number to spare (features are already left out). With auto buffers, and also builtin memcpy, the compiler can optimize the memcpy to nothing on arches with no alignment, and should do this with -Os. I think -ffreestanding in boot programs kills the builtin, and this is almost intentional since compilers have poor support for -Os so the inline memcpy is sometimes larger unless it is null. > > fs_off = 0; > while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) > for (s = buf; s < buf + DEV_BSIZE;) { > - d = (void *)s; > + memcpy(&d, s, sizeof(struct direct)); > if (ls) > - printf("%s ", d->d_name); > - else if (!strcmp(name, d->d_name)) { > - *ino = d->d_ino; > - return d->d_type; > + printf("%s ", d.d_name); > + else if (!strcmp(name, d.d_name)) { > + *ino = d.d_ino; > + return d.d_type; > } > - s += d->d_reclen; > + s += d.d_reclen; > } > if (n != -1 && ls) > printf("\n"); The static buffer in the old code also looks like a pessimization for space. It doesn't seem to be needed to preserver or return results. Compilers don't seem to be smart enough to see this and optimize it to auto or vice versa. Testing shows that the static buffer is space optimization for gcc and a space pessimization for clang: X #include X #include X X int X foo(void) X { X static char buf[101]; X static int buf1[3]; X X read(0, buf, sizeof(buf)); X memcpy(buf1, &buf[2], sizeof(buf1)); X return (buf[0] + buf1[0]); X } 2 static buffers give the best pessimizations for clang -Os -m32. Even with -Os, clang prefers to use large instructions to reduce the number of instructions. The static buffers give largest instructions, and also prevent optimizing away the memcpy(). With auto buf1, it takes -ffreestanding to kill the optimization of memcpy() and with that optimization the size is reduced by almost a factor of 2. With auto buf too, other pessimizations are applied to give a size reduction of just 1 byte. gcc-4.2.1 never inlines the memcpy(), but it does the other pessimizations less well to give an in-between size. Aproximate sizes on i386: 65 bytes for clang with statics, 49 for gcc, 33 for clang with autos and builtins, 28 for tweaked output for clang with static buf, auto buf1 and builtins (null memcpy). Probably the static buf is an intentional optimization for gcc. Compilers do too good a job of generating large code for large stack offsets. In my test code, the offsets are about 101 which is less than 128 so it takes only 2 bytes. DEV_BSIZE is 512 so it needs 5-byte offsets from the usual pessimizations for the base pointer (these are to point %ebp at the top of the variables and put all the scalar variables below the buffer so that the offsets are largest). But clang also does good pessimizations for offsets from the static buffer: pushl $foo.buf # 5 bytes movsbl foo.buf, %eax # 7 bytes addl foo.buf+2, %eax # 6 bytes Actually optimizing for space: movl $foo.buf,%ebx # 5 bytes pushl %ebx # 1 byte movsbl (%ebx), %eax # 3 bytes addl 2(%ebx), %eax # 3 bytes Bruce From owner-svn-src-all@freebsd.org Wed Sep 14 20:10:01 2016 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 072A2BDA5B2; Wed, 14 Sep 2016 20:10:01 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 275EF1F89; Wed, 14 Sep 2016 20:09:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 81334550; Wed, 14 Sep 2016 22:09:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=p2w31a+LjzY7HQcRYyWnfAikEG0=; b=LCefPu3S4FGLHoFjit/jnfNVRo6d HAjsSz5KYxkCTDmEJg24ywGdOHbg7QpbQhcgP2CGucY3zkg/miMN/yvZsaRV49/m E1kzMESW/WK4FLzfwhKiGQRVqw7shQeb4moozGClYoPzs8h2C9yZ2hw26YE/4tiy Z7PNsp+BEX38WuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=GqfNYLH/RZZPcAvu6gu1EdJm90oRMqNpT6cQeg/uKD0/+ByNhOSvwqZB tJAiXnLLO4r+qsYgsjN782tTrH306jl0R40Xu2zsOakb9/Gl6OkW723ypqBx6vDG noxuCneukCVNkN8rsYRyAjnstlNrAeD7X4TKWYivE001xn7UjOg= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 107ae606 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 14 Sep 2016 22:09:50 +0200 (CEST) Date: Wed, 14 Sep 2016 22:09:49 +0200 From: Emmanuel Vadot To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common Message-Id: <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> In-Reply-To: <20160915042715.N2557@besplex.bde.org> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> <20160915042715.N2557@besplex.bde.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 20:10:01 -0000 Hi Bruce, On Thu, 15 Sep 2016 05:37:19 +1000 (EST) Bruce Evans wrote: > On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > > > Log: > > ufsread: Do not cast struct direct from void * > > This cause alignment problem on ARM (and possibly other archs), instead copy it. > > > > MFC after: 1 week > > > > Modified: > > head/sys/boot/common/ufsread.c > > > > Modified: head/sys/boot/common/ufsread.c > > ============================================================================== > > --- head/sys/boot/common/ufsread.c Wed Sep 14 16:47:17 2016 (r305813) > > +++ head/sys/boot/common/ufsread.c Wed Sep 14 17:43:32 2016 (r305814) > > @@ -97,21 +97,21 @@ static __inline uint8_t > > fsfind(const char *name, ufs_ino_t * ino) > > { > > static char buf[DEV_BSIZE]; > > - struct direct *d; > > + static struct direct d; > > char *s; > > ssize_t n; > > This looks like a good pessimization for space. boot2 on i386 has to > fit in 8192 bytes and has a negative number to spare (features are > already left out). Do you have any suggestion on making the code better ? This was the last patch for having EFI working on ARMv6 and this is something that I want to be enabled by default at some point. > > With auto buffers, and also builtin memcpy, the compiler can optimize > the memcpy to nothing on arches with no alignment, and should do this > with -Os. I think -ffreestanding in boot programs kills the builtin, > and this is almost intentional since compilers have poor support for > -Os so the inline memcpy is sometimes larger unless it is null. > > > > > fs_off = 0; > > while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) > > for (s = buf; s < buf + DEV_BSIZE;) { > > - d = (void *)s; > > + memcpy(&d, s, sizeof(struct direct)); > > if (ls) > > - printf("%s ", d->d_name); > > - else if (!strcmp(name, d->d_name)) { > > - *ino = d->d_ino; > > - return d->d_type; > > + printf("%s ", d.d_name); > > + else if (!strcmp(name, d.d_name)) { > > + *ino = d.d_ino; > > + return d.d_type; > > } > > - s += d->d_reclen; > > + s += d.d_reclen; > > } > > if (n != -1 && ls) > > printf("\n"); > > The static buffer in the old code also looks like a pessimization for > space. It doesn't seem to be needed to preserver or return results. > Compilers don't seem to be smart enough to see this and optimize it > to auto or vice versa. > > Testing shows that the static buffer is space optimization for gcc > and a space pessimization for clang: > > X #include > X #include > X > X int > X foo(void) > X { > X static char buf[101]; > X static int buf1[3]; > X > X read(0, buf, sizeof(buf)); > X memcpy(buf1, &buf[2], sizeof(buf1)); > X return (buf[0] + buf1[0]); > X } > > 2 static buffers give the best pessimizations for clang -Os -m32. > Even with -Os, clang prefers to use large instructions to reduce the > number of instructions. The static buffers give largest instructions, > and also prevent optimizing away the memcpy(). With auto buf1, it > takes -ffreestanding to kill the optimization of memcpy() and with > that optimization the size is reduced by almost a factor of 2. With > auto buf too, other pessimizations are applied to give a size reduction > of just 1 byte. gcc-4.2.1 never inlines the memcpy(), but it does > the other pessimizations less well to give an in-between size. > > Aproximate sizes on i386: 65 bytes for clang with statics, 49 for gcc, > 33 for clang with autos and builtins, 28 for tweaked output for clang > with static buf, auto buf1 and builtins (null memcpy). > > Probably the static buf is an intentional optimization for gcc. > Compilers do too good a job of generating large code for large stack > offsets. In my test code, the offsets are about 101 which is less than > 128 so it takes only 2 bytes. DEV_BSIZE is 512 so it needs 5-byte > offsets from the usual pessimizations for the base pointer (these > are to point %ebp at the top of the variables and put all the scalar > variables below the buffer so that the offsets are largest). But > clang also does good pessimizations for offsets from the static buffer: > > pushl $foo.buf # 5 bytes > movsbl foo.buf, %eax # 7 bytes > addl foo.buf+2, %eax # 6 bytes > > Actually optimizing for space: > > movl $foo.buf,%ebx # 5 bytes > pushl %ebx # 1 byte > movsbl (%ebx), %eax # 3 bytes > addl 2(%ebx), %eax # 3 bytes > > Bruce Cheers, -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Wed Sep 14 20:32:36 2016 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 09882BDAFB7; Wed, 14 Sep 2016 20:32:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C28ED1DED; Wed, 14 Sep 2016 20:32:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EKWZuZ004133; Wed, 14 Sep 2016 20:32:35 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EKWYeI004126; Wed, 14 Sep 2016 20:32:34 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142032.u8EKWYeI004126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 20:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305816 - in vendor/libarchive/dist/libarchive: . test 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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 20:32:36 -0000 Author: mm Date: Wed Sep 14 20:32:34 2016 New Revision: 305816 URL: https://svnweb.freebsd.org/changeset/base/305816 Log: Update vendor/libarchive to git c31379acc9009f5a3bafcfa33d7672a24b3f51f3 Vendor issues fixed (FreeBSD): PR #778: ACL error handling Issue #745: Symlink check prefix optimization is too aggressive Issue #746: Hard links with data can evade sandboxing restrictions This update fixes the vulnerability #3 and vulnerability #4 as reported in the "non-cryptanalytic attacks against FreeBSD update components". https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Vulnerability #2 has already been fixed in r304866 Modified: vendor/libarchive/dist/libarchive/archive_platform.h vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_write_disk_acl.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c Modified: vendor/libarchive/dist/libarchive/archive_platform.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_platform.h Wed Sep 14 18:22:12 2016 (r305815) +++ vendor/libarchive/dist/libarchive/archive_platform.h Wed Sep 14 20:32:34 2016 (r305816) @@ -159,6 +159,15 @@ #define CAN_RESTORE_METADATA_FD #endif +/* + * glibc 2.24 deprecates readdir_r + */ +#if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) +#define USE_READDIR_R 1 +#else +#undef USE_READDIR_R +#endif + /* Set up defaults for internal error codes. */ #ifndef ARCHIVE_ERRNO_FILE_FORMAT #if HAVE_EFTYPE Modified: vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Wed Sep 14 18:22:12 2016 (r305815) +++ vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Wed Sep 14 20:32:34 2016 (r305816) @@ -411,9 +411,7 @@ setup_acls(struct archive_read_disk *a, { const char *accpath; acl_t acl; -#if HAVE_ACL_IS_TRIVIAL_NP int r; -#endif accpath = archive_entry_sourcepath(entry); if (accpath == NULL) @@ -473,9 +471,13 @@ setup_acls(struct archive_read_disk *a, } #endif if (acl != NULL) { - translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); acl_free(acl); - return (ARCHIVE_OK); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate NFSv4 ACLs: %s", accpath); + } + return (r); } #endif /* ACL_TYPE_NFS4 */ @@ -506,19 +508,30 @@ setup_acls(struct archive_read_disk *a, #endif if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); acl = NULL; + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate access ACLs: %s", accpath); + return (r); + } } /* Only directories can have default ACLs. */ if (S_ISDIR(archive_entry_mode(entry))) { acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); acl_free(acl); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate default ACLs: %s", + accpath); + return (r); + } } } return (ARCHIVE_OK); @@ -574,12 +587,12 @@ translate_acl(struct archive_read_disk * #ifdef ACL_TYPE_NFS4 acl_entry_type_t acl_type; acl_flagset_t acl_flagset; - int brand, r; + int brand; #endif acl_entry_t acl_entry; acl_permset_t acl_permset; int i, entry_acl_type; - int s, ae_id, ae_tag, ae_perm; + int r, s, ae_id, ae_tag, ae_perm; const char *ae_name; @@ -587,7 +600,11 @@ translate_acl(struct archive_read_disk * // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 // Make sure the "brand" on this ACL is consistent // with the default_entry_acl_type bits provided. - acl_get_brand_np(acl, &brand); + if (acl_get_brand_np(acl, &brand) != 0) { + archive_set_error(&a->archive, errno, + "Failed to read ACL brand"); + return (ARCHIVE_WARN); + } switch (brand) { case ACL_BRAND_POSIX: switch (default_entry_acl_type) { @@ -595,31 +612,43 @@ translate_acl(struct archive_read_disk * case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for POSIX.1e ACL"); + return (ARCHIVE_WARN); } break; case ACL_BRAND_NFS4: if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for NFSv4 ACL"); + return (ARCHIVE_WARN); } break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Unknown ACL brand"); + return (ARCHIVE_WARN); break; } #endif s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get first ACL entry"); + return (ARCHIVE_WARN); + } while (s == 1) { ae_id = -1; ae_name = NULL; ae_perm = 0; - acl_get_tag_type(acl_entry, &acl_tag); + if (acl_get_tag_type(acl_entry, &acl_tag) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL tag type"); + return (ARCHIVE_WARN); + } switch (acl_tag) { case ACL_USER: ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry); @@ -654,13 +683,18 @@ translate_acl(struct archive_read_disk * continue; } - // XXX acl type maps to allow/deny/audit/YYYY bits - // XXX acl_get_entry_type_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs + // XXX acl_type maps to allow/deny/audit/YYYY bits entry_acl_type = default_entry_acl_type; #ifdef ACL_TYPE_NFS4 - r = acl_get_entry_type_np(acl_entry, &acl_type); - if (r == 0) { + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_entry_type_np() falis with non-NFSv4 ACLs + */ + if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { + archive_set_error(&a->archive, errno, "Failed " + "to get ACL type from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } switch (acl_type) { case ACL_ENTRY_TYPE_ALLOW: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; @@ -674,32 +708,53 @@ translate_acl(struct archive_read_disk * case ACL_ENTRY_TYPE_ALARM: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; break; + default: + archive_set_error(&a->archive, errno, + "Invalid NFSv4 ACL entry type"); + return (ARCHIVE_WARN); } - } - /* - * Libarchive stores "flag" (NFSv4 inheritance bits) - * in the ae_perm bitmap. - */ - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + * + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get flagset from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) + r = acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check flag in a NFSv4 " + "ACL flagset"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_inherit_map[i].archive_inherit; } } #endif - acl_get_permset(acl_entry, &acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL permission set"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { /* * acl_get_perm() is spelled differently on different * platforms; see above. */ - if (ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm)) + r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check permission in an ACL permission set"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_perm_map[i].archive_perm; } @@ -708,6 +763,11 @@ translate_acl(struct archive_read_disk * ae_id, ae_name); s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get next ACL entry"); + return (ARCHIVE_WARN); + } } return (ARCHIVE_OK); } Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Wed Sep 14 18:22:12 2016 (r305815) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Wed Sep 14 20:32:34 2016 (r305816) @@ -165,7 +165,7 @@ struct filesystem { int synthetic; int remote; int noatime; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t name_max; #endif long incr_xfer_size; @@ -200,7 +200,7 @@ struct tree { DIR *d; #define INVALID_DIR_HANDLE NULL struct dirent *de; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) struct dirent *dirent; size_t dirent_allocated; #endif @@ -1592,7 +1592,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ #if defined(HAVE_STRUCT_STATFS_F_NAMEMAX) t->current_filesystem->name_max = sfs.f_namemax; @@ -1615,7 +1615,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; #endif -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -1817,7 +1817,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namelen; #endif @@ -1901,7 +1901,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namemax; #endif @@ -1918,7 +1918,7 @@ static int setup_current_filesystem(struct archive_read_disk *a) { struct tree *t = a->tree; -#if defined(_PC_NAME_MAX) && defined(HAVE_READDIR_R) +#if defined(_PC_NAME_MAX) && defined(USE_READDIR_R) long nm; #endif t->current_filesystem->synthetic = -1;/* Not supported */ @@ -1930,7 +1930,7 @@ setup_current_filesystem(struct archive_ t->current_filesystem->min_xfer_size = -1; t->current_filesystem->incr_xfer_size = -1; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ # if defined(_PC_NAME_MAX) if (tree_current_is_symblic_link_target(t)) { @@ -1958,7 +1958,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; # endif /* _PC_NAME_MAX */ -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -2366,7 +2366,7 @@ tree_dir_next_posix(struct tree *t) size_t namelen; if (t->d == NULL) { -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t dirent_size; #endif @@ -2387,7 +2387,7 @@ tree_dir_next_posix(struct tree *t) t->visit_type = r != 0 ? r : TREE_ERROR_DIR; return (t->visit_type); } -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) dirent_size = offsetof(struct dirent, d_name) + t->filesystem_table[t->current->filesystem_id].name_max + 1; if (t->dirent == NULL || t->dirent_allocated < dirent_size) { @@ -2404,11 +2404,11 @@ tree_dir_next_posix(struct tree *t) } t->dirent_allocated = dirent_size; } -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ } for (;;) { errno = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) r = readdir_r(t->d, t->dirent, &t->de); #ifdef _AIX /* Note: According to the man page, return value 9 indicates @@ -2660,7 +2660,7 @@ tree_free(struct tree *t) if (t == NULL) return; archive_string_free(&t->path); -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) free(t->dirent); #endif free(t->sparse_list); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Wed Sep 14 18:22:12 2016 (r305815) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Wed Sep 14 20:32:34 2016 (r305816) @@ -136,6 +136,7 @@ struct tar { int64_t entry_padding; int64_t entry_bytes_unconsumed; int64_t realsize; + int sparse_allowed; struct sparse_block *sparse_list; struct sparse_block *sparse_last; int64_t sparse_offset; @@ -1271,6 +1272,14 @@ header_common(struct archive_read *a, st * sparse information in the extended area. */ /* FALLTHROUGH */ + case '0': + /* + * Enable sparse file "read" support only for regular + * files and explicit GNU sparse files. However, we + * don't allow non-standard file types to be sparse. + */ + tar->sparse_allowed = 1; + /* FALLTHROUGH */ default: /* Regular file and non-standard types */ /* * Per POSIX: non-recognized types should always be @@ -1728,6 +1737,14 @@ pax_attribute(struct archive_read *a, st * NULL pointer to strlen(). */ switch (key[0]) { case 'G': + /* Reject GNU.sparse.* headers on non-regular files. */ + if (strncmp(key, "GNU.sparse", 10) == 0 && + !tar->sparse_allowed) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Non-regular file cannot be sparse"); + return (ARCHIVE_FATAL); + } + /* GNU "0.0" sparse pax format. */ if (strcmp(key, "GNU.sparse.numblocks") == 0) { tar->sparse_offset = -1; Modified: vendor/libarchive/dist/libarchive/archive_write_disk_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_acl.c Wed Sep 14 18:22:12 2016 (r305815) +++ vendor/libarchive/dist/libarchive/archive_write_disk_acl.c Wed Sep 14 20:32:34 2016 (r305816) @@ -153,9 +153,19 @@ set_acl(struct archive *a, int fd, const if (entries == 0) return (ARCHIVE_OK); acl = acl_init(entries); + if (acl == (acl_t)NULL) { + archive_set_error(a, errno, + "Failed to initialize ACL working storage"); + return (ARCHIVE_FAILED); + } while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { - acl_create_entry(&acl, &acl_entry); + if (acl_create_entry(&acl, &acl_entry) != 0) { + archive_set_error(a, errno, + "Failed to create a new ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } switch (ae_tag) { case ARCHIVE_ENTRY_ACL_USER: @@ -186,53 +196,96 @@ set_acl(struct archive *a, int fd, const break; #endif default: - /* XXX */ - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; } #ifdef ACL_TYPE_NFS4 + r = 0; switch (ae_type) { case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); break; case ARCHIVE_ENTRY_ACL_TYPE_DENY: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); break; case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); break; case ARCHIVE_ENTRY_ACL_TYPE_ALARM: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); break; case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: // These don't translate directly into the system ACL. break; default: - // XXX error handling here. - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (r != 0) { + archive_set_error(a, errno, + "Failed to set ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; } #endif - acl_get_permset(acl_entry, &acl_permset); - acl_clear_perms(acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to get ACL permission set"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_perms(acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to clear ACL permissions"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { if (ae_permset & acl_perm_map[i].archive_perm) - acl_add_perm(acl_permset, - acl_perm_map[i].platform_perm); + if (acl_add_perm(acl_permset, + acl_perm_map[i].platform_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } } #ifdef ACL_TYPE_NFS4 - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { - acl_clear_flags_np(acl_flagset); + if (acl_type == ACL_TYPE_NFS4) { + /* + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to get flagset from an NFSv4 ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_flags_np(acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to clear flags from an NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + if (ae_permset & acl_inherit_map[i].archive_inherit) { + if (acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit) != 0) { + archive_set_error(a, errno, + "Failed to add flag to NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } } } #endif @@ -262,6 +315,7 @@ set_acl(struct archive *a, int fd, const ret = ARCHIVE_WARN; } #endif +exit_free: acl_free(acl); return (ret); } Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Wed Sep 14 18:22:12 2016 (r305815) +++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Wed Sep 14 20:32:34 2016 (r305816) @@ -140,7 +140,17 @@ __FBSDID("$FreeBSD$"); #define O_BINARY 0 #endif #ifndef O_CLOEXEC -#define O_CLOEXEC 0 +#define O_CLOEXEC 0 +#endif + +/* Ignore non-int O_NOFOLLOW constant. */ +/* gnulib's fcntl.h does this on AIX, but it seems practical everywhere */ +#if defined O_NOFOLLOW && !(INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +#undef O_NOFOLLOW +#endif + +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0 #endif struct fixup_entry { @@ -326,12 +336,14 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) +static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif +static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -2014,6 +2026,10 @@ create_filesystem_object(struct archive_ const char *linkname; mode_t final_mode, mode; int r; + /* these for check_symlinks_fsobj */ + char *linkname_copy; /* non-const copy of linkname */ + struct archive_string error_string; + int error_number; /* We identify hard/symlinks according to the link names. */ /* Since link(2) and symlink(2) don't handle modes, we're done here. */ @@ -2022,6 +2038,27 @@ create_filesystem_object(struct archive_ #if !HAVE_LINK return (EPERM); #else + archive_string_init(&error_string); + linkname_copy = strdup(linkname); + if (linkname_copy == NULL) { + return (EPERM); + } + /* TODO: consider using the cleaned-up path as the link target? */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + free(linkname_copy); r = link(linkname, a->name) ? errno : 0; /* * New cpio and pax formats allow hardlink entries @@ -2040,7 +2077,7 @@ create_filesystem_object(struct archive_ a->deferred = 0; } else if (r == 0 && a->filesize > 0) { a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC); + O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2351,126 +2388,233 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } -/* TODO: Make this work. */ -/* - * TODO: The deep-directory support bypasses this; disable deep directory - * support if we're doing symlink checks. - */ /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other * recent paths. */ /* TODO: Extend this to support symlinks on Windows Vista and later. */ + +/* + * Checks the given path to see if any elements along it are symlinks. Returns + * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. + */ static int -check_symlinks(struct archive_write_disk *a) +check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ - (void)a; /* UNUSED */ + (void)path; /* UNUSED */ + (void)error_number; /* UNUSED */ + (void)error_string; /* UNUSED */ + (void)flags; /* UNUSED */ return (ARCHIVE_OK); #else - char *pn; + int res = ARCHIVE_OK; + char *tail; + char *head; + int last; char c; int r; struct stat st; + int restore_pwd; + + /* Nothing to do here if name is empty */ + if(path[0] == '\0') + return (ARCHIVE_OK); /* * Guard against symlink tricks. Reject any archive entry whose * destination would be altered by a symlink. - */ - /* Whatever we checked last time doesn't need to be re-checked. */ - pn = a->name; - if (archive_strlen(&(a->path_safe)) > 0) { - char *p = a->path_safe.s; - while ((*pn != '\0') && (*p == *pn)) - ++p, ++pn; - } + * + * Walk the filename in chunks separated by '/'. For each segment: + * - if it doesn't exist, continue + * - if it's symlink, abort or remove it + * - if it's a directory and it's not the last chunk, cd into it + * As we go: + * head points to the current (relative) path + * tail points to the temporary \0 terminating the segment we're currently examining + * c holds what used to be in *tail + * last is 1 if this is the last tail + */ + restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(restore_pwd); + if (restore_pwd < 0) + return (ARCHIVE_FATAL); + head = path; + tail = path; + last = 0; + /* TODO: reintroduce a safe cache here? */ /* Skip the root directory if the path is absolute. */ - if(pn == a->name && pn[0] == '/') - ++pn; - c = pn[0]; - /* Keep going until we've checked the entire name. */ - while (pn[0] != '\0' && (pn[0] != '/' || pn[1] != '\0')) { + if(tail == path && tail[0] == '/') + ++tail; + /* Keep going until we've checked the entire name. + * head, tail, path all alias the same string, which is + * temporarily zeroed at tail, so be careful restoring the + * stashed (c=tail[0]) for error messages. + * Exiting the loop with break is okay; continue is not. + */ + while (!last) { + /* Skip the separator we just consumed, plus any adjacent ones */ + while (*tail == '/') + ++tail; /* Skip the next path element. */ - while (*pn != '\0' && *pn != '/') - ++pn; - c = pn[0]; - pn[0] = '\0'; + while (*tail != '\0' && *tail != '/') + ++tail; + /* is this the last path component? */ + last = (tail[0] == '\0') || (tail[0] == '/' && tail[1] == '\0'); + /* temporarily truncate the string here */ + c = tail[0]; + tail[0] = '\0'; /* Check that we haven't hit a symlink. */ - r = lstat(a->name, &st); + r = lstat(head, &st); if (r != 0) { + tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ if (errno == ENOENT) { break; } else { - /* Note: This effectively disables deep directory + /* Treat any other error as fatal - best to be paranoid here + * Note: This effectively disables deep directory * support when security checks are enabled. * Otherwise, very long pathnames that trigger * an error here could evade the sandbox. * TODO: We could do better, but it would probably * require merging the symlink checks with the * deep-directory editing. */ - return (ARCHIVE_FAILED); + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not stat %s", + path); + res = ARCHIVE_FAILED; + break; + } + } else if (S_ISDIR(st.st_mode)) { + if (!last) { + if (chdir(head) != 0) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not chdir %s", + path); + res = (ARCHIVE_FATAL); + break; + } + /* Our view is now from inside this dir: */ + head = tail + 1; } } else if (S_ISLNK(st.st_mode)) { - if (c == '\0') { + if (last) { /* * Last element is symlink; remove it * so we can overwrite it with the * item being extracted. */ - if (unlink(a->name)) { - archive_set_error(&a->archive, errno, - "Could not remove symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head)) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not remove symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; /* * Even if we did remove it, a warning * is in order. The warning is silly, * though, if we're just replacing one * symlink with another symlink. */ - if (!S_ISLNK(a->mode)) { - archive_set_error(&a->archive, 0, - "Removing symlink %s", - a->name); + tail[0] = c; + /* FIXME: not sure how important this is to restore + if (!S_ISLNK(path)) { + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Removing symlink %s", + path); } + */ /* Symlink gone. No more problem! */ - pn[0] = c; - return (0); - } else if (a->flags & ARCHIVE_EXTRACT_UNLINK) { + res = ARCHIVE_OK; + break; + } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(a->name) != 0) { - archive_set_error(&a->archive, 0, - "Cannot remove intervening symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head) != 0) { + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot remove intervening symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; + tail[0] = c; } else { - archive_set_error(&a->archive, 0, - "Cannot extract through symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot extract through symlink %s", + path); + res = ARCHIVE_FAILED; + break; } } - pn[0] = c; - if (pn[0] != '\0') - pn++; /* Advance to the next segment. */ - } - pn[0] = c; - /* We've checked and/or cleaned the whole path, so remember it. */ - archive_strcpy(&a->path_safe, a->name); - return (ARCHIVE_OK); + /* be sure to always maintain this */ + tail[0] = c; + if (tail[0] != '\0') + tail++; /* Advance to the next segment. */ + } + /* Catches loop exits via break */ + tail[0] = c; +#ifdef HAVE_FCHDIR + /* If we changed directory above, restore it here. */ + if (restore_pwd >= 0) { + r = fchdir(restore_pwd); + if (r != 0) { + if(error_number) *error_number = errno; + if(error_string) + archive_string_sprintf(error_string, + "chdir() failure"); + } + close(restore_pwd); + restore_pwd = -1; + if (r != 0) { + res = (ARCHIVE_FATAL); + } + } +#endif + /* TODO: reintroduce a safe cache here? */ + return res; #endif } +/* + * Check a->name for symlinks, returning ARCHIVE_OK if its clean, otherwise + * calls archive_set_error and returns ARCHIVE_{FATAL,FAILED} + */ +static int +check_symlinks(struct archive_write_disk *a) +{ + struct archive_string error_string; + int error_number; + int rc; + archive_string_init(&error_string); + rc = check_symlinks_fsobj(a->name, &error_number, &error_string, a->flags); + if (rc != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + } + archive_string_free(&error_string); + a->pst = NULL; /* to be safe */ + return rc; +} + + #if defined(__CYGWIN__) /* * 1. Convert a path separator from '\' to '/' . @@ -2544,15 +2688,17 @@ cleanup_pathname_win(struct archive_writ * is set) if the path is absolute. */ static int -cleanup_pathname(struct archive_write_disk *a) +cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { char *dest, *src; char separator = '\0'; - dest = src = a->name; + dest = src = path; if (*src == '\0') { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid empty pathname"); + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Invalid empty pathname"); return (ARCHIVE_FAILED); } @@ -2561,9 +2707,11 @@ cleanup_pathname(struct archive_write_di #endif /* Skip leading '/'. */ if (*src == '/') { - if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Path is absolute"); + if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Path is absolute"); return (ARCHIVE_FAILED); } @@ -2590,10 +2738,11 @@ cleanup_pathname(struct archive_write_di } else if (src[1] == '.') { if (src[2] == '/' || src[2] == '\0') { /* Conditionally warn about '..' */ - if (a->flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Path contains '..'"); + if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 14 20:51:49 2016 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 96A11BDB564; Wed, 14 Sep 2016 20:51: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 5E5E5197C; Wed, 14 Sep 2016 20:51:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 02361784089; Thu, 15 Sep 2016 06:51:46 +1000 (AEST) Date: Thu, 15 Sep 2016 06:51:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Emmanuel Vadot cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common In-Reply-To: <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> Message-ID: <20160915063308.G2902@besplex.bde.org> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> <20160915042715.N2557@besplex.bde.org> <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> 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=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=iHnWpXaEffL-ftcl-ccA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 20:51:49 -0000 On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > Bruce Evans wrote: > >> On Wed, 14 Sep 2016, Emmanuel Vadot wrote: >> >>> Log: >>> ufsread: Do not cast struct direct from void * >>> This cause alignment problem on ARM (and possibly other archs), instead copy it. >>> ... >> >> This looks like a good pessimization for space. boot2 on i386 has to >> fit in 8192 bytes and has a negative number to spare (features are >> already left out). > > Do you have any suggestion on making the code better ? > This was the last patch for having EFI working on ARMv6 and this is > something that I want to be enabled by default at some point. At least copy to a local variable. Ifdefs for the space-constrained && non-strict-alignment arches work of course, but shouldn't be needed. You will have to investigate the -ffreestanding and builtin situation. -ffreestanding is set in 24 sub-Makefiles instead of correctly in 1 Makefile.inc. I think it applies to all of boot/i386. boot code almost never recovers from this using __builtin_*. Beware that some builtins just call an extern function which might not exist in boot code. Even memcpy barely exists in small boot2's. Some compilers have buggy -ffreestanding and call memcpy() for struct copying, so it is preferred to bcopy() in boot code. Bruce From owner-svn-src-all@freebsd.org Wed Sep 14 20:55:04 2016 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 DE5C1BDB780; Wed, 14 Sep 2016 20:55:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91ED71E01; Wed, 14 Sep 2016 20:55:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EKt3nD012230; Wed, 14 Sep 2016 20:55:03 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EKt388012229; Wed, 14 Sep 2016 20:55:03 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142055.u8EKt388012229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 20:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305817 - in head/contrib/libarchive: libarchive libarchive_fe tar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 20:55:05 -0000 Author: mm Date: Wed Sep 14 20:55:03 2016 New Revision: 305817 URL: https://svnweb.freebsd.org/changeset/base/305817 Log: Remove mergeinfo from contrib/libarchive subdirs Modified: Directory Properties: head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/libarchive_fe/ (props changed) head/contrib/libarchive/tar/ (props changed) From owner-svn-src-all@freebsd.org Wed Sep 14 21:01:03 2016 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 6E5E8BDB933; Wed, 14 Sep 2016 21:01:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 251151200; Wed, 14 Sep 2016 21:01:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EL12n3013179; Wed, 14 Sep 2016 21:01:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EL12Qv013178; Wed, 14 Sep 2016 21:01:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142101.u8EL12Qv013178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 21:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305818 - head/contrib/libarchive/cpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 21:01:03 -0000 Author: mm Date: Wed Sep 14 21:01:02 2016 New Revision: 305818 URL: https://svnweb.freebsd.org/changeset/base/305818 Log: Remove mergeinfo from contrib/libarchive/cpio Modified: Directory Properties: head/contrib/libarchive/cpio/ (props changed) From owner-svn-src-all@freebsd.org Wed Sep 14 21:15:03 2016 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 8CB52B9626F; Wed, 14 Sep 2016 21:15:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD4E1F92; Wed, 14 Sep 2016 21:15:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8ELF2vC019811; Wed, 14 Sep 2016 21:15:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ELF1t1019804; Wed, 14 Sep 2016 21:15:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142115.u8ELF1t1019804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 21:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305819 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 21:15:03 -0000 Author: mm Date: Wed Sep 14 21:15:01 2016 New Revision: 305819 URL: https://svnweb.freebsd.org/changeset/base/305819 Log: MFV r305816: Sync libarchive with vendor including important security fixes. Issues fixed (FreeBSD): PR #778: ACL error handling Issue #745: Symlink check prefix optimization is too aggressive Issue #746: Hard links with data can evade sandboxing restrictions This update fixes the vulnerability #3 and vulnerability #4 as reported in "non-cryptanalytic attacks against FreeBSD update components". https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Fix for vulnerability #2 has already been merged in r304989. MFC after: 1 week Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Modified: head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c head/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_platform.h Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_platform.h Wed Sep 14 21:15:01 2016 (r305819) @@ -159,6 +159,15 @@ #define CAN_RESTORE_METADATA_FD #endif +/* + * glibc 2.24 deprecates readdir_r + */ +#if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) +#define USE_READDIR_R 1 +#else +#undef USE_READDIR_R +#endif + /* Set up defaults for internal error codes. */ #ifndef ARCHIVE_ERRNO_FILE_FORMAT #if HAVE_EFTYPE Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Sep 14 21:15:01 2016 (r305819) @@ -411,9 +411,7 @@ setup_acls(struct archive_read_disk *a, { const char *accpath; acl_t acl; -#if HAVE_ACL_IS_TRIVIAL_NP int r; -#endif accpath = archive_entry_sourcepath(entry); if (accpath == NULL) @@ -473,9 +471,13 @@ setup_acls(struct archive_read_disk *a, } #endif if (acl != NULL) { - translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); acl_free(acl); - return (ARCHIVE_OK); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate NFSv4 ACLs: %s", accpath); + } + return (r); } #endif /* ACL_TYPE_NFS4 */ @@ -506,19 +508,30 @@ setup_acls(struct archive_read_disk *a, #endif if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); acl = NULL; + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate access ACLs: %s", accpath); + return (r); + } } /* Only directories can have default ACLs. */ if (S_ISDIR(archive_entry_mode(entry))) { acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); acl_free(acl); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate default ACLs: %s", + accpath); + return (r); + } } } return (ARCHIVE_OK); @@ -574,19 +587,23 @@ translate_acl(struct archive_read_disk * #ifdef ACL_TYPE_NFS4 acl_entry_type_t acl_type; acl_flagset_t acl_flagset; - int brand, r; + int brand; #endif acl_entry_t acl_entry; acl_permset_t acl_permset; int i, entry_acl_type; - int s, ae_id, ae_tag, ae_perm; + int r, s, ae_id, ae_tag, ae_perm; const char *ae_name; #ifdef ACL_TYPE_NFS4 // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 // Make sure the "brand" on this ACL is consistent // with the default_entry_acl_type bits provided. - acl_get_brand_np(acl, &brand); + if (acl_get_brand_np(acl, &brand) != 0) { + archive_set_error(&a->archive, errno, + "Failed to read ACL brand"); + return (ARCHIVE_WARN); + } switch (brand) { case ACL_BRAND_POSIX: switch (default_entry_acl_type) { @@ -594,31 +611,43 @@ translate_acl(struct archive_read_disk * case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for POSIX.1e ACL"); + return (ARCHIVE_WARN); } break; case ACL_BRAND_NFS4: if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for NFSv4 ACL"); + return (ARCHIVE_WARN); } break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Unknown ACL brand"); + return (ARCHIVE_WARN); break; } #endif s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get first ACL entry"); + return (ARCHIVE_WARN); + } while (s == 1) { ae_id = -1; ae_name = NULL; ae_perm = 0; - acl_get_tag_type(acl_entry, &acl_tag); + if (acl_get_tag_type(acl_entry, &acl_tag) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL tag type"); + return (ARCHIVE_WARN); + } switch (acl_tag) { case ACL_USER: ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry); @@ -653,13 +682,18 @@ translate_acl(struct archive_read_disk * continue; } - // XXX acl type maps to allow/deny/audit/YYYY bits - // XXX acl_get_entry_type_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs + // XXX acl_type maps to allow/deny/audit/YYYY bits entry_acl_type = default_entry_acl_type; #ifdef ACL_TYPE_NFS4 - r = acl_get_entry_type_np(acl_entry, &acl_type); - if (r == 0) { + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_entry_type_np() falis with non-NFSv4 ACLs + */ + if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { + archive_set_error(&a->archive, errno, "Failed " + "to get ACL type from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } switch (acl_type) { case ACL_ENTRY_TYPE_ALLOW: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; @@ -673,32 +707,53 @@ translate_acl(struct archive_read_disk * case ACL_ENTRY_TYPE_ALARM: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; break; + default: + archive_set_error(&a->archive, errno, + "Invalid NFSv4 ACL entry type"); + return (ARCHIVE_WARN); } - } - /* - * Libarchive stores "flag" (NFSv4 inheritance bits) - * in the ae_perm bitmap. - */ - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + * + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get flagset from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) + r = acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check flag in a NFSv4 " + "ACL flagset"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_inherit_map[i].archive_inherit; } } #endif - acl_get_permset(acl_entry, &acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL permission set"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { /* * acl_get_perm() is spelled differently on different * platforms; see above. */ - if (ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm)) + r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check permission in an ACL permission set"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_perm_map[i].archive_perm; } @@ -707,6 +762,11 @@ translate_acl(struct archive_read_disk * ae_id, ae_name); s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get next ACL entry"); + return (ARCHIVE_WARN); + } } return (ARCHIVE_OK); } Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Wed Sep 14 21:15:01 2016 (r305819) @@ -165,7 +165,7 @@ struct filesystem { int synthetic; int remote; int noatime; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t name_max; #endif long incr_xfer_size; @@ -200,7 +200,7 @@ struct tree { DIR *d; #define INVALID_DIR_HANDLE NULL struct dirent *de; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) struct dirent *dirent; size_t dirent_allocated; #endif @@ -1592,7 +1592,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ #if defined(HAVE_STRUCT_STATFS_F_NAMEMAX) t->current_filesystem->name_max = sfs.f_namemax; @@ -1615,7 +1615,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; #endif -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -1817,7 +1817,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namelen; #endif @@ -1901,7 +1901,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namemax; #endif @@ -1918,7 +1918,7 @@ static int setup_current_filesystem(struct archive_read_disk *a) { struct tree *t = a->tree; -#if defined(_PC_NAME_MAX) && defined(HAVE_READDIR_R) +#if defined(_PC_NAME_MAX) && defined(USE_READDIR_R) long nm; #endif t->current_filesystem->synthetic = -1;/* Not supported */ @@ -1930,7 +1930,7 @@ setup_current_filesystem(struct archive_ t->current_filesystem->min_xfer_size = -1; t->current_filesystem->incr_xfer_size = -1; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ # if defined(_PC_NAME_MAX) if (tree_current_is_symblic_link_target(t)) { @@ -1958,7 +1958,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; # endif /* _PC_NAME_MAX */ -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -2366,7 +2366,7 @@ tree_dir_next_posix(struct tree *t) size_t namelen; if (t->d == NULL) { -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t dirent_size; #endif @@ -2387,7 +2387,7 @@ tree_dir_next_posix(struct tree *t) t->visit_type = r != 0 ? r : TREE_ERROR_DIR; return (t->visit_type); } -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) dirent_size = offsetof(struct dirent, d_name) + t->filesystem_table[t->current->filesystem_id].name_max + 1; if (t->dirent == NULL || t->dirent_allocated < dirent_size) { @@ -2404,11 +2404,11 @@ tree_dir_next_posix(struct tree *t) } t->dirent_allocated = dirent_size; } -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ } for (;;) { errno = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) r = readdir_r(t->d, t->dirent, &t->de); #ifdef _AIX /* Note: According to the man page, return value 9 indicates @@ -2660,7 +2660,7 @@ tree_free(struct tree *t) if (t == NULL) return; archive_string_free(&t->path); -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) free(t->dirent); #endif free(t->sparse_list); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Wed Sep 14 21:15:01 2016 (r305819) @@ -136,6 +136,7 @@ struct tar { int64_t entry_padding; int64_t entry_bytes_unconsumed; int64_t realsize; + int sparse_allowed; struct sparse_block *sparse_list; struct sparse_block *sparse_last; int64_t sparse_offset; @@ -1271,6 +1272,14 @@ header_common(struct archive_read *a, st * sparse information in the extended area. */ /* FALLTHROUGH */ + case '0': + /* + * Enable sparse file "read" support only for regular + * files and explicit GNU sparse files. However, we + * don't allow non-standard file types to be sparse. + */ + tar->sparse_allowed = 1; + /* FALLTHROUGH */ default: /* Regular file and non-standard types */ /* * Per POSIX: non-recognized types should always be @@ -1730,6 +1739,14 @@ pax_attribute(struct archive_read *a, st #endif switch (key[0]) { case 'G': + /* Reject GNU.sparse.* headers on non-regular files. */ + if (strncmp(key, "GNU.sparse", 10) == 0 && + !tar->sparse_allowed) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Non-regular file cannot be sparse"); + return (ARCHIVE_FATAL); + } + /* GNU "0.0" sparse pax format. */ if (strcmp(key, "GNU.sparse.numblocks") == 0) { tar->sparse_offset = -1; Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Wed Sep 14 21:15:01 2016 (r305819) @@ -153,9 +153,19 @@ set_acl(struct archive *a, int fd, const if (entries == 0) return (ARCHIVE_OK); acl = acl_init(entries); + if (acl == (acl_t)NULL) { + archive_set_error(a, errno, + "Failed to initialize ACL working storage"); + return (ARCHIVE_FAILED); + } while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { - acl_create_entry(&acl, &acl_entry); + if (acl_create_entry(&acl, &acl_entry) != 0) { + archive_set_error(a, errno, + "Failed to create a new ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } switch (ae_tag) { case ARCHIVE_ENTRY_ACL_USER: @@ -186,53 +196,96 @@ set_acl(struct archive *a, int fd, const break; #endif default: - /* XXX */ - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; } #ifdef ACL_TYPE_NFS4 + r = 0; switch (ae_type) { case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); break; case ARCHIVE_ENTRY_ACL_TYPE_DENY: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); break; case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); break; case ARCHIVE_ENTRY_ACL_TYPE_ALARM: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); break; case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: // These don't translate directly into the system ACL. break; default: - // XXX error handling here. - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (r != 0) { + archive_set_error(a, errno, + "Failed to set ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; } #endif - acl_get_permset(acl_entry, &acl_permset); - acl_clear_perms(acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to get ACL permission set"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_perms(acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to clear ACL permissions"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { if (ae_permset & acl_perm_map[i].archive_perm) - acl_add_perm(acl_permset, - acl_perm_map[i].platform_perm); + if (acl_add_perm(acl_permset, + acl_perm_map[i].platform_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } } #ifdef ACL_TYPE_NFS4 - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { - acl_clear_flags_np(acl_flagset); + if (acl_type == ACL_TYPE_NFS4) { + /* + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to get flagset from an NFSv4 ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_flags_np(acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to clear flags from an NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + if (ae_permset & acl_inherit_map[i].archive_inherit) { + if (acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit) != 0) { + archive_set_error(a, errno, + "Failed to add flag to NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } } } #endif @@ -262,6 +315,7 @@ set_acl(struct archive *a, int fd, const ret = ARCHIVE_WARN; } #endif +exit_free: acl_free(acl); return (ret); } Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Sep 14 21:15:01 2016 (r305819) @@ -140,7 +140,17 @@ __FBSDID("$FreeBSD$"); #define O_BINARY 0 #endif #ifndef O_CLOEXEC -#define O_CLOEXEC 0 +#define O_CLOEXEC 0 +#endif + +/* Ignore non-int O_NOFOLLOW constant. */ +/* gnulib's fcntl.h does this on AIX, but it seems practical everywhere */ +#if defined O_NOFOLLOW && !(INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +#undef O_NOFOLLOW +#endif + +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0 #endif struct fixup_entry { @@ -326,12 +336,14 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) +static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif +static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -2014,6 +2026,10 @@ create_filesystem_object(struct archive_ const char *linkname; mode_t final_mode, mode; int r; + /* these for check_symlinks_fsobj */ + char *linkname_copy; /* non-const copy of linkname */ + struct archive_string error_string; + int error_number; /* We identify hard/symlinks according to the link names. */ /* Since link(2) and symlink(2) don't handle modes, we're done here. */ @@ -2022,6 +2038,27 @@ create_filesystem_object(struct archive_ #if !HAVE_LINK return (EPERM); #else + archive_string_init(&error_string); + linkname_copy = strdup(linkname); + if (linkname_copy == NULL) { + return (EPERM); + } + /* TODO: consider using the cleaned-up path as the link target? */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + free(linkname_copy); r = link(linkname, a->name) ? errno : 0; /* * New cpio and pax formats allow hardlink entries @@ -2040,7 +2077,7 @@ create_filesystem_object(struct archive_ a->deferred = 0; } else if (r == 0 && a->filesize > 0) { a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC); + O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2351,126 +2388,233 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } -/* TODO: Make this work. */ -/* - * TODO: The deep-directory support bypasses this; disable deep directory - * support if we're doing symlink checks. - */ /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other * recent paths. */ /* TODO: Extend this to support symlinks on Windows Vista and later. */ + +/* + * Checks the given path to see if any elements along it are symlinks. Returns + * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. + */ static int -check_symlinks(struct archive_write_disk *a) +check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ - (void)a; /* UNUSED */ + (void)path; /* UNUSED */ + (void)error_number; /* UNUSED */ + (void)error_string; /* UNUSED */ + (void)flags; /* UNUSED */ return (ARCHIVE_OK); #else - char *pn; + int res = ARCHIVE_OK; + char *tail; + char *head; + int last; char c; int r; struct stat st; + int restore_pwd; + + /* Nothing to do here if name is empty */ + if(path[0] == '\0') + return (ARCHIVE_OK); /* * Guard against symlink tricks. Reject any archive entry whose * destination would be altered by a symlink. - */ - /* Whatever we checked last time doesn't need to be re-checked. */ - pn = a->name; - if (archive_strlen(&(a->path_safe)) > 0) { - char *p = a->path_safe.s; - while ((*pn != '\0') && (*p == *pn)) - ++p, ++pn; - } + * + * Walk the filename in chunks separated by '/'. For each segment: + * - if it doesn't exist, continue + * - if it's symlink, abort or remove it + * - if it's a directory and it's not the last chunk, cd into it + * As we go: + * head points to the current (relative) path + * tail points to the temporary \0 terminating the segment we're currently examining + * c holds what used to be in *tail + * last is 1 if this is the last tail + */ + restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(restore_pwd); + if (restore_pwd < 0) + return (ARCHIVE_FATAL); + head = path; + tail = path; + last = 0; + /* TODO: reintroduce a safe cache here? */ /* Skip the root directory if the path is absolute. */ - if(pn == a->name && pn[0] == '/') - ++pn; - c = pn[0]; - /* Keep going until we've checked the entire name. */ - while (pn[0] != '\0' && (pn[0] != '/' || pn[1] != '\0')) { + if(tail == path && tail[0] == '/') + ++tail; + /* Keep going until we've checked the entire name. + * head, tail, path all alias the same string, which is + * temporarily zeroed at tail, so be careful restoring the + * stashed (c=tail[0]) for error messages. + * Exiting the loop with break is okay; continue is not. + */ + while (!last) { + /* Skip the separator we just consumed, plus any adjacent ones */ + while (*tail == '/') + ++tail; /* Skip the next path element. */ - while (*pn != '\0' && *pn != '/') - ++pn; - c = pn[0]; - pn[0] = '\0'; + while (*tail != '\0' && *tail != '/') + ++tail; + /* is this the last path component? */ + last = (tail[0] == '\0') || (tail[0] == '/' && tail[1] == '\0'); + /* temporarily truncate the string here */ + c = tail[0]; + tail[0] = '\0'; /* Check that we haven't hit a symlink. */ - r = lstat(a->name, &st); + r = lstat(head, &st); if (r != 0) { + tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ if (errno == ENOENT) { break; } else { - /* Note: This effectively disables deep directory + /* Treat any other error as fatal - best to be paranoid here + * Note: This effectively disables deep directory * support when security checks are enabled. * Otherwise, very long pathnames that trigger * an error here could evade the sandbox. * TODO: We could do better, but it would probably * require merging the symlink checks with the * deep-directory editing. */ - return (ARCHIVE_FAILED); + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not stat %s", + path); + res = ARCHIVE_FAILED; + break; + } + } else if (S_ISDIR(st.st_mode)) { + if (!last) { + if (chdir(head) != 0) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not chdir %s", + path); + res = (ARCHIVE_FATAL); + break; + } + /* Our view is now from inside this dir: */ + head = tail + 1; } } else if (S_ISLNK(st.st_mode)) { - if (c == '\0') { + if (last) { /* * Last element is symlink; remove it * so we can overwrite it with the * item being extracted. */ - if (unlink(a->name)) { - archive_set_error(&a->archive, errno, - "Could not remove symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head)) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not remove symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; /* * Even if we did remove it, a warning * is in order. The warning is silly, * though, if we're just replacing one * symlink with another symlink. */ - if (!S_ISLNK(a->mode)) { - archive_set_error(&a->archive, 0, - "Removing symlink %s", - a->name); + tail[0] = c; + /* FIXME: not sure how important this is to restore + if (!S_ISLNK(path)) { + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Removing symlink %s", + path); } + */ /* Symlink gone. No more problem! */ - pn[0] = c; - return (0); - } else if (a->flags & ARCHIVE_EXTRACT_UNLINK) { + res = ARCHIVE_OK; + break; + } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(a->name) != 0) { - archive_set_error(&a->archive, 0, - "Cannot remove intervening symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head) != 0) { + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot remove intervening symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; + tail[0] = c; } else { - archive_set_error(&a->archive, 0, - "Cannot extract through symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot extract through symlink %s", + path); + res = ARCHIVE_FAILED; + break; } } - pn[0] = c; - if (pn[0] != '\0') - pn++; /* Advance to the next segment. */ - } - pn[0] = c; - /* We've checked and/or cleaned the whole path, so remember it. */ - archive_strcpy(&a->path_safe, a->name); - return (ARCHIVE_OK); + /* be sure to always maintain this */ + tail[0] = c; + if (tail[0] != '\0') + tail++; /* Advance to the next segment. */ + } + /* Catches loop exits via break */ + tail[0] = c; +#ifdef HAVE_FCHDIR + /* If we changed directory above, restore it here. */ + if (restore_pwd >= 0) { + r = fchdir(restore_pwd); + if (r != 0) { + if(error_number) *error_number = errno; + if(error_string) + archive_string_sprintf(error_string, + "chdir() failure"); + } + close(restore_pwd); + restore_pwd = -1; + if (r != 0) { + res = (ARCHIVE_FATAL); + } + } +#endif + /* TODO: reintroduce a safe cache here? */ + return res; #endif } +/* + * Check a->name for symlinks, returning ARCHIVE_OK if its clean, otherwise + * calls archive_set_error and returns ARCHIVE_{FATAL,FAILED} + */ +static int +check_symlinks(struct archive_write_disk *a) +{ + struct archive_string error_string; + int error_number; + int rc; + archive_string_init(&error_string); + rc = check_symlinks_fsobj(a->name, &error_number, &error_string, a->flags); + if (rc != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + } + archive_string_free(&error_string); + a->pst = NULL; /* to be safe */ + return rc; +} + + #if defined(__CYGWIN__) /* * 1. Convert a path separator from '\' to '/' . @@ -2544,15 +2688,17 @@ cleanup_pathname_win(struct archive_writ * is set) if the path is absolute. */ static int -cleanup_pathname(struct archive_write_disk *a) +cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { char *dest, *src; char separator = '\0'; - dest = src = a->name; + dest = src = path; if (*src == '\0') { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid empty pathname"); + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Invalid empty pathname"); return (ARCHIVE_FAILED); } @@ -2561,9 +2707,11 @@ cleanup_pathname(struct archive_write_di #endif /* Skip leading '/'. */ if (*src == '/') { - if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Path is absolute"); + if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Path is absolute"); return (ARCHIVE_FAILED); } @@ -2590,10 +2738,11 @@ cleanup_pathname(struct archive_write_di } else if (src[1] == '.') { if (src[2] == '/' || src[2] == '\0') { /* Conditionally warn about '..' */ - if (a->flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Path contains '..'"); + if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 14 23:24:24 2016 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 560D1BDA11B; Wed, 14 Sep 2016 23:24:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28CD71693; Wed, 14 Sep 2016 23:24:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8ENONo9068729; Wed, 14 Sep 2016 23:24:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ENONYG068728; Wed, 14 Sep 2016 23:24:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609142324.u8ENONYG068728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Sep 2016 23:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305820 - head/sys/powerpc/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.23 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2016 23:24:24 -0000 Author: jhibbits Date: Wed Sep 14 23:24:23 2016 New Revision: 305820 URL: https://svnweb.freebsd.org/changeset/base/305820 Log: Only define db_show_spr if DDB is enabled. PR: 212667 Reported by: Kenneth Salerno Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Wed Sep 14 21:15:01 2016 (r305819) +++ head/sys/powerpc/powerpc/machdep.c Wed Sep 14 23:24:23 2016 (r305820) @@ -527,6 +527,7 @@ spinlock_exit(void) */ extern register_t get_spr(int); +#ifdef DDB DB_SHOW_COMMAND(spr, db_show_spr) { register_t spr; @@ -546,3 +547,4 @@ DB_SHOW_COMMAND(spr, db_show_spr) db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno, (unsigned long)spr); } +#endif From owner-svn-src-all@freebsd.org Thu Sep 15 00:24:50 2016 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 72A9FBDB484; Thu, 15 Sep 2016 00:24:50 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AFC313D9; Thu, 15 Sep 2016 00:24:49 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id kKSpbQ2vngdalkKSqbRr0B; Wed, 14 Sep 2016 18:24:25 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=_Da3-AaO94K6rK72rs4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 48E5D150D; Wed, 14 Sep 2016 17:23:39 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u8F0NcMu021150; Wed, 14 Sep 2016 17:23:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201609150023.u8F0NcMu021150@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Pedro Giffuni cc: Baptiste Daroussin , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test In-Reply-To: Message from Pedro Giffuni of "Wed, 14 Sep 2016 08:37:37 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 14 Sep 2016 17:23:38 -0700 X-CMAE-Envelope: MS4wfN1m6t6j08jCrkDzrHhHlJap0S8AdSrCuAqYEFbefRptQXsmxY8TJzp05qL1L8QTPVeMcRi08JhtVwH2AQfIjH0xQjZ7o/VW1XnUwVjgiMuK1VQwZJYE QgLvkMg5GuKQhVlqN8nICNYB9HF8YW05SzVQEe89NxNaLI6n2K6Bs5L+zcs4BL5rN6Yv9rUHOoNcXtYrfuj/+wyNwW5c/IvSYSFyxX2J99QYnS5GE/+jk73G UUgKo83W89buhJBHC2arTPVDqkzUA+gB5vBNme2t+NRhRtphiCz1bVWBv7V0U9vYCntMKSp8yhg48vnCED9d26pjKLEpz4czZSpT2Ta0yHk= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 00:24:50 -0000 In message , Pedro Giffuni wr ites: > Hello; > > > On 14/09/2016 00:00, Baptiste Daroussin wrote: > > On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: > >> Author: cy > >> Date: Wed Sep 14 01:47:01 2016 > >> New Revision: 305787 > >> URL: https://svnweb.freebsd.org/changeset/base/305787 > >> > >> Log: > >> Switch from .CURDIR to the simpler, more legible SRCTOP. > >> > >> Suggested by: emaste > >> X-MFC-with: upcoming amd upgrade > >> > > I thought the plans was more to deprecated and remove amd at some points gi > ven > > we now have autofs/automountd? Am I missing something? > > We haven't discussed deprecation, although it's not off the table. > > From what I read about amd, it gets along with autofs well. > It appears some sysadmins may be used to amd and just removing it may > violate POLA. True. > > It may be that the port/pkg is sufficient but before removing we should > update it to match what the port has. Agreed. I'm working on the update bit. It's mostly done. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Sep 15 01:55:19 2016 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 7DC67BDB521; Thu, 15 Sep 2016 01:55:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E7AD12AD; Thu, 15 Sep 2016 01:55:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F1tICV029631; Thu, 15 Sep 2016 01:55:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F1tI7j029630; Thu, 15 Sep 2016 01:55:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609150155.u8F1tI7j029630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 01:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305821 - head/usr.bin/login X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 01:55:19 -0000 Author: emaste Date: Thu Sep 15 01:55:18 2016 New Revision: 305821 URL: https://svnweb.freebsd.org/changeset/base/305821 Log: login: clean up errx strings errx() prefixes the error string with argv[0] so including "login: " in the string is redundant. Also remove a superfluous newline. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/login/login_audit.c Modified: head/usr.bin/login/login_audit.c ============================================================================== --- head/usr.bin/login/login_audit.c Wed Sep 14 23:24:23 2016 (r305820) +++ head/usr.bin/login/login_audit.c Thu Sep 15 01:55:18 2016 (r305821) @@ -73,14 +73,14 @@ au_login_success(void) if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { if (errno == ENOSYS) return; - errx(1, "login: Could not determine audit condition"); + errx(1, "Could not determine audit condition"); } if (au_cond == AUC_NOAUDIT) return; /* Compute and set the user's preselection mask. */ if (au_user_mask(pwd->pw_name, &aumask) == -1) - errx(1, "login: Could not set audit mask\n"); + errx(1, "Could not set audit mask"); /* Set the audit info for the user. */ auinfo.ai_auid = uid; @@ -88,22 +88,22 @@ au_login_success(void) bcopy(&tid, &auinfo.ai_termid, sizeof(auinfo.ai_termid)); bcopy(&aumask, &auinfo.ai_mask, sizeof(auinfo.ai_mask)); if (setaudit(&auinfo) != 0) - err(1, "login: setaudit failed"); + err(1, "setaudit failed"); if ((aufd = au_open()) == -1) - errx(1,"login: Audit Error: au_open() failed"); + errx(1, "Audit Error: au_open() failed"); if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, pid, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); au_write(aufd, tok); if ((tok = au_to_return32(0, 0)) == NULL) - errx(1, "login: Audit Error: au_to_return32() failed"); + errx(1, "Audit Error: au_to_return32() failed"); au_write(aufd, tok); if (au_close(aufd, 1, AUE_login) == -1) - errx(1, "login: Audit Record was not committed."); + errx(1, "Audit Record was not committed."); } /* @@ -124,13 +124,13 @@ au_login_fail(const char *errmsg, int na if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { if (errno == ENOSYS) return; - errx(1, "login: Could not determine audit condition"); + errx(1, "Could not determine audit condition"); } if (au_cond == AUC_NOAUDIT) return; if ((aufd = au_open()) == -1) - errx(1, "login: Audit Error: au_open() failed"); + errx(1, "Audit Error: au_open() failed"); if (na) { /* @@ -139,28 +139,28 @@ au_login_fail(const char *errmsg, int na */ if ((tok = au_to_subject32(-1, geteuid(), getegid(), -1, -1, pid, -1, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); } else { /* We know the subject -- so use its value instead. */ uid = pwd->pw_uid; gid = pwd->pw_gid; if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, pid, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); } au_write(aufd, tok); /* Include the error message. */ if ((tok = au_to_text(errmsg)) == NULL) - errx(1, "login: Audit Error: au_to_text() failed"); + errx(1, "Audit Error: au_to_text() failed"); au_write(aufd, tok); if ((tok = au_to_return32(1, errno)) == NULL) - errx(1, "login: Audit Error: au_to_return32() failed"); + errx(1, "Audit Error: au_to_return32() failed"); au_write(aufd, tok); if (au_close(aufd, 1, AUE_login) == -1) - errx(1, "login: Audit Error: au_close() was not committed"); + errx(1, "Audit Error: au_close() was not committed"); } /* @@ -181,24 +181,24 @@ audit_logout(void) if (auditon(A_GETCOND, &au_cond, sizeof(int)) < 0) { if (errno == ENOSYS) return; - errx(1, "login: Could not determine audit condition"); + errx(1, "Could not determine audit condition"); } if (au_cond == AUC_NOAUDIT) return; if ((aufd = au_open()) == -1) - errx(1, "login: Audit Error: au_open() failed"); + errx(1, "Audit Error: au_open() failed"); /* The subject that is created (euid, egid of the current process). */ if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, pid, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); au_write(aufd, tok); if ((tok = au_to_return32(0, 0)) == NULL) - errx(1, "login: Audit Error: au_to_return32() failed"); + errx(1, "Audit Error: au_to_return32() failed"); au_write(aufd, tok); if (au_close(aufd, 1, AUE_logout) == -1) - errx(1, "login: Audit Record was not committed."); + errx(1, "Audit Record was not committed."); } From owner-svn-src-all@freebsd.org Thu Sep 15 01:58:13 2016 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 5D8C5BDB5DC; Thu, 15 Sep 2016 01:58:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B95114BB; Thu, 15 Sep 2016 01:58:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F1wCKt029761; Thu, 15 Sep 2016 01:58:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F1wCvL029760; Thu, 15 Sep 2016 01:58:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609150158.u8F1wCvL029760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 01:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305822 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 01:58:13 -0000 Author: emaste Date: Thu Sep 15 01:58:12 2016 New Revision: 305822 URL: https://svnweb.freebsd.org/changeset/base/305822 Log: bspatch: use #define for header size instead of magic number Reviewed by: allanjude, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7861 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 15 01:55:18 2016 (r305821) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 15 01:58:12 2016 (r305822) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,6 +53,7 @@ __FBSDID("$FreeBSD$"); #ifndef O_BINARY #define O_BINARY 0 #endif +#define HEADER_SIZE 32 static char *newfile; static int dirfd = -1; @@ -101,12 +103,11 @@ int main(int argc, char *argv[]) int newfd, oldfd; off_t oldsize, newsize; off_t bzctrllen, bzdatalen; - u_char header[32], buf[8]; + u_char header[HEADER_SIZE], buf[8]; u_char *old, *new; off_t oldpos, newpos; off_t ctrl[3]; - off_t lenread; - off_t i; + off_t i, lenread, offset; #ifdef HAVE_CAPSICUM cap_rights_t rights_dir, rights_ro, rights_wr; #endif @@ -181,7 +182,7 @@ int main(int argc, char *argv[]) */ /* Read header */ - if (fread(header, 1, 32, f) < 32) { + if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) { if (feof(f)) errx(1, "Corrupt patch"); err(1, "fread(%s)", argv[3]); @@ -195,27 +196,27 @@ int main(int argc, char *argv[]) bzctrllen = offtin(header + 8); bzdatalen = offtin(header + 16); newsize = offtin(header + 24); - if (bzctrllen < 0 || bzctrllen > OFF_MAX - 32 || - bzdatalen < 0 || bzctrllen + 32 > OFF_MAX - bzdatalen || + if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE || + bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen || newsize < 0 || newsize > SSIZE_MAX) errx(1, "Corrupt patch"); /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) err(1, "fclose(%s)", argv[3]); - if (fseeko(cpf, 32, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)32); + offset = HEADER_SIZE; + if (fseeko(cpf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)(32 + bzctrllen)); + offset += bzctrllen; + if (fseeko(dpf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)(32 + bzctrllen + bzdatalen)); + offset += bzdatalen; + if (fseeko(epf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); From owner-svn-src-all@freebsd.org Thu Sep 15 02:48:57 2016 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 34B2EBDB53A; Thu, 15 Sep 2016 02:48:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05F121AF1; Thu, 15 Sep 2016 02:48:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F2muPP048400; Thu, 15 Sep 2016 02:48:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F2murT048399; Thu, 15 Sep 2016 02:48:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609150248.u8F2murT048399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 02:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305823 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 02:48:57 -0000 Author: emaste Date: Thu Sep 15 02:48:56 2016 New Revision: 305823 URL: https://svnweb.freebsd.org/changeset/base/305823 Log: sdiff: improve errx string errx() appends a newline so \n is superfluous. Also switch to lower case with no period for consistency with other errx strings. Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Thu Sep 15 01:58:12 2016 (r305822) +++ head/usr.bin/sdiff/sdiff.c Thu Sep 15 02:48:56 2016 (r305823) @@ -488,7 +488,7 @@ binexec(char *diffprog, char *f1, char * execv(diffprog, args); /* If execv() fails, sdiff's execution will continue below. */ - errx(1, "Could not execute diff process.\n"); + errx(1, "could not execute diff process"); } /* From owner-svn-src-all@freebsd.org Thu Sep 15 05:07:57 2016 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 B52F2BDB886; Thu, 15 Sep 2016 05:07:57 +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 635E311AC; Thu, 15 Sep 2016 05:07:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id A0D407826A9; Thu, 15 Sep 2016 15:07:53 +1000 (AEST) Date: Thu, 15 Sep 2016 15:07:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305821 - head/usr.bin/login In-Reply-To: <201609150155.u8F1tI7j029630@repo.freebsd.org> Message-ID: <20160915144746.X806@besplex.bde.org> References: <201609150155.u8F1tI7j029630@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=YKd6FehL3BivA6oiOWAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 05:07:57 -0000 On Thu, 15 Sep 2016, Ed Maste wrote: > Log: > login: clean up errx strings > > errx() prefixes the error string with argv[0] so including "login: " > in the string is redundant. Also remove a superfluous newline. The strings still have plenty of dirt: > Modified: head/usr.bin/login/login_audit.c > ============================================================================== > --- head/usr.bin/login/login_audit.c Wed Sep 14 23:24:23 2016 (r305820) > +++ head/usr.bin/login/login_audit.c Thu Sep 15 01:55:18 2016 (r305821) > @@ -73,14 +73,14 @@ au_login_success(void) > if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { > if (errno == ENOSYS) > return; > - errx(1, "login: Could not determine audit condition"); > + errx(1, "Could not determine audit condition"); Capitalization. Error messages are conventionally not capitalized (but strerror() strings break this). This file does this in many more places, but not all. > @@ -88,22 +88,22 @@ au_login_success(void) > bcopy(&tid, &auinfo.ai_termid, sizeof(auinfo.ai_termid)); > bcopy(&aumask, &auinfo.ai_mask, sizeof(auinfo.ai_mask)); > if (setaudit(&auinfo) != 0) > - err(1, "login: setaudit failed"); > + err(1, "setaudit failed"); Example of normal style for an error message. Should possibly indicate that it was a specific function/syscall that failed by marking up the function with "()". > > if ((aufd = au_open()) == -1) > - errx(1,"login: Audit Error: au_open() failed"); > + errx(1, "Audit Error: au_open() failed"); This marks up the function and adds the doubly Capitalized spam "Audit Error: ". Who would have thought that an error message is for an error? "Audit " is not as redundant as that, but is not used in all of the messages. Since this uses errx() and not err(), a different style is justified, but it is probably wrong to not use strerror() when a function/syscall name is printed. The "failed" part of the message is nondescript. > > if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, > pid, &tid)) == NULL) > - errx(1, "login: Audit Error: au_to_subject32() failed"); > + errx(1, "Audit Error: au_to_subject32() failed"); > au_write(aufd, tok); > > if ((tok = au_to_return32(0, 0)) == NULL) > - errx(1, "login: Audit Error: au_to_return32() failed"); > + errx(1, "Audit Error: au_to_return32() failed"); > au_write(aufd, tok); Spam continues. The function name is a bit too long to print. > > if (au_close(aufd, 1, AUE_login) == -1) > - errx(1, "login: Audit Record was not committed."); > + errx(1, "Audit Record was not committed."); > } Now "Audit Record" is useful because the function name is not printed. Not printing the function name is a different and perhaps better style. I usually print the function name when I don't want to think about a better discription. Error messages are conventionally not capitalized, and most in this file are not. but this one is. > > /* > @@ -124,13 +124,13 @@ au_login_fail(const char *errmsg, int na > if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { > if (errno == ENOSYS) > return; > - errx(1, "login: Could not determine audit condition"); > + errx(1, "Could not determine audit condition"); > } Back to only 1 capitialization error. > if (au_cond == AUC_NOAUDIT) > return; > > if ((aufd = au_open()) == -1) > - errx(1, "login: Audit Error: au_open() failed"); > + errx(1, "Audit Error: au_open() failed"); Back to spam. > > if (na) { > /* > @@ -139,28 +139,28 @@ au_login_fail(const char *errmsg, int na > */ > if ((tok = au_to_subject32(-1, geteuid(), getegid(), -1, -1, > pid, -1, &tid)) == NULL) > - errx(1, "login: Audit Error: au_to_subject32() failed"); > + errx(1, "Audit Error: au_to_subject32() failed"); > } else { > /* We know the subject -- so use its value instead. */ > uid = pwd->pw_uid; > gid = pwd->pw_gid; > if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, > gid, pid, pid, &tid)) == NULL) > - errx(1, "login: Audit Error: au_to_subject32() failed"); > + errx(1, "Audit Error: au_to_subject32() failed"); > ... The general style reduces to "error: xxx failed [duh]" with careful use of errx() instead of err() to prevent leakage of useful information. Bruce From owner-svn-src-all@freebsd.org Thu Sep 15 07:41:51 2016 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 BB766BDAFC8; Thu, 15 Sep 2016 07:41:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E761C47; Thu, 15 Sep 2016 07:41:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F7foJR059166; Thu, 15 Sep 2016 07:41:50 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F7fmcM059138; Thu, 15 Sep 2016 07:41:48 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609150741.u8F7fmcM059138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 15 Sep 2016 07:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 07:41:51 -0000 Author: kevlo Date: Thu Sep 15 07:41:48 2016 New Revision: 305824 URL: https://svnweb.freebsd.org/changeset/base/305824 Log: Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D7878 Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/kern/uipc_socket.c head/sys/net/if_arcsubr.c head/sys/net/if_fddisubr.c head/sys/net/if_iso88025subr.c head/sys/net/raw_usrreq.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_output.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/icmp6.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/keysock.c head/sys/sys/mbuf.h Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 15 07:41:48 2016 (r305824) @@ -3226,7 +3226,7 @@ filterdone: fdp = fin->fin_dif; if ((fdp != NULL) && (fdp->fd_ptr != NULL) && (fdp->fd_ptr != (void *)-1)) { - mc = M_COPY(fin->fin_m); + mc = M_COPYM(fin->fin_m); if (mc != NULL) ipf_fastroute(mc, &mc, fin, fdp); } Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Sep 15 07:41:48 2016 (r305824) @@ -211,7 +211,7 @@ struct ether_addr { # define MSGDSIZE(m) mbufchainlen(m) # define M_LEN(m) (m)->m_len # define M_ADJ(m,x) m_adj(m, x) -# define M_COPY(x) m_copy((x), 0, M_COPYALL) +# define M_COPYM(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) # define M_DUP(m) m_dup(m, M_NOWAIT) # define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } typedef struct mbuf mb_t; @@ -366,7 +366,7 @@ typedef struct mb_s { # define MSGDSIZE(m) msgdsize(m) # define M_LEN(m) (m)->mb_len # define M_ADJ(m,x) (m)->mb_len += x -# define M_COPY(m) dupmbt(m) +# define M_COPYM(m) dupmbt(m) # define M_DUP(m) dupmbt(m) # define GETKTIME(x) gettimeofday((struct timeval *)(x), NULL) # define MTOD(m, t) ((t)(m)->mb_data) Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Sep 15 07:41:48 2016 (r305824) @@ -920,7 +920,7 @@ ipf_fastroute(m0, mpp, fin, fdp) mhip->ip_off |= IP_MF; mhip->ip_len = htons((u_short)(len + mhlen)); *mnext = m; - m->m_next = m_copy(m0, off, len); + m->m_next = m_copym(m0, off, len, M_NOWAIT); if (m->m_next == 0) { error = ENOBUFS; /* ??? */ goto sendorfree; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/kern/uipc_socket.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1640,7 +1640,8 @@ dontblock: do { if (flags & MSG_PEEK) { if (controlp != NULL) { - *controlp = m_copy(m, 0, m->m_len); + *controlp = m_copym(m, 0, m->m_len, + M_NOWAIT); controlp = &(*controlp)->m_next; } m = m->m_next; Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/if_arcsubr.c Thu Sep 15 07:41:48 2016 (r305824) @@ -225,7 +225,7 @@ arc_output(struct ifnet *ifp, struct mbu if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { - struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); + struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); (void) if_simloop(ifp, n, dst->sa_family, ARC_HDRLEN); } else if (ah->arc_dhost == ah->arc_shost) { Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/if_fddisubr.c Thu Sep 15 07:41:48 2016 (r305824) @@ -275,7 +275,7 @@ fddi_output(struct ifnet *ifp, struct mb if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); (void) if_simloop(ifp, n, dst->sa_family, FDDI_HDR_LEN); } else if (bcmp(fh->fddi_dhost, fh->fddi_shost, Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/if_iso88025subr.c Thu Sep 15 07:41:48 2016 (r305824) @@ -364,7 +364,7 @@ iso88025_output(struct ifnet *ifp, struc if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); (void) if_simloop(ifp, n, dst->sa_family, ISO88025_HDR_LEN); } else if (bcmp(th->iso88025_dhost, th->iso88025_shost, Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/raw_usrreq.c Thu Sep 15 07:41:48 2016 (r305824) @@ -95,7 +95,7 @@ raw_input_ext(struct mbuf *m0, struct so continue; if (last) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) { if (sbappendaddr(&last->so_rcv, src, n, (struct mbuf *)0) == 0) Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/ip_input.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1000,7 +1000,7 @@ ip_forward(struct mbuf *m, int srcrt) * because unnecessary, or because rate limited), so we are * really we are wasting a lot of work here. * - * We don't use m_copy() because it might return a reference + * We don't use m_copym() because it might return a reference * to a shared cluster. Both this function and ip_output() * assume exclusive access to the IP header in `m', so any * data in a cluster may change before we reach icmp_error(). Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/ip_mroute.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1344,7 +1344,7 @@ X_ip_mforward(struct ip *ip, struct ifne goto fail; /* Make a copy of the header to send to the user level process */ - mm = m_copy(mb0, 0, hlen); + mm = m_copym(mb0, 0, hlen, M_NOWAIT); if (mm == NULL) goto fail1; @@ -1542,7 +1542,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET }; struct igmpmsg *im; int hlen = ip->ip_hl << 2; - struct mbuf *mm = m_copy(m, 0, hlen); + struct mbuf *mm = m_copym(m, 0, hlen, M_NOWAIT); if (mm && (!M_WRITABLE(mm) || mm->m_len < hlen)) mm = m_pullup(mm, hlen); @@ -2734,9 +2734,9 @@ pim_input(struct mbuf **mp, int *offp, i * actions (e.g., send back PIM_REGISTER_STOP). * XXX: here m->m_data points to the outer IP header. */ - mcp = m_copy(m, 0, iphlen + PIM_REG_MINLEN); + mcp = m_copym(m, 0, iphlen + PIM_REG_MINLEN, M_NOWAIT); if (mcp == NULL) { - CTR1(KTR_IPMF, "%s: m_copy() failed", __func__); + CTR1(KTR_IPMF, "%s: m_copym() failed", __func__); m_freem(m); return (IPPROTO_DONE); } Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/raw_ip.c Thu Sep 15 07:41:48 2016 (r305824) @@ -322,7 +322,7 @@ rip_input(struct mbuf **mp, int *offp, i if (last != NULL) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n != NULL) (void) rip_append(last, ip, n, &ripsrc); /* XXX count dropped packet */ @@ -400,7 +400,7 @@ rip_input(struct mbuf **mp, int *offp, i if (last != NULL) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n != NULL) (void) rip_append(last, ip, n, &ripsrc); /* XXX count dropped packet */ Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/tcp_output.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1049,7 +1049,7 @@ send: mtod(m, caddr_t) + hdrlen); m->m_len += len; } else { - m->m_next = m_copy(mb, moff, (int)len); + m->m_next = m_copym(mb, moff, len, M_NOWAIT); if (m->m_next == NULL) { SOCKBUF_UNLOCK(&so->so_snd); (void) m_free(m); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/udp_usrreq.c Thu Sep 15 07:41:48 2016 (r305824) @@ -597,7 +597,8 @@ udp_input(struct mbuf **mp, int *offp, i if (last != NULL) { struct mbuf *n; - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != + NULL) { UDP_PROBE(receive, NULL, last, ip, last, uh); if (udp_append(last, ip, n, iphlen, Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/icmp6.c Thu Sep 15 07:41:48 2016 (r305824) @@ -554,7 +554,7 @@ icmp6_input(struct mbuf **mp, int *offp, icmp6_ifstat_inc(ifp, ifs6_in_echo); if (code != 0) goto badcode; - if ((n = m_copy(m, 0, M_COPYALL)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Give up remote */ break; } @@ -651,7 +651,7 @@ icmp6_input(struct mbuf **mp, int *offp, IP6_EXTHDR_CHECK(m, off, sizeof(struct icmp6_nodeinfo), IPPROTO_DONE); #endif - n = m_copy(m, 0, M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) n = ni6_input(n, off); /* XXX meaningless if n == NULL */ @@ -2039,7 +2039,7 @@ icmp6_rip6_input(struct mbuf **mp, int o } } if (n != NULL || - (n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { + (n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { if (last->inp_flags & INP_CONTROLOPTS) ip6_savecontrol(last, n, &opts); /* strip intermediate headers */ Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/ip6_forward.c Thu Sep 15 07:41:48 2016 (r305824) @@ -166,7 +166,8 @@ ip6_forward(struct mbuf *m, int srcrt) * It is important to save it before IPsec processing as IPsec * processing may modify the mbuf. */ - mcopy = m_copy(m, 0, imin(m->m_pkthdr.len, ICMPV6_PLD_MAXLEN)); + mcopy = m_copym(m, 0, imin(m->m_pkthdr.len, ICMPV6_PLD_MAXLEN), + M_NOWAIT); #ifdef IPSEC /* get a security policy for this packet */ Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/ip6_mroute.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1145,7 +1145,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru MFC6_UNLOCK(); return (ENOBUFS); } - mb0 = m_copy(m, 0, M_COPYALL); + mb0 = m_copym(m, 0, M_COPYALL, M_NOWAIT); /* * Pullup packet header if needed before storing it, * as other references may modify it in the meantime. @@ -1185,7 +1185,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru * Make a copy of the header to send to the user * level process */ - mm = m_copy(mb0, 0, sizeof(struct ip6_hdr)); + mm = m_copym(mb0, 0, sizeof(struct ip6_hdr), M_NOWAIT); if (mm == NULL) { free(rte, M_MRTABLE6); m_freem(mb0); @@ -1417,7 +1417,8 @@ ip6_mdq(struct mbuf *m, struct ifnet *if struct omrt6msg *oim; #endif - mm = m_copy(m, 0, sizeof(struct ip6_hdr)); + mm = m_copym(m, 0, sizeof(struct ip6_hdr), + M_NOWAIT); if (mm && (!M_WRITABLE(mm) || mm->m_len < sizeof(struct ip6_hdr))) @@ -1547,7 +1548,7 @@ phyint_send(struct ip6_hdr *ip6, struct * the IPv6 header is actually copied, not just referenced, * so that ip6_output() only scribbles on the copy. */ - mb_copy = m_copy(m, 0, M_COPYALL); + mb_copy = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (mb_copy && (!M_WRITABLE(mb_copy) || mb_copy->m_len < sizeof(struct ip6_hdr))) mb_copy = m_pullup(mb_copy, sizeof(struct ip6_hdr)); @@ -1651,7 +1652,7 @@ register_send(struct ip6_hdr *ip6, struc mm->m_data += max_linkhdr; mm->m_len = sizeof(struct ip6_hdr); - if ((mm->m_next = m_copy(m, 0, M_COPYALL)) == NULL) { + if ((mm->m_next = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { m_freem(mm); return (ENOBUFS); } @@ -1870,7 +1871,7 @@ pim6_input(struct mbuf **mp, int *offp, /* * make a copy of the whole header to pass to the daemon later. */ - mcp = m_copy(m, 0, off + PIM6_REG_MINLEN); + mcp = m_copym(m, 0, off + PIM6_REG_MINLEN, M_NOWAIT); if (mcp == NULL) { MRT6_DLOG(DEBUG_ANY | DEBUG_ERR, "pim register: " "could not copy register head"); Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/ip6_output.c Thu Sep 15 07:41:48 2016 (r305824) @@ -259,7 +259,7 @@ ip6_fragment(struct ifnet *ifp, struct m ip6f->ip6f_offlg |= IP6F_MORE_FRAG; mhip6->ip6_plen = htons((u_short)(mtu + hlen + sizeof(*ip6f) - sizeof(struct ip6_hdr))); - if ((m_frgpart = m_copy(m0, off, mtu)) == NULL) { + if ((m_frgpart = m_copym(m0, off, mtu, M_NOWAIT)) == NULL) { IP6STAT_INC(ip6s_odropped); return (ENOBUFS); } @@ -3003,7 +3003,7 @@ ip6_mloopback(struct ifnet *ifp, struct struct mbuf *copym; struct ip6_hdr *ip6; - copym = m_copy(m, 0, M_COPYALL); + copym = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (copym == NULL) return; Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/raw_ip6.c Thu Sep 15 07:41:48 2016 (r305824) @@ -256,7 +256,7 @@ rip6_input(struct mbuf **mp, int *offp, } } if (last != NULL) { - struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); + struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); #ifdef IPSEC /* Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/udp6_usrreq.c Thu Sep 15 07:41:48 2016 (r305824) @@ -366,7 +366,8 @@ udp6_input(struct mbuf **mp, int *offp, if (last != NULL) { struct mbuf *n; - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != + NULL) { INP_RLOCK(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netipsec/keysock.c Thu Sep 15 07:41:48 2016 (r305824) @@ -301,7 +301,7 @@ key_sendup_mbuf(struct socket *so, struc * (based on pf_key@inner.net message on 14 Oct 1998) */ if (((struct keycb *)rp)->kp_promisc) { - if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { (void)key_sendup0(rp, n, 1); n = NULL; } @@ -331,7 +331,7 @@ key_sendup_mbuf(struct socket *so, struc if (!sendup) continue; - if ((n = m_copy(m, 0, (int)M_COPYALL)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { m_freem(m); PFKEYSTAT_INC(in_nomem); mtx_unlock(&rawcb_mtx); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/sys/mbuf.h Thu Sep 15 07:41:48 2016 (r305824) @@ -979,9 +979,6 @@ m_align(struct mbuf *m, int len) /* Length to m_copy to copy all. */ #define M_COPYALL 1000000000 -/* Compatibility with 4.3. */ -#define m_copy(m, o, l) m_copym((m), (o), (l), M_NOWAIT) - extern int max_datalen; /* MHLEN - max_hdr */ extern int max_hdr; /* Largest link + protocol header */ extern int max_linkhdr; /* Largest link-level header */ From owner-svn-src-all@freebsd.org Thu Sep 15 07:58:35 2016 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 43A91BDB532; Thu, 15 Sep 2016 07:58:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) (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 0FE4C1381; Thu, 15 Sep 2016 07:58:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id pp5so1820583pac.2; Thu, 15 Sep 2016 00:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=JLoxVRWf+AYe2bCw5taUlPFDvZNf5X+jrPbJ90p/uRQ=; b=Bsi7/UiWhFyAWSUIIZ85/RkdrUJ7Y2VZ0AJOWQDX9vyJ7E3yXbBaH9TO4/Xqu/e0y3 we2i/W300wSir9RY8PirHZ68o5mjOwECkiy+sc7MOpXVDzu0ovmmPUZn1h9VPiCE7RSp fTAIxGN4JRKeja/14K2jGI5oEatCde98l4i5iqBWlbAvLeNAe93AZNdZmN3/mghd484O OOeBV8QtuCGUjtEfS0d4Rsx7jNSFi1+QsApYJmdflXBK+CkMtf1e6sCHy7PlxhPMibUK YL0uWK6aObkwFplakcPr0Q7iKCQOYgwm2lu2/PYe+ZA/VrhNRsJTehmP/iIu+Xy4Cku7 /sag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=JLoxVRWf+AYe2bCw5taUlPFDvZNf5X+jrPbJ90p/uRQ=; b=Lo9d2PFZVvNtHnBoszo6GdtwCITTPmYB8lLTIwaeg0uM4qTWuNsgA+PiiNZPfcruIY gVrLcUyKDTHcSXJZNS7DjLA/WerRG8lnCOZ59HK5s3gJzGsvXUGrP0iufQ2OwNXySsNE Xv8BElEuLpKH/174conUCefNWyLBeIIznd8WpNNrqD0lOHtjh+h22Z49pykI91VHpePz 6+t+uDvKLzpnGXtLZB40fQ1i5+U1+tHETWe90aKNtP68XkjqMiKEGoj18EfovRJGhYux 1rG0LcgvFCVmdzdhV2iKVHaGECoVFrDUDUgnkTI6uFDrayFXKOEhrARndpEria/ja84f K9lA== X-Gm-Message-State: AE9vXwO50JVxdIfZ7dQb9CPKsw9vOpy4Dx8XW473V8vbpnT4aHjgSYOY19/lehItekmtJw== X-Received: by 10.66.131.48 with SMTP id oj16mr12244021pab.126.1473926314535; Thu, 15 Sep 2016 00:58:34 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id ve9sm2901633pac.12.2016.09.15.00.58.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 00:58:33 -0700 (PDT) Subject: Re: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201609150741.u8F7fmcM059138@repo.freebsd.org> Date: Thu, 15 Sep 2016 00:58:33 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> References: <201609150741.u8F7fmcM059138@repo.freebsd.org> To: Kevin Lo X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 07:58:35 -0000 --Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 15, 2016, at 00:41, Kevin Lo wrote: >=20 > Author: kevlo > Date: Thu Sep 15 07:41:48 2016 > New Revision: 305824 > URL: https://svnweb.freebsd.org/changeset/base/305824 >=20 > Log: > Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. >=20 > Reviewed by: gnn > Differential Revision: https://reviews.freebsd.org/D7878 >=20 > Modified: > head/sys/contrib/ipfilter/netinet/fil.c > head/sys/contrib/ipfilter/netinet/ip_compat.h > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > head/sys/kern/uipc_socket.c > head/sys/net/if_arcsubr.c > head/sys/net/if_fddisubr.c > head/sys/net/if_iso88025subr.c > head/sys/net/raw_usrreq.c > head/sys/netinet/ip_input.c > head/sys/netinet/ip_mroute.c > head/sys/netinet/raw_ip.c > head/sys/netinet/tcp_output.c > head/sys/netinet/udp_usrreq.c > head/sys/netinet6/icmp6.c > head/sys/netinet6/ip6_forward.c > head/sys/netinet6/ip6_mroute.c > head/sys/netinet6/ip6_output.c > head/sys/netinet6/raw_ip6.c > head/sys/netinet6/udp6_usrreq.c > head/sys/netipsec/keysock.c > head/sys/sys/mbuf.h Bump __FreeBSD_version for the change (just in case something=E2=80=99s = using the #define elsewhere)? Thanks! -Ngie --Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E 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 iQIcBAEBCgAGBQJX2lSqAAoJEPWDqSZpMIYVaa8QAMhuiL4uauFoOOHNqcQTAe0d wvyrPM0VQST8CMoPizMPsYmV4fbglVLEOIPOu4xUYnJ+NJLyRew0A9nkOah/+DJ7 /WpD4dRCcBKI3DIcBm88FcL4/hkH+Q8O4Ps5TWVqp5ibR96XWwz0TiSWq5ke01Tw nK67uo1rUuQq6jFi2H1fsiMXj9EcVl2bKgoQARu3sZi3iIPmceeQd5GC6mHVSbT6 N/D1PuCmx4cBm/YXAJSO/OmkfWyui9Ru1QILvMuMyvzKwuOWb1bSPUFZbZlXb/TK t8NQmH9Aj+BdTjkFNBqxIw85e2Aj+dSH+cVps2hDu0IgZkTkXqBspNtxgdxzj2hi rWSdeUeX3/fOQoHK4QRxqQ15mzP7Ms+LmA7DptSKC6b7l95+qYGmut/7ekgm5MVc Q5bWbOgKfsaTMKBMu7iq4wp7IFtz2PEozven9hi04FVfgtvXI6NrkJM5pa2BbUCu rK6ukL4/JyGsO30ZlDvYrRxlg0IzDsRgKvsyGDZzA38BN5NnaNgPRCHHDTIlIcam PzgLif18/g1lZWvmTUWLIubQry4PDmNUn5JrbvMNkpf2e0cCW0Eij/LMFV6bQE0R IbQV0UuiJWni+fBH/ruJgSxDTgiUO3gdYyGuE5WT49HFlUMIhE8j6w5tddvm4KFC h583qEsej8Grg/sP6xjR =11OA -----END PGP SIGNATURE----- --Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E-- From owner-svn-src-all@freebsd.org Thu Sep 15 08:25:14 2016 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 CF0FEBDC155; Thu, 15 Sep 2016 08:25:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F3341305; Thu, 15 Sep 2016 08:25:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8PDDK075097; Thu, 15 Sep 2016 08:25:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8PDiN075096; Thu, 15 Sep 2016 08:25:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609150825.u8F8PDiN075096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 15 Sep 2016 08:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305825 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:25:14 -0000 Author: kib Date: Thu Sep 15 08:25:13 2016 New Revision: 305825 URL: https://svnweb.freebsd.org/changeset/base/305825 Log: MFC r305744: Fix typo in comment. Modified: stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Thu Sep 15 07:41:48 2016 (r305824) +++ stable/11/sys/x86/x86/identcpu.c Thu Sep 15 08:25:13 2016 (r305825) @@ -1725,7 +1725,7 @@ print_AMD_info(void) * As long as that bug pops up very rarely (intensive machine usage * on other operating systems generally generates one unexplainable * crash any 2 months) and as long as a model specific fix would be - * impratical at this stage, print out a warning string if the broken + * impractical at this stage, print out a warning string if the broken * model and family are identified. */ if (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x20 && From owner-svn-src-all@freebsd.org Thu Sep 15 08:27:00 2016 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 CFB60BDC1D1; Thu, 15 Sep 2016 08:27:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8C214BC; Thu, 15 Sep 2016 08:27:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8Qx65075210; Thu, 15 Sep 2016 08:26:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8QxH7075209; Thu, 15 Sep 2016 08:26:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609150826.u8F8QxH7075209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 15 Sep 2016 08:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305826 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:27:00 -0000 Author: kib Date: Thu Sep 15 08:26:59 2016 New Revision: 305826 URL: https://svnweb.freebsd.org/changeset/base/305826 Log: MFC r305744: Fix typo in comment. Modified: stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Thu Sep 15 08:25:13 2016 (r305825) +++ stable/10/sys/x86/x86/identcpu.c Thu Sep 15 08:26:59 2016 (r305826) @@ -1683,7 +1683,7 @@ print_AMD_info(void) * As long as that bug pops up very rarely (intensive machine usage * on other operating systems generally generates one unexplainable * crash any 2 months) and as long as a model specific fix would be - * impratical at this stage, print out a warning string if the broken + * impractical at this stage, print out a warning string if the broken * model and family are identified. */ if (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x20 && From owner-svn-src-all@freebsd.org Thu Sep 15 08:30:49 2016 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 12C8FBDC248; Thu, 15 Sep 2016 08:30:49 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7E4D1698; Thu, 15 Sep 2016 08:30:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8UmSj076058; Thu, 15 Sep 2016 08:30:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8UmxS076057; Thu, 15 Sep 2016 08:30:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609150830.u8F8UmxS076057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 15 Sep 2016 08:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305827 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:30:49 -0000 Author: np Date: Thu Sep 15 08:30:47 2016 New Revision: 305827 URL: https://svnweb.freebsd.org/changeset/base/305827 Log: cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields to use in tx work requests. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Sep 15 08:26:59 2016 (r305826) +++ head/sys/dev/cxgbe/t4_sge.c Thu Sep 15 08:30:47 2016 (r305827) @@ -3253,8 +3253,9 @@ alloc_nm_txq(struct vi_info *vi, struct nm_txq->nid = idx; nm_txq->iqidx = iqidx; nm_txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) | - V_TXPKT_VF(vi->viid)); + V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | + V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | + V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, @@ -3620,8 +3621,10 @@ alloc_txq(struct vi_info *vi, struct sge V_TXPKT_INTF(pi->tx_chan)); else txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) | - V_TXPKT_VF(vi->viid)); + V_TXPKT_INTF(pi->tx_chan) | + V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | + V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | + V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); txq->tc_idx = -1; txq->sdesc = malloc(eq->sidx * sizeof(struct tx_sdesc), M_CXGBE, M_ZERO | M_WAITOK); From owner-svn-src-all@freebsd.org Thu Sep 15 08:34:17 2016 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 DD434BDC40A; Thu, 15 Sep 2016 08:34:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD8551C0C; Thu, 15 Sep 2016 08:34:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8YGOR079022; Thu, 15 Sep 2016 08:34:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8YGf7079021; Thu, 15 Sep 2016 08:34:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609150834.u8F8YGf7079021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Sep 2016 08:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305828 - stable/11/sys/dev/usb/input X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:34:18 -0000 Author: hselasky Date: Thu Sep 15 08:34:16 2016 New Revision: 305828 URL: https://svnweb.freebsd.org/changeset/base/305828 Log: MFC r305590: Correctly map the USB mouse tilt delta values into buttons 5 and 6 instead of 3 and 4 which is used for the scroll wheel, according to X.org. PR: 170358 Modified: stable/11/sys/dev/usb/input/ums.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/input/ums.c ============================================================================== --- stable/11/sys/dev/usb/input/ums.c Thu Sep 15 08:30:47 2016 (r305827) +++ stable/11/sys/dev/usb/input/ums.c Thu Sep 15 08:34:16 2016 (r305828) @@ -288,9 +288,9 @@ ums_intr_callback(struct usb_xfer *xfer, /* translate T-axis into button presses until further */ if (dt > 0) - buttons |= 1UL << 3; + buttons |= 1UL << 5; else if (dt < 0) - buttons |= 1UL << 4; + buttons |= 1UL << 6; sc->sc_status.button = buttons; sc->sc_status.dx += dx; From owner-svn-src-all@freebsd.org Thu Sep 15 08:35:47 2016 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 97F34BDC4C1; Thu, 15 Sep 2016 08:35:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67A061DE7; Thu, 15 Sep 2016 08:35:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8ZkUE079147; Thu, 15 Sep 2016 08:35:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8ZkXw079146; Thu, 15 Sep 2016 08:35:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609150835.u8F8ZkXw079146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Sep 2016 08:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305829 - stable/10/sys/dev/usb/input 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:35:47 -0000 Author: hselasky Date: Thu Sep 15 08:35:46 2016 New Revision: 305829 URL: https://svnweb.freebsd.org/changeset/base/305829 Log: MFC r305590: Correctly map the USB mouse tilt delta values into buttons 5 and 6 instead of 3 and 4 which is used for the scroll wheel, according to X.org. PR: 170358 Modified: stable/10/sys/dev/usb/input/ums.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/ums.c ============================================================================== --- stable/10/sys/dev/usb/input/ums.c Thu Sep 15 08:34:16 2016 (r305828) +++ stable/10/sys/dev/usb/input/ums.c Thu Sep 15 08:35:46 2016 (r305829) @@ -288,9 +288,9 @@ ums_intr_callback(struct usb_xfer *xfer, /* translate T-axis into button presses until further */ if (dt > 0) - buttons |= 1UL << 3; + buttons |= 1UL << 5; else if (dt < 0) - buttons |= 1UL << 4; + buttons |= 1UL << 6; sc->sc_status.button = buttons; sc->sc_status.dx += dx; From owner-svn-src-all@freebsd.org Thu Sep 15 08:37:21 2016 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 8384CBDC546; Thu, 15 Sep 2016 08:37:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53E2F1F8C; Thu, 15 Sep 2016 08:37:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8bKnx079269; Thu, 15 Sep 2016 08:37:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8bKdo079268; Thu, 15 Sep 2016 08:37:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609150837.u8F8bKdo079268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Sep 2016 08:37:20 +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: r305830 - stable/9/sys/dev/usb/input 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:37:21 -0000 Author: hselasky Date: Thu Sep 15 08:37:20 2016 New Revision: 305830 URL: https://svnweb.freebsd.org/changeset/base/305830 Log: MFC r305590: Correctly map the USB mouse tilt delta values into buttons 5 and 6 instead of 3 and 4 which is used for the scroll wheel, according to X.org. PR: 170358 Modified: stable/9/sys/dev/usb/input/ums.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/input/ums.c ============================================================================== --- stable/9/sys/dev/usb/input/ums.c Thu Sep 15 08:35:46 2016 (r305829) +++ stable/9/sys/dev/usb/input/ums.c Thu Sep 15 08:37:20 2016 (r305830) @@ -288,9 +288,9 @@ ums_intr_callback(struct usb_xfer *xfer, /* translate T-axis into button presses until further */ if (dt > 0) - buttons |= 1UL << 3; + buttons |= 1UL << 5; else if (dt < 0) - buttons |= 1UL << 4; + buttons |= 1UL << 6; sc->sc_status.button = buttons; sc->sc_status.dx += dx; From owner-svn-src-all@freebsd.org Thu Sep 15 08:38:54 2016 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 C9B9ABDC5D9; Thu, 15 Sep 2016 08:38:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEE71139; Thu, 15 Sep 2016 08:38:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F8crGX079383; Thu, 15 Sep 2016 08:38:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8cr6L079382; Thu, 15 Sep 2016 08:38:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609150838.u8F8cr6L079382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Sep 2016 08:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r305831 - stable/8/sys/dev/usb/input X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 08:38:54 -0000 Author: hselasky Date: Thu Sep 15 08:38:53 2016 New Revision: 305831 URL: https://svnweb.freebsd.org/changeset/base/305831 Log: MFC r305590: Correctly map the USB mouse tilt delta values into buttons 5 and 6 instead of 3 and 4 which is used for the scroll wheel, according to X.org. PR: 170358 Modified: stable/8/sys/dev/usb/input/ums.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/input/ums.c ============================================================================== --- stable/8/sys/dev/usb/input/ums.c Thu Sep 15 08:37:20 2016 (r305830) +++ stable/8/sys/dev/usb/input/ums.c Thu Sep 15 08:38:53 2016 (r305831) @@ -288,9 +288,9 @@ ums_intr_callback(struct usb_xfer *xfer, /* translate T-axis into button presses until further */ if (dt > 0) - buttons |= 1UL << 3; + buttons |= 1UL << 5; else if (dt < 0) - buttons |= 1UL << 4; + buttons |= 1UL << 6; sc->sc_status.button = buttons; sc->sc_status.dx += dx; From owner-svn-src-all@freebsd.org Thu Sep 15 13:16:28 2016 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 2707BBDB284; Thu, 15 Sep 2016 13:16:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7D85946; Thu, 15 Sep 2016 13:16:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FDGRBI085034; Thu, 15 Sep 2016 13:16:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FDGL5c084975; Thu, 15 Sep 2016 13:16:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151316.u8FDGL5c084975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 13:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305832 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 13:16:28 -0000 Author: emaste Date: Thu Sep 15 13:16:20 2016 New Revision: 305832 URL: https://svnweb.freebsd.org/changeset/base/305832 Log: Renumber license clauses in sys/kern to avoid skipping #3 Modified: head/sys/kern/kern_acct.c head/sys/kern/kern_clock.c head/sys/kern/kern_cons.c head/sys/kern/kern_descrip.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_lockf.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mib.c head/sys/kern/kern_proc.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/kern_sendfile.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/kern/kern_synch.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_time.c head/sys/kern/kern_timeout.c head/sys/kern/kern_xxx.c head/sys/kern/sched_4bsd.c head/sys/kern/subr_autoconf.c head/sys/kern/subr_blist.c head/sys/kern/subr_clock.c head/sys/kern/subr_hash.c head/sys/kern/subr_log.c head/sys/kern/subr_mchain.c head/sys/kern/subr_param.c head/sys/kern/subr_pcpu.c head/sys/kern/subr_prf.c head/sys/kern/subr_prof.c head/sys/kern/subr_rtc.c head/sys/kern/subr_scanf.c head/sys/kern/subr_uio.c head/sys/kern/sys_generic.c head/sys/kern/sys_socket.c head/sys/kern/tty_compat.c head/sys/kern/tty_info.c head/sys/kern/uipc_domain.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/kern/vfs_export.c head/sys/kern/vfs_init.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_acct.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_clock.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_cons.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_descrip.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_exit.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_fork.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_ktrace.c Thu Sep 15 13:16:20 2016 (r305832) @@ -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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_lockf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -39,7 +39,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_malloc.c Thu Sep 15 13:16:20 2016 (r305832) @@ -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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_mib.c Thu Sep 15 13:16:20 2016 (r305832) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_proc.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_prot.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_resource.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_sendfile.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_shutdown.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_sig.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_synch.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_sysctl.c Thu Sep 15 13:16:20 2016 (r305832) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_time.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_timeout.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/kern_xxx.c ============================================================================== --- head/sys/kern/kern_xxx.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_xxx.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/sched_4bsd.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_autoconf.c ============================================================================== --- head/sys/kern/subr_autoconf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_autoconf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -14,7 +14,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_blist.c Thu Sep 15 13:16:20 2016 (r305832) @@ -8,7 +8,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_clock.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_hash.c ============================================================================== --- head/sys/kern/subr_hash.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_hash.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_log.c ============================================================================== --- head/sys/kern/subr_log.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_log.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_mchain.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the author nor the names of any co-contributors + * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_param.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_pcpu.c Thu Sep 15 13:16:20 2016 (r305832) @@ -14,7 +14,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. - * 4. Neither the name of the author nor the names of any co-contributors + * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_prf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_prof.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_rtc.c Thu Sep 15 13:16:20 2016 (r305832) @@ -20,7 +20,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_scanf.c ============================================================================== --- head/sys/kern/subr_scanf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_scanf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -13,7 +13,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_uio.c Thu Sep 15 13:16:20 2016 (r305832) @@ -20,7 +20,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/sys_generic.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/sys_socket.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/tty_compat.c ============================================================================== --- head/sys/kern/tty_compat.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/tty_compat.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/tty_info.c Thu Sep 15 13:16:20 2016 (r305832) @@ -23,7 +23,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_domain.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_mbuf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_mbuf2.c Thu Sep 15 13:16:20 2016 (r305832) @@ -41,7 +41,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_sockbuf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_socket.c Thu Sep 15 13:16:20 2016 (r305832) @@ -13,7 +13,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_syscalls.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_usrreq.c Thu Sep 15 13:16:20 2016 (r305832) @@ -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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_cache.c Thu Sep 15 13:16:20 2016 (r305832) @@ -13,7 +13,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_cluster.c Thu Sep 15 13:16:20 2016 (r305832) @@ -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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_default.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_export.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_init.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_lookup.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_mount.c Thu Sep 15 13:16:20 2016 (r305832) @@ -17,7 +17,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_mountroot.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_subr.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_syscalls.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_vnops.c Thu Sep 15 13:16:20 2016 (r305832) @@ -21,7 +21,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vnode_if.src Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # From owner-svn-src-all@freebsd.org Thu Sep 15 13:40:37 2016 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 DDAD4BDBB0B; Thu, 15 Sep 2016 13:40:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C3FFF9; Thu, 15 Sep 2016 13:40:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FDea9V092760; Thu, 15 Sep 2016 13:40:36 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FDea0k092759; Thu, 15 Sep 2016 13:40:36 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609151340.u8FDea0k092759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 15 Sep 2016 13:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305833 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 13:40:38 -0000 Author: kevlo Date: Thu Sep 15 13:40:36 2016 New Revision: 305833 URL: https://svnweb.freebsd.org/changeset/base/305833 Log: Bump __FreeBSD_version for r305824. Suggested by: ngie Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Sep 15 13:16:20 2016 (r305832) +++ head/sys/sys/param.h Thu Sep 15 13:40:36 2016 (r305833) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200007 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200008 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Sep 15 13:46:35 2016 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 DB6C8BDBE8E; Thu, 15 Sep 2016 13:46:35 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC25957; Thu, 15 Sep 2016 13:46:34 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.15.2/8.15.2) with ESMTPS id u8FDkIki009007 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Sep 2016 21:46:19 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.15.2/8.15.2/Submit) id u8FDkILK009006; Thu, 15 Sep 2016 21:46:18 +0800 (CST) (envelope-from kevlo) Date: Thu, 15 Sep 2016 21:46:18 +0800 From: Kevin Lo To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys Message-ID: <20160915134618.GA8952@ns.kevlo.org> References: <201609150741.u8F7fmcM059138@repo.freebsd.org> <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 13:46:36 -0000 On Thu, Sep 15, 2016 at 12:58:33AM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Sep 15, 2016, at 00:41, Kevin Lo wrote: > > > > Author: kevlo > > Date: Thu Sep 15 07:41:48 2016 > > New Revision: 305824 > > URL: https://svnweb.freebsd.org/changeset/base/305824 > > > > Log: > > Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. > > > > Reviewed by: gnn > > Differential Revision: https://reviews.freebsd.org/D7878 > > > > Modified: > > head/sys/contrib/ipfilter/netinet/fil.c > > head/sys/contrib/ipfilter/netinet/ip_compat.h > > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > > head/sys/kern/uipc_socket.c > > head/sys/net/if_arcsubr.c > > head/sys/net/if_fddisubr.c > > head/sys/net/if_iso88025subr.c > > head/sys/net/raw_usrreq.c > > head/sys/netinet/ip_input.c > > head/sys/netinet/ip_mroute.c > > head/sys/netinet/raw_ip.c > > head/sys/netinet/tcp_output.c > > head/sys/netinet/udp_usrreq.c > > head/sys/netinet6/icmp6.c > > head/sys/netinet6/ip6_forward.c > > head/sys/netinet6/ip6_mroute.c > > head/sys/netinet6/ip6_output.c > > head/sys/netinet6/raw_ip6.c > > head/sys/netinet6/udp6_usrreq.c > > head/sys/netipsec/keysock.c > > head/sys/sys/mbuf.h > > Bump __FreeBSD_version for the change (just in case something’s using the #define elsewhere)? Bumped(r305833), thanks. > Thanks! > -Ngie From owner-svn-src-all@freebsd.org Thu Sep 15 13:57:38 2016 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 92BF8BDB244; Thu, 15 Sep 2016 13:57:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628371FD; Thu, 15 Sep 2016 13:57:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FDvbsQ000199; Thu, 15 Sep 2016 13:57:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FDvb4r000198; Thu, 15 Sep 2016 13:57:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201609151357.u8FDvb4r000198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 15 Sep 2016 13:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305834 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 13:57:38 -0000 Author: trasz Date: Thu Sep 15 13:57:37 2016 New Revision: 305834 URL: https://svnweb.freebsd.org/changeset/base/305834 Log: Change the getnewvnode(9) tag for nullfs from "null" to "nullfs". It's more consistent, and besides, the "null" alone looks weird. MFC after: 1 month Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Thu Sep 15 13:40:36 2016 (r305833) +++ head/sys/fs/nullfs/null_subr.c Thu Sep 15 13:57:37 2016 (r305834) @@ -238,7 +238,7 @@ null_nodeget(mp, lowervp, vpp) */ xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK); - error = getnewvnode("null", mp, &null_vnodeops, &vp); + error = getnewvnode("nullfs", mp, &null_vnodeops, &vp); if (error) { vput(lowervp); free(xp, M_NULLFSNODE); From owner-svn-src-all@freebsd.org Thu Sep 15 17:05:56 2016 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 84715BDA921; Thu, 15 Sep 2016 17:05:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 486EBD48; Thu, 15 Sep 2016 17:05:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FH5tuV073646; Thu, 15 Sep 2016 17:05:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FH5sKY073637; Thu, 15 Sep 2016 17:05:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609151705.u8FH5sKY073637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Sep 2016 17:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305836 - in head/sys: amd64/amd64 amd64/include compat/linprocfs i386/include x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:05:56 -0000 Author: jhb Date: Thu Sep 15 17:05:54 2016 New Revision: 305836 URL: https://svnweb.freebsd.org/changeset/base/305836 Log: Remove 'cpu' and 'cpu_class' on amd64. The 'cpu' and 'cpu_class' variables were always set to the same value on amd64 and are legacy holdovers from i386. Remove them entirely on amd64. Reviewed by: imp, kib (older version) Differential Revision: https://reviews.freebsd.org/D7888 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/cputypes.h head/sys/compat/linprocfs/linprocfs.c head/sys/i386/include/cputypes.h head/sys/i386/include/md_var.h head/sys/x86/include/cputypes.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/amd64/amd64/machdep.c Thu Sep 15 17:05:54 2016 (r305836) @@ -269,7 +269,6 @@ cpu_startup(dummy) */ startrtclock(); printcpuinfo(); - panicifcpuunsupported(); /* * Display physical memory if SMBIOS reports reasonable amount. Modified: head/sys/amd64/include/cputypes.h ============================================================================== --- head/sys/amd64/include/cputypes.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/amd64/include/cputypes.h Thu Sep 15 17:05:54 2016 (r305836) @@ -1,48 +1,6 @@ /*- - * Copyright (c) 1993 Christopher G. Demetriou - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ - -#ifndef _MACHINE_CPUTYPES_H_ -#define _MACHINE_CPUTYPES_H_ +/* $FreeBSD$ */ #include - -/* - * Classes of processor. - */ -#define CPUCLASS_X86 0 /* X86 */ -#define CPUCLASS_K8 1 /* K8 AMD64 class */ - -/* - * Kinds of processor. - */ -#define CPU_X86 0 /* Intel */ -#define CPU_CLAWHAMMER 1 /* AMD Clawhammer */ -#define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */ - -#endif /* !_MACHINE_CPUTYPES_H_ */ Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/compat/linprocfs/linprocfs.c Thu Sep 15 17:05:54 2016 (r305836) @@ -218,7 +218,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) char model[128]; uint64_t freq; size_t size; - int class, fqmhz, fqkhz; + int fqmhz, fqkhz; int i; /* @@ -235,33 +235,6 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "3dnowext", "3dnow" }; - switch (cpu_class) { -#ifdef __i386__ - case CPUCLASS_286: - class = 2; - break; - case CPUCLASS_386: - class = 3; - break; - case CPUCLASS_486: - class = 4; - break; - case CPUCLASS_586: - class = 5; - break; - case CPUCLASS_686: - class = 6; - break; - default: - class = 0; - break; -#else /* __amd64__ */ - default: - class = 15; - break; -#endif - } - hw_model[0] = CTL_HW; hw_model[1] = HW_MODEL; model[0] = '\0'; @@ -286,7 +259,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) #ifdef __i386__ switch (cpu_vendor_id) { case CPU_VENDOR_AMD: - if (class < 6) + if (cpu_class < CPUCLASS_686) flags[16] = "fcmov"; break; case CPU_VENDOR_CYRIX: Modified: head/sys/i386/include/cputypes.h ============================================================================== --- head/sys/i386/include/cputypes.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/i386/include/cputypes.h Thu Sep 15 17:05:54 2016 (r305836) @@ -63,4 +63,9 @@ #define CPU_P4 16 /* Intel Pentium 4 */ #define CPU_GEODE1100 17 /* NS Geode SC1100 */ +#ifndef LOCORE +extern int cpu; +extern int cpu_class; +#endif + #endif /* !_MACHINE_CPUTYPES_H_ */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/i386/include/md_var.h Thu Sep 15 17:05:54 2016 (r305836) @@ -65,6 +65,7 @@ void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); vm_paddr_t kvtop(void *addr); +void panicifcpuunsupported(void); void ppro_reenable_apic(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); Modified: head/sys/x86/include/cputypes.h ============================================================================== --- head/sys/x86/include/cputypes.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/x86/include/cputypes.h Thu Sep 15 17:05:54 2016 (r305836) @@ -46,9 +46,4 @@ #define CPU_VENDOR_RISE 0xdead2bad /* Rise */ #define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT -#ifndef LOCORE -extern int cpu; -extern int cpu_class; -#endif - #endif /* !_X86_CPUTYPES_H_ */ Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/x86/include/x86_var.h Thu Sep 15 17:05:54 2016 (r305836) @@ -107,7 +107,6 @@ bool fix_cpuid(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); -void panicifcpuunsupported(void); void pagecopy(void *from, void *to); void printcpuinfo(void); int user_dbreg_trap(void); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/x86/x86/identcpu.c Thu Sep 15 17:05:54 2016 (r305836) @@ -87,8 +87,10 @@ static void print_svm_info(void); static void print_via_padlock_info(void); static void print_vmx_info(void); +#ifdef __i386__ int cpu; /* Are we 386, 386sx, 486, etc? */ int cpu_class; +#endif u_int cpu_feature; /* Feature flags */ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ @@ -184,13 +186,11 @@ static const char *cpu_brandtable[MAX_BR NULL, "Intel Pentium 4" }; -#endif static struct { char *cpu_name; int cpu_class; } cpus[] = { -#ifdef __i386__ { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ { "i386DX", CPUCLASS_386 }, /* CPU_386 */ @@ -208,11 +208,8 @@ static struct { { "Pentium II", CPUCLASS_686 }, /* CPU_PII */ { "Pentium III", CPUCLASS_686 }, /* CPU_PIII */ { "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */ -#else - { "Clawhammer", CPUCLASS_K8 }, /* CPU_CLAWHAMMER */ - { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */ -#endif }; +#endif static struct { char *vendor; @@ -242,9 +239,13 @@ printcpuinfo(void) u_int regs[4], i; char *brand; - cpu_class = cpus[cpu].cpu_class; printf("CPU: "); +#ifdef __i386__ + cpu_class = cpus[cpu].cpu_class; strncpy(cpu_model, cpus[cpu].cpu_name, sizeof (cpu_model)); +#else + strncpy(cpu_model, "Hammer", sizeof (cpu_model)); +#endif /* Check for extended CPUID information and a processor name. */ if (cpu_exthigh >= 0x80000004) { @@ -697,8 +698,8 @@ printcpuinfo(void) (intmax_t)(tsc_freq + 4999) / 1000000, (u_int)((tsc_freq + 4999) / 10000) % 100); } - switch(cpu_class) { #ifdef __i386__ + switch(cpu_class) { case CPUCLASS_286: printf("286"); break; @@ -720,14 +721,12 @@ printcpuinfo(void) printf("686"); break; #endif -#else - case CPUCLASS_K8: - printf("K8"); - break; -#endif default: printf("Unknown"); /* will panic below... */ } +#else + printf("K8"); +#endif printf("-class CPU)\n"); if (*cpu_vendor) printf(" Origin=\"%s\"", cpu_vendor); @@ -1051,28 +1050,22 @@ printcpuinfo(void) print_hypervisor_info(); } +#ifdef __i386__ void panicifcpuunsupported(void) { -#ifdef __i386__ #if !defined(lint) #if !defined(I486_CPU) && !defined(I586_CPU) && !defined(I686_CPU) #error This kernel is not configured for one of the supported CPUs #endif #else /* lint */ #endif /* lint */ -#else /* __amd64__ */ -#ifndef HAMMER -#error "You need to specify a cpu type" -#endif -#endif /* * Now that we have told the user what they have, * let them know if that machine type isn't configured. */ switch (cpu_class) { -#ifdef __i386__ case CPUCLASS_286: /* a 286 should not make it this far, anyway */ case CPUCLASS_386: #if !defined(I486_CPU) @@ -1084,19 +1077,12 @@ panicifcpuunsupported(void) #if !defined(I686_CPU) case CPUCLASS_686: #endif -#else /* __amd64__ */ - case CPUCLASS_X86: -#ifndef HAMMER - case CPUCLASS_K8: -#endif -#endif panic("CPU class not configured"); default: break; } } -#ifdef __i386__ static volatile u_int trap_by_rdmsr; /* @@ -1580,9 +1566,6 @@ identify_cpu(void) return; } } -#else - /* XXX */ - cpu = CPU_CLAWHAMMER; #endif } From owner-svn-src-all@freebsd.org Thu Sep 15 17:22:37 2016 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 1696DBDAD97; Thu, 15 Sep 2016 17:22:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D76A57F8; Thu, 15 Sep 2016 17:22:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHMaoG081139; Thu, 15 Sep 2016 17:22:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHMa1b081138; Thu, 15 Sep 2016 17:22:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151722.u8FHMa1b081138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305837 - stable/11/contrib/elftoolchain/readelf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:22:37 -0000 Author: emaste Date: Thu Sep 15 17:22:35 2016 New Revision: 305837 URL: https://svnweb.freebsd.org/changeset/base/305837 Log: MFC r303674: readelf: report ARM program and section header types Modified: stable/11/contrib/elftoolchain/readelf/readelf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/11/contrib/elftoolchain/readelf/readelf.c Thu Sep 15 17:05:54 2016 (r305836) +++ stable/11/contrib/elftoolchain/readelf/readelf.c Thu Sep 15 17:22:35 2016 (r305837) @@ -343,7 +343,7 @@ static const char *note_type_openbsd(uns static const char *note_type_unknown(unsigned int nt); static const char *note_type_xen(unsigned int nt); static const char *option_kind(uint8_t kind); -static const char *phdr_type(unsigned int ptype); +static const char *phdr_type(unsigned int mach, unsigned int ptype); static const char *ppc_abi_fp(uint64_t fp); static const char *ppc_abi_vector(uint64_t vec); static void readelf_usage(int status); @@ -622,10 +622,24 @@ elf_ver(unsigned int ver) } static const char * -phdr_type(unsigned int ptype) +phdr_type(unsigned int mach, unsigned int ptype) { static char s_ptype[32]; + if (ptype >= PT_LOPROC && ptype <= PT_HIPROC) { + switch (mach) { + case EM_ARM: + switch (ptype) { + case PT_ARM_ARCHEXT: return "ARM_ARCHEXT"; + case PT_ARM_EXIDX: return "ARM_EXIDX"; + } + break; + } + snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x", + ptype - PT_LOPROC); + return (s_ptype); + } + switch (ptype) { case PT_NULL: return "NULL"; case PT_LOAD: return "LOAD"; @@ -639,10 +653,7 @@ phdr_type(unsigned int ptype) case PT_GNU_STACK: return "GNU_STACK"; case PT_GNU_RELRO: return "GNU_RELRO"; default: - if (ptype >= PT_LOPROC && ptype <= PT_HIPROC) - snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x", - ptype - PT_LOPROC); - else if (ptype >= PT_LOOS && ptype <= PT_HIOS) + if (ptype >= PT_LOOS && ptype <= PT_HIOS) snprintf(s_ptype, sizeof(s_ptype), "LOOS+%#x", ptype - PT_LOOS); else @@ -659,6 +670,15 @@ section_type(unsigned int mach, unsigned if (stype >= SHT_LOPROC && stype <= SHT_HIPROC) { switch (mach) { + case EM_ARM: + switch (stype) { + case SHT_ARM_EXIDX: return "ARM_EXIDX"; + case SHT_ARM_PREEMPTMAP: return "ARM_PREEMPTMAP"; + case SHT_ARM_ATTRIBUTES: return "ARM_ATTRIBUTES"; + case SHT_ARM_DEBUGOVERLAY: return "ARM_DEBUGOVERLAY"; + case SHT_ARM_OVERLAYSECTION: return "ARM_OVERLAYSECTION"; + } + break; case EM_X86_64: switch (stype) { case SHT_X86_64_UNWIND: return "X86_64_UNWIND"; @@ -2273,9 +2293,10 @@ dump_phdr(struct readelf *re) #define PH_HDR "Type", "Offset", "VirtAddr", "PhysAddr", "FileSiz", \ "MemSiz", "Flg", "Align" -#define PH_CT phdr_type(phdr.p_type), (uintmax_t)phdr.p_offset, \ - (uintmax_t)phdr.p_vaddr, (uintmax_t)phdr.p_paddr, \ - (uintmax_t)phdr.p_filesz, (uintmax_t)phdr.p_memsz, \ +#define PH_CT phdr_type(re->ehdr.e_machine, phdr.p_type), \ + (uintmax_t)phdr.p_offset, (uintmax_t)phdr.p_vaddr, \ + (uintmax_t)phdr.p_paddr, (uintmax_t)phdr.p_filesz, \ + (uintmax_t)phdr.p_memsz, \ phdr.p_flags & PF_R ? 'R' : ' ', \ phdr.p_flags & PF_W ? 'W' : ' ', \ phdr.p_flags & PF_X ? 'E' : ' ', \ From owner-svn-src-all@freebsd.org Thu Sep 15 17:23:15 2016 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 F2FF1BDAE03; Thu, 15 Sep 2016 17:23:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C534995E; Thu, 15 Sep 2016 17:23:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHNFF3081221; Thu, 15 Sep 2016 17:23:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHNFeM081220; Thu, 15 Sep 2016 17:23:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151723.u8FHNFeM081220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305838 - stable/11/contrib/elftoolchain/elfcopy X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:23:16 -0000 Author: emaste Date: Thu Sep 15 17:23:14 2016 New Revision: 305838 URL: https://svnweb.freebsd.org/changeset/base/305838 Log: MFC r304151: elfcopy: silence GCC 5.3 unitialized variable warning Although it's a false positive there is little cost to initializing it always. Modified: stable/11/contrib/elftoolchain/elfcopy/ascii.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/ascii.c Thu Sep 15 17:22:35 2016 (r305837) +++ stable/11/contrib/elftoolchain/elfcopy/ascii.c Thu Sep 15 17:23:14 2016 (r305838) @@ -251,6 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { + sz = 0; /* Silence GCC 5.3 unintialized variable warning */ if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { From owner-svn-src-all@freebsd.org Thu Sep 15 17:24:12 2016 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 5EA93BDAE92; Thu, 15 Sep 2016 17:24:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30E5EADB; Thu, 15 Sep 2016 17:24:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHOBO8081306; Thu, 15 Sep 2016 17:24:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHOBnd081304; Thu, 15 Sep 2016 17:24:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151724.u8FHOBnd081304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305839 - stable/11/contrib/elftoolchain/libelftc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:24:12 -0000 Author: emaste Date: Thu Sep 15 17:24:11 2016 New Revision: 305839 URL: https://svnweb.freebsd.org/changeset/base/305839 Log: MFC r304160: elfcopy: add elf64-littleaarch64 output target support Modified: stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Thu Sep 15 17:23:14 2016 (r305838) +++ stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Thu Sep 15 17:24:11 2016 (r305839) @@ -89,6 +89,7 @@ Known descriptor names and their propert .It Li elf64-ia64-big Ta ELF Ta MSB Ta 64 .It Li elf64-ia64-little Ta ELF Ta LSB Ta 64 .It Li elf64-little Ta ELF Ta LSB Ta 64 +.It Li elf64-littleaarch64 Ta ELF Ta LSB Ta 64 .It Li elf64-littlemips Ta ELF Ta LSB Ta 64 .It Li elf64-powerpc Ta ELF Ta MSB Ta 64 .It Li elf64-powerpcle Ta ELF Ta LSB Ta 64 Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Thu Sep 15 17:23:14 2016 (r305838) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Thu Sep 15 17:24:11 2016 (r305839) @@ -250,6 +250,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf64-littleaarch64", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_AARCH64, + }, + + { .bt_name = "elf64-littlemips", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, From owner-svn-src-all@freebsd.org Thu Sep 15 17:24:25 2016 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 4187BBDAEFE; Thu, 15 Sep 2016 17:24:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04D44CA7; Thu, 15 Sep 2016 17:24:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHOORM081374; Thu, 15 Sep 2016 17:24:24 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHONFq081367; Thu, 15 Sep 2016 17:24:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609151724.u8FHONFq081367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 15 Sep 2016 17:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305840 - in head/sys: amd64/amd64 amd64/include ddb i386/i386 i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:24:25 -0000 Author: bde Date: Thu Sep 15 17:24:23 2016 New Revision: 305840 URL: https://svnweb.freebsd.org/changeset/base/305840 Log: Abort single stepping in ddb if the trap is not for single-stepping. This is not very easy to do, since ddb didn't know when traps are for single-stepping. It more or less assumed that traps are either breakpoints or single-step, but even for x86 this became inadequate with the release of the i386 in ~1986, and FreeBSD passes it other trap types for NMIs and panics. On x86, teach ddb when a trap is for single stepping using the %dr6 register. Unknown traps are now treated almost the same as breakpoints instead of as the same as single-steps. Previously, the classification of breakpoints was almost correct and everything else was unknown so had to be treated as a single-step. Now the classification of single- steps is precise, the classification of breakpoints is almost correct (as before) and everything else is unknown and treated like a breakpoint. This fixes: - breakpoints not set by ddb, including the main one in kdb_enter(), were treated as single-steps and not stopped on when stepping (except for the usual, simple case of a step with residual count 1). As special cases, kdb_enter() didn't stop for fatal traps or panics - similarly for "hardware breakpoints". Use a new MD macro IS_SSTEP_TRAP(type, code) to code to classify single-steps. This is excessively complicated for bug-for-bug and backwards compatibilty. Design errors apparently started in Mach in ~1990 or perhaps in the FreeBSD interface in ~1993. Common trap types like single steps should have a unique MI code (like the TRAP* codes for user SIGTRAP) so that debuggers don't need macros like IS_SSTEP_TRAP() to decode them. But 'type' is actually an ambiguous MD trap number, and code was always 0 (now it is (int)%dr6 on x86). So it was impossible to determine the trap type from the args. Global variables had to be used. There is already a classification macro db_pc_is_single_step(), but this just gets in the way. It is only used to recover from bugs in IS_BREAKPOINT_TRAP(). On some arches, IS_BREAKPOINT_TRAP() just duplicates the ambiguity in 'type' and misclassifies single-steps as breakpoints. It defaults to 'false', which is the opposite of what is needed for bug-for-bug compatibility. When this is cleaned up, MI classification bits should be passed in 'code'. This could be done now for positive-logic bits, since 'code' was always 0, but some negative logic is needed for compatibility so a simple MI classificition is not usable yet. After reading %dr6, clear the single-step bit in it so that the type of the next debugger trap can be decoded. This is a little ddb-specific. ddb doesn't understand the need to clear this bit and doing it before calling kdb is easiest. gdb would need to reverse this to support hardware breakpoints, but it just doesn't support them now since gdbstub doesn't support %dr*. Fix a bug involving %dr6: when emulating a single-step trap for vm86, set the bit for it in %dr6. Userland debuggers need this. ddb now needs this for vm86 bios calls. The bit gets copied to 'code' then cleared again. Fix related style bugs: - when clearing bits for hardware breakpoints in %dr6, spell the mask as ~0xf on both amd64 and i386 to get the correct number of bits using sign extension and not need a comment about using the wrong mask on amd64 (amd64 traps for invalid results but clearing the reserved top bits didn't trap since they are 0). - rewrite my old wrong comments about using %dr6 for ddb watchpoints. Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/db_machdep.h head/sys/ddb/db_run.c head/sys/i386/i386/trap.c head/sys/i386/include/db_machdep.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/amd64/amd64/trap.c Thu Sep 15 17:24:23 2016 (r305840) @@ -176,6 +176,7 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; + register_t dr6; int i = 0, ucode = 0, code; u_int type; register_t addr = 0; @@ -540,8 +541,7 @@ trap(struct trapframe *frame) * Reset breakpoint bits because the * processor doesn't */ - /* XXX check upper bits here */ - load_dr6(rdr6() & 0xfffffff0); + load_dr6(rdr6() & ~0xf); goto out; } /* @@ -553,7 +553,10 @@ trap(struct trapframe *frame) * Otherwise, debugger traps "can't happen". */ #ifdef KDB - if (kdb_trap(type, 0, frame)) + /* XXX %dr6 is not quite reentrant. */ + dr6 = rdr6(); + load_dr6(dr6 & ~0x4000); + if (kdb_trap(type, dr6, frame)) goto out; #endif break; Modified: head/sys/amd64/include/db_machdep.h ============================================================================== --- head/sys/amd64/include/db_machdep.h Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/amd64/include/db_machdep.h Thu Sep 15 17:24:23 2016 (r305840) @@ -56,12 +56,16 @@ do { \ #define db_clear_single_step kdb_cpu_clear_singlestep #define db_set_single_step kdb_cpu_set_singlestep -#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) /* - * Watchpoints are not supported. The debug exception type is in %dr6 - * and not yet in the args to this macro. + * The debug exception type is copied from %dr6 to 'code' and used to + * disambiguate single step traps. Watchpoints have no special support. + * Our hardware breakpoints are not well integrated with ddb and are too + * different from watchpoints. ddb treats them as unknown traps with + * unknown addresses and doesn't turn them off while it is running. */ -#define IS_WATCHPOINT_TRAP(type, code) 0 +#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) +#define IS_SSTEP_TRAP(type, code) ((type) == T_TRCTRAP && (code) & 0x4000) +#define IS_WATCHPOINT_TRAP(type, code) 0 #define I_CALL 0xe8 #define I_CALLI 0xff Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/ddb/db_run.c Thu Sep 15 17:24:23 2016 (r305840) @@ -57,6 +57,7 @@ static int db_run_mode; #define STEP_INVISIBLE 5 #define STEP_COUNT 6 +static bool db_sstep_multiple; static bool db_sstep_print; static int db_loop_count; static int db_call_depth; @@ -133,7 +134,25 @@ db_stop_at_pc(int type, int code, bool * #endif } - *is_breakpoint = false; + *is_breakpoint = false; /* might be a breakpoint, but not ours */ + + /* + * If stepping, then abort if the trap type is unexpected. + * Breakpoints owned by us are expected and were handled above. + * Single-steps are expected and are handled below. All others + * are unexpected. + * + * If the MD layer doesn't tell us when it is stepping, use the + * bad historical default that all unexepected traps. + */ +#ifndef IS_SSTEP_TRAP +#define IS_SSTEP_TRAP(type, code) true +#endif + if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) { + printf("Stepping aborted\n"); + db_run_mode = STEP_NONE; + return (true); + } if (db_run_mode == STEP_INVISIBLE) { db_run_mode = STEP_CONTINUE; @@ -194,6 +213,7 @@ db_restart_at_pc(bool watchpt) db_addr_t pc = PC_REGS(); if ((db_run_mode == STEP_COUNT) || + ((db_run_mode == STEP_ONCE) && db_sstep_multiple) || (db_run_mode == STEP_RETURN) || (db_run_mode == STEP_CALLT)) { /* @@ -321,6 +341,7 @@ db_single_step_cmd(db_expr_t addr, bool db_run_mode = STEP_ONCE; db_loop_count = count; + db_sstep_multiple = (count != 1); db_sstep_print = print; db_inst_count = 0; db_load_count = 0; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/i386/i386/trap.c Thu Sep 15 17:24:23 2016 (r305840) @@ -189,6 +189,7 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; + register_t dr6; int i = 0, ucode = 0, code; u_int type; register_t addr = 0; @@ -362,6 +363,7 @@ user_trctrap_out: i = vm86_emulate((struct vm86frame *)frame); if (i == SIGTRAP) { type = T_TRCTRAP; + load_dr6(rdr6() | 0x4000); goto user_trctrap_out; } if (i == 0) @@ -572,6 +574,7 @@ user_trctrap_out: i = vm86_emulate((struct vm86frame *)frame); if (i == SIGTRAP) { type = T_TRCTRAP; + load_dr6(rdr6() | 0x4000); goto kernel_trctrap; } if (i != 0) @@ -696,7 +699,7 @@ kernel_trctrap: * Reset breakpoint bits because the * processor doesn't */ - load_dr6(rdr6() & 0xfffffff0); + load_dr6(rdr6() & ~0xf); goto out; } /* @@ -708,7 +711,10 @@ kernel_trctrap: * Otherwise, debugger traps "can't happen". */ #ifdef KDB - if (kdb_trap(type, 0, frame)) + /* XXX %dr6 is not quite reentrant. */ + dr6 = rdr6(); + load_dr6(dr6 & ~0x4000); + if (kdb_trap(type, dr6, frame)) goto out; #endif break; Modified: head/sys/i386/include/db_machdep.h ============================================================================== --- head/sys/i386/include/db_machdep.h Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/i386/include/db_machdep.h Thu Sep 15 17:24:23 2016 (r305840) @@ -59,12 +59,16 @@ do { \ #define db_clear_single_step kdb_cpu_clear_singlestep #define db_set_single_step kdb_cpu_set_singlestep -#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) /* - * Watchpoints are not supported. The debug exception type is in %dr6 - * and not yet in the args to this macro. + * The debug exception type is copied from %dr6 to 'code' and used to + * disambiguate single step traps. Watchpoints have no special support. + * Our hardware breakpoints are not well integrated with ddb and are too + * different from watchpoints. ddb treats them as unknown traps with + * unknown addresses and doesn't turn them off while it is running. */ -#define IS_WATCHPOINT_TRAP(type, code) 0 +#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) +#define IS_SSTEP_TRAP(type, code) ((type) == T_TRCTRAP && (code) & 0x4000) +#define IS_WATCHPOINT_TRAP(type, code) 0 #define I_CALL 0xe8 #define I_CALLI 0xff From owner-svn-src-all@freebsd.org Thu Sep 15 17:24:40 2016 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 A2F02BDAF80; Thu, 15 Sep 2016 17:24:40 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59AE9E88; Thu, 15 Sep 2016 17:24:40 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHOdef081431; Thu, 15 Sep 2016 17:24:39 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHOd0h081430; Thu, 15 Sep 2016 17:24:39 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609151724.u8FHOd0h081430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 15 Sep 2016 17:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305841 - head/bin/cat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:24:40 -0000 Author: ache Date: Thu Sep 15 17:24:39 2016 New Revision: 305841 URL: https://svnweb.freebsd.org/changeset/base/305841 Log: Implement multibyte encoding support for -v with fallback MFC after: 7 days Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Thu Sep 15 17:24:23 2016 (r305840) +++ head/bin/cat/cat.c Thu Sep 15 17:24:39 2016 (r305841) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static int bflag, eflag, lflag, nflag, sflag, tflag, vflag; static int rval; @@ -207,6 +209,7 @@ static void cook_cat(FILE *fp) { int ch, gobble, line, prev; + wint_t wch; /* Reset EOF condition on stdin. */ if (fp == stdin && feof(stdin)) @@ -239,18 +242,40 @@ cook_cat(FILE *fp) continue; } } else if (vflag) { - if (!isascii(ch) && !isprint(ch)) { + (void)ungetc(ch, fp); + /* + * Our getwc(3) doesn't change file position + * on error. + */ + if ((wch = getwc(fp)) == WEOF) { + if (ferror(fp) && errno == EILSEQ) { + clearerr(fp); + /* Resync attempt. */ + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + if ((ch = getc(fp)) == EOF) + break; + wch = ch; + goto ilseq; + } else + break; + } + if (!iswascii(wch) && !iswprint(wch)) { +ilseq: if (putchar('M') == EOF || putchar('-') == EOF) break; - ch = toascii(ch); + wch = toascii(wch); } - if (iscntrl(ch)) { - if (putchar('^') == EOF || - putchar(ch == '\177' ? '?' : - ch | 0100) == EOF) + if (iswcntrl(wch)) { + ch = toascii(wch); + ch = (ch == '\177') ? '?' : (ch | 0100); + if (putchar('^') == EOF || putchar(ch) == EOF) break; continue; } + if (putwchar(wch) == WEOF) + break; + ch = -1; + continue; } if (putchar(ch) == EOF) break; From owner-svn-src-all@freebsd.org Thu Sep 15 17:25:12 2016 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 4B985BDB069; Thu, 15 Sep 2016 17:25:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A59B0; Thu, 15 Sep 2016 17:25:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHPBFU081504; Thu, 15 Sep 2016 17:25:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHPBUp081503; Thu, 15 Sep 2016 17:25:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151725.u8FHPBUp081503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305842 - stable/11/contrib/elftoolchain/elfcopy X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:25:12 -0000 Author: emaste Date: Thu Sep 15 17:25:11 2016 New Revision: 305842 URL: https://svnweb.freebsd.org/changeset/base/305842 Log: MFC r304191: elfcopy: correct comment typo (Missed in r305838) Modified: stable/11/contrib/elftoolchain/elfcopy/ascii.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/ascii.c Thu Sep 15 17:24:39 2016 (r305841) +++ stable/11/contrib/elftoolchain/elfcopy/ascii.c Thu Sep 15 17:25:11 2016 (r305842) @@ -251,7 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { - sz = 0; /* Silence GCC 5.3 unintialized variable warning */ + sz = 0; /* Silence GCC 5.3 uninitialized variable warning */ if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { From owner-svn-src-all@freebsd.org Thu Sep 15 17:25:54 2016 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 A5E10BDB0EF; Thu, 15 Sep 2016 17:25:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E515221; Thu, 15 Sep 2016 17:25:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHPrHg081577; Thu, 15 Sep 2016 17:25:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHPqFH081568; Thu, 15 Sep 2016 17:25:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201609151725.u8FHPqFH081568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Sep 2016 17:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305843 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:25:54 -0000 Author: brooks Date: Thu Sep 15 17:25:52 2016 New Revision: 305843 URL: https://svnweb.freebsd.org/changeset/base/305843 Log: The TLS offset is a property of the process ABI. Move to a per-proc TLS offset rather than incorrectly keying off the presense of freebsd32 compability in the kernel. Reviewed by: adrian, sbruno Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7843 Modified: head/sys/mips/include/proc.h head/sys/mips/mips/cpu.c head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/genassym.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/swtch.S head/sys/mips/mips/sys_machdep.c head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/include/proc.h Thu Sep 15 17:25:52 2016 (r305843) @@ -62,6 +62,7 @@ struct mdthread { int md_pc_count; /* performance counter */ int md_pc_spill; /* performance counter spill */ void *md_tls; + size_t md_tls_tcb_offset; /* TCB offset */ #ifdef CPU_CNMIPS struct octeon_cop2_state *md_cop2; /* kernel context */ struct octeon_cop2_state *md_ucop2; /* userland context */ Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/cpu.c Thu Sep 15 17:25:52 2016 (r305843) @@ -71,13 +71,12 @@ struct mips_cpuinfo cpuinfo; # define _LOAD_T0_MDTLS_A1 \ _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) -# if defined(COMPAT_FREEBSD32) -# define _ADDIU_V0_T0_TLS_OFFSET \ - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE32)) -# else -# define _ADDIU_V0_T0_TLS_OFFSET \ - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) -# endif /* ! COMPAT_FREEBSD32 */ +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ + _ENCODE_INSN(OP_LD, A1, T1, 0, \ + offsetof(struct thread, td_md.md_tls_tcb_offset)) + +# define _ADDU_V0_T0_T1 \ + _ENCODE_INSN(0, T0, T1, V0, OP_DADDU) # define _MTC0_V0_USERLOCAL \ _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) @@ -86,8 +85,14 @@ struct mips_cpuinfo cpuinfo; # define _LOAD_T0_MDTLS_A1 \ _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) -# define _ADDIU_V0_T0_TLS_OFFSET \ - _ENCODE_INSN(OP_ADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) + +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ + _ENCODE_INSN(OP_LW, A1, T1, 0, \ + offsetof(struct thread, td_md.md_tls_tcb_offset)) + +# define _ADDU_V0_T0_T1 \ + _ENCODE_INSN(0, T0, T1, V0, OP_ADDU) + # define _MTC0_V0_USERLOCAL \ _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) @@ -111,8 +116,9 @@ remove_userlocal_code(uint32_t *cpu_swit if (instructp[0] == _JR_RA) panic("%s: Unable to patch cpu_switch().", __func__); if (instructp[0] == _LOAD_T0_MDTLS_A1 && - instructp[1] == _ADDIU_V0_T0_TLS_OFFSET && - instructp[2] == _MTC0_V0_USERLOCAL) { + instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && + instructp[2] == _ADDU_V0_T0_T1 && + instructp[3] == _MTC0_V0_USERLOCAL) { instructp[0] = _JR_RA; instructp[1] = _NOP; break; Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -138,6 +139,8 @@ freebsd32_exec_setregs(struct thread *td * Clear extended address space bit for userland. */ td->td_frame->sr &= ~MIPS_SR_UX; + + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; } int Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/genassym.c Thu Sep 15 17:25:52 2016 (r305843) @@ -74,12 +74,7 @@ ASSYM(TD_FLAGS, offsetof(struct thread, ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags)); ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls)); - -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE32)); -#else -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE)); -#endif +ASSYM(TD_MDTLS_TCB_OFFSET, offsetof(struct thread, td_md.md_tls_tcb_offset)); ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero)); ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context)); Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -466,6 +467,8 @@ exec_setregs(struct thread *td, struct i if (PCPU_GET(fpcurthread) == td) PCPU_SET(fpcurthread, (struct thread *)0); td->td_md.md_ss_addr = 0; + + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; } int Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/swtch.S Thu Sep 15 17:25:52 2016 (r305843) @@ -385,7 +385,8 @@ sw2: * remove_userlocal_code() in cpu.c. */ PTR_L t0, TD_MDTLS(a1) # Get TLS pointer - PTR_ADDIU v0, t0, TLS_TCB_OFFSET # Add TLS/TCB offset + PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset + PTR_ADDU v0, t0, t1 MTC0 v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr j ra Modified: head/sys/mips/mips/sys_machdep.c ============================================================================== --- head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -69,13 +69,8 @@ sysarch(struct thread *td, struct sysarc * rdhwr trap() instruction handler. */ if (cpuinfo.userlocal_reg == true) { -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) mips_wr_userlocal((unsigned long)(uap->parms + - TLS_TP_OFFSET + TLS_TCB_SIZE32)); -#else - mips_wr_userlocal((unsigned long)(uap->parms + - TLS_TP_OFFSET + TLS_TCB_SIZE)); -#endif + td->td_md.md_tls_tcb_offset)); } return (0); case MIPS_GET_TLS: Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/trap.c Thu Sep 15 17:25:52 2016 (r305843) @@ -909,12 +909,7 @@ dofault: if (inst.RType.rd == 29) { frame_regs = &(trapframe->zero); frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE32; - else -#endif - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE; + frame_regs[inst.RType.rt] += td->td_md.md_tls_tcb_offset; trapframe->pc += sizeof(int); goto out; } Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -154,6 +154,7 @@ cpu_fork(register struct thread *td1,reg */ td2->td_md.md_tls = td1->td_md.md_tls; + td2->td_md.md_tls_tcb_offset = td1->td_md.md_tls_tcb_offset; td2->td_md.md_saved_intr = MIPS_SR_INT_IE; td2->td_md.md_spinlock_count = 1; #ifdef CPU_CNMIPS @@ -494,15 +495,16 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - td->td_md.md_tls = (char*)tls_base; - if (td == curthread && cpuinfo.userlocal_reg == true) { #if defined(__mips_n64) && defined(COMPAT_FREEBSD32) - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + - TLS_TCB_SIZE32); -#else - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + - TLS_TCB_SIZE); + if (td->td_proc && SV_PROC_FLAG(td->td_proc, SV_ILP32)) + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; + else #endif + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; + td->td_md.md_tls = (char*)tls_base; + if (td == curthread && cpuinfo.userlocal_reg == true) { + mips_wr_userlocal((unsigned long)tls_base + + td->td_md.md_tls_tcb_offset); } return (0); From owner-svn-src-all@freebsd.org Thu Sep 15 17:28:06 2016 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 895FABDB171; Thu, 15 Sep 2016 17:28:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 541B45F4; Thu, 15 Sep 2016 17:28:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHS5cv081750; Thu, 15 Sep 2016 17:28:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHS3Ph081732; Thu, 15 Sep 2016 17:28:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151728.u8FHS3Ph081732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305844 - in stable/11: contrib/elftoolchain/common contrib/elftoolchain/elfcopy contrib/elftoolchain/elfdump contrib/elftoolchain/libelf contrib/elftoolchain/libelftc contrib/elftoolch... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:28:06 -0000 Author: emaste Date: Thu Sep 15 17:28:03 2016 New Revision: 305844 URL: https://svnweb.freebsd.org/changeset/base/305844 Log: MFC r305130: Update to ELF Tool Chain r3490 Improvements include: * readelf: report all relocation types in rel/rela for MIPS N64 * readelf: add ELFOSABI_ARM_AEABI * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM * Add recent RISC-V relocations * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH MFC r305155: readelf: silence GCC 4.2.1 uninitialized variable warning Sponsored by: The FreeBSD Foundation Added: stable/11/contrib/elftoolchain/libelftc/elftc_timestamp.3 - copied unchanged from r305130, head/contrib/elftoolchain/libelftc/elftc_timestamp.3 stable/11/contrib/elftoolchain/libelftc/elftc_timestamp.c - copied unchanged from r305130, head/contrib/elftoolchain/libelftc/elftc_timestamp.c Modified: stable/11/contrib/elftoolchain/common/elfdefinitions.h stable/11/contrib/elftoolchain/elfcopy/archive.c stable/11/contrib/elftoolchain/elfcopy/ascii.c stable/11/contrib/elftoolchain/elfcopy/pe.c stable/11/contrib/elftoolchain/elfdump/elfdump.c stable/11/contrib/elftoolchain/libelf/elf_flagdata.3 stable/11/contrib/elftoolchain/libelftc/Makefile stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 stable/11/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c stable/11/contrib/elftoolchain/libelftc/libelftc.h stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c stable/11/contrib/elftoolchain/readelf/readelf.1 stable/11/contrib/elftoolchain/readelf/readelf.c stable/11/lib/libelftc/Makefile stable/11/lib/libelftc/elftc_version.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- stable/11/contrib/elftoolchain/common/elfdefinitions.h Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/common/elfdefinitions.h Thu Sep 15 17:28:03 2016 (r305844) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3455 2016-05-09 13:47:29Z emaste $ + * $Id: elfdefinitions.h 3485 2016-08-18 13:38:52Z emaste $ */ /* @@ -2091,7 +2091,10 @@ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, _ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \ _ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \ -_ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) +_ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) \ +_ELF_DEFINE_RELOC(R_RISCV_RVC_LUI, 46) \ +_ELF_DEFINE_RELOC(R_RISCV_GPREL_I, 47) \ +_ELF_DEFINE_RELOC(R_RISCV_GPREL_S, 48) #define _ELF_DEFINE_SPARC_RELOCATIONS() \ _ELF_DEFINE_RELOC(R_SPARC_NONE, 0) \ Modified: stable/11/contrib/elftoolchain/elfcopy/archive.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/archive.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/elfcopy/archive.c Thu Sep 15 17:28:03 2016 (r305844) @@ -38,7 +38,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: archive.c 3287 2015-12-31 16:58:48Z emaste $"); +ELFTC_VCSID("$Id: archive.c 3490 2016-08-31 00:12:22Z emaste $"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ @@ -440,6 +440,7 @@ ac_write_objs(struct elfcopy *ecp, int o struct archive *a; struct archive_entry *entry; struct ar_obj *obj; + time_t timestamp; int nr; if ((a = archive_write_new()) == NULL) @@ -450,7 +451,9 @@ ac_write_objs(struct elfcopy *ecp, int o /* Write the archive symbol table, even if it's empty. */ entry = archive_entry_new(); archive_entry_copy_pathname(entry, "/"); - archive_entry_set_mtime(entry, time(NULL), 0); + if (elftc_timestamp(×tamp) != 0) + err(EXIT_FAILURE, "elftc_timestamp"); + archive_entry_set_mtime(entry, timestamp, 0); archive_entry_set_size(entry, (ecp->s_cnt + 1) * sizeof(uint32_t) + ecp->s_sn_sz); AC(archive_write_header(a, entry)); Modified: stable/11/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/ascii.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/elfcopy/ascii.c Thu Sep 15 17:28:03 2016 (r305844) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: ascii.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: ascii.c 3487 2016-08-24 18:12:08Z emaste $"); static void append_data(struct section *s, const void *buf, size_t sz); static char hex_digit(uint8_t n); @@ -251,7 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { - sz = 0; /* Silence GCC 5.3 uninitialized variable warning */ + sz = 0; if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { Modified: stable/11/contrib/elftoolchain/elfcopy/pe.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/pe.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/elfcopy/pe.c Thu Sep 15 17:28:03 2016 (r305844) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: pe.c 3477 2016-05-25 20:00:42Z kaiwang27 $"); +ELFTC_VCSID("$Id: pe.c 3490 2016-08-31 00:12:22Z emaste $"); /* Convert ELF object to Portable Executable (PE). */ void @@ -54,6 +54,7 @@ create_pe(struct elfcopy *ecp, int ifd, PE_Buffer *pb; const char *name; size_t indx; + time_t timestamp; int elferr; if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) @@ -89,7 +90,9 @@ create_pe(struct elfcopy *ecp, int ifd, pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN; break; } - pch.ch_timestamp = (uint32_t) time(NULL); + if (elftc_timestamp(×tamp) != 0) + err(EXIT_FAILURE, "elftc_timestamp"); + pch.ch_timestamp = (uint32_t) timestamp; if (pe_update_coff_header(pe, &pch) < 0) err(EXIT_FAILURE, "pe_update_coff_header() failed"); Modified: stable/11/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- stable/11/contrib/elftoolchain/elfdump/elfdump.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/elfdump/elfdump.c Thu Sep 15 17:28:03 2016 (r305844) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3474 2016-05-17 20:44:53Z emaste $"); +ELFTC_VCSID("$Id: elfdump.c 3482 2016-08-02 18:47:00Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -332,6 +332,8 @@ static const char *ei_abis[256] = { "ELFOSABI_IRIX", "ELFOSABI_FREEBSD", "ELFOSABI_TRU64", "ELFOSABI_MODESTO", "ELFOSABI_OPENBSD", [17] = "ELFOSABI_CLOUDABI", + [64] = "ELFOSABI_ARM_AEABI", + [97] = "ELFOSABI_ARM", [255] = "ELFOSABI_STANDALONE" }; Modified: stable/11/contrib/elftoolchain/libelf/elf_flagdata.3 ============================================================================== --- stable/11/contrib/elftoolchain/libelf/elf_flagdata.3 Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelf/elf_flagdata.3 Thu Sep 15 17:28:03 2016 (r305844) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_flagdata.3 2884 2013-01-11 02:03:46Z jkoshy $ +.\" $Id: elf_flagdata.3 3479 2016-06-25 20:44:33Z jkoshy $ .\" .Dd December 3, 2011 .Os @@ -208,16 +208,13 @@ was called without a program header bein .Xr elf 3 , .Xr elf32_newehdr 3 , .Xr elf32_newphdr 3 , -.Xr elf32_newshdr 3 , .Xr elf64_newehdr 3 , .Xr elf64_newphdr 3 , -.Xr elf64_newshdr 3 , .Xr elf_newdata 3 , .Xr elf_update 3 , .Xr gelf 3 , .Xr gelf_newehdr 3 , .Xr gelf_newphdr 3 , -.Xr gelf_newshdr 3 , .Xr gelf_update_dyn 3 , .Xr gelf_update_move 3 , .Xr gelf_update_rel 3 , Modified: stable/11/contrib/elftoolchain/libelftc/Makefile ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/Makefile Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelftc/Makefile Thu Sep 15 17:28:03 2016 (r305844) @@ -1,4 +1,4 @@ -# $Id: Makefile 3418 2016-02-19 20:04:42Z emaste $ +# $Id: Makefile 3489 2016-08-31 00:12:15Z emaste $ TOP= ${.CURDIR}/.. @@ -10,6 +10,7 @@ SRCS= elftc_bfdtarget.c \ elftc_reloc_type_str.c \ elftc_set_timestamps.c \ elftc_string_table.c \ + elftc_timestamp.c \ elftc_version.c \ libelftc_bfdtarget.c \ libelftc_dem_arm.c \ Modified: stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Thu Sep 15 17:28:03 2016 (r305844) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_bfd_find_target.3 3348 2016-01-18 14:18:50Z emaste $ +.\" $Id: elftc_bfd_find_target.3 3488 2016-08-24 18:15:57Z emaste $ .\" .Dd November 30, 2011 .Os Modified: stable/11/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Thu Sep 15 17:28:03 2016 (r305844) @@ -545,6 +545,9 @@ elftc_reloc_type_str(unsigned int mach, case 43: return "R_RISCV_ALIGN"; case 44: return "R_RISCV_RVC_BRANCH"; case 45: return "R_RISCV_RVC_JUMP"; + case 46: return "R_RISCV_RVC_LUI"; + case 47: return "R_RISCV_GPREL_I"; + case 48: return "R_RISCV_GPREL_S"; } break; case EM_SPARC: Copied: stable/11/contrib/elftoolchain/libelftc/elftc_timestamp.3 (from r305130, head/contrib/elftoolchain/libelftc/elftc_timestamp.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/elftoolchain/libelftc/elftc_timestamp.3 Thu Sep 15 17:28:03 2016 (r305844, copy of r305130, head/contrib/elftoolchain/libelftc/elftc_timestamp.3) @@ -0,0 +1,79 @@ +.\" Copyright (c) 2016 The FreeBSD Foundation. All rights reserved. +.\" +.\" This documentation was written by Ed Maste under sponsorship of +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" This software is provided by the author and contributors ``as is'' and +.\" any express or implied warranties, including, but not limited to, the +.\" implied warranties of merchantability and fitness for a particular purpose +.\" are disclaimed. In no event shall the author or contributors be liable +.\" for any direct, indirect, incidental, special, exemplary, or consequential +.\" damages (including, but not limited to, procurement of substitute goods +.\" or services; loss of use, data, or profits; or business interruption) +.\" however caused and on any theory of liability, whether in contract, strict +.\" liability, or tort (including negligence or otherwise) arising in any way +.\" out of the use of this software, even if advised of the possibility of +.\" such damage. +.\" +.\" $Id$ +.\" +.Dd August 24, 2016 +.Os +.Dt ELFTC_TIMESTAMP 3 +.Sh NAME +.Nm elftc_timestamp +.Nd return the current or environment-provided timestamp +.Sh LIBRARY +.Lb libelftc +.Sh SYNOPSIS +.In libelftc.h +.Ft int +.Fo elftc_timestamp +.Fa "time_t *timestamp" +.Fc +.Sh DESCRIPTION +The +.Fn elftc_timestamp +function returns a timestamp supplied by the +.Ev SOURCE_DATE_EPOCH +environment variable, or the current time provided by +.Xr time 3 +if the environment variable is not set. +.Pp +The +.Ar timestamp +argument specifies a pointer to the location where the timestamp will be +stored. +.Sh RETURN VALUE +Function +.Fn elftc_timestamp +returns 0 on success, and -1 in the event of an error. +.Sh ERRORS +The +.Fn elftc_timestamp +function may fail with the following errors: +.Bl -tag -width ".Bq Er ERANGE" +.It Bq Er EINVAL +.Ev SOURCE_DATE_EPOCH +contains invalid characters. +.It Bq Er ERANGE +.Ev SOURCE_DATE_EPOCH +specifies a negative value or a value that cannot be stored in a +time_t. +.El +The +.Fn elftc_timestamp +function may also fail for any of the reasons described in +.Xr strtoll 3 . +.Sh SEE ALSO +.Xr strtoll 3 , +.Xr time 3 Copied: stable/11/contrib/elftoolchain/libelftc/elftc_timestamp.c (from r305130, head/contrib/elftoolchain/libelftc/elftc_timestamp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/elftoolchain/libelftc/elftc_timestamp.c Thu Sep 15 17:28:03 2016 (r305844, copy of r305130, head/contrib/elftoolchain/libelftc/elftc_timestamp.c) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Ed Maste under sponsorship + * of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +int +elftc_timestamp(time_t *timestamp) +{ + long long source_date_epoch; + char *env, *eptr; + + if ((env = getenv("SOURCE_DATE_EPOCH")) != NULL) { + errno = 0; + source_date_epoch = strtoll(env, &eptr, 10); + if (*eptr != '\0') + errno = EINVAL; + if (source_date_epoch < 0) + errno = ERANGE; + if (errno != 0) + return (-1); + *timestamp = source_date_epoch; + return (0); + } + *timestamp = time(NULL); + return (0); +} Modified: stable/11/contrib/elftoolchain/libelftc/libelftc.h ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc.h Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelftc/libelftc.h Thu Sep 15 17:28:03 2016 (r305844) @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: users/kaiwang27/elftc/libelftc.h 392 2009-05-31 19:17:46Z kaiwang27 $ - * $Id: libelftc.h 3418 2016-02-19 20:04:42Z emaste $ + * $Id: libelftc.h 3489 2016-08-31 00:12:15Z emaste $ */ #ifndef _LIBELFTC_H_ @@ -91,6 +91,7 @@ int elftc_string_table_remove(Elftc_Str const char *_string); const char *elftc_string_table_to_string(Elftc_String_Table *_table, size_t offset); +int elftc_timestamp(time_t *_timestamp); const char *elftc_version(void); #ifdef __cplusplus } Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Thu Sep 15 17:28:03 2016 (r305844) @@ -30,7 +30,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3309 2016-01-10 09:10:51Z kaiwang27 $"); +ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3488 2016-08-24 18:15:57Z emaste $"); struct _Elftc_Bfd_Target _libelftc_targets[] = { Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Thu Sep 15 17:28:03 2016 (r305844) @@ -36,7 +36,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3447 2016-05-03 13:32:23Z emaste $"); +ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3480 2016-07-24 23:38:41Z emaste $"); /** * @file cpp_demangle.c Modified: stable/11/contrib/elftoolchain/readelf/readelf.1 ============================================================================== --- stable/11/contrib/elftoolchain/readelf/readelf.1 Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/readelf/readelf.1 Thu Sep 15 17:28:03 2016 (r305844) @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: readelf.1 3219 2015-05-24 23:42:34Z kaiwang27 $ +.\" $Id: readelf.1 3486 2016-08-22 14:10:05Z emaste $ .\" .Dd September 13, 2012 .Os @@ -43,12 +43,12 @@ .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section .Op Fl r | Fl -relocs .Op Fl t | Fl -section-details -.Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section .Op Fl v | Fl -version .Oo .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | .Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ... .Oc +.Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section .Op Fl A | Fl -arch-specific .Op Fl D | Fl -use-dynamic .Op Fl H | Fl -help Modified: stable/11/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/11/contrib/elftoolchain/readelf/readelf.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/contrib/elftoolchain/readelf/readelf.c Thu Sep 15 17:28:03 2016 (r305844) @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3469 2016-05-15 23:16:09Z emaste $"); +ELFTC_VCSID("$Id: readelf.c 3484 2016-08-03 13:36:49Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ #ifndef STB_GNU_UNIQUE @@ -440,6 +440,7 @@ elf_osabi(unsigned int abi) case ELFOSABI_OPENVMS: return "OpenVMS"; case ELFOSABI_NSK: return "NSK"; case ELFOSABI_CLOUDABI: return "CloudABI"; + case ELFOSABI_ARM_AEABI: return "ARM EABI"; case ELFOSABI_ARM: return "ARM"; case ELFOSABI_STANDALONE: return "StandAlone"; default: @@ -2787,6 +2788,8 @@ dump_rel(struct readelf *re, struct sect const char *symname; uint64_t symval; int i, len; + uint32_t type; + uint8_t type2, type3; if (s->link >= re->shnum) return; @@ -2796,8 +2799,8 @@ dump_rel(struct readelf *re, struct sect elftc_reloc_type_str(re->ehdr.e_machine, \ ELF32_R_TYPE(r.r_info)), (uintmax_t)symval, symname #define REL_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \ - elftc_reloc_type_str(re->ehdr.e_machine, \ - ELF64_R_TYPE(r.r_info)), (uintmax_t)symval, symname + elftc_reloc_type_str(re->ehdr.e_machine, type), \ + (uintmax_t)symval, symname printf("\nRelocation section (%s):\n", s->name); if (re->ec == ELFCLASS32) @@ -2823,12 +2826,37 @@ dump_rel(struct readelf *re, struct sect ELF64_R_TYPE(r.r_info)); printf("%8.8jx %8.8jx %-19.19s %8.8jx %s\n", REL_CT32); } else { + type = ELF64_R_TYPE(r.r_info); + if (re->ehdr.e_machine == EM_MIPS) { + type2 = (type >> 8) & 0xFF; + type3 = (type >> 16) & 0xFF; + type = type & 0xFF; + } else { + type2 = type3 = 0; + } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" " %16.16jx %s\n", REL_CT64); else printf("%12.12jx %12.12jx %-19.19s" " %16.16jx %s\n", REL_CT64); + if (re->ehdr.e_machine == EM_MIPS) { + if (re->options & RE_WW) { + printf("%32s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%32s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } else { + printf("%24s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%24s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } + } } } @@ -2843,6 +2871,8 @@ dump_rela(struct readelf *re, struct sec const char *symname; uint64_t symval; int i, len; + uint32_t type; + uint8_t type2, type3; if (s->link >= re->shnum) return; @@ -2853,8 +2883,8 @@ dump_rela(struct readelf *re, struct sec elftc_reloc_type_str(re->ehdr.e_machine, \ ELF32_R_TYPE(r.r_info)), (uintmax_t)symval, symname #define RELA_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \ - elftc_reloc_type_str(re->ehdr.e_machine, \ - ELF64_R_TYPE(r.r_info)), (uintmax_t)symval, symname + elftc_reloc_type_str(re->ehdr.e_machine, type), \ + (uintmax_t)symval, symname printf("\nRelocation section with addend (%s):\n", s->name); if (re->ec == ELFCLASS32) @@ -2881,6 +2911,14 @@ dump_rela(struct readelf *re, struct sec printf("%8.8jx %8.8jx %-19.19s %8.8jx %s", RELA_CT32); printf(" + %x\n", (uint32_t) r.r_addend); } else { + type = ELF64_R_TYPE(r.r_info); + if (re->ehdr.e_machine == EM_MIPS) { + type2 = (type >> 8) & 0xFF; + type3 = (type >> 16) & 0xFF; + type = type & 0xFF; + } else { + type2 = type3 = 0; + } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" " %16.16jx %s", RELA_CT64); @@ -2888,6 +2926,23 @@ dump_rela(struct readelf *re, struct sec printf("%12.12jx %12.12jx %-19.19s" " %16.16jx %s", RELA_CT64); printf(" + %jx\n", (uintmax_t) r.r_addend); + if (re->ehdr.e_machine == EM_MIPS) { + if (re->options & RE_WW) { + printf("%32s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%32s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } else { + printf("%24s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%24s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } + } } } Modified: stable/11/lib/libelftc/Makefile ============================================================================== --- stable/11/lib/libelftc/Makefile Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/lib/libelftc/Makefile Thu Sep 15 17:28:03 2016 (r305844) @@ -16,6 +16,7 @@ SRCS= elftc_bfdtarget.c elftc_reloc_type_str.c \ elftc_set_timestamps.c \ elftc_string_table.c \ + elftc_timestamp.c \ elftc_version.c \ libelftc_bfdtarget.c \ libelftc_dem_arm.c \ Modified: stable/11/lib/libelftc/elftc_version.c ============================================================================== --- stable/11/lib/libelftc/elftc_version.c Thu Sep 15 17:25:52 2016 (r305843) +++ stable/11/lib/libelftc/elftc_version.c Thu Sep 15 17:28:03 2016 (r305844) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3477M"; + return "elftoolchain r3490M"; } From owner-svn-src-all@freebsd.org Thu Sep 15 17:30:03 2016 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 60A93BDB227; Thu, 15 Sep 2016 17:30:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 173A580B; Thu, 15 Sep 2016 17:30:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHU2QL081888; Thu, 15 Sep 2016 17:30:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHU2Wi081886; Thu, 15 Sep 2016 17:30:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151730.u8FHU2Wi081886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305845 - in stable/11/sys/boot/efi: boot1 loader X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:30:03 -0000 Author: emaste Date: Thu Sep 15 17:30:01 2016 New Revision: 305845 URL: https://svnweb.freebsd.org/changeset/base/305845 Log: MFC r305160: Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/loader/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Thu Sep 15 17:28:03 2016 (r305844) +++ stable/11/sys/boot/efi/boot1/Makefile Thu Sep 15 17:30:01 2016 (r305845) @@ -84,11 +84,15 @@ EFI_TARGET= efi-app-ia32 EFI_TARGET= binary .endif +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# for build reproducibility. +SOURCE_DATE_EPOCH?=1451606400 boot1.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame \ Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Thu Sep 15 17:28:03 2016 (r305844) +++ stable/11/sys/boot/efi/loader/Makefile Thu Sep 15 17:30:01 2016 (r305845) @@ -128,11 +128,15 @@ EFI_TARGET= efi-app-ia32 EFI_TARGET= binary .endif +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# for build reproducibility. +SOURCE_DATE_EPOCH?=1451606400 loader.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ From owner-svn-src-all@freebsd.org Thu Sep 15 17:34:15 2016 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 C43E1BDB4D3; Thu, 15 Sep 2016 17:34:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 914DFCE9; Thu, 15 Sep 2016 17:34:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHYEnn085531; Thu, 15 Sep 2016 17:34:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHYEpl085530; Thu, 15 Sep 2016 17:34:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151734.u8FHYEpl085530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305846 - stable/11/sys/dev/kbd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:34:15 -0000 Author: emaste Date: Thu Sep 15 17:34:14 2016 New Revision: 305846 URL: https://svnweb.freebsd.org/changeset/base/305846 Log: MFC r303335: apply some style(9) to kbd: make function name start in column 1 Modified: stable/11/sys/dev/kbd/kbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/kbd/kbd.c ============================================================================== --- stable/11/sys/dev/kbd/kbd.c Thu Sep 15 17:30:01 2016 (r305845) +++ stable/11/sys/dev/kbd/kbd.c Thu Sep 15 17:34:14 2016 (r305846) @@ -284,8 +284,8 @@ kbd_unregister(keyboard_t *kbd) } /* find a function table by the driver name */ -keyboard_switch_t -*kbd_get_switch(char *driver) +keyboard_switch_t * +kbd_get_switch(char *driver) { const keyboard_driver_t **list; const keyboard_driver_t *p; @@ -419,8 +419,8 @@ kbd_change_callback(keyboard_t *kbd, voi } /* get a keyboard structure */ -keyboard_t -*kbd_get_keyboard(int index) +keyboard_t * +kbd_get_keyboard(int index) { if ((index < 0) || (index >= keyboards)) return (NULL); @@ -1118,8 +1118,8 @@ fkey_change_ok(fkeytab_t *oldkey, fkeyar #endif /* get a pointer to the string associated with the given function key */ -u_char -*genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) +u_char * +genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) { if (kbd == NULL) return (NULL); @@ -1131,8 +1131,8 @@ u_char } /* diagnostic dump */ -static char -*get_kbd_type_name(int type) +static char * +get_kbd_type_name(int type) { static struct { int type; From owner-svn-src-all@freebsd.org Thu Sep 15 17:36:44 2016 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 94775BDB646; Thu, 15 Sep 2016 17:36:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61188F99; Thu, 15 Sep 2016 17:36:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHahid085671; Thu, 15 Sep 2016 17:36:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHahvU085670; Thu, 15 Sep 2016 17:36:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151736.u8FHahvU085670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305847 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:36:44 -0000 Author: emaste Date: Thu Sep 15 17:36:43 2016 New Revision: 305847 URL: https://svnweb.freebsd.org/changeset/base/305847 Log: MFC r303670: Add ELFOSABI_ARM_AEABI ELF OSABI constant Modified: stable/11/sys/sys/elf_common.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/elf_common.h ============================================================================== --- stable/11/sys/sys/elf_common.h Thu Sep 15 17:34:14 2016 (r305846) +++ stable/11/sys/sys/elf_common.h Thu Sep 15 17:36:43 2016 (r305847) @@ -171,6 +171,7 @@ typedef struct { #define ELFOSABI_AROS 15 /* Amiga Research OS */ #define ELFOSABI_FENIXOS 16 /* FenixOS */ #define ELFOSABI_CLOUDABI 17 /* Nuxi CloudABI */ +#define ELFOSABI_ARM_AEABI 64 /* ARM EABI */ #define ELFOSABI_ARM 97 /* ARM */ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ From owner-svn-src-all@freebsd.org Thu Sep 15 17:37:32 2016 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 10C08BDB6CA; Thu, 15 Sep 2016 17:37:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D46A8179; Thu, 15 Sep 2016 17:37:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHbVbY085758; Thu, 15 Sep 2016 17:37:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHbUYL085756; Thu, 15 Sep 2016 17:37:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151737.u8FHbUYL085756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 17:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305848 - in stable/11/sys: arm/include sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 17:37:32 -0000 Author: emaste Date: Thu Sep 15 17:37:30 2016 New Revision: 305848 URL: https://svnweb.freebsd.org/changeset/base/305848 Log: MFC r303677: Move/add ARM ELF PHDR types to elf_common.h Modified: stable/11/sys/arm/include/elf.h stable/11/sys/sys/elf_common.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/elf.h ============================================================================== --- stable/11/sys/arm/include/elf.h Thu Sep 15 17:36:43 2016 (r305847) +++ stable/11/sys/arm/include/elf.h Thu Sep 15 17:37:30 2016 (r305848) @@ -55,9 +55,6 @@ __ElfType(Auxinfo); #define ELF_MACHINE_OK(x) ((x) == EM_ARM) -/* Unwind info section type */ -#define PT_ARM_EXIDX (PT_LOPROC + 1) - /* * Relocation types. */ Modified: stable/11/sys/sys/elf_common.h ============================================================================== --- stable/11/sys/sys/elf_common.h Thu Sep 15 17:36:43 2016 (r305847) +++ stable/11/sys/sys/elf_common.h Thu Sep 15 17:37:30 2016 (r305848) @@ -511,6 +511,8 @@ typedef struct { #define PT_HISUNW 0x6fffffff #define PT_HIOS 0x6fffffff /* Last OS-specific. */ #define PT_LOPROC 0x70000000 /* First processor-specific type. */ +#define PT_ARM_ARCHEXT 0x70000000 /* ARM arch compat information. */ +#define PT_ARM_EXIDX 0x70000001 /* ARM exception unwind tables. */ #define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ /* Values for p_flags. */ From owner-svn-src-all@freebsd.org Thu Sep 15 18:30:54 2016 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 ADFB7BDC67D; Thu, 15 Sep 2016 18:30:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E20EAD4; Thu, 15 Sep 2016 18:30:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FIUrYA005298; Thu, 15 Sep 2016 18:30:53 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FIUrCW005297; Thu, 15 Sep 2016 18:30:53 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609151830.u8FIUrCW005297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 15 Sep 2016 18:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305849 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 18:30:54 -0000 Author: bde Date: Thu Sep 15 18:30:53 2016 New Revision: 305849 URL: https://svnweb.freebsd.org/changeset/base/305849 Log: Decode some REX prefixes in inst_call(). This makes the 'next' and 'until' commands work in more cases. Modified: head/sys/amd64/include/db_machdep.h Modified: head/sys/amd64/include/db_machdep.h ============================================================================== --- head/sys/amd64/include/db_machdep.h Thu Sep 15 17:37:30 2016 (r305848) +++ head/sys/amd64/include/db_machdep.h Thu Sep 15 18:30:53 2016 (r305849) @@ -69,14 +69,15 @@ do { \ #define I_CALL 0xe8 #define I_CALLI 0xff +#define i_calli(ins) (((ins)&0xff) == I_CALLI && ((ins)&0x3800) == 0x1000) #define I_RET 0xc3 #define I_IRET 0xcf +#define i_rex(ins) (((ins) & 0xff) == 0x41 || ((ins) & 0xff) == 0x43) #define inst_trap_return(ins) (((ins)&0xff) == I_IRET) #define inst_return(ins) (((ins)&0xff) == I_RET) -#define inst_call(ins) (((ins)&0xff) == I_CALL || \ - (((ins)&0xff) == I_CALLI && \ - ((ins)&0x3800) == 0x1000)) +#define inst_call(ins) (((ins)&0xff) == I_CALL || i_calli(ins) || \ + (i_calli((ins) >> 8) && i_rex(ins))) #define inst_load(ins) 0 #define inst_store(ins) 0 From owner-svn-src-all@freebsd.org Thu Sep 15 19:05:21 2016 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 E6C89BDCDB7; Thu, 15 Sep 2016 19:05:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::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 B63C8DC0; Thu, 15 Sep 2016 19:05:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id cm16so18504644pac.0; Thu, 15 Sep 2016 12:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tATAhrrS3GQLVeoxFfU7gwsdhXKKPqVf1R/lSXruB1M=; b=lmhUYMHQ0XbQMdPP45snsg1+JQQwwnwj9i4noAUfp0QzhgSmUtnfMaspRuiK17nKYb uDXBg4eaGq0WRuuWImbhH73i1qWBtU2gj1T5elUnwtUzoRBR9lKtEnZXuf+MXaLNa73l D6QZtls43XIt1pvAkuEKMP+GuoMRAEphpdvgacqBPcpXtFfhFkR46eaIWgRfdt3yTLrj gI/A800oo+Q4hAPxMfBA7mGZXJOugP56mORSF3d0M2SXqFJiiLz+cnvNpOZOecsj+fum 3x4UUAy86FIgZTOlBYf447rp+tE4XpKSRQQpJcpjIhYEArpl5gZNXHyzDmypnEDt3Oh9 ZwSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tATAhrrS3GQLVeoxFfU7gwsdhXKKPqVf1R/lSXruB1M=; b=kgBeutiXeGw/jz272HlHlS40PpfmXOuJXabpn5M+st2tElk1e0MZ3GbLoNxd/K5Kov JM82FLfHWpebvRfgiNofaM5HeXNS2EKEigThZ029YzhUQFnVlMl+YpwiIH3SRXWeS09u IaT9M0T62wMjG+ymNwGCIntGWw/saVv81q2FPBijEqkoS9JNOfXU+3LxrUi5Og8HraNI eB7/D/a4N0yRmXZaahmtSaMp4f2SiFr0SvDvihI1ibwlwob17Wqg7Ypy+wtQNMmmtlWp 9gyqOiw8qb9tOGiGSbottRcUZB72cDKW0tKeHMKLFD4KYtXw4X8bKD+6pr20PFQ5F1ou QQzg== X-Gm-Message-State: AE9vXwPdja1MVxhFmbOHMIWbv+BiAoLWgbvJqH2iPuuDFALRFFzS1cb/3Nq6aqlaTYbCWw== X-Received: by 10.66.157.103 with SMTP id wl7mr17221550pab.116.1473966320439; Thu, 15 Sep 2016 12:05:20 -0700 (PDT) Received: from ?IPv6:2607:fb90:80b2:18a4:14c8:2538:e637:10f? ([2607:fb90:80b2:18a4:14c8:2538:e637:10f]) by smtp.gmail.com with ESMTPSA id s89sm46814592pfi.83.2016.09.15.12.05.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 12:05:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys From: Ngie Cooper X-Mailer: iPhone Mail (13G36) In-Reply-To: <20160915134618.GA8952@ns.kevlo.org> Date: Thu, 15 Sep 2016 12:05:16 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <25658DD6-6FC9-48F1-B7D0-59A929FB43BE@gmail.com> References: <201609150741.u8F7fmcM059138@repo.freebsd.org> <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> <20160915134618.GA8952@ns.kevlo.org> To: Kevin Lo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 19:05:22 -0000 > On Sep 15, 2016, at 06:46, Kevin Lo wrote: ... > Bumped(r305833), thanks. Thanks :)! -Ngie From owner-svn-src-all@freebsd.org Thu Sep 15 22:04:40 2016 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 61C03BDC919 for ; Thu, 15 Sep 2016 22:04:40 +0000 (UTC) (envelope-from nobody@platypus.sitestrux.com) Received: from platypus.sitestrux.com (platypus.sitestrux.com [199.187.211.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23C58814 for ; Thu, 15 Sep 2016 22:04:39 +0000 (UTC) (envelope-from nobody@platypus.sitestrux.com) Received: from nobody by platypus.sitestrux.com with local (Exim 4.80) (envelope-from ) id 1bkdmK-0004oS-E1 for svn-src-all@freebsd.org; Thu, 15 Sep 2016 17:01:04 -0400 To: svn-src-all@freebsd.org Subject: We have a slight error in your account information X-PHP-Script: www.ebnutrition.com/_files/mlr.php for 41.111.8.158 From: PayPal Support. Message-Id: Date: Thu, 15 Sep 2016 17:01:04 -0400 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - platypus.sitestrux.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [99 32007] / [47 12] X-AntiAbuse: Sender Address Domain - platypus.sitestrux.com X-Source: X-Source-Args: X-Source-Dir: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 22:04:40 -0000 From owner-svn-src-all@freebsd.org Thu Sep 15 22:27:01 2016 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 CC859BDCEE0; Thu, 15 Sep 2016 22:27:01 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 807AB22B; Thu, 15 Sep 2016 22:27:01 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FMR06Y095925; Thu, 15 Sep 2016 22:27:00 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FMR0B7095924; Thu, 15 Sep 2016 22:27:00 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609152227.u8FMR0B7095924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 15 Sep 2016 22:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305850 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 22:27:01 -0000 Author: avos Date: Thu Sep 15 22:27:00 2016 New Revision: 305850 URL: https://svnweb.freebsd.org/changeset/base/305850 Log: net80211: allow to override SWCRYPT/SWMIC bits in the driver Add IEEE80211_KEY_SWCRYPT / IEEE80211_KEY_SWMIC bits to the IEEE80211_KEY_DEVICE mask - as a result, those bits will be preserved during group key handshake. A driver can override them in iv_key_alloc() for some keys in case when hardware crypto support is not possible. As an example: - multi-vap without multicast key search support; - IBSS RSN for devices w/ fixed storage for group keys; Tested with RTL8188EU (AP, sw crypto) and RTL8821AU (STA, sw crypto for group keys + hw crypto for pairwise keys) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D7901 Modified: head/sys/net80211/ieee80211_crypto.h Modified: head/sys/net80211/ieee80211_crypto.h ============================================================================== --- head/sys/net80211/ieee80211_crypto.h Thu Sep 15 18:30:53 2016 (r305849) +++ head/sys/net80211/ieee80211_crypto.h Thu Sep 15 22:27:00 2016 (r305850) @@ -101,13 +101,15 @@ struct ieee80211_key { #define IEEE80211_KEY_COMMON /* common flags passed in by apps */\ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP | \ IEEE80211_KEY_NOREPLAY) -#define IEEE80211_KEY_DEVICE /* flags owned by device driver */\ - (IEEE80211_KEY_DEVKEY|IEEE80211_KEY_CIPHER0|IEEE80211_KEY_CIPHER1) #define IEEE80211_KEY_SWCRYPT \ (IEEE80211_KEY_SWENCRYPT | IEEE80211_KEY_SWDECRYPT) #define IEEE80211_KEY_SWMIC (IEEE80211_KEY_SWENMIC | IEEE80211_KEY_SWDEMIC) +#define IEEE80211_KEY_DEVICE /* flags owned by device driver */\ + (IEEE80211_KEY_DEVKEY|IEEE80211_KEY_CIPHER0|IEEE80211_KEY_CIPHER1| \ + IEEE80211_KEY_SWCRYPT|IEEE80211_KEY_SWMIC) + #define IEEE80211_KEY_BITS \ "\20\1XMIT\2RECV\3GROUP\4SWENCRYPT\5SWDECRYPT\6SWENMIC\7SWDEMIC" \ "\10DEVKEY\11CIPHER0\12CIPHER1" From owner-svn-src-all@freebsd.org Thu Sep 15 22:31:51 2016 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 05F8DBDC0F3; Thu, 15 Sep 2016 22:31:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB625846; Thu, 15 Sep 2016 22:31:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FMVoik096733; Thu, 15 Sep 2016 22:31:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FMVnk4096731; Thu, 15 Sep 2016 22:31:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609152231.u8FMVnk4096731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 15 Sep 2016 22:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305851 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2016 22:31:51 -0000 Author: np Date: Thu Sep 15 22:31:49 2016 New Revision: 305851 URL: https://svnweb.freebsd.org/changeset/base/305851 Log: Whitespace nits. Modified: head/sys/dev/cxgbe/t4_iov.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Thu Sep 15 22:27:00 2016 (r305850) +++ head/sys/dev/cxgbe/t4_iov.c Thu Sep 15 22:31:49 2016 (r305851) @@ -97,7 +97,7 @@ static int t4iov_attach_child(device_t d static int t4iov_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -114,7 +114,7 @@ t4iov_probe(device_t dev) static int t5iov_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Thu Sep 15 22:27:00 2016 (r305850) +++ head/sys/dev/cxgbe/t4_vf.c Thu Sep 15 22:31:49 2016 (r305851) @@ -124,7 +124,7 @@ static struct cdevsw t4vf_cdevsw = { static int t4vf_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -140,7 +140,7 @@ t4vf_probe(device_t dev) static int t5vf_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -653,7 +653,7 @@ t4vf_attach(device_t dev) pi->vi[0].dev = pi->dev; device_set_softc(pi->dev, pi); } - + /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ From owner-svn-src-all@freebsd.org Fri Sep 16 00:08:39 2016 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 A42F6BDC611; Fri, 16 Sep 2016 00:08:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7606474C; Fri, 16 Sep 2016 00:08:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G08cb5033167; Fri, 16 Sep 2016 00:08:38 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G08bWr033156; Fri, 16 Sep 2016 00:08:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609160008.u8G08bWr033156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 16 Sep 2016 00:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305852 - in head/sys: dev/cxgbe dev/cxgbe/firmware modules/cxgbe modules/cxgbe/if_cc modules/cxgbe/if_ccv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 00:08:39 -0000 Author: np Date: Fri Sep 16 00:08:37 2016 New Revision: 305852 URL: https://svnweb.freebsd.org/changeset/base/305852 Log: cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will come up as 't6nex' nexus devices with 'cc' ports hanging off them. The T6 firmware and configuration files will be added as soon as they are released. For now the driver will try to work with whatever firmware and configuration is on the card's flash. Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/if_cc.c (contents, props changed) head/sys/dev/cxgbe/if_ccv.c (contents, props changed) head/sys/modules/cxgbe/if_cc/ head/sys/modules/cxgbe/if_cc/Makefile (contents, props changed) head/sys/modules/cxgbe/if_ccv/ head/sys/modules/cxgbe/if_ccv/Makefile (contents, props changed) Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_iov.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_tracer.c head/sys/dev/cxgbe/t4_vf.c head/sys/modules/cxgbe/Makefile Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/adapter.h Fri Sep 16 00:08:37 2016 (r305852) @@ -752,10 +752,20 @@ struct sge { struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; }; +struct devnames { + const char *nexus_name; + const char *ifnet_name; + const char *vi_ifnet_name; + const char *pf03_drv_name; + const char *vf_nexus_name; + const char *vf_ifnet_name; +}; + struct adapter { SLIST_ENTRY(adapter) link; device_t dev; struct cdev *cdev; + const struct devnames *names; /* PCIe register resources */ int regs_rid; @@ -1117,6 +1127,7 @@ int t4_os_pci_restore_state(struct adapt void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); +void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); int t4_detach_common(device_t); int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Fri Sep 16 00:08:37 2016 (r305852) @@ -9215,6 +9215,11 @@ enum { T5FW_VERSION_MINOR = 0x05, T5FW_VERSION_MICRO = 0x25, T5FW_VERSION_BUILD = 0x00, + + T6FW_VERSION_MAJOR = 0x00, + T6FW_VERSION_MINOR = 0x00, + T6FW_VERSION_MICRO = 0x00, + T6FW_VERSION_BUILD = 0x00, }; enum { Added: head/sys/dev/cxgbe/if_cc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/if_cc.c Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * 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 + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + + return (0); +} +static moduledata_t if_cc_mod = {"if_cc", mod_event}; +DECLARE_MODULE(if_cc, if_cc_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(if_cc, 1); +MODULE_DEPEND(if_cc, cc, 1, 1, 1); Added: head/sys/dev/cxgbe/if_ccv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/if_ccv.c Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * 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 + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + + return (0); +} +static moduledata_t if_ccv_mod = {"if_ccv", mod_event}; +DECLARE_MODULE(if_ccv, if_ccv_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(if_ccv, 1); +MODULE_DEPEND(if_ccv, ccv, 1, 1, 1); Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_iov.c Fri Sep 16 00:08:37 2016 (r305852) @@ -90,6 +90,12 @@ struct { {0x500f, "Chelsio Amsterdam"}, {0x5013, "Chelsio T580-CHR"}, #endif +}, t6iov_pciids[] = { + {0x6001, "Chelsio T6225-CR"}, /* 2 x 10/25G */ + {0x6002, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ + {0x6007, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ + {0x6008, "Chelsio T62100-SO-CR"}, /* 2 x 40/50/100G, nomem */ + {0x600d, "Chelsio T62100-CR"}, /* 2 x 40/50/100G */ }; static int t4iov_attach_child(device_t dev); @@ -129,6 +135,23 @@ t5iov_probe(device_t dev) } static int +t6iov_probe(device_t dev) +{ + uint16_t d; + size_t i; + + d = pci_get_device(dev); + for (i = 0; i < nitems(t6iov_pciids); i++) { + if (d == t6iov_pciids[i].device) { + device_set_desc(dev, t6iov_pciids[i].desc); + device_quiet(dev); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + +static int t4iov_attach(device_t dev) { struct t4iov_softc *sc; @@ -288,10 +311,36 @@ static driver_t t5iov_driver = { sizeof(struct t4iov_softc) }; -static devclass_t t4iov_devclass, t5iov_devclass; +static device_method_t t6iov_methods[] = { + DEVMETHOD(device_probe, t6iov_probe), + DEVMETHOD(device_attach, t4iov_attach), + DEVMETHOD(device_detach, t4iov_detach), + +#ifdef PCI_IOV + DEVMETHOD(pci_iov_init, t4iov_iov_init), + DEVMETHOD(pci_iov_uninit, t4iov_iov_uninit), + DEVMETHOD(pci_iov_add_vf, t4iov_add_vf), +#endif + + DEVMETHOD(t4_attach_child, t4iov_attach_child), + DEVMETHOD(t4_detach_child, t4iov_detach_child), + + DEVMETHOD_END +}; + +static driver_t t6iov_driver = { + "t6iov", + t6iov_methods, + sizeof(struct t4iov_softc) +}; + +static devclass_t t4iov_devclass, t5iov_devclass, t6iov_devclass; DRIVER_MODULE(t4iov, pci, t4iov_driver, t4iov_devclass, 0, 0); MODULE_VERSION(t4iov, 1); DRIVER_MODULE(t5iov, pci, t5iov_driver, t5iov_devclass, 0, 0); MODULE_VERSION(t5iov, 1); + +DRIVER_MODULE(t6iov, pci, t6iov_driver, t6iov_devclass, 0, 0); +MODULE_VERSION(t6iov, 1); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_main.c Fri Sep 16 00:08:37 2016 (r305852) @@ -174,6 +174,39 @@ static driver_t vcxl_driver = { sizeof(struct vi_info) }; +/* T6 bus driver interface */ +static int t6_probe(device_t); +static device_method_t t6_methods[] = { + DEVMETHOD(device_probe, t6_probe), + DEVMETHOD(device_attach, t4_attach), + DEVMETHOD(device_detach, t4_detach), + + DEVMETHOD(t4_is_main_ready, t4_ready), + DEVMETHOD(t4_read_port_device, t4_read_port_device), + + DEVMETHOD_END +}; +static driver_t t6_driver = { + "t6nex", + t6_methods, + sizeof(struct adapter) +}; + + +/* T6 port (cc) interface */ +static driver_t cc_driver = { + "cc", + cxgbe_methods, + sizeof(struct port_info) +}; + +/* T6 VI (vcc) interface */ +static driver_t vcc_driver = { + "vcc", + vcxgbe_methods, + sizeof(struct vi_info) +}; + /* ifnet + media interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); @@ -567,6 +600,13 @@ struct { {0x540f, "Chelsio Amsterdam"}, {0x5413, "Chelsio T580-CHR"}, #endif +}, t6_pciids[] = { + {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ + {0x6401, "Chelsio T6225-CR"}, /* 2 x 10/25G */ + {0x6402, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ + {0x6407, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ + {0x6408, "Chelsio T62100-SO-CR"}, /* 2 x 40/50/100G, nomem */ + {0x640d, "Chelsio T62100-CR"}, /* 2 x 40/50/100G */ }; #ifdef TCP_OFFLOAD @@ -629,6 +669,26 @@ t5_probe(device_t dev) return (ENXIO); } +static int +t6_probe(device_t dev) +{ + int i; + uint16_t v = pci_get_vendor(dev); + uint16_t d = pci_get_device(dev); + + if (v != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + + for (i = 0; i < nitems(t6_pciids); i++) { + if (d == t6_pciids[i].device) { + device_set_desc(dev, t6_pciids[i].desc); + return (BUS_PROBE_DEFAULT); + } + } + + return (ENXIO); +} + static void t5_attribute_workaround(device_t dev) { @@ -656,6 +716,45 @@ t5_attribute_workaround(device_t dev) device_get_nameunit(root_port)); } +static const struct devnames devnames[] = { + { + .nexus_name = "t4nex", + .ifnet_name = "cxgbe", + .vi_ifnet_name = "vcxgbe", + .pf03_drv_name = "t4iov", + .vf_nexus_name = "t4vf", + .vf_ifnet_name = "cxgbev" + }, { + .nexus_name = "t5nex", + .ifnet_name = "cxl", + .vi_ifnet_name = "vcxl", + .pf03_drv_name = "t5iov", + .vf_nexus_name = "t5vf", + .vf_ifnet_name = "cxlv" + }, { + .nexus_name = "t6nex", + .ifnet_name = "cc", + .vi_ifnet_name = "vcc", + .pf03_drv_name = "t6iov", + .vf_nexus_name = "t6vf", + .vf_ifnet_name = "ccv" + } +}; + +void +t4_init_devnames(struct adapter *sc) +{ + int id; + + id = chip_id(sc); + if (id >= CHELSIO_T4 && id - CHELSIO_T4 < nitems(devnames)) + sc->names = &devnames[id - CHELSIO_T4]; + else { + device_printf(sc->dev, "chip id %d is not supported.\n", id); + sc->names = NULL; + } +} + static int t4_attach(device_t dev) { @@ -733,6 +832,12 @@ t4_attach(device_t dev) goto done; } + t4_init_devnames(sc); + if (sc->names == NULL) { + rc = ENOTSUP; + goto done; /* error message displayed already */ + } + /* * Do this really early, with the memory windows set up even before the * character device. The userland tool's register i/o and mem read @@ -872,7 +977,7 @@ t4_attach(device_t dev) pi->linkdnrc = -1; - pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbe" : "cxl", -1); + pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -1355,6 +1460,7 @@ static int cxgbe_attach(device_t dev) { struct port_info *pi = device_get_softc(dev); + struct adapter *sc = pi->adapter; struct vi_info *vi; int i, rc; @@ -1367,8 +1473,7 @@ cxgbe_attach(device_t dev) for_each_vi(pi, i, vi) { if (i == 0) continue; - vi->dev = device_add_child(dev, is_t4(pi->adapter) ? - "vcxgbe" : "vcxl", -1); + vi->dev = device_add_child(dev, sc->names->vi_ifnet_name, -1); if (vi->dev == NULL) { device_printf(dev, "failed to add VI %d\n", i); continue; @@ -2686,6 +2791,22 @@ struct fw_info { .intfver_fcoepdu = FW_INTFVER(T5, FCOEPDU), .intfver_fcoe = FW_INTFVER(T5, FCOE), }, + }, { + .chip = CHELSIO_T6, + .kld_name = "t6fw_cfg", + .fw_mod_name = "t6fw", + .fw_hdr = { + .chip = FW_HDR_CHIP_T6, + .fw_ver = htobe32_const(FW_VERSION(T6)), + .intfver_nic = FW_INTFVER(T6, NIC), + .intfver_vnic = FW_INTFVER(T6, VNIC), + .intfver_ofld = FW_INTFVER(T6, OFLD), + .intfver_ri = FW_INTFVER(T6, RI), + .intfver_iscsipdu = FW_INTFVER(T6, ISCSIPDU), + .intfver_iscsi = FW_INTFVER(T6, ISCSI), + .intfver_fcoepdu = FW_INTFVER(T6, FCOEPDU), + .intfver_fcoe = FW_INTFVER(T6, FCOE), + }, } }; @@ -9646,9 +9767,9 @@ done_unload: return (rc); } -static devclass_t t4_devclass, t5_devclass; -static devclass_t cxgbe_devclass, cxl_devclass; -static devclass_t vcxgbe_devclass, vcxl_devclass; +static devclass_t t4_devclass, t5_devclass, t6_devclass; +static devclass_t cxgbe_devclass, cxl_devclass, cc_devclass; +static devclass_t vcxgbe_devclass, vcxl_devclass, vcc_devclass; DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, mod_event, 0); MODULE_VERSION(t4nex, 1); @@ -9657,7 +9778,6 @@ MODULE_DEPEND(t4nex, firmware, 1, 1, 1); MODULE_DEPEND(t4nex, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ - DRIVER_MODULE(t5nex, pci, t5_driver, t5_devclass, mod_event, 0); MODULE_VERSION(t5nex, 1); MODULE_DEPEND(t5nex, firmware, 1, 1, 1); @@ -9665,14 +9785,27 @@ MODULE_DEPEND(t5nex, firmware, 1, 1, 1); MODULE_DEPEND(t5nex, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ +DRIVER_MODULE(t6nex, pci, t6_driver, t6_devclass, mod_event, 0); +MODULE_VERSION(t6nex, 1); +MODULE_DEPEND(t6nex, firmware, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(t6nex, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ + DRIVER_MODULE(cxgbe, t4nex, cxgbe_driver, cxgbe_devclass, 0, 0); MODULE_VERSION(cxgbe, 1); DRIVER_MODULE(cxl, t5nex, cxl_driver, cxl_devclass, 0, 0); MODULE_VERSION(cxl, 1); +DRIVER_MODULE(cc, t6nex, cc_driver, cc_devclass, 0, 0); +MODULE_VERSION(cc, 1); + DRIVER_MODULE(vcxgbe, cxgbe, vcxgbe_driver, vcxgbe_devclass, 0, 0); MODULE_VERSION(vcxgbe, 1); DRIVER_MODULE(vcxl, cxl, vcxl_driver, vcxl_devclass, 0, 0); MODULE_VERSION(vcxl, 1); + +DRIVER_MODULE(vcc, cc, vcc_driver, vcc_devclass, 0, 0); +MODULE_VERSION(vcc, 1); Modified: head/sys/dev/cxgbe/t4_tracer.c ============================================================================== --- head/sys/dev/cxgbe/t4_tracer.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_tracer.c Fri Sep 16 00:08:37 2016 (r305852) @@ -124,7 +124,8 @@ t4_cloner_match(struct if_clone *ifc, co { if (strncmp(name, "t4nex", 5) != 0 && - strncmp(name, "t5nex", 5) != 0) + strncmp(name, "t5nex", 5) != 0 && + strncmp(name, "t6nex", 5) != 0) return (0); if (name[5] < '0' || name[5] > '9') return (0); Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_vf.c Fri Sep 16 00:08:37 2016 (r305852) @@ -111,6 +111,12 @@ struct { {0x580f, "Chelsio Amsterdam VF"}, {0x5813, "Chelsio T580-CHR VF"}, #endif +}, t6vf_pciids[] = { + {0x6801, "Chelsio T6225-CR VF"}, /* 2 x 10/25G */ + {0x6802, "Chelsio T6225-SO-CR VF"}, /* 2 x 10/25G, nomem */ + {0x6807, "Chelsio T62100-LP-CR VF"}, /* 2 x 40/50/100G */ + {0x6808, "Chelsio T62100-SO-CR VF"}, /* 2 x 40/50/100G, nomem */ + {0x680d, "Chelsio T62100-CR VF"}, /* 2 x 40/50/100G */ }; static d_ioctl_t t4vf_ioctl; @@ -153,6 +159,22 @@ t5vf_probe(device_t dev) return (ENXIO); } +static int +t6vf_probe(device_t dev) +{ + uint16_t d; + size_t i; + + d = pci_get_device(dev); + for (i = 0; i < nitems(t6vf_pciids); i++) { + if (d == t6vf_pciids[i].device) { + device_set_desc(dev, t6vf_pciids[i].desc); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + #define FW_PARAM_DEV(param) \ (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param)) @@ -498,6 +520,12 @@ t4vf_attach(device_t dev) if (rc != 0) goto done; + t4_init_devnames(sc); + if (sc->names == NULL) { + rc = ENOTSUP; + goto done; /* error message displayed already */ + } + /* * Leave the 'pf' and 'mbox' values as zero. This ensures * that various firmware messages do not set the fields which @@ -642,8 +670,7 @@ t4vf_attach(device_t dev) pi->linkdnrc = -1; - pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbev" : "cxlv", - -1); + pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -920,6 +947,20 @@ static driver_t t5vf_driver = { sizeof(struct adapter) }; +static device_method_t t6vf_methods[] = { + DEVMETHOD(device_probe, t6vf_probe), + DEVMETHOD(device_attach, t4vf_attach), + DEVMETHOD(device_detach, t4_detach_common), + + DEVMETHOD_END +}; + +static driver_t t6vf_driver = { + "t6vf", + t6vf_methods, + sizeof(struct adapter) +}; + static driver_t cxgbev_driver = { "cxgbev", cxgbe_methods, @@ -932,8 +973,14 @@ static driver_t cxlv_driver = { sizeof(struct port_info) }; -static devclass_t t4vf_devclass, t5vf_devclass; -static devclass_t cxgbev_devclass, cxlv_devclass; +static driver_t ccv_driver = { + "ccv", + cxgbe_methods, + sizeof(struct port_info) +}; + +static devclass_t t4vf_devclass, t5vf_devclass, t6vf_devclass; +static devclass_t cxgbev_devclass, cxlv_devclass, ccv_devclass; DRIVER_MODULE(t4vf, pci, t4vf_driver, t4vf_devclass, 0, 0); MODULE_VERSION(t4vf, 1); @@ -943,8 +990,15 @@ DRIVER_MODULE(t5vf, pci, t5vf_driver, t5 MODULE_VERSION(t5vf, 1); MODULE_DEPEND(t5vf, t5nex, 1, 1, 1); +DRIVER_MODULE(t6vf, pci, t6vf_driver, t6vf_devclass, 0, 0); +MODULE_VERSION(t6vf, 1); +MODULE_DEPEND(t6vf, t6nex, 1, 1, 1); + DRIVER_MODULE(cxgbev, t4vf, cxgbev_driver, cxgbev_devclass, 0, 0); MODULE_VERSION(cxgbev, 1); DRIVER_MODULE(cxlv, t5vf, cxlv_driver, cxlv_devclass, 0, 0); MODULE_VERSION(cxlv, 1); + +DRIVER_MODULE(ccv, t6vf, ccv_driver, ccv_devclass, 0, 0); +MODULE_VERSION(ccv, 1); Modified: head/sys/modules/cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/Makefile Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/modules/cxgbe/Makefile Fri Sep 16 00:08:37 2016 (r305852) @@ -7,8 +7,10 @@ SYSDIR?=${.CURDIR}/../.. SUBDIR= if_cxgbe SUBDIR+= if_cxl +SUBDIR+= if_cc SUBDIR+= if_cxgbev SUBDIR+= if_cxlv +SUBDIR+= if_ccv SUBDIR+= t4_firmware SUBDIR+= t5_firmware SUBDIR+= ${_tom} Added: head/sys/modules/cxgbe/if_cc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cxgbe/if_cc/Makefile Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,11 @@ +# +# $FreeBSD$ +# + +CXGBE= ${.CURDIR}/../../../dev/cxgbe +.PATH: ${CXGBE} + +KMOD= if_cc +SRCS= if_cc.c + +.include Added: head/sys/modules/cxgbe/if_ccv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cxgbe/if_ccv/Makefile Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,11 @@ +# +# $FreeBSD$ +# + +CXGBE= ${.CURDIR}/../../../dev/cxgbe +.PATH: ${CXGBE} + +KMOD= if_ccv +SRCS= if_ccv.c + +.include From owner-svn-src-all@freebsd.org Fri Sep 16 00:14:27 2016 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 9000DBDC7A7; Fri, 16 Sep 2016 00:14:27 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C060B6C; Fri, 16 Sep 2016 00:14:27 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G0EQXB036801; Fri, 16 Sep 2016 00:14:26 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G0EQKU036798; Fri, 16 Sep 2016 00:14:26 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201609160014.u8G0EQKU036798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 16 Sep 2016 00:14:26 +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: r305853 - in stable/10: share/man/man4 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 00:14:27 -0000 Author: hiren Date: Fri Sep 16 00:14:26 2016 New Revision: 305853 URL: https://svnweb.freebsd.org/changeset/base/305853 Log: MFC r301522 (by bz) Implement a `show panic` command to DDB which will helpfully print the panic string again if set, in case it scrolled out of the active window. This avoids having to remember the symbol name. Also add a show callout command to DDB in order to inspect some struct callout fields in case of panics in the callout code. This may help to see if there was memory corruption or to further ease debugging problems. No objection by: bz Modified: stable/10/share/man/man4/ddb.4 stable/10/sys/kern/kern_shutdown.c stable/10/sys/kern/kern_timeout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ddb.4 ============================================================================== --- stable/10/share/man/man4/ddb.4 Fri Sep 16 00:08:37 2016 (r305852) +++ stable/10/share/man/man4/ddb.4 Fri Sep 16 00:14:26 2016 (r305853) @@ -611,6 +611,13 @@ See the header file for more details on the exact meaning of the structure fields. .\" .Pp +.It Ic show Cm callout Ar addr +Show information about the callout structure +.Vt struct callout +present at +.Ar addr . +.\" +.Pp .It Ic show Cm cbstat Show brief information about the TTY subsystem. .\" @@ -839,6 +846,10 @@ option is specified the complete object is printed. .\" .Pp +.It Ic show Cm panic +Print the panic message if set. +.\" +.Pp .It Ic show Cm page Show statistics on VM pages. .\" Modified: stable/10/sys/kern/kern_shutdown.c ============================================================================== --- stable/10/sys/kern/kern_shutdown.c Fri Sep 16 00:08:37 2016 (r305852) +++ stable/10/sys/kern/kern_shutdown.c Fri Sep 16 00:14:26 2016 (r305853) @@ -1031,3 +1031,14 @@ mkdumpheader(struct kerneldumpheader *kd strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->parity = kerneldump_parity(kdh); } + +#ifdef DDB +DB_SHOW_COMMAND(panic, db_show_panic) +{ + + if (panicstr == NULL) + db_printf("panicstr not set\n"); + else + db_printf("panic: %s\n", panicstr); +} +#endif Modified: stable/10/sys/kern/kern_timeout.c ============================================================================== --- stable/10/sys/kern/kern_timeout.c Fri Sep 16 00:08:37 2016 (r305852) +++ stable/10/sys/kern/kern_timeout.c Fri Sep 16 00:14:26 2016 (r305853) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_callout_profiling.h" #include "opt_kdtrace.h" +#include "opt_ddb.h" #if defined(__arm__) #include "opt_timer.h" #endif @@ -60,6 +61,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#include +#endif + #ifdef SMP #include #endif @@ -1576,3 +1582,34 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_callout_stat, "I", "Dump immediate statistic snapshot of the scheduled callouts"); + +#ifdef DDB +static void +_show_callout(struct callout *c) +{ + + db_printf("callout %p\n", c); +#define C_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, c->e); + db_printf(" &c_links = %p\n", &(c->c_links)); + C_DB_PRINTF("%" PRId64, c_time); + C_DB_PRINTF("%" PRId64, c_precision); + C_DB_PRINTF("%p", c_arg); + C_DB_PRINTF("%p", c_func); + C_DB_PRINTF("%p", c_lock); + C_DB_PRINTF("%#x", c_flags); + C_DB_PRINTF("%#x", c_iflags); + C_DB_PRINTF("%d", c_cpu); +#undef C_DB_PRINTF +} + +DB_SHOW_COMMAND(callout, db_show_callout) +{ + + if (!have_addr) { + db_printf("usage: show callout \n"); + return; + } + + _show_callout((struct callout *)addr); +} +#endif /* DDB */ From owner-svn-src-all@freebsd.org Fri Sep 16 01:38:24 2016 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 712B4BDCA44; Fri, 16 Sep 2016 01:38:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2011AE81; Fri, 16 Sep 2016 01:38:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G1cN43066653; Fri, 16 Sep 2016 01:38:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G1cNsi066650; Fri, 16 Sep 2016 01:38:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609160138.u8G1cNsi066650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Sep 2016 01:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305854 - in head/sys/boot/efi/loader/arch: amd64 arm64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 01:38:24 -0000 Author: emaste Date: Fri Sep 16 01:38:22 2016 New Revision: 305854 URL: https://svnweb.freebsd.org/changeset/base/305854 Log: Use arch-specific .text padding fill value in EFI loaders The fill pattern was previously an ia64 instruction sequence. Presumably ia64's linker script was copied as a starting point. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 head/sys/boot/efi/loader/arch/i386/ldscript.i386 Modified: head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Sep 16 00:14:26 2016 (r305853) +++ head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Sep 16 01:38:22 2016 (r305854) @@ -19,7 +19,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Sep 16 00:14:26 2016 (r305853) +++ head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Sep 16 01:38:22 2016 (r305854) @@ -15,7 +15,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xD4200000 . = ALIGN(16); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: head/sys/boot/efi/loader/arch/i386/ldscript.i386 ============================================================================== --- head/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Sep 16 00:14:26 2016 (r305853) +++ head/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Sep 16 01:38:22 2016 (r305854) @@ -14,7 +14,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) From owner-svn-src-all@freebsd.org Fri Sep 16 02:31:22 2016 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 CA6F4BDC6AC; Fri, 16 Sep 2016 02:31:22 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0110.outbound.protection.outlook.com [104.47.32.110]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60577369; Fri, 16 Sep 2016 02:31:21 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Wr4fqcUj6bUNd+HFX+M/r66eDtWWOdeun0Le5rIy66g=; b=WoVmUJ+/ezgSOO49BDcVi0HW4D0Jk8662K/vDAjg9Dyrz5lomUtUGEtigAdnF44J+8mIAp0nlPoGvJEUlTm/I9O0SgWgk27Ge9y/SI9GbSAvBH1M4x0MoS6D3sDrhhu6Viiw+BGCyaTASwXr5siP2ErXtct6YR2v4KWOZHZzuCE= Received: from CY1PR05CA0011.namprd05.prod.outlook.com (10.166.186.149) by BLUPR0501MB977.namprd05.prod.outlook.com (10.141.254.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.6; Fri, 16 Sep 2016 02:31:19 +0000 Received: from BL2FFO11FD057.protection.gbl (2a01:111:f400:7c09::111) by CY1PR05CA0011.outlook.office365.com (2a01:111:e400:c5a4::21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.639.2 via Frontend Transport; Fri, 16 Sep 2016 02:31:19 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) 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.18 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.18) by BL2FFO11FD057.mail.protection.outlook.com (10.173.161.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 02:31:19 +0000 Received: from p-mailhub01.juniper.net (10.160.2.17) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 15 Sep 2016 19:31:07 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id u8G2V6PM006019; Thu, 15 Sep 2016 19:31:06 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 22DD638551E; Thu, 15 Sep 2016 19:31:06 -0700 (PDT) To: Bryan Drewery CC: , , , Subject: Re: svn commit: r305634 - head/share/mk In-Reply-To: References: <201609090121.u891LZOO023156@repo.freebsd.org> <76524.1473467847@kaos.jnpr.net> Comments: In-reply-to: Bryan Drewery message dated "Wed, 14 Sep 2016 11:14:13 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8254.1473993065.1@kaos.jnpr.net> Date: Thu, 15 Sep 2016 19:31:05 -0700 Message-ID: <8255.1473993065@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.18; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(199003)(24454002)(189002)(377454003)(105596002)(69596002)(586003)(76176999)(4001430100002)(68736007)(93886004)(106466001)(23726003)(50986999)(8676002)(81166006)(7126002)(11100500001)(86362001)(50226002)(53416004)(117636001)(2950100001)(97756001)(626004)(5660300001)(107886002)(8936002)(4326007)(81156014)(305945005)(76506005)(50466002)(7846002)(97736004)(450100001)(19580405001)(9686002)(189998001)(46406003)(47776003)(7696004)(110136003)(77096005)(2906002)(92566002)(19580395003)(356003)(2810700001)(87936001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR0501MB977; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD057; 1:SvUgufYSsilcOZoMXS3uIByO6603ZZNZm7LjInvnoiUj/G8PJHQMZ1oFthx8yZY3C2sLEX8cMPyUpxQEqQkmoC3+3ki1dWHBEK9xoVc3T2JGwN8nchOW0wX3qqAERxE2XfjAkJsOSxwtNlZv2zXq2xfbu0T2rLL3IOqNdXOGQpV3UskNBLWFh1g/B4ARWPV36khXZqCd8mojdfebCk8AA2t6TgdCHtADYYV9nclXONL9iLPrn+DKGJ9qHSC+MPJ8ll7HlXR9A+KKEysEyAwZVkY6wHgKH5UQyyb2aujDeEF8A0wbEMvUmJX4ISERPsQ6rm5Ieo+WTBUfEK3niB/4r+RCT7Ju1C/pV9XRtIGtqbbfoVB9Efeql4MZJ6+ZtrBWjTM6R51Ya5obEYkBlta6Q2t53T/yxoGqFt+PQY2uHnHt6zAdYht/UWym+2FjThyjmEGzlaTCvcecJRpDqA+lQdmdJ71MHJdLnfN2keSZL8OiPzB0UiqtgKLEmPnrbIAaxkVCB97Ul56QKZlZwohsh6jcYBWpzszCGMiCFEqRW/4= X-MS-Office365-Filtering-Correlation-Id: 57a4a4dc-1fff-423a-56c2-08d3ddd98ab0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 2:dpOiCeae8Dh7TZJO3btbNgeWUW4voAAeZvo4RNZqJB+1+FI+v9GTkFm5IqEHmaw2wwBadVPOkcvdQtDnhbXaiXro77ZZPxFTjXlrg873BZ+mq7PbTT+ZQvD+4q5wASjjaJgQI4ZLvTQdmKkcstrbDYCbUZtVctDGWChH5CMguHRFd7JgoiuJYHMqWV8jfxLr; 3:p0ZoVwU6V5aawmHxIHAkgMgidr3+tL4XRipNYY3Qac4dAzdadPMBpN3JPVoZekmS9T7f8UoR3yhHj4VN8E8sHWw5zlAMP+bOYy7hOF9dsmyBm7i76ql/Voepor/Ze7uQY+AZNGTexXLjHqixoJEAzTX3LAMgjtdeSpvg/kyhlX0m5mzRUlmb0TchJwl6HZU9NgdCgias8zVK2UIUCu46NkoA2HxfRzgSWE8S3l6sJPM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB977; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 25:pCgkgD3GYOX2IWJQbMVkSi4/2uybBp/0fTf+drkv27oKJf755OWYD0qjwh7VNHAOGHH0DQ0rPM90LjMBUtIjIElYwqMs8tHlCn8GIDdaiB4nVb19BTByXAzBdbm6ECLdw1Tyyyy1/RQPdPaBMr6TllZ3Bb3jGivHGCe0aaPUAK17FvW/Fpa0h4AFYc6n6ViJPLYrGW3pZiF/+wCy8uJVbpohXEhUAz5uP26Tw7xGjoiq7OHsMenD9TfONzQTPyjzCjjASqr7mmHeIpwF4/ZftEt9uEhAv9HuYj12x3NzBBewxWFTazue6QmtYl2X7QXcc5//d9qgCuCtXI89IqRgy9Xe8BzPFImNfKxiFH+wK6hQu4+XZz5tobGPJjalHCAWIFlkq2eosLctzfbbZZ6ISHd0FHjMonYKi7gU+sLg+pMDDFBSl07tPxgvaHCM/q3LKqqltbrqG6INdUDS2Ti/9iBaOSs/mzquLp2Tg/vM8mNok4P04HwnePNqd5TGEpDQicx/0UZfmHCJQpcBB+AmwZ6d8VbrCTvBy9vI2ouVjCZ79EQPoD9e+TNrhJXnwuzWgIZ1aHrgAthwmmR3Bmnm3ZvogJQn+nBGNZGi5UAyJuk/FRvBo74y8etX8ARPqqYq2PEvCk4IkwEzrbuUgpdvYWm3EE3+vy/kyumLeKPjVcp+ky3bSHYhr0wTRmKgjV4vZs6S0b4VMmvlEpt/qyv5EY4KKG5J+9iQoOiUHQigX3CczPPAgIoP0gAJey02MmCA X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 31:Y/dkq5rcXsHzygLBjv2/h0BYIUmH7oSXx/Jz+6ZYmr/yVO4+YuRpdUpD2ReimsBAMi+AWd0mcpMU7OlUDf9jV68Oy7zhU1AJPFDwxPOZd6jZ+bDL0s4x949jnSrYbpKS1/EoFQ1S8/YTsZ4vtMZq1iPFWMsptkMe/gQz27kcb+nMulRpuv4YWPzFLsRwRvHGytoavgqFxKFz6pagJergLU3c/KW/B08N8i5TjF/Lsxk=; 20:MVOXszmsAdo5+mDfKOvze7+q+Tt3/rMkRliyd1ZYAe+cteYa9xZA0wpmOMH66VByvvvy1hwMQdqE3W2FZs7iwpZhVpMG6Kkml5StB5npW7mO2dIorbP2rvdi8QxIrq6i55EueyvKGP5ISpLwlvcsiWpFmje1XmhUiQlVkHP99MMZ9UKMLnYUcOoZ/3eOvNq6thyROSXlILUVp3y0u1mnRwqcsLkeCpu3ze961oOapfQDlx/KXkGMjvlFGlkSJaDDZu+/pQJ7heqOuBWXjUFdm8CHFiRsNhTdF13ytj0Ftiv9/pNzQvif4H8tEXocqhPHXRyRykxjuQgoosFMC9rR/yCih/jt3FKg8+w+cN7EONppYKiVfsXT9Wj3JdLvoQzgrSUtHuuUMvNJmW/LPZm6TJBxV/cvzFTsCDZYDltv3tlp4aqSOaFPYVEAR2Rb4JYUeswCbPca8rSLDEikGVkQOD6pQ0Y94+Ow0kdFKMVoiJDvRx/tosmP/FuK2OH33OvH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13017025)(8121501046)(5005006)(13015025)(13023025)(13024025)(13018025)(10201501046)(3002001)(6055026); SRVR:BLUPR0501MB977; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB977; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 4:NrVOa8fEcJ7QwGVHajfbgONrO4I9VwYJjuJ5zMFH0Z/PbbSnFRxTzzXUl2i3jwebEkCYInL9WjnflQpQ41+ZXu4mtWyk84VRqBRZf49gNrH0u/grLjxPLo7L+FQHfr+2mEwdTO0t21jv2nR+Ge80ksr8Z7kpIhm3+ODVUA9hEIUoOfAWj1AIJuWjfN+Q59kBRkxOUSpdD/esTXnfLSsJ2FfpiUiK7/8mIYS6Ycf92cO9tLPLwqI5s/BBuGMbYN/wlCS29+7rr7nnLdHGgRRXcPDjL8CrKRzRfr2L1e5U7lkcr/pdMgHIRaE65L0+jnGXle61eAsebzQqW7kxdtGLdWsKruMxlaVwbBdXwkw71MElcyiAOv7i+bcIzYPpae30sojEQuBlgQgeFpET/TO3TfaVTkJ4yOkGYN0KjvqdqM5zWNQosWmsr5/4jGBx8OFqESSgQA6rQQyoV+qSUGSQy5HrQcVjs5lstoVu7j3omQtSSUs0vxhUPTnmQJiKcmg7 X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0501MB977; 23:wP/cQotLYQovcaDI0REVBmeUf1LR5HlnoIvIebR8?= =?us-ascii?Q?O1ORT7PrjNNK4Z8haKrh9zZ+8I2c1HuAt8Zw9/6WF++RK8lZmn47l16ErqG2?= =?us-ascii?Q?72ht38mAdpvoltu9AkxY8t/aqT+9LNnuYUHT/LyxcKYJ0+QcyvPr/ObTJpx0?= =?us-ascii?Q?jPMkkA2harqxLISH4hoMj/Fnuoct8pahPBW7zqtgTYXevTlTk8f7B/RU3IPK?= =?us-ascii?Q?1Y0Tlbt4O2VOiNgLdYljAjPJ499GustvpB4WjvEc6gkatYOqHNVAFCk77Fai?= =?us-ascii?Q?p5R5ha0kNbNJy/zBeGZ6BPlprivJ9tPwu5Ti6ng2AiVIGNfUgzTHtqbYoLJK?= =?us-ascii?Q?nGWTdI3+wz2nFssCwgtPSmFSKUxk/SvfoEDw+inDL8YDHQyfdvXqHYu6jdnS?= =?us-ascii?Q?uaEJwBgbbFdNhagvSyH4lkxNz93VBfUCPPAWnAwKbW2KkcPVvRHTlEyK5z9b?= =?us-ascii?Q?SgotXiNrTK2OmiGdhxG1exd01T/qwGazW1Il6Dwh+h/JL1/DJebHNs889iUm?= =?us-ascii?Q?CPA/YCJc0OLG5v+/AvQKLsFbfrOeaZ2+e7W8iXQTjQewYUe0wflsoJsXSo//?= =?us-ascii?Q?xT5g6NMXC9kj827egNBvlMT8mPzfMjxskNqXvPrtUCAyQrXzw0mmV029CqiC?= =?us-ascii?Q?8SvRxihewYyyCb1i6hAusbmaV4Awzvu1TAcUd0sEdELT4hgkwtx/8nf86I75?= =?us-ascii?Q?U71IAS77MK+FTwMslP6B6idj19xbg6AjJg+7HEU9zlIucwxm8H5ZzeBiIG59?= =?us-ascii?Q?lbgey3lKLQinmSOGxvASAfrNt97ho1b1UR+WgNKamaLMmsMPkEf8wTWfEwDe?= =?us-ascii?Q?/CpvuBeShWbJ9uNr+L8ksWakmODwy9yessfektzVUShSrMJKqMxzxlkevTJ+?= =?us-ascii?Q?qO3TFy3XisoQpMYfjdVLLMcBLQsCPfeY+/f+vweJ7bfseAY2NjmO5Q5QYNA9?= =?us-ascii?Q?l3vdeH08+2GcgwDdznbaNCLxhcF7q26OHAwptOFjCynmfdIsRk7Xm45tCU4k?= =?us-ascii?Q?B94BE1pQ+UAgmk/uhanbueYKdHRPiyvDO4BMALFvrLH7Syb5gceahqZeK0Tv?= =?us-ascii?Q?7o2I+E5EKFWDab2S32Q2ah1vG/Q0Rig6K5QVrwmT0b+0xiyxxRO8tu0FEWkE?= =?us-ascii?Q?d7VjtHtpplbKAJE/5XHp0iH6fj+G5i46jt8rCg4HAAKPZyD6of70PFuyFmgW?= =?us-ascii?Q?AvOujB6rglWj5k29oRM3uNpUmP4mrLSgTdjo4+TEcnM2oAMsNapud7eQj5QI?= =?us-ascii?Q?qBFGPb+ENywrlhRKEcCe1CUS4x2jyKz6EN5kPKRIjdJ+MeaWVaXmNbArdqgw?= =?us-ascii?Q?Fg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 6:014MTQ1zNM8IW9cSbOfheH8BMLBjEhbXxWOpVRdA/+rm0Kp9E3f0oZzO2iR7ulmFKHgHVXY0d64+fO4nulHhxgmAsAzjMv8m7ORFijOPXqD63jbP8GOMN1YOMWrmwI+OgMTxjfpcTYWysYfURIxgKl3s28gJ/bq8jpmElH0joELvEdDoLj58AYBKkO8Miy1eAlnHmw0Soj7Nuukp7nkErkBpBpHNPsxiAgnvTYXaWpjaksNoSv4dhADNOaqSfJrlvLn02Ksbg+eJptmH7YHv9BtnjQLvR/CqohuJe8VT6bS5EGjU53BVRwCi55VTJ2l8yk6tnCro+3ysM71wix8KDA==; 5:7le6In0KkLW4OMHK/vxeAHWMXNxopyZYCVSpBu+ohNxAywDJvepLbHpHqOzrJ0OwY4osnNHT5kwblu/pTRsev9/RkayIkS8uAg4mQufg4bYl81tQtJX3HQ8Sa3rzfbNJY0tygBGKP8XFwTyN0elRyw==; 24:8YY5o+cjxIWynVKHLdUrQQwP44EwlIZBvyw1ejouBcy9RLiFeLlL6uavSCbSpxJl9A4+tnNeN+ZgVz5bK5LVsC9/V8WDlhDJ5rAXMhyf5zA=; 7:l/J9rqEWdi4zNiSps0uYsL9w/ZUkt0v0OqP1P0THoi2R4J3kXHjd6LMLvruqc3WBwUBroOkJsVsUg5KfvJ0BwKMwV4d/2cmazWAnOS3Qd5DrVbJ29OjAvlAmoS3bielGI2YMBaJVgQrJ2SZQib/UtWEaQHUa6An1srTJQxw7cunkgRwrf8oSvdPkduHyv8ZAPkbOWsvirwF+t+TkkzBP9FCiiWQIQbSANoUA7RtO9aWnTAc7k3FSCT9Sya/Acshw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 02:31:19.0237 (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.18]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB977 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 02:31:22 -0000 Bryan Drewery wrote: > On 9/9/16 5:37 PM, Simon J. Gerraty wrote: > > Bryan Drewery wrote: > > > >>> +# some targets involve old pre-built targets > >>> +# ignore mtime of shell > >>> +# and mtime of makefiles does not matter in meta mode > >>> +.MAKE.META.IGNORE_PATHS += \ > >>> + ${MAKEFILE} \ > >>> + ${SHELL} \ > >>> + ${SYS_MK_DIR} > >> > >> I think it could be problematic to ignore *.mk changes. The build > Can you at least wrap it in something like .if > !defined(META_CONSIDER_MK_FILES) ? How about META_IGNORE_MAKEFILES ? Could even be an option ie. -DWITHOUT_META_IGNORE_MAKEFILES to disable? From owner-svn-src-all@freebsd.org Fri Sep 16 03:04:49 2016 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 A77CCBDCE06; Fri, 16 Sep 2016 03:04:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3CD1560; Fri, 16 Sep 2016 03:04:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G34mAF000816; Fri, 16 Sep 2016 03:04:48 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G34mOm000815; Fri, 16 Sep 2016 03:04:48 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201609160304.u8G34mOm000815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 16 Sep 2016 03:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305855 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 03:04:49 -0000 Author: marcel Date: Fri Sep 16 03:04:48 2016 New Revision: 305855 URL: https://svnweb.freebsd.org/changeset/base/305855 Log: When MAKEOBJDIRPREFIX points to a case-insensitive file system, the build can break when different source files create the same object files (case-insensitivity speaking). This is the case for _Exit.c and _exit.s. Compile _Exit.c as C99_Exit.c Reviewed by: sjg@ MFC after: completion Sponsored by: Bracket Computing Differential Revision: https://reviews.freebsd.org/D7893 Modified: head/lib/libc/stdlib/Makefile.inc Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Fri Sep 16 01:38:22 2016 (r305854) +++ head/lib/libc/stdlib/Makefile.inc Fri Sep 16 03:04:48 2016 (r305855) @@ -4,7 +4,7 @@ # machine-independent stdlib sources .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib -MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ +MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ @@ -16,6 +16,13 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c +# Work around an issue on case-insensitive file systems. +# libc has both _Exit.c and _exit.s and they both yield +# _exit.o (case insensitively speaking). +CLEANFILES+=C99_Exit.c +C99_Exit.c: ${LIBC_SRCTOP}/stdlib/_Exit.c .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + SYM_MAPS+= ${LIBC_SRCTOP}/stdlib/Symbol.map # machine-dependent stdlib sources From owner-svn-src-all@freebsd.org Fri Sep 16 03:36:44 2016 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 AF90EBDB43B; Fri, 16 Sep 2016 03:36:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 662191FA3; Fri, 16 Sep 2016 03:36:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G3ahPg012244; Fri, 16 Sep 2016 03:36:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G3ahxC012243; Fri, 16 Sep 2016 03:36:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201609160336.u8G3ahxC012243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Sep 2016 03:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305856 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 03:36:44 -0000 Author: mjg Date: Fri Sep 16 03:36:43 2016 New Revision: 305856 URL: https://svnweb.freebsd.org/changeset/base/305856 Log: linprocfs: garbage collect meminfo fields not present in linux In particular memshared not only does not exist in linux, it was extremely expensive to calculate. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Sep 16 03:04:48 2016 (r305855) +++ head/sys/compat/linprocfs/linprocfs.c Fri Sep 16 03:36:43 2016 (r305856) @@ -144,12 +144,10 @@ linprocfs_domeminfo(PFS_FILL_ARGS) unsigned long memtotal; /* total memory in bytes */ unsigned long memused; /* used memory in bytes */ unsigned long memfree; /* free memory in bytes */ - unsigned long memshared; /* shared memory ??? */ unsigned long buffers, cached; /* buffer / cache memory ??? */ unsigned long long swaptotal; /* total swap space in bytes */ unsigned long long swapused; /* used swap space in bytes */ unsigned long long swapfree; /* free swap space in bytes */ - vm_object_t object; int i, j; memtotal = physmem * PAGE_SIZE; @@ -169,13 +167,6 @@ linprocfs_domeminfo(PFS_FILL_ARGS) swaptotal = (unsigned long long)i * PAGE_SIZE; swapused = (unsigned long long)j * PAGE_SIZE; swapfree = swaptotal - swapused; - memshared = 0; - mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) - if (object->shadow_count > 1) - memshared += object->resident_page_count; - mtx_unlock(&vm_object_list_mtx); - memshared *= PAGE_SIZE; /* * We'd love to be able to write: * @@ -188,21 +179,14 @@ linprocfs_domeminfo(PFS_FILL_ARGS) cached = vm_cnt.v_cache_count * PAGE_SIZE; sbuf_printf(sb, - " total: used: free: shared: buffers: cached:\n" - "Mem: %lu %lu %lu %lu %lu %lu\n" - "Swap: %llu %llu %llu\n" "MemTotal: %9lu kB\n" "MemFree: %9lu kB\n" - "MemShared:%9lu kB\n" "Buffers: %9lu kB\n" "Cached: %9lu kB\n" "SwapTotal:%9llu kB\n" "SwapFree: %9llu kB\n", - memtotal, memused, memfree, memshared, buffers, cached, - swaptotal, swapused, swapfree, - B2K(memtotal), B2K(memfree), - B2K(memshared), B2K(buffers), B2K(cached), - B2K(swaptotal), B2K(swapfree)); + B2K(memtotal), B2K(memfree), B2K(buffers), + B2K(cached), B2K(swaptotal), B2K(swapfree)); return (0); } From owner-svn-src-all@freebsd.org Fri Sep 16 04:08:36 2016 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 0A656BDBB48; Fri, 16 Sep 2016 04:08:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF80CDCA; Fri, 16 Sep 2016 04:08:35 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G48Z8c023562; Fri, 16 Sep 2016 04:08:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G48ZKL023561; Fri, 16 Sep 2016 04:08:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160408.u8G48ZKL023561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305857 - head/sbin/rcorder X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:08:36 -0000 Author: allanjude Date: Fri Sep 16 04:08:34 2016 New Revision: 305857 URL: https://svnweb.freebsd.org/changeset/base/305857 Log: sbin/rcorder/rcorder.8: Amend HISTORY rcorder appeared in FreeBSD 5.0. Address issues raised by igor. PR: 212547 Submitted by: Sevan Janiyan Modified: head/sbin/rcorder/rcorder.8 Modified: head/sbin/rcorder/rcorder.8 ============================================================================== --- head/sbin/rcorder/rcorder.8 Fri Sep 16 03:36:43 2016 (r305856) +++ head/sbin/rcorder/rcorder.8 Fri Sep 16 04:08:34 2016 (r305857) @@ -1,7 +1,7 @@ .\" $NetBSD: rcorder.8,v 1.3 2000/07/17 14:16:22 mrg Exp $ .\" .\" Copyright (c) 1998 -.\" Perry E. Metzger. All rights reserved. +.\" Perry E. Metzger. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2011 +.Dd September 10, 2016 .Dt RCORDER 8 .Os .Sh NAME @@ -160,8 +160,11 @@ processing the stated file. .Sh HISTORY The .Nm -utility first appeared in +utility appeared in .Nx 1.5 . +.Nm +utility first appeared in +.Fx 5.0 . .Sh AUTHORS .An -nosplit Written by @@ -172,7 +175,7 @@ and The .Dq Li REQUIRE keyword is misleading: -It doesn't describe which daemons have to be running before a script +It does not describe which daemons have to be running before a script will be started. It describes which scripts must be placed before it in the dependency ordering. From owner-svn-src-all@freebsd.org Fri Sep 16 04:11:05 2016 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 73262BDBD0A; Fri, 16 Sep 2016 04:11:05 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41AD012A; Fri, 16 Sep 2016 04:11:05 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4B4Yb023739; Fri, 16 Sep 2016 04:11:04 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4B4RU023738; Fri, 16 Sep 2016 04:11:04 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160411.u8G4B4RU023738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305858 - head/sbin/reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:11:05 -0000 Author: allanjude Date: Fri Sep 16 04:11:04 2016 New Revision: 305858 URL: https://svnweb.freebsd.org/changeset/base/305858 Log: sbin/reboot/reboot.8: Amend HISTORY A standalone reboot utility showed up in 4.0BSD, in AT&T UNIX init has a case for reboot and is present in the version shipped with V5 either way, current entry is incorrect. PR: 212548 Submitted by: Sevan Janiyan Modified: head/sbin/reboot/reboot.8 Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Fri Sep 16 04:08:34 2016 (r305857) +++ head/sbin/reboot/reboot.8 Fri Sep 16 04:11:04 2016 (r305858) @@ -28,7 +28,7 @@ .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd Dec 12, 2015 +.Dd September 10, 2016 .Dt REBOOT 8 .Os .Sh NAME @@ -165,4 +165,4 @@ reboot -r A .Nm utility appeared in -.At v6 . +.Bx 4.0 . From owner-svn-src-all@freebsd.org Fri Sep 16 04:12:33 2016 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 E78DBBDBF1C; Fri, 16 Sep 2016 04:12:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2497670; Fri, 16 Sep 2016 04:12:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4CWZF027290; Fri, 16 Sep 2016 04:12:32 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4CWMx027289; Fri, 16 Sep 2016 04:12:32 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160412.u8G4CWMx027289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305859 - head/sbin/umount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:12:34 -0000 Author: allanjude Date: Fri Sep 16 04:12:32 2016 New Revision: 305859 URL: https://svnweb.freebsd.org/changeset/base/305859 Log: sbin/umount/umount.8: Amend HISTORY umount first appeared in V1, confirmed using TUHS archive http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1 PR: 212554 Submitted by: Sevan Janiyan Modified: head/sbin/umount/umount.8 Modified: head/sbin/umount/umount.8 ============================================================================== --- head/sbin/umount/umount.8 Fri Sep 16 04:11:04 2016 (r305858) +++ head/sbin/umount/umount.8 Fri Sep 16 04:12:32 2016 (r305859) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd July 7, 2016 +.Dd September 10, 2016 .Dt UMOUNT 8 .Os .Sh NAME @@ -158,4 +158,4 @@ file system table A .Nm utility appeared in -.At v6 . +.At v1 . From owner-svn-src-all@freebsd.org Fri Sep 16 04:22:22 2016 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 74042BDC478; Fri, 16 Sep 2016 04:22:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F433C9D; Fri, 16 Sep 2016 04:22:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4MLGi031063; Fri, 16 Sep 2016 04:22:21 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4MLN0031061; Fri, 16 Sep 2016 04:22:21 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201609160422.u8G4MLN0031061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 16 Sep 2016 04:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305860 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:22:22 -0000 Author: araujo Date: Fri Sep 16 04:22:21 2016 New Revision: 305860 URL: https://svnweb.freebsd.org/changeset/base/305860 Log: Add an option called "random" that combined with "ether" can generate a random MAC address for an Ethernet interface. PR: 211984 Submitted by: pi@ Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock Approved by: wblock (manpages) Modified: head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/af_link.c ============================================================================== --- head/sbin/ifconfig/af_link.c Fri Sep 16 04:12:32 2016 (r305859) +++ head/sbin/ifconfig/af_link.c Fri Sep 16 04:22:21 2016 (r305860) @@ -90,13 +90,23 @@ link_getaddr(const char *addr, int which if (which != ADDR) errx(1, "can't set link-level netmask or broadcast"); - if ((temp = malloc(strlen(addr) + 2)) == NULL) - errx(1, "malloc failed"); - temp[0] = ':'; - strcpy(temp + 1, addr); - sdl.sdl_len = sizeof(sdl); - link_addr(temp, &sdl); - free(temp); + if (!strcmp(addr, "random")) { + sdl.sdl_len = sizeof(sdl); + sdl.sdl_alen = ETHER_ADDR_LEN; + sdl.sdl_nlen = 0; + sdl.sdl_family = AF_LINK; + arc4random_buf(&sdl.sdl_data, ETHER_ADDR_LEN); + /* Non-multicast and claim it is a hardware address */ + sdl.sdl_data[0] &= 0xfc; + } else { + if ((temp = malloc(strlen(addr) + 2)) == NULL) + errx(1, "malloc failed"); + temp[0] = ':'; + strcpy(temp + 1, addr); + sdl.sdl_len = sizeof(sdl); + link_addr(temp, &sdl); + free(temp); + } if (sdl.sdl_alen > sizeof(sa->sa_data)) errx(1, "malformed link-level address"); sa->sa_family = AF_LINK; Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:12:32 2016 (r305859) +++ head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:22:21 2016 (r305860) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 8, 2016 +.Dd September 17, 2016 .Dt IFCONFIG 8 .Os .Sh NAME @@ -145,6 +145,12 @@ is specified as a series of colon-separa This can be used to, for example, set a new MAC address on an Ethernet interface, though the mechanism used is not Ethernet specific. +Use the +.Pq Dq random +keyword to set a randomly generated MAC address. +A randomly-generated MAC address might be the same as one already in use +in the network. +Such duplications are extremely unlikely. If the interface is already up when this option is used, it will be briefly brought down and then brought back up again in order to ensure that the receive @@ -254,7 +260,7 @@ Display subnet masks in dotted quad nota .br 255.255.0.0 or 255.255.255.192 .It Sy hex -Display subnet masks in hexidecimal, for example: +Display subnet masks in hexadecimal, for example: .br 0xffff0000 or 0xffffffc0 .El @@ -2615,13 +2621,13 @@ and .Cm vlandev must both be set at the same time. .It Cm vlanpcp Ar priority_code_point -Priority code point +Priority code point .Pq Dv PCP is an 3-bit field which refers to the IEEE 802.1p class of service and maps to the frame priority level. .Pp Values in order of priority are: -.Cm 1 +.Cm 1 .Pq Dv Background (lowest) , .Cm 0 .Pq Dv Best effort (default) , @@ -2759,7 +2765,7 @@ interface to send the frame directly to broadcasting the frame to the multicast group. This is the default. .It Fl vxlanlearn -The forwarding table is not populated by recevied packets. +The forwarding table is not populated by received packets. .It Cm vxlanflush Delete all dynamically-learned addresses from the forwarding table. .It Cm vxlanflushall From owner-svn-src-all@freebsd.org Fri Sep 16 04:28:34 2016 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 0B032BDC547; Fri, 16 Sep 2016 04:28:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9AA0F43; Fri, 16 Sep 2016 04:28:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4SXLC031459; Fri, 16 Sep 2016 04:28:33 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4SV2F031448; Fri, 16 Sep 2016 04:28:31 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160428.u8G4SV2F031448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305861 - in head/sbin: geom/class/multipath ggate/ggatec ggate/ggated ggate/ggatel hastctl hastd iscontrol mdmfs mount_nfs nandfs nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:28:34 -0000 Author: allanjude Date: Fri Sep 16 04:28:31 2016 New Revision: 305861 URL: https://svnweb.freebsd.org/changeset/base/305861 Log: Add missing history sections to a number of storage related man pages gmultipath.8: Add HISTORY Adjust sentences with bad phrases picked up by igor ggatec.8: Add HISTORY ggated.8: Add HISTORY ggatel.8: Add HISTORY Seperate out sentence as advised by igor. hastctl.8: Add HISTORY hastd.8: Add HISTORY Fix sentence highlighted by igor. iscontrol.8: Add HISTORY mdmfs.8: Add HISTORY Address issues raised by igor mount_nfs.8: Add HISTORY Not sure where mount_nfs first showed up, but the verison used in the BSD's originates from 4.4BSD according to CSRG archive. Though commercial offerings from Sun and others covers older systems, eg https://groups.google.com/forum/#!topic/net.unix-wizards/lMe7aQikqJI nandfs.8: Add HISTORY Adjust sentence in description to address bad phrase highlighted by igor. nvmecontrol.8: Add HISTORY PR: 212491 PR: 212498 PR: 212499 PR: 212500 PR: 212501 PR: 212502 PR: 212505 PR: 212508 PR: 212540 PR: 212543 PR: 212546 Submitted by: Sevan Janiyan Modified: head/sbin/geom/class/multipath/gmultipath.8 head/sbin/ggate/ggatec/ggatec.8 head/sbin/ggate/ggated/ggated.8 head/sbin/ggate/ggatel/ggatel.8 head/sbin/hastctl/hastctl.8 head/sbin/hastd/hastd.8 head/sbin/iscontrol/iscontrol.8 head/sbin/mdmfs/mdmfs.8 head/sbin/mount_nfs/mount_nfs.8 head/sbin/nandfs/nandfs.8 head/sbin/nvmecontrol/nvmecontrol.8 Modified: head/sbin/geom/class/multipath/gmultipath.8 ============================================================================== --- head/sbin/geom/class/multipath/gmultipath.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/geom/class/multipath/gmultipath.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2015 +.Dd September 8, 2016 .Dt GMULTIPATH 8 .Os .Sh NAME @@ -255,12 +255,11 @@ When this occurs, that path is marked FA in a list is selected as active and the failed I/O reissued. In Active/Active mode all paths not marked FAIL may handle I/O at the same time. Requests are distributed between paths to equalize load. -For capable devices it allows to utilize the bandwidth of all paths. +For capable devices it allows the utilisation of the bandwidth available on all paths. In Active/Read mode all paths not marked FAIL may handle reads at the same time, but unlike in Active/Active mode only one path handles write requests at any -point in time. -It allows to closer follow the original write request order if the layer above -needs it for data consistency (not waiting for requisite write completion +point in time; closely following the original write request order if the layer +above needs it for data consistency (not waiting for requisite write completion before sending dependent write). .Pp When new devices are added to the system the @@ -368,6 +367,11 @@ geom_multipath_load="YES" .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.0 .Sh AUTHORS .An Matthew Jacob Aq Mt mjacob@FreeBSD.org .An Alexander Motin Aq Mt mav@FreeBSD.org Modified: head/sbin/ggate/ggatec/ggatec.8 ============================================================================== --- head/sbin/ggate/ggatec/ggatec.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/ggate/ggatec/ggatec.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2016 +.Dd September 8, 2016 .Dt GGATEC 8 .Os .Sh NAME @@ -173,6 +173,11 @@ client# mount_cd9660 /dev/ggate0 /cdrom .Xr ggated 8 , .Xr ggatel 8 , .Xr mount_cd9660 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.3 . .Sh AUTHORS The .Nm Modified: head/sbin/ggate/ggated/ggated.8 ============================================================================== --- head/sbin/ggate/ggated/ggated.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/ggate/ggated/ggated.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2016 +.Dd September 8, 2016 .Dt GGATED 8 .Os .Sh NAME @@ -116,6 +116,11 @@ Export CD-ROM device and a file: .Xr geom 4 , .Xr ggatec 8 , .Xr ggatel 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.3 . .Sh AUTHORS The .Nm Modified: head/sbin/ggate/ggatel/ggatel.8 ============================================================================== --- head/sbin/ggate/ggatel/ggatel.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/ggate/ggatel/ggatel.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd September 8, 2016 .Dt GGATEL 8 .Os .Sh NAME @@ -80,7 +80,8 @@ List providers. .It Cm rescue Take over a previously created provider and handle pending and future -requests. This is useful if the initial +requests. +This is useful if the initial .Nm process died. To prevent data loss, the given path must lead to the @@ -151,6 +152,11 @@ ggatel destroy -u 5 .Xr ggated 8 , .Xr mount 8 , .Xr newfs 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.3 . .Sh AUTHORS The .Nm Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/hastctl/hastctl.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2013 +.Dd September 8, 2016 .Dt HASTCTL 8 .Os .Sh NAME @@ -220,6 +220,11 @@ nodeB# application_start .Xr hastd 8 , .Xr mount 8 , .Xr newfs 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 8.1 . .Sh AUTHORS The .Nm Modified: head/sbin/hastd/hastd.8 ============================================================================== --- head/sbin/hastd/hastd.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/hastd/hastd.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 1, 2010 +.Dd September 8, 2016 .Dt HASTD 8 .Os .Sh NAME @@ -44,8 +44,8 @@ The daemon is responsible for managing highly available GEOM providers. .Pp .Nm -allows to transparently store data on two physically separated machines -connected over the TCP/IP network. +allows the transpaent storage of data on two physically separated machines +connected over a TCP/IP network. Only one machine (cluster node) can actively use storage provided by .Nm . This machine is called primary. @@ -224,6 +224,11 @@ nodeA# mount -o noatime /dev/hast/shared .Xr mount 8 , .Xr newfs 8 , .Xr g_bio 9 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 8.1 . .Sh AUTHORS The .Nm Modified: head/sbin/iscontrol/iscontrol.8 ============================================================================== --- head/sbin/iscontrol/iscontrol.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/iscontrol/iscontrol.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2014 +.Dd September 9, 2016 .Dt ISCONTROL 8 .Os .Sh NAME @@ -125,7 +125,11 @@ whatever options are specified, and star .Xr iscsictl 8 .Sh STANDARDS RFC 3720 -.\"Sh HISTORY +.Sh HISTORY +The +.Nm +utility appeared in +Fx 7.0 . .Sh BUGS .Nm should probably load the iscsi_initiator module if needed. Modified: head/sbin/mdmfs/mdmfs.8 ============================================================================== --- head/sbin/mdmfs/mdmfs.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/mdmfs/mdmfs.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2016 +.Dd September 9, 2016 .Dt MDMFS 8 .Os .Sh NAME @@ -127,7 +127,8 @@ to try to detach the unit before attachi .It Fl d Ar max-extent-size The file system may choose to store large files using extents. This parameter specifies the largest extent size that may be -used. It is presently limited to its default value which is 16 +used. +It is presently limited to its default value which is 16 times the file system blocksize. .It Fl E Ar path-mdconfig Use @@ -311,8 +312,8 @@ option is passed to .Xr mount 8 as .Fl t . -See the programs that the options are passed to for more information -on their semantics. +For information on semantics, refer to the documentation of the programs +that the options are passed to. .Sh EXAMPLES Create and mount a 32 megabyte swap-backed file system on .Pa /tmp : @@ -394,5 +395,10 @@ was given on the command line. .Xr mdconfig 8 , .Xr mount 8 , .Xr newfs 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.0 . .Sh AUTHORS .An Dima Dorfman Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/mount_nfs/mount_nfs.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd October 30, 2014 +.Dd September 10, 2016 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -183,8 +183,8 @@ for positive name cache entries. If this is set to 0 it disables positive name caching for the mount point. .It Cm negnametimeo Ns = Ns Aq Ar value Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds) -for negative name cache entries. If this is set to 0 it disables negative -name caching for the mount point. +for negative name cache entries. +If this is set to 0 it disables negative name caching for the mount point. .It Cm nfsv2 Use the NFS Version 2 protocol (the default is to try version 3 first then version 2). @@ -262,7 +262,7 @@ such that the dirty byte range becomes a that are dirty. This reduces the number of writes significantly for software builds. -The merging of byte ranges isn't done if the file has been file +The merging of byte ranges is not done if the file has been file locked, since most applications modifying a file from multiple clients will use file locking. As such, this option could result in a corrupted file for the @@ -271,8 +271,9 @@ clients concurrently without using file .It Cm principal For the RPCSEC_GSS security flavors, such as krb5, krb5i and krb5p, this option sets the name of the host based principal name expected -by the server. This option overrides the default, which will be -``nfs@'' and should normally be sufficient. +by the server. +This option overrides the default, which will be ``nfs@'' +and should normally be sufficient. .It Cm noresvport Do .Em not @@ -515,6 +516,11 @@ Same as .Xr nfsd 8 , .Xr nfsiod 8 , .Xr showmount 8 +.Sh HISTORY +A version of the +.Nm +utility appeared in +.Bx 4.4 . .Sh BUGS Since nfsv4 performs open/lock operations that have their ordering strictly enforced by the server, the options Modified: head/sbin/nandfs/nandfs.8 ============================================================================== --- head/sbin/nandfs/nandfs.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/nandfs/nandfs.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 10, 2016 .Dt NANDFS 8 .Os .Sh NAME @@ -48,7 +48,7 @@ .Sh DESCRIPTION The .Nm -utility allows to manage snapshots of a mounted NAND FS. +utility allows the management of snapshots on a mounted NAND FS. .Sh EXAMPLES Create a snapshot of filesystem mounted on .Em /nand . @@ -69,6 +69,11 @@ Remove snapshot 1 of filesystem mounted .Bd -literal -offset 2n .Li # Ic nandfs rmsnap 1 /nand .Ed +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 10.0 . .Sh AUTHORS This utility and manual page were written by .An Mateusz Guzik . Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/nvmecontrol/nvmecontrol.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 26, 2013 +.Dd September 10, 2016 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -94,9 +94,9 @@ Display an hexadecimal dump of the nvme0 .Pp .Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1 .Pp -Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each -thread will issue a single 512 byte read command. Results are printed to -stdout when 30 seconds expires. +Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. +Each thread will issue a single 512 byte read command. +Results are printed to stdout when 30 seconds expires. .Pp .Dl nvmecontrol reset nvme0 .Pp @@ -137,6 +137,11 @@ Set the current power mode. .Dl nvmecontrol power nvme0 .Pp Get the current power mode. +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.2 . .Sh AUTHORS .An -nosplit .Nm From owner-svn-src-all@freebsd.org Fri Sep 16 04:29:09 2016 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 6859FBDC616; Fri, 16 Sep 2016 04:29:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002: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 160C71E1; Fri, 16 Sep 2016 04:29:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id u82so75624865ywc.2; Thu, 15 Sep 2016 21:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lGutiF2CrFCN7aeqxzDNnm4yTTbO9VEp6P5h0k1nhQE=; b=WeZKTy7A9x6nx3VOY4hRnVdmXuUWn9Ft7Q8sre3dOmgSv4rM1+DWEHimW8cmi82n7Q zfK7In8y4SzFq3bMA8iZJMusXsXH/LW/TVsPyvHoX3LIR8jtPZyV5vSsOW8+703GC3Yy u529Og3hMkBohxf6FvqIxiRsXtfPah6Np5HgPrMkGfIndNlIgRfTT+BmCPkxV9Lx4Hqd 7CT1f01HiRwMlGj2CTFSwptPNzukewxHLNi7KAA4zzhczMERuhGvkj3HPqfZSuWCVdIC Kld6EcFO+GuKRU0Hh2nlMORFNwvOpf0YvzWKiMyoSDIXwveLcTh1dRGMbutyhf1Q+qhJ ol0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=lGutiF2CrFCN7aeqxzDNnm4yTTbO9VEp6P5h0k1nhQE=; b=TFCPAe2JAzQxfOWPTl546u0VtAq3QQc6NJkRW4Cu7ZzjqtEr5EVPVuUMqwxnyoBaXI UDHBFYW1wFiM15wt7JQVWVLQEUm0p77czvrz0XjUcMWCbfrYecNB3JSoDEyPIhY2l5rN LRuporvbzvNG7r3odpWA5BocjhY65+YOg//F0pqnhagPEm/WPbwyXOl5Zjhigyr+jZMB I4YVtNPnOBx6i7jk2r3eCWkm0UXAG1EDlWXA/Z9ZHIAhsdgKIm1fl6o6zll3qTfkyfUh 56yMy3q3P3ayETlzOmnhy0lH3r1G/sHDCSCfGO15AGHf/lzRobWytKm3FzP/JoL0glEn wCrg== X-Gm-Message-State: AE9vXwOa2sTyXrUcsOai+xhox7xaXMMi4clVccLdoVulPvFeaIl7E2m3hGPp6Ljq7UM4Iatx3XYgFROx+HXLEQ== X-Received: by 10.13.198.194 with SMTP id i185mr11802644ywd.132.1474000148175; Thu, 15 Sep 2016 21:29:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.56.130 with HTTP; Thu, 15 Sep 2016 21:29:07 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <201609160422.u8G4MLN0031061@repo.freebsd.org> References: <201609160422.u8G4MLN0031061@repo.freebsd.org> From: Marcelo Araujo Date: Fri, 16 Sep 2016 12:29:07 +0800 Message-ID: Subject: Re: svn commit: r305860 - head/sbin/ifconfig To: Marcelo Araujo 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.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:29:09 -0000 Ooops! Forgot to add the review link: https://reviews.freebsd.org/D7615 Best, 2016-09-16 12:22 GMT+08:00 Marcelo Araujo : > Author: araujo > Date: Fri Sep 16 04:22:21 2016 > New Revision: 305860 > URL: https://svnweb.freebsd.org/changeset/base/305860 > > Log: > Add an option called "random" that combined with "ether" can generate a > random MAC address for an Ethernet interface. > > PR: 211984 > Submitted by: pi@ > Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock > Approved by: wblock (manpages) > > Modified: > head/sbin/ifconfig/af_link.c > head/sbin/ifconfig/ifconfig.8 > > Modified: head/sbin/ifconfig/af_link.c > ============================================================ > ================== > --- head/sbin/ifconfig/af_link.c Fri Sep 16 04:12:32 2016 > (r305859) > +++ head/sbin/ifconfig/af_link.c Fri Sep 16 04:22:21 2016 > (r305860) > @@ -90,13 +90,23 @@ link_getaddr(const char *addr, int which > > if (which != ADDR) > errx(1, "can't set link-level netmask or broadcast"); > - if ((temp = malloc(strlen(addr) + 2)) == NULL) > - errx(1, "malloc failed"); > - temp[0] = ':'; > - strcpy(temp + 1, addr); > - sdl.sdl_len = sizeof(sdl); > - link_addr(temp, &sdl); > - free(temp); > + if (!strcmp(addr, "random")) { > + sdl.sdl_len = sizeof(sdl); > + sdl.sdl_alen = ETHER_ADDR_LEN; > + sdl.sdl_nlen = 0; > + sdl.sdl_family = AF_LINK; > + arc4random_buf(&sdl.sdl_data, ETHER_ADDR_LEN); > + /* Non-multicast and claim it is a hardware address */ > + sdl.sdl_data[0] &= 0xfc; > + } else { > + if ((temp = malloc(strlen(addr) + 2)) == NULL) > + errx(1, "malloc failed"); > + temp[0] = ':'; > + strcpy(temp + 1, addr); > + sdl.sdl_len = sizeof(sdl); > + link_addr(temp, &sdl); > + free(temp); > + } > if (sdl.sdl_alen > sizeof(sa->sa_data)) > errx(1, "malformed link-level address"); > sa->sa_family = AF_LINK; > > Modified: head/sbin/ifconfig/ifconfig.8 > ============================================================ > ================== > --- head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:12:32 2016 > (r305859) > +++ head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:22:21 2016 > (r305860) > @@ -28,7 +28,7 @@ > .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 > .\" $FreeBSD$ > .\" > -.Dd June 8, 2016 > +.Dd September 17, 2016 > .Dt IFCONFIG 8 > .Os > .Sh NAME > @@ -145,6 +145,12 @@ is specified as a series of colon-separa > This can be used to, for example, > set a new MAC address on an Ethernet interface, though the > mechanism used is not Ethernet specific. > +Use the > +.Pq Dq random > +keyword to set a randomly generated MAC address. > +A randomly-generated MAC address might be the same as one already in use > +in the network. > +Such duplications are extremely unlikely. > If the interface is already > up when this option is used, it will be briefly brought down and > then brought back up again in order to ensure that the receive > @@ -254,7 +260,7 @@ Display subnet masks in dotted quad nota > .br > 255.255.0.0 or 255.255.255.192 > .It Sy hex > -Display subnet masks in hexidecimal, for example: > +Display subnet masks in hexadecimal, for example: > .br > 0xffff0000 or 0xffffffc0 > .El > @@ -2615,13 +2621,13 @@ and > .Cm vlandev > must both be set at the same time. > .It Cm vlanpcp Ar priority_code_point > -Priority code point > +Priority code point > .Pq Dv PCP > is an 3-bit field which refers to the IEEE 802.1p > class of service and maps to the frame priority level. > .Pp > Values in order of priority are: > -.Cm 1 > +.Cm 1 > .Pq Dv Background (lowest) , > .Cm 0 > .Pq Dv Best effort (default) , > @@ -2759,7 +2765,7 @@ interface to send the frame directly to > broadcasting the frame to the multicast group. > This is the default. > .It Fl vxlanlearn > -The forwarding table is not populated by recevied packets. > +The forwarding table is not populated by received packets. > .It Cm vxlanflush > Delete all dynamically-learned addresses from the forwarding table. > .It Cm vxlanflushall > _______________________________________________ > 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" > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Fri Sep 16 04:58:39 2016 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 1AA70BDC0A8; Fri, 16 Sep 2016 04:58:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2D3D8D0; Fri, 16 Sep 2016 04:58:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4wcRg042652; Fri, 16 Sep 2016 04:58:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4wb8U042650; Fri, 16 Sep 2016 04:58:37 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160458.u8G4wb8U042650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 04:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305862 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 04:58:39 -0000 Author: bde Date: Fri Sep 16 04:58:37 2016 New Revision: 305862 URL: https://svnweb.freebsd.org/changeset/base/305862 Log: (1) Ifdef the new dr6 variable for KDB. While here, avoid using the old variable 'code' and remove it in trap(). ('code' was meant for holding things like %dr6, but is too small to hold %dr6 on amd64 and was reduced to an obfuscation of tf_err, with early truncation on amd64.) Submitted by: Michael Butler (imb@...) Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Sep 16 04:28:31 2016 (r305861) +++ head/sys/amd64/amd64/trap.c Fri Sep 16 04:58:37 2016 (r305862) @@ -176,8 +176,10 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; +#ifdef KDB register_t dr6; - int i = 0, ucode = 0, code; +#endif + int i = 0, ucode = 0; u_int type; register_t addr = 0; ksiginfo_t ksi; @@ -259,8 +261,6 @@ trap(struct trapframe *frame) } } - code = frame->tf_err; - if (TRAPF_USERMODE(frame)) { /* user trap */ @@ -378,7 +378,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton @@ -564,7 +564,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Sep 16 04:28:31 2016 (r305861) +++ head/sys/i386/i386/trap.c Fri Sep 16 04:58:37 2016 (r305862) @@ -189,8 +189,10 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; +#ifdef KDB register_t dr6; - int i = 0, ucode = 0, code; +#endif + int i = 0, ucode = 0; u_int type; register_t addr = 0; vm_offset_t eva; @@ -293,7 +295,6 @@ trap(struct trapframe *frame) } } eva = 0; - code = frame->tf_err; if (type == T_PAGEFLT) { /* * For some Cyrix CPUs, %cr2 is clobbered by @@ -467,7 +468,7 @@ user_trctrap_out: goto userout; #else /* !POWERFAIL_NMI */ /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton @@ -730,7 +731,7 @@ kernel_trctrap: goto out; #else /* !POWERFAIL_NMI */ /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton From owner-svn-src-all@freebsd.org Fri Sep 16 05:33:09 2016 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 477D9BDCBB7; Fri, 16 Sep 2016 05:33:09 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4A6C52; Fri, 16 Sep 2016 05:33:09 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G5X8Cl057324; Fri, 16 Sep 2016 05:33:08 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G5X80j057323; Fri, 16 Sep 2016 05:33:08 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201609160533.u8G5X80j057323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 16 Sep 2016 05:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305863 - head/sbin/natd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 05:33:09 -0000 Author: araujo Date: Fri Sep 16 05:33:08 2016 New Revision: 305863 URL: https://svnweb.freebsd.org/changeset/base/305863 Log: Invert calloc(3) argument order. Reviewed by: ed. MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7902 Modified: head/sbin/natd/natd.c Modified: head/sbin/natd/natd.c ============================================================================== --- head/sbin/natd/natd.c Fri Sep 16 04:58:37 2016 (r305862) +++ head/sbin/natd/natd.c Fri Sep 16 05:33:08 2016 (r305863) @@ -2006,7 +2006,7 @@ NewInstance(const char *name) } } ninstance++; - ip = calloc(sizeof *ip, 1); + ip = calloc(1, sizeof(*ip)); ip->name = strdup(name); ip->la = LibAliasInit (ip->la); ip->assignAliasAddr = 0; From owner-svn-src-all@freebsd.org Fri Sep 16 06:31:11 2016 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 ED794BDB77B; Fri, 16 Sep 2016 06:31:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9B33666; Fri, 16 Sep 2016 06:31:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G6VALE076233; Fri, 16 Sep 2016 06:31:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G6VAwE076232; Fri, 16 Sep 2016 06:31:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160631.u8G6VAwE076232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 06:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305864 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 06:31:12 -0000 Author: bde Date: Fri Sep 16 06:31:10 2016 New Revision: 305864 URL: https://svnweb.freebsd.org/changeset/base/305864 Log: Statically initialize the run mode to the one that will become current on first entry. This fixes a spurious "Stepping aborted" message when the first entry is for a breakpoint. Don't reset to the run mode to STEP_NONE when stopping, and remove STEP_NONE. This mode was never really used, except transiently to mis-decide whether to print the message on first entry. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Fri Sep 16 05:33:08 2016 (r305863) +++ head/sys/ddb/db_run.c Fri Sep 16 06:31:10 2016 (r305864) @@ -48,14 +48,13 @@ __FBSDID("$FreeBSD$"); #include #include -static int db_run_mode; -#define STEP_NONE 0 #define STEP_ONCE 1 #define STEP_RETURN 2 #define STEP_CALLT 3 #define STEP_CONTINUE 4 #define STEP_INVISIBLE 5 #define STEP_COUNT 6 +static int db_run_mode = STEP_CONTINUE; static bool db_sstep_multiple; static bool db_sstep_print; @@ -150,7 +149,6 @@ db_stop_at_pc(int type, int code, bool * #endif if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) { printf("Stepping aborted\n"); - db_run_mode = STEP_NONE; return (true); } @@ -203,7 +201,6 @@ db_stop_at_pc(int type, int code, bool * return (false); /* continue */ } } - db_run_mode = STEP_NONE; return (true); } From owner-svn-src-all@freebsd.org Fri Sep 16 07:09:37 2016 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 375BCBDC4C2; Fri, 16 Sep 2016 07:09:37 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB88BE1F; Fri, 16 Sep 2016 07:09:36 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G79aAH091772; Fri, 16 Sep 2016 07:09:36 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G79Z99091770; Fri, 16 Sep 2016 07:09:35 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160709.u8G79Z99091770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 07:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305865 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 07:09:37 -0000 Author: bde Date: Fri Sep 16 07:09:35 2016 New Revision: 305865 URL: https://svnweb.freebsd.org/changeset/base/305865 Log: Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the i386-only section, and fix a comment about the amd64 kernel trapframe not having stackregs. tf_rsp doesn't need decoding on amd64, but had an old clone of i386 code to do this in 1 place, and since the amd64 kernel trapframe does have stackregs, the result was an off-by-16 error for %rsp in an error message. Modified: head/sys/amd64/amd64/trap.c head/sys/x86/include/frame.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Sep 16 06:31:10 2016 (r305864) +++ head/sys/amd64/amd64/trap.c Fri Sep 16 07:09:35 2016 (r305865) @@ -776,7 +776,6 @@ trap_fatal(frame, eva) { int code, ss; u_int type; - long esp; struct soft_segment_descriptor softseg; char *msg; @@ -807,14 +806,8 @@ trap_fatal(frame, eva) } printf("instruction pointer = 0x%lx:0x%lx\n", frame->tf_cs & 0xffff, frame->tf_rip); - if (TF_HAS_STACKREGS(frame)) { - ss = frame->tf_ss & 0xffff; - esp = frame->tf_rsp; - } else { - ss = GSEL(GDATA_SEL, SEL_KPL); - esp = (long)&frame->tf_rsp; - } - printf("stack pointer = 0x%x:0x%lx\n", ss, esp); + ss = frame->tf_ss & 0xffff; + printf("stack pointer = 0x%x:0x%lx\n", ss, frame->tf_rsp); printf("frame pointer = 0x%x:0x%lx\n", ss, frame->tf_rbp); printf("code segment = base 0x%lx, limit 0x%lx, type 0x%x\n", softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type); Modified: head/sys/x86/include/frame.h ============================================================================== --- head/sys/x86/include/frame.h Fri Sep 16 06:31:10 2016 (r305864) +++ head/sys/x86/include/frame.h Fri Sep 16 07:09:35 2016 (r305865) @@ -98,6 +98,15 @@ struct trapframe_vm86 { int tf_vm86_fs; int tf_vm86_gs; }; + +/* + * This alias for the MI TRAPF_USERMODE() should be used when we don't + * care about user mode itself, but need to know if a frame has stack + * registers. The difference is only logical, but on i386 the logic + * for using TRAPF_USERMODE() is complicated by sometimes treating vm86 + * bioscall mode (which is a special ring 3 user mode) as kernel mode. + */ +#define TF_HAS_STACKREGS(tf) TRAPF_USERMODE(tf) #endif /* __i386__ */ #ifdef __amd64__ @@ -136,7 +145,7 @@ struct trapframe { register_t tf_rip; register_t tf_cs; register_t tf_rflags; - /* below only when crossing rings (user to kernel) */ + /* the amd64 frame always has the stack registers */ register_t tf_rsp; register_t tf_ss; }; @@ -146,13 +155,4 @@ struct trapframe { #define TF_HASFPXSTATE 0x4 #endif /* __amd64__ */ -/* - * This alias for the MI TRAPF_USERMODE() should be used when we don't - * care about user mode itself, but need to know if a frame has stack - * registers. The difference is only logical, but on i386 the logic - * for using TRAPF_USERMODE() is complicated by sometimes treating vm86 - * bioscall mode (which is a special ring 3 user mode) as kernel mode. - */ -#define TF_HAS_STACKREGS(tf) TRAPF_USERMODE(tf) - #endif /* _MACHINE_FRAME_H_ */ From owner-svn-src-all@freebsd.org Fri Sep 16 10:04:31 2016 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 9FAC3BDC141; Fri, 16 Sep 2016 10:04:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4F912C; Fri, 16 Sep 2016 10:04:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GA4UbB059899; Fri, 16 Sep 2016 10:04:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GA4SUY059878; Fri, 16 Sep 2016 10:04:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609161004.u8GA4SUY059878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Sep 2016 10:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305866 - in stable/11: lib/libc lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/sys lib/libc/x86 sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 10:04:31 -0000 Author: kib Date: Fri Sep 16 10:04:28 2016 New Revision: 305866 URL: https://svnweb.freebsd.org/changeset/base/305866 Log: MFC r304285: Implement userspace gettimeofday(2) with HPET timecounter. Added: stable/11/lib/libc/x86/ - copied from r304285, head/lib/libc/x86/ Deleted: stable/11/lib/libc/amd64/sys/__vdso_gettc.c stable/11/lib/libc/i386/sys/__vdso_gettc.c Modified: stable/11/lib/libc/Makefile stable/11/lib/libc/aarch64/sys/__vdso_gettc.c stable/11/lib/libc/amd64/sys/Makefile.inc stable/11/lib/libc/arm/sys/__vdso_gettc.c stable/11/lib/libc/i386/sys/Makefile.inc stable/11/lib/libc/sys/__vdso_gettimeofday.c stable/11/lib/libc/sys/trivial-vdso_tc.c stable/11/sys/arm/arm/generic_timer.c stable/11/sys/arm/arm/machdep.c stable/11/sys/arm/include/md_var.h stable/11/sys/arm/include/vdso.h stable/11/sys/arm64/arm64/machdep.c stable/11/sys/arm64/include/md_var.h stable/11/sys/arm64/include/vdso.h stable/11/sys/dev/acpica/acpi_hpet.c stable/11/sys/dev/acpica/acpi_hpet.h stable/11/sys/kern/kern_tc.c stable/11/sys/sys/timetc.h stable/11/sys/sys/vdso.h stable/11/sys/x86/include/vdso.h stable/11/sys/x86/x86/tsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/Makefile ============================================================================== --- stable/11/lib/libc/Makefile Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/Makefile Fri Sep 16 10:04:28 2016 (r305866) @@ -110,6 +110,9 @@ NOASM= ${LIBC_ARCH} == "mips" .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif +.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" +.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" +.endif .if ${MK_NIS} != "no" CFLAGS+= -DYP .include "${LIBC_SRCTOP}/yp/Makefile.inc" Modified: stable/11/lib/libc/aarch64/sys/__vdso_gettc.c ============================================================================== --- stable/11/lib/libc/aarch64/sys/__vdso_gettc.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/aarch64/sys/__vdso_gettc.c Fri Sep 16 10:04:28 2016 (r305866) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" static inline uint64_t @@ -55,14 +56,15 @@ cp15_cntpct_get(void) } #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); __asm __volatile("isb" : : : "memory"); - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); - return (val); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); } #pragma weak __vdso_gettimekeep Modified: stable/11/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/amd64/sys/Makefile.inc Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/amd64/sys/Makefile.inc Fri Sep 16 10:04:28 2016 (r305866) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ - amd64_set_gsbase.c __vdso_gettc.c + amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S Modified: stable/11/lib/libc/arm/sys/__vdso_gettc.c ============================================================================== --- stable/11/lib/libc/arm/sys/__vdso_gettc.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/arm/sys/__vdso_gettc.c Fri Sep 16 10:04:28 2016 (r305866) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" #if __ARM_ARCH >= 6 @@ -58,11 +59,12 @@ cp15_cntpct_get(void) #endif #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); #if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but @@ -70,11 +72,12 @@ __vdso_gettc(const struct vdso_timehands * armv7-a directive does not work. */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); #else - val = 0; + *tc = 0; + return (ENOSYS); #endif - return (val); } #pragma weak __vdso_gettimekeep Modified: stable/11/lib/libc/i386/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/i386/sys/Makefile.inc Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/i386/sys/Makefile.inc Fri Sep 16 10:04:28 2016 (r305866) @@ -5,8 +5,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c .endif SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ - i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ - __vdso_gettc.c + i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S syscall.S Modified: stable/11/lib/libc/sys/__vdso_gettimeofday.c ============================================================================== --- stable/11/lib/libc/sys/__vdso_gettimeofday.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/sys/__vdso_gettimeofday.c Fri Sep 16 10:04:28 2016 (r305866) @@ -34,12 +34,16 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -static u_int -tc_delta(const struct vdso_timehands *th) +static int +tc_delta(const struct vdso_timehands *th, u_int *delta) { + int error; + u_int tc; - return ((__vdso_gettc(th) - th->th_offset_count) & - th->th_counter_mask); + error = __vdso_gettc(th, &tc); + if (error == 0) + *delta = (tc - th->th_offset_count) & th->th_counter_mask; + return (error); } /* @@ -56,6 +60,8 @@ binuptime(struct bintime *bt, struct vds { struct vdso_timehands *th; uint32_t curr, gen; + u_int delta; + int error; do { if (!tk->tk_enabled) @@ -63,11 +69,14 @@ binuptime(struct bintime *bt, struct vds curr = atomic_load_acq_32(&tk->tk_current); th = &tk->tk_th[curr]; - if (th->th_algo != VDSO_TH_ALGO_1) - return (ENOSYS); gen = atomic_load_acq_32(&th->th_gen); *bt = th->th_offset; - bintime_addx(bt, th->th_scale * tc_delta(th)); + error = tc_delta(th, &delta); + if (error == EAGAIN) + continue; + if (error != 0) + return (error); + bintime_addx(bt, th->th_scale * delta); if (abs) bintime_add(bt, &th->th_boottime); Modified: stable/11/lib/libc/sys/trivial-vdso_tc.c ============================================================================== --- stable/11/lib/libc/sys/trivial-vdso_tc.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/lib/libc/sys/trivial-vdso_tc.c Fri Sep 16 10:04:28 2016 (r305866) @@ -32,11 +32,11 @@ __FBSDID("$FreeBSD$"); #include #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - return (0); + return (ENOSYS); } #pragma weak __vdso_gettimekeep Modified: stable/11/sys/arm/arm/generic_timer.c ============================================================================== --- stable/11/sys/arm/arm/generic_timer.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm/arm/generic_timer.c Fri Sep 16 10:04:28 2016 (r305866) @@ -105,6 +105,10 @@ static struct resource_spec timer_spec[] { -1, 0 } }; +static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +static void arm_tmr_do_delay(int usec, void *); + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -114,6 +118,7 @@ static struct timecounter arm_tmr_timeco .tc_counter_mask = ~0u, .tc_frequency = 0, .tc_quality = 1000, + .tc_fill_vdso_timehands = arm_tmr_fill_vdso_timehands, }; #ifdef __arm__ @@ -128,10 +133,6 @@ static struct timecounter arm_tmr_timeco #define set_el1(x, val) WRITE_SPECIALREG(x ##_el1, val) #endif -static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, - struct timecounter *tc); -static void arm_tmr_do_delay(int usec, void *); - static int get_freq(void) { @@ -412,8 +413,6 @@ arm_tmr_attach(device_t dev) } } - arm_cpu_fill_vdso_timehands = arm_tmr_fill_vdso_timehands; - arm_tmr_timecount.tc_frequency = sc->clkfreq; tc_init(&arm_tmr_timecount); @@ -535,7 +534,8 @@ arm_tmr_fill_vdso_timehands(struct vdso_ struct timecounter *tc) { + vdso_th->th_algo = VDSO_TH_ALGO_ARM_GENTIM; vdso_th->th_physical = arm_tmr_sc->physical; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (tc == &arm_tmr_timecount); + return (1); } Modified: stable/11/sys/arm/arm/machdep.c ============================================================================== --- stable/11/sys/arm/arm/machdep.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm/arm/machdep.c Fri Sep 16 10:04:28 2016 (r305866) @@ -1996,14 +1996,3 @@ initarm(struct arm_boot_params *abp) #endif /* __ARM_ARCH < 6 */ #endif /* FDT */ - -uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) -{ - - return (arm_cpu_fill_vdso_timehands != NULL ? - arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); -} Modified: stable/11/sys/arm/include/md_var.h ============================================================================== --- stable/11/sys/arm/include/md_var.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm/include/md_var.h Fri Sep 16 10:04:28 2016 (r305866) @@ -45,11 +45,6 @@ extern int (*_arm_bzero)(void *, int, in extern int _min_memcpy_size; extern int _min_bzero_size; -struct vdso_timehands; -struct timecounter; -extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - #define DST_IS_USER 0x1 #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 Modified: stable/11/sys/arm/include/vdso.h ============================================================================== --- stable/11/sys/arm/include/vdso.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm/include/vdso.h Fri Sep 16 10:04:28 2016 (r305866) @@ -32,4 +32,6 @@ uint32_t th_physical; \ uint32_t th_res[7]; +#define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 + #endif Modified: stable/11/sys/arm64/arm64/machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/machdep.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm64/arm64/machdep.c Fri Sep 16 10:04:28 2016 (r305866) @@ -927,17 +927,6 @@ initarm(struct arm64_bootparams *abp) early_boot = 0; } -uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) -{ - - return (arm_cpu_fill_vdso_timehands != NULL ? - arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); -} - #ifdef DDB #include Modified: stable/11/sys/arm64/include/md_var.h ============================================================================== --- stable/11/sys/arm64/include/md_var.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm64/include/md_var.h Fri Sep 16 10:04:28 2016 (r305866) @@ -47,9 +47,4 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); int minidumpsys(struct dumperinfo *); -struct vdso_timehands; -struct timecounter; -extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - #endif /* !_MACHINE_MD_VAR_H_ */ Modified: stable/11/sys/arm64/include/vdso.h ============================================================================== --- stable/11/sys/arm64/include/vdso.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/arm64/include/vdso.h Fri Sep 16 10:04:28 2016 (r305866) @@ -32,4 +32,6 @@ uint32_t th_physical; \ uint32_t th_res[7]; +#define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 + #endif /* !_MACHINE_VDSO_H_ */ Modified: stable/11/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_hpet.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/dev/acpica/acpi_hpet.c Fri Sep 16 10:04:28 2016 (r305866) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_compat.h" + #if defined(__amd64__) #define DEV_APIC #else @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -141,6 +144,35 @@ hpet_get_timecount(struct timecounter *t return (bus_read_4(sc->mem_res, HPET_MAIN_COUNTER)); } +uint32_t +hpet_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +{ + struct hpet_softc *sc; + + sc = tc->tc_priv; + vdso_th->th_algo = VDSO_TH_ALGO_X86_HPET; + vdso_th->th_x86_shift = 0; + vdso_th->th_x86_hpet_idx = device_get_unit(sc->dev); + bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); + return (sc->mmap_allow != 0); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc) +{ + struct hpet_softc *sc; + + sc = tc->tc_priv; + vdso_th32->th_algo = VDSO_TH_ALGO_X86_HPET; + vdso_th32->th_x86_shift = 0; + vdso_th32->th_x86_hpet_idx = device_get_unit(sc->dev); + bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); + return (sc->mmap_allow != 0); +} +#endif + static void hpet_enable(struct hpet_softc *sc) { @@ -537,6 +569,10 @@ hpet_attach(device_t dev) sc->tc.tc_quality = 950, sc->tc.tc_frequency = sc->freq; sc->tc.tc_priv = sc; + sc->tc.tc_fill_vdso_timehands = hpet_vdso_timehands; +#ifdef COMPAT_FREEBSD32 + sc->tc.tc_fill_vdso_timehands32 = hpet_vdso_timehands32; +#endif tc_init(&sc->tc); } /* If not disabled - setup and announce event timers. */ Modified: stable/11/sys/dev/acpica/acpi_hpet.h ============================================================================== --- stable/11/sys/dev/acpica/acpi_hpet.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/dev/acpica/acpi_hpet.h Fri Sep 16 10:04:28 2016 (r305866) @@ -64,4 +64,15 @@ #define HPET_MIN_CYCLES 128 /* Period considered reliable. */ +#ifdef _KERNEL +struct timecounter; +struct vdso_timehands; +struct vdso_timehands32; + +uint32_t hpet_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +uint32_t hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif + #endif /* !__ACPI_HPET_H__ */ Modified: stable/11/sys/kern/kern_tc.c ============================================================================== --- stable/11/sys/kern/kern_tc.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/kern/kern_tc.c Fri Sep 16 10:04:28 2016 (r305866) @@ -6,11 +6,14 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2011, 2015, 2016 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Julien Ridoux at the University * of Melbourne under sponsorship from the FreeBSD Foundation. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. */ #include @@ -2134,13 +2137,16 @@ tc_fill_vdso_timehands(struct vdso_timeh uint32_t enabled; th = timehands; - vdso_th->th_algo = VDSO_TH_ALGO_1; vdso_th->th_scale = th->th_scale; vdso_th->th_offset_count = th->th_offset_count; vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_offset = th->th_offset; vdso_th->th_boottime = th->th_boottime; - enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); + if (th->th_counter->tc_fill_vdso_timehands != NULL) { + enabled = th->th_counter->tc_fill_vdso_timehands(vdso_th, + th->th_counter); + } else + enabled = 0; if (!vdso_th_enable) enabled = 0; return (enabled); @@ -2154,7 +2160,6 @@ tc_fill_vdso_timehands32(struct vdso_tim uint32_t enabled; th = timehands; - vdso_th32->th_algo = VDSO_TH_ALGO_1; *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale; vdso_th32->th_offset_count = th->th_offset_count; vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; @@ -2162,7 +2167,11 @@ tc_fill_vdso_timehands32(struct vdso_tim *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; vdso_th32->th_boottime.sec = th->th_boottime.sec; *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac; - enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); + if (th->th_counter->tc_fill_vdso_timehands32 != NULL) { + enabled = th->th_counter->tc_fill_vdso_timehands32(vdso_th32, + th->th_counter); + } else + enabled = 0; if (!vdso_th_enable) enabled = 0; return (enabled); Modified: stable/11/sys/sys/timetc.h ============================================================================== --- stable/11/sys/sys/timetc.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/sys/timetc.h Fri Sep 16 10:04:28 2016 (r305866) @@ -28,8 +28,14 @@ */ struct timecounter; +struct vdso_timehands; +struct vdso_timehands32; typedef u_int timecounter_get_t(struct timecounter *); typedef void timecounter_pps_t(struct timecounter *); +typedef uint32_t timecounter_fill_vdso_timehands_t(struct vdso_timehands *, + struct timecounter *); +typedef uint32_t timecounter_fill_vdso_timehands32_t(struct vdso_timehands32 *, + struct timecounter *); struct timecounter { timecounter_get_t *tc_get_timecount; @@ -68,6 +74,8 @@ struct timecounter { /* Pointer to the timecounter's private parts. */ struct timecounter *tc_next; /* Pointer to the next timecounter. */ + timecounter_fill_vdso_timehands_t *tc_fill_vdso_timehands; + timecounter_fill_vdso_timehands32_t *tc_fill_vdso_timehands32; }; extern struct timecounter *timecounter; Modified: stable/11/sys/sys/vdso.h ============================================================================== --- stable/11/sys/sys/vdso.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/sys/vdso.h Fri Sep 16 10:04:28 2016 (r305866) @@ -53,6 +53,7 @@ struct vdso_timekeep { #define VDSO_TK_VER_1 0x1 #define VDSO_TK_VER_CURR VDSO_TK_VER_1 #define VDSO_TH_ALGO_1 0x1 +#define VDSO_TH_ALGO_2 0x2 #ifndef _KERNEL @@ -62,7 +63,7 @@ struct timezone; int __vdso_clock_gettime(clockid_t clock_id, struct timespec *ts); int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz); -u_int __vdso_gettc(const struct vdso_timehands *vdso_th); +int __vdso_gettc(const struct vdso_timehands *vdso_th, u_int *tc); int __vdso_gettimekeep(struct vdso_timekeep **tk); #endif Modified: stable/11/sys/x86/include/vdso.h ============================================================================== --- stable/11/sys/x86/include/vdso.h Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/x86/include/vdso.h Fri Sep 16 10:04:28 2016 (r305866) @@ -1,7 +1,11 @@ /*- * Copyright 2012 Konstantin Belousov . + * Copyright 2016 The FreeBSD Foundation. * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -30,7 +34,11 @@ #define VDSO_TIMEHANDS_MD \ uint32_t th_x86_shift; \ - uint32_t th_res[7]; + uint32_t th_x86_hpet_idx; \ + uint32_t th_res[6]; + +#define VDSO_TH_ALGO_X86_TSC VDSO_TH_ALGO_1 +#define VDSO_TH_ALGO_X86_HPET VDSO_TH_ALGO_2 #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: stable/11/sys/x86/x86/tsc.c ============================================================================== --- stable/11/sys/x86/x86/tsc.c Fri Sep 16 07:09:35 2016 (r305865) +++ stable/11/sys/x86/x86/tsc.c Fri Sep 16 10:04:28 2016 (r305866) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "cpufreq_if.h" @@ -93,14 +94,22 @@ static unsigned tsc_get_timecount_low_lf static unsigned tsc_get_timecount_mfence(struct timecounter *tc); static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); +static uint32_t x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +#ifdef COMPAT_FREEBSD32 +static uint32_t x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif static struct timecounter tsc_timecounter = { - tsc_get_timecount, /* get_timecount */ - 0, /* no poll_pps */ - ~0u, /* counter_mask */ - 0, /* frequency */ - "TSC", /* name */ - 800, /* quality (adjusted in code) */ + .tc_get_timecount = tsc_get_timecount, + .tc_counter_mask = ~0u, + .tc_name = "TSC", + .tc_quality = 800, /* adjusted in code */ + .tc_fill_vdso_timehands = x86_tsc_vdso_timehands, +#ifdef COMPAT_FREEBSD32 + .tc_fill_vdso_timehands32 = x86_tsc_vdso_timehands32, +#endif }; static void @@ -724,23 +733,27 @@ tsc_get_timecount_low_mfence(struct time return (tsc_get_timecount_low(tc)); } -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +static uint32_t +x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) { + vdso_th->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th->th_x86_shift = (int)(intptr_t)tc->tc_priv; + vdso_th->th_x86_hpet_idx = 0xffffffff; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (tc == &tsc_timecounter); + return (1); } #ifdef COMPAT_FREEBSD32 -uint32_t -cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32, +static uint32_t +x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, struct timecounter *tc) { + vdso_th32->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th32->th_x86_shift = (int)(intptr_t)tc->tc_priv; + vdso_th32->th_x86_hpet_idx = 0xffffffff; bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); - return (tc == &tsc_timecounter); + return (1); } #endif From owner-svn-src-all@freebsd.org Fri Sep 16 11:28:18 2016 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 B26DDBDD5C4; Fri, 16 Sep 2016 11:28:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 513C5146F; Fri, 16 Sep 2016 11:28:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBSHs5089814; Fri, 16 Sep 2016 11:28:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBSGii089801; Fri, 16 Sep 2016 11:28:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161128.u8GBSGii089801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305867 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:28:18 -0000 Author: hselasky Date: Fri Sep 16 11:28:16 2016 New Revision: 305867 URL: https://svnweb.freebsd.org/changeset/base/305867 Log: Update the MLX5 core module: - Add new firmware commands and update existing ones. - Add more firmware related structures and update existing ones. - Some minor fixes, like adding missing \n to some prints. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/cq.h head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/flow_table.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_cq.c head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_core/mlx5_mr.c head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_core/mlx5_qp.c head/sys/dev/mlx5/mlx5_core/mlx5_srq.c head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c head/sys/dev/mlx5/mlx5_core/mlx5_uar.c head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/mlx5_core/transobj.h head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/qp.h head/sys/dev/mlx5/vport.h Modified: head/sys/dev/mlx5/cq.h ============================================================================== --- head/sys/dev/mlx5/cq.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/cq.h Fri Sep 16 11:28:16 2016 (r305867) @@ -49,6 +49,8 @@ struct mlx5_core_cq { unsigned arm_sn; struct mlx5_rsc_debug *dbg; int pid; + int reset_notify_added; + struct list_head reset_notify; }; Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/device.h Fri Sep 16 11:28:16 2016 (r305867) @@ -57,6 +57,7 @@ #define MLX5_FLD_SZ_BYTES(typ, fld) (__mlx5_bit_sz(typ, fld) / 8) #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32) +#define MLX5_ST_SZ_QW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 64) #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8) #define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32) #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8) @@ -112,6 +113,10 @@ enum { }; enum { + MLX5_CQ_FLAGS_OI = 2, +}; + +enum { MLX5_STAT_RATE_OFFSET = 5, }; @@ -129,6 +134,10 @@ enum { }; enum { + MLX5_MKEY_INBOX_PG_ACCESS = 1 << 31 +}; + +enum { MLX5_PERM_LOCAL_READ = 1 << 2, MLX5_PERM_LOCAL_WRITE = 1 << 3, MLX5_PERM_REMOTE_READ = 1 << 4, @@ -184,6 +193,25 @@ enum { }; enum { + MLX5_UMR_TRANSLATION_OFFSET_EN = (1 << 4), + + MLX5_UMR_CHECK_NOT_FREE = (1 << 5), + MLX5_UMR_CHECK_FREE = (2 << 5), + + MLX5_UMR_INLINE = (1 << 7), +}; + +#define MLX5_UMR_MTT_ALIGNMENT 0x40 +#define MLX5_UMR_MTT_MASK (MLX5_UMR_MTT_ALIGNMENT - 1) +#define MLX5_UMR_MTT_MIN_CHUNK_SIZE MLX5_UMR_MTT_ALIGNMENT + +enum { + MLX5_EVENT_QUEUE_TYPE_QP = 0, + MLX5_EVENT_QUEUE_TYPE_RQ = 1, + MLX5_EVENT_QUEUE_TYPE_SQ = 2, +}; + +enum { MLX5_PORT_CHANGE_SUBTYPE_DOWN = 1, MLX5_PORT_CHANGE_SUBTYPE_ACTIVE = 4, MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED = 5, @@ -194,19 +222,28 @@ enum { }; enum { + MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX = 1, + MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE, + MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE, + MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE, + MLX5_MAX_INLINE_RECEIVE_SIZE = 64 +}; + +enum { MLX5_DEV_CAP_FLAG_XRC = 1LL << 3, MLX5_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, MLX5_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9, MLX5_DEV_CAP_FLAG_APM = 1LL << 17, - MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, MLX5_DEV_CAP_FLAG_SCQE_BRK_MOD = 1LL << 21, MLX5_DEV_CAP_FLAG_BLOCK_MCAST = 1LL << 23, MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29, MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30, + MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 33, MLX5_DEV_CAP_FLAG_ROCE = 1LL << 34, MLX5_DEV_CAP_FLAG_DCT = 1LL << 37, MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46, + MLX5_DEV_CAP_FLAG_DRAIN_SIGERR = 1LL << 48, }; enum { @@ -263,6 +300,7 @@ enum { MLX5_OPCODE_UMR = 0x25, + MLX5_OPCODE_SIGNATURE_CANCELED = (1 << 15), }; enum { @@ -299,6 +337,18 @@ struct mlx5_outbox_hdr { __be32 syndrome; }; +struct mlx5_cmd_set_dc_cnak_mbox_in { + struct mlx5_inbox_hdr hdr; + u8 enable; + u8 reserved[47]; + __be64 pa; +}; + +struct mlx5_cmd_set_dc_cnak_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + struct mlx5_cmd_layout { u8 type; u8 rsvd0[3]; @@ -339,9 +389,12 @@ struct mlx5_init_seg { __be32 rsvd1[120]; __be32 initializing; struct mlx5_health_buffer health; - __be32 rsvd2[884]; + __be32 rsvd2[880]; + __be32 internal_timer_h; + __be32 internal_timer_l; + __be32 rsvd3[2]; __be32 health_counter; - __be32 rsvd3[1019]; + __be32 rsvd4[1019]; __be64 ieee1588_clk; __be32 ieee1588_clk_type; __be32 clr_intx; @@ -420,6 +473,7 @@ enum { MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST = 0x4, MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, + MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, }; struct mlx5_eqe_port_module_event { @@ -832,6 +886,10 @@ struct mlx5_query_eq_mbox_out { struct mlx5_eq_context ctx; }; +enum { + MLX5_MKEY_STATUS_FREE = 1 << 6, +}; + struct mlx5_mkey_seg { /* This is a two bit field occupying bits 31-30. * bit 31 is always 0, @@ -868,7 +926,7 @@ struct mlx5_query_special_ctxs_mbox_out struct mlx5_create_mkey_mbox_in { struct mlx5_inbox_hdr hdr; __be32 input_mkey_index; - u8 rsvd0[4]; + __be32 flags; struct mlx5_mkey_seg seg; u8 rsvd1[16]; __be32 xlat_oct_act_size; @@ -971,6 +1029,17 @@ struct mlx5_destroy_psv_out { u8 rsvd[8]; }; +static inline int mlx5_host_is_le(void) +{ +#if defined(__LITTLE_ENDIAN) + return 1; +#elif defined(__BIG_ENDIAN) + return 0; +#else +#error Host endianness not defined +#endif +} + #define MLX5_CMD_OP_MAX 0x939 enum { @@ -1008,6 +1077,8 @@ enum { MLX5_FLOW_TABLE_TYPE_EGRESS_ACL = 2, MLX5_FLOW_TABLE_TYPE_INGRESS_ACL = 3, MLX5_FLOW_TABLE_TYPE_ESWITCH = 4, + MLX5_FLOW_TABLE_TYPE_SNIFFER_RX = 5, + MLX5_FLOW_TABLE_TYPE_SNIFFER_TX = 6, }; enum { @@ -1062,6 +1133,10 @@ enum mlx5_cap_type { MLX5_CAP_FLOW_TABLE, MLX5_CAP_ESWITCH_FLOW_TABLE, MLX5_CAP_ESWITCH, + MLX5_CAP_SNAPSHOT, + MLX5_CAP_VECTOR_CALC, + MLX5_CAP_QOS, + MLX5_CAP_DEBUG, /* NUM OF CAP Types */ MLX5_CAP_NUM }; @@ -1107,21 +1182,23 @@ enum mlx5_cap_type { MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_max[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) -#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE(dev, \ - flow_table_properties_esw_acl_egress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL_MAX(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ - flow_table_properties_esw_acl_egress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE(dev, \ - flow_table_properties_esw_acl_ingress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL_MAX(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ - flow_table_properties_esw_acl_ingress.cap) +#define MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_nic_esw_fdb.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_FDB_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_nic_esw_fdb.cap) + +#define MLX5_CAP_ESW_EGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_EGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_INGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_esw_acl_ingress.cap) + +#define MLX5_CAP_ESW_INGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_ingress.cap) #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ @@ -1137,6 +1214,38 @@ enum mlx5_cap_type { #define MLX5_CAP_ODP_MAX(mdev, cap)\ MLX5_GET(odp_cap, mdev->hca_caps_max[MLX5_CAP_ODP], cap) +#define MLX5_CAP_SNAPSHOT(mdev, cap) \ + MLX5_GET(snapshot_cap, \ + mdev->hca_caps_cur[MLX5_CAP_SNAPSHOT], cap) + +#define MLX5_CAP_SNAPSHOT_MAX(mdev, cap) \ + MLX5_GET(snapshot_cap, \ + mdev->hca_caps_max[MLX5_CAP_SNAPSHOT], cap) + +#define MLX5_CAP_EOIB_OFFLOADS(mdev, cap) \ + MLX5_GET(per_protocol_networking_offload_caps,\ + mdev->hca_caps_cur[MLX5_CAP_EOIB_OFFLOADS], cap) + +#define MLX5_CAP_EOIB_OFFLOADS_MAX(mdev, cap) \ + MLX5_GET(per_protocol_networking_offload_caps,\ + mdev->hca_caps_max[MLX5_CAP_EOIB_OFFLOADS], cap) + +#define MLX5_CAP_DEBUG(mdev, cap) \ + MLX5_GET(debug_cap, \ + mdev->hca_caps_cur[MLX5_CAP_DEBUG], cap) + +#define MLX5_CAP_DEBUG_MAX(mdev, cap) \ + MLX5_GET(debug_cap, \ + mdev->hca_caps_max[MLX5_CAP_DEBUG], cap) + +#define MLX5_CAP_QOS(mdev, cap) \ + MLX5_GET(qos_cap,\ + mdev->hca_caps_cur[MLX5_CAP_QOS], cap) + +#define MLX5_CAP_QOS_MAX(mdev, cap) \ + MLX5_GET(qos_cap,\ + mdev->hca_caps_max[MLX5_CAP_QOS], cap) + enum { MLX5_CMD_STAT_OK = 0x0, MLX5_CMD_STAT_INT_ERR = 0x1, @@ -1168,6 +1277,22 @@ enum { }; enum { + MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP = 0x0, + MLX5_PCIE_LANE_COUNTERS_GROUP = 0x1, + MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP = 0x2, +}; + +enum { + MLX5_NUM_UUARS_PER_PAGE = MLX5_NON_FP_BF_REGS_PER_PAGE, + MLX5_DEF_TOT_UUARS = 8 * MLX5_NUM_UUARS_PER_PAGE, +}; + +enum { + NUM_DRIVER_UARS = 4, + NUM_LOW_LAT_UUARS = 4, +}; + +enum { MLX5_CAP_PORT_TYPE_IB = 0x0, MLX5_CAP_PORT_TYPE_ETH = 0x1, }; @@ -1252,4 +1377,7 @@ static inline int mlx5_get_cqe_format(co return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; } +/* 8 regular priorities + 1 for multicast */ +#define MLX5_NUM_BYPASS_FTS 9 + #endif /* MLX5_DEVICE_H */ Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/driver.h Fri Sep 16 11:28:16 2016 (r305867) @@ -42,16 +42,15 @@ #include #include +#define MLX5_QCOUNTER_SETS_NETDEV 64 + enum { MLX5_BOARD_ID_LEN = 64, MLX5_MAX_NAME_LEN = 16, }; enum { - /* one minute for the sake of bringup. Generally, commands must always - * complete and we may need to increase this timeout value - */ - MLX5_CMD_TIMEOUT_MSEC = 7200 * 1000, + MLX5_CMD_TIMEOUT_MSEC = 8 * 60 * 1000, MLX5_CMD_WQ_MAX_NAME = 32, }; @@ -85,20 +84,44 @@ enum { }; enum { - MLX5_ATOMIC_MODE_IB_COMP = 1 << 16, - MLX5_ATOMIC_MODE_CX = 2 << 16, - MLX5_ATOMIC_MODE_8B = 3 << 16, - MLX5_ATOMIC_MODE_16B = 4 << 16, - MLX5_ATOMIC_MODE_32B = 5 << 16, - MLX5_ATOMIC_MODE_64B = 6 << 16, - MLX5_ATOMIC_MODE_128B = 7 << 16, - MLX5_ATOMIC_MODE_256B = 8 << 16, + MLX5_ATOMIC_MODE_OFF = 16, + MLX5_ATOMIC_MODE_NONE = 0 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_IB_COMP = 1 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_CX = 2 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_8B = 3 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_16B = 4 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_32B = 5 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_64B = 6 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_128B = 7 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_256B = 8 << MLX5_ATOMIC_MODE_OFF, +}; + +enum { + MLX5_ATOMIC_MODE_DCT_OFF = 20, + MLX5_ATOMIC_MODE_DCT_NONE = 0 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_IB_COMP = 1 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_CX = 2 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_8B = 3 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_16B = 4 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_32B = 5 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_64B = 6 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_128B = 7 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_256B = 8 << MLX5_ATOMIC_MODE_DCT_OFF, +}; + +enum { + MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0, + MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1, + MLX5_ATOMIC_OPS_MASKED_CMP_SWAP = 1 << 2, + MLX5_ATOMIC_OPS_MASKED_FETCH_ADD = 1 << 3, }; enum { MLX5_REG_QETCR = 0x4005, MLX5_REG_QPDP = 0x4007, MLX5_REG_QTCT = 0x400A, + MLX5_REG_DCBX_PARAM = 0x4020, + MLX5_REG_DCBX_APP = 0x4021, MLX5_REG_PCAP = 0x5001, MLX5_REG_PMTU = 0x5003, MLX5_REG_PTYS = 0x5004, @@ -116,6 +139,7 @@ enum { MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, MLX5_REG_MCIA = 0x9014, + MLX5_REG_MPCNT = 0x9051, }; enum dbg_rsc_type { @@ -124,6 +148,12 @@ enum dbg_rsc_type { MLX5_DBG_RSC_CQ, }; +enum { + MLX5_INTERFACE_PROTOCOL_IB = 0, + MLX5_INTERFACE_PROTOCOL_ETH = 1, + MLX5_INTERFACE_NUMBER = 2, +}; + struct mlx5_field_desc { struct dentry *dent; int i; @@ -147,6 +177,10 @@ enum mlx5_dev_event { MLX5_DEV_EVENT_GUID_CHANGE, MLX5_DEV_EVENT_CLIENT_REREG, MLX5_DEV_EVENT_VPORT_CHANGE, + MLX5_DEV_EVENT_ERROR_STATE_DCBX, + MLX5_DEV_EVENT_REMOTE_CONFIG_CHANGE, + MLX5_DEV_EVENT_LOCAL_OPER_CHANGE, + MLX5_DEV_EVENT_REMOTE_CONFIG_APPLICATION_PRIORITY_CHANGE, }; enum mlx5_port_status { @@ -375,9 +409,12 @@ struct mlx5_core_mr { }; enum mlx5_res_type { - MLX5_RES_QP, - MLX5_RES_SRQ, - MLX5_RES_XSRQ, + MLX5_RES_QP = MLX5_EVENT_QUEUE_TYPE_QP, + MLX5_RES_RQ = MLX5_EVENT_QUEUE_TYPE_RQ, + MLX5_RES_SQ = MLX5_EVENT_QUEUE_TYPE_SQ, + MLX5_RES_SRQ = 3, + MLX5_RES_XSRQ = 4, + MLX5_RES_DCT = 5, }; struct mlx5_core_rsc_common { @@ -413,8 +450,6 @@ struct mlx5_eq_table { struct mlx5_uar { u32 index; - struct list_head bf_list; - unsigned free_bf_bmap; void __iomem *bf_map; void __iomem *map; }; @@ -461,7 +496,7 @@ struct mlx5_srq_table { struct mlx5_mr_table { /* protect radix tree */ - rwlock_t lock; + spinlock_t lock; struct radix_tree_root tree; }; @@ -483,7 +518,7 @@ struct mlx5_priv { struct workqueue_struct *pg_wq; struct rb_root page_root; int fw_pages; - int reg_pages; + atomic_t reg_pages; struct list_head free_list; struct mlx5_core_health health; @@ -521,6 +556,12 @@ struct mlx5_priv { struct list_head dev_list; struct list_head ctx_list; spinlock_t ctx_lock; + unsigned long pci_dev_data; +}; + +enum mlx5_device_state { + MLX5_DEVICE_STATE_UP, + MLX5_DEVICE_STATE_INTERNAL_ERROR, }; struct mlx5_special_contexts { @@ -535,6 +576,7 @@ struct mlx5_core_dev { u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; struct mlx5_init_seg __iomem *iseg; + enum mlx5_device_state state; void (*event) (struct mlx5_core_dev *dev, enum mlx5_dev_event event, unsigned long param); @@ -544,6 +586,7 @@ struct mlx5_core_dev { u32 issi; struct mlx5_special_contexts special_contexts; unsigned int module_status[MLX5_MAX_PORTS]; + u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; }; enum { @@ -573,6 +616,8 @@ struct mlx5_net_counters { }; struct mlx5_ptys_reg { + u8 an_dis_admin; + u8 an_dis_ap; u8 local_port; u8 proto_mask; u32 eth_proto_cap; @@ -620,6 +665,15 @@ enum { MLX5_DB_PER_PAGE = PAGE_SIZE / L1_CACHE_BYTES, }; +struct mlx5_core_dct { + struct mlx5_core_rsc_common common; /* must be first */ + void (*event)(struct mlx5_core_dct *, int); + int dctn; + struct completion drained; + struct mlx5_rsc_debug *dbg; + int pid; +}; + enum { MLX5_COMP_EQ_SIZE = 1024, }; @@ -725,9 +779,14 @@ static inline void *mlx5_vzalloc(unsigne return rtn; } -static inline u32 mlx5_base_mkey(const u32 key) +static inline void *mlx5_vmalloc(unsigned long size) { - return key & 0xffffff00u; + void *rtn; + + rtn = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); + if (!rtn) + rtn = vmalloc(size); + return rtn; } int mlx5_cmd_init(struct mlx5_core_dev *dev); @@ -809,6 +868,8 @@ int mlx5_stop_eqs(struct mlx5_core_dev * int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, int *irqn); int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); +int mlx5_core_set_dc_cnak_trace(struct mlx5_core_dev *dev, int enable, + u64 addr); int mlx5_qp_debugfs_init(struct mlx5_core_dev *dev); void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev); @@ -816,11 +877,16 @@ int mlx5_core_access_reg(struct mlx5_cor int size_in, void *data_out, int size_out, u16 reg_num, int arg, int write); +void mlx5_toggle_port_link(struct mlx5_core_dev *dev); int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, int ptys_size, int proto_mask); int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev, u32 *proto_cap, int proto_mask); +int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask, + u8 *an_disable_cap, u8 *an_disable_status); +int mlx5_set_port_autoneg(struct mlx5_core_dev *dev, bool disable, + u32 eth_proto_admin, int proto_mask); int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev, u32 *proto_admin, int proto_mask); int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, @@ -828,10 +894,14 @@ int mlx5_set_port_proto(struct mlx5_core int mlx5_set_port_status(struct mlx5_core_dev *dev, enum mlx5_port_status status); int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); +int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, + enum mlx5_port_status *status); int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, u32 rx_pause, u32 tx_pause); int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port, u32 *rx_pause, u32 *tx_pause); +int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx); +int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx); int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu); int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); @@ -884,6 +954,9 @@ int mlx5_modify_port_cong_params(struct void *in, int in_size); int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear, void *out, int out_size); +int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size); +int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, + u16 sample_index, void *out, int out_size); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; @@ -905,12 +978,7 @@ enum { }; enum { - MAX_MR_CACHE_ENTRIES = 16, -}; - -enum { - MLX5_INTERFACE_PROTOCOL_IB = 0, - MLX5_INTERFACE_PROTOCOL_ETH = 1, + MAX_MR_CACHE_ENTRIES = 15, }; struct mlx5_interface { @@ -936,6 +1004,14 @@ struct mlx5_profile { } mr_cache[MAX_MR_CACHE_ENTRIES]; }; +enum { + MLX5_PCI_DEV_IS_VF = 1 << 0, +}; + +static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev) +{ + return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF); +} #define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff Modified: head/sys/dev/mlx5/flow_table.h ============================================================================== --- head/sys/dev/mlx5/flow_table.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/flow_table.h Fri Sep 16 11:28:16 2016 (r305867) @@ -30,6 +30,9 @@ #include +#define MLX5_SET_FLOW_TABLE_ROOT_OPMOD_SET 0x0 +#define MLX5_SET_FLOW_TABLE_ROOT_OPMOD_RESET 0x1 + struct mlx5_flow_table_group { u8 log_sz; u8 match_criteria_enable; @@ -44,7 +47,10 @@ void mlx5_destroy_flow_table(void *flow_ int mlx5_add_flow_table_entry(void *flow_table, u8 match_criteria_enable, void *match_criteria, void *flow_context, u32 *flow_index); -void mlx5_del_flow_table_entry(void *flow_table, u32 flow_index); +int mlx5_del_flow_table_entry(void *flow_table, u32 flow_index); u32 mlx5_get_flow_table_id(void *flow_table); +int mlx5_set_flow_table_root(struct mlx5_core_dev *mdev, u16 op_mod, + u8 vport_num, u8 table_type, u32 table_id, + u32 underlay_qpn); #endif /* MLX5_FLOW_TABLE_H */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 16 11:28:16 2016 (r305867) @@ -121,7 +121,7 @@ static int alloc_ent(struct mlx5_cmd *cm clear_bit(ret, &cmd->bitmask); spin_unlock_irqrestore(&cmd->alloc_lock, flags); - return ret < cmd->max_reg_cmds ? ret : -ENOMEM; + return ret < cmd->max_reg_cmds ? ret : -1; } static void free_ent(struct mlx5_cmd *cmd, int idx) @@ -396,6 +396,9 @@ const char *mlx5_command_str(int command case MLX5_CMD_OP_CREATE_DCT: return "CREATE_DCT"; + case MLX5_CMD_OP_SET_DC_CNAK_TRACE: + return "SET_DC_CNAK_TRACE"; + case MLX5_CMD_OP_DESTROY_DCT: return "DESTROY_DCT"; @@ -639,6 +642,12 @@ const char *mlx5_command_str(int command case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: return "DELETE_FLOW_TABLE_ENTRY"; + case MLX5_CMD_OP_SET_DIAGNOSTICS: + return "MLX5_CMD_OP_SET_DIAGNOSTICS"; + + case MLX5_CMD_OP_QUERY_DIAGNOSTICS: + return "MLX5_CMD_OP_QUERY_DIAGNOSTICS"; + default: return "unknown command opcode"; } } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 16 11:28:16 2016 (r305867) @@ -64,6 +64,8 @@ enum { MLX5_CMD_TIME, /* print command execution time */ }; +struct mlx5_core_dev; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 16 11:28:16 2016 (r305867) @@ -187,10 +187,12 @@ int mlx5_core_destroy_cq(struct mlx5_cor in.cqn = cpu_to_be32(cq->cqn); err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); if (err) - return err; + goto out; - if (out.hdr.status) - return mlx5_cmd_status_to_err(&out.hdr); + if (out.hdr.status) { + err = mlx5_cmd_status_to_err(&out.hdr); + goto out; + } synchronize_irq(cq->irqn); @@ -198,7 +200,9 @@ int mlx5_core_destroy_cq(struct mlx5_cor complete(&cq->free); wait_for_completion(&cq->free); - return 0; +out: + + return err; } EXPORT_SYMBOL(mlx5_core_destroy_cq); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 16 11:28:16 2016 (r305867) @@ -155,6 +155,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_PAGE_REQUEST"; case MLX5_EVENT_TYPE_NIC_VPORT_CHANGE: return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; + case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: + return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; default: return "Unrecognized event"; } @@ -181,6 +183,21 @@ static enum mlx5_dev_event port_subtype_ return -1; } +static enum mlx5_dev_event dcbx_subevent(u8 subtype) +{ + switch (subtype) { + case MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX: + return MLX5_DEV_EVENT_ERROR_STATE_DCBX; + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE: + return MLX5_DEV_EVENT_REMOTE_CONFIG_CHANGE; + case MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE: + return MLX5_DEV_EVENT_LOCAL_OPER_CHANGE; + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE: + return MLX5_DEV_EVENT_REMOTE_CONFIG_APPLICATION_PRIORITY_CHANGE; + } + return -1; +} + static void eq_update_ci(struct mlx5_eq *eq, int arm) { __be32 __iomem *addr = eq->doorbell + (arm ? 0 : 2); @@ -259,6 +276,26 @@ static int mlx5_eq_int(struct mlx5_core_ port, eqe->sub_type); } break; + + case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: + port = (eqe->data.port.port >> 4) & 0xf; + switch (eqe->sub_type) { + case MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX: + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE: + case MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE: + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE: + if (dev->event) + dev->event(dev, + dcbx_subevent(eqe->sub_type), + 0); + break; + default: + mlx5_core_warn(dev, + "dcbx event with unrecognized subtype: port %d, sub_type %d\n", + port, eqe->sub_type); + } + break; + case MLX5_EVENT_TYPE_CQ_ERROR: cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xffffff; mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 0x%x\n", @@ -476,6 +513,10 @@ int mlx5_start_eqs(struct mlx5_core_dev async_event_mask |= (1ull << MLX5_EVENT_TYPE_NIC_VPORT_CHANGE); + if (MLX5_CAP_GEN(dev, dcbx)) + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT); + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); @@ -573,6 +614,8 @@ static const char *mlx5_port_module_even return "Unknown identifier"; case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE: return "High Temperature"; + case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: + return "Cable is shorted"; default: return "Unknown error type"; @@ -605,19 +648,19 @@ static void mlx5_port_module_event(struc switch (module_status) { case MLX5_MODULE_STATUS_PLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged\n", module_num); break; case MLX5_MODULE_STATUS_UNPLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged\n", module_num); break; case MLX5_MODULE_STATUS_ERROR: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s", module_num, mlx5_port_module_event_error_type_to_string(error_type)); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type)); break; default: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status\n", module_num); } /* store module status */ if (module_num < MLX5_MAX_PORTS) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 16 11:28:16 2016 (r305867) @@ -96,10 +96,10 @@ static int mlx5_vacl_table_allow_vlan(vo MLX5_SET(flow_context, flow_context, action, MLX5_FLOW_CONTEXT_ACTION_ALLOW); in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); - MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, in_match_value, outer_headers.first_vid, vlan); - MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, in_match_criteria, outer_headers.first_vid, 0xfff); if (acl_table->spoofchk_enabled) { @@ -255,8 +255,8 @@ static int mlx5_vacl_table_apply_untagge /* Apply new untagged rule */ MLX5_SET(flow_context, flow_context, action, new_action); in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); - MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 0); - MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.cvlan_tag, 0); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.cvlan_tag, 1); if (acl_table->spoofchk_enabled) { smac = MLX5_ADDR_OF(fte_match_param, in_match_value, @@ -549,7 +549,7 @@ static int mlx5_vacl_table_create_ft(voi MLX5_MATCH_OUTER_HEADERS; MLX5_SET(fte_match_param, g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx].match_criteria, - outer_headers.vlan_tag, 1); + outer_headers.cvlan_tag, 1); if (spoofchk) { smac = MLX5_ADDR_OF(fte_match_param, g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx] @@ -564,7 +564,7 @@ static int mlx5_vacl_table_create_ft(voi MLX5_MATCH_OUTER_HEADERS; MLX5_SET(fte_match_param, g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, - outer_headers.vlan_tag, 1); + outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, outer_headers.first_vid, 0xfff); @@ -627,10 +627,10 @@ void *mlx5_vacl_table_create(struct mlx5 struct mlx5_vacl_table *acl_table; int err = 0; - if (is_egress && !MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, ft_support)) + if (is_egress && !MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) return NULL; - if (!is_egress && !MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, ft_support)) + if (!is_egress && !MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) return NULL; acl_table = kzalloc(sizeof(*acl_table), GFP_KERNEL); @@ -640,9 +640,9 @@ void *mlx5_vacl_table_create(struct mlx5 acl_table->acl_type = is_egress ? MLX5_FLOW_TABLE_TYPE_EGRESS_ACL : MLX5_FLOW_TABLE_TYPE_INGRESS_ACL; acl_table->max_ft_size = (is_egress ? - MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, + MLX5_CAP_ESW_EGRESS_ACL(dev, log_max_ft_size) : - MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, + MLX5_CAP_ESW_INGRESS_ACL(dev, log_max_ft_size)); acl_table->dev = dev; acl_table->vport = vport; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 16 11:28:16 2016 (r305867) @@ -87,7 +87,7 @@ static int mlx5_set_flow_entry_cmd(struc return err; } -static void mlx5_del_flow_entry_cmd(struct mlx5_flow_table *ft, u32 flow_index) +static int mlx5_del_flow_entry_cmd(struct mlx5_flow_table *ft, u32 flow_index) { u32 in[MLX5_ST_SZ_DW(delete_fte_in)]; u32 out[MLX5_ST_SZ_DW(delete_fte_out)]; @@ -103,7 +103,8 @@ static void mlx5_del_flow_entry_cmd(stru MLX5_SET_DFTEI(in, flow_index, flow_index); MLX5_SET_DFTEI(in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY); - mlx5_cmd_exec_check_status(ft->dev, in, sizeof(in), out, sizeof(out)); + return mlx5_cmd_exec_check_status(ft->dev, in, sizeof(in), out, + sizeof(out)); } static void mlx5_destroy_flow_group_cmd(struct mlx5_flow_table *ft, int i) @@ -343,12 +344,15 @@ int mlx5_add_flow_table_entry(void *flow } EXPORT_SYMBOL(mlx5_add_flow_table_entry); -void mlx5_del_flow_table_entry(void *flow_table, u32 flow_index) +int mlx5_del_flow_table_entry(void *flow_table, u32 flow_index) { struct mlx5_flow_table *ft = flow_table; + int ret; - mlx5_del_flow_entry_cmd(ft, flow_index); - mlx5_free_flow_index(ft, flow_index); + ret = mlx5_del_flow_entry_cmd(ft, flow_index); + if (!ret) + mlx5_free_flow_index(ft, flow_index); + return ret; } EXPORT_SYMBOL(mlx5_del_flow_table_entry); @@ -430,3 +434,46 @@ u32 mlx5_get_flow_table_id(void *flow_ta return ft->id; } EXPORT_SYMBOL(mlx5_get_flow_table_id); + +int mlx5_set_flow_table_root(struct mlx5_core_dev *mdev, u16 op_mod, + u8 vport_num, u8 table_type, u32 table_id, + u32 underlay_qpn) +{ + u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)]; + u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)]; + int err; + int is_group_manager; + + is_group_manager = MLX5_CAP_GEN(mdev, vport_group_manager); + + memset(in, 0, sizeof(in)); + + MLX5_SET(set_flow_table_root_in, in, op_mod, op_mod); + MLX5_SET(set_flow_table_root_in, in, table_type, table_type); + MLX5_SET(set_flow_table_root_in, in, underlay_qpn, underlay_qpn); + if (op_mod == MLX5_SET_FLOW_TABLE_ROOT_OPMOD_SET) + MLX5_SET(set_flow_table_root_in, in, table_id, table_id); + + MLX5_SET(set_flow_table_root_in, in, opcode, + MLX5_CMD_OP_SET_FLOW_TABLE_ROOT); + + if (vport_num) { + if (is_group_manager) { + MLX5_SET(set_flow_table_root_in, in, other_vport, + 1); + MLX5_SET(set_flow_table_root_in, in, vport_number, + vport_num); + } else { + return -EPERM; + } + } + + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, + sizeof(out)); + if (err) + return err; + + return 0; +} +EXPORT_SYMBOL(mlx5_set_flow_table_root); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 16 11:28:16 2016 (r305867) @@ -201,6 +201,50 @@ int mlx5_query_hca_caps(struct mlx5_core return err; } + if (MLX5_CAP_GEN(dev, snapshot)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_SNAPSHOT, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + err = mlx5_core_get_caps(dev, MLX5_CAP_SNAPSHOT, + HCA_CAP_OPMOD_GET_MAX); + if (err) + return err; + } + + if (MLX5_CAP_GEN(dev, ipoib_enhanced_offloads)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_EOIB_OFFLOADS, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + err = mlx5_core_get_caps(dev, MLX5_CAP_EOIB_OFFLOADS, + HCA_CAP_OPMOD_GET_MAX); + if (err) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 16 11:35:47 2016 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 51CB2BDD7E9; Fri, 16 Sep 2016 11:35:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 103D41B84; Fri, 16 Sep 2016 11:35:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBZkV6093625; Fri, 16 Sep 2016 11:35:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBZjps093621; Fri, 16 Sep 2016 11:35:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161135.u8GBZjps093621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305868 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:35:47 -0000 Author: hselasky Date: Fri Sep 16 11:35:45 2016 New Revision: 305868 URL: https://svnweb.freebsd.org/changeset/base/305868 Log: mlx5en: Separate the sendqueue from using the mlx5e_channel structure. This change allows for reusing the transmit path for so called rate limited senqueues. While at it optimise some pointer lookups in the fast path. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:35:45 2016 (r305868) @@ -433,9 +433,9 @@ struct mlx5e_cq { /* data path - accessed per HW polling */ struct mlx5_core_cq mcq; - struct mlx5e_channel *channel; /* control */ + struct mlx5e_priv *priv; struct mlx5_wq_ctrl wq_ctrl; } __aligned(MLX5E_CACHELINE_SIZE); @@ -515,6 +515,7 @@ struct mlx5e_sq { struct mlx5_wq_cyc wq; void __iomem *uar_map; void __iomem *uar_bf_map; + struct ifnet *ifp; u32 sqn; u32 bf_buf_size; struct device *pdev; @@ -523,7 +524,7 @@ struct mlx5e_sq { /* control path */ struct mlx5_wq_ctrl wq_ctrl; struct mlx5_uar uar; - struct mlx5e_channel *channel; + struct mlx5e_priv *priv; int tc; unsigned int queue_state; } __aligned(MLX5E_CACHELINE_SIZE); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:35:45 2016 (r305868) @@ -982,7 +982,8 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->pdev = c->pdev; sq->mkey_be = c->mkey_be; - sq->channel = c; + sq->ifp = priv->ifp; + sq->priv = priv; sq->tc = tc; sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, @@ -1039,15 +1040,12 @@ done: static void mlx5e_destroy_sq(struct mlx5e_sq *sq) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - /* destroy all sysctl nodes */ sysctl_ctx_free(&sq->stats.ctx); mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); - mlx5_unmap_free_uar(priv->mdev, &sq->uar); + mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); taskqueue_drain(sq->sq_tq, &sq->sq_task); taskqueue_free(sq->sq_tq); buf_ring_free(sq->br, M_MLX5EN); @@ -1056,10 +1054,6 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) static int mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - void *in; void *sqc; void *wq; @@ -1077,8 +1071,8 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str memcpy(sqc, param->sqc, sizeof(param->sqc)); - MLX5_SET(sqc, sqc, tis_num_0, priv->tisn[sq->tc]); - MLX5_SET(sqc, sqc, cqn, c->sq[sq->tc].cq.mcq.cqn); + MLX5_SET(sqc, sqc, tis_num_0, sq->priv->tisn[sq->tc]); + MLX5_SET(sqc, sqc, cqn, sq->cq.mcq.cqn); MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); MLX5_SET(sqc, sqc, tis_lst_sz, 1); MLX5_SET(sqc, sqc, flush_in_error_en, 1); @@ -1092,7 +1086,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str mlx5_fill_page_array(&sq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(wq, wq, pas)); - err = mlx5_core_create_sq(mdev, in, inlen, &sq->sqn); + err = mlx5_core_create_sq(sq->priv->mdev, in, inlen, &sq->sqn); kvfree(in); @@ -1102,10 +1096,6 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str static int mlx5e_modify_sq(struct mlx5e_sq *sq, int curr_state, int next_state) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - void *in; void *sqc; int inlen; @@ -1122,7 +1112,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int MLX5_SET(modify_sq_in, in, sq_state, curr_state); MLX5_SET(sqc, sqc, state, next_state); - err = mlx5_core_modify_sq(mdev, in, inlen); + err = mlx5_core_modify_sq(sq->priv->mdev, in, inlen); kvfree(in); @@ -1132,11 +1122,8 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int static void mlx5e_disable_sq(struct mlx5e_sq *sq) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - mlx5_core_destroy_sq(mdev, sq->sqn); + mlx5_core_destroy_sq(sq->priv->mdev, sq->sqn); } static int @@ -1302,7 +1289,7 @@ mlx5e_create_cq(struct mlx5e_channel *c, cqe->op_own = 0xf1; } - cq->channel = c; + cq->priv = priv; return (0); } @@ -1317,9 +1304,6 @@ static int mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, u8 moderation_mode) { - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_core_cq *mcq = &cq->mcq; void *in; void *cqc; @@ -1341,7 +1325,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str mlx5_fill_page_array(&cq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(create_cq_in, in, pas)); - mlx5_vector2eqn(mdev, param->eq_ix, &eqn, &irqn_not_used); + mlx5_vector2eqn(cq->priv->mdev, param->eq_ix, &eqn, &irqn_not_used); MLX5_SET(cqc, cqc, cq_period_mode, moderation_mode); MLX5_SET(cqc, cqc, c_eqn, eqn); @@ -1350,7 +1334,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str PAGE_SHIFT); MLX5_SET64(cqc, cqc, dbr_addr, cq->wq_ctrl.db.dma); - err = mlx5_core_create_cq(mdev, mcq, in, inlen); + err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen); kvfree(in); @@ -1365,11 +1349,8 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str static void mlx5e_disable_cq(struct mlx5e_cq *cq) { - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - mlx5_core_destroy_cq(mdev, &cq->mcq); + mlx5_core_destroy_cq(cq->priv->mdev, &cq->mcq); } static int Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:35:45 2016 (r305868) @@ -233,7 +233,7 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc /* Setup local variables */ pi = sq->pc & sq->wq.sz_m1; wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); - ifp = sq->channel->ifp; + ifp = sq->ifp; memset(wqe, 0, sizeof(*wqe)); @@ -534,7 +534,7 @@ void mlx5e_tx_que(void *context, int pending) { struct mlx5e_sq *sq = context; - struct ifnet *ifp = sq->channel->ifp; + struct ifnet *ifp = sq->ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { mtx_lock(&sq->lock); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 16 11:35:45 2016 (r305868) @@ -47,10 +47,7 @@ void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, int event) { struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq); - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct ifnet *ifp = priv->ifp; - if_printf(ifp, "%s: cqn=0x%.6x event=0x%.2x\n", + if_printf(cq->priv->ifp, "%s: cqn=0x%.6x event=0x%.2x\n", __func__, mcq->cqn, event); } From owner-svn-src-all@freebsd.org Fri Sep 16 11:37:36 2016 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 B4CC4BDD868; Fri, 16 Sep 2016 11:37:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DB871D33; Fri, 16 Sep 2016 11:37:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBbZCv093755; Fri, 16 Sep 2016 11:37:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBbZFL093754; Fri, 16 Sep 2016 11:37:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161137.u8GBbZFL093754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305869 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:37:36 -0000 Author: hselasky Date: Fri Sep 16 11:37:35 2016 New Revision: 305869 URL: https://svnweb.freebsd.org/changeset/base/305869 Log: mlx5en: Minor completion queue control path code refactor. Move setting of CQ moderation mode together with the other CQ moderation parameters. Pass completion event vector as a separate argument to mlx5e_open_cq(), because its value is different for each call. Pass mlx5e_priv pointer instead of mlx5e_channel pointer so that code can be used by rate limiting sendqueues. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:35:45 2016 (r305868) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:37:35 2016 (r305869) @@ -47,7 +47,6 @@ struct mlx5e_sq_param { struct mlx5e_cq_param { u32 cqc [MLX5_ST_SZ_DW(cqc)]; struct mlx5_wq_param wq; - u16 eq_ix; }; struct mlx5e_channel_param { @@ -1248,12 +1247,12 @@ mlx5e_close_sq_wait(struct mlx5e_sq *sq) } static int -mlx5e_create_cq(struct mlx5e_channel *c, +mlx5e_create_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, - mlx5e_cq_comp_t *comp) + mlx5e_cq_comp_t *comp, + int eq_ix) { - struct mlx5e_priv *priv = c->priv; struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_core_cq *mcq = &cq->mcq; int eqn_not_used; @@ -1263,21 +1262,20 @@ mlx5e_create_cq(struct mlx5e_channel *c, param->wq.buf_numa_node = 0; param->wq.db_numa_node = 0; - param->eq_ix = c->ix; err = mlx5_cqwq_create(mdev, ¶m->wq, param->cqc, &cq->wq, &cq->wq_ctrl); if (err) return (err); - mlx5_vector2eqn(mdev, param->eq_ix, &eqn_not_used, &irqn); + mlx5_vector2eqn(mdev, eq_ix, &eqn_not_used, &irqn); mcq->cqe_sz = 64; mcq->set_ci_db = cq->wq_ctrl.db.db; mcq->arm_db = cq->wq_ctrl.db.db + 1; *mcq->set_ci_db = 0; *mcq->arm_db = 0; - mcq->vector = param->eq_ix; + mcq->vector = eq_ix; mcq->comp = comp; mcq->event = mlx5e_cq_error_event; mcq->irqn = irqn; @@ -1301,8 +1299,7 @@ mlx5e_destroy_cq(struct mlx5e_cq *cq) } static int -mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, - u8 moderation_mode) +mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix) { struct mlx5_core_cq *mcq = &cq->mcq; void *in; @@ -1325,9 +1322,8 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str mlx5_fill_page_array(&cq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(create_cq_in, in, pas)); - mlx5_vector2eqn(cq->priv->mdev, param->eq_ix, &eqn, &irqn_not_used); + mlx5_vector2eqn(cq->priv->mdev, eq_ix, &eqn, &irqn_not_used); - MLX5_SET(cqc, cqc, cq_period_mode, moderation_mode); MLX5_SET(cqc, cqc, c_eqn, eqn); MLX5_SET(cqc, cqc, uar_page, mcq->uar->index); MLX5_SET(cqc, cqc, log_page_size, cq->wq_ctrl.buf.page_shift - @@ -1354,19 +1350,19 @@ mlx5e_disable_cq(struct mlx5e_cq *cq) } static int -mlx5e_open_cq(struct mlx5e_channel *c, +mlx5e_open_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, mlx5e_cq_comp_t *comp, - u8 moderation_mode) + int eq_ix) { int err; - err = mlx5e_create_cq(c, param, cq, comp); + err = mlx5e_create_cq(priv, param, cq, comp, eq_ix); if (err) return (err); - err = mlx5e_enable_cq(cq, param, moderation_mode); + err = mlx5e_enable_cq(cq, param, eq_ix); if (err) goto err_destroy_cq; @@ -1389,25 +1385,13 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { - u8 tx_moderation_mode; int err; int tc; - switch (c->priv->params.tx_cq_moderation_mode) { - case 0: - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - default: - if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; - else - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ - err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, tx_moderation_mode); + err = mlx5e_open_cq(c->priv, &cparam->tx_cq, &c->sq[tc].cq, + &mlx5e_tx_cq_comp, c->ix); if (err) goto err_close_tx_cqs; } @@ -1503,7 +1487,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr struct mlx5e_channel *volatile *cp) { struct mlx5e_channel *c; - u8 rx_moderation_mode; int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); @@ -1526,21 +1509,9 @@ mlx5e_open_channel(struct mlx5e_priv *pr if (err) goto err_free; - switch (priv->params.rx_cq_moderation_mode) { - case 0: - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - default: - if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; - else - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - } - /* open receive completion queue */ - err = mlx5e_open_cq(c, &cparam->rx_cq, &c->rq.cq, - &mlx5e_rx_cq_comp, rx_moderation_mode); + err = mlx5e_open_cq(c->priv, &cparam->rx_cq, &c->rq.cq, + &mlx5e_rx_cq_comp, c->ix); if (err) goto err_close_tx_cqs; @@ -1670,6 +1641,18 @@ mlx5e_build_rx_cq_param(struct mlx5e_pri MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); + switch (priv->params.rx_cq_moderation_mode) { + case 0: + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + } + mlx5e_build_common_cq_param(priv, param); } @@ -1683,6 +1666,18 @@ mlx5e_build_tx_cq_param(struct mlx5e_pri MLX5_SET(cqc, cqc, cq_period, priv->params.tx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.tx_cq_moderation_pkts); + switch (priv->params.tx_cq_moderation_mode) { + case 0: + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + } + mlx5e_build_common_cq_param(priv, param); } From owner-svn-src-all@freebsd.org Fri Sep 16 11:39:16 2016 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 AD350BDD929; Fri, 16 Sep 2016 11:39:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 672711ED6; Fri, 16 Sep 2016 11:39:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBdFdV093875; Fri, 16 Sep 2016 11:39:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBdFax093873; Fri, 16 Sep 2016 11:39:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161139.u8GBdFax093873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305870 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:39:16 -0000 Author: hselasky Date: Fri Sep 16 11:39:15 2016 New Revision: 305870 URL: https://svnweb.freebsd.org/changeset/base/305870 Log: mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global. Make some functions and structures global to allow for code reuse when creating rate limiting sendqueues. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:37:35 2016 (r305869) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:39:15 2016 (r305870) @@ -352,6 +352,21 @@ struct mlx5e_stats { struct mlx5e_port_stats_debug port_stats_debug; }; +struct mlx5e_rq_param { + u32 rqc [MLX5_ST_SZ_DW(rqc)]; + struct mlx5_wq_param wq; +}; + +struct mlx5e_sq_param { + u32 sqc [MLX5_ST_SZ_DW(sqc)]; + struct mlx5_wq_param wq; +}; + +struct mlx5e_cq_param { + u32 cqc [MLX5_ST_SZ_DW(cqc)]; + struct mlx5_wq_param wq; +}; + struct mlx5e_params { u8 log_sq_size; u8 log_rq_size; @@ -794,5 +809,8 @@ void mlx5e_create_stats(struct sysctl_ct void mlx5e_send_nop(struct mlx5e_sq *, u32); void mlx5e_sq_cev_timeout(void *); int mlx5e_refresh_channel_params(struct mlx5e_priv *); +int mlx5e_open_cq(struct mlx5e_priv *, struct mlx5e_cq_param *, + struct mlx5e_cq *, mlx5e_cq_comp_t *, int eq_ix); +void mlx5e_close_cq(struct mlx5e_cq *); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:37:35 2016 (r305869) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:39:15 2016 (r305870) @@ -34,21 +34,6 @@ char mlx5e_version[] = "Mellanox Ethernet driver" " (" ETH_DRIVER_VERSION ")"; -struct mlx5e_rq_param { - u32 rqc [MLX5_ST_SZ_DW(rqc)]; - struct mlx5_wq_param wq; -}; - -struct mlx5e_sq_param { - u32 sqc [MLX5_ST_SZ_DW(sqc)]; - struct mlx5_wq_param wq; -}; - -struct mlx5e_cq_param { - u32 cqc [MLX5_ST_SZ_DW(cqc)]; - struct mlx5_wq_param wq; -}; - struct mlx5e_channel_param { struct mlx5e_rq_param rq; struct mlx5e_sq_param sq; @@ -1349,7 +1334,7 @@ mlx5e_disable_cq(struct mlx5e_cq *cq) mlx5_core_destroy_cq(cq->priv->mdev, &cq->mcq); } -static int +int mlx5e_open_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, @@ -1374,7 +1359,7 @@ err_destroy_cq: return (err); } -static void +void mlx5e_close_cq(struct mlx5e_cq *cq) { mlx5e_disable_cq(cq); From owner-svn-src-all@freebsd.org Fri Sep 16 11:40:47 2016 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 0A34DBDD98F; Fri, 16 Sep 2016 11:40:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6F37FE; Fri, 16 Sep 2016 11:40:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBejNK094653; Fri, 16 Sep 2016 11:40:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBejLG094651; Fri, 16 Sep 2016 11:40:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161140.u8GBejLG094651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305871 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:40:47 -0000 Author: hselasky Date: Fri Sep 16 11:40:45 2016 New Revision: 305871 URL: https://svnweb.freebsd.org/changeset/base/305871 Log: mlx5en: Optimise away duplicate UAR pointers. This change also reduces the size of the mlx5e_sq structure so that the last queue_state element will fit into the previous cacheline and then the mlx5e_sq structure becomes one cacheline less for amd64. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:39:15 2016 (r305870) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:40:45 2016 (r305871) @@ -528,8 +528,7 @@ struct mlx5e_sq { /* read only */ struct mlx5_wq_cyc wq; - void __iomem *uar_map; - void __iomem *uar_bf_map; + struct mlx5_uar uar; struct ifnet *ifp; u32 sqn; u32 bf_buf_size; @@ -538,7 +537,6 @@ struct mlx5e_sq { /* control path */ struct mlx5_wq_ctrl wq_ctrl; - struct mlx5_uar uar; struct mlx5e_priv *priv; int tc; unsigned int queue_state; @@ -780,13 +778,13 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); if (bf_sz) { - __iowrite64_copy(sq->uar_bf_map + ofst, wqe, bf_sz); + __iowrite64_copy(sq->uar.bf_map + ofst, wqe, bf_sz); /* flush the write-combining mapped buffer */ wmb(); } else { - mlx5_write64(wqe, sq->uar_map + ofst, NULL); + mlx5_write64(wqe, sq->uar.map + ofst, NULL); } sq->bf_offset ^= sq->bf_buf_size; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:39:15 2016 (r305870) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:40:45 2016 (r305871) @@ -956,8 +956,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, goto err_unmap_free_uar; sq->wq.db = &sq->wq.db[MLX5_SND_DBR]; - sq->uar_map = sq->uar.map; - sq->uar_bf_map = sq->uar.bf_map; sq->bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2; err = mlx5e_alloc_sq_db(sq); From owner-svn-src-all@freebsd.org Fri Sep 16 11:45:36 2016 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 71898BDDB30; Fri, 16 Sep 2016 11:45:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42425803; Fri, 16 Sep 2016 11:45:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBjZA1097473; Fri, 16 Sep 2016 11:45:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBjZQG097471; Fri, 16 Sep 2016 11:45:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161145.u8GBjZQG097471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305872 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:45:36 -0000 Author: hselasky Date: Fri Sep 16 11:45:35 2016 New Revision: 305872 URL: https://svnweb.freebsd.org/changeset/base/305872 Log: mlx5en: Properly declare doorbell lock for 32-bit CPUs. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:40:45 2016 (r305871) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:45:35 2016 (r305872) @@ -662,6 +662,7 @@ struct mlx5e_priv { struct work_struct update_stats_work; struct work_struct update_carrier_work; struct work_struct set_rx_mode_work; + MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock) struct mlx5_core_dev *mdev; struct ifnet *ifp; @@ -784,7 +785,8 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); } else { - mlx5_write64(wqe, sq->uar.map + ofst, NULL); + mlx5_write64(wqe, sq->uar.map + ofst, + MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); } sq->bf_offset ^= sq->bf_buf_size; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:40:45 2016 (r305871) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:45:35 2016 (r305872) @@ -2753,6 +2753,7 @@ mlx5e_priv_mtx_init(struct mlx5e_priv *p mtx_init(&priv->async_events_mtx, "mlx5async", MTX_NETWORK_LOCK, MTX_DEF); sx_init(&priv->state_lock, "mlx5state"); callout_init_mtx(&priv->watchdog, &priv->async_events_mtx, 0); + MLX5_INIT_DOORBELL_LOCK(&priv->doorbell_lock); } static void From owner-svn-src-all@freebsd.org Fri Sep 16 11:47:17 2016 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 849D8BDDB9D; Fri, 16 Sep 2016 11:47:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60AB299B; Fri, 16 Sep 2016 11:47:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBlGgD097570; Fri, 16 Sep 2016 11:47:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBlGUJ097568; Fri, 16 Sep 2016 11:47:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161147.u8GBlGUJ097568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305873 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:47:17 -0000 Author: hselasky Date: Fri Sep 16 11:47:16 2016 New Revision: 305873 URL: https://svnweb.freebsd.org/changeset/base/305873 Log: mlx5en: Factor out common sendqueue code for use with rate limiting SQs. Try to reuse code to setup sendqueues when possible by making some static functions global. Further split the mlx5e_close_sq_wait() function to separate out reusable parts. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:45:35 2016 (r305872) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:47:16 2016 (r305873) @@ -812,5 +812,11 @@ int mlx5e_refresh_channel_params(struct int mlx5e_open_cq(struct mlx5e_priv *, struct mlx5e_cq_param *, struct mlx5e_cq *, mlx5e_cq_comp_t *, int eq_ix); void mlx5e_close_cq(struct mlx5e_cq *); +void mlx5e_free_sq_db(struct mlx5e_sq *); +int mlx5e_alloc_sq_db(struct mlx5e_sq *); +int mlx5e_enable_sq(struct mlx5e_sq *, struct mlx5e_sq_param *, int tis_num); +int mlx5e_modify_sq(struct mlx5e_sq *, int curr_state, int next_state); +void mlx5e_disable_sq(struct mlx5e_sq *); +void mlx5e_drain_sq(struct mlx5e_sq *); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:45:35 2016 (r305872) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:47:16 2016 (r305873) @@ -873,7 +873,7 @@ mlx5e_close_rq_wait(struct mlx5e_rq *rq) mlx5e_destroy_rq(rq); } -static void +void mlx5e_free_sq_db(struct mlx5e_sq *sq) { int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); @@ -884,7 +884,7 @@ mlx5e_free_sq_db(struct mlx5e_sq *sq) free(sq->mbuf, M_MLX5EN); } -static int +int mlx5e_alloc_sq_db(struct mlx5e_sq *sq) { int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); @@ -1033,8 +1033,9 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) buf_ring_free(sq->br, M_MLX5EN); } -static int -mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) +int +mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param, + int tis_num) { void *in; void *sqc; @@ -1053,7 +1054,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str memcpy(sqc, param->sqc, sizeof(param->sqc)); - MLX5_SET(sqc, sqc, tis_num_0, sq->priv->tisn[sq->tc]); + MLX5_SET(sqc, sqc, tis_num_0, tis_num); MLX5_SET(sqc, sqc, cqn, sq->cq.mcq.cqn); MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); MLX5_SET(sqc, sqc, tis_lst_sz, 1); @@ -1075,7 +1076,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str return (err); } -static int +int mlx5e_modify_sq(struct mlx5e_sq *sq, int curr_state, int next_state) { void *in; @@ -1101,7 +1102,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int return (err); } -static void +void mlx5e_disable_sq(struct mlx5e_sq *sq) { @@ -1120,7 +1121,7 @@ mlx5e_open_sq(struct mlx5e_channel *c, if (err) return (err); - err = mlx5e_enable_sq(sq, param); + err = mlx5e_enable_sq(sq, param, c->priv->tisn[tc]); if (err) goto err_destroy_sq; @@ -1196,8 +1197,8 @@ mlx5e_sq_cev_timeout(void *arg) callout_reset_curcpu(&sq->cev_callout, hz, mlx5e_sq_cev_timeout, sq); } -static void -mlx5e_close_sq_wait(struct mlx5e_sq *sq) +void +mlx5e_drain_sq(struct mlx5e_sq *sq) { mtx_lock(&sq->lock); @@ -1224,7 +1225,13 @@ mlx5e_close_sq_wait(struct mlx5e_sq *sq) mtx_lock(&sq->lock); } mtx_unlock(&sq->lock); +} + +static void +mlx5e_close_sq_wait(struct mlx5e_sq *sq) +{ + mlx5e_drain_sq(sq); mlx5e_disable_sq(sq); mlx5e_destroy_sq(sq); } From owner-svn-src-all@freebsd.org Fri Sep 16 11:51:32 2016 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 DC17ABDDCB9; Fri, 16 Sep 2016 11:51:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88E4AC9F; Fri, 16 Sep 2016 11:51:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBpVL0099953; Fri, 16 Sep 2016 11:51:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBpV02099952; Fri, 16 Sep 2016 11:51:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161151.u8GBpV02099952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305874 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:51:33 -0000 Author: hselasky Date: Fri Sep 16 11:51:31 2016 New Revision: 305874 URL: https://svnweb.freebsd.org/changeset/base/305874 Log: mlx5en: Allow setting the software MTU size below 1500 bytes The hardware MTU size can't be set to a value less than 1500 bytes due to side-band management support. Allow setting the software MTU size below 1500 bytes, thus creating a mismatch between hardware and software MTU sizes. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:47:16 2016 (r305873) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:51:31 2016 (r305874) @@ -2173,7 +2173,6 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp int hw_mtu; int err; - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", @@ -2181,19 +2180,20 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp return (err); } err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); - if (!err) { - ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu); - - if (ifp->if_mtu != sw_mtu) { - if_printf(ifp, "Port MTU %d is different than " - "ifp mtu %d\n", sw_mtu, (int)ifp->if_mtu); - } - } else { + if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); - ifp->if_mtu = sw_mtu; + } else if (MLX5E_HW2SW_MTU(hw_mtu) < sw_mtu) { + err = -E2BIG, + if_printf(ifp, "Port MTU %d is smaller than " + "ifp mtu %d\n", hw_mtu, sw_mtu); + } else if (MLX5E_HW2SW_MTU(hw_mtu) > sw_mtu) { + err = -EINVAL; + if_printf(ifp, "Port MTU %d is bigger than " + "ifp mtu %d\n", hw_mtu, sw_mtu); } - return (0); + ifp->if_mtu = sw_mtu; + return (err); } int From owner-svn-src-all@freebsd.org Fri Sep 16 11:53:55 2016 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 146D0BDDD4C; Fri, 16 Sep 2016 11:53:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6545EE4; Fri, 16 Sep 2016 11:53:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBrsVo001439; Fri, 16 Sep 2016 11:53:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBrsul001438; Fri, 16 Sep 2016 11:53:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161153.u8GBrsul001438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305875 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:53:55 -0000 Author: hselasky Date: Fri Sep 16 11:53:53 2016 New Revision: 305875 URL: https://svnweb.freebsd.org/changeset/base/305875 Log: mlx5en: Verify port type is ethernet before creating network device Else the mlx5en driver might attach to infiniband ports. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:51:31 2016 (r305874) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:53:53 2016 (r305875) @@ -2654,6 +2654,9 @@ mlx5e_check_required_hca_cap(struct mlx5 /* TODO: add more must-to-have features */ + if (MLX5_CAP_GEN(mdev, port_type) != MLX5_CAP_PORT_TYPE_ETH) + return (-ENODEV); + return (0); } From owner-svn-src-all@freebsd.org Fri Sep 16 11:55:39 2016 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 C6E94BDDE13; Fri, 16 Sep 2016 11:55:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FA48146; Fri, 16 Sep 2016 11:55:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBtc09001569; Fri, 16 Sep 2016 11:55:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBtcKw001567; Fri, 16 Sep 2016 11:55:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161155.u8GBtcKw001567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305876 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:55:39 -0000 Author: hselasky Date: Fri Sep 16 11:55:38 2016 New Revision: 305876 URL: https://svnweb.freebsd.org/changeset/base/305876 Log: mlx5en: Remove unused pdev pointer. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:53:53 2016 (r305875) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:55:38 2016 (r305876) @@ -467,7 +467,6 @@ struct mlx5e_rq { bus_dma_tag_t dma_tag; u32 wqe_sz; struct mlx5e_rq_mbuf *mbuf; - struct device *pdev; struct ifnet *ifp; struct mlx5e_rq_stats stats; struct mlx5e_cq cq; @@ -532,7 +531,6 @@ struct mlx5e_sq { struct ifnet *ifp; u32 sqn; u32 bf_buf_size; - struct device *pdev; u32 mkey_be; /* control path */ @@ -553,7 +551,6 @@ struct mlx5e_channel { /* data path */ struct mlx5e_rq rq; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; - struct device *pdev; struct ifnet *ifp; u32 mkey_be; u8 num_tc; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:53:53 2016 (r305875) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:55:38 2016 (r305876) @@ -674,7 +674,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, wqe->data.byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING); } - rq->pdev = c->pdev; rq->ifp = c->ifp; rq->channel = c; rq->ix = c->ix; @@ -962,7 +961,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, if (err) goto err_sq_wq_destroy; - sq->pdev = c->pdev; sq->mkey_be = c->mkey_be; sq->ifp = priv->ifp; sq->priv = priv; @@ -1486,7 +1484,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr c->priv = priv; c->ix = ix; c->cpu = 0; - c->pdev = &priv->mdev->pdev->dev; c->ifp = priv->ifp; c->mkey_be = cpu_to_be32(priv->mr.key); c->num_tc = priv->num_tc; From owner-svn-src-all@freebsd.org Fri Sep 16 11:57:49 2016 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 C7A32BDDF78; Fri, 16 Sep 2016 11:57:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94D96694; Fri, 16 Sep 2016 11:57:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GBvmYx001681; Fri, 16 Sep 2016 11:57:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBvmnb001680; Fri, 16 Sep 2016 11:57:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161157.u8GBvmnb001680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305877 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 11:57:49 -0000 Author: hselasky Date: Fri Sep 16 11:57:48 2016 New Revision: 305877 URL: https://svnweb.freebsd.org/changeset/base/305877 Log: mlx5en: Fix duplicate mbuf free-by-code. When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set, we should not free the mbuf, because the caller will keep the mbuf in the drbr. Make sure the mbuf pointer is correctly set upon function exit. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:55:38 2016 (r305876) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:57:48 2016 (r305877) @@ -224,10 +224,8 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc /* Send one multi NOP message instead of many */ mlx5e_send_nop(sq, (pi + 1) * MLX5_SEND_WQEBB_NUM_DS); pi = ((~sq->pc) & sq->wq.sz_m1); - if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) { - m_freem(mb); + if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) return (ENOMEM); - } } /* Setup local variables */ @@ -338,10 +336,8 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc mb, segs, &nsegs, BUS_DMA_NOWAIT); } /* Catch errors */ - if (err != 0) { + if (err != 0) goto tx_drop; - } - *mbp = mb; for (x = 0; x != nsegs; x++) { if (segs[x].ds_len == 0) @@ -374,6 +370,7 @@ skip_dma: bus_dmamap_sync(sq->dma_tag, sq->mbuf[pi].dma_map, BUS_DMASYNC_PREWRITE); sq->stats.packets++; + *mbp = NULL; /* safety clear */ return (0); tx_drop: From owner-svn-src-all@freebsd.org Fri Sep 16 12:12:01 2016 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 EC729BDBC94; Fri, 16 Sep 2016 12:12:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC062EA; Fri, 16 Sep 2016 12:12:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCC115008892; Fri, 16 Sep 2016 12:12:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCC03F008891; Fri, 16 Sep 2016 12:12:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161212.u8GCC03F008891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305878 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:12:02 -0000 Author: andrew Date: Fri Sep 16 12:12:00 2016 New Revision: 305878 URL: https://svnweb.freebsd.org/changeset/base/305878 Log: MFC 305605: Don't panic when we don't handle a userland exception, not all we may see are currently handled. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/trap.c ============================================================================== --- stable/11/sys/arm64/arm64/trap.c Fri Sep 16 11:57:48 2016 (r305877) +++ stable/11/sys/arm64/arm64/trap.c Fri Sep 16 12:12:00 2016 (r305878) @@ -394,9 +394,9 @@ do_el0_sync(struct trapframe *frame) userret(td, frame); break; default: - print_registers(frame); - panic("Unknown userland exception %x esr_el1 %lx\n", exception, - esr); + call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)frame->tf_elr); + userret(td, frame); + break; } } From owner-svn-src-all@freebsd.org Fri Sep 16 12:17:03 2016 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 06F07BDBF09; Fri, 16 Sep 2016 12:17:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEEB07A0; Fri, 16 Sep 2016 12:17:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCH1en009117; Fri, 16 Sep 2016 12:17:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCH1ef009116; Fri, 16 Sep 2016 12:17:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161217.u8GCH1ef009116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305879 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:17:03 -0000 Author: andrew Date: Fri Sep 16 12:17:01 2016 New Revision: 305879 URL: https://svnweb.freebsd.org/changeset/base/305879 Log: MFC 303744: Remove the pvh_global_lock lock from the arm64 pmap. It is unneeded on arm64 as invalidation will have completed before the pmap_invalidate_* functions have complete. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:12:00 2016 (r305878) +++ stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:17:01 2016 (r305879) @@ -218,8 +218,6 @@ vm_offset_t kernel_vm_end = 0; struct msgbuf *msgbufp = NULL; -static struct rwlock_padalign pvh_global_lock; - vm_paddr_t dmap_phys_base; /* The start of the dmap region */ vm_paddr_t dmap_phys_max; /* The limit of the dmap region */ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ @@ -671,11 +669,6 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offs kernel_pmap_store.pm_l0 = (pd_entry_t *)l0pt; PMAP_LOCK_INIT(kernel_pmap); - /* - * Initialize the global pv list lock. - */ - rw_init(&pvh_global_lock, "pmap pv global"); - /* Assume the address we were loaded to is a valid physical address */ min_pa = max_pa = KERNBASE - kern_delta; @@ -1404,9 +1397,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); - rw_runlock(&pvh_global_lock); VM_WAIT; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -1748,7 +1739,6 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(atomic_add_long(&pv_entry_frees, 1)); PV_STAT(atomic_add_int(&pv_entry_spare, 1)); @@ -1805,7 +1795,6 @@ get_pv_entry(pmap_t pmap, struct rwlock struct pv_chunk *pc; vm_page_t m; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(atomic_add_long(&pv_entry_allocs, 1)); retry: @@ -1873,7 +1862,6 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); @@ -1909,7 +1897,6 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* Pass NULL instead of the lock pointer to disable reclamation. */ if ((pv = get_pv_entry(pmap, NULL)) != NULL) { @@ -1978,7 +1965,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 0; SLIST_INIT(&free); - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); lock = NULL; @@ -2057,7 +2043,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva rw_wunlock(lock); if (anyvalid) pmap_invalidate_all(pmap); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); } @@ -2080,18 +2065,31 @@ pmap_remove_all(vm_page_t m) { pv_entry_t pv; pmap_t pmap; + struct rwlock *lock; pd_entry_t *pde, tpde; pt_entry_t *pte, tpte; struct spglist free; - int lvl; + int lvl, md_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); - rw_wlock(&pvh_global_lock); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); +retry: + rw_wlock(lock); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (md_gen != m->md.pv_gen) { + rw_wunlock(lock); + PMAP_UNLOCK(pmap); + goto retry; + } + } pmap_resident_count_dec(pmap, 1); pde = pmap_pde(pmap, pv->pv_va, &lvl); @@ -2126,7 +2124,7 @@ pmap_remove_all(vm_page_t m) PMAP_UNLOCK(pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - rw_wunlock(&pvh_global_lock); + rw_wunlock(lock); pmap_free_zero_pages(&free); } @@ -2241,7 +2239,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, mpte = NULL; lock = NULL; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); if (va < VM_MAXUSER_ADDRESS) { @@ -2251,7 +2248,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, CTR0(KTR_PMAP, "pmap_enter: mpte == NULL"); if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); return (KERN_RESOURCE_SHORTAGE); } @@ -2433,7 +2429,6 @@ validate: if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } @@ -2465,7 +2460,6 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte = NULL; m = m_start; lock = NULL; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -2474,7 +2468,6 @@ pmap_enter_object(pmap_t pmap, vm_offset } if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -2493,12 +2486,10 @@ pmap_enter_quick(pmap_t pmap, vm_offset_ struct rwlock *lock; lock = NULL; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); (void)pmap_enter_quick_locked(pmap, va, m, prot, NULL, &lock); if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -2515,7 +2506,6 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); CTR2(KTR_PMAP, "pmap_enter_quick_locked: %p %lx", pmap, va); @@ -2644,9 +2634,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva vm_offset_t va_next; pd_entry_t *l0, *l1, *l2; pt_entry_t *l3; - boolean_t pv_lists_locked; - pv_lists_locked = FALSE; PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l0 = pmap_l0(pmap, sva); @@ -2692,8 +2680,6 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva pmap->pm_stats.wired_count--; } } - if (pv_lists_locked) - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -2837,7 +2823,6 @@ pmap_page_exists_quick(pmap_t pmap, vm_p KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { @@ -2850,7 +2835,6 @@ pmap_page_exists_quick(pmap_t pmap, vm_p break; } rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (rv); } @@ -2871,7 +2855,6 @@ pmap_page_wired_mappings(vm_page_t m) if ((m->oflags & VPO_UNMANAGED) != 0) return (0); - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); restart: @@ -2894,7 +2877,6 @@ restart: PMAP_UNLOCK(pmap); } rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (count); } @@ -2932,7 +2914,6 @@ pmap_remove_pages(pmap_t pmap) lock = NULL; SLIST_INIT(&free); - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; @@ -3018,7 +2999,6 @@ pmap_remove_pages(pmap_t pmap) pmap_invalidate_all(pmap); if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); } @@ -3039,7 +3019,6 @@ pmap_page_test_mappings(vm_page_t m, boo boolean_t rv; rv = FALSE; - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); restart: @@ -3075,7 +3054,6 @@ restart: } out: rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (rv); } @@ -3164,7 +3142,6 @@ pmap_remove_write(vm_page_t m) VM_OBJECT_ASSERT_WLOCKED(m->object); if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); retry_pv_loop: rw_wlock(lock); @@ -3196,7 +3173,6 @@ retry: } rw_wunlock(lock); vm_page_aflag_clear(m, PGA_WRITEABLE); - rw_runlock(&pvh_global_lock); } static __inline boolean_t @@ -3238,7 +3214,6 @@ pmap_ts_referenced(vm_page_t m) cleared = 0; pa = VM_PAGE_TO_PHYS(m); lock = PHYS_TO_PV_LIST_LOCK(pa); - rw_rlock(&pvh_global_lock); rw_wlock(lock); retry: not_cleared = 0; @@ -3307,7 +3282,6 @@ retry: not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); - rw_runlock(&pvh_global_lock); pmap_free_zero_pages(&free); return (cleared + not_cleared); } From owner-svn-src-all@freebsd.org Fri Sep 16 12:18:23 2016 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 F0934BDBF9E; Fri, 16 Sep 2016 12:18:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C117394F; Fri, 16 Sep 2016 12:18:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCIM4B009212; Fri, 16 Sep 2016 12:18:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCIMGX009211; Fri, 16 Sep 2016 12:18:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161218.u8GCIMGX009211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305880 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:18:24 -0000 Author: andrew Date: Fri Sep 16 12:18:22 2016 New Revision: 305880 URL: https://svnweb.freebsd.org/changeset/base/305880 Log: MFC 303903: Implement pmap_align_superpage on arm64 based on the amd64 implementation. This will be needed when superpage support is added. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:17:01 2016 (r305879) +++ stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:18:22 2016 (r305880) @@ -3490,6 +3490,20 @@ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { + vm_offset_t superpage_offset; + + if (size < L2_SIZE) + return; + if (object != NULL && (object->flags & OBJ_COLORED) != 0) + offset += ptoa(object->pg_color); + superpage_offset = offset & L2_OFFSET; + if (size - ((L2_SIZE - superpage_offset) & L2_OFFSET) < L2_SIZE || + (*addr & L2_OFFSET) == superpage_offset) + return; + if ((*addr & L2_OFFSET) < superpage_offset) + *addr = (*addr & ~L2_OFFSET) + superpage_offset; + else + *addr = ((*addr + L2_OFFSET) & ~L2_OFFSET) + superpage_offset; } /** From owner-svn-src-all@freebsd.org Fri Sep 16 12:20:43 2016 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 8B5F9BDC072; Fri, 16 Sep 2016 12:20:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DD55BD5; Fri, 16 Sep 2016 12:20:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCKgMM009455; Fri, 16 Sep 2016 12:20:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCKg2E009454; Fri, 16 Sep 2016 12:20:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161220.u8GCKg2E009454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305881 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:20:43 -0000 Author: andrew Date: Fri Sep 16 12:20:42 2016 New Revision: 305881 URL: https://svnweb.freebsd.org/changeset/base/305881 Log: MFC 303904: Uncomment the vm.kvm_size and vm.kvm_free sysctls. These work as expected so there is no reason to leave them commented out. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:18:22 2016 (r305880) +++ stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:20:42 2016 (r305881) @@ -1574,7 +1574,6 @@ pmap_release(pmap_t pmap) vm_page_free_zero(m); } -#if 0 static int kvm_size(SYSCTL_HANDLER_ARGS) { @@ -1594,7 +1593,6 @@ kvm_free(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 0, 0, kvm_free, "LU", "Amount of KVM free"); -#endif /* 0 */ /* * grow the number of kernel page table entries, if needed From owner-svn-src-all@freebsd.org Fri Sep 16 12:36:12 2016 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 3EC87BDC6AC; Fri, 16 Sep 2016 12:36:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040DE6E0; Fri, 16 Sep 2016 12:36:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCaBRu016577; Fri, 16 Sep 2016 12:36:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCaB2u016575; Fri, 16 Sep 2016 12:36:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161236.u8GCaB2u016575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305882 - in stable/11/sys/arm64: arm64 include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:36:12 -0000 Author: andrew Date: Fri Sep 16 12:36:11 2016 New Revision: 305882 URL: https://svnweb.freebsd.org/changeset/base/305882 Log: MFC 304004, 304596, 304598, 304599, 304600, 304604, 304620, 304685, 304687, 304688, 304689, 304746, 304749, 304750, 304806, 305071, 305191: Merge arm64 superpage support, however leave it disabled by default. MFC after: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/pmap.c stable/11/sys/arm64/arm64/trap.c stable/11/sys/arm64/include/pmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:20:42 2016 (r305881) +++ stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:36:11 2016 (r305882) @@ -106,6 +106,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -134,6 +135,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -176,6 +178,7 @@ __FBSDID("$FreeBSD$"); #endif #define pmap_l2_pindex(v) ((v) >> L2_SHIFT) +#define pa_to_pvh(pa) (&pv_table[pmap_l2_pindex(pa)]) #define NPV_LIST_LOCKS MAXCPU @@ -218,6 +221,14 @@ vm_offset_t kernel_vm_end = 0; struct msgbuf *msgbufp = NULL; +/* + * Data for the pv entry allocation mechanism. + * Updates to pv_invl_gen are protected by the pv_list_locks[] + * elements, but reads are not. + */ +static struct md_page *pv_table; +static struct md_page pv_dummy; + vm_paddr_t dmap_phys_base; /* The start of the dmap region */ vm_paddr_t dmap_phys_max; /* The limit of the dmap region */ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ @@ -229,6 +240,13 @@ CTASSERT((DMAP_MAX_ADDRESS & ~L0_OFFSET #define DMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> L0_SHIFT) extern pt_entry_t pagetable_dmap[]; +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); + +static int superpages_enabled = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &superpages_enabled, 0, + "Are large page mappings enabled?"); + /* * Data for the pv entry allocation mechanism */ @@ -243,6 +261,13 @@ static vm_page_t reclaim_pv_chunk(pmap_t static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); + +static int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); +static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va); +static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, + vm_offset_t va, struct rwlock **lockp); +static pt_entry_t *pmap_demote_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, @@ -422,6 +447,13 @@ pmap_pte(pmap_t pmap, vm_offset_t va, in return (l3); } +static inline bool +pmap_superpages_enabled(void) +{ + + return (superpages_enabled != 0); +} + bool pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l0, pd_entry_t **l1, pd_entry_t **l2, pt_entry_t **l3) @@ -477,6 +509,17 @@ pmap_l3_valid(pt_entry_t l3) return ((l3 & ATTR_DESCR_MASK) == L3_PAGE); } + +/* Is a level 1 or 2entry a valid block and cacheable */ +CTASSERT(L1_BLOCK == L2_BLOCK); +static __inline int +pmap_pte_valid_cacheable(pt_entry_t pte) +{ + + return (((pte & ATTR_DESCR_MASK) == L1_BLOCK) && + ((pte & ATTR_IDX_MASK) == ATTR_IDX(CACHED_MEMORY))); +} + static __inline int pmap_l3_valid_cacheable(pt_entry_t l3) { @@ -834,7 +877,13 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - int i; + vm_size_t s; + int i, pv_npg; + + /* + * Are large page mappings enabled? + */ + TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", &superpages_enabled); /* * Initialize the pv chunk list mutex. @@ -846,7 +895,38 @@ pmap_init(void) */ for (i = 0; i < NPV_LIST_LOCKS; i++) rw_init(&pv_list_locks[i], "pmap pv list"); -} + + /* + * Calculate the size of the pv head table for superpages. + */ + pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, L2_SIZE); + + /* + * Allocate memory for the pv head table for superpages. + */ + s = (vm_size_t)(pv_npg * sizeof(struct md_page)); + s = round_page(s); + pv_table = (struct md_page *)kmem_malloc(kernel_arena, s, + M_WAITOK | M_ZERO); + for (i = 0; i < pv_npg; i++) + TAILQ_INIT(&pv_table[i].pv_list); + TAILQ_INIT(&pv_dummy.pv_list); +} + +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, + "2MB page mapping counters"); + +static u_long pmap_l2_demotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD, + &pmap_l2_demotions, 0, "2MB page demotions"); + +static u_long pmap_l2_p_failures; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, p_failures, CTLFLAG_RD, + &pmap_l2_p_failures, 0, "2MB page promotion failures"); + +static u_long pmap_l2_promotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLAG_RD, + &pmap_l2_promotions, 0, "2MB page promotions"); /* * Invalidate a single TLB entry. @@ -954,6 +1034,7 @@ vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { pt_entry_t *pte, tpte; + vm_offset_t off; vm_paddr_t pa; vm_page_t m; int lvl; @@ -975,9 +1056,21 @@ retry: tpte & ATTR_DESCR_MASK)); if (((tpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) || ((prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, tpte & ~ATTR_MASK, &pa)) + switch(lvl) { + case 1: + off = va & L1_OFFSET; + break; + case 2: + off = va & L2_OFFSET; + break; + case 3: + default: + off = 0; + } + if (vm_page_pa_tryrelock(pmap, + (tpte & ~ATTR_MASK) | off, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE((tpte & ~ATTR_MASK) | off); vm_page_hold(m); } } @@ -1345,6 +1438,7 @@ pmap_pinit0(pmap_t pmap) PMAP_LOCK_INIT(pmap); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_l0 = kernel_pmap->pm_l0; + pmap->pm_root.rt_root = 0; } int @@ -1366,6 +1460,7 @@ pmap_pinit(pmap_t pmap) if ((l0pt->flags & PG_ZERO) == 0) pagezero(pmap->pm_l0); + pmap->pm_root.rt_root = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); return (1); @@ -1511,6 +1606,9 @@ pmap_alloc_l3(pmap_t pmap, vm_offset_t v { vm_pindex_t ptepindex; pd_entry_t *pde, tpde; +#ifdef INVARIANTS + pt_entry_t *pte; +#endif vm_page_t m; int lvl; @@ -1529,13 +1627,33 @@ retry: * and activate it. If we get a level 2 pde it will point to a level 3 * table. */ - if (lvl == 2) { + switch (lvl) { + case -1: + break; + case 0: +#ifdef INVARIANTS + pte = pmap_l0_to_l1(pde, va); + KASSERT(pmap_load(pte) == 0, + ("pmap_alloc_l3: TODO: l0 superpages")); +#endif + break; + case 1: +#ifdef INVARIANTS + pte = pmap_l1_to_l2(pde, va); + KASSERT(pmap_load(pte) == 0, + ("pmap_alloc_l3: TODO: l1 superpages")); +#endif + break; + case 2: tpde = pmap_load(pde); if (tpde != 0) { m = PHYS_TO_VM_PAGE(tpde & ~ATTR_MASK); m->wire_count++; return (m); } + break; + default: + panic("pmap_alloc_l3: Invalid level %d", lvl); } /* @@ -1566,6 +1684,8 @@ pmap_release(pmap_t pmap) KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); + KASSERT(vm_radix_is_empty(&pmap->pm_root), + ("pmap_release: pmap has reserved page table page(s)")); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); @@ -1850,6 +1970,68 @@ retry: } /* + * Ensure that the number of spare PV entries in the specified pmap meets or + * exceeds the given count, "needed". + * + * The given PV list lock may be released. + */ +static void +reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp) +{ + struct pch new_tail; + struct pv_chunk *pc; + int avail, free; + vm_page_t m; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); + + /* + * Newly allocated PV chunks must be stored in a private list until + * the required number of PV chunks have been allocated. Otherwise, + * reclaim_pv_chunk() could recycle one of these chunks. In + * contrast, these chunks must be added to the pmap upon allocation. + */ + TAILQ_INIT(&new_tail); +retry: + avail = 0; + TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { + bit_count((bitstr_t *)pc->pc_map, 0, + sizeof(pc->pc_map) * NBBY, &free); + if (free == 0) + break; + avail += free; + if (avail >= needed) + break; + } + for (; avail < needed; avail += _NPCPV) { + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + VM_ALLOC_WIRED); + if (m == NULL) { + m = reclaim_pv_chunk(pmap, lockp); + if (m == NULL) + goto retry; + } + PV_STAT(atomic_add_int(&pc_chunk_count, 1)); + PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); + dump_add_page(m->phys_addr); + pc = (void *)PHYS_TO_DMAP(m->phys_addr); + pc->pc_pmap = pmap; + pc->pc_map[0] = PC_FREE0; + pc->pc_map[1] = PC_FREE1; + pc->pc_map[2] = PC_FREE2; + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV)); + } + if (!TAILQ_EMPTY(&new_tail)) { + mtx_lock(&pv_chunks_mutex); + TAILQ_CONCAT(&pv_chunks, &new_tail, pc_lru); + mtx_unlock(&pv_chunks_mutex); + } +} + +/* * First find and then remove the pv entry for the specified pmap and virtual * address from the specified pv list. Returns the pv entry if found and NULL * otherwise. This operation can be performed on pv lists for either 4KB or @@ -1871,6 +2053,74 @@ pmap_pvh_remove(struct md_page *pvh, pma } /* + * After demotion from a 2MB page mapping to 512 4KB page mappings, + * destroy the pv entry for the 2MB page mapping and reinstantiate the pv + * entries for each of the 4KB page mappings. + */ +static void +pmap_pv_demote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) +{ + struct md_page *pvh; + struct pv_chunk *pc; + pv_entry_t pv; + vm_offset_t va_last; + vm_page_t m; + int bit, field; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((pa & L2_OFFSET) == 0, + ("pmap_pv_demote_l2: pa is not 2mpage aligned")); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + + /* + * Transfer the 2mpage's pv entry for this mapping to the first + * page's pv list. Once this transfer begins, the pv list lock + * must not be released until the last pv entry is reinstantiated. + */ + pvh = pa_to_pvh(pa); + va = va & ~L2_OFFSET; + pv = pmap_pvh_remove(pvh, pmap, va); + KASSERT(pv != NULL, ("pmap_pv_demote_l2: pv not found")); + m = PHYS_TO_VM_PAGE(pa); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); + m->md.pv_gen++; + /* Instantiate the remaining Ln_ENTRIES - 1 pv entries. */ + PV_STAT(atomic_add_long(&pv_entry_allocs, Ln_ENTRIES - 1)); + va_last = va + L2_SIZE - PAGE_SIZE; + for (;;) { + pc = TAILQ_FIRST(&pmap->pm_pvchunk); + KASSERT(pc->pc_map[0] != 0 || pc->pc_map[1] != 0 || + pc->pc_map[2] != 0, ("pmap_pv_demote_l2: missing spare")); + for (field = 0; field < _NPCM; field++) { + while (pc->pc_map[field]) { + bit = ffsl(pc->pc_map[field]) - 1; + pc->pc_map[field] &= ~(1ul << bit); + pv = &pc->pc_pventry[field * 64 + bit]; + va += PAGE_SIZE; + pv->pv_va = va; + m++; + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("pmap_pv_demote_l2: page %p is not managed", m)); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); + m->md.pv_gen++; + if (va == va_last) + goto out; + } + } + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } +out: + if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 && pc->pc_map[2] == 0) { + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } + PV_STAT(atomic_add_long(&pv_entry_count, Ln_ENTRIES - 1)); + PV_STAT(atomic_subtract_int(&pv_entry_spare, Ln_ENTRIES - 1)); +} + +/* * First find and then destroy the pv entry for the specified pmap and virtual * address. This operation can be performed on pv lists for either 4KB or 2MB * page mappings. @@ -1914,6 +2164,7 @@ static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp) { + struct md_page *pvh; pt_entry_t old_l3; vm_page_t m; @@ -1934,6 +2185,12 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t * vm_page_aflag_set(m, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); pmap_pvh_free(&m->md, pmap, va); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); + } } return (pmap_unuse_l3(pmap, va, l2e, free)); } @@ -2000,6 +2257,14 @@ pmap_remove(pmap_t pmap, vm_offset_t sva l3_paddr = pmap_load(l2); + if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { + /* TODO: Add pmap_remove_l2 */ + if (pmap_demote_l2_locked(pmap, l2, sva & ~L2_OFFSET, + &lock) == NULL) + continue; + l3_paddr = pmap_load(l2); + } + /* * Weed out invalid mappings. */ @@ -2061,28 +2326,56 @@ pmap_remove(pmap_t pmap, vm_offset_t sva void pmap_remove_all(vm_page_t m) { + struct md_page *pvh; pv_entry_t pv; pmap_t pmap; struct rwlock *lock; pd_entry_t *pde, tpde; pt_entry_t *pte, tpte; + vm_offset_t va; struct spglist free; - int lvl, md_gen; + int lvl, pvh_gen, md_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); lock = VM_PAGE_TO_PV_LIST_LOCK(m); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); retry: rw_wlock(lock); + while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + rw_wunlock(lock); + PMAP_UNLOCK(pmap); + goto retry; + } + } + va = pv->pv_va; + pte = pmap_pte(pmap, va, &lvl); + KASSERT(pte != NULL, + ("pmap_remove_all: no page table entry found")); + KASSERT(lvl == 2, + ("pmap_remove_all: invalid pte level %d", lvl)); + + pmap_demote_l2_locked(pmap, pte, va, &lock); + PMAP_UNLOCK(pmap); + } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; md_gen = m->md.pv_gen; rw_wunlock(lock); PMAP_LOCK(pmap); rw_wlock(lock); - if (md_gen != m->md.pv_gen) { + if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) { rw_wunlock(lock); PMAP_UNLOCK(pmap); goto retry; @@ -2169,9 +2462,17 @@ pmap_protect(pmap_t pmap, vm_offset_t sv va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL || (pmap_load(l2) & ATTR_DESCR_MASK) != L2_TABLE) + if (pmap_load(l2) == 0) continue; + if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { + l3p = pmap_demote_l2(pmap, l2, sva); + if (l3p == NULL) + continue; + } + KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, + ("pmap_protect: Invalid L2 entry after demotion")); + if (va_next > eva) va_next = eva; @@ -2194,6 +2495,194 @@ pmap_protect(pmap_t pmap, vm_offset_t sv } /* + * Inserts the specified page table page into the specified pmap's collection + * of idle page table pages. Each of a pmap's page table pages is responsible + * for mapping a distinct range of virtual addresses. The pmap's collection is + * ordered by this virtual address range. + */ +static __inline int +pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + return (vm_radix_insert(&pmap->pm_root, mpte)); +} + +/* + * Looks for a page table page mapping the specified virtual address in the + * specified pmap's collection of idle page table pages. Returns NULL if there + * is no page table page corresponding to the specified virtual address. + */ +static __inline vm_page_t +pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + return (vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(va))); +} + +/* + * Removes the specified page table page from the specified pmap's collection + * of idle page table pages. The specified page table page must be a member of + * the pmap's collection. + */ +static __inline void +pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + vm_radix_remove(&pmap->pm_root, mpte->pindex); +} + +/* + * Performs a break-before-make update of a pmap entry. This is needed when + * either promoting or demoting pages to ensure the TLB doesn't get into an + * inconsistent state. + */ +static void +pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, + vm_offset_t va, vm_size_t size) +{ + register_t intr; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + /* + * Ensure we don't get switched out with the page table in an + * inconsistent state. We also need to ensure no interrupts fire + * as they may make use of an address we are about to invalidate. + */ + intr = intr_disable(); + critical_enter(); + + /* Clear the old mapping */ + pmap_load_clear(pte); + PTE_SYNC(pte); + pmap_invalidate_range(pmap, va, va + size); + + /* Create the new mapping */ + pmap_load_store(pte, newpte); + PTE_SYNC(pte); + + critical_exit(); + intr_restore(intr); +} + +/* + * After promotion from 512 4KB page mappings to a single 2MB page mapping, + * replace the many pv entries for the 4KB page mappings by a single pv entry + * for the 2MB page mapping. + */ +static void +pmap_pv_promote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) +{ + struct md_page *pvh; + pv_entry_t pv; + vm_offset_t va_last; + vm_page_t m; + + KASSERT((pa & L2_OFFSET) == 0, + ("pmap_pv_promote_l2: pa is not 2mpage aligned")); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + + /* + * Transfer the first page's pv entry for this mapping to the 2mpage's + * pv list. Aside from avoiding the cost of a call to get_pv_entry(), + * a transfer avoids the possibility that get_pv_entry() calls + * reclaim_pv_chunk() and that reclaim_pv_chunk() removes one of the + * mappings that is being promoted. + */ + m = PHYS_TO_VM_PAGE(pa); + va = va & ~L2_OFFSET; + pv = pmap_pvh_remove(&m->md, pmap, va); + KASSERT(pv != NULL, ("pmap_pv_promote_l2: pv not found")); + pvh = pa_to_pvh(pa); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + pvh->pv_gen++; + /* Free the remaining NPTEPG - 1 pv entries. */ + va_last = va + L2_SIZE - PAGE_SIZE; + do { + m++; + va += PAGE_SIZE; + pmap_pvh_free(&m->md, pmap, va); + } while (va < va_last); +} + +/* + * Tries to promote the 512, contiguous 4KB page mappings that are within a + * single level 2 table entry to a single 2MB page mapping. For promotion + * to occur, two conditions must be met: (1) the 4KB page mappings must map + * aligned, contiguous physical memory and (2) the 4KB page mappings must have + * identical characteristics. + */ +static void +pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, + struct rwlock **lockp) +{ + pt_entry_t *firstl3, *l3, newl2, oldl3, pa; + vm_page_t mpte; + vm_offset_t sva; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + sva = va & ~L2_OFFSET; + firstl3 = pmap_l2_to_l3(l2, sva); + newl2 = pmap_load(firstl3); + + /* Check the alingment is valid */ + if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" + " in pmap %p", va, pmap); + return; + } + + pa = newl2 + L2_SIZE - PAGE_SIZE; + for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) { + oldl3 = pmap_load(l3); + if (oldl3 != pa) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" + " in pmap %p", va, pmap); + return; + } + pa -= PAGE_SIZE; + } + + /* + * Save the page table page in its current state until the L2 + * mapping the superpage is demoted by pmap_demote_l2() or + * destroyed by pmap_remove_l3(). + */ + mpte = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); + KASSERT(mpte >= vm_page_array && + mpte < &vm_page_array[vm_page_array_size], + ("pmap_promote_l2: page table page is out of range")); + KASSERT(mpte->pindex == pmap_l2_pindex(va), + ("pmap_promote_l2: page table page's pindex is wrong")); + if (pmap_insert_pt_page(pmap, mpte)) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, + "pmap_promote_l2: failure for va %#lx in pmap %p", va, + pmap); + return; + } + + if ((newl2 & ATTR_SW_MANAGED) != 0) + pmap_pv_promote_l2(pmap, va, newl2 & ~ATTR_MASK, lockp); + + newl2 &= ~ATTR_DESCR_MASK; + newl2 |= L2_BLOCK; + + pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE); + + atomic_add_long(&pmap_l2_promotions, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: success for va %#lx in pmap %p", va, + pmap); +} + +/* * Insert the given physical page (p) at * the specified virtual address (v) in the * target physical map with the protection requested. @@ -2212,7 +2701,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, struct rwlock *lock; pd_entry_t *pde; pt_entry_t new_l3, orig_l3; - pt_entry_t *l3; + pt_entry_t *l2, *l3; pv_entry_t pv; vm_paddr_t opa, pa, l1_pa, l2_pa, l3_pa; vm_page_t mpte, om, l1_m, l2_m, l3_m; @@ -2239,6 +2728,22 @@ pmap_enter(pmap_t pmap, vm_offset_t va, lock = NULL; PMAP_LOCK(pmap); + pde = pmap_pde(pmap, va, &lvl); + if (pde != NULL && lvl == 1) { + l2 = pmap_l1_to_l2(pde, va); + if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK && + (l3 = pmap_demote_l2_locked(pmap, l2, va & ~L2_OFFSET, + &lock)) != NULL) { + l3 = &l3[pmap_l3_index(va)]; + if (va < VM_MAXUSER_ADDRESS) { + mpte = PHYS_TO_VM_PAGE( + pmap_load(l2) & ~ATTR_MASK); + mpte->wire_count++; + } + goto havel3; + } + } + if (va < VM_MAXUSER_ADDRESS) { nosleep = (flags & PMAP_ENTER_NOSLEEP) != 0; mpte = pmap_alloc_l3(pmap, va, nosleep ? NULL : &lock); @@ -2257,7 +2762,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, l3 = pmap_l2_to_l3(pde, va); } else { - pde = pmap_pde(pmap, va, &lvl); /* * If we get a level 2 pde it must point to a level 3 entry * otherwise we will need to create the intermediate tables @@ -2320,6 +2824,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, l3 = pmap_l2_to_l3(pde, va); pmap_invalidate_page(pmap, va); } +havel3: om = NULL; orig_l3 = pmap_load(l3); @@ -2399,11 +2904,11 @@ pmap_enter(pmap_t pmap, vm_offset_t va, */ if (orig_l3 != 0) { validate: - orig_l3 = pmap_load_store(l3, new_l3); - PTE_SYNC(l3); + orig_l3 = pmap_load(l3); opa = orig_l3 & ~ATTR_MASK; if (opa != pa) { + pmap_update_entry(pmap, l3, new_l3, va, PAGE_SIZE); if ((orig_l3 & ATTR_SW_MANAGED) != 0) { om = PHYS_TO_VM_PAGE(opa); if (pmap_page_dirty(orig_l3)) @@ -2412,18 +2917,38 @@ validate: vm_page_aflag_set(om, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pmap_pvh_free(&om->md, pmap, va); + if ((om->aflags & PGA_WRITEABLE) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + vm_page_aflag_clear(om, PGA_WRITEABLE); } - } else if (pmap_page_dirty(orig_l3)) { - if ((orig_l3 & ATTR_SW_MANAGED) != 0) + } else { + pmap_load_store(l3, new_l3); + PTE_SYNC(l3); + pmap_invalidate_page(pmap, va); + if (pmap_page_dirty(orig_l3) && + (orig_l3 & ATTR_SW_MANAGED) != 0) vm_page_dirty(m); } } else { pmap_load_store(l3, new_l3); - PTE_SYNC(l3); } + + PTE_SYNC(l3); pmap_invalidate_page(pmap, va); - if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) - cpu_icache_sync_range(va, PAGE_SIZE); + + if (pmap != pmap_kernel()) { + if (pmap == &curproc->p_vmspace->vm_pmap) + cpu_icache_sync_range(va, PAGE_SIZE); + + if ((mpte == NULL || mpte->wire_count == NL3PG) && + pmap_superpages_enabled() && + (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) { + pmap_promote_l2(pmap, pde, va, &lock); + } + } if (lock != NULL) rw_wunlock(lock); @@ -2497,7 +3022,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ { struct spglist free; pd_entry_t *pde; - pt_entry_t *l3; + pt_entry_t *l2, *l3; vm_paddr_t pa; int lvl; @@ -2532,6 +3057,12 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * attempt to allocate a page table page. If this * attempt fails, we don't retry. Instead, we give up. */ + if (lvl == 1) { + l2 = pmap_l1_to_l2(pde, va); + if ((pmap_load(l2) & ATTR_DESCR_MASK) == + L2_BLOCK) + return (NULL); + } if (lvl == 2 && pmap_load(pde) != 0) { mpte = PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); @@ -2589,7 +3120,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ pmap_resident_count_inc(pmap, 1); pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_IDX(m->md.pv_memattr) | - ATTR_AP(ATTR_AP_RW) | L3_PAGE; + ATTR_AP(ATTR_AP_RO) | L3_PAGE; /* * Now validate mapping with RO protection @@ -2659,6 +3190,14 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva if (pmap_load(l2) == 0) continue; + if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { + l3 = pmap_demote_l2(pmap, l2, sva); + if (l3 == NULL) + continue; + } + KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, + ("pmap_unwire: Invalid l2 entry after demotion")); + if (va_next > eva) va_next = eva; for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, @@ -2813,6 +3352,7 @@ pmap_quick_remove_page(vm_offset_t addr) boolean_t pmap_page_exists_quick(pmap_t pmap, vm_page_t m) { + struct md_page *pvh; struct rwlock *lock; pv_entry_t pv; int loops = 0; @@ -2832,6 +3372,18 @@ pmap_page_exists_quick(pmap_t pmap, vm_p if (loops >= 16) break; } + if (!rv && loops < 16 && (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { + if (PV_PMAP(pv) == pmap) { + rv = TRUE; + break; + } + loops++; + if (loops >= 16) + break; + } + } rw_runlock(lock); return (rv); } @@ -2846,10 +3398,11 @@ int pmap_page_wired_mappings(vm_page_t m) { struct rwlock *lock; + struct md_page *pvh; pmap_t pmap; pt_entry_t *pte; pv_entry_t pv; - int count, lvl, md_gen; + int count, lvl, md_gen, pvh_gen; if ((m->oflags & VPO_UNMANAGED) != 0) return (0); @@ -2874,6 +3427,29 @@ restart: count++; PMAP_UNLOCK(pmap); } + if ((m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + pvh_gen = pvh->pv_gen; + rw_runlock(lock); + PMAP_LOCK(pmap); + rw_rlock(lock); + if (md_gen != m->md.pv_gen || + pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + pte = pmap_pte(pmap, pv->pv_va, &lvl); + if (pte != NULL && + (pmap_load(pte) & ATTR_SW_WIRED) != 0) + count++; + PMAP_UNLOCK(pmap); + } + } rw_runlock(lock); return (count); } @@ -2900,8 +3476,9 @@ pmap_remove_pages(pmap_t pmap) pd_entry_t *pde; pt_entry_t *pte, tpte; struct spglist free; - vm_page_t m; + vm_page_t m, ml3, mt; pv_entry_t pv; + struct md_page *pvh; struct pv_chunk *pc, *npc; struct rwlock *lock; int64_t bit; @@ -2928,14 +3505,30 @@ pmap_remove_pages(pmap_t pmap) pde = pmap_pde(pmap, pv->pv_va, &lvl); KASSERT(pde != NULL, ("Attempting to remove an unmapped page")); - KASSERT(lvl == 2, - ("Invalid page directory level: %d", lvl)); - pte = pmap_l2_to_l3(pde, pv->pv_va); - KASSERT(pte != NULL, - ("Attempting to remove an unmapped page")); - - tpte = pmap_load(pte); + switch(lvl) { + case 1: + pte = pmap_l1_to_l2(pde, pv->pv_va); + tpte = pmap_load(pte); + KASSERT((tpte & ATTR_DESCR_MASK) == + L2_BLOCK, + ("Attempting to remove an invalid " + "block: %lx", tpte)); + tpte = pmap_load(pte); + break; + case 2: + pte = pmap_l2_to_l3(pde, pv->pv_va); + tpte = pmap_load(pte); + KASSERT((tpte & ATTR_DESCR_MASK) == + L3_PAGE, + ("Attempting to remove an invalid " + "page: %lx", tpte)); + break; + default: + panic( + "Invalid page directory level: %d", + lvl); + } /* * We cannot remove wired pages from a process' mapping at this time @@ -2958,10 +3551,17 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad pte %#jx", (uintmax_t)tpte)); - /* XXX: assumes tpte is level 3 */ - if (pmap_is_current(pmap) && - pmap_l3_valid_cacheable(tpte)) - cpu_dcache_wb_range(pv->pv_va, L3_SIZE); + if (pmap_is_current(pmap)) { + if (lvl == 2 && + pmap_l3_valid_cacheable(tpte)) { + cpu_dcache_wb_range(pv->pv_va, + L3_SIZE); + } else if (lvl == 1 && + pmap_pte_valid_cacheable(tpte)) { + cpu_dcache_wb_range(pv->pv_va, + L2_SIZE); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 16 12:39:22 2016 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 C36C1BDC740; Fri, 16 Sep 2016 12:39:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7845E8C9; Fri, 16 Sep 2016 12:39:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCdLmP016725; Fri, 16 Sep 2016 12:39:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCdL56016724; Fri, 16 Sep 2016 12:39:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161239.u8GCdL56016724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305883 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:39:22 -0000 Author: andrew Date: Fri Sep 16 12:39:21 2016 New Revision: 305883 URL: https://svnweb.freebsd.org/changeset/base/305883 Log: MFC 305545: Only call cpu_icache_sync_range when inserting an executable page. If the page is non-executable the contents of the i-cache are unimportant so this call is just adding unneeded overhead when inserting pages. While doing research using gem5 with an O3 pipeline and 1k/32k/1M iTLB/L1 iCache/L2 Bjoern Zeeb (bz@) observed a fairly high rate of calls into arm64_icache_sync_range() from pmap_enter() along with a high number of instruction fetches and iTLB/iCache hits. Limiting the calls to arm64_icache_sync_range() to only executable pages, we observe the iTLB and iCache Hit going down by about 43%. These numbers are quite misleading when looked at alone as at the same time instructions retired were reduced by 19.2% and instruction fetches were reduced by 38.8%. Overall this reduced the runtime of the test program by 22.4%. On Juno hardware, in steady-state, running the same test, using the cycle count to determine runtime, we do see a reduction of up to 28.9% in runtime. While these numbers certainly depend on the program executed, we expect an overall performance improvement. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:36:11 2016 (r305882) +++ stable/11/sys/arm64/arm64/pmap.c Fri Sep 16 12:39:21 2016 (r305883) @@ -2939,8 +2939,9 @@ validate: pmap_invalidate_page(pmap, va); if (pmap != pmap_kernel()) { - if (pmap == &curproc->p_vmspace->vm_pmap) - cpu_icache_sync_range(va, PAGE_SIZE); + if (pmap == &curproc->p_vmspace->vm_pmap && + (prot & VM_PROT_EXECUTE) != 0) + cpu_icache_sync_range(va, PAGE_SIZE); if ((mpte == NULL || mpte->wire_count == NL3PG) && pmap_superpages_enabled() && From owner-svn-src-all@freebsd.org Fri Sep 16 12:42:37 2016 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 C69BDBDC8BB; Fri, 16 Sep 2016 12:42:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98934C7A; Fri, 16 Sep 2016 12:42:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCga7E020267; Fri, 16 Sep 2016 12:42:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCgaqF020266; Fri, 16 Sep 2016 12:42:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161242.u8GCgaqF020266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305884 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:42:37 -0000 Author: andrew Date: Fri Sep 16 12:42:36 2016 New Revision: 305884 URL: https://svnweb.freebsd.org/changeset/base/305884 Log: MFC 305546: When synchronising the instruction and data caches we only need to clean the data cache to the point of unification. This is the point where the two caches are unified to a single unified cache so cleaning past here is just extra unneeded work. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/cpufunc_asm.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- stable/11/sys/arm64/arm64/cpufunc_asm.S Fri Sep 16 12:39:21 2016 (r305883) +++ stable/11/sys/arm64/arm64/cpufunc_asm.S Fri Sep 16 12:42:36 2016 (r305884) @@ -151,5 +151,5 @@ END(arm64_idcache_wbinv_range) * void arm64_icache_sync_range(vm_offset_t, vm_size_t) */ ENTRY(arm64_icache_sync_range) - cache_handle_range dcop = cvac, ic = 1, icop = ivau + cache_handle_range dcop = cvau, ic = 1, icop = ivau END(arm64_icache_sync_range) From owner-svn-src-all@freebsd.org Fri Sep 16 12:48:59 2016 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 85639BDC9B0; Fri, 16 Sep 2016 12:48:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E150E6F; Fri, 16 Sep 2016 12:48:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GCmwbc020543; Fri, 16 Sep 2016 12:48:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GCmwuN020542; Fri, 16 Sep 2016 12:48:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161248.u8GCmwuN020542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 12:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305885 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:48:59 -0000 Author: andrew Date: Fri Sep 16 12:48:58 2016 New Revision: 305885 URL: https://svnweb.freebsd.org/changeset/base/305885 Log: MFC 305128: Also handle instruction traps. We might hit these when the page we are executing is being promoted to a superpage. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/trap.c ============================================================================== --- stable/11/sys/arm64/arm64/trap.c Fri Sep 16 12:42:36 2016 (r305884) +++ stable/11/sys/arm64/arm64/trap.c Fri Sep 16 12:48:58 2016 (r305885) @@ -282,6 +282,7 @@ do_el1h_sync(struct trapframe *frame) print_registers(frame); printf(" esr: %.8lx\n", esr); panic("VFP exception in the kernel"); + case EXCP_INSN_ABORT: case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); intr_enable(); From owner-svn-src-all@freebsd.org Fri Sep 16 12:50:46 2016 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 6133FBDCA3D; Fri, 16 Sep 2016 12:50:46 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 322A5FF5; Fri, 16 Sep 2016 12:50:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 8C8D2D78FE; Fri, 16 Sep 2016 12:50:39 +0000 (UTC) Date: Fri, 16 Sep 2016 13:50:36 +0100 From: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r305885 - stable/11/sys/arm64/arm64 Message-ID: <20160916135036.27b6e885@zapp> In-Reply-To: <201609161248.u8GCmwuN020542@repo.freebsd.org> References: <201609161248.u8GCmwuN020542@repo.freebsd.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 12:50:46 -0000 On Fri, 16 Sep 2016 12:48:58 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Fri Sep 16 12:48:58 2016 > New Revision: 305885 > URL: https://svnweb.freebsd.org/changeset/base/305885 > > Log: > MFC 305128: > Also handle instruction traps. We might hit these when the page we > are executing is being promoted to a superpage. We don't promote kernel pages that this change is handling, however it was merged for completeness. Andrew From owner-svn-src-all@freebsd.org Fri Sep 16 13:00:56 2016 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 8C77DBDCC67; Fri, 16 Sep 2016 13:00:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E6E6779; Fri, 16 Sep 2016 13:00:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GD0tlB024487; Fri, 16 Sep 2016 13:00:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GD0tHN024486; Fri, 16 Sep 2016 13:00:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161300.u8GD0tHN024486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 13:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305886 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 13:00:56 -0000 Author: andrew Date: Fri Sep 16 13:00:55 2016 New Revision: 305886 URL: https://svnweb.freebsd.org/changeset/base/305886 Log: MFC 305607: Trap msr/mrs instructions. These are privileged arm64 instructions and shouldn't normally be used. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/trap.c ============================================================================== --- stable/11/sys/arm64/arm64/trap.c Fri Sep 16 12:48:58 2016 (r305885) +++ stable/11/sys/arm64/arm64/trap.c Fri Sep 16 13:00:55 2016 (r305886) @@ -388,6 +388,10 @@ do_el0_sync(struct trapframe *frame) call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr); userret(td, frame); break; + case EXCP_MSR: + call_trapsignal(td, SIGILL, ILL_PRVOPC, (void *)frame->tf_elr); + userret(td, frame); + break; case EXCP_SOFTSTP_EL0: td->td_frame->tf_spsr &= ~PSR_SS; td->td_pcb->pcb_flags &= ~PCB_SINGLE_STEP; From owner-svn-src-all@freebsd.org Fri Sep 16 14:23:17 2016 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 73F43BDCFA8; Fri, 16 Sep 2016 14:23:17 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 442A5FE5; Fri, 16 Sep 2016 14:23:17 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GENGep057868; Fri, 16 Sep 2016 14:23:16 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GENGjv057867; Fri, 16 Sep 2016 14:23:16 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201609161423.u8GENGjv057867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 16 Sep 2016 14:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305887 - head/usr.bin/seq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 14:23:17 -0000 Author: wblock (doc committer) Date: Fri Sep 16 14:23:16 2016 New Revision: 305887 URL: https://svnweb.freebsd.org/changeset/base/305887 Log: Update history. Patch supplied by Sevan Janiyan . PR: 181390 Submitted by: ksmakoto@dd.iij4u.or.jp MFC after: 1 week Modified: head/usr.bin/seq/seq.1 Modified: head/usr.bin/seq/seq.1 ============================================================================== --- head/usr.bin/seq/seq.1 Fri Sep 16 13:00:55 2016 (r305886) +++ head/usr.bin/seq/seq.1 Fri Sep 16 14:23:16 2016 (r305887) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2013 +.Dd August 12, 2016 .Dt SEQ 1 .Os .Sh NAME @@ -156,13 +156,13 @@ the default conversion is changed to .Sh HISTORY The .Nm -command first appeared in -.Tn "Plan 9 from Bell Labs" . +command first appeared in Version\~8 +.At . A .Nm command appeared in .Nx 3.0 , -and ported to +and was ported to .Fx 9.0 . This command was based on the command of the same name in .Tn "Plan 9 from Bell Labs" @@ -180,9 +180,4 @@ option does not handle the transition fr to exponent representation very well. The .Nm -command is not bug for bug compatible with the -.Tn "Plan 9 from Bell Labs" -or -.Tn GNU -versions of -.Nm . +command is not bug for bug compatible with other implementations. From owner-svn-src-all@freebsd.org Fri Sep 16 15:19:33 2016 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 64C0CBDD01A; Fri, 16 Sep 2016 15:19:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11595F6C; Fri, 16 Sep 2016 15:19:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GFJW1o077009; Fri, 16 Sep 2016 15:19:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GFJWin077006; Fri, 16 Sep 2016 15:19:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161519.u8GFJWin077006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 15:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305888 - in vendor/cortex-strings: . dist dist/autom4te.cache dist/benchmarks dist/benchmarks/dhry dist/benchmarks/dhry/.deps dist/benchmarks/multi dist/benchmarks/multi/.deps dist/ref... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 15:19:33 -0000 Author: andrew Date: Fri Sep 16 15:19:31 2016 New Revision: 305888 URL: https://svnweb.freebsd.org/changeset/base/305888 Log: Import the Linaro Cortex Strings library from https://git.linaro.org/toolchain/cortex-strings.git Sponsored by: The FreeBSD Foundation Added: vendor/cortex-strings/ vendor/cortex-strings/dist/ vendor/cortex-strings/dist/.gitignore vendor/cortex-strings/dist/Makefile (contents, props changed) vendor/cortex-strings/dist/Makefile.am (contents, props changed) vendor/cortex-strings/dist/Makefile.in (contents, props changed) vendor/cortex-strings/dist/README vendor/cortex-strings/dist/aclocal.m4 vendor/cortex-strings/dist/autogen.sh (contents, props changed) vendor/cortex-strings/dist/autom4te.cache/ vendor/cortex-strings/dist/autom4te.cache/output.0 vendor/cortex-strings/dist/autom4te.cache/output.1 (contents, props changed) vendor/cortex-strings/dist/autom4te.cache/requests vendor/cortex-strings/dist/autom4te.cache/traces.0 vendor/cortex-strings/dist/autom4te.cache/traces.1 (contents, props changed) vendor/cortex-strings/dist/benchmarks/ vendor/cortex-strings/dist/benchmarks/dhry/ vendor/cortex-strings/dist/benchmarks/dhry/.deps/ vendor/cortex-strings/dist/benchmarks/dhry/.deps/dhry-dhry_1.Po (contents, props changed) vendor/cortex-strings/dist/benchmarks/dhry/.deps/dhry-dhry_2.Po (contents, props changed) vendor/cortex-strings/dist/benchmarks/dhry/.deps/dhry_native-dhry_1.Po (contents, props changed) vendor/cortex-strings/dist/benchmarks/dhry/.deps/dhry_native-dhry_2.Po (contents, props changed) vendor/cortex-strings/dist/benchmarks/dhry/dhry.h (contents, props changed) vendor/cortex-strings/dist/benchmarks/dhry/dhry_1.c (contents, props changed) vendor/cortex-strings/dist/benchmarks/dhry/dhry_2.c (contents, props changed) vendor/cortex-strings/dist/benchmarks/multi/ vendor/cortex-strings/dist/benchmarks/multi/.deps/ vendor/cortex-strings/dist/benchmarks/multi/.deps/.dirstamp vendor/cortex-strings/dist/benchmarks/multi/.deps/libmulti_a-harness.Po (contents, props changed) vendor/cortex-strings/dist/benchmarks/multi/.dirstamp vendor/cortex-strings/dist/benchmarks/multi/harness.c (contents, props changed) vendor/cortex-strings/dist/compile (contents, props changed) vendor/cortex-strings/dist/config.guess (contents, props changed) vendor/cortex-strings/dist/config.h (contents, props changed) vendor/cortex-strings/dist/config.h.in (contents, props changed) vendor/cortex-strings/dist/config.log vendor/cortex-strings/dist/config.status (contents, props changed) vendor/cortex-strings/dist/config.sub (contents, props changed) vendor/cortex-strings/dist/configure (contents, props changed) vendor/cortex-strings/dist/configure.ac vendor/cortex-strings/dist/depcomp (contents, props changed) vendor/cortex-strings/dist/install-sh (contents, props changed) vendor/cortex-strings/dist/libtool (contents, props changed) vendor/cortex-strings/dist/ltmain.sh (contents, props changed) vendor/cortex-strings/dist/missing (contents, props changed) vendor/cortex-strings/dist/reference/ vendor/cortex-strings/dist/reference/bionic-a15/ vendor/cortex-strings/dist/reference/bionic-a15/.deps/ vendor/cortex-strings/dist/reference/bionic-a15/.deps/libbionic_a15_a-strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/.deps/memcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/memcmp.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/memcpy.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/memset.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/strcmp.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/strcpy.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a15/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/ vendor/cortex-strings/dist/reference/bionic-a9/.deps/ vendor/cortex-strings/dist/reference/bionic-a9/.deps/libbionic_a9_a-strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/.deps/memcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/memcmp.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/memcpy.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/memset.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/strcmp.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/strcpy.S (contents, props changed) vendor/cortex-strings/dist/reference/bionic-a9/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/ vendor/cortex-strings/dist/reference/bionic-c/.deps/ vendor/cortex-strings/dist/reference/bionic-c/.deps/.dirstamp vendor/cortex-strings/dist/reference/bionic-c/.deps/bcopy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/memchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/memcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/strchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.deps/strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/.dirstamp vendor/cortex-strings/dist/reference/bionic-c/bcopy.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/memchr.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/memcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/memcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/memset.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/strchr.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/strcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/strcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/bionic-c/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/csl/ vendor/cortex-strings/dist/reference/csl/.deps/ vendor/cortex-strings/dist/reference/csl/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/csl/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/csl/arm_asm.h (contents, props changed) vendor/cortex-strings/dist/reference/csl/memcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/csl/memset.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc/ vendor/cortex-strings/dist/reference/glibc-c/ vendor/cortex-strings/dist/reference/glibc-c/.deps/ vendor/cortex-strings/dist/reference/glibc-c/.deps/.dirstamp vendor/cortex-strings/dist/reference/glibc-c/.deps/memchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/memcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/strchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.deps/wordcopy.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/.dirstamp vendor/cortex-strings/dist/reference/glibc-c/memchr.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/memcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/memcopy.h (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/memcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/memset.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/pagecopy.h (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/strchr.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/strcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/strcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc-c/wordcopy.c (contents, props changed) vendor/cortex-strings/dist/reference/glibc/.deps/ vendor/cortex-strings/dist/reference/glibc/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc/.deps/strchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc/.deps/strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/glibc/memcpy.S (contents, props changed) vendor/cortex-strings/dist/reference/glibc/memset.S (contents, props changed) vendor/cortex-strings/dist/reference/glibc/strchr.S (contents, props changed) vendor/cortex-strings/dist/reference/glibc/strlen.S (contents, props changed) vendor/cortex-strings/dist/reference/helpers/ vendor/cortex-strings/dist/reference/helpers/bounce.c (contents, props changed) vendor/cortex-strings/dist/reference/helpers/spawn.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib/ vendor/cortex-strings/dist/reference/newlib-c/ vendor/cortex-strings/dist/reference/newlib-c/.deps/ vendor/cortex-strings/dist/reference/newlib-c/.deps/memchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/memcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/strchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/.deps/strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/memchr.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/memcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/memcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/memset.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/shim.h (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/strchr.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/strcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/strcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-c/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/ vendor/cortex-strings/dist/reference/newlib-xscale/.deps/ vendor/cortex-strings/dist/reference/newlib-xscale/.deps/memchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/.deps/strchr.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/.deps/strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/memchr.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/memcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/memset.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/strchr.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/strcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/strcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib-xscale/xscale.h (contents, props changed) vendor/cortex-strings/dist/reference/newlib/.deps/ vendor/cortex-strings/dist/reference/newlib/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib/.deps/strlen.Po (contents, props changed) vendor/cortex-strings/dist/reference/newlib/arm_asm.h (contents, props changed) vendor/cortex-strings/dist/reference/newlib/memcpy.S (contents, props changed) vendor/cortex-strings/dist/reference/newlib/shim.h (contents, props changed) vendor/cortex-strings/dist/reference/newlib/strcmp.S (contents, props changed) vendor/cortex-strings/dist/reference/newlib/strcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/newlib/strlen.c (contents, props changed) vendor/cortex-strings/dist/reference/plain/ vendor/cortex-strings/dist/reference/plain/.deps/ vendor/cortex-strings/dist/reference/plain/.deps/memcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/plain/.deps/memset.Po (contents, props changed) vendor/cortex-strings/dist/reference/plain/.deps/strcmp.Po (contents, props changed) vendor/cortex-strings/dist/reference/plain/.deps/strcpy.Po (contents, props changed) vendor/cortex-strings/dist/reference/plain/memcpy.c (contents, props changed) vendor/cortex-strings/dist/reference/plain/memset.c (contents, props changed) vendor/cortex-strings/dist/reference/plain/strcmp.c (contents, props changed) vendor/cortex-strings/dist/reference/plain/strcpy.c (contents, props changed) vendor/cortex-strings/dist/scripts/ vendor/cortex-strings/dist/scripts/add-license.sh (contents, props changed) vendor/cortex-strings/dist/scripts/bench.py (contents, props changed) vendor/cortex-strings/dist/scripts/fixup.py (contents, props changed) vendor/cortex-strings/dist/scripts/libplot.py (contents, props changed) vendor/cortex-strings/dist/scripts/plot-align.py (contents, props changed) vendor/cortex-strings/dist/scripts/plot-sizes.py (contents, props changed) vendor/cortex-strings/dist/scripts/plot-top.py (contents, props changed) vendor/cortex-strings/dist/scripts/plot.py (contents, props changed) vendor/cortex-strings/dist/scripts/trim.sh (contents, props changed) vendor/cortex-strings/dist/src/ vendor/cortex-strings/dist/src/aarch64/ vendor/cortex-strings/dist/src/aarch64/.deps/ vendor/cortex-strings/dist/src/aarch64/.deps/memchr.Plo vendor/cortex-strings/dist/src/aarch64/.deps/memcmp.Plo vendor/cortex-strings/dist/src/aarch64/.deps/memcpy.Plo vendor/cortex-strings/dist/src/aarch64/.deps/memmove.Plo vendor/cortex-strings/dist/src/aarch64/.deps/memset.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strchr.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strchrnul.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strcmp.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strcpy.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strlen.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strncmp.Plo vendor/cortex-strings/dist/src/aarch64/.deps/strnlen.Plo vendor/cortex-strings/dist/src/aarch64/memchr.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/memcmp.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/memcpy.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/memmove.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/memset.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strchr.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strchrnul.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strcmp.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strcpy.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strlen.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strncmp.S (contents, props changed) vendor/cortex-strings/dist/src/aarch64/strnlen.S (contents, props changed) vendor/cortex-strings/dist/src/arm/ vendor/cortex-strings/dist/src/arm/.deps/ vendor/cortex-strings/dist/src/arm/.deps/memchr.Plo vendor/cortex-strings/dist/src/arm/.deps/memcpy.Plo vendor/cortex-strings/dist/src/arm/.deps/memset.Plo vendor/cortex-strings/dist/src/arm/.deps/strchr.Plo vendor/cortex-strings/dist/src/arm/.deps/strcmp.Plo vendor/cortex-strings/dist/src/arm/memchr.S (contents, props changed) vendor/cortex-strings/dist/src/arm/memcpy.S (contents, props changed) vendor/cortex-strings/dist/src/arm/memset.S (contents, props changed) vendor/cortex-strings/dist/src/arm/strchr.S (contents, props changed) vendor/cortex-strings/dist/src/arm/strcmp.S (contents, props changed) vendor/cortex-strings/dist/src/thumb/ vendor/cortex-strings/dist/src/thumb-2/ vendor/cortex-strings/dist/src/thumb-2/.deps/ vendor/cortex-strings/dist/src/thumb-2/.deps/strcpy.Plo vendor/cortex-strings/dist/src/thumb-2/.deps/strlen.Plo vendor/cortex-strings/dist/src/thumb-2/strcpy.c (contents, props changed) vendor/cortex-strings/dist/src/thumb-2/strlen.S (contents, props changed) vendor/cortex-strings/dist/src/thumb/aeabi_idiv.S (contents, props changed) vendor/cortex-strings/dist/src/thumb/strcmp-armv6m.S (contents, props changed) vendor/cortex-strings/dist/stamp-h1 vendor/cortex-strings/dist/test-driver (contents, props changed) vendor/cortex-strings/dist/tests/ vendor/cortex-strings/dist/tests/.deps/ vendor/cortex-strings/dist/tests/.deps/test-strnlen.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_memchr-test-memchr.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_memcmp-test-memcmp.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_memcpy-test-memcpy.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_memmove-test-memmove.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_memset-test-memset.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_strchr-test-strchr.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_strcmp-test-strcmp.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_strcpy-test-strcpy.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_strlen-test-strlen.Po (contents, props changed) vendor/cortex-strings/dist/tests/.deps/tests_test_strncmp-test-strncmp.Po (contents, props changed) vendor/cortex-strings/dist/tests/hp-timing.h (contents, props changed) vendor/cortex-strings/dist/tests/test-memchr.c (contents, props changed) vendor/cortex-strings/dist/tests/test-memcmp.c (contents, props changed) vendor/cortex-strings/dist/tests/test-memcpy.c (contents, props changed) vendor/cortex-strings/dist/tests/test-memmove.c (contents, props changed) vendor/cortex-strings/dist/tests/test-memset.c (contents, props changed) vendor/cortex-strings/dist/tests/test-skeleton.c (contents, props changed) vendor/cortex-strings/dist/tests/test-strchr.c (contents, props changed) vendor/cortex-strings/dist/tests/test-strcmp.c (contents, props changed) vendor/cortex-strings/dist/tests/test-strcpy.c (contents, props changed) vendor/cortex-strings/dist/tests/test-string.h (contents, props changed) vendor/cortex-strings/dist/tests/test-strlen.c (contents, props changed) vendor/cortex-strings/dist/tests/test-strncmp.c (contents, props changed) vendor/cortex-strings/dist/tests/test-strnlen.c (contents, props changed) Added: vendor/cortex-strings/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/cortex-strings/dist/.gitignore Fri Sep 16 15:19:31 2016 (r305888) @@ -0,0 +1,11 @@ +*.a +*.o +*.la +*.lo +*.png +*.pyc +.deps +.dirstamp +.libs +try-* +cache.txt Added: vendor/cortex-strings/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/cortex-strings/dist/Makefile Fri Sep 16 15:19:31 2016 (r305888) @@ -0,0 +1,2797 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# Copyright (c) 2011, Linaro Limited +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of the Linaro nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. +# + +# Top level Makefile for cortex-strings + + + + +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/cortex-strings +pkgincludedir = $(includedir)/cortex-strings +pkglibdir = $(libdir)/cortex-strings +pkglibexecdir = $(libexecdir)/cortex-strings +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = aarch64-none-elf +host_triplet = aarch64-none-elf +check_PROGRAMS = tests/test-memchr$(EXEEXT) tests/test-memcmp$(EXEEXT) \ + tests/test-memcpy$(EXEEXT) tests/test-memmove$(EXEEXT) \ + tests/test-memset$(EXEEXT) tests/test-strchr$(EXEEXT) \ + tests/test-strcmp$(EXEEXT) tests/test-strcpy$(EXEEXT) \ + tests/test-strlen$(EXEEXT) tests/test-strncmp$(EXEEXT) \ + tests/test-strnlen$(EXEEXT) +noinst_PROGRAMS = dhry$(EXEEXT) dhry-native$(EXEEXT) try-none$(EXEEXT) \ + try-this$(EXEEXT) try-plain$(EXEEXT) try-newlib-c$(EXEEXT) \ + try-bionic-c$(EXEEXT) try-glibc-c$(EXEEXT) $(am__EXEEXT_1) + +# Benchmarks and example programs +#am__append_1 = \ +# try-bionic-a9 \ +# try-bionic-a15 \ +# try-csl \ +# try-glibc \ +# try-newlib \ +# try-newlib-xscale + + +# Libraries used in the benchmarks and examples +#am__append_2 = \ +# libbionic-a9.a \ +# libbionic-a15.a \ +# libcsl.a \ +# libglibc.a \ +# libnewlib.a \ +# libnewlib-xscale.a + +#am__append_3 = \ +# -mtune=$(submachine) + +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY)) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libbionic_a15_a_AR = $(AR) $(ARFLAGS) +libbionic_a15_a_LIBADD = +am__libbionic_a15_a_SOURCES_DIST = reference/bionic-a15/memcpy.S \ + reference/bionic-a15/memset.S reference/bionic-a15/memcmp.S \ + reference/bionic-a15/strcmp.S reference/bionic-a15/strcpy.S \ + reference/bionic-a15/strlen.c +am__dirstamp = $(am__leading_dot)dirstamp +#am__objects_1 = reference/bionic-a15/memcpy.$(OBJEXT) \ +# reference/bionic-a15/memset.$(OBJEXT) +#am_libbionic_a15_a_OBJECTS = $(am__objects_1) \ +# reference/bionic-a15/memcmp.$(OBJEXT) \ +# reference/bionic-a15/strcmp.$(OBJEXT) \ +# reference/bionic-a15/strcpy.$(OBJEXT) \ +# reference/bionic-a15/libbionic_a15_a-strlen.$(OBJEXT) +libbionic_a15_a_OBJECTS = $(am_libbionic_a15_a_OBJECTS) +libbionic_a9_a_AR = $(AR) $(ARFLAGS) +libbionic_a9_a_LIBADD = +am__libbionic_a9_a_SOURCES_DIST = reference/bionic-a9/memcpy.S \ + reference/bionic-a9/memset.S reference/bionic-a9/memcmp.S \ + reference/bionic-a9/strcmp.S reference/bionic-a9/strcpy.S \ + reference/bionic-a9/strlen.c +#am__objects_2 = reference/bionic-a9/memcpy.$(OBJEXT) \ +# reference/bionic-a9/memset.$(OBJEXT) +#am_libbionic_a9_a_OBJECTS = $(am__objects_2) \ +# reference/bionic-a9/memcmp.$(OBJEXT) \ +# reference/bionic-a9/strcmp.$(OBJEXT) \ +# reference/bionic-a9/strcpy.$(OBJEXT) \ +# reference/bionic-a9/libbionic_a9_a-strlen.$(OBJEXT) +libbionic_a9_a_OBJECTS = $(am_libbionic_a9_a_OBJECTS) +libbionic_c_a_AR = $(AR) $(ARFLAGS) +libbionic_c_a_LIBADD = +am_libbionic_c_a_OBJECTS = reference/bionic-c/bcopy.$(OBJEXT) \ + reference/bionic-c/memchr.$(OBJEXT) \ + reference/bionic-c/memcmp.$(OBJEXT) \ + reference/bionic-c/memcpy.$(OBJEXT) \ + reference/bionic-c/memset.$(OBJEXT) \ + reference/bionic-c/strchr.$(OBJEXT) \ + reference/bionic-c/strcmp.$(OBJEXT) \ + reference/bionic-c/strcpy.$(OBJEXT) \ + reference/bionic-c/strlen.$(OBJEXT) +libbionic_c_a_OBJECTS = $(am_libbionic_c_a_OBJECTS) +libcsl_a_AR = $(AR) $(ARFLAGS) +libcsl_a_LIBADD = +am__libcsl_a_SOURCES_DIST = reference/csl/memcpy.c \ + reference/csl/memset.c reference/csl/arm_asm.h +#am_libcsl_a_OBJECTS = \ +# reference/csl/memcpy.$(OBJEXT) \ +# reference/csl/memset.$(OBJEXT) +libcsl_a_OBJECTS = $(am_libcsl_a_OBJECTS) +libglibc_c_a_AR = $(AR) $(ARFLAGS) +libglibc_c_a_LIBADD = +am_libglibc_c_a_OBJECTS = reference/glibc-c/memchr.$(OBJEXT) \ + reference/glibc-c/memcmp.$(OBJEXT) \ + reference/glibc-c/memcpy.$(OBJEXT) \ + reference/glibc-c/memset.$(OBJEXT) \ + reference/glibc-c/strchr.$(OBJEXT) \ + reference/glibc-c/strcmp.$(OBJEXT) \ + reference/glibc-c/strcpy.$(OBJEXT) \ + reference/glibc-c/strlen.$(OBJEXT) \ + reference/glibc-c/wordcopy.$(OBJEXT) +libglibc_c_a_OBJECTS = $(am_libglibc_c_a_OBJECTS) +libglibc_a_AR = $(AR) $(ARFLAGS) +libglibc_a_LIBADD = +am__libglibc_a_SOURCES_DIST = reference/glibc/memcpy.S \ + reference/glibc/memset.S reference/glibc/strchr.S \ + reference/glibc/strlen.S +#am_libglibc_a_OBJECTS = \ +# reference/glibc/memcpy.$(OBJEXT) \ +# reference/glibc/memset.$(OBJEXT) \ +# reference/glibc/strchr.$(OBJEXT) \ +# reference/glibc/strlen.$(OBJEXT) +libglibc_a_OBJECTS = $(am_libglibc_a_OBJECTS) +libmulti_a_AR = $(AR) $(ARFLAGS) +libmulti_a_LIBADD = +am_libmulti_a_OBJECTS = benchmarks/multi/libmulti_a-harness.$(OBJEXT) +libmulti_a_OBJECTS = $(am_libmulti_a_OBJECTS) +libnewlib_c_a_AR = $(AR) $(ARFLAGS) +libnewlib_c_a_LIBADD = +am_libnewlib_c_a_OBJECTS = reference/newlib-c/memchr.$(OBJEXT) \ + reference/newlib-c/memcmp.$(OBJEXT) \ + reference/newlib-c/memcpy.$(OBJEXT) \ + reference/newlib-c/memset.$(OBJEXT) \ + reference/newlib-c/strchr.$(OBJEXT) \ + reference/newlib-c/strcmp.$(OBJEXT) \ + reference/newlib-c/strcpy.$(OBJEXT) \ + reference/newlib-c/strlen.$(OBJEXT) +libnewlib_c_a_OBJECTS = $(am_libnewlib_c_a_OBJECTS) +libnewlib_xscale_a_AR = $(AR) $(ARFLAGS) +libnewlib_xscale_a_LIBADD = +am__libnewlib_xscale_a_SOURCES_DIST = \ + reference/newlib-xscale/memchr.c \ + reference/newlib-xscale/memcpy.c \ + reference/newlib-xscale/memset.c \ + reference/newlib-xscale/strchr.c \ + reference/newlib-xscale/strcmp.c \ + reference/newlib-xscale/strcpy.c \ + reference/newlib-xscale/strlen.c \ + reference/newlib-xscale/xscale.h +#am_libnewlib_xscale_a_OBJECTS = \ +# reference/newlib-xscale/memchr.$(OBJEXT) \ +# reference/newlib-xscale/memcpy.$(OBJEXT) \ +# reference/newlib-xscale/memset.$(OBJEXT) \ +# reference/newlib-xscale/strchr.$(OBJEXT) \ +# reference/newlib-xscale/strcmp.$(OBJEXT) \ +# reference/newlib-xscale/strcpy.$(OBJEXT) \ +# reference/newlib-xscale/strlen.$(OBJEXT) +libnewlib_xscale_a_OBJECTS = $(am_libnewlib_xscale_a_OBJECTS) +libnewlib_a_AR = $(AR) $(ARFLAGS) +libnewlib_a_LIBADD = +am__libnewlib_a_SOURCES_DIST = reference/newlib/memcpy.S \ + reference/newlib/strcmp.S reference/newlib/strcpy.c \ + reference/newlib/strlen.c reference/newlib/arm_asm.h \ + reference/newlib/shim.h +#am_libnewlib_a_OBJECTS = \ +# reference/newlib/memcpy.$(OBJEXT) \ +# reference/newlib/strcmp.$(OBJEXT) \ +# reference/newlib/strcpy.$(OBJEXT) \ +# reference/newlib/strlen.$(OBJEXT) +libnewlib_a_OBJECTS = $(am_libnewlib_a_OBJECTS) +libplain_a_AR = $(AR) $(ARFLAGS) +libplain_a_LIBADD = +am_libplain_a_OBJECTS = reference/plain/memset.$(OBJEXT) \ + reference/plain/memcpy.$(OBJEXT) \ + reference/plain/strcmp.$(OBJEXT) \ + reference/plain/strcpy.$(OBJEXT) +libplain_a_OBJECTS = $(am_libplain_a_OBJECTS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libcortex_strings_la_LIBADD = +am__libcortex_strings_la_SOURCES_DIST = src/thumb-2/strcpy.c \ + src/arm/memchr.S src/arm/strchr.S src/thumb-2/strlen.S \ + src/arm/memset.S src/arm/memcpy.S src/arm/strcmp.S \ + src/aarch64/memchr.S src/aarch64/memcmp.S src/aarch64/memcpy.S \ + src/aarch64/memmove.S src/aarch64/memset.S \ + src/aarch64/strchr.S src/aarch64/strchrnul.S \ + src/aarch64/strcmp.S src/aarch64/strcpy.S src/aarch64/strlen.S \ + src/aarch64/strncmp.S src/aarch64/strnlen.S +am_libcortex_strings_la_OBJECTS = \ + src/aarch64/memchr.lo \ + src/aarch64/memcmp.lo \ + src/aarch64/memcpy.lo \ + src/aarch64/memmove.lo \ + src/aarch64/memset.lo \ + src/aarch64/strchr.lo \ + src/aarch64/strchrnul.lo \ + src/aarch64/strcmp.lo \ + src/aarch64/strcpy.lo \ + src/aarch64/strlen.lo \ + src/aarch64/strncmp.lo \ + src/aarch64/strnlen.lo +#am_libcortex_strings_la_OBJECTS = \ +# src/thumb-2/strcpy.lo src/arm/memchr.lo \ +# src/arm/strchr.lo src/thumb-2/strlen.lo \ +# src/arm/memset.lo src/arm/memcpy.lo \ +# src/arm/strcmp.lo +libcortex_strings_la_OBJECTS = $(am_libcortex_strings_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +libcortex_strings_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libcortex_strings_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +#am__EXEEXT_1 = try-bionic-a9$(EXEEXT) \ +# try-bionic-a15$(EXEEXT) try-csl$(EXEEXT) \ +# try-glibc$(EXEEXT) try-newlib$(EXEEXT) \ +# try-newlib-xscale$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am_dhry_OBJECTS = benchmarks/dhry/dhry-dhry_1.$(OBJEXT) \ + benchmarks/dhry/dhry-dhry_2.$(OBJEXT) +dhry_OBJECTS = $(am_dhry_OBJECTS) +dhry_DEPENDENCIES = libcortex-strings.la +dhry_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(dhry_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am__objects_3 = benchmarks/dhry/dhry_native-dhry_1.$(OBJEXT) \ + benchmarks/dhry/dhry_native-dhry_2.$(OBJEXT) +am_dhry_native_OBJECTS = $(am__objects_3) +dhry_native_OBJECTS = $(am_dhry_native_OBJECTS) +dhry_native_LDADD = $(LDADD) +dhry_native_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(dhry_native_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +tests_test_memchr_SOURCES = tests/test-memchr.c +tests_test_memchr_OBJECTS = \ + tests/tests_test_memchr-test-memchr.$(OBJEXT) +tests_test_memchr_DEPENDENCIES = $(tests_ldadd) +tests_test_memchr_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_memchr_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_memcmp_SOURCES = tests/test-memcmp.c +tests_test_memcmp_OBJECTS = \ + tests/tests_test_memcmp-test-memcmp.$(OBJEXT) +tests_test_memcmp_DEPENDENCIES = $(tests_ldadd) +tests_test_memcmp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_memcmp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_memcpy_SOURCES = tests/test-memcpy.c +tests_test_memcpy_OBJECTS = \ + tests/tests_test_memcpy-test-memcpy.$(OBJEXT) +tests_test_memcpy_DEPENDENCIES = $(tests_ldadd) +tests_test_memcpy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_memcpy_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_memmove_SOURCES = tests/test-memmove.c +tests_test_memmove_OBJECTS = \ + tests/tests_test_memmove-test-memmove.$(OBJEXT) +tests_test_memmove_DEPENDENCIES = $(tests_ldadd) +tests_test_memmove_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_memmove_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +tests_test_memset_SOURCES = tests/test-memset.c +tests_test_memset_OBJECTS = \ + tests/tests_test_memset-test-memset.$(OBJEXT) +tests_test_memset_DEPENDENCIES = $(tests_ldadd) +tests_test_memset_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_memset_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_strchr_SOURCES = tests/test-strchr.c +tests_test_strchr_OBJECTS = \ + tests/tests_test_strchr-test-strchr.$(OBJEXT) +tests_test_strchr_DEPENDENCIES = $(tests_ldadd) +tests_test_strchr_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_strchr_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_strcmp_SOURCES = tests/test-strcmp.c +tests_test_strcmp_OBJECTS = \ + tests/tests_test_strcmp-test-strcmp.$(OBJEXT) +tests_test_strcmp_DEPENDENCIES = $(tests_ldadd) +tests_test_strcmp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_strcmp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_strcpy_SOURCES = tests/test-strcpy.c +tests_test_strcpy_OBJECTS = \ + tests/tests_test_strcpy-test-strcpy.$(OBJEXT) +tests_test_strcpy_DEPENDENCIES = $(tests_ldadd) +tests_test_strcpy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_strcpy_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_strlen_SOURCES = tests/test-strlen.c +tests_test_strlen_OBJECTS = \ + tests/tests_test_strlen-test-strlen.$(OBJEXT) +tests_test_strlen_DEPENDENCIES = $(tests_ldadd) +tests_test_strlen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_strlen_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +tests_test_strncmp_SOURCES = tests/test-strncmp.c +tests_test_strncmp_OBJECTS = \ + tests/tests_test_strncmp-test-strncmp.$(OBJEXT) +tests_test_strncmp_DEPENDENCIES = $(tests_ldadd) +tests_test_strncmp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(tests_test_strncmp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +tests_test_strnlen_SOURCES = tests/test-strnlen.c +tests_test_strnlen_OBJECTS = tests/test-strnlen.$(OBJEXT) +tests_test_strnlen_LDADD = $(LDADD) +am_try_bionic_a15_OBJECTS = +try_bionic_a15_OBJECTS = $(am_try_bionic_a15_OBJECTS) +#try_bionic_a15_DEPENDENCIES = libmulti.a \ +# libbionic-a15.a +am_try_bionic_a9_OBJECTS = +try_bionic_a9_OBJECTS = $(am_try_bionic_a9_OBJECTS) +#try_bionic_a9_DEPENDENCIES = libmulti.a \ +# libbionic-a9.a +am_try_bionic_c_OBJECTS = +try_bionic_c_OBJECTS = $(am_try_bionic_c_OBJECTS) +try_bionic_c_DEPENDENCIES = libmulti.a libbionic-c.a +am_try_csl_OBJECTS = +try_csl_OBJECTS = $(am_try_csl_OBJECTS) +#try_csl_DEPENDENCIES = libmulti.a libcsl.a +am_try_glibc_OBJECTS = +try_glibc_OBJECTS = $(am_try_glibc_OBJECTS) +#try_glibc_DEPENDENCIES = libmulti.a libglibc.a +am_try_glibc_c_OBJECTS = +try_glibc_c_OBJECTS = $(am_try_glibc_c_OBJECTS) +try_glibc_c_DEPENDENCIES = libmulti.a libglibc-c.a +am_try_newlib_OBJECTS = +try_newlib_OBJECTS = $(am_try_newlib_OBJECTS) +#try_newlib_DEPENDENCIES = libmulti.a libnewlib.a +am_try_newlib_c_OBJECTS = +try_newlib_c_OBJECTS = $(am_try_newlib_c_OBJECTS) +try_newlib_c_DEPENDENCIES = libmulti.a libnewlib-c.a +am_try_newlib_xscale_OBJECTS = +try_newlib_xscale_OBJECTS = $(am_try_newlib_xscale_OBJECTS) +#try_newlib_xscale_DEPENDENCIES = libmulti.a \ +# libnewlib-xscale.a +am_try_none_OBJECTS = +try_none_OBJECTS = $(am_try_none_OBJECTS) +try_none_DEPENDENCIES = libmulti.a +am_try_plain_OBJECTS = +try_plain_OBJECTS = $(am_try_plain_OBJECTS) +try_plain_DEPENDENCIES = libmulti.a libplain.a +am_try_this_OBJECTS = +try_this_OBJECTS = $(am_try_this_OBJECTS) +try_this_DEPENDENCIES = libmulti.a libcortex-strings.la +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CCASFLAGS) $(CCASFLAGS) +AM_V_CPPAS = $(am__v_CPPAS_$(V)) +am__v_CPPAS_ = $(am__v_CPPAS_$(AM_DEFAULT_VERBOSITY)) +am__v_CPPAS_0 = @echo " CPPAS " $@; +am__v_CPPAS_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libbionic_a15_a_SOURCES) $(libbionic_a9_a_SOURCES) \ + $(libbionic_c_a_SOURCES) $(libcsl_a_SOURCES) \ + $(libglibc_c_a_SOURCES) $(libglibc_a_SOURCES) \ + $(libmulti_a_SOURCES) $(libnewlib_c_a_SOURCES) \ + $(libnewlib_xscale_a_SOURCES) $(libnewlib_a_SOURCES) \ + $(libplain_a_SOURCES) $(libcortex_strings_la_SOURCES) \ + $(dhry_SOURCES) $(dhry_native_SOURCES) tests/test-memchr.c \ + tests/test-memcmp.c tests/test-memcpy.c tests/test-memmove.c \ + tests/test-memset.c tests/test-strchr.c tests/test-strcmp.c \ + tests/test-strcpy.c tests/test-strlen.c tests/test-strncmp.c \ + tests/test-strnlen.c $(try_bionic_a15_SOURCES) \ + $(try_bionic_a9_SOURCES) $(try_bionic_c_SOURCES) \ + $(try_csl_SOURCES) $(try_glibc_SOURCES) $(try_glibc_c_SOURCES) \ + $(try_newlib_SOURCES) $(try_newlib_c_SOURCES) \ + $(try_newlib_xscale_SOURCES) $(try_none_SOURCES) \ + $(try_plain_SOURCES) $(try_this_SOURCES) +DIST_SOURCES = $(am__libbionic_a15_a_SOURCES_DIST) \ + $(am__libbionic_a9_a_SOURCES_DIST) $(libbionic_c_a_SOURCES) \ + $(am__libcsl_a_SOURCES_DIST) $(libglibc_c_a_SOURCES) \ + $(am__libglibc_a_SOURCES_DIST) $(libmulti_a_SOURCES) \ + $(libnewlib_c_a_SOURCES) \ + $(am__libnewlib_xscale_a_SOURCES_DIST) \ + $(am__libnewlib_a_SOURCES_DIST) $(libplain_a_SOURCES) \ + $(am__libcortex_strings_la_SOURCES_DIST) $(dhry_SOURCES) \ + $(dhry_native_SOURCES) tests/test-memchr.c tests/test-memcmp.c \ + tests/test-memcpy.c tests/test-memmove.c tests/test-memset.c \ + tests/test-strchr.c tests/test-strcmp.c tests/test-strcpy.c \ + tests/test-strlen.c tests/test-strncmp.c tests/test-strnlen.c \ + $(try_bionic_a15_SOURCES) $(try_bionic_a9_SOURCES) \ + $(try_bionic_c_SOURCES) $(try_csl_SOURCES) \ + $(try_glibc_SOURCES) $(try_glibc_c_SOURCES) \ + $(try_newlib_SOURCES) $(try_newlib_c_SOURCES) \ + $(try_newlib_xscale_SOURCES) $(try_none_SOURCES) \ + $(try_plain_SOURCES) $(try_this_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope check recheck +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in README \ + compile config.guess config.sub depcomp install-sh ltmain.sh \ + missing test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +DIST_TARGETS = dist-bzip2 dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = ${SHELL} /home/andrew/freebsd/repo/cortex-strings/missing aclocal-1.15 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AUTOCONF = ${SHELL} /home/andrew/freebsd/repo/cortex-strings/missing autoconf +AUTOHEADER = ${SHELL} /home/andrew/freebsd/repo/cortex-strings/missing autoheader +AUTOMAKE = ${SHELL} /home/andrew/freebsd/repo/cortex-strings/missing automake-1.15 +AWK = nawk +CC = gcc +CCAS = gcc +CCASDEPMODE = depmode=gcc3 +CCASFLAGS = -g -O2 +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /usr/bin/grep -E +EXEEXT = +FGREP = /usr/bin/grep -F +GREP = /usr/bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/local/bin/ld +LDFLAGS = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBOBJS = +LT_SYS_LIBRARY_PATH = +MAKEINFO = ${SHELL} /home/andrew/freebsd/repo/cortex-strings/missing makeinfo +MANIFEST_TOOL = : +MKDIR_P = ./install-sh -c -d +NM = /usr/local/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = cortex-strings +PACKAGE_BUGREPORT = +PACKAGE_NAME = cortex-strings +PACKAGE_STRING = cortex-strings 1.1-2012.06~dev +PACKAGE_TARNAME = cortex-strings +PACKAGE_URL = +PACKAGE_VERSION = 1.1-2012.06~dev +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /usr/local/bin/gsed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 1.1-2012.06~dev +abs_builddir = /home/andrew/freebsd/repo/cortex-strings +abs_srcdir = /home/andrew/freebsd/repo/cortex-strings +abs_top_builddir = /home/andrew/freebsd/repo/cortex-strings +abs_top_srcdir = /home/andrew/freebsd/repo/cortex-strings +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = aarch64-none-elf +build_alias = aarch64-none-elf +build_cpu = aarch64 +build_os = elf +build_vendor = none +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = aarch64-none-elf +host_alias = +host_cpu = aarch64 +host_os = elf +host_vendor = none +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/andrew/freebsd/repo/cortex-strings/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +submachine = +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = +top_builddir = . +top_srcdir = . +with_neon = yes +with_vfp = yes + +# Used to record the compiler version in the executables +COMPILER = $(shell $(CC) --version 2>&1 | head -n1) + +# The main library +lib_LTLIBRARIES = \ + libcortex-strings.la + + +# Options for the tests +tests_cflags = -I$(srcdir)/tests $(AM_CFLAGS) +tests_ldadd = libcortex-strings.la +tests_test_memchr_LDADD = $(tests_ldadd) +tests_test_memchr_CFLAGS = $(tests_cflags) +tests_test_memcmp_LDADD = $(tests_ldadd) +tests_test_memcmp_CFLAGS = $(tests_cflags) +tests_test_memcpy_LDADD = $(tests_ldadd) +tests_test_memcpy_CFLAGS = $(tests_cflags) +tests_test_memmove_LDADD = $(tests_ldadd) +tests_test_memmove_CFLAGS = $(tests_cflags) +tests_test_memset_LDADD = $(tests_ldadd) +tests_test_memset_CFLAGS = $(tests_cflags) +tests_test_strchr_LDADD = $(tests_ldadd) +tests_test_strchr_CFLAGS = $(tests_cflags) +tests_test_strcmp_LDADD = $(tests_ldadd) +tests_test_strcmp_CFLAGS = $(tests_cflags) +tests_test_strcpy_LDADD = $(tests_ldadd) +tests_test_strcpy_CFLAGS = $(tests_cflags) +tests_test_strlen_LDADD = $(tests_ldadd) +tests_test_strlen_CFLAGS = $(tests_cflags) +tests_test_strncmp_LDADD = $(tests_ldadd) +tests_test_strncmp_CFLAGS = $(tests_cflags) +TESTS = $(check_PROGRAMS) + +# Good 'ol Dhrystone +dhry_SOURCES = \ + benchmarks/dhry/dhry_1.c \ + benchmarks/dhry/dhry_2.c \ + benchmarks/dhry/dhry.h + +dhry_CFLAGS = -Dcompiler="\"$(COMPILER)\"" -Doptions="\"$(CFLAGS)\"" +dhry_LDADD = libcortex-strings.la +dhry_native_SOURCES = $(dhry_SOURCES) +dhry_native_CFLAGS = $(dhry_CFLAGS) + +# Benchmark harness +noinst_LIBRARIES = libmulti.a libbionic-c.a libglibc-c.a libnewlib-c.a \ + libplain.a $(am__append_2) +libmulti_a_SOURCES = \ + benchmarks/multi/harness.c + +libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS) +libbionic_c_a_SOURCES = \ + reference/bionic-c/bcopy.c \ + reference/bionic-c/memchr.c \ + reference/bionic-c/memcmp.c \ + reference/bionic-c/memcpy.c \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 16 15:25:45 2016 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 62EB5BDD25F; Fri, 16 Sep 2016 15:25:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1532C767; Fri, 16 Sep 2016 15:25:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GFPibX080769; Fri, 16 Sep 2016 15:25:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GFPifw080768; Fri, 16 Sep 2016 15:25:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161525.u8GFPifw080768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 15:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305889 - in vendor/cortex-strings/dist: . autom4te.cache benchmarks/dhry/.deps benchmarks/multi benchmarks/multi/.deps reference/bionic-a15/.deps reference/bionic-a9/.deps reference/bi... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 15:25:45 -0000 Author: andrew Date: Fri Sep 16 15:25:44 2016 New Revision: 305889 URL: https://svnweb.freebsd.org/changeset/base/305889 Log: Remove generated files that shouldn't have been added Reported by: cognet Sponsored by: The FreeBSD Foundation Deleted: vendor/cortex-strings/dist/Makefile vendor/cortex-strings/dist/Makefile.in vendor/cortex-strings/dist/aclocal.m4 vendor/cortex-strings/dist/autom4te.cache/ vendor/cortex-strings/dist/benchmarks/dhry/.deps/ vendor/cortex-strings/dist/benchmarks/multi/.deps/ vendor/cortex-strings/dist/benchmarks/multi/.dirstamp vendor/cortex-strings/dist/compile vendor/cortex-strings/dist/config.guess vendor/cortex-strings/dist/config.h vendor/cortex-strings/dist/config.h.in vendor/cortex-strings/dist/config.log vendor/cortex-strings/dist/config.status vendor/cortex-strings/dist/config.sub vendor/cortex-strings/dist/configure vendor/cortex-strings/dist/depcomp vendor/cortex-strings/dist/install-sh vendor/cortex-strings/dist/libtool vendor/cortex-strings/dist/ltmain.sh vendor/cortex-strings/dist/missing vendor/cortex-strings/dist/reference/bionic-a15/.deps/ vendor/cortex-strings/dist/reference/bionic-a9/.deps/ vendor/cortex-strings/dist/reference/bionic-c/.deps/ vendor/cortex-strings/dist/reference/bionic-c/.dirstamp vendor/cortex-strings/dist/reference/csl/.deps/ vendor/cortex-strings/dist/reference/glibc-c/.deps/ vendor/cortex-strings/dist/reference/glibc-c/.dirstamp vendor/cortex-strings/dist/reference/glibc/.deps/ vendor/cortex-strings/dist/reference/newlib-c/.deps/ vendor/cortex-strings/dist/reference/newlib-xscale/.deps/ vendor/cortex-strings/dist/reference/newlib/.deps/ vendor/cortex-strings/dist/reference/plain/.deps/ vendor/cortex-strings/dist/src/aarch64/.deps/ vendor/cortex-strings/dist/src/arm/.deps/ vendor/cortex-strings/dist/src/thumb-2/.deps/ vendor/cortex-strings/dist/stamp-h1 vendor/cortex-strings/dist/test-driver vendor/cortex-strings/dist/tests/.deps/ From owner-svn-src-all@freebsd.org Fri Sep 16 15:29:24 2016 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 A979ABDD34D; Fri, 16 Sep 2016 15:29:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E54D930; Fri, 16 Sep 2016 15:29:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GFTNTk080934; Fri, 16 Sep 2016 15:29:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GFTNKJ080933; Fri, 16 Sep 2016 15:29:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609161529.u8GFTNKJ080933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Sep 2016 15:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305890 - in vendor/cortex-strings/linaro-eb80ac: . autom4te.cache benchmarks/dhry/.deps benchmarks/multi benchmarks/multi/.deps reference/bionic-a15/.deps reference/bionic-a9/.deps ref... 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.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 15:29:24 -0000 Author: andrew Date: Fri Sep 16 15:29:23 2016 New Revision: 305890 URL: https://svnweb.freebsd.org/changeset/base/305890 Log: Tag upstream revision eb80ac77a6cdb3509d885d23d1dd343803381176 Added: vendor/cortex-strings/linaro-eb80ac/ - copied from r305888, vendor/cortex-strings/dist/ Deleted: vendor/cortex-strings/linaro-eb80ac/Makefile vendor/cortex-strings/linaro-eb80ac/Makefile.in vendor/cortex-strings/linaro-eb80ac/aclocal.m4 vendor/cortex-strings/linaro-eb80ac/autom4te.cache/ vendor/cortex-strings/linaro-eb80ac/benchmarks/dhry/.deps/ vendor/cortex-strings/linaro-eb80ac/benchmarks/multi/.deps/ vendor/cortex-strings/linaro-eb80ac/benchmarks/multi/.dirstamp vendor/cortex-strings/linaro-eb80ac/compile vendor/cortex-strings/linaro-eb80ac/config.guess vendor/cortex-strings/linaro-eb80ac/config.h vendor/cortex-strings/linaro-eb80ac/config.h.in vendor/cortex-strings/linaro-eb80ac/config.log vendor/cortex-strings/linaro-eb80ac/config.status vendor/cortex-strings/linaro-eb80ac/config.sub vendor/cortex-strings/linaro-eb80ac/configure vendor/cortex-strings/linaro-eb80ac/depcomp vendor/cortex-strings/linaro-eb80ac/install-sh vendor/cortex-strings/linaro-eb80ac/libtool vendor/cortex-strings/linaro-eb80ac/ltmain.sh vendor/cortex-strings/linaro-eb80ac/missing vendor/cortex-strings/linaro-eb80ac/reference/bionic-a15/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/bionic-a9/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/bionic-c/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/bionic-c/.dirstamp vendor/cortex-strings/linaro-eb80ac/reference/csl/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/glibc-c/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/glibc-c/.dirstamp vendor/cortex-strings/linaro-eb80ac/reference/glibc/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/newlib-c/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/newlib-xscale/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/newlib/.deps/ vendor/cortex-strings/linaro-eb80ac/reference/plain/.deps/ vendor/cortex-strings/linaro-eb80ac/src/aarch64/.deps/ vendor/cortex-strings/linaro-eb80ac/src/arm/.deps/ vendor/cortex-strings/linaro-eb80ac/src/thumb-2/.deps/ vendor/cortex-strings/linaro-eb80ac/stamp-h1 vendor/cortex-strings/linaro-eb80ac/test-driver vendor/cortex-strings/linaro-eb80ac/tests/.deps/ From owner-svn-src-all@freebsd.org Fri Sep 16 22:51:39 2016 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 4FFECBDDFB0; Fri, 16 Sep 2016 22:51:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2495E11B9; Fri, 16 Sep 2016 22:51:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GMpcej052757; Fri, 16 Sep 2016 22:51:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GMpccg052742; Fri, 16 Sep 2016 22:51:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609162251.u8GMpccg052742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 16 Sep 2016 22:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305894 - head/sys/boot/powerpc/boot1.chrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2016 22:51:39 -0000 Author: jhibbits Date: Fri Sep 16 22:51:37 2016 New Revision: 305894 URL: https://svnweb.freebsd.org/changeset/base/305894 Log: Increase the boot1 file size on the HFS boot image. The boot1.elf is too fat for 30k, it's not 32k on powerpc64, and 34k on powerpc. Without this, boot1 will fail with odd behaviors. MFC after: 1 day Modified: head/sys/boot/powerpc/boot1.chrp/Makefile.hfs head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Modified: head/sys/boot/powerpc/boot1.chrp/Makefile.hfs ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile.hfs Fri Sep 16 21:14:11 2016 (r305893) +++ head/sys/boot/powerpc/boot1.chrp/Makefile.hfs Fri Sep 16 22:51:37 2016 (r305894) @@ -1,4 +1,4 @@ # This file autogenerated by generate-hfs.sh - DO NOT EDIT # $FreeBSD$ -BOOTINFO_OFFSET=0x58 +BOOTINFO_OFFSET=0x9c BOOT1_OFFSET=0x1c Modified: head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Fri Sep 16 21:14:11 2016 (r305893) +++ head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Fri Sep 16 22:51:37 2016 (r305894) @@ -15,7 +15,7 @@ HFS_SIZE=1600 #Size in 512-byte blocks of the produced image CHRPBOOT_SIZE=2k -BOOT1_SIZE=30k +BOOT1_SIZE=64k # Generate 800K HFS image OUTPUT_FILE=hfs.tmpl Modified: head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Fri Sep 16 21:14:11 2016 (r305893) +++ head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Fri Sep 16 22:51:37 2016 (r305894) @@ -2,17 +2,17 @@ HFS template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 hfs.tmpl.bz2 -M0EIH.3%!62936?(HJX\``"]_]?___O)20>!4M2$>0#MUW$1$``$!$``"2!`( -M4EG``>G*VV3"22334_2(/*>ID,@``:#U&"-#(!IZ0`)$HIY0>B-#(/4T```& -M@R:`&@``<:,F1A&(!A-!@$T&@9,FC)D,(#!4E-*--31ZAB!DT!ID:#$81HT& -M@9-!Z::C:E=SZCC1((92M^1Q@3&>="[<2FD((A[AT#`[('#?MSV(S,>HOI'#2,"EJ0PU5).T`PX,54O,RTW8-",N1`R>?SL"+?Q51[H]# -MJ1C5"]BDBF1UJ!Y`J$WTC]QAFZ%Q21$J,I&0,0?9?DPU!Z>$9.380JJCO$Q8 -MXZTX)GQCCGNC%G1BIDBHTK#J9N0,M[85QC:.'>]#,GPRAALU*=)2`$ND22<. --VK/^+N2*<*$AY%%7'@`` +M0EIH.3%!629365^MV6L``"]__O___M)20>!0O2$>0#MUW$!$``%%$``@``!` +M!`!R2<`![@H2"2A2-Z)-HC]4`:`-``T:&@&@#0/TTH<`PC":8A@$`R`&$:9, +MF$8"&AP#",)IB&`0#(`81IDR81@(:")0HT*>4,:0TT`:!ZC0/*/4/1&@;4>H +M&@RYG-FL-,\=C91FTSS@99`O+OA;*$ZN3-&UF`W@#SP:;MVF_EN,-]P$ZN2B +M=";7YHA7VT!#<@,B`H*?S#?Q;CUJ8H8+9:E)+4"L7'CL5&D.IO4;H98%^4@[ +M9`*L&1``5*0#A(EB8BH`S'1O^N +M)Y6'!#N:*:JYTEX\:%'"?.G$FCP8TM_0/ND`^IG3[ +M.QUEDP&P>3+Z442Q!:S.A1>00]'X'D%)UX9QZ>$Q?(808QB-4%9BBTL"L(BB +MEJ*'HH820Q$'%G':JF.:>$U4H`0S`:GSZM-C5BNX(2&$B"J*45`"4FEZ__%W +))%.%"07ZW9:P ` end From owner-svn-src-all@freebsd.org Sat Sep 17 05:02:02 2016 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 10B5DBDEFD0; Sat, 17 Sep 2016 05:02:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c: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 B9FBAD31; Sat, 17 Sep 2016 05:02:01 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-vk0-x235.google.com with SMTP id 192so55179780vkl.0; Fri, 16 Sep 2016 22:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=s7bZwXpkM/5RAvOl1YIvbibj5LylwWSbTe6uxd/2Ixo=; b=lwUMBJozB4Bcy7dsG4UwQLo18s1o/JEelQZ3bgVMkzm0hUhNY9Ai/nInF+muQGCHoO ZaFarfwALjxYJC/AcuGOH4kcuJBE+sDCFKkJiGJSLD/YtwWsCjvTHeb2rHwLwVhgxX4D //Ha8md3jmL7229vmlqJhXclAOECUHmJmj7jPZY+kbtO/PFU9pk4PXSUez9bevz3LTdJ 8SkaZkGismkQmB4xpE8ga1cDNDYSbsbxdOIMtRUJvA8CsgzAwmon+olpBb4Rm6Y+sENE PGK2esXL9wa4DPkAf2RpoAF/GurKxcBiUaXkBvwkfFx2yB4CKm2VOmDe586R5OdTOHPx xEkA== 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:from:date :message-id:subject:to; bh=s7bZwXpkM/5RAvOl1YIvbibj5LylwWSbTe6uxd/2Ixo=; b=ZI2V8ykbLYwu30TLyaGAkvVjmdWKtqc1/KG6AT1Tf1odQOrP74PvyXXcKJjC0gYz/j gNzJ6Mwmkean/rCxZQu8QxGmJ/gsDxCbSAAJmFD6YoGTW33tMB6KdJPZBDFkzQdJzcc+ iHExD7oJaiZxyhVyA8c8NJx0InfYdrgSOrulnq/avkErt4st09S+oGzfucPucvB/souN P0vbpa96gjoUWTsWtwKBpGm4qnkY2jwu24/Vn/LdNkyCKD6Qqeiiu1bqTSt+HVVjpvm7 KiNco3rvh09HcZgFLjX8FJjcudqNL+pGuraH9399mFJIus7zbHNtfgGOebun/cduGaPV nK7A== X-Gm-Message-State: AE9vXwNiuUhI1wH5AStQhhi2kAijeLN5aTeXDPpFgJhQwKB1mJXXA5JBHMxVh96ZP2xraAq38uxRJJfthkrJdQ== X-Received: by 10.31.61.215 with SMTP id k206mr7015111vka.5.1474088520674; Fri, 16 Sep 2016 22:02:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.114.129 with HTTP; Fri, 16 Sep 2016 22:01:59 -0700 (PDT) Received: by 10.103.114.129 with HTTP; Fri, 16 Sep 2016 22:01:59 -0700 (PDT) In-Reply-To: <201609162251.u8GMpccg052742@repo.freebsd.org> References: <201609162251.u8GMpccg052742@repo.freebsd.org> From: Justin Hibbits Date: Sat, 17 Sep 2016 00:01:59 -0500 Message-ID: Subject: Re: svn commit: r305894 - head/sys/boot/powerpc/boot1.chrp To: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 05:02:02 -0000 On Sep 16, 2016 17:51, "Justin Hibbits" wrote: > > Author: jhibbits > Date: Fri Sep 16 22:51:37 2016 > New Revision: 305894 > URL: https://svnweb.freebsd.org/changeset/base/305894 > > Log: > Increase the boot1 file size on the HFS boot image. > > The boot1.elf is too fat for 30k, it's not 32k on powerpc64, and 34k on powerpc. > Without this, boot1 will fail with odd behaviors. Oops, as was pointed out to me privately, s/not/now/ obviously. - Justin From owner-svn-src-all@freebsd.org Sat Sep 17 05:44:58 2016 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 6A82CBDDC34; Sat, 17 Sep 2016 05:44:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433ABC4; Sat, 17 Sep 2016 05:44:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8H5iv63008486; Sat, 17 Sep 2016 05:44:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8H5ivB1008484; Sat, 17 Sep 2016 05:44:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609170544.u8H5ivB1008484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 17 Sep 2016 05:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305895 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 05:44:58 -0000 Author: adrian Date: Sat Sep 17 05:44:57 2016 New Revision: 305895 URL: https://svnweb.freebsd.org/changeset/base/305895 Log: [net80211] add a HT method to populate HTCAP based on IBSS requirements. IBSS negotiation is a subset of the STA/AP negotiation. We always have a current channel, so base the HT capabilities on the current channel. This is then put into IBSS probe requests to inform peers of our 11n capabilities. Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Fri Sep 16 22:51:37 2016 (r305894) +++ head/sys/net80211/ieee80211_ht.c Sat Sep 17 05:44:57 2016 (r305895) @@ -2846,6 +2846,96 @@ ieee80211_add_htcap(uint8_t *frm, struct } /* + * Non-associated probe request - add HT capabilities based on + * the current channel configuration. + */ +static uint8_t * +ieee80211_add_htcap_body_ch(uint8_t *frm, struct ieee80211vap *vap, + struct ieee80211_channel *c) +{ +#define ADDSHORT(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = (v) >> 8; \ + frm += 2; \ +} while (0) + struct ieee80211com *ic = vap->iv_ic; + uint16_t caps, extcaps; + int rxmax, density; + + /* HT capabilities */ + caps = vap->iv_htcaps & 0xffff; + + /* + * We don't use this in STA mode; only in IBSS mode. + * So in IBSS mode we base our HTCAP flags on the + * given channel. + */ + + /* override 20/40 use based on current channel */ + if (IEEE80211_IS_CHAN_HT40(c)) + caps |= IEEE80211_HTCAP_CHWIDTH40; + else + caps &= ~IEEE80211_HTCAP_CHWIDTH40; + + /* Use the currently configured values */ + rxmax = vap->iv_ampdu_rxmax; + density = vap->iv_ampdu_density; + + /* adjust short GI based on channel and config */ + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0) + caps &= ~IEEE80211_HTCAP_SHORTGI20; + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || + (caps & IEEE80211_HTCAP_CHWIDTH40) == 0) + caps &= ~IEEE80211_HTCAP_SHORTGI40; + ADDSHORT(frm, caps); + + /* HT parameters */ + *frm = SM(rxmax, IEEE80211_HTCAP_MAXRXAMPDU) + | SM(density, IEEE80211_HTCAP_MPDUDENSITY) + ; + frm++; + + /* pre-zero remainder of ie */ + memset(frm, 0, sizeof(struct ieee80211_ie_htcap) - + __offsetof(struct ieee80211_ie_htcap, hc_mcsset)); + + /* supported MCS set */ + /* + * XXX: For sta mode the rate set should be restricted based + * on the AP's capabilities, but ni_htrates isn't setup when + * we're called to form an AssocReq frame so for now we're + * restricted to the device capabilities. + */ + ieee80211_set_mcsset(ic, frm); + + frm += __offsetof(struct ieee80211_ie_htcap, hc_extcap) - + __offsetof(struct ieee80211_ie_htcap, hc_mcsset); + + /* HT extended capabilities */ + extcaps = vap->iv_htextcaps & 0xffff; + + ADDSHORT(frm, extcaps); + + frm += sizeof(struct ieee80211_ie_htcap) - + __offsetof(struct ieee80211_ie_htcap, hc_txbf); + + return frm; +#undef ADDSHORT +} + +/* + * Add 802.11n HT capabilities information element + */ +uint8_t * +ieee80211_add_htcap_ch(uint8_t *frm, struct ieee80211vap *vap, + struct ieee80211_channel *c) +{ + frm[0] = IEEE80211_ELEMID_HTCAP; + frm[1] = sizeof(struct ieee80211_ie_htcap) - 2; + return ieee80211_add_htcap_body_ch(frm + 2, vap, c); +} + +/* * Add Broadcom OUI wrapped standard HTCAP ie; this is * used for compatibility w/ pre-draft implementations. */ Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Fri Sep 16 22:51:37 2016 (r305894) +++ head/sys/net80211/ieee80211_ht.h Sat Sep 17 05:44:57 2016 (r305895) @@ -210,6 +210,8 @@ void ieee80211_ampdu_stop(struct ieee802 int ieee80211_send_bar(struct ieee80211_node *, struct ieee80211_tx_ampdu *, ieee80211_seq); uint8_t *ieee80211_add_htcap(uint8_t *, struct ieee80211_node *); +uint8_t *ieee80211_add_htcap_ch(uint8_t *, struct ieee80211vap *, + struct ieee80211_channel *); uint8_t *ieee80211_add_htcap_vendor(uint8_t *, struct ieee80211_node *); uint8_t *ieee80211_add_htinfo(uint8_t *, struct ieee80211_node *); uint8_t *ieee80211_add_htinfo_vendor(uint8_t *, struct ieee80211_node *); From owner-svn-src-all@freebsd.org Sat Sep 17 08:10:03 2016 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 0B1DEBDE8C8; Sat, 17 Sep 2016 08:10:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D185D86C; Sat, 17 Sep 2016 08:10:02 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8H8A2vL060520; Sat, 17 Sep 2016 08:10:02 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8H8A2eQ060519; Sat, 17 Sep 2016 08:10:02 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201609170810.u8H8A2eQ060519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 17 Sep 2016 08:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305896 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 08:10:03 -0000 Author: dchagin Date: Sat Sep 17 08:10:01 2016 New Revision: 305896 URL: https://svnweb.freebsd.org/changeset/base/305896 Log: Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Submitted by: Erik Cederstrand Reported by: Erik Cederstrand MFC after: 1 week Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sat Sep 17 05:44:57 2016 (r305895) +++ head/sys/compat/linux/linux_ioctl.c Sat Sep 17 08:10:01 2016 (r305896) @@ -297,6 +297,15 @@ linux_ioctl_disk(struct thread *td, stru return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKSSZGET: + error = fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + fdrop(fp, td); + if (error) + return (error); + return (copyout(§orsize, (void *)args->arg, + sizeof(sectorsize))); + break; } fdrop(fp, td); return (ENOIOCTL); From owner-svn-src-all@freebsd.org Sat Sep 17 11:43:53 2016 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 04D06BDEFAE; Sat, 17 Sep 2016 11:43:53 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B92E5C32; Sat, 17 Sep 2016 11:43:52 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HBhpe6046438; Sat, 17 Sep 2016 11:43:51 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HBhpNQ046437; Sat, 17 Sep 2016 11:43:51 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609171143.u8HBhpNQ046437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 17 Sep 2016 11:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305897 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 11:43:53 -0000 Author: bde Date: Sat Sep 17 11:43:51 2016 New Revision: 305897 URL: https://svnweb.freebsd.org/changeset/base/305897 Log: Silently ignore unexpected single-step traps (except for turning off single-stepping). Only do this on arches (only x86 so far) which classify single-step traps unambiguously. This allows other parts of the kernel to be intentionally and unintentionally sloppy about generating single-step traps. On x86, at least the following places were unintentionally sloppy: - all operations that context-switched [er]flags. Especially spinlock_enter()/exit() and cpu_switch(). When single-stepped, saving the flags leaves PSL_T set in the saved flags, so restoring gives a trap that is spurious if it occurs after single-step mode has been left. Switching contexts away from a low priority thread gives especially long-lived saved copies. - the vm86 emulation allows user mode to set PSL_T. This was correct until vm86 bios call mode was unintentionally given access to kdb handling its single-step traps. Now these places are intentionally sloppy, but unexpected debugger traps still cause panics if no debugger that handles the trap is attached when the trap is delivered. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Sat Sep 17 08:10:01 2016 (r305896) +++ head/sys/ddb/db_run.c Sat Sep 17 11:43:51 2016 (r305897) @@ -136,21 +136,29 @@ db_stop_at_pc(int type, int code, bool * *is_breakpoint = false; /* might be a breakpoint, but not ours */ /* + * If not stepping, then silently ignore single-step traps + * (except for clearing the single-step-flag above). + * * If stepping, then abort if the trap type is unexpected. * Breakpoints owned by us are expected and were handled above. * Single-steps are expected and are handled below. All others * are unexpected. * - * If the MD layer doesn't tell us when it is stepping, use the - * bad historical default that all unexepected traps. + * Only do either of these if the MD layer claims to classify + * single-step traps unambiguously (by defining IS_SSTEP_TRAP). + * Otherwise, fall through to the bad historical behaviour + * given by turning unexpected traps into expected traps: if not + * stepping, then expect only breakpoints and stop, and if + * stepping, then expect only single-steps and step. */ -#ifndef IS_SSTEP_TRAP -#define IS_SSTEP_TRAP(type, code) true -#endif +#ifdef IS_SSTEP_TRAP + if (db_run_mode == STEP_CONTINUE && IS_SSTEP_TRAP(type, code)) + return (false); if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) { printf("Stepping aborted\n"); return (true); } +#endif if (db_run_mode == STEP_INVISIBLE) { db_run_mode = STEP_CONTINUE; From owner-svn-src-all@freebsd.org Sat Sep 17 13:48:02 2016 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 87FFFBDCD43; Sat, 17 Sep 2016 13:48:02 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5867591; Sat, 17 Sep 2016 13:48:02 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HDm1on093025; Sat, 17 Sep 2016 13:48:01 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HDm1Yn093022; Sat, 17 Sep 2016 13:48:01 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201609171348.u8HDm1Yn093022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 17 Sep 2016 13:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305898 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 13:48:02 -0000 Author: jceel Date: Sat Sep 17 13:48:01 2016 New Revision: 305898 URL: https://svnweb.freebsd.org/changeset/base/305898 Log: Add virtio-console support to bhyve. Adds virtio-console device support to bhyve, allowing to create bidirectional character streams between host and guest. Syntax: -s ,virtio-console,port1=/path/to/port1.sock,anotherport=... Maximum of 16 ports per device can be created. Every port is named and corresponds to an Unix domain socket created by bhyve. bhyve accepts at most one connection per port at a time. Limitations: - due to lack of destructors of in bhyve, sockets on the filesystem must be cleaned up manually after bhyve exits - there's no way to use "console port" feature, nor the console port resize as of now - emergency write is advertised, but no-op as of now Approved by: trasz MFC after: 1 month Relnotes: yes Sponsored by: iXsystems, Inc. Differential Revision: D7185 Added: head/usr.sbin/bhyve/pci_virtio_console.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Sat Sep 17 11:43:51 2016 (r305897) +++ head/usr.sbin/bhyve/Makefile Sat Sep 17 13:48:01 2016 (r305898) @@ -36,6 +36,7 @@ SRCS= \ pci_lpc.c \ pci_passthru.c \ pci_virtio_block.c \ + pci_virtio_console.c \ pci_virtio_net.c \ pci_virtio_rnd.c \ pci_uart.c \ Added: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_virtio_console.c Sat Sep 17 13:48:01 2016 (r305898) @@ -0,0 +1,631 @@ +/*- + * Copyright (c) 2016 iXsystems Inc. + * All rights reserved. + * + * This software was developed by Jakub Klama + * under sponsorship from iXsystems Inc. + * + * 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 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 +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "virtio.h" +#include "mevent.h" + +#define VTCON_RINGSZ 64 +#define VTCON_MAXPORTS 16 +#define VTCON_MAXQ (VTCON_MAXPORTS * 2 + 2) + +#define VTCON_DEVICE_READY 0 +#define VTCON_DEVICE_ADD 1 +#define VTCON_DEVICE_REMOVE 2 +#define VTCON_PORT_READY 3 +#define VTCON_CONSOLE_PORT 4 +#define VTCON_CONSOLE_RESIZE 5 +#define VTCON_PORT_OPEN 6 +#define VTCON_PORT_NAME 7 + +#define VTCON_F_SIZE 0 +#define VTCON_F_MULTIPORT 1 +#define VTCON_F_EMERG_WRITE 2 +#define VTCON_S_HOSTCAPS \ + (VTCON_F_SIZE | VTCON_F_MULTIPORT | VTCON_F_EMERG_WRITE) + +static int pci_vtcon_debug; +#define DPRINTF(params) if (pci_vtcon_debug) printf params +#define WPRINTF(params) printf params + +struct pci_vtcon_softc; +struct pci_vtcon_port; +struct pci_vtcon_config; +typedef void (pci_vtcon_cb_t)(struct pci_vtcon_port *, void *, struct iovec *, + int); + +struct pci_vtcon_port { + struct pci_vtcon_softc * vsp_sc; + int vsp_id; + const char * vsp_name; + bool vsp_enabled; + bool vsp_console; + bool vsp_rx_ready; + int vsp_rxq; + int vsp_txq; + void * vsp_arg; + pci_vtcon_cb_t * vsp_cb; +}; + +struct pci_vtcon_sock +{ + struct pci_vtcon_port * vss_port; + const char * vss_path; + struct mevent * vss_server_evp; + struct mevent * vss_conn_evp; + int vss_server_fd; + int vss_conn_fd; + bool vss_open; +}; + +struct pci_vtcon_softc { + struct virtio_softc vsc_vs; + struct vqueue_info vsc_queues[VTCON_MAXQ]; + pthread_mutex_t vsc_mtx; + uint64_t vsc_cfg; + uint64_t vsc_features; + char * vsc_rootdir; + int vsc_kq; + int vsc_nports; + struct pci_vtcon_port vsc_control_port; + struct pci_vtcon_port vsc_ports[VTCON_MAXPORTS]; + struct pci_vtcon_config *vsc_config; +}; + +struct pci_vtcon_config { + uint16_t cols; + uint16_t rows; + uint32_t max_nr_ports; + uint32_t emerg_wr; +} __attribute__((packed)); + +struct pci_vtcon_control { + uint32_t id; + uint16_t event; + uint16_t value; +} __attribute__((packed)); + +struct pci_vtcon_console_resize { + uint16_t cols; + uint16_t rows; +} __attribute__((packed)); + +static void pci_vtcon_reset(void *); +static void pci_vtcon_notify_rx(void *, struct vqueue_info *); +static void pci_vtcon_notify_tx(void *, struct vqueue_info *); +static int pci_vtcon_cfgread(void *, int, int, uint32_t *); +static int pci_vtcon_cfgwrite(void *, int, int, uint32_t); +static void pci_vtcon_neg_features(void *, uint64_t); +static void pci_vtcon_sock_accept(int, enum ev_type, void *); +static void pci_vtcon_sock_rx(int, enum ev_type, void *); +static void pci_vtcon_sock_tx(struct pci_vtcon_port *, void *, struct iovec *, + int); +static void pci_vtcon_control_send(struct pci_vtcon_softc *, + struct pci_vtcon_control *, const void *, size_t); +static void pci_vtcon_announce_port(struct pci_vtcon_port *); +static void pci_vtcon_open_port(struct pci_vtcon_port *, bool); + +static struct virtio_consts vtcon_vi_consts = { + "vtcon", /* our name */ + VTCON_MAXQ, /* we support VTCON_MAXQ virtqueues */ + sizeof(struct pci_vtcon_config), /* config reg size */ + pci_vtcon_reset, /* reset */ + NULL, /* device-wide qnotify */ + pci_vtcon_cfgread, /* read virtio config */ + pci_vtcon_cfgwrite, /* write virtio config */ + pci_vtcon_neg_features, /* apply negotiated features */ + VTCON_S_HOSTCAPS, /* our capabilities */ +}; + + +static void +pci_vtcon_reset(void *vsc) +{ + struct pci_vtcon_softc *sc; + + sc = vsc; + + DPRINTF(("vtcon: device reset requested!\n")); + vi_reset_dev(&sc->vsc_vs); +} + +static void +pci_vtcon_neg_features(void *vsc, uint64_t negotiated_features) +{ + struct pci_vtcon_softc *sc = vsc; + + sc->vsc_features = negotiated_features; +} + +static int +pci_vtcon_cfgread(void *vsc, int offset, int size, uint32_t *retval) +{ + struct pci_vtcon_softc *sc = vsc; + void *ptr; + + ptr = (uint8_t *)sc->vsc_config + offset; + memcpy(retval, ptr, size); + return (0); +} + +static int +pci_vtcon_cfgwrite(void *vsc, int offset, int size, uint32_t val) +{ + + return (0); +} + +static inline struct pci_vtcon_port * +pci_vtcon_vq_to_port(struct pci_vtcon_softc *sc, struct vqueue_info *vq) +{ + uint16_t num = vq->vq_num; + + if (num == 0 || num == 1) + return (&sc->vsc_ports[0]); + + if (num == 2 || num == 3) + return (&sc->vsc_control_port); + + return (&sc->vsc_ports[(num / 2) - 1]); +} + +static inline struct vqueue_info * +pci_vtcon_port_to_vq(struct pci_vtcon_port *port, bool tx_queue) +{ + int qnum; + + qnum = tx_queue ? port->vsp_txq : port->vsp_rxq; + return (&port->vsp_sc->vsc_queues[qnum]); +} + +static struct pci_vtcon_port * +pci_vtcon_port_add(struct pci_vtcon_softc *sc, const char *name, + pci_vtcon_cb_t *cb, void *arg) +{ + struct pci_vtcon_port *port; + + if (sc->vsc_nports == VTCON_MAXPORTS) { + errno = EBUSY; + return (NULL); + } + + port = &sc->vsc_ports[sc->vsc_nports++]; + port->vsp_id = sc->vsc_nports - 1; + port->vsp_sc = sc; + port->vsp_name = name; + port->vsp_cb = cb; + port->vsp_arg = arg; + + if (port->vsp_id == 0) { + /* port0 */ + port->vsp_txq = 0; + port->vsp_rxq = 1; + } else { + port->vsp_txq = sc->vsc_nports * 2; + port->vsp_rxq = port->vsp_txq + 1; + } + + port->vsp_enabled = true; + return (port); +} + +static int +pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const char *name, + const char *path) +{ + struct pci_vtcon_sock *sock; + struct sockaddr_un sun; + int s = -1, fd = -1, error = 0; + + sock = calloc(1, sizeof(struct pci_vtcon_sock)); + if (sock == NULL) { + error = -1; + goto out; + } + + s = socket(AF_UNIX, SOCK_STREAM, 0); + if (s < 0) { + error = -1; + goto out; + } + + fd = open(dirname(path), O_RDONLY | O_DIRECTORY); + if (fd < 0) { + error = -1; + goto out; + } + + sun.sun_family = AF_UNIX; + sun.sun_len = sizeof(struct sockaddr_un); + strncpy(sun.sun_path, basename((char *)path), sizeof(sun.sun_path)); + + if (bindat(fd, s, (struct sockaddr *)&sun, sun.sun_len) < 0) { + error = -1; + goto out; + } + + if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) { + error = -1; + goto out; + } + + if (listen(s, 1) < 0) { + error = -1; + goto out; + } + + + sock->vss_port = pci_vtcon_port_add(sc, name, pci_vtcon_sock_tx, sock); + if (sock->vss_port == NULL) { + error = -1; + goto out; + } + + sock->vss_open = false; + sock->vss_conn_fd = -1; + sock->vss_server_fd = s; + sock->vss_server_evp = mevent_add(s, EVF_READ, pci_vtcon_sock_accept, + sock); + + if (sock->vss_server_evp == NULL) { + error = -1; + goto out; + } + +out: + if (fd != -1) + close(fd); + + if (error != 0 && s != -1) + close(s); + + return (error); +} + +static void +pci_vtcon_sock_accept(int fd __unused, enum ev_type t __unused, void *arg) +{ + struct pci_vtcon_sock *sock = (struct pci_vtcon_sock *)arg; + int s; + + s = accept(sock->vss_server_fd, NULL, NULL); + if (s < 0) + return; + + if (sock->vss_open) { + close(s); + return; + } + + sock->vss_open = true; + sock->vss_conn_fd = s; + sock->vss_conn_evp = mevent_add(s, EVF_READ, pci_vtcon_sock_rx, sock); + pci_vtcon_open_port(sock->vss_port, true); +} + +static void +pci_vtcon_sock_rx(int fd __unused, enum ev_type t __unused, void *arg) +{ + struct pci_vtcon_port *port; + struct pci_vtcon_sock *sock = (struct pci_vtcon_sock *)arg; + struct vqueue_info *vq; + struct iovec iov; + static char dummybuf[2048]; + int len, n; + uint16_t idx; + + port = sock->vss_port; + vq = pci_vtcon_port_to_vq(port, true); + + if (!sock->vss_open || !port->vsp_rx_ready) { + len = read(sock->vss_conn_fd, dummybuf, sizeof(dummybuf)); + if (len == 0) + goto close; + + return; + } + + if (!vq_has_descs(vq)) { + len = read(sock->vss_conn_fd, dummybuf, sizeof(dummybuf)); + vq_endchains(vq, 1); + if (len == 0) + goto close; + + return; + } + + do { + n = vq_getchain(vq, &idx, &iov, 1, NULL); + len = readv(sock->vss_conn_fd, &iov, n); + + if (len == 0 || (len < 0 && errno == EWOULDBLOCK)) { + vq_retchain(vq); + vq_endchains(vq, 0); + if (len == 0) + goto close; + + return; + } + + vq_relchain(vq, idx, len); + } while (vq_has_descs(vq)); + + vq_endchains(vq, 1); + +close: + mevent_delete_close(sock->vss_conn_evp); + sock->vss_conn_fd = -1; + sock->vss_open = false; +} + +static void +pci_vtcon_sock_tx(struct pci_vtcon_port *port, void *arg, struct iovec *iov, + int niov) +{ + struct pci_vtcon_sock *sock; + int ret; + + sock = (struct pci_vtcon_sock *)arg; + + if (sock->vss_conn_fd == -1) + return; + + ret = writev(sock->vss_conn_fd, iov, niov); + + if (ret < 0 && errno != EWOULDBLOCK) { + mevent_delete_close(sock->vss_conn_evp); + sock->vss_conn_fd = -1; + sock->vss_open = false; + } +} + +static void +pci_vtcon_control_tx(struct pci_vtcon_port *port, void *arg, struct iovec *iov, + int niov) +{ + struct pci_vtcon_softc *sc; + struct pci_vtcon_port *tmp; + struct pci_vtcon_control resp, *ctrl; + int i; + + assert(niov == 1); + + sc = port->vsp_sc; + ctrl = (struct pci_vtcon_control *)iov->iov_base; + + switch (ctrl->event) { + case VTCON_DEVICE_READY: + /* set port ready events for registered ports */ + for (i = 0; i < VTCON_MAXPORTS; i++) { + tmp = &sc->vsc_ports[i]; + if (tmp->vsp_enabled) + pci_vtcon_announce_port(tmp); + } + break; + + case VTCON_PORT_READY: + if (ctrl->id >= sc->vsc_nports) { + WPRINTF(("VTCON_PORT_READY event for unknown port %d\n", + ctrl->id)); + return; + } + + tmp = &sc->vsc_ports[ctrl->id]; + if (tmp->vsp_console) { + resp.event = VTCON_CONSOLE_PORT; + resp.id = ctrl->id; + resp.value = 1; + pci_vtcon_control_send(sc, &resp, NULL, 0); + } + break; + } +} + +static void +pci_vtcon_announce_port(struct pci_vtcon_port *port) +{ + struct pci_vtcon_control event; + + event.id = port->vsp_id; + event.event = VTCON_DEVICE_ADD; + event.value = 1; + pci_vtcon_control_send(port->vsp_sc, &event, NULL, 0); + + event.event = VTCON_PORT_NAME; + pci_vtcon_control_send(port->vsp_sc, &event, port->vsp_name, + strlen(port->vsp_name)); +} + +static void +pci_vtcon_open_port(struct pci_vtcon_port *port, bool open) +{ + struct pci_vtcon_control event; + + event.id = port->vsp_id; + event.event = VTCON_PORT_OPEN; + event.value = (int)open; + pci_vtcon_control_send(port->vsp_sc, &event, NULL, 0); +} + +static void +pci_vtcon_control_send(struct pci_vtcon_softc *sc, + struct pci_vtcon_control *ctrl, const void *payload, size_t len) +{ + struct vqueue_info *vq; + struct iovec iov; + uint16_t idx; + int n; + + vq = pci_vtcon_port_to_vq(&sc->vsc_control_port, true); + + if (!vq_has_descs(vq)) + return; + + n = vq_getchain(vq, &idx, &iov, 1, NULL); + + assert(n == 1); + + memcpy(iov.iov_base, ctrl, sizeof(struct pci_vtcon_control)); + if (payload != NULL && len > 0) + memcpy(iov.iov_base + sizeof(struct pci_vtcon_control), + payload, len); + + vq_relchain(vq, idx, sizeof(struct pci_vtcon_control) + len); + vq_endchains(vq, 1); +} + + +static void +pci_vtcon_notify_tx(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtcon_softc *sc; + struct pci_vtcon_port *port; + struct iovec iov[1]; + uint16_t idx, n; + uint16_t flags[8]; + + sc = vsc; + port = pci_vtcon_vq_to_port(sc, vq); + + while (vq_has_descs(vq)) { + n = vq_getchain(vq, &idx, iov, 1, flags); + if (port != NULL) + port->vsp_cb(port, port->vsp_arg, iov, 1); + + /* + * Release this chain and handle more + */ + vq_relchain(vq, idx, 0); + } + vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ +} + +static void +pci_vtcon_notify_rx(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtcon_softc *sc; + struct pci_vtcon_port *port; + + sc = vsc; + port = pci_vtcon_vq_to_port(sc, vq); + + if (!port->vsp_rx_ready) { + port->vsp_rx_ready = 1; + vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + } +} + +static int +pci_vtcon_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + struct pci_vtcon_softc *sc; + char *portname = NULL; + char *portpath = NULL; + char *opt; + int i; + + sc = calloc(1, sizeof(struct pci_vtcon_softc)); + sc->vsc_config = calloc(1, sizeof(struct pci_vtcon_config)); + sc->vsc_config->max_nr_ports = VTCON_MAXPORTS; + sc->vsc_config->cols = 80; + sc->vsc_config->rows = 25; + + vi_softc_linkup(&sc->vsc_vs, &vtcon_vi_consts, sc, pi, sc->vsc_queues); + sc->vsc_vs.vs_mtx = &sc->vsc_mtx; + + for (i = 0; i < VTCON_MAXQ; i++) { + sc->vsc_queues[i].vq_qsize = VTCON_RINGSZ; + sc->vsc_queues[i].vq_notify = i % 2 == 0 + ? pci_vtcon_notify_rx + : pci_vtcon_notify_tx; + } + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_CONSOLE); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_SIMPLECOMM); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_CONSOLE); + pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR); + + if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) + return (1); + vi_set_io_bar(&sc->vsc_vs, 0); + + /* create control port */ + sc->vsc_control_port.vsp_sc = sc; + sc->vsc_control_port.vsp_txq = 2; + sc->vsc_control_port.vsp_rxq = 3; + sc->vsc_control_port.vsp_cb = pci_vtcon_control_tx; + sc->vsc_control_port.vsp_enabled = true; + + while ((opt = strsep(&opts, ",")) != NULL) { + portname = strsep(&opt, "="); + portpath = strdup(opt); + + /* create port */ + if (pci_vtcon_sock_add(sc, portname, portpath) < 0) { + fprintf(stderr, "cannot create port %s: %s\n", + portname, strerror(errno)); + return (1); + } + } + + return (0); +} + +struct pci_devemu pci_de_vcon = { + .pe_emu = "virtio-console", + .pe_init = pci_vtcon_init, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read +}; +PCI_EMUL_SET(pci_de_vcon); Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Sat Sep 17 11:43:51 2016 (r305897) +++ head/usr.sbin/bhyve/virtio.h Sat Sep 17 13:48:01 2016 (r305898) @@ -210,6 +210,7 @@ struct vring_used { #define VIRTIO_DEV_NET 0x1000 #define VIRTIO_DEV_BLOCK 0x1001 #define VIRTIO_DEV_RANDOM 0x1002 +#define VIRTIO_DEV_CONSOLE 0x1003 /* * PCI config space constants. From owner-svn-src-all@freebsd.org Sat Sep 17 14:00:53 2016 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 A7749BDE008; Sat, 17 Sep 2016 14:00:53 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6822A921; Sat, 17 Sep 2016 14:00:53 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HE0qDl097245; Sat, 17 Sep 2016 14:00:52 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HE0qIU097241; Sat, 17 Sep 2016 14:00:52 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609171400.u8HE0qIU097241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 17 Sep 2016 14:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305899 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 14:00:53 -0000 Author: bde Date: Sat Sep 17 14:00:52 2016 New Revision: 305899 URL: https://svnweb.freebsd.org/changeset/base/305899 Log: Remove all kernel uses of pcb_psl, but keep in in the struct to preserve the ABI and API for applications. It was removed in the port to amd64, but was remained as garbage giving a micro-pessimization and spurious single-step traps on i386. pcb_psl was intended to be used just to do a context switch of PSL_I, but this context switch was null in most or all versions, and mis-switching of PSL_T was done instead. Some history: - in 386BSD-0.0, cpu_switch() ran at splhigh() and splhigh() did too much interrupt disabling, so interrupts were hard-disabled across cpu_switch() and too many other places - in 386BSD-0.0-patchkit through FreeBSD-4 and FreeBSD-5 before SMPng, splhigh() did soft interrupt masking, and cpu_switch() was excessively cautious and did a cli at the start and a sti at the end to hard-disable interrupts across the switch - SMPng replaced the spl's and cli's by spinlocks (just sched_lock?), so interrupts were hard-disabled across cpu_switch() and too many other places again - initial attempts to fix this intended to restore some soft interrupt disabling, but to support variations in this cpu_switch() used pushfl/popfl into pcb_psl to avoid hard-coding the assumption that the initial and final states have PSL_I enabled. But the version with soft interrupt disabling wasn't used for long, or was never committed, (except I always used my different version of it for UP) so the pushfl/popl and pcb_psl to hold them have been doing less than nothing for about 14 years. Modified: head/sys/i386/i386/genassym.c head/sys/i386/i386/swtch.s head/sys/i386/i386/vm_machdep.c head/sys/i386/include/pcb.h Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/i386/genassym.c Sat Sep 17 14:00:52 2016 (r305899) @@ -143,7 +143,6 @@ ASSYM(PCB_DR2, offsetof(struct pcb, pcb_ ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3)); ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6)); ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7)); -ASSYM(PCB_PSL, offsetof(struct pcb, pcb_psl)); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext)); Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/i386/swtch.s Sat Sep 17 14:00:52 2016 (r305899) @@ -131,8 +131,6 @@ ENTRY(cpu_switch) movl %esi,PCB_ESI(%edx) movl %edi,PCB_EDI(%edx) mov %gs,PCB_GS(%edx) - pushfl /* PSL */ - popl PCB_PSL(%edx) /* Test if debug registers should be saved. */ testl $PCB_DBREGS,PCB_FLAGS(%edx) jz 1f /* no, skip over */ @@ -261,8 +259,6 @@ sw1: movl PCB_EDI(%edx),%edi movl PCB_EIP(%edx),%eax movl %eax,(%esp) - pushl PCB_PSL(%edx) - popfl movl %edx, PCPU(CURPCB) movl TD_TID(%ecx),%eax @@ -365,8 +361,6 @@ ENTRY(savectx) movl %esi,PCB_ESI(%ecx) movl %edi,PCB_EDI(%ecx) mov %gs,PCB_GS(%ecx) - pushfl - popl PCB_PSL(%ecx) movl %cr0,%eax movl %eax,PCB_CR0(%ecx) Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/i386/vm_machdep.c Sat Sep 17 14:00:52 2016 (r305899) @@ -273,7 +273,6 @@ cpu_fork(td1, p2, td2, flags) pcb2->pcb_esp = (int)td2->td_frame - sizeof(void *); pcb2->pcb_ebx = (int)td2; /* fork_trampoline argument */ pcb2->pcb_eip = (int)fork_trampoline; - pcb2->pcb_psl = PSL_KERNEL; /* ints disabled */ /*- * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. @@ -504,7 +503,6 @@ cpu_copy_thread(struct thread *td, struc pcb2->pcb_esp = (int)td->td_frame - sizeof(void *); /* trampoline arg */ pcb2->pcb_ebx = (int)td; /* trampoline arg */ pcb2->pcb_eip = (int)fork_trampoline; - pcb2->pcb_psl &= ~(PSL_I); /* interrupts must be disabled */ pcb2->pcb_gs = rgs(); /* * If we didn't copy the pcb, we'd need to do the following registers: Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/include/pcb.h Sat Sep 17 14:00:52 2016 (r305899) @@ -89,7 +89,7 @@ struct pcb { caddr_t pcb_onfault; /* copyin/out fault recovery */ struct pcb_ext *pcb_ext; /* optional pcb extension */ - int pcb_psl; /* process status long */ + int pcb_waspsl; /* unused padding for ABI and API compat */ u_long pcb_vm86[2]; /* vm86bios scratch space */ union savefpu *pcb_save; From owner-svn-src-all@freebsd.org Sat Sep 17 14:23:37 2016 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 C399FBDE89E; Sat, 17 Sep 2016 14:23:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 8E578A41; Sat, 17 Sep 2016 14:23:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 5AF1BD468BB; Sun, 18 Sep 2016 00:23:27 +1000 (AEST) Date: Sun, 18 Sep 2016 00:23:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305899 - in head/sys/i386: i386 include In-Reply-To: <201609171400.u8HE0qIU097241@repo.freebsd.org> Message-ID: <20160918000646.S2446@besplex.bde.org> References: <201609171400.u8HE0qIU097241@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=HDxS4Cb_YJLcUxZtNZAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 14:23:37 -0000 On Sat, 17 Sep 2016, Bruce Evans wrote: > Author: bde > Date: Sat Sep 17 14:00:52 2016 > New Revision: 305899 > URL: https://svnweb.freebsd.org/changeset/base/305899 > > Log: > Remove all kernel uses of pcb_psl, but keep in in the struct to > preserve the ABI and API for applications. It was removed in the port > to amd64, but was remained as garbage giving a micro-pessimization and > spurious single-step traps on i386. > ... Actually, I committed a version that breaks the API by renaming the variable. I will leave it like that. pcb_psl is not used anywhere in head/ports, so it is used in at most the externally-maintained part of a port or things like gdb scripts. Bruce From owner-svn-src-all@freebsd.org Sat Sep 17 16:03:34 2016 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 D5F2ABDEF7D; Sat, 17 Sep 2016 16:03:34 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD303CC3; Sat, 17 Sep 2016 16:03:34 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HG3Xrt046517; Sat, 17 Sep 2016 16:03:33 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HG3XAY046516; Sat, 17 Sep 2016 16:03:33 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201609171603.u8HG3XAY046516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 17 Sep 2016 16:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305900 - head/sys/dev/virtio/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 16:03:34 -0000 Author: jceel Date: Sat Sep 17 16:03:33 2016 New Revision: 305900 URL: https://svnweb.freebsd.org/changeset/base/305900 Log: Create aliases for named virtio-console ports. Make virtio_console(4) create `/dev/vtcon/` alias pointing to /dev/ttyVx.y upon receiving PORT_NAME (id = 7) event over the control queue. Approved by: trasz MFC after: 1 month Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D7182 Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Sat Sep 17 14:00:52 2016 (r305899) +++ head/sys/dev/virtio/console/virtio_console.c Sat Sep 17 16:03:33 2016 (r305900) @@ -176,8 +176,10 @@ static void vtcon_ctrl_port_add_event(s static void vtcon_ctrl_port_remove_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_console_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_open_event(struct vtcon_softc *, int); +static void vtcon_ctrl_port_name_event(struct vtcon_softc *, int, + const char *, size_t); static void vtcon_ctrl_process_event(struct vtcon_softc *, - struct virtio_console_control *); + struct virtio_console_control *, void *, size_t); static void vtcon_ctrl_task_cb(void *, int); static void vtcon_ctrl_event_intr(void *); static void vtcon_ctrl_poll(struct vtcon_softc *, @@ -611,8 +613,10 @@ vtcon_ctrl_event_create(struct vtcon_sof struct virtio_console_control *control; int error; - control = malloc(sizeof(struct virtio_console_control), M_DEVBUF, - M_ZERO | M_NOWAIT); + control = malloc( + sizeof(struct virtio_console_control) + VTCON_BULK_BUFSZ, + M_DEVBUF, M_ZERO | M_NOWAIT); + if (control == NULL) return (ENOMEM); @@ -796,8 +800,29 @@ vtcon_ctrl_port_open_event(struct vtcon_ } static void +vtcon_ctrl_port_name_event(struct vtcon_softc *sc, int id, const char *name, + size_t len) +{ + device_t dev; + struct vtcon_softc_port *scport; + struct vtcon_port *port; + + dev = sc->vtcon_dev; + scport = &sc->vtcon_ports[id]; + + port = scport->vcsp_port; + if (port == NULL) { + device_printf(dev, "%s: name port %d, but does not exist\n", + __func__, id); + return; + } + + tty_makealias(port->vtcport_tty, "vtcon/%*s", (int)len, name); +} + +static void vtcon_ctrl_process_event(struct vtcon_softc *sc, - struct virtio_console_control *control) + struct virtio_console_control *control, void *payload, size_t plen) { device_t dev; int id; @@ -831,6 +856,9 @@ vtcon_ctrl_process_event(struct vtcon_so break; case VIRTIO_CONSOLE_PORT_NAME: + if (payload != NULL && plen > 0) + vtcon_ctrl_port_name_event(sc, id, + (const char *)payload, plen); break; } } @@ -842,6 +870,9 @@ vtcon_ctrl_task_cb(void *xsc, int pendin struct virtqueue *vq; struct virtio_console_control *control; int detached; + uint32_t len; + size_t plen; + void *payload; sc = xsc; vq = sc->vtcon_ctrl_rxvq; @@ -849,12 +880,20 @@ vtcon_ctrl_task_cb(void *xsc, int pendin VTCON_LOCK(sc); while ((detached = (sc->vtcon_flags & VTCON_FLAG_DETACHED)) == 0) { - control = virtqueue_dequeue(vq, NULL); + control = virtqueue_dequeue(vq, &len); + payload = NULL; + plen = 0; + if (control == NULL) break; + if (len > sizeof(control)) { + payload = (void *)(control + 1); + plen = len - sizeof(control); + } + VTCON_UNLOCK(sc); - vtcon_ctrl_process_event(sc, control); + vtcon_ctrl_process_event(sc, control, payload, plen); VTCON_LOCK(sc); vtcon_ctrl_event_requeue(sc, control); } From owner-svn-src-all@freebsd.org Sat Sep 17 16:45:58 2016 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 772B4BDE97E; Sat, 17 Sep 2016 16:45:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41CA0146A; Sat, 17 Sep 2016 16:45:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HGjvbX061435; Sat, 17 Sep 2016 16:45:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HGjvDq061432; Sat, 17 Sep 2016 16:45:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609171645.u8HGjvDq061432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 17 Sep 2016 16:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305901 - stable/11/sys/boot/powerpc/boot1.chrp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 16:45:58 -0000 Author: jhibbits Date: Sat Sep 17 16:45:57 2016 New Revision: 305901 URL: https://svnweb.freebsd.org/changeset/base/305901 Log: MFC r305894: Increase the boot1 file size on the HFS boot image. The boot1.elf is too fat for 30k, it's now 32k on powerpc64, and 34k on powerpc. Without this, boot1 will fail with odd behaviors. Modified: stable/11/sys/boot/powerpc/boot1.chrp/Makefile.hfs stable/11/sys/boot/powerpc/boot1.chrp/generate-hfs.sh stable/11/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/powerpc/boot1.chrp/Makefile.hfs ============================================================================== --- stable/11/sys/boot/powerpc/boot1.chrp/Makefile.hfs Sat Sep 17 16:03:33 2016 (r305900) +++ stable/11/sys/boot/powerpc/boot1.chrp/Makefile.hfs Sat Sep 17 16:45:57 2016 (r305901) @@ -1,4 +1,4 @@ # This file autogenerated by generate-hfs.sh - DO NOT EDIT # $FreeBSD$ -BOOTINFO_OFFSET=0x58 +BOOTINFO_OFFSET=0x9c BOOT1_OFFSET=0x1c Modified: stable/11/sys/boot/powerpc/boot1.chrp/generate-hfs.sh ============================================================================== --- stable/11/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Sat Sep 17 16:03:33 2016 (r305900) +++ stable/11/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Sat Sep 17 16:45:57 2016 (r305901) @@ -15,7 +15,7 @@ HFS_SIZE=1600 #Size in 512-byte blocks of the produced image CHRPBOOT_SIZE=2k -BOOT1_SIZE=30k +BOOT1_SIZE=64k # Generate 800K HFS image OUTPUT_FILE=hfs.tmpl Modified: stable/11/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu ============================================================================== --- stable/11/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Sat Sep 17 16:03:33 2016 (r305900) +++ stable/11/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Sat Sep 17 16:45:57 2016 (r305901) @@ -2,17 +2,17 @@ HFS template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 hfs.tmpl.bz2 -M0EIH.3%!62936?(HJX\``"]_]?___O)20>!4M2$>0#MUW$1$``$!$``"2!`( -M4EG``>G*VV3"22334_2(/*>ID,@``:#U&"-#(!IZ0`)$HIY0>B-#(/4T```& -M@R:`&@``<:,F1A&(!A-!@$T&@9,FC)D,(#!4E-*--31ZAB!DT!ID:#$81HT& -M@9-!Z::C:E=SZCC1((92M^1Q@3&>="[<2FD((A[AT#`[('#?MSV(S,>HOI'#2,"EJ0PU5).T`PX,54O,RTW8-",N1`R>?SL"+?Q51[H]# -MJ1C5"]BDBF1UJ!Y`J$WTC]QAFZ%Q21$J,I&0,0?9?DPU!Z>$9.380JJCO$Q8 -MXZTX)GQCCGNC%G1BIDBHTK#J9N0,M[85QC:.'>]#,GPRAALU*=)2`$ND22<. --VK/^+N2*<*$AY%%7'@`` +M0EIH.3%!629365^MV6L``"]__O___M)20>!0O2$>0#MUW$!$``%%$``@``!` +M!`!R2<`![@H2"2A2-Z)-HC]4`:`-``T:&@&@#0/TTH<`PC":8A@$`R`&$:9, +MF$8"&AP#",)IB&`0#(`81IDR81@(:")0HT*>4,:0TT`:!ZC0/*/4/1&@;4>H +M&@RYG-FL-,\=C91FTSS@99`O+OA;*$ZN3-&UF`W@#SP:;MVF_EN,-]P$ZN2B +M=";7YHA7VT!#<@,B`H*?S#?Q;CUJ8H8+9:E)+4"L7'CL5&D.IO4;H98%^4@[ +M9`*L&1``5*0#A(EB8BH`S'1O^N +M)Y6'!#N:*:JYTEX\:%'"?.G$FCP8TM_0/ND`^IG3[ +M.QUEDP&P>3+Z442Q!:S.A1>00]'X'D%)UX9QZ>$Q?(808QB-4%9BBTL"L(BB +MEJ*'HH820Q$'%G':JF.:>$U4H`0S`:GSZM-C5BNX(2&$B"J*45`"4FEZ__%W +))%.%"07ZW9:P ` end From owner-svn-src-all@freebsd.org Sat Sep 17 16:47:36 2016 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 81F4BBDEA16; Sat, 17 Sep 2016 16:47:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2543A1632; Sat, 17 Sep 2016 16:47:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HGlZd2061534; Sat, 17 Sep 2016 16:47:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HGlYEf061527; Sat, 17 Sep 2016 16:47:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609171647.u8HGlYEf061527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Sep 2016 16:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305902 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 16:47:36 -0000 Author: kib Date: Sat Sep 17 16:47:34 2016 New Revision: 305902 URL: https://svnweb.freebsd.org/changeset/base/305902 Log: Reduce size of ufs inode. Remove redunand i_dev and i_fs pointers, which are available as ip->i_ump->um_dev and ip->i_ump->um_fs, and reorder members by size to reduce padding. To compensate added derefences, the most often i_ump access to differentiate between UFS1 and UFS2 dinode layout is removed, by addition of the new i_flag IN_UFS2. Overall, this actually reduces the amount of memory dereferences. On 64bit machine, original struct inode size is 176, reduced to 152 bytes with the change. Tested by: pho (previous version) Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_rawread.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_acl.c head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_gjournal.c head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_quota.c head/sys/ufs/ufs/ufs_vnops.c head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Sep 17 16:47:34 2016 (r305902) @@ -163,13 +163,13 @@ ffs_alloc(ip, lbn, bpref, size, flags, c #endif *bnp = 0; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; mtx_assert(UFS_MTX(ump), MA_OWNED); #ifdef INVARIANTS if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { printf("dev = %s, bsize = %ld, size = %d, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_bsize, size, + devtoname(ump->um_dev), (long)fs->fs_bsize, size, fs->fs_fsmnt); panic("ffs_alloc: bad size"); } @@ -260,9 +260,9 @@ ffs_realloccg(ip, lbprev, bprev, bpref, int64_t delta; vp = ITOV(ip); - fs = ip->i_fs; + ump = ITOUMP(ip); + fs = ump->um_fs; bp = NULL; - ump = ip->i_ump; gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; mtx_assert(UFS_MTX(ump), MA_OWNED); @@ -273,7 +273,7 @@ ffs_realloccg(ip, lbprev, bprev, bpref, (u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) { printf( "dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_bsize, osize, + devtoname(ump->um_dev), (long)fs->fs_bsize, osize, nsize, fs->fs_fsmnt); panic("ffs_realloccg: bad size"); } @@ -288,7 +288,7 @@ retry: } if (bprev == 0) { printf("dev = %s, bsize = %ld, bprev = %jd, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_bsize, (intmax_t)bprev, + devtoname(ump->um_dev), (long)fs->fs_bsize, (intmax_t)bprev, fs->fs_fsmnt); panic("ffs_realloccg: bad bprev"); } @@ -383,7 +383,7 @@ retry: break; default: printf("dev = %s, optim = %ld, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_optim, fs->fs_fsmnt); + devtoname(ump->um_dev), (long)fs->fs_optim, fs->fs_fsmnt); panic("ffs_realloccg: bad optim"); /* NOTREACHED */ } @@ -391,7 +391,7 @@ retry: if (bno > 0) { bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) - ffs_blkfree(ump, fs, ip->i_devvp, bprev, (long)osize, + ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize, ip->i_number, vp->v_type, NULL); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); @@ -490,7 +490,7 @@ ffs_reallocblks(ap) * These devices are flash and therefore work less well with this * optimization. Also skip if reallocblks has been disabled globally. */ - ump = VTOI(ap->a_vp)->i_ump; + ump = ap->a_vp->v_mount->mnt_data; if (ump->um_candelete || doreallocblks == 0) return (ENOSPC); @@ -529,8 +529,8 @@ ffs_reallocblks_ufs1(ap) vp = ap->a_vp; ip = VTOI(vp); - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; /* * If we are not tracking block clusters or if we have less than 4% * free blocks left, then do not attempt to cluster. Running with @@ -727,7 +727,7 @@ ffs_reallocblks_ufs1(ap) #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { if (!DOINGSOFTDEP(vp)) - ffs_blkfree(ump, fs, ip->i_devvp, + ffs_blkfree(ump, fs, ump->um_devvp, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize, ip->i_number, vp->v_type, NULL); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); @@ -778,8 +778,8 @@ ffs_reallocblks_ufs2(ap) vp = ap->a_vp; ip = VTOI(vp); - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; /* * If we are not tracking block clusters or if we have less than 4% * free blocks left, then do not attempt to cluster. Running with @@ -975,7 +975,7 @@ ffs_reallocblks_ufs2(ap) #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { if (!DOINGSOFTDEP(vp)) - ffs_blkfree(ump, fs, ip->i_devvp, + ffs_blkfree(ump, fs, ump->um_devvp, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize, ip->i_number, vp->v_type, NULL); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); @@ -1040,8 +1040,8 @@ ffs_valloc(pvp, mode, cred, vpp) *vpp = NULL; pip = VTOI(pvp); - fs = pip->i_fs; - ump = pip->i_ump; + ump = ITOUMP(pip); + fs = ump->um_fs; UFS_LOCK(ump); reclaimed = 0; @@ -1114,10 +1114,12 @@ dup_alloc: ip->i_flag = 0; (*vpp)->v_vflag = 0; (*vpp)->v_type = VNON; - if (fs->fs_magic == FS_UFS2_MAGIC) + if (fs->fs_magic == FS_UFS2_MAGIC) { (*vpp)->v_op = &ffs_vnodeops2; - else + ip->i_flag |= IN_UFS2; + } else { (*vpp)->v_op = &ffs_vnodeops1; + } return (0); noinodes: if (reclaimed == 0) { @@ -1158,8 +1160,8 @@ ffs_dirpref(pip) u_int mincg, minndir; u_int maxcontigdirs; - mtx_assert(UFS_MTX(pip->i_ump), MA_OWNED); - fs = pip->i_fs; + mtx_assert(UFS_MTX(ITOUMP(pip)), MA_OWNED); + fs = ITOFS(pip); avgifree = fs->fs_cstotal.cs_nifree / fs->fs_ncg; avgbfree = fs->fs_cstotal.cs_nbfree / fs->fs_ncg; @@ -1307,8 +1309,8 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) ufs2_daddr_t pref; KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap")); - mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); - fs = ip->i_fs; + mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); + fs = ITOFS(ip); /* * Allocation of indirect blocks is indicated by passing negative * values in indx: -1 for single indirect, -2 for double indirect, @@ -1412,8 +1414,8 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) ufs2_daddr_t pref; KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap")); - mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); - fs = ip->i_fs; + mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); + fs = ITOFS(ip); /* * Allocation of indirect blocks is indicated by passing negative * values in indx: -1 for single indirect, -2 for double indirect, @@ -1526,12 +1528,12 @@ ffs_hashalloc(ip, cg, pref, size, rsize, ufs2_daddr_t result; u_int i, icg = cg; - mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); + mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); #ifdef INVARIANTS if (ITOV(ip)->v_mount->mnt_kern_flag & MNTK_SUSPENDED) panic("ffs_hashalloc: allocation on suspended filesystem"); #endif - fs = ip->i_fs; + fs = ITOFS(ip); /* * 1: preferred cylinder group */ @@ -1589,8 +1591,8 @@ ffs_fragextend(ip, cg, bprev, osize, nsi int i, error; u_int8_t *blksfree; - ump = ip->i_ump; - fs = ip->i_fs; + ump = ITOUMP(ip); + fs = ump->um_fs; if (fs->fs_cs(fs, cg).cs_nffree < numfrags(fs, nsize - osize)) return (0); frags = numfrags(fs, nsize); @@ -1600,8 +1602,8 @@ ffs_fragextend(ip, cg, bprev, osize, nsi return (0); } UFS_UNLOCK(ump); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, NOCRED, &bp); if (error) goto fail; cgp = (struct cg *)bp->b_data; @@ -1673,13 +1675,13 @@ ffs_alloccg(ip, cg, bpref, size, rsize) int i, allocsiz, error, frags; u_int8_t *blksfree; - ump = ip->i_ump; - fs = ip->i_fs; + ump = ITOUMP(ip); + fs = ump->um_fs; if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize) return (0); UFS_UNLOCK(ump); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, NOCRED, &bp); if (error) goto fail; cgp = (struct cg *)bp->b_data; @@ -1775,8 +1777,8 @@ ffs_alloccgblk(ip, bp, bpref, size) u_int8_t *blksfree; int i, cgbpref; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; mtx_assert(UFS_MTX(ump), MA_OWNED); cgp = (struct cg *)bp->b_data; blksfree = cg_blksfree(cgp); @@ -1861,12 +1863,12 @@ ffs_clusteralloc(ip, cg, bpref, len) int32_t *lp; u_int8_t *blksfree; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; if (fs->fs_maxcluster[cg] < len) return (0); UFS_UNLOCK(ump); - if (bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, + if (bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp)) goto fail_lock; cgp = (struct cg *)bp->b_data; @@ -1965,8 +1967,8 @@ getinobuf(struct inode *ip, u_int cg, u_ { struct fs *fs; - fs = ip->i_fs; - return (getblk(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, + fs = ITOFS(ip); + return (getblk(ITODEVVP(ip), fsbtodb(fs, ino_to_fsba(fs, cg * fs->fs_ipg + cginoblk)), (int)fs->fs_bsize, 0, 0, gbflags)); } @@ -1997,13 +1999,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu int error, start, len, i; u_int32_t old_initediblk; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; check_nifree: if (fs->fs_cs(fs, cg).cs_nifree == 0) return (0); UFS_UNLOCK(ump); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp); if (error) { brelse(bp); @@ -2101,7 +2103,7 @@ gotit: * to it, then leave it unchanged as the other thread * has already set it correctly. */ - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp); UFS_LOCK(ump); ACTIVECLEAR(fs, cg); @@ -2166,7 +2168,8 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size cg = dtog(fs, bno); if (devvp->v_type == VREG) { /* devvp is a snapshot */ - dev = VTOI(devvp)->i_devvp->v_rdev; + MPASS(devvp->v_mount->mnt_data == ump); + dev = ump->um_devvp->v_rdev; cgblkno = fragstoblks(fs, cgtod(fs, cg)); } else { /* devvp is a normal disk device */ @@ -2396,7 +2399,7 @@ ffs_checkblk(ip, bno, size) int i, error, frags, free; u_int8_t *blksfree; - fs = ip->i_fs; + fs = ITOFS(ip); if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { printf("bsize = %ld, size = %ld, fs = %s\n", (long)fs->fs_bsize, size, fs->fs_fsmnt); @@ -2404,7 +2407,7 @@ ffs_checkblk(ip, bno, size) } if ((u_int)bno >= fs->fs_size) panic("ffs_checkblk: bad block %jd", (intmax_t)bno); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, dtog(fs, bno))), + error = bread(ITODEVVP(ip), fsbtodb(fs, cgtod(fs, dtog(fs, bno))), (int)fs->fs_cgsize, NOCRED, &bp); if (error) panic("ffs_checkblk: cg bread failed"); @@ -2438,6 +2441,7 @@ ffs_vfree(pvp, ino, mode) ino_t ino; int mode; { + struct ufsmount *ump; struct inode *ip; if (DOINGSOFTDEP(pvp)) { @@ -2445,8 +2449,8 @@ ffs_vfree(pvp, ino, mode) return (0); } ip = VTOI(pvp); - return (ffs_freefile(ip->i_ump, ip->i_fs, ip->i_devvp, ino, mode, - NULL)); + ump = VFSTOUFS(pvp->v_mount); + return (ffs_freefile(ump, ump->um_fs, ump->um_devvp, ino, mode, NULL)); } /* @@ -2473,7 +2477,8 @@ ffs_freefile(ump, fs, devvp, ino, mode, cg = ino_to_cg(fs, ino); if (devvp->v_type == VREG) { /* devvp is a snapshot */ - dev = VTOI(devvp)->i_devvp->v_rdev; + MPASS(devvp->v_mount->mnt_data == ump); + dev = ump->um_devvp->v_rdev; cgbno = fragstoblks(fs, cgtod(fs, cg)); } else { /* devvp is a normal disk device */ @@ -3056,7 +3061,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; AUDIT_ARG_VNODE1(vp); ip = VTOI(vp); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) error = copyin((void *)(intptr_t)cmd.size, ip->i_din1, sizeof(struct ufs1_dinode)); else @@ -3076,7 +3081,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) error = EPERM; break; } - if (VTOI(vp)->i_ump != ump) { + if (ITOUMP(VTOI(vp)) != ump) { error = EINVAL; break; } @@ -3173,11 +3178,11 @@ buffered_write(fp, uio, active_cred, fla return (EINVAL); } ip = VTOI(vp); - if (ip->i_devvp != devvp) { + if (ITODEVVP(ip) != devvp) { vput(vp); return (EINVAL); } - fs = ip->i_fs; + fs = ITOFS(ip); vput(vp); foffset_lock_uio(fp, uio, flags); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_balloc.c Sat Sep 17 16:47:34 2016 (r305902) @@ -111,8 +111,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t ip = VTOI(vp); dp = ip->i_din1; - fs = ip->i_fs; - ump = ip->i_ump; + fs = ITOFS(ip); + ump = ITOUMP(ip); lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; reclaimed = 0; @@ -548,7 +548,7 @@ fail: } lbns_remfree++; #endif - ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, + ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } return (error); @@ -584,8 +584,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t ip = VTOI(vp); dp = ip->i_din2; - fs = ip->i_fs; - ump = ip->i_ump; + fs = ITOFS(ip); + ump = ITOUMP(ip); lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; reclaimed = 0; @@ -1141,7 +1141,7 @@ fail: } lbns_remfree++; #endif - ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, + ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } return (error); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_inode.c Sat Sep 17 16:47:34 2016 (r305902) @@ -92,8 +92,8 @@ ffs_update(vp, waitfor) if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0) return (0); ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); - fs = ip->i_fs; - if (fs->fs_ronly && ip->i_ump->um_fsckpid == 0) + fs = ITOFS(ip); + if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0) return (0); /* * If we are updating a snapshot and another process is currently @@ -110,7 +110,7 @@ ffs_update(vp, waitfor) if (IS_SNAPSHOT(ip)) flags = GB_LOCK_NOWAIT; loop: - error = breadn_flags(ip->i_devvp, + error = breadn_flags(ITODEVVP(ip), fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int) fs->fs_bsize, 0, 0, 0, NOCRED, flags, &bp); if (error != 0) { @@ -143,7 +143,7 @@ loop: softdep_update_inodeblock(ip, bp, waitfor); else if (ip->i_effnlink != ip->i_nlink) panic("ffs_update: bad link cnt"); - if (ip->i_ump->um_fstype == UFS1) { + if (I_IS_UFS1(ip)) { *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1; /* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */ @@ -197,8 +197,8 @@ ffs_truncate(vp, length, flags, cred) off_t osize; ip = VTOI(vp); - fs = ip->i_fs; - ump = ip->i_ump; + ump = VFSTOUFS(vp->v_mount); + fs = ump->um_fs; bo = &vp->v_bufobj; ASSERT_VOP_LOCKED(vp, "ffs_truncate"); @@ -270,7 +270,7 @@ ffs_truncate(vp, length, flags, cred) for (i = 0; i < NXADDR; i++) { if (oldblks[i] == 0) continue; - ffs_blkfree(ump, fs, ip->i_devvp, oldblks[i], + ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], sblksize(fs, osize, i), ip->i_number, vp->v_type, NULL); } @@ -346,7 +346,7 @@ ffs_truncate(vp, length, flags, cred) if (error) return (error); indiroff = (lbn - NDADDR) % NINDIR(fs); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) blkno = ((ufs1_daddr_t *)(bp->b_data))[indiroff]; else blkno = ((ufs2_daddr_t *)(bp->b_data))[indiroff]; @@ -518,7 +518,7 @@ ffs_truncate(vp, length, flags, cred) blocksreleased += count; if (lastiblock[level] < 0) { DIP_SET(ip, i_ib[level], 0); - ffs_blkfree(ump, fs, ip->i_devvp, bn, + ffs_blkfree(ump, fs, ump->um_devvp, bn, fs->fs_bsize, ip->i_number, vp->v_type, NULL); blocksreleased += nblocks; @@ -539,7 +539,7 @@ ffs_truncate(vp, length, flags, cred) continue; DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); - ffs_blkfree(ump, fs, ip->i_devvp, bn, bsize, ip->i_number, + ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, vp->v_type, NULL); blocksreleased += btodb(bsize); } @@ -571,7 +571,7 @@ ffs_truncate(vp, length, flags, cred) * required for the storage we're keeping. */ bn += numfrags(fs, newspace); - ffs_blkfree(ump, fs, ip->i_devvp, bn, + ffs_blkfree(ump, fs, ump->um_devvp, bn, oldspace - newspace, ip->i_number, vp->v_type, NULL); blocksreleased += btodb(oldspace - newspace); } @@ -630,7 +630,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev ufs2_daddr_t *countp; { struct buf *bp; - struct fs *fs = ip->i_fs; + struct fs *fs; struct vnode *vp; caddr_t copy = NULL; int i, nblocks, error = 0, allerror = 0; @@ -638,7 +638,9 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev ufs2_daddr_t blkcount, factor, blocksreleased = 0; ufs1_daddr_t *bap1 = NULL; ufs2_daddr_t *bap2 = NULL; -# define BAP(ip, i) (((ip)->i_ump->um_fstype == UFS1) ? bap1[i] : bap2[i]) +#define BAP(ip, i) (I_IS_UFS1(ip) ? bap1[i] : bap2[i]) + + fs = ITOFS(ip); /* * Calculate index in current block of last @@ -686,7 +688,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev return (error); } - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) bap1 = (ufs1_daddr_t *)bp->b_data; else bap2 = (ufs2_daddr_t *)bp->b_data; @@ -694,7 +696,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev copy = malloc(fs->fs_bsize, M_TEMP, M_WAITOK); bcopy((caddr_t)bp->b_data, copy, (u_int)fs->fs_bsize); for (i = last + 1; i < NINDIR(fs); i++) - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) bap1[i] = 0; else bap2[i] = 0; @@ -705,7 +707,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev if (error) allerror = error; } - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) bap1 = (ufs1_daddr_t *)copy; else bap2 = (ufs2_daddr_t *)copy; @@ -725,7 +727,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev allerror = error; blocksreleased += blkcount; } - ffs_blkfree(ip->i_ump, fs, ip->i_devvp, nb, fs->fs_bsize, + ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize, ip->i_number, vp->v_type, NULL); blocksreleased += nblocks; } @@ -759,6 +761,6 @@ int ffs_rdonly(struct inode *ip) { - return (ip->i_ump->um_fs->fs_ronly != 0); + return (ITOFS(ip)->fs_ronly != 0); } Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_rawread.c Sat Sep 17 16:47:34 2016 (r305902) @@ -204,7 +204,7 @@ ffs_rawread_readahead(struct vnode *vp, bsize = vp->v_mount->mnt_stat.f_iosize; ip = VTOI(vp); - dp = ip->i_devvp; + dp = ITODEVVP(ip); iolen = ((vm_offset_t) udata) & PAGE_MASK; bp->b_bcount = len; @@ -440,7 +440,7 @@ ffs_rawread(struct vnode *vp, /* Only handle sector aligned reads */ ip = VTOI(vp); - secsize = ip->i_devvp->v_bufobj.bo_bsize; + secsize = ITODEVVP(ip)->v_bufobj.bo_bsize; if ((uio->uio_offset & (secsize - 1)) == 0 && (uio->uio_resid & (secsize - 1)) == 0) { @@ -460,7 +460,7 @@ ffs_rawread(struct vnode *vp, } partialbytes = ((unsigned int) ip->i_size) % - ip->i_fs->fs_bsize; + ITOFS(ip)->fs_bsize; blockbytes = (int) filebytes - partialbytes; if (blockbytes > 0) { skipbytes = uio->uio_resid - Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Sep 17 16:47:34 2016 (r305902) @@ -302,7 +302,7 @@ restart: vp = nd.ni_vp; vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); - devvp = ip->i_devvp; + devvp = ITODEVVP(ip); /* * Allocate and copy the last block contents so as to be able * to set size to that of the filesystem. @@ -587,7 +587,7 @@ loop: } } snaplistsize += 1; - if (xp->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, BLK_NOCOPY, 1); else @@ -620,7 +620,7 @@ loop: goto out1; } xp = VTOI(xvp); - if (xp->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, BLK_NOCOPY, 0); else @@ -706,7 +706,7 @@ out1: TAILQ_FOREACH(xp, &sn->sn_head, i_nextsnap) { if (xp == ip) break; - if (xp->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, fs, snapacct_ufs1, BLK_SNAP, 0); else @@ -735,7 +735,7 @@ out1: * blocks marked as used in the snapshot bitmaps. Also, collect * the list of allocated blocks in i_snapblklist. */ - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) error = expunge_ufs1(vp, ip, copy_fs, mapacct_ufs1, BLK_SNAP, 0); else @@ -887,9 +887,9 @@ cgaccount(cg, vp, nbp, passno) int error, len, loc, indiroff; ip = VTOI(vp); - fs = ip->i_fs; - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, KERNCRED, &bp); + fs = ITOFS(ip); + error = bread(ITODEVVP(ip), fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, KERNCRED, &bp); if (error) { brelse(bp); return (error); @@ -899,7 +899,7 @@ cgaccount(cg, vp, nbp, passno) brelse(bp); return (EIO); } - UFS_LOCK(ip->i_ump); + UFS_LOCK(ITOUMP(ip)); ACTIVESET(fs, cg); /* * Recomputation of summary information might not have been performed @@ -908,7 +908,7 @@ cgaccount(cg, vp, nbp, passno) * fsck is slightly more consistent. */ fs->fs_cs(fs, cg) = cgp->cg_cs; - UFS_UNLOCK(ip->i_ump); + UFS_UNLOCK(ITOUMP(ip)); bcopy(bp->b_data, nbp->b_data, fs->fs_cgsize); if (fs->fs_cgsize < fs->fs_bsize) bzero(&nbp->b_data[fs->fs_cgsize], @@ -952,7 +952,7 @@ cgaccount(cg, vp, nbp, passno) } indiroff = 0; } - if (ip->i_ump->um_fstype == UFS1) { + if (I_IS_UFS1(ip)) { if (ffs_isblock(fs, cg_blksfree(cgp), loc)) ((ufs1_daddr_t *)(ibp->b_data))[indiroff] = BLK_NOCOPY; @@ -1257,7 +1257,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); - ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, + ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, vp->v_type, NULL); } return (0); @@ -1541,7 +1541,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); - ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, + ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, vp->v_type, NULL); } return (0); @@ -1565,7 +1565,7 @@ ffs_snapgone(ip) * Find snapshot in incore list. */ xp = NULL; - sn = ip->i_devvp->v_rdev->si_snapdata; + sn = ITODEVVP(ip)->v_rdev->si_snapdata; if (sn != NULL) TAILQ_FOREACH(xp, &sn->sn_head, i_nextsnap) if (xp == ip) @@ -1578,8 +1578,8 @@ ffs_snapgone(ip) /* * Delete snapshot inode from superblock. Keep list dense. */ - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; UFS_LOCK(ump); for (snaploc = 0; snaploc < FSMAXSNAP; snaploc++) if (fs->fs_snapinum[snaploc] == ip->i_number) @@ -1611,8 +1611,8 @@ ffs_snapremove(vp) struct snapdata *sn; ip = VTOI(vp); - fs = ip->i_fs; - devvp = ip->i_devvp; + fs = ITOFS(ip); + devvp = ITODEVVP(ip); /* * If active, delete from incore list (this snapshot may * already have been in the process of being deleted, so @@ -1646,7 +1646,7 @@ ffs_snapremove(vp) if (dblk == BLK_NOCOPY || dblk == BLK_SNAP) DIP_SET(ip, i_db[blkno], 0); else if ((dblk == blkstofrags(fs, blkno) && - ffs_snapblkfree(fs, ip->i_devvp, dblk, fs->fs_bsize, + ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - btodb(fs->fs_bsize)); @@ -1664,14 +1664,14 @@ ffs_snapremove(vp) else last = fs->fs_size - blkno; for (loc = 0; loc < last; loc++) { - if (ip->i_ump->um_fstype == UFS1) { + if (I_IS_UFS1(ip)) { dblk = ((ufs1_daddr_t *)(ibp->b_data))[loc]; if (dblk == 0) continue; if (dblk == BLK_NOCOPY || dblk == BLK_SNAP) ((ufs1_daddr_t *)(ibp->b_data))[loc]= 0; else if ((dblk == blkstofrags(fs, blkno) && - ffs_snapblkfree(fs, ip->i_devvp, dblk, + ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { ip->i_din1->di_blocks -= @@ -1686,7 +1686,7 @@ ffs_snapremove(vp) if (dblk == BLK_NOCOPY || dblk == BLK_SNAP) ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; else if ((dblk == blkstofrags(fs, blkno) && - ffs_snapblkfree(fs, ip->i_devvp, dblk, + ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { ip->i_din2->di_blocks -= btodb(fs->fs_bsize); ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; @@ -1781,7 +1781,7 @@ retry: if (error) break; indiroff = (lbn - NDADDR) % NINDIR(fs); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) blkno=((ufs1_daddr_t *)(ibp->b_data))[indiroff]; else blkno=((ufs2_daddr_t *)(ibp->b_data))[indiroff]; @@ -1806,7 +1806,7 @@ retry: if (lbn < NDADDR) { DIP_SET(ip, i_db[lbn], BLK_NOCOPY); ip->i_flag |= IN_CHANGE | IN_UPDATE; - } else if (ip->i_ump->um_fstype == UFS1) { + } else if (I_IS_UFS1(ip)) { ((ufs1_daddr_t *)(ibp->b_data))[indiroff] = BLK_NOCOPY; bdwrite(ibp); @@ -1854,7 +1854,7 @@ retry: } if (lbn < NDADDR) { DIP_SET(ip, i_db[lbn], bno); - } else if (ip->i_ump->um_fstype == UFS1) { + } else if (I_IS_UFS1(ip)) { ((ufs1_daddr_t *)(ibp->b_data))[indiroff] = bno; bdwrite(ibp); } else { @@ -2136,7 +2136,7 @@ ffs_bp_snapblk(devvp, bp) sn = devvp->v_rdev->si_snapdata; if (sn == NULL || TAILQ_FIRST(&sn->sn_head) == NULL) return (0); - fs = TAILQ_FIRST(&sn->sn_head)->i_fs; + fs = ITOFS(TAILQ_FIRST(&sn->sn_head)); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; @@ -2263,7 +2263,7 @@ ffs_copyonwrite(devvp, bp) return (0); /* No snapshot */ } ip = TAILQ_FIRST(&sn->sn_head); - fs = ip->i_fs; + fs = ITOFS(ip); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; @@ -2337,7 +2337,7 @@ ffs_copyonwrite(devvp, bp) if (error) break; indiroff = (lbn - NDADDR) % NINDIR(fs); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) blkno=((ufs1_daddr_t *)(ibp->b_data))[indiroff]; else blkno=((ufs2_daddr_t *)(ibp->b_data))[indiroff]; @@ -2493,15 +2493,19 @@ readblock(vp, bp, lbn) { struct inode *ip = VTOI(vp); struct bio *bip; + struct fs *fs; + + ip = VTOI(vp); + fs = ITOFS(ip); bip = g_alloc_bio(); bip->bio_cmd = BIO_READ; - bip->bio_offset = dbtob(fsbtodb(ip->i_fs, blkstofrags(ip->i_fs, lbn))); + bip->bio_offset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn))); bip->bio_data = bp->b_data; bip->bio_length = bp->b_bcount; bip->bio_done = NULL; - g_io_request(bip, ip->i_devvp->v_bufobj.bo_private); + g_io_request(bip, ITODEVVP(ip)->v_bufobj.bo_private); bp->b_error = biowait(bip, "snaprdb"); g_destroy_bio(bip); return (bp->b_error); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Sep 17 16:47:34 2016 (r305902) @@ -3998,7 +3998,7 @@ newjmvref(dp, ino, oldoff, newoff) struct jmvref *jmvref; jmvref = malloc(sizeof(*jmvref), M_JMVREF, M_SOFTDEP_FLAGS); - workitem_alloc(&jmvref->jm_list, D_JMVREF, UFSTOVFS(dp->i_ump)); + workitem_alloc(&jmvref->jm_list, D_JMVREF, ITOVFS(dp)); jmvref->jm_list.wk_state = ATTACHED | DEPCOMPLETE; jmvref->jm_parent = dp->i_number; jmvref->jm_ino = ino; @@ -4025,7 +4025,7 @@ newjremref(struct dirrem *dirrem, struct struct jremref *jremref; jremref = malloc(sizeof(*jremref), M_JREMREF, M_SOFTDEP_FLAGS); - workitem_alloc(&jremref->jr_list, D_JREMREF, UFSTOVFS(dp->i_ump)); + workitem_alloc(&jremref->jr_list, D_JREMREF, ITOVFS(dp)); jremref->jr_state = ATTACHED; newinoref(&jremref->jr_ref, ip->i_number, dp->i_number, diroff, nlink, ip->i_mode); @@ -4061,7 +4061,7 @@ newjaddref(struct inode *dp, ino_t ino, struct jaddref *jaddref; jaddref = malloc(sizeof(*jaddref), M_JADDREF, M_SOFTDEP_FLAGS); - workitem_alloc(&jaddref->ja_list, D_JADDREF, UFSTOVFS(dp->i_ump)); + workitem_alloc(&jaddref->ja_list, D_JADDREF, ITOVFS(dp)); jaddref->ja_state = ATTACHED; jaddref->ja_mkdir = NULL; newinoref(&jaddref->ja_ref, ino, dp->i_number, diroff, nlink, mode); @@ -4649,7 +4649,7 @@ inodedep_lookup_ip(ip) KASSERT(ip->i_nlink >= ip->i_effnlink, ("inodedep_lookup_ip: bad delta")); - (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, + (void) inodedep_lookup(ITOVFS(ip), ip->i_number, DEPALLOC, &inodedep); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked")); @@ -4672,12 +4672,12 @@ softdep_setup_create(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_create called on non-softdep filesystem")); KASSERT(ip->i_nlink == 1, ("softdep_setup_create: Invalid link count.")); dvp = ITOV(dp); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4686,7 +4686,7 @@ softdep_setup_create(dp, ip) ("softdep_setup_create: No addref structure present.")); } softdep_prelink(dvp, NULL); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4704,7 +4704,7 @@ softdep_setup_dotdot_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_dotdot_link called on non-softdep filesystem")); dvp = ITOV(dp); jaddref = NULL; @@ -4715,13 +4715,13 @@ softdep_setup_dotdot_link(dp, ip) if (DOINGSUJ(dvp)) jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET, dp->i_effnlink - 1, dp->i_mode); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(dp); if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4739,20 +4739,20 @@ softdep_setup_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_link called on non-softdep filesystem")); dvp = ITOV(dp); jaddref = NULL; if (DOINGSUJ(dvp)) jaddref = newjaddref(dp, ip->i_number, 0, ip->i_effnlink - 1, ip->i_mode); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(ip); if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4772,7 +4772,7 @@ softdep_setup_mkdir(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_mkdir called on non-softdep filesystem")); dvp = ITOV(dp); dotaddref = dotdotaddref = NULL; @@ -4784,7 +4784,7 @@ softdep_setup_mkdir(dp, ip) dp->i_effnlink - 1, dp->i_mode); dotdotaddref->ja_state |= MKDIR_PARENT; } - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4802,7 +4802,7 @@ softdep_setup_mkdir(dp, ip) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &dotdotaddref->ja_ref, if_deps); softdep_prelink(ITOV(dp), NULL); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4816,14 +4816,14 @@ softdep_setup_rmdir(dp, ip) { struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_rmdir called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 17 18:14:32 2016 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 93281BDE1DC; Sat, 17 Sep 2016 18:14:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 573D13A5; Sat, 17 Sep 2016 18:14:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HIEV0m095615; Sat, 17 Sep 2016 18:14:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HIEVG6095612; Sat, 17 Sep 2016 18:14:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609171814.u8HIEVG6095612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Sep 2016 18:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305903 - in head: lib/libprocstat sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 18:14:32 -0000 Author: kib Date: Sat Sep 17 18:14:31 2016 New Revision: 305903 URL: https://svnweb.freebsd.org/changeset/base/305903 Log: Fix libprocstat build after r305902. - Use _Bool to not require userspace to include stdbool.h. - Make extattr.h usable without vnode_if.h. - Follow i_ump to get cdev pointer. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libprocstat/common_kvm.c head/sys/ufs/ufs/extattr.h head/sys/ufs/ufs/inode.h Modified: head/lib/libprocstat/common_kvm.c ============================================================================== --- head/lib/libprocstat/common_kvm.c Sat Sep 17 16:47:34 2016 (r305902) +++ head/lib/libprocstat/common_kvm.c Sat Sep 17 18:14:31 2016 (r305903) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #undef _KERNEL @@ -88,17 +90,22 @@ int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) { struct inode inode; + struct ufsmount um; if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &inode, sizeof(inode))) { warnx("can't read inode at %p", (void *)VTOI(vp)); return (1); } + if (!kvm_read_all(kd, (unsigned long)inode.i_ump, &um, sizeof(um))) { + warnx("can't read ufsmount at %p", (void *)inode.i_ump); + return (1); + } /* * The st_dev from stat(2) is a dev_t. These kernel structures * contain cdev pointers. We need to convert to dev_t to make * comparisons */ - vn->vn_fsid = dev2udev(kd, inode.i_dev); + vn->vn_fsid = dev2udev(kd, um.um_dev); vn->vn_fileid = inode.i_number; vn->vn_mode = (mode_t)inode.i_mode; vn->vn_size = inode.i_size; Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Sat Sep 17 16:47:34 2016 (r305902) +++ head/sys/ufs/ufs/extattr.h Sat Sep 17 18:14:31 2016 (r305903) @@ -133,6 +133,10 @@ struct ufs_extattr_per_mount { int uepm_flags; }; +struct vop_getextattr_args; +struct vop_deleteextattr_args; +struct vop_setextattr_args; + void ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm); void ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm); int ufs_extattr_start(struct mount *mp, struct thread *td); Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Sat Sep 17 16:47:34 2016 (r305902) +++ head/sys/ufs/ufs/inode.h Sat Sep 17 18:14:31 2016 (r305903) @@ -145,14 +145,14 @@ struct inode { #define ITOFS(ip) (ITOUMP(ip)->um_fs) #define ITOVFS(ip) ((ip)->i_vnode->v_mount) -static inline bool +static inline _Bool I_IS_UFS1(const struct inode *ip) { return ((ip->i_flag & IN_UFS2) == 0); } -static inline bool +static inline _Bool I_IS_UFS2(const struct inode *ip) { From owner-svn-src-all@freebsd.org Sat Sep 17 19:38:57 2016 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 B4AD1BDED82; Sat, 17 Sep 2016 19:38:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9283A2A1; Sat, 17 Sep 2016 19:38:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HJcuS3025998; Sat, 17 Sep 2016 19:38:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HJcumX025995; Sat, 17 Sep 2016 19:38:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609171938.u8HJcumX025995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 17 Sep 2016 19:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r305904 - releng/11.0/sys/boot/powerpc/boot1.chrp 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 19:38:57 -0000 Author: jhibbits Date: Sat Sep 17 19:38:56 2016 New Revision: 305904 URL: https://svnweb.freebsd.org/changeset/base/305904 Log: MF stable/11 r305901: MFC r305894: Increase the boot1 file size on the HFS boot image. The boot1.elf is too fat for 30k, it's now 32k on powerpc64, and 34k on powerpc. Without this, boot1 will fail with odd behaviors. Approved by: re(gjb@) Modified: releng/11.0/sys/boot/powerpc/boot1.chrp/Makefile.hfs releng/11.0/sys/boot/powerpc/boot1.chrp/generate-hfs.sh releng/11.0/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/boot/powerpc/boot1.chrp/Makefile.hfs ============================================================================== --- releng/11.0/sys/boot/powerpc/boot1.chrp/Makefile.hfs Sat Sep 17 18:14:31 2016 (r305903) +++ releng/11.0/sys/boot/powerpc/boot1.chrp/Makefile.hfs Sat Sep 17 19:38:56 2016 (r305904) @@ -1,4 +1,4 @@ # This file autogenerated by generate-hfs.sh - DO NOT EDIT # $FreeBSD$ -BOOTINFO_OFFSET=0x58 +BOOTINFO_OFFSET=0x9c BOOT1_OFFSET=0x1c Modified: releng/11.0/sys/boot/powerpc/boot1.chrp/generate-hfs.sh ============================================================================== --- releng/11.0/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Sat Sep 17 18:14:31 2016 (r305903) +++ releng/11.0/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Sat Sep 17 19:38:56 2016 (r305904) @@ -15,7 +15,7 @@ HFS_SIZE=1600 #Size in 512-byte blocks of the produced image CHRPBOOT_SIZE=2k -BOOT1_SIZE=30k +BOOT1_SIZE=64k # Generate 800K HFS image OUTPUT_FILE=hfs.tmpl Modified: releng/11.0/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu ============================================================================== --- releng/11.0/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Sat Sep 17 18:14:31 2016 (r305903) +++ releng/11.0/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Sat Sep 17 19:38:56 2016 (r305904) @@ -2,17 +2,17 @@ HFS template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 hfs.tmpl.bz2 -M0EIH.3%!62936?(HJX\``"]_]?___O)20>!4M2$>0#MUW$1$``$!$``"2!`( -M4EG``>G*VV3"22334_2(/*>ID,@``:#U&"-#(!IZ0`)$HIY0>B-#(/4T```& -M@R:`&@``<:,F1A&(!A-!@$T&@9,FC)D,(#!4E-*--31ZAB!DT!ID:#$81HT& -M@9-!Z::C:E=SZCC1((92M^1Q@3&>="[<2FD((A[AT#`[('#?MSV(S,>HOI'#2,"EJ0PU5).T`PX,54O,RTW8-",N1`R>?SL"+?Q51[H]# -MJ1C5"]BDBF1UJ!Y`J$WTC]QAFZ%Q21$J,I&0,0?9?DPU!Z>$9.380JJCO$Q8 -MXZTX)GQCCGNC%G1BIDBHTK#J9N0,M[85QC:.'>]#,GPRAALU*=)2`$ND22<. --VK/^+N2*<*$AY%%7'@`` +M0EIH.3%!629365^MV6L``"]__O___M)20>!0O2$>0#MUW$!$``%%$``@``!` +M!`!R2<`![@H2"2A2-Z)-HC]4`:`-``T:&@&@#0/TTH<`PC":8A@$`R`&$:9, +MF$8"&AP#",)IB&`0#(`81IDR81@(:")0HT*>4,:0TT`:!ZC0/*/4/1&@;4>H +M&@RYG-FL-,\=C91FTSS@99`O+OA;*$ZN3-&UF`W@#SP:;MVF_EN,-]P$ZN2B +M=";7YHA7VT!#<@,B`H*?S#?Q;CUJ8H8+9:E)+4"L7'CL5&D.IO4;H98%^4@[ +M9`*L&1``5*0#A(EB8BH`S'1O^N +M)Y6'!#N:*:JYTEX\:%'"?.G$FCP8TM_0/ND`^IG3[ +M.QUEDP&P>3+Z442Q!:S.A1>00]'X'D%)UX9QZ>$Q?(808QB-4%9BBTL"L(BB +MEJ*'HH820Q$'%G':JF.:>$U4H`0S`:GSZM-C5BNX(2&$B"J*45`"4FEZ__%W +))%.%"07ZW9:P ` end From owner-svn-src-all@freebsd.org Sat Sep 17 21:49:12 2016 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 77CE3BDEA23; Sat, 17 Sep 2016 21:49:12 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4741DDDF; Sat, 17 Sep 2016 21:49:12 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HLnBOO074687; Sat, 17 Sep 2016 21:49:11 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HLnBiH074686; Sat, 17 Sep 2016 21:49:11 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201609172149.u8HLnBiH074686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Sat, 17 Sep 2016 21:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305905 - 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.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 21:49:12 -0000 Author: rene (doc,ports committer) Date: Sat Sep 17 21:49:11 2016 New Revision: 305905 URL: https://svnweb.freebsd.org/changeset/base/305905 Log: bapt stepped down from portmgr Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sat Sep 17 19:38:56 2016 (r305904) +++ head/share/misc/organization.dot Sat Sep 17 21:49:11 2016 (r305905) @@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretar doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nmat, swills"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bdrewery,\nmat, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] From owner-svn-src-all@freebsd.org Sat Sep 17 22:13:04 2016 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 9DF6CBDEFA3; Sat, 17 Sep 2016 22:13:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54364ABF; Sat, 17 Sep 2016 22:13:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HMD3pR085805; Sat, 17 Sep 2016 22:13:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HMD3vs085800; Sat, 17 Sep 2016 22:13:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609172213.u8HMD3vs085800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 17 Sep 2016 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305906 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 22:13:04 -0000 Author: np Date: Sat Sep 17 22:13:03 2016 New Revision: 305906 URL: https://svnweb.freebsd.org/changeset/base/305906 Log: cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/adapter.h Sat Sep 17 22:13:03 2016 (r305906) @@ -231,6 +231,7 @@ struct vi_info { int if_flags; uint16_t *rss, *nm_rss; + int smt_idx; /* for convenience */ uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/common/t4_hw.c Sat Sep 17 22:13:03 2016 (r305906) @@ -8100,6 +8100,10 @@ int t4_port_init(struct adapter *adap, i return ret; p->vi[0].viid = ret; + if (chip_id(adap) <= CHELSIO_T5) + p->vi[0].smt_idx = (ret & 0x7f) << 1; + else + p->vi[0].smt_idx = (ret & 0x7f); p->tx_chan = j; p->rx_chan_map = t4_get_mps_bg_map(adap, j); p->lport = j; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/t4_main.c Sat Sep 17 22:13:03 2016 (r305906) @@ -2030,6 +2030,10 @@ vcxgbe_attach(device_t dev) return (-rc); } vi->viid = rc; + if (chip_id(sc) <= CHELSIO_T5) + vi->smt_idx = (rc & 0x7f) << 1; + else + vi->smt_idx = (rc & 0x7f); param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/tom/t4_tom.c Sat Sep 17 22:13:03 2016 (r305906) @@ -538,7 +538,6 @@ select_rcv_wscale(void) } extern int always_keepalive; -#define VIID_SMACIDX(v) (((unsigned int)(v) & 0x7f) << 1) /* * socket so could be a listening socket too. @@ -569,7 +568,7 @@ calc_opt0(struct socket *so, struct vi_i opt0 |= V_L2T_IDX(e->idx); if (vi != NULL) { - opt0 |= V_SMAC_SEL(VIID_SMACIDX(vi->viid)); + opt0 |= V_SMAC_SEL(vi->smt_idx); opt0 |= V_TX_CHAN(vi->pi->tx_chan); } From owner-svn-src-all@freebsd.org Sat Sep 17 22:18:34 2016 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 25A4ABDF027; Sat, 17 Sep 2016 22:18:34 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBA55C86; Sat, 17 Sep 2016 22:18:33 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HMIX4M086012; Sat, 17 Sep 2016 22:18:33 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HMIXIf086011; Sat, 17 Sep 2016 22:18:33 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201609172218.u8HMIXIf086011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 17 Sep 2016 22:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305907 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 22:18:34 -0000 Author: landonf Date: Sat Sep 17 22:18:32 2016 New Revision: 305907 URL: https://svnweb.freebsd.org/changeset/base/305907 Log: bhnd(4): Fix regression in BCM4331 SPROM pin reference counting. In r304870, refcount handling was lifted out into a common OTP/SPROM code path, but the refcount assertions in chipc_disable_sprom_pins() were not updated accordingly; this triggered an assertion on BCM4331 devices when releasing a SPROM pin reservation. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/cores/chipc/chipc.c Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Sep 17 22:13:03 2016 (r305906) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Sep 17 22:18:32 2016 (r305907) @@ -1261,8 +1261,7 @@ chipc_disable_sprom_pins(struct chipc_so return; CHIPC_LOCK_ASSERT(sc, MA_OWNED); - KASSERT(sc->sprom_refcnt != 0, ("sprom pins already disabled")); - KASSERT(sc->sprom_refcnt == 1, ("sprom pins in use")); + KASSERT(sc->sprom_refcnt == 0, ("sprom pins in use")); cctrl = bhnd_bus_read_4(sc->core, CHIPC_CHIPCTRL); From owner-svn-src-all@freebsd.org Sat Sep 17 23:08:50 2016 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 76EB3BDFB28; Sat, 17 Sep 2016 23:08:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 523DA13C4; Sat, 17 Sep 2016 23:08:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HN8nNd004854; Sat, 17 Sep 2016 23:08:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HN8nFm004852; Sat, 17 Sep 2016 23:08:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609172308.u8HN8nFm004852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 17 Sep 2016 23:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305908 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2016 23:08:50 -0000 Author: np Date: Sat Sep 17 23:08:49 2016 New Revision: 305908 URL: https://svnweb.freebsd.org/changeset/base/305908 Log: cxgbe/t4_tom: Update the active/passive open code to support T6. Data path works as-is. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Sat Sep 17 22:18:32 2016 (r305907) +++ head/sys/dev/cxgbe/tom/t4_connect.c Sat Sep 17 23:08:49 2016 (r305908) @@ -277,19 +277,26 @@ t4_init_connect_cpl_handlers(void) static inline int act_open_cpl_size(struct adapter *sc, int isipv6) { - static const int sz_t4[] = { - sizeof (struct cpl_act_open_req), - sizeof (struct cpl_act_open_req6) - }; - static const int sz_t5[] = { - sizeof (struct cpl_t5_act_open_req), - sizeof (struct cpl_t5_act_open_req6) + int idx; + static const int sz_table[3][2] = { + { + sizeof (struct cpl_act_open_req), + sizeof (struct cpl_act_open_req6) + }, + { + sizeof (struct cpl_t5_act_open_req), + sizeof (struct cpl_t5_act_open_req6) + }, + { + sizeof (struct cpl_t6_act_open_req), + sizeof (struct cpl_t6_act_open_req6) + }, }; - if (is_t4(sc)) - return (sz_t4[!!isipv6]); - else - return (sz_t5[!!isipv6]); + MPASS(chip_id(sc) >= CHELSIO_T4); + idx = min(chip_id(sc) - CHELSIO_T4, 2); + + return (sz_table[idx][!!isipv6]); } /* @@ -373,28 +380,32 @@ t4_connect(struct toedev *tod, struct so if (isipv6) { struct cpl_act_open_req6 *cpl = wrtod(wr); + struct cpl_t5_act_open_req6 *cpl5 = (void *)cpl; + struct cpl_t6_act_open_req6 *cpl6 = (void *)cpl; - if ((inp->inp_vflag & INP_IPV6) == 0) { - /* XXX think about this a bit more */ - log(LOG_ERR, - "%s: time to think about AF_INET6 + vflag 0x%x.\n", - __func__, inp->inp_vflag); + if ((inp->inp_vflag & INP_IPV6) == 0) DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - } toep->ce = hold_lip(td, &inp->in6p_laddr); if (toep->ce == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); - if (is_t4(sc)) { + switch (chip_id(sc)) { + case CHELSIO_T4: INIT_TP_WR(cpl, 0); cpl->params = select_ntuple(vi, toep->l2te); - } else { - struct cpl_t5_act_open_req6 *c5 = (void *)cpl; - - INIT_TP_WR(c5, 0); - c5->iss = htobe32(tp->iss); - c5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T5: + INIT_TP_WR(cpl5, 0); + cpl5->iss = htobe32(tp->iss); + cpl5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T6: + default: + INIT_TP_WR(cpl6, 0); + cpl6->iss = htobe32(tp->iss); + cpl6->params = select_ntuple(vi, toep->l2te); + break; } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, qid_atid)); @@ -409,16 +420,25 @@ t4_connect(struct toedev *tod, struct so cpl->opt2 = calc_opt2a(so, toep); } else { struct cpl_act_open_req *cpl = wrtod(wr); + struct cpl_t5_act_open_req *cpl5 = (void *)cpl; + struct cpl_t6_act_open_req *cpl6 = (void *)cpl; - if (is_t4(sc)) { + switch (chip_id(sc)) { + case CHELSIO_T4: INIT_TP_WR(cpl, 0); cpl->params = select_ntuple(vi, toep->l2te); - } else { - struct cpl_t5_act_open_req *c5 = (void *)cpl; - - INIT_TP_WR(c5, 0); - c5->iss = htobe32(tp->iss); - c5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T5: + INIT_TP_WR(cpl5, 0); + cpl5->iss = htobe32(tp->iss); + cpl5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T6: + default: + INIT_TP_WR(cpl6, 0); + cpl6->iss = htobe32(tp->iss); + cpl6->params = select_ntuple(vi, toep->l2te); + break; } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, qid_atid)); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Sat Sep 17 22:18:32 2016 (r305907) +++ head/sys/dev/cxgbe/tom/t4_listen.c Sat Sep 17 23:08:49 2016 (r305908) @@ -694,7 +694,7 @@ t4_syncache_respond(struct toedev *tod, synqe->iss = be32toh(th->th_seq); synqe->ts = to.to_tsval; - if (is_t5(sc)) { + if (chip_id(sc) >= CHELSIO_T5) { struct cpl_t5_pass_accept_rpl *rpl5 = wrtod(wr); rpl5->iss = th->th_seq; @@ -1053,8 +1053,8 @@ calc_opt2p(struct adapter *sc, struct po } static void -pass_accept_req_to_protohdrs(const struct mbuf *m, struct in_conninfo *inc, - struct tcphdr *th) +pass_accept_req_to_protohdrs(struct adapter *sc, const struct mbuf *m, + struct in_conninfo *inc, struct tcphdr *th) { const struct cpl_pass_accept_req *cpl = mtod(m, const void *); const struct ether_header *eh; @@ -1063,8 +1063,13 @@ pass_accept_req_to_protohdrs(const struc const struct tcphdr *tcp; eh = (const void *)(cpl + 1); - l3hdr = ((uintptr_t)eh + G_ETH_HDR_LEN(hlen)); - tcp = (const void *)(l3hdr + G_IP_HDR_LEN(hlen)); + if (chip_id(sc) >= CHELSIO_T6) { + l3hdr = ((uintptr_t)eh + G_T6_ETH_HDR_LEN(hlen)); + tcp = (const void *)(l3hdr + G_T6_IP_HDR_LEN(hlen)); + } else { + l3hdr = ((uintptr_t)eh + G_ETH_HDR_LEN(hlen)); + tcp = (const void *)(l3hdr + G_IP_HDR_LEN(hlen)); + } if (inc) { bzero(inc, sizeof(*inc)); @@ -1188,7 +1193,7 @@ do_pass_accept_req(struct sge_iq *iq, co CTR4(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p", __func__, stid, tid, lctx); - pass_accept_req_to_protohdrs(m, &inc, &th); + pass_accept_req_to_protohdrs(sc, m, &inc, &th); t4opt_to_tcpopt(&cpl->tcpopt, &to); pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; @@ -1427,14 +1432,14 @@ reject: } static void -synqe_to_protohdrs(struct synq_entry *synqe, +synqe_to_protohdrs(struct adapter *sc, struct synq_entry *synqe, const struct cpl_pass_establish *cpl, struct in_conninfo *inc, struct tcphdr *th, struct tcpopt *to) { uint16_t tcp_opt = be16toh(cpl->tcp_opt); /* start off with the original SYN */ - pass_accept_req_to_protohdrs(synqe->syn, inc, th); + pass_accept_req_to_protohdrs(sc, synqe->syn, inc, th); /* modify parts to make it look like the ACK to our SYN|ACK */ th->th_flags = TH_ACK; @@ -1536,7 +1541,7 @@ reset: KASSERT(so != NULL, ("%s: socket is NULL", __func__)); /* Come up with something that syncache_expand should be ok with. */ - synqe_to_protohdrs(synqe, cpl, &inc, &th, &to); + synqe_to_protohdrs(sc, synqe, cpl, &inc, &th, &to); /* * No more need for anything in the mbuf that carried the